hoodcms 6.0.4 → 6.0.7

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/js/app.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * hoodcms v6.0.4
2
+ * hoodcms v6.0.7
3
3
  * A fully customisable content management system built in ASP.NET Core 5 & Bootstrap 5.
4
4
  * Written by George Whysall, 2022
5
5
  * Released under the GPL-3.0 License.
@@ -23,19 +23,19 @@ var extendStatics=function(t,e){return extendStatics=Object.setPrototypeOf||{__p
23
23
  function getDefaultExportFromCjs (x) {
24
24
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
25
25
  }var pickr_min = {exports: {}};/*! Pickr 1.8.2 MIT | https://github.com/Simonwep/pickr */
26
- !function(t,e){var o;o=function(){return (()=>{var t={d:(e,o)=>{for(var n in o)t.o(o,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:o[n]});},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0});}},e={};t.d(e,{default:()=>E});var o={};function n(t,e,o,n,i={}){e instanceof HTMLCollection||e instanceof NodeList?e=Array.from(e):Array.isArray(e)||(e=[e]),Array.isArray(o)||(o=[o]);for(const s of e)for(const e of o)s[t](e,n,{capture:!1,...i});return Array.prototype.slice.call(arguments,1)}t.r(o),t.d(o,{adjustableInputNumbers:()=>p,createElementFromString:()=>r,createFromTemplate:()=>a,eventPath:()=>l,off:()=>s,on:()=>i,resolveElement:()=>c});const i=n.bind(null,"addEventListener"),s=n.bind(null,"removeEventListener");function r(t){const e=document.createElement("div");return e.innerHTML=t.trim(),e.firstElementChild}function a(t){const e=(t,e)=>{const o=t.getAttribute(e);return t.removeAttribute(e),o},o=(t,n={})=>{const i=e(t,":obj"),s=e(t,":ref"),r=i?n[i]={}:n;s&&(n[s]=t);for(const n of Array.from(t.children)){const t=e(n,":arr"),i=o(n,t?{}:r);t&&(r[t]||(r[t]=[])).push(Object.keys(i).length?i:n);}return n};return o(r(t))}function l(t){let e=t.path||t.composedPath&&t.composedPath();if(e)return e;let o=t.target.parentElement;for(e=[t.target,o];o=o.parentElement;)e.push(o);return e.push(document,window),e}function c(t){return t instanceof Element?t:"string"==typeof t?t.split(/>>/g).reduce(((t,e,o,n)=>(t=t.querySelector(e),o<n.length-1?t.shadowRoot:t)),document):null}function p(t,e=(t=>t)){function o(o){const n=[.001,.01,.1][Number(o.shiftKey||2*o.ctrlKey)]*(o.deltaY<0?1:-1);let i=0,s=t.selectionStart;t.value=t.value.replace(/[\d.]+/g,((t,o)=>o<=s&&o+t.length>=s?(s=o,e(Number(t),n,i)):(i++,t))),t.focus(),t.setSelectionRange(s,s),o.preventDefault(),t.dispatchEvent(new Event("input"));}i(t,"focus",(()=>i(window,"wheel",o,{passive:!1}))),i(t,"blur",(()=>s(window,"wheel",o)));}const{min:u,max:h,floor:d,round:m}=Math;function f(t,e,o){e/=100,o/=100;const n=d(t=t/360*6),i=t-n,s=o*(1-e),r=o*(1-i*e),a=o*(1-(1-i)*e),l=n%6;return [255*[o,r,s,s,a,o][l],255*[a,o,o,r,s,s][l],255*[s,s,a,o,o,r][l]]}function v(t,e,o){const n=(2-(e/=100))*(o/=100)/2;return 0!==n&&(e=1===n?0:n<.5?e*o/(2*n):e*o/(2-2*n)),[t,100*e,100*n]}function b(t,e,o){const n=u(t/=255,e/=255,o/=255),i=h(t,e,o),s=i-n;let r,a;if(0===s)r=a=0;else {a=s/i;const n=((i-t)/6+s/2)/s,l=((i-e)/6+s/2)/s,c=((i-o)/6+s/2)/s;t===i?r=c-l:e===i?r=1/3+n-c:o===i&&(r=2/3+l-n),r<0?r+=1:r>1&&(r-=1);}return [360*r,100*a,100*i]}function _(t,e,o,n){return e/=100,o/=100,[...b(255*(1-u(1,(t/=100)*(1-(n/=100))+n)),255*(1-u(1,e*(1-n)+n)),255*(1-u(1,o*(1-n)+n)))]}function g(t,e,o){e/=100;const n=2*(e*=(o/=100)<.5?o:1-o)/(o+e)*100,i=100*(o+e);return [t,isNaN(n)?0:n,i]}function y(t){return b(...t.match(/.{2}/g).map((t=>parseInt(t,16))))}function w(t=0,e=0,o=0,n=1){const i=(t,e)=>(o=-1)=>e(~o?t.map((t=>Number(t.toFixed(o)))):t),s={h:t,s:e,v:o,a:n,toHSVA(){const t=[s.h,s.s,s.v,s.a];return t.toString=i(t,(t=>`hsva(${t[0]}, ${t[1]}%, ${t[2]}%, ${s.a})`)),t},toHSLA(){const t=[...v(s.h,s.s,s.v),s.a];return t.toString=i(t,(t=>`hsla(${t[0]}, ${t[1]}%, ${t[2]}%, ${s.a})`)),t},toRGBA(){const t=[...f(s.h,s.s,s.v),s.a];return t.toString=i(t,(t=>`rgba(${t[0]}, ${t[1]}, ${t[2]}, ${s.a})`)),t},toCMYK(){const t=function(t,e,o){const n=f(t,e,o),i=n[0]/255,s=n[1]/255,r=n[2]/255,a=u(1-i,1-s,1-r);return [100*(1===a?0:(1-i-a)/(1-a)),100*(1===a?0:(1-s-a)/(1-a)),100*(1===a?0:(1-r-a)/(1-a)),100*a]}(s.h,s.s,s.v);return t.toString=i(t,(t=>`cmyk(${t[0]}%, ${t[1]}%, ${t[2]}%, ${t[3]}%)`)),t},toHEXA(){const t=function(t,e,o){return f(t,e,o).map((t=>m(t).toString(16).padStart(2,"0")))}(s.h,s.s,s.v),e=s.a>=1?"":Number((255*s.a).toFixed(0)).toString(16).toUpperCase().padStart(2,"0");return e&&t.push(e),t.toString=()=>`#${t.join("").toUpperCase()}`,t},clone:()=>w(s.h,s.s,s.v,s.a)};return s}const A=t=>Math.max(Math.min(t,1),0);function k(t){const e={options:Object.assign({lock:null,onchange:()=>0,onstop:()=>0},t),_keyboard(t){const{options:o}=e,{type:n,key:i}=t;if(document.activeElement===o.wrapper){const{lock:o}=e.options,s="ArrowUp"===i,r="ArrowRight"===i,a="ArrowDown"===i,l="ArrowLeft"===i;if("keydown"===n&&(s||r||a||l)){let n=0,i=0;"v"===o?n=s||r?1:-1:"h"===o?n=s||r?-1:1:(i=s?-1:a?1:0,n=l?-1:r?1:0),e.update(A(e.cache.x+.01*n),A(e.cache.y+.01*i)),t.preventDefault();}else i.startsWith("Arrow")&&(e.options.onstop(),t.preventDefault());}},_tapstart(t){i(document,["mouseup","touchend","touchcancel"],e._tapstop),i(document,["mousemove","touchmove"],e._tapmove),t.cancelable&&t.preventDefault(),e._tapmove(t);},_tapmove(t){const{options:o,cache:n}=e,{lock:i,element:s,wrapper:r}=o,a=r.getBoundingClientRect();let l=0,c=0;if(t){const e=t&&t.touches&&t.touches[0];l=t?(e||t).clientX:0,c=t?(e||t).clientY:0,l<a.left?l=a.left:l>a.left+a.width&&(l=a.left+a.width),c<a.top?c=a.top:c>a.top+a.height&&(c=a.top+a.height),l-=a.left,c-=a.top;}else n&&(l=n.x*a.width,c=n.y*a.height);"h"!==i&&(s.style.left=`calc(${l/a.width*100}% - ${s.offsetWidth/2}px)`),"v"!==i&&(s.style.top=`calc(${c/a.height*100}% - ${s.offsetHeight/2}px)`),e.cache={x:l/a.width,y:c/a.height};const p=A(l/a.width),u=A(c/a.height);switch(i){case"v":return o.onchange(p);case"h":return o.onchange(u);default:return o.onchange(p,u)}},_tapstop(){e.options.onstop(),s(document,["mouseup","touchend","touchcancel"],e._tapstop),s(document,["mousemove","touchmove"],e._tapmove);},trigger(){e._tapmove();},update(t=0,o=0){const{left:n,top:i,width:s,height:r}=e.options.wrapper.getBoundingClientRect();"h"===e.options.lock&&(o=t),e._tapmove({clientX:n+s*t,clientY:i+r*o});},destroy(){const{options:t,_tapstart:o,_keyboard:n}=e;s(document,["keydown","keyup"],n),s([t.wrapper,t.element],"mousedown",o),s([t.wrapper,t.element],"touchstart",o,{passive:!1});}},{options:o,_tapstart:n,_keyboard:r}=e;return i([o.wrapper,o.element],"mousedown",n),i([o.wrapper,o.element],"touchstart",n,{passive:!1}),i(document,["keydown","keyup"],r),e}function C(t={}){t=Object.assign({onchange:()=>0,className:"",elements:[]},t);const e=i(t.elements,"click",(e=>{t.elements.forEach((o=>o.classList[e.target===o?"add":"remove"](t.className))),t.onchange(e),e.stopPropagation();}));return {destroy:()=>s(...e)}}const $={variantFlipOrder:{start:"sme",middle:"mse",end:"ems"},positionFlipOrder:{top:"tbrl",right:"rltb",bottom:"btrl",left:"lrbt"},position:"bottom",margin:8};function S(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}class E{constructor(t){S(this,"_initializingActive",!0),S(this,"_recalc",!0),S(this,"_nanopop",null),S(this,"_root",null),S(this,"_color",w()),S(this,"_lastColor",w()),S(this,"_swatchColors",[]),S(this,"_setupAnimationFrame",null),S(this,"_eventListener",{init:[],save:[],hide:[],show:[],clear:[],change:[],changestop:[],cancel:[],swatchselect:[]}),this.options=t=Object.assign({...E.DEFAULT_OPTIONS},t);const{swatches:e,components:o,theme:n,sliders:i,lockOpacity:s,padding:r}=t;["nano","monolith"].includes(n)&&!i&&(t.sliders="h"),o.interaction||(o.interaction={});const{preview:a,opacity:l,hue:c,palette:p}=o;o.opacity=!s&&l,o.palette=p||a||l||c,this._preBuild(),this._buildComponents(),this._bindEvents(),this._finalBuild(),e&&e.length&&e.forEach((t=>this.addSwatch(t)));const{button:u,app:h}=this._root;this._nanopop=((t,e,o)=>{const n="object"!=typeof t||t instanceof HTMLElement?{reference:t,popper:e,...o}:t;return {update(t=n){const{reference:e,popper:o}=Object.assign(n,t);if(!o||!e)throw new Error("Popper- or reference-element missing.");return ((t,e,o)=>{const{container:n,margin:i,position:s,variantFlipOrder:r,positionFlipOrder:a}={container:document.documentElement.getBoundingClientRect(),...$,...o},{left:l,top:c}=e.style;e.style.left="0",e.style.top="0";const p=t.getBoundingClientRect(),u=e.getBoundingClientRect(),h={t:p.top-u.height-i,b:p.bottom+i,r:p.right+i,l:p.left-u.width-i},d={vs:p.left,vm:p.left+p.width/2+-u.width/2,ve:p.left+p.width-u.width,hs:p.top,hm:p.bottom-p.height/2-u.height/2,he:p.bottom-u.height},[m,f="middle"]=s.split("-"),v=a[m],b=r[f],{top:_,left:g,bottom:y,right:w}=n;for(const t of v){const o="t"===t||"b"===t,n=h[t],[i,s]=o?["top","left"]:["left","top"],[r,a]=o?[u.height,u.width]:[u.width,u.height],[l,c]=o?[y,w]:[w,y],[p,m]=o?[_,g]:[g,_];if(!(n<p||n+r>l))for(const r of b){const l=d[(o?"v":"h")+r];if(!(l<m||l+a>c))return e.style[s]=l-u[s]+"px",e.style[i]=n-u[i]+"px",t+r}}return e.style.left=l,e.style.top=c,null})(e,o,n)}}})(u,h,{margin:r}),u.setAttribute("role","button"),u.setAttribute("aria-label",this._t("btn:toggle"));const d=this;this._setupAnimationFrame=requestAnimationFrame((function e(){if(!h.offsetWidth)return requestAnimationFrame(e);d.setColor(t.default),d._rePositioningPicker(),t.defaultRepresentation&&(d._representation=t.defaultRepresentation,d.setColorRepresentation(d._representation)),t.showAlways&&d.show(),d._initializingActive=!1,d._emit("init");}));}_preBuild(){const{options:t}=this;for(const e of ["el","container"])t[e]=c(t[e]);this._root=(t=>{const{components:e,useAsButton:o,inline:n,appClass:i,theme:s,lockOpacity:r}=t.options,l=t=>t?"":'style="display:none" hidden',c=e=>t._t(e),p=a(`\n <div :ref="root" class="pickr">\n\n ${o?"":'<button type="button" :ref="button" class="pcr-button"></button>'}\n\n <div :ref="app" class="pcr-app ${i||""}" data-theme="${s}" ${n?'style="position: unset"':""} aria-label="${c("ui:dialog")}" role="window">\n <div class="pcr-selection" ${l(e.palette)}>\n <div :obj="preview" class="pcr-color-preview" ${l(e.preview)}>\n <button type="button" :ref="lastColor" class="pcr-last-color" aria-label="${c("btn:last-color")}"></button>\n <div :ref="currentColor" class="pcr-current-color"></div>\n </div>\n\n <div :obj="palette" class="pcr-color-palette">\n <div :ref="picker" class="pcr-picker"></div>\n <div :ref="palette" class="pcr-palette" tabindex="0" aria-label="${c("aria:palette")}" role="listbox"></div>\n </div>\n\n <div :obj="hue" class="pcr-color-chooser" ${l(e.hue)}>\n <div :ref="picker" class="pcr-picker"></div>\n <div :ref="slider" class="pcr-hue pcr-slider" tabindex="0" aria-label="${c("aria:hue")}" role="slider"></div>\n </div>\n\n <div :obj="opacity" class="pcr-color-opacity" ${l(e.opacity)}>\n <div :ref="picker" class="pcr-picker"></div>\n <div :ref="slider" class="pcr-opacity pcr-slider" tabindex="0" aria-label="${c("aria:opacity")}" role="slider"></div>\n </div>\n </div>\n\n <div class="pcr-swatches ${e.palette?"":"pcr-last"}" :ref="swatches"></div>\n\n <div :obj="interaction" class="pcr-interaction" ${l(Object.keys(e.interaction).length)}>\n <input :ref="result" class="pcr-result" type="text" spellcheck="false" ${l(e.interaction.input)} aria-label="${c("aria:input")}">\n\n <input :arr="options" class="pcr-type" data-type="HEXA" value="${r?"HEX":"HEXA"}" type="button" ${l(e.interaction.hex)}>\n <input :arr="options" class="pcr-type" data-type="RGBA" value="${r?"RGB":"RGBA"}" type="button" ${l(e.interaction.rgba)}>\n <input :arr="options" class="pcr-type" data-type="HSLA" value="${r?"HSL":"HSLA"}" type="button" ${l(e.interaction.hsla)}>\n <input :arr="options" class="pcr-type" data-type="HSVA" value="${r?"HSV":"HSVA"}" type="button" ${l(e.interaction.hsva)}>\n <input :arr="options" class="pcr-type" data-type="CMYK" value="CMYK" type="button" ${l(e.interaction.cmyk)}>\n\n <input :ref="save" class="pcr-save" value="${c("btn:save")}" type="button" ${l(e.interaction.save)} aria-label="${c("aria:btn:save")}">\n <input :ref="cancel" class="pcr-cancel" value="${c("btn:cancel")}" type="button" ${l(e.interaction.cancel)} aria-label="${c("aria:btn:cancel")}">\n <input :ref="clear" class="pcr-clear" value="${c("btn:clear")}" type="button" ${l(e.interaction.clear)} aria-label="${c("aria:btn:clear")}">\n </div>\n </div>\n </div>\n `),u=p.interaction;return u.options.find((t=>!t.hidden&&!t.classList.add("active"))),u.type=()=>u.options.find((t=>t.classList.contains("active"))),p})(this),t.useAsButton&&(this._root.button=t.el),t.container.appendChild(this._root.root);}_finalBuild(){const t=this.options,e=this._root;if(t.container.removeChild(e.root),t.inline){const o=t.el.parentElement;t.el.nextSibling?o.insertBefore(e.app,t.el.nextSibling):o.appendChild(e.app);}else t.container.appendChild(e.app);t.useAsButton?t.inline&&t.el.remove():t.el.parentNode.replaceChild(e.root,t.el),t.disabled&&this.disable(),t.comparison||(e.button.style.transition="none",t.useAsButton||(e.preview.lastColor.style.transition="none")),this.hide();}_buildComponents(){const t=this,e=this.options.components,o=(t.options.sliders||"v").repeat(2),[n,i]=o.match(/^[vh]+$/g)?o:[],s=()=>this._color||(this._color=this._lastColor.clone()),r={palette:k({element:t._root.palette.picker,wrapper:t._root.palette.palette,onstop:()=>t._emit("changestop","slider",t),onchange(o,n){if(!e.palette)return;const i=s(),{_root:r,options:a}=t,{lastColor:l,currentColor:c}=r.preview;t._recalc&&(i.s=100*o,i.v=100-100*n,i.v<0&&(i.v=0),t._updateOutput("slider"));const p=i.toRGBA().toString(0);this.element.style.background=p,this.wrapper.style.background=`\n linear-gradient(to top, rgba(0, 0, 0, ${i.a}), transparent),\n linear-gradient(to left, hsla(${i.h}, 100%, 50%, ${i.a}), rgba(255, 255, 255, ${i.a}))\n `,a.comparison?a.useAsButton||t._lastColor||l.style.setProperty("--pcr-color",p):(r.button.style.setProperty("--pcr-color",p),r.button.classList.remove("clear"));const u=i.toHEXA().toString();for(const{el:e,color:o}of t._swatchColors)e.classList[u===o.toHEXA().toString()?"add":"remove"]("pcr-active");c.style.setProperty("--pcr-color",p);}}),hue:k({lock:"v"===i?"h":"v",element:t._root.hue.picker,wrapper:t._root.hue.slider,onstop:()=>t._emit("changestop","slider",t),onchange(o){if(!e.hue||!e.palette)return;const n=s();t._recalc&&(n.h=360*o),this.element.style.backgroundColor=`hsl(${n.h}, 100%, 50%)`,r.palette.trigger();}}),opacity:k({lock:"v"===n?"h":"v",element:t._root.opacity.picker,wrapper:t._root.opacity.slider,onstop:()=>t._emit("changestop","slider",t),onchange(o){if(!e.opacity||!e.palette)return;const n=s();t._recalc&&(n.a=Math.round(100*o)/100),this.element.style.background=`rgba(0, 0, 0, ${n.a})`,r.palette.trigger();}}),selectable:C({elements:t._root.interaction.options,className:"active",onchange(e){t._representation=e.target.getAttribute("data-type").toUpperCase(),t._recalc&&t._updateOutput("swatch");}})};this._components=r;}_bindEvents(){const{_root:t,options:e}=this,o=[i(t.interaction.clear,"click",(()=>this._clearColor())),i([t.interaction.cancel,t.preview.lastColor],"click",(()=>{this.setHSVA(...(this._lastColor||this._color).toHSVA(),!0),this._emit("cancel");})),i(t.interaction.save,"click",(()=>{!this.applyColor()&&!e.showAlways&&this.hide();})),i(t.interaction.result,["keyup","input"],(t=>{this.setColor(t.target.value,!0)&&!this._initializingActive&&(this._emit("change",this._color,"input",this),this._emit("changestop","input",this)),t.stopImmediatePropagation();})),i(t.interaction.result,["focus","blur"],(t=>{this._recalc="blur"===t.type,this._recalc&&this._updateOutput(null);})),i([t.palette.palette,t.palette.picker,t.hue.slider,t.hue.picker,t.opacity.slider,t.opacity.picker],["mousedown","touchstart"],(()=>this._recalc=!0),{passive:!0})];if(!e.showAlways){const n=e.closeWithKey;o.push(i(t.button,"click",(()=>this.isOpen()?this.hide():this.show())),i(document,"keyup",(t=>this.isOpen()&&(t.key===n||t.code===n)&&this.hide())),i(document,["touchstart","mousedown"],(e=>{this.isOpen()&&!l(e).some((e=>e===t.app||e===t.button))&&this.hide();}),{capture:!0}));}if(e.adjustableNumbers){const e={rgba:[255,255,255,1],hsva:[360,100,100,1],hsla:[360,100,100,1],cmyk:[100,100,100,100]};p(t.interaction.result,((t,o,n)=>{const i=e[this.getColorRepresentation().toLowerCase()];if(i){const e=i[n],s=t+(e>=100?1e3*o:o);return s<=0?0:Number((s<e?s:e).toPrecision(3))}return t}));}if(e.autoReposition&&!e.inline){let t=null;const n=this;o.push(i(window,["scroll","resize"],(()=>{n.isOpen()&&(e.closeOnScroll&&n.hide(),null===t?(t=setTimeout((()=>t=null),100),requestAnimationFrame((function e(){n._rePositioningPicker(),null!==t&&requestAnimationFrame(e);}))):(clearTimeout(t),t=setTimeout((()=>t=null),100)));}),{capture:!0}));}this._eventBindings=o;}_rePositioningPicker(){const{options:t}=this;if(!t.inline&&!this._nanopop.update({container:document.body.getBoundingClientRect(),position:t.position})){const t=this._root.app,e=t.getBoundingClientRect();t.style.top=(window.innerHeight-e.height)/2+"px",t.style.left=(window.innerWidth-e.width)/2+"px";}}_updateOutput(t){const{_root:e,_color:o,options:n}=this;if(e.interaction.type()){const t=`to${e.interaction.type().getAttribute("data-type")}`;e.interaction.result.value="function"==typeof o[t]?o[t]().toString(n.outputPrecision):"";}!this._initializingActive&&this._recalc&&this._emit("change",o,t,this);}_clearColor(t=!1){const{_root:e,options:o}=this;o.useAsButton||e.button.style.setProperty("--pcr-color","rgba(0, 0, 0, 0.15)"),e.button.classList.add("clear"),o.showAlways||this.hide(),this._lastColor=null,this._initializingActive||t||(this._emit("save",null),this._emit("clear"));}_parseLocalColor(t){const{values:e,type:o,a:n}=function(t){t=t.match(/^[a-zA-Z]+$/)?function(t){if("black"===t.toLowerCase())return "#000";const e=document.createElement("canvas").getContext("2d");return e.fillStyle=t,"#000"===e.fillStyle?null:e.fillStyle}(t):t;const e={cmyk:/^cmyk[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)/i,rgba:/^((rgba)|rgb)[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)[\D]*?([\d.]+|$)/i,hsla:/^((hsla)|hsl)[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)[\D]*?([\d.]+|$)/i,hsva:/^((hsva)|hsv)[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)[\D]*?([\d.]+|$)/i,hexa:/^#?(([\dA-Fa-f]{3,4})|([\dA-Fa-f]{6})|([\dA-Fa-f]{8}))$/i},o=t=>t.map((t=>/^(|\d+)\.\d+|\d+$/.test(t)?Number(t):void 0));let n;t:for(const i in e){if(!(n=e[i].exec(t)))continue;const s=t=>!!n[2]==("number"==typeof t);switch(i){case"cmyk":{const[,t,e,s,r]=o(n);if(t>100||e>100||s>100||r>100)break t;return {values:_(t,e,s,r),type:i}}case"rgba":{const[,,,t,e,r,a]=o(n);if(t>255||e>255||r>255||a<0||a>1||!s(a))break t;return {values:[...b(t,e,r),a],a:a,type:i}}case"hexa":{let[,t]=n;4!==t.length&&3!==t.length||(t=t.split("").map((t=>t+t)).join(""));const e=t.substring(0,6);let o=t.substring(6);return o=o?parseInt(o,16)/255:void 0,{values:[...y(e),o],a:o,type:i}}case"hsla":{const[,,,t,e,r,a]=o(n);if(t>360||e>100||r>100||a<0||a>1||!s(a))break t;return {values:[...g(t,e,r),a],a:a,type:i}}case"hsva":{const[,,,t,e,r,a]=o(n);if(t>360||e>100||r>100||a<0||a>1||!s(a))break t;return {values:[t,e,r,a],a:a,type:i}}}}return {values:null,type:null}}(t),{lockOpacity:i}=this.options,s=void 0!==n&&1!==n;return e&&3===e.length&&(e[3]=void 0),{values:!e||i&&s?null:e,type:o}}_t(t){return this.options.i18n[t]||E.I18N_DEFAULTS[t]}_emit(t,...e){this._eventListener[t].forEach((t=>t(...e,this)));}on(t,e){return this._eventListener[t].push(e),this}off(t,e){const o=this._eventListener[t]||[],n=o.indexOf(e);return ~n&&o.splice(n,1),this}addSwatch(t){const{values:e}=this._parseLocalColor(t);if(e){const{_swatchColors:t,_root:o}=this,n=w(...e),s=r(`<button type="button" style="--pcr-color: ${n.toRGBA().toString(0)}" aria-label="${this._t("btn:swatch")}"/>`);return o.swatches.appendChild(s),t.push({el:s,color:n}),this._eventBindings.push(i(s,"click",(()=>{this.setHSVA(...n.toHSVA(),!0),this._emit("swatchselect",n),this._emit("change",n,"swatch",this);}))),!0}return !1}removeSwatch(t){const e=this._swatchColors[t];if(e){const{el:o}=e;return this._root.swatches.removeChild(o),this._swatchColors.splice(t,1),!0}return !1}applyColor(t=!1){const{preview:e,button:o}=this._root,n=this._color.toRGBA().toString(0);return e.lastColor.style.setProperty("--pcr-color",n),this.options.useAsButton||o.style.setProperty("--pcr-color",n),o.classList.remove("clear"),this._lastColor=this._color.clone(),this._initializingActive||t||this._emit("save",this._color),this}destroy(){cancelAnimationFrame(this._setupAnimationFrame),this._eventBindings.forEach((t=>s(...t))),Object.keys(this._components).forEach((t=>this._components[t].destroy()));}destroyAndRemove(){this.destroy();const{root:t,app:e}=this._root;t.parentElement&&t.parentElement.removeChild(t),e.parentElement.removeChild(e),Object.keys(this).forEach((t=>this[t]=null));}hide(){return !!this.isOpen()&&(this._root.app.classList.remove("visible"),this._emit("hide"),!0)}show(){return !this.options.disabled&&!this.isOpen()&&(this._root.app.classList.add("visible"),this._rePositioningPicker(),this._emit("show",this._color),this)}isOpen(){return this._root.app.classList.contains("visible")}setHSVA(t=360,e=0,o=0,n=1,i=!1){const s=this._recalc;if(this._recalc=!1,t<0||t>360||e<0||e>100||o<0||o>100||n<0||n>1)return !1;this._color=w(t,e,o,n);const{hue:r,opacity:a,palette:l}=this._components;return r.update(t/360),a.update(n),l.update(e/100,1-o/100),i||this.applyColor(),s&&this._updateOutput(),this._recalc=s,!0}setColor(t,e=!1){if(null===t)return this._clearColor(e),!0;const{values:o,type:n}=this._parseLocalColor(t);if(o){const t=n.toUpperCase(),{options:i}=this._root.interaction,s=i.find((e=>e.getAttribute("data-type")===t));if(s&&!s.hidden)for(const t of i)t.classList[t===s?"add":"remove"]("active");return !!this.setHSVA(...o,e)&&this.setColorRepresentation(t)}return !1}setColorRepresentation(t){return t=t.toUpperCase(),!!this._root.interaction.options.find((e=>e.getAttribute("data-type").startsWith(t)&&!e.click()))}getColorRepresentation(){return this._representation}getColor(){return this._color}getSelectedColor(){return this._lastColor}getRoot(){return this._root}disable(){return this.hide(),this.options.disabled=!0,this._root.button.classList.add("disabled"),this}enable(){return this.options.disabled=!1,this._root.button.classList.remove("disabled"),this}}return S(E,"utils",o),S(E,"version","1.8.2"),S(E,"I18N_DEFAULTS",{"ui:dialog":"color picker dialog","btn:toggle":"toggle color picker dialog","btn:swatch":"color swatch","btn:last-color":"use previous color","btn:save":"Save","btn:cancel":"Cancel","btn:clear":"Clear","aria:btn:save":"save and close","aria:btn:cancel":"cancel and close","aria:btn:clear":"clear and close","aria:input":"color input field","aria:palette":"color selection area","aria:hue":"hue selection slider","aria:opacity":"selection slider"}),S(E,"DEFAULT_OPTIONS",{appClass:null,theme:"classic",useAsButton:!1,padding:8,disabled:!1,comparison:!0,closeOnScroll:!1,outputPrecision:0,lockOpacity:!1,autoReposition:!0,container:"body",components:{interaction:{}},i18n:{},swatches:null,inline:!1,sliders:null,default:"#42445a",defaultRepresentation:null,position:"bottom-middle",adjustableNumbers:!0,showAlways:!1,closeWithKey:"Escape"}),S(E,"create",(t=>new E(t))),e.default})()},pickr_min.exports=o();}();getDefaultExportFromCjs(pickr_min.exports);var Inline=function(){function o(){}return o.load=function(n,r){var t,e=$(n);e.addClass("loading"),r.onLoad&&r.onLoad(n);var l=e.data("url");$.get(l,(function(o){r.onRender&&(o=r.onRender(o,n)),e.html(o),e.removeClass("loading"),r.onComplete&&r.onComplete(o,n);})).fail(null!==(t=r.onError)&&void 0!==t?t:o.handleError);},o.task=function(n,r,t,e){void 0===t&&(t=null),void 0===e&&(e=null),r&&r.classList.add("loading"),$.get(n,(function(o){r&&r.classList.remove("loading"),t&&t(o,r);})).fail(null!=e?e:o.handleError);},o.post=function(n,r,t,e){void 0===t&&(t=null),void 0===e&&(e=null),r&&r.classList.add("loading"),$.post(n,(function(o){r&&r.classList.remove("loading"),t&&t(o,r);})).fail(null!=e?e:o.handleError);},o.handleError=function(o,n,r){500===o.status?Alerts.error("There was an error processing the content, please contact an administrator if this continues.","Error "+o.status,1e4):404===o.status?Alerts.error("The content could not be found.","Error "+o.status,1e4):401===o.status&&(Alerts.error("You are not allowed to view this resource, are you logged in correctly?","Error "+o.status,1e4),window.location=window.location);},o}();var tinymce = {exports: {}};!function(e){!function(){var t=function(e){if(null===e)return "null";if(void 0===e)return "undefined";var t=typeof e;return "object"===t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"===t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t},n=function(e){return {eq:e}},r=n((function(e,t){return e===t})),o=function(e){return n((function(t,n){if(t.length!==n.length)return !1;for(var r=t.length,o=0;o<r;o++)if(!e.eq(t[o],n[o]))return !1;return !0}))},i=function(e,t){return function(e,t){return n((function(n,r){return e.eq(t(n),t(r))}))}(o(e),(function(e){return function(e,t){return Array.prototype.slice.call(e).sort(t)}(e,t)}))},a=function(e){return n((function(t,n){var o=Object.keys(t),a=Object.keys(n);if(!i(r).eq(o,a))return !1;for(var u=o.length,c=0;c<u;c++){var s=o[c];if(!e.eq(t[s],n[s]))return !1}return !0}))},u=n((function(e,n){if(e===n)return !0;var r=t(e);return r===t(n)&&(function(e){return -1!==["undefined","boolean","number","string","function","xml","null"].indexOf(e)}(r)?e===n:"array"===r?o(u).eq(e,n):"object"===r&&a(u).eq(e,n))})),c=function(e){return function(t){return r=typeof(n=t),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===e;var n,r;}},s=function(e){return function(t){return typeof t===e}},f=function(e){return function(t){return e===t}},l=c("string"),d=c("object"),m=c("array"),g=f(null),p=s("boolean"),h=f(void 0),v=function(e){return null==e},b=function(e){return !v(e)},y=s("function"),C=s("number"),x=function(){},w=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e(t.apply(null,n))}},S=function(e,t){return function(n){return e(t(n))}},k=function(e){return function(){return e}},N=function(e){return e},E=function(e,t){return e===t};function _(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=t.concat(n);return e.apply(null,o)}}var A=function(e){return function(t){return !e(t)}},R=function(e){return e()},D=function(e){e();},T=k(!1),O=k(!0),B=function(){return P},P=function(){var e=function(e){return e()},t=N;return {fold:function(e,t){return e()},isSome:T,isNone:O,getOr:t,getOrThunk:e,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:k(null),getOrUndefined:k(void 0),or:t,orThunk:e,map:B,each:x,bind:B,exists:T,forall:O,filter:function(){return B()},toArray:function(){return []},toString:k("none()")}}(),L=function(e){var t=k(e),n=function(){return o},r=function(t){return t(e)},o={fold:function(t,n){return n(e)},isSome:O,isNone:T,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:n,orThunk:n,map:function(t){return L(t(e))},each:function(t){t(e);},bind:r,exists:r,forall:r,filter:function(t){return t(e)?o:P},toArray:function(){return [e]},toString:function(){return "some("+e+")"}};return o},I={some:L,none:B,from:function(e){return null==e?P:L(e)}},M=Array.prototype.slice,F=Array.prototype.indexOf,U=Array.prototype.push,z=function(e,t){return F.call(e,t)},H=function(e,t){return z(e,t)>-1},j=function(e,t){for(var n=0,r=e.length;n<r;n++){if(t(e[n],n))return !0}return !1},V=function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o);}return r},q=function(e,t){for(var n=0,r=e.length;n<r;n++){t(e[n],n);}},$=function(e,t){for(var n=e.length-1;n>=0;n--){t(e[n],n);}},W=function(e,t){for(var n=[],r=[],o=0,i=e.length;o<i;o++){var a=e[o];(t(a,o)?n:r).push(a);}return {pass:n,fail:r}},K=function(e,t){for(var n=[],r=0,o=e.length;r<o;r++){var i=e[r];t(i,r)&&n.push(i);}return n},X=function(e,t,n){return $(e,(function(e,r){n=t(n,e,r);})),n},Y=function(e,t,n){return q(e,(function(e,r){n=t(n,e,r);})),n},G=function(e,t,n){for(var r=0,o=e.length;r<o;r++){var i=e[r];if(t(i,r))return I.some(i);if(n(i,r))break}return I.none()},J=function(e,t){return G(e,t,T)},Q=function(e,t){for(var n=0,r=e.length;n<r;n++){if(t(e[n],n))return I.some(n)}return I.none()},Z=function(e,t){return function(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!m(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);U.apply(t,e[n]);}return t}(V(e,t))},ee=function(e,t){for(var n=0,r=e.length;n<r;++n){if(!0!==t(e[n],n))return !1}return !0},te=function(e){var t=M.call(e,0);return t.reverse(),t},ne=function(e,t){return K(e,(function(e){return !H(t,e)}))},re=function(e,t){var n=M.call(e,0);return n.sort(t),n},oe=function(e,t){return t>=0&&t<e.length?I.some(e[t]):I.none()},ie=function(e){return oe(e,0)},ae=function(e){return oe(e,e.length-1)},ue=y(Array.from)?Array.from:function(e){return M.call(e)},ce=function(e,t){for(var n=0;n<e.length;n++){var r=t(e[n],n);if(r.isSome())return r}return I.none()},se=Object.keys,fe=Object.hasOwnProperty,le=function(e,t){for(var n=se(e),r=0,o=n.length;r<o;r++){var i=n[r];t(e[i],i);}},de=function(e,t){return me(e,(function(e,n){return {k:n,v:t(e,n)}}))},me=function(e,t){var n={};return le(e,(function(e,r){var o=t(e,r);n[o.k]=o.v;})),n},ge=function(e){return function(t,n){e[n]=t;}},pe=function(e,t,n,r){return le(e,(function(e,o){(t(e,o)?n:r)(e,o);})),{}},he=function(e,t){var n={};return pe(e,t,ge(n),x),n},ve=function(e){return function(e,t){var n=[];return le(e,(function(e,r){n.push(t(e,r));})),n}(e,N)},be=function(e,t){return ye(e,t)?I.from(e[t]):I.none()},ye=function(e,t){return fe.call(e,t)},Ce=function(e,t){return ye(e,t)&&void 0!==e[t]&&null!==e[t]},xe=Array.isArray,we=function(e,t,n){var r,o;if(!e)return !1;if(n=n||e,void 0!==e.length){for(r=0,o=e.length;r<o;r++)if(!1===t.call(n,e[r],r,e))return !1}else for(r in e)if(ye(e,r)&&!1===t.call(n,e[r],r,e))return !1;return !0},Se=function(e,t){var n=[];return we(e,(function(r,o){n.push(t(r,o,e));})),n},ke=function(e,t){var n=[];return we(e,(function(r,o){t&&!t(r,o,e)||n.push(r);})),n},Ne=function(e,t){if(e)for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return -1},Ee=function(e,t,n,r){for(var o=h(n)?e[0]:n,i=0;i<e.length;i++)o=t.call(r,o,e[i],i);return o},_e=function(e,t,n){var r,o;for(r=0,o=e.length;r<o;r++)if(t.call(n,e[r],r,e))return r;return -1},Ae=function(e){return e[e.length-1]},Re=function(){return Re=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},Re.apply(this,arguments)};function De(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}var Te=function(e){var t,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,t=e.apply(null,r)),t}},Oe=function(){return Be(0,0)},Be=function(e,t){return {major:e,minor:t}},Pe={nu:Be,detect:function(e,t){var n=String(t).toLowerCase();return 0===e.length?Oe():function(e,t){var n=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.test(t))return r}}(e,t);if(!n)return {major:0,minor:0};var r=function(e){return Number(t.replace(n,"$"+e))};return Be(r(1),r(2))}(e,n)},unknown:Oe},Le=function(e,t){var n=String(t).toLowerCase();return J(e,(function(e){return e.search(n)}))},Ie=function(e,t){return -1!==e.indexOf(t)},Me=function(e,t){return function(e,t,n){return ""===t||e.length>=t.length&&e.substr(n,n+t.length)===t}(e,t,0)},Fe=function(e){return function(t){return t.replace(e,"")}},Ue=Fe(/^\s+|\s+$/g),ze=Fe(/^\s+/g),He=Fe(/\s+$/g),je=function(e){return e.length>0},Ve=function(e){return !je(e)},qe=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,$e=function(e){return function(t){return Ie(t,e)}},We=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return Ie(e,"edge/")&&Ie(e,"chrome")&&Ie(e,"safari")&&Ie(e,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,qe],search:function(e){return Ie(e,"chrome")&&!Ie(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return Ie(e,"msie")||Ie(e,"trident")}},{name:"Opera",versionRegexes:[qe,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:$e("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:$e("firefox")},{name:"Safari",versionRegexes:[qe,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return (Ie(e,"safari")||Ie(e,"mobile/"))&&Ie(e,"applewebkit")}}],Ke=[{name:"Windows",search:$e("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return Ie(e,"iphone")||Ie(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:$e("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:$e("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:$e("linux"),versionRegexes:[]},{name:"Solaris",search:$e("sunos"),versionRegexes:[]},{name:"FreeBSD",search:$e("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:$e("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Xe={browsers:k(We),oses:k(Ke)},Ye="Edge",Ge="Chrome",Je="Opera",Qe="Firefox",Ze="Safari",et=function(e){var t=e.current,n=e.version,r=function(e){return function(){return t===e}};return {current:t,version:n,isEdge:r(Ye),isChrome:r(Ge),isIE:r("IE"),isOpera:r(Je),isFirefox:r(Qe),isSafari:r(Ze)}},tt={unknown:function(){return et({current:void 0,version:Pe.unknown()})},nu:et,edge:k(Ye),chrome:k(Ge),ie:k("IE"),opera:k(Je),firefox:k(Qe),safari:k(Ze)},nt="Windows",rt="Android",ot="Linux",it="Solaris",at="FreeBSD",ut="ChromeOS",ct=function(e){var t=e.current,n=e.version,r=function(e){return function(){return t===e}};return {current:t,version:n,isWindows:r(nt),isiOS:r("iOS"),isAndroid:r(rt),isOSX:r("OSX"),isLinux:r(ot),isSolaris:r(it),isFreeBSD:r(at),isChromeOS:r(ut)}},st={unknown:function(){return ct({current:void 0,version:Pe.unknown()})},nu:ct,windows:k(nt),ios:k("iOS"),android:k(rt),linux:k(ot),osx:k("OSX"),solaris:k(it),freebsd:k(at),chromeos:k(ut)},ft=function(e,t,n){var r=Xe.browsers(),o=Xe.oses(),i=t.bind((function(e){return function(e,t){return ce(t.brands,(function(t){var n=t.brand.toLowerCase();return J(e,(function(e){var t;return n===(null===(t=e.brand)||void 0===t?void 0:t.toLowerCase())})).map((function(e){return {current:e.name,version:Pe.nu(parseInt(t.version,10),0)}}))}))}(r,e)})).orThunk((function(){return function(e,t){return Le(e,t).map((function(e){var n=Pe.detect(e.versionRegexes,t);return {current:e.name,version:n}}))}(r,e)})).fold(tt.unknown,tt.nu),a=function(e,t){return Le(e,t).map((function(e){var n=Pe.detect(e.versionRegexes,t);return {current:e.name,version:n}}))}(o,e).fold(st.unknown,st.nu),u=function(e,t,n,r){var o=e.isiOS()&&!0===/ipad/i.test(n),i=e.isiOS()&&!o,a=e.isiOS()||e.isAndroid(),u=a||r("(pointer:coarse)"),c=o||!i&&a&&r("(min-device-width:768px)"),s=i||a&&!c,f=t.isSafari()&&e.isiOS()&&!1===/safari/i.test(n),l=!s&&!c&&!f;return {isiPad:k(o),isiPhone:k(i),isTablet:k(c),isPhone:k(s),isTouch:k(u),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:k(f),isDesktop:k(l)}}(a,i,e,n);return {browser:i,os:a,deviceType:u}},lt=function(e){return window.matchMedia(e).matches},dt=Te((function(){return ft(navigator.userAgent,I.from(navigator.userAgentData),lt)})),mt=function(){return dt()},gt=navigator.userAgent,pt=mt(),ht=pt.browser,vt=pt.os,bt=pt.deviceType,yt=/WebKit/.test(gt)&&!ht.isEdge(),Ct="FormData"in window&&"FileReader"in window&&"URL"in window&&!!URL.createObjectURL,xt=-1!==gt.indexOf("Windows Phone"),wt={opera:ht.isOpera(),webkit:yt,ie:!(!ht.isIE()&&!ht.isEdge())&&ht.version.major,gecko:ht.isFirefox(),mac:vt.isOSX()||vt.isiOS(),iOS:bt.isiPad()||bt.isiPhone(),android:vt.isAndroid(),contentEditable:!0,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:!0,range:window.getSelection&&"Range"in window,documentMode:ht.isIE()?document.documentMode||7:10,fileApi:Ct,ceFalse:!0,cacheSuffix:null,container:null,experimentalShadowDom:!1,canHaveCSP:!ht.isIE(),desktop:bt.isDesktop(),windowsPhone:xt,browser:{current:ht.current,version:ht.version,isChrome:ht.isChrome,isEdge:ht.isEdge,isFirefox:ht.isFirefox,isIE:ht.isIE,isOpera:ht.isOpera,isSafari:ht.isSafari},os:{current:vt.current,version:vt.version,isAndroid:vt.isAndroid,isChromeOS:vt.isChromeOS,isFreeBSD:vt.isFreeBSD,isiOS:vt.isiOS,isLinux:vt.isLinux,isOSX:vt.isOSX,isSolaris:vt.isSolaris,isWindows:vt.isWindows},deviceType:{isDesktop:bt.isDesktop,isiPad:bt.isiPad,isiPhone:bt.isiPhone,isPhone:bt.isPhone,isTablet:bt.isTablet,isTouch:bt.isTouch,isWebView:bt.isWebView}},St=/^\s*|\s*$/g,kt=function(e){return null==e?"":(""+e).replace(St,"")},Nt=function(e,t){return t?!("array"!==t||!xe(e))||typeof e===t:void 0!==e},Et=function(e,t,n,r){r=r||this,e&&(n&&(e=e[n]),we(e,(function(e,o){if(!1===t.call(r,e,o,n))return !1;Et(e,t,n,r);})));},_t={trim:kt,isArray:xe,is:Nt,toArray:function(e){if(xe(e))return e;for(var t=[],n=0,r=e.length;n<r;n++)t[n]=e[n];return t},makeMap:function(e,t,n){var r;for(t=t||",","string"==typeof(e=e||[])&&(e=e.split(t)),n=n||{},r=e.length;r--;)n[e[r]]={};return n},each:we,map:Se,grep:ke,inArray:Ne,hasOwn:ye,extend:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0;r<t.length;r++){var o=t[r];for(var i in o)if(ye(o,i)){var a=o[i];void 0!==a&&(e[i]=a);}}return e},create:function(e,t,n){var r,o,i,a=this,u=0,c=(e=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(e))[3].match(/(^|\.)(\w+)$/i)[2],s=a.createNS(e[3].replace(/\.\w+$/,""),n);if(!s[c]){if("static"===e[2])return s[c]=t,void(this.onCreate&&this.onCreate(e[2],e[3],s[c]));t[c]||(t[c]=function(){},u=1),s[c]=t[c],a.extend(s[c].prototype,t),e[5]&&(r=a.resolve(e[5]).prototype,o=e[5].match(/\.(\w+)$/i)[1],i=s[c],s[c]=u?function(){return r[o].apply(this,arguments)}:function(){return this.parent=r[o],i.apply(this,arguments)},s[c].prototype[c]=s[c],a.each(r,(function(e,t){s[c].prototype[t]=r[t];})),a.each(t,(function(e,t){r[t]?s[c].prototype[t]=function(){return this.parent=r[t],e.apply(this,arguments)}:t!==c&&(s[c].prototype[t]=e);}))),a.each(t.static,(function(e,t){s[c][t]=e;}));}},walk:Et,createNS:function(e,t){var n,r;for(t=t||window,e=e.split("."),n=0;n<e.length;n++)t[r=e[n]]||(t[r]={}),t=t[r];return t},resolve:function(e,t){var n,r;for(t=t||window,n=0,r=(e=e.split(".")).length;n<r&&(t=t[e[n]]);n++);return t},explode:function(e,t){return !e||Nt(e,"array")?e:Se(e.split(t||","),kt)},_addCacheSuffix:function(e){var t=wt.cacheSuffix;return t&&(e+=(-1===e.indexOf("?")?"?":"&")+t),e}},At=function(e){if(null==e)throw new Error("Node cannot be null or undefined");return {dom:e}},Rt={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return At(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return At(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return At(n)},fromDom:At,fromPoint:function(e,t,n){return I.from(e.dom.elementFromPoint(t,n)).map(At)}},Dt=function(e,t){var n=[],r=function(e){return n.push(e),t(e)},o=t(e);do{o=o.bind(r);}while(o.isSome());return n},Tt=function(e,t){var n=e.dom;if(1!==n.nodeType)return !1;var r=n;if(void 0!==r.matches)return r.matches(t);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(t);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(t);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")},Ot=function(e){return 1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType||0===e.childElementCount},Bt=function(e,t){return e.dom===t.dom},Pt=function(e,t){return n=e.dom,r=t.dom,function(e,t,n){return 0!=(e.compareDocumentPosition(t)&n)}(n,r,Node.DOCUMENT_POSITION_CONTAINED_BY);var n,r;},Lt=function(e,t){return mt().browser.isIE()?Pt(e,t):function(e,t){var n=e.dom,r=t.dom;return n!==r&&n.contains(r)}(e,t)};"undefined"!=typeof window?window:Function("return this;")();var It=function(e){return e.dom.nodeName.toLowerCase()},Mt=function(e){return e.dom.nodeType},Ft=function(e){return function(t){return Mt(t)===e}},Ut=Ft(1),zt=Ft(3),Ht=Ft(9),jt=Ft(11),Vt=function(e){return Rt.fromDom(e.dom.ownerDocument)},qt=function(e){return Ht(e)?e:Vt(e)},$t=function(e){return Rt.fromDom(qt(e).dom.defaultView)},Wt=function(e){return I.from(e.dom.parentNode).map(Rt.fromDom)},Kt=function(e){return I.from(e.dom.previousSibling).map(Rt.fromDom)},Xt=function(e){return I.from(e.dom.nextSibling).map(Rt.fromDom)},Yt=function(e){return te(Dt(e,Kt))},Gt=function(e){return Dt(e,Xt)},Jt=function(e){return V(e.dom.childNodes,Rt.fromDom)},Qt=function(e,t){var n=e.dom.childNodes;return I.from(n[t]).map(Rt.fromDom)},Zt=function(e){return Qt(e,0)},en=function(e){return Qt(e,e.dom.childNodes.length-1)},tn=function(e){return e.dom.childNodes.length},nn=function(e){return jt(e)&&b(e.dom.host)},rn=y(Element.prototype.attachShadow)&&y(Node.prototype.getRootNode),on=k(rn),an=rn?function(e){return Rt.fromDom(e.dom.getRootNode())}:qt,un=function(e){return nn(e)?e:function(e){var t=e.dom.head;if(null==t)throw new Error("Head is not available yet");return Rt.fromDom(t)}(qt(e))},cn=function(e){return Rt.fromDom(e.dom.host)},sn=function(e){return b(e.dom.shadowRoot)},fn=function(e,t){Wt(e).each((function(n){n.dom.insertBefore(t.dom,e.dom);}));},ln=function(e,t){Xt(e).fold((function(){Wt(e).each((function(e){mn(e,t);}));}),(function(e){fn(e,t);}));},dn=function(e,t){Zt(e).fold((function(){mn(e,t);}),(function(n){e.dom.insertBefore(t.dom,n.dom);}));},mn=function(e,t){e.dom.appendChild(t.dom);},gn=function(e,t){q(t,(function(t){mn(e,t);}));},pn=function(e){e.dom.textContent="",q(Jt(e),(function(e){hn(e);}));},hn=function(e){var t=e.dom;null!==t.parentNode&&t.parentNode.removeChild(t);},vn=function(e){var t,n=Jt(e);n.length>0&&(t=e,q(n,(function(e){fn(t,e);}))),hn(e);},bn=function(e){var t=zt(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return !1;var n=t.ownerDocument;return function(e){var t=an(e);return nn(t)?I.some(t):I.none()}(Rt.fromDom(t)).fold((function(){return n.body.contains(t)}),S(bn,cn))},yn=function(e,t){return {left:e,top:t,translate:function(n,r){return yn(e+n,t+r)}}},Cn=yn,xn=function(e,t){return void 0!==e?e:void 0!==t?t:0},wn=function(e){var t=e.dom,n=t.ownerDocument.body;return n===t?Cn(n.offsetLeft,n.offsetTop):bn(e)?function(e){var t=e.getBoundingClientRect();return Cn(t.left,t.top)}(t):Cn(0,0)},Sn=function(e){var t=void 0!==e?e.dom:document,n=t.body.scrollLeft||t.documentElement.scrollLeft,r=t.body.scrollTop||t.documentElement.scrollTop;return Cn(n,r)},kn=function(e,t,n){var r=(void 0!==n?n.dom:document).defaultView;r&&r.scrollTo(e,t);},Nn=function(e,t){mt().browser.isSafari()&&y(e.dom.scrollIntoViewIfNeeded)?e.dom.scrollIntoViewIfNeeded(!1):e.dom.scrollIntoView(t);},En=function(e,t,n,r){return {x:e,y:t,width:n,height:r,right:e+n,bottom:t+r}},_n=function(e){var t=void 0===e?window:e,n=t.document,r=Sn(Rt.fromDom(n));return function(e){var t=void 0===e?window:e;return mt().browser.isFirefox()?I.none():I.from(t.visualViewport)}(t).fold((function(){var e=t.document.documentElement,n=e.clientWidth,o=e.clientHeight;return En(r.left,r.top,n,o)}),(function(e){return En(Math.max(e.pageLeft,r.left),Math.max(e.pageTop,r.top),e.width,e.height)}))},An=function(e){return function(t){return !!t&&t.nodeType===e}},Rn=function(e){return !!e&&!Object.getPrototypeOf(e)},Dn=An(1),Tn=function(e){var t=e.map((function(e){return e.toLowerCase()}));return function(e){if(e&&e.nodeName){var n=e.nodeName.toLowerCase();return H(t,n)}return !1}},On=function(e,t){var n=t.toLowerCase().split(" ");return function(t){if(Dn(t))for(var r=0;r<n.length;r++){var o=t.ownerDocument.defaultView.getComputedStyle(t,null);if((o?o.getPropertyValue(e):null)===n[r])return !0}return !1}},Bn=function(e){return function(t){return Dn(t)&&t.hasAttribute(e)}},Pn=function(e){return Dn(e)&&e.hasAttribute("data-mce-bogus")},Ln=function(e){return Dn(e)&&"TABLE"===e.tagName},In=function(e){return function(t){if(Dn(t)){if(t.contentEditable===e)return !0;if(t.getAttribute("data-mce-contenteditable")===e)return !0}return !1}},Mn=Tn(["textarea","input"]),Fn=An(3),Un=An(8),zn=An(9),Hn=An(11),jn=Tn(["br"]),Vn=Tn(["img"]),qn=In("true"),$n=In("false"),Wn=Tn(["td","th"]),Kn=Tn(["video","audio","object","embed"]),Xn=function(e,t,n){return void 0===n&&(n=E),e.exists((function(e){return n(e,t)}))},Yn=function(e,t,n){return e.isSome()&&t.isSome()?I.some(n(e.getOrDie(),t.getOrDie())):I.none()},Gn=function(e){return void 0!==e.style&&y(e.style.getPropertyValue)},Jn=function(e,t,n){if(!(l(n)||p(n)||C(n)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"");},Qn=function(e,t,n){Jn(e.dom,t,n);},Zn=function(e,t){var n=e.dom;le(t,(function(e,t){Jn(n,t,e);}));},er=function(e,t){var n=e.dom.getAttribute(t);return null===n?void 0:n},tr=function(e,t){return I.from(er(e,t))},nr=function(e,t){e.dom.removeAttribute(t);},rr=function(e,t){var n=e.dom;le(t,(function(e,t){!function(e,t,n){if(!l(n))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",n,":: Element ",e),new Error("CSS value must be a string: "+n);Gn(e)&&e.style.setProperty(t,n);}(n,t,e);}));},or=function(e,t){var n=e.dom,r=window.getComputedStyle(n).getPropertyValue(t);return ""!==r||bn(e)?r:ir(n,t)},ir=function(e,t){return Gn(e)?e.style.getPropertyValue(t):""},ar=function(e,t){var n=e.dom,r=ir(n,t);return I.from(r).filter((function(e){return e.length>0}))},ur=function(e){var t={},n=e.dom;if(Gn(n))for(var r=0;r<n.style.length;r++){var o=n.style.item(r);t[o]=n.style[o];}return t},cr=mt().browser,sr=function(e){return J(e,Ut)},fr=function(e,t){return e.children&&H(e.children,t)},lr=function(e,t,n){var r=0,o=0,i=e.ownerDocument;if(n=n||e,t){if(n===e&&t.getBoundingClientRect&&"static"===or(Rt.fromDom(e),"position")){var a=t.getBoundingClientRect();return {x:r=a.left+(i.documentElement.scrollLeft||e.scrollLeft)-i.documentElement.clientLeft,y:o=a.top+(i.documentElement.scrollTop||e.scrollTop)-i.documentElement.clientTop}}for(var u=t;u&&u!==n&&u.nodeType&&!fr(u,n);){var c=u;r+=c.offsetLeft||0,o+=c.offsetTop||0,u=c.offsetParent;}for(u=t.parentNode;u&&u!==n&&u.nodeType&&!fr(u,n);)r-=u.scrollLeft||0,o-=u.scrollTop||0,u=u.parentNode;o+=function(e){return cr.isFirefox()&&"table"===It(e)?sr(Jt(e)).filter((function(e){return "caption"===It(e)})).bind((function(e){return sr(Gt(e)).map((function(t){var n=t.dom.offsetTop,r=e.dom.offsetTop,o=e.dom.offsetHeight;return n<=r?-o:0}))})).getOr(0):0}(Rt.fromDom(t));}return {x:r,y:o}},dr={},mr={exports:dr};!function(e,t,n,r){var o,i;o=this,i=function(){var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==commonjsGlobal?commonjsGlobal:"undefined"!=typeof self?self:{},t={exports:{}};!function(t){!function(e){var n=setTimeout;function r(){}function o(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],f(e,this);}function i(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,o._immediateFn((function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value);}catch(e){return void u(t.promise,e)}a(t.promise,r);}else (1===e._state?a:u)(t.promise,e._value);}))):e._deferreds.push(t);}function a(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if(t instanceof o)return e._state=3,e._value=t,void c(e);if("function"==typeof n)return void f((r=n,i=t,function(){r.apply(i,arguments);}),e)}e._state=1,e._value=t,c(e);}catch(t){u(e,t);}var r,i;}function u(e,t){e._state=2,e._value=t,c(e);}function c(e){2===e._state&&0===e._deferreds.length&&o._immediateFn((function(){e._handled||o._unhandledRejectionFn(e._value);}));for(var t=0,n=e._deferreds.length;t<n;t++)i(e,e._deferreds[t]);e._deferreds=null;}function s(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n;}function f(e,t){var n=!1;try{e((function(e){n||(n=!0,a(t,e));}),(function(e){n||(n=!0,u(t,e));}));}catch(e){if(n)return;n=!0,u(t,e);}}o.prototype.catch=function(e){return this.then(null,e)},o.prototype.then=function(e,t){var n=new this.constructor(r);return i(this,new s(e,t,n)),n},o.all=function(e){var t=Array.prototype.slice.call(e);return new o((function(e,n){if(0===t.length)return e([]);var r=t.length;function o(i,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var u=a.then;if("function"==typeof u)return void u.call(a,(function(e){o(i,e);}),n)}t[i]=a,0==--r&&e(t);}catch(e){n(e);}}for(var i=0;i<t.length;i++)o(i,t[i]);}))},o.resolve=function(e){return e&&"object"==typeof e&&e.constructor===o?e:new o((function(t){t(e);}))},o.reject=function(e){return new o((function(t,n){n(e);}))},o.race=function(e){return new o((function(t,n){for(var r=0,o=e.length;r<o;r++)e[r].then(t,n);}))},o._immediateFn="function"==typeof setImmediate?function(e){setImmediate(e);}:function(e){n(e,0);},o._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e);},o._setImmediateFn=function(e){o._immediateFn=e;},o._setUnhandledRejectionFn=function(e){o._unhandledRejectionFn=e;},t.exports?t.exports=o:e.Promise||(e.Promise=o);}(e);}(t);var n=t.exports;return {boltExport:("undefined"!=typeof window?window:Function("return this;")()).Promise||n}},"object"==typeof t&&void 0!==n?n.exports=i():"function"==typeof e&&e.amd?e(i):(o="undefined"!=typeof globalThis?globalThis:o||self).EphoxContactWrapper=i();}(void 0,dr,mr);var gr=mr.exports.boltExport,pr=function(e){var t=I.none(),n=[],r=function(e){o()?a(e):n.push(e);},o=function(){return t.isSome()},i=function(e){q(e,a);},a=function(e){t.each((function(t){setTimeout((function(){e(t);}),0);}));};return e((function(e){o()||(t=I.some(e),i(n),n=[]);})),{get:r,map:function(e){return pr((function(t){r((function(n){t(e(n));}));}))},isReady:o}},hr={nu:pr,pure:function(e){return pr((function(t){t(e);}))}},vr=function(e){setTimeout((function(){throw e}),0);},br=function(e){var t=function(t){e().then(t,vr);};return {map:function(t){return br((function(){return e().then(t)}))},bind:function(t){return br((function(){return e().then((function(e){return t(e).toPromise()}))}))},anonBind:function(t){return br((function(){return e().then((function(){return t.toPromise()}))}))},toLazy:function(){return hr.nu(t)},toCached:function(){var t=null;return br((function(){return null===t&&(t=e()),t}))},toPromise:e,get:t}},yr=function(e){return br((function(){return new gr(e)}))},Cr=function(e,t){return t((function(t){var n=[],r=0;0===e.length?t([]):q(e,(function(o,i){o.get(function(o){return function(i){n[o]=i,++r>=e.length&&t(n);}}(i));}));}))},xr=function(e){return {isValue:O,isError:T,getOr:k(e),getOrThunk:k(e),getOrDie:k(e),or:function(t){return xr(e)},orThunk:function(t){return xr(e)},fold:function(t,n){return n(e)},map:function(t){return xr(t(e))},mapError:function(t){return xr(e)},each:function(t){t(e);},bind:function(t){return t(e)},exists:function(t){return t(e)},forall:function(t){return t(e)},toOptional:function(){return I.some(e)}}},wr=function(e){return {isValue:T,isError:O,getOr:N,getOrThunk:function(e){return e()},getOrDie:function(){return (t=String(e),function(){throw new Error(t)})();var t;},or:N,orThunk:function(e){return e()},fold:function(t,n){return t(e)},map:function(t){return wr(e)},mapError:function(t){return wr(t(e))},each:x,bind:function(t){return wr(e)},exists:T,forall:O,toOptional:I.none}},Sr={value:xr,error:wr,fromOption:function(e,t){return e.fold((function(){return wr(t)}),xr)}},kr=function(e){if(!m(e))throw new Error("cases must be an array");if(0===e.length)throw new Error("there must be at least one case");var t=[],n={};return q(e,(function(r,o){var i=se(r);if(1!==i.length)throw new Error("one and only one name per case");var a=i[0],u=r[a];if(void 0!==n[a])throw new Error("duplicate key detected:"+a);if("cata"===a)throw new Error("cannot have a case named cata (sorry)");if(!m(u))throw new Error("case arguments must be an array");t.push(a),n[a]=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=n.length;if(i!==u.length)throw new Error("Wrong number of arguments to case "+a+". Expected "+u.length+" ("+u+"), got "+i);var c=function(e){var r=se(e);if(t.length!==r.length)throw new Error("Wrong number of arguments to match. Expected: "+t.join(",")+"\nActual: "+r.join(","));if(!ee(t,(function(e){return H(r,e)})))throw new Error("Not all branches were specified when using match. Specified: "+r.join(", ")+"\nRequired: "+t.join(", "));return e[a].apply(null,n)};return {fold:function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];if(t.length!==e.length)throw new Error("Wrong number of arguments to fold. Expected "+e.length+", got "+t.length);var i=t[o];return i.apply(null,n)},match:c,log:function(e){console.log(e,{constructors:t,constructor:a,params:n});}}};})),n};kr([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);var Nr=function(e){return e.fold(N,N)};function Er(e,t,n,r,o){return e(n,r)?I.some(n):y(o)&&o(n)?I.none():t(n,r,o)}var _r,Ar,Rr,Dr,Tr,Or,Br,Pr,Lr,Ir,Mr,Fr,Ur,zr,Hr,jr,Vr,qr,$r,Wr,Kr=function(e,t,n){for(var r=e.dom,o=y(n)?n:T;r.parentNode;){r=r.parentNode;var i=Rt.fromDom(r);if(t(i))return I.some(i);if(o(i))break}return I.none()},Xr=function(e,t,n){return Er((function(e,t){return t(e)}),Kr,e,t,n)},Yr=function(e,t){return J(e.dom.childNodes,(function(e){return t(Rt.fromDom(e))})).map(Rt.fromDom)},Gr=function(e,t,n){return Kr(e,(function(e){return Tt(e,t)}),n)},Jr=function(e,t){return function(e,t){var n=void 0===t?document:t.dom;return Ot(n)?I.none():I.from(n.querySelector(e)).map(Rt.fromDom)}(t,e)},Qr=function(e,t,n){return Er((function(e,t){return Tt(e,t)}),Gr,e,t,n)},Zr=window.Promise?window.Promise:gr,eo=function(e,t){return "number"!=typeof t&&(t=0),setTimeout(e,t)},to=function(e,t){return "number"!=typeof t&&(t=1),setInterval(e,t)},no=function(e,t){var n,r=function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];clearTimeout(n),n=eo((function(){e.apply(this,r);}),t);};return r.stop=function(){clearTimeout(n);},r},ro={requestAnimationFrame:function(e,t){_r?_r.then(e):_r=new Zr((function(e){t||(t=document.body),function(e,t){for(var n=window.requestAnimationFrame,r=["ms","moz","webkit"],o=0;o<r.length&&!n;o++)n=window[r[o]+"RequestAnimationFrame"];n||(n=function(e){window.setTimeout(e,0);}),n(e,t);}(e,t);})).then(e);},setTimeout:eo,setInterval:to,setEditorTimeout:function(e,t,n){return eo((function(){e.removed||t();}),n)},setEditorInterval:function(e,t,n){var r=to((function(){e.removed?clearInterval(r):t();}),n);return r},debounce:no,throttle:no,clearInterval:function(e){return clearInterval(e)},clearTimeout:function(e){return clearTimeout(e)}},oo=function(e,t){void 0===t&&(t={});var n=0,r={},o=Rt.fromDom(e),i=qt(o),a=t.maxLoadTime||5e3,u=function(u,c,s){var f,l=_t._addCacheSuffix(u),d=function(e){return be(r,e).getOrThunk((function(){return {id:"mce-u"+n++,passed:[],failed:[],count:0}}))}(l);r[l]=d,d.count++;var m=function(e,t){for(var n=e.length;n--;)e[n]();d.status=t,d.passed=[],d.failed=[],f&&(f.onload=null,f.onerror=null,f=null);},g=function(){return m(d.passed,2)},p=function(){return m(d.failed,3)},h=function(){var t,n;t=function(){for(var t=e.styleSheets,n=t.length;n--;){var r=t[n].ownerNode;if(r&&r.id===f.id)return g(),!0}return !1},n=h,t()||(Date.now()-y<a?ro.setTimeout(n):p());};if(c&&d.passed.push(c),s&&d.failed.push(s),1!==d.status)if(2!==d.status)if(3!==d.status){d.status=1;var v=Rt.fromTag("link",i.dom);Zn(v,{rel:"stylesheet",type:"text/css",id:d.id});var b,y=Date.now();t.contentCssCors&&Qn(v,"crossOrigin","anonymous"),t.referrerPolicy&&Qn(v,"referrerpolicy",t.referrerPolicy),(f=v.dom).onload=h,f.onerror=p,b=v,mn(un(o),b),Qn(v,"href",l);}else p();else g();},c=function(e){return yr((function(t){u(e,w(t,k(Sr.value(e))),w(t,k(Sr.error(e))));}))},s=function(e){var t=_t._addCacheSuffix(e);be(r,t).each((function(e){var n,i;0===--e.count&&(delete r[t],n=e.id,i=un(o),Jr(i,"#"+n).each(hn));}));};return {load:u,loadAll:function(e,t,n){var r;(r=V(e,c),Cr(r,yr)).get((function(e){var r=W(e,(function(e){return e.isValue()}));r.fail.length>0?n(r.fail.map(Nr)):t(r.pass.map(Nr));}));},unload:s,unloadAll:function(e){q(e,(function(e){s(e);}));},_setReferrerPolicy:function(e){t.referrerPolicy=e;}}},io=function(){var e=new WeakMap;return {forElement:function(t,n){var r=an(t).dom;return I.from(e.get(r)).getOrThunk((function(){var t=oo(r,n);return e.set(r,t),t}))}}}(),ao=function(){function e(e,t){this.node=e,this.rootNode=t,this.current=this.current.bind(this),this.next=this.next.bind(this),this.prev=this.prev.bind(this),this.prev2=this.prev2.bind(this);}return e.prototype.current=function(){return this.node},e.prototype.next=function(e){return this.node=this.findSibling(this.node,"firstChild","nextSibling",e),this.node},e.prototype.prev=function(e){return this.node=this.findSibling(this.node,"lastChild","previousSibling",e),this.node},e.prototype.prev2=function(e){return this.node=this.findPreviousNode(this.node,"lastChild","previousSibling",e),this.node},e.prototype.findSibling=function(e,t,n,r){var o,i;if(e){if(!r&&e[t])return e[t];if(e!==this.rootNode){if(o=e[n])return o;for(i=e.parentNode;i&&i!==this.rootNode;i=i.parentNode)if(o=i[n])return o}}},e.prototype.findPreviousNode=function(e,t,n,r){var o,i,a;if(e){if(o=e[n],this.rootNode&&o===this.rootNode)return;if(o){if(!r)for(a=o[t];a;a=a[t])if(!a[t])return a;return o}if((i=e.parentNode)&&i!==this.rootNode)return i}},e}(),uo=function(e){var t;return function(n){return t=t||function(e,t){for(var n={},r=0,o=e.length;r<o;r++){var i=e[r];n[String(i)]=t(i,r);}return n}(e,O),ye(t,It(n))}},co=uo(["h1","h2","h3","h4","h5","h6"]),so=uo(["article","aside","details","div","dt","figcaption","footer","form","fieldset","header","hgroup","html","main","nav","section","summary","body","p","dl","multicol","dd","figure","address","center","blockquote","h1","h2","h3","h4","h5","h6","listing","xmp","pre","plaintext","menu","dir","ul","ol","li","hr","table","tbody","thead","tfoot","th","tr","td","caption"]),fo=function(e){return Ut(e)&&!so(e)},lo=function(e){return Ut(e)&&"br"===It(e)},mo=uo(["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"]),go=uo(["ul","ol","dl"]),po=uo(["li","dd","dt"]),ho=uo(["thead","tbody","tfoot"]),vo=uo(["td","th"]),bo=uo(["pre","script","textarea","style"]),yo=" ",Co="\ufeff",xo=function(e){return "\ufeff"===e},wo=function(e){return e.replace(/\uFEFF/g,"")},So=Dn,ko=Fn,No=function(e){return ko(e)&&(e=e.parentNode),So(e)&&e.hasAttribute("data-mce-caret")},Eo=function(e){return ko(e)&&xo(e.data)},_o=function(e){return No(e)||Eo(e)},Ao=function(e){return e.firstChild!==e.lastChild||!jn(e.firstChild)},Ro=function(e){var t=e.container();return !!Fn(t)&&(t.data.charAt(e.offset())===Co||e.isAtStart()&&Eo(t.previousSibling))},Do=function(e){var t=e.container();return !!Fn(t)&&(t.data.charAt(e.offset()-1)===Co||e.isAtEnd()&&Eo(t.nextSibling))},To=function(e,t,n){var r,o=t.ownerDocument.createElement(e);o.setAttribute("data-mce-caret",n?"before":"after"),o.setAttribute("data-mce-bogus","all"),o.appendChild(((r=document.createElement("br")).setAttribute("data-mce-bogus","1"),r));var i=t.parentNode;return n?i.insertBefore(o,t):t.nextSibling?i.insertBefore(o,t.nextSibling):i.appendChild(o),o},Oo=function(e){return ko(e)&&e.data[0]===Co},Bo=function(e){return ko(e)&&e.data[e.data.length-1]===Co},Po=function(e){return e&&e.hasAttribute("data-mce-caret")?(t=e.getElementsByTagName("br"),n=t[t.length-1],Pn(n)&&n.parentNode.removeChild(n),e.removeAttribute("data-mce-caret"),e.removeAttribute("data-mce-bogus"),e.removeAttribute("style"),e.removeAttribute("_moz_abspos"),e):null;var t,n;},Lo=function(e){return No(e.startContainer)},Io=qn,Mo=$n,Fo=jn,Uo=Fn,zo=Tn(["script","style","textarea"]),Ho=Tn(["img","input","textarea","hr","iframe","video","audio","object","embed"]),jo=Tn(["table"]),Vo=_o,qo=function(e){return !Vo(e)&&(Uo(e)?!zo(e.parentNode):Ho(e)||Fo(e)||jo(e)||$o(e))},$o=function(e){return !1===function(e){return Dn(e)&&"true"===e.getAttribute("unselectable")}(e)&&Mo(e)},Wo=function(e,t){return qo(e)&&function(e,t){for(e=e.parentNode;e&&e!==t;e=e.parentNode){if($o(e))return !1;if(Io(e))return !0}return !0}(e,t)},Ko=/^[ \t\r\n]*$/,Xo=function(e){return Ko.test(e)},Yo=function(e,t){var n,r,o,i=Rt.fromDom(t),a=Rt.fromDom(e);return n=a,r="pre,code",o=_(Bt,i),Gr(n,r,o).isSome()},Go=function(e,t){return qo(e)&&!1===function(e,t){return Fn(e)&&Xo(e.data)&&!1===Yo(e,t)}(e,t)||function(e){return Dn(e)&&"A"===e.nodeName&&!e.hasAttribute("href")&&(e.hasAttribute("name")||e.hasAttribute("id"))}(e)||Jo(e)},Jo=Bn("data-mce-bookmark"),Qo=Bn("data-mce-bogus"),Zo=(Ar="data-mce-bogus",Rr="all",function(e){return Dn(e)&&e.getAttribute(Ar)===Rr}),ei=function(e,t){return void 0===t&&(t=!0),function(e,t){var n=0;if(Go(e,e))return !1;var r=e.firstChild;if(!r)return !0;var o=new ao(r,e);do{if(t){if(Zo(r)){r=o.next(!0);continue}if(Qo(r)){r=o.next();continue}}if(jn(r))n++,r=o.next();else {if(Go(r,e))return !1;r=o.next();}}while(r);return n<=1}(e.dom,t)},ti=function(e,t){return b(e)&&(Go(e,t)||fo(Rt.fromDom(e)))},ni=function(e){return function(e){return "span"===e.nodeName.toLowerCase()}(e)&&"bookmark"===e.getAttribute("data-mce-type")},ri=function(e,t){return Fn(e)&&e.data.length>0&&function(e,t){var n=new ao(e,t).prev(!1),r=new ao(e,t).next(!1),o=h(n)||ti(n,t),i=h(r)||ti(r,t);return o&&i}(e,t)},oi=function(e,t,n){var r=n||t;if(Dn(t)&&ni(t))return t;for(var o=t.childNodes,i=o.length-1;i>=0;i--)oi(e,o[i],r);if(Dn(t)){var a=t.childNodes;1===a.length&&ni(a[0])&&t.parentNode.insertBefore(a[0],t);}return function(e){return Hn(e)||zn(e)}(t)||Go(t,r)||function(e){return !!Dn(e)&&e.childNodes.length>0}(t)||ri(t,r)||e.remove(t),t},ii=_t.makeMap,ai=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,ui=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,ci=/[<>&\"\']/g,si=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,fi={128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"},li={'"':"&quot;","'":"&#39;","<":"&lt;",">":"&gt;","&":"&amp;","`":"&#96;"},di={"&lt;":"<","&gt;":">","&amp;":"&","&quot;":'"',"&apos;":"'"},mi=function(e,t){var n,r,o,i={};if(e){for(e=e.split(","),t=t||10,n=0;n<e.length;n+=2)r=String.fromCharCode(parseInt(e[n],t)),li[r]||(o="&"+e[n+1]+";",i[r]=o,i[o]=r);return i}},gi=mi("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32),pi=function(e,t){return e.replace(t?ai:ui,(function(e){return li[e]||e}))},hi=function(e,t){return e.replace(t?ai:ui,(function(e){return e.length>1?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":li[e]||"&#"+e.charCodeAt(0)+";"}))},vi=function(e,t,n){return n=n||gi,e.replace(t?ai:ui,(function(e){return li[e]||n[e]||e}))},bi={encodeRaw:pi,encodeAllRaw:function(e){return (""+e).replace(ci,(function(e){return li[e]||e}))},encodeNumeric:hi,encodeNamed:vi,getEncodeFunc:function(e,t){var n=mi(t)||gi,r=ii(e.replace(/\+/g,","));return r.named&&r.numeric?function(e,t){return e.replace(t?ai:ui,(function(e){return void 0!==li[e]?li[e]:void 0!==n[e]?n[e]:e.length>1?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":"&#"+e.charCodeAt(0)+";"}))}:r.named?t?function(e,t){return vi(e,t,n)}:vi:r.numeric?hi:pi},decode:function(e){return e.replace(si,(function(e,t){return t?(t="x"===t.charAt(0).toLowerCase()?parseInt(t.substr(1),16):parseInt(t,10))>65535?(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t))):fi[t]||String.fromCharCode(t):di[e]||gi[e]||function(e){var t=Rt.fromTag("div").dom;return t.innerHTML=e,t.textContent||t.innerText||e}(e)}))}},yi={},Ci={},xi=_t.makeMap,wi=_t.each,Si=_t.extend,ki=_t.explode,Ni=_t.inArray,Ei=function(e,t){return (e=_t.trim(e))?e.split(t||" "):[]},_i=function(e,t){var n;return e&&(n={},"string"==typeof e&&(e={"*":e}),wi(e,(function(e,r){n[r]=n[r.toUpperCase()]="map"===t?xi(e,/[, ]/):ki(e,/[, ]/);}))),n},Ai=function(e){var t={},n={},r=[],o={},i={},a=function(t,n,r){var o=e[t];return o?o=xi(o,/[, ]/,xi(o.toUpperCase(),/[, ]/)):(o=yi[t])||(o=xi(n," ",xi(n.toUpperCase()," ")),o=Si(o,r),yi[t]=o),o},u=function(e){var t,n,r,o,i,a,u={},c=function(e,n,r){var o,i,a,c=function(e,t){var n,r,o={};for(n=0,r=e.length;n<r;n++)o[e[n]]=t||{};return o};n=n||"","string"==typeof(r=r||[])&&(r=Ei(r));var s=Ei(e);for(o=s.length;o--;)a={attributes:c(i=Ei([t,n].join(" "))),attributesOrder:i,children:c(r,Ci)},u[s[o]]=a;},s=function(e,t){var n,r,o,i,a=Ei(e);n=a.length;for(var c=Ei(t);n--;)for(r=u[a[n]],o=0,i=c.length;o<i;o++)r.attributes[c[o]]={},r.attributesOrder.push(c[o]);};return yi[e]?yi[e]:(t="id accesskey class dir lang style tabindex title role",n="address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul",r="a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment","html4"!==e&&(t+=" contenteditable contextmenu draggable dropzone hidden spellcheck translate",n+=" article aside details dialog figure main header footer hgroup section nav",r+=" audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen"),"html5-strict"!==e&&(t+=" xml:lang",r=[r,a="acronym applet basefont big font strike tt"].join(" "),wi(Ei(a),(function(e){c(e,"",r);})),n=[n,i="center dir isindex noframes"].join(" "),o=[n,r].join(" "),wi(Ei(i),(function(e){c(e,"",o);}))),o=o||[n,r].join(" "),c("html","manifest","head body"),c("head","","base command link meta noscript script style title"),c("title hr noscript br"),c("base","href target"),c("link","href rel media hreflang type sizes hreflang"),c("meta","name http-equiv content charset"),c("style","media type scoped"),c("script","src async defer type charset"),c("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",o),c("address dt dd div caption","",o),c("h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn","",r),c("blockquote","cite",o),c("ol","reversed start type","li"),c("ul","","li"),c("li","value",o),c("dl","","dt dd"),c("a","href target rel media hreflang type",r),c("q","cite",r),c("ins del","cite datetime",o),c("img","src sizes srcset alt usemap ismap width height"),c("iframe","src name width height",o),c("embed","src type width height"),c("object","data type typemustmatch name usemap form width height",[o,"param"].join(" ")),c("param","name value"),c("map","name",[o,"area"].join(" ")),c("area","alt coords shape href target rel media hreflang type"),c("table","border","caption colgroup thead tfoot tbody tr"+("html4"===e?" col":"")),c("colgroup","span","col"),c("col","span"),c("tbody thead tfoot","","tr"),c("tr","","td th"),c("td","colspan rowspan headers",o),c("th","colspan rowspan headers scope abbr",o),c("form","accept-charset action autocomplete enctype method name novalidate target",o),c("fieldset","disabled form name",[o,"legend"].join(" ")),c("label","form for",r),c("input","accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate formtarget height list max maxlength min multiple name pattern readonly required size src step type value width"),c("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"===e?o:r),c("select","disabled form multiple name required size","option optgroup"),c("optgroup","disabled label","option"),c("option","disabled label selected value"),c("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),c("menu","type label",[o,"li"].join(" ")),c("noscript","",o),"html4"!==e&&(c("wbr"),c("ruby","",[r,"rt rp"].join(" ")),c("figcaption","",o),c("mark rt rp summary bdi","",r),c("canvas","width height",o),c("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",[o,"track source"].join(" ")),c("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",[o,"track source"].join(" ")),c("picture","","img source"),c("source","src srcset type media sizes"),c("track","kind src srclang label default"),c("datalist","",[r,"option"].join(" ")),c("article section nav aside main header footer","",o),c("hgroup","","h1 h2 h3 h4 h5 h6"),c("figure","",[o,"figcaption"].join(" ")),c("time","datetime",r),c("dialog","open",o),c("command","type label icon disabled checked radiogroup command"),c("output","for form name",r),c("progress","value max",r),c("meter","value min max low high optimum",r),c("details","open",[o,"summary"].join(" ")),c("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!==e&&(s("script","language xml:space"),s("style","xml:space"),s("object","declare classid code codebase codetype archive standby align border hspace vspace"),s("embed","align name hspace vspace"),s("param","valuetype type"),s("a","charset name rev shape coords"),s("br","clear"),s("applet","codebase archive code object alt name width height align hspace vspace"),s("img","name longdesc align border hspace vspace"),s("iframe","longdesc frameborder marginwidth marginheight scrolling align"),s("font basefont","size color face"),s("input","usemap align"),s("select"),s("textarea"),s("h1 h2 h3 h4 h5 h6 div p legend caption","align"),s("ul","type compact"),s("li","type"),s("ol dl menu dir","compact"),s("pre","width xml:space"),s("hr","align noshade size width"),s("isindex","prompt"),s("table","summary width frame rules cellspacing cellpadding align bgcolor"),s("col","width align char charoff valign"),s("colgroup","width align char charoff valign"),s("thead","align char charoff valign"),s("tr","align char charoff valign bgcolor"),s("th","axis align char charoff valign nowrap bgcolor width height"),s("form","accept"),s("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),s("tfoot","align char charoff valign"),s("tbody","align char charoff valign"),s("area","nohref"),s("body","background bgcolor text link vlink alink")),"html4"!==e&&(s("input button select textarea","autofocus"),s("input textarea","placeholder"),s("a","download"),s("link script img","crossorigin"),s("img","loading"),s("iframe","sandbox seamless allowfullscreen loading")),wi(Ei("a form meter progress dfn"),(function(e){u[e]&&delete u[e].children[e];})),delete u.caption.children.table,delete u.script,yi[e]=u,u)}((e=e||{}).schema);!1===e.verify_html&&(e.valid_elements="*[*]");var c=_i(e.valid_styles),s=_i(e.invalid_styles,"map"),f=_i(e.valid_classes,"map"),l=a("whitespace_elements","pre script noscript style textarea video audio iframe object code"),d=a("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),m=a("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),g=a("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),p="td th iframe video audio object script code",h=a("non_empty_elements",p+" pre",m),v=a("move_caret_before_on_enter_elements",p+" table",m),b=a("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside main nav figure"),y=a("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup figcaption details summary",b),C=a("text_inline_elements","span strong b em i font strike u var cite dfn code mark q sup sub samp");wi((e.special||"script noscript iframe noframes noembed title style textarea xmp").split(" "),(function(e){i[e]=new RegExp("</"+e+"[^>]*>","gi");}));var x=function(e){return new RegExp("^"+e.replace(/([?+*])/g,".$1")+"$")},w=function(e){var n,o,i,a,u,c,s,f,l,d,m,g,p,h,v,b,y,C,w=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)])?$/,S=/^([!\-])?(\w+[\\:]:\w+|[^=:<]+)?(?:([=:<])(.*))?$/,k=/[*?+]/;if(e){var N=Ei(e,",");for(t["@"]&&(b=t["@"].attributes,y=t["@"].attributesOrder),n=0,o=N.length;n<o;n++)if(u=w.exec(N[n])){if(h=u[1],l=u[2],v=u[3],f=u[5],c={attributes:g={},attributesOrder:p=[]},"#"===h&&(c.paddEmpty=!0),"-"===h&&(c.removeEmpty=!0),"!"===u[4]&&(c.removeEmptyAttrs=!0),b&&(le(b,(function(e,t){g[t]=e;})),p.push.apply(p,y)),f)for(i=0,a=(f=Ei(f,"|")).length;i<a;i++)if(u=S.exec(f[i])){if(s={},m=u[1],d=u[2].replace(/[\\:]:/g,":"),h=u[3],C=u[4],"!"===m&&(c.attributesRequired=c.attributesRequired||[],c.attributesRequired.push(d),s.required=!0),"-"===m){delete g[d],p.splice(Ni(p,d),1);continue}h&&("="===h&&(c.attributesDefault=c.attributesDefault||[],c.attributesDefault.push({name:d,value:C}),s.defaultValue=C),":"===h&&(c.attributesForced=c.attributesForced||[],c.attributesForced.push({name:d,value:C}),s.forcedValue=C),"<"===h&&(s.validValues=xi(C,"?"))),k.test(d)?(c.attributePatterns=c.attributePatterns||[],s.pattern=x(d),c.attributePatterns.push(s)):(g[d]||p.push(d),g[d]=s);}b||"@"!==l||(b=g,y=p),v&&(c.outputName=l,t[v]=c),k.test(l)?(c.pattern=x(l),r.push(c)):t[l]=c;}}},S=function(e){t={},r=[],w(e),wi(u,(function(e,t){n[t]=e.children;}));},N=function(e){var r=/^(~)?(.+)$/;e&&(yi.text_block_elements=yi.block_elements=null,wi(Ei(e,","),(function(e){var i=r.exec(e),a="~"===i[1],u=a?"span":"div",c=i[2];if(n[c]=n[u],o[c]=u,a||(y[c.toUpperCase()]={},y[c]={}),!t[c]){var s=t[u];delete(s=Si({},s)).removeEmptyAttrs,delete s.removeEmpty,t[c]=s;}wi(n,(function(e,t){e[u]&&(n[t]=e=Si({},n[t]),e[c]=e[u]);}));})));},E=function(t){var r=/^([+\-]?)([A-Za-z0-9_\-.\u00b7\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u037d\u037f-\u1fff\u200c-\u200d\u203f-\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]+)\[([^\]]+)]$/;yi[e.schema]=null,t&&wi(Ei(t,","),(function(e){var t,o,i=r.exec(e);i&&(o=i[1],t=o?n[i[2]]:n[i[2]]={"#comment":{}},t=n[i[2]],wi(Ei(i[3],"|"),(function(e){"-"===o?delete t[e]:t[e]={};})));}));},_=function(e){var n,o=t[e];if(o)return o;for(n=r.length;n--;)if((o=r[n]).pattern.test(e))return o};e.valid_elements?S(e.valid_elements):(wi(u,(function(e,r){t[r]={attributes:e.attributes,attributesOrder:e.attributesOrder},n[r]=e.children;})),"html5"!==e.schema&&wi(Ei("strong/b em/i"),(function(e){var n=Ei(e,"/");t[n[1]].outputName=n[0];})),wi(Ei("ol ul sub sup blockquote span font a table tbody strong em b i"),(function(e){t[e]&&(t[e].removeEmpty=!0);})),wi(Ei("p h1 h2 h3 h4 h5 h6 th td pre div address caption li"),(function(e){t[e].paddEmpty=!0;})),wi(Ei("span"),(function(e){t[e].removeEmptyAttrs=!0;}))),N(e.custom_elements),E(e.valid_children),w(e.extended_valid_elements),E("+ol[ul|ol],+ul[ul|ol]"),wi({dd:"dl",dt:"dl",li:"ul ol",td:"tr",th:"tr",tr:"tbody thead tfoot",tbody:"table",thead:"table",tfoot:"table",legend:"fieldset",area:"map",param:"video audio object"},(function(e,n){t[n]&&(t[n].parentsRequired=Ei(e));})),e.invalid_elements&&wi(ki(e.invalid_elements),(function(e){t[e]&&delete t[e];})),_("span")||w("span[!data-mce-type|*]");var A=k(c),R=k(s),D=k(f),T=k(g),O=k(y),B=k(b),P=k(C),L=k(m),I=k(d),M=k(h),F=k(v),U=k(l),z=k(i),H=k(o);return {children:n,elements:t,getValidStyles:A,getValidClasses:D,getBlockElements:O,getInvalidStyles:R,getShortEndedElements:L,getTextBlockElements:B,getTextInlineElements:P,getBoolAttrs:T,getElementRule:_,getSelfClosingElements:I,getNonEmptyElements:M,getMoveCaretBeforeOnEnterElements:F,getWhiteSpaceElements:U,getSpecialElements:z,isValidChild:function(e,t){var r=n[e.toLowerCase()];return !(!r||!r[t.toLowerCase()])},isValid:function(e,t){var n,r,o=_(e);if(o){if(!t)return !0;if(o.attributes[t])return !0;if(n=o.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(e))return !0}return !1},getCustomElements:H,addValidElements:w,setValidElements:S,addCustomElements:N,addValidChildren:E}},Ri=function(e,t,n,r){var o=function(e){return (e=parseInt(e,10).toString(16)).length>1?e:"0"+e};return "#"+o(t)+o(n)+o(r)},Di=function(e,t){var n,r,o,i=this,a=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,u=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,c=/\s*([^:]+):\s*([^;]+);?/g,s=/\s+$/,f={},l="\ufeff";e=e||{},t&&(r=t.getValidStyles(),o=t.getInvalidStyles());var d="\\\" \\' \\; \\: ; : \ufeff".split(" ");for(n=0;n<d.length;n++)f[d[n]]=l+n,f[l+n]=d[n];return {toHex:function(e){return e.replace(a,Ri)},parse:function(t){var r,o,d,m,g,p,h,v,b={},y=e.url_converter,C=e.url_converter_scope||i,x=function(e,t,r){var o=b[e+"-top"+t];if(o){var i=b[e+"-right"+t];if(i){var a=b[e+"-bottom"+t];if(a){var u=b[e+"-left"+t];if(u){var c=[o,i,a,u];for(n=c.length-1;n--&&c[n]===c[n+1];);n>-1&&r||(b[e+t]=-1===n?c[0]:c.join(" "),delete b[e+"-top"+t],delete b[e+"-right"+t],delete b[e+"-bottom"+t],delete b[e+"-left"+t]);}}}}},w=function(e){var t,n=b[e];if(n){for(t=(n=n.split(" ")).length;t--;)if(n[t]!==n[0])return !1;return b[e]=n[0],!0}},S=function(e){return m=!0,f[e]},k=function(e,t){return m&&(e=e.replace(/\uFEFF[0-9]/g,(function(e){return f[e]}))),t||(e=e.replace(/\\([\'\";:])/g,"$1")),e},N=function(e){return String.fromCharCode(parseInt(e.slice(1),16))},E=function(e){return e.replace(/\\[0-9a-f]+/gi,N)},_=function(t,n,r,o,i,a){if(i=i||a)return "'"+(i=k(i)).replace(/\'/g,"\\'")+"'";if(n=k(n||r||o),!e.allow_script_urls){var u=n.replace(/[\s\r\n]+/g,"");if(/(java|vb)script:/i.test(u))return "";if(!e.allow_svg_data_urls&&/^data:image\/svg/i.test(u))return ""}return y&&(n=y.call(C,n,"style")),"url('"+n.replace(/\'/g,"\\'")+"')"};if(t){for(t=(t=t.replace(/[\u0000-\u001F]/g,"")).replace(/\\[\"\';:\uFEFF]/g,S).replace(/\"[^\"]+\"|\'[^\']+\'/g,(function(e){return e.replace(/[;:]/g,S)}));r=c.exec(t);)if(c.lastIndex=r.index+r[0].length,o=r[1].replace(s,"").toLowerCase(),d=r[2].replace(s,""),o&&d){if(o=E(o),d=E(d),-1!==o.indexOf(l)||-1!==o.indexOf('"'))continue;if(!e.allow_script_urls&&("behavior"===o||/expression\s*\(|\/\*|\*\//.test(d)))continue;"font-weight"===o&&"700"===d?d="bold":"color"!==o&&"background-color"!==o||(d=d.toLowerCase()),d=(d=d.replace(a,Ri)).replace(u,_),b[o]=m?k(d,!0):d;}x("border","",!0),x("border","-width"),x("border","-color"),x("border","-style"),x("padding",""),x("margin",""),g="border",h="border-style",v="border-color",w(p="border-width")&&w(h)&&w(v)&&(b[g]=b[p]+" "+b[h]+" "+b[v],delete b[p],delete b[h],delete b[v]),"medium none"===b.border&&delete b.border,"none"===b["border-image"]&&delete b["border-image"];}return b},serialize:function(e,t){var n="",i=function(t){var o,i=r[t];if(i)for(var a=0,u=i.length;a<u;a++)t=i[a],(o=e[t])&&(n+=(n.length>0?" ":"")+t+": "+o+";");};return t&&r?(i("*"),i(t)):le(e,(function(e,r){!e||o&&!function(e,t){var n=o["*"];return !(n&&n[e]||(n=o[t])&&n[e])}(r,t)||(n+=(n.length>0?" ":"")+r+": "+e+";");})),n}}},Ti={keyLocation:!0,layerX:!0,layerY:!0,returnValue:!0,webkitMovementX:!0,webkitMovementY:!0,keyIdentifier:!0,mozPressure:!0},Oi=function(e){return e instanceof Event||y(e.initEvent)},Bi=function(e,t,n,r){var o,i=function(e,t){var n=null!=t?t:{};for(var r in e)ye(Ti,r)||(n[r]=e[r]);return b(n.composedPath)&&(n.composedPath=function(){return e.composedPath()}),n}(t,r);return i.type=e,v(i.target)&&(i.target=null!==(o=i.srcElement)&&void 0!==o?o:n),function(e){return v(e.preventDefault)||Oi(e)}(t)&&(i.preventDefault=function(){i.defaultPrevented=!0,i.isDefaultPrevented=O,y(t.preventDefault)?t.preventDefault():Oi(t)&&(t.returnValue=!1);},i.stopPropagation=function(){i.cancelBubble=!0,i.isPropagationStopped=O,y(t.stopPropagation)?t.stopPropagation():Oi(t)&&(t.cancelBubble=!0);},i.stopImmediatePropagation=function(){i.isImmediatePropagationStopped=O,i.stopPropagation();},function(e){return e.isDefaultPrevented===O||e.isDefaultPrevented===T}(i)||(i.isDefaultPrevented=!0===i.defaultPrevented?O:T,i.isPropagationStopped=!0===i.cancelBubble?O:T,i.isImmediatePropagationStopped=T)),i},Pi=/^(?:mouse|contextmenu)|click/,Li=function(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r||!1):e.attachEvent&&e.attachEvent("on"+t,n);},Ii=function(e,t,n,r){e.removeEventListener?e.removeEventListener(t,n,r||!1):e.detachEvent&&e.detachEvent("on"+t,n);},Mi=function(e,t){var n=Bi(e.type,e,document,t);if(function(e){return b(e)&&Pi.test(e.type)}(e)&&h(e.pageX)&&!h(e.clientX)){var r=n.target.ownerDocument||document,o=r.documentElement,i=r.body,a=n;a.pageX=e.clientX+(o&&o.scrollLeft||i&&i.scrollLeft||0)-(o&&o.clientLeft||i&&i.clientLeft||0),a.pageY=e.clientY+(o&&o.scrollTop||i&&i.scrollTop||0)-(o&&o.clientTop||i&&i.clientTop||0);}return h(n.metaKey)&&(n.metaKey=!1),n},Fi=function(e,t,n){var r=e.document,o={type:"ready"};if(n.domLoaded)t(o);else {var i=function(){Ii(e,"DOMContentLoaded",i),Ii(e,"load",i),n.domLoaded||(n.domLoaded=!0,t(o)),e=null;};"complete"===r.readyState||"interactive"===r.readyState&&r.body?i():Li(e,"DOMContentLoaded",i),n.domLoaded||Li(e,"load",i);}},Ui=function(){function e(){this.domLoaded=!1,this.events={},this.count=1,this.expando="mce-data-"+(+new Date).toString(32),this.hasMouseEnterLeave="onmouseenter"in document.documentElement,this.hasFocusIn="onfocusin"in document.documentElement,this.count=1;}return e.prototype.bind=function(e,t,n,r){var o,i,a,u,c,s,f,l=this,d=window,m=function(e){l.executeHandlers(Mi(e||d.event),o);};if(e&&3!==e.nodeType&&8!==e.nodeType){e[l.expando]?o=e[l.expando]:(o=l.count++,e[l.expando]=o,l.events[o]={}),r=r||e;var g=t.split(" ");for(a=g.length;a--;)s=m,c=f=!1,"DOMContentLoaded"===(u=g[a])&&(u="ready"),l.domLoaded&&"ready"===u&&"complete"===e.readyState?n.call(r,Mi({type:u})):(l.hasMouseEnterLeave||(c=l.mouseEnterLeave[u])&&(s=function(e){var t=e.currentTarget,n=e.relatedTarget;if(n&&t.contains)n=t.contains(n);else for(;n&&n!==t;)n=n.parentNode;n||((e=Mi(e||d.event)).type="mouseout"===e.type?"mouseleave":"mouseenter",e.target=t,l.executeHandlers(e,o));}),l.hasFocusIn||"focusin"!==u&&"focusout"!==u||(f=!0,c="focusin"===u?"focus":"blur",s=function(e){(e=Mi(e||d.event)).type="focus"===e.type?"focusin":"focusout",l.executeHandlers(e,o);}),(i=l.events[o][u])?"ready"===u&&l.domLoaded?n(Mi({type:u})):i.push({func:n,scope:r}):(l.events[o][u]=i=[{func:n,scope:r}],i.fakeName=c,i.capture=f,i.nativeHandler=s,"ready"===u?Fi(e,s,l):Li(e,c||u,s,f)));return e=i=null,n}},e.prototype.unbind=function(e,t,n){var r,o,i,a,u;if(!e||3===e.nodeType||8===e.nodeType)return this;var c=e[this.expando];if(c){if(u=this.events[c],t){var s=t.split(" ");for(o=s.length;o--;)if(r=u[a=s[o]]){if(n)for(i=r.length;i--;)if(r[i].func===n){var f=r.nativeHandler,l=r.fakeName,d=r.capture;(r=r.slice(0,i).concat(r.slice(i+1))).nativeHandler=f,r.fakeName=l,r.capture=d,u[a]=r;}n&&0!==r.length||(delete u[a],Ii(e,r.fakeName||a,r.nativeHandler,r.capture));}}else le(u,(function(t,n){Ii(e,t.fakeName||n,t.nativeHandler,t.capture);})),u={};for(a in u)if(ye(u,a))return this;delete this.events[c];try{delete e[this.expando];}catch(t){e[this.expando]=null;}}return this},e.prototype.fire=function(e,t,n){var r;if(!e||3===e.nodeType||8===e.nodeType)return this;var o=Mi({type:t,target:e},n);do{(r=e[this.expando])&&this.executeHandlers(o,r),e=e.parentNode||e.ownerDocument||e.defaultView||e.parentWindow;}while(e&&!o.isPropagationStopped());return this},e.prototype.clean=function(e){var t,n;if(!e||3===e.nodeType||8===e.nodeType)return this;if(e[this.expando]&&this.unbind(e),e.getElementsByTagName||(e=e.document),e&&e.getElementsByTagName)for(this.unbind(e),t=(n=e.getElementsByTagName("*")).length;t--;)(e=n[t])[this.expando]&&this.unbind(e);return this},e.prototype.destroy=function(){this.events={};},e.prototype.cancel=function(e){return e&&(e.preventDefault(),e.stopImmediatePropagation()),!1},e.prototype.executeHandlers=function(e,t){var n=this.events[t],r=n&&n[e.type];if(r)for(var o=0,i=r.length;o<i;o++){var a=r[o];if(a&&!1===a.func.call(a.scope,e)&&e.preventDefault(),e.isImmediatePropagationStopped())return}},e.Event=new e,e}(),zi="sizzle"+-new Date,Hi=window.document,ji=0,Vi=0,qi=Sa(),$i=Sa(),Wi=Sa(),Ki=function(e,t){return e===t&&(Ur=!0),0},Xi="undefined",Yi=1<<31,Gi={}.hasOwnProperty,Ji=[],Qi=Ji.pop,Zi=Ji.push,ea=Ji.push,ta=Ji.slice,na=Ji.indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(this[t]===e)return t;return -1},ra="[\\x20\\t\\r\\n\\f]",oa="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",ia="\\[[\\x20\\t\\r\\n\\f]*("+oa+")(?:"+ra+"*([*^$|!~]?=)"+ra+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+oa+"))|)"+ra+"*\\]",aa=":("+oa+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+ia+")*)|.*)\\)|)",ua=new RegExp("^[\\x20\\t\\r\\n\\f]+|((?:^|[^\\\\])(?:\\\\.)*)[\\x20\\t\\r\\n\\f]+$","g"),ca=new RegExp("^[\\x20\\t\\r\\n\\f]*,[\\x20\\t\\r\\n\\f]*"),sa=new RegExp("^[\\x20\\t\\r\\n\\f]*([>+~]|[\\x20\\t\\r\\n\\f])[\\x20\\t\\r\\n\\f]*"),fa=new RegExp("=[\\x20\\t\\r\\n\\f]*([^\\]'\"]*?)[\\x20\\t\\r\\n\\f]*\\]","g"),la=new RegExp(aa),da=new RegExp("^"+oa+"$"),ma={ID:new RegExp("^#("+oa+")"),CLASS:new RegExp("^\\.("+oa+")"),TAG:new RegExp("^("+oa+"|[*])"),ATTR:new RegExp("^"+ia),PSEUDO:new RegExp("^"+aa),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\([\\x20\\t\\r\\n\\f]*(even|odd|(([+-]|)(\\d*)n|)[\\x20\\t\\r\\n\\f]*(?:([+-]|)[\\x20\\t\\r\\n\\f]*(\\d+)|))[\\x20\\t\\r\\n\\f]*\\)|)","i"),bool:new RegExp("^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$","i"),needsContext:new RegExp("^[\\x20\\t\\r\\n\\f]*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\([\\x20\\t\\r\\n\\f]*((?:-\\d)?\\d*)[\\x20\\t\\r\\n\\f]*\\)|)(?=[^-]|$)","i")},ga=/^(?:input|select|textarea|button)$/i,pa=/^h\d$/i,ha=/^[^{]+\{\s*\[native \w/,va=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ba=/[+~]/,ya=/'|\\/g,Ca=new RegExp("\\\\([\\da-f]{1,6}[\\x20\\t\\r\\n\\f]?|([\\x20\\t\\r\\n\\f])|.)","ig"),xa=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{ea.apply(Ji=ta.call(Hi.childNodes),Hi.childNodes),Ji[Hi.childNodes.length].nodeType;}catch(e){ea={apply:Ji.length?function(e,t){Zi.apply(e,ta.call(t));}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1;}};}var wa=function(e,t,n,r){var o,i,a,u,c,s,f,l,d,m;if((t?t.ownerDocument||t:Hi)!==Hr&&zr(t),n=n||[],!e||"string"!=typeof e)return n;if(1!==(u=(t=t||Hr).nodeType)&&9!==u)return [];if(Vr&&!r){if(o=va.exec(e))if(a=o[1]){if(9===u){if(!(i=t.getElementById(a))||!i.parentNode)return n;if(i.id===a)return n.push(i),n}else if(t.ownerDocument&&(i=t.ownerDocument.getElementById(a))&&Wr(t,i)&&i.id===a)return n.push(i),n}else {if(o[2])return ea.apply(n,t.getElementsByTagName(e)),n;if((a=o[3])&&Dr.getElementsByClassName)return ea.apply(n,t.getElementsByClassName(a)),n}if(Dr.qsa&&(!qr||!qr.test(e))){if(l=f=zi,d=t,m=9===u&&e,1===u&&"object"!==t.nodeName.toLowerCase()){for(s=Pr(e),(f=t.getAttribute("id"))?l=f.replace(ya,"\\$&"):t.setAttribute("id",l),l="[id='"+l+"'] ",c=s.length;c--;)s[c]=l+Ra(s[c]);d=ba.test(e)&&_a(t.parentNode)||t,m=s.join(",");}if(m)try{return ea.apply(n,d.querySelectorAll(m)),n}catch(e){}finally{f||t.removeAttribute("id");}}}return Ir(e.replace(ua,"$1"),t,n,r)};function Sa(){var e=[];return function t(n,r){return e.push(n+" ")>Tr.cacheLength&&delete t[e.shift()],t[n+" "]=r}}function ka(e){return e[zi]=!0,e}function Na(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||Yi)-(~e.sourceIndex||Yi);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return -1;return e?1:-1}function Ea(e){return ka((function(t){return t=+t,ka((function(n,r){for(var o,i=e([],n.length,t),a=i.length;a--;)n[o=i[a]]&&(n[o]=!(r[o]=n[o]));}))}))}function _a(e){return e&&typeof e.getElementsByTagName!==Xi&&e}function Aa(){}function Ra(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function Da(e,t,n){var r=t.dir,o=n&&"parentNode"===r,i=Vi++;return t.first?function(t,n,i){for(;t=t[r];)if(1===t.nodeType||o)return e(t,n,i)}:function(t,n,a){var u,c,s=[ji,i];if(a){for(;t=t[r];)if((1===t.nodeType||o)&&e(t,n,a))return !0}else for(;t=t[r];)if(1===t.nodeType||o){if((u=(c=t[zi]||(t[zi]={}))[r])&&u[0]===ji&&u[1]===i)return s[2]=u[2];if(c[r]=s,s[2]=e(t,n,a))return !0}}}function Ta(e){return e.length>1?function(t,n,r){for(var o=e.length;o--;)if(!e[o](t,n,r))return !1;return !0}:e[0]}function Oa(e,t,n,r,o){for(var i,a=[],u=0,c=e.length,s=null!=t;u<c;u++)(i=e[u])&&(n&&!n(i,r,o)||(a.push(i),s&&t.push(u)));return a}function Ba(e,t,n,r,o,i){return r&&!r[zi]&&(r=Ba(r)),o&&!o[zi]&&(o=Ba(o,i)),ka((function(i,a,u,c){var s,f,l,d=[],m=[],g=a.length,p=i||function(e,t,n){for(var r=0,o=t.length;r<o;r++)wa(e,t[r],n);return n}(t||"*",u.nodeType?[u]:u,[]),h=!e||!i&&t?p:Oa(p,d,e,u,c),v=n?o||(i?e:g||r)?[]:a:h;if(n&&n(h,v,u,c),r)for(s=Oa(v,m),r(s,[],u,c),f=s.length;f--;)(l=s[f])&&(v[m[f]]=!(h[m[f]]=l));if(i){if(o||e){if(o){for(s=[],f=v.length;f--;)(l=v[f])&&s.push(h[f]=l);o(null,v=[],s,c);}for(f=v.length;f--;)(l=v[f])&&(s=o?na.call(i,l):d[f])>-1&&(i[s]=!(a[s]=l));}}else v=Oa(v===a?v.splice(g,v.length):v),o?o(null,a,v,c):ea.apply(a,v);}))}function Pa(e){for(var t,n,r,o=e.length,i=Tr.relative[e[0].type],a=i||Tr.relative[" "],u=i?1:0,c=Da((function(e){return e===t}),a,!0),s=Da((function(e){return na.call(t,e)>-1}),a,!0),f=[function(e,n,r){var o=!i&&(r||n!==Mr)||((t=n).nodeType?c(e,n,r):s(e,n,r));return t=null,o}];u<o;u++)if(n=Tr.relative[e[u].type])f=[Da(Ta(f),n)];else {if((n=Tr.filter[e[u].type].apply(null,e[u].matches))[zi]){for(r=++u;r<o&&!Tr.relative[e[r].type];r++);return Ba(u>1&&Ta(f),u>1&&Ra(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(ua,"$1"),n,u<r&&Pa(e.slice(u,r)),r<o&&Pa(e=e.slice(r)),r<o&&Ra(e))}f.push(n);}return Ta(f)}Dr=wa.support={},Br=wa.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return !!t&&"HTML"!==t.nodeName},zr=wa.setDocument=function(e){var t,n=e?e.ownerDocument||e:Hi,r=n.defaultView;return n!==Hr&&9===n.nodeType&&n.documentElement?(Hr=n,jr=n.documentElement,Vr=!Br(n),r&&r!==function(e){try{return e.top}catch(e){}return null}(r)&&(r.addEventListener?r.addEventListener("unload",(function(){zr();}),!1):r.attachEvent&&r.attachEvent("onunload",(function(){zr();}))),Dr.attributes=!0,Dr.getElementsByTagName=!0,Dr.getElementsByClassName=ha.test(n.getElementsByClassName),Dr.getById=!0,Tr.find.ID=function(e,t){if(typeof t.getElementById!==Xi&&Vr){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},Tr.filter.ID=function(e){var t=e.replace(Ca,xa);return function(e){return e.getAttribute("id")===t}},Tr.find.TAG=Dr.getElementsByTagName?function(e,t){if(typeof t.getElementsByTagName!==Xi)return t.getElementsByTagName(e)}:function(e,t){var n,r=[],o=0,i=t.getElementsByTagName(e);if("*"===e){for(;n=i[o++];)1===n.nodeType&&r.push(n);return r}return i},Tr.find.CLASS=Dr.getElementsByClassName&&function(e,t){if(Vr)return t.getElementsByClassName(e)},$r=[],qr=[],Dr.disconnectedMatch=!0,qr=qr.length&&new RegExp(qr.join("|")),$r=$r.length&&new RegExp($r.join("|")),t=ha.test(jr.compareDocumentPosition),Wr=t||ha.test(jr.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return !0;return !1},Ki=t?function(e,t){if(e===t)return Ur=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!Dr.sortDetached&&t.compareDocumentPosition(e)===r?e===n||e.ownerDocument===Hi&&Wr(Hi,e)?-1:t===n||t.ownerDocument===Hi&&Wr(Hi,t)?1:Fr?na.call(Fr,e)-na.call(Fr,t):0:4&r?-1:1)}:function(e,t){if(e===t)return Ur=!0,0;var r,o=0,i=e.parentNode,a=t.parentNode,u=[e],c=[t];if(!i||!a)return e===n?-1:t===n?1:i?-1:a?1:Fr?na.call(Fr,e)-na.call(Fr,t):0;if(i===a)return Na(e,t);for(r=e;r=r.parentNode;)u.unshift(r);for(r=t;r=r.parentNode;)c.unshift(r);for(;u[o]===c[o];)o++;return o?Na(u[o],c[o]):u[o]===Hi?-1:c[o]===Hi?1:0},n):Hr},wa.matches=function(e,t){return wa(e,null,null,t)},wa.matchesSelector=function(e,t){if((e.ownerDocument||e)!==Hr&&zr(e),t=t.replace(fa,"='$1']"),Dr.matchesSelector&&Vr&&(!$r||!$r.test(t))&&(!qr||!qr.test(t)))try{var n=undefined.call(e,t);if(n||Dr.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){}return wa(t,Hr,null,[e]).length>0},wa.contains=function(e,t){return (e.ownerDocument||e)!==Hr&&zr(e),Wr(e,t)},wa.attr=function(e,t){(e.ownerDocument||e)!==Hr&&zr(e);var n=Tr.attrHandle[t.toLowerCase()],r=n&&Gi.call(Tr.attrHandle,t.toLowerCase())?n(e,t,!Vr):void 0;return void 0!==r?r:Dr.attributes||!Vr?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},wa.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},wa.uniqueSort=function(e){var t,n=[],r=0,o=0;if(Ur=!Dr.detectDuplicates,Fr=!Dr.sortStable&&e.slice(0),e.sort(Ki),Ur){for(;t=e[o++];)t===e[o]&&(r=n.push(o));for(;r--;)e.splice(n[r],1);}return Fr=null,e},Or=wa.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=Or(e);}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=Or(t);return n},Tr=wa.selectors={cacheLength:50,createPseudo:ka,match:ma,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Ca,xa),e[3]=(e[3]||e[4]||e[5]||"").replace(Ca,xa),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||wa.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&wa.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return ma.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&la.test(n)&&(t=Pr(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Ca,xa).toLowerCase();return "*"===e?function(){return !0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=qi[e+" "];return t||(t=new RegExp("(^|[\\x20\\t\\r\\n\\f])"+e+"("+ra+"|$)"))&&qi(e,(function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==Xi&&e.getAttribute("class")||"")}))},ATTR:function(e,t,n){return function(r){var o=wa.attr(r,e);return null==o?"!="===t:!t||(o+="","="===t?o===n:"!="===t?o!==n:"^="===t?n&&0===o.indexOf(n):"*="===t?n&&o.indexOf(n)>-1:"$="===t?n&&o.slice(-n.length)===n:"~="===t?(" "+o+" ").indexOf(n)>-1:"|="===t&&(o===n||o.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,o){var i="nth"!==e.slice(0,3),a="last"!==e.slice(-4),u="of-type"===t;return 1===r&&0===o?function(e){return !!e.parentNode}:function(t,n,c){var s,f,l,d,m,g,p=i!==a?"nextSibling":"previousSibling",h=t.parentNode,v=u&&t.nodeName.toLowerCase(),b=!c&&!u;if(h){if(i){for(;p;){for(l=t;l=l[p];)if(u?l.nodeName.toLowerCase()===v:1===l.nodeType)return !1;g=p="only"===e&&!g&&"nextSibling";}return !0}if(g=[a?h.firstChild:h.lastChild],a&&b){for(m=(s=(f=h[zi]||(h[zi]={}))[e]||[])[0]===ji&&s[1],d=s[0]===ji&&s[2],l=m&&h.childNodes[m];l=++m&&l&&l[p]||(d=m=0)||g.pop();)if(1===l.nodeType&&++d&&l===t){f[e]=[ji,m,d];break}}else if(b&&(s=(t[zi]||(t[zi]={}))[e])&&s[0]===ji)d=s[1];else for(;(l=++m&&l&&l[p]||(d=m=0)||g.pop())&&((u?l.nodeName.toLowerCase()!==v:1!==l.nodeType)||!++d||(b&&((l[zi]||(l[zi]={}))[e]=[ji,d]),l!==t)););return (d-=o)===r||d%r==0&&d/r>=0}}},PSEUDO:function(e,t){var n,r=Tr.pseudos[e]||Tr.setFilters[e.toLowerCase()]||wa.error("unsupported pseudo: "+e);return r[zi]?r(t):r.length>1?(n=[e,e,"",t],Tr.setFilters.hasOwnProperty(e.toLowerCase())?ka((function(e,n){for(var o,i=r(e,t),a=i.length;a--;)e[o=na.call(e,i[a])]=!(n[o]=i[a]);})):function(e){return r(e,0,n)}):r}},pseudos:{not:ka((function(e){var t=[],n=[],r=Lr(e.replace(ua,"$1"));return r[zi]?ka((function(e,t,n,o){for(var i,a=r(e,null,o,[]),u=e.length;u--;)(i=a[u])&&(e[u]=!(t[u]=i));})):function(e,o,i){return t[0]=e,r(t,null,i,n),t[0]=null,!n.pop()}})),has:ka((function(e){return function(t){return wa(e,t).length>0}})),contains:ka((function(e){return e=e.replace(Ca,xa),function(t){return (t.textContent||t.innerText||Or(t)).indexOf(e)>-1}})),lang:ka((function(e){return da.test(e||"")||wa.error("unsupported lang: "+e),e=e.replace(Ca,xa).toLowerCase(),function(t){var n;do{if(n=Vr?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return (n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return !1}})),target:function(e){var t=window.location&&window.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===jr},focus:function(e){return e===Hr.activeElement&&(!Hr.hasFocus||Hr.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return !1===e.disabled},disabled:function(e){return !0===e.disabled},checked:function(e){var t=e.nodeName.toLowerCase();return "input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return !1;return !0},parent:function(e){return !Tr.pseudos.empty(e)},header:function(e){return pa.test(e.nodeName)},input:function(e){return ga.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return "input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return "input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:Ea((function(){return [0]})),last:Ea((function(e,t){return [t-1]})),eq:Ea((function(e,t,n){return [n<0?n+t:n]})),even:Ea((function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e})),odd:Ea((function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e})),lt:Ea((function(e,t,n){for(var r=n<0?n+t:n;--r>=0;)e.push(r);return e})),gt:Ea((function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e}))}},Tr.pseudos.nth=Tr.pseudos.eq,q(["radio","checkbox","file","password","image"],(function(e){Tr.pseudos[e]=function(e){return function(t){return "input"===t.nodeName.toLowerCase()&&t.type===e}}(e);})),q(["submit","reset"],(function(e){Tr.pseudos[e]=function(e){return function(t){var n=t.nodeName.toLowerCase();return ("input"===n||"button"===n)&&t.type===e}}(e);})),Aa.prototype=Tr.filters=Tr.pseudos,Tr.setFilters=new Aa,Pr=wa.tokenize=function(e,t){var n,r,o,i,a,u,c,s=$i[e+" "];if(s)return t?0:s.slice(0);for(a=e,u=[],c=Tr.preFilter;a;){for(i in n&&!(r=ca.exec(a))||(r&&(a=a.slice(r[0].length)||a),u.push(o=[])),n=!1,(r=sa.exec(a))&&(n=r.shift(),o.push({value:n,type:r[0].replace(ua," ")}),a=a.slice(n.length)),Tr.filter)Tr.filter.hasOwnProperty(i)&&(!(r=ma[i].exec(a))||c[i]&&!(r=c[i](r))||(n=r.shift(),o.push({value:n,type:i,matches:r}),a=a.slice(n.length)));if(!n)break}return t?a.length:a?wa.error(e):$i(e,u).slice(0)},Lr=wa.compile=function(e,t){var n,r=[],o=[],i=Wi[e+" "];if(!i){for(t||(t=Pr(e)),n=t.length;n--;)(i=Pa(t[n]))[zi]?r.push(i):o.push(i);i=Wi(e,function(e,t){var n=t.length>0,r=e.length>0,o=function(o,i,a,u,c){var s,f,l,d=0,m="0",g=o&&[],p=[],h=Mr,v=o||r&&Tr.find.TAG("*",c),b=ji+=null==h?1:Math.random()||.1,y=v.length;for(c&&(Mr=i!==Hr&&i);m!==y&&null!=(s=v[m]);m++){if(r&&s){for(f=0;l=e[f++];)if(l(s,i,a)){u.push(s);break}c&&(ji=b);}n&&((s=!l&&s)&&d--,o&&g.push(s));}if(d+=m,n&&m!==d){for(f=0;l=t[f++];)l(g,p,i,a);if(o){if(d>0)for(;m--;)g[m]||p[m]||(p[m]=Qi.call(u));p=Oa(p);}ea.apply(u,p),c&&!o&&p.length>0&&d+t.length>1&&wa.uniqueSort(u);}return c&&(ji=b,Mr=h),g};return n?ka(o):o}(o,r)),i.selector=e;}return i},Ir=wa.select=function(e,t,n,r){var o,i,a,u,c,s="function"==typeof e&&e,f=!r&&Pr(e=s.selector||e);if(n=n||[],1===f.length){if((i=f[0]=f[0].slice(0)).length>2&&"ID"===(a=i[0]).type&&Dr.getById&&9===t.nodeType&&Vr&&Tr.relative[i[1].type]){if(!(t=(Tr.find.ID(a.matches[0].replace(Ca,xa),t)||[])[0]))return n;s&&(t=t.parentNode),e=e.slice(i.shift().value.length);}for(o=ma.needsContext.test(e)?0:i.length;o--&&(a=i[o],!Tr.relative[u=a.type]);)if((c=Tr.find[u])&&(r=c(a.matches[0].replace(Ca,xa),ba.test(i[0].type)&&_a(t.parentNode)||t))){if(i.splice(o,1),!(e=r.length&&Ra(i)))return ea.apply(n,r),n;break}}return (s||Lr(e,f))(r,t,!Vr,n,ba.test(e)&&_a(t.parentNode)||t),n},Dr.sortStable=zi.split("").sort(Ki).join("")===zi,Dr.detectDuplicates=!!Ur,zr(),Dr.sortDetached=!0;var La=document,Ia=Array.prototype.push,Ma=Array.prototype.slice,Fa=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,Ua=Ui.Event,za=_t.makeMap("children,contents,next,prev"),Ha=function(e){return void 0!==e},ja=function(e){return "string"==typeof e},Va=function(e,t){var n,r=(t=t||La).createElement("div"),o=t.createDocumentFragment();for(r.innerHTML=e;n=r.firstChild;)o.appendChild(n);return o},qa=function(e,t,n,r){var o;if(ja(t))t=Va(t,ou(e[0]));else if(t.length&&!t.nodeType){if(t=cu.makeArray(t),r)for(o=t.length-1;o>=0;o--)qa(e,t[o],n,r);else for(o=0;o<t.length;o++)qa(e,t[o],n,r);return e}if(t.nodeType)for(o=e.length;o--;)n.call(e[o],t);return e},$a=function(e,t){return e&&t&&-1!==(" "+e.className+" ").indexOf(" "+t+" ")},Wa=function(e,t,n){var r,o;return t=cu(t)[0],e.each((function(){var e=this;n&&r===e.parentNode||(r=e.parentNode,o=t.cloneNode(!1),e.parentNode.insertBefore(o,e)),o.appendChild(e);})),e},Ka=_t.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),Xa=_t.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),Ya={for:"htmlFor",class:"className",readonly:"readOnly"},Ga={float:"cssFloat"},Ja={},Qa={},Za=function(e,t){return new cu.fn.init(e,t)},eu=/^\s*|\s*$/g,tu=function(e){return null==e?"":(""+e).replace(eu,"")},nu=function(e,t){var n,r,o,i;if(e)if(void 0===(n=e.length)){for(r in e)if(e.hasOwnProperty(r)&&(i=e[r],!1===t.call(i,r,i)))break}else for(o=0;o<n&&(i=e[o],!1!==t.call(i,o,i));o++);return e},ru=function(e,t){var n=[];return nu(e,(function(e,r){t(r,e)&&n.push(r);})),n},ou=function(e){return e?9===e.nodeType?e:e.ownerDocument:La};Za.fn=Za.prototype={constructor:Za,selector:"",context:null,length:0,init:function(e,t){var n,r,o=this;if(!e)return o;if(e.nodeType)return o.context=o[0]=e,o.length=1,o;if(t&&t.nodeType)o.context=t;else {if(t)return cu(e).attr(t);o.context=t=document;}if(ja(e)){if(o.selector=e,!(n="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:Fa.exec(e)))return cu(t).find(e);if(n[1])for(r=Va(e,ou(t)).firstChild;r;)Ia.call(o,r),r=r.nextSibling;else {if(!(r=ou(t).getElementById(n[2])))return o;if(r.id!==n[2])return o.find(e);o.length=1,o[0]=r;}}else this.add(e,!1);return o},toArray:function(){return _t.toArray(this)},add:function(e,t){var n,r,o=this;if(ja(e))return o.add(cu(e));if(!1!==t)for(n=cu.unique(o.toArray().concat(cu.makeArray(e))),o.length=n.length,r=0;r<n.length;r++)o[r]=n[r];else Ia.apply(o,cu.makeArray(e));return o},attr:function(e,t){var n,r=this;if("object"==typeof e)nu(e,(function(e,t){r.attr(e,t);}));else {if(!Ha(t)){if(r[0]&&1===r[0].nodeType){if((n=Ja[e])&&n.get)return n.get(r[0],e);if(Xa[e])return r.prop(e)?e:void 0;null===(t=r[0].getAttribute(e,2))&&(t=void 0);}return t}this.each((function(){var n;if(1===this.nodeType){if((n=Ja[e])&&n.set)return void n.set(this,t);null===t?this.removeAttribute(e,2):this.setAttribute(e,t,2);}}));}return r},removeAttr:function(e){return this.attr(e,null)},prop:function(e,t){var n=this;if("object"==typeof(e=Ya[e]||e))nu(e,(function(e,t){n.prop(e,t);}));else {if(!Ha(t))return n[0]&&n[0].nodeType&&e in n[0]?n[0][e]:t;this.each((function(){1===this.nodeType&&(this[e]=t);}));}return n},css:function(e,t){var n,r,o=this,i=function(e){return e.replace(/-(\D)/g,(function(e,t){return t.toUpperCase()}))},a=function(e){return e.replace(/[A-Z]/g,(function(e){return "-"+e}))};if("object"==typeof e)nu(e,(function(e,t){o.css(e,t);}));else if(Ha(t))e=i(e),"number"!=typeof t||Ka[e]||(t=t.toString()+"px"),o.each((function(){var n=this.style;if((r=Qa[e])&&r.set)r.set(this,t);else {try{this.style[Ga[e]||e]=t;}catch(e){}null!==t&&""!==t||(n.removeProperty?n.removeProperty(a(e)):n.removeAttribute(e));}}));else {if(n=o[0],(r=Qa[e])&&r.get)return r.get(n);if(!n.ownerDocument.defaultView)return n.currentStyle?n.currentStyle[i(e)]:"";try{return n.ownerDocument.defaultView.getComputedStyle(n,null).getPropertyValue(a(e))}catch(e){return}}return o},remove:function(){for(var e,t=this.length;t--;)e=this[t],Ua.clean(e),e.parentNode&&e.parentNode.removeChild(e);return this},empty:function(){for(var e,t=this.length;t--;)for(e=this[t];e.firstChild;)e.removeChild(e.firstChild);return this},html:function(e){var t,n=this;if(Ha(e)){t=n.length;try{for(;t--;)n[t].innerHTML=e;}catch(r){cu(n[t]).empty().append(e);}return n}return n[0]?n[0].innerHTML:""},text:function(e){var t,n=this;if(Ha(e)){for(t=n.length;t--;)"innerText"in n[t]?n[t].innerText=e:n[0].textContent=e;return n}return n[0]?n[0].innerText||n[0].textContent:""},append:function(){return qa(this,arguments,(function(e){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.appendChild(e);}))},prepend:function(){return qa(this,arguments,(function(e){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.insertBefore(e,this.firstChild);}),!0)},before:function(){var e=this;return e[0]&&e[0].parentNode?qa(e,arguments,(function(e){this.parentNode.insertBefore(e,this);})):e},after:function(){var e=this;return e[0]&&e[0].parentNode?qa(e,arguments,(function(e){this.parentNode.insertBefore(e,this.nextSibling);}),!0):e},appendTo:function(e){return cu(e).append(this),this},prependTo:function(e){return cu(e).prepend(this),this},replaceWith:function(e){return this.before(e).remove()},wrap:function(e){return Wa(this,e)},wrapAll:function(e){return Wa(this,e,!0)},wrapInner:function(e){return this.each((function(){cu(this).contents().wrapAll(e);})),this},unwrap:function(){return this.parent().each((function(){cu(this).replaceWith(this.childNodes);}))},clone:function(){var e=[];return this.each((function(){e.push(this.cloneNode(!0));})),cu(e)},addClass:function(e){return this.toggleClass(e,!0)},removeClass:function(e){return this.toggleClass(e,!1)},toggleClass:function(e,t){var n=this;return "string"!=typeof e||(-1!==e.indexOf(" ")?nu(e.split(" "),(function(){n.toggleClass(this,t);})):n.each((function(n,r){var o=$a(r,e);if(o!==t){var i=r.className;o?r.className=tu((" "+i+" ").replace(" "+e+" "," ")):r.className+=i?" "+e:e;}}))),n},hasClass:function(e){return $a(this[0],e)},each:function(e){return nu(this,e)},on:function(e,t){return this.each((function(){Ua.bind(this,e,t);}))},off:function(e,t){return this.each((function(){Ua.unbind(this,e,t);}))},trigger:function(e){return this.each((function(){"object"==typeof e?Ua.fire(this,e.type,e):Ua.fire(this,e);}))},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return cu(Ma.apply(this,arguments))},eq:function(e){return -1===e?this.slice(e):this.slice(e,+e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},find:function(e){var t,n,r=[];for(t=0,n=this.length;t<n;t++)cu.find(e,this[t],r);return cu(r)},filter:function(e){return cu("function"==typeof e?ru(this.toArray(),(function(t,n){return e(n,t)})):cu.filter(e,this.toArray()))},closest:function(e){var t=[];return e instanceof cu&&(e=e[0]),this.each((function(n,r){for(;r;){if("string"==typeof e&&cu(r).is(e)){t.push(r);break}if(r===e){t.push(r);break}r=r.parentNode;}})),cu(t)},offset:function(e){var t,n,r,o,i=0,a=0;return e?this.css(e):((t=this[0])&&(r=(n=t.ownerDocument).documentElement,t.getBoundingClientRect&&(i=(o=t.getBoundingClientRect()).left+(r.scrollLeft||n.body.scrollLeft)-r.clientLeft,a=o.top+(r.scrollTop||n.body.scrollTop)-r.clientTop)),{left:i,top:a})},push:Ia,sort:Array.prototype.sort,splice:Array.prototype.splice},_t.extend(Za,{extend:_t.extend,makeArray:function(e){return (t=e)&&t===t.window||e.nodeType?[e]:_t.toArray(e);var t;},inArray:function(e,t){var n;if(t.indexOf)return t.indexOf(e);for(n=t.length;n--;)if(t[n]===e)return n;return -1},isArray:_t.isArray,each:nu,trim:tu,grep:ru,find:wa,expr:wa.selectors,unique:wa.uniqueSort,text:wa.getText,contains:wa.contains,filter:function(e,t,n){var r=t.length;for(n&&(e=":not("+e+")");r--;)1!==t[r].nodeType&&t.splice(r,1);return t=1===t.length?cu.find.matchesSelector(t[0],e)?[t[0]]:[]:cu.find.matches(e,t)}});var iu=function(e,t,n){var r=[],o=e[t];for("string"!=typeof n&&n instanceof cu&&(n=n[0]);o&&9!==o.nodeType;){if(void 0!==n){if(o===n)break;if("string"==typeof n&&cu(o).is(n))break}1===o.nodeType&&r.push(o),o=o[t];}return r},au=function(e,t,n,r){var o=[];for(r instanceof cu&&(r=r[0]);e;e=e[t])if(!n||e.nodeType===n){if(void 0!==r){if(e===r)break;if("string"==typeof r&&cu(e).is(r))break}o.push(e);}return o},uu=function(e,t,n){for(e=e[t];e;e=e[t])if(e.nodeType===n)return e;return null};nu({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return iu(e,"parentNode")},next:function(e){return uu(e,"nextSibling",1)},prev:function(e){return uu(e,"previousSibling",1)},children:function(e){return au(e.firstChild,"nextSibling",1)},contents:function(e){return _t.toArray(("iframe"===e.nodeName?e.contentDocument||e.contentWindow.document:e).childNodes)}},(function(e,t){Za.fn[e]=function(n){var r=[];this.each((function(){var e=t.call(r,this,n,r);e&&(cu.isArray(e)?r.push.apply(r,e):r.push(e));})),this.length>1&&(za[e]||(r=cu.unique(r)),0===e.indexOf("parents")&&(r=r.reverse()));var o=cu(r);return n?o.filter(n):o};})),nu({parentsUntil:function(e,t){return iu(e,"parentNode",t)},nextUntil:function(e,t){return au(e,"nextSibling",1,t).slice(1)},prevUntil:function(e,t){return au(e,"previousSibling",1,t).slice(1)}},(function(e,t){Za.fn[e]=function(n,r){var o=[];this.each((function(){var e=t.call(o,this,n,o);e&&(cu.isArray(e)?o.push.apply(o,e):o.push(e));})),this.length>1&&(o=cu.unique(o),0!==e.indexOf("parents")&&"prevUntil"!==e||(o=o.reverse()));var i=cu(o);return r?i.filter(r):i};})),Za.fn.is=function(e){return !!e&&this.filter(e).length>0},Za.fn.init.prototype=Za.fn,Za.overrideDefaults=function(e){var t,n=function(r,o){return t=t||e(),0===arguments.length&&(r=t.element),o||(o=t.context),new n.fn.init(r,o)};return cu.extend(n,this),n},Za.attrHooks=Ja,Za.cssHooks=Qa;var cu=Za,su=_t.each,fu=_t.grep,lu=wt.ie,du=/^([a-z0-9],?)+$/i,mu=function(e,t){var n=t.attr("style"),r=e.serialize(e.parse(n),t[0].nodeName);r||(r=null),t.attr("data-mce-style",r);},gu=function(e,t){var n,r,o=0;if(e)for(n=e.nodeType,e=e.previousSibling;e;e=e.previousSibling)r=e.nodeType,(!t||3!==r||r!==n&&e.nodeValue.length)&&(o++,n=r);return o},pu=function(e,t){void 0===t&&(t={});var n={},r=window,o={},i=0,a=io.forElement(Rt.fromDom(e),{contentCssCors:t.contentCssCors,referrerPolicy:t.referrerPolicy}),u=[],c=t.schema?t.schema:Ai({}),s=Di({url_converter:t.url_converter,url_converter_scope:t.url_converter_scope},t.schema),f=t.ownEvents?new Ui:Ui.Event,d=c.getBlockElements(),m=cu.overrideDefaults((function(){return {context:e,element:V.getRoot()}})),g=function(t){return t&&e&&l(t)?e.getElementById(t):t},p=function(e){return m("string"==typeof e?g(e):e)},h=function(e,t,n){var r,o,i=p(e);return i.length&&(o=(r=$[t])&&r.get?r.get(i,t):i.attr(t)),void 0===o&&(o=n||""),o},b=function(e){var t=g(e);return t?t.attributes:[]},y=function(e,n,r){""===r&&(r=null);var o=p(e),i=o.attr(n);if(o.length){var a=$[n];a&&a.set?a.set(o,r,n):o.attr(n,r),i!==r&&t.onSetAttrib&&t.onSetAttrib({attrElm:o,attrName:n,attrValue:r});}},C=function(){return t.root_element||e.body},w=function(t,n){return lr(e.body,g(t),n)},S=function(e,t,n){var r=p(e);return n?r.css(t):("float"===(t=t.replace(/-(\D)/g,(function(e,t){return t.toUpperCase()})))&&(t=wt.browser.isIE()?"styleFloat":"cssFloat"),r[0]&&r[0].style?r[0].style[t]:void 0)},N=function(e){var t,n;return e=g(e),t=S(e,"width"),n=S(e,"height"),-1===t.indexOf("px")&&(t=0),-1===n.indexOf("px")&&(n=0),{w:parseInt(t,10)||e.offsetWidth||e.clientWidth,h:parseInt(n,10)||e.offsetHeight||e.clientHeight}},E=function(e,t){var n;if(!e)return !1;if(!Array.isArray(e)){if("*"===t)return 1===e.nodeType;if(du.test(t)){var r=t.toLowerCase().split(/,/),o=e.nodeName.toLowerCase();for(n=r.length-1;n>=0;n--)if(r[n]===o)return !0;return !1}if(e.nodeType&&1!==e.nodeType)return !1}var i=Array.isArray(e)?e:[e];return wa(t,i[0].ownerDocument||i[0],null,i).length>0},_=function(e,t,n,r){var o,i=[],a=g(e);for(r=void 0===r,n=n||("BODY"!==C().nodeName?C().parentNode:null),_t.is(t,"string")&&(o=t,t="*"===t?function(e){return 1===e.nodeType}:function(e){return E(e,o)});a&&!(a===n||v(a.nodeType)||zn(a)||Hn(a));){if(!t||"function"==typeof t&&t(a)){if(!r)return [a];i.push(a);}a=a.parentNode;}return r?i:null},A=function(e,t,n){var r=t;if(e)for("string"==typeof t&&(r=function(e){return E(e,t)}),e=e[n];e;e=e[n])if("function"==typeof r&&r(e))return e;return null},R=function(e,t,n){var r,o="string"==typeof e?g(e):e;if(!o)return !1;if(_t.isArray(o)&&(o.length||0===o.length))return r=[],su(o,(function(e,o){e&&r.push(t.call(n,"string"==typeof e?g(e):e,o));})),r;var i=n||this;return t.call(i,o)},D=function(e,t){p(e).each((function(e,n){su(t,(function(e,t){y(n,t,e);}));}));},T=function(e,t){var n=p(e);lu?n.each((function(e,n){if(!1!==n.canHaveHTML){for(;n.firstChild;)n.removeChild(n.firstChild);try{n.innerHTML="<br>"+t,n.removeChild(n.firstChild);}catch(e){cu("<div></div>").html("<br>"+t).contents().slice(1).appendTo(n);}return t}})):n.html(t);},O=function(t,n,r,o,i){return R(t,(function(t){var a="string"==typeof n?e.createElement(n):n;return D(a,r),o&&("string"!=typeof o&&o.nodeType?a.appendChild(o):"string"==typeof o&&T(a,o)),i?a:t.appendChild(a)}))},B=function(t,n,r){return O(e.createElement(t),t,n,r,!0)},P=bi.encodeAllRaw,L=function(e,t){var n=p(e);return t?n.each((function(){for(var e;e=this.firstChild;)3===e.nodeType&&0===e.data.length?this.removeChild(e):this.parentNode.insertBefore(e,this);})).remove():n.remove(),n.length>1?n.toArray():n[0]},I=function(e,t,n){p(e).toggleClass(t,n).each((function(){""===this.className&&cu(this).attr("class",null);}));},M=function(e,t,n){return R(t,(function(t){return _t.is(t,"array")&&(e=e.cloneNode(!0)),n&&su(fu(t.childNodes),(function(t){e.appendChild(t);})),t.parentNode.replaceChild(e,t)}))},F=function(e){if(Dn(e)){var t="a"===e.nodeName.toLowerCase()&&!h(e,"href")&&h(e,"id");if(h(e,"name")||h(e,"data-mce-bookmark")||t)return !0}return !1},U=function(){return e.createRange()},z=function(n,o,i,a){if(_t.isArray(n)){for(var c=n.length,s=[];c--;)s[c]=z(n[c],o,i,a);return s}return !t.collect||n!==e&&n!==r||u.push([n,o,i,a]),f.bind(n,o,i,a||V)},H=function(t,n,o){if(_t.isArray(t)){for(var i=t.length,a=[];i--;)a[i]=H(t[i],n,o);return a}if(u.length>0&&(t===e||t===r))for(i=u.length;i--;){var c=u[i];t!==c[0]||n&&n!==c[1]||o&&o!==c[2]||f.unbind(c[0],c[1],c[2]);}return f.unbind(t,n,o)},j=function(e){if(e&&Dn(e)){var t=e.getAttribute("data-mce-contenteditable");return t&&"inherit"!==t?t:"inherit"!==e.contentEditable?e.contentEditable:null}return null},V={doc:e,settings:t,win:r,files:o,stdMode:!0,boxModel:!0,styleSheetLoader:a,boundEvents:u,styles:s,schema:c,events:f,isBlock:function(e){if("string"==typeof e)return !!d[e];if(e){var t=e.nodeType;if(t)return !(1!==t||!d[e.nodeName])}return !1},$:m,$$:p,root:null,clone:function(t,n){if(!lu||1!==t.nodeType||n)return t.cloneNode(n);var r=e.createElement(t.nodeName);return su(b(t),(function(e){y(r,e.nodeName,h(t,e.nodeName));})),r},getRoot:C,getViewPort:function(e){var t=_n(e);return {x:t.x,y:t.y,w:t.width,h:t.height}},getRect:function(e){e=g(e);var t=w(e),n=N(e);return {x:t.x,y:t.y,w:n.w,h:n.h}},getSize:N,getParent:function(e,t,n){var r=_(e,t,n,!1);return r&&r.length>0?r[0]:null},getParents:_,get:g,getNext:function(e,t){return A(e,t,"nextSibling")},getPrev:function(e,t){return A(e,t,"previousSibling")},select:function(n,r){return wa(n,g(r)||t.root_element||e,[])},is:E,add:O,create:B,createHTML:function(e,t,n){var r,o="";for(r in o+="<"+e,t)Ce(t,r)&&(o+=" "+r+'="'+P(t[r])+'"');return void 0!==n?o+">"+n+"</"+e+">":o+" />"},createFragment:function(t){var n,r=e.createElement("div"),o=e.createDocumentFragment();for(o.appendChild(r),t&&(r.innerHTML=t);n=r.firstChild;)o.appendChild(n);return o.removeChild(r),o},remove:L,setStyle:function(e,n,r){var o=l(n)?p(e).css(n,r):p(e).css(n);t.update_styles&&mu(s,o);},getStyle:S,setStyles:function(e,n){var r=p(e).css(n);t.update_styles&&mu(s,r);},removeAllAttribs:function(e){return R(e,(function(e){var t,n=e.attributes;for(t=n.length-1;t>=0;t--)e.removeAttributeNode(n.item(t));}))},setAttrib:y,setAttribs:D,getAttrib:h,getPos:w,parseStyle:function(e){return s.parse(e)},serializeStyle:function(e,t){return s.serialize(e,t)},addStyle:function(t){var r,o;if(V!==pu.DOM&&e===document){if(n[t])return;n[t]=!0;}(o=e.getElementById("mceDefaultStyles"))||((o=e.createElement("style")).id="mceDefaultStyles",o.type="text/css",(r=e.getElementsByTagName("head")[0]).firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o)),o.styleSheet?o.styleSheet.cssText+=t:o.appendChild(e.createTextNode(t));},loadCSS:function(e){e||(e=""),q(e.split(","),(function(e){o[e]=!0,a.load(e,x);}));},addClass:function(e,t){p(e).addClass(t);},removeClass:function(e,t){I(e,t,!1);},hasClass:function(e,t){return p(e).hasClass(t)},toggleClass:I,show:function(e){p(e).show();},hide:function(e){p(e).hide();},isHidden:function(e){return "none"===p(e).css("display")},uniqueId:function(e){return (e||"mce_")+i++},setHTML:T,getOuterHTML:function(e){var t="string"==typeof e?g(e):e;return Dn(t)?t.outerHTML:cu("<div></div>").append(cu(t).clone()).html()},setOuterHTML:function(e,t){p(e).each((function(){try{if("outerHTML"in this)return void(this.outerHTML=t)}catch(e){}L(cu(this).html(t),!0);}));},decode:bi.decode,encode:P,insertAfter:function(e,t){var n=g(t);return R(e,(function(e){var t=n.parentNode,r=n.nextSibling;return r?t.insertBefore(e,r):t.appendChild(e),e}))},replace:M,rename:function(e,t){var n;return e.nodeName!==t.toUpperCase()&&(n=B(t),su(b(e),(function(t){y(n,t.nodeName,h(e,t.nodeName));})),M(n,e,!0)),n||e},findCommonAncestor:function(e,t){for(var n,r=e;r;){for(n=t;n&&r!==n;)n=n.parentNode;if(r===n)break;r=r.parentNode;}return !r&&e.ownerDocument?e.ownerDocument.documentElement:r},toHex:function(e){return s.toHex(_t.trim(e))},run:R,getAttribs:b,isEmpty:function(e,t){var n,r,o=0;if(F(e))return !1;if(e=e.firstChild){var i=new ao(e,e.parentNode),a=c?c.getWhiteSpaceElements():{};t=t||(c?c.getNonEmptyElements():null);do{if(n=e.nodeType,Dn(e)){var u=e.getAttribute("data-mce-bogus");if(u){e=i.next("all"===u);continue}if(r=e.nodeName.toLowerCase(),t&&t[r]){if("br"===r){o++,e=i.next();continue}return !1}if(F(e))return !1}if(8===n)return !1;if(3===n&&!Xo(e.nodeValue))return !1;if(3===n&&e.parentNode&&a[e.parentNode.nodeName]&&Xo(e.nodeValue))return !1;e=i.next();}while(e)}return o<=1},createRng:U,nodeIndex:gu,split:function(e,t,n){var r,o,i,a=U();if(e&&t)return a.setStart(e.parentNode,gu(e)),a.setEnd(t.parentNode,gu(t)),r=a.extractContents(),(a=U()).setStart(t.parentNode,gu(t)+1),a.setEnd(e.parentNode,gu(e)+1),o=a.extractContents(),(i=e.parentNode).insertBefore(oi(V,r),e),n?i.insertBefore(n,e):i.insertBefore(t,e),i.insertBefore(oi(V,o),e),L(e),n||t},bind:z,unbind:H,fire:function(e,t,n){return f.fire(e,t,n)},getContentEditable:j,getContentEditableParent:function(e){for(var t=C(),n=null;e&&e!==t&&null===(n=j(e));e=e.parentNode);return n},destroy:function(){if(u.length>0)for(var e=u.length;e--;){var t=u[e];f.unbind(t[0],t[1],t[2]);}le(o,(function(e,t){a.unload(t),delete o[t];})),wa.setDocument&&wa.setDocument();},isChildOf:function(e,t){if(lu){for(;e;){if(t===e)return !0;e=e.parentNode;}return !1}return e===t||t.contains(e)},dumpRng:function(e){return "startContainer: "+e.startContainer.nodeName+", startOffset: "+e.startOffset+", endContainer: "+e.endContainer.nodeName+", endOffset: "+e.endOffset}},$=function(e,t,n){var r=t.keep_values,o={set:function(e,r,o){t.url_converter&&null!==r&&(r=t.url_converter.call(t.url_converter_scope||n(),r,o,e[0])),e.attr("data-mce-"+o,r).attr(o,r);},get:function(e,t){return e.attr("data-mce-"+t)||e.attr(t)}},i={style:{set:function(t,n){null===n||"object"!=typeof n?(r&&t.attr("data-mce-style",n),null!==n&&"string"==typeof n?(t.removeAttr("style"),t.css(e.parse(n))):t.attr("style",n)):t.css(n);},get:function(t){var n=t.attr("data-mce-style")||t.attr("style");return e.serialize(e.parse(n),t[0].nodeName)}}};return r&&(i.href=i.src=o),i}(s,t,k(V));return V};pu.DOM=pu(document),pu.nodeIndex=gu;var hu=pu.DOM,vu=_t.each,bu=_t.grep,yu=function(){function e(e){void 0===e&&(e={}),this.states={},this.queue=[],this.scriptLoadedCallbacks={},this.queueLoadedCallbacks=[],this.loading=0,this.settings=e;}return e.prototype._setReferrerPolicy=function(e){this.settings.referrerPolicy=e;},e.prototype.loadScript=function(e,t,n){var r,o=hu,i=function(){o.remove(a),r&&(r.onerror=r.onload=r=null);},a=o.uniqueId();(r=document.createElement("script")).id=a,r.type="text/javascript",r.src=_t._addCacheSuffix(e),this.settings.referrerPolicy&&o.setAttrib(r,"referrerpolicy",this.settings.referrerPolicy),r.onload=function(){i(),t();},r.onerror=function(){i(),y(n)?n():"undefined"!=typeof console&&console.log&&console.log("Failed to load script: "+e);},(document.getElementsByTagName("head")[0]||document.body).appendChild(r);},e.prototype.isDone=function(e){return 2===this.states[e]},e.prototype.markDone=function(e){this.states[e]=2;},e.prototype.add=function(e,t,n,r){var o=this.states[e];this.queue.push(e),void 0===o&&(this.states[e]=0),t&&(this.scriptLoadedCallbacks[e]||(this.scriptLoadedCallbacks[e]=[]),this.scriptLoadedCallbacks[e].push({success:t,failure:r,scope:n||this}));},e.prototype.load=function(e,t,n,r){return this.add(e,t,n,r)},e.prototype.remove=function(e){delete this.states[e],delete this.scriptLoadedCallbacks[e];},e.prototype.loadQueue=function(e,t,n){this.loadScripts(this.queue,e,t,n);},e.prototype.loadScripts=function(e,t,n,r){var o=this,i=[],a=function(e,t){vu(o.scriptLoadedCallbacks[t],(function(t){y(t[e])&&t[e].call(t.scope);})),o.scriptLoadedCallbacks[t]=void 0;};o.queueLoadedCallbacks.push({success:t,failure:r,scope:n||this});var u=function(){var t=bu(e);if(e.length=0,vu(t,(function(e){2!==o.states[e]?3!==o.states[e]?1!==o.states[e]&&(o.states[e]=1,o.loading++,o.loadScript(e,(function(){o.states[e]=2,o.loading--,a("success",e),u();}),(function(){o.states[e]=3,o.loading--,i.push(e),a("failure",e),u();}))):a("failure",e):a("success",e);})),!o.loading){var n=o.queueLoadedCallbacks.slice(0);o.queueLoadedCallbacks.length=0,vu(n,(function(e){0===i.length?y(e.success)&&e.success.call(e.scope):y(e.failure)&&e.failure.call(e.scope,i);}));}};u();},e.ScriptLoader=new e,e}(),Cu=function(e){var t=e;return {get:function(){return t},set:function(e){t=e;}}},xu={},wu=Cu("en"),Su=function(){return be(xu,wu.get())},ku={getData:function(){return de(xu,(function(e){return Re({},e)}))},setCode:function(e){e&&wu.set(e);},getCode:function(){return wu.get()},add:function(e,t){var n=xu[e];n||(xu[e]=n={}),le(t,(function(e,t){n[t.toLowerCase()]=e;}));},translate:function(e){var t,n=Su().getOr({}),r=function(e){return y(e)?Object.prototype.toString.call(e):o(e)?"":""+e},o=function(e){return ""===e||null==e},i=function(e){var t=r(e);return be(n,t.toLowerCase()).map(r).getOr(t)},a=function(e){return e.replace(/{context:\w+}$/,"")};if(o(e))return "";if(d(t=e)&&ye(t,"raw"))return r(e.raw);if(function(e){return m(e)&&e.length>1}(e)){var u=e.slice(1);return a(i(e[0]).replace(/\{([0-9]+)\}/g,(function(e,t){return ye(u,t)?r(u[t]):e})))}return a(i(e))},isRtl:function(){return Su().bind((function(e){return be(e,"_dir")})).exists((function(e){return "rtl"===e}))},hasCode:function(e){return ye(xu,e)}},Nu=function(){var e=[],t={},n={},r=[],o=function(e,t){var n=K(r,(function(n){return n.name===e&&n.state===t}));q(n,(function(e){return e.callback()}));},i=function(e){var t;return n[e]&&(t=n[e].dependencies),t||[]},a=function(e,t){return "object"==typeof t?t:"string"==typeof e?{prefix:"",resource:t,suffix:""}:{prefix:e.prefix,resource:t,suffix:e.suffix}},u=function(e,r,c,s,f){if(!t[e]){var l="string"==typeof r?r:r.prefix+r.resource+r.suffix;0!==l.indexOf("/")&&-1===l.indexOf("://")&&(l=Nu.baseURL+"/"+l),t[e]=l.substring(0,l.lastIndexOf("/"));var d=function(){o(e,"loaded"),function(e,t,n,r){var o=i(e);q(o,(function(e){var n=a(t,e);u(n.resource,n,void 0,void 0);})),n&&(r?n.call(r):n.call(yu));}(e,r,c,s);};n[e]?d():yu.ScriptLoader.add(l,d,s,f);}},c=function(e,o,i){void 0===i&&(i="added"),ye(n,e)&&"added"===i||ye(t,e)&&"loaded"===i?o():r.push({name:e,state:i,callback:o});};return {items:e,urls:t,lookup:n,_listeners:r,get:function(e){if(n[e])return n[e].instance},dependencies:i,requireLangPack:function(e,n){!1!==Nu.languageLoad&&c(e,(function(){var r=ku.getCode();!r||n&&-1===(","+(n||"")+",").indexOf(","+r+",")||yu.ScriptLoader.add(t[e]+"/langs/"+r+".js");}),"loaded");},add:function(t,r,i){var a=r;return e.push(a),n[t]={instance:a,dependencies:i},o(t,"added"),a},remove:function(e){delete t[e],delete n[e];},createUrl:a,addComponents:function(e,n){var r=t[e];q(n,(function(e){yu.ScriptLoader.add(r+"/"+e);}));},load:u,waitFor:c}};Nu.languageLoad=!0,Nu.baseURL="",Nu.PluginManager=Nu(),Nu.ThemeManager=Nu();var Eu=function(){var e=function(e){var t=Cu(I.none()),n=function(){return t.get().each(e)};return {clear:function(){n(),t.set(I.none());},isSet:function(){return t.get().isSome()},get:function(){return t.get()},set:function(e){n(),t.set(I.some(e));}}}(x);return Re(Re({},e),{on:function(t){return e.get().each(t)}})},_u=function(e,t){var n=null;return {cancel:function(){g(n)||(clearTimeout(n),n=null);},throttle:function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];g(n)&&(n=setTimeout((function(){n=null,e.apply(null,r);}),t));}}},Au=function(e,t){var n=null,r=function(){g(n)||(clearTimeout(n),n=null);};return {cancel:r,throttle:function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];r(),n=setTimeout((function(){n=null,e.apply(null,o);}),t);}}},Ru=function(e,t){var n=er(e,t);return void 0===n||""===n?[]:n.split(" ")},Du=function(e){return void 0!==e.dom.classList},Tu=function(e,t){return function(e,t,n){var r=Ru(e,t).concat([n]);return Qn(e,t,r.join(" ")),!0}(e,"class",t)},Ou=function(e,t){return function(e,t,n){var r=K(Ru(e,t),(function(e){return e!==n}));return r.length>0?Qn(e,t,r.join(" ")):nr(e,t),!1}(e,"class",t)},Bu=function(e,t){Du(e)?e.dom.classList.add(t):Tu(e,t);},Pu=function(e){var t=Du(e)?e.dom.classList:function(e){return Ru(e,"class")}(e);0===t.length&&nr(e,"class");},Lu=function(e,t){return Du(e)&&e.dom.classList.contains(t)},Iu=function(e,t){var n=[];return q(Jt(e),(function(e){t(e)&&(n=n.concat([e])),n=n.concat(Iu(e,t));})),n},Mu=function(e,t){return function(e,t){var n=void 0===t?document:t.dom;return Ot(n)?[]:V(n.querySelectorAll(e),Rt.fromDom)}(t,e)},Fu=k("mce-annotation"),Uu=k("data-mce-annotation"),zu=k("data-mce-annotation-uid"),Hu=function(e,t){var n=e.selection.getRng(),r=Rt.fromDom(n.startContainer),o=Rt.fromDom(e.getBody()),i=t.fold((function(){return "."+Fu()}),(function(e){return "["+Uu()+'="'+e+'"]'})),a=Qt(r,n.startOffset).getOr(r),u=Qr(a,i,(function(e){return Bt(e,o)})),c=function(e,t){return function(e,t){var n=e.dom;return !(!n||!n.hasAttribute)&&n.hasAttribute(t)}(e,t)?I.some(er(e,t)):I.none()};return u.bind((function(t){return c(t,""+zu()).bind((function(n){return c(t,""+Uu()).map((function(t){var r=ju(e,n);return {uid:n,name:t,elements:r}}))}))}))},ju=function(e,t){var n=Rt.fromDom(e.getBody());return Mu(n,"["+zu()+'="'+t+'"]')},Vu=function(e,t){var n=Cu({}),r=function(){return {listeners:[],previous:Eu()}},o=function(e,t){i(e,(function(e){return t(e),e}));},i=function(e,t){var o=n.get(),i=t(be(o,e).getOrThunk(r));o[e]=i,n.set(o);},a=Au((function(){var t=n.get(),r=re(se(t));q(r,(function(t){i(t,(function(n){var r=n.previous.get();return Hu(e,I.some(t)).fold((function(){r.isSome()&&(!function(e){o(e,(function(t){q(t.listeners,(function(t){return t(!1,e)}));}));}(t),n.previous.clear());}),(function(e){var t=e.uid,i=e.name,a=e.elements;Xn(r,t)||(!function(e,t,n){o(e,(function(r){q(r.listeners,(function(r){return r(!0,e,{uid:t,nodes:V(n,(function(e){return e.dom}))})}));}));}(i,t,a),n.previous.set(t));})),{previous:n.previous,listeners:n.listeners}}));}));}),30);e.on("remove",(function(){a.cancel();})),e.on("NodeChange",(function(){a.throttle();}));return {addListener:function(e,t){i(e,(function(e){return {previous:e.previous,listeners:e.listeners.concat([t])}}));}}},qu=function(e,t){e.on("init",(function(){e.serializer.addNodeFilter("span",(function(e){q(e,(function(e){(function(e){return I.from(e.attr(Uu())).bind(t.lookup)})(e).each((function(t){!1===t.persistent&&e.unwrap();}));}));}));}));},$u=0,Wu=function(e){var t=(new Date).getTime();return e+"_"+Math.floor(1e9*Math.random())+ ++$u+String(t)},Ku=function(e,t){var n,r,o=Vt(e).dom,i=Rt.fromDom(o.createDocumentFragment()),a=(n=t,(r=(o||document).createElement("div")).innerHTML=n,Jt(Rt.fromDom(r)));gn(i,a),pn(e),mn(e,i);},Xu=function(e,t){return Rt.fromDom(e.dom.cloneNode(t))},Yu=function(e){return Xu(e,!1)},Gu=function(e){return Xu(e,!0)},Ju=function(e,t,n){void 0===n&&(n=T);var r=new ao(e,t),o=function(e){var t;do{t=r[e]();}while(t&&!Fn(t)&&!n(t));return I.from(t).filter(Fn)};return {current:function(){return I.from(r.current()).filter(Fn)},next:function(){return o("next")},prev:function(){return o("prev")},prev2:function(){return o("prev2")}}},Qu=function(e,t){var n=t||function(t){return e.isBlock(t)||jn(t)||$n(t)},r=function(e,t,n,o){if(Fn(e)){var i=o(e,t,e.data);if(-1!==i)return I.some({container:e,offset:i})}return n().bind((function(e){return r(e.container,e.offset,n,o)}))};return {backwards:function(e,t,o,i){var a=Ju(e,i,n);return r(e,t,(function(){return a.prev().map((function(e){return {container:e,offset:e.length}}))}),o).getOrNull()},forwards:function(e,t,o,i){var a=Ju(e,i,n);return r(e,t,(function(){return a.next().map((function(e){return {container:e,offset:0}}))}),o).getOrNull()}}},Zu=Math.round,ec=function(e){return e?{left:Zu(e.left),top:Zu(e.top),bottom:Zu(e.bottom),right:Zu(e.right),width:Zu(e.width),height:Zu(e.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0}},tc=function(e,t){return e=ec(e),t||(e.left=e.left+e.width),e.right=e.left,e.width=0,e},nc=function(e,t,n){return e>=0&&e<=Math.min(t.height,n.height)/2},rc=function(e,t){var n=Math.min(t.height/2,e.height/2);return e.bottom-n<t.top||!(e.top>t.bottom)&&nc(t.top-e.bottom,e,t)},oc=function(e,t){return e.top>t.bottom||!(e.bottom<t.top)&&nc(t.bottom-e.top,e,t)},ic=function(e,t,n){return t>=e.left&&t<=e.right&&n>=e.top&&n<=e.bottom},ac=function(e){var t=e.startContainer,n=e.startOffset;return t.hasChildNodes()&&e.endOffset===n+1?t.childNodes[n]:null},uc=function(e,t){if(Dn(e)&&e.hasChildNodes()){var n=e.childNodes,r=function(e,t,n){return Math.min(Math.max(e,t),n)}(t,0,n.length-1);return n[r]}return e},cc=new RegExp("[̀-ͯ҃-҇҈-҉֑-ֽֿׁ-ׂׄ-ׇׅؐ-ًؚ-ٰٟۖ-ۜ۟-ۤۧ-۪ۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣣ-ंऺ़ु-ै्॑-ॗॢ-ॣঁ়াু-ৄ্ৗৢ-ৣਁ-ਂ਼ੁ-ੂੇ-ੈੋ-੍ੑੰ-ੱੵઁ-ં઼ુ-ૅે-ૈ્ૢ-ૣଁ଼ାିୁ-ୄ୍ୖୗୢ-ୣஂாீ்ௗఀా-ీె-ైొ-్ౕ-ౖౢ-ౣಁ಼ಿೂೆೌ-್ೕ-ೖೢ-ೣഁാു-ൄ്ൗൢ-ൣ්ාි-ුූෟัิ-ฺ็-๎ັິ-ູົ-ຼ່-ໍ༘-ཱ༹༙༵༷-ཾྀ-྄྆-྇ྍ-ྗྙ-ྼ࿆ိ-ူဲ-့္-်ွ-ှၘ-ၙၞ-ၠၱ-ၴႂႅ-ႆႍႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒ-ᝓᝲ-ᝳ឴-឵ិ-ួំ៉-៓៝᠋-᠍ᢩᤠ-ᤢᤧ-ᤨᤲ᤹-᤻ᨗ-ᨘᨛᩖᩘ-ᩞ᩠ᩢᩥ-ᩬᩳ-᩿᩼᪰-᪽᪾ᬀ-ᬃ᬴ᬶ-ᬺᬼᭂ᭫-᭳ᮀ-ᮁᮢ-ᮥᮨ-ᮩ᮫-ᮭ᯦ᯨ-ᯩᯭᯯ-ᯱᰬ-ᰳᰶ-᰷᳐-᳔᳒-᳢᳠-᳨᳭᳴᳸-᳹᷀-᷵᷼-᷿‌-‍⃐-⃜⃝-⃠⃡⃢-⃤⃥-⃰⳯-⵿⳱ⷠ-〪ⷿ-〭〮-゙〯-゚꙯꙰-꙲ꙴ-꙽ꚞ-ꚟ꛰-꛱ꠂ꠆ꠋꠥ-ꠦ꣄꣠-꣱ꤦ-꤭ꥇ-ꥑꦀ-ꦂ꦳ꦶ-ꦹꦼꧥꨩ-ꨮꨱ-ꨲꨵ-ꨶꩃꩌꩼꪰꪲ-ꪴꪷ-ꪸꪾ-꪿꫁ꫬ-ꫭ꫶ꯥꯨ꯭ﬞ︀-️︠-゙︯-゚]"),sc=function(e){return "string"==typeof e&&e.charCodeAt(0)>=768&&cc.test(e)},fc=Dn,lc=qo,dc=On("display","block table"),mc=On("float","left right"),gc=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){for(var n=0;n<e.length;n++)if(!e[n](t))return !1;return !0}}(fc,lc,A(mc)),pc=A(On("white-space","pre pre-line pre-wrap")),hc=Fn,vc=jn,bc=pu.nodeIndex,yc=function(e,t){return t<0&&Dn(e)&&e.hasChildNodes()?void 0:uc(e,t)},Cc=function(e){return "createRange"in e?e.createRange():pu.DOM.createRng()},xc=function(e){return e&&/[\r\n\t ]/.test(e)},wc=function(e){return !!e.setStart&&!!e.setEnd},Sc=function(e){var t=e.startContainer,n=e.startOffset;if(xc(e.toString())&&pc(t.parentNode)&&Fn(t)){var r=t.data;if(xc(r[n-1])||xc(r[n+1]))return !0}return !1},kc=function(e){return 0===e.left&&0===e.right&&0===e.top&&0===e.bottom},Nc=function(e){var t,n=e.getClientRects();return t=n.length>0?ec(n[0]):ec(e.getBoundingClientRect()),!wc(e)&&vc(e)&&kc(t)?function(e){var t=e.ownerDocument,n=Cc(t),r=t.createTextNode(yo),o=e.parentNode;o.insertBefore(r,e),n.setStart(r,0),n.setEnd(r,1);var i=ec(n.getBoundingClientRect());return o.removeChild(r),i}(e):kc(t)&&wc(e)?function(e){var t=e.startContainer,n=e.endContainer,r=e.startOffset,o=e.endOffset;if(t===n&&Fn(n)&&0===r&&1===o){var i=e.cloneRange();return i.setEndAfter(n),Nc(i)}return null}(e):t},Ec=function(e,t){var n=tc(e,t);return n.width=1,n.right=n.left+1,n},_c=function(e){var t=[],n=function(e){var n,r;0!==e.height&&(t.length>0&&(n=e,r=t[t.length-1],n.left===r.left&&n.top===r.top&&n.bottom===r.bottom&&n.right===r.right)||t.push(e));},r=function(e,r){var o=Cc(e.ownerDocument);if(r<e.data.length){if(sc(e.data[r]))return t;if(sc(e.data[r-1])&&(o.setStart(e,r),o.setEnd(e,r+1),!Sc(o)))return n(Ec(Nc(o),!1)),t}r>0&&(o.setStart(e,r-1),o.setEnd(e,r),Sc(o)||n(Ec(Nc(o),!1))),r<e.data.length&&(o.setStart(e,r),o.setEnd(e,r+1),Sc(o)||n(Ec(Nc(o),!0)));},o=e.container(),i=e.offset();if(hc(o))return r(o,i),t;if(fc(o))if(e.isAtEnd()){var a=yc(o,i);hc(a)&&r(a,a.data.length),gc(a)&&!vc(a)&&n(Ec(Nc(a),!1));}else {a=yc(o,i);if(hc(a)&&r(a,0),gc(a)&&e.isAtEnd())return n(Ec(Nc(a),!1)),t;var u=yc(e.container(),e.offset()-1);gc(u)&&!vc(u)&&(dc(u)||dc(a)||!gc(a))&&n(Ec(Nc(u),!1)),gc(a)&&n(Ec(Nc(a),!0));}return t},Ac=function(e,t,n){var r=function(){return n||(n=_c(Ac(e,t))),n};return {container:k(e),offset:k(t),toRange:function(){var n=Cc(e.ownerDocument);return n.setStart(e,t),n.setEnd(e,t),n},getClientRects:r,isVisible:function(){return r().length>0},isAtStart:function(){return hc(e),0===t},isAtEnd:function(){return hc(e)?t>=e.data.length:t>=e.childNodes.length},isEqual:function(n){return n&&e===n.container()&&t===n.offset()},getNode:function(n){return yc(e,n?t-1:t)}}};Ac.fromRangeStart=function(e){return Ac(e.startContainer,e.startOffset)},Ac.fromRangeEnd=function(e){return Ac(e.endContainer,e.endOffset)},Ac.after=function(e){return Ac(e.parentNode,bc(e)+1)},Ac.before=function(e){return Ac(e.parentNode,bc(e))},Ac.isAbove=function(e,t){return Yn(ie(t.getClientRects()),ae(e.getClientRects()),rc).getOr(!1)},Ac.isBelow=function(e,t){return Yn(ae(t.getClientRects()),ie(e.getClientRects()),oc).getOr(!1)},Ac.isAtStart=function(e){return !!e&&e.isAtStart()},Ac.isAtEnd=function(e){return !!e&&e.isAtEnd()},Ac.isTextPosition=function(e){return !!e&&Fn(e.container())},Ac.isElementPosition=function(e){return !1===Ac.isTextPosition(e)};var Rc,Dc=function(e,t){Fn(t)&&0===t.data.length&&e.remove(t);},Tc=function(e,t,n){Hn(n)?function(e,t,n){var r=I.from(n.firstChild),o=I.from(n.lastChild);t.insertNode(n),r.each((function(t){return Dc(e,t.previousSibling)})),o.each((function(t){return Dc(e,t.nextSibling)}));}(e,t,n):function(e,t,n){t.insertNode(n),Dc(e,n.previousSibling),Dc(e,n.nextSibling);}(e,t,n);},Oc=Fn,Bc=Pn,Pc=pu.nodeIndex,Lc=function(e){var t=e.parentNode;return Bc(t)?Lc(t):t},Ic=function(e){return e?Ee(e.childNodes,(function(e,t){return Bc(t)&&"BR"!==t.nodeName?e=e.concat(Ic(t)):e.push(t),e}),[]):[]},Mc=function(e){return function(t){return e===t}},Fc=function(e){return (Oc(e)?"text()":e.nodeName.toLowerCase())+"["+function(e){var t,n;t=Ic(Lc(e)),n=_e(t,Mc(e),e),t=t.slice(0,n+1);var r=Ee(t,(function(e,n,r){return Oc(n)&&Oc(t[r-1])&&e++,e}),0);return t=ke(t,Tn([e.nodeName])),(n=_e(t,Mc(e),e))-r}(e)+"]"},Uc=function(e,t){var n,r,o,i,a,u=[];return n=t.container(),r=t.offset(),Oc(n)?o=function(e,t){for(;(e=e.previousSibling)&&Oc(e);)t+=e.data.length;return t}(n,r):(r>=(i=n.childNodes).length?(o="after",r=i.length-1):o="before",n=i[r]),u.push(Fc(n)),a=function(e,t,n){var r=[];for(t=t.parentNode;!(t===e||n&&n(t));t=t.parentNode)r.push(t);return r}(e,n),a=ke(a,A(Pn)),(u=u.concat(Se(a,(function(e){return Fc(e)})))).reverse().join("/")+","+o},zc=function(e,t){var n;if(!t)return null;var r=t.split(","),o=r[0].split("/");n=r.length>1?r[1]:"before";var i=Ee(o,(function(e,t){var n=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(t);return n?("text()"===n[1]&&(n[1]="#text"),function(e,t,n){var r=Ic(e);return r=ke(r,(function(e,t){return !Oc(e)||!Oc(r[t-1])})),(r=ke(r,Tn([t])))[n]}(e,n[1],parseInt(n[2],10))):null}),e);return i?Oc(i)?function(e,t){for(var n,r=e,o=0;Oc(r);){if(n=r.data.length,t>=o&&t<=o+n){e=r,t-=o;break}if(!Oc(r.nextSibling)){e=r,t=n;break}o+=n,r=r.nextSibling;}return Oc(e)&&t>e.data.length&&(t=e.data.length),Ac(e,t)}(i,parseInt(n,10)):(n="after"===n?Pc(i)+1:Pc(i),Ac(i.parentNode,n)):null},Hc=$n,jc=function(e,t,n,r,o){var i,a=r[o?"startContainer":"endContainer"],u=r[o?"startOffset":"endOffset"],c=[],s=0,f=e.getRoot();for(Fn(a)?c.push(n?function(e,t,n){var r,o;for(o=e(t.data.slice(0,n)).length,r=t.previousSibling;r&&Fn(r);r=r.previousSibling)o+=e(r.data).length;return o}(t,a,u):u):(u>=(i=a.childNodes).length&&i.length&&(s=1,u=Math.max(0,i.length-1)),c.push(e.nodeIndex(i[u],n)+s));a&&a!==f;a=a.parentNode)c.push(e.nodeIndex(a,n));return c},Vc=function(e,t,n){var r=0;return _t.each(e.select(t),(function(e){if("all"!==e.getAttribute("data-mce-bogus"))return e!==n&&void r++})),r},qc=function(e,t){var n,r,o,i=t?"start":"end";n=e[i+"Container"],r=e[i+"Offset"],Dn(n)&&"TR"===n.nodeName&&(n=(o=n.childNodes)[Math.min(t?r:r-1,o.length-1)])&&(r=t?0:n.childNodes.length,e["set"+(t?"Start":"End")](n,r));},$c=function(e){return qc(e,!0),qc(e,!1),e},Wc=function(e,t){var n;if(Dn(e)&&(e=uc(e,t),Hc(e)))return e;if(_o(e)){if(Fn(e)&&No(e)&&(e=e.parentNode),n=e.previousSibling,Hc(n))return n;if(n=e.nextSibling,Hc(n))return n}},Kc=function(e,t,n){var r=n.getNode(),o=r?r.nodeName:null,i=n.getRng();if(Hc(r)||"IMG"===o)return {name:o,index:Vc(n.dom,o,r)};var a=function(e){return Wc(e.startContainer,e.startOffset)||Wc(e.endContainer,e.endOffset)}(i);return a?{name:o=a.tagName,index:Vc(n.dom,o,a)}:function(e,t,n,r){var o=t.dom,i={};return i.start=jc(o,e,n,r,!0),t.isCollapsed()||(i.end=jc(o,e,n,r,!1)),Lo(r)&&(i.isFakeCaret=!0),i}(e,n,t,i)},Xc=function(e,t,n){var r={"data-mce-type":"bookmark",id:t,style:"overflow:hidden;line-height:0px"};return n?e.create("span",r,"&#xFEFF;"):e.create("span",r)},Yc=function(e,t){var n=e.dom,r=e.getRng(),o=n.uniqueId(),i=e.isCollapsed(),a=e.getNode(),u=a.nodeName;if("IMG"===u)return {name:u,index:Vc(n,u,a)};var c=$c(r.cloneRange());if(!i){c.collapse(!1);var s=Xc(n,o+"_end",t);Tc(n,c,s);}(r=$c(r)).collapse(!0);var f=Xc(n,o+"_start",t);return Tc(n,r,f),e.moveToBookmark({id:o,keep:!0}),{id:o}},Gc=function(e,t,n){return 2===t?Kc(wo,n,e):3===t?function(e){var t=e.getRng();return {start:Uc(e.dom.getRoot(),Ac.fromRangeStart(t)),end:Uc(e.dom.getRoot(),Ac.fromRangeEnd(t))}}(e):t?function(e){return {rng:e.getRng()}}(e):Yc(e,!1)},Jc=_(Kc,N,!0),Qc=pu.DOM,Zc=function(e,t,n){var r=e.getParam(t,n);if(-1!==r.indexOf("=")){var o=e.getParam(t,"","hash");return be(o,e.id).getOr(n)}return r},es=function(e){return e.getParam("content_security_policy","")},ts=function(e){if(e.getParam("force_p_newlines",!1))return "p";var t=e.getParam("forced_root_block","p");return !1===t?"":!0===t?"p":t},ns=function(e){return e.getParam("forced_root_block_attrs",{})},rs=function(e){return e.getParam("automatic_uploads",!0,"boolean")},os=function(e){return e.getParam("images_reuse_filename",!1,"boolean")},is=function(e){return e.getParam("icons","","string")},as=function(e){return e.getParam("images_upload_url","","string")},us=function(e){return e.getParam("images_upload_base_path","","string")},cs=function(e){return e.getParam("images_upload_credentials",!1,"boolean")},ss=function(e){return e.getParam("images_upload_handler",null,"function")},fs=function(e){return e.getParam("content_css_cors",!1,"boolean")},ls=function(e){return e.getParam("referrer_policy","","string")},ds=function(e){return e.getParam("language","en","string")},ms=function(e){return e.getParam("indent_use_margin",!1)},gs=function(e){var t=e.getParam("font_css",[]);return m(t)?t:V(t.split(","),Ue)},ps=function(e){var t=e.getParam("object_resizing");return !1!==t&&!wt.iOS&&(l(t)?t:"table,img,figure.image,div,video,iframe")},hs=function(e){return e.getParam("event_root")},vs=function(e){return e.getParam("theme")},bs=function(e){return e.getParam("validate")},ys=function(e){return !1!==e.getParam("inline_boundaries")},Cs=function(e){return e.getParam("content_css_cors")},xs=function(e){return e.getParam("plugins","","string")},ws=Dn,Ss=Fn,ks=function(e){var t=e.parentNode;t&&t.removeChild(e);},Ns=function(e){var t=wo(e);return {count:e.length-t.length,text:t}},Es=function(e){for(var t;-1!==(t=e.data.lastIndexOf(Co));)e.deleteData(t,1);},_s=function(e,t){return Ts(e),t},As=function(e,t){var n=t.container(),r=function(e,t){var n=z(e,t);return -1===n?I.none():I.some(n)}(ue(n.childNodes),e).map((function(e){return e<t.offset()?Ac(n,t.offset()-1):t})).getOr(t);return Ts(e),r},Rs=function(e,t){return Ss(e)&&t.container()===e?function(e,t){var n=Ns(e.data.substr(0,t.offset())),r=Ns(e.data.substr(t.offset()));return (n.text+r.text).length>0?(Es(e),Ac(e,t.offset()-n.count)):t}(e,t):_s(e,t)},Ds=function(e,t){return Ac.isTextPosition(t)?Rs(e,t):function(e,t){return t.container()===e.parentNode?As(e,t):_s(e,t)}(e,t)},Ts=function(e){ws(e)&&_o(e)&&(Ao(e)?e.removeAttribute("data-mce-caret"):ks(e)),Ss(e)&&(Es(e),0===e.data.length&&ks(e));},Os=mt().browser,Bs=$n,Ps=Kn,Ls=Wn,Is=function(e,t,n){var r,o,i=tc(t.getBoundingClientRect(),n);if("BODY"===e.tagName){var a=e.ownerDocument.documentElement;r=e.scrollLeft||a.scrollLeft,o=e.scrollTop||a.scrollTop;}else {var u=e.getBoundingClientRect();r=e.scrollLeft-u.left,o=e.scrollTop-u.top;}i.left+=r,i.right+=r,i.top+=o,i.bottom+=o,i.width=1;var c=t.offsetWidth-t.clientWidth;return c>0&&(n&&(c*=-1),i.left+=c,i.right+=c),i},Ms=function(e,t,n,r){var o,i,a=Eu(),u=ts(e),c=u.length>0?u:"p",s=function(){!function(e){for(var t=Mu(Rt.fromDom(e),"*[contentEditable=false],video,audio,embed,object"),n=0;n<t.length;n++){var r,o=t[n].dom,i=o.previousSibling;Bo(i)&&(1===(r=i.data).length?i.parentNode.removeChild(i):i.deleteData(r.length-1,1)),i=o.nextSibling,Oo(i)&&(1===(r=i.data).length?i.parentNode.removeChild(i):i.deleteData(0,1));}}(t),i&&(Ts(i),i=null),a.on((function(e){cu(e.caret).remove(),a.clear();})),o&&(ro.clearInterval(o),o=void 0);},f=function(){o=ro.setInterval((function(){r()?cu("div.mce-visual-caret",t).toggleClass("mce-visual-caret-hidden"):cu("div.mce-visual-caret",t).addClass("mce-visual-caret-hidden");}),500);};return {show:function(e,r){var o;if(s(),Ls(r))return null;if(!n(r))return i=function(e,t){var n=e.ownerDocument.createTextNode(Co),r=e.parentNode;if(t){if(o=e.previousSibling,ko(o)){if(_o(o))return o;if(Bo(o))return o.splitText(o.data.length-1)}r.insertBefore(n,e);}else {var o=e.nextSibling;if(ko(o)){if(_o(o))return o;if(Oo(o))return o.splitText(1),o}e.nextSibling?r.insertBefore(n,e.nextSibling):r.appendChild(n);}return n}(r,e),o=r.ownerDocument.createRange(),Us(i.nextSibling)?(o.setStart(i,0),o.setEnd(i,0)):(o.setStart(i,1),o.setEnd(i,1)),o;i=To(c,r,e);var u=Is(t,r,e);cu(i).css("top",u.top);var l=cu('<div class="mce-visual-caret" data-mce-bogus="all"></div>').css(Re({},u)).appendTo(t)[0];return a.set({caret:l,element:r,before:e}),e&&cu(l).addClass("mce-visual-caret-before"),f(),(o=r.ownerDocument.createRange()).setStart(i,0),o.setEnd(i,0),o},hide:s,getCss:function(){return ".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}"},reposition:function(){a.on((function(e){var n=Is(t,e.element,e.before);cu(e.caret).css(Re({},n));}));},destroy:function(){return ro.clearInterval(o)}}},Fs=function(){return Os.isIE()||Os.isEdge()||Os.isFirefox()},Us=function(e){return Bs(e)||Ps(e)},zs=function(e){return Us(e)||Ln(e)&&Fs()},Hs=$n,js=Kn,Vs=On("display","block table table-cell table-caption list-item"),qs=_o,$s=No,Ws=Dn,Ks=qo,Xs=function(e){return e>0},Ys=function(e){return e<0},Gs=function(e,t){for(var n;n=e(t);)if(!$s(n))return n;return null},Js=function(e,t,n,r,o){var i=new ao(e,r),a=Hs(e)||$s(e);if(Ys(t)){if(a&&n(e=Gs(i.prev.bind(i),!0)))return e;for(;e=Gs(i.prev.bind(i),o);)if(n(e))return e}if(Xs(t)){if(a&&n(e=Gs(i.next.bind(i),!0)))return e;for(;e=Gs(i.next.bind(i),o);)if(n(e))return e}return null},Qs=function(e,t){for(;e&&e!==t;){if(Vs(e))return e;e=e.parentNode;}return null},Zs=function(e,t,n){return Qs(e.container(),n)===Qs(t.container(),n)},ef=function(e,t){if(!t)return null;var n=t.container(),r=t.offset();return Ws(n)?n.childNodes[r+e]:null},tf=function(e,t){var n=t.ownerDocument.createRange();return e?(n.setStartBefore(t),n.setEndBefore(t)):(n.setStartAfter(t),n.setEndAfter(t)),n},nf=function(e,t,n){return Qs(t,e)===Qs(n,e)},rf=function(e,t,n){for(var r=e?"previousSibling":"nextSibling";n&&n!==t;){var o=n[r];if(qs(o)&&(o=o[r]),Hs(o)||js(o)){if(nf(t,o,n))return o;break}if(Ks(o))break;n=n.parentNode;}return null},of=_(tf,!0),af=_(tf,!1),uf=function(e,t,n){var r,o=_(rf,!0,t),i=_(rf,!1,t),a=n.startContainer,u=n.startOffset;if(No(a)){Ws(a)||(a=a.parentNode);var c=a.getAttribute("data-mce-caret");if("before"===c&&(r=a.nextSibling,zs(r)))return of(r);if("after"===c&&(r=a.previousSibling,zs(r)))return af(r)}if(!n.collapsed)return n;if(Fn(a)){if(qs(a)){if(1===e){if(r=i(a))return of(r);if(r=o(a))return af(r)}if(-1===e){if(r=o(a))return af(r);if(r=i(a))return of(r)}return n}if(Bo(a)&&u>=a.data.length-1)return 1===e&&(r=i(a))?of(r):n;if(Oo(a)&&u<=1)return -1===e&&(r=o(a))?af(r):n;if(u===a.data.length)return (r=i(a))?of(r):n;if(0===u)return (r=o(a))?af(r):n}return n},cf=function(e,t){return I.from(ef(e?0:-1,t)).filter(Hs)},sf=function(e,t,n){var r=uf(e,t,n);return -1===e?Ac.fromRangeStart(r):Ac.fromRangeEnd(r)},ff=function(e){return I.from(e.getNode()).map(Rt.fromDom)},lf=function(e,t){for(;t=e(t);)if(t.isVisible())return t;return t},df=function(e,t){var n=Zs(e,t);return !(n||!jn(e.getNode()))||n};!function(e){e[e.Backwards=-1]="Backwards",e[e.Forwards=1]="Forwards";}(Rc||(Rc={}));var mf,gf=$n,pf=Fn,hf=Dn,vf=jn,bf=qo,yf=function(e){return Ho(e)||function(e){return !!$o(e)&&!0!==Y(ue(e.getElementsByTagName("*")),(function(e,t){return e||Io(t)}),!1)}(e)},Cf=Wo,xf=function(e,t){return e.hasChildNodes()&&t<e.childNodes.length?e.childNodes[t]:null},wf=function(e,t){if(Xs(e)){if(bf(t.previousSibling)&&!pf(t.previousSibling))return Ac.before(t);if(pf(t))return Ac(t,0)}if(Ys(e)){if(bf(t.nextSibling)&&!pf(t.nextSibling))return Ac.after(t);if(pf(t))return Ac(t,t.data.length)}return Ys(e)?vf(t)?Ac.before(t):Ac.after(t):Ac.before(t)},Sf=function(e,t,n){var r,o,i,a;if(!hf(n)||!t)return null;if(t.isEqual(Ac.after(n))&&n.lastChild){if(a=Ac.after(n.lastChild),Ys(e)&&bf(n.lastChild)&&hf(n.lastChild))return vf(n.lastChild)?Ac.before(n.lastChild):a}else a=t;var u=a.container(),c=a.offset();if(pf(u)){if(Ys(e)&&c>0)return Ac(u,--c);if(Xs(e)&&c<u.length)return Ac(u,++c);r=u;}else {if(Ys(e)&&c>0&&(o=xf(u,c-1),bf(o)))return !yf(o)&&(i=Js(o,e,Cf,o))?pf(i)?Ac(i,i.data.length):Ac.after(i):pf(o)?Ac(o,o.data.length):Ac.before(o);if(Xs(e)&&c<u.childNodes.length&&(o=xf(u,c),bf(o)))return vf(o)?function(e,t){var n=t.nextSibling;return n&&bf(n)?pf(n)?Ac(n,0):Ac.before(n):Sf(Rc.Forwards,Ac.after(t),e)}(n,o):!yf(o)&&(i=Js(o,e,Cf,o))?pf(i)?Ac(i,0):Ac.before(i):pf(o)?Ac(o,0):Ac.after(o);r=o||a.getNode();}if((Xs(e)&&a.isAtEnd()||Ys(e)&&a.isAtStart())&&(r=Js(r,e,O,n,!0),Cf(r,n)))return wf(e,r);o=Js(r,e,Cf,n);var s=Ae(K(function(e,t){for(var n=[];e&&e!==t;)n.push(e),e=e.parentNode;return n}(u,n),gf));return !s||o&&s.contains(o)?o?wf(e,o):null:a=Xs(e)?Ac.after(s):Ac.before(s)},kf=function(e){return {next:function(t){return Sf(Rc.Forwards,t,e)},prev:function(t){return Sf(Rc.Backwards,t,e)}}},Nf=function(e){return Ac.isTextPosition(e)?0===e.offset():qo(e.getNode())},Ef=function(e){if(Ac.isTextPosition(e)){var t=e.container();return e.offset()===t.data.length}return qo(e.getNode(!0))},_f=function(e,t){return !Ac.isTextPosition(e)&&!Ac.isTextPosition(t)&&e.getNode()===t.getNode(!0)},Af=function(e,t,n){return e?!_f(t,n)&&(r=t,!(!Ac.isTextPosition(r)&&jn(r.getNode())))&&Ef(t)&&Nf(n):!_f(n,t)&&Nf(t)&&Ef(n);var r;},Rf=function(e,t,n){var r=kf(t);return I.from(e?r.next(n):r.prev(n))},Df=function(e,t,n){return Rf(e,t,n).bind((function(r){return Zs(n,r,t)&&Af(e,n,r)?Rf(e,t,r):I.some(r)}))},Tf=function(e,t,n,r){return Df(e,t,n).bind((function(n){return r(n)?Tf(e,t,n,r):I.some(n)}))},Of=function(e,t){var n,r=e?t.firstChild:t.lastChild;return Fn(r)?I.some(Ac(r,e?0:r.data.length)):r?qo(r)?I.some(e?Ac.before(r):jn(n=r)?Ac.before(n):Ac.after(n)):function(e,t,n){var r=e?Ac.before(n):Ac.after(n);return Rf(e,t,r)}(e,t,r):I.none()},Bf=_(Rf,!0),Pf=_(Rf,!1),Lf=_(Of,!0),If=_(Of,!1),Mf="_mce_caret",Ff=function(e){return Dn(e)&&e.id===Mf},Uf=function(e,t){for(;t&&t!==e;){if(t.id===Mf)return t;t=t.parentNode;}return null},zf=function(e){return _t.isArray(e.start)},Hf=function(e,t){return Dn(t)&&e.isBlock(t)&&!t.innerHTML&&!wt.ie&&(t.innerHTML='<br data-mce-bogus="1" />'),t},jf=function(e,t){return If(e).fold(T,(function(e){return t.setStart(e.container(),e.offset()),t.setEnd(e.container(),e.offset()),!0}))},Vf=function(e,t,n){return !(!function(e){return !1===e.hasChildNodes()}(t)||!Uf(e,t))&&(function(e,t){var n=e.ownerDocument.createTextNode(Co);e.appendChild(n),t.setStart(n,0),t.setEnd(n,0);}(t,n),!0)},qf=function(e,t,n,r){var o,i,a,u,c=n[t?"start":"end"],s=e.getRoot();if(c){for(a=c[0],i=s,o=c.length-1;o>=1;o--){if(u=i.childNodes,Vf(s,i,r))return !0;if(c[o]>u.length-1)return !!Vf(s,i,r)||jf(i,r);i=u[c[o]];}3===i.nodeType&&(a=Math.min(c[0],i.nodeValue.length)),1===i.nodeType&&(a=Math.min(c[0],i.childNodes.length)),t?r.setStart(i,a):r.setEnd(i,a);}return !0},$f=function(e){return Fn(e)&&e.data.length>0},Wf=function(e,t,n){var r,o,i,a,u,c,s=e.get(n.id+"_"+t),f=n.keep;if(s){if(r=s.parentNode,"start"===t?(f?s.hasChildNodes()?(r=s.firstChild,o=1):$f(s.nextSibling)?(r=s.nextSibling,o=0):$f(s.previousSibling)?(r=s.previousSibling,o=s.previousSibling.data.length):(r=s.parentNode,o=e.nodeIndex(s)+1):o=e.nodeIndex(s),u=r,c=o):(f?s.hasChildNodes()?(r=s.firstChild,o=1):$f(s.previousSibling)?(r=s.previousSibling,o=s.previousSibling.data.length):(r=s.parentNode,o=e.nodeIndex(s)):o=e.nodeIndex(s),u=r,c=o),!f){for(a=s.previousSibling,i=s.nextSibling,_t.each(_t.grep(s.childNodes),(function(e){Fn(e)&&(e.nodeValue=e.nodeValue.replace(/\uFEFF/g,""));}));s=e.get(n.id+"_"+t);)e.remove(s,!0);a&&i&&a.nodeType===i.nodeType&&Fn(a)&&!wt.opera&&(o=a.nodeValue.length,a.appendData(i.nodeValue),e.remove(i),u=a,c=o);}return I.some(Ac(u,c))}return I.none()},Kf=function(e,t){var n=e.dom;if(t){if(zf(t))return function(e,t){var n=e.createRng();return qf(e,!0,t,n)&&qf(e,!1,t,n)?I.some(n):I.none()}(n,t);if(function(e){return l(e.start)}(t))return I.some(function(e,t){var n,r=e.createRng();return n=zc(e.getRoot(),t.start),r.setStart(n.container(),n.offset()),n=zc(e.getRoot(),t.end),r.setEnd(n.container(),n.offset()),r}(n,t));if(function(e){return ye(e,"id")}(t))return function(e,t){var n=Wf(e,"start",t),r=Wf(e,"end",t);return Yn(n,r.or(n),(function(t,n){var r=e.createRng();return r.setStart(Hf(e,t.container()),t.offset()),r.setEnd(Hf(e,n.container()),n.offset()),r}))}(n,t);if(function(e){return ye(e,"name")}(t))return function(e,t){return I.from(e.select(t.name)[t.index]).map((function(t){var n=e.createRng();return n.selectNode(t),n}))}(n,t);if(function(e){return ye(e,"rng")}(t))return I.some(t.rng)}return I.none()},Xf=function(e,t,n){return Gc(e,t,n)},Yf=function(e,t){Kf(e,t).each((function(t){e.setRng(t);}));},Gf=function(e){return Dn(e)&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type")},Jf=(mf=yo,function(e){return mf===e}),Qf=function(e){return ""!==e&&-1!==" \f\n\r\t\v".indexOf(e)},Zf=function(e){return !Qf(e)&&!Jf(e)},el=function(e){return !!e.nodeType},tl=function(e,t,n){var r=n.startOffset,o=n.startContainer;if((o!==n.endContainer||!function(e){return e&&/^(IMG)$/.test(e.nodeName)}(o.childNodes[r]))&&Dn(o)){var i=o.childNodes,a=void 0;r<i.length?(o=i[r],a=new ao(o,e.getParent(o,e.isBlock))):(o=i[i.length-1],(a=new ao(o,e.getParent(o,e.isBlock))).next(!0));for(var u=a.current();u;u=a.next())if(Fn(u)&&!il(u))return n.setStart(u,0),void t.setRng(n)}},nl=function(e,t,n){if(e){var r=t?"nextSibling":"previousSibling";for(e=n?e:e[r];e;e=e[r])if(Dn(e)||!il(e))return e}},rl=function(e,t){return el(t)&&(t=t.nodeName),!!e.schema.getTextBlockElements()[t.toLowerCase()]},ol=function(e,t,n){return e.schema.isValidChild(t,n)},il=function(e,t){if(void 0===t&&(t=!1),b(e)&&Fn(e)){var n=t?e.data.replace(/ /g," "):e.data;return Xo(n)}return !1},al=function(e,t){return y(e)?e=e(t):b(t)&&(e=e.replace(/%(\w+)/g,(function(e,n){return t[n]||e}))),e},ul=function(e,t){return t=t||"",e=""+((e=e||"").nodeName||e),t=""+(t.nodeName||t),e.toLowerCase()===t.toLowerCase()},cl=function(e,t,n){return "color"!==n&&"backgroundColor"!==n||(t=e.toHex(t)),"fontWeight"===n&&700===t&&(t="bold"),"fontFamily"===n&&(t=t.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),""+t},sl=function(e,t,n){return cl(e,e.getStyle(t,n),n)},fl=function(e,t){var n;return e.getParent(t,(function(t){return (n=e.getStyle(t,"text-decoration"))&&"none"!==n})),n},ll=function(e,t,n){return e.getParents(t,n,e.getRoot())},dl=function(e,t,n){var r=["inline","block","selector","attributes","styles","classes"],o=function(e){return he(e,(function(e,t){return j(r,(function(e){return e===t}))}))};return j(e.formatter.get(t),(function(t){var r=o(t);return j(e.formatter.get(n),(function(e){var t=o(e);return function(e,t,n){return void 0===n&&(n=u),a(n).eq(e,t)}(r,t)}))}))},ml=function(e){return Ce(e,"block")},gl=function(e){return Ce(e,"selector")},pl=function(e){return Ce(e,"inline")},hl=function(e){return gl(e)&&!1!==e.expand&&!pl(e)},vl=Gf,bl=ll,yl=il,Cl=rl,xl=function(e,t){for(var n=t;n;){if(Dn(n)&&e.getContentEditable(n))return "false"===e.getContentEditable(n)?n:t;n=n.parentNode;}return t},wl=function(e,t,n,r){for(var o=t.data,i=n;e?i>=0:i<o.length;e?i--:i++)if(r(o.charAt(i)))return e?i+1:i;return -1},Sl=function(e,t,n){return wl(e,t,n,(function(e){return Jf(e)||Qf(e)}))},kl=function(e,t,n){return wl(e,t,n,Zf)},Nl=function(e,t,n,r,o,i){var a,u=e.getParent(n,e.isBlock)||t,c=function(t,n,r){var i=Qu(e),c=o?i.backwards:i.forwards;return I.from(c(t,n,(function(e,t){return vl(e.parentNode)?-1:(a=e,r(o,e,t))}),u))};return c(n,r,Sl).bind((function(e){return i?c(e.container,e.offset+(o?-1:0),kl):I.some(e)})).orThunk((function(){return a?I.some({container:a,offset:o?0:a.length}):I.none()}))},El=function(e,t,n,r,o){Fn(r)&&Ve(r.data)&&r[o]&&(r=r[o]);for(var i=bl(e,r),a=0;a<i.length;a++)for(var u=0;u<t.length;u++){var c=t[u];if((!b(c.collapsed)||c.collapsed===n.collapsed)&&(gl(c)&&e.is(i[a],c.selector)))return i[a]}return r},_l=function(e,t,n,r){var o=n,i=e.dom,a=i.getRoot(),u=t[0];if(ml(u)&&(o=u.wrapper?null:i.getParent(n,u.block,a)),!o){var c=i.getParent(n,"LI,TD,TH");o=i.getParent(Fn(n)?n.parentNode:n,(function(t){return t!==a&&Cl(e,t)}),c);}if(o&&ml(u)&&u.wrapper&&(o=bl(i,o,"ul,ol").reverse()[0]||o),!o)for(o=n;o[r]&&!i.isBlock(o[r])&&(o=o[r],!ul(o,"br")););return o||n},Al=function(e,t,n,r){var o=n.parentNode;return !b(n[r])&&(!(o!==t&&!v(o)&&!e.isBlock(o))||Al(e,t,o,r))},Rl=function(e,t,n,r,o){var i,a=n,u=o?"previousSibling":"nextSibling",c=e.getRoot();if(Fn(n)&&!yl(n)&&(o?r>0:r<n.data.length))return n;for(;;){if(!t[0].block_expand&&e.isBlock(a))return a;for(var s=a[u];s;s=s[u]){var f=Fn(s)&&!Al(e,c,s,u);if(!vl(s)&&(!jn(i=s)||!i.getAttribute("data-mce-bogus")||i.nextSibling)&&!yl(s,f))return a}if(a===c||a.parentNode===c){n=a;break}a=a.parentNode;}return n},Dl=function(e){return vl(e.parentNode)||vl(e)},Tl=function(e,t,n,r){void 0===r&&(r=!1);var o=t.startContainer,i=t.startOffset,a=t.endContainer,u=t.endOffset,c=e.dom,s=n[0];(Dn(o)&&o.hasChildNodes()&&(o=uc(o,i),Fn(o)&&(i=0)),Dn(a)&&a.hasChildNodes()&&(a=uc(a,t.collapsed?u:u-1),Fn(a)&&(u=a.nodeValue.length)),o=xl(c,o),a=xl(c,a),Dl(o)&&(o=vl(o)?o:o.parentNode,o=t.collapsed?o.previousSibling||o:o.nextSibling||o,Fn(o)&&(i=t.collapsed?o.length:0)),Dl(a)&&(a=vl(a)?a:a.parentNode,a=t.collapsed?a.nextSibling||a:a.previousSibling||a,Fn(a)&&(u=t.collapsed?0:a.length)),t.collapsed)&&(Nl(c,e.getBody(),o,i,!0,r).each((function(e){var t=e.container,n=e.offset;o=t,i=n;})),Nl(c,e.getBody(),a,u,!1,r).each((function(e){var t=e.container,n=e.offset;a=t,u=n;})));return (pl(s)||s.block_expand)&&(pl(s)&&Fn(o)&&0!==i||(o=Rl(c,n,o,i,!0)),pl(s)&&Fn(a)&&u!==a.nodeValue.length||(a=Rl(c,n,a,u,!1))),hl(s)&&(o=El(c,n,t,o,"previousSibling"),a=El(c,n,t,a,"nextSibling")),(ml(s)||gl(s))&&(o=_l(e,n,o,"previousSibling"),a=_l(e,n,a,"nextSibling"),ml(s)&&(c.isBlock(o)||(o=Rl(c,n,o,i,!0)),c.isBlock(a)||(a=Rl(c,n,a,u,!1)))),Dn(o)&&(i=c.nodeIndex(o),o=o.parentNode),Dn(a)&&(u=c.nodeIndex(a)+1,a=a.parentNode),{startContainer:o,startOffset:i,endContainer:a,endOffset:u}},Ol=function(e,t,n){var r=t.startOffset,o=uc(t.startContainer,r),i=t.endOffset,a=uc(t.endContainer,i-1),u=function(e){var t=e[0];Fn(t)&&t===o&&r>=t.data.length&&e.splice(0,1);var n=e[e.length-1];return 0===i&&e.length>0&&n===a&&Fn(n)&&e.splice(e.length-1,1),e},c=function(e,t,n){for(var r=[];e&&e!==n;e=e[t])r.push(e);return r},s=function(t,n){return e.getParent(t,(function(e){return e.parentNode===n}),n)},f=function(e,t,r){for(var o=r?"nextSibling":"previousSibling",i=e,a=i.parentNode;i&&i!==t;i=a){a=i.parentNode;var s=c(i===e?i:i[o],o);s.length&&(r||s.reverse(),n(u(s)));}};if(o===a)return n(u([o]));var l=e.findCommonAncestor(o,a);if(e.isChildOf(o,a))return f(o,l,!0);if(e.isChildOf(a,o))return f(a,l);var d=s(o,l)||o,m=s(a,l)||a;f(o,d,!0);var g=c(d===o?d:d.nextSibling,"nextSibling",m===a?m.nextSibling:m);g.length&&n(u(g)),f(a,m);},Bl=function(e){var t=[];if(e)for(var n=0;n<e.rangeCount;n++)t.push(e.getRangeAt(n));return t},Pl=function(e){return K(function(e){return Z(e,(function(e){var t=ac(e);return t?[Rt.fromDom(t)]:[]}))}(e),vo)},Ll=function(e,t){var n=Mu(t,"td[data-mce-selected],th[data-mce-selected]");return n.length>0?n:Pl(e)},Il=function(e){return Ll(Bl(e.selection.getSel()),Rt.fromDom(e.getBody()))},Ml=function(e,t){return Gr(e,"table",t)},Fl=function(e){return Zt(e).fold(k([e]),(function(t){return [e].concat(Fl(t))}))},Ul=function(e){return en(e).fold(k([e]),(function(t){return "br"===It(t)?Kt(t).map((function(t){return [e].concat(Ul(t))})).getOr([]):[e].concat(Ul(t))}))},zl=function(e,t){return Yn(function(e){var t=e.startContainer,n=e.startOffset;return Fn(t)?0===n?I.some(Rt.fromDom(t)):I.none():I.from(t.childNodes[n]).map(Rt.fromDom)}(t),function(e){var t=e.endContainer,n=e.endOffset;return Fn(t)?n===t.data.length?I.some(Rt.fromDom(t)):I.none():I.from(t.childNodes[n-1]).map(Rt.fromDom)}(t),(function(t,n){var r=J(Fl(e),_(Bt,t)),o=J(Ul(e),_(Bt,n));return r.isSome()&&o.isSome()})).getOr(!1)},Hl=function(e,t,n,r){var o=n,i=new ao(n,o),a=he(e.schema.getMoveCaretBeforeOnEnterElements(),(function(e,t){return !H(["td","th","table"],t.toLowerCase())}));do{if(Fn(n)&&0!==_t.trim(n.nodeValue).length)return void(r?t.setStart(n,0):t.setEnd(n,n.nodeValue.length));if(a[n.nodeName])return void(r?t.setStartBefore(n):"BR"===n.nodeName?t.setEndBefore(n):t.setEndAfter(n))}while(n=r?i.next():i.prev());"BODY"===o.nodeName&&(r?t.setStart(o,0):t.setEnd(o,o.childNodes.length));},jl=function(e){var t=e.selection.getSel();return t&&t.rangeCount>0},Vl=function(e,t){var n=Il(e);n.length>0?q(n,(function(n){var r=n.dom,o=e.dom.createRng();o.setStartBefore(r),o.setEndAfter(r),t(o,!0);})):t(e.selection.getRng(),!1);},ql=function(e,t,n){var r=Yc(e,t);n(r),e.moveToBookmark(r);},$l=function(e,t){var n=function(t){return e(t)?I.from(t.dom.nodeValue):I.none()};return {get:function(r){if(!e(r))throw new Error("Can only get "+t+" value of a "+t+" node");return n(r).getOr("")},getOption:n,set:function(n,r){if(!e(n))throw new Error("Can only set raw "+t+" value of a "+t+" node");n.dom.nodeValue=r;}}}(zt,"text"),Wl=function(e){return $l.get(e)},Kl=function(e,t,n,r){return Wt(t).fold((function(){return "skipping"}),(function(o){return "br"===r||function(e){return zt(e)&&Wl(e)===Co}(t)?"valid":function(e){return Ut(e)&&Lu(e,Fu())}(t)?"existing":Ff(t.dom)?"caret":ol(e,n,r)&&ol(e,It(o),n)?"valid":"invalid-child"}))},Xl=function(e,t,n,r){var o=t.uid,i=void 0===o?Wu("mce-annotation"):o,a=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}(t,["uid"]),u=Rt.fromTag("span",e);Bu(u,Fu()),Qn(u,""+zu(),i),Qn(u,""+Uu(),n);var c=r(i,a),s=c.attributes,f=void 0===s?{}:s,l=c.classes,d=void 0===l?[]:l;return Zn(u,f),function(e,t){q(t,(function(t){Bu(e,t);}));}(u,d),u},Yl=function(e,t,n,r,o){var i=[],a=Xl(e.getDoc(),o,n,r),u=Eu(),c=function(){u.clear();},s=function(e){q(e,f);},f=function(t){switch(Kl(e,t,"span",It(t))){case"invalid-child":c();var n=Jt(t);s(n),c();break;case"valid":var r=u.get().getOrThunk((function(){var e=Yu(a);return i.push(e),u.set(e),e}));!function(e,t){fn(e,t),mn(t,e);}(t,r);}};return Ol(e.dom,t,(function(e){c(),function(e){var t=V(e,Rt.fromDom);s(t);}(e);})),i},Gl=function(e,t,n,r){e.undoManager.transact((function(){var o=e.selection,i=o.getRng(),a=Il(e).length>0;if(i.collapsed&&!a&&function(e,t){var n=Tl(e,t,[{inline:"span"}]);t.setStart(n.startContainer,n.startOffset),t.setEnd(n.endContainer,n.endOffset),e.selection.setRng(t);}(e,i),o.getRng().collapsed&&!a){var u=Xl(e.getDoc(),r,t,n.decorate);Ku(u,yo),o.getRng().insertNode(u.dom),o.select(u.dom);}else ql(o,!1,(function(){Vl(e,(function(o){Yl(e,o,t,n.decorate,r);}));}));}));},Jl=function(e){var t,n=(t={},{register:function(e,n){t[e]={name:e,settings:n};},lookup:function(e){return be(t,e).map((function(e){return e.settings}))}});qu(e,n);var r=Vu(e);return {register:function(e,t){n.register(e,t);},annotate:function(t,r){n.lookup(t).each((function(n){Gl(e,t,n,r);}));},annotationChanged:function(e,t){r.addListener(e,t);},remove:function(t){Hu(e,I.some(t)).each((function(e){var t=e.elements;q(t,vn);}));},getAll:function(t){var n=function(e,t){var n=Rt.fromDom(e.getBody()),r=Mu(n,"["+Uu()+'="'+t+'"]'),o={};return q(r,(function(e){var t=er(e,zu()),n=be(o,t).getOr([]);o[t]=n.concat([e]);})),o}(e,t);return de(n,(function(e){return V(e,(function(e){return e.dom}))}))}}},Ql=function(e){return {getBookmark:_(Xf,e),moveToBookmark:_(Yf,e)}};Ql.isBookmarkNode=Gf;var Zl=function(e,t){for(;t&&t!==e;){if(qn(t)||$n(t))return t;t=t.parentNode;}return null},ed=function(e,t,n){if(n.collapsed)return !1;if(wt.browser.isIE()&&n.startOffset===n.endOffset-1&&n.startContainer===n.endContainer){var r=n.startContainer.childNodes[n.startOffset];if(Dn(r))return j(r.getClientRects(),(function(n){return ic(n,e,t)}))}return j(n.getClientRects(),(function(n){return ic(n,e,t)}))},td=function(e,t,n){return e.fire(t,n)},nd=function(e,t,n,r){return e.fire("FormatApply",{format:t,node:n,vars:r})},rd=function(e,t,n,r){return e.fire("FormatRemove",{format:t,node:n,vars:r})},od={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,ESC:27,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,modifierPressed:function(e){return e.shiftKey||e.ctrlKey||e.altKey||od.metaKeyPressed(e)},metaKeyPressed:function(e){return wt.mac?e.metaKey:e.ctrlKey&&!e.altKey}},id=$n,ad=function(e,t){var n,r,o,i,a,u,c,s,f,l,d,m,g,p,h,v="data-mce-selected",y=t.dom,C=_t.each,x=t.getDoc(),w=document,S=Math.abs,k=Math.round,N=t.getBody(),E={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]},_=function(e){return e&&("IMG"===e.nodeName||t.dom.is(e,"figure.image"))},A=function(e){return Kn(e)||y.hasClass(e,"mce-preview-object")},R=function(e){var n=e.target;(function(e,t){if("longpress"===e.type||0===e.type.indexOf("touch")){var n=e.touches[0];return _(e.target)&&!ed(n.clientX,n.clientY,t)}return _(e.target)&&!ed(e.clientX,e.clientY,t)})(e,t.selection.getRng())&&!e.isDefaultPrevented()&&t.selection.select(n);},D=function(e){return y.is(e,"figure.image")?[e.querySelector("img")]:y.hasClass(e,"mce-preview-object")&&b(e.firstElementChild)?[e,e.firstElementChild]:[e]},T=function(e){var n=ps(t);return !!n&&("false"!==e.getAttribute("data-mce-resize")&&(e!==t.getBody()&&(y.hasClass(e,"mce-preview-object")?Tt(Rt.fromDom(e.firstElementChild),n):Tt(Rt.fromDom(e),n))))},O=function(e,n,r){if(b(r)){var o=D(e);q(o,(function(e){e.style[n]||!t.schema.isValid(e.nodeName.toLowerCase(),n)?y.setStyle(e,n,r):y.setAttrib(e,n,""+r);}));}},B=function(e,t,n){O(e,"width",t),O(e,"height",n);},P=function(e){var a,v,b,C,x;a=e.screenX-u,v=e.screenY-c,m=a*i[2]+s,g=v*i[3]+f,m=m<5?5:m,g=g<5?5:g,b=(_(n)||A(n))&&!1!==function(e){return e.getParam("resize_img_proportional",!0,"boolean")}(t)?!od.modifierPressed(e):od.modifierPressed(e),b&&(S(a)>S(v)?(g=k(m*l),m=k(g/l)):(m=k(g/l),g=k(m*l))),B(r,m,g),C=(C=i.startPos.x+a)>0?C:0,x=(x=i.startPos.y+v)>0?x:0,y.setStyles(o,{left:C,top:x,display:"block"}),o.innerHTML=m+" &times; "+g,i[2]<0&&r.clientWidth<=m&&y.setStyle(r,"left",undefined+(s-m)),i[3]<0&&r.clientHeight<=g&&y.setStyle(r,"top",undefined+(f-g)),(a=N.scrollWidth-p)+(v=N.scrollHeight-h)!==0&&y.setStyles(o,{left:C-a,top:x-v}),d||(!function(e,t,n,r,o){e.fire("ObjectResizeStart",{target:t,width:n,height:r,origin:o});}(t,n,s,f,"corner-"+i.name),d=!0);},L=function(){var e=d;d=!1,e&&(O(n,"width",m),O(n,"height",g)),y.unbind(x,"mousemove",P),y.unbind(x,"mouseup",L),w!==x&&(y.unbind(w,"mousemove",P),y.unbind(w,"mouseup",L)),y.remove(r),y.remove(o),y.remove(a),I(n),e&&(!function(e,t,n,r,o){e.fire("ObjectResized",{target:t,width:n,height:r,origin:o});}(t,n,m,g,"corner-"+i.name),y.setAttrib(n,"style",y.getAttrib(n,"style"))),t.nodeChanged();},I=function(e){z();var d=y.getPos(e,N),b=d.x,S=d.y,k=e.getBoundingClientRect(),_=k.width||k.right-k.left,R=k.height||k.bottom-k.top;n!==e&&(M(),n=e,m=g=0);var O=t.fire("ObjectSelected",{target:e}),I=y.getAttrib(n,v,"1");T(e)&&!O.isDefaultPrevented()?C(E,(function(e,t){var d,m=function(d){var m,g=D(n)[0];u=d.screenX,c=d.screenY,s=g.clientWidth,f=g.clientHeight,l=f/s,(i=e).name=t,i.startPos={x:_*e[0]+b,y:R*e[1]+S},p=N.scrollWidth,h=N.scrollHeight,a=y.add(N,"div",{class:"mce-resize-backdrop","data-mce-bogus":"all"}),y.setStyles(a,{position:"fixed",left:"0",top:"0",width:"100%",height:"100%"}),r=A(m=n)?y.create("img",{src:wt.transparentSrc}):m.cloneNode(!0),y.addClass(r,"mce-clonedresizable"),y.setAttrib(r,"data-mce-bogus","all"),r.contentEditable="false",y.setStyles(r,{left:b,top:S,margin:0}),B(r,_,R),r.removeAttribute(v),N.appendChild(r),y.bind(x,"mousemove",P),y.bind(x,"mouseup",L),w!==x&&(y.bind(w,"mousemove",P),y.bind(w,"mouseup",L)),o=y.add(N,"div",{class:"mce-resize-helper","data-mce-bogus":"all"},s+" &times; "+f);};(d=y.get("mceResizeHandle"+t))&&y.remove(d),d=y.add(N,"div",{id:"mceResizeHandle"+t,"data-mce-bogus":"all",class:"mce-resizehandle",unselectable:!0,style:"cursor:"+t+"-resize; margin:0; padding:0"}),11===wt.ie&&(d.contentEditable=!1),y.bind(d,"mousedown",(function(e){e.stopImmediatePropagation(),e.preventDefault(),m(e);})),e.elm=d,y.setStyles(d,{left:_*e[0]+b-d.offsetWidth/2,top:R*e[1]+S-d.offsetHeight/2});})):M(),y.getAttrib(n,v)||n.setAttribute(v,I);},M=function(){z(),n&&n.removeAttribute(v),le(E,(function(e,t){var n=y.get("mceResizeHandle"+t);n&&(y.unbind(n),y.remove(n));}));},F=function(n){var r,o=function(e,t){if(e)do{if(e===t)return !0}while(e=e.parentNode)};d||t.removed||(C(y.select("img[data-mce-selected],hr[data-mce-selected]"),(function(e){e.removeAttribute(v);})),r="mousedown"===n.type?n.target:e.getNode(),o(r=y.$(r).closest("table,img,figure.image,hr,video,span.mce-preview-object")[0],N)&&(H(),o(e.getStart(!0),r)&&o(e.getEnd(!0),r))?I(r):M());},U=function(e){return id(Zl(t.getBody(),e))},z=function(){le(E,(function(e){e.elm&&(y.unbind(e.elm),delete e.elm);}));},H=function(){try{t.getDoc().execCommand("enableObjectResizing",!1,"false");}catch(e){}};t.on("init",(function(){if(H(),wt.browser.isIE()||wt.browser.isEdge()){t.on("mousedown click",(function(e){var n=e.target,r=n.nodeName;d||!/^(TABLE|IMG|HR)$/.test(r)||U(n)||(2!==e.button&&t.selection.select(n,"TABLE"===r),"mousedown"===e.type&&t.nodeChanged());}));var e=function(e){var n=function(e){ro.setEditorTimeout(t,(function(){return t.selection.select(e)}));};if(U(e.target)||Kn(e.target))return e.preventDefault(),void n(e.target);/^(TABLE|IMG|HR)$/.test(e.target.nodeName)&&(e.preventDefault(),"IMG"===e.target.tagName&&n(e.target));};y.bind(N,"mscontrolselect",e),t.on("remove",(function(){return y.unbind(N,"mscontrolselect",e)}));}var r=ro.throttle((function(e){t.composing||F(e);}));t.on("nodechange ResizeEditor ResizeWindow ResizeContent drop FullscreenStateChanged",r),t.on("keyup compositionend",(function(e){n&&"TABLE"===n.nodeName&&r(e);})),t.on("hide blur",M),t.on("contextmenu longpress",R,!0);})),t.on("remove",z);return {isResizable:T,showResizeRect:I,hideResizeRect:M,updateResizeRect:F,destroy:function(){n=r=a=null;}}},ud=function(e){return qn(e)||$n(e)},cd=function(e,t,n){var r,o,i=n;if(i.caretPositionFromPoint)(o=i.caretPositionFromPoint(e,t))&&((r=n.createRange()).setStart(o.offsetNode,o.offset),r.collapse(!0));else if(i.caretRangeFromPoint)r=i.caretRangeFromPoint(e,t);else if(i.body.createTextRange){r=i.body.createTextRange();try{r.moveToPoint(e,t),r.collapse(!0);}catch(o){r=function(e,t,n){var r,o=n.elementFromPoint(e,t),i=n.body.createTextRange();if(o&&"HTML"!==o.tagName||(o=n.body),i.moveToElementText(o),(r=(r=_t.toArray(i.getClientRects())).sort((function(e,n){return (e=Math.abs(Math.max(e.top-t,e.bottom-t)))-Math.abs(Math.max(n.top-t,n.bottom-t))}))).length>0){t=(r[0].bottom+r[0].top)/2;try{return i.moveToPoint(e,t),i.collapse(!0),i}catch(e){}}return null}(e,t,n);}return function(e,t){var n=e&&e.parentElement?e.parentElement():null;return $n(function(e,t,n){for(;e&&e!==t;){if(n(e))return e;e=e.parentNode;}return null}(n,t,ud))?null:e}(r,n.body)}return r},sd=function(e,t){return e&&t&&e.startContainer===t.startContainer&&e.startOffset===t.startOffset&&e.endContainer===t.endContainer&&e.endOffset===t.endOffset},fd=function(e,t,n){return null!==function(e,t,n){for(;e&&e!==t;){if(n(e))return e;e=e.parentNode;}return null}(e,t,n)},ld=function(e,t,n){return fd(e,t,(function(e){return e.nodeName===n}))},dd=function(e){return e&&"TABLE"===e.nodeName},md=function(e){return e&&/^(TD|TH|CAPTION)$/.test(e.nodeName)},gd=function(e,t){return _o(e)&&!1===fd(e,t,Ff)},pd=function(e,t,n){for(var r=new ao(t,e.getParent(t.parentNode,e.isBlock)||e.getRoot());t=r[n?"prev":"next"]();)if(jn(t))return !0},hd=function(e,t,n,r,o){var i,a,u=e.getRoot(),c=e.schema.getNonEmptyElements(),s=e.getParent(o.parentNode,e.isBlock)||u;if(r&&jn(o)&&t&&e.isEmpty(s))return I.some(Ac(o.parentNode,e.nodeIndex(o)));for(var f=new ao(o,s);a=f[r?"prev":"next"]();){if("false"===e.getContentEditableParent(a)||gd(a,u))return I.none();if(Fn(a)&&a.nodeValue.length>0)return !1===ld(a,u,"A")?I.some(Ac(a,r?a.nodeValue.length:0)):I.none();if(e.isBlock(a)||c[a.nodeName.toLowerCase()])return I.none();i=a;}return n&&i?I.some(Ac(i,0)):I.none()},vd=function(e,t,n,r){var o,i,a,u,c=e.getRoot(),s=!1;o=r[(n?"start":"end")+"Container"],i=r[(n?"start":"end")+"Offset"];var f=Dn(o)&&i===o.childNodes.length,l=e.schema.getNonEmptyElements();if(u=n,_o(o))return I.none();if(Dn(o)&&i>o.childNodes.length-1&&(u=!1),zn(o)&&(o=c,i=0),o===c){if(u&&(a=o.childNodes[i>0?i-1:0])){if(_o(a))return I.none();if(l[a.nodeName]||dd(a))return I.none()}if(o.hasChildNodes()){if(i=Math.min(!u&&i>0?i-1:i,o.childNodes.length-1),o=o.childNodes[i],i=Fn(o)&&f?o.data.length:0,!t&&o===c.lastChild&&dd(o))return I.none();if(function(e,t){for(;t&&t!==e;){if($n(t))return !0;t=t.parentNode;}return !1}(c,o)||_o(o))return I.none();if(o.hasChildNodes()&&!1===dd(o)){a=o;var d=new ao(o,c);do{if($n(a)||_o(a)){s=!1;break}if(Fn(a)&&a.nodeValue.length>0){i=u?0:a.nodeValue.length,o=a,s=!0;break}if(l[a.nodeName.toLowerCase()]&&!md(a)){i=e.nodeIndex(a),o=a.parentNode,u||i++,s=!0;break}}while(a=u?d.next():d.prev())}}}return t&&(Fn(o)&&0===i&&hd(e,f,t,!0,o).each((function(e){o=e.container(),i=e.offset(),s=!0;})),Dn(o)&&((a=o.childNodes[i])||(a=o.childNodes[i-1]),!a||!jn(a)||function(e,t){return e.previousSibling&&e.previousSibling.nodeName===t}(a,"A")||pd(e,a,!1)||pd(e,a,!0)||hd(e,f,t,!0,a).each((function(e){o=e.container(),i=e.offset(),s=!0;})))),u&&!t&&Fn(o)&&i===o.nodeValue.length&&hd(e,f,t,!1,o).each((function(e){o=e.container(),i=e.offset(),s=!0;})),s?I.some(Ac(o,i)):I.none()},bd=function(e,t){var n=t.collapsed,r=t.cloneRange(),o=Ac.fromRangeStart(t);return vd(e,n,!0,r).each((function(e){n&&Ac.isAbove(o,e)||r.setStart(e.container(),e.offset());})),n||vd(e,n,!1,r).each((function(e){r.setEnd(e.container(),e.offset());})),n&&r.collapse(!0),sd(t,r)?I.none():I.some(r)},yd=function(e,t){return e.splitText(t)},Cd=function(e){var t=e.startContainer,n=e.startOffset,r=e.endContainer,o=e.endOffset;return t===r&&Fn(t)?n>0&&n<t.nodeValue.length&&(t=(r=yd(t,n)).previousSibling,o>n?(t=r=yd(r,o-=n).previousSibling,o=r.nodeValue.length,n=0):o=0):(Fn(t)&&n>0&&n<t.nodeValue.length&&(t=yd(t,n),n=0),Fn(r)&&o>0&&o<r.nodeValue.length&&(o=(r=yd(r,o).previousSibling).nodeValue.length)),{startContainer:t,startOffset:n,endContainer:r,endOffset:o}},xd=function(e){return {walk:function(t,n){return Ol(e,t,n)},split:Cd,normalize:function(t){return bd(e,t).fold(T,(function(e){return t.setStart(e.startContainer,e.startOffset),t.setEnd(e.endContainer,e.endOffset),!0}))}}};xd.compareRanges=sd,xd.getCaretRangeFromPoint=cd,xd.getSelectedNode=ac,xd.getNode=uc;var wd,Sd=function(e,t){var n=function(n){var r=t(n);if(r<=0||null===r){var o=or(n,e);return parseFloat(o)||0}return r},r=function(e,t){return Y(t,(function(t,n){var r=or(e,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?t:t+o}),0)};return {set:function(t,n){if(!C(n)&&!n.match(/^[0-9]+$/))throw new Error(e+".set accepts only positive integer values. Value was "+n);var r=t.dom;Gn(r)&&(r.style[e]=n+"px");},get:n,getOuter:n,aggregate:r,max:function(e,t,n){var o=r(e,n);return t>o?t-o:0}}}("height",(function(e){var t=e.dom;return bn(e)?t.getBoundingClientRect().height:t.offsetHeight})),kd=function(e,t){return e.view(t).fold(k([]),(function(t){var n=e.owner(t),r=kd(e,n);return [t].concat(r)}))},Nd=Object.freeze({__proto__:null,view:function(e){var t;return (e.dom===document?I.none():I.from(null===(t=e.dom.defaultView)||void 0===t?void 0:t.frameElement)).map(Rt.fromDom)},owner:function(e){return qt(e)}}),Ed=function(e){var t=Rt.fromDom(document),n=Sn(t),r=function(e,t){var n=t.owner(e);return kd(t,n)}(e,Nd),o=wn(e),i=X(r,(function(e,t){var n=wn(t);return {left:e.left+n.left,top:e.top+n.top}}),{left:0,top:0});return Cn(i.left+o.left+n.left,i.top+o.top+n.top)},_d=function(e){return "textarea"===It(e)},Ad=function(e,t){var n=function(e){var t=e.dom.ownerDocument,n=t.body,r=t.defaultView,o=t.documentElement;if(n===e.dom)return Cn(n.offsetLeft,n.offsetTop);var i=xn(null==r?void 0:r.pageYOffset,o.scrollTop),a=xn(null==r?void 0:r.pageXOffset,o.scrollLeft),u=xn(o.clientTop,n.clientTop),c=xn(o.clientLeft,n.clientLeft);return wn(e).translate(a-c,i-u)}(e),r=function(e){return Sd.get(e)}(e);return {element:e,bottom:n.top+r,height:r,pos:n,cleanup:t}},Rd=function(e,t){var n=function(e,t){var n=Jt(e);if(0===n.length||_d(e))return {element:e,offset:t};if(t<n.length&&!_d(n[t]))return {element:n[t],offset:0};var r=n[n.length-1];return _d(r)?{element:e,offset:t}:"img"===It(r)?{element:r,offset:1}:zt(r)?{element:r,offset:Wl(r).length}:{element:r,offset:Jt(r).length}}(e,t),r=Rt.fromHtml('<span data-mce-bogus="all" style="display: inline-block;">\ufeff</span>');return fn(n.element,r),Ad(r,(function(){return hn(r)}))},Dd=function(e,t,n,r){Pd(e,(function(o,i){return Od(e,t,n,r)}),n);},Td=function(e,t,n,r,o){var i={elm:r.element.dom,alignToTop:o};(function(e,t){return e.fire("ScrollIntoView",t).isDefaultPrevented()})(e,i)||(n(t,Sn(t).top,r,o),function(e,t){e.fire("AfterScrollIntoView",t);}(e,i));},Od=function(e,t,n,r){var o=Rt.fromDom(e.getBody()),i=Rt.fromDom(e.getDoc());o.dom.offsetWidth;var a=Rd(Rt.fromDom(n.startContainer),n.startOffset);Td(e,i,t,a,r),a.cleanup();},Bd=function(e,t,n,r){var o=Rt.fromDom(e.getDoc());Td(e,o,n,function(e){return Ad(Rt.fromDom(e),x)}(t),r);},Pd=function(e,t,n){var r=n.startContainer,o=n.startOffset,i=n.endContainer,a=n.endOffset;t(Rt.fromDom(r),Rt.fromDom(i));var u=e.dom.createRng();u.setStart(r,o),u.setEnd(i,a),e.selection.setRng(n);},Ld=function(e,t,n,r){var o=e.pos;if(n)kn(o.left,o.top,r);else {var i=o.top-t+e.height;kn(o.left,i,r);}},Id=function(e,t,n,r,o){var i=n+t,a=r.pos.top,u=r.bottom,c=u-a>=n;if(a<t)Ld(r,n,!1!==o,e);else if(a>i){Ld(r,n,c?!1!==o:!0===o,e);}else u>i&&!c&&Ld(r,n,!0===o,e);},Md=function(e,t,n,r){var o=e.dom.defaultView.innerHeight;Id(e,t,o,n,r);},Fd=function(e,t,n,r){var o=e.dom.defaultView.innerHeight;Id(e,t,o,n,r);var i=Ed(n.element),a=_n(window);i.top<a.y?Nn(n.element,!1!==r):i.top>a.bottom&&Nn(n.element,!0===r);},Ud=function(e,t,n){return Dd(e,Md,t,n)},zd=function(e,t,n){return Bd(e,t,Md,n)},Hd=function(e,t,n){return Dd(e,Fd,t,n)},jd=function(e,t,n){return Bd(e,t,Fd,n)},Vd=function(e,t,n){(e.inline?Ud:Hd)(e,t,n);},qd=function(e){var t=an(e).dom;return e.dom===t.activeElement},$d=function(e){return void 0===e&&(e=Rt.fromDom(document)),I.from(e.dom.activeElement).map(Rt.fromDom)},Wd=function(e,t,n,r){return {start:e,soffset:t,finish:n,foffset:r}},Kd=kr([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Xd=(Kd.before,Kd.on,Kd.after,function(e){return e.fold(N,N,N)}),Yd=kr([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Gd={domRange:Yd.domRange,relative:Yd.relative,exact:Yd.exact,exactFromRange:function(e){return Yd.exact(e.start,e.soffset,e.finish,e.foffset)},getWin:function(e){var t=function(e){return e.match({domRange:function(e){return Rt.fromDom(e.startContainer)},relative:function(e,t){return Xd(e)},exact:function(e,t,n,r){return e}})}(e);return $t(t)},range:Wd},Jd=mt().browser,Qd=function(e,t){var n=zt(t)?Wl(t).length:Jt(t).length+1;return e>n?n:e<0?0:e},Zd=function(e){return Gd.range(e.start,Qd(e.soffset,e.start),e.finish,Qd(e.foffset,e.finish))},em=function(e,t){return !Rn(t.dom)&&(Lt(e,t)||Bt(e,t))},tm=function(e){return function(t){return em(e,t.start)&&em(e,t.finish)}},nm=function(e){return !0===e.inline||Jd.isIE()},rm=function(e){return Gd.range(Rt.fromDom(e.startContainer),e.startOffset,Rt.fromDom(e.endContainer),e.endOffset)},om=function(e){return function(e){var t=e.getSelection();return (t&&0!==t.rangeCount?I.from(t.getRangeAt(0)):I.none()).map(rm)}($t(e).dom).filter(tm(e))},im=function(e){var t=document.createRange();try{return t.setStart(e.start.dom,e.soffset),t.setEnd(e.finish.dom,e.foffset),I.some(t)}catch(e){return I.none()}},am=function(e){var t=nm(e)?om(Rt.fromDom(e.getBody())):I.none();e.bookmark=t.isSome()?t:e.bookmark;},um=function(e){return (e.bookmark?e.bookmark:I.none()).bind((function(t){return function(e,t){return I.from(t).filter(tm(e)).map(Zd)}(Rt.fromDom(e.getBody()),t)})).bind(im)},cm={isEditorUIElement:function(e){var t=e.className.toString();return -1!==t.indexOf("tox-")||-1!==t.indexOf("mce-")}},sm=function(e,t){mt().browser.isIE()?function(e){e.on("focusout",(function(){am(e);}));}(e):function(e,t){e.on("mouseup touchend",(function(e){t.throttle();}));}(e,t),e.on("keyup NodeChange",(function(t){(function(e){return "nodechange"===e.type&&e.selectionChange})(t)||am(e);}));},fm=function(e){var t=_u((function(){am(e);}),0);e.on("init",(function(){e.inline&&function(e,t){var n=function(){t.throttle();};pu.DOM.bind(document,"mouseup",n),e.on("remove",(function(){pu.DOM.unbind(document,"mouseup",n);}));}(e,t),sm(e,t);})),e.on("remove",(function(){t.cancel();}));},lm=pu.DOM,dm=function(e,t){var n=function(e){return e.getParam("custom_ui_selector","","string")}(e),r=lm.getParent(t,(function(t){return function(e){return cm.isEditorUIElement(e)}(t)||!!n&&e.dom.is(t,n)}));return null!==r},mm=function(e,t){var n=t.editor;fm(n),n.on("focusin",(function(){var t=e.focusedEditor;t!==n&&(t&&t.fire("blur",{focusedEditor:n}),e.setActive(n),e.focusedEditor=n,n.fire("focus",{blurredEditor:t}),n.focus(!0));})),n.on("focusout",(function(){ro.setEditorTimeout(n,(function(){var t=e.focusedEditor;dm(n,function(e){try{var t=an(Rt.fromDom(e.getElement()));return $d(t).fold((function(){return document.body}),(function(e){return e.dom}))}catch(e){return document.body}}(n))||t!==n||(n.fire("blur",{focusedEditor:null}),e.focusedEditor=null);}));})),wd||(wd=function(t){var n=e.activeEditor;n&&function(e){if(on()&&b(e.target)){var t=Rt.fromDom(e.target);if(Ut(t)&&sn(t)&&e.composed&&e.composedPath){var n=e.composedPath();if(n)return ie(n)}}return I.from(e.target)}(t).each((function(t){t.ownerDocument===document&&(t===document.body||dm(n,t)||e.focusedEditor!==n||(n.fire("blur",{focusedEditor:null}),e.focusedEditor=null));}));},lm.bind(document,"focusin",wd));},gm=function(e,t){e.focusedEditor===t.editor&&(e.focusedEditor=null),e.activeEditor||(lm.unbind(document,"focusin",wd),wd=null);},pm=function(e,t){return function(e){return e.collapsed?I.from(uc(e.startContainer,e.startOffset)).map(Rt.fromDom):I.none()}(t).bind((function(t){return ho(t)?I.some(t):!1===Lt(e,t)?I.some(e):I.none()}))},hm=function(e,t){pm(Rt.fromDom(e.getBody()),t).bind((function(e){return Lf(e.dom)})).fold((function(){e.selection.normalize();}),(function(t){return e.selection.setRng(t.toRange())}));},vm=function(e){if(e.setActive)try{e.setActive();}catch(t){e.focus();}else e.focus();},bm=function(e){return qd(e)||(t=e,$d(an(t)).filter((function(e){return t.dom.contains(e.dom)}))).isSome();var t;},ym=function(e){return e.inline?function(e){var t=e.getBody();return t&&bm(Rt.fromDom(t))}(e):function(e){return e.iframeElement&&qd(Rt.fromDom(e.iframeElement))}(e)},Cm=function(e){return ym(e)||function(e){var t=an(Rt.fromDom(e.getElement()));return $d(t).filter((function(t){return !(void 0!==(n=t.dom.classList)&&(n.contains("tox-edit-area")||n.contains("tox-edit-area__iframe")||n.contains("mce-content-body")))&&dm(e,t.dom);var n;})).isSome()}(e)},xm=function(e){return e.editorManager.setActive(e)},wm=function(e,t){e.removed||(t?xm(e):function(e){var t=e.selection,n=e.getBody(),r=t.getRng();e.quirks.refreshContentEditable(),void 0!==e.bookmark&&!1===ym(e)&&um(e).each((function(t){e.selection.setRng(t),r=t;}));var o=function(e,t){return e.dom.getParent(t,(function(t){return "true"===e.dom.getContentEditable(t)}))}(e,t.getNode());if(e.$.contains(n,o))return vm(o),hm(e,r),void xm(e);e.inline||(wt.opera||vm(n),e.getWin().focus()),(wt.gecko||e.inline)&&(vm(n),hm(e,r)),xm(e);}(e));},Sm=function(e,t,n,r,o){var i=n?t.startContainer:t.endContainer,a=n?t.startOffset:t.endOffset;return I.from(i).map(Rt.fromDom).map((function(e){return r&&t.collapsed?e:Qt(e,o(e,a)).getOr(e)})).bind((function(e){return Ut(e)?I.some(e):Wt(e).filter(Ut)})).map((function(e){return e.dom})).getOr(e)},km=function(e,t,n){return Sm(e,t,!0,n,(function(e,t){return Math.min(tn(e),t)}))},Nm=function(e,t,n){return Sm(e,t,!1,n,(function(e,t){return t>0?t-1:t}))},Em=function(e,t){for(var n=e;e&&Fn(e)&&0===e.length;)e=t?e.nextSibling:e.previousSibling;return e||n},_m=function(e,t){return V(t,(function(t){var n=e.fire("GetSelectionRange",{range:t});return n.range!==t?n.range:t}))},Am={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},Rm=function(e,t,n){var r=n?"lastChild":"firstChild",o=n?"prev":"next";if(e[r])return e[r];if(e!==t){var i=e[o];if(i)return i;for(var a=e.parent;a&&a!==t;a=a.parent)if(i=a[o])return i}},Dm=function(e){if(!Xo(e.value))return !1;var t=e.parent;return !t||"span"===t.name&&!t.attr("style")||!/^[ ]+$/.test(e.value)},Tm=function(e){var t="a"===e.name&&!e.attr("href")&&e.attr("id");return e.attr("name")||e.attr("id")&&!e.firstChild||e.attr("data-mce-bookmark")||t},Om=function(){function e(e,t){this.name=e,this.type=t,1===t&&(this.attributes=[],this.attributes.map={});}return e.create=function(t,n){var r=new e(t,Am[t]||1);return n&&le(n,(function(e,t){r.attr(t,e);})),r},e.prototype.replace=function(e){var t=this;return e.parent&&e.remove(),t.insert(e,t),t.remove(),t},e.prototype.attr=function(e,t){var n,r=this;if("string"!=typeof e)return null!=e&&le(e,(function(e,t){r.attr(t,e);})),r;if(n=r.attributes){if(void 0!==t){if(null===t){if(e in n.map){delete n.map[e];for(var o=n.length;o--;)if(n[o].name===e)return n.splice(o,1),r}return r}if(e in n.map){for(o=n.length;o--;)if(n[o].name===e){n[o].value=t;break}}else n.push({name:e,value:t});return n.map[e]=t,r}return n.map[e]}},e.prototype.clone=function(){var t,n=this,r=new e(n.name,n.type);if(t=n.attributes){var o=[];o.map={};for(var i=0,a=t.length;i<a;i++){var u=t[i];"id"!==u.name&&(o[o.length]={name:u.name,value:u.value},o.map[u.name]=u.value);}r.attributes=o;}return r.value=n.value,r.shortEnded=n.shortEnded,r},e.prototype.wrap=function(e){var t=this;return t.parent.insert(e,t),e.append(t),t},e.prototype.unwrap=function(){for(var e=this,t=e.firstChild;t;){var n=t.next;e.insert(t,e,!0),t=n;}e.remove();},e.prototype.remove=function(){var e=this,t=e.parent,n=e.next,r=e.prev;return t&&(t.firstChild===e?(t.firstChild=n,n&&(n.prev=null)):r.next=n,t.lastChild===e?(t.lastChild=r,r&&(r.next=null)):n.prev=r,e.parent=e.next=e.prev=null),e},e.prototype.append=function(e){var t=this;e.parent&&e.remove();var n=t.lastChild;return n?(n.next=e,e.prev=n,t.lastChild=e):t.lastChild=t.firstChild=e,e.parent=t,e},e.prototype.insert=function(e,t,n){e.parent&&e.remove();var r=t.parent||this;return n?(t===r.firstChild?r.firstChild=e:t.prev.next=e,e.prev=t.prev,e.next=t,t.prev=e):(t===r.lastChild?r.lastChild=e:t.next.prev=e,e.next=t.next,e.prev=t,t.next=e),e.parent=r,e},e.prototype.getAll=function(e){for(var t=[],n=this.firstChild;n;n=Rm(n,this))n.name===e&&t.push(n);return t},e.prototype.children=function(){for(var e=[],t=this.firstChild;t;t=t.next)e.push(t);return e},e.prototype.empty=function(){var e=this;if(e.firstChild){for(var t=[],n=e.firstChild;n;n=Rm(n,e))t.push(n);for(var r=t.length;r--;){(n=t[r]).parent=n.firstChild=n.lastChild=n.next=n.prev=null;}}return e.firstChild=e.lastChild=null,e},e.prototype.isEmpty=function(e,t,n){void 0===t&&(t={});var r=this,o=r.firstChild;if(Tm(r))return !1;if(o)do{if(1===o.type){if(o.attr("data-mce-bogus"))continue;if(e[o.name])return !1;if(Tm(o))return !1}if(8===o.type)return !1;if(3===o.type&&!Dm(o))return !1;if(3===o.type&&o.parent&&t[o.parent.name]&&Xo(o.value))return !1;if(n&&n(o))return !1}while(o=Rm(o,r));return !0},e.prototype.walk=function(e){return Rm(this,null,e)},e}(),Bm=function(e,t){return e.replace(t.re,(function(e){return be(t.uris,e).getOr(e)}))},Pm=_t.each,Lm=_t.trim,Im="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),Mm={ftp:21,http:80,https:443,mailto:25},Fm=["img","video"],Um=function(e,t,n){return !e.allow_html_data_urls&&(/^data:image\//i.test(t)?function(e,t){return b(e)?!e:!b(t)||!H(Fm,t)}(e.allow_svg_data_urls,n)&&/^data:image\/svg\+xml/i.test(t):/^data:/i.test(t))},zm=function(){function e(t,n){t=Lm(t),this.settings=n||{};var r=this.settings.base_uri,o=this;if(/^([\w\-]+):([^\/]{2})/i.test(t)||/^\s*#/.test(t))o.source=t;else {var i=0===t.indexOf("//");if(0!==t.indexOf("/")||i||(t=(r&&r.protocol||"http")+"://mce_host"+t),!/^[\w\-]*:?\/\//.test(t)){var a=this.settings.base_uri?this.settings.base_uri.path:new e(document.location.href).directory;if(this.settings.base_uri&&""==this.settings.base_uri.protocol)t="//mce_host"+o.toAbsPath(a,t);else {var u=/([^#?]*)([#?]?.*)/.exec(t);t=(r&&r.protocol||"http")+"://mce_host"+o.toAbsPath(a,u[1])+u[2];}}t=t.replace(/@@/g,"(mce_at)");var c=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?(\[[a-zA-Z0-9:.%]+\]|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(t);Pm(Im,(function(e,t){var n=c[t];n&&(n=n.replace(/\(mce_at\)/g,"@@")),o[e]=n;})),r&&(o.protocol||(o.protocol=r.protocol),o.userInfo||(o.userInfo=r.userInfo),o.port||"mce_host"!==o.host||(o.port=r.port),o.host&&"mce_host"!==o.host||(o.host=r.host),o.source=""),i&&(o.protocol="");}}return e.parseDataUri=function(e){var t,n=decodeURIComponent(e).split(","),r=/data:([^;]+)/.exec(n[0]);return r&&(t=r[1]),{type:t,data:n[1]}},e.isDomSafe=function(e,t,n){if(void 0===n&&(n={}),n.allow_script_urls)return !0;var r=bi.decode(e).replace(/[\s\u0000-\u001F]+/g,"");try{r=decodeURIComponent(r);}catch(e){r=unescape(r);}return !/((java|vb)script|mhtml):/i.test(r)&&!Um(n,r,t)},e.getDocumentBaseUrl=function(e){var t;return t=0!==e.protocol.indexOf("http")&&"file:"!==e.protocol?e.href:e.protocol+"//"+e.host+e.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(t)&&(t=t.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(t)||(t+="/")),t},e.prototype.setPath=function(e){var t=/^(.*?)\/?(\w+)?$/.exec(e);this.path=t[0],this.directory=t[1],this.file=t[2],this.source="",this.getURI();},e.prototype.toRelative=function(t){var n;if("./"===t)return t;var r=new e(t,{base_uri:this});if("mce_host"!==r.host&&this.host!==r.host&&r.host||this.port!==r.port||this.protocol!==r.protocol&&""!==r.protocol)return r.getURI();var o=this.getURI(),i=r.getURI();return o===i||"/"===o.charAt(o.length-1)&&o.substr(0,o.length-1)===i?o:(n=this.toRelPath(this.path,r.path),r.query&&(n+="?"+r.query),r.anchor&&(n+="#"+r.anchor),n)},e.prototype.toAbsolute=function(t,n){var r=new e(t,{base_uri:this});return r.getURI(n&&this.isSameOrigin(r))},e.prototype.isSameOrigin=function(e){if(this.host==e.host&&this.protocol==e.protocol){if(this.port==e.port)return !0;var t=Mm[this.protocol];if(t&&(this.port||t)==(e.port||t))return !0}return !1},e.prototype.toRelPath=function(e,t){var n,r,o=0,i="",a=e.substring(0,e.lastIndexOf("/")).split("/"),u=t.split("/");if(a.length>=u.length)for(n=0,r=a.length;n<r;n++)if(n>=u.length||a[n]!==u[n]){o=n+1;break}if(a.length<u.length)for(n=0,r=u.length;n<r;n++)if(n>=a.length||a[n]!==u[n]){o=n+1;break}if(1===o)return t;for(n=0,r=a.length-(o-1);n<r;n++)i+="../";for(n=o-1,r=u.length;n<r;n++)i+=n!==o-1?"/"+u[n]:u[n];return i},e.prototype.toAbsPath=function(e,t){var n,r,o=0,i=[],a=/\/$/.test(t)?"/":"",u=e.split("/"),c=t.split("/");for(Pm(u,(function(e){e&&i.push(e);})),u=i,n=c.length-1,i=[];n>=0;n--)0!==c[n].length&&"."!==c[n]&&(".."!==c[n]?o>0?o--:i.push(c[n]):o++);return 0!==(r=(n=u.length-o)<=0?te(i).join("/"):u.slice(0,n).join("/")+"/"+te(i).join("/")).indexOf("/")&&(r="/"+r),a&&r.lastIndexOf("/")!==r.length-1&&(r+=a),r},e.prototype.getURI=function(e){var t;return void 0===e&&(e=!1),this.source&&!e||(t="",e||(this.protocol?t+=this.protocol+"://":t+="//",this.userInfo&&(t+=this.userInfo+"@"),this.host&&(t+=this.host),this.port&&(t+=":"+this.port)),this.path&&(t+=this.path),this.query&&(t+="?"+this.query),this.anchor&&(t+="#"+this.anchor),this.source=t),this.source},e}(),Hm=_t.makeMap("button,fieldset,form,iframe,img,image,input,object,output,select,textarea"),jm=function(e,t,n){for(var r=/<([!?\/])?([A-Za-z0-9\-_:.]+)/g,o=/(?:\s(?:[^'">]+(?:"[^"]*"|'[^']*'))*[^"'>]*(?:"[^">]*|'[^'>]*)?|\s*|\/)>/g,i=e.getShortEndedElements(),a=1,u=n;0!==a;)for(r.lastIndex=u;;){var c=r.exec(t);if(null===c)return u;if("!"===c[1]){u=Me(c[2],"--")?Vm(t,!1,c.index+"!--".length):Vm(t,!0,c.index+1);break}o.lastIndex=r.lastIndex;var s=o.exec(t);if(!g(s)&&s.index===r.lastIndex){"/"===c[1]?a-=1:ye(i,c[2])||(a+=1),u=r.lastIndex+s[0].length;break}}return u},Vm=function(e,t,n){void 0===n&&(n=0);var r=e.toLowerCase();if(-1!==r.indexOf("[if ",n)&&function(e,t){return /^\s*\[if [\w\W]+\]>.*<!\[endif\](--!?)?>/.test(e.substr(t))}(r,n)){var o=r.indexOf("[endif]",n);return r.indexOf(">",o)}if(t){var i=r.indexOf(">",n);return -1!==i?i:r.length}var a=/--!?>/g;a.lastIndex=n;var u=a.exec(e);return u?u.index+u[0].length:r.length},qm=function(e,t){var n=e.exec(t);if(n){var r=n[1],o=n[2];return "string"==typeof r&&"data-mce-bogus"===r.toLowerCase()?o:null}return null},$m=function(e,t){var n;void 0===t&&(t=Ai());var r=null!==(n=(e=e||{}).document)&&void 0!==n?n:document,o=r.createElement("form");!1!==e.fix_self_closing&&(e.fix_self_closing=!0);var i=e.comment?e.comment:x,a=e.cdata?e.cdata:x,u=e.text?e.text:x,c=e.start?e.start:x,s=e.end?e.end:x,f=e.pi?e.pi:x,l=e.doctype?e.doctype:x,d=function(n,d){void 0===d&&(d="html");for(var m,g,p,h,v,b,y,C,x,w,S,k,N,E,_,A,R,D,T,O=n.html,B=0,P=[],L=0,I=bi.decode,M=_t.makeMap("src,href,data,background,action,formaction,poster,xlink:href"),F="html"===d?0:1,U=function(e){var t,n;for(t=P.length;t--&&P[t].name!==e;);if(t>=0){for(n=P.length-1;n>=t;n--)(e=P[n]).valid&&s(e.name);P.length=t;}},z=function(e,t){return u(Bm(e,n),t)},H=function(t){""!==t&&(">"===t.charAt(0)&&(t=" "+t),e.allow_conditional_comments||"[if"!==t.substr(0,3).toLowerCase()||(t=" "+t),i(Bm(t,n)));},j=function(e,t){var n=e||"",r=!Me(n,"--"),o=Vm(O,r,t);return e=O.substr(t,o-t),H(r?n+e:e),o+1},V=function(t,i,a,u,c){if(a=function(e){return Bm(e,n)}((i=i.toLowerCase())in X?i:I(a||u||c||"")),Y&&!C&&!1===function(e){return 0===e.indexOf("data-")||0===e.indexOf("aria-")}(i)){var s=E[i];if(!s&&_){for(var f=_.length;f--&&!(s=_[f]).pattern.test(i););-1===f&&(s=null);}if(!s)return;if(s.validValues&&!(a in s.validValues))return}("name"===i||"id"===i)&&t in Hm&&(a in r||a in o)||M[i]&&!zm.isDomSafe(a,t,e)||C&&(i in M||0===i.indexOf("on"))||(h.map[i]=a,h.push({name:i,value:a}));},q=new RegExp("<(?:(?:!--([\\w\\W]*?)--!?>)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:![Dd][Oo][Cc][Tt][Yy][Pp][Ee]([\\w\\W]*?)>)|(?:!(--)?)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)>)|(?:([A-Za-z][A-Za-z0-9\\-_:.]*)(\\s(?:[^'\">]+(?:\"[^\"]*\"|'[^']*'))*[^\"'>]*(?:\"[^\">]*|'[^'>]*)?|\\s*|\\/)>))","g"),$=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,W=t.getShortEndedElements(),K=e.self_closing_elements||t.getSelfClosingElements(),X=t.getBoolAttrs(),Y=e.validate,G=e.remove_internals,J=e.fix_self_closing,Q=t.getSpecialElements(),Z=O+">";m=q.exec(Z);){var ee=m[0];if(B<m.index&&z(I(O.substr(B,m.index-B))),g=m[7])":"===(g=g.toLowerCase()).charAt(0)&&(g=g.substr(1)),U(g);else if(g=m[8]){if(m.index+ee.length>O.length){z(I(O.substr(m.index))),B=m.index+ee.length;continue}":"===(g=g.toLowerCase()).charAt(0)&&(g=g.substr(1)),x=g in W,J&&K[g]&&P.length>0&&P[P.length-1].name===g&&U(g);var te=qm($,m[9]);if(null!==te){if("all"===te){B=jm(t,O,q.lastIndex),q.lastIndex=B;continue}S=!1;}if(!Y||(w=t.getElementRule(g))){if(S=!0,Y&&(E=w.attributes,_=w.attributePatterns),(N=m[9])?((C=-1!==N.indexOf("data-mce-type"))&&G&&(S=!1),(h=[]).map={},N.replace($,(function(e,t,n,r,o){return V(g,t,n,r,o),""}))):(h=[]).map={},Y&&!C){if(A=w.attributesRequired,R=w.attributesDefault,D=w.attributesForced,w.removeEmptyAttrs&&!h.length&&(S=!1),D)for(v=D.length;v--;)y=(k=D[v]).name,"{$uid}"===(T=k.value)&&(T="mce_"+L++),h.map[y]=T,h.push({name:y,value:T});if(R)for(v=R.length;v--;)(y=(k=R[v]).name)in h.map||("{$uid}"===(T=k.value)&&(T="mce_"+L++),h.map[y]=T,h.push({name:y,value:T}));if(A){for(v=A.length;v--&&!(A[v]in h.map););-1===v&&(S=!1);}if(k=h.map["data-mce-bogus"]){if("all"===k){B=jm(t,O,q.lastIndex),q.lastIndex=B;continue}S=!1;}}S&&c(g,h,x);}else S=!1;if(p=Q[g]){p.lastIndex=B=m.index+ee.length,(m=p.exec(O))?(S&&(b=O.substr(B,m.index-B)),B=m.index+m[0].length):(b=O.substr(B),B=O.length),S&&(b.length>0&&z(b,!0),s(g)),q.lastIndex=B;continue}x||(N&&N.indexOf("/")===N.length-1?S&&s(g):P.push({name:g,valid:S}));}else if(g=m[1])H(g);else if(g=m[2]){if(!(1===F||e.preserve_cdata||P.length>0&&t.isValidChild(P[P.length-1].name,"#cdata"))){B=j("",m.index+2),q.lastIndex=B;continue}a(g);}else if(g=m[3])l(g);else {if((g=m[4])||"<!"===ee){B=j(g,m.index+ee.length),q.lastIndex=B;continue}if(g=m[5]){if(1!==F){B=j("?",m.index+2),q.lastIndex=B;continue}f(g,m[6]);}}B=m.index+ee.length;}for(B<O.length&&z(I(O.substr(B))),v=P.length-1;v>=0;v--)(g=P[v]).valid&&s(g.name);};return {parse:function(e,t){void 0===t&&(t="html"),d(function(e){for(var t,n=/data:[^;]+;base64,([a-z0-9\+\/=\s]+)/gi,r=[],o={},i=Wu("img"),a=0,u=0;t=n.exec(e);){var c=t[0],s=i+"_"+u++;o[s]=c,a<t.index&&r.push(e.substr(a,t.index-a)),r.push(s),a=t.index+c.length;}var f=new RegExp(i+"_[0-9]+","g");return 0===a?{prefix:i,uris:o,html:e,re:f}:(a<e.length&&r.push(e.substr(a)),{prefix:i,uris:o,html:r.join(""),re:f})}(e),t);}}};$m.findEndTag=jm;var Wm=function(e,t){for(var n,r=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,o=e.schema,i=function(e,t){var n=new RegExp(["\\s?("+e.join("|")+')="[^"]+"'].join("|"),"gi");return t.replace(n,"")}(e.getTempAttrs(),t),a=o.getShortEndedElements();n=r.exec(i);){var u=r.lastIndex,c=n[0].length,s=void 0;s=a[n[1]]?u:$m.findEndTag(o,i,u),i=i.substring(0,u-c)+i.substring(s),r.lastIndex=u-c;}return wo(i)},Km=Wm,Xm=function(e,t,n,r){var o,i=function(e,t){return Re(Re({},e),{format:t,get:!0,getInner:!0})}(t,n),a=t.no_events?i:e.fire("BeforeGetContent",i);return o="raw"===a.format?_t.trim(Km(e.serializer,r.innerHTML)):"text"===a.format?e.dom.isEmpty(r)?"":wo(r.innerText||r.textContent):"tree"===a.format?e.serializer.serialize(r,a):function(e,t){var n=ts(e),r=new RegExp("^(<"+n+"[^>]*>(&nbsp;|&#160;|\\s| |<br \\/>|)<\\/"+n+">[\r\n]*|<br \\/>[\r\n]*)$");return t.replace(r,"")}(e,e.serializer.serialize(r,a)),H(["text","tree"],a.format)||bo(Rt.fromDom(r))?a.content=o:a.content=_t.trim(o),a.no_events?a.content:e.fire("GetContent",a).content},Ym=_t.each,Gm=function(e){return {compare:function(t,n){if(t.nodeName!==n.nodeName)return !1;var r=function(t){var n={};return Ym(e.getAttribs(t),(function(r){var o=r.nodeName.toLowerCase();0!==o.indexOf("_")&&"style"!==o&&0!==o.indexOf("data-")&&(n[o]=e.getAttrib(t,o));})),n},o=function(e,t){var n,r;for(r in e)if(ye(e,r)){if(void 0===(n=t[r]))return !1;if(e[r]!==n)return !1;delete t[r];}for(r in t)if(ye(t,r))return !1;return !0};return !!o(r(t),r(n))&&(!!o(e.parseStyle(e.getAttrib(t,"style")),e.parseStyle(e.getAttrib(n,"style")))&&(!Gf(t)&&!Gf(n)))}}},Jm=_t.makeMap,Qm=function(e){var t=[],n=(e=e||{}).indent,r=Jm(e.indent_before||""),o=Jm(e.indent_after||""),i=bi.getEncodeFunc(e.entity_encoding||"raw",e.entities),a="html"===e.element_format;return {start:function(e,u,c){var s,f,l,d;if(n&&r[e]&&t.length>0&&(d=t[t.length-1]).length>0&&"\n"!==d&&t.push("\n"),t.push("<",e),u)for(s=0,f=u.length;s<f;s++)l=u[s],t.push(" ",l.name,'="',i(l.value,!0),'"');t[t.length]=!c||a?">":" />",c&&n&&o[e]&&t.length>0&&(d=t[t.length-1]).length>0&&"\n"!==d&&t.push("\n");},end:function(e){var r;t.push("</",e,">"),n&&o[e]&&t.length>0&&(r=t[t.length-1]).length>0&&"\n"!==r&&t.push("\n");},text:function(e,n){e.length>0&&(t[t.length]=n?e:i(e));},cdata:function(e){t.push("<![CDATA[",e,"]]>");},comment:function(e){t.push("\x3c!--",e,"--\x3e");},pi:function(e,r){r?t.push("<?",e," ",i(r),"?>"):t.push("<?",e,"?>"),n&&t.push("\n");},doctype:function(e){t.push("<!DOCTYPE",e,">",n?"\n":"");},reset:function(){t.length=0;},getContent:function(){return t.join("").replace(/\n$/,"")}}},Zm=function(e,t){void 0===t&&(t=Ai());var n=Qm(e);(e=e||{}).validate=!("validate"in e)||e.validate;return {serialize:function(r){var o=e.validate,i={3:function(e){n.text(e.value,e.raw);},8:function(e){n.comment(e.value);},7:function(e){n.pi(e.name,e.value);},10:function(e){n.doctype(e.value);},4:function(e){n.cdata(e.value);},11:function(e){if(e=e.firstChild)do{a(e);}while(e=e.next)}};n.reset();var a=function(e){var r=i[e.type];if(r)r(e);else {var u=e.name,c=e.shortEnded,s=e.attributes;if(o&&s&&s.length>1){var f=[];f.map={};var l=t.getElementRule(e.name);if(l){for(var d=0,m=l.attributesOrder.length;d<m;d++){if((p=l.attributesOrder[d])in s.map){var g=s.map[p];f.map[p]=g,f.push({name:p,value:g});}}for(d=0,m=s.length;d<m;d++){var p;if(!((p=s[d].name)in f.map)){g=s.map[p];f.map[p]=g,f.push({name:p,value:g});}}s=f;}}if(n.start(e.name,s,c),!c){if(e=e.firstChild)do{a(e);}while(e=e.next);n.end(u);}}};return 1!==r.type||e.inner?i[11](r):a(r),n.getContent()}}},eg=new Set;q(["margin","margin-left","margin-right","margin-top","margin-bottom","padding","padding-left","padding-right","padding-top","padding-bottom","border","border-width","border-style","border-color","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","float","position","left","right","top","bottom","z-index","display","transform","width","max-width","min-width","height","max-height","min-height","overflow","overflow-x","overflow-y","text-overflow","vertical-align","transition","transition-delay","transition-duration","transition-property","transition-timing-function"],(function(e){eg.add(e);}));var tg=["font","text-decoration","text-emphasis"],ng=function(e,t){return se(e.parseStyle(e.getAttrib(t,"style")))},rg=function(e,t){return ee(ng(e,t),(function(e){return !function(e){return eg.has(e)}(e)}))},og=function(e,t,n){var r=ng(e,t),o=ng(e,n),i=function(r){var o=e.getStyle(t,r),i=e.getStyle(n,r);return je(o)&&je(i)&&o!==i};return j(r,(function(e){var t=function(t){return j(t,(function(t){return t===e}))};if(!t(o)&&t(tg)){var n=K(o,(function(e){return j(tg,(function(t){return Me(e,t)}))}));return j(n,i)}return i(e)}))},ig=function(e,t,n){return I.from(n.container()).filter(Fn).exists((function(r){var o=e?0:-1;return t(r.data.charAt(n.offset()+o))}))},ag=_(ig,!0,Qf),ug=_(ig,!1,Qf),cg=function(e){var t=e.container();return Fn(t)&&(0===t.data.length||xo(t.data)&&Ql.isBookmarkNode(t.parentNode))},sg=function(e,t){return function(n){return I.from(ef(e?0:-1,n)).filter(t).isSome()}},fg=function(e){return Vn(e)&&"block"===or(Rt.fromDom(e),"display")},lg=function(e){return $n(e)&&!function(e){return Dn(e)&&"all"===e.getAttribute("data-mce-bogus")}(e)},dg=sg(!0,fg),mg=sg(!1,fg),gg=sg(!0,Kn),pg=sg(!1,Kn),hg=sg(!0,Ln),vg=sg(!1,Ln),bg=sg(!0,lg),yg=sg(!1,lg),Cg=function(e){var t=Mu(e,"br"),n=K(function(e){for(var t=[],n=e.dom;n;)t.push(Rt.fromDom(n)),n=n.lastChild;return t}(e).slice(-1),lo);t.length===n.length&&q(n,hn);},xg=function(e){pn(e),mn(e,Rt.fromHtml('<br data-mce-bogus="1">'));},wg=function(e){en(e).each((function(t){Kt(t).each((function(n){so(e)&&lo(t)&&so(n)&&hn(t);}));}));},Sg=function(e,t,n){return Lt(t,e)?(r=function(e,t){for(var n=y(t)?t:T,r=e.dom,o=[];null!==r.parentNode&&void 0!==r.parentNode;){var i=r.parentNode,a=Rt.fromDom(i);if(o.push(a),!0===n(a))break;r=i;}return o}(e,(function(e){return n(e)||Bt(e,t)})),r.slice(0,-1)):[];var r;},kg=function(e,t){return Sg(e,t,T)},Ng=function(e,t){return [e].concat(kg(e,t))},Eg=function(e,t,n){return Tf(e,t,n,cg)},_g=function(e,t){return J(Ng(Rt.fromDom(t.container()),e),so)},Ag=function(e,t,n){return Eg(e,t.dom,n).forall((function(e){return _g(t,n).fold((function(){return !1===Zs(e,n,t.dom)}),(function(r){return !1===Zs(e,n,t.dom)&&Lt(r,Rt.fromDom(e.container()))}))}))},Rg=function(e,t,n){return _g(t,n).fold((function(){return Eg(e,t.dom,n).forall((function(e){return !1===Zs(e,n,t.dom)}))}),(function(t){return Eg(e,t.dom,n).isNone()}))},Dg=_(Rg,!1),Tg=_(Rg,!0),Og=_(Ag,!1),Bg=_(Ag,!0),Pg=function(e){return ff(e).exists(lo)},Lg=function(e,t,n){var r=K(Ng(Rt.fromDom(n.container()),t),so),o=ie(r).getOr(t);return Rf(e,o.dom,n).filter(Pg)},Ig=function(e,t){return ff(t).exists(lo)||Lg(!0,e,t).isSome()},Mg=function(e,t){return function(e){return I.from(e.getNode(!0)).map(Rt.fromDom)}(t).exists(lo)||Lg(!1,e,t).isSome()},Fg=_(Lg,!1),Ug=_(Lg,!0),zg=function(e){return Ac.isTextPosition(e)&&!e.isAtStart()&&!e.isAtEnd()},Hg=function(e,t){var n=K(Ng(Rt.fromDom(t.container()),e),so);return ie(n).getOr(e)},jg=function(e,t){return zg(t)?ug(t):ug(t)||Pf(Hg(e,t).dom,t).exists(ug)},Vg=function(e,t){return zg(t)?ag(t):ag(t)||Bf(Hg(e,t).dom,t).exists(ag)},qg=function(e){return ff(e).bind((function(e){return Xr(e,Ut)})).exists((function(e){return function(e){return H(["pre","pre-wrap"],e)}(or(e,"white-space"))}))},$g=function(e,t){return function(e,t){return Pf(e.dom,t).isNone()}(e,t)||function(e,t){return Bf(e.dom,t).isNone()}(e,t)||Dg(e,t)||Tg(e,t)||Mg(e,t)||Ig(e,t)},Wg=function(e,t){return !qg(t)&&(Dg(e,t)||Og(e,t)||Mg(e,t)||jg(e,t))},Kg=function(e,t){return !qg(t)&&(Tg(e,t)||Bg(e,t)||Ig(e,t)||Vg(e,t))},Xg=function(e,t){return Wg(e,t)||Kg(e,function(e){var t=e.container(),n=e.offset();return Fn(t)&&n<t.data.length?Ac(t,n+1):e}(t))},Yg=function(e,t){return Jf(e.charAt(t))},Gg=function(e){var t=e.container();return Fn(t)&&Ie(t.data,yo)},Jg=function(e){var t=e.data,n=function(e){var t=e.split("");return V(t,(function(e,n){return Jf(e)&&n>0&&n<t.length-1&&Zf(t[n-1])&&Zf(t[n+1])?" ":e})).join("")}(t);return n!==t&&(e.data=n,!0)},Qg=function(e,t){return I.some(t).filter(Gg).bind((function(t){var n=t.container(),r=function(e,t){var n=t.data,r=Ac(t,0);return !(!Yg(n,0)||Xg(e,r)||(t.data=" "+n.slice(1),0))}(e,n)||Jg(n)||function(e,t){var n=t.data,r=Ac(t,n.length-1);return !(!Yg(n,n.length-1)||Xg(e,r)||(t.data=n.slice(0,-1)+" ",0))}(e,n);return r?I.some(t):I.none()}))},Zg=function(e){var t=Rt.fromDom(e.getBody());e.selection.isCollapsed()&&Qg(t,Ac.fromRangeStart(e.selection.getRng())).each((function(t){e.selection.setRng(t.toRange());}));},ep=function(e,t,n){if(0!==n){var r=Rt.fromDom(e),o=Kr(r,so).getOr(r),i=e.data.slice(t,t+n),a=t+n>=e.data.length&&Kg(o,Ac(e,e.data.length)),u=0===t&&Wg(o,Ac(e,0));e.replaceData(t,n,function(e,t,n){return Y(e,(function(r,o){return Qf(o)||Jf(o)?r.previousCharIsSpace||""===r.str&&t||r.str.length===e.length-1&&n?{previousCharIsSpace:!1,str:r.str+yo}:{previousCharIsSpace:!0,str:r.str+" "}:{previousCharIsSpace:!1,str:r.str+o}}),{previousCharIsSpace:!1,str:""}).str}(i,u,a));}},tp=function(e,t){var n=e.data.slice(t),r=n.length-ze(n).length;ep(e,t,r);},np=function(e,t){var n=e.data.slice(0,t),r=n.length-He(n).length;ep(e,t-r,r);},rp=function(e,t,n,r){void 0===r&&(r=!0);var o=He(e.data).length,i=r?e:t,a=r?t:e;return r?i.appendData(a.data):i.insertData(0,a.data),hn(Rt.fromDom(a)),n&&tp(i,o),i},op=function(e,t){return function(e,t){var n=e.container(),r=e.offset();return !1===Ac.isTextPosition(e)&&n===t.parentNode&&r>Ac.before(t).offset()}(t,e)?Ac(t.container(),t.offset()-1):t},ip=function(e){return qo(e.previousSibling)?I.some((t=e.previousSibling,Fn(t)?Ac(t,t.data.length):Ac.after(t))):e.previousSibling?If(e.previousSibling):I.none();var t;},ap=function(e){return qo(e.nextSibling)?I.some((t=e.nextSibling,Fn(t)?Ac(t,0):Ac.before(t))):e.nextSibling?Lf(e.nextSibling):I.none();var t;},up=function(e,t){return ip(t).orThunk((function(){return ap(t)})).orThunk((function(){return function(e,t){var n=Ac.before(t.previousSibling?t.previousSibling:t.parentNode);return Pf(e,n).fold((function(){return Bf(e,Ac.after(t))}),I.some)}(e,t)}))},cp=function(e,t){return ap(t).orThunk((function(){return ip(t)})).orThunk((function(){return function(e,t){return Bf(e,Ac.after(t)).fold((function(){return Pf(e,Ac.before(t))}),I.some)}(e,t)}))},sp=function(e,t,n){return function(e,t,n){return e?cp(t,n):up(t,n)}(e,t,n).map(_(op,n))},fp=function(e,t,n){n.fold((function(){e.focus();}),(function(n){e.selection.setRng(n.toRange(),t);}));},lp=function(e,t){return t&&ye(e.schema.getBlockElements(),It(t))},dp=function(e){if(ei(e)){var t=Rt.fromHtml('<br data-mce-bogus="1">');return pn(e),mn(e,t),I.some(Ac.before(t.dom))}return I.none()},mp=function(e,t,n){var r,o,i,a,u=Kt(e).filter(zt),c=Xt(e).filter(zt);return hn(e),(r=u,o=c,i=t,a=function(e,t,r){var o=e.dom,i=t.dom,a=o.data.length;return rp(o,i,n),r.container()===i?Ac(o,a):r},r.isSome()&&o.isSome()&&i.isSome()?I.some(a(r.getOrDie(),o.getOrDie(),i.getOrDie())):I.none()).orThunk((function(){return n&&(u.each((function(e){return np(e.dom,e.dom.length)})),c.each((function(e){return tp(e.dom,0)}))),t}))},gp=function(e,t,n,r){void 0===r&&(r=!0);var o,i=sp(t,e.getBody(),n.dom),a=Kr(n,_(lp,e),(o=e.getBody(),function(e){return e.dom===o})),u=mp(n,i,function(e,t){return ye(e.schema.getTextInlineElements(),It(t))}(e,n));e.dom.isEmpty(e.getBody())?(e.setContent(""),e.selection.setCursorLocation()):a.bind(dp).fold((function(){r&&fp(e,t,u);}),(function(n){r&&fp(e,t,I.some(n));}));},pp=function(e){return Mu(e,"td,th")},hp=function(e,t){return {start:e,end:t}},vp=kr([{singleCellTable:["rng","cell"]},{fullTable:["table"]},{partialTable:["cells","outsideDetails"]},{multiTable:["startTableCells","endTableCells","betweenRng"]}]),bp=function(e,t){return Qr(Rt.fromDom(e),"td,th",t)},yp=function(e){return !Bt(e.start,e.end)},Cp=function(e,t){return Ml(e.start,t).bind((function(n){return Ml(e.end,t).bind((function(e){return t=Bt(n,e),r=n,t?I.some(r):I.none();var t,r;}))}))},xp=function(e){return function(t){return Cp(t,e).map((function(e){return function(e,t,n){return {rng:e,table:t,cells:n}}(t,e,pp(e))}))}},wp=function(e,t,n,r){if(n.collapsed||!e.forall(yp))return I.none();if(t.isSameTable){var o=e.bind(xp(r));return I.some({start:o,end:o})}var i=bp(n.startContainer,r),a=bp(n.endContainer,r),u=i.bind(function(e){return function(t){return Ml(t,e).bind((function(e){return ae(pp(e)).map((function(e){return hp(t,e)}))}))}}(r)).bind(xp(r)),c=a.bind(function(e){return function(t){return Ml(t,e).bind((function(e){return ie(pp(e)).map((function(e){return hp(e,t)}))}))}}(r)).bind(xp(r));return I.some({start:u,end:c})},Sp=function(e,t){return Q(e,(function(e){return Bt(e,t)}))},kp=function(e){return Yn(Sp(e.cells,e.rng.start),Sp(e.cells,e.rng.end),(function(t,n){return e.cells.slice(t,n+1)}))},Np=function(e,t,n){return e.exists((function(e){return function(e,t){return !yp(e)&&Cp(e,t).exists((function(e){var t=e.dom.rows;return 1===t.length&&1===t[0].cells.length}))}(e,n)&&zl(e.start,t)}))},Ep=function(e,t){var n=t.startTable,r=t.endTable,o=e.cloneRange();return n.each((function(e){return o.setStartAfter(e.dom)})),r.each((function(e){return o.setEndBefore(e.dom)})),o},_p=function(e,t){var n=function(e){return function(t){return Bt(e,t)}}(e),r=function(e,t){var n=bp(e.startContainer,t),r=bp(e.endContainer,t);return Yn(n,r,hp)}(t,n),o=function(e,t){var n=function(e){return Ml(Rt.fromDom(e),t)},r=n(e.startContainer),o=n(e.endContainer),i=r.isSome(),a=o.isSome(),u=Yn(r,o,Bt).getOr(!1);return {startTable:r,endTable:o,isStartInTable:i,isEndInTable:a,isSameTable:u,isMultiTable:!u&&i&&a}}(t,n);return Np(r,t,n)?r.map((function(e){return vp.singleCellTable(t,e.start)})):o.isMultiTable?function(e,t,n,r){return wp(e,t,n,r).bind((function(e){var r=e.start,o=e.end,i=r.bind(kp).getOr([]),a=o.bind(kp).getOr([]);if(i.length>0&&a.length>0){var u=Ep(n,t);return I.some(vp.multiTable(i,a,u))}return I.none()}))}(r,o,t,n):function(e,t,n,r){return wp(e,t,n,r).bind((function(e){var t=e.start,n=e.end;return t.or(n)})).bind((function(e){var r=t.isSameTable,o=kp(e).getOr([]);if(r&&e.cells.length===o.length)return I.some(vp.fullTable(e.table));if(o.length>0){if(r)return I.some(vp.partialTable(o,I.none()));var i=Ep(n,t);return I.some(vp.partialTable(o,I.some(Re(Re({},t),{rng:i}))))}return I.none()}))}(r,o,t,n)},Ap=function(e){var t;return (8===Mt(t=e)||"#comment"===It(t)?Kt(e):en(e)).bind(Ap).orThunk((function(){return I.some(e)}))},Rp=function(e){return q(e,(function(e){nr(e,"contenteditable"),xg(e);}))},Dp=function(e,t,n,r){var o=n.cloneRange();r?(o.setStart(n.startContainer,n.startOffset),o.setEndAfter(t.dom.lastChild)):(o.setStartBefore(t.dom.firstChild),o.setEnd(n.endContainer,n.endOffset)),Pp(e,o,t,!1);},Tp=function(e){var t=Il(e),n=Rt.fromDom(e.selection.getNode());Wn(n.dom)&&ei(n)?e.selection.setCursorLocation(n.dom,0):e.selection.collapse(!0),t.length>1&&j(t,(function(e){return Bt(e,n)}))&&Qn(n,"data-mce-selected","1");},Op=function(e,t,n){var r=e.selection.getRng(),o=n.bind((function(n){var o=n.rng,i=n.isStartInTable,a=function(e,t){return I.from(e.dom.getParent(t,e.dom.isBlock)).map(Rt.fromDom)}(e,i?o.endContainer:o.startContainer);o.deleteContents(),function(e,t,n){n.each((function(n){t?hn(n):(xg(n),e.selection.setCursorLocation(n.dom,0));}));}(e,i,a.filter(ei));var u=i?t[0]:t[t.length-1];return Dp(e,u,r,i),ei(u)?I.none():I.some(i?t.slice(1):t.slice(0,-1))})).getOr(t);return Rp(o),Tp(e),!0},Bp=function(e,t,n,r){var o=e.selection.getRng(),i=t[0],a=n[n.length-1];Dp(e,i,o,!0),Dp(e,a,o,!1);var u=ei(i)?t:t.slice(1),c=ei(a)?n:n.slice(0,-1);return Rp(u.concat(c)),r.deleteContents(),Tp(e),!0},Pp=function(e,t,n,r){void 0===r&&(r=!0),t.deleteContents();var o,i=Ap(n).getOr(n),a=Rt.fromDom(e.dom.getParent(i.dom,e.dom.isBlock));if(ei(a)&&(xg(a),r&&e.selection.setCursorLocation(a.dom,0)),!Bt(n,a)){var u=Xn(Wt(a),n)?[]:Wt(o=a).map(Jt).map((function(e){return K(e,(function(e){return !Bt(o,e)}))})).getOr([]);q(u.concat(Jt(n)),(function(e){Bt(e,a)||Lt(e,a)||!ei(e)||hn(e);}));}return !0},Lp=function(e,t){return gp(e,!1,t),!0},Ip=function(e,t,n,r){return Fp(t,r).fold((function(){return function(e,t,n){return _p(t,n).map((function(t){return t.fold(_(Pp,e),_(Lp,e),_(Op,e),_(Bp,e))}))}(e,t,n)}),(function(t){return function(e,t){return Up(e,t)}(e,t)})).getOr(!1)},Mp=function(e,t){return J(Ng(t,e),vo)},Fp=function(e,t){return J(Ng(t,e),(n="caption",function(e){return Ut(e)&&It(e)===n}));var n;},Up=function(e,t){return xg(t),e.selection.setCursorLocation(t.dom,0),I.some(!0)},zp=function(e,t,n,r,o){return Df(n,e.getBody(),o).bind((function(i){return function(e,t,n,r){return Lf(e.dom).bind((function(o){return If(e.dom).map((function(e){return t?n.isEqual(o)&&r.isEqual(e):n.isEqual(e)&&r.isEqual(o)}))})).getOr(!0)}(r,n,o,i)?function(e,t){return Up(e,t)}(e,r):function(e,t,n){return Fp(e,Rt.fromDom(n.getNode())).map((function(e){return !1===Bt(e,t)}))}(t,r,i)})).or(I.some(!0))},Hp=function(e,t,n,r){var o=Ac.fromRangeStart(e.selection.getRng());return Mp(n,r).bind((function(r){return ei(r)?Up(e,r):function(e,t,n,r,o){return Df(n,e.getBody(),o).bind((function(e){return Mp(t,Rt.fromDom(e.getNode())).map((function(e){return !1===Bt(e,r)}))}))}(e,n,t,r,o)})).getOr(!1)},jp=function(e,t){return e?hg(t):vg(t)},Vp=function(e,t,n){var r=Rt.fromDom(e.getBody());return Fp(r,n).fold((function(){return Hp(e,t,r,n)||function(e,t){var n=Ac.fromRangeStart(e.selection.getRng());return jp(t,n)||Rf(t,e.getBody(),n).exists((function(e){return jp(t,e)}))}(e,t)}),(function(n){return function(e,t,n,r){var o=Ac.fromRangeStart(e.selection.getRng());return ei(r)?Up(e,r):zp(e,n,t,r,o)}(e,t,r,n).getOr(!1)}))},qp=function(e,t){var n=Rt.fromDom(e.selection.getStart(!0)),r=Il(e);return e.selection.isCollapsed()&&0===r.length?Vp(e,t,n):function(e,t,n){var r=Rt.fromDom(e.getBody()),o=e.selection.getRng();return 0!==n.length?Op(e,n,I.none()):Ip(e,r,o,t)}(e,n,r)},$p=function(e){var t=Ac.fromRangeStart(e),n=Ac.fromRangeEnd(e),r=e.commonAncestorContainer;return Rf(!1,r,n).map((function(o){return !Zs(t,n,r)&&Zs(t,o,r)?function(e,t,n,r){var o=document.createRange();return o.setStart(e,t),o.setEnd(n,r),o}(t.container(),t.offset(),o.container(),o.offset()):e})).getOr(e)},Wp=function(e){return e.collapsed?e:$p(e)},Kp=function(e,t){return e.getBlockElements()[t.name]&&function(e){return e.firstChild&&e.firstChild===e.lastChild}(t)&&function(e){return "br"===e.name||e.value===yo}(t.firstChild)},Xp=function(e,t){var n=t.firstChild,r=t.lastChild;return n&&"meta"===n.name&&(n=n.next),r&&"mce_marker"===r.attr("id")&&(r=r.prev),function(e,t){var n=e.getNonEmptyElements();return t&&(t.isEmpty(n)||Kp(e,t))}(e,r)&&(r=r.prev),!(!n||n!==r)&&("ul"===n.name||"ol"===n.name)},Yp=function(e){return e&&e.firstChild&&e.firstChild===e.lastChild&&function(e){return e.data===yo||jn(e)}(e.firstChild)},Gp=function(e){return e.length>0&&(!(t=e[e.length-1]).firstChild||Yp(t))?e.slice(0,-1):e;var t;},Jp=function(e,t){var n=e.getParent(t,e.isBlock);return n&&"LI"===n.nodeName?n:null},Qp=function(e,t){var n=Ac.after(e),r=kf(t).prev(n);return r?r.toRange():null},Zp=function(e,t,n){var r=e.parentNode;return _t.each(t,(function(t){r.insertBefore(t,e);})),function(e,t){var n=Ac.before(e),r=kf(t).next(n);return r?r.toRange():null}(e,n)},eh=function(e,t,n,r){var o,i=function(e,t,n){var r=t.serialize(n);return function(e){var t=e.firstChild,n=e.lastChild;return t&&"META"===t.nodeName&&t.parentNode.removeChild(t),n&&"mce_marker"===n.id&&n.parentNode.removeChild(n),e}(e.createFragment(r))}(t,e,r),a=Jp(t,n.startContainer),u=Gp((o=i.firstChild,K(o.childNodes,(function(e){return "LI"===e.nodeName})))),c=t.getRoot(),s=function(e){var r=Ac.fromRangeStart(n),o=kf(t.getRoot()),i=1===e?o.prev(r):o.next(r);return !i||Jp(t,i.getNode())!==a};return s(1)?Zp(a,u,c):s(2)?function(e,t,n,r){return r.insertAfter(t.reverse(),e),Qp(t[0],n)}(a,u,c,t):function(e,t,n,r){var o=function(e,t){var n=t.cloneRange(),r=t.cloneRange();return n.setStartBefore(e),r.setEndAfter(e),[n.cloneContents(),r.cloneContents()]}(e,r),i=e.parentNode;return i.insertBefore(o[0],e),_t.each(t,(function(t){i.insertBefore(t,e);})),i.insertBefore(o[1],e),i.removeChild(e),Qp(t[t.length-1],n)}(a,u,c,n)},th=Wn,nh=function(e){var t=e.dom,n=Wp(e.selection.getRng());e.selection.setRng(n);var r=t.getParent(n.startContainer,th);!function(e,t,n){return null!==n&&n===e.getParent(t.endContainer,th)&&zl(Rt.fromDom(n),t)}(t,n,r)?e.getDoc().execCommand("Delete",!1,null):Pp(e,n,Rt.fromDom(r));},rh=function(e,t,n){var r,o,i,a=e.selection,u=e.dom;/^ | $/.test(t)&&(t=function(e,t,n){var r=Rt.fromDom(e.getRoot());return n=Wg(r,Ac.fromRangeStart(t))?n.replace(/^ /,"&nbsp;"):n.replace(/^&nbsp;/," "),Kg(r,Ac.fromRangeEnd(t))?n.replace(/(&nbsp;| )(<br( \/)>)?$/,"&nbsp;"):n.replace(/&nbsp;(<br( \/)?>)?$/," ")}(u,a.getRng(),t));var c=e.parser,s=n.merge,f=Zm({validate:bs(e)},e.schema),l='<span id="mce_marker" data-mce-type="bookmark">&#xFEFF;</span>',d=e.fire("BeforeSetContent",{content:t,format:"html",selection:!0,paste:n.paste});if(d.isDefaultPrevented())e.fire("SetContent",{content:d.content,format:"html",selection:!0,paste:n.paste});else {-1===(t=d.content).indexOf("{$caret}")&&(t+="{$caret}"),t=t.replace(/\{\$caret\}/,l);var m=(o=a.getRng()).startContainer||(o.parentElement?o.parentElement():null),g=e.getBody();m===g&&a.isCollapsed()&&u.isBlock(g.firstChild)&&function(e,t){return t&&!e.schema.getShortEndedElements()[t.nodeName]}(e,g.firstChild)&&u.isEmpty(g.firstChild)&&((o=u.createRng()).setStart(g.firstChild,0),o.setEnd(g.firstChild,0),a.setRng(o)),a.isCollapsed()||nh(e);var p,h={context:(r=a.getNode()).nodeName.toLowerCase(),data:n.data,insert:!0},v=c.parse(t,h);if(!0===n.paste&&Xp(e.schema,v)&&function(e,t){return !!Jp(e,t)}(u,r))return o=eh(f,u,a.getRng(),v),a.setRng(o),void e.fire("SetContent",d);if(function(e){for(var t=e;t=t.walk();)1===t.type&&t.attr("data-mce-fragment","1");}(v),"mce_marker"===(i=v.lastChild).attr("id")){var y=i;for(i=i.prev;i;i=i.walk(!0))if(3===i.type||!u.isBlock(i.name)){e.schema.isValidChild(i.parent.name,"span")&&i.parent.insert(y,i,"br"===i.name);break}}if(e._selectionOverrides.showBlockCaretContainer(r),h.invalid){e.selection.setContent(l),r=a.getNode();var C=e.getBody();for(9===r.nodeType?r=i=C:i=r;i!==C;)r=i,i=i.parentNode;t=r===C?C.innerHTML:u.getOuterHTML(r),t=f.serialize(c.parse(t.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,(function(){return f.serialize(v)})))),r===C?u.setHTML(C,t):u.setOuterHTML(r,t);}else !function(e,t,n){if("all"===n.getAttribute("data-mce-bogus"))n.parentNode.insertBefore(e.dom.createFragment(t),n);else {var r=n.firstChild,o=n.lastChild;!r||r===o&&"BR"===r.nodeName?e.dom.setHTML(n,t):e.selection.setContent(t);}}(e,t=f.serialize(v),r);!function(e,t){var n=e.schema.getTextInlineElements(),r=e.dom;if(t){var o=e.getBody(),i=Gm(r);_t.each(r.select("*[data-mce-fragment]"),(function(e){if(b(n[e.nodeName.toLowerCase()])&&rg(r,e))for(var t=e.parentNode;b(t)&&t!==o&&!og(r,e,t);t=t.parentNode)if(i.compare(t,e)){r.remove(e,!0);break}}));}}(e,s),function(e,t){var n,r=e.dom,o=e.selection;if(t){o.scrollIntoView(t);var i=Zl(e.getBody(),t);if("false"===r.getContentEditable(i))return r.remove(t),void o.select(i);var a=r.createRng(),u=t.previousSibling;if(Fn(u)){if(a.setStart(u,u.nodeValue.length),!wt.ie){var c=t.nextSibling;Fn(c)&&(u.appendData(c.data),c.parentNode.removeChild(c));}}else a.setStartBefore(t),a.setEndBefore(t);var s=r.getParent(t,r.isBlock);r.remove(t),s&&r.isEmpty(s)&&(e.$(s).empty(),a.setStart(s,0),a.setEnd(s,0),th(s)||function(e){return !!e.getAttribute("data-mce-fragment")}(s)||!(n=function(t){var n=Ac.fromRangeStart(t);if(n=kf(e.getBody()).next(n))return n.toRange()}(a))?r.add(s,r.create("br",{"data-mce-bogus":"1"})):(a=n,r.remove(s))),o.setRng(a);}}(e,u.get("mce_marker")),p=e.getBody(),_t.each(p.getElementsByTagName("*"),(function(e){e.removeAttribute("data-mce-fragment");})),function(e,t){I.from(e.getParent(t,"td,th")).map(Rt.fromDom).each(wg);}(u,a.getStart()),e.fire("SetContent",d),e.addVisual();}},oh=function(e,t){t(e),e.firstChild&&oh(e.firstChild,t),e.next&&oh(e.next,t);},ih=function(e,t,n){var r=function(e,t,n){var r={},o={},i=[];for(var a in n.firstChild&&oh(n.firstChild,(function(n){q(e,(function(e){e.name===n.name&&(r[e.name]?r[e.name].nodes.push(n):r[e.name]={filter:e,nodes:[n]});})),q(t,(function(e){"string"==typeof n.attr(e.name)&&(o[e.name]?o[e.name].nodes.push(n):o[e.name]={filter:e,nodes:[n]});}));})),r)ye(r,a)&&i.push(r[a]);for(var u in o)ye(o,u)&&i.push(o[u]);return i}(e,t,n);q(r,(function(e){q(e.filter.callbacks,(function(t){t(e.nodes,e.filter.name,{});}));}));},ah=function(e){return e instanceof Om},uh=function(e,t,n){e.dom.setHTML(e.getBody(),t),!0!==n&&function(e){ym(e)&&Lf(e.getBody()).each((function(t){var n=t.getNode(),r=Ln(n)?Lf(n).getOr(t):t;e.selection.setRng(r.toRange());}));}(e);},ch=function(e,t,n){var r=function(e,t){return Re(Re({format:"html"},e),{set:!0,content:ah(t)?"":t})}(n,t),o=n.no_events?r:e.fire("BeforeSetContent",r);return ah(t)||(t=o.content),I.from(e.getBody()).fold(k(t),(function(n){return ah(t)?function(e,t,n,r){ih(e.parser.getNodeFilters(),e.parser.getAttributeFilters(),n);var o=Zm({validate:e.validate},e.schema).serialize(n);return r.content=bo(Rt.fromDom(t))?o:_t.trim(o),uh(e,r.content,r.no_selection),r.no_events||e.fire("SetContent",r),n}(e,n,t,o):function(e,t,n,r){if(0===n.length||/^\s+$/.test(n)){var o='<br data-mce-bogus="1">';"TABLE"===t.nodeName?n="<tr><td>"+o+"</td></tr>":/^(UL|OL)$/.test(t.nodeName)&&(n="<li>"+o+"</li>");var i=ts(e);i&&e.schema.isValidChild(t.nodeName.toLowerCase(),i.toLowerCase())?(n=o,n=e.dom.createHTML(i,ns(e),n)):n||(n='<br data-mce-bogus="1">'),uh(e,n,r.no_selection),e.fire("SetContent",r);}else "raw"!==r.format&&(n=Zm({validate:e.validate},e.schema).serialize(e.parser.parse(n,{isRootContent:!0,insert:!0}))),r.content=bo(Rt.fromDom(t))?n:_t.trim(n),uh(e,r.content,r.no_selection),r.no_events||e.fire("SetContent",r);return r.content}(e,n,t,o)}))},sh=function(e,t){return function(e,t){var n=e.dom;return n.parentNode?Yr(Rt.fromDom(n.parentNode),(function(n){return !Bt(e,n)&&t(n)})):I.none()}(e,t).isSome()},fh=function(e){return y(e)?e:T},lh=function(e,t,n){var r=t(e),o=fh(n);return r.orThunk((function(){return o(e)?I.none():function(e,t,n){for(var r=e.dom,o=fh(n);r.parentNode;){r=r.parentNode;var i=Rt.fromDom(r),a=t(i);if(a.isSome())return a;if(o(i))break}return I.none()}(e,t,o)}))},dh=ul,mh=function(e,t,n){var r=e.formatter.get(n);if(r)for(var o=0;o<r.length;o++){var i=r[o];if(gl(i)&&!1===i.inherit&&e.dom.is(t,i.selector))return !0}return !1},gh=function(e,t,n,r,o){var i=e.dom.getRoot();return t!==i&&(t=e.dom.getParent(t,(function(t){return !!mh(e,t,n)||(t.parentNode===i||!!vh(e,t,n,r,!0))})),!!vh(e,t,n,r,o))},ph=function(e,t,n){return !!dh(t,n.inline)||(!!dh(t,n.block)||(n.selector?1===t.nodeType&&e.is(t,n.selector):void 0))},hh=function(e,t,n,r,o,i){var a=n[r];if(y(n.onmatch))return n.onmatch(t,n,r);if(a)if(h(a.length)){for(var u in a)if(ye(a,u)){var c="attributes"===r?e.getAttrib(t,u):sl(e,t,u),s=al(a[u],i),f=v(c)||Ve(c);if(f&&v(s))continue;if(o&&f&&!n.exact)return !1;if((!o||n.exact)&&!dh(c,cl(e,s,u)))return !1}}else for(var l=0;l<a.length;l++)if("attributes"===r?e.getAttrib(t,a[l]):sl(e,t,a[l]))return !0;return !0},vh=function(e,t,n,r,o){var i=e.formatter.get(n),a=e.dom;if(i&&t)for(var u=0;u<i.length;u++){var c=i[u];if(ph(e.dom,t,c)&&hh(a,t,c,"attributes",o,r)&&hh(a,t,c,"styles",o,r)){var s=c.classes;if(s)for(var f=0;f<s.length;f++)if(!e.dom.hasClass(t,al(s[f],r)))return;return c}}},bh=function(e,t,n,r,o){if(r)return gh(e,r,t,n,o);if(r=e.selection.getNode(),gh(e,r,t,n,o))return !0;var i=e.selection.getStart();return !(i===r||!gh(e,i,t,n,o))},yh=function(e,t){var n=function(t){return Bt(t,Rt.fromDom(e.getBody()))};return I.from(e.selection.getStart(!0)).bind((function(r){return lh(Rt.fromDom(r),(function(n){return ce(t,(function(t){return function(t,n){return vh(e,t.dom,n)?I.some(n):I.none()}(n,t)}))}),n)})).getOrNull()},Ch=function(e,t,n){return Y(n,(function(n,r){var o=function(e,t){return j(e.formatter.get(t),(function(e){var t=function(e){return e.length>1&&"%"===e.charAt(0)};return j(["styles","attributes"],(function(n){return be(e,n).exists((function(e){var n=m(e)?e:ve(e);return j(n,t)}))}))}))}(e,r);return e.formatter.matchNode(t,r,{},o)?n.concat([r]):n}),[])},xh=Co,wh="_mce_caret",Sh=function(e){return function(e){for(var t=[];e;){if(3===e.nodeType&&e.nodeValue!==xh||e.childNodes.length>1)return [];1===e.nodeType&&t.push(e),e=e.firstChild;}return t}(e).length>0},kh=function(e){if(e){var t=new ao(e,e);for(e=t.current();e;e=t.next())if(Fn(e))return e}return null},Nh=function(e){var t=Rt.fromTag("span");return Zn(t,{id:wh,"data-mce-bogus":"1","data-mce-type":"format-caret"}),e&&mn(t,Rt.fromText(xh)),t},Eh=function(e,t,n){void 0===n&&(n=!0);var r=e.dom,o=e.selection;if(Sh(t))gp(e,!1,Rt.fromDom(t),n);else {var i=o.getRng(),a=r.getParent(t,r.isBlock),u=i.startContainer,c=i.startOffset,s=i.endContainer,f=i.endOffset,l=function(e){var t=kh(e);return t&&t.nodeValue.charAt(0)===xh&&t.deleteData(0,1),t}(t);r.remove(t,!0),u===l&&c>0&&i.setStart(l,c-1),s===l&&f>0&&i.setEnd(l,f-1),a&&r.isEmpty(a)&&xg(Rt.fromDom(a)),o.setRng(i);}},_h=function(e,t,n){void 0===n&&(n=!0);var r=e.dom,o=e.selection;if(t)Eh(e,t,n);else if(!(t=Uf(e.getBody(),o.getStart())))for(;t=r.get(wh);)Eh(e,t,!1);},Ah=function(e,t){return e.appendChild(t),t},Rh=function(e,t){var n=X(e,(function(e,t){return Ah(e,t.cloneNode(!1))}),t);return Ah(n,n.ownerDocument.createTextNode(xh))},Dh=function(e,t,n,r){var o,i,a,u=e.dom,c=e.selection,s=[],f=c.getRng(),l=f.startContainer,d=f.startOffset;for(i=l,3===l.nodeType&&(d!==l.nodeValue.length&&(o=!0),i=i.parentNode);i;){if(vh(e,i,t,n,r)){a=i;break}i.nextSibling&&(o=!0),s.push(i),i=i.parentNode;}if(a)if(o){var m=c.getBookmark();f.collapse(!0);var g=Tl(e,f,e.formatter.get(t),!0);g=Cd(g),e.formatter.remove(t,n,g,r),c.moveToBookmark(m);}else {var p=Uf(e.getBody(),a),h=Nh(!1).dom;!function(e,t,n){var r=e.dom,o=r.getParent(n,_(rl,e));o&&r.isEmpty(o)?n.parentNode.replaceChild(t,n):(Cg(Rt.fromDom(n)),r.isEmpty(n)?n.parentNode.replaceChild(t,n):r.insertAfter(t,n));}(e,h,null!==p?p:a);var v=function(e,t,n,r,o,i){var a=e.formatter,u=e.dom,c=K(se(a.get()),(function(e){return e!==r&&!Ie(e,"removeformat")})),s=Ch(e,n,c);if(K(s,(function(t){return !dl(e,t,r)})).length>0){var f=n.cloneNode(!1);return u.add(t,f),a.remove(r,o,f,i),u.remove(f),I.some(f)}return I.none()}(e,h,a,t,n,r),b=Rh(s.concat(v.toArray()),h);Eh(e,p,!1),c.setCursorLocation(b,1),u.isEmpty(a)&&u.remove(a);}},Th=function(e){e.on("mouseup keydown",(function(t){!function(e,t){var n=e.selection,r=e.getBody();_h(e,null,!1),8!==t&&46!==t||!n.isCollapsed()||n.getStart().innerHTML!==xh||_h(e,Uf(r,n.getStart())),37!==t&&39!==t||_h(e,Uf(r,n.getStart()));}(e,t.keyCode);}));},Oh=function(e,t){var n=e.schema.getTextInlineElements();return ye(n,It(t))&&!Ff(t.dom)&&!Pn(t.dom)},Bh={},Ph=ke,Lh=we;!function(e,t){Bh[e]||(Bh[e]=[]),Bh[e].push(t);}("pre",(function(e){var t,n=e.selection.getRng(),r=Tn(["pre"]);n.collapsed||(t=e.selection.getSelectedBlocks(),Lh(Ph(Ph(t,r),(function(e){return r(e.previousSibling)&&-1!==Ne(t,e.previousSibling)})),(function(e){var t,n;t=e.previousSibling,cu(n=e).remove(),cu(t).append("<br><br>").append(n.childNodes);})));}));var Ih=_t.each,Mh=function(e){return Dn(e)&&!Gf(e)&&!Ff(e)&&!Pn(e)},Fh=function(e,t){for(var n=e;n;n=n[t]){if(Fn(n)&&je(n.data))return e;if(Dn(n)&&!Gf(n))return n}return e},Uh=function(e,t,n){var r=Gm(e);if(t&&n&&(t=Fh(t,"previousSibling"),n=Fh(n,"nextSibling"),r.compare(t,n))){for(var o=t.nextSibling;o&&o!==n;){var i=o;o=o.nextSibling,t.appendChild(i);}return e.remove(n),_t.each(_t.grep(n.childNodes),(function(e){t.appendChild(e);})),t}return n},zh=function(e,t,n,r){if(r&&!1!==t.merge_siblings){var o=Uh(e,nl(r),r);Uh(e,o,nl(o,!0));}},Hh=function(e,t,n){Ih(e.childNodes,(function(e){Mh(e)&&(t(e)&&n(e),e.hasChildNodes()&&Hh(e,t,n));}));},jh=function(e,t){return function(n){return !(!n||!sl(e,n,t))}},Vh=function(e,t,n){return function(r){e.setStyle(r,t,n),""===r.getAttribute("style")&&r.removeAttribute("style"),function(e,t){"SPAN"===t.nodeName&&0===e.getAttribs(t).length&&e.remove(t,!0);}(e,r);}},qh=kr([{keep:[]},{rename:["name"]},{removed:[]}]),$h=/^(src|href|style)$/,Wh=_t.each,Kh=ul,Xh=function(e,t,n){return e.isChildOf(t,n)&&t!==n&&!e.isBlock(n)},Yh=function(e,t,n){var r=t[n?"startContainer":"endContainer"],o=t[n?"startOffset":"endOffset"];if(Dn(r)){var i=r.childNodes.length-1;!n&&o&&o--,r=r.childNodes[o>i?i:o];}return Fn(r)&&n&&o>=r.nodeValue.length&&(r=new ao(r,e.getBody()).next()||r),Fn(r)&&!n&&0===o&&(r=new ao(r,e.getBody()).prev()||r),r},Gh=function(e,t){var n=t?"firstChild":"lastChild";if(function(e){return /^(TR|TH|TD)$/.test(e.nodeName)}(e)&&e[n]){var r=e[n];return "TR"===e.nodeName&&r[n]||r}return e},Jh=function(e,t,n,r){var o=e.create(n,r);return t.parentNode.insertBefore(o,t),o.appendChild(t),o},Qh=function(e,t,n,r,o){var i=Rt.fromDom(t),a=Rt.fromDom(e.create(r,o)),u=n?Gt(i):Yt(i);return gn(a,u),n?(fn(i,a),dn(a,i)):(ln(i,a),mn(a,i)),a.dom},Zh=function(e,t,n,r){var o=nl(t,n,r);return v(o)||"BR"===o.nodeName||e.isBlock(o)},ev=function(e,t,n){var r,o=t.parentNode,i=e.dom,a=ts(e);ml(n)&&(a?o===i.getRoot()&&(n.list_block&&Kh(t,n.list_block)||q(ue(t.childNodes),(function(t){ol(e,a,t.nodeName.toLowerCase())?r?r.appendChild(t):(r=Jh(i,t,a),i.setAttribs(r,e.settings.forced_root_block_attrs)):r=null;}))):i.isBlock(t)&&!i.isBlock(o)&&(Zh(i,t,!1)||Zh(i,t.firstChild,!0,!0)||t.insertBefore(i.create("br"),t.firstChild),Zh(i,t,!0)||Zh(i,t.lastChild,!1,!0)||t.appendChild(i.create("br")))),function(e){return gl(e)&&pl(e)&&Xn(be(e,"mixed"),!0)}(n)&&!Kh(n.inline,t)||i.remove(t,!0);},tv=function(e,t,n,r,o){var i,a=e.dom;if(!function(e,t,n){return !(!pl(n)||!Kh(t,n.inline))||!(!ml(n)||!Kh(t,n.block))||(gl(n)?Dn(t)&&e.is(t,n.selector):void 0)}(a,r,t)&&!function(e,t){return t.links&&"A"===e.nodeName}(r,t))return qh.keep();var u=r;if(pl(t)&&"all"===t.remove&&m(t.preserve_attributes)){var c=K(a.getAttribs(u),(function(e){return H(t.preserve_attributes,e.name.toLowerCase())}));if(a.removeAllAttribs(u),q(c,(function(e){return a.setAttrib(u,e.name,e.value)})),c.length>0)return qh.rename("span")}if("all"!==t.remove){Wh(t.styles,(function(e,r){e=cl(a,al(e,n),r+""),C(r)&&(r=e,o=null),(t.remove_similar||!o||Kh(sl(a,o,r),e))&&a.setStyle(u,r,""),i=!0;})),i&&""===a.getAttrib(u,"style")&&(u.removeAttribute("style"),u.removeAttribute("data-mce-style")),Wh(t.attributes,(function(e,r){var i;if(e=al(e,n),C(r)&&(r=e,o=null),t.remove_similar||!o||Kh(a.getAttrib(o,r),e)){if("class"===r&&(e=a.getAttrib(u,r))&&(i="",q(e.split(/\s+/),(function(e){/mce\-\w+/.test(e)&&(i+=(i?" ":"")+e);})),i))return void a.setAttrib(u,r,i);if($h.test(r)&&u.removeAttribute("data-mce-"+r),"style"===r&&Tn(["li"])(u)&&"none"===a.getStyle(u,"list-style-type"))return u.removeAttribute(r),void a.setStyle(u,"list-style-type","none");"class"===r&&u.removeAttribute("className"),u.removeAttribute(r);}})),Wh(t.classes,(function(e){e=al(e,n),o&&!a.hasClass(o,e)||a.removeClass(u,e);}));for(var s=a.getAttribs(u),f=0;f<s.length;f++){var l=s[f].nodeName;if(0!==l.indexOf("_")&&0!==l.indexOf("data-"))return qh.keep()}}return "none"!==t.remove?(ev(e,u,t),qh.removed()):qh.keep()},nv=function(e,t,n,r,o){return tv(e,t,n,r,o).fold(T,(function(t){return e.dom.rename(r,t),!0}),O)},rv=function(e,t,n,r){return tv(e,t,n,r,r).fold(k(r),(function(t){return e.dom.createFragment().appendChild(r),e.dom.rename(r,t)}),k(null))},ov=function(e,t,n,r,o){var i=e.formatter.get(t),a=i[0],u=!0,c=e.dom,s=e.selection,f=function(r){var u=function(e,t,n,r,o){var i;return q(ll(e.dom,t.parentNode).reverse(),(function(t){if(!i&&"_start"!==t.id&&"_end"!==t.id){var a=vh(e,t,n,r,o);a&&!1!==a.split&&(i=t);}})),i}(e,r,t,n,o);return function(e,t,n,r,o,i,a,u){var c,s,f,l=e.dom;if(n){for(var d=n.parentNode,m=r.parentNode;m&&m!==d;m=m.parentNode){c=l.clone(m,!1);for(var g=0;g<t.length&&null!==(c=rv(e,t[g],u,c));g++);c&&(s&&c.appendChild(s),f||(f=c),s=c);}!i||a.mixed&&l.isBlock(n)||(r=l.split(n,r)),s&&(o.parentNode.insertBefore(s,o),f.appendChild(o),pl(a)&&zh(l,a,0,s));}return r}(e,i,u,r,r,!0,a,n)},l=function(t){return j(i,(function(r){return nv(e,r,n,t,t)}))},d=function(t){var n=!0,r=!1;Dn(t)&&c.getContentEditable(t)&&(n=u,u="true"===c.getContentEditable(t),r=!0);var o=ue(t.childNodes);if(u&&!r){var i=l(t),s=t.parentNode;!i&&b(s)&&hl(a)&&l(s);}if(a.deep&&o.length){for(var f=0;f<o.length;f++)d(o[f]);r&&(u=n);}q(["underline","line-through","overline"],(function(n){Dn(t)&&e.dom.getStyle(t,"text-decoration")===n&&t.parentNode&&fl(c,t.parentNode)===n&&nv(e,{deep:!1,exact:!0,inline:"span",styles:{textDecoration:n}},null,t);}));},m=function(e){var t=c.get(e?"_start":"_end"),n=t[e?"firstChild":"lastChild"];return function(e){return Gf(e)&&Dn(e)&&("_start"===e.id||"_end"===e.id)}(n)&&(n=n[e?"firstChild":"lastChild"]),Fn(n)&&0===n.data.length&&(n=e?t.previousSibling||t.nextSibling:t.nextSibling||t.previousSibling),c.remove(t,!0),n},g=function(t){var n,r,o=Tl(e,t,i,t.collapsed);if(a.split){if(o=Cd(o),(n=Yh(e,o,!0))!==(r=Yh(e,o))){if(n=Gh(n,!0),r=Gh(r,!1),Xh(c,n,r)){var u=I.from(n.firstChild).getOr(n);return f(Qh(c,u,!0,"span",{id:"_start","data-mce-type":"bookmark"})),void m(!0)}if(Xh(c,r,n)){u=I.from(r.lastChild).getOr(r);return f(Qh(c,u,!1,"span",{id:"_end","data-mce-type":"bookmark"})),void m(!1)}n=Jh(c,n,"span",{id:"_start","data-mce-type":"bookmark"}),r=Jh(c,r,"span",{id:"_end","data-mce-type":"bookmark"});var s=c.createRng();s.setStartAfter(n),s.setEndBefore(r),Ol(c,s,(function(e){q(e,(function(e){Gf(e)||Gf(e.parentNode)||f(e);}));})),f(n),f(r),n=m(!0),r=m();}else n=r=f(n);o.startContainer=n.parentNode?n.parentNode:n,o.startOffset=c.nodeIndex(n),o.endContainer=r.parentNode?r.parentNode:r,o.endOffset=c.nodeIndex(r)+1;}Ol(c,o,(function(e){q(e,d);}));};if(r){if(el(r)){var p=c.createRng();p.setStartBefore(r),p.setEndAfter(r),g(p);}else g(r);rd(e,t,r,n);}else if("false"!==c.getContentEditable(s.getNode()))s.isCollapsed()&&pl(a)&&!Il(e).length?Dh(e,t,n,o):(ql(s,!0,(function(){Vl(e,g);})),pl(a)&&bh(e,t,n,s.getStart())&&tl(c,s,s.getRng()),e.nodeChanged()),rd(e,t,r,n);else {r=s.getNode();for(var h=0;h<i.length&&(!i[h].ceFalseOverride||!nv(e,i[h],n,r,r));h++);rd(e,t,r,n);}},iv=_t.each,av=function(e,t,n,r){iv(t,(function(t){pl(t)&&iv(e.dom.select(t.inline,r),(function(r){Mh(r)&&nv(e,t,n,r,t.exact?r:null);})),function(e,t,n){if(t.clear_child_styles){var r=t.links?"*:not(a)":"*";Ih(e.select(r,n),(function(n){Mh(n)&&Ih(t.styles,(function(t,r){e.setStyle(n,r,"");}));}));}}(e.dom,t,r);}));},uv=_t.each,cv=function(e){return Dn(e)&&!Gf(e)&&!Ff(e)&&!Pn(e)},sv=function(e,t,n,r){var o=e.formatter.get(t),i=o[0],a=!r&&e.selection.isCollapsed(),u=e.dom,c=e.selection,s=function(e,t){if(void 0===t&&(t=i),y(t.onformat)&&t.onformat(e,t,n,r),uv(t.styles,(function(t,r){u.setStyle(e,r,al(t,n));})),t.styles){var o=u.getAttrib(e,"style");o&&u.setAttrib(e,"data-mce-style",o);}uv(t.attributes,(function(t,r){u.setAttrib(e,r,al(t,n));})),uv(t.classes,(function(t){t=al(t,n),u.hasClass(e,t)||u.addClass(e,t);}));},f=function(e,t){var n=!1;return uv(e,(function(e){return !!gl(e)&&(b(e.collapsed)&&e.collapsed!==a?void 0:u.is(t,e.selector)&&!Ff(t)?(s(t,e),n=!0,!1):void 0)})),n},d=function(e){if(l(e)){var t=u.create(e);return s(t),t}return null},m=function(r,a,u){var c=[],l=!0,m=i.inline||i.block,g=d(m);Ol(r,a,(function(a){var d,p=function(a){var h=!1,v=l,y=a.nodeName.toLowerCase(),C=a.parentNode,x=C.nodeName.toLowerCase();if(Dn(a)&&r.getContentEditable(a)&&(v=l,l="true"===r.getContentEditable(a),h=!0),jn(a)&&!function(e,t,n,r){if(function(e){return e.getParam("format_empty_lines",!1,"boolean")}(e)&&pl(t)){var o=Re(Re({},e.schema.getTextBlockElements()),{td:{},th:{},li:{},dt:{},dd:{},figcaption:{},caption:{},details:{},summary:{}}),i=sh(Rt.fromDom(n),(function(e){return Ff(e.dom)}));return Ce(o,r)&&ei(Rt.fromDom(n.parentNode),!1)&&!i}return !1}(e,i,a,x))return d=null,void(ml(i)&&r.remove(a));if(ml(i)&&i.wrapper&&vh(e,a,t,n))d=null;else {if(l&&!h&&ml(i)&&!i.wrapper&&rl(e,y)&&ol(e,x,m)){var w=r.rename(a,m);return s(w),c.push(w),void(d=null)}if(gl(i)){var S=f(o,a);if(!S&&b(C)&&hl(i)&&(S=f(o,C)),!pl(i)||S)return void(d=null)}!l||h||!ol(e,m,y)||!ol(e,x,m)||!u&&Fn(a)&&xo(a.data)||Ff(a)||pl(i)&&r.isBlock(a)?(d=null,q(ue(a.childNodes),p),h&&(l=v),d=null):(d||(d=r.clone(g,!1),a.parentNode.insertBefore(d,a),c.push(d)),d.appendChild(a));}};q(a,p);})),!0===i.links&&q(c,(function(e){var t=function(e){"A"===e.nodeName&&s(e,i),q(ue(e.childNodes),t);};t(e);})),q(c,(function(a){var u=function(e){var t=0;return q(e.childNodes,(function(e){(function(e){return b(e)&&Fn(e)&&0===e.length})(e)||Gf(e)||t++;})),t}(a);!(c.length>1)&&r.isBlock(a)||0!==u?(pl(i)||ml(i)&&i.wrapper)&&(i.exact||1!==u||(a=function(e){var t=J(e.childNodes,cv).filter((function(e){return ph(r,e,i)}));return t.map((function(t){var n=r.clone(t,!1);return s(n),r.replace(n,e,!0),r.remove(t,!0),n})).getOr(e)}(a)),av(e,o,n,a),function(e,t,n,r,o){vh(e,o.parentNode,n,r)&&nv(e,t,r,o)||t.merge_with_parents&&e.dom.getParent(o.parentNode,(function(i){if(vh(e,i,n,r))return nv(e,t,r,o),!0}));}(e,i,t,n,a),function(e,t,n,r){t.styles&&t.styles.backgroundColor&&Hh(r,jh(e,"fontSize"),Vh(e,"backgroundColor",al(t.styles.backgroundColor,n)));}(r,i,n,a),function(e,t,n,r){var o=function(t){if(1===t.nodeType&&t.parentNode&&1===t.parentNode.nodeType){var n=fl(e,t.parentNode);e.getStyle(t,"color")&&n?e.setStyle(t,"text-decoration",n):e.getStyle(t,"text-decoration")===n&&e.setStyle(t,"text-decoration",null);}};t.styles&&(t.styles.color||t.styles.textDecoration)&&(_t.walk(r,o,"childNodes"),o(r));}(r,i,0,a),function(e,t,n,r){!pl(t)||"sub"!==t.inline&&"sup"!==t.inline||(Hh(r,jh(e,"fontSize"),Vh(e,"fontSize","")),e.remove(e.select("sup"===t.inline?"sub":"sup",r),!0));}(r,i,0,a),zh(r,i,0,a)):r.remove(a,!0);}));};if("false"!==u.getContentEditable(c.getNode())){if(i){if(r)if(el(r)){if(!f(o,r)){var g=u.createRng();g.setStartBefore(r),g.setEndAfter(r),m(u,Tl(e,g,o),!0);}}else m(u,r,!0);else if(a&&pl(i)&&!Il(e).length)!function(e,t,n){var r,o,i=e.selection,a=i.getRng(),u=a.startOffset,c=a.startContainer.nodeValue;(r=Uf(e.getBody(),i.getStart()))&&(o=kh(r));var s,f,l=/[^\s\u00a0\u00ad\u200b\ufeff]/;if(c&&u>0&&u<c.length&&l.test(c.charAt(u))&&l.test(c.charAt(u-1))){var d=i.getBookmark();a.collapse(!0);var m=Tl(e,a,e.formatter.get(t));m=Cd(m),e.formatter.apply(t,n,m),i.moveToBookmark(d);}else r&&o.nodeValue===xh||(s=e.getDoc(),f=Nh(!0).dom,o=(r=s.importNode(f,!0)).firstChild,a.insertNode(r),u=1),e.formatter.apply(t,n,r),i.setCursorLocation(o,u);}(e,t,n);else {var p=c.getNode(),h=o[0];e.settings.forced_root_block||!h.defaultBlock||u.getParent(p,u.isBlock)||sv(e,h.defaultBlock),c.setRng(Wp(c.getRng())),ql(c,!0,(function(){Vl(e,(function(t,n){var r=n?t:Tl(e,t,o);m(u,r,!1);}));})),tl(u,c,c.getRng()),e.nodeChanged();}!function(e,t){Lh(Bh[e],(function(e){e(t);}));}(t,e);}nd(e,t,r,n);}else {r=c.getNode();for(var v=0,C=o.length;v<C;v++){var x=o[v];if(x.ceFalseOverride&&gl(x)&&u.is(r,x.selector)){s(r,x);break}}nd(e,t,r,n);}},fv=function(e){return ye(e,"vars")},lv=function(e){return e.selection.getStart()},dv=function(e,t,n,r,o){return G(t,(function(t){var i=e.formatter.matchNode(t,n,null!=o?o:{},r);return !h(i)}),(function(t){return !!mh(e,t,n)||!r&&b(e.formatter.matchNode(t,n,o,!0))}))},mv=function(e,t){var n=null!=t?t:lv(e);return K(ll(e.dom,n),(function(e){return Dn(e)&&!Pn(e)}))},gv=function(e,t,n){var r=mv(e,t);le(n,(function(n,o){var i=function(n){var i=dv(e,r,o,n.similar,fv(n)?n.vars:void 0),a=i.isSome();if(n.state.get()!==a){n.state.set(a);var u=i.getOr(t);fv(n)?n.callback(a,{node:u,format:o,parents:r}):q(n.callbacks,(function(e){return e(a,{node:u,format:o,parents:r})}));}};q([n.withSimilar,n.withoutSimilar],i),q(n.withVars,i);}));},pv=function(e,t,n,r,o,i){return null===t.get()&&function(e,t){e.set({}),t.on("NodeChange",(function(n){gv(t,n.element,e.get());})),t.on("FormatApply FormatRemove",(function(n){var r=I.from(n.node).map((function(e){return el(e)?e:e.startContainer})).bind((function(e){return Dn(e)?I.some(e):I.from(e.parentElement)})).getOrThunk((function(){return lv(t)}));gv(t,r,e.get());}));}(t,e),function(e,t,n,r,o,i){var a=t.get();q(n.split(","),(function(t){var n=be(a,t).getOrThunk((function(){var e={withSimilar:{state:Cu(!1),similar:!0,callbacks:[]},withoutSimilar:{state:Cu(!1),similar:!1,callbacks:[]},withVars:[]};return a[t]=e,e})),u=function(){var n=mv(e);return dv(e,n,t,o,i).isSome()};if(h(i)){var c=o?n.withSimilar:n.withoutSimilar;c.callbacks.push(r),1===c.callbacks.length&&c.state.set(u());}else n.withVars.push({state:Cu(u()),similar:o,vars:i,callback:r});})),t.set(a);}(e,t,n,r,o,i),{unbind:function(){return function(e,t,n){var r=e.get();q(t.split(","),(function(e){return be(r,e).each((function(t){r[e]={withSimilar:Re(Re({},t.withSimilar),{callbacks:K(t.withSimilar.callbacks,(function(e){return e!==n}))}),withoutSimilar:Re(Re({},t.withoutSimilar),{callbacks:K(t.withoutSimilar.callbacks,(function(e){return e!==n}))}),withVars:K(t.withVars,(function(e){return e.callback!==n}))};}))})),e.set(r);}(t,n,r)}}},hv=function(e,t){var n=(t||document).createDocumentFragment();return q(e,(function(e){n.appendChild(e.dom);})),Rt.fromDom(n)},vv=function(e,t,n){return {element:e,width:t,rows:n}},bv=function(e,t){return {element:e,cells:t}},yv=function(e,t){return {x:e,y:t}},Cv=function(e,t){var n=parseInt(er(e,t),10);return isNaN(n)?1:n},xv=function(e,t,n){var r=e.rows;return !!(r[n]?r[n].cells:[])[t]},wv=function(e){return Y(e,(function(e,t){return t.cells.length>e?t.cells.length:e}),0)},Sv=function(e,t){for(var n=e.rows,r=0;r<n.length;r++)for(var o=n[r].cells,i=0;i<o.length;i++)if(Bt(o[i],t))return I.some(yv(i,r));return I.none()},kv=function(e,t,n,r,o){for(var i=[],a=e.rows,u=n;u<=o;u++){var c=a[u].cells,s=t<r?c.slice(t,r+1):c.slice(r,t+1);i.push(bv(a[u].element,s));}return i},Nv=function(e){var t=vv(Yu(e),0,[]);return q(Mu(e,"tr"),(function(e,n){q(Mu(e,"td,th"),(function(r,o){!function(e,t,n,r,o){for(var i=Cv(o,"rowspan"),a=Cv(o,"colspan"),u=e.rows,c=n;c<n+i;c++){u[c]||(u[c]=bv(Gu(r),[]));for(var s=t;s<t+a;s++)u[c].cells[s]=c===n&&s===t?o:Yu(o);}}(t,function(e,t,n){for(;xv(e,t,n);)t++;return t}(t,o,n),n,e,r);}));})),vv(t.element,wv(t.rows),t.rows)},Ev=function(e){return function(e,t){var n=Yu(e.element),r=Rt.fromTag("tbody");return gn(r,t),mn(n,r),n}(e,function(e){return V(e.rows,(function(e){var t=V(e.cells,(function(e){var t=Gu(e);return nr(t,"colspan"),nr(t,"rowspan"),t})),n=Yu(e.element);return gn(n,t),n}))}(e))},_v=function(e,t,n){return Sv(e,t).bind((function(t){return Sv(e,n).map((function(n){return function(e,t,n){var r=t.x,o=t.y,i=n.x,a=n.y,u=o<a?kv(e,r,o,i,a):kv(e,r,a,i,o);return vv(e.element,wv(u),u)}(e,t,n)}))}))},Av=function(e,t){return J(e,(function(e){return "li"===It(e)&&zl(e,t)})).fold(k([]),(function(t){return function(e){return J(e,(function(e){return "ul"===It(e)||"ol"===It(e)}))}(e).map((function(e){var t=Rt.fromTag(It(e)),n=he(ur(e),(function(e,t){return Me(t,"list-style")}));return rr(t,n),[Rt.fromTag("li"),t]})).getOr([])}))},Rv=function(e,t){var n=Rt.fromDom(t.commonAncestorContainer),r=Ng(n,e),o=K(r,(function(e){return fo(e)||co(e)})),i=Av(r,t),a=o.concat(i.length?i:function(e){return po(e)?Wt(e).filter(go).fold(k([]),(function(t){return [e,t]})):go(e)?[e]:[]}(n));return V(a,Yu)},Dv=function(){return hv([])},Tv=function(e,t){return n=Rt.fromDom(t.cloneContents()),r=Rv(e,t),o=Y(r,(function(e,t){return mn(t,e),t}),n),r.length>0?hv([o]):o;var n,r,o;},Ov=function(e,t){return (n=e,r=t[0],Gr(r,"table",_(Bt,n))).bind((function(e){var n=t[0],r=t[t.length-1],o=Nv(e);return _v(o,n,r).map((function(e){return hv([Ev(e)])}))})).getOrThunk(Dv);var n,r;},Bv=function(e,t){var n=Ll(t,e);return n.length>0?Ov(e,n):function(e,t){return t.length>0&&t[0].collapsed?Dv():Tv(e,t[0])}(e,t)},Pv=function(e,t){return t>=0&&t<e.length&&Qf(e.charAt(t))},Lv=function(e,t){var n=wo(e.innerText);return t?function(e){return e.replace(/^[ \f\n\r\t\v]+/,"")}(n):n},Iv=function(e,t,n){void 0===n&&(n={});var r=function(e,t){return Re(Re({},e),{format:t,get:!0,selection:!0})}(n,t),o=e.fire("BeforeGetContent",r);if(o.isDefaultPrevented())return e.fire("GetContent",o),o.content;if("text"===o.format)return function(e){return I.from(e.selection.getRng()).map((function(t){var n=I.from(e.dom.getParent(t.commonAncestorContainer,e.dom.isBlock)),r=e.getBody(),o=function(e){return e.map((function(e){return e.nodeName})).getOr("div").toLowerCase()}(n),i=wt.browser.isIE()&&"pre"!==o,a=e.dom.add(r,o,{"data-mce-bogus":"all",style:"overflow: hidden; opacity: 0;"},t.cloneContents()),u=Lv(a,i),c=wo(a.textContent);if(e.dom.remove(a),Pv(c,0)||Pv(c,c.length-1)){var s=n.getOr(r),f=Lv(s,i),l=f.indexOf(u);return -1===l?u:(Pv(f,l-1)?" ":"")+u+(Pv(f,l+u.length)?" ":"")}return u})).getOr("")}(e);o.getInner=!0;var i=function(e,t){var n=e.selection.getRng(),r=e.dom.create("body"),o=e.selection.getSel(),i=_m(e,Bl(o)),a=t.contextual?Bv(Rt.fromDom(e.getBody()),i).dom:n.cloneContents();return a&&r.appendChild(a),e.selection.serializer.serialize(r,t)}(e,o);return "tree"===o.format?i:(o.content=e.selection.isCollapsed()?"":i,e.fire("GetContent",o),o.content)},Mv=function(e){return Dn(e)?e.outerHTML:Fn(e)?bi.encodeRaw(e.data,!1):Un(e)?"\x3c!--"+e.data+"--\x3e":""},Fv=function(e,t,n){var r=function(e){var t,n=document.createElement("div"),r=document.createDocumentFragment();for(e&&(n.innerHTML=e);t=n.firstChild;)r.appendChild(t);return r}(t);if(e.hasChildNodes()&&n<e.childNodes.length){var o=e.childNodes[n];o.parentNode.insertBefore(r,o);}else e.appendChild(r);},Uv=function(e,t){var n,r,o,i,a,u,c,s,f,l=V(ue(t.childNodes),Mv);return function(e,t){var n=0;q(e,(function(e){0===e[0]?n++:1===e[0]?(Fv(t,e[1],n),n++):2===e[0]&&function(e,t){if(e.hasChildNodes()&&t<e.childNodes.length){var n=e.childNodes[t];n.parentNode.removeChild(n);}}(t,n);}));}((r=e,o=(n=l).length+r.length+2,i=new Array(o),a=new Array(o),u=function(e,t,o,i,a){var c=s(e,t,o,i);if(null===c||c.start===t&&c.diag===t-i||c.end===e&&c.diag===e-o)for(var f=e,l=o;f<t||l<i;)f<t&&l<i&&n[f]===r[l]?(a.push([0,n[f]]),++f,++l):t-e>i-o?(a.push([2,n[f]]),++f):(a.push([1,r[l]]),++l);else {u(e,c.start,o,c.start-c.diag,a);for(var d=c.start;d<c.end;++d)a.push([0,n[d]]);u(c.end,t,c.end-c.diag,i,a);}},c=function(e,t,o,i){for(var a=e;a-t<i&&a<o&&n[a]===r[a-t];)++a;return function(e,t,n){return {start:e,end:t,diag:n}}(e,a,t)},s=function(e,t,o,u){var s=t-e,f=u-o;if(0===s||0===f)return null;var l,d,m,g,p,h=s-f,v=f+s,b=(v%2==0?v:v+1)/2;for(i[1+b]=e,a[1+b]=t+1,l=0;l<=b;++l){for(d=-l;d<=l;d+=2){for(m=d+b,d===-l||d!==l&&i[m-1]<i[m+1]?i[m]=i[m+1]:i[m]=i[m-1]+1,p=(g=i[m])-e+o-d;g<t&&p<u&&n[g]===r[p];)i[m]=++g,++p;if(h%2!=0&&h-l<=d&&d<=h+l&&a[m-h]<=i[m])return c(a[m-h],d+e-o,t,u)}for(d=h-l;d<=h+l;d+=2){for(m=d+b-h,d===h-l||d!==h+l&&a[m+1]<=a[m-1]?a[m]=a[m+1]-1:a[m]=a[m-1],p=(g=a[m]-1)-e+o-d;g>=e&&p>=o&&n[g]===r[p];)a[m]=g--,p--;if(h%2==0&&-l<=d&&d<=l&&a[m]<=i[m+h])return c(a[m],d+e-o,t,u)}}},f=[],u(0,n.length,0,r.length,f),f),t),t},zv=Te((function(){return document.implementation.createHTMLDocument("undo")})),Hv=function(e){var t,n=(t=e.getBody(),K(V(ue(t.childNodes),Mv),(function(e){return e.length>0}))),r=Z(n,(function(t){var n=Wm(e.serializer,t);return n.length>0?[n]:[]})),o=r.join("");return -1!==o.indexOf("</iframe>")?function(e){return {type:"fragmented",fragments:e,content:"",bookmark:null,beforeBookmark:null}}(r):function(e){return {type:"complete",fragments:null,content:e,bookmark:null,beforeBookmark:null}}(o)},jv=function(e,t,n){var r=n?t.beforeBookmark:t.bookmark;"fragmented"===t.type?Uv(t.fragments,e.getBody()):e.setContent(t.content,{format:"raw",no_selection:!b(r)||!zf(r)||!r.isFakeCaret}),e.selection.moveToBookmark(r);},Vv=function(e){return "fragmented"===e.type?e.fragments.join(""):e.content},qv=function(e){var t=Rt.fromTag("body",zv());return Ku(t,Vv(e)),q(Mu(t,"*[data-mce-bogus]"),vn),t.dom.innerHTML},$v=function(e,t){return !(!e||!t)&&(!!function(e,t){return Vv(e)===Vv(t)}(e,t)||function(e,t){return qv(e)===qv(t)}(e,t))},Wv=function(e){return 0===e.get()},Kv=function(e,t,n){Wv(n)&&(e.typing=t);},Xv=function(e,t){e.typing&&(Kv(e,!1,t),e.add());},Yv=function(e){return {undoManager:{beforeChange:function(t,n){return function(e,t,n){Wv(t)&&n.set(Jc(e.selection));}(e,t,n)},add:function(t,n,r,o,i,a){return function(e,t,n,r,o,i,a){var u=Hv(e);if(i=i||{},i=_t.extend(i,u),!1===Wv(r)||e.removed)return null;var c=t.data[n.get()];if(e.fire("BeforeAddUndo",{level:i,lastLevel:c,originalEvent:a}).isDefaultPrevented())return null;if(c&&$v(c,i))return null;t.data[n.get()]&&o.get().each((function(e){t.data[n.get()].beforeBookmark=e;}));var s=function(e){return e.getParam("custom_undo_redo_levels",0,"number")}(e);if(s&&t.data.length>s){for(var f=0;f<t.data.length-1;f++)t.data[f]=t.data[f+1];t.data.length--,n.set(t.data.length);}i.bookmark=Jc(e.selection),n.get()<t.data.length-1&&(t.data.length=n.get()+1),t.data.push(i),n.set(t.data.length-1);var l={level:i,lastLevel:c,originalEvent:a};return n.get()>0?(e.setDirty(!0),e.fire("AddUndo",l),e.fire("change",l)):e.fire("AddUndo",l),i}(e,t,n,r,o,i,a)},undo:function(t,n,r){return function(e,t,n,r){var o;return t.typing&&(t.add(),t.typing=!1,Kv(t,!1,n)),r.get()>0&&(r.set(r.get()-1),o=t.data[r.get()],jv(e,o,!0),e.setDirty(!0),e.fire("Undo",{level:o})),o}(e,t,n,r)},redo:function(t,n){return function(e,t,n){var r;return t.get()<n.length-1&&(t.set(t.get()+1),r=n[t.get()],jv(e,r,!1),e.setDirty(!0),e.fire("Redo",{level:r})),r}(e,t,n)},clear:function(t,n){return function(e,t,n){t.data=[],n.set(0),t.typing=!1,e.fire("ClearUndos");}(e,t,n)},reset:function(e){return function(e){e.clear(),e.add();}(e)},hasUndo:function(t,n){return function(e,t,n){return n.get()>0||t.typing&&t.data[0]&&!$v(Hv(e),t.data[0])}(e,t,n)},hasRedo:function(e,t){return function(e,t){return t.get()<e.data.length-1&&!e.typing}(e,t)},transact:function(e,t,n){return function(e,t,n){return Xv(e,t),e.beforeChange(),e.ignore(n),e.add()}(e,t,n)},ignore:function(e,t){return function(e,t){try{e.set(e.get()+1),t();}finally{e.set(e.get()-1);}}(e,t)},extra:function(t,n,r,o){return function(e,t,n,r,o){if(t.transact(r)){var i=t.data[n.get()].bookmark,a=t.data[n.get()-1];jv(e,a,!0),t.transact(o)&&(t.data[n.get()-1].beforeBookmark=i);}}(e,t,n,r,o)}},formatter:{match:function(t,n,r,o){return bh(e,t,n,r,o)},matchAll:function(t,n){return function(e,t,n){var r=[],o={},i=e.selection.getStart();return e.dom.getParent(i,(function(i){for(var a=0;a<t.length;a++){var u=t[a];!o[u]&&vh(e,i,u,n)&&(o[u]=!0,r.push(u));}}),e.dom.getRoot()),r}(e,t,n)},matchNode:function(t,n,r,o){return vh(e,t,n,r,o)},canApply:function(t){return function(e,t){var n=e.formatter.get(t),r=e.dom;if(n)for(var o=e.selection.getStart(),i=ll(r,o),a=n.length-1;a>=0;a--){var u=n[a];if(!gl(u)||b(u.defaultBlock))return !0;for(var c=i.length-1;c>=0;c--)if(r.is(i[c],u.selector))return !0}return !1}(e,t)},closest:function(t){return yh(e,t)},apply:function(t,n,r){return sv(e,t,n,r)},remove:function(t,n,r,o){return ov(e,t,n,r,o)},toggle:function(t,n,r){return function(e,t,n,r){var o=e.formatter.get(t);!bh(e,t,n,r)||"toggle"in o[0]&&!o[0].toggle?sv(e,t,n,r):ov(e,t,n,r);}(e,t,n,r)},formatChanged:function(t,n,r,o,i){return pv(e,t,n,r,o,i)}},editor:{getContent:function(t,n){return function(e,t,n){return I.from(e.getBody()).fold(k("tree"===t.format?new Om("body",11):""),(function(r){return Xm(e,t,n,r)}))}(e,t,n)},setContent:function(t,n){return ch(e,t,n)},insertContent:function(t,n){return rh(e,t,n)},addVisual:function(t){return function(e,t){var n=e.dom,r=b(t)?t:e.getBody();h(e.hasVisual)&&(e.hasVisual=function(e){return e.getParam("visual",!0,"boolean")}(e)),q(n.select("table,a",r),(function(t){switch(t.nodeName){case"TABLE":var r=function(e){return e.getParam("visual_table_class","mce-item-table","string")}(e),o=n.getAttrib(t,"border");o&&"0"!==o||!e.hasVisual?n.removeClass(t,r):n.addClass(t,r);break;case"A":if(!n.getAttrib(t,"href")){var i=n.getAttrib(t,"name")||t.id,a=function(e){return e.getParam("visual_anchor_class","mce-item-anchor","string")}(e);i&&e.hasVisual?n.addClass(t,a):n.removeClass(t,a);}}})),e.fire("VisualAid",{element:t,hasVisual:e.hasVisual});}(e,t)}},selection:{getContent:function(t,n){return Iv(e,t,n)}},raw:{getModel:function(){return I.none()}}}},Gv=function(e){return ye(e.plugins,"rtc")},Jv=function(e){var t=e;return function(e){return be(e.plugins,"rtc").bind((function(e){return I.from(e.setup)}))}(e).fold((function(){return t.rtcInstance=Yv(e),I.none()}),(function(e){return t.rtcInstance=function(){var e=k(null),t=k("");return {undoManager:{beforeChange:x,add:e,undo:e,redo:e,clear:x,reset:x,hasUndo:T,hasRedo:T,transact:e,ignore:x,extra:x},formatter:{match:T,matchAll:k([]),matchNode:k(void 0),canApply:T,closest:t,apply:x,remove:x,toggle:x,formatChanged:k({unbind:x})},editor:{getContent:t,setContent:t,insertContent:x,addVisual:x},selection:{getContent:t},raw:{getModel:k(I.none())}}}(),I.some((function(){return e().then((function(e){return t.rtcInstance=function(e){var t=function(e){return d(e)?e:{}},n=e.undoManager,r=e.formatter,o=e.editor,i=e.selection,a=e.raw;return {undoManager:{beforeChange:n.beforeChange,add:n.add,undo:n.undo,redo:n.redo,clear:n.clear,reset:n.reset,hasUndo:n.hasUndo,hasRedo:n.hasRedo,transact:function(e,t,r){return n.transact(r)},ignore:function(e,t){return n.ignore(t)},extra:function(e,t,r,o){return n.extra(r,o)}},formatter:{match:function(e,n,o,i){return r.match(e,t(n),i)},matchAll:r.matchAll,matchNode:r.matchNode,canApply:function(e){return r.canApply(e)},closest:function(e){return r.closest(e)},apply:function(e,n,o){return r.apply(e,t(n))},remove:function(e,n,o,i){return r.remove(e,t(n))},toggle:function(e,n,o){return r.toggle(e,t(n))},formatChanged:function(e,t,n,o,i){return r.formatChanged(t,n,o,i)}},editor:{getContent:function(e,t){return o.getContent(e)},setContent:function(e,t){return o.setContent(e,t)},insertContent:function(e,t){return o.insertContent(e)},addVisual:o.addVisual},selection:{getContent:function(e,t){return i.getContent(t)}},raw:{getModel:function(){return I.some(a.getRawModel())}}}}(e),e.rtc.isRemote}))}))}))},Qv=function(e){return e.rtcInstance?e.rtcInstance:Yv(e)},Zv=function(e){var t=e.rtcInstance;if(t)return t;throw new Error("Failed to get RTC instance not yet initialized.")},eb=function(e,t){return void 0===t&&(t={}),function(e,t,n){return Zv(e).selection.getContent(t,n)}(e,t.format?t.format:"html",t)},tb=function(e){return 0===e.dom.length?(hn(e),I.none()):I.some(e)},nb=function(e,t,n,r){e.bind((function(e){return (r?np:tp)(e.dom,r?e.dom.length:0),t.filter(zt).map((function(t){return function(e,t,n,r){var o=e.dom,i=t.dom,a=r?o.length:i.length;r?(rp(o,i,!1,!r),n.setStart(i,a)):(rp(i,o,!1,!r),n.setEnd(i,a));}(e,t,n,r)}))})).orThunk((function(){var e=function(e,t){return e.filter((function(e){return Ql.isBookmarkNode(e.dom)})).bind(t?Xt:Kt)}(t,r).or(t).filter(zt);return e.map((function(e){return function(e,t){Wt(e).each((function(n){var r=e.dom;t&&Wg(n,Ac(r,0))?tp(r,0):!t&&Kg(n,Ac(r,r.length))&&np(r,r.length);}));}(e,r)}))}));},rb=function(e,t,n){void 0===n&&(n={});var r=function(e,t){return Re(Re({format:"html"},e),{set:!0,selection:!0,content:t})}(n,t),o=r;if(!r.no_events){var i=e.fire("BeforeSetContent",r);if(i.isDefaultPrevented())return void e.fire("SetContent",i);o=i;}o.content=function(e,t){if("raw"!==t.format){var n=e.selection.getRng(),r=e.dom.getParent(n.commonAncestorContainer,e.dom.isBlock),o=r?{context:r.nodeName.toLowerCase()}:{},i=e.parser.parse(t.content,Re(Re({isRootContent:!0,forced_root_block:!1},o),t));return Zm({validate:e.validate},e.schema).serialize(i)}return t.content}(e,o);var a=e.selection.getRng();!function(e,t){var n=I.from(t.firstChild).map(Rt.fromDom),r=I.from(t.lastChild).map(Rt.fromDom);e.deleteContents(),e.insertNode(t);var o=n.bind(Kt).filter(zt).bind(tb),i=r.bind(Xt).filter(zt).bind(tb);nb(o,n,e,!0),nb(i,r,e,!1),e.collapse(!1);}(a,a.createContextualFragment(o.content)),e.selection.setRng(a),Vd(e,a),o.no_events||e.fire("SetContent",o);},ob=function(e,t,n){if(e&&ye(e,t)){var r=K(e[t],(function(e){return e!==n}));0===r.length?delete e[t]:e[t]=r;}};var ib,ab,ub=function(e){return !!e.select},cb=function(e){return !(!e||!e.ownerDocument)&&Lt(Rt.fromDom(e.ownerDocument),Rt.fromDom(e))},sb=function(e,t,n,r){var o,i,a=function(e,t){var n,r,o=function(t,n){return J(n,(function(n){return e.is(n,t)}))},i=function(t){return e.getParents(t,null,e.getRoot())};return {selectorChangedWithUnbind:function(e,a){return n||(n={},r={},t.on("NodeChange",(function(e){var t=e.element,a=i(t),u={};_t.each(n,(function(e,t){o(t,a).each((function(n){r[t]||(q(e,(function(e){e(!0,{node:n,selector:t,parents:a});})),r[t]=e),u[t]=e;}));})),_t.each(r,(function(e,n){u[n]||(delete r[n],_t.each(e,(function(e){e(!1,{node:t,selector:n,parents:a});})));}));}))),n[e]||(n[e]=[]),n[e].push(a),o(e,i(t.selection.getStart())).each((function(){r[e]=n[e];})),{unbind:function(){ob(n,e,a),ob(r,e,a);}}}}}(e,r).selectorChangedWithUnbind,u=function(e,t){return rb(r,e,t)},c=function(e){var t=f();t.collapse(!!e),l(t);},s=function(){return t.getSelection?t.getSelection():t.document.selection},f=function(){var n,a,u,c=function(e,t,n){try{return t.compareBoundaryPoints(e,n)}catch(e){return -1}},f=t.document;if(void 0!==r.bookmark&&!1===ym(r)){var l=um(r);if(l.isSome())return l.map((function(e){return _m(r,[e])[0]})).getOr(f.createRange())}try{(n=s())&&!Rn(n.anchorNode)&&(a=n.rangeCount>0?n.getRangeAt(0):n.createRange?n.createRange():f.createRange(),a=_m(r,[a])[0]);}catch(e){}return a||(a=f.createRange?f.createRange():f.body.createTextRange()),a.setStart&&9===a.startContainer.nodeType&&a.collapsed&&(u=e.getRoot(),a.setStart(u,0),a.setEnd(u,0)),o&&i&&(0===c(a.START_TO_START,a,o)&&0===c(a.END_TO_END,a,o)?a=i:(o=null,i=null)),a},l=function(e,t){var n;if(function(e){return !!e&&(!!ub(e)||cb(e.startContainer)&&cb(e.endContainer))}(e)){var a=ub(e)?e:null;if(a){i=null;try{a.select();}catch(e){}}else {var u=s();if(e=r.fire("SetSelectionRange",{range:e,forward:t}).range,u){i=e;try{u.removeAllRanges(),u.addRange(e);}catch(e){}!1===t&&u.extend&&(u.collapse(e.endContainer,e.endOffset),u.extend(e.startContainer,e.startOffset)),o=u.rangeCount>0?u.getRangeAt(0):null;}e.collapsed||e.startContainer!==e.endContainer||!u.setBaseAndExtent||wt.ie||e.endOffset-e.startOffset<2&&e.startContainer.hasChildNodes()&&(n=e.startContainer.childNodes[e.startOffset])&&"IMG"===n.tagName&&(u.setBaseAndExtent(e.startContainer,e.startOffset,e.endContainer,e.endOffset),u.anchorNode===e.startContainer&&u.focusNode===e.endContainer||u.setBaseAndExtent(n,0,n,1)),r.fire("AfterSetSelectionRange",{range:e,forward:t});}}},d=function(){var t=s(),n=null==t?void 0:t.anchorNode,r=null==t?void 0:t.focusNode;if(!t||!n||!r||Rn(n)||Rn(r))return !0;var o=e.createRng();o.setStart(n,t.anchorOffset),o.collapse(!0);var i=e.createRng();return i.setStart(r,t.focusOffset),i.collapse(!0),o.compareBoundaryPoints(o.START_TO_START,i)<=0},m={bookmarkManager:null,controlSelection:null,dom:e,win:t,serializer:n,editor:r,collapse:c,setCursorLocation:function(t,n){var o=e.createRng();b(t)&&b(n)?(o.setStart(t,n),o.setEnd(t,n),l(o),c(!1)):(Hl(e,o,r.getBody(),!0),l(o));},getContent:function(e){return eb(r,e)},setContent:u,getBookmark:function(e,t){return g.getBookmark(e,t)},moveToBookmark:function(e){return g.moveToBookmark(e)},select:function(t,n){return function(e,t,n){return I.from(t).map((function(t){var r=e.nodeIndex(t),o=e.createRng();return o.setStart(t.parentNode,r),o.setEnd(t.parentNode,r+1),n&&(Hl(e,o,t,!0),Hl(e,o,t,!1)),o}))}(e,t,n).each(l),t},isCollapsed:function(){var e=f(),t=s();return !(!e||e.item)&&(e.compareEndPoints?0===e.compareEndPoints("StartToEnd",e):!t||e.collapsed)},isForward:d,setNode:function(t){return u(e.getOuterHTML(t)),t},getNode:function(){return function(e,t){var n,r,o;if(!t)return e;r=t.startContainer,o=t.endContainer;var i=t.startOffset,a=t.endOffset;return n=t.commonAncestorContainer,!t.collapsed&&(r===o&&a-i<2&&r.hasChildNodes()&&(n=r.childNodes[i]),3===r.nodeType&&3===o.nodeType&&(r=r.length===i?Em(r.nextSibling,!0):r.parentNode,o=0===a?Em(o.previousSibling,!1):o.parentNode,r&&r===o))?r:n&&3===n.nodeType?n.parentNode:n}(r.getBody(),f())},getSel:s,setRng:l,getRng:f,getStart:function(e){return km(r.getBody(),f(),e)},getEnd:function(e){return Nm(r.getBody(),f(),e)},getSelectedBlocks:function(t,n){return function(e,t,n,r){var o,i=[],a=e.getRoot();if(n=e.getParent(n||km(a,t,t.collapsed),e.isBlock),r=e.getParent(r||Nm(a,t,t.collapsed),e.isBlock),n&&n!==a&&i.push(n),n&&r&&n!==r){o=n;for(var u=new ao(n,a);(o=u.next())&&o!==r;)e.isBlock(o)&&i.push(o);}return r&&n!==r&&r!==a&&i.push(r),i}(e,f(),t,n)},normalize:function(){var t=f(),n=s();if(!(Bl(n).length>1)&&jl(r)){var o=bd(e,t);return o.each((function(e){l(e,d());})),o.getOr(t)}return t},selectorChanged:function(e,t){return a(e,t),m},selectorChangedWithUnbind:a,getScrollContainer:function(){for(var t,n=e.getRoot();n&&"BODY"!==n.nodeName;){if(n.scrollHeight>n.clientHeight){t=n;break}n=n.parentNode;}return t},scrollIntoView:function(e,t){b(e)?function(e,t,n){(e.inline?zd:jd)(e,t,n);}(r,e,t):Vd(r,f(),t);},placeCaretAt:function(e,t){return l(cd(e,t,r.getDoc()))},getBoundingClientRect:function(){var e=f();return e.collapsed?Ac.fromRangeStart(e).getClientRects()[0]:e.getBoundingClientRect()},destroy:function(){t=o=i=null,p.destroy();}},g=Ql(m),p=ad(m,r);return m.bookmarkManager=g,m.controlSelection=p,m},fb=function(e,t,n){e.addNodeFilter("font",(function(e){q(e,(function(e){var r=t.parse(e.attr("style")),o=e.attr("color"),i=e.attr("face"),a=e.attr("size");o&&(r.color=o),i&&(r["font-family"]=i),a&&(r["font-size"]=n[parseInt(e.attr("size"),10)-1]),e.name="span",e.attr("style",t.serialize(r)),function(e,t){q(t,(function(t){e.attr(t,null);}));}(e,["color","face","size"]);}));}));},lb=function(e,t){var n=Di();t.convert_fonts_to_spans&&fb(e,n,_t.explode(t.font_size_legacy_values)),function(e,t){e.addNodeFilter("strike",(function(e){q(e,(function(e){var n=t.parse(e.attr("style"));n["text-decoration"]="line-through",e.name="span",e.attr("style",t.serialize(n));}));}));}(e,n);},db=function(e){var t,n=decodeURIComponent(e).split(","),r=/data:([^;]+)/.exec(n[0]);return r&&(t=r[1]),{type:t,data:n[1]}},mb=function(e,t){var n;try{n=atob(t);}catch(e){return I.none()}for(var r=new Uint8Array(n.length),o=0;o<r.length;o++)r[o]=n.charCodeAt(o);return I.some(new Blob([r],{type:e}))},gb=function(e){return 0===e.indexOf("blob:")?function(e){return new Zr((function(t,n){var r=function(){n("Cannot convert "+e+" to Blob. Resource might not exist or is inaccessible.");};try{var o=new XMLHttpRequest;o.open("GET",e,!0),o.responseType="blob",o.onload=function(){200===o.status?t(o.response):r();},o.onerror=r,o.send();}catch(e){r();}}))}(e):0===e.indexOf("data:")?(t=e,new Zr((function(e){var n=db(t),r=n.type,o=n.data;mb(r,o).fold((function(){return e(new Blob([]))}),e);}))):null;var t;},pb=0,hb=function(e){return (e||"blobid")+pb++},vb=function(e,t,n,r){var o,i;if(0!==t.src.indexOf("blob:")){var a=db(t.src),u=a.data,c=a.type;o=u,(i=e.getByData(o,c))?n({image:t,blobInfo:i}):gb(t.src).then((function(r){i=e.create(hb(),r,o),e.add(i),n({image:t,blobInfo:i});}),(function(e){r(e);}));}else (i=e.getByUri(t.src))?n({image:t,blobInfo:i}):gb(t.src).then((function(r){(function(e){return new Zr((function(t){var n=new FileReader;n.onloadend=function(){t(n.result);},n.readAsDataURL(e);}))})(r).then((function(a){o=db(a).data,i=e.create(hb(),r,o),e.add(i),n({image:t,blobInfo:i});}));}),(function(e){r(e);}));},bb=function(e,t){var n={};return {findAll:function(r,o){o||(o=O);var i=K(function(e){return e?ue(e.getElementsByTagName("img")):[]}(r),(function(t){var n=t.src;return !!wt.fileApi&&(!t.hasAttribute("data-mce-bogus")&&(!t.hasAttribute("data-mce-placeholder")&&(!(!n||n===wt.transparentSrc)&&(0===n.indexOf("blob:")?!e.isUploaded(n)&&o(t):0===n.indexOf("data:")&&o(t)))))})),a=V(i,(function(e){if(void 0!==n[e.src])return new Zr((function(t){n[e.src].then((function(n){if("string"==typeof n)return n;t({image:e,blobInfo:n.blobInfo});}));}));var r=new Zr((function(n,r){vb(t,e,n,r);})).then((function(e){return delete n[e.image.src],e})).catch((function(t){return delete n[e.src],t}));return n[e.src]=r,r}));return Zr.all(a)}}},yb=function(e,t,n,r){(e.padd_empty_with_br||t.insert)&&n[r.name]?r.empty().append(new Om("br",1)).shortEnded=!0:r.empty().append(new Om("#text",3)).value=yo;},Cb=function(e,t){return e&&e.firstChild&&e.firstChild===e.lastChild&&e.firstChild.name===t},xb=function(e,t,n,r){return r.isEmpty(t,n,(function(t){return function(e,t){var n=e.getElementRule(t.name);return n&&n.paddEmpty}(e,t)}))},wb=function(e,t){var n=t.blob_cache,r=function(e){var r=e.attr("src");(function(e){return e.attr("src")===wt.transparentSrc||b(e.attr("data-mce-placeholder"))})(e)||function(e){return b(e.attr("data-mce-bogus"))}(e)||function(e){var t=/data:([^;]+);base64,([a-z0-9\+\/=\s]+)/i.exec(e);return t?I.some({type:t[1],data:decodeURIComponent(t[2])}):I.none()}(r).filter((function(){return function(e,t){if(t.images_dataimg_filter){var n=new Image;return n.src=e.attr("src"),le(e.attributes.map,(function(e,t){n.setAttribute(t,e);})),t.images_dataimg_filter(n)}return !0}(e,t)})).bind((function(e){var t=e.type,r=e.data;return I.from(n.getByData(r,t)).orThunk((function(){return mb(t,r).map((function(e){var t=n.create(hb(),e,r);return n.add(t),t}))}))})).each((function(t){e.attr("src",t.blobUri());}));};n&&e.addAttributeFilter("src",(function(e){return q(e,r)}));},Sb=_t.makeMap,kb=_t.each,Nb=_t.explode,Eb=_t.extend,_b=function(e,t){void 0===t&&(t=Ai());var n={},r=[],o={},i={};(e=e||{}).validate=!("validate"in e)||e.validate,e.root_name=e.root_name||"body";var a=function(e){var t=e.name;t in n&&((u=o[t])?u.push(e):o[t]=[e]);for(var a=r.length;a--;){var u,c=r[a].name;if(c in e.attributes.map)(u=i[c])?u.push(e):i[c]=[e];}return e},u={schema:t,addAttributeFilter:function(e,t){kb(Nb(e),(function(e){var n;for(n=0;n<r.length;n++)if(r[n].name===e)return void r[n].callbacks.push(t);r.push({name:e,callbacks:[t]});}));},getAttributeFilters:function(){return [].concat(r)},addNodeFilter:function(e,t){kb(Nb(e),(function(e){var r=n[e];r||(n[e]=r=[]),r.push(t);}));},getNodeFilters:function(){var e=[];for(var t in n)ye(n,t)&&e.push({name:t,callbacks:n[t]});return e},filterNode:a,parse:function(u,c){var s,f,l,d,m,g,p,h,v=[];c=c||{},o={},i={};var b=Eb(Sb("script,style,head,html,body,title,meta,param"),t.getBlockElements()),y=t.getNonEmptyElements(),C=t.children,x=e.validate,w=function(e){return !1===e?"":!0===e?"p":e}("forced_root_block"in c?c.forced_root_block:e.forced_root_block),S=t.getWhiteSpaceElements(),k=/^[ \t\r\n]+/,N=/[ \t\r\n]+$/,E=/[ \t\r\n]+/g,_=/^[ \t\r\n]+$/,A=ye(S,c.context)||ye(S,e.root_name),R=function(e,t){var r,i=new Om(e,t);return e in n&&((r=o[e])?r.push(i):o[e]=[i]),i},D=function(e){for(var n=t.getBlockElements(),r=e.prev;r&&3===r.type;){var o=r.value.replace(N,"");if(o.length>0)return void(r.value=o);var i=r.next;if(i){if(3===i.type&&i.value.length){r=r.prev;continue}if(!n[i.name]&&"script"!==i.name&&"style"!==i.name){r=r.prev;continue}}var a=r.prev;r.remove(),r=a;}},T=$m({validate:x,document:e.document,allow_html_data_urls:e.allow_html_data_urls,allow_svg_data_urls:e.allow_svg_data_urls,allow_script_urls:e.allow_script_urls,allow_conditional_comments:e.allow_conditional_comments,preserve_cdata:e.preserve_cdata,self_closing_elements:function(e){var t={};for(var n in e)"li"!==n&&"p"!==n&&(t[n]=e[n]);return t}(t.getSelfClosingElements()),cdata:function(e){h.append(R("#cdata",4)).value=e;},text:function(e,t){var n;A||(e=e.replace(E," "),function(e,t){return e&&(ye(t,e.name)||"br"===e.name)}(h.lastChild,b)&&(e=e.replace(k,""))),0!==e.length&&((n=R("#text",3)).raw=!!t,h.append(n).value=e);},comment:function(e){h.append(R("#comment",8)).value=e;},pi:function(e,t){h.append(R(e,7)).value=t,D(h);},doctype:function(e){h.append(R("#doctype",10)).value=e,D(h);},start:function(e,n,o){var a=x?t.getElementRule(e):{};if(a){var u=R(a.outputName||e,1);u.attributes=n,u.shortEnded=o,h.append(u);var c=C[h.name];c&&C[u.name]&&!c[u.name]&&v.push(u);for(var s=r.length;s--;){var f=r[s].name;f in n.map&&((g=i[f])?g.push(u):i[f]=[u]);}b[e]&&D(u),o||(h=u),!A&&S[e]&&(A=!0);}},end:function(n){var r,o,i,a,u=x?t.getElementRule(n):{};if(u){if(b[n]&&!A){if((r=h.firstChild)&&3===r.type)if((o=r.value.replace(k,"")).length>0)r.value=o,r=r.next;else for(i=r.next,r.remove(),r=i;r&&3===r.type;)o=r.value,i=r.next,(0===o.length||_.test(o))&&(r.remove(),r=i),r=i;if((r=h.lastChild)&&3===r.type)if((o=r.value.replace(N,"")).length>0)r.value=o,r=r.prev;else for(i=r.prev,r.remove(),r=i;r&&3===r.type;)o=r.value,i=r.prev,(0===o.length||_.test(o))&&(r.remove(),r=i),r=i;}if(A&&S[n]&&(A=!1),u.removeEmpty&&xb(t,y,S,h))return a=h.parent,b[h.name]?h.empty().remove():h.unwrap(),void(h=a);u.paddEmpty&&(function(e){return Cb(e,"#text")&&e.firstChild.value===yo}(h)||xb(t,y,S,h))&&yb(e,c,b,h),h=h.parent;}}},t),O=h=new Om(c.context||e.root_name,11);if(T.parse(u,c.format),x&&v.length&&(c.context?c.invalid=!0:function(e){for(var n=Sb("tr,td,th,tbody,thead,tfoot,table"),r=t.getNonEmptyElements(),o=t.getWhiteSpaceElements(),i=t.getTextBlockElements(),u=t.getSpecialElements(),c=function(e,n){if(void 0===n&&(n=e.parent),u[e.name])e.empty().remove();else {for(var r=0,o=e.children();r<o.length;r++){var i=o[r];t.isValidChild(n.name,i.name)||c(i,n);}e.unwrap();}},s=0;s<e.length;s++){var f=e[s],l=void 0,d=void 0,m=void 0;if(f.parent&&!f.fixed)if(i[f.name]&&"li"===f.parent.name){for(var g=f.next;g&&i[g.name];)g.name="li",g.fixed=!0,f.parent.insert(g,f.parent),g=g.next;f.unwrap();}else {var p=[f];for(l=f.parent;l&&!t.isValidChild(l.name,f.name)&&!n[l.name];l=l.parent)p.push(l);if(l&&p.length>1)if(t.isValidChild(l.name,f.name)){p.reverse();for(var h=d=a(p[0].clone()),v=0;v<p.length-1;v++){t.isValidChild(h.name,p[v].name)?(m=a(p[v].clone()),h.append(m)):m=h;for(var b=p[v].firstChild;b&&b!==p[v+1];){var y=b.next;m.append(b),b=y;}h=m;}xb(t,r,o,d)?l.insert(f,p[0],!0):(l.insert(d,p[0],!0),l.insert(f,d)),l=p[0],(xb(t,r,o,l)||Cb(l,"br"))&&l.empty().remove();}else c(f);else if(f.parent){if("li"===f.name){if((g=f.prev)&&("ul"===g.name||"ol"===g.name)){g.append(f);continue}if((g=f.next)&&("ul"===g.name||"ol"===g.name)){g.insert(f,g.firstChild,!0);continue}f.wrap(a(new Om("ul",1)));continue}t.isValidChild(f.parent.name,"div")&&t.isValidChild("div",f.name)?f.wrap(a(new Om("div",1))):c(f);}}}}(v)),w&&("body"===O.name||c.isRootContent)&&function(){var n=O.firstChild,r=null,o=function(e){e&&((n=e.firstChild)&&3===n.type&&(n.value=n.value.replace(k,"")),(n=e.lastChild)&&3===n.type&&(n.value=n.value.replace(N,"")));};if(t.isValidChild(O.name,w.toLowerCase())){for(;n;){var i=n.next;3===n.type||1===n.type&&"p"!==n.name&&!b[n.name]&&!n.attr("data-mce-type")?(r||((r=R(w,1)).attr(e.forced_root_block_attrs),O.insert(r,n)),r.append(n)):(o(r),r=null),n=i;}o(r);}}(),!c.invalid){for(p in o)if(ye(o,p)){for(g=n[p],d=(s=o[p]).length;d--;)s[d].parent||s.splice(d,1);for(f=0,l=g.length;f<l;f++)g[f](s,p,c);}for(f=0,l=r.length;f<l;f++)if((g=r[f]).name in i){for(d=(s=i[g.name]).length;d--;)s[d].parent||s.splice(d,1);for(d=0,m=g.callbacks.length;d<m;d++)g.callbacks[d](s,g.name,c);}}return O}};return function(e,t){var n=e.schema;t.remove_trailing_brs&&e.addNodeFilter("br",(function(e,r,o){var i,a,u,c,s,f,l,d,m=e.length,g=_t.extend({},n.getBlockElements()),p=n.getNonEmptyElements(),h=n.getWhiteSpaceElements();for(g.body=1,i=0;i<m;i++)if(u=(a=e[i]).parent,g[a.parent.name]&&a===u.lastChild){for(s=a.prev;s;){if("span"!==(f=s.name)||"bookmark"!==s.attr("data-mce-type")){"br"===f&&(a=null);break}s=s.prev;}a&&(a.remove(),xb(n,p,h,u)&&(l=n.getElementRule(u.name))&&(l.removeEmpty?u.remove():l.paddEmpty&&yb(t,o,g,u)));}else {for(c=a;u&&u.firstChild===c&&u.lastChild===c&&(c=u,!g[u.name]);)u=u.parent;c===u&&!0!==t.padd_empty_with_br&&((d=new Om("#text",3)).value=yo,a.replace(d));}})),e.addAttributeFilter("href",(function(e){var n,r,o=e.length;if(!t.allow_unsafe_link_target)for(;o--;){var i=e[o];"a"===i.name&&"_blank"===i.attr("target")&&i.attr("rel",(r=void 0,r=(n=i.attr("rel"))?_t.trim(n):"",/\b(noopener)\b/g.test(r)?r:function(e){return e.split(" ").filter((function(e){return e.length>0})).concat(["noopener"]).sort().join(" ")}(r)));}})),t.allow_html_in_named_anchor||e.addAttributeFilter("id,name",(function(e){for(var t,n,r,o,i=e.length;i--;)if("a"===(o=e[i]).name&&o.firstChild&&!o.attr("href")){r=o.parent,t=o.lastChild;do{n=t.prev,r.insert(t,o),t=n;}while(t)}})),t.fix_list_elements&&e.addNodeFilter("ul,ol",(function(e){for(var t,n,r=e.length;r--;)if("ul"===(n=(t=e[r]).parent).name||"ol"===n.name)if(t.prev&&"li"===t.prev.name)t.prev.append(t);else {var o=new Om("li",1);o.attr("style","list-style-type: none"),t.wrap(o);}})),t.validate&&n.getValidClasses()&&e.addAttributeFilter("class",(function(e){for(var t=n.getValidClasses(),r=e.length;r--;){for(var o=e[r],i=o.attr("class").split(" "),a="",u=0;u<i.length;u++){var c=i[u],s=!1,f=t["*"];f&&f[c]&&(s=!0),f=t[o.name],!s&&f&&f[c]&&(s=!0),s&&(a&&(a+=" "),a+=c);}a.length||(a=null),o.attr("class",a);}})),wb(e,t);}(u,e),function(e,t){t.inline_styles&&lb(e,t);}(u,e),u},Ab=function(e,t,n){return function(e,t){return e&&e.hasEventListeners("PreProcess")&&!t.no_events}(e,n)?function(e,t,n){var r,o=e.dom,i=t.cloneNode(!0),a=document.implementation;if(a.createHTMLDocument){var u=a.createHTMLDocument("");_t.each("BODY"===i.nodeName?i.childNodes:[i],(function(e){u.body.appendChild(u.importNode(e,!0));})),i="BODY"!==i.nodeName?u.body.firstChild:u.body,r=o.doc,o.doc=u;}return function(e,t){e.fire("PreProcess",t);}(e,Re(Re({},n),{node:i})),r&&(o.doc=r),i}(e,t,n):t},Rb=function(e,t,n){-1===_t.inArray(t,n)&&(e.addAttributeFilter(n,(function(e,t){for(var n=e.length;n--;)e[n].attr(t,null);})),t.push(n));},Db=function(e,t,n,r,o){var i=function(e,t,n){return Zm(e,t).serialize(n)}(t,n,r);return function(e,t,n){if(!t.no_events&&e){var r=function(e,t){return e.fire("PostProcess",t)}(e,Re(Re({},t),{content:n}));return r.content}return n}(e,o,i)},Tb=function(e,t){var n=["data-mce-selected"],r=t&&t.dom?t.dom:pu.DOM,o=t&&t.schema?t.schema:Ai(e);e.entity_encoding=e.entity_encoding||"named",e.remove_trailing_brs=!("remove_trailing_brs"in e)||e.remove_trailing_brs;var i=_b(e,o);!function(e,t,n){e.addAttributeFilter("data-mce-tabindex",(function(e,t){for(var n=e.length;n--;){var r=e[n];r.attr("tabindex",r.attr("data-mce-tabindex")),r.attr(t,null);}})),e.addAttributeFilter("src,href,style",(function(e,r){for(var o="data-mce-"+r,i=t.url_converter,a=t.url_converter_scope,u=e.length;u--;){var c=e[u],s=c.attr(o);void 0!==s?(c.attr(r,s.length>0?s:null),c.attr(o,null)):(s=c.attr(r),"style"===r?s=n.serializeStyle(n.parseStyle(s),c.name):i&&(s=i.call(a,s,r,c.name)),c.attr(r,s.length>0?s:null));}})),e.addAttributeFilter("class",(function(e){for(var t=e.length;t--;){var n=e[t],r=n.attr("class");r&&(r=n.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),n.attr("class",r.length>0?r:null));}})),e.addAttributeFilter("data-mce-type",(function(e,t,n){for(var r=e.length;r--;){var o=e[r];if("bookmark"===o.attr("data-mce-type")&&!n.cleanup){var i=I.from(o.firstChild).exists((function(e){return !xo(e.value)}));i?o.unwrap():o.remove();}}})),e.addNodeFilter("noscript",(function(e){for(var t=e.length;t--;){var n=e[t].firstChild;n&&(n.value=bi.decode(n.value));}})),e.addNodeFilter("script,style",(function(e,n){for(var r=function(e){return e.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi,"").replace(/\s*(\/\*\s*\]\]>\s*\*\/(-->)?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")},o=e.length;o--;){var i=e[o],a=i.firstChild?i.firstChild.value:"";if("script"===n){var u=i.attr("type");u&&i.attr("type","mce-no/type"===u?null:u.replace(/^mce\-/,"")),"xhtml"===t.element_format&&a.length>0&&(i.firstChild.value="// <![CDATA[\n"+r(a)+"\n// ]]>");}else "xhtml"===t.element_format&&a.length>0&&(i.firstChild.value="\x3c!--\n"+r(a)+"\n--\x3e");}})),e.addNodeFilter("#comment",(function(e){for(var r=e.length;r--;){var o=e[r];t.preserve_cdata&&0===o.value.indexOf("[CDATA[")?(o.name="#cdata",o.type=4,o.value=n.decode(o.value.replace(/^\[CDATA\[|\]\]$/g,""))):0===o.value.indexOf("mce:protected ")&&(o.name="#text",o.type=3,o.raw=!0,o.value=unescape(o.value).substr(14));}})),e.addNodeFilter("xml:namespace,input",(function(e,t){for(var n=e.length;n--;){var r=e[n];7===r.type?r.remove():1===r.type&&("input"!==t||r.attr("type")||r.attr("type","text"));}})),e.addAttributeFilter("data-mce-type",(function(t){q(t,(function(t){"format-caret"===t.attr("data-mce-type")&&(t.isEmpty(e.schema.getNonEmptyElements())?t.remove():t.unwrap());}));})),e.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-type,data-mce-resize,data-mce-placeholder",(function(e,t){for(var n=e.length;n--;)e[n].attr(t,null);}));}(i,e,r);return {schema:o,addNodeFilter:i.addNodeFilter,addAttributeFilter:i.addAttributeFilter,serialize:function(n,a){void 0===a&&(a={});var u=Re({format:"html"},a),c=Ab(t,n,u),s=function(e,t,n){var r=wo(n.getInner?t.innerHTML:e.getOuterHTML(t));return n.selection||bo(Rt.fromDom(t))?r:_t.trim(r)}(r,c,u),f=function(e,t,n){var r=n.selection?Re({forced_root_block:!1},n):n,o=e.parse(t,r);return function(e){var t=function(e){return e&&"br"===e.name},n=e.lastChild;if(t(n)){var r=n.prev;t(r)&&(n.remove(),r.remove());}}(o),o}(i,s,u);return "tree"===u.format?f:Db(t,e,o,f,u)},addRules:o.addValidElements,setRules:o.setValidElements,addTempAttr:_(Rb,i,n),getTempAttrs:k(n),getNodeFilters:i.getNodeFilters,getAttributeFilters:i.getAttributeFilters}},Ob=function(e,t){var n=Tb(e,t);return {schema:n.schema,addNodeFilter:n.addNodeFilter,addAttributeFilter:n.addAttributeFilter,serialize:n.serialize,addRules:n.addRules,setRules:n.setRules,addTempAttr:n.addTempAttr,getTempAttrs:n.getTempAttrs,getNodeFilters:n.getNodeFilters,getAttributeFilters:n.getAttributeFilters}},Bb=function(e,t){return void 0===t&&(t={}),function(e,t,n){return Qv(e).editor.getContent(t,n)}(e,t,t.format?t.format:"html")},Pb=function(e,t,n){return void 0===n&&(n={}),function(e,t,n){return Qv(e).editor.setContent(t,n)}(e,t,n)},Lb=pu.DOM,Ib=function(e){return I.from(e).each((function(e){return e.destroy()}))},Mb=function(e){if(!e.removed){var t=e._selectionOverrides,n=e.editorUpload,r=e.getBody(),o=e.getElement();r&&e.save({is_removing:!0}),e.removed=!0,e.unbindAllNativeEvents(),e.hasHiddenInput&&o&&Lb.remove(o.nextSibling),function(e){e.fire("remove");}(e),e.editorManager.remove(e),!e.inline&&r&&function(e){Lb.setStyle(e.id,"display",e.orgDisplay);}(e),function(e){e.fire("detach");}(e),Lb.remove(e.getContainer()),Ib(t),Ib(n),e.destroy();}},Fb=function(e,t){var n=e.selection,r=e.dom;e.destroyed||(t||e.removed?(t||(e.editorManager.off("beforeunload",e._beforeUnload),e.theme&&e.theme.destroy&&e.theme.destroy(),Ib(n),Ib(r)),function(e){var t=e.formElement;t&&(t._mceOldSubmit&&(t.submit=t._mceOldSubmit,t._mceOldSubmit=null),Lb.unbind(t,"submit reset",e.formEventDelegate));}(e),function(e){e.contentAreaContainer=e.formElement=e.container=e.editorContainer=null,e.bodyElement=e.contentDocument=e.contentWindow=null,e.iframeElement=e.targetElm=null,e.selection&&(e.selection=e.selection.win=e.selection.dom=e.selection.dom.doc=null);}(e),e.destroyed=!0):e.remove());},Ub=(ib=function(e,t){return d(e)&&d(t)?Ub(e,t):t},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(0===e.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<e.length;r++){var o=e[r];for(var i in o)ye(o,i)&&(n[i]=ib(n[i],o[i]));}return n}),zb="autoresize_on_init,content_editable_state,convert_fonts_to_spans,inline_styles,padd_empty_with_br,block_elements,boolean_attributes,editor_deselector,editor_selector,elements,file_browser_callback_types,filepicker_validator_handler,force_hex_style_colors,force_p_newlines,gecko_spellcheck,images_dataimg_filter,media_scripts,mode,move_caret_before_on_enter_elements,non_empty_elements,self_closing_elements,short_ended_elements,special,spellchecker_select_languages,spellchecker_whitelist,tab_focus,table_responsive_width,text_block_elements,text_inline_elements,toolbar_drawer,types,validate,whitespace_elements,paste_word_valid_elements,paste_retain_style_properties,paste_convert_word_fake_lists".split(","),Hb="bbcode,colorpicker,contextmenu,fullpage,legacyoutput,spellchecker,textcolor".split(","),jb="imagetools,toc".split(","),Vb=function(e){var t=K(zb,(function(t){return ye(e,t)})),n=e.forced_root_block;return !1!==n&&""!==n||t.push("forced_root_block (false only)"),re(t)},qb=function(e){var t=_t.makeMap(e.plugins," "),n=function(e){return ye(t,e)},r=De(De([],K(Hb,n),!0),Z(jb,(function(e){return n(e)?[e+" (moving to premium)"]:[]})),!0);return re(r)},$b=mt().deviceType,Wb=$b.isTouch(),Kb=$b.isPhone(),Xb=$b.isTablet(),Yb=["lists","autolink","autosave"],Gb={table_grid:!1,object_resizing:!1,resize:!1},Jb=function(e){var t=m(e)?e.join(" "):e,n=V(l(t)?t.split(" "):[],Ue);return K(n,(function(e){return e.length>0}))},Qb=function(e,t){var n,r,o=(r={},pe(t,(function(t,n){return H(e,n)}),ge(n={}),ge(r)),{t:n,f:r});return function(e,t){return {sections:k(e),settings:k(t)}}(o.t,o.f)},Zb=function(e,t){return ye(e.sections(),t)},ey=function(e,t){return be(e,"toolbar_mode").orThunk((function(){return be(e,"toolbar_drawer").map((function(e){return !1===e?"wrap":e}))})).getOr(t)},ty=function(e,t){var n={resize:!1,toolbar_mode:ey(e,"scrolling"),toolbar_sticky:!1};return Re(Re(Re({},Gb),n),t?{menubar:!1}:{})},ny=function(e,t){var n=t.external_plugins?t.external_plugins:{};return e&&e.external_plugins?_t.extend({},e.external_plugins,n):n},ry=function(e,t,n,r){return e&&function(e,t,n){var r=e.sections();return Zb(e,t)&&r[t].theme===n}(t,"mobile","mobile")?K(r,_(H,Yb)):e&&Zb(t,"mobile")?r:n},oy=function(e,t,n,r){var o=Jb(n.forced_plugins),i=Jb(r.plugins),a=function(e,t){return Zb(e,t)?e.sections()[t]:{}}(t,"mobile"),u=a.plugins?Jb(a.plugins):i,c=function(e,t){return [].concat(Jb(e)).concat(Jb(t))}(o,ry(e,t,i,u));if(wt.browser.isIE()&&H(c,"rtc"))throw new Error("RTC plugin is not supported on IE 11.");return _t.extend(r,{plugins:c.join(" ")})},iy=function(e,t,n,r,o){var i=e?{mobile:ty(o.mobile||{},t)}:{},a=Qb(["mobile"],Ub(i,o)),u=_t.extend(n,r,a.settings(),function(e,t){return e&&Zb(t,"mobile")}(e,a)?function(e,t,n){void 0===n&&(n={});var r=e.sections(),o=be(r,t).getOr({});return _t.extend({},n,o)}(a,"mobile"):{},{validate:!0,external_plugins:ny(r,a.settings())});return oy(e,a,r,u)},ay=function(e,t,n,r,o){var i=function(e,t,n,r,o){var i={id:t,theme:"silver",toolbar_mode:ey(e,"floating"),plugins:"",document_base_url:n,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"<!DOCTYPE html>",visual:!0,font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,inline_styles:!0,convert_fonts_to_spans:!0,indent:!0,indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",entity_encoding:"named",url_converter:o.convertURL,url_converter_scope:o};return Re(Re({},i),r?Gb:{})}(o,t,n,Wb,e),a=iy(Kb||Xb,Kb,i,r,o);return !1!==a.deprecation_warnings&&function(e,t){var n=Vb(e),r=qb(t),o=r.length>0,i=n.length>0,a="mobile"===t.theme;if(o||i||a){var u="\n- ",c=a?"\n\nThemes:\n- mobile":"",s=o?"\n\nPlugins:\n- "+r.join(u):"",f=i?"\n\nSettings:\n- "+n.join(u):"";console.warn("The following deprecated features are currently enabled, these will be removed in TinyMCE 6.0. See https://www.tiny.cloud/docs/release-notes/6.0-upcoming-changes/ for more information."+c+s+f);}}(o,a),a},uy=function(e,t,n){return I.from(t.settings[n]).filter(e)},cy=function(e,t,n,r){var o,i=t in e.settings?e.settings[t]:n;return "hash"===r?function(e){var t={};return "string"==typeof e?q(e.indexOf("=")>0?e.split(/[;,](?![^=;,]*(?:[;,]|$))/):e.split(","),(function(e){var n=e.split("=");n.length>1?t[_t.trim(n[0])]=_t.trim(n[1]):t[_t.trim(n[0])]=_t.trim(n[0]);})):t=e,t}(i):"string"===r?uy(l,e,t).getOr(n):"number"===r?uy(C,e,t).getOr(n):"boolean"===r?uy(p,e,t).getOr(n):"object"===r?uy(d,e,t).getOr(n):"array"===r?uy(m,e,t).getOr(n):"string[]"===r?uy((o=l,function(e){return m(e)&&ee(e,o)}),e,t).getOr(n):"function"===r?uy(y,e,t).getOr(n):i},sy=(ab={},{add:function(e,t){ab[e]=t;},get:function(e){return ab[e]?ab[e]:{icons:{}}},has:function(e){return ye(ab,e)}}),fy=function(e,t){return t.dom[e]},ly=function(e,t){return parseInt(or(t,e),10)},dy=_(fy,"clientWidth"),my=_(fy,"clientHeight"),gy=_(ly,"margin-top"),py=_(ly,"margin-left"),hy=function(e,t,n){var r,o=Rt.fromDom(e.getBody()),i=e.inline?o:(r=o,Rt.fromDom(qt(r).dom.documentElement)),a=function(e,t,n,r){var o=function(e){return e.dom.getBoundingClientRect()}(t);return {x:n-(e?o.left+t.dom.clientLeft+py(t):0),y:r-(e?o.top+t.dom.clientTop+gy(t):0)}}(e.inline,i,t,n);return function(e,t,n){var r=dy(e),o=my(e);return t>=0&&n>=0&&t<=r&&n<=o}(i,a.x,a.y)},vy=function(e){var t,n=e.inline?e.getBody():e.getContentAreaContainer();return (t=n,I.from(t).map(Rt.fromDom)).map(bn).getOr(!1)},by=function(e){var t=[],n=function(){var t,n=e.theme;return n&&n.getNotificationManagerImpl?n.getNotificationManagerImpl():{open:t=function(){throw new Error("Theme did not provide a NotificationManager implementation.")},close:t,reposition:t,getArgs:t}},r=function(){return I.from(t[0])},o=function(){t.length>0&&n().reposition(t);},i=function(e){Q(t,(function(t){return t===e})).each((function(e){t.splice(e,1);}));},a=function(a,u){if(void 0===u&&(u=!0),!e.removed&&vy(e))return u&&e.fire("BeforeOpenNotification",{notification:a}),J(t,(function(e){return t=n().getArgs(e),r=a,!(t.type!==r.type||t.text!==r.text||t.progressBar||t.timeout||r.progressBar||r.timeout);var t,r;})).getOrThunk((function(){e.editorManager.setActive(e);var u=n().open(a,(function(){i(u),o(),r().fold((function(){return e.focus()}),(function(e){return Rt.fromDom(e.getEl()).dom.focus()}));}));return function(e){t.push(e);}(u),o(),e.fire("OpenNotification",{notification:Re({},u)}),u}))},u=k(t);return function(e){e.on("SkinLoaded",(function(){var t=function(e){return e.getParam("service_message")}(e);t&&a({text:t,type:"warning",timeout:0},!1),o();})),e.on("show ResizeEditor ResizeWindow NodeChange",(function(){ro.requestAnimationFrame(o);})),e.on("remove",(function(){q(t.slice(),(function(e){n().close(e);}));}));}(e),{open:a,close:function(){r().each((function(e){n().close(e),i(e),o();}));},getNotifications:u}},yy=Nu.PluginManager,Cy=Nu.ThemeManager;var xy=function(e){var t=[],n=function(){var t,n=e.theme;return n&&n.getWindowManagerImpl?n.getWindowManagerImpl():{open:t=function(){throw new Error("Theme did not provide a WindowManager implementation.")},openUrl:t,alert:t,confirm:t,close:t,getParams:t,setParams:t}},r=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t?t.apply(e,n):void 0}},o=function(n){t.push(n),function(t){e.fire("OpenWindow",{dialog:t});}(n);},i=function(n){!function(t){e.fire("CloseWindow",{dialog:t});}(n),0===(t=K(t,(function(e){return e!==n}))).length&&e.focus();},a=function(t){e.editorManager.setActive(e),am(e);var n=t();return o(n),n};return e.on("remove",(function(){q(t,(function(e){n().close(e);}));})),{open:function(e,t){return a((function(){return n().open(e,t,i)}))},openUrl:function(e){return a((function(){return n().openUrl(e,i)}))},alert:function(e,t,o){var i=n();i.alert(e,r(o||i,t));},confirm:function(e,t,o){var i=n();i.confirm(e,r(o||i,t));},close:function(){I.from(t[t.length-1]).each((function(e){n().close(e),i(e);}));}}},wy=function(e,t){e.notificationManager.open({type:"error",text:t});},Sy=function(e,t){e._skinLoaded?wy(e,t):e.on("SkinLoaded",(function(){wy(e,t);}));},ky=function(e,t,n){td(e,t,{message:n}),console.error(n);},Ny=function(e,t,n){return n?"Failed to load "+e+": "+n+" from url "+t:"Failed to load "+e+" url: "+t},Ey=function(e,t,n){ky(e,"PluginLoadError",Ny("plugin",t,n));},_y=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=window.console;r&&(r.error?r.error.apply(r,De([e],t,!1)):r.log.apply(r,De([e],t,!1)));},Ay=function(e){return Ry(e,function(e){var t=e.getParam("content_css");return l(t)?V(t.split(","),Ue):m(t)?t:!1===t||e.inline?[]:["default"]}(e))},Ry=function(e,t){var n=e.editorManager.baseURL+"/skins/content",r="content"+e.editorManager.suffix+".css",o=!0===e.inline;return V(t,(function(t){return function(e){return /^[a-z0-9\-]+$/i.test(e)}(t)&&!o?n+"/"+t+"/"+r:e.documentBaseURI.toAbsolute(t)}))},Dy=function(e){e.contentCSS=e.contentCSS.concat(Ay(e),function(e){return Ry(e,gs(e))}(e));},Ty=function(){var e={},t=function(e,t){return {status:e,resultUri:t}},n=function(t){return t in e};return {hasBlobUri:n,getResultUri:function(t){var n=e[t];return n?n.resultUri:null},isPending:function(t){return !!n(t)&&1===e[t].status},isUploaded:function(t){return !!n(t)&&2===e[t].status},markPending:function(n){e[n]=t(1,null);},markUploaded:function(n,r){e[n]=t(2,r);},removeFailed:function(t){delete e[t];},destroy:function(){e={};}}},Oy=0,By=function(e){return e+Oy+++(t=function(){return Math.round(4294967295*Math.random()).toString(36)},"s"+(new Date).getTime().toString(36)+t()+t()+t());var t;},Py=function(e,t){var n={},r=function(e,n,r,o){var i=new XMLHttpRequest;i.open("POST",t.url),i.withCredentials=t.credentials,i.upload.onprogress=function(e){o(e.loaded/e.total*100);},i.onerror=function(){r("Image upload failed due to a XHR Transport error. Code: "+i.status);},i.onload=function(){if(i.status<200||i.status>=300)r("HTTP Error: "+i.status);else {var e,o,a=JSON.parse(i.responseText);if(a&&"string"==typeof a.location)n((e=t.basePath,o=a.location,e?e.replace(/\/$/,"")+"/"+o.replace(/^\//,""):o));else r("Invalid JSON: "+i.responseText);}};var a=new FormData;a.append("file",e.blob(),e.filename()),i.send(a);},o=function(e,t){return {url:t,blobInfo:e,status:!0}},i=function(e,t,n){return {url:"",blobInfo:e,status:!1,error:{message:t,options:n}}},a=function(e,t){_t.each(n[e],(function(e){e(t);})),delete n[e];},u=function(r,u){return r=_t.grep(r,(function(t){return !e.isUploaded(t.blobUri())})),Zr.all(_t.map(r,(function(r){return e.isPending(r.blobUri())?function(e){var t=e.blobUri();return new Zr((function(e){n[t]=n[t]||[],n[t].push(e);}))}(r):function(t,n,r){return e.markPending(t.blobUri()),new Zr((function(u){var c;try{var s=function(){c&&c.close();};n(t,(function(n){s(),e.markUploaded(t.blobUri(),n),a(t.blobUri(),o(t,n)),u(o(t,n));}),(function(n,r){var o=r||{};s(),e.removeFailed(t.blobUri()),a(t.blobUri(),i(t,n,o)),u(i(t,n,o));}),(function(e){e<0||e>100||I.from(c).orThunk((function(){return I.from(r).map(R)})).each((function(t){c=t,t.progressBar.value(e);}));}));}catch(e){u(i(t,e.message,{}));}}))}(r,t.handler,u)})))};return !1===y(t.handler)&&(t.handler=r),{upload:function(e,n){return t.url||t.handler!==r?u(e,n):new Zr((function(e){e([]);}))}}},Ly=function(e){return function(){return e.notificationManager.open({text:e.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0})}},Iy=function(e,t){return Py(t,{url:as(e),basePath:us(e),credentials:cs(e),handler:ss(e)})},My=function(e){var t,n,r=function(){var e=[],t=function(e){if(!e.blob||!e.base64)throw new Error("blob and base64 representations of the image are required for BlobInfo to be created");var t,n=e.id||By("blobid"),r=e.name||n,o=e.blob;return {id:k(n),name:k(r),filename:k(e.filename||r+"."+(t=o.type,{"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png","image/apng":"apng","image/avif":"avif","image/svg+xml":"svg","image/webp":"webp","image/bmp":"bmp","image/tiff":"tiff"}[t.toLowerCase()]||"dat")),blob:k(o),base64:k(e.base64),blobUri:k(e.blobUri||URL.createObjectURL(o)),uri:k(e.uri)}},n=function(t){return J(e,t).getOrUndefined()},r=function(e){return n((function(t){return t.id()===e}))};return {create:function(e,n,r,o,i){if(l(e))return t({id:e,name:o,filename:i,blob:n,base64:r});if(d(e))return t(e);throw new Error("Unknown input type")},add:function(t){r(t.id())||e.push(t);},get:r,getByUri:function(e){return n((function(t){return t.blobUri()===e}))},getByData:function(e,t){return n((function(n){return n.base64()===e&&n.blob().type===t}))},findFirst:n,removeByUri:function(t){e=K(e,(function(e){return e.blobUri()!==t||(URL.revokeObjectURL(e.blobUri()),!1)}));},destroy:function(){q(e,(function(e){URL.revokeObjectURL(e.blobUri());})),e=[];}}}(),o=Ty(),i=[],a=function(e){var t=Cu(null);return e.on("change AddUndo",(function(e){t.set(Re({},e.level));})),{fireIfChanged:function(){var n=e.undoManager.data;ae(n).filter((function(e){return !$v(t.get(),e)})).each((function(t){e.setDirty(!0),e.fire("change",{level:t,lastLevel:oe(n,n.length-2).getOrNull()});}));}}}(e),u=function(t){return function(n){return e.selection?t(n):[]}},c=function(e,t,n){var r=0;do{-1!==(r=e.indexOf(t,r))&&(e=e.substring(0,r)+n+e.substr(r+t.length),r+=n.length-t.length+1);}while(-1!==r);return e},s=function(e,t,n){var r='src="'+n+'"'+(n===wt.transparentSrc?' data-mce-placeholder="1"':"");return e=c(e,'src="'+t+'"',r),e=c(e,'data-mce-src="'+t+'"','data-mce-src="'+n+'"')},f=function(t,n){q(e.undoManager.data,(function(e){"fragmented"===e.type?e.fragments=V(e.fragments,(function(e){return s(e,t,n)})):e.content=s(e.content,t,n);}));},m=function(n){return t||(t=Iy(e,o)),h().then(u((function(o){var i=V(o,(function(e){return e.blobInfo}));return t.upload(i,Ly(e)).then(u((function(t){var i=[],u=V(t,(function(t,n){var a=o[n].blobInfo,u=o[n].image;return t.status&&function(e){return e.getParam("images_replace_blob_uris",!0,"boolean")}(e)?(r.removeByUri(u.src),Gv(e)||function(t,n){var r,o=e.convertURL(n,"src");f(t.src,n),e.$(t).attr({src:os(e)?(r=n,r+(-1===r.indexOf("?")?"?":"&")+(new Date).getTime()):n,"data-mce-src":o});}(u,t.url)):t.error&&(t.error.options.remove&&(f(u.getAttribute("src"),wt.transparentSrc),i.push(u)),function(e,t){Sy(e,ku.translate(["Failed to upload image: {0}",t]));}(e,t.error.message)),{element:u,status:t.status,uploadUri:t.url,blobInfo:a}}));return u.length>0&&a.fireIfChanged(),i.length>0&&(Gv(e)?console.error("Removing images on failed uploads is currently unsupported for RTC"):e.undoManager.transact((function(){q(i,(function(t){e.dom.remove(t),r.removeByUri(t.src);}));}))),n&&n(u),u})))})))},g=function(t){if(rs(e))return m(t)},p=function(t){if(!1===ee(i,(function(e){return e(t)})))return !1;if(0===t.getAttribute("src").indexOf("data:")){var n=function(e){return e.getParam("images_dataimg_filter",O,"function")}(e);return n(t)}return !0},h=function(){return n||(n=bb(o,r)),n.findAll(e.getBody(),p).then(u((function(t){return t=K(t,(function(t){return "string"!=typeof t||(Sy(e,t),!1)})),Gv(e)||q(t,(function(e){f(e.image.src,e.blobInfo.blobUri()),e.image.src=e.blobInfo.blobUri(),e.image.removeAttribute("data-mce-src");})),t})))},v=function(t){return t.replace(/src="(blob:[^"]+)"/g,(function(t,n){var i=o.getResultUri(n);if(i)return 'src="'+i+'"';var a=r.getByUri(n);return a||(a=Y(e.editorManager.get(),(function(e,t){return e||t.editorUpload&&t.editorUpload.blobCache.getByUri(n)}),null)),a?'src="data:'+a.blob().type+";base64,"+a.base64()+'"':t}))};return e.on("SetContent",(function(){rs(e)?g():h();})),e.on("RawSaveContent",(function(e){e.content=v(e.content);})),e.on("GetContent",(function(e){e.source_view||"raw"===e.format||"tree"===e.format||(e.content=v(e.content));})),e.on("PostRender",(function(){e.parser.addNodeFilter("img",(function(e){q(e,(function(e){var t=e.attr("src");if(!r.getByUri(t)){var n=o.getResultUri(t);n&&e.attr("src",n);}}));}));})),{blobCache:r,addFilter:function(e){i.push(e);},uploadImages:m,uploadImagesAuto:g,scanForImages:h,destroy:function(){r.destroy(),o.destroy(),n=t=null;}}},Fy=function(e){var t={},n=function(e,r){e&&(l(e)?(m(r)||(r=[r]),q(r,(function(e){h(e.deep)&&(e.deep=!gl(e)),h(e.split)&&(e.split=!gl(e)||pl(e)),h(e.remove)&&gl(e)&&!pl(e)&&(e.remove="none"),gl(e)&&pl(e)&&(e.mixed=!0,e.block_expand=!0),l(e.classes)&&(e.classes=e.classes.split(/\s+/));})),t[e]=r):le(e,(function(e,t){n(t,e);})));};return n(function(e){var t={valigntop:[{selector:"td,th",styles:{verticalAlign:"top"}}],valignmiddle:[{selector:"td,th",styles:{verticalAlign:"middle"}}],valignbottom:[{selector:"td,th",styles:{verticalAlign:"bottom"}}],alignleft:[{selector:"figure.image",collapsed:!1,classes:"align-left",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"left"},inherit:!1,preview:!1,defaultBlock:"div"},{selector:"img,table,audio,video",collapsed:!1,styles:{float:"left"},preview:"font-family font-size"}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"center"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"figure.image",collapsed:!1,classes:"align-center",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"img,audio,video",collapsed:!1,styles:{display:"block",marginLeft:"auto",marginRight:"auto"},preview:!1},{selector:"table",collapsed:!1,styles:{marginLeft:"auto",marginRight:"auto"},preview:"font-family font-size"}],alignright:[{selector:"figure.image",collapsed:!1,classes:"align-right",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"right"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"img,table,audio,video",collapsed:!1,styles:{float:"right"},preview:"font-family font-size"}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"justify"},inherit:!1,defaultBlock:"div",preview:"font-family font-size"}],bold:[{inline:"strong",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all",preserve_attributes:["class","style"]}],italic:[{inline:"em",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all",preserve_attributes:["class","style"]}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all",preserve_attributes:["class","style"]}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:!0},{inline:"strike",remove:"all",preserve_attributes:["class","style"]},{inline:"s",remove:"all",preserve_attributes:["class","style"]}],forecolor:{inline:"span",styles:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},fontname:{inline:"span",toggle:!1,styles:{fontFamily:"%value"},clear_child_styles:!0},fontsize:{inline:"span",toggle:!1,styles:{fontSize:"%value"},clear_child_styles:!0},lineheight:{selector:"h1,h2,h3,h4,h5,h6,p,li,td,th,div",defaultBlock:"p",styles:{lineHeight:"%value"}},fontsize_class:{inline:"span",attributes:{class:"%value"}},blockquote:{block:"blockquote",wrapper:!0,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},code:{inline:"code"},link:{inline:"a",selector:"a",remove:"all",split:!0,deep:!0,onmatch:function(e,t,n){return Dn(e)&&e.hasAttribute("href")},onformat:function(t,n,r){_t.each(r,(function(n,r){e.setAttrib(t,r,n);}));}},lang:{inline:"span",clear_child_styles:!0,remove_similar:!0,attributes:{lang:"%value","data-mce-lang":function(e){var t;return null!==(t=null==e?void 0:e.customValue)&&void 0!==t?t:null}}},removeformat:[{selector:"b,strong,em,i,font,u,strike,s,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins,small",remove:"all",split:!0,expand:!1,block_expand:!0,deep:!0},{selector:"span",attributes:["style","class"],remove:"empty",split:!0,expand:!1,deep:!0},{selector:"*",attributes:["style","class"],split:!1,expand:!1,deep:!0}]};return _t.each("p h1 h2 h3 h4 h5 h6 div address pre dt dd samp".split(/\s/),(function(e){t[e]={block:e,remove:"all"};})),t}(e.dom)),n(function(e){return e.getParam("formats")}(e)),{get:function(e){return b(e)?t[e]:t},has:function(e){return ye(t,e)},register:n,unregister:function(e){return e&&t[e]&&delete t[e],t}}},Uy=_t.each,zy=pu.DOM,Hy=function(e,t){var n,r,o,i=t&&t.schema||Ai({}),a=function(e){r="string"==typeof e?{name:e,classes:[],attrs:{}}:e;var t=zy.create(r.name);return function(e,t){t.classes.length&&zy.addClass(e,t.classes.join(" ")),zy.setAttribs(e,t.attrs);}(t,r),t},u=function(e,t,n){var r,o,c=t.length>0&&t[0],s=c&&c.name,f=function(e,t){var n="string"!=typeof e?e.nodeName.toLowerCase():e,r=i.getElementRule(n),o=r&&r.parentsRequired;return !(!o||!o.length)&&(t&&-1!==_t.inArray(o,t)?t:o[0])}(e,s);if(f)s===f?(o=t[0],t=t.slice(1)):o=f;else if(c)o=t[0],t=t.slice(1);else if(!n)return e;return o&&(r=a(o)).appendChild(e),n&&(r||(r=zy.create("div")).appendChild(e),_t.each(n,(function(t){var n=a(t);r.insertBefore(n,e);}))),u(r,t,o&&o.siblings)};return e&&e.length?(r=e[0],n=a(r),(o=zy.create("div")).appendChild(u(n,e.slice(1),r.siblings)),o):""},jy=function(e){var t,n={classes:[],attrs:{}};return "*"!==(e=n.selector=_t.trim(e))&&(t=e.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g,(function(e,t,r,o,i){switch(t){case"#":n.attrs.id=r;break;case".":n.classes.push(r);break;case":":-1!==_t.inArray("checked disabled enabled read-only required".split(" "),r)&&(n.attrs[r]=r);}if("["===o){var a=i.match(/([\w\-]+)(?:\=\"([^\"]+))?/);a&&(n.attrs[a[1]]=a[2]);}return ""}))),n.name=t||"div",n},Vy=function(e,t){var n,r,o,i="",a=function(e){var t=e.getParam("preview_styles","font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow");return l(t)?t:""}(e);if(""===a)return "";var u=function(e){return e.replace(/%(\w+)/g,"")};if("string"==typeof t){if(!(t=e.formatter.get(t)))return;t=t[0];}if("preview"in t){var c=be(t,"preview");if(Xn(c,!1))return "";a=c.getOr(a);}n=t.block||t.inline||"span";var s,f=(s=t.selector)&&"string"==typeof s?(s=(s=s.split(/\s*,\s*/)[0]).replace(/\s*(~\+|~|\+|>)\s*/g,"$1"),_t.map(s.split(/(?:>|\s+(?![^\[\]]+\]))/),(function(e){var t=_t.map(e.split(/(?:~\+|~|\+)/),jy),n=t.pop();return t.length&&(n.siblings=t),n})).reverse()):[];f.length?(f[0].name||(f[0].name=n),n=t.selector,r=Hy(f,e)):r=Hy([n],e);var d=zy.select(n,r)[0]||r.firstChild;return Uy(t.styles,(function(e,t){var n=u(e);n&&zy.setStyle(d,t,n);})),Uy(t.attributes,(function(e,t){var n=u(e);n&&zy.setAttrib(d,t,n);})),Uy(t.classes,(function(e){var t=u(e);zy.hasClass(d,t)||zy.addClass(d,t);})),e.fire("PreviewFormats"),zy.setStyles(r,{position:"absolute",left:-65535}),e.getBody().appendChild(r),o=zy.getStyle(e.getBody(),"fontSize",!0),o=/px$/.test(o)?parseInt(o,10):0,Uy(a.split(" "),(function(t){var n=zy.getStyle(d,t,!0);if(!("background-color"===t&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(n)&&(n=zy.getStyle(e.getBody(),t,!0),"#ffffff"===zy.toHex(n).toLowerCase())||"color"===t&&"#000000"===zy.toHex(n).toLowerCase())){if("font-size"===t&&/em|%$/.test(n)){if(0===o)return;n=parseFloat(n)/(/%$/.test(n)?100:1)*o+"px";}"border"===t&&n&&(i+="padding:0 2px;"),i+=t+":"+n+";";}})),e.fire("AfterPreviewFormats"),zy.remove(r),i},qy=function(e){var t=Fy(e),n=Cu(null);return function(e){e.addShortcut("meta+b","","Bold"),e.addShortcut("meta+i","","Italic"),e.addShortcut("meta+u","","Underline");for(var t=1;t<=6;t++)e.addShortcut("access+"+t,"",["FormatBlock",!1,"h"+t]);e.addShortcut("access+7","",["FormatBlock",!1,"p"]),e.addShortcut("access+8","",["FormatBlock",!1,"div"]),e.addShortcut("access+9","",["FormatBlock",!1,"address"]);}(e),Th(e),{get:t.get,has:t.has,register:t.register,unregister:t.unregister,apply:function(t,n,r){!function(e,t,n,r){Zv(e).formatter.apply(t,n,r);}(e,t,n,r);},remove:function(t,n,r,o){!function(e,t,n,r,o){Zv(e).formatter.remove(t,n,r,o);}(e,t,n,r,o);},toggle:function(t,n,r){!function(e,t,n,r){Zv(e).formatter.toggle(t,n,r);}(e,t,n,r);},match:function(t,n,r,o){return function(e,t,n,r,o){return Zv(e).formatter.match(t,n,r,o)}(e,t,n,r,o)},closest:function(t){return function(e,t){return Zv(e).formatter.closest(t)}(e,t)},matchAll:function(t,n){return function(e,t,n){return Zv(e).formatter.matchAll(t,n)}(e,t,n)},matchNode:function(t,n,r,o){return function(e,t,n,r,o){return Zv(e).formatter.matchNode(t,n,r,o)}(e,t,n,r,o)},canApply:function(t){return function(e,t){return Zv(e).formatter.canApply(t)}(e,t)},formatChanged:function(t,r,o,i){return function(e,t,n,r,o,i){return Zv(e).formatter.formatChanged(t,n,r,o,i)}(e,n,t,r,o,i)},getCssText:_(Vy,e)}},$y=function(e){switch(e.toLowerCase()){case"undo":case"redo":case"mcerepaint":case"mcefocus":return !0;default:return !1}},Wy=function(e){var t=Eu(),n=Cu(0),r=Cu(0),o={data:[],typing:!1,beforeChange:function(){!function(e,t,n){Zv(e).undoManager.beforeChange(t,n);}(e,n,t);},add:function(i,a){return function(e,t,n,r,o,i,a){return Zv(e).undoManager.add(t,n,r,o,i,a)}(e,o,r,n,t,i,a)},undo:function(){return function(e,t,n,r){return Zv(e).undoManager.undo(t,n,r)}(e,o,n,r)},redo:function(){return function(e,t,n){return Zv(e).undoManager.redo(t,n)}(e,r,o.data)},clear:function(){!function(e,t,n){Zv(e).undoManager.clear(t,n);}(e,o,r);},reset:function(){!function(e,t){Zv(e).undoManager.reset(t);}(e,o);},hasUndo:function(){return function(e,t,n){return Zv(e).undoManager.hasUndo(t,n)}(e,o,r)},hasRedo:function(){return function(e,t,n){return Zv(e).undoManager.hasRedo(t,n)}(e,o,r)},transact:function(t){return function(e,t,n,r){return Zv(e).undoManager.transact(t,n,r)}(e,o,n,t)},ignore:function(t){!function(e,t,n){Zv(e).undoManager.ignore(t,n);}(e,n,t);},extra:function(t,n){!function(e,t,n,r,o){Zv(e).undoManager.extra(t,n,r,o);}(e,o,r,t,n);}};return Gv(e)||function(e,t,n){var r=Cu(!1),o=function(e){Kv(t,!1,n),t.add({},e);};e.on("init",(function(){t.add();})),e.on("BeforeExecCommand",(function(e){var r=e.command;$y(r)||(Xv(t,n),t.beforeChange());})),e.on("ExecCommand",(function(e){var t=e.command;$y(t)||o(e);})),e.on("ObjectResizeStart cut",(function(){t.beforeChange();})),e.on("SaveContent ObjectResized blur",o),e.on("dragend",o),e.on("keyup",(function(n){var i=n.keyCode;n.isDefaultPrevented()||((i>=33&&i<=36||i>=37&&i<=40||45===i||n.ctrlKey)&&(o(),e.nodeChanged()),46!==i&&8!==i||e.nodeChanged(),r.get()&&t.typing&&!1===$v(Hv(e),t.data[0])&&(!1===e.isDirty()&&(e.setDirty(!0),e.fire("change",{level:t.data[0],lastLevel:null})),e.fire("TypingUndo"),r.set(!1),e.nodeChanged()));})),e.on("keydown",(function(e){var i=e.keyCode;if(!e.isDefaultPrevented())if(i>=33&&i<=36||i>=37&&i<=40||45===i)t.typing&&o(e);else {var a=e.ctrlKey&&!e.altKey||e.metaKey;!(i<16||i>20)||224===i||91===i||t.typing||a||(t.beforeChange(),Kv(t,!0,n),t.add({},e),r.set(!0));}})),e.on("mousedown",(function(e){t.typing&&o(e);})),e.on("input",(function(e){var t;e.inputType&&("insertReplacementText"===e.inputType||"insertText"===(t=e).inputType&&null===t.data||function(e){return "insertFromPaste"===e.inputType||"insertFromDrop"===e.inputType}(e))&&o(e);})),e.on("AddUndo Undo Redo ClearUndos",(function(t){t.isDefaultPrevented()||e.nodeChanged();}));}(e,o,n),function(e){e.addShortcut("meta+z","","Undo"),e.addShortcut("meta+y,meta+shift+z","","Redo");}(e),o},Ky=[9,27,od.HOME,od.END,19,20,44,144,145,33,34,45,16,17,18,91,92,93,od.DOWN,od.UP,od.LEFT,od.RIGHT].concat(wt.browser.isFirefox()?[224]:[]),Xy="data-mce-placeholder",Yy=function(e){return "keydown"===e.type||"keyup"===e.type},Gy=function(e){var t=e.keyCode;return t===od.BACKSPACE||t===od.DELETE},Jy=function(e){var t=e.dom,n=ts(e),r=function(e){return e.getParam("placeholder",Qc.getAttrib(e.getElement(),"placeholder"),"string")}(e),o=function(i,a){if(!function(e){if(Yy(e)){var t=e.keyCode;return !Gy(e)&&(od.metaKeyPressed(e)||e.altKey||t>=112&&t<=123||H(Ky,t))}return !1}(i)){var u=e.getBody(),c=!function(e){return Yy(e)&&!(Gy(e)||"keyup"===e.type&&229===e.keyCode)}(i)&&function(e,t,n){if(ei(Rt.fromDom(t),!1)){var r=""===n,o=t.firstElementChild;return !o||!e.getStyle(t.firstElementChild,"padding-left")&&!e.getStyle(t.firstElementChild,"padding-right")&&(r?!e.isBlock(o):n===o.nodeName.toLowerCase())}return !1}(t,u,n);(""!==t.getAttrib(u,Xy)!==c||a)&&(t.setAttrib(u,Xy,c?r:null),t.setAttrib(u,"aria-placeholder",c?r:null),function(e,t){e.fire("PlaceholderToggle",{state:t});}(e,c),e.on(c?"keydown":"keyup",o),e.off(c?"keyup":"keydown",o));}};r&&e.on("init",(function(t){o(t,!0),e.on("change SetContent ExecCommand",o),e.on("paste",(function(t){return ro.setEditorTimeout(e,(function(){return o(t)}))}));}));},Qy=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,Zy=function(e,t){return Tt(Rt.fromDom(t),function(e){return e.getParam("inline_boundaries_selector","a[href],code,.mce-annotation","string")}(e))},eC=function(e){return "rtl"===pu.DOM.getStyle(e,"direction",!0)||(t=e.textContent,Qy.test(t));var t;},tC=function(e,t,n){var r=function(e,t,n){return K(pu.DOM.getParents(n.container(),"*",t),e)}(e,t,n);return I.from(r[r.length-1])},nC=function(e,t){if(!t)return t;var n=t.container(),r=t.offset();return e?Eo(n)?Fn(n.nextSibling)?Ac(n.nextSibling,0):Ac.after(n):Ro(t)?Ac(n,r+1):t:Eo(n)?Fn(n.previousSibling)?Ac(n.previousSibling,n.previousSibling.data.length):Ac.before(n):Do(t)?Ac(n,r-1):t},rC=_(nC,!0),oC=_(nC,!1),iC=function(e){return mo(e)||po(e)},aC=function(e,t){return Lt(e,t)?Xr(t,iC,function(e){return function(t){return Bt(e,Rt.fromDom(t.dom.parentNode))}}(e)):I.none()},uC=function(e){e.dom.isEmpty(e.getBody())&&(e.setContent(""),function(e){var t=e.getBody(),n=t.firstChild&&e.dom.isBlock(t.firstChild)?t.firstChild:t;e.selection.setCursorLocation(n,0);}(e));},cC=function(e,t){return {from:e,to:t}},sC=function(e,t){var n=Rt.fromDom(e),r=Rt.fromDom(t.container());return aC(n,r).map((function(e){return function(e,t){return {block:e,position:t}}(e,t)}))},fC=function(e,t,n){var r=sC(e,Ac.fromRangeStart(n)),o=r.bind((function(n){return Rf(t,e,n.position).bind((function(n){return sC(e,n).map((function(n){return function(e,t,n){return jn(n.position.getNode())&&!1===ei(n.block)?Of(!1,n.block.dom).bind((function(r){return r.isEqual(n.position)?Rf(t,e,r).bind((function(t){return sC(e,t)})):I.some(n)})).getOr(n):n}(e,t,n)}))}))}));return Yn(r,o,cC).filter((function(e){return function(e){return !1===Bt(e.from.block,e.to.block)}(e)&&function(e){return Wt(e.from.block).bind((function(t){return Wt(e.to.block).filter((function(e){return Bt(t,e)}))})).isSome()}(e)&&function(e){return !1===$n(e.from.block.dom)&&!1===$n(e.to.block.dom)}(e)}))},lC=function(e){var t=Jt(e);return Q(t,so).fold(k(t),(function(e){return t.slice(0,e)}))},dC=function(e){var t=lC(e);return q(t,hn),t},mC=function(e,t){var n=Ng(t,e);return J(n.reverse(),(function(e){return ei(e)})).each(hn)},gC=function(e,t,n,r){if(ei(n))return xg(n),Lf(n.dom);0===K(Yt(r),(function(e){return !ei(e)})).length&&ei(t)&&fn(r,Rt.fromTag("br"));var o=Pf(n.dom,Ac.before(r.dom));return q(dC(t),(function(e){fn(r,e);})),mC(e,t),o},pC=function(e,t,n){if(ei(n))return hn(n),ei(t)&&xg(t),Lf(t.dom);var r=If(n.dom);return q(dC(t),(function(e){mn(n,e);})),mC(e,t),r},hC=function(e,t){return Lt(t,e)?function(e,t){var n=Ng(t,e);return I.from(n[n.length-1])}(t,e):I.none()},vC=function(e,t){Of(e,t.dom).map((function(e){return e.getNode()})).map(Rt.fromDom).filter(lo).each(hn);},bC=function(e,t,n){return vC(!0,t),vC(!1,n),hC(t,n).fold(_(pC,e,t,n),_(gC,e,t,n))},yC=function(e,t,n,r){return t?bC(e,r,n):bC(e,n,r)},CC=function(e,t){var n=Rt.fromDom(e.getBody()),r=function(e,t,n){return n.collapsed?fC(e,t,n):I.none()}(n.dom,t,e.selection.getRng()).bind((function(e){return yC(n,t,e.from.block,e.to.block)}));return r.each((function(t){e.selection.setRng(t.toRange());})),r.isSome()},xC=function(e,t){var n=Rt.fromDom(t),r=_(Bt,e);return Kr(n,vo,r).isSome()},wC=function(e,t){var n=Pf(e.dom,Ac.fromRangeStart(t)).isNone(),r=Bf(e.dom,Ac.fromRangeEnd(t)).isNone();return !function(e,t){return xC(e,t.startContainer)||xC(e,t.endContainer)}(e,t)&&n&&r},SC=function(e){var t=Rt.fromDom(e.getBody()),n=e.selection.getRng();return wC(t,n)?function(e){return e.setContent(""),e.selection.setCursorLocation(),!0}(e):function(e,t){var n=t.getRng();return Yn(aC(e,Rt.fromDom(n.startContainer)),aC(e,Rt.fromDom(n.endContainer)),(function(r,o){return !1===Bt(r,o)&&(n.deleteContents(),yC(e,!0,r,o).each((function(e){t.setRng(e.toRange());})),!0)})).getOr(!1)}(t,e.selection)},kC=function(e,t){return !e.selection.isCollapsed()&&SC(e)},NC=qn,EC=$n,_C=function(e,t,n,r,o){return I.from(t._selectionOverrides.showCaret(e,n,r,o))},AC=function(e,t){return e.fire("BeforeObjectSelected",{target:t}).isDefaultPrevented()?I.none():I.some(function(e){var t=e.ownerDocument.createRange();return t.selectNode(e),t}(t))},RC=function(e,t,n){var r=uf(1,e.getBody(),t),o=Ac.fromRangeStart(r),i=o.getNode();if(Us(i))return _C(1,e,i,!o.isAtEnd(),!1);var a=o.getNode(!0);if(Us(a))return _C(1,e,a,!1,!1);var u=e.dom.getParent(o.getNode(),(function(e){return EC(e)||NC(e)}));return Us(u)?_C(1,e,u,!1,n):I.none()},DC=function(e,t,n){return t.collapsed?RC(e,t,n).getOr(t):t},TC=function(e){return bg(e)||gg(e)},OC=function(e){return yg(e)||pg(e)},BC=function(e,t,n,r,o,i){return _C(r,e,i.getNode(!o),o,!0).each((function(n){if(t.collapsed){var r=t.cloneRange();o?r.setEnd(n.startContainer,n.startOffset):r.setStart(n.endContainer,n.endOffset),r.deleteContents();}else t.deleteContents();e.selection.setRng(n);})),function(e,t){Fn(t)&&0===t.data.length&&e.remove(t);}(e.dom,n),!0},PC=function(e,t){return function(e,t){var n=e.selection.getRng();if(!Fn(n.commonAncestorContainer))return !1;var r=t?Rc.Forwards:Rc.Backwards,o=kf(e.getBody()),i=_(lf,t?o.next:o.prev),a=t?TC:OC,u=sf(r,e.getBody(),n),c=nC(t,i(u));if(!c||!df(u,c))return !1;if(a(c))return BC(e,n,u.getNode(),r,t,c);var s=i(c);return !!(s&&a(s)&&df(c,s))&&BC(e,n,u.getNode(),r,t,s)}(e,t)},LC=kr([{remove:["element"]},{moveToElement:["element"]},{moveToPosition:["position"]}]),IC=function(e,t,n,r){var o=r.getNode(!1===t);return aC(Rt.fromDom(e),Rt.fromDom(n.getNode())).map((function(e){return ei(e)?LC.remove(e.dom):LC.moveToElement(o)})).orThunk((function(){return I.some(LC.moveToElement(o))}))},MC=function(e,t,n){return Rf(t,e,n).bind((function(r){return o=r.getNode(),vo(Rt.fromDom(o))||po(Rt.fromDom(o))||function(e,t,n,r){var o=function(t){return fo(Rt.fromDom(t))&&!Zs(n,r,e)};return cf(!t,n).fold((function(){return cf(t,r).fold(T,o)}),o)}(e,t,n,r)?I.none():t&&$n(r.getNode())||!1===t&&$n(r.getNode(!0))?IC(e,t,n,r):t&&yg(n)||!1===t&&bg(n)?I.some(LC.moveToPosition(r)):I.none();var o;}))},FC=function(e,t,n){return function(e,t){var n=t.getNode(!1===e),r=e?"after":"before";return Dn(n)&&n.getAttribute("data-mce-caret")===r}(t,n)?function(e,t){return e&&$n(t.nextSibling)?I.some(LC.moveToElement(t.nextSibling)):!1===e&&$n(t.previousSibling)?I.some(LC.moveToElement(t.previousSibling)):I.none()}(t,n.getNode(!1===t)).fold((function(){return MC(e,t,n)}),I.some):MC(e,t,n).bind((function(t){return function(e,t,n){return n.fold((function(e){return I.some(LC.remove(e))}),(function(e){return I.some(LC.moveToElement(e))}),(function(n){return Zs(t,n,e)?I.none():I.some(LC.moveToPosition(n))}))}(e,n,t)}))},UC=function(e,t){return I.from(Zl(e.getBody(),t))},zC=function(e,t){var n=e.selection.getNode();return UC(e,n).filter($n).fold((function(){return function(e,t,n){var r=uf(t?1:-1,e,n),o=Ac.fromRangeStart(r),i=Rt.fromDom(e);return !1===t&&yg(o)?I.some(LC.remove(o.getNode(!0))):t&&bg(o)?I.some(LC.remove(o.getNode())):!1===t&&bg(o)&&Mg(i,o)?Fg(i,o).map((function(e){return LC.remove(e.getNode())})):t&&yg(o)&&Ig(i,o)?Ug(i,o).map((function(e){return LC.remove(e.getNode())})):FC(e,t,o)}(e.getBody(),t,e.selection.getRng()).exists((function(n){return n.fold(function(e,t){return function(n){return e._selectionOverrides.hideFakeCaret(),gp(e,t,Rt.fromDom(n)),!0}}(e,t),function(e,t){return function(n){var r=t?Ac.before(n):Ac.after(n);return e.selection.setRng(r.toRange()),!0}}(e,t),function(e){return function(t){return e.selection.setRng(t.toRange()),!0}}(e))}))}),O)},HC=function(e,t){var n=e.selection.getNode();return !(!$n(n)||Wn(n))&&UC(e,n.parentNode).filter($n).fold((function(){var n;return n=Rt.fromDom(e.getBody()),q(Mu(n,".mce-offscreen-selection"),hn),gp(e,t,Rt.fromDom(e.selection.getNode())),uC(e),!0}),O)},jC=function(e){var t=e.dom,n=e.selection,r=Zl(e.getBody(),n.getNode());if(qn(r)&&t.isBlock(r)&&t.isEmpty(r)){var o=t.create("br",{"data-mce-bogus":"1"});t.setHTML(r,""),r.appendChild(o),n.setRng(Ac.before(o).toRange());}return !0},VC=function(e,t){return e.selection.isCollapsed()?zC(e,t):HC(e,t)},qC=function(e,t){return !!e.selection.isCollapsed()&&function(e,t){var n=Ac.fromRangeStart(e.selection.getRng());return Rf(t,e.getBody(),n).filter((function(e){return t?dg(e):mg(e)})).bind((function(e){return I.from(ef(t?0:-1,e))})).exists((function(t){return e.selection.select(t),!0}))}(e,t)},$C=Fn,WC=function(e){return $C(e)&&e.data[0]===Co},KC=function(e){return $C(e)&&e.data[e.data.length-1]===Co},XC=function(e){return e.ownerDocument.createTextNode(Co)},YC=function(e,t){return e?function(e){if($C(e.previousSibling))return KC(e.previousSibling)||e.previousSibling.appendData(Co),e.previousSibling;if($C(e))return WC(e)||e.insertData(0,Co),e;var t=XC(e);return e.parentNode.insertBefore(t,e),t}(t):function(e){if($C(e.nextSibling))return WC(e.nextSibling)||e.nextSibling.insertData(0,Co),e.nextSibling;if($C(e))return KC(e)||e.appendData(Co),e;var t=XC(e);return e.nextSibling?e.parentNode.insertBefore(t,e.nextSibling):e.parentNode.appendChild(t),t}(t)},GC=_(YC,!0),JC=_(YC,!1),QC=function(e,t){return Fn(e.container())?YC(t,e.container()):YC(t,e.getNode())},ZC=function(e,t){var n=t.get();return n&&e.container()===n&&Eo(n)},ex=function(e,t){return t.fold((function(t){Ts(e.get());var n=GC(t);return e.set(n),I.some(Ac(n,n.length-1))}),(function(t){return Lf(t).map((function(t){if(ZC(t,e))return Ac(e.get(),1);Ts(e.get());var n=QC(t,!0);return e.set(n),Ac(n,1)}))}),(function(t){return If(t).map((function(t){if(ZC(t,e))return Ac(e.get(),e.get().length-1);Ts(e.get());var n=QC(t,!1);return e.set(n),Ac(n,n.length-1)}))}),(function(t){Ts(e.get());var n=JC(t);return e.set(n),I.some(Ac(n,1))}))},tx=function(e,t){for(var n=0;n<e.length;n++){var r=e[n].apply(null,t);if(r.isSome())return r}return I.none()},nx=kr([{before:["element"]},{start:["element"]},{end:["element"]},{after:["element"]}]),rx=function(e,t){var n=Qs(t,e);return n||e},ox=function(e,t,n){var r=rC(n),o=rx(t,r.container());return tC(e,o,r).fold((function(){return Bf(o,r).bind(_(tC,e,o)).map((function(e){return nx.before(e)}))}),I.none)},ix=function(e,t){return null===Uf(e,t)},ax=function(e,t,n){return tC(e,t,n).filter(_(ix,t))},ux=function(e,t,n){var r=oC(n);return ax(e,t,r).bind((function(e){return Pf(e,r).isNone()?I.some(nx.start(e)):I.none()}))},cx=function(e,t,n){var r=rC(n);return ax(e,t,r).bind((function(e){return Bf(e,r).isNone()?I.some(nx.end(e)):I.none()}))},sx=function(e,t,n){var r=oC(n),o=rx(t,r.container());return tC(e,o,r).fold((function(){return Pf(o,r).bind(_(tC,e,o)).map((function(e){return nx.after(e)}))}),I.none)},fx=function(e){return !1===eC(dx(e))},lx=function(e,t,n){return tx([ox,ux,cx,sx],[e,t,n]).filter(fx)},dx=function(e){return e.fold(N,N,N,N)},mx=function(e){return e.fold(k("before"),k("start"),k("end"),k("after"))},gx=function(e){return e.fold(nx.before,nx.before,nx.after,nx.after)},px=function(e){return e.fold(nx.start,nx.start,nx.end,nx.end)},hx=function(e,t,n,r,o,i){return Yn(tC(t,n,r),tC(t,n,o),(function(t,r){return t!==r&&function(e,t,n){var r=Qs(t,e),o=Qs(n,e);return r&&r===o}(n,t,r)?nx.after(e?t:r):i})).getOr(i)},vx=function(e,t){return e.fold(O,(function(e){return r=t,!(mx(n=e)===mx(r)&&dx(n)===dx(r));var n,r;}))},bx=function(e,t){return e?t.fold(w(I.some,nx.start),I.none,w(I.some,nx.after),I.none):t.fold(I.none,w(I.some,nx.before),I.none,w(I.some,nx.end))},yx=function(e,t,n,r){var o=nC(e,r),i=lx(t,n,o);return lx(t,n,o).bind(_(bx,e)).orThunk((function(){return function(e,t,n,r,o){var i=nC(e,o);return Rf(e,n,i).map(_(nC,e)).fold((function(){return r.map(gx)}),(function(o){return lx(t,n,o).map(_(hx,e,t,n,i,o)).filter(_(vx,r))})).filter(fx)}(e,t,n,i,r)}))};_(yx,!1),_(yx,!0);var Cx,xx=function(e,t,n){var r=e?1:-1;return t.setRng(Ac(n.container(),n.offset()+r).toRange()),t.getSel().modify("move",e?"forward":"backward","word"),!0},wx=function(e,t){var n=t.selection.getRng(),r=e?Ac.fromRangeEnd(n):Ac.fromRangeStart(n);return !!function(e){return y(e.selection.getSel().modify)}(t)&&(e&&Ro(r)?xx(!0,t.selection,r):!(e||!Do(r))&&xx(!1,t.selection,r))};!function(e){e[e.Br=0]="Br",e[e.Block=1]="Block",e[e.Wrap=2]="Wrap",e[e.Eol=3]="Eol";}(Cx||(Cx={}));var Sx,kx=function(e,t){return e===Rc.Backwards?te(t):t},Nx=function(e,t,n){return e===Rc.Forwards?t.next(n):t.prev(n)},Ex=function(e,t,n,r){return jn(r.getNode(t===Rc.Forwards))?Cx.Br:!1===Zs(n,r)?Cx.Block:Cx.Wrap},_x=function(e,t,n,r){for(var o=kf(n),i=r,a=[];i;){var u=Nx(t,o,i);if(!u)break;if(jn(u.getNode(!1)))return t===Rc.Forwards?{positions:kx(t,a).concat([u]),breakType:Cx.Br,breakAt:I.some(u)}:{positions:kx(t,a),breakType:Cx.Br,breakAt:I.some(u)};if(u.isVisible()){if(e(i,u)){var c=Ex(0,t,i,u);return {positions:kx(t,a),breakType:c,breakAt:I.some(u)}}a.push(u),i=u;}else i=u;}return {positions:kx(t,a),breakType:Cx.Eol,breakAt:I.none()}},Ax=function(e,t,n,r){return t(n,r).breakAt.map((function(r){var o=t(n,r).positions;return e===Rc.Backwards?o.concat(r):[r].concat(o)})).getOr([])},Rx=function(e,t){return Y(e,(function(e,n){return e.fold((function(){return I.some(n)}),(function(r){return Yn(ie(r.getClientRects()),ie(n.getClientRects()),(function(e,o){var i=Math.abs(t-e.left);return Math.abs(t-o.left)<=i?n:r})).or(e)}))}),I.none())},Dx=function(e,t){return ie(t.getClientRects()).bind((function(t){return Rx(e,t.left)}))},Tx=_(_x,Ac.isAbove,-1),Ox=_(_x,Ac.isBelow,1),Bx=_(Ax,-1,Tx),Px=_(Ax,1,Ox),Lx=function(e){var t=function(t){return V(t,(function(t){var n=ec(t);return n.node=e,n}))};if(Dn(e))return t(e.getClientRects());if(Fn(e)){var n=e.ownerDocument.createRange();return n.setStart(e,0),n.setEnd(e,e.data.length),t(n.getClientRects())}},Ix=function(e){return Z(e,Lx)};!function(e){e[e.Up=-1]="Up",e[e.Down=1]="Down";}(Sx||(Sx={}));var Mx,Fx,Ux=function(e,t,n,r,o,i){var a=0,u=[],c=function(r){var i=Ix([r]);-1===e&&(i=i.reverse());for(var c=0;c<i.length;c++){var f=i[c];if(!n(f,s)){if(u.length>0&&t(f,Ae(u))&&a++,f.line=a,o(f))return !0;u.push(f);}}},s=Ae(i.getClientRects());if(!s)return u;var f=i.getNode();return c(f),function(e,t,n,r){for(;r=Js(r,e,Wo,t);)if(n(r))return}(e,r,c,f),u},zx=_(Ux,Sx.Up,rc,oc),Hx=_(Ux,Sx.Down,oc,rc),jx=function(e){return function(t){return function(e,t){return t.line>e}(e,t)}},Vx=function(e){return function(t){return function(e,t){return t.line===e}(e,t)}},qx=$n,$x=Js,Wx=function(e,t){return Math.abs(e.left-t)},Kx=function(e,t){return Math.abs(e.right-t)},Xx=function(e,t){return e>=t.left&&e<=t.right},Yx=function(e,t){return e>=t.top&&e<=t.bottom},Gx=function(e,t,n){return void 0===n&&(n=O),Ee(e,(function(e,r){if(Xx(t,r))return n(r)?r:e;if(Xx(t,e))return n(e)?e:r;var o=Math.min(Wx(e,t),Kx(e,t)),i=Math.min(Wx(r,t),Kx(r,t));return i===o&&Ce(r,"node")&&qx(r.node)||i<o?r:e}))},Jx=function(e,t,n,r,o){var i=$x(r,e,Wo,t,!o);do{if(!i||n(i))return}while(i=$x(i,e,Wo,t))},Qx=function(e,t,n){var r=Ix(function(e){return K(ue(e.getElementsByTagName("*")),zs)}(e)),o=K(r,_(Yx,n)),i=function(e){return !Ln(e.node)&&!Kn(e.node)},a=Gx(o,t,i);if(a){var u=i(a);if(a=Gx(function(e,t,n){void 0===n&&(n=!0);var r=[],o=function(e,n){var o=K(Ix([n]),(function(n){return !e(n,t)}));return r=r.concat(o),0===o.length};return r.push(t),Jx(Sx.Up,e,_(o,rc),t.node,n),Jx(Sx.Down,e,_(o,oc),t.node,n),r}(e,a,u),t,i),a&&zs(a.node))return function(e,t){return {node:e.node,before:Wx(e,t)<Kx(e,t)}}(a,t)}return null},Zx=function(e,t){e.selection.setRng(t),Vd(e,e.selection.getRng());},ew=function(e,t,n){return I.some(DC(e,t,n))},tw=function(e,t,n,r,o,i){var a=t===Rc.Forwards,u=kf(e.getBody()),c=_(lf,a?u.next:u.prev),s=a?r:o;if(!n.collapsed){var f=ac(n);if(i(f))return _C(t,e,f,t===Rc.Backwards,!1)}var l=sf(t,e.getBody(),n);if(s(l))return AC(e,l.getNode(!a));var d=nC(a,c(l)),m=Lo(n);if(!d)return m?I.some(n):I.none();if(s(d))return _C(t,e,d.getNode(!a),a,!1);var g=c(d);return g&&s(g)&&df(d,g)?_C(t,e,g.getNode(!a),a,!1):m?ew(e,d.toRange(),!1):I.none()},nw=function(e,t,n,r,o,i){var a=sf(t,e.getBody(),n),u=Ae(a.getClientRects()),c=t===Sx.Down;if(!u)return I.none();var s,f=(c?Hx:zx)(e.getBody(),jx(1),a),l=K(f,Vx(1)),d=u.left,m=Gx(l,d);if(m&&i(m.node)){var g=Math.abs(d-m.left),p=Math.abs(d-m.right);return _C(t,e,m.node,g<p,!1)}if(s=r(a)?a.getNode():o(a)?a.getNode(!0):ac(n)){var h=function(e,t,n,r){var o,i,a,u,c=kf(t),s=[],f=0,l=function(e){return Ae(e.getClientRects())};1===e?(o=c.next,i=oc,a=rc,u=Ac.after(r)):(o=c.prev,i=rc,a=oc,u=Ac.before(r));var d=l(u);do{if(u.isVisible()){var m=l(u);if(!a(m,d)){s.length>0&&i(m,Ae(s))&&f++;var g=ec(m);if(g.position=u,g.line=f,n(g))return s;s.push(g);}}}while(u=o(u));return s}(t,e.getBody(),jx(1),s),v=Gx(K(h,Vx(1)),d);if(v)return ew(e,v.position.toRange(),!1);if(v=Ae(K(h,Vx(0))))return ew(e,v.position.toRange(),!1)}return 0===l.length?rw(e,c).filter(c?o:r).map((function(t){return DC(e,t.toRange(),!1)})):I.none()},rw=function(e,t){var n=e.selection.getRng(),r=e.getBody();if(t){var o=Ac.fromRangeEnd(n),i=Ox(r,o);return ae(i.positions)}o=Ac.fromRangeStart(n),i=Tx(r,o);return ie(i.positions)},ow=function(e,t,n){return rw(e,t).filter(n).exists((function(t){return e.selection.setRng(t.toRange()),!0}))},iw=function(e,t){var n=e.dom.createRng();n.setStart(t.container(),t.offset()),n.setEnd(t.container(),t.offset()),e.selection.setRng(n);},aw=function(e,t){e?t.setAttribute("data-mce-selected","inline-boundary"):t.removeAttribute("data-mce-selected");},uw=function(e,t,n){return ex(t,n).map((function(t){return iw(e,t),n}))},cw=function(e,t){if(e.selection.isCollapsed()&&!0!==e.composing&&t.get()){var n=Ac.fromRangeStart(e.selection.getRng());Ac.isTextPosition(n)&&!1===function(e){return Ro(e)||Do(e)}(n)&&(iw(e,Ds(t.get(),n)),t.set(null));}},sw=function(e,t,n){return !!ys(e)&&function(e,t,n){var r=e.getBody(),o=Ac.fromRangeStart(e.selection.getRng()),i=_(Zy,e);return yx(n,i,r,o).bind((function(n){return uw(e,t,n)}))}(e,t,n).isSome()},fw=function(e,t,n){return !!ys(t)&&wx(e,t)},lw=function(e){var t=Cu(null),n=_(Zy,e);return e.on("NodeChange",(function(r){!ys(e)||wt.browser.isIE()&&r.initial||(function(e,t,n){var r=V(Mu(Rt.fromDom(t.getRoot()),'*[data-mce-selected="inline-boundary"]'),(function(e){return e.dom})),o=K(r,e),i=K(n,e);q(ne(o,i),_(aw,!1)),q(ne(i,o),_(aw,!0));}(n,e.dom,r.parents),cw(e,t),function(e,t,n,r){if(t.selection.isCollapsed()){var o=K(r,e);q(o,(function(r){var o=Ac.fromRangeStart(t.selection.getRng());lx(e,t.getBody(),o).bind((function(e){return uw(t,n,e)}));}));}}(n,e,t,r.parents));})),t},dw=_(fw,!0),mw=_(fw,!1),gw=function(e,t,n){if(ys(e)){var r=rw(e,t).getOrThunk((function(){var n=e.selection.getRng();return t?Ac.fromRangeEnd(n):Ac.fromRangeStart(n)}));return lx(_(Zy,e),e.getBody(),r).exists((function(t){var r=gx(t);return ex(n,r).exists((function(t){return iw(e,t),!0}))}))}return !1},pw=function(e,t){return function(n){return ex(t,n).exists((function(t){return iw(e,t),!0}))}},hw=function(e,t,n,r){var o=e.getBody(),i=_(Zy,e);e.undoManager.ignore((function(){e.selection.setRng(function(e,t){var n=document.createRange();return n.setStart(e.container(),e.offset()),n.setEnd(t.container(),t.offset()),n}(n,r)),e.execCommand("Delete"),lx(i,o,Ac.fromRangeStart(e.selection.getRng())).map(px).map(pw(e,t));})),e.nodeChanged();},vw=function(e,t,n,r){var o=function(e,t){return Qs(t,e)||e}(e.getBody(),r.container()),i=_(Zy,e),a=lx(i,o,r);return a.bind((function(e){return n?e.fold(k(I.some(px(e))),I.none,k(I.some(gx(e))),I.none):e.fold(I.none,k(I.some(gx(e))),I.none,k(I.some(px(e))))})).map(pw(e,t)).getOrThunk((function(){var u=Df(n,o,r),c=u.bind((function(e){return lx(i,o,e)}));return Yn(a,c,(function(){return tC(i,o,r).exists((function(t){return !!function(e){return Yn(Lf(e),If(e),(function(t,n){var r=nC(!0,t),o=nC(!1,n);return Bf(e,r).forall((function(e){return e.isEqual(o)}))})).getOr(!0)}(t)&&(gp(e,n,Rt.fromDom(t)),!0)}))})).orThunk((function(){return c.bind((function(o){return u.map((function(o){return n?hw(e,t,r,o):hw(e,t,o,r),!0}))}))})).getOr(!1)}))},bw=function(e,t,n){if(e.selection.isCollapsed()&&ys(e)){var r=Ac.fromRangeStart(e.selection.getRng());return vw(e,t,n,r)}return !1},yw=function(e){return 1===tn(e)},Cw=function(e,t,n,r){var o=_(Oh,t),i=V(K(r,o),(function(e){return e.dom}));if(0===i.length)gp(t,e,n);else {var a=function(e,t){var n=Nh(!1),r=Rh(t,n.dom);return fn(Rt.fromDom(e),n),hn(Rt.fromDom(e)),Ac(r,0)}(n.dom,i);t.selection.setRng(a.toRange());}},xw=function(e,t){var n=Rt.fromDom(e.getBody()),r=Rt.fromDom(e.selection.getStart()),o=K(function(e,t){var n=Ng(t,e);return Q(n,so).fold(k(n),(function(e){return n.slice(0,e)}))}(n,r),yw);return ae(o).exists((function(n){var r,i=Ac.fromRangeStart(e.selection.getRng());return !(!function(e,t,n){return Yn(Lf(n),If(n),(function(r,o){var i=nC(!0,r),a=nC(!1,o),u=nC(!1,t);return e?Bf(n,u).exists((function(e){return e.isEqual(a)&&t.isEqual(i)})):Pf(n,u).exists((function(e){return e.isEqual(i)&&t.isEqual(a)}))})).getOr(!0)}(t,i,n.dom)||(r=n,Ff(r.dom)&&Sh(r.dom)))&&(Cw(t,e,n,o),!0)}))},ww=function(e,t){return !!e.selection.isCollapsed()&&xw(e,t)},Sw=function(e,t,n){return e._selectionOverrides.hideFakeCaret(),gp(e,t,Rt.fromDom(n)),!0},kw=function(e,t){return e.selection.isCollapsed()?function(e,t){var n=t?gg:pg,r=t?Rc.Forwards:Rc.Backwards,o=sf(r,e.getBody(),e.selection.getRng());return n(o)?Sw(e,t,o.getNode(!t)):I.from(nC(t,o)).filter((function(e){return n(e)&&df(o,e)})).exists((function(n){return Sw(e,t,n.getNode(!t))}))}(e,t):function(e,t){var n=e.selection.getNode();return !!Kn(n)&&Sw(e,t,n)}(e,t)},Nw=function(e){var t=parseInt(e,10);return isNaN(t)?0:t},Ew=function(e,t){return (e||"table"===It(t)?"margin":"padding")+("rtl"===or(t,"direction")?"-right":"-left")},_w=function(e){var t=Rw(e);return !e.mode.isReadOnly()&&(t.length>1||function(e,t){return ee(t,(function(t){var n=Ew(ms(e),t),r=ar(t,n).map(Nw).getOr(0);return "false"!==e.dom.getContentEditable(t.dom)&&r>0}))}(e,t))},Aw=function(e){return go(e)||po(e)},Rw=function(e){return K((t=e.selection.getSelectedBlocks(),V(t,Rt.fromDom)),(function(e){return !Aw(e)&&!function(e){return Wt(e).exists(Aw)}(e)&&Xr(e,(function(e){return qn(e.dom)||$n(e.dom)})).exists((function(e){return qn(e.dom)}))}));var t;},Dw=function(e,t){var n=e.dom,r=e.selection,o=e.formatter,i=function(e){return e.getParam("indentation","40px","string")}(e),a=/[a-z%]+$/i.exec(i)[0],u=parseInt(i,10),c=ms(e),s=ts(e);e.queryCommandState("InsertUnorderedList")||e.queryCommandState("InsertOrderedList")||""!==s||n.getParent(r.getNode(),n.isBlock)||o.apply("div"),q(Rw(e),(function(e){!function(e,t,n,r,o,i){var a=Ew(n,Rt.fromDom(i));if("outdent"===t){var u=Math.max(0,Nw(i.style[a])-r);e.setStyle(i,a,u?u+o:"");}else u=Nw(i.style[a])+r+o,e.setStyle(i,a,u);}(n,t,c,u,a,e.dom);}));},Tw=function(e,t){if(e.selection.isCollapsed()&&_w(e)){var n=e.dom,r=e.selection.getRng(),o=Ac.fromRangeStart(r),i=n.getParent(r.startContainer,n.isBlock);if(null!==i&&Dg(Rt.fromDom(i),o))return Dw(e,"outdent"),!0}return !1},Ow=function(e,t){e.getDoc().execCommand(t,!1,null);},Bw=function(e,t){e.addCommand("delete",(function(){!function(e,t){Tw(e)||VC(e,!1)||PC(e,!1)||bw(e,t,!1)||CC(e,!1)||qp(e)||qC(e,!1)||kw(e,!1)||kC(e)||ww(e,!1)||(Ow(e,"Delete"),uC(e));}(e,t);})),e.addCommand("forwardDelete",(function(){!function(e,t){VC(e,!0)||PC(e,!0)||bw(e,t,!0)||CC(e,!0)||qp(e)||qC(e,!0)||kw(e,!0)||kC(e)||ww(e,!0)||Ow(e,"ForwardDelete");}(e,t);}));},Pw=function(e){return void 0===e.touches||1!==e.touches.length?I.none():I.some(e.touches[0])},Lw=function(e){var t=Eu(),n=Cu(!1),r=Au((function(t){e.fire("longpress",Re(Re({},t),{type:"longpress"})),n.set(!0);}),400);e.on("touchstart",(function(e){Pw(e).each((function(o){r.cancel();var i={x:o.clientX,y:o.clientY,target:e.target};r.throttle(e),n.set(!1),t.set(i);}));}),!0),e.on("touchmove",(function(o){r.cancel(),Pw(o).each((function(r){t.on((function(o){(function(e,t){var n=Math.abs(e.clientX-t.x),r=Math.abs(e.clientY-t.y);return n>5||r>5})(r,o)&&(t.clear(),n.set(!1),e.fire("longpresscancel"));}));}));}),!0),e.on("touchend touchcancel",(function(o){r.cancel(),"touchcancel"!==o.type&&t.get().filter((function(e){return e.target.isEqualNode(o.target)})).each((function(){n.get()?o.preventDefault():e.fire("tap",Re(Re({},o),{type:"tap"}));}));}),!0);},Iw=function(e,t){return ye(e,t.nodeName)},Mw=function(e,t){return !!Fn(t)||!!Dn(t)&&(!Iw(e,t)&&!Gf(t))},Fw=function(e,t){if(Fn(t)){if(0===t.nodeValue.length)return !0;if(/^\s+$/.test(t.nodeValue)&&(!t.nextSibling||Iw(e,t.nextSibling)))return !0}return !1},Uw=function(e){var t,n,r,o=e.dom,i=e.selection,a=e.schema,u=a.getBlockElements(),c=i.getStart(),s=e.getBody(),f=ts(e);if(c&&Dn(c)&&f){var l=s.nodeName.toLowerCase();if(a.isValidChild(l,f.toLowerCase())&&!function(e,t,n){return j(kg(Rt.fromDom(n),Rt.fromDom(t)),(function(t){return Iw(e,t.dom)}))}(u,s,c)){var d=i.getRng(),m=d.startContainer,g=d.startOffset,p=d.endContainer,h=d.endOffset,v=ym(e);for(c=s.firstChild;c;)if(Mw(u,c)){if(Fw(u,c)){n=c,c=c.nextSibling,o.remove(n);continue}t||(t=o.create(f,ns(e)),c.parentNode.insertBefore(t,c),r=!0),n=c,c=c.nextSibling,t.appendChild(n);}else t=null,c=c.nextSibling;r&&v&&(d.setStart(m,g),d.setEnd(p,h),i.setRng(d),e.nodeChanged());}}},zw=function(e,t){t.hasAttribute("data-mce-caret")&&(Po(t),function(e){e.selection.setRng(e.selection.getRng());}(e),e.selection.scrollIntoView(t));},Hw=function(e,t){var n=function(e){return Jr(Rt.fromDom(e.getBody()),"*[data-mce-caret]").map((function(e){return e.dom})).getOrNull()}(e);if(n)return "compositionstart"===t.type?(t.preventDefault(),t.stopPropagation(),void zw(e,n)):void(Ao(n)&&(zw(e,n),e.undoManager.add()))},jw=$n,Vw=function(e,t,n){var r=kf(e.getBody()),o=_(lf,1===t?r.next:r.prev);if(n.collapsed&&function(e){return ""!==ts(e)}(e)){var i=e.dom.getParent(n.startContainer,"PRE");if(!i)return;if(!o(Ac.fromRangeStart(n))){var a=function(e){var t=e.dom.create(ts(e));return (!wt.ie||wt.ie>=11)&&(t.innerHTML='<br data-mce-bogus="1">'),t}(e);1===t?e.$(i).after(a):e.$(i).before(a),e.selection.select(a,!0),e.selection.collapse();}}},qw=function(e,t){var n=t?Rc.Forwards:Rc.Backwards,r=e.selection.getRng();return function(e,t,n){return tw(t,e,n,bg,yg,jw)}(n,e,r).orThunk((function(){return Vw(e,n,r),I.none()}))},$w=function(e,t){var n=t?1:-1,r=e.selection.getRng();return function(e,t,n){return nw(t,e,n,(function(e){return bg(e)||hg(e)}),(function(e){return yg(e)||vg(e)}),jw)}(n,e,r).orThunk((function(){return Vw(e,n,r),I.none()}))},Ww=function(e,t){return qw(e,t).exists((function(t){return Zx(e,t),!0}))},Kw=function(e,t){return $w(e,t).exists((function(t){return Zx(e,t),!0}))},Xw=function(e,t){return ow(e,t,t?yg:bg)},Yw=function(e){return H(["figcaption"],It(e))},Gw=function(e){var t=document.createRange();return t.setStartBefore(e.dom),t.setEndBefore(e.dom),t},Jw=function(e,t,n){n?mn(e,t):dn(e,t);},Qw=function(e,t,n,r){return ""===t?function(e,t){var n=Rt.fromTag("br");return Jw(e,n,t),Gw(n)}(e,r):function(e,t,n,r){var o=Rt.fromTag(n),i=Rt.fromTag("br");return Zn(o,r),mn(o,i),Jw(e,o,t),Gw(i)}(e,r,t,n)},Zw=function(e,t,n){return t?function(e,t){return Ox(e,t).breakAt.isNone()}(e.dom,n):function(e,t){return Tx(e,t).breakAt.isNone()}(e.dom,n)},eS=function(e,t){var n=Rt.fromDom(e.getBody()),r=Ac.fromRangeStart(e.selection.getRng()),o=ts(e),i=ns(e);return function(e,t){var n=_(Bt,t);return Xr(Rt.fromDom(e.container()),so,n).filter(Yw)}(r,n).exists((function(){if(Zw(n,t,r)){var a=Qw(n,o,i,t);return e.selection.setRng(a),!0}return !1}))},tS=function(e,t){return !!e.selection.isCollapsed()&&eS(e,t)},nS=function(e,t){return Z(function(e){return V(e,(function(e){return Re({shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0,action:x},e)}))}(e),(function(e){return function(e,t){return t.keyCode===e.keyCode&&t.shiftKey===e.shiftKey&&t.altKey===e.altKey&&t.ctrlKey===e.ctrlKey&&t.metaKey===e.metaKey}(e,t)?[e]:[]}))},rS=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return function(){return e.apply(null,t)}},oS=function(e,t){return J(nS(e,t),(function(e){return e.action()}))},iS=function(e,t){var n=t?Rc.Forwards:Rc.Backwards,r=e.selection.getRng();return tw(e,n,r,gg,pg,Kn).exists((function(t){return Zx(e,t),!0}))},aS=function(e,t){var n=t?1:-1,r=e.selection.getRng();return nw(e,n,r,gg,pg,Kn).exists((function(t){return Zx(e,t),!0}))},uS=function(e,t){return ow(e,t,t?pg:gg)},cS=function(e,t,n,r,o){var i=Mu(Rt.fromDom(n),"td,th,caption").map((function(e){return e.dom})),a=K(function(e,t){return Z(t,(function(t){var n=function(e,t){return {left:e.left-t,top:e.top-t,right:e.right+2*t,bottom:e.bottom+2*t,width:e.width+t,height:e.height+t}}(ec(t.getBoundingClientRect()),-1);return [{x:n.left,y:e(n),cell:t},{x:n.right,y:e(n),cell:t}]}))}(e,i),(function(e){return t(e,o)}));return function(e,t,n){return Y(e,(function(e,r){return e.fold((function(){return I.some(r)}),(function(e){var o=Math.sqrt(Math.abs(e.x-t)+Math.abs(e.y-n)),i=Math.sqrt(Math.abs(r.x-t)+Math.abs(r.y-n));return I.some(i<o?r:e)}))}),I.none())}(a,r,o).map((function(e){return e.cell}))},sS=_(cS,(function(e){return e.bottom}),(function(e,t){return e.y<t})),fS=_(cS,(function(e){return e.top}),(function(e,t){return e.y>t})),lS=function(e,t){return ie(t.getClientRects()).bind((function(t){return sS(e,t.left,t.top)})).bind((function(e){return Dx(If(n=e).map((function(e){return Tx(n,e).positions.concat(e)})).getOr([]),t);var n;}))},dS=function(e,t){return ae(t.getClientRects()).bind((function(t){return fS(e,t.left,t.top)})).bind((function(e){return Dx(Lf(n=e).map((function(e){return [e].concat(Ox(n,e).positions)})).getOr([]),t);var n;}))},mS=function(e,t,n){var r=e(t,n);return function(e){return e.breakType===Cx.Wrap&&0===e.positions.length}(r)||!jn(n.getNode())&&function(e){return e.breakType===Cx.Br&&1===e.positions.length}(r)?!function(e,t,n){return n.breakAt.exists((function(n){return e(t,n).breakAt.isSome()}))}(e,t,r):r.breakAt.isNone()},gS=_(mS,Tx),pS=_(mS,Ox),hS=function(e,t,n,r){var o=e.selection.getRng(),i=t?1:-1;return !(!Fs()||!function(e,t,n){var r=Ac.fromRangeStart(t);return Of(!e,n).exists((function(e){return e.isEqual(r)}))}(t,o,n))&&(_C(i,e,n,!t,!1).each((function(t){Zx(e,t);})),!0)},vS=function(e,t){var n=t.getNode(e);return Dn(n)&&"TABLE"===n.nodeName?I.some(n):I.none()},bS=function(e,t,n){var r=vS(!!t,n),o=!1===t;r.fold((function(){return Zx(e,n.toRange())}),(function(r){return Of(o,e.getBody()).filter((function(e){return e.isEqual(n)})).fold((function(){return Zx(e,n.toRange())}),(function(o){return function(e,t,n,r){var o=ts(t);o?t.undoManager.transact((function(){var r=Rt.fromTag(o);Zn(r,ns(t)),mn(r,Rt.fromTag("br")),e?ln(Rt.fromDom(n),r):fn(Rt.fromDom(n),r);var i=t.dom.createRng();i.setStart(r.dom,0),i.setEnd(r.dom,0),Zx(t,i);})):Zx(t,r.toRange());}(t,e,r,n)}))}));},yS=function(e,t,n,r){var o=e.selection.getRng(),i=Ac.fromRangeStart(o),a=e.getBody();if(!t&&gS(r,i)){var u=function(e,t,n){return lS(t,n).orThunk((function(){return ie(n.getClientRects()).bind((function(n){return Rx(Bx(e,Ac.before(t)),n.left)}))})).getOr(Ac.before(t))}(a,n,i);return bS(e,t,u),!0}if(t&&pS(r,i)){u=function(e,t,n){return dS(t,n).orThunk((function(){return ie(n.getClientRects()).bind((function(n){return Rx(Px(e,Ac.after(t)),n.left)}))})).getOr(Ac.after(t))}(a,n,i);return bS(e,t,u),!0}return !1},CS=function(e,t,n){return I.from(e.dom.getParent(e.selection.getNode(),"td,th")).bind((function(r){return I.from(e.dom.getParent(r,"table")).map((function(o){return n(e,t,o,r)}))})).getOr(!1)},xS=function(e,t){return CS(e,t,hS)},wS=function(e,t){return CS(e,t,yS)},SS=function(e,t){e.on("keydown",(function(n){!1===n.isDefaultPrevented()&&function(e,t,n){var r=mt().os;oS([{keyCode:od.RIGHT,action:rS(Ww,e,!0)},{keyCode:od.LEFT,action:rS(Ww,e,!1)},{keyCode:od.UP,action:rS(Kw,e,!1)},{keyCode:od.DOWN,action:rS(Kw,e,!0)},{keyCode:od.RIGHT,action:rS(xS,e,!0)},{keyCode:od.LEFT,action:rS(xS,e,!1)},{keyCode:od.UP,action:rS(wS,e,!1)},{keyCode:od.DOWN,action:rS(wS,e,!0)},{keyCode:od.RIGHT,action:rS(iS,e,!0)},{keyCode:od.LEFT,action:rS(iS,e,!1)},{keyCode:od.UP,action:rS(aS,e,!1)},{keyCode:od.DOWN,action:rS(aS,e,!0)},{keyCode:od.RIGHT,action:rS(sw,e,t,!0)},{keyCode:od.LEFT,action:rS(sw,e,t,!1)},{keyCode:od.RIGHT,ctrlKey:!r.isOSX(),altKey:r.isOSX(),action:rS(dw,e,t)},{keyCode:od.LEFT,ctrlKey:!r.isOSX(),altKey:r.isOSX(),action:rS(mw,e,t)},{keyCode:od.UP,action:rS(tS,e,!1)},{keyCode:od.DOWN,action:rS(tS,e,!0)}],n).each((function(e){n.preventDefault();}));}(e,t,n);}));},kS=function(e,t){e.on("keydown",(function(n){!1===n.isDefaultPrevented()&&function(e,t,n){oS([{keyCode:od.BACKSPACE,action:rS(Tw,e,!1)},{keyCode:od.BACKSPACE,action:rS(VC,e,!1)},{keyCode:od.DELETE,action:rS(VC,e,!0)},{keyCode:od.BACKSPACE,action:rS(PC,e,!1)},{keyCode:od.DELETE,action:rS(PC,e,!0)},{keyCode:od.BACKSPACE,action:rS(bw,e,t,!1)},{keyCode:od.DELETE,action:rS(bw,e,t,!0)},{keyCode:od.BACKSPACE,action:rS(qp,e,!1)},{keyCode:od.DELETE,action:rS(qp,e,!0)},{keyCode:od.BACKSPACE,action:rS(qC,e,!1)},{keyCode:od.DELETE,action:rS(qC,e,!0)},{keyCode:od.BACKSPACE,action:rS(kw,e,!1)},{keyCode:od.DELETE,action:rS(kw,e,!0)},{keyCode:od.BACKSPACE,action:rS(kC,e,!1)},{keyCode:od.DELETE,action:rS(kC,e,!0)},{keyCode:od.BACKSPACE,action:rS(CC,e,!1)},{keyCode:od.DELETE,action:rS(CC,e,!0)},{keyCode:od.BACKSPACE,action:rS(ww,e,!1)},{keyCode:od.DELETE,action:rS(ww,e,!0)}],n).each((function(e){n.preventDefault();}));}(e,t,n);})),e.on("keyup",(function(t){!1===t.isDefaultPrevented()&&function(e,t){oS([{keyCode:od.BACKSPACE,action:rS(jC,e)},{keyCode:od.DELETE,action:rS(jC,e)}],t);}(e,t);}));},NS=function(e,t){var n,r=t,o=e.dom,i=e.schema.getMoveCaretBeforeOnEnterElements();if(t){if(/^(LI|DT|DD)$/.test(t.nodeName)){var a=function(e){for(;e;){if(1===e.nodeType||3===e.nodeType&&e.data&&/[\r\n\s]/.test(e.data))return e;e=e.nextSibling;}}(t.firstChild);a&&/^(UL|OL|DL)$/.test(a.nodeName)&&t.insertBefore(o.doc.createTextNode(yo),t.firstChild);}var u=o.createRng();if(t.normalize(),t.hasChildNodes()){for(var c=new ao(t,t);n=c.current();){if(Fn(n)){u.setStart(n,0),u.setEnd(n,0);break}if(i[n.nodeName.toLowerCase()]){u.setStartBefore(n),u.setEndBefore(n);break}r=n,n=c.next();}n||(u.setStart(r,0),u.setEnd(r,0));}else jn(t)?t.nextSibling&&o.isBlock(t.nextSibling)?(u.setStartBefore(t),u.setEndBefore(t)):(u.setStartAfter(t),u.setEndAfter(t)):(u.setStart(t,0),u.setEnd(t,0));e.selection.setRng(u),Vd(e,u);}},ES=function(e){return I.from(e.dom.getParent(e.selection.getStart(!0),e.dom.isBlock))},_S=function(e,t){return e&&e.parentNode&&e.parentNode.nodeName===t},AS=function(e){return e&&/^(OL|UL|LI)$/.test(e.nodeName)},RS=function(e){var t=e.parentNode;return /^(LI|DT|DD)$/.test(t.nodeName)?t:e},DS=function(e,t,n){for(var r=e[n?"firstChild":"lastChild"];r&&!Dn(r);)r=r[n?"nextSibling":"previousSibling"];return r===t},TS=function(e,t,n,r,o){var i=e.dom,a=e.selection.getRng();if(n!==e.getBody()){var u;AS(u=n)&&AS(u.parentNode)&&(o="LI");var c=o?t(o):i.create("BR");if(DS(n,r,!0)&&DS(n,r,!1))if(_S(n,"LI")){var s=RS(n);i.insertAfter(c,s),!function(e){var t;return (null===(t=e.parentNode)||void 0===t?void 0:t.firstChild)===e}(n)?i.remove(n):i.remove(s);}else i.replace(c,n);else if(DS(n,r,!0))_S(n,"LI")?(i.insertAfter(c,RS(n)),c.appendChild(i.doc.createTextNode(" ")),c.appendChild(n)):n.parentNode.insertBefore(c,n),i.remove(r);else if(DS(n,r,!1))i.insertAfter(c,RS(n)),i.remove(r);else {n=RS(n);var f=a.cloneRange();f.setStartAfter(r),f.setEndAfter(n);var l=f.extractContents();"LI"===o&&function(e,t){return e.firstChild&&e.firstChild.nodeName===t}(l,"LI")?(c=l.firstChild,i.insertAfter(l,n)):(i.insertAfter(l,n),i.insertAfter(c,n)),i.remove(r);}NS(e,c);}},OS=function(e,t){return t&&"A"===t.nodeName&&e.isEmpty(t)},BS=function(e){e.innerHTML='<br data-mce-bogus="1">';},PS=function(e,t){return e.nodeName===t||e.previousSibling&&e.previousSibling.nodeName===t},LS=function(e,t){return t&&e.isBlock(t)&&!/^(TD|TH|CAPTION|FORM)$/.test(t.nodeName)&&!/^(fixed|absolute)/i.test(t.style.position)&&"true"!==e.getContentEditable(t)},IS=function(e,t,n){return !1===Fn(t)?n:e?1===n&&t.data.charAt(n-1)===Co?0:n:n===t.data.length-1&&t.data.charAt(n)===Co?t.data.length:n},MS=function(e,t){var n,r,o=e.getRoot();for(n=t;n!==o&&"false"!==e.getContentEditable(n);)"true"===e.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},FS=function(e,t){var n=ts(e);n&&n.toLowerCase()===t.tagName.toLowerCase()&&function(e,t,n){var r=e.dom;I.from(n.style).map(r.parseStyle).each((function(e){var n=ur(Rt.fromDom(t)),o=Re(Re({},n),e);r.setStyles(t,o);}));var o=I.from(n.class).map((function(e){return e.split(/\s+/)})),i=I.from(t.className).map((function(e){return K(e.split(/\s+/),(function(e){return ""!==e}))}));Yn(o,i,(function(e,n){var o=K(n,(function(t){return !H(e,t)})),i=De(De([],e,!0),o,!0);r.setAttrib(t,"class",i.join(" "));}));var a=["style","class"],u=he(n,(function(e,t){return !H(a,t)}));r.setAttribs(t,u);}(e,t,ns(e));},US=function(e,t){var n,r,o,i,a,u,c,s,f,l,d=e.dom,m=e.schema,g=m.getNonEmptyElements(),p=e.selection.getRng(),h=function(t){var n,o,a,u=r,c=m.getTextInlineElements();if(a=n=t||"TABLE"===s||"HR"===s?d.create(t||f):i.cloneNode(!1),!1===function(e){return e.getParam("keep_styles",!0)}(e))d.setAttrib(n,"style",null),d.setAttrib(n,"class",null);else do{if(c[u.nodeName]){if(Ff(u)||Gf(u))continue;o=u.cloneNode(!1),d.setAttrib(o,"id",""),n.hasChildNodes()?(o.appendChild(n.firstChild),n.appendChild(o)):(a=o,n.appendChild(o));}}while((u=u.parentNode)&&u!==x);return FS(e,n),BS(a),n},v=function(e){var t,n,a=IS(e,r,o);if(Fn(r)&&(e?a>0:a<r.nodeValue.length))return !1;if(r.parentNode===i&&l&&!e)return !0;if(e&&Dn(r)&&r===i.firstChild)return !0;if(PS(r,"TABLE")||PS(r,"HR"))return l&&!e||!l&&e;var u=new ao(r,i);for(Fn(r)&&(e&&0===a?u.prev():e||a!==r.nodeValue.length||u.next());t=u.current();){if(Dn(t)){if(!t.getAttribute("data-mce-bogus")&&(n=t.nodeName.toLowerCase(),g[n]&&"br"!==n))return !1}else if(Fn(t)&&!Xo(t.nodeValue))return !1;e?u.prev():u.next();}return !0},b=function(){a=/^(H[1-6]|PRE|FIGURE)$/.test(s)&&"HGROUP"!==w?h(f):h(),function(e){return e.getParam("end_container_on_empty_block",!1)}(e)&&LS(d,c)&&d.isEmpty(i)?a=d.split(c,i):d.insertAfter(a,i),NS(e,a);};bd(d,p).each((function(e){p.setStart(e.startContainer,e.startOffset),p.setEnd(e.endContainer,e.endOffset);})),r=p.startContainer,o=p.startOffset,f=ts(e);var y=!(!t||!t.shiftKey),C=!(!t||!t.ctrlKey);Dn(r)&&r.hasChildNodes()&&(l=o>r.childNodes.length-1,r=r.childNodes[Math.min(o,r.childNodes.length-1)]||r,o=l&&Fn(r)?r.nodeValue.length:0);var x=MS(d,r);if(x){(f&&!y||!f&&y)&&(r=function(e,t,n,r,o){var i,a,u,c,s,f,l=t||"P",d=e.dom,m=MS(d,r);if(!(a=d.getParent(r,d.isBlock))||!LS(d,a)){if(f=(a=a||m)===e.getBody()||function(e){return e&&/^(TD|TH|CAPTION)$/.test(e.nodeName)}(a)?a.nodeName.toLowerCase():a.parentNode.nodeName.toLowerCase(),!a.hasChildNodes())return i=d.create(l),FS(e,i),a.appendChild(i),n.setStart(i,0),n.setEnd(i,0),i;for(c=r;c.parentNode!==a;)c=c.parentNode;for(;c&&!d.isBlock(c);)u=c,c=c.previousSibling;if(u&&e.schema.isValidChild(f,l.toLowerCase())){for(i=d.create(l),FS(e,i),u.parentNode.insertBefore(i,u),c=u;c&&!d.isBlock(c);)s=c.nextSibling,i.appendChild(c),c=s;n.setStart(r,o),n.setEnd(r,o);}}return r}(e,f,p,r,o)),i=d.getParent(r,d.isBlock),c=i?d.getParent(i.parentNode,d.isBlock):null,s=i?i.nodeName.toUpperCase():"";var w=c?c.nodeName.toUpperCase():"";"LI"!==w||C||(i=c,c=c.parentNode,s=w),/^(LI|DT|DD)$/.test(s)&&d.isEmpty(i)?TS(e,h,c,i,f):f&&i===e.getBody()||(f=f||"P",No(i)?(a=Po(i),d.isEmpty(i)&&BS(i),FS(e,a),NS(e,a)):v()?b():v(!0)?(a=i.parentNode.insertBefore(h(),i),NS(e,PS(i,"HR")?a:i)):(n=function(e){var t=e.cloneRange();return t.setStart(e.startContainer,IS(!0,e.startContainer,e.startOffset)),t.setEnd(e.endContainer,IS(!1,e.endContainer,e.endOffset)),t}(p).cloneRange(),n.setEndAfter(i),function(e){q(Iu(Rt.fromDom(e),zt),(function(e){var t=e.dom;t.nodeValue=wo(t.nodeValue);}));}(u=n.extractContents()),function(e){do{Fn(e)&&(e.nodeValue=e.nodeValue.replace(/^[\r\n]+/,"")),e=e.firstChild;}while(e)}(u),a=u.firstChild,d.insertAfter(u,i),function(e,t,n){var r,o=n,i=[];if(o){for(;o=o.firstChild;){if(e.isBlock(o))return;Dn(o)&&!t[o.nodeName.toLowerCase()]&&i.push(o);}for(r=i.length;r--;)(!(o=i[r]).hasChildNodes()||o.firstChild===o.lastChild&&""===o.firstChild.nodeValue||OS(e,o))&&e.remove(o);}}(d,g,a),function(e,t){t.normalize();var n=t.lastChild;n&&!/^(left|right)$/gi.test(e.getStyle(n,"float",!0))||e.add(t,"br");}(d,i),d.isEmpty(i)&&BS(i),a.normalize(),d.isEmpty(a)?(d.remove(a),b()):(FS(e,a),NS(e,a))),d.setAttrib(a,"id",""),e.fire("NewBlock",{newBlock:a}));}},zS=function(e,t,n){var r=e.dom.createRng();n?(r.setStartBefore(t),r.setEndBefore(t)):(r.setStartAfter(t),r.setEndAfter(t)),e.selection.setRng(r),Vd(e,r);},HS=function(e,t){var n,r,o=e.selection,i=e.dom,a=o.getRng();bd(i,a).each((function(e){a.setStart(e.startContainer,e.startOffset),a.setEnd(e.endContainer,e.endOffset);}));var u=a.startOffset,c=a.startContainer;if(1===c.nodeType&&c.hasChildNodes()){var s=u>c.childNodes.length-1;c=c.childNodes[Math.min(u,c.childNodes.length-1)]||c,u=s&&3===c.nodeType?c.nodeValue.length:0;}var f=i.getParent(c,i.isBlock),l=f?i.getParent(f.parentNode,i.isBlock):null,d=l?l.nodeName.toUpperCase():"",m=!(!t||!t.ctrlKey);"LI"!==d||m||(f=l),c&&3===c.nodeType&&u>=c.nodeValue.length&&(function(e,t,n){for(var r,o=new ao(t,n),i=e.getNonEmptyElements();r=o.next();)if(i[r.nodeName.toLowerCase()]||r.length>0)return !0}(e.schema,c,f)||(n=i.create("br"),a.insertNode(n),a.setStartAfter(n),a.setEndAfter(n),r=!0)),n=i.create("br"),Tc(i,a,n),zS(e,n,r),e.undoManager.add();},jS=function(e,t){var n=Rt.fromTag("br");fn(Rt.fromDom(t),n),e.undoManager.add();},VS=function(e,t){qS(e.getBody(),t)||ln(Rt.fromDom(t),Rt.fromTag("br"));var n=Rt.fromTag("br");ln(Rt.fromDom(t),n),zS(e,n.dom,!1),e.undoManager.add();},qS=function(e,t){return n=Ac.after(t),!!jn(n.getNode())||Bf(e,Ac.after(t)).map((function(e){return jn(e.getNode())})).getOr(!1);var n;},$S=function(e){return e&&"A"===e.nodeName&&"href"in e},WS=function(e){return e.fold(T,$S,$S,T)},KS=function(e,t){t.fold(x,_(jS,e),_(VS,e),x);},XS=function(e,t){var n=function(e){var t=_(Zy,e),n=Ac.fromRangeStart(e.selection.getRng());return lx(t,e.getBody(),n).filter(WS)}(e);n.isSome()?n.each(_(KS,e)):HS(e,t);},YS=function(e,t){return ES(e).filter((function(e){return t.length>0&&Tt(Rt.fromDom(e),t)})).isSome()},GS=kr([{br:[]},{block:[]},{none:[]}]),JS=function(e,t){return function(e){return YS(e,function(e){return e.getParam("no_newline_selector","")}(e))}(e)},QS=function(e){return function(t,n){return ""===ts(t)===e}},ZS=function(e){return function(t,n){return function(e){return ES(e).filter((function(e){return po(Rt.fromDom(e))})).isSome()}(t)===e}},ek=function(e,t){return function(n,r){var o=function(e){return ES(e).fold(k(""),(function(e){return e.nodeName.toUpperCase()}))}(n)===e.toUpperCase();return o===t}},tk=function(e){return ek("pre",e)},nk=function(e){return function(t,n){return function(e){return e.getParam("br_in_pre",!0)}(t)===e}},rk=function(e,t){return function(e){return YS(e,function(e){return e.getParam("br_newline_selector",".mce-toc h2,figcaption,caption")}(e))}(e)},ok=function(e,t){return t},ik=function(e){var t=ts(e),n=function(e,t){var n,r,o=e.getRoot();for(n=t;n!==o&&"false"!==e.getContentEditable(n);)"true"===e.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o}(e.dom,e.selection.getStart());return n&&e.schema.isValidChild(n.nodeName,t||"P")},ak=function(e,t){return function(n,r){return Y(e,(function(e,t){return e&&t(n,r)}),!0)?I.some(t):I.none()}},uk=function(e,t){(function(e,t){return tx([ak([JS],GS.none()),ak([ek("summary",!0)],GS.br()),ak([tk(!0),nk(!1),ok],GS.br()),ak([tk(!0),nk(!1)],GS.block()),ak([tk(!0),nk(!0),ok],GS.block()),ak([tk(!0),nk(!0)],GS.br()),ak([ZS(!0),ok],GS.br()),ak([ZS(!0)],GS.block()),ak([QS(!0),ok,ik],GS.block()),ak([QS(!0)],GS.br()),ak([rk],GS.br()),ak([QS(!1),ok],GS.br()),ak([ik],GS.block())],[e,!(!t||!t.shiftKey)]).getOr(GS.none())})(e,t).fold((function(){XS(e,t);}),(function(){US(e,t);}),x);},ck=function(e){e.on("keydown",(function(t){t.keyCode===od.ENTER&&function(e,t){var n;t.isDefaultPrevented()||(t.preventDefault(),(n=e.undoManager).typing&&(n.typing=!1,n.add()),e.undoManager.transact((function(){!1===e.selection.isCollapsed()&&e.execCommand("Delete"),uk(e,t);})));}(e,t);}));},sk=function(e,t){e.on("keydown",(function(n){!1===n.isDefaultPrevented()&&function(e,t,n){oS([{keyCode:od.END,action:rS(Xw,e,!0)},{keyCode:od.HOME,action:rS(Xw,e,!1)},{keyCode:od.END,action:rS(uS,e,!0)},{keyCode:od.HOME,action:rS(uS,e,!1)},{keyCode:od.END,action:rS(gw,e,!0,t)},{keyCode:od.HOME,action:rS(gw,e,!1,t)}],n).each((function(e){n.preventDefault();}));}(e,t,n);}));},fk=mt().browser,lk=function(e){!function(e){var t=_u((function(){e.composing||Zg(e);}),0);fk.isIE()&&(e.on("keypress",(function(e){t.throttle();})),e.on("remove",(function(e){t.cancel();})));}(e),e.on("input",(function(t){!1===t.isComposing&&Zg(e);}));},dk=mt(),mk=function(e){return e.stopImmediatePropagation()},gk=function(e){return e.keyCode===od.PAGE_UP||e.keyCode===od.PAGE_DOWN},pk=function(e,t,n){n&&!e.get()?t.on("NodeChange",mk,!0):!n&&e.get()&&t.off("NodeChange",mk),e.set(n);},hk=function(e,t){if(!dk.os.isOSX()){var n=Cu(!1);e.on("keydown",(function(t){gk(t)&&pk(n,e,!0);})),e.on("keyup",(function(r){!1===r.isDefaultPrevented()&&function(e,t,n){oS([{keyCode:od.PAGE_UP,action:rS(gw,e,!1,t)},{keyCode:od.PAGE_DOWN,action:rS(gw,e,!0,t)}],n);}(e,t,r),gk(r)&&n.get()&&(pk(n,e,!1),e.nodeChanged());}));}},vk=function(e,t){var n=t.container(),r=t.offset();return Fn(n)?(n.insertData(r,e),I.some(Ac(n,r+e.length))):ff(t).map((function(n){var r=Rt.fromText(e);return t.isAtEnd()?ln(n,r):fn(n,r),Ac(r.dom,e.length)}))},bk=_(vk,yo),yk=_(vk," "),Ck=function(e,t){return function(n){return function(e,t){return !qg(t)&&($g(e,t)||jg(e,t)||Vg(e,t))}(e,n)?bk(t):yk(t)}},xk=function(e){var t=Ac.fromRangeStart(e.selection.getRng()),n=Rt.fromDom(e.getBody());if(e.selection.isCollapsed()){var r=_(Zy,e),o=Ac.fromRangeStart(e.selection.getRng());return lx(r,e.getBody(),o).bind(function(e){return function(t){return t.fold((function(t){return Pf(e.dom,Ac.before(t))}),(function(e){return Lf(e)}),(function(e){return If(e)}),(function(t){return Bf(e.dom,Ac.after(t))}))}}(n)).bind(Ck(n,t)).exists(function(e){return function(t){return e.selection.setRng(t.toRange()),e.nodeChanged(),!0}}(e))}return !1},wk=function(e){e.on("keydown",(function(t){!1===t.isDefaultPrevented()&&function(e,t){oS([{keyCode:od.SPACEBAR,action:rS(xk,e)}],t).each((function(e){t.preventDefault();}));}(e,t);}));},Sk=function(e){var t=lw(e);return function(e){e.on("keyup compositionstart",_(Hw,e));}(e),SS(e,t),kS(e,t),ck(e),wk(e),lk(e),sk(e,t),hk(e,t),t},kk=function(){function e(e){var t;this.lastPath=[],this.editor=e;var n=this;"onselectionchange"in e.getDoc()||e.on("NodeChange click mouseup keyup focus",(function(n){var r=e.selection.getRng(),o={startContainer:r.startContainer,startOffset:r.startOffset,endContainer:r.endContainer,endOffset:r.endOffset};"nodechange"!==n.type&&sd(o,t)||e.fire("SelectionChange"),t=o;})),e.on("contextmenu",(function(){e.fire("SelectionChange");})),e.on("SelectionChange",(function(){var t=e.selection.getStart(!0);!t||!wt.range&&e.selection.isCollapsed()||jl(e)&&!n.isSameElementPath(t)&&e.dom.isChildOf(t,e.getBody())&&e.nodeChanged({selectionChange:!0});})),e.on("mouseup",(function(t){!t.isDefaultPrevented()&&jl(e)&&("IMG"===e.selection.getNode().nodeName?ro.setEditorTimeout(e,(function(){e.nodeChanged();})):e.nodeChanged());}));}return e.prototype.nodeChanged=function(e){var t,n,r,o=this.editor.selection;this.editor.initialized&&o&&!this.editor.getParam("disable_nodechange")&&!this.editor.mode.isReadOnly()&&(r=this.editor.getBody(),(t=o.getStart(!0)||r).ownerDocument===this.editor.getDoc()&&this.editor.dom.isChildOf(t,r)||(t=r),n=[],this.editor.dom.getParent(t,(function(e){if(e===r)return !0;n.push(e);})),(e=e||{}).element=t,e.parents=n,this.editor.fire("NodeChange",e));},e.prototype.isSameElementPath=function(e){var t,n=this.editor.$(e).parentsUntil(this.editor.getBody()).add(e);if(n.length===this.lastPath.length){for(t=n.length;t>=0&&n[t]===this.lastPath[t];t--);if(-1===t)return this.lastPath=n,!0}return this.lastPath=n,!1},e}(),Nk=function(e){!function(e){e.on("click",(function(t){e.dom.getParent(t.target,"details")&&t.preventDefault();}));}(e),function(e){e.parser.addNodeFilter("details",(function(e){q(e,(function(e){e.attr("data-mce-open",e.attr("open")),e.attr("open","open");}));})),e.serializer.addNodeFilter("details",(function(e){q(e,(function(e){var t=e.attr("data-mce-open");e.attr("open",l(t)?t:null),e.attr("data-mce-open",null);}));}));}(e);},Ek=function(e){return Dn(e)&&mo(Rt.fromDom(e))},_k=function(e){e.on("click",(function(t){t.detail>=3&&function(e){var t=e.selection.getRng(),n=Ac.fromRangeStart(t),r=Ac.fromRangeEnd(t);if(Ac.isElementPosition(n)){var o=n.container();Ek(o)&&Lf(o).each((function(e){return t.setStart(e.container(),e.offset())}));}Ac.isElementPosition(r)&&(o=n.container(),Ek(o)&&If(o).each((function(e){return t.setEnd(e.container(),e.offset())})));e.selection.setRng(Wp(t));}(e);}));},Ak=function(e){var t=e.getBoundingClientRect(),n=e.ownerDocument,r=n.documentElement,o=n.defaultView;return {top:t.top+o.pageYOffset-r.clientTop,left:t.left+o.pageXOffset-r.clientLeft}},Rk=function(e,t){return n=function(e){return e.inline?Ak(e.getBody()):{left:0,top:0}}(e),r=function(e){var t=e.getBody();return e.inline?{left:t.scrollLeft,top:t.scrollTop}:{left:0,top:0}}(e),o=function(e,t){if(t.target.ownerDocument!==e.getDoc()){var n=Ak(e.getContentAreaContainer()),r=function(e){var t=e.getBody(),n=e.getDoc().documentElement,r={left:t.scrollLeft,top:t.scrollTop},o={left:t.scrollLeft||n.scrollLeft,top:t.scrollTop||n.scrollTop};return e.inline?r:o}(e);return {left:t.pageX-n.left+r.left,top:t.pageY-n.top+r.top}}return {left:t.pageX,top:t.pageY}}(e,t),{pageX:o.left-n.left+r.left,pageY:o.top-n.top+r.top};var n,r,o;},Dk=$n,Tk=qn,Ok=function(e,t,n,r){var o=e.dom,i=t.cloneNode(!0);o.setStyles(i,{width:n,height:r}),o.setAttrib(i,"data-mce-selected",null);var a=o.create("div",{class:"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return o.setStyles(a,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:n,height:r}),o.setStyles(i,{margin:0,boxSizing:"border-box"}),a.appendChild(i),a},Bk=function(e){e&&e.parentNode&&e.parentNode.removeChild(e);},Pk=function(e,t){return function(n){if(function(e){return 0===e.button}(n)){var r=J(t.dom.getParents(n.target),function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){for(var n=0;n<e.length;n++)if(e[n](t))return !0;return !1}}(Dk,Tk)).getOr(null);if(u=t.getBody(),Dk(c=r)&&c!==u){var o=t.dom.getPos(r),i=t.getBody(),a=t.getDoc().documentElement;e.set({element:r,dragging:!1,screenX:n.screenX,screenY:n.screenY,maxX:(t.inline?i.scrollWidth:a.offsetWidth)-2,maxY:(t.inline?i.scrollHeight:a.offsetHeight)-2,relX:n.pageX-o.x,relY:n.pageY-o.y,width:r.offsetWidth,height:r.offsetHeight,ghost:Ok(t,r,r.offsetWidth,r.offsetHeight)});}}var u,c;}},Lk=function(e,t){return function(n){e.on((function(e){if(e.dragging){if(function(e,t,n){return t!==n&&!e.dom.isChildOf(t,n)&&!Dk(t)}(t,(a=t.selection,3===(u=a.getSel().getRangeAt(0).startContainer).nodeType?u.parentNode:u),e.element)){var r=(o=e.element,(i=o.cloneNode(!0)).removeAttribute("data-mce-selected"),i);t.fire("drop",{clientX:n.clientX,clientY:n.clientY}).isDefaultPrevented()||t.undoManager.transact((function(){Bk(e.element),t.insertContent(t.dom.getOuterHTML(r)),t._selectionOverrides.hideFakeCaret();}));}t.fire("dragend");}var o,i,a,u;})),Ik(e);}},Ik=function(e){e.on((function(e){Bk(e.ghost);})),e.clear();},Mk=function(e){var t=Eu(),n=pu.DOM,r=document,o=Pk(t,e),i=function(e,t){var n=ro.throttle((function(e,n){t._selectionOverrides.hideFakeCaret(),t.selection.placeCaretAt(e,n);}),0);return t.on("remove",n.stop),function(r){return e.on((function(e){var o,i,a=Math.max(Math.abs(r.screenX-e.screenX),Math.abs(r.screenY-e.screenY));if(!e.dragging&&a>10){if(t.fire("dragstart",{target:e.element}).isDefaultPrevented())return;e.dragging=!0,t.focus();}if(e.dragging){var u=function(e,t){return {pageX:t.pageX-e.relX,pageY:t.pageY+5}}(e,Rk(t,r));o=e.ghost,i=t.getBody(),o.parentNode!==i&&i.appendChild(o),function(e,t,n,r,o,i){var a=0,u=0;e.style.left=t.pageX+"px",e.style.top=t.pageY+"px",t.pageX+n>o&&(a=t.pageX+n-o),t.pageY+r>i&&(u=t.pageY+r-i),e.style.width=n-a+"px",e.style.height=r-u+"px";}(e.ghost,u,e.width,e.height,e.maxX,e.maxY),n(r.clientX,r.clientY);}}))}}(t,e),a=Lk(t,e),u=function(e,t){return function(){e.on((function(e){e.dragging&&t.fire("dragend");})),Ik(e);}}(t,e);e.on("mousedown",o),e.on("mousemove",i),e.on("mouseup",a),n.bind(r,"mousemove",i),n.bind(r,"mouseup",u),e.on("remove",(function(){n.unbind(r,"mousemove",i),n.unbind(r,"mouseup",u);})),e.on("keydown",(function(e){e.keyCode===od.ESC&&u();}));},Fk=function(e){Mk(e),function(e){e.on("drop",(function(t){var n=void 0!==t.clientX?e.getDoc().elementFromPoint(t.clientX,t.clientY):null;(Dk(n)||"false"===e.dom.getContentEditableParent(n))&&t.preventDefault();}));}(e),function(e){return e.getParam("block_unsupported_drop",!0,"boolean")}(e)&&function(e){var t=function(t){if(!t.isDefaultPrevented()){var n=t.dataTransfer;n&&(H(n.types,"Files")||n.files.length>0)&&(t.preventDefault(),"drop"===t.type&&Sy(e,"Dropped file type is not supported"));}},n=function(n){dm(e,n.target)&&t(n);},r=function(){var r=pu.DOM,o=e.dom,i=document,a=e.inline?e.getBody():e.getDoc(),u=["drop","dragover"];q(u,(function(e){r.bind(i,e,n),o.bind(a,e,t);})),e.on("remove",(function(){q(u,(function(e){r.unbind(i,e,n),o.unbind(a,e,t);}));}));};e.on("init",(function(){ro.setEditorTimeout(e,r,0);}));}(e);},Uk=qn,zk=$n,Hk=function(e,t){return Zl(e.getBody(),t)},jk=function(e){var t,n=e.selection,r=e.dom,o=r.isBlock,i=e.getBody(),a=Ms(e,i,o,(function(){return ym(e)})),u="sel-"+r.uniqueId(),c="data-mce-selected",s=function(e){return e!==i&&(zk(e)||Kn(e))&&r.isChildOf(e,i)},f=function(e){return bg(e)||yg(e)||gg(e)||pg(e)},l=function(e){e&&n.setRng(e);},d=n.getRng,m=function(t,r,o,i){return void 0===i&&(i=!0),e.fire("ShowCaret",{target:r,direction:t,before:o}).isDefaultPrevented()?null:(i&&n.scrollIntoView(r,-1===t),a.show(o,r))},g=function(e){return _o(e)||Oo(e)||Bo(e)},p=function(e){return g(e.startContainer)||g(e.endContainer)},h=function(t){var n=e.schema.getShortEndedElements(),o=r.createRng(),i=t.startContainer,a=t.startOffset,u=t.endContainer,c=t.endOffset;return ye(n,i.nodeName.toLowerCase())?0===a?o.setStartBefore(i):o.setStartAfter(i):o.setStart(i,a),ye(n,u.nodeName.toLowerCase())?0===c?o.setEndBefore(u):o.setEndAfter(u):o.setEnd(u,c),o},b=function(o){var i=o.cloneNode(!0),a=e.fire("ObjectSelected",{target:o,targetClone:i});if(a.isDefaultPrevented())return null;var s=function(t,o,i){var a=e.$,c=Jr(Rt.fromDom(e.getBody()),"#"+u).fold((function(){return a([])}),(function(e){return a([e.dom])}));0===c.length&&(c=a('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>').attr("id",u)).appendTo(e.getBody());var s=r.createRng();o===i&&wt.ie?(c.empty().append('<p style="font-size: 0" data-mce-bogus="all"> </p>').append(o),s.setStartAfter(c[0].firstChild.firstChild),s.setEndAfter(o)):(c.empty().append(yo).append(o).append(yo),s.setStart(c[0].firstChild,1),s.setEnd(c[0].lastChild,0)),c.css({top:r.getPos(t,e.getBody()).y}),c[0].focus();var f=n.getSel();return f.removeAllRanges(),f.addRange(s),s}(o,a.targetClone,i),f=Rt.fromDom(o);return q(Mu(Rt.fromDom(e.getBody()),"*[data-mce-selected]"),(function(e){Bt(f,e)||nr(e,c);})),r.getAttrib(o,c)||o.setAttribute(c,"1"),t=o,x(),s},y=function(e,t){if(!e)return null;if(e.collapsed){if(!p(e)){var n=t?1:-1,o=sf(n,i,e),a=o.getNode(!t);if(zs(a))return m(n,a,!!t&&!o.isAtEnd(),!1);var u=o.getNode(t);if(zs(u))return m(n,u,!t&&!o.isAtEnd(),!1)}return null}var c=e.startContainer,f=e.startOffset,l=e.endOffset;if(3===c.nodeType&&0===f&&zk(c.parentNode)&&(c=c.parentNode,f=r.nodeIndex(c),c=c.parentNode),1!==c.nodeType)return null;if(l===f+1&&c===e.endContainer){var d=c.childNodes[f];if(s(d))return b(d)}return null},C=function(){t&&t.removeAttribute(c),Jr(Rt.fromDom(e.getBody()),"#"+u).each(hn),t=null;},x=function(){a.hide();};return wt.ceFalse&&!Gv(e)&&function(){e.on("mouseup",(function(t){var n=d();n.collapsed&&hy(e,t.clientX,t.clientY)&&RC(e,n,!1).each(l);})),e.on("click",(function(t){var o=Hk(e,t.target);o&&(zk(o)&&(t.preventDefault(),e.focus()),Uk(o)&&r.isChildOf(o,n.getNode())&&C());})),e.on("blur NewBlock",C),e.on("ResizeWindow FullscreenStateChanged",a.reposition);var c=function(t,n){var i,a,u=r.getParent(t,o),c=r.getParent(n,o);return !v(u)&&(!(t===c||!r.isChildOf(u,c)||!1!==zk(Hk(e,u)))||!r.isChildOf(c,u)&&(i=u,a=c,!(r.getParent(i,o)===r.getParent(a,o)))&&function(e){var t=e.firstChild;if(v(t))return !1;var n=Ac.before(t);if(jn(n.getNode())&&1===e.childNodes.length)return !f(n);var r=kf(e).next(n);return r&&!f(r)}(u))};e.on("tap",(function(t){var n=t.target,r=Hk(e,n);zk(r)?(t.preventDefault(),AC(e,r).each(y)):s(n)&&AC(e,n).each(y);}),!0),e.on("mousedown",(function(t){var o=t.target;if((o===i||"HTML"===o.nodeName||r.isChildOf(o,i))&&!1!==hy(e,t.clientX,t.clientY)){var a=Hk(e,o);if(a)zk(a)?(t.preventDefault(),AC(e,a).each(y)):(C(),Uk(a)&&t.shiftKey||ed(t.clientX,t.clientY,n.getRng())||(x(),n.placeCaretAt(t.clientX,t.clientY)));else if(s(o))AC(e,o).each(y);else if(!1===zs(o)){C(),x();var u=Qx(i,t.clientX,t.clientY);if(u&&!c(o,u.node)){t.preventDefault();var f=m(1,u.node,u.before,!1);l(f),e.getBody().focus();}}}})),e.on("keypress",(function(e){od.modifierPressed(e)||zk(n.getNode())&&e.preventDefault();})),e.on("GetSelectionRange",(function(e){var n=e.range;if(t){if(!t.parentNode)return void(t=null);(n=n.cloneRange()).selectNode(t),e.range=n;}})),e.on("SetSelectionRange",(function(e){e.range=h(e.range);var t=y(e.range,e.forward);t&&(e.range=t);})),e.on("AfterSetSelectionRange",(function(e){var t,n=e.range,o=n.startContainer.parentNode;p(n)||"mcepastebin"===o.id||x(),t=o,r.hasClass(t,"mce-offscreen-selection")||C();})),e.on("copy",(function(e){var t,n=e.clipboardData;if(!e.isDefaultPrevented()&&e.clipboardData&&!wt.ie){var o=(t=r.get(u))?t.getElementsByTagName("*")[0]:t;o&&(e.preventDefault(),n.clearData(),n.setData("text/html",o.outerHTML),n.setData("text/plain",o.outerText||o.innerText));}})),Fk(e),function(e){var t=_u((function(){if(!e.removed&&e.getBody().contains(document.activeElement)){var t=e.selection.getRng();if(t.collapsed){var n=DC(e,t,!1);e.selection.setRng(n);}}}),0);e.on("focus",(function(){t.throttle();})),e.on("blur",(function(){t.cancel();}));}(e),function(e){e.on("init",(function(){e.on("focusin",(function(t){var n=t.target;if(Kn(n)){var r=Zl(e.getBody(),n),o=$n(r)?r:n;e.selection.getNode()!==o&&AC(e,o).each((function(t){return e.selection.setRng(t)}));}}));}));}(e);}(),{showCaret:m,showBlockCaretContainer:function(e){e.hasAttribute("data-mce-caret")&&(Po(e),l(d()),n.scrollIntoView(e));},hideFakeCaret:x,destroy:function(){a.destroy(),t=null;}}},Vk=function(e){var t,n,r=_t.each,o=od.BACKSPACE,i=od.DELETE,a=e.dom,u=e.selection,c=e.parser,s=wt.gecko,f=wt.ie,l=wt.webkit,d="data:text/mce-internal,",m=f?"Text":"URL",g=function(t,n){try{e.getDoc().execCommand(t,!1,n);}catch(e){}},p=function(e){return e.isDefaultPrevented()},h=function(){var t=function(e){var t=a.create("body"),n=e.cloneContents();return t.appendChild(n),u.serializer.serialize(t,{format:"html"})};e.on("keydown",(function(n){var r,u,c=n.keyCode;if(!p(n)&&(c===i||c===o)){if(r=e.selection.isCollapsed(),u=e.getBody(),r&&!a.isEmpty(u))return;if(!r&&!function(n){var r=t(n),o=a.createRng();return o.selectNode(e.getBody()),r===t(o)}(e.selection.getRng()))return;n.preventDefault(),e.setContent(""),u.firstChild&&a.isBlock(u.firstChild)?e.selection.setCursorLocation(u.firstChild,0):e.selection.setCursorLocation(u,0),e.nodeChanged();}}));},v=function(){e.shortcuts.add("meta+a",null,"SelectAll");},b=function(){e.inline||a.bind(e.getDoc(),"mousedown mouseup",(function(t){var n;if(t.target===e.getDoc().documentElement)if(n=u.getRng(),e.getBody().focus(),"mousedown"===t.type){if(_o(n.startContainer))return;u.placeCaretAt(t.clientX,t.clientY);}else u.setRng(n);}));},y=function(){Range.prototype.getClientRects||e.on("mousedown",(function(t){if(!p(t)&&"HTML"===t.target.nodeName){var n=e.getBody();n.blur(),ro.setEditorTimeout(e,(function(){n.focus();}));}}));},C=function(){e.on("click",(function(t){var n=t.target;/^(IMG|HR)$/.test(n.nodeName)&&"false"!==a.getContentEditableParent(n)&&(t.preventDefault(),e.selection.select(n),e.nodeChanged()),"A"===n.nodeName&&a.hasClass(n,"mce-item-anchor")&&(t.preventDefault(),u.select(n));}));},w=function(){e.on("keydown",(function(e){if(!p(e)&&e.keyCode===o&&u.isCollapsed()&&0===u.getRng().startOffset){var t=u.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}}));},S=function(){(function(e){return e.getParam("readonly")})(e)||e.on("BeforeExecCommand mousedown",(function(){g("StyleWithCSS",!1),g("enableInlineTableEditing",!1),ps(e)||g("enableObjectResizing",!1);}));},k=function(){e.on("SetContent ExecCommand",(function(e){"setcontent"!==e.type&&"mceInsertLink"!==e.command||r(a.select("a"),(function(e){var t=e.parentNode,n=a.getRoot();if(t.lastChild===e){for(;t&&!a.isBlock(t);){if(t.parentNode.lastChild!==t||t===n)return;t=t.parentNode;}a.add(t,"br",{"data-mce-bogus":1});}}));}));},N=function(){e.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}");},E=function(){e.inline||e.on("keydown",(function(){document.activeElement===document.body&&e.getWin().focus();}));},_=function(){e.inline||(e.contentStyles.push("body {min-height: 150px}"),e.on("click",(function(t){var n;if("HTML"===t.target.nodeName){if(wt.ie>11)return void e.getBody().focus();n=e.selection.getRng(),e.getBody().focus(),e.selection.setRng(n),e.selection.normalize(),e.nodeChanged();}})));},A=function(){wt.mac&&e.on("keydown",(function(t){!od.metaKeyPressed(t)||t.shiftKey||37!==t.keyCode&&39!==t.keyCode||(t.preventDefault(),e.selection.getSel().modify("move",37===t.keyCode?"backward":"forward","lineboundary"));}));},R=function(){e.on("click",(function(e){var t=e.target;do{if("A"===t.tagName)return void e.preventDefault()}while(t=t.parentNode)})),e.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}");},D=function(){e.on("init",(function(){e.dom.bind(e.getBody(),"submit",(function(e){e.preventDefault();}));}));},T=function(){e.on("dragstart",(function(t){!function(t){var n,r;t.dataTransfer&&(e.selection.isCollapsed()&&"IMG"===t.target.tagName&&u.select(t.target),(n=e.selection.getContent()).length>0&&(r=d+escape(e.id)+","+escape(n),t.dataTransfer.setData(m,r)));}(t);})),e.on("drop",(function(t){if(!p(t)){var n=function(e){var t;return e.dataTransfer&&(t=e.dataTransfer.getData(m))&&t.indexOf(d)>=0?(t=t.substr(d.length).split(","),{id:unescape(t[0]),html:unescape(t[1])}):null}(t);if(n&&n.id!==e.id){t.preventDefault();var r=cd(t.x,t.y,e.getDoc());u.setRng(r),o=n.html,i=!0,e.queryCommandSupported("mceInsertClipboardContent")?e.execCommand("mceInsertClipboardContent",!1,{content:o,internal:i}):e.execCommand("mceInsertContent",!1,o);}}var o,i;}));},O=x;return Gv(e)?(l&&(b(),C(),D(),v(),wt.iOS&&(E(),_(),R())),s&&(y(),S(),N(),A())):(e.on("keydown",(function(t){var n,r;if(!p(t)&&t.keyCode===od.BACKSPACE){var o=(n=u.getRng()).startContainer,i=n.startOffset,c=a.getRoot();if(r=o,n.collapsed&&0===i){for(;r&&r.parentNode&&r.parentNode.firstChild===r&&r.parentNode!==c;)r=r.parentNode;"BLOCKQUOTE"===r.tagName&&(e.formatter.toggle("blockquote",null,r),(n=a.createRng()).setStart(o,0),n.setEnd(o,0),u.setRng(n));}}})),h(),wt.windowsPhone||e.on("keyup focusin mouseup",(function(e){od.modifierPressed(e)||u.normalize();}),!0),l&&(b(),C(),ts(e)&&e.on("init",(function(){g("DefaultParagraphSeparator",ts(e));})),D(),w(),c.addNodeFilter("br",(function(e){for(var t=e.length;t--;)"Apple-interchange-newline"===e[t].attr("class")&&e[t].remove();})),wt.iOS?(E(),_(),R()):v()),wt.ie>=11&&(_(),w()),wt.ie&&(v(),g("AutoUrlDetect",!1),T()),s&&(e.on("keydown",(function(t){if(!p(t)&&t.keyCode===o){if(!e.getBody().getElementsByTagName("hr").length)return;if(u.isCollapsed()&&0===u.getRng().startOffset){var n=u.getNode(),r=n.previousSibling;if("HR"===n.nodeName)return a.remove(n),void t.preventDefault();r&&r.nodeName&&"hr"===r.nodeName.toLowerCase()&&(a.remove(r),t.preventDefault());}}})),y(),t=function(){var t=a.getAttribs(u.getStart().cloneNode(!1));return function(){var n=u.getStart();n!==e.getBody()&&(a.setAttrib(n,"style",null),r(t,(function(e){n.setAttributeNode(e.cloneNode(!0));})));}},n=function(){return !u.isCollapsed()&&a.getParent(u.getStart(),a.isBlock)!==a.getParent(u.getEnd(),a.isBlock)},e.on("keypress",(function(r){var o;if(!p(r)&&(8===r.keyCode||46===r.keyCode)&&n())return o=t(),e.getDoc().execCommand("delete",!1,null),o(),r.preventDefault(),!1})),a.bind(e.getDoc(),"cut",(function(r){var o;!p(r)&&n()&&(o=t(),ro.setEditorTimeout(e,(function(){o();})));})),S(),k(),N(),A(),w())),{refreshContentEditable:O,isHidden:function(){if(!s||e.removed)return !1;var t=e.selection.getSel();return !t||!t.rangeCount||0===t.rangeCount}}},qk=pu.DOM,$k=function(e){return e.inline?e.getElement().nodeName.toLowerCase():void 0},Wk=function(e){return he(e,(function(e){return !1===h(e)}))},Kk=function(e){var t=e.settings,n=e.editorUpload.blobCache;return Wk({allow_conditional_comments:t.allow_conditional_comments,allow_html_data_urls:t.allow_html_data_urls,allow_svg_data_urls:t.allow_svg_data_urls,allow_html_in_named_anchor:t.allow_html_in_named_anchor,allow_script_urls:t.allow_script_urls,allow_unsafe_link_target:t.allow_unsafe_link_target,convert_fonts_to_spans:t.convert_fonts_to_spans,fix_list_elements:t.fix_list_elements,font_size_legacy_values:t.font_size_legacy_values,forced_root_block:t.forced_root_block,forced_root_block_attrs:t.forced_root_block_attrs,padd_empty_with_br:t.padd_empty_with_br,preserve_cdata:t.preserve_cdata,remove_trailing_brs:t.remove_trailing_brs,inline_styles:t.inline_styles,root_name:$k(e),validate:!0,blob_cache:n,document:e.getDoc(),images_dataimg_filter:t.images_dataimg_filter})},Xk=function(e){var t=e.dom.getRoot();e.inline||jl(e)&&e.selection.getStart(!0)!==t||Lf(t).each((function(t){var n=t.getNode(),r=Ln(n)?Lf(n).getOr(t):t;wt.browser.isIE()?function(e,t){var n=Rt.fromDom(e.getBody()),r=(nm(e)?I.from(t):I.none()).map(rm).filter(tm(n));e.bookmark=r.isSome()?r:e.bookmark;}(e,r.toRange()):e.selection.setRng(r.toRange());}));},Yk=function(e){e.bindPendingEventDelegates(),e.initialized=!0,function(e){e.fire("Init");}(e),e.focus(!0),Xk(e),e.nodeChanged({initial:!0}),e.execCallback("init_instance_callback",e),function(e){e.settings.auto_focus&&ro.setEditorTimeout(e,(function(){var t;(t=!0===e.settings.auto_focus?e:e.editorManager.get(e.settings.auto_focus)).destroyed||t.focus();}),100);}(e);},Gk=function(e){return e.inline?e.ui.styleSheetLoader:e.dom.styleSheetLoader},Jk=function(e){var t=Gk(e),n=gs(e),r=e.contentCSS,o=function(){t.unloadAll(r),e.inline||e.ui.styleSheetLoader.unloadAll(n);},i=function(){e.removed?o():e.on("remove",o);};if(e.contentStyles.length>0){var a="";_t.each(e.contentStyles,(function(e){a+=e+"\r\n";})),e.dom.addStyle(a);}var u=Zr.all(function(e,t,n){var r=[new Zr((function(n,r){return Gk(e).loadAll(t,n,r)}))];return e.inline?r:r.concat([new Zr((function(t,r){return e.ui.styleSheetLoader.loadAll(n,t,r)}))])}(e,r,n)).then(i).catch(i);return e.settings.content_style&&function(e,t){var n=Rt.fromDom(e.getBody()),r=un(an(n)),o=Rt.fromTag("style");Qn(o,"type","text/css"),mn(o,Rt.fromText(t)),mn(r,o),e.on("remove",(function(){hn(o);}));}(e,e.settings.content_style),u},Qk=function(e){var t=e.settings,n=e.getDoc(),r=e.getBody();!function(e){e.fire("PreInit");}(e),t.browser_spellcheck||t.gecko_spellcheck||(n.body.spellcheck=!1,qk.setAttrib(r,"spellcheck","false")),e.quirks=Vk(e),function(e){e.fire("PostRender");}(e);var o=function(e){return e.getParam("directionality",ku.isRtl()?"rtl":void 0)}(e);void 0!==o&&(r.dir=o),t.protect&&e.on("BeforeSetContent",(function(e){_t.each(t.protect,(function(t){e.content=e.content.replace(t,(function(e){return "\x3c!--mce:protected "+escape(e)+"--\x3e"}));}));})),e.on("SetContent",(function(){e.addVisual(e.getBody());})),e.on("compositionstart compositionend",(function(t){e.composing="compositionstart"===t.type;}));},Zk=function(e){!0!==e.removed&&(!function(e){Gv(e)||e.load({initial:!0,format:"html"}),e.startContent=e.getContent({format:"raw"});}(e),Yk(e));},eN=function(e,t){var n=e.settings,r=e.getElement(),o=e.getDoc();n.inline||(e.getElement().style.visibility=e.orgVisibility),t||e.inline||(o.open(),o.write(e.iframeHTML),o.close()),e.inline&&(qk.addClass(r,"mce-content-body"),e.contentDocument=o=document,e.contentWindow=window,e.bodyElement=r,e.contentAreaContainer=r);var i=e.getBody();i.disabled=!0,e.readonly=!!n.readonly,e.readonly||(e.inline&&"static"===qk.getStyle(i,"position",!0)&&(i.style.position="relative"),i.contentEditable=e.getParam("content_editable_state",!0)),i.disabled=!1,e.editorUpload=My(e),e.schema=Ai(n),e.dom=pu(o,{keep_values:!0,url_converter:e.convertURL,url_converter_scope:e,hex_colors:n.force_hex_style_colors,update_styles:!0,root_element:e.inline?e.getBody():null,collect:function(){return e.inline},schema:e.schema,contentCssCors:fs(e),referrerPolicy:ls(e),onSetAttrib:function(t){e.fire("SetAttrib",t);}}),e.parser=function(e){var t=_b(Kk(e),e.schema);return t.addAttributeFilter("src,href,style,tabindex",(function(t,n){for(var r,o,i=t.length,a=e.dom,u="data-mce-"+n;i--;)if((o=(r=t[i]).attr(n))&&!r.attr(u)){if(0===o.indexOf("data:")||0===o.indexOf("blob:"))continue;"style"===n?((o=a.serializeStyle(a.parseStyle(o),r.name)).length||(o=null),r.attr(u,o),r.attr(n,o)):"tabindex"===n?(r.attr(u,o),r.attr(n,null)):r.attr(u,e.convertURL(o,n,r.name));}})),t.addNodeFilter("script",(function(e){for(var t=e.length;t--;){var n=e[t],r=n.attr("type")||"no/type";0!==r.indexOf("mce-")&&n.attr("type","mce-"+r);}})),e.settings.preserve_cdata&&t.addNodeFilter("#cdata",(function(t){for(var n=t.length;n--;){var r=t[n];r.type=8,r.name="#comment",r.value="[CDATA["+e.dom.encode(r.value)+"]]";}})),t.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",(function(t){for(var n=t.length,r=e.schema.getNonEmptyElements();n--;){var o=t[n];o.isEmpty(r)&&0===o.getAll("br").length&&(o.append(new Om("br",1)).shortEnded=!0);}})),t}(e),e.serializer=Ob(function(e){var t=e.settings;return Re(Re({},Kk(e)),Wk({url_converter:t.url_converter,url_converter_scope:t.url_converter_scope,element_format:t.element_format,entities:t.entities,entity_encoding:t.entity_encoding,indent:t.indent,indent_after:t.indent_after,indent_before:t.indent_before,block_elements:t.block_elements,boolean_attributes:t.boolean_attributes,custom_elements:t.custom_elements,extended_valid_elements:t.extended_valid_elements,invalid_elements:t.invalid_elements,invalid_styles:t.invalid_styles,move_caret_before_on_enter_elements:t.move_caret_before_on_enter_elements,non_empty_elements:t.non_empty_elements,schema:t.schema,self_closing_elements:t.self_closing_elements,short_ended_elements:t.short_ended_elements,special:t.special,text_block_elements:t.text_block_elements,text_inline_elements:t.text_inline_elements,valid_children:t.valid_children,valid_classes:t.valid_classes,valid_elements:t.valid_elements,valid_styles:t.valid_styles,verify_html:t.verify_html,whitespace_elements:t.whitespace_elements}))}(e),e),e.selection=sb(e.dom,e.getWin(),e.serializer,e),e.annotator=Jl(e),e.formatter=qy(e),e.undoManager=Wy(e),e._nodeChangeDispatcher=new kk(e),e._selectionOverrides=jk(e),Lw(e),Nk(e),Gv(e)||_k(e);var a=function(e){return Gv(e)?Cu(null):Sk(e)}(e);Bw(e,a),function(e){ts(e)&&e.on("NodeChange",_(Uw,e));}(e),Jy(e);var u=Jv(e);Qk(e),u.fold((function(){Jk(e).then((function(){return Zk(e)}));}),(function(t){e.setProgressState(!0),Jk(e).then((function(){t().then((function(t){e.setProgressState(!1),Zk(e);}),(function(t){e.notificationManager.open({type:"error",text:String(t)}),Zk(e);}));}));}));},tN=pu.DOM,nN=function(e){var t=function(e){return e.getParam("doctype","<!DOCTYPE html>")}(e)+"<html><head>";((function(e){return e.getParam("document_base_url","")}))(e)!==e.documentBaseUrl&&(t+='<base href="'+e.documentBaseURI.getURI()+'" />'),t+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';var n=function(e){return Zc(e,"body_id","tinymce")}(e),r=function(e){return Zc(e,"body_class","")}(e),o=e.translate(function(e){return e.getParam("iframe_aria_text","Rich Text Area. Press ALT-0 for help.","string")}(e));return es(e)&&(t+='<meta http-equiv="Content-Security-Policy" content="'+es(e)+'" />'),t+='</head><body id="'+n+'" class="mce-content-body '+r+'" data-id="'+e.id+'" aria-label="'+o+'"><br></body></html>'},rN=function(e,t){var n,r,o,i,a=e.translate("Rich Text Area"),u=(n=e.id,r=a,t.height,o=function(e){return e.getParam("iframe_attrs",{})}(e),i=Rt.fromTag("iframe"),Zn(i,o),Zn(i,{id:n+"_ifr",frameBorder:"0",allowTransparency:"true",title:r}),Bu(i,"tox-edit-area__iframe"),i).dom;u.onload=function(){u.onload=null,e.fire("load");};var c=function(e,t){if(document.domain!==window.location.hostname&&wt.browser.isIE()){var n=By("mce");e[n]=function(){eN(e);};var r='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+e.id+'");document.write(ed.iframeHTML);document.close();ed.'+n+"(true);})()";return tN.setAttrib(t,"src",r),!0}return !1}(e,u);return e.contentAreaContainer=t.iframeContainer,e.iframeElement=u,e.iframeHTML=nN(e),tN.add(t.iframeContainer,u),c},oN=pu.DOM,iN=function(e,t,n){var r=yy.get(n),o=yy.urls[n]||e.documentBaseUrl.replace(/\/$/,"");if(n=_t.trim(n),r&&-1===_t.inArray(t,n)){if(_t.each(yy.dependencies(n),(function(n){iN(e,t,n);})),e.plugins[n])return;try{var i=new r(e,o,e.$);e.plugins[n]=i,i.init&&(i.init(e,o),t.push(n));}catch(t){!function(e,t,n){var r=ku.translate(["Failed to initialize plugin: {0}",t]);td(e,"PluginLoadError",{message:r}),_y(r,n),Sy(e,r);}(e,n,t);}}},aN=function(e){return e.replace(/^\-/,"")},uN=function(e){return {editorContainer:e,iframeContainer:e,api:{}}},cN=function(e){var t=e.getElement();return e.inline?uN(null):function(e){var t=oN.create("div");return oN.insertAfter(t,e),uN(t)}(t)},sN=function(e){var t=e.getElement();return e.orgDisplay=t.style.display,l(vs(e))?function(e){return e.theme.renderUI()}(e):y(vs(e))?function(e){var t=e.getElement(),n=vs(e)(e,t);return n.editorContainer.nodeType&&(n.editorContainer.id=n.editorContainer.id||e.id+"_parent"),n.iframeContainer&&n.iframeContainer.nodeType&&(n.iframeContainer.id=n.iframeContainer.id||e.id+"_iframecontainer"),n.height=n.iframeHeight?n.iframeHeight:t.offsetHeight,n}(e):cN(e)},fN=function(e){e.fire("ScriptsLoaded"),function(e){var t=_t.trim(is(e)),n=e.ui.registry.getAll().icons,r=Re(Re({},sy.get("default").icons),sy.get(t).icons);le(r,(function(t,r){ye(n,r)||e.ui.registry.addIcon(r,t);}));}(e),function(e){var t=vs(e);if(l(t)){e.settings.theme=aN(t);var n=Cy.get(t);e.theme=new n(e,Cy.urls[t]),e.theme.init&&e.theme.init(e,Cy.urls[t]||e.documentBaseUrl.replace(/\/$/,""),e.$);}else e.theme={};}(e),function(e){var t=[];_t.each(xs(e).split(/[ ,]/),(function(n){iN(e,t,aN(n));}));}(e);var t=sN(e);!function(e,t){var n={show:I.from(t.show).getOr(x),hide:I.from(t.hide).getOr(x),disable:I.from(t.disable).getOr(x),isDisabled:I.from(t.isDisabled).getOr(T),enable:function(){e.mode.isReadOnly()||I.from(t.enable).map(D);}};e.ui=Re(Re({},e.ui),n);}(e,I.from(t.api).getOr({}));var n={editorContainer:t.editorContainer,iframeContainer:t.iframeContainer};return e.editorContainer=n.editorContainer?n.editorContainer:null,Dy(e),e.inline?eN(e):function(e,t){var n=rN(e,t);t.editorContainer&&(tN.get(t.editorContainer).style.display=e.orgDisplay,e.hidden=tN.isHidden(t.editorContainer)),e.getElement().style.display="none",tN.setAttrib(e.id,"aria-hidden","true"),n||eN(e);}(e,n)},lN=pu.DOM,dN=function(e){return "-"===e.charAt(0)},mN=function(e,t){var n=ds(t),r=function(e){return e.getParam("language_url","","string")}(t);if(!1===ku.hasCode(n)&&"en"!==n){var o=""!==r?r:t.editorManager.baseURL+"/langs/"+n+".js";e.add(o,x,void 0,(function(){!function(e,t,n){ky(e,"LanguageLoadError",Ny("language",t,n));}(t,o,n);}));}},gN=function(e,t,n){return I.from(t).filter((function(e){return e.length>0&&!sy.has(e)})).map((function(t){return {url:e.editorManager.baseURL+"/icons/"+t+"/icons"+n+".js",name:I.some(t)}}))},pN=function(e,t,n){var r=gN(t,"default",n),o=function(e){return I.from(function(e){return e.getParam("icons_url","","string")}(e)).filter((function(e){return e.length>0})).map((function(e){return {url:e,name:I.none()}}))}(t).orThunk((function(){return gN(t,is(t),"")}));q(function(e){for(var t=[],n=function(e){t.push(e);},r=0;r<e.length;r++)e[r].each(n);return t}([r,o]),(function(n){e.add(n.url,x,void 0,(function(){!function(e,t,n){ky(e,"IconsLoadError",Ny("icons",t,n));}(t,n.url,n.name.getOrUndefined());}));}));},hN=function(e,t){var n=yu.ScriptLoader;!function(e,t,n,r){var o=vs(t);if(l(o)){if(!dN(o)&&!ye(Cy.urls,o)){var i=function(e){return e.getParam("theme_url")}(t);i?Cy.load(o,t.documentBaseURI.toAbsolute(i)):Cy.load(o,"themes/"+o+"/theme"+n+".js");}e.loadQueue((function(){Cy.waitFor(o,r);}));}else r();}(n,e,t,(function(){mN(n,e),pN(n,e,t),function(e,t){_t.each(function(e){return e.getParam("external_plugins")}(e),(function(t,n){yy.load(n,t,x,void 0,(function(){Ey(e,t,n);})),e.settings.plugins+=" "+n;})),_t.each(xs(e).split(/[ ,]/),(function(n){if((n=_t.trim(n))&&!yy.urls[n])if(dN(n)){n=n.substr(1,n.length);var r=yy.dependencies(n);_t.each(r,(function(n){var r={prefix:"plugins/",resource:n,suffix:"/plugin"+t+".js"},o=yy.createUrl(r,n);yy.load(o.resource,o,x,void 0,(function(){Ey(e,o.prefix+o.resource+o.suffix,o.resource);}));}));}else {var o={prefix:"plugins/",resource:n,suffix:"/plugin"+t+".js"};yy.load(n,o,x,void 0,(function(){Ey(e,o.prefix+o.resource+o.suffix,n);}));}}));}(e,t),n.loadQueue((function(){e.removed||fN(e);}),e,(function(){e.removed||fN(e);}));}));},vN=function(e){var t=e.id;ku.setCode(ds(e));var n=function(){lN.unbind(window,"ready",n),e.render();};if(Ui.Event.domLoaded){if(e.getElement()&&wt.contentEditable){var r=Rt.fromDom(e.getElement()),o=function(e){return Y(e.dom.attributes,(function(e,t){return e[t.name]=t.value,e}),{})}(r);e.on("remove",(function(){$(r.dom.attributes,(function(e){return nr(r,e.name)})),Zn(r,o);})),e.ui.styleSheetLoader=function(e,t){return io.forElement(e,{contentCssCors:Cs(t),referrerPolicy:ls(t)})}(r,e),!function(e){return e.getParam("inline")}(e)?(e.orgVisibility=e.getElement().style.visibility,e.getElement().style.visibility="hidden"):e.inline=!0;var i=e.getElement().form||lN.getParent(t,"form");i&&(e.formElement=i,function(e){return e.getParam("hidden_input")}(e)&&!Mn(e.getElement())&&(lN.insertAfter(lN.create("input",{type:"hidden",name:t}),t),e.hasHiddenInput=!0),e.formEventDelegate=function(t){e.fire(t.type,t);},lN.bind(i,"submit reset",e.formEventDelegate),e.on("reset",(function(){e.resetContent();})),!function(e){return e.getParam("submit_patch")}(e)||i.submit.nodeType||i.submit.length||i._mceOldSubmit||(i._mceOldSubmit=i.submit,i.submit=function(){return e.editorManager.triggerSave(),e.setDirty(!1),i._mceOldSubmit(i)})),e.windowManager=xy(e),e.notificationManager=by(e),function(e){return "xml"===e.getParam("encoding")}(e)&&e.on("GetContent",(function(e){e.save&&(e.content=lN.encode(e.content));})),function(e){return e.getParam("add_form_submit_trigger")}(e)&&e.on("submit",(function(){e.initialized&&e.save();})),function(e){return e.getParam("add_unload_trigger")}(e)&&(e._beforeUnload=function(){!e.initialized||e.destroyed||e.isHidden()||e.save({format:"raw",no_events:!0,set_dirty:!1});},e.editorManager.on("BeforeUnload",e._beforeUnload)),e.editorManager.add(e),hN(e,e.suffix);}}else lN.bind(window,"ready",n);},bN=function(e,t){return function(e,t){return Zv(e).editor.addVisual(t)}(e,t)},yN={"font-size":"size","font-family":"face"},CN=function(e,t,n){return lh(Rt.fromDom(n),(function(t){return function(t){return ar(t,e).orThunk((function(){return "font"===It(t)?be(yN,e).bind((function(e){return tr(t,e)})):I.none()}))}(t)}),(function(e){return Bt(Rt.fromDom(t),e)}))},xN=function(e){return function(t,n){return I.from(n).map(Rt.fromDom).filter(Ut).bind((function(n){return CN(e,t,n.dom).or(function(e,t){return I.from(pu.DOM.getStyle(t,e,!0))}(e,n.dom))})).getOr("")}},wN=xN("font-size"),SN=w((function(e){return e.replace(/[\'\"\\]/g,"").replace(/,\s+/g,",")}),xN("font-family")),kN=function(e){return Lf(e.getBody()).map((function(e){var t=e.container();return Fn(t)?t.parentNode:t}))},NN=function(e,t){return function(e){return I.from(e.selection.getRng()).bind((function(t){var n=e.getBody();return t.startContainer===n&&0===t.startOffset?I.none():I.from(e.selection.getStart(!0))}))}(e).orThunk(_(kN,e)).map(Rt.fromDom).filter(Ut).bind(t)},EN=function(e,t){return NN(e,S(I.some,t))},_N=function(e,t){if(/^[0-9.]+$/.test(t)){var n=parseInt(t,10);if(n>=1&&n<=7){var r=function(e){return _t.explode(e.getParam("font_size_style_values","xx-small,x-small,small,medium,large,x-large,xx-large"))}(e),o=function(e){return _t.explode(e.getParam("font_size_classes",""))}(e);return o?o[n-1]||t:r[n-1]||t}return t}return t},AN=function(e){var t=e.split(/\s*,\s*/);return V(t,(function(e){return -1===e.indexOf(" ")||Me(e,'"')||Me(e,"'")?e:"'"+e+"'"})).join(",")},RN=function(e,t){var n=function(e){if("string"!=typeof e){var t=_t.extend({paste:e.paste,data:{paste:e.paste}},e);return {content:e.content,details:t}}return {content:e,details:{}}}(t);!function(e,t,n){Qv(e).editor.insertContent(t,n);}(e,n.content,n.details);},DN=_t.each,TN=_t.map,ON=_t.inArray,BN=function(){function e(e){this.commands={state:{},exec:{},value:{}},this.editor=e,this.setupCommands(e);}return e.prototype.execCommand=function(e,t,n,r){var o,i=!1,a=this;if(!a.editor.removed){var u;if("mcefocus"!==e.toLowerCase()&&(/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(e)||r&&r.skip_focus?(u=a.editor,um(u).each((function(e){return u.selection.setRng(e)}))):a.editor.focus()),(r=a.editor.fire("BeforeExecCommand",{command:e,ui:t,value:n})).isDefaultPrevented())return !1;var c=e.toLowerCase();if(o=a.commands.exec[c])return o(c,t,n),a.editor.fire("ExecCommand",{command:e,ui:t,value:n}),!0;if(DN(this.editor.plugins,(function(r){if(r.execCommand&&r.execCommand(e,t,n))return a.editor.fire("ExecCommand",{command:e,ui:t,value:n}),i=!0,!1})),i)return i;if(a.editor.theme&&a.editor.theme.execCommand&&a.editor.theme.execCommand(e,t,n))return a.editor.fire("ExecCommand",{command:e,ui:t,value:n}),!0;try{i=a.editor.getDoc().execCommand(e,t,n);}catch(e){}return !!i&&(a.editor.fire("ExecCommand",{command:e,ui:t,value:n}),!0)}},e.prototype.queryCommandState=function(e){var t;if(!this.editor.quirks.isHidden()&&!this.editor.removed){if(e=e.toLowerCase(),t=this.commands.state[e])return t(e);try{return this.editor.getDoc().queryCommandState(e)}catch(e){}return !1}},e.prototype.queryCommandValue=function(e){var t;if(!this.editor.quirks.isHidden()&&!this.editor.removed){if(e=e.toLowerCase(),t=this.commands.value[e])return t(e);try{return this.editor.getDoc().queryCommandValue(e)}catch(e){}}},e.prototype.addCommands=function(e,t){void 0===t&&(t="exec");var n=this;DN(e,(function(e,r){DN(r.toLowerCase().split(","),(function(r){n.commands[t][r]=e;}));}));},e.prototype.addCommand=function(e,t,n){var r=this;e=e.toLowerCase(),this.commands.exec[e]=function(e,o,i,a){return t.call(n||r.editor,o,i,a)};},e.prototype.queryCommandSupported=function(e){if(e=e.toLowerCase(),this.commands.exec[e])return !0;try{return this.editor.getDoc().queryCommandSupported(e)}catch(e){}return !1},e.prototype.addQueryStateHandler=function(e,t,n){var r=this;e=e.toLowerCase(),this.commands.state[e]=function(){return t.call(n||r.editor)};},e.prototype.addQueryValueHandler=function(e,t,n){var r=this;e=e.toLowerCase(),this.commands.value[e]=function(){return t.call(n||r.editor)};},e.prototype.hasCustomCommand=function(e){return e=e.toLowerCase(),!!this.commands.exec[e]},e.prototype.execNativeCommand=function(e,t,n){return void 0===t&&(t=!1),void 0===n&&(n=null),this.editor.getDoc().execCommand(e,t,n)},e.prototype.isFormatMatch=function(e){return this.editor.formatter.match(e)},e.prototype.toggleFormat=function(e,t){this.editor.formatter.toggle(e,t),this.editor.nodeChanged();},e.prototype.storeSelection=function(e){this.selectionBookmark=this.editor.selection.getBookmark(e);},e.prototype.restoreSelection=function(){this.editor.selection.moveToBookmark(this.selectionBookmark);},e.prototype.setupCommands=function(e){var t=this;this.addCommands({"mceResetDesignMode,mceBeginUndoLevel":x,"mceEndUndoLevel,mceAddUndoLevel":function(){e.undoManager.add();},mceFocus:function(t,n,r){wm(e,r);},"Cut,Copy,Paste":function(n){var r,o=e.getDoc();try{t.execNativeCommand(n);}catch(e){r=!0;}if("paste"!==n||o.queryCommandEnabled(n)||(r=!0),r||!o.queryCommandSupported(n)){var i=e.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");wt.mac&&(i=i.replace(/Ctrl\+/g,"⌘+")),e.notificationManager.open({text:i,type:"error"});}},unlink:function(){if(e.selection.isCollapsed()){var t=e.dom.getParent(e.selection.getStart(),"a");t&&e.dom.remove(t,!0);}else e.formatter.remove("link");},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone":function(n){var r=n.substring(7);"full"===r&&(r="justify"),DN("left,center,right,justify".split(","),(function(t){r!==t&&e.formatter.remove("align"+t);})),"none"!==r&&t.toggleFormat("align"+r);},"InsertUnorderedList,InsertOrderedList":function(n){var r;t.execNativeCommand(n);var o=e.dom.getParent(e.selection.getNode(),"ol,ul");o&&(r=o.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(r.nodeName)&&(t.storeSelection(),e.dom.split(r,o),t.restoreSelection()));},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){t.toggleFormat(e);},"ForeColor,HiliteColor":function(e,n,r){t.toggleFormat(e,{value:r});},FontName:function(t,n,r){!function(e,t){var n=_N(e,t);e.formatter.toggle("fontname",{value:AN(n)}),e.nodeChanged();}(e,r);},FontSize:function(t,n,r){!function(e,t){e.formatter.toggle("fontsize",{value:_N(e,t)}),e.nodeChanged();}(e,r);},LineHeight:function(t,n,r){!function(e,t){e.formatter.toggle("lineheight",{value:String(t)}),e.nodeChanged();}(e,r);},Lang:function(e,n,r){t.toggleFormat(e,{value:r.code,customValue:r.customCode});},RemoveFormat:function(t){e.formatter.remove(t);},mceBlockQuote:function(){t.toggleFormat("blockquote");},FormatBlock:function(e,n,r){return t.toggleFormat(r||"p")},mceCleanup:function(){var t=e.selection.getBookmark();e.setContent(e.getContent()),e.selection.moveToBookmark(t);},mceRemoveNode:function(n,r,o){var i=o||e.selection.getNode();i!==e.getBody()&&(t.storeSelection(),e.dom.remove(i,!0),t.restoreSelection());},mceSelectNodeDepth:function(t,n,r){var o=0;e.dom.getParent(e.selection.getNode(),(function(t){if(1===t.nodeType&&o++===r)return e.selection.select(t),!1}),e.getBody());},mceSelectNode:function(t,n,r){e.selection.select(r);},mceInsertContent:function(t,n,r){RN(e,r);},mceInsertRawHTML:function(t,n,r){e.selection.setContent("tiny_mce_marker");var o=e.getContent();e.setContent(o.replace(/tiny_mce_marker/g,(function(){return r})));},mceInsertNewLine:function(t,n,r){uk(e,r);},mceToggleFormat:function(e,n,r){t.toggleFormat(r);},mceSetContent:function(t,n,r){e.setContent(r);},"Indent,Outdent":function(t){Dw(e,t);},mceRepaint:x,InsertHorizontalRule:function(){e.execCommand("mceInsertContent",!1,"<hr />");},mceToggleVisualAid:function(){e.hasVisual=!e.hasVisual,e.addVisual();},mceReplaceContent:function(t,n,r){e.execCommand("mceInsertContent",!1,r.replace(/\{\$selection\}/g,e.selection.getContent({format:"text"})));},mceInsertLink:function(t,n,r){"string"==typeof r&&(r={href:r});var o=e.dom.getParent(e.selection.getNode(),"a");r.href=r.href.replace(/ /g,"%20"),o&&r.href||e.formatter.remove("link"),r.href&&e.formatter.apply("link",r,o);},selectAll:function(){var t=e.dom.getParent(e.selection.getStart(),qn);if(t){var n=e.dom.createRng();n.selectNodeContents(t),e.selection.setRng(n);}},mceNewDocument:function(){e.setContent("");},InsertLineBreak:function(t,n,r){return XS(e,r),!0}});var n=function(t){return function(){var n=e.selection,r=n.isCollapsed()?[e.dom.getParent(n.getNode(),e.dom.isBlock)]:n.getSelectedBlocks(),o=TN(r,(function(n){return !!e.formatter.matchNode(n,t)}));return -1!==ON(o,!0)}};t.addCommands({JustifyLeft:n("alignleft"),JustifyCenter:n("aligncenter"),JustifyRight:n("alignright"),JustifyFull:n("alignjustify"),"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){return t.isFormatMatch(e)},mceBlockQuote:function(){return t.isFormatMatch("blockquote")},Outdent:function(){return _w(e)},"InsertUnorderedList,InsertOrderedList":function(t){var n=e.dom.getParent(e.selection.getNode(),"ul,ol");return n&&("insertunorderedlist"===t&&"UL"===n.tagName||"insertorderedlist"===t&&"OL"===n.tagName)}},"state"),t.addCommands({Undo:function(){e.undoManager.undo();},Redo:function(){e.undoManager.redo();}}),t.addQueryValueHandler("FontName",(function(){return function(e){return EN(e,(function(t){return SN(e.getBody(),t.dom)})).getOr("")}(e)}),this),t.addQueryValueHandler("FontSize",(function(){return function(e){return EN(e,(function(t){return wN(e.getBody(),t.dom)})).getOr("")}(e)}),this),t.addQueryValueHandler("LineHeight",(function(){return function(e){return EN(e,(function(t){var n=Rt.fromDom(e.getBody()),r=lh(t,(function(e){return ar(e,"line-height")}),_(Bt,n));return r.getOrThunk((function(){var e=parseFloat(or(t,"line-height")),n=parseFloat(or(t,"font-size"));return String(e/n)}))})).getOr("")}(e)}),this);},e}(),PN="data-mce-contenteditable",LN=function(e,t,n){var r,o;Lu(e,t)&&!1===n?(o=t,Du(r=e)?r.dom.classList.remove(o):Ou(r,o),Pu(r)):n&&Bu(e,t);},IN=function(e,t,n){try{e.getDoc().execCommand(t,!1,String(n));}catch(e){}},MN=function(e,t){e.dom.contentEditable=t?"true":"false";},FN=function(e,t){var n=Rt.fromDom(e.getBody());LN(n,"mce-content-readonly",t),t?(e.selection.controlSelection.hideResizeRect(),e._selectionOverrides.hideFakeCaret(),function(e){I.from(e.selection.getNode()).each((function(e){e.removeAttribute("data-mce-selected");}));}(e),e.readonly=!0,MN(n,!1),q(Mu(n,'*[contenteditable="true"]'),(function(e){Qn(e,PN,"true"),MN(e,!1);}))):(e.readonly=!1,MN(n,!0),function(e){q(Mu(e,'*[data-mce-contenteditable="true"]'),(function(e){nr(e,PN),MN(e,!0);}));}(n),IN(e,"StyleWithCSS",!1),IN(e,"enableInlineTableEditing",!1),IN(e,"enableObjectResizing",!1),Cm(e)&&e.focus(),function(e){e.selection.setRng(e.selection.getRng());}(e),e.nodeChanged());},UN=function(e){return e.readonly},zN=function(e){e.parser.addAttributeFilter("contenteditable",(function(t){UN(e)&&q(t,(function(e){e.attr(PN,e.attr("contenteditable")),e.attr("contenteditable","false");}));})),e.serializer.addAttributeFilter(PN,(function(t){UN(e)&&q(t,(function(e){e.attr("contenteditable",e.attr(PN));}));})),e.serializer.addTempAttr(PN);},HN=function(e,t){if(function(e){return "click"===e.type}(t)&&!od.metaKeyPressed(t)){var n=Rt.fromDom(t.target);(function(e,t){return Qr(t,"a",(function(t){return Bt(t,Rt.fromDom(e.getBody()))})).bind((function(e){return tr(e,"href")}))})(e,n).each((function(n){if(t.preventDefault(),/^#/.test(n)){var r=e.dom.select(n+',[name="'+((Me(o=n,i="#")?function(e,t){return e.substring(t)}(o,i.length):o)+'"]'));r.length&&e.selection.scrollIntoView(r[0],!0);}else window.open(n,"_blank","rel=noopener noreferrer,menubar=yes,toolbar=yes,location=yes,status=yes,resizable=yes,scrollbars=yes");var o,i;}));}},jN=_t.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input beforeinput contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchmove touchend touchcancel"," "),VN=function(){function e(e){this.bindings={},this.settings=e||{},this.scope=this.settings.scope||this,this.toggleEvent=this.settings.toggleEvent||T;}return e.isNative=function(e){return !!jN[e.toLowerCase()]},e.prototype.fire=function(e,t){var n=e.toLowerCase(),r=Bi(n,t||{},this.scope);this.settings.beforeFire&&this.settings.beforeFire(r);var o=this.bindings[n];if(o)for(var i=0,a=o.length;i<a;i++){var u=o[i];if(!u.removed){if(u.once&&this.off(n,u.func),r.isImmediatePropagationStopped())return r;if(!1===u.func.call(this.scope,r))return r.preventDefault(),r}}return r},e.prototype.on=function(e,t,n,r){if(!1===t&&(t=T),t){var o={func:t,removed:!1};r&&_t.extend(o,r);for(var i=e.toLowerCase().split(" "),a=i.length;a--;){var u=i[a],c=this.bindings[u];c||(c=[],this.toggleEvent(u,!0)),c=n?De([o],c,!0):De(De([],c,!0),[o],!1),this.bindings[u]=c;}}return this},e.prototype.off=function(e,t){var n=this;if(e)for(var r=e.toLowerCase().split(" "),o=r.length;o--;){var i=r[o],a=this.bindings[i];if(!i)return le(this.bindings,(function(e,t){n.toggleEvent(t,!1),delete n.bindings[t];})),this;if(a){if(t){var u=W(a,(function(e){return e.func===t}));a=u.fail,this.bindings[i]=a,q(u.pass,(function(e){e.removed=!0;}));}else a.length=0;a.length||(this.toggleEvent(e,!1),delete this.bindings[i]);}}else le(this.bindings,(function(e,t){n.toggleEvent(t,!1);})),this.bindings={};return this},e.prototype.once=function(e,t,n){return this.on(e,t,n,{once:!0})},e.prototype.has=function(e){return e=e.toLowerCase(),!(!this.bindings[e]||0===this.bindings[e].length)},e}(),qN=function(e){return e._eventDispatcher||(e._eventDispatcher=new VN({scope:e,toggleEvent:function(t,n){VN.isNative(t)&&e.toggleNativeEvent&&e.toggleNativeEvent(t,n);}})),e._eventDispatcher},$N={fire:function(e,t,n){var r=this;if(r.removed&&"remove"!==e&&"detach"!==e)return t;var o=qN(r).fire(e,t);if(!1!==n&&r.parent)for(var i=r.parent();i&&!o.isPropagationStopped();)i.fire(e,o,!1),i=i.parent();return o},on:function(e,t,n){return qN(this).on(e,t,n)},off:function(e,t){return qN(this).off(e,t)},once:function(e,t){return qN(this).once(e,t)},hasEventListeners:function(e){return qN(this).has(e)}},WN=pu.DOM,KN=function(e,t){if("selectionchange"===t)return e.getDoc();if(!e.inline&&/^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(t))return e.getDoc().documentElement;var n=hs(e);return n?(e.eventRoot||(e.eventRoot=WN.select(n)[0]),e.eventRoot):e.getBody()},XN=function(e,t,n){!function(e){return !e.hidden&&!UN(e)}(e)?UN(e)&&HN(e,n):e.fire(t,n);},YN=function(e,t){var n;if(e.delegates||(e.delegates={}),!e.delegates[t]&&!e.removed){var r=KN(e,t);if(hs(e)){if(Mx||(Mx={},e.editorManager.on("removeEditor",(function(){e.editorManager.activeEditor||Mx&&(le(Mx,(function(t,n){e.dom.unbind(KN(e,n));})),Mx=null);}))),Mx[t])return;n=function(n){for(var r=n.target,o=e.editorManager.get(),i=o.length;i--;){var a=o[i].getBody();(a===r||WN.isChildOf(r,a))&&XN(o[i],t,n);}},Mx[t]=n,WN.bind(r,t,n);}else n=function(n){XN(e,t,n);},WN.bind(r,t,n),e.delegates[t]=n;}},GN=Re(Re({},$N),{bindPendingEventDelegates:function(){var e=this;_t.each(e._pendingNativeEvents,(function(t){YN(e,t);}));},toggleNativeEvent:function(e,t){var n=this;"focus"!==e&&"blur"!==e&&(n.removed||(t?n.initialized?YN(n,e):n._pendingNativeEvents?n._pendingNativeEvents.push(e):n._pendingNativeEvents=[e]:n.initialized&&(n.dom.unbind(KN(n,e),e,n.delegates[e]),delete n.delegates[e])));},unbindAllNativeEvents:function(){var e=this,t=e.getBody(),n=e.dom;e.delegates&&(le(e.delegates,(function(t,n){e.dom.unbind(KN(e,n),n,t);})),delete e.delegates),!e.inline&&t&&n&&(t.onload=null,n.unbind(e.getWin()),n.unbind(e.getDoc())),n&&(n.unbind(t),n.unbind(e.getContainer()));}}),JN=["design","readonly"],QN=function(e,t,n,r){var o=n[t.get()],i=n[r];try{i.activate();}catch(e){return void console.error("problem while activating editor mode "+r+":",e)}o.deactivate(),o.editorReadOnly!==i.editorReadOnly&&FN(e,i.editorReadOnly),t.set(r),function(e,t){e.fire("SwitchMode",{mode:t});}(e,r);},ZN=function(e){var t=Cu("design"),n=Cu({design:{activate:x,deactivate:x,editorReadOnly:!1},readonly:{activate:x,deactivate:x,editorReadOnly:!0}});return function(e){e.serializer?zN(e):e.on("PreInit",(function(){zN(e);}));}(e),function(e){e.on("ShowCaret",(function(t){UN(e)&&t.preventDefault();})),e.on("ObjectSelected",(function(t){UN(e)&&t.preventDefault();}));}(e),{isReadOnly:function(){return UN(e)},set:function(r){return function(e,t,n,r){if(r!==n.get()){if(!ye(t,r))throw new Error("Editor mode '"+r+"' is invalid");e.initialized?QN(e,n,t,r):e.on("init",(function(){return QN(e,n,t,r)}));}}(e,n.get(),t,r)},get:function(){return t.get()},register:function(e,t){n.set(function(e,t,n){var r;if(H(JN,t))throw new Error("Cannot override default mode "+t);return Re(Re({},e),((r={})[t]=Re(Re({},n),{deactivate:function(){try{n.deactivate();}catch(e){console.error("problem while deactivating editor mode "+t+":",e);}}}),r))}(n.get(),e,t));}}},eE=_t.each,tE=_t.explode,nE={f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123},rE=_t.makeMap("alt,ctrl,shift,meta,access"),oE=function(e){var t,n={};eE(tE(e.toLowerCase(),"+"),(function(e){e in rE?n[e]=!0:/^[0-9]{2,}$/.test(e)?n.keyCode=parseInt(e,10):(n.charCode=e.charCodeAt(0),n.keyCode=nE[e]||e.toUpperCase().charCodeAt(0));}));var r=[n.keyCode];for(t in rE)n[t]?r.push(t):n[t]=!1;return n.id=r.join(","),n.access&&(n.alt=!0,wt.mac?n.ctrl=!0:n.shift=!0),n.meta&&(wt.mac?n.meta=!0:(n.ctrl=!0,n.meta=!1)),n},iE=function(){function e(e){this.shortcuts={},this.pendingPatterns=[],this.editor=e;var t=this;e.on("keyup keypress keydown",(function(e){!t.hasModifier(e)&&!t.isFunctionKey(e)||e.isDefaultPrevented()||(eE(t.shortcuts,(function(n){if(t.matchShortcut(e,n))return t.pendingPatterns=n.subpatterns.slice(0),"keydown"===e.type&&t.executeShortcutAction(n),!0})),t.matchShortcut(e,t.pendingPatterns[0])&&(1===t.pendingPatterns.length&&"keydown"===e.type&&t.executeShortcutAction(t.pendingPatterns[0]),t.pendingPatterns.shift()));}));}return e.prototype.add=function(e,t,n,r){var o=this,i=o.normalizeCommandFunc(n);return eE(tE(_t.trim(e)),(function(e){var n=o.createShortcut(e,t,i,r);o.shortcuts[n.id]=n;})),!0},e.prototype.remove=function(e){var t=this.createShortcut(e);return !!this.shortcuts[t.id]&&(delete this.shortcuts[t.id],!0)},e.prototype.normalizeCommandFunc=function(e){var t=this,n=e;return "string"==typeof n?function(){t.editor.execCommand(n,!1,null);}:_t.isArray(n)?function(){t.editor.execCommand(n[0],n[1],n[2]);}:n},e.prototype.createShortcut=function(e,t,n,r){var o=_t.map(tE(e,">"),oE);return o[o.length-1]=_t.extend(o[o.length-1],{func:n,scope:r||this.editor}),_t.extend(o[0],{desc:this.editor.translate(t),subpatterns:o.slice(1)})},e.prototype.hasModifier=function(e){return e.altKey||e.ctrlKey||e.metaKey},e.prototype.isFunctionKey=function(e){return "keydown"===e.type&&e.keyCode>=112&&e.keyCode<=123},e.prototype.matchShortcut=function(e,t){return !!t&&(t.ctrl===e.ctrlKey&&t.meta===e.metaKey&&(t.alt===e.altKey&&t.shift===e.shiftKey&&(!!(e.keyCode===t.keyCode||e.charCode&&e.charCode===t.charCode)&&(e.preventDefault(),!0))))},e.prototype.executeShortcutAction=function(e){return e.func?e.func.call(e.scope):null},e}(),aE=function(){var e=function(){var e={},t={},n={},r={},o={},i={},a={},u=function(e,t){return function(n,r){return e[n.toLowerCase()]=Re(Re({},r),{type:t})}};return {addButton:u(e,"button"),addGroupToolbarButton:u(e,"grouptoolbarbutton"),addToggleButton:u(e,"togglebutton"),addMenuButton:u(e,"menubutton"),addSplitButton:u(e,"splitbutton"),addMenuItem:u(t,"menuitem"),addNestedMenuItem:u(t,"nestedmenuitem"),addToggleMenuItem:u(t,"togglemenuitem"),addAutocompleter:u(n,"autocompleter"),addContextMenu:u(o,"contextmenu"),addContextToolbar:u(i,"contexttoolbar"),addContextForm:u(i,"contextform"),addSidebar:u(a,"sidebar"),addIcon:function(e,t){return r[e.toLowerCase()]=t},getAll:function(){return {buttons:e,menuItems:t,icons:r,popups:n,contextMenus:o,contextToolbars:i,sidebars:a}}}}();return {addAutocompleter:e.addAutocompleter,addButton:e.addButton,addContextForm:e.addContextForm,addContextMenu:e.addContextMenu,addContextToolbar:e.addContextToolbar,addIcon:e.addIcon,addMenuButton:e.addMenuButton,addMenuItem:e.addMenuItem,addNestedMenuItem:e.addNestedMenuItem,addSidebar:e.addSidebar,addSplitButton:e.addSplitButton,addToggleButton:e.addToggleButton,addGroupToolbarButton:e.addGroupToolbarButton,addToggleMenuItem:e.addToggleMenuItem,getAll:e.getAll}},uE=pu.DOM,cE=_t.extend,sE=_t.each,fE=_t.resolve,lE=wt.ie,dE=function(){function e(e,t,n){var r=this;this.plugins={},this.contentCSS=[],this.contentStyles=[],this.loadedCSS={},this.isNotDirty=!1,this.editorManager=n,this.documentBaseUrl=n.documentBaseURL,cE(this,GN),this.settings=ay(this,e,this.documentBaseUrl,n.defaultSettings,t),this.settings.suffix&&(n.suffix=this.settings.suffix),this.suffix=n.suffix,this.settings.base_url&&n._setBaseUrl(this.settings.base_url),this.baseUri=n.baseURI,this.settings.referrer_policy&&(yu.ScriptLoader._setReferrerPolicy(this.settings.referrer_policy),pu.DOM.styleSheetLoader._setReferrerPolicy(this.settings.referrer_policy)),Nu.languageLoad=this.settings.language_load,Nu.baseURL=n.baseURL,this.id=e,this.setDirty(!1),this.documentBaseURI=new zm(this.settings.document_base_url,{base_uri:this.baseUri}),this.baseURI=this.baseUri,this.inline=!!this.settings.inline,this.shortcuts=new iE(this),this.editorCommands=new BN(this),this.settings.cache_suffix&&(wt.cacheSuffix=this.settings.cache_suffix.replace(/^[\?\&]+/,"")),this.ui={registry:aE(),styleSheetLoader:void 0,show:x,hide:x,enable:x,disable:x,isDisabled:T};var o=ZN(this);this.mode=o,this.setMode=o.set,n.fire("SetupEditor",{editor:this}),this.execCallback("setup",this),this.$=cu.overrideDefaults((function(){return {context:r.inline?r.getBody():r.getDoc(),element:r.getBody()}}));}return e.prototype.render=function(){vN(this);},e.prototype.focus=function(e){this.execCommand("mceFocus",!1,e);},e.prototype.hasFocus=function(){return ym(this)},e.prototype.execCallback=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r,o=this,i=o.settings[e];if(i)return o.callbackLookup&&(r=o.callbackLookup[e])&&(i=r.func,r=r.scope),"string"==typeof i&&(r=(r=i.replace(/\.\w+$/,""))?fE(r):0,i=fE(i),o.callbackLookup=o.callbackLookup||{},o.callbackLookup[e]={func:i,scope:r}),i.apply(r||o,t)},e.prototype.translate=function(e){return ku.translate(e)},e.prototype.getParam=function(e,t,n){return cy(this,e,t,n)},e.prototype.hasPlugin=function(e,t){return !!H(xs(this).split(/[ ,]/),e)&&(!t||void 0!==yy.get(e))},e.prototype.nodeChanged=function(e){this._nodeChangeDispatcher.nodeChanged(e);},e.prototype.addCommand=function(e,t,n){this.editorCommands.addCommand(e,t,n);},e.prototype.addQueryStateHandler=function(e,t,n){this.editorCommands.addQueryStateHandler(e,t,n);},e.prototype.addQueryValueHandler=function(e,t,n){this.editorCommands.addQueryValueHandler(e,t,n);},e.prototype.addShortcut=function(e,t,n,r){this.shortcuts.add(e,t,n,r);},e.prototype.execCommand=function(e,t,n,r){return this.editorCommands.execCommand(e,t,n,r)},e.prototype.queryCommandState=function(e){return this.editorCommands.queryCommandState(e)},e.prototype.queryCommandValue=function(e){return this.editorCommands.queryCommandValue(e)},e.prototype.queryCommandSupported=function(e){return this.editorCommands.queryCommandSupported(e)},e.prototype.show=function(){var e=this;e.hidden&&(e.hidden=!1,e.inline?e.getBody().contentEditable="true":(uE.show(e.getContainer()),uE.hide(e.id)),e.load(),e.fire("show"));},e.prototype.hide=function(){var e=this,t=e.getDoc();e.hidden||(lE&&t&&!e.inline&&t.execCommand("SelectAll"),e.save(),e.inline?(e.getBody().contentEditable="false",e===e.editorManager.focusedEditor&&(e.editorManager.focusedEditor=null)):(uE.hide(e.getContainer()),uE.setStyle(e.id,"display",e.orgDisplay)),e.hidden=!0,e.fire("hide"));},e.prototype.isHidden=function(){return !!this.hidden},e.prototype.setProgressState=function(e,t){this.fire("ProgressState",{state:e,time:t});},e.prototype.load=function(e){var t,n=this,r=n.getElement();if(n.removed)return "";if(r){(e=e||{}).load=!0;var o=Mn(r)?r.value:r.innerHTML;return t=n.setContent(o,e),e.element=r,e.no_events||n.fire("LoadContent",e),e.element=r=null,t}},e.prototype.save=function(e){var t,n,r=this,o=r.getElement();if(o&&r.initialized&&!r.removed)return (e=e||{}).save=!0,e.element=o,e.content=r.getContent(e),e.no_events||r.fire("SaveContent",e),"raw"===e.format&&r.fire("RawSaveContent",e),t=e.content,Mn(o)?o.value=t:(!e.is_removing&&r.inline||(o.innerHTML=t),(n=uE.getParent(r.id,"form"))&&sE(n.elements,(function(e){if(e.name===r.id)return e.value=t,!1}))),e.element=o=null,!1!==e.set_dirty&&r.setDirty(!1),t},e.prototype.setContent=function(e,t){return Pb(this,e,t)},e.prototype.getContent=function(e){return Bb(this,e)},e.prototype.insertContent=function(e,t){t&&(e=cE({content:e},t)),this.execCommand("mceInsertContent",!1,e);},e.prototype.resetContent=function(e){void 0===e?Pb(this,this.startContent,{format:"raw"}):Pb(this,e),this.undoManager.reset(),this.setDirty(!1),this.nodeChanged();},e.prototype.isDirty=function(){return !this.isNotDirty},e.prototype.setDirty=function(e){var t=!this.isNotDirty;this.isNotDirty=!e,e&&e!==t&&this.fire("dirty");},e.prototype.getContainer=function(){var e=this;return e.container||(e.container=uE.get(e.editorContainer||e.id+"_parent")),e.container},e.prototype.getContentAreaContainer=function(){return this.contentAreaContainer},e.prototype.getElement=function(){return this.targetElm||(this.targetElm=uE.get(this.id)),this.targetElm},e.prototype.getWin=function(){var e,t=this;return t.contentWindow||(e=t.iframeElement)&&(t.contentWindow=e.contentWindow),t.contentWindow},e.prototype.getDoc=function(){var e,t=this;return t.contentDocument||(e=t.getWin())&&(t.contentDocument=e.document),t.contentDocument},e.prototype.getBody=function(){var e=this.getDoc();return this.bodyElement||(e?e.body:null)},e.prototype.convertURL=function(e,t,n){var r=this,o=r.settings;return o.urlconverter_callback?r.execCallback("urlconverter_callback",e,n,!0,t):!o.convert_urls||n&&"LINK"===n.nodeName||0===e.indexOf("file:")||0===e.length?e:o.relative_urls?r.documentBaseURI.toRelative(e):e=r.documentBaseURI.toAbsolute(e,o.remove_script_host)},e.prototype.addVisual=function(e){bN(this,e);},e.prototype.remove=function(){Mb(this);},e.prototype.destroy=function(e){Fb(this,e);},e.prototype.uploadImages=function(e){return this.editorUpload.uploadImages(e)},e.prototype._scanForImages=function(){return this.editorUpload.scanForImages()},e.prototype.addButton=function(){throw new Error("editor.addButton has been removed in tinymce 5x, use editor.ui.registry.addButton or editor.ui.registry.addToggleButton or editor.ui.registry.addSplitButton instead")},e.prototype.addSidebar=function(){throw new Error("editor.addSidebar has been removed in tinymce 5x, use editor.ui.registry.addSidebar instead")},e.prototype.addMenuItem=function(){throw new Error("editor.addMenuItem has been removed in tinymce 5x, use editor.ui.registry.addMenuItem instead")},e.prototype.addContextToolbar=function(){throw new Error("editor.addContextToolbar has been removed in tinymce 5x, use editor.ui.registry.addContextToolbar instead")},e}(),mE=pu.DOM,gE=_t.explode,pE=_t.each,hE=_t.extend,vE=0,bE=!1,yE=[],CE=[],xE=function(e){var t=e.type;pE(NE.get(),(function(n){switch(t){case"scroll":n.fire("ScrollWindow",e);break;case"resize":n.fire("ResizeWindow",e);}}));},wE=function(e){e!==bE&&(e?cu(window).on("resize scroll",xE):cu(window).off("resize scroll",xE),bE=e);},SE=function(e){var t=CE;delete yE[e.id];for(var n=0;n<yE.length;n++)if(yE[n]===e){yE.splice(n,1);break}return CE=K(CE,(function(t){return e!==t})),NE.activeEditor===e&&(NE.activeEditor=CE.length>0?CE[0]:null),NE.focusedEditor===e&&(NE.focusedEditor=null),t.length!==CE.length},kE="CSS1Compat"!==document.compatMode,NE=Re(Re({},$N),{baseURI:null,baseURL:null,defaultSettings:{},documentBaseURL:null,suffix:null,$:cu,majorVersion:"5",minorVersion:"10.2",releaseDate:"2021-11-17",editors:yE,i18n:ku,activeEditor:null,focusedEditor:null,settings:{},setup:function(){var e,t,n=this,r="";t=zm.getDocumentBaseUrl(document.location),/^[^:]+:\/\/\/?[^\/]+\//.test(t)&&(t=t.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(t)||(t+="/"));var o,i=window.tinymce||window.tinyMCEPreInit;if(i)e=i.base||i.baseURL,r=i.suffix;else {for(var a=document.getElementsByTagName("script"),u=0;u<a.length;u++){var c;if(""!==(c=a[u].src||"")){var s=c.substring(c.lastIndexOf("/"));if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(c)){-1!==s.indexOf(".min")&&(r=".min"),e=c.substring(0,c.lastIndexOf("/"));break}}}if(!e&&document.currentScript)-1!==(c=document.currentScript.src).indexOf(".min")&&(r=".min"),e=c.substring(0,c.lastIndexOf("/"));}n.baseURL=new zm(t).toAbsolute(e),n.documentBaseURL=t,n.baseURI=new zm(n.baseURL),n.suffix=r,(o=n).on("AddEditor",_(mm,o)),o.on("RemoveEditor",_(gm,o));},overrideDefaults:function(e){var t=e.base_url;t&&this._setBaseUrl(t);var n=e.suffix;e.suffix&&(this.suffix=n),this.defaultSettings=e;var r=e.plugin_base_urls;void 0!==r&&le(r,(function(e,t){Nu.PluginManager.urls[t]=e;}));},init:function(e){var t,n=this,r=_t.makeMap("area base basefont br col frame hr img input isindex link meta param embed source wbr track colgroup option table tbody tfoot thead tr th td script noscript style textarea video audio iframe object menu"," "),o=function(e){var t=e.id;return t||(t=be(e,"name").filter((function(e){return !mE.get(e)})).getOrThunk(mE.uniqueId),e.setAttribute("id",t)),t},i=function(e,t){return t.constructor===RegExp?t.test(e.className):mE.hasClass(e,t)},a=function(e){t=e;},u=function(){var t,c=0,s=[],f=function(e,r,o){var i=new dE(e,r,n);s.push(i),i.on("init",(function(){++c===t.length&&a(s);})),i.targetElm=i.targetElm||o,i.render();};mE.unbind(window,"ready",u),function(t){var r=e[t];if(r)r.apply(n,[]);}("onpageload"),t=cu.unique(function(e){var t=[];if(wt.browser.isIE()&&wt.browser.version.major<11)return _y("TinyMCE does not support the browser you are using. For a list of supported browsers please see: https://www.tinymce.com/docs/get-started/system-requirements/"),[];if(kE)return _y("Failed to initialize the editor as the document is not in standards mode. TinyMCE requires standards mode."),[];if(e.types)return pE(e.types,(function(e){t=t.concat(mE.select(e.selector));})),t;if(e.selector)return mE.select(e.selector);if(e.target)return [e.target];switch(e.mode){case"exact":var n=e.elements||"";n.length>0&&pE(gE(n),(function(e){var n=mE.get(e);n?t.push(n):pE(document.forms,(function(n){pE(n.elements,(function(n){n.name===e&&(e="mce_editor_"+vE++,mE.setAttrib(n,"id",e),t.push(n));}));}));}));break;case"textareas":case"specific_textareas":pE(mE.select("textarea"),(function(n){e.editor_deselector&&i(n,e.editor_deselector)||e.editor_selector&&!i(n,e.editor_selector)||t.push(n);}));}return t}(e)),e.types?pE(e.types,(function(n){_t.each(t,(function(t){return !mE.is(t,n.selector)||(f(o(t),hE({},e,n),t),!1)}));})):(_t.each(t,(function(e){var t;(t=n.get(e.id))&&t.initialized&&!(t.getContainer()||t.getBody()).parentNode&&(SE(t),t.unbindAllNativeEvents(),t.destroy(!0),t.removed=!0,t=null);})),0===(t=_t.grep(t,(function(e){return !n.get(e.id)}))).length?a([]):pE(t,(function(t){!function(e,t){return e.inline&&t.tagName.toLowerCase()in r}(e,t)?f(o(t),e,t):_y("Could not initialize inline editor on invalid inline target element",t);})));};return n.settings=e,mE.bind(window,"ready",u),new Zr((function(e){t?e(t):a=function(t){e(t);};}))},get:function(e){return 0===arguments.length?CE.slice(0):l(e)?J(CE,(function(t){return t.id===e})).getOr(null):C(e)&&CE[e]?CE[e]:null},add:function(e){var t=this;return yE[e.id]===e||(null===t.get(e.id)&&("length"!==e.id&&(yE[e.id]=e),yE.push(e),CE.push(e)),wE(!0),t.activeEditor=e,t.fire("AddEditor",{editor:e}),Fx||(Fx=function(e){var n=t.fire("BeforeUnload");if(n.returnValue)return e.preventDefault(),e.returnValue=n.returnValue,n.returnValue},window.addEventListener("beforeunload",Fx))),e},createEditor:function(e,t){return this.add(new dE(e,t,this))},remove:function(e){var t,n,r=this;if(e){if(!l(e))return n=e,g(r.get(n.id))?null:(SE(n)&&r.fire("RemoveEditor",{editor:n}),0===CE.length&&window.removeEventListener("beforeunload",Fx),n.remove(),wE(CE.length>0),n);pE(mE.select(e),(function(e){(n=r.get(e.id))&&r.remove(n);}));}else for(t=CE.length-1;t>=0;t--)r.remove(CE[t]);},execCommand:function(e,t,n){var r=this,o=r.get(n);switch(e){case"mceAddEditor":return r.get(n)||new dE(n,r.settings,r).render(),!0;case"mceRemoveEditor":return o&&o.remove(),!0;case"mceToggleEditor":return o?(o.isHidden()?o.show():o.hide(),!0):(r.execCommand("mceAddEditor",!1,n),!0)}return !!r.activeEditor&&r.activeEditor.execCommand(e,t,n)},triggerSave:function(){pE(CE,(function(e){e.save();}));},addI18n:function(e,t){ku.add(e,t);},translate:function(e){return ku.translate(e)},setActive:function(e){var t=this.activeEditor;this.activeEditor!==e&&(t&&t.fire("deactivate",{relatedTarget:e}),e.fire("activate",{relatedTarget:t})),this.activeEditor=e;},_setBaseUrl:function(e){this.baseURL=new zm(this.documentBaseURL).toAbsolute(e.replace(/\/+$/,"")),this.baseURI=new zm(this.baseURL);}});NE.setup();var EE,_E,AE,RE,DE=Math.min,TE=Math.max,OE=Math.round,BE=function(e,t,n){var r=t.x,o=t.y,i=e.w,a=e.h,u=t.w,c=t.h,s=(n||"").split("");return "b"===s[0]&&(o+=c),"r"===s[1]&&(r+=u),"c"===s[0]&&(o+=OE(c/2)),"c"===s[1]&&(r+=OE(u/2)),"b"===s[3]&&(o-=a),"r"===s[4]&&(r-=i),"c"===s[3]&&(o-=OE(a/2)),"c"===s[4]&&(r-=OE(i/2)),PE(r,o,i,a)},PE=function(e,t,n,r){return {x:e,y:t,w:n,h:r}},LE={inflate:function(e,t,n){return PE(e.x-t,e.y-n,e.w+2*t,e.h+2*n)},relativePosition:BE,findBestRelativePosition:function(e,t,n,r){var o,i;for(i=0;i<r.length;i++)if((o=BE(e,t,r[i])).x>=n.x&&o.x+o.w<=n.w+n.x&&o.y>=n.y&&o.y+o.h<=n.h+n.y)return r[i];return null},intersect:function(e,t){var n=TE(e.x,t.x),r=TE(e.y,t.y),o=DE(e.x+e.w,t.x+t.w),i=DE(e.y+e.h,t.y+t.h);return o-n<0||i-r<0?null:PE(n,r,o-n,i-r)},clamp:function(e,t,n){var r=e.x,o=e.y,i=e.x+e.w,a=e.y+e.h,u=t.x+t.w,c=t.y+t.h,s=TE(0,t.x-r),f=TE(0,t.y-o),l=TE(0,i-u),d=TE(0,a-c);return r+=s,o+=f,n&&(i+=s,a+=f,r-=l,o-=d),PE(r,o,(i-=l)-r,(a-=d)-o)},create:PE,fromClientRect:function(e){return PE(e.left,e.top,e.width,e.height)}},IE=(EE={},_E={},{load:function(e,t){var n='Script at URL "'+t+'" failed to load',r='Script at URL "'+t+"\" did not call `tinymce.Resource.add('"+e+"', data)` within 1 second";if(void 0!==EE[e])return EE[e];var o=new Zr((function(o,i){var a=function(e,t,n){void 0===n&&(n=1e3);var r=!1,o=null,i=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];r||(r=!0,null!==o&&(clearTimeout(o),o=null),e.apply(null,t));}},a=i(e),u=i(t);return {start:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];r||null!==o||(o=setTimeout((function(){return u.apply(null,e)}),n));},resolve:a,reject:u}}(o,i);_E[e]=a.resolve,yu.ScriptLoader.loadScript(t,(function(){return a.start(r)}),(function(){return a.reject(n)}));}));return EE[e]=o,o},add:function(e,t){void 0!==_E[e]&&(_E[e](t),delete _E[e]),EE[e]=Zr.resolve(t);}}),ME=_t.each,FE=_t.extend,UE=function(){};UE.extend=AE=function(e){var t=this.prototype,n=function(){var e,t,n,r=this;if(!RE&&(r.init&&r.init.apply(r,arguments),t=r.Mixins))for(e=t.length;e--;)(n=t[e]).init&&n.init.apply(r,arguments);},r=function(){return this};RE=!0;var o=new this;return RE=!1,e.Mixins&&(ME(e.Mixins,(function(t){for(var n in t)"init"!==n&&(e[n]=t[n]);})),t.Mixins&&(e.Mixins=t.Mixins.concat(e.Mixins))),e.Methods&&ME(e.Methods.split(","),(function(t){e[t]=r;})),e.Properties&&ME(e.Properties.split(","),(function(t){var n="_"+t;e[t]=function(e){var t=this;return void 0!==e?(t[n]=e,t):t[n]};})),e.Statics&&ME(e.Statics,(function(e,t){n[t]=e;})),e.Defaults&&t.Defaults&&(e.Defaults=FE({},t.Defaults,e.Defaults)),le(e,(function(e,n){"function"==typeof e&&t[n]?o[n]=function(e,n){return function(){var r=this,o=r._super;r._super=t[e];var i=n.apply(r,arguments);return r._super=o,i}}(n,e):o[n]=e;})),n.prototype=o,n.constructor=n,n.extend=AE,n};var zE,HE=Math.min,jE=Math.max,VE=Math.round,qE={serialize:function(e){var t=JSON.stringify(e);return l(t)?t.replace(/[\u0080-\uFFFF]/g,(function(e){var t=e.charCodeAt(0).toString(16);return "\\u"+"0000".substring(t.length)+t})):t},parse:function(e){try{return JSON.parse(e)}catch(e){}}},$E={callbacks:{},count:0,send:function(e){var t=this,n=pu.DOM,r=void 0!==e.count?e.count:t.count,o="tinymce_jsonp_"+r;t.callbacks[r]=function(i){n.remove(o),delete t.callbacks[r],e.callback(i);},n.add(n.doc.body,"script",{id:o,src:e.url,type:"text/javascript"}),t.count++;}},WE=Re(Re({},$N),{send:function(e){var t,n=0,r=function(){!e.async||4===t.readyState||n++>1e4?(e.success&&n<1e4&&200===t.status?e.success.call(e.success_scope,""+t.responseText,t,e):e.error&&e.error.call(e.error_scope,n>1e4?"TIMED_OUT":"GENERAL",t,e),t=null):ro.setTimeout(r,10);};if(e.scope=e.scope||this,e.success_scope=e.success_scope||e.scope,e.error_scope=e.error_scope||e.scope,e.async=!1!==e.async,e.data=e.data||"",WE.fire("beforeInitialize",{settings:e}),(t=new XMLHttpRequest).overrideMimeType&&t.overrideMimeType(e.content_type),t.open(e.type||(e.data?"POST":"GET"),e.url,e.async),e.crossDomain&&(t.withCredentials=!0),e.content_type&&t.setRequestHeader("Content-Type",e.content_type),e.requestheaders&&_t.each(e.requestheaders,(function(e){t.setRequestHeader(e.key,e.value);})),t.setRequestHeader("X-Requested-With","XMLHttpRequest"),(t=WE.fire("beforeSend",{xhr:t,settings:e}).xhr).send(e.data),!e.async)return r();ro.setTimeout(r,10);}}),KE=_t.extend,XE=function(){function e(e){this.settings=KE({},e),this.count=0;}return e.sendRPC=function(t){return (new e).send(t)},e.prototype.send=function(e){var t=e.error,n=e.success,r=KE(this.settings,e);r.success=function(e,o){void 0===(e=qE.parse(e))&&(e={error:"JSON Parse error."}),e.error?t.call(r.error_scope||r.scope,e.error,o):n.call(r.success_scope||r.scope,e.result);},r.error=function(e,n){t&&t.call(r.error_scope||r.scope,e,n);},r.data=qE.serialize({id:e.id||"c"+this.count++,method:e.method,params:e.params}),r.content_type="application/json",WE.send(r);},e}();try{var YE="__storage_test__";(zE=window.localStorage).setItem(YE,YE),zE.removeItem(YE);}catch(e){zE=function(){var e={},t=[],n={getItem:function(t){return e[t]||null},setItem:function(n,r){t.push(n),e[n]=String(r);},key:function(e){return t[e]},removeItem:function(n){t=t.filter((function(e){return e===n})),delete e[n];},clear:function(){t=[],e={};},length:0};return Object.defineProperty(n,"length",{get:function(){return t.length},configurable:!1,enumerable:!1}),n}();}var GE={geom:{Rect:LE},util:{Promise:Zr,Delay:ro,Tools:_t,VK:od,URI:zm,Class:UE,EventDispatcher:VN,Observable:$N,I18n:ku,XHR:WE,JSON:qE,JSONRequest:XE,JSONP:$E,LocalStorage:zE,Color:function(e){var t={},n=0,r=0,o=0,i=function(e){var i;return "object"==typeof e?"r"in e?(n=e.r,r=e.g,o=e.b):"v"in e&&function(e,t,i){if(e=(parseInt(e,10)||0)%360,t=parseInt(t,10)/100,i=parseInt(i,10)/100,t=jE(0,HE(t,1)),i=jE(0,HE(i,1)),0!==t){var a=e/60,u=i*t,c=u*(1-Math.abs(a%2-1)),s=i-u;switch(Math.floor(a)){case 0:n=u,r=c,o=0;break;case 1:n=c,r=u,o=0;break;case 2:n=0,r=u,o=c;break;case 3:n=0,r=c,o=u;break;case 4:n=c,r=0,o=u;break;case 5:n=u,r=0,o=c;break;default:n=r=o=0;}n=VE(255*(n+s)),r=VE(255*(r+s)),o=VE(255*(o+s));}else n=r=o=VE(255*i);}(e.h,e.s,e.v):(i=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(e))?(n=parseInt(i[1],10),r=parseInt(i[2],10),o=parseInt(i[3],10)):(i=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(e))?(n=parseInt(i[1],16),r=parseInt(i[2],16),o=parseInt(i[3],16)):(i=/#([0-F])([0-F])([0-F])/gi.exec(e))&&(n=parseInt(i[1]+i[1],16),r=parseInt(i[2]+i[2],16),o=parseInt(i[3]+i[3],16)),n=n<0?0:n>255?255:n,r=r<0?0:r>255?255:r,o=o<0?0:o>255?255:o,t};return e&&i(e),t.toRgb=function(){return {r:n,g:r,b:o}},t.toHsv=function(){return function(e,t,n){var r,o;o=0;var i=HE(e/=255,HE(t/=255,n/=255)),a=jE(e,jE(t,n));return i===a?{h:0,s:0,v:100*(o=i)}:(r=(a-i)/a,o=a,{h:VE(60*((e===i?3:n===i?1:5)-(e===i?t-n:n===i?e-t:n-e)/(a-i))),s:VE(100*r),v:VE(100*o)})}(n,r,o)},t.toHex=function(){var e=function(e){return (e=parseInt(e,10).toString(16)).length>1?e:"0"+e};return "#"+e(n)+e(r)+e(o)},t.parse=i,t},ImageUploader:function(e){var t=Ty(),n=Iy(e,t);return {upload:function(t,r){return void 0===r&&(r=!0),n.upload(t,r?Ly(e):void 0)}}}},dom:{EventUtils:Ui,Sizzle:wa,DomQuery:cu,TreeWalker:ao,TextSeeker:Qu,DOMUtils:pu,ScriptLoader:yu,RangeUtils:xd,Serializer:Ob,StyleSheetLoader:oo,ControlSelection:ad,BookmarkManager:Ql,Selection:sb,Event:Ui.Event},html:{Styles:Di,Entities:bi,Node:Om,Schema:Ai,SaxParser:$m,DomParser:_b,Writer:Qm,Serializer:Zm},Env:wt,AddOnManager:Nu,Annotator:Jl,Formatter:qy,UndoManager:Wy,EditorCommands:BN,WindowManager:xy,NotificationManager:by,EditorObservable:GN,Shortcuts:iE,Editor:dE,FocusManager:cm,EditorManager:NE,DOM:pu.DOM,ScriptLoader:yu.ScriptLoader,PluginManager:yy,ThemeManager:Cy,IconManager:sy,Resource:IE,trim:_t.trim,isArray:_t.isArray,is:_t.is,toArray:_t.toArray,makeMap:_t.makeMap,each:_t.each,map:_t.map,grep:_t.grep,inArray:_t.inArray,extend:_t.extend,create:_t.create,walk:_t.walk,createNS:_t.createNS,resolve:_t.resolve,explode:_t.explode,_addCacheSuffix:_t._addCacheSuffix,isOpera:wt.opera,isWebKit:wt.webkit,isIE:wt.ie,isGecko:wt.gecko,isMac:wt.mac},JE=_t.extend(NE,GE);!function(e){window.tinymce=e,window.tinyMCE=e;}(JE),function(t){try{e.exports=t;}catch(e){}}(JE);}();}(tinymce);
26
+ !function(t,e){var o;o=function(){return (()=>{var t={d:(e,o)=>{for(var n in o)t.o(o,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:o[n]});},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0});}},e={};t.d(e,{default:()=>E});var o={};function n(t,e,o,n,i={}){e instanceof HTMLCollection||e instanceof NodeList?e=Array.from(e):Array.isArray(e)||(e=[e]),Array.isArray(o)||(o=[o]);for(const s of e)for(const e of o)s[t](e,n,{capture:!1,...i});return Array.prototype.slice.call(arguments,1)}t.r(o),t.d(o,{adjustableInputNumbers:()=>p,createElementFromString:()=>r,createFromTemplate:()=>a,eventPath:()=>l,off:()=>s,on:()=>i,resolveElement:()=>c});const i=n.bind(null,"addEventListener"),s=n.bind(null,"removeEventListener");function r(t){const e=document.createElement("div");return e.innerHTML=t.trim(),e.firstElementChild}function a(t){const e=(t,e)=>{const o=t.getAttribute(e);return t.removeAttribute(e),o},o=(t,n={})=>{const i=e(t,":obj"),s=e(t,":ref"),r=i?n[i]={}:n;s&&(n[s]=t);for(const n of Array.from(t.children)){const t=e(n,":arr"),i=o(n,t?{}:r);t&&(r[t]||(r[t]=[])).push(Object.keys(i).length?i:n);}return n};return o(r(t))}function l(t){let e=t.path||t.composedPath&&t.composedPath();if(e)return e;let o=t.target.parentElement;for(e=[t.target,o];o=o.parentElement;)e.push(o);return e.push(document,window),e}function c(t){return t instanceof Element?t:"string"==typeof t?t.split(/>>/g).reduce(((t,e,o,n)=>(t=t.querySelector(e),o<n.length-1?t.shadowRoot:t)),document):null}function p(t,e=(t=>t)){function o(o){const n=[.001,.01,.1][Number(o.shiftKey||2*o.ctrlKey)]*(o.deltaY<0?1:-1);let i=0,s=t.selectionStart;t.value=t.value.replace(/[\d.]+/g,((t,o)=>o<=s&&o+t.length>=s?(s=o,e(Number(t),n,i)):(i++,t))),t.focus(),t.setSelectionRange(s,s),o.preventDefault(),t.dispatchEvent(new Event("input"));}i(t,"focus",(()=>i(window,"wheel",o,{passive:!1}))),i(t,"blur",(()=>s(window,"wheel",o)));}const{min:u,max:h,floor:d,round:m}=Math;function f(t,e,o){e/=100,o/=100;const n=d(t=t/360*6),i=t-n,s=o*(1-e),r=o*(1-i*e),a=o*(1-(1-i)*e),l=n%6;return [255*[o,r,s,s,a,o][l],255*[a,o,o,r,s,s][l],255*[s,s,a,o,o,r][l]]}function v(t,e,o){const n=(2-(e/=100))*(o/=100)/2;return 0!==n&&(e=1===n?0:n<.5?e*o/(2*n):e*o/(2-2*n)),[t,100*e,100*n]}function b(t,e,o){const n=u(t/=255,e/=255,o/=255),i=h(t,e,o),s=i-n;let r,a;if(0===s)r=a=0;else {a=s/i;const n=((i-t)/6+s/2)/s,l=((i-e)/6+s/2)/s,c=((i-o)/6+s/2)/s;t===i?r=c-l:e===i?r=1/3+n-c:o===i&&(r=2/3+l-n),r<0?r+=1:r>1&&(r-=1);}return [360*r,100*a,100*i]}function _(t,e,o,n){return e/=100,o/=100,[...b(255*(1-u(1,(t/=100)*(1-(n/=100))+n)),255*(1-u(1,e*(1-n)+n)),255*(1-u(1,o*(1-n)+n)))]}function g(t,e,o){e/=100;const n=2*(e*=(o/=100)<.5?o:1-o)/(o+e)*100,i=100*(o+e);return [t,isNaN(n)?0:n,i]}function y(t){return b(...t.match(/.{2}/g).map((t=>parseInt(t,16))))}function w(t=0,e=0,o=0,n=1){const i=(t,e)=>(o=-1)=>e(~o?t.map((t=>Number(t.toFixed(o)))):t),s={h:t,s:e,v:o,a:n,toHSVA(){const t=[s.h,s.s,s.v,s.a];return t.toString=i(t,(t=>`hsva(${t[0]}, ${t[1]}%, ${t[2]}%, ${s.a})`)),t},toHSLA(){const t=[...v(s.h,s.s,s.v),s.a];return t.toString=i(t,(t=>`hsla(${t[0]}, ${t[1]}%, ${t[2]}%, ${s.a})`)),t},toRGBA(){const t=[...f(s.h,s.s,s.v),s.a];return t.toString=i(t,(t=>`rgba(${t[0]}, ${t[1]}, ${t[2]}, ${s.a})`)),t},toCMYK(){const t=function(t,e,o){const n=f(t,e,o),i=n[0]/255,s=n[1]/255,r=n[2]/255,a=u(1-i,1-s,1-r);return [100*(1===a?0:(1-i-a)/(1-a)),100*(1===a?0:(1-s-a)/(1-a)),100*(1===a?0:(1-r-a)/(1-a)),100*a]}(s.h,s.s,s.v);return t.toString=i(t,(t=>`cmyk(${t[0]}%, ${t[1]}%, ${t[2]}%, ${t[3]}%)`)),t},toHEXA(){const t=function(t,e,o){return f(t,e,o).map((t=>m(t).toString(16).padStart(2,"0")))}(s.h,s.s,s.v),e=s.a>=1?"":Number((255*s.a).toFixed(0)).toString(16).toUpperCase().padStart(2,"0");return e&&t.push(e),t.toString=()=>`#${t.join("").toUpperCase()}`,t},clone:()=>w(s.h,s.s,s.v,s.a)};return s}const A=t=>Math.max(Math.min(t,1),0);function k(t){const e={options:Object.assign({lock:null,onchange:()=>0,onstop:()=>0},t),_keyboard(t){const{options:o}=e,{type:n,key:i}=t;if(document.activeElement===o.wrapper){const{lock:o}=e.options,s="ArrowUp"===i,r="ArrowRight"===i,a="ArrowDown"===i,l="ArrowLeft"===i;if("keydown"===n&&(s||r||a||l)){let n=0,i=0;"v"===o?n=s||r?1:-1:"h"===o?n=s||r?-1:1:(i=s?-1:a?1:0,n=l?-1:r?1:0),e.update(A(e.cache.x+.01*n),A(e.cache.y+.01*i)),t.preventDefault();}else i.startsWith("Arrow")&&(e.options.onstop(),t.preventDefault());}},_tapstart(t){i(document,["mouseup","touchend","touchcancel"],e._tapstop),i(document,["mousemove","touchmove"],e._tapmove),t.cancelable&&t.preventDefault(),e._tapmove(t);},_tapmove(t){const{options:o,cache:n}=e,{lock:i,element:s,wrapper:r}=o,a=r.getBoundingClientRect();let l=0,c=0;if(t){const e=t&&t.touches&&t.touches[0];l=t?(e||t).clientX:0,c=t?(e||t).clientY:0,l<a.left?l=a.left:l>a.left+a.width&&(l=a.left+a.width),c<a.top?c=a.top:c>a.top+a.height&&(c=a.top+a.height),l-=a.left,c-=a.top;}else n&&(l=n.x*a.width,c=n.y*a.height);"h"!==i&&(s.style.left=`calc(${l/a.width*100}% - ${s.offsetWidth/2}px)`),"v"!==i&&(s.style.top=`calc(${c/a.height*100}% - ${s.offsetHeight/2}px)`),e.cache={x:l/a.width,y:c/a.height};const p=A(l/a.width),u=A(c/a.height);switch(i){case"v":return o.onchange(p);case"h":return o.onchange(u);default:return o.onchange(p,u)}},_tapstop(){e.options.onstop(),s(document,["mouseup","touchend","touchcancel"],e._tapstop),s(document,["mousemove","touchmove"],e._tapmove);},trigger(){e._tapmove();},update(t=0,o=0){const{left:n,top:i,width:s,height:r}=e.options.wrapper.getBoundingClientRect();"h"===e.options.lock&&(o=t),e._tapmove({clientX:n+s*t,clientY:i+r*o});},destroy(){const{options:t,_tapstart:o,_keyboard:n}=e;s(document,["keydown","keyup"],n),s([t.wrapper,t.element],"mousedown",o),s([t.wrapper,t.element],"touchstart",o,{passive:!1});}},{options:o,_tapstart:n,_keyboard:r}=e;return i([o.wrapper,o.element],"mousedown",n),i([o.wrapper,o.element],"touchstart",n,{passive:!1}),i(document,["keydown","keyup"],r),e}function C(t={}){t=Object.assign({onchange:()=>0,className:"",elements:[]},t);const e=i(t.elements,"click",(e=>{t.elements.forEach((o=>o.classList[e.target===o?"add":"remove"](t.className))),t.onchange(e),e.stopPropagation();}));return {destroy:()=>s(...e)}}const $={variantFlipOrder:{start:"sme",middle:"mse",end:"ems"},positionFlipOrder:{top:"tbrl",right:"rltb",bottom:"btrl",left:"lrbt"},position:"bottom",margin:8};function S(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}class E{constructor(t){S(this,"_initializingActive",!0),S(this,"_recalc",!0),S(this,"_nanopop",null),S(this,"_root",null),S(this,"_color",w()),S(this,"_lastColor",w()),S(this,"_swatchColors",[]),S(this,"_setupAnimationFrame",null),S(this,"_eventListener",{init:[],save:[],hide:[],show:[],clear:[],change:[],changestop:[],cancel:[],swatchselect:[]}),this.options=t=Object.assign({...E.DEFAULT_OPTIONS},t);const{swatches:e,components:o,theme:n,sliders:i,lockOpacity:s,padding:r}=t;["nano","monolith"].includes(n)&&!i&&(t.sliders="h"),o.interaction||(o.interaction={});const{preview:a,opacity:l,hue:c,palette:p}=o;o.opacity=!s&&l,o.palette=p||a||l||c,this._preBuild(),this._buildComponents(),this._bindEvents(),this._finalBuild(),e&&e.length&&e.forEach((t=>this.addSwatch(t)));const{button:u,app:h}=this._root;this._nanopop=((t,e,o)=>{const n="object"!=typeof t||t instanceof HTMLElement?{reference:t,popper:e,...o}:t;return {update(t=n){const{reference:e,popper:o}=Object.assign(n,t);if(!o||!e)throw new Error("Popper- or reference-element missing.");return ((t,e,o)=>{const{container:n,margin:i,position:s,variantFlipOrder:r,positionFlipOrder:a}={container:document.documentElement.getBoundingClientRect(),...$,...o},{left:l,top:c}=e.style;e.style.left="0",e.style.top="0";const p=t.getBoundingClientRect(),u=e.getBoundingClientRect(),h={t:p.top-u.height-i,b:p.bottom+i,r:p.right+i,l:p.left-u.width-i},d={vs:p.left,vm:p.left+p.width/2+-u.width/2,ve:p.left+p.width-u.width,hs:p.top,hm:p.bottom-p.height/2-u.height/2,he:p.bottom-u.height},[m,f="middle"]=s.split("-"),v=a[m],b=r[f],{top:_,left:g,bottom:y,right:w}=n;for(const t of v){const o="t"===t||"b"===t,n=h[t],[i,s]=o?["top","left"]:["left","top"],[r,a]=o?[u.height,u.width]:[u.width,u.height],[l,c]=o?[y,w]:[w,y],[p,m]=o?[_,g]:[g,_];if(!(n<p||n+r>l))for(const r of b){const l=d[(o?"v":"h")+r];if(!(l<m||l+a>c))return e.style[s]=l-u[s]+"px",e.style[i]=n-u[i]+"px",t+r}}return e.style.left=l,e.style.top=c,null})(e,o,n)}}})(u,h,{margin:r}),u.setAttribute("role","button"),u.setAttribute("aria-label",this._t("btn:toggle"));const d=this;this._setupAnimationFrame=requestAnimationFrame((function e(){if(!h.offsetWidth)return requestAnimationFrame(e);d.setColor(t.default),d._rePositioningPicker(),t.defaultRepresentation&&(d._representation=t.defaultRepresentation,d.setColorRepresentation(d._representation)),t.showAlways&&d.show(),d._initializingActive=!1,d._emit("init");}));}_preBuild(){const{options:t}=this;for(const e of ["el","container"])t[e]=c(t[e]);this._root=(t=>{const{components:e,useAsButton:o,inline:n,appClass:i,theme:s,lockOpacity:r}=t.options,l=t=>t?"":'style="display:none" hidden',c=e=>t._t(e),p=a(`\n <div :ref="root" class="pickr">\n\n ${o?"":'<button type="button" :ref="button" class="pcr-button"></button>'}\n\n <div :ref="app" class="pcr-app ${i||""}" data-theme="${s}" ${n?'style="position: unset"':""} aria-label="${c("ui:dialog")}" role="window">\n <div class="pcr-selection" ${l(e.palette)}>\n <div :obj="preview" class="pcr-color-preview" ${l(e.preview)}>\n <button type="button" :ref="lastColor" class="pcr-last-color" aria-label="${c("btn:last-color")}"></button>\n <div :ref="currentColor" class="pcr-current-color"></div>\n </div>\n\n <div :obj="palette" class="pcr-color-palette">\n <div :ref="picker" class="pcr-picker"></div>\n <div :ref="palette" class="pcr-palette" tabindex="0" aria-label="${c("aria:palette")}" role="listbox"></div>\n </div>\n\n <div :obj="hue" class="pcr-color-chooser" ${l(e.hue)}>\n <div :ref="picker" class="pcr-picker"></div>\n <div :ref="slider" class="pcr-hue pcr-slider" tabindex="0" aria-label="${c("aria:hue")}" role="slider"></div>\n </div>\n\n <div :obj="opacity" class="pcr-color-opacity" ${l(e.opacity)}>\n <div :ref="picker" class="pcr-picker"></div>\n <div :ref="slider" class="pcr-opacity pcr-slider" tabindex="0" aria-label="${c("aria:opacity")}" role="slider"></div>\n </div>\n </div>\n\n <div class="pcr-swatches ${e.palette?"":"pcr-last"}" :ref="swatches"></div>\n\n <div :obj="interaction" class="pcr-interaction" ${l(Object.keys(e.interaction).length)}>\n <input :ref="result" class="pcr-result" type="text" spellcheck="false" ${l(e.interaction.input)} aria-label="${c("aria:input")}">\n\n <input :arr="options" class="pcr-type" data-type="HEXA" value="${r?"HEX":"HEXA"}" type="button" ${l(e.interaction.hex)}>\n <input :arr="options" class="pcr-type" data-type="RGBA" value="${r?"RGB":"RGBA"}" type="button" ${l(e.interaction.rgba)}>\n <input :arr="options" class="pcr-type" data-type="HSLA" value="${r?"HSL":"HSLA"}" type="button" ${l(e.interaction.hsla)}>\n <input :arr="options" class="pcr-type" data-type="HSVA" value="${r?"HSV":"HSVA"}" type="button" ${l(e.interaction.hsva)}>\n <input :arr="options" class="pcr-type" data-type="CMYK" value="CMYK" type="button" ${l(e.interaction.cmyk)}>\n\n <input :ref="save" class="pcr-save" value="${c("btn:save")}" type="button" ${l(e.interaction.save)} aria-label="${c("aria:btn:save")}">\n <input :ref="cancel" class="pcr-cancel" value="${c("btn:cancel")}" type="button" ${l(e.interaction.cancel)} aria-label="${c("aria:btn:cancel")}">\n <input :ref="clear" class="pcr-clear" value="${c("btn:clear")}" type="button" ${l(e.interaction.clear)} aria-label="${c("aria:btn:clear")}">\n </div>\n </div>\n </div>\n `),u=p.interaction;return u.options.find((t=>!t.hidden&&!t.classList.add("active"))),u.type=()=>u.options.find((t=>t.classList.contains("active"))),p})(this),t.useAsButton&&(this._root.button=t.el),t.container.appendChild(this._root.root);}_finalBuild(){const t=this.options,e=this._root;if(t.container.removeChild(e.root),t.inline){const o=t.el.parentElement;t.el.nextSibling?o.insertBefore(e.app,t.el.nextSibling):o.appendChild(e.app);}else t.container.appendChild(e.app);t.useAsButton?t.inline&&t.el.remove():t.el.parentNode.replaceChild(e.root,t.el),t.disabled&&this.disable(),t.comparison||(e.button.style.transition="none",t.useAsButton||(e.preview.lastColor.style.transition="none")),this.hide();}_buildComponents(){const t=this,e=this.options.components,o=(t.options.sliders||"v").repeat(2),[n,i]=o.match(/^[vh]+$/g)?o:[],s=()=>this._color||(this._color=this._lastColor.clone()),r={palette:k({element:t._root.palette.picker,wrapper:t._root.palette.palette,onstop:()=>t._emit("changestop","slider",t),onchange(o,n){if(!e.palette)return;const i=s(),{_root:r,options:a}=t,{lastColor:l,currentColor:c}=r.preview;t._recalc&&(i.s=100*o,i.v=100-100*n,i.v<0&&(i.v=0),t._updateOutput("slider"));const p=i.toRGBA().toString(0);this.element.style.background=p,this.wrapper.style.background=`\n linear-gradient(to top, rgba(0, 0, 0, ${i.a}), transparent),\n linear-gradient(to left, hsla(${i.h}, 100%, 50%, ${i.a}), rgba(255, 255, 255, ${i.a}))\n `,a.comparison?a.useAsButton||t._lastColor||l.style.setProperty("--pcr-color",p):(r.button.style.setProperty("--pcr-color",p),r.button.classList.remove("clear"));const u=i.toHEXA().toString();for(const{el:e,color:o}of t._swatchColors)e.classList[u===o.toHEXA().toString()?"add":"remove"]("pcr-active");c.style.setProperty("--pcr-color",p);}}),hue:k({lock:"v"===i?"h":"v",element:t._root.hue.picker,wrapper:t._root.hue.slider,onstop:()=>t._emit("changestop","slider",t),onchange(o){if(!e.hue||!e.palette)return;const n=s();t._recalc&&(n.h=360*o),this.element.style.backgroundColor=`hsl(${n.h}, 100%, 50%)`,r.palette.trigger();}}),opacity:k({lock:"v"===n?"h":"v",element:t._root.opacity.picker,wrapper:t._root.opacity.slider,onstop:()=>t._emit("changestop","slider",t),onchange(o){if(!e.opacity||!e.palette)return;const n=s();t._recalc&&(n.a=Math.round(100*o)/100),this.element.style.background=`rgba(0, 0, 0, ${n.a})`,r.palette.trigger();}}),selectable:C({elements:t._root.interaction.options,className:"active",onchange(e){t._representation=e.target.getAttribute("data-type").toUpperCase(),t._recalc&&t._updateOutput("swatch");}})};this._components=r;}_bindEvents(){const{_root:t,options:e}=this,o=[i(t.interaction.clear,"click",(()=>this._clearColor())),i([t.interaction.cancel,t.preview.lastColor],"click",(()=>{this.setHSVA(...(this._lastColor||this._color).toHSVA(),!0),this._emit("cancel");})),i(t.interaction.save,"click",(()=>{!this.applyColor()&&!e.showAlways&&this.hide();})),i(t.interaction.result,["keyup","input"],(t=>{this.setColor(t.target.value,!0)&&!this._initializingActive&&(this._emit("change",this._color,"input",this),this._emit("changestop","input",this)),t.stopImmediatePropagation();})),i(t.interaction.result,["focus","blur"],(t=>{this._recalc="blur"===t.type,this._recalc&&this._updateOutput(null);})),i([t.palette.palette,t.palette.picker,t.hue.slider,t.hue.picker,t.opacity.slider,t.opacity.picker],["mousedown","touchstart"],(()=>this._recalc=!0),{passive:!0})];if(!e.showAlways){const n=e.closeWithKey;o.push(i(t.button,"click",(()=>this.isOpen()?this.hide():this.show())),i(document,"keyup",(t=>this.isOpen()&&(t.key===n||t.code===n)&&this.hide())),i(document,["touchstart","mousedown"],(e=>{this.isOpen()&&!l(e).some((e=>e===t.app||e===t.button))&&this.hide();}),{capture:!0}));}if(e.adjustableNumbers){const e={rgba:[255,255,255,1],hsva:[360,100,100,1],hsla:[360,100,100,1],cmyk:[100,100,100,100]};p(t.interaction.result,((t,o,n)=>{const i=e[this.getColorRepresentation().toLowerCase()];if(i){const e=i[n],s=t+(e>=100?1e3*o:o);return s<=0?0:Number((s<e?s:e).toPrecision(3))}return t}));}if(e.autoReposition&&!e.inline){let t=null;const n=this;o.push(i(window,["scroll","resize"],(()=>{n.isOpen()&&(e.closeOnScroll&&n.hide(),null===t?(t=setTimeout((()=>t=null),100),requestAnimationFrame((function e(){n._rePositioningPicker(),null!==t&&requestAnimationFrame(e);}))):(clearTimeout(t),t=setTimeout((()=>t=null),100)));}),{capture:!0}));}this._eventBindings=o;}_rePositioningPicker(){const{options:t}=this;if(!t.inline&&!this._nanopop.update({container:document.body.getBoundingClientRect(),position:t.position})){const t=this._root.app,e=t.getBoundingClientRect();t.style.top=(window.innerHeight-e.height)/2+"px",t.style.left=(window.innerWidth-e.width)/2+"px";}}_updateOutput(t){const{_root:e,_color:o,options:n}=this;if(e.interaction.type()){const t=`to${e.interaction.type().getAttribute("data-type")}`;e.interaction.result.value="function"==typeof o[t]?o[t]().toString(n.outputPrecision):"";}!this._initializingActive&&this._recalc&&this._emit("change",o,t,this);}_clearColor(t=!1){const{_root:e,options:o}=this;o.useAsButton||e.button.style.setProperty("--pcr-color","rgba(0, 0, 0, 0.15)"),e.button.classList.add("clear"),o.showAlways||this.hide(),this._lastColor=null,this._initializingActive||t||(this._emit("save",null),this._emit("clear"));}_parseLocalColor(t){const{values:e,type:o,a:n}=function(t){t=t.match(/^[a-zA-Z]+$/)?function(t){if("black"===t.toLowerCase())return "#000";const e=document.createElement("canvas").getContext("2d");return e.fillStyle=t,"#000"===e.fillStyle?null:e.fillStyle}(t):t;const e={cmyk:/^cmyk[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)/i,rgba:/^((rgba)|rgb)[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)[\D]*?([\d.]+|$)/i,hsla:/^((hsla)|hsl)[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)[\D]*?([\d.]+|$)/i,hsva:/^((hsva)|hsv)[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)[\D]*?([\d.]+|$)/i,hexa:/^#?(([\dA-Fa-f]{3,4})|([\dA-Fa-f]{6})|([\dA-Fa-f]{8}))$/i},o=t=>t.map((t=>/^(|\d+)\.\d+|\d+$/.test(t)?Number(t):void 0));let n;t:for(const i in e){if(!(n=e[i].exec(t)))continue;const s=t=>!!n[2]==("number"==typeof t);switch(i){case"cmyk":{const[,t,e,s,r]=o(n);if(t>100||e>100||s>100||r>100)break t;return {values:_(t,e,s,r),type:i}}case"rgba":{const[,,,t,e,r,a]=o(n);if(t>255||e>255||r>255||a<0||a>1||!s(a))break t;return {values:[...b(t,e,r),a],a:a,type:i}}case"hexa":{let[,t]=n;4!==t.length&&3!==t.length||(t=t.split("").map((t=>t+t)).join(""));const e=t.substring(0,6);let o=t.substring(6);return o=o?parseInt(o,16)/255:void 0,{values:[...y(e),o],a:o,type:i}}case"hsla":{const[,,,t,e,r,a]=o(n);if(t>360||e>100||r>100||a<0||a>1||!s(a))break t;return {values:[...g(t,e,r),a],a:a,type:i}}case"hsva":{const[,,,t,e,r,a]=o(n);if(t>360||e>100||r>100||a<0||a>1||!s(a))break t;return {values:[t,e,r,a],a:a,type:i}}}}return {values:null,type:null}}(t),{lockOpacity:i}=this.options,s=void 0!==n&&1!==n;return e&&3===e.length&&(e[3]=void 0),{values:!e||i&&s?null:e,type:o}}_t(t){return this.options.i18n[t]||E.I18N_DEFAULTS[t]}_emit(t,...e){this._eventListener[t].forEach((t=>t(...e,this)));}on(t,e){return this._eventListener[t].push(e),this}off(t,e){const o=this._eventListener[t]||[],n=o.indexOf(e);return ~n&&o.splice(n,1),this}addSwatch(t){const{values:e}=this._parseLocalColor(t);if(e){const{_swatchColors:t,_root:o}=this,n=w(...e),s=r(`<button type="button" style="--pcr-color: ${n.toRGBA().toString(0)}" aria-label="${this._t("btn:swatch")}"/>`);return o.swatches.appendChild(s),t.push({el:s,color:n}),this._eventBindings.push(i(s,"click",(()=>{this.setHSVA(...n.toHSVA(),!0),this._emit("swatchselect",n),this._emit("change",n,"swatch",this);}))),!0}return !1}removeSwatch(t){const e=this._swatchColors[t];if(e){const{el:o}=e;return this._root.swatches.removeChild(o),this._swatchColors.splice(t,1),!0}return !1}applyColor(t=!1){const{preview:e,button:o}=this._root,n=this._color.toRGBA().toString(0);return e.lastColor.style.setProperty("--pcr-color",n),this.options.useAsButton||o.style.setProperty("--pcr-color",n),o.classList.remove("clear"),this._lastColor=this._color.clone(),this._initializingActive||t||this._emit("save",this._color),this}destroy(){cancelAnimationFrame(this._setupAnimationFrame),this._eventBindings.forEach((t=>s(...t))),Object.keys(this._components).forEach((t=>this._components[t].destroy()));}destroyAndRemove(){this.destroy();const{root:t,app:e}=this._root;t.parentElement&&t.parentElement.removeChild(t),e.parentElement.removeChild(e),Object.keys(this).forEach((t=>this[t]=null));}hide(){return !!this.isOpen()&&(this._root.app.classList.remove("visible"),this._emit("hide"),!0)}show(){return !this.options.disabled&&!this.isOpen()&&(this._root.app.classList.add("visible"),this._rePositioningPicker(),this._emit("show",this._color),this)}isOpen(){return this._root.app.classList.contains("visible")}setHSVA(t=360,e=0,o=0,n=1,i=!1){const s=this._recalc;if(this._recalc=!1,t<0||t>360||e<0||e>100||o<0||o>100||n<0||n>1)return !1;this._color=w(t,e,o,n);const{hue:r,opacity:a,palette:l}=this._components;return r.update(t/360),a.update(n),l.update(e/100,1-o/100),i||this.applyColor(),s&&this._updateOutput(),this._recalc=s,!0}setColor(t,e=!1){if(null===t)return this._clearColor(e),!0;const{values:o,type:n}=this._parseLocalColor(t);if(o){const t=n.toUpperCase(),{options:i}=this._root.interaction,s=i.find((e=>e.getAttribute("data-type")===t));if(s&&!s.hidden)for(const t of i)t.classList[t===s?"add":"remove"]("active");return !!this.setHSVA(...o,e)&&this.setColorRepresentation(t)}return !1}setColorRepresentation(t){return t=t.toUpperCase(),!!this._root.interaction.options.find((e=>e.getAttribute("data-type").startsWith(t)&&!e.click()))}getColorRepresentation(){return this._representation}getColor(){return this._color}getSelectedColor(){return this._lastColor}getRoot(){return this._root}disable(){return this.hide(),this.options.disabled=!0,this._root.button.classList.add("disabled"),this}enable(){return this.options.disabled=!1,this._root.button.classList.remove("disabled"),this}}return S(E,"utils",o),S(E,"version","1.8.2"),S(E,"I18N_DEFAULTS",{"ui:dialog":"color picker dialog","btn:toggle":"toggle color picker dialog","btn:swatch":"color swatch","btn:last-color":"use previous color","btn:save":"Save","btn:cancel":"Cancel","btn:clear":"Clear","aria:btn:save":"save and close","aria:btn:cancel":"cancel and close","aria:btn:clear":"clear and close","aria:input":"color input field","aria:palette":"color selection area","aria:hue":"hue selection slider","aria:opacity":"selection slider"}),S(E,"DEFAULT_OPTIONS",{appClass:null,theme:"classic",useAsButton:!1,padding:8,disabled:!1,comparison:!0,closeOnScroll:!1,outputPrecision:0,lockOpacity:!1,autoReposition:!0,container:"body",components:{interaction:{}},i18n:{},swatches:null,inline:!1,sliders:null,default:"#42445a",defaultRepresentation:null,position:"bottom-middle",adjustableNumbers:!0,showAlways:!1,closeWithKey:"Escape"}),S(E,"create",(t=>new E(t))),e.default})()},pickr_min.exports=o();}();getDefaultExportFromCjs(pickr_min.exports);var Inline=function(){function o(){}return o.load=function(n,r){var t,e=$(n);e.addClass("loading"),r.onLoad&&r.onLoad(n);var l=e.data("url");$.get(l,(function(o){r.onRender&&(o=r.onRender(o,n)),e.html(o),e.removeClass("loading"),r.onComplete&&r.onComplete(o,n);})).fail(null!==(t=r.onError)&&void 0!==t?t:o.handleError);},o.task=function(n,r,t,e){void 0===t&&(t=null),void 0===e&&(e=null),r&&r.classList.add("loading"),$.get(n,(function(o){r&&r.classList.remove("loading"),t&&t(o,r);})).fail(null!=e?e:o.handleError);},o.post=function(n,r,t,e){void 0===t&&(t=null),void 0===e&&(e=null),r&&r.classList.add("loading"),$.post(n,(function(o){r&&r.classList.remove("loading"),t&&t(o,r);})).fail(null!=e?e:o.handleError);},o.handleError=function(o,n,r){500===o.status?Alerts.error("There was an error processing the content, please contact an administrator if this continues.","Error "+o.status,1e4):404===o.status?Alerts.error("The content could not be found.","Error "+o.status,1e4):401===o.status&&(Alerts.error("You are not allowed to view this resource, are you logged in correctly?","Error "+o.status,1e4),window.location=window.location);},o}();var tinymce = {exports: {}};!function(e){!function(){var t=function(e){if(null===e)return "null";if(void 0===e)return "undefined";var t=typeof e;return "object"===t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"===t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t},n=function(e){return {eq:e}},r=n((function(e,t){return e===t})),o=function(e){return n((function(t,n){if(t.length!==n.length)return !1;for(var r=t.length,o=0;o<r;o++)if(!e.eq(t[o],n[o]))return !1;return !0}))},i=function(e,t){return function(e,t){return n((function(n,r){return e.eq(t(n),t(r))}))}(o(e),(function(e){return function(e,t){return Array.prototype.slice.call(e).sort(t)}(e,t)}))},a=function(e){return n((function(t,n){var o=Object.keys(t),a=Object.keys(n);if(!i(r).eq(o,a))return !1;for(var u=o.length,c=0;c<u;c++){var s=o[c];if(!e.eq(t[s],n[s]))return !1}return !0}))},u=n((function(e,n){if(e===n)return !0;var r=t(e);return r===t(n)&&(function(e){return -1!==["undefined","boolean","number","string","function","xml","null"].indexOf(e)}(r)?e===n:"array"===r?o(u).eq(e,n):"object"===r&&a(u).eq(e,n))})),c=function(e){return function(t){return r=typeof(n=t),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===e;var n,r;}},s=function(e){return function(t){return typeof t===e}},f=function(e){return function(t){return e===t}},l=c("string"),d=c("object"),m=c("array"),g=f(null),p=s("boolean"),h=f(void 0),v=function(e){return null==e},b=function(e){return !v(e)},y=s("function"),C=s("number"),x=function(){},w=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e(t.apply(null,n))}},S=function(e,t){return function(n){return e(t(n))}},k=function(e){return function(){return e}},N=function(e){return e},E=function(e,t){return e===t};function _(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=t.concat(n);return e.apply(null,o)}}var A=function(e){return function(t){return !e(t)}},R=function(e){return e()},D=function(e){e();},T=k(!1),O=k(!0),B=function(){return P},P=function(){var e=function(e){return e()},t=N;return {fold:function(e,t){return e()},isSome:T,isNone:O,getOr:t,getOrThunk:e,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:k(null),getOrUndefined:k(void 0),or:t,orThunk:e,map:B,each:x,bind:B,exists:T,forall:O,filter:function(){return B()},toArray:function(){return []},toString:k("none()")}}(),L=function(e){var t=k(e),n=function(){return o},r=function(t){return t(e)},o={fold:function(t,n){return n(e)},isSome:O,isNone:T,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:n,orThunk:n,map:function(t){return L(t(e))},each:function(t){t(e);},bind:r,exists:r,forall:r,filter:function(t){return t(e)?o:P},toArray:function(){return [e]},toString:function(){return "some("+e+")"}};return o},I={some:L,none:B,from:function(e){return null==e?P:L(e)}},M=Array.prototype.slice,F=Array.prototype.indexOf,U=Array.prototype.push,z=function(e,t){return F.call(e,t)},H=function(e,t){return z(e,t)>-1},j=function(e,t){for(var n=0,r=e.length;n<r;n++){if(t(e[n],n))return !0}return !1},V=function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o);}return r},q=function(e,t){for(var n=0,r=e.length;n<r;n++){t(e[n],n);}},$=function(e,t){for(var n=e.length-1;n>=0;n--){t(e[n],n);}},W=function(e,t){for(var n=[],r=[],o=0,i=e.length;o<i;o++){var a=e[o];(t(a,o)?n:r).push(a);}return {pass:n,fail:r}},K=function(e,t){for(var n=[],r=0,o=e.length;r<o;r++){var i=e[r];t(i,r)&&n.push(i);}return n},X=function(e,t,n){return $(e,(function(e,r){n=t(n,e,r);})),n},Y=function(e,t,n){return q(e,(function(e,r){n=t(n,e,r);})),n},G=function(e,t,n){for(var r=0,o=e.length;r<o;r++){var i=e[r];if(t(i,r))return I.some(i);if(n(i,r))break}return I.none()},J=function(e,t){return G(e,t,T)},Q=function(e,t){for(var n=0,r=e.length;n<r;n++){if(t(e[n],n))return I.some(n)}return I.none()},Z=function(e,t){return function(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!m(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);U.apply(t,e[n]);}return t}(V(e,t))},ee=function(e,t){for(var n=0,r=e.length;n<r;++n){if(!0!==t(e[n],n))return !1}return !0},te=function(e){var t=M.call(e,0);return t.reverse(),t},ne=function(e,t){return K(e,(function(e){return !H(t,e)}))},re=function(e,t){var n=M.call(e,0);return n.sort(t),n},oe=function(e,t){return t>=0&&t<e.length?I.some(e[t]):I.none()},ie=function(e){return oe(e,0)},ae=function(e){return oe(e,e.length-1)},ue=y(Array.from)?Array.from:function(e){return M.call(e)},ce=function(e,t){for(var n=0;n<e.length;n++){var r=t(e[n],n);if(r.isSome())return r}return I.none()},se=Object.keys,fe=Object.hasOwnProperty,le=function(e,t){for(var n=se(e),r=0,o=n.length;r<o;r++){var i=n[r];t(e[i],i);}},de=function(e,t){return me(e,(function(e,n){return {k:n,v:t(e,n)}}))},me=function(e,t){var n={};return le(e,(function(e,r){var o=t(e,r);n[o.k]=o.v;})),n},ge=function(e){return function(t,n){e[n]=t;}},pe=function(e,t,n,r){return le(e,(function(e,o){(t(e,o)?n:r)(e,o);})),{}},he=function(e,t){var n={};return pe(e,t,ge(n),x),n},ve=function(e){return function(e,t){var n=[];return le(e,(function(e,r){n.push(t(e,r));})),n}(e,N)},be=function(e,t){return ye(e,t)?I.from(e[t]):I.none()},ye=function(e,t){return fe.call(e,t)},Ce=function(e,t){return ye(e,t)&&void 0!==e[t]&&null!==e[t]},xe=Array.isArray,we=function(e,t,n){var r,o;if(!e)return !1;if(n=n||e,void 0!==e.length){for(r=0,o=e.length;r<o;r++)if(!1===t.call(n,e[r],r,e))return !1}else for(r in e)if(ye(e,r)&&!1===t.call(n,e[r],r,e))return !1;return !0},Se=function(e,t){var n=[];return we(e,(function(r,o){n.push(t(r,o,e));})),n},ke=function(e,t){var n=[];return we(e,(function(r,o){t&&!t(r,o,e)||n.push(r);})),n},Ne=function(e,t){if(e)for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return -1},Ee=function(e,t,n,r){for(var o=h(n)?e[0]:n,i=0;i<e.length;i++)o=t.call(r,o,e[i],i);return o},_e=function(e,t,n){var r,o;for(r=0,o=e.length;r<o;r++)if(t.call(n,e[r],r,e))return r;return -1},Ae=function(e){return e[e.length-1]},Re=function(){return Re=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},Re.apply(this,arguments)};function De(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}var Te=function(e){var t,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,t=e.apply(null,r)),t}},Oe=function(){return Be(0,0)},Be=function(e,t){return {major:e,minor:t}},Pe={nu:Be,detect:function(e,t){var n=String(t).toLowerCase();return 0===e.length?Oe():function(e,t){var n=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.test(t))return r}}(e,t);if(!n)return {major:0,minor:0};var r=function(e){return Number(t.replace(n,"$"+e))};return Be(r(1),r(2))}(e,n)},unknown:Oe},Le=function(e,t){var n=String(t).toLowerCase();return J(e,(function(e){return e.search(n)}))},Ie=function(e,t){return -1!==e.indexOf(t)},Me=function(e,t){return function(e,t,n){return ""===t||e.length>=t.length&&e.substr(n,n+t.length)===t}(e,t,0)},Fe=function(e){return function(t){return t.replace(e,"")}},Ue=Fe(/^\s+|\s+$/g),ze=Fe(/^\s+/g),He=Fe(/\s+$/g),je=function(e){return e.length>0},Ve=function(e){return !je(e)},qe=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,$e=function(e){return function(t){return Ie(t,e)}},We=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return Ie(e,"edge/")&&Ie(e,"chrome")&&Ie(e,"safari")&&Ie(e,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,qe],search:function(e){return Ie(e,"chrome")&&!Ie(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return Ie(e,"msie")||Ie(e,"trident")}},{name:"Opera",versionRegexes:[qe,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:$e("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:$e("firefox")},{name:"Safari",versionRegexes:[qe,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return (Ie(e,"safari")||Ie(e,"mobile/"))&&Ie(e,"applewebkit")}}],Ke=[{name:"Windows",search:$e("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return Ie(e,"iphone")||Ie(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:$e("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:$e("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:$e("linux"),versionRegexes:[]},{name:"Solaris",search:$e("sunos"),versionRegexes:[]},{name:"FreeBSD",search:$e("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:$e("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Xe={browsers:k(We),oses:k(Ke)},Ye="Edge",Ge="Chrome",Je="Opera",Qe="Firefox",Ze="Safari",et=function(e){var t=e.current,n=e.version,r=function(e){return function(){return t===e}};return {current:t,version:n,isEdge:r(Ye),isChrome:r(Ge),isIE:r("IE"),isOpera:r(Je),isFirefox:r(Qe),isSafari:r(Ze)}},tt={unknown:function(){return et({current:void 0,version:Pe.unknown()})},nu:et,edge:k(Ye),chrome:k(Ge),ie:k("IE"),opera:k(Je),firefox:k(Qe),safari:k(Ze)},nt="Windows",rt="Android",ot="Linux",it="Solaris",at="FreeBSD",ut="ChromeOS",ct=function(e){var t=e.current,n=e.version,r=function(e){return function(){return t===e}};return {current:t,version:n,isWindows:r(nt),isiOS:r("iOS"),isAndroid:r(rt),isOSX:r("OSX"),isLinux:r(ot),isSolaris:r(it),isFreeBSD:r(at),isChromeOS:r(ut)}},st={unknown:function(){return ct({current:void 0,version:Pe.unknown()})},nu:ct,windows:k(nt),ios:k("iOS"),android:k(rt),linux:k(ot),osx:k("OSX"),solaris:k(it),freebsd:k(at),chromeos:k(ut)},ft=function(e,t,n){var r=Xe.browsers(),o=Xe.oses(),i=t.bind((function(e){return function(e,t){return ce(t.brands,(function(t){var n=t.brand.toLowerCase();return J(e,(function(e){var t;return n===(null===(t=e.brand)||void 0===t?void 0:t.toLowerCase())})).map((function(e){return {current:e.name,version:Pe.nu(parseInt(t.version,10),0)}}))}))}(r,e)})).orThunk((function(){return function(e,t){return Le(e,t).map((function(e){var n=Pe.detect(e.versionRegexes,t);return {current:e.name,version:n}}))}(r,e)})).fold(tt.unknown,tt.nu),a=function(e,t){return Le(e,t).map((function(e){var n=Pe.detect(e.versionRegexes,t);return {current:e.name,version:n}}))}(o,e).fold(st.unknown,st.nu),u=function(e,t,n,r){var o=e.isiOS()&&!0===/ipad/i.test(n),i=e.isiOS()&&!o,a=e.isiOS()||e.isAndroid(),u=a||r("(pointer:coarse)"),c=o||!i&&a&&r("(min-device-width:768px)"),s=i||a&&!c,f=t.isSafari()&&e.isiOS()&&!1===/safari/i.test(n),l=!s&&!c&&!f;return {isiPad:k(o),isiPhone:k(i),isTablet:k(c),isPhone:k(s),isTouch:k(u),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:k(f),isDesktop:k(l)}}(a,i,e,n);return {browser:i,os:a,deviceType:u}},lt=function(e){return window.matchMedia(e).matches},dt=Te((function(){return ft(navigator.userAgent,I.from(navigator.userAgentData),lt)})),mt=function(){return dt()},gt=navigator.userAgent,pt=mt(),ht=pt.browser,vt=pt.os,bt=pt.deviceType,yt=/WebKit/.test(gt)&&!ht.isEdge(),Ct="FormData"in window&&"FileReader"in window&&"URL"in window&&!!URL.createObjectURL,xt=-1!==gt.indexOf("Windows Phone"),wt={opera:ht.isOpera(),webkit:yt,ie:!(!ht.isIE()&&!ht.isEdge())&&ht.version.major,gecko:ht.isFirefox(),mac:vt.isOSX()||vt.isiOS(),iOS:bt.isiPad()||bt.isiPhone(),android:vt.isAndroid(),contentEditable:!0,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:!0,range:window.getSelection&&"Range"in window,documentMode:ht.isIE()?document.documentMode||7:10,fileApi:Ct,ceFalse:!0,cacheSuffix:null,container:null,experimentalShadowDom:!1,canHaveCSP:!ht.isIE(),desktop:bt.isDesktop(),windowsPhone:xt,browser:{current:ht.current,version:ht.version,isChrome:ht.isChrome,isEdge:ht.isEdge,isFirefox:ht.isFirefox,isIE:ht.isIE,isOpera:ht.isOpera,isSafari:ht.isSafari},os:{current:vt.current,version:vt.version,isAndroid:vt.isAndroid,isChromeOS:vt.isChromeOS,isFreeBSD:vt.isFreeBSD,isiOS:vt.isiOS,isLinux:vt.isLinux,isOSX:vt.isOSX,isSolaris:vt.isSolaris,isWindows:vt.isWindows},deviceType:{isDesktop:bt.isDesktop,isiPad:bt.isiPad,isiPhone:bt.isiPhone,isPhone:bt.isPhone,isTablet:bt.isTablet,isTouch:bt.isTouch,isWebView:bt.isWebView}},St=/^\s*|\s*$/g,kt=function(e){return null==e?"":(""+e).replace(St,"")},Nt=function(e,t){return t?!("array"!==t||!xe(e))||typeof e===t:void 0!==e},Et=function(e,t,n,r){r=r||this,e&&(n&&(e=e[n]),we(e,(function(e,o){if(!1===t.call(r,e,o,n))return !1;Et(e,t,n,r);})));},_t={trim:kt,isArray:xe,is:Nt,toArray:function(e){if(xe(e))return e;for(var t=[],n=0,r=e.length;n<r;n++)t[n]=e[n];return t},makeMap:function(e,t,n){var r;for(t=t||",","string"==typeof(e=e||[])&&(e=e.split(t)),n=n||{},r=e.length;r--;)n[e[r]]={};return n},each:we,map:Se,grep:ke,inArray:Ne,hasOwn:ye,extend:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0;r<t.length;r++){var o=t[r];for(var i in o)if(ye(o,i)){var a=o[i];void 0!==a&&(e[i]=a);}}return e},create:function(e,t,n){var r,o,i,a=this,u=0,c=(e=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(e))[3].match(/(^|\.)(\w+)$/i)[2],s=a.createNS(e[3].replace(/\.\w+$/,""),n);if(!s[c]){if("static"===e[2])return s[c]=t,void(this.onCreate&&this.onCreate(e[2],e[3],s[c]));t[c]||(t[c]=function(){},u=1),s[c]=t[c],a.extend(s[c].prototype,t),e[5]&&(r=a.resolve(e[5]).prototype,o=e[5].match(/\.(\w+)$/i)[1],i=s[c],s[c]=u?function(){return r[o].apply(this,arguments)}:function(){return this.parent=r[o],i.apply(this,arguments)},s[c].prototype[c]=s[c],a.each(r,(function(e,t){s[c].prototype[t]=r[t];})),a.each(t,(function(e,t){r[t]?s[c].prototype[t]=function(){return this.parent=r[t],e.apply(this,arguments)}:t!==c&&(s[c].prototype[t]=e);}))),a.each(t.static,(function(e,t){s[c][t]=e;}));}},walk:Et,createNS:function(e,t){var n,r;for(t=t||window,e=e.split("."),n=0;n<e.length;n++)t[r=e[n]]||(t[r]={}),t=t[r];return t},resolve:function(e,t){var n,r;for(t=t||window,n=0,r=(e=e.split(".")).length;n<r&&(t=t[e[n]]);n++);return t},explode:function(e,t){return !e||Nt(e,"array")?e:Se(e.split(t||","),kt)},_addCacheSuffix:function(e){var t=wt.cacheSuffix;return t&&(e+=(-1===e.indexOf("?")?"?":"&")+t),e}},At=function(e){if(null==e)throw new Error("Node cannot be null or undefined");return {dom:e}},Rt={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return At(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return At(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return At(n)},fromDom:At,fromPoint:function(e,t,n){return I.from(e.dom.elementFromPoint(t,n)).map(At)}},Dt=function(e,t){var n=[],r=function(e){return n.push(e),t(e)},o=t(e);do{o=o.bind(r);}while(o.isSome());return n},Tt=function(e,t){var n=e.dom;if(1!==n.nodeType)return !1;var r=n;if(void 0!==r.matches)return r.matches(t);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(t);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(t);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")},Ot=function(e){return 1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType||0===e.childElementCount},Bt=function(e,t){return e.dom===t.dom},Pt=function(e,t){return n=e.dom,r=t.dom,function(e,t,n){return 0!=(e.compareDocumentPosition(t)&n)}(n,r,Node.DOCUMENT_POSITION_CONTAINED_BY);var n,r;},Lt=function(e,t){return mt().browser.isIE()?Pt(e,t):function(e,t){var n=e.dom,r=t.dom;return n!==r&&n.contains(r)}(e,t)};"undefined"!=typeof window?window:Function("return this;")();var It=function(e){return e.dom.nodeName.toLowerCase()},Mt=function(e){return e.dom.nodeType},Ft=function(e){return function(t){return Mt(t)===e}},Ut=Ft(1),zt=Ft(3),Ht=Ft(9),jt=Ft(11),Vt=function(e){return Rt.fromDom(e.dom.ownerDocument)},qt=function(e){return Ht(e)?e:Vt(e)},$t=function(e){return Rt.fromDom(qt(e).dom.defaultView)},Wt=function(e){return I.from(e.dom.parentNode).map(Rt.fromDom)},Kt=function(e){return I.from(e.dom.previousSibling).map(Rt.fromDom)},Xt=function(e){return I.from(e.dom.nextSibling).map(Rt.fromDom)},Yt=function(e){return te(Dt(e,Kt))},Gt=function(e){return Dt(e,Xt)},Jt=function(e){return V(e.dom.childNodes,Rt.fromDom)},Qt=function(e,t){var n=e.dom.childNodes;return I.from(n[t]).map(Rt.fromDom)},Zt=function(e){return Qt(e,0)},en=function(e){return Qt(e,e.dom.childNodes.length-1)},tn=function(e){return e.dom.childNodes.length},nn=function(e){return jt(e)&&b(e.dom.host)},rn=y(Element.prototype.attachShadow)&&y(Node.prototype.getRootNode),on=k(rn),an=rn?function(e){return Rt.fromDom(e.dom.getRootNode())}:qt,un=function(e){return nn(e)?e:function(e){var t=e.dom.head;if(null==t)throw new Error("Head is not available yet");return Rt.fromDom(t)}(qt(e))},cn=function(e){return Rt.fromDom(e.dom.host)},sn=function(e){return b(e.dom.shadowRoot)},fn=function(e,t){Wt(e).each((function(n){n.dom.insertBefore(t.dom,e.dom);}));},ln=function(e,t){Xt(e).fold((function(){Wt(e).each((function(e){mn(e,t);}));}),(function(e){fn(e,t);}));},dn=function(e,t){Zt(e).fold((function(){mn(e,t);}),(function(n){e.dom.insertBefore(t.dom,n.dom);}));},mn=function(e,t){e.dom.appendChild(t.dom);},gn=function(e,t){q(t,(function(t){mn(e,t);}));},pn=function(e){e.dom.textContent="",q(Jt(e),(function(e){hn(e);}));},hn=function(e){var t=e.dom;null!==t.parentNode&&t.parentNode.removeChild(t);},vn=function(e){var t,n=Jt(e);n.length>0&&(t=e,q(n,(function(e){fn(t,e);}))),hn(e);},bn=function(e){var t=zt(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return !1;var n=t.ownerDocument;return function(e){var t=an(e);return nn(t)?I.some(t):I.none()}(Rt.fromDom(t)).fold((function(){return n.body.contains(t)}),S(bn,cn))},yn=function(e,t){return {left:e,top:t,translate:function(n,r){return yn(e+n,t+r)}}},Cn=yn,xn=function(e,t){return void 0!==e?e:void 0!==t?t:0},wn=function(e){var t=e.dom,n=t.ownerDocument.body;return n===t?Cn(n.offsetLeft,n.offsetTop):bn(e)?function(e){var t=e.getBoundingClientRect();return Cn(t.left,t.top)}(t):Cn(0,0)},Sn=function(e){var t=void 0!==e?e.dom:document,n=t.body.scrollLeft||t.documentElement.scrollLeft,r=t.body.scrollTop||t.documentElement.scrollTop;return Cn(n,r)},kn=function(e,t,n){var r=(void 0!==n?n.dom:document).defaultView;r&&r.scrollTo(e,t);},Nn=function(e,t){mt().browser.isSafari()&&y(e.dom.scrollIntoViewIfNeeded)?e.dom.scrollIntoViewIfNeeded(!1):e.dom.scrollIntoView(t);},En=function(e,t,n,r){return {x:e,y:t,width:n,height:r,right:e+n,bottom:t+r}},_n=function(e){var t=void 0===e?window:e,n=t.document,r=Sn(Rt.fromDom(n));return function(e){var t=void 0===e?window:e;return mt().browser.isFirefox()?I.none():I.from(t.visualViewport)}(t).fold((function(){var e=t.document.documentElement,n=e.clientWidth,o=e.clientHeight;return En(r.left,r.top,n,o)}),(function(e){return En(Math.max(e.pageLeft,r.left),Math.max(e.pageTop,r.top),e.width,e.height)}))},An=function(e){return function(t){return !!t&&t.nodeType===e}},Rn=function(e){return !!e&&!Object.getPrototypeOf(e)},Dn=An(1),Tn=function(e){var t=e.map((function(e){return e.toLowerCase()}));return function(e){if(e&&e.nodeName){var n=e.nodeName.toLowerCase();return H(t,n)}return !1}},On=function(e,t){var n=t.toLowerCase().split(" ");return function(t){if(Dn(t))for(var r=0;r<n.length;r++){var o=t.ownerDocument.defaultView.getComputedStyle(t,null);if((o?o.getPropertyValue(e):null)===n[r])return !0}return !1}},Bn=function(e){return function(t){return Dn(t)&&t.hasAttribute(e)}},Pn=function(e){return Dn(e)&&e.hasAttribute("data-mce-bogus")},Ln=function(e){return Dn(e)&&"TABLE"===e.tagName},In=function(e){return function(t){if(Dn(t)){if(t.contentEditable===e)return !0;if(t.getAttribute("data-mce-contenteditable")===e)return !0}return !1}},Mn=Tn(["textarea","input"]),Fn=An(3),Un=An(8),zn=An(9),Hn=An(11),jn=Tn(["br"]),Vn=Tn(["img"]),qn=In("true"),$n=In("false"),Wn=Tn(["td","th"]),Kn=Tn(["video","audio","object","embed"]),Xn=function(e,t,n){return void 0===n&&(n=E),e.exists((function(e){return n(e,t)}))},Yn=function(e,t,n){return e.isSome()&&t.isSome()?I.some(n(e.getOrDie(),t.getOrDie())):I.none()},Gn=function(e){return void 0!==e.style&&y(e.style.getPropertyValue)},Jn=function(e,t,n){if(!(l(n)||p(n)||C(n)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"");},Qn=function(e,t,n){Jn(e.dom,t,n);},Zn=function(e,t){var n=e.dom;le(t,(function(e,t){Jn(n,t,e);}));},er=function(e,t){var n=e.dom.getAttribute(t);return null===n?void 0:n},tr=function(e,t){return I.from(er(e,t))},nr=function(e,t){e.dom.removeAttribute(t);},rr=function(e,t){var n=e.dom;le(t,(function(e,t){!function(e,t,n){if(!l(n))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",n,":: Element ",e),new Error("CSS value must be a string: "+n);Gn(e)&&e.style.setProperty(t,n);}(n,t,e);}));},or=function(e,t){var n=e.dom,r=window.getComputedStyle(n).getPropertyValue(t);return ""!==r||bn(e)?r:ir(n,t)},ir=function(e,t){return Gn(e)?e.style.getPropertyValue(t):""},ar=function(e,t){var n=e.dom,r=ir(n,t);return I.from(r).filter((function(e){return e.length>0}))},ur=function(e){var t={},n=e.dom;if(Gn(n))for(var r=0;r<n.style.length;r++){var o=n.style.item(r);t[o]=n.style[o];}return t},cr=mt().browser,sr=function(e){return J(e,Ut)},fr=function(e,t){return e.children&&H(e.children,t)},lr=function(e,t,n){var r=0,o=0,i=e.ownerDocument;if(n=n||e,t){if(n===e&&t.getBoundingClientRect&&"static"===or(Rt.fromDom(e),"position")){var a=t.getBoundingClientRect();return {x:r=a.left+(i.documentElement.scrollLeft||e.scrollLeft)-i.documentElement.clientLeft,y:o=a.top+(i.documentElement.scrollTop||e.scrollTop)-i.documentElement.clientTop}}for(var u=t;u&&u!==n&&u.nodeType&&!fr(u,n);){var c=u;r+=c.offsetLeft||0,o+=c.offsetTop||0,u=c.offsetParent;}for(u=t.parentNode;u&&u!==n&&u.nodeType&&!fr(u,n);)r-=u.scrollLeft||0,o-=u.scrollTop||0,u=u.parentNode;o+=function(e){return cr.isFirefox()&&"table"===It(e)?sr(Jt(e)).filter((function(e){return "caption"===It(e)})).bind((function(e){return sr(Gt(e)).map((function(t){var n=t.dom.offsetTop,r=e.dom.offsetTop,o=e.dom.offsetHeight;return n<=r?-o:0}))})).getOr(0):0}(Rt.fromDom(t));}return {x:r,y:o}},dr={},mr={exports:dr};!function(e,t,n,r){var o,i;o=this,i=function(){var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==commonjsGlobal?commonjsGlobal:"undefined"!=typeof self?self:{},t={exports:{}};!function(t){!function(e){var n=setTimeout;function r(){}function o(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],f(e,this);}function i(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,o._immediateFn((function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value);}catch(e){return void u(t.promise,e)}a(t.promise,r);}else (1===e._state?a:u)(t.promise,e._value);}))):e._deferreds.push(t);}function a(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if(t instanceof o)return e._state=3,e._value=t,void c(e);if("function"==typeof n)return void f((r=n,i=t,function(){r.apply(i,arguments);}),e)}e._state=1,e._value=t,c(e);}catch(t){u(e,t);}var r,i;}function u(e,t){e._state=2,e._value=t,c(e);}function c(e){2===e._state&&0===e._deferreds.length&&o._immediateFn((function(){e._handled||o._unhandledRejectionFn(e._value);}));for(var t=0,n=e._deferreds.length;t<n;t++)i(e,e._deferreds[t]);e._deferreds=null;}function s(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n;}function f(e,t){var n=!1;try{e((function(e){n||(n=!0,a(t,e));}),(function(e){n||(n=!0,u(t,e));}));}catch(e){if(n)return;n=!0,u(t,e);}}o.prototype.catch=function(e){return this.then(null,e)},o.prototype.then=function(e,t){var n=new this.constructor(r);return i(this,new s(e,t,n)),n},o.all=function(e){var t=Array.prototype.slice.call(e);return new o((function(e,n){if(0===t.length)return e([]);var r=t.length;function o(i,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var u=a.then;if("function"==typeof u)return void u.call(a,(function(e){o(i,e);}),n)}t[i]=a,0==--r&&e(t);}catch(e){n(e);}}for(var i=0;i<t.length;i++)o(i,t[i]);}))},o.resolve=function(e){return e&&"object"==typeof e&&e.constructor===o?e:new o((function(t){t(e);}))},o.reject=function(e){return new o((function(t,n){n(e);}))},o.race=function(e){return new o((function(t,n){for(var r=0,o=e.length;r<o;r++)e[r].then(t,n);}))},o._immediateFn="function"==typeof setImmediate?function(e){setImmediate(e);}:function(e){n(e,0);},o._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e);},o._setImmediateFn=function(e){o._immediateFn=e;},o._setUnhandledRejectionFn=function(e){o._unhandledRejectionFn=e;},t.exports?t.exports=o:e.Promise||(e.Promise=o);}(e);}(t);var n=t.exports;return {boltExport:("undefined"!=typeof window?window:Function("return this;")()).Promise||n}},"object"==typeof t&&void 0!==n?n.exports=i():"function"==typeof e&&e.amd?e(i):(o="undefined"!=typeof globalThis?globalThis:o||self).EphoxContactWrapper=i();}(void 0,dr,mr);var gr=mr.exports.boltExport,pr=function(e){var t=I.none(),n=[],r=function(e){o()?a(e):n.push(e);},o=function(){return t.isSome()},i=function(e){q(e,a);},a=function(e){t.each((function(t){setTimeout((function(){e(t);}),0);}));};return e((function(e){o()||(t=I.some(e),i(n),n=[]);})),{get:r,map:function(e){return pr((function(t){r((function(n){t(e(n));}));}))},isReady:o}},hr={nu:pr,pure:function(e){return pr((function(t){t(e);}))}},vr=function(e){setTimeout((function(){throw e}),0);},br=function(e){var t=function(t){e().then(t,vr);};return {map:function(t){return br((function(){return e().then(t)}))},bind:function(t){return br((function(){return e().then((function(e){return t(e).toPromise()}))}))},anonBind:function(t){return br((function(){return e().then((function(){return t.toPromise()}))}))},toLazy:function(){return hr.nu(t)},toCached:function(){var t=null;return br((function(){return null===t&&(t=e()),t}))},toPromise:e,get:t}},yr=function(e){return br((function(){return new gr(e)}))},Cr=function(e,t){return t((function(t){var n=[],r=0;0===e.length?t([]):q(e,(function(o,i){o.get(function(o){return function(i){n[o]=i,++r>=e.length&&t(n);}}(i));}));}))},xr=function(e){return {isValue:O,isError:T,getOr:k(e),getOrThunk:k(e),getOrDie:k(e),or:function(t){return xr(e)},orThunk:function(t){return xr(e)},fold:function(t,n){return n(e)},map:function(t){return xr(t(e))},mapError:function(t){return xr(e)},each:function(t){t(e);},bind:function(t){return t(e)},exists:function(t){return t(e)},forall:function(t){return t(e)},toOptional:function(){return I.some(e)}}},wr=function(e){return {isValue:T,isError:O,getOr:N,getOrThunk:function(e){return e()},getOrDie:function(){return (t=String(e),function(){throw new Error(t)})();var t;},or:N,orThunk:function(e){return e()},fold:function(t,n){return t(e)},map:function(t){return wr(e)},mapError:function(t){return wr(t(e))},each:x,bind:function(t){return wr(e)},exists:T,forall:O,toOptional:I.none}},Sr={value:xr,error:wr,fromOption:function(e,t){return e.fold((function(){return wr(t)}),xr)}},kr=function(e){if(!m(e))throw new Error("cases must be an array");if(0===e.length)throw new Error("there must be at least one case");var t=[],n={};return q(e,(function(r,o){var i=se(r);if(1!==i.length)throw new Error("one and only one name per case");var a=i[0],u=r[a];if(void 0!==n[a])throw new Error("duplicate key detected:"+a);if("cata"===a)throw new Error("cannot have a case named cata (sorry)");if(!m(u))throw new Error("case arguments must be an array");t.push(a),n[a]=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=n.length;if(i!==u.length)throw new Error("Wrong number of arguments to case "+a+". Expected "+u.length+" ("+u+"), got "+i);var c=function(e){var r=se(e);if(t.length!==r.length)throw new Error("Wrong number of arguments to match. Expected: "+t.join(",")+"\nActual: "+r.join(","));if(!ee(t,(function(e){return H(r,e)})))throw new Error("Not all branches were specified when using match. Specified: "+r.join(", ")+"\nRequired: "+t.join(", "));return e[a].apply(null,n)};return {fold:function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];if(t.length!==e.length)throw new Error("Wrong number of arguments to fold. Expected "+e.length+", got "+t.length);var i=t[o];return i.apply(null,n)},match:c,log:function(e){console.log(e,{constructors:t,constructor:a,params:n});}}};})),n};kr([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);var Nr=function(e){return e.fold(N,N)};function Er(e,t,n,r,o){return e(n,r)?I.some(n):y(o)&&o(n)?I.none():t(n,r,o)}var _r,Ar,Rr,Dr,Tr,Or,Br,Pr,Lr,Ir,Mr,Fr,Ur,zr,Hr,jr,Vr,qr,$r,Wr,Kr=function(e,t,n){for(var r=e.dom,o=y(n)?n:T;r.parentNode;){r=r.parentNode;var i=Rt.fromDom(r);if(t(i))return I.some(i);if(o(i))break}return I.none()},Xr=function(e,t,n){return Er((function(e,t){return t(e)}),Kr,e,t,n)},Yr=function(e,t){return J(e.dom.childNodes,(function(e){return t(Rt.fromDom(e))})).map(Rt.fromDom)},Gr=function(e,t,n){return Kr(e,(function(e){return Tt(e,t)}),n)},Jr=function(e,t){return function(e,t){var n=void 0===t?document:t.dom;return Ot(n)?I.none():I.from(n.querySelector(e)).map(Rt.fromDom)}(t,e)},Qr=function(e,t,n){return Er((function(e,t){return Tt(e,t)}),Gr,e,t,n)},Zr=window.Promise?window.Promise:gr,eo=function(e,t){return "number"!=typeof t&&(t=0),setTimeout(e,t)},to=function(e,t){return "number"!=typeof t&&(t=1),setInterval(e,t)},no=function(e,t){var n,r=function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];clearTimeout(n),n=eo((function(){e.apply(this,r);}),t);};return r.stop=function(){clearTimeout(n);},r},ro={requestAnimationFrame:function(e,t){_r?_r.then(e):_r=new Zr((function(e){t||(t=document.body),function(e,t){for(var n=window.requestAnimationFrame,r=["ms","moz","webkit"],o=0;o<r.length&&!n;o++)n=window[r[o]+"RequestAnimationFrame"];n||(n=function(e){window.setTimeout(e,0);}),n(e,t);}(e,t);})).then(e);},setTimeout:eo,setInterval:to,setEditorTimeout:function(e,t,n){return eo((function(){e.removed||t();}),n)},setEditorInterval:function(e,t,n){var r=to((function(){e.removed?clearInterval(r):t();}),n);return r},debounce:no,throttle:no,clearInterval:function(e){return clearInterval(e)},clearTimeout:function(e){return clearTimeout(e)}},oo=function(e,t){void 0===t&&(t={});var n=0,r={},o=Rt.fromDom(e),i=qt(o),a=t.maxLoadTime||5e3,u=function(u,c,s){var f,l=_t._addCacheSuffix(u),d=function(e){return be(r,e).getOrThunk((function(){return {id:"mce-u"+n++,passed:[],failed:[],count:0}}))}(l);r[l]=d,d.count++;var m=function(e,t){for(var n=e.length;n--;)e[n]();d.status=t,d.passed=[],d.failed=[],f&&(f.onload=null,f.onerror=null,f=null);},g=function(){return m(d.passed,2)},p=function(){return m(d.failed,3)},h=function(){var t,n;t=function(){for(var t=e.styleSheets,n=t.length;n--;){var r=t[n].ownerNode;if(r&&r.id===f.id)return g(),!0}return !1},n=h,t()||(Date.now()-y<a?ro.setTimeout(n):p());};if(c&&d.passed.push(c),s&&d.failed.push(s),1!==d.status)if(2!==d.status)if(3!==d.status){d.status=1;var v=Rt.fromTag("link",i.dom);Zn(v,{rel:"stylesheet",type:"text/css",id:d.id});var b,y=Date.now();t.contentCssCors&&Qn(v,"crossOrigin","anonymous"),t.referrerPolicy&&Qn(v,"referrerpolicy",t.referrerPolicy),(f=v.dom).onload=h,f.onerror=p,b=v,mn(un(o),b),Qn(v,"href",l);}else p();else g();},c=function(e){return yr((function(t){u(e,w(t,k(Sr.value(e))),w(t,k(Sr.error(e))));}))},s=function(e){var t=_t._addCacheSuffix(e);be(r,t).each((function(e){var n,i;0===--e.count&&(delete r[t],n=e.id,i=un(o),Jr(i,"#"+n).each(hn));}));};return {load:u,loadAll:function(e,t,n){var r;(r=V(e,c),Cr(r,yr)).get((function(e){var r=W(e,(function(e){return e.isValue()}));r.fail.length>0?n(r.fail.map(Nr)):t(r.pass.map(Nr));}));},unload:s,unloadAll:function(e){q(e,(function(e){s(e);}));},_setReferrerPolicy:function(e){t.referrerPolicy=e;}}},io=function(){var e=new WeakMap;return {forElement:function(t,n){var r=an(t).dom;return I.from(e.get(r)).getOrThunk((function(){var t=oo(r,n);return e.set(r,t),t}))}}}(),ao=function(){function e(e,t){this.node=e,this.rootNode=t,this.current=this.current.bind(this),this.next=this.next.bind(this),this.prev=this.prev.bind(this),this.prev2=this.prev2.bind(this);}return e.prototype.current=function(){return this.node},e.prototype.next=function(e){return this.node=this.findSibling(this.node,"firstChild","nextSibling",e),this.node},e.prototype.prev=function(e){return this.node=this.findSibling(this.node,"lastChild","previousSibling",e),this.node},e.prototype.prev2=function(e){return this.node=this.findPreviousNode(this.node,"lastChild","previousSibling",e),this.node},e.prototype.findSibling=function(e,t,n,r){var o,i;if(e){if(!r&&e[t])return e[t];if(e!==this.rootNode){if(o=e[n])return o;for(i=e.parentNode;i&&i!==this.rootNode;i=i.parentNode)if(o=i[n])return o}}},e.prototype.findPreviousNode=function(e,t,n,r){var o,i,a;if(e){if(o=e[n],this.rootNode&&o===this.rootNode)return;if(o){if(!r)for(a=o[t];a;a=a[t])if(!a[t])return a;return o}if((i=e.parentNode)&&i!==this.rootNode)return i}},e}(),uo=function(e){var t;return function(n){return t=t||function(e,t){for(var n={},r=0,o=e.length;r<o;r++){var i=e[r];n[String(i)]=t(i,r);}return n}(e,O),ye(t,It(n))}},co=uo(["h1","h2","h3","h4","h5","h6"]),so=uo(["article","aside","details","div","dt","figcaption","footer","form","fieldset","header","hgroup","html","main","nav","section","summary","body","p","dl","multicol","dd","figure","address","center","blockquote","h1","h2","h3","h4","h5","h6","listing","xmp","pre","plaintext","menu","dir","ul","ol","li","hr","table","tbody","thead","tfoot","th","tr","td","caption"]),fo=function(e){return Ut(e)&&!so(e)},lo=function(e){return Ut(e)&&"br"===It(e)},mo=uo(["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"]),go=uo(["ul","ol","dl"]),po=uo(["li","dd","dt"]),ho=uo(["thead","tbody","tfoot"]),vo=uo(["td","th"]),bo=uo(["pre","script","textarea","style"]),yo=" ",Co="\ufeff",xo=function(e){return "\ufeff"===e},wo=function(e){return e.replace(/\uFEFF/g,"")},So=Dn,ko=Fn,No=function(e){return ko(e)&&(e=e.parentNode),So(e)&&e.hasAttribute("data-mce-caret")},Eo=function(e){return ko(e)&&xo(e.data)},_o=function(e){return No(e)||Eo(e)},Ao=function(e){return e.firstChild!==e.lastChild||!jn(e.firstChild)},Ro=function(e){var t=e.container();return !!Fn(t)&&(t.data.charAt(e.offset())===Co||e.isAtStart()&&Eo(t.previousSibling))},Do=function(e){var t=e.container();return !!Fn(t)&&(t.data.charAt(e.offset()-1)===Co||e.isAtEnd()&&Eo(t.nextSibling))},To=function(e,t,n){var r,o=t.ownerDocument.createElement(e);o.setAttribute("data-mce-caret",n?"before":"after"),o.setAttribute("data-mce-bogus","all"),o.appendChild(((r=document.createElement("br")).setAttribute("data-mce-bogus","1"),r));var i=t.parentNode;return n?i.insertBefore(o,t):t.nextSibling?i.insertBefore(o,t.nextSibling):i.appendChild(o),o},Oo=function(e){return ko(e)&&e.data[0]===Co},Bo=function(e){return ko(e)&&e.data[e.data.length-1]===Co},Po=function(e){return e&&e.hasAttribute("data-mce-caret")?(t=e.getElementsByTagName("br"),n=t[t.length-1],Pn(n)&&n.parentNode.removeChild(n),e.removeAttribute("data-mce-caret"),e.removeAttribute("data-mce-bogus"),e.removeAttribute("style"),e.removeAttribute("_moz_abspos"),e):null;var t,n;},Lo=function(e){return No(e.startContainer)},Io=qn,Mo=$n,Fo=jn,Uo=Fn,zo=Tn(["script","style","textarea"]),Ho=Tn(["img","input","textarea","hr","iframe","video","audio","object","embed"]),jo=Tn(["table"]),Vo=_o,qo=function(e){return !Vo(e)&&(Uo(e)?!zo(e.parentNode):Ho(e)||Fo(e)||jo(e)||$o(e))},$o=function(e){return !1===function(e){return Dn(e)&&"true"===e.getAttribute("unselectable")}(e)&&Mo(e)},Wo=function(e,t){return qo(e)&&function(e,t){for(e=e.parentNode;e&&e!==t;e=e.parentNode){if($o(e))return !1;if(Io(e))return !0}return !0}(e,t)},Ko=/^[ \t\r\n]*$/,Xo=function(e){return Ko.test(e)},Yo=function(e,t){var n,r,o,i=Rt.fromDom(t),a=Rt.fromDom(e);return n=a,r="pre,code",o=_(Bt,i),Gr(n,r,o).isSome()},Go=function(e,t){return qo(e)&&!1===function(e,t){return Fn(e)&&Xo(e.data)&&!1===Yo(e,t)}(e,t)||function(e){return Dn(e)&&"A"===e.nodeName&&!e.hasAttribute("href")&&(e.hasAttribute("name")||e.hasAttribute("id"))}(e)||Jo(e)},Jo=Bn("data-mce-bookmark"),Qo=Bn("data-mce-bogus"),Zo=(Ar="data-mce-bogus",Rr="all",function(e){return Dn(e)&&e.getAttribute(Ar)===Rr}),ei=function(e,t){return void 0===t&&(t=!0),function(e,t){var n=0;if(Go(e,e))return !1;var r=e.firstChild;if(!r)return !0;var o=new ao(r,e);do{if(t){if(Zo(r)){r=o.next(!0);continue}if(Qo(r)){r=o.next();continue}}if(jn(r))n++,r=o.next();else {if(Go(r,e))return !1;r=o.next();}}while(r);return n<=1}(e.dom,t)},ti=function(e,t){return b(e)&&(Go(e,t)||fo(Rt.fromDom(e)))},ni=function(e){return function(e){return "span"===e.nodeName.toLowerCase()}(e)&&"bookmark"===e.getAttribute("data-mce-type")},ri=function(e,t){return Fn(e)&&e.data.length>0&&function(e,t){var n=new ao(e,t).prev(!1),r=new ao(e,t).next(!1),o=h(n)||ti(n,t),i=h(r)||ti(r,t);return o&&i}(e,t)},oi=function(e,t,n){var r=n||t;if(Dn(t)&&ni(t))return t;for(var o=t.childNodes,i=o.length-1;i>=0;i--)oi(e,o[i],r);if(Dn(t)){var a=t.childNodes;1===a.length&&ni(a[0])&&t.parentNode.insertBefore(a[0],t);}return function(e){return Hn(e)||zn(e)}(t)||Go(t,r)||function(e){return !!Dn(e)&&e.childNodes.length>0}(t)||ri(t,r)||e.remove(t),t},ii=_t.makeMap,ai=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,ui=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,ci=/[<>&\"\']/g,si=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,fi={128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"},li={'"':"&quot;","'":"&#39;","<":"&lt;",">":"&gt;","&":"&amp;","`":"&#96;"},di={"&lt;":"<","&gt;":">","&amp;":"&","&quot;":'"',"&apos;":"'"},mi=function(e,t){var n,r,o,i={};if(e){for(e=e.split(","),t=t||10,n=0;n<e.length;n+=2)r=String.fromCharCode(parseInt(e[n],t)),li[r]||(o="&"+e[n+1]+";",i[r]=o,i[o]=r);return i}},gi=mi("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32),pi=function(e,t){return e.replace(t?ai:ui,(function(e){return li[e]||e}))},hi=function(e,t){return e.replace(t?ai:ui,(function(e){return e.length>1?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":li[e]||"&#"+e.charCodeAt(0)+";"}))},vi=function(e,t,n){return n=n||gi,e.replace(t?ai:ui,(function(e){return li[e]||n[e]||e}))},bi={encodeRaw:pi,encodeAllRaw:function(e){return (""+e).replace(ci,(function(e){return li[e]||e}))},encodeNumeric:hi,encodeNamed:vi,getEncodeFunc:function(e,t){var n=mi(t)||gi,r=ii(e.replace(/\+/g,","));return r.named&&r.numeric?function(e,t){return e.replace(t?ai:ui,(function(e){return void 0!==li[e]?li[e]:void 0!==n[e]?n[e]:e.length>1?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":"&#"+e.charCodeAt(0)+";"}))}:r.named?t?function(e,t){return vi(e,t,n)}:vi:r.numeric?hi:pi},decode:function(e){return e.replace(si,(function(e,t){return t?(t="x"===t.charAt(0).toLowerCase()?parseInt(t.substr(1),16):parseInt(t,10))>65535?(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t))):fi[t]||String.fromCharCode(t):di[e]||gi[e]||function(e){var t=Rt.fromTag("div").dom;return t.innerHTML=e,t.textContent||t.innerText||e}(e)}))}},yi={},Ci={},xi=_t.makeMap,wi=_t.each,Si=_t.extend,ki=_t.explode,Ni=_t.inArray,Ei=function(e,t){return (e=_t.trim(e))?e.split(t||" "):[]},_i=function(e,t){var n;return e&&(n={},"string"==typeof e&&(e={"*":e}),wi(e,(function(e,r){n[r]=n[r.toUpperCase()]="map"===t?xi(e,/[, ]/):ki(e,/[, ]/);}))),n},Ai=function(e){var t={},n={},r=[],o={},i={},a=function(t,n,r){var o=e[t];return o?o=xi(o,/[, ]/,xi(o.toUpperCase(),/[, ]/)):(o=yi[t])||(o=xi(n," ",xi(n.toUpperCase()," ")),o=Si(o,r),yi[t]=o),o},u=function(e){var t,n,r,o,i,a,u={},c=function(e,n,r){var o,i,a,c=function(e,t){var n,r,o={};for(n=0,r=e.length;n<r;n++)o[e[n]]=t||{};return o};n=n||"","string"==typeof(r=r||[])&&(r=Ei(r));var s=Ei(e);for(o=s.length;o--;)a={attributes:c(i=Ei([t,n].join(" "))),attributesOrder:i,children:c(r,Ci)},u[s[o]]=a;},s=function(e,t){var n,r,o,i,a=Ei(e);n=a.length;for(var c=Ei(t);n--;)for(r=u[a[n]],o=0,i=c.length;o<i;o++)r.attributes[c[o]]={},r.attributesOrder.push(c[o]);};return yi[e]?yi[e]:(t="id accesskey class dir lang style tabindex title role",n="address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul",r="a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment","html4"!==e&&(t+=" contenteditable contextmenu draggable dropzone hidden spellcheck translate",n+=" article aside details dialog figure main header footer hgroup section nav",r+=" audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen"),"html5-strict"!==e&&(t+=" xml:lang",r=[r,a="acronym applet basefont big font strike tt"].join(" "),wi(Ei(a),(function(e){c(e,"",r);})),n=[n,i="center dir isindex noframes"].join(" "),o=[n,r].join(" "),wi(Ei(i),(function(e){c(e,"",o);}))),o=o||[n,r].join(" "),c("html","manifest","head body"),c("head","","base command link meta noscript script style title"),c("title hr noscript br"),c("base","href target"),c("link","href rel media hreflang type sizes hreflang"),c("meta","name http-equiv content charset"),c("style","media type scoped"),c("script","src async defer type charset"),c("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",o),c("address dt dd div caption","",o),c("h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn","",r),c("blockquote","cite",o),c("ol","reversed start type","li"),c("ul","","li"),c("li","value",o),c("dl","","dt dd"),c("a","href target rel media hreflang type",r),c("q","cite",r),c("ins del","cite datetime",o),c("img","src sizes srcset alt usemap ismap width height"),c("iframe","src name width height",o),c("embed","src type width height"),c("object","data type typemustmatch name usemap form width height",[o,"param"].join(" ")),c("param","name value"),c("map","name",[o,"area"].join(" ")),c("area","alt coords shape href target rel media hreflang type"),c("table","border","caption colgroup thead tfoot tbody tr"+("html4"===e?" col":"")),c("colgroup","span","col"),c("col","span"),c("tbody thead tfoot","","tr"),c("tr","","td th"),c("td","colspan rowspan headers",o),c("th","colspan rowspan headers scope abbr",o),c("form","accept-charset action autocomplete enctype method name novalidate target",o),c("fieldset","disabled form name",[o,"legend"].join(" ")),c("label","form for",r),c("input","accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate formtarget height list max maxlength min multiple name pattern readonly required size src step type value width"),c("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"===e?o:r),c("select","disabled form multiple name required size","option optgroup"),c("optgroup","disabled label","option"),c("option","disabled label selected value"),c("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),c("menu","type label",[o,"li"].join(" ")),c("noscript","",o),"html4"!==e&&(c("wbr"),c("ruby","",[r,"rt rp"].join(" ")),c("figcaption","",o),c("mark rt rp summary bdi","",r),c("canvas","width height",o),c("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",[o,"track source"].join(" ")),c("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",[o,"track source"].join(" ")),c("picture","","img source"),c("source","src srcset type media sizes"),c("track","kind src srclang label default"),c("datalist","",[r,"option"].join(" ")),c("article section nav aside main header footer","",o),c("hgroup","","h1 h2 h3 h4 h5 h6"),c("figure","",[o,"figcaption"].join(" ")),c("time","datetime",r),c("dialog","open",o),c("command","type label icon disabled checked radiogroup command"),c("output","for form name",r),c("progress","value max",r),c("meter","value min max low high optimum",r),c("details","open",[o,"summary"].join(" ")),c("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!==e&&(s("script","language xml:space"),s("style","xml:space"),s("object","declare classid code codebase codetype archive standby align border hspace vspace"),s("embed","align name hspace vspace"),s("param","valuetype type"),s("a","charset name rev shape coords"),s("br","clear"),s("applet","codebase archive code object alt name width height align hspace vspace"),s("img","name longdesc align border hspace vspace"),s("iframe","longdesc frameborder marginwidth marginheight scrolling align"),s("font basefont","size color face"),s("input","usemap align"),s("select"),s("textarea"),s("h1 h2 h3 h4 h5 h6 div p legend caption","align"),s("ul","type compact"),s("li","type"),s("ol dl menu dir","compact"),s("pre","width xml:space"),s("hr","align noshade size width"),s("isindex","prompt"),s("table","summary width frame rules cellspacing cellpadding align bgcolor"),s("col","width align char charoff valign"),s("colgroup","width align char charoff valign"),s("thead","align char charoff valign"),s("tr","align char charoff valign bgcolor"),s("th","axis align char charoff valign nowrap bgcolor width height"),s("form","accept"),s("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),s("tfoot","align char charoff valign"),s("tbody","align char charoff valign"),s("area","nohref"),s("body","background bgcolor text link vlink alink")),"html4"!==e&&(s("input button select textarea","autofocus"),s("input textarea","placeholder"),s("a","download"),s("link script img","crossorigin"),s("img","loading"),s("iframe","sandbox seamless allowfullscreen loading")),wi(Ei("a form meter progress dfn"),(function(e){u[e]&&delete u[e].children[e];})),delete u.caption.children.table,delete u.script,yi[e]=u,u)}((e=e||{}).schema);!1===e.verify_html&&(e.valid_elements="*[*]");var c=_i(e.valid_styles),s=_i(e.invalid_styles,"map"),f=_i(e.valid_classes,"map"),l=a("whitespace_elements","pre script noscript style textarea video audio iframe object code"),d=a("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),m=a("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),g=a("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),p="td th iframe video audio object script code",h=a("non_empty_elements",p+" pre",m),v=a("move_caret_before_on_enter_elements",p+" table",m),b=a("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside main nav figure"),y=a("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup figcaption details summary",b),C=a("text_inline_elements","span strong b em i font strike u var cite dfn code mark q sup sub samp");wi((e.special||"script noscript iframe noframes noembed title style textarea xmp").split(" "),(function(e){i[e]=new RegExp("</"+e+"[^>]*>","gi");}));var x=function(e){return new RegExp("^"+e.replace(/([?+*])/g,".$1")+"$")},w=function(e){var n,o,i,a,u,c,s,f,l,d,m,g,p,h,v,b,y,C,w=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)])?$/,S=/^([!\-])?(\w+[\\:]:\w+|[^=:<]+)?(?:([=:<])(.*))?$/,k=/[*?+]/;if(e){var N=Ei(e,",");for(t["@"]&&(b=t["@"].attributes,y=t["@"].attributesOrder),n=0,o=N.length;n<o;n++)if(u=w.exec(N[n])){if(h=u[1],l=u[2],v=u[3],f=u[5],c={attributes:g={},attributesOrder:p=[]},"#"===h&&(c.paddEmpty=!0),"-"===h&&(c.removeEmpty=!0),"!"===u[4]&&(c.removeEmptyAttrs=!0),b&&(le(b,(function(e,t){g[t]=e;})),p.push.apply(p,y)),f)for(i=0,a=(f=Ei(f,"|")).length;i<a;i++)if(u=S.exec(f[i])){if(s={},m=u[1],d=u[2].replace(/[\\:]:/g,":"),h=u[3],C=u[4],"!"===m&&(c.attributesRequired=c.attributesRequired||[],c.attributesRequired.push(d),s.required=!0),"-"===m){delete g[d],p.splice(Ni(p,d),1);continue}h&&("="===h&&(c.attributesDefault=c.attributesDefault||[],c.attributesDefault.push({name:d,value:C}),s.defaultValue=C),":"===h&&(c.attributesForced=c.attributesForced||[],c.attributesForced.push({name:d,value:C}),s.forcedValue=C),"<"===h&&(s.validValues=xi(C,"?"))),k.test(d)?(c.attributePatterns=c.attributePatterns||[],s.pattern=x(d),c.attributePatterns.push(s)):(g[d]||p.push(d),g[d]=s);}b||"@"!==l||(b=g,y=p),v&&(c.outputName=l,t[v]=c),k.test(l)?(c.pattern=x(l),r.push(c)):t[l]=c;}}},S=function(e){t={},r=[],w(e),wi(u,(function(e,t){n[t]=e.children;}));},N=function(e){var r=/^(~)?(.+)$/;e&&(yi.text_block_elements=yi.block_elements=null,wi(Ei(e,","),(function(e){var i=r.exec(e),a="~"===i[1],u=a?"span":"div",c=i[2];if(n[c]=n[u],o[c]=u,a||(y[c.toUpperCase()]={},y[c]={}),!t[c]){var s=t[u];delete(s=Si({},s)).removeEmptyAttrs,delete s.removeEmpty,t[c]=s;}wi(n,(function(e,t){e[u]&&(n[t]=e=Si({},n[t]),e[c]=e[u]);}));})));},E=function(t){var r=/^([+\-]?)([A-Za-z0-9_\-.\u00b7\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u037d\u037f-\u1fff\u200c-\u200d\u203f-\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]+)\[([^\]]+)]$/;yi[e.schema]=null,t&&wi(Ei(t,","),(function(e){var t,o,i=r.exec(e);i&&(o=i[1],t=o?n[i[2]]:n[i[2]]={"#comment":{}},t=n[i[2]],wi(Ei(i[3],"|"),(function(e){"-"===o?delete t[e]:t[e]={};})));}));},_=function(e){var n,o=t[e];if(o)return o;for(n=r.length;n--;)if((o=r[n]).pattern.test(e))return o};e.valid_elements?S(e.valid_elements):(wi(u,(function(e,r){t[r]={attributes:e.attributes,attributesOrder:e.attributesOrder},n[r]=e.children;})),"html5"!==e.schema&&wi(Ei("strong/b em/i"),(function(e){var n=Ei(e,"/");t[n[1]].outputName=n[0];})),wi(Ei("ol ul sub sup blockquote span font a table tbody strong em b i"),(function(e){t[e]&&(t[e].removeEmpty=!0);})),wi(Ei("p h1 h2 h3 h4 h5 h6 th td pre div address caption li"),(function(e){t[e].paddEmpty=!0;})),wi(Ei("span"),(function(e){t[e].removeEmptyAttrs=!0;}))),N(e.custom_elements),E(e.valid_children),w(e.extended_valid_elements),E("+ol[ul|ol],+ul[ul|ol]"),wi({dd:"dl",dt:"dl",li:"ul ol",td:"tr",th:"tr",tr:"tbody thead tfoot",tbody:"table",thead:"table",tfoot:"table",legend:"fieldset",area:"map",param:"video audio object"},(function(e,n){t[n]&&(t[n].parentsRequired=Ei(e));})),e.invalid_elements&&wi(ki(e.invalid_elements),(function(e){t[e]&&delete t[e];})),_("span")||w("span[!data-mce-type|*]");var A=k(c),R=k(s),D=k(f),T=k(g),O=k(y),B=k(b),P=k(C),L=k(m),I=k(d),M=k(h),F=k(v),U=k(l),z=k(i),H=k(o);return {children:n,elements:t,getValidStyles:A,getValidClasses:D,getBlockElements:O,getInvalidStyles:R,getShortEndedElements:L,getTextBlockElements:B,getTextInlineElements:P,getBoolAttrs:T,getElementRule:_,getSelfClosingElements:I,getNonEmptyElements:M,getMoveCaretBeforeOnEnterElements:F,getWhiteSpaceElements:U,getSpecialElements:z,isValidChild:function(e,t){var r=n[e.toLowerCase()];return !(!r||!r[t.toLowerCase()])},isValid:function(e,t){var n,r,o=_(e);if(o){if(!t)return !0;if(o.attributes[t])return !0;if(n=o.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(e))return !0}return !1},getCustomElements:H,addValidElements:w,setValidElements:S,addCustomElements:N,addValidChildren:E}},Ri=function(e,t,n,r){var o=function(e){return (e=parseInt(e,10).toString(16)).length>1?e:"0"+e};return "#"+o(t)+o(n)+o(r)},Di=function(e,t){var n,r,o,i=this,a=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,u=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,c=/\s*([^:]+):\s*([^;]+);?/g,s=/\s+$/,f={},l="\ufeff";e=e||{},t&&(r=t.getValidStyles(),o=t.getInvalidStyles());var d="\\\" \\' \\; \\: ; : \ufeff".split(" ");for(n=0;n<d.length;n++)f[d[n]]=l+n,f[l+n]=d[n];return {toHex:function(e){return e.replace(a,Ri)},parse:function(t){var r,o,d,m,g,p,h,v,b={},y=e.url_converter,C=e.url_converter_scope||i,x=function(e,t,r){var o=b[e+"-top"+t];if(o){var i=b[e+"-right"+t];if(i){var a=b[e+"-bottom"+t];if(a){var u=b[e+"-left"+t];if(u){var c=[o,i,a,u];for(n=c.length-1;n--&&c[n]===c[n+1];);n>-1&&r||(b[e+t]=-1===n?c[0]:c.join(" "),delete b[e+"-top"+t],delete b[e+"-right"+t],delete b[e+"-bottom"+t],delete b[e+"-left"+t]);}}}}},w=function(e){var t,n=b[e];if(n){for(t=(n=n.split(" ")).length;t--;)if(n[t]!==n[0])return !1;return b[e]=n[0],!0}},S=function(e){return m=!0,f[e]},k=function(e,t){return m&&(e=e.replace(/\uFEFF[0-9]/g,(function(e){return f[e]}))),t||(e=e.replace(/\\([\'\";:])/g,"$1")),e},N=function(e){return String.fromCharCode(parseInt(e.slice(1),16))},E=function(e){return e.replace(/\\[0-9a-f]+/gi,N)},_=function(t,n,r,o,i,a){if(i=i||a)return "'"+(i=k(i)).replace(/\'/g,"\\'")+"'";if(n=k(n||r||o),!e.allow_script_urls){var u=n.replace(/[\s\r\n]+/g,"");if(/(java|vb)script:/i.test(u))return "";if(!e.allow_svg_data_urls&&/^data:image\/svg/i.test(u))return ""}return y&&(n=y.call(C,n,"style")),"url('"+n.replace(/\'/g,"\\'")+"')"};if(t){for(t=(t=t.replace(/[\u0000-\u001F]/g,"")).replace(/\\[\"\';:\uFEFF]/g,S).replace(/\"[^\"]+\"|\'[^\']+\'/g,(function(e){return e.replace(/[;:]/g,S)}));r=c.exec(t);)if(c.lastIndex=r.index+r[0].length,o=r[1].replace(s,"").toLowerCase(),d=r[2].replace(s,""),o&&d){if(o=E(o),d=E(d),-1!==o.indexOf(l)||-1!==o.indexOf('"'))continue;if(!e.allow_script_urls&&("behavior"===o||/expression\s*\(|\/\*|\*\//.test(d)))continue;"font-weight"===o&&"700"===d?d="bold":"color"!==o&&"background-color"!==o||(d=d.toLowerCase()),d=(d=d.replace(a,Ri)).replace(u,_),b[o]=m?k(d,!0):d;}x("border","",!0),x("border","-width"),x("border","-color"),x("border","-style"),x("padding",""),x("margin",""),g="border",h="border-style",v="border-color",w(p="border-width")&&w(h)&&w(v)&&(b[g]=b[p]+" "+b[h]+" "+b[v],delete b[p],delete b[h],delete b[v]),"medium none"===b.border&&delete b.border,"none"===b["border-image"]&&delete b["border-image"];}return b},serialize:function(e,t){var n="",i=function(t){var o,i=r[t];if(i)for(var a=0,u=i.length;a<u;a++)t=i[a],(o=e[t])&&(n+=(n.length>0?" ":"")+t+": "+o+";");};return t&&r?(i("*"),i(t)):le(e,(function(e,r){!e||o&&!function(e,t){var n=o["*"];return !(n&&n[e]||(n=o[t])&&n[e])}(r,t)||(n+=(n.length>0?" ":"")+r+": "+e+";");})),n}}},Ti={keyLocation:!0,layerX:!0,layerY:!0,returnValue:!0,webkitMovementX:!0,webkitMovementY:!0,keyIdentifier:!0,mozPressure:!0},Oi=function(e){return e instanceof Event||y(e.initEvent)},Bi=function(e,t,n,r){var o,i=function(e,t){var n=null!=t?t:{};for(var r in e)ye(Ti,r)||(n[r]=e[r]);return b(n.composedPath)&&(n.composedPath=function(){return e.composedPath()}),n}(t,r);return i.type=e,v(i.target)&&(i.target=null!==(o=i.srcElement)&&void 0!==o?o:n),function(e){return v(e.preventDefault)||Oi(e)}(t)&&(i.preventDefault=function(){i.defaultPrevented=!0,i.isDefaultPrevented=O,y(t.preventDefault)?t.preventDefault():Oi(t)&&(t.returnValue=!1);},i.stopPropagation=function(){i.cancelBubble=!0,i.isPropagationStopped=O,y(t.stopPropagation)?t.stopPropagation():Oi(t)&&(t.cancelBubble=!0);},i.stopImmediatePropagation=function(){i.isImmediatePropagationStopped=O,i.stopPropagation();},function(e){return e.isDefaultPrevented===O||e.isDefaultPrevented===T}(i)||(i.isDefaultPrevented=!0===i.defaultPrevented?O:T,i.isPropagationStopped=!0===i.cancelBubble?O:T,i.isImmediatePropagationStopped=T)),i},Pi=/^(?:mouse|contextmenu)|click/,Li=function(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r||!1):e.attachEvent&&e.attachEvent("on"+t,n);},Ii=function(e,t,n,r){e.removeEventListener?e.removeEventListener(t,n,r||!1):e.detachEvent&&e.detachEvent("on"+t,n);},Mi=function(e,t){var n=Bi(e.type,e,document,t);if(function(e){return b(e)&&Pi.test(e.type)}(e)&&h(e.pageX)&&!h(e.clientX)){var r=n.target.ownerDocument||document,o=r.documentElement,i=r.body,a=n;a.pageX=e.clientX+(o&&o.scrollLeft||i&&i.scrollLeft||0)-(o&&o.clientLeft||i&&i.clientLeft||0),a.pageY=e.clientY+(o&&o.scrollTop||i&&i.scrollTop||0)-(o&&o.clientTop||i&&i.clientTop||0);}return h(n.metaKey)&&(n.metaKey=!1),n},Fi=function(e,t,n){var r=e.document,o={type:"ready"};if(n.domLoaded)t(o);else {var i=function(){Ii(e,"DOMContentLoaded",i),Ii(e,"load",i),n.domLoaded||(n.domLoaded=!0,t(o)),e=null;};"complete"===r.readyState||"interactive"===r.readyState&&r.body?i():Li(e,"DOMContentLoaded",i),n.domLoaded||Li(e,"load",i);}},Ui=function(){function e(){this.domLoaded=!1,this.events={},this.count=1,this.expando="mce-data-"+(+new Date).toString(32),this.hasMouseEnterLeave="onmouseenter"in document.documentElement,this.hasFocusIn="onfocusin"in document.documentElement,this.count=1;}return e.prototype.bind=function(e,t,n,r){var o,i,a,u,c,s,f,l=this,d=window,m=function(e){l.executeHandlers(Mi(e||d.event),o);};if(e&&3!==e.nodeType&&8!==e.nodeType){e[l.expando]?o=e[l.expando]:(o=l.count++,e[l.expando]=o,l.events[o]={}),r=r||e;var g=t.split(" ");for(a=g.length;a--;)s=m,c=f=!1,"DOMContentLoaded"===(u=g[a])&&(u="ready"),l.domLoaded&&"ready"===u&&"complete"===e.readyState?n.call(r,Mi({type:u})):(l.hasMouseEnterLeave||(c=l.mouseEnterLeave[u])&&(s=function(e){var t=e.currentTarget,n=e.relatedTarget;if(n&&t.contains)n=t.contains(n);else for(;n&&n!==t;)n=n.parentNode;n||((e=Mi(e||d.event)).type="mouseout"===e.type?"mouseleave":"mouseenter",e.target=t,l.executeHandlers(e,o));}),l.hasFocusIn||"focusin"!==u&&"focusout"!==u||(f=!0,c="focusin"===u?"focus":"blur",s=function(e){(e=Mi(e||d.event)).type="focus"===e.type?"focusin":"focusout",l.executeHandlers(e,o);}),(i=l.events[o][u])?"ready"===u&&l.domLoaded?n(Mi({type:u})):i.push({func:n,scope:r}):(l.events[o][u]=i=[{func:n,scope:r}],i.fakeName=c,i.capture=f,i.nativeHandler=s,"ready"===u?Fi(e,s,l):Li(e,c||u,s,f)));return e=i=null,n}},e.prototype.unbind=function(e,t,n){var r,o,i,a,u;if(!e||3===e.nodeType||8===e.nodeType)return this;var c=e[this.expando];if(c){if(u=this.events[c],t){var s=t.split(" ");for(o=s.length;o--;)if(r=u[a=s[o]]){if(n)for(i=r.length;i--;)if(r[i].func===n){var f=r.nativeHandler,l=r.fakeName,d=r.capture;(r=r.slice(0,i).concat(r.slice(i+1))).nativeHandler=f,r.fakeName=l,r.capture=d,u[a]=r;}n&&0!==r.length||(delete u[a],Ii(e,r.fakeName||a,r.nativeHandler,r.capture));}}else le(u,(function(t,n){Ii(e,t.fakeName||n,t.nativeHandler,t.capture);})),u={};for(a in u)if(ye(u,a))return this;delete this.events[c];try{delete e[this.expando];}catch(t){e[this.expando]=null;}}return this},e.prototype.fire=function(e,t,n){var r;if(!e||3===e.nodeType||8===e.nodeType)return this;var o=Mi({type:t,target:e},n);do{(r=e[this.expando])&&this.executeHandlers(o,r),e=e.parentNode||e.ownerDocument||e.defaultView||e.parentWindow;}while(e&&!o.isPropagationStopped());return this},e.prototype.clean=function(e){var t,n;if(!e||3===e.nodeType||8===e.nodeType)return this;if(e[this.expando]&&this.unbind(e),e.getElementsByTagName||(e=e.document),e&&e.getElementsByTagName)for(this.unbind(e),t=(n=e.getElementsByTagName("*")).length;t--;)(e=n[t])[this.expando]&&this.unbind(e);return this},e.prototype.destroy=function(){this.events={};},e.prototype.cancel=function(e){return e&&(e.preventDefault(),e.stopImmediatePropagation()),!1},e.prototype.executeHandlers=function(e,t){var n=this.events[t],r=n&&n[e.type];if(r)for(var o=0,i=r.length;o<i;o++){var a=r[o];if(a&&!1===a.func.call(a.scope,e)&&e.preventDefault(),e.isImmediatePropagationStopped())return}},e.Event=new e,e}(),zi="sizzle"+-new Date,Hi=window.document,ji=0,Vi=0,qi=Sa(),$i=Sa(),Wi=Sa(),Ki=function(e,t){return e===t&&(Ur=!0),0},Xi="undefined",Yi=1<<31,Gi={}.hasOwnProperty,Ji=[],Qi=Ji.pop,Zi=Ji.push,ea=Ji.push,ta=Ji.slice,na=Ji.indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(this[t]===e)return t;return -1},ra="[\\x20\\t\\r\\n\\f]",oa="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",ia="\\[[\\x20\\t\\r\\n\\f]*("+oa+")(?:"+ra+"*([*^$|!~]?=)"+ra+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+oa+"))|)"+ra+"*\\]",aa=":("+oa+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+ia+")*)|.*)\\)|)",ua=new RegExp("^[\\x20\\t\\r\\n\\f]+|((?:^|[^\\\\])(?:\\\\.)*)[\\x20\\t\\r\\n\\f]+$","g"),ca=new RegExp("^[\\x20\\t\\r\\n\\f]*,[\\x20\\t\\r\\n\\f]*"),sa=new RegExp("^[\\x20\\t\\r\\n\\f]*([>+~]|[\\x20\\t\\r\\n\\f])[\\x20\\t\\r\\n\\f]*"),fa=new RegExp("=[\\x20\\t\\r\\n\\f]*([^\\]'\"]*?)[\\x20\\t\\r\\n\\f]*\\]","g"),la=new RegExp(aa),da=new RegExp("^"+oa+"$"),ma={ID:new RegExp("^#("+oa+")"),CLASS:new RegExp("^\\.("+oa+")"),TAG:new RegExp("^("+oa+"|[*])"),ATTR:new RegExp("^"+ia),PSEUDO:new RegExp("^"+aa),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\([\\x20\\t\\r\\n\\f]*(even|odd|(([+-]|)(\\d*)n|)[\\x20\\t\\r\\n\\f]*(?:([+-]|)[\\x20\\t\\r\\n\\f]*(\\d+)|))[\\x20\\t\\r\\n\\f]*\\)|)","i"),bool:new RegExp("^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$","i"),needsContext:new RegExp("^[\\x20\\t\\r\\n\\f]*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\([\\x20\\t\\r\\n\\f]*((?:-\\d)?\\d*)[\\x20\\t\\r\\n\\f]*\\)|)(?=[^-]|$)","i")},ga=/^(?:input|select|textarea|button)$/i,pa=/^h\d$/i,ha=/^[^{]+\{\s*\[native \w/,va=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ba=/[+~]/,ya=/'|\\/g,Ca=new RegExp("\\\\([\\da-f]{1,6}[\\x20\\t\\r\\n\\f]?|([\\x20\\t\\r\\n\\f])|.)","ig"),xa=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{ea.apply(Ji=ta.call(Hi.childNodes),Hi.childNodes),Ji[Hi.childNodes.length].nodeType;}catch(e){ea={apply:Ji.length?function(e,t){Zi.apply(e,ta.call(t));}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1;}};}var wa=function(e,t,n,r){var o,i,a,u,c,s,f,l,d,m;if((t?t.ownerDocument||t:Hi)!==Hr&&zr(t),n=n||[],!e||"string"!=typeof e)return n;if(1!==(u=(t=t||Hr).nodeType)&&9!==u)return [];if(Vr&&!r){if(o=va.exec(e))if(a=o[1]){if(9===u){if(!(i=t.getElementById(a))||!i.parentNode)return n;if(i.id===a)return n.push(i),n}else if(t.ownerDocument&&(i=t.ownerDocument.getElementById(a))&&Wr(t,i)&&i.id===a)return n.push(i),n}else {if(o[2])return ea.apply(n,t.getElementsByTagName(e)),n;if((a=o[3])&&Dr.getElementsByClassName)return ea.apply(n,t.getElementsByClassName(a)),n}if(Dr.qsa&&(!qr||!qr.test(e))){if(l=f=zi,d=t,m=9===u&&e,1===u&&"object"!==t.nodeName.toLowerCase()){for(s=Pr(e),(f=t.getAttribute("id"))?l=f.replace(ya,"\\$&"):t.setAttribute("id",l),l="[id='"+l+"'] ",c=s.length;c--;)s[c]=l+Ra(s[c]);d=ba.test(e)&&_a(t.parentNode)||t,m=s.join(",");}if(m)try{return ea.apply(n,d.querySelectorAll(m)),n}catch(e){}finally{f||t.removeAttribute("id");}}}return Ir(e.replace(ua,"$1"),t,n,r)};function Sa(){var e=[];return function t(n,r){return e.push(n+" ")>Tr.cacheLength&&delete t[e.shift()],t[n+" "]=r}}function ka(e){return e[zi]=!0,e}function Na(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||Yi)-(~e.sourceIndex||Yi);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return -1;return e?1:-1}function Ea(e){return ka((function(t){return t=+t,ka((function(n,r){for(var o,i=e([],n.length,t),a=i.length;a--;)n[o=i[a]]&&(n[o]=!(r[o]=n[o]));}))}))}function _a(e){return e&&typeof e.getElementsByTagName!==Xi&&e}function Aa(){}function Ra(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function Da(e,t,n){var r=t.dir,o=n&&"parentNode"===r,i=Vi++;return t.first?function(t,n,i){for(;t=t[r];)if(1===t.nodeType||o)return e(t,n,i)}:function(t,n,a){var u,c,s=[ji,i];if(a){for(;t=t[r];)if((1===t.nodeType||o)&&e(t,n,a))return !0}else for(;t=t[r];)if(1===t.nodeType||o){if((u=(c=t[zi]||(t[zi]={}))[r])&&u[0]===ji&&u[1]===i)return s[2]=u[2];if(c[r]=s,s[2]=e(t,n,a))return !0}}}function Ta(e){return e.length>1?function(t,n,r){for(var o=e.length;o--;)if(!e[o](t,n,r))return !1;return !0}:e[0]}function Oa(e,t,n,r,o){for(var i,a=[],u=0,c=e.length,s=null!=t;u<c;u++)(i=e[u])&&(n&&!n(i,r,o)||(a.push(i),s&&t.push(u)));return a}function Ba(e,t,n,r,o,i){return r&&!r[zi]&&(r=Ba(r)),o&&!o[zi]&&(o=Ba(o,i)),ka((function(i,a,u,c){var s,f,l,d=[],m=[],g=a.length,p=i||function(e,t,n){for(var r=0,o=t.length;r<o;r++)wa(e,t[r],n);return n}(t||"*",u.nodeType?[u]:u,[]),h=!e||!i&&t?p:Oa(p,d,e,u,c),v=n?o||(i?e:g||r)?[]:a:h;if(n&&n(h,v,u,c),r)for(s=Oa(v,m),r(s,[],u,c),f=s.length;f--;)(l=s[f])&&(v[m[f]]=!(h[m[f]]=l));if(i){if(o||e){if(o){for(s=[],f=v.length;f--;)(l=v[f])&&s.push(h[f]=l);o(null,v=[],s,c);}for(f=v.length;f--;)(l=v[f])&&(s=o?na.call(i,l):d[f])>-1&&(i[s]=!(a[s]=l));}}else v=Oa(v===a?v.splice(g,v.length):v),o?o(null,a,v,c):ea.apply(a,v);}))}function Pa(e){for(var t,n,r,o=e.length,i=Tr.relative[e[0].type],a=i||Tr.relative[" "],u=i?1:0,c=Da((function(e){return e===t}),a,!0),s=Da((function(e){return na.call(t,e)>-1}),a,!0),f=[function(e,n,r){var o=!i&&(r||n!==Mr)||((t=n).nodeType?c(e,n,r):s(e,n,r));return t=null,o}];u<o;u++)if(n=Tr.relative[e[u].type])f=[Da(Ta(f),n)];else {if((n=Tr.filter[e[u].type].apply(null,e[u].matches))[zi]){for(r=++u;r<o&&!Tr.relative[e[r].type];r++);return Ba(u>1&&Ta(f),u>1&&Ra(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(ua,"$1"),n,u<r&&Pa(e.slice(u,r)),r<o&&Pa(e=e.slice(r)),r<o&&Ra(e))}f.push(n);}return Ta(f)}Dr=wa.support={},Br=wa.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return !!t&&"HTML"!==t.nodeName},zr=wa.setDocument=function(e){var t,n=e?e.ownerDocument||e:Hi,r=n.defaultView;return n!==Hr&&9===n.nodeType&&n.documentElement?(Hr=n,jr=n.documentElement,Vr=!Br(n),r&&r!==function(e){try{return e.top}catch(e){}return null}(r)&&(r.addEventListener?r.addEventListener("unload",(function(){zr();}),!1):r.attachEvent&&r.attachEvent("onunload",(function(){zr();}))),Dr.attributes=!0,Dr.getElementsByTagName=!0,Dr.getElementsByClassName=ha.test(n.getElementsByClassName),Dr.getById=!0,Tr.find.ID=function(e,t){if(typeof t.getElementById!==Xi&&Vr){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},Tr.filter.ID=function(e){var t=e.replace(Ca,xa);return function(e){return e.getAttribute("id")===t}},Tr.find.TAG=Dr.getElementsByTagName?function(e,t){if(typeof t.getElementsByTagName!==Xi)return t.getElementsByTagName(e)}:function(e,t){var n,r=[],o=0,i=t.getElementsByTagName(e);if("*"===e){for(;n=i[o++];)1===n.nodeType&&r.push(n);return r}return i},Tr.find.CLASS=Dr.getElementsByClassName&&function(e,t){if(Vr)return t.getElementsByClassName(e)},$r=[],qr=[],Dr.disconnectedMatch=!0,qr=qr.length&&new RegExp(qr.join("|")),$r=$r.length&&new RegExp($r.join("|")),t=ha.test(jr.compareDocumentPosition),Wr=t||ha.test(jr.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return !0;return !1},Ki=t?function(e,t){if(e===t)return Ur=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!Dr.sortDetached&&t.compareDocumentPosition(e)===r?e===n||e.ownerDocument===Hi&&Wr(Hi,e)?-1:t===n||t.ownerDocument===Hi&&Wr(Hi,t)?1:Fr?na.call(Fr,e)-na.call(Fr,t):0:4&r?-1:1)}:function(e,t){if(e===t)return Ur=!0,0;var r,o=0,i=e.parentNode,a=t.parentNode,u=[e],c=[t];if(!i||!a)return e===n?-1:t===n?1:i?-1:a?1:Fr?na.call(Fr,e)-na.call(Fr,t):0;if(i===a)return Na(e,t);for(r=e;r=r.parentNode;)u.unshift(r);for(r=t;r=r.parentNode;)c.unshift(r);for(;u[o]===c[o];)o++;return o?Na(u[o],c[o]):u[o]===Hi?-1:c[o]===Hi?1:0},n):Hr},wa.matches=function(e,t){return wa(e,null,null,t)},wa.matchesSelector=function(e,t){if((e.ownerDocument||e)!==Hr&&zr(e),t=t.replace(fa,"='$1']"),Dr.matchesSelector&&Vr&&(!$r||!$r.test(t))&&(!qr||!qr.test(t)))try{var n=undefined.call(e,t);if(n||Dr.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){}return wa(t,Hr,null,[e]).length>0},wa.contains=function(e,t){return (e.ownerDocument||e)!==Hr&&zr(e),Wr(e,t)},wa.attr=function(e,t){(e.ownerDocument||e)!==Hr&&zr(e);var n=Tr.attrHandle[t.toLowerCase()],r=n&&Gi.call(Tr.attrHandle,t.toLowerCase())?n(e,t,!Vr):void 0;return void 0!==r?r:Dr.attributes||!Vr?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},wa.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},wa.uniqueSort=function(e){var t,n=[],r=0,o=0;if(Ur=!Dr.detectDuplicates,Fr=!Dr.sortStable&&e.slice(0),e.sort(Ki),Ur){for(;t=e[o++];)t===e[o]&&(r=n.push(o));for(;r--;)e.splice(n[r],1);}return Fr=null,e},Or=wa.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=Or(e);}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=Or(t);return n},Tr=wa.selectors={cacheLength:50,createPseudo:ka,match:ma,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Ca,xa),e[3]=(e[3]||e[4]||e[5]||"").replace(Ca,xa),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||wa.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&wa.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return ma.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&la.test(n)&&(t=Pr(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Ca,xa).toLowerCase();return "*"===e?function(){return !0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=qi[e+" "];return t||(t=new RegExp("(^|[\\x20\\t\\r\\n\\f])"+e+"("+ra+"|$)"))&&qi(e,(function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==Xi&&e.getAttribute("class")||"")}))},ATTR:function(e,t,n){return function(r){var o=wa.attr(r,e);return null==o?"!="===t:!t||(o+="","="===t?o===n:"!="===t?o!==n:"^="===t?n&&0===o.indexOf(n):"*="===t?n&&o.indexOf(n)>-1:"$="===t?n&&o.slice(-n.length)===n:"~="===t?(" "+o+" ").indexOf(n)>-1:"|="===t&&(o===n||o.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,o){var i="nth"!==e.slice(0,3),a="last"!==e.slice(-4),u="of-type"===t;return 1===r&&0===o?function(e){return !!e.parentNode}:function(t,n,c){var s,f,l,d,m,g,p=i!==a?"nextSibling":"previousSibling",h=t.parentNode,v=u&&t.nodeName.toLowerCase(),b=!c&&!u;if(h){if(i){for(;p;){for(l=t;l=l[p];)if(u?l.nodeName.toLowerCase()===v:1===l.nodeType)return !1;g=p="only"===e&&!g&&"nextSibling";}return !0}if(g=[a?h.firstChild:h.lastChild],a&&b){for(m=(s=(f=h[zi]||(h[zi]={}))[e]||[])[0]===ji&&s[1],d=s[0]===ji&&s[2],l=m&&h.childNodes[m];l=++m&&l&&l[p]||(d=m=0)||g.pop();)if(1===l.nodeType&&++d&&l===t){f[e]=[ji,m,d];break}}else if(b&&(s=(t[zi]||(t[zi]={}))[e])&&s[0]===ji)d=s[1];else for(;(l=++m&&l&&l[p]||(d=m=0)||g.pop())&&((u?l.nodeName.toLowerCase()!==v:1!==l.nodeType)||!++d||(b&&((l[zi]||(l[zi]={}))[e]=[ji,d]),l!==t)););return (d-=o)===r||d%r==0&&d/r>=0}}},PSEUDO:function(e,t){var n,r=Tr.pseudos[e]||Tr.setFilters[e.toLowerCase()]||wa.error("unsupported pseudo: "+e);return r[zi]?r(t):r.length>1?(n=[e,e,"",t],Tr.setFilters.hasOwnProperty(e.toLowerCase())?ka((function(e,n){for(var o,i=r(e,t),a=i.length;a--;)e[o=na.call(e,i[a])]=!(n[o]=i[a]);})):function(e){return r(e,0,n)}):r}},pseudos:{not:ka((function(e){var t=[],n=[],r=Lr(e.replace(ua,"$1"));return r[zi]?ka((function(e,t,n,o){for(var i,a=r(e,null,o,[]),u=e.length;u--;)(i=a[u])&&(e[u]=!(t[u]=i));})):function(e,o,i){return t[0]=e,r(t,null,i,n),t[0]=null,!n.pop()}})),has:ka((function(e){return function(t){return wa(e,t).length>0}})),contains:ka((function(e){return e=e.replace(Ca,xa),function(t){return (t.textContent||t.innerText||Or(t)).indexOf(e)>-1}})),lang:ka((function(e){return da.test(e||"")||wa.error("unsupported lang: "+e),e=e.replace(Ca,xa).toLowerCase(),function(t){var n;do{if(n=Vr?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return (n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return !1}})),target:function(e){var t=window.location&&window.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===jr},focus:function(e){return e===Hr.activeElement&&(!Hr.hasFocus||Hr.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return !1===e.disabled},disabled:function(e){return !0===e.disabled},checked:function(e){var t=e.nodeName.toLowerCase();return "input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return !1;return !0},parent:function(e){return !Tr.pseudos.empty(e)},header:function(e){return pa.test(e.nodeName)},input:function(e){return ga.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return "input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return "input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:Ea((function(){return [0]})),last:Ea((function(e,t){return [t-1]})),eq:Ea((function(e,t,n){return [n<0?n+t:n]})),even:Ea((function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e})),odd:Ea((function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e})),lt:Ea((function(e,t,n){for(var r=n<0?n+t:n;--r>=0;)e.push(r);return e})),gt:Ea((function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e}))}},Tr.pseudos.nth=Tr.pseudos.eq,q(["radio","checkbox","file","password","image"],(function(e){Tr.pseudos[e]=function(e){return function(t){return "input"===t.nodeName.toLowerCase()&&t.type===e}}(e);})),q(["submit","reset"],(function(e){Tr.pseudos[e]=function(e){return function(t){var n=t.nodeName.toLowerCase();return ("input"===n||"button"===n)&&t.type===e}}(e);})),Aa.prototype=Tr.filters=Tr.pseudos,Tr.setFilters=new Aa,Pr=wa.tokenize=function(e,t){var n,r,o,i,a,u,c,s=$i[e+" "];if(s)return t?0:s.slice(0);for(a=e,u=[],c=Tr.preFilter;a;){for(i in n&&!(r=ca.exec(a))||(r&&(a=a.slice(r[0].length)||a),u.push(o=[])),n=!1,(r=sa.exec(a))&&(n=r.shift(),o.push({value:n,type:r[0].replace(ua," ")}),a=a.slice(n.length)),Tr.filter)Tr.filter.hasOwnProperty(i)&&(!(r=ma[i].exec(a))||c[i]&&!(r=c[i](r))||(n=r.shift(),o.push({value:n,type:i,matches:r}),a=a.slice(n.length)));if(!n)break}return t?a.length:a?wa.error(e):$i(e,u).slice(0)},Lr=wa.compile=function(e,t){var n,r=[],o=[],i=Wi[e+" "];if(!i){for(t||(t=Pr(e)),n=t.length;n--;)(i=Pa(t[n]))[zi]?r.push(i):o.push(i);i=Wi(e,function(e,t){var n=t.length>0,r=e.length>0,o=function(o,i,a,u,c){var s,f,l,d=0,m="0",g=o&&[],p=[],h=Mr,v=o||r&&Tr.find.TAG("*",c),b=ji+=null==h?1:Math.random()||.1,y=v.length;for(c&&(Mr=i!==Hr&&i);m!==y&&null!=(s=v[m]);m++){if(r&&s){for(f=0;l=e[f++];)if(l(s,i,a)){u.push(s);break}c&&(ji=b);}n&&((s=!l&&s)&&d--,o&&g.push(s));}if(d+=m,n&&m!==d){for(f=0;l=t[f++];)l(g,p,i,a);if(o){if(d>0)for(;m--;)g[m]||p[m]||(p[m]=Qi.call(u));p=Oa(p);}ea.apply(u,p),c&&!o&&p.length>0&&d+t.length>1&&wa.uniqueSort(u);}return c&&(ji=b,Mr=h),g};return n?ka(o):o}(o,r)),i.selector=e;}return i},Ir=wa.select=function(e,t,n,r){var o,i,a,u,c,s="function"==typeof e&&e,f=!r&&Pr(e=s.selector||e);if(n=n||[],1===f.length){if((i=f[0]=f[0].slice(0)).length>2&&"ID"===(a=i[0]).type&&Dr.getById&&9===t.nodeType&&Vr&&Tr.relative[i[1].type]){if(!(t=(Tr.find.ID(a.matches[0].replace(Ca,xa),t)||[])[0]))return n;s&&(t=t.parentNode),e=e.slice(i.shift().value.length);}for(o=ma.needsContext.test(e)?0:i.length;o--&&(a=i[o],!Tr.relative[u=a.type]);)if((c=Tr.find[u])&&(r=c(a.matches[0].replace(Ca,xa),ba.test(i[0].type)&&_a(t.parentNode)||t))){if(i.splice(o,1),!(e=r.length&&Ra(i)))return ea.apply(n,r),n;break}}return (s||Lr(e,f))(r,t,!Vr,n,ba.test(e)&&_a(t.parentNode)||t),n},Dr.sortStable=zi.split("").sort(Ki).join("")===zi,Dr.detectDuplicates=!!Ur,zr(),Dr.sortDetached=!0;var La=document,Ia=Array.prototype.push,Ma=Array.prototype.slice,Fa=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,Ua=Ui.Event,za=_t.makeMap("children,contents,next,prev"),Ha=function(e){return void 0!==e},ja=function(e){return "string"==typeof e},Va=function(e,t){var n,r=(t=t||La).createElement("div"),o=t.createDocumentFragment();for(r.innerHTML=e;n=r.firstChild;)o.appendChild(n);return o},qa=function(e,t,n,r){var o;if(ja(t))t=Va(t,ou(e[0]));else if(t.length&&!t.nodeType){if(t=cu.makeArray(t),r)for(o=t.length-1;o>=0;o--)qa(e,t[o],n,r);else for(o=0;o<t.length;o++)qa(e,t[o],n,r);return e}if(t.nodeType)for(o=e.length;o--;)n.call(e[o],t);return e},$a=function(e,t){return e&&t&&-1!==(" "+e.className+" ").indexOf(" "+t+" ")},Wa=function(e,t,n){var r,o;return t=cu(t)[0],e.each((function(){var e=this;n&&r===e.parentNode||(r=e.parentNode,o=t.cloneNode(!1),e.parentNode.insertBefore(o,e)),o.appendChild(e);})),e},Ka=_t.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),Xa=_t.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),Ya={for:"htmlFor",class:"className",readonly:"readOnly"},Ga={float:"cssFloat"},Ja={},Qa={},Za=function(e,t){return new cu.fn.init(e,t)},eu=/^\s*|\s*$/g,tu=function(e){return null==e?"":(""+e).replace(eu,"")},nu=function(e,t){var n,r,o,i;if(e)if(void 0===(n=e.length)){for(r in e)if(e.hasOwnProperty(r)&&(i=e[r],!1===t.call(i,r,i)))break}else for(o=0;o<n&&(i=e[o],!1!==t.call(i,o,i));o++);return e},ru=function(e,t){var n=[];return nu(e,(function(e,r){t(r,e)&&n.push(r);})),n},ou=function(e){return e?9===e.nodeType?e:e.ownerDocument:La};Za.fn=Za.prototype={constructor:Za,selector:"",context:null,length:0,init:function(e,t){var n,r,o=this;if(!e)return o;if(e.nodeType)return o.context=o[0]=e,o.length=1,o;if(t&&t.nodeType)o.context=t;else {if(t)return cu(e).attr(t);o.context=t=document;}if(ja(e)){if(o.selector=e,!(n="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:Fa.exec(e)))return cu(t).find(e);if(n[1])for(r=Va(e,ou(t)).firstChild;r;)Ia.call(o,r),r=r.nextSibling;else {if(!(r=ou(t).getElementById(n[2])))return o;if(r.id!==n[2])return o.find(e);o.length=1,o[0]=r;}}else this.add(e,!1);return o},toArray:function(){return _t.toArray(this)},add:function(e,t){var n,r,o=this;if(ja(e))return o.add(cu(e));if(!1!==t)for(n=cu.unique(o.toArray().concat(cu.makeArray(e))),o.length=n.length,r=0;r<n.length;r++)o[r]=n[r];else Ia.apply(o,cu.makeArray(e));return o},attr:function(e,t){var n,r=this;if("object"==typeof e)nu(e,(function(e,t){r.attr(e,t);}));else {if(!Ha(t)){if(r[0]&&1===r[0].nodeType){if((n=Ja[e])&&n.get)return n.get(r[0],e);if(Xa[e])return r.prop(e)?e:void 0;null===(t=r[0].getAttribute(e,2))&&(t=void 0);}return t}this.each((function(){var n;if(1===this.nodeType){if((n=Ja[e])&&n.set)return void n.set(this,t);null===t?this.removeAttribute(e,2):this.setAttribute(e,t,2);}}));}return r},removeAttr:function(e){return this.attr(e,null)},prop:function(e,t){var n=this;if("object"==typeof(e=Ya[e]||e))nu(e,(function(e,t){n.prop(e,t);}));else {if(!Ha(t))return n[0]&&n[0].nodeType&&e in n[0]?n[0][e]:t;this.each((function(){1===this.nodeType&&(this[e]=t);}));}return n},css:function(e,t){var n,r,o=this,i=function(e){return e.replace(/-(\D)/g,(function(e,t){return t.toUpperCase()}))},a=function(e){return e.replace(/[A-Z]/g,(function(e){return "-"+e}))};if("object"==typeof e)nu(e,(function(e,t){o.css(e,t);}));else if(Ha(t))e=i(e),"number"!=typeof t||Ka[e]||(t=t.toString()+"px"),o.each((function(){var n=this.style;if((r=Qa[e])&&r.set)r.set(this,t);else {try{this.style[Ga[e]||e]=t;}catch(e){}null!==t&&""!==t||(n.removeProperty?n.removeProperty(a(e)):n.removeAttribute(e));}}));else {if(n=o[0],(r=Qa[e])&&r.get)return r.get(n);if(!n.ownerDocument.defaultView)return n.currentStyle?n.currentStyle[i(e)]:"";try{return n.ownerDocument.defaultView.getComputedStyle(n,null).getPropertyValue(a(e))}catch(e){return}}return o},remove:function(){for(var e,t=this.length;t--;)e=this[t],Ua.clean(e),e.parentNode&&e.parentNode.removeChild(e);return this},empty:function(){for(var e,t=this.length;t--;)for(e=this[t];e.firstChild;)e.removeChild(e.firstChild);return this},html:function(e){var t,n=this;if(Ha(e)){t=n.length;try{for(;t--;)n[t].innerHTML=e;}catch(r){cu(n[t]).empty().append(e);}return n}return n[0]?n[0].innerHTML:""},text:function(e){var t,n=this;if(Ha(e)){for(t=n.length;t--;)"innerText"in n[t]?n[t].innerText=e:n[0].textContent=e;return n}return n[0]?n[0].innerText||n[0].textContent:""},append:function(){return qa(this,arguments,(function(e){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.appendChild(e);}))},prepend:function(){return qa(this,arguments,(function(e){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.insertBefore(e,this.firstChild);}),!0)},before:function(){var e=this;return e[0]&&e[0].parentNode?qa(e,arguments,(function(e){this.parentNode.insertBefore(e,this);})):e},after:function(){var e=this;return e[0]&&e[0].parentNode?qa(e,arguments,(function(e){this.parentNode.insertBefore(e,this.nextSibling);}),!0):e},appendTo:function(e){return cu(e).append(this),this},prependTo:function(e){return cu(e).prepend(this),this},replaceWith:function(e){return this.before(e).remove()},wrap:function(e){return Wa(this,e)},wrapAll:function(e){return Wa(this,e,!0)},wrapInner:function(e){return this.each((function(){cu(this).contents().wrapAll(e);})),this},unwrap:function(){return this.parent().each((function(){cu(this).replaceWith(this.childNodes);}))},clone:function(){var e=[];return this.each((function(){e.push(this.cloneNode(!0));})),cu(e)},addClass:function(e){return this.toggleClass(e,!0)},removeClass:function(e){return this.toggleClass(e,!1)},toggleClass:function(e,t){var n=this;return "string"!=typeof e||(-1!==e.indexOf(" ")?nu(e.split(" "),(function(){n.toggleClass(this,t);})):n.each((function(n,r){var o=$a(r,e);if(o!==t){var i=r.className;o?r.className=tu((" "+i+" ").replace(" "+e+" "," ")):r.className+=i?" "+e:e;}}))),n},hasClass:function(e){return $a(this[0],e)},each:function(e){return nu(this,e)},on:function(e,t){return this.each((function(){Ua.bind(this,e,t);}))},off:function(e,t){return this.each((function(){Ua.unbind(this,e,t);}))},trigger:function(e){return this.each((function(){"object"==typeof e?Ua.fire(this,e.type,e):Ua.fire(this,e);}))},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return cu(Ma.apply(this,arguments))},eq:function(e){return -1===e?this.slice(e):this.slice(e,+e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},find:function(e){var t,n,r=[];for(t=0,n=this.length;t<n;t++)cu.find(e,this[t],r);return cu(r)},filter:function(e){return cu("function"==typeof e?ru(this.toArray(),(function(t,n){return e(n,t)})):cu.filter(e,this.toArray()))},closest:function(e){var t=[];return e instanceof cu&&(e=e[0]),this.each((function(n,r){for(;r;){if("string"==typeof e&&cu(r).is(e)){t.push(r);break}if(r===e){t.push(r);break}r=r.parentNode;}})),cu(t)},offset:function(e){var t,n,r,o,i=0,a=0;return e?this.css(e):((t=this[0])&&(r=(n=t.ownerDocument).documentElement,t.getBoundingClientRect&&(i=(o=t.getBoundingClientRect()).left+(r.scrollLeft||n.body.scrollLeft)-r.clientLeft,a=o.top+(r.scrollTop||n.body.scrollTop)-r.clientTop)),{left:i,top:a})},push:Ia,sort:Array.prototype.sort,splice:Array.prototype.splice},_t.extend(Za,{extend:_t.extend,makeArray:function(e){return (t=e)&&t===t.window||e.nodeType?[e]:_t.toArray(e);var t;},inArray:function(e,t){var n;if(t.indexOf)return t.indexOf(e);for(n=t.length;n--;)if(t[n]===e)return n;return -1},isArray:_t.isArray,each:nu,trim:tu,grep:ru,find:wa,expr:wa.selectors,unique:wa.uniqueSort,text:wa.getText,contains:wa.contains,filter:function(e,t,n){var r=t.length;for(n&&(e=":not("+e+")");r--;)1!==t[r].nodeType&&t.splice(r,1);return t=1===t.length?cu.find.matchesSelector(t[0],e)?[t[0]]:[]:cu.find.matches(e,t)}});var iu=function(e,t,n){var r=[],o=e[t];for("string"!=typeof n&&n instanceof cu&&(n=n[0]);o&&9!==o.nodeType;){if(void 0!==n){if(o===n)break;if("string"==typeof n&&cu(o).is(n))break}1===o.nodeType&&r.push(o),o=o[t];}return r},au=function(e,t,n,r){var o=[];for(r instanceof cu&&(r=r[0]);e;e=e[t])if(!n||e.nodeType===n){if(void 0!==r){if(e===r)break;if("string"==typeof r&&cu(e).is(r))break}o.push(e);}return o},uu=function(e,t,n){for(e=e[t];e;e=e[t])if(e.nodeType===n)return e;return null};nu({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return iu(e,"parentNode")},next:function(e){return uu(e,"nextSibling",1)},prev:function(e){return uu(e,"previousSibling",1)},children:function(e){return au(e.firstChild,"nextSibling",1)},contents:function(e){return _t.toArray(("iframe"===e.nodeName?e.contentDocument||e.contentWindow.document:e).childNodes)}},(function(e,t){Za.fn[e]=function(n){var r=[];this.each((function(){var e=t.call(r,this,n,r);e&&(cu.isArray(e)?r.push.apply(r,e):r.push(e));})),this.length>1&&(za[e]||(r=cu.unique(r)),0===e.indexOf("parents")&&(r=r.reverse()));var o=cu(r);return n?o.filter(n):o};})),nu({parentsUntil:function(e,t){return iu(e,"parentNode",t)},nextUntil:function(e,t){return au(e,"nextSibling",1,t).slice(1)},prevUntil:function(e,t){return au(e,"previousSibling",1,t).slice(1)}},(function(e,t){Za.fn[e]=function(n,r){var o=[];this.each((function(){var e=t.call(o,this,n,o);e&&(cu.isArray(e)?o.push.apply(o,e):o.push(e));})),this.length>1&&(o=cu.unique(o),0!==e.indexOf("parents")&&"prevUntil"!==e||(o=o.reverse()));var i=cu(o);return r?i.filter(r):i};})),Za.fn.is=function(e){return !!e&&this.filter(e).length>0},Za.fn.init.prototype=Za.fn,Za.overrideDefaults=function(e){var t,n=function(r,o){return t=t||e(),0===arguments.length&&(r=t.element),o||(o=t.context),new n.fn.init(r,o)};return cu.extend(n,this),n},Za.attrHooks=Ja,Za.cssHooks=Qa;var cu=Za,su=_t.each,fu=_t.grep,lu=wt.ie,du=/^([a-z0-9],?)+$/i,mu=function(e,t){var n=t.attr("style"),r=e.serialize(e.parse(n),t[0].nodeName);r||(r=null),t.attr("data-mce-style",r);},gu=function(e,t){var n,r,o=0;if(e)for(n=e.nodeType,e=e.previousSibling;e;e=e.previousSibling)r=e.nodeType,(!t||3!==r||r!==n&&e.nodeValue.length)&&(o++,n=r);return o},pu=function(e,t){void 0===t&&(t={});var n={},r=window,o={},i=0,a=io.forElement(Rt.fromDom(e),{contentCssCors:t.contentCssCors,referrerPolicy:t.referrerPolicy}),u=[],c=t.schema?t.schema:Ai({}),s=Di({url_converter:t.url_converter,url_converter_scope:t.url_converter_scope},t.schema),f=t.ownEvents?new Ui:Ui.Event,d=c.getBlockElements(),m=cu.overrideDefaults((function(){return {context:e,element:V.getRoot()}})),g=function(t){return t&&e&&l(t)?e.getElementById(t):t},p=function(e){return m("string"==typeof e?g(e):e)},h=function(e,t,n){var r,o,i=p(e);return i.length&&(o=(r=$[t])&&r.get?r.get(i,t):i.attr(t)),void 0===o&&(o=n||""),o},b=function(e){var t=g(e);return t?t.attributes:[]},y=function(e,n,r){""===r&&(r=null);var o=p(e),i=o.attr(n);if(o.length){var a=$[n];a&&a.set?a.set(o,r,n):o.attr(n,r),i!==r&&t.onSetAttrib&&t.onSetAttrib({attrElm:o,attrName:n,attrValue:r});}},C=function(){return t.root_element||e.body},w=function(t,n){return lr(e.body,g(t),n)},S=function(e,t,n){var r=p(e);return n?r.css(t):("float"===(t=t.replace(/-(\D)/g,(function(e,t){return t.toUpperCase()})))&&(t=wt.browser.isIE()?"styleFloat":"cssFloat"),r[0]&&r[0].style?r[0].style[t]:void 0)},N=function(e){var t,n;return e=g(e),t=S(e,"width"),n=S(e,"height"),-1===t.indexOf("px")&&(t=0),-1===n.indexOf("px")&&(n=0),{w:parseInt(t,10)||e.offsetWidth||e.clientWidth,h:parseInt(n,10)||e.offsetHeight||e.clientHeight}},E=function(e,t){var n;if(!e)return !1;if(!Array.isArray(e)){if("*"===t)return 1===e.nodeType;if(du.test(t)){var r=t.toLowerCase().split(/,/),o=e.nodeName.toLowerCase();for(n=r.length-1;n>=0;n--)if(r[n]===o)return !0;return !1}if(e.nodeType&&1!==e.nodeType)return !1}var i=Array.isArray(e)?e:[e];return wa(t,i[0].ownerDocument||i[0],null,i).length>0},_=function(e,t,n,r){var o,i=[],a=g(e);for(r=void 0===r,n=n||("BODY"!==C().nodeName?C().parentNode:null),_t.is(t,"string")&&(o=t,t="*"===t?function(e){return 1===e.nodeType}:function(e){return E(e,o)});a&&!(a===n||v(a.nodeType)||zn(a)||Hn(a));){if(!t||"function"==typeof t&&t(a)){if(!r)return [a];i.push(a);}a=a.parentNode;}return r?i:null},A=function(e,t,n){var r=t;if(e)for("string"==typeof t&&(r=function(e){return E(e,t)}),e=e[n];e;e=e[n])if("function"==typeof r&&r(e))return e;return null},R=function(e,t,n){var r,o="string"==typeof e?g(e):e;if(!o)return !1;if(_t.isArray(o)&&(o.length||0===o.length))return r=[],su(o,(function(e,o){e&&r.push(t.call(n,"string"==typeof e?g(e):e,o));})),r;var i=n||this;return t.call(i,o)},D=function(e,t){p(e).each((function(e,n){su(t,(function(e,t){y(n,t,e);}));}));},T=function(e,t){var n=p(e);lu?n.each((function(e,n){if(!1!==n.canHaveHTML){for(;n.firstChild;)n.removeChild(n.firstChild);try{n.innerHTML="<br>"+t,n.removeChild(n.firstChild);}catch(e){cu("<div></div>").html("<br>"+t).contents().slice(1).appendTo(n);}return t}})):n.html(t);},O=function(t,n,r,o,i){return R(t,(function(t){var a="string"==typeof n?e.createElement(n):n;return D(a,r),o&&("string"!=typeof o&&o.nodeType?a.appendChild(o):"string"==typeof o&&T(a,o)),i?a:t.appendChild(a)}))},B=function(t,n,r){return O(e.createElement(t),t,n,r,!0)},P=bi.encodeAllRaw,L=function(e,t){var n=p(e);return t?n.each((function(){for(var e;e=this.firstChild;)3===e.nodeType&&0===e.data.length?this.removeChild(e):this.parentNode.insertBefore(e,this);})).remove():n.remove(),n.length>1?n.toArray():n[0]},I=function(e,t,n){p(e).toggleClass(t,n).each((function(){""===this.className&&cu(this).attr("class",null);}));},M=function(e,t,n){return R(t,(function(t){return _t.is(t,"array")&&(e=e.cloneNode(!0)),n&&su(fu(t.childNodes),(function(t){e.appendChild(t);})),t.parentNode.replaceChild(e,t)}))},F=function(e){if(Dn(e)){var t="a"===e.nodeName.toLowerCase()&&!h(e,"href")&&h(e,"id");if(h(e,"name")||h(e,"data-mce-bookmark")||t)return !0}return !1},U=function(){return e.createRange()},z=function(n,o,i,a){if(_t.isArray(n)){for(var c=n.length,s=[];c--;)s[c]=z(n[c],o,i,a);return s}return !t.collect||n!==e&&n!==r||u.push([n,o,i,a]),f.bind(n,o,i,a||V)},H=function(t,n,o){if(_t.isArray(t)){for(var i=t.length,a=[];i--;)a[i]=H(t[i],n,o);return a}if(u.length>0&&(t===e||t===r))for(i=u.length;i--;){var c=u[i];t!==c[0]||n&&n!==c[1]||o&&o!==c[2]||f.unbind(c[0],c[1],c[2]);}return f.unbind(t,n,o)},j=function(e){if(e&&Dn(e)){var t=e.getAttribute("data-mce-contenteditable");return t&&"inherit"!==t?t:"inherit"!==e.contentEditable?e.contentEditable:null}return null},V={doc:e,settings:t,win:r,files:o,stdMode:!0,boxModel:!0,styleSheetLoader:a,boundEvents:u,styles:s,schema:c,events:f,isBlock:function(e){if("string"==typeof e)return !!d[e];if(e){var t=e.nodeType;if(t)return !(1!==t||!d[e.nodeName])}return !1},$:m,$$:p,root:null,clone:function(t,n){if(!lu||1!==t.nodeType||n)return t.cloneNode(n);var r=e.createElement(t.nodeName);return su(b(t),(function(e){y(r,e.nodeName,h(t,e.nodeName));})),r},getRoot:C,getViewPort:function(e){var t=_n(e);return {x:t.x,y:t.y,w:t.width,h:t.height}},getRect:function(e){e=g(e);var t=w(e),n=N(e);return {x:t.x,y:t.y,w:n.w,h:n.h}},getSize:N,getParent:function(e,t,n){var r=_(e,t,n,!1);return r&&r.length>0?r[0]:null},getParents:_,get:g,getNext:function(e,t){return A(e,t,"nextSibling")},getPrev:function(e,t){return A(e,t,"previousSibling")},select:function(n,r){return wa(n,g(r)||t.root_element||e,[])},is:E,add:O,create:B,createHTML:function(e,t,n){var r,o="";for(r in o+="<"+e,t)Ce(t,r)&&(o+=" "+r+'="'+P(t[r])+'"');return void 0!==n?o+">"+n+"</"+e+">":o+" />"},createFragment:function(t){var n,r=e.createElement("div"),o=e.createDocumentFragment();for(o.appendChild(r),t&&(r.innerHTML=t);n=r.firstChild;)o.appendChild(n);return o.removeChild(r),o},remove:L,setStyle:function(e,n,r){var o=l(n)?p(e).css(n,r):p(e).css(n);t.update_styles&&mu(s,o);},getStyle:S,setStyles:function(e,n){var r=p(e).css(n);t.update_styles&&mu(s,r);},removeAllAttribs:function(e){return R(e,(function(e){var t,n=e.attributes;for(t=n.length-1;t>=0;t--)e.removeAttributeNode(n.item(t));}))},setAttrib:y,setAttribs:D,getAttrib:h,getPos:w,parseStyle:function(e){return s.parse(e)},serializeStyle:function(e,t){return s.serialize(e,t)},addStyle:function(t){var r,o;if(V!==pu.DOM&&e===document){if(n[t])return;n[t]=!0;}(o=e.getElementById("mceDefaultStyles"))||((o=e.createElement("style")).id="mceDefaultStyles",o.type="text/css",(r=e.getElementsByTagName("head")[0]).firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o)),o.styleSheet?o.styleSheet.cssText+=t:o.appendChild(e.createTextNode(t));},loadCSS:function(e){e||(e=""),q(e.split(","),(function(e){o[e]=!0,a.load(e,x);}));},addClass:function(e,t){p(e).addClass(t);},removeClass:function(e,t){I(e,t,!1);},hasClass:function(e,t){return p(e).hasClass(t)},toggleClass:I,show:function(e){p(e).show();},hide:function(e){p(e).hide();},isHidden:function(e){return "none"===p(e).css("display")},uniqueId:function(e){return (e||"mce_")+i++},setHTML:T,getOuterHTML:function(e){var t="string"==typeof e?g(e):e;return Dn(t)?t.outerHTML:cu("<div></div>").append(cu(t).clone()).html()},setOuterHTML:function(e,t){p(e).each((function(){try{if("outerHTML"in this)return void(this.outerHTML=t)}catch(e){}L(cu(this).html(t),!0);}));},decode:bi.decode,encode:P,insertAfter:function(e,t){var n=g(t);return R(e,(function(e){var t=n.parentNode,r=n.nextSibling;return r?t.insertBefore(e,r):t.appendChild(e),e}))},replace:M,rename:function(e,t){var n;return e.nodeName!==t.toUpperCase()&&(n=B(t),su(b(e),(function(t){y(n,t.nodeName,h(e,t.nodeName));})),M(n,e,!0)),n||e},findCommonAncestor:function(e,t){for(var n,r=e;r;){for(n=t;n&&r!==n;)n=n.parentNode;if(r===n)break;r=r.parentNode;}return !r&&e.ownerDocument?e.ownerDocument.documentElement:r},toHex:function(e){return s.toHex(_t.trim(e))},run:R,getAttribs:b,isEmpty:function(e,t){var n,r,o=0;if(F(e))return !1;if(e=e.firstChild){var i=new ao(e,e.parentNode),a=c?c.getWhiteSpaceElements():{};t=t||(c?c.getNonEmptyElements():null);do{if(n=e.nodeType,Dn(e)){var u=e.getAttribute("data-mce-bogus");if(u){e=i.next("all"===u);continue}if(r=e.nodeName.toLowerCase(),t&&t[r]){if("br"===r){o++,e=i.next();continue}return !1}if(F(e))return !1}if(8===n)return !1;if(3===n&&!Xo(e.nodeValue))return !1;if(3===n&&e.parentNode&&a[e.parentNode.nodeName]&&Xo(e.nodeValue))return !1;e=i.next();}while(e)}return o<=1},createRng:U,nodeIndex:gu,split:function(e,t,n){var r,o,i,a=U();if(e&&t)return a.setStart(e.parentNode,gu(e)),a.setEnd(t.parentNode,gu(t)),r=a.extractContents(),(a=U()).setStart(t.parentNode,gu(t)+1),a.setEnd(e.parentNode,gu(e)+1),o=a.extractContents(),(i=e.parentNode).insertBefore(oi(V,r),e),n?i.insertBefore(n,e):i.insertBefore(t,e),i.insertBefore(oi(V,o),e),L(e),n||t},bind:z,unbind:H,fire:function(e,t,n){return f.fire(e,t,n)},getContentEditable:j,getContentEditableParent:function(e){for(var t=C(),n=null;e&&e!==t&&null===(n=j(e));e=e.parentNode);return n},destroy:function(){if(u.length>0)for(var e=u.length;e--;){var t=u[e];f.unbind(t[0],t[1],t[2]);}le(o,(function(e,t){a.unload(t),delete o[t];})),wa.setDocument&&wa.setDocument();},isChildOf:function(e,t){if(lu){for(;e;){if(t===e)return !0;e=e.parentNode;}return !1}return e===t||t.contains(e)},dumpRng:function(e){return "startContainer: "+e.startContainer.nodeName+", startOffset: "+e.startOffset+", endContainer: "+e.endContainer.nodeName+", endOffset: "+e.endOffset}},$=function(e,t,n){var r=t.keep_values,o={set:function(e,r,o){t.url_converter&&null!==r&&(r=t.url_converter.call(t.url_converter_scope||n(),r,o,e[0])),e.attr("data-mce-"+o,r).attr(o,r);},get:function(e,t){return e.attr("data-mce-"+t)||e.attr(t)}},i={style:{set:function(t,n){null===n||"object"!=typeof n?(r&&t.attr("data-mce-style",n),null!==n&&"string"==typeof n?(t.removeAttr("style"),t.css(e.parse(n))):t.attr("style",n)):t.css(n);},get:function(t){var n=t.attr("data-mce-style")||t.attr("style");return e.serialize(e.parse(n),t[0].nodeName)}}};return r&&(i.href=i.src=o),i}(s,t,k(V));return V};pu.DOM=pu(document),pu.nodeIndex=gu;var hu=pu.DOM,vu=_t.each,bu=_t.grep,yu=function(){function e(e){void 0===e&&(e={}),this.states={},this.queue=[],this.scriptLoadedCallbacks={},this.queueLoadedCallbacks=[],this.loading=0,this.settings=e;}return e.prototype._setReferrerPolicy=function(e){this.settings.referrerPolicy=e;},e.prototype.loadScript=function(e,t,n){var r,o=hu,i=function(){o.remove(a),r&&(r.onerror=r.onload=r=null);},a=o.uniqueId();(r=document.createElement("script")).id=a,r.type="text/javascript",r.src=_t._addCacheSuffix(e),this.settings.referrerPolicy&&o.setAttrib(r,"referrerpolicy",this.settings.referrerPolicy),r.onload=function(){i(),t();},r.onerror=function(){i(),y(n)?n():"undefined"!=typeof console&&console.log&&console.log("Failed to load script: "+e);},(document.getElementsByTagName("head")[0]||document.body).appendChild(r);},e.prototype.isDone=function(e){return 2===this.states[e]},e.prototype.markDone=function(e){this.states[e]=2;},e.prototype.add=function(e,t,n,r){var o=this.states[e];this.queue.push(e),void 0===o&&(this.states[e]=0),t&&(this.scriptLoadedCallbacks[e]||(this.scriptLoadedCallbacks[e]=[]),this.scriptLoadedCallbacks[e].push({success:t,failure:r,scope:n||this}));},e.prototype.load=function(e,t,n,r){return this.add(e,t,n,r)},e.prototype.remove=function(e){delete this.states[e],delete this.scriptLoadedCallbacks[e];},e.prototype.loadQueue=function(e,t,n){this.loadScripts(this.queue,e,t,n);},e.prototype.loadScripts=function(e,t,n,r){var o=this,i=[],a=function(e,t){vu(o.scriptLoadedCallbacks[t],(function(t){y(t[e])&&t[e].call(t.scope);})),o.scriptLoadedCallbacks[t]=void 0;};o.queueLoadedCallbacks.push({success:t,failure:r,scope:n||this});var u=function(){var t=bu(e);if(e.length=0,vu(t,(function(e){2!==o.states[e]?3!==o.states[e]?1!==o.states[e]&&(o.states[e]=1,o.loading++,o.loadScript(e,(function(){o.states[e]=2,o.loading--,a("success",e),u();}),(function(){o.states[e]=3,o.loading--,i.push(e),a("failure",e),u();}))):a("failure",e):a("success",e);})),!o.loading){var n=o.queueLoadedCallbacks.slice(0);o.queueLoadedCallbacks.length=0,vu(n,(function(e){0===i.length?y(e.success)&&e.success.call(e.scope):y(e.failure)&&e.failure.call(e.scope,i);}));}};u();},e.ScriptLoader=new e,e}(),Cu=function(e){var t=e;return {get:function(){return t},set:function(e){t=e;}}},xu={},wu=Cu("en"),Su=function(){return be(xu,wu.get())},ku={getData:function(){return de(xu,(function(e){return Re({},e)}))},setCode:function(e){e&&wu.set(e);},getCode:function(){return wu.get()},add:function(e,t){var n=xu[e];n||(xu[e]=n={}),le(t,(function(e,t){n[t.toLowerCase()]=e;}));},translate:function(e){var t,n=Su().getOr({}),r=function(e){return y(e)?Object.prototype.toString.call(e):o(e)?"":""+e},o=function(e){return ""===e||null==e},i=function(e){var t=r(e);return be(n,t.toLowerCase()).map(r).getOr(t)},a=function(e){return e.replace(/{context:\w+}$/,"")};if(o(e))return "";if(d(t=e)&&ye(t,"raw"))return r(e.raw);if(function(e){return m(e)&&e.length>1}(e)){var u=e.slice(1);return a(i(e[0]).replace(/\{([0-9]+)\}/g,(function(e,t){return ye(u,t)?r(u[t]):e})))}return a(i(e))},isRtl:function(){return Su().bind((function(e){return be(e,"_dir")})).exists((function(e){return "rtl"===e}))},hasCode:function(e){return ye(xu,e)}},Nu=function(){var e=[],t={},n={},r=[],o=function(e,t){var n=K(r,(function(n){return n.name===e&&n.state===t}));q(n,(function(e){return e.callback()}));},i=function(e){var t;return n[e]&&(t=n[e].dependencies),t||[]},a=function(e,t){return "object"==typeof t?t:"string"==typeof e?{prefix:"",resource:t,suffix:""}:{prefix:e.prefix,resource:t,suffix:e.suffix}},u=function(e,r,c,s,f){if(!t[e]){var l="string"==typeof r?r:r.prefix+r.resource+r.suffix;0!==l.indexOf("/")&&-1===l.indexOf("://")&&(l=Nu.baseURL+"/"+l),t[e]=l.substring(0,l.lastIndexOf("/"));var d=function(){o(e,"loaded"),function(e,t,n,r){var o=i(e);q(o,(function(e){var n=a(t,e);u(n.resource,n,void 0,void 0);})),n&&(r?n.call(r):n.call(yu));}(e,r,c,s);};n[e]?d():yu.ScriptLoader.add(l,d,s,f);}},c=function(e,o,i){void 0===i&&(i="added"),ye(n,e)&&"added"===i||ye(t,e)&&"loaded"===i?o():r.push({name:e,state:i,callback:o});};return {items:e,urls:t,lookup:n,_listeners:r,get:function(e){if(n[e])return n[e].instance},dependencies:i,requireLangPack:function(e,n){!1!==Nu.languageLoad&&c(e,(function(){var r=ku.getCode();!r||n&&-1===(","+(n||"")+",").indexOf(","+r+",")||yu.ScriptLoader.add(t[e]+"/langs/"+r+".js");}),"loaded");},add:function(t,r,i){var a=r;return e.push(a),n[t]={instance:a,dependencies:i},o(t,"added"),a},remove:function(e){delete t[e],delete n[e];},createUrl:a,addComponents:function(e,n){var r=t[e];q(n,(function(e){yu.ScriptLoader.add(r+"/"+e);}));},load:u,waitFor:c}};Nu.languageLoad=!0,Nu.baseURL="",Nu.PluginManager=Nu(),Nu.ThemeManager=Nu();var Eu=function(){var e=function(e){var t=Cu(I.none()),n=function(){return t.get().each(e)};return {clear:function(){n(),t.set(I.none());},isSet:function(){return t.get().isSome()},get:function(){return t.get()},set:function(e){n(),t.set(I.some(e));}}}(x);return Re(Re({},e),{on:function(t){return e.get().each(t)}})},_u=function(e,t){var n=null;return {cancel:function(){g(n)||(clearTimeout(n),n=null);},throttle:function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];g(n)&&(n=setTimeout((function(){n=null,e.apply(null,r);}),t));}}},Au=function(e,t){var n=null,r=function(){g(n)||(clearTimeout(n),n=null);};return {cancel:r,throttle:function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];r(),n=setTimeout((function(){n=null,e.apply(null,o);}),t);}}},Ru=function(e,t){var n=er(e,t);return void 0===n||""===n?[]:n.split(" ")},Du=function(e){return void 0!==e.dom.classList},Tu=function(e,t){return function(e,t,n){var r=Ru(e,t).concat([n]);return Qn(e,t,r.join(" ")),!0}(e,"class",t)},Ou=function(e,t){return function(e,t,n){var r=K(Ru(e,t),(function(e){return e!==n}));return r.length>0?Qn(e,t,r.join(" ")):nr(e,t),!1}(e,"class",t)},Bu=function(e,t){Du(e)?e.dom.classList.add(t):Tu(e,t);},Pu=function(e){var t=Du(e)?e.dom.classList:function(e){return Ru(e,"class")}(e);0===t.length&&nr(e,"class");},Lu=function(e,t){return Du(e)&&e.dom.classList.contains(t)},Iu=function(e,t){var n=[];return q(Jt(e),(function(e){t(e)&&(n=n.concat([e])),n=n.concat(Iu(e,t));})),n},Mu=function(e,t){return function(e,t){var n=void 0===t?document:t.dom;return Ot(n)?[]:V(n.querySelectorAll(e),Rt.fromDom)}(t,e)},Fu=k("mce-annotation"),Uu=k("data-mce-annotation"),zu=k("data-mce-annotation-uid"),Hu=function(e,t){var n=e.selection.getRng(),r=Rt.fromDom(n.startContainer),o=Rt.fromDom(e.getBody()),i=t.fold((function(){return "."+Fu()}),(function(e){return "["+Uu()+'="'+e+'"]'})),a=Qt(r,n.startOffset).getOr(r),u=Qr(a,i,(function(e){return Bt(e,o)})),c=function(e,t){return function(e,t){var n=e.dom;return !(!n||!n.hasAttribute)&&n.hasAttribute(t)}(e,t)?I.some(er(e,t)):I.none()};return u.bind((function(t){return c(t,""+zu()).bind((function(n){return c(t,""+Uu()).map((function(t){var r=ju(e,n);return {uid:n,name:t,elements:r}}))}))}))},ju=function(e,t){var n=Rt.fromDom(e.getBody());return Mu(n,"["+zu()+'="'+t+'"]')},Vu=function(e,t){var n=Cu({}),r=function(){return {listeners:[],previous:Eu()}},o=function(e,t){i(e,(function(e){return t(e),e}));},i=function(e,t){var o=n.get(),i=t(be(o,e).getOrThunk(r));o[e]=i,n.set(o);},a=Au((function(){var t=n.get(),r=re(se(t));q(r,(function(t){i(t,(function(n){var r=n.previous.get();return Hu(e,I.some(t)).fold((function(){r.isSome()&&(!function(e){o(e,(function(t){q(t.listeners,(function(t){return t(!1,e)}));}));}(t),n.previous.clear());}),(function(e){var t=e.uid,i=e.name,a=e.elements;Xn(r,t)||(!function(e,t,n){o(e,(function(r){q(r.listeners,(function(r){return r(!0,e,{uid:t,nodes:V(n,(function(e){return e.dom}))})}));}));}(i,t,a),n.previous.set(t));})),{previous:n.previous,listeners:n.listeners}}));}));}),30);e.on("remove",(function(){a.cancel();})),e.on("NodeChange",(function(){a.throttle();}));return {addListener:function(e,t){i(e,(function(e){return {previous:e.previous,listeners:e.listeners.concat([t])}}));}}},qu=function(e,t){e.on("init",(function(){e.serializer.addNodeFilter("span",(function(e){q(e,(function(e){(function(e){return I.from(e.attr(Uu())).bind(t.lookup)})(e).each((function(t){!1===t.persistent&&e.unwrap();}));}));}));}));},$u=0,Wu=function(e){var t=(new Date).getTime();return e+"_"+Math.floor(1e9*Math.random())+ ++$u+String(t)},Ku=function(e,t){var n,r,o=Vt(e).dom,i=Rt.fromDom(o.createDocumentFragment()),a=(n=t,(r=(o||document).createElement("div")).innerHTML=n,Jt(Rt.fromDom(r)));gn(i,a),pn(e),mn(e,i);},Xu=function(e,t){return Rt.fromDom(e.dom.cloneNode(t))},Yu=function(e){return Xu(e,!1)},Gu=function(e){return Xu(e,!0)},Ju=function(e,t,n){void 0===n&&(n=T);var r=new ao(e,t),o=function(e){var t;do{t=r[e]();}while(t&&!Fn(t)&&!n(t));return I.from(t).filter(Fn)};return {current:function(){return I.from(r.current()).filter(Fn)},next:function(){return o("next")},prev:function(){return o("prev")},prev2:function(){return o("prev2")}}},Qu=function(e,t){var n=t||function(t){return e.isBlock(t)||jn(t)||$n(t)},r=function(e,t,n,o){if(Fn(e)){var i=o(e,t,e.data);if(-1!==i)return I.some({container:e,offset:i})}return n().bind((function(e){return r(e.container,e.offset,n,o)}))};return {backwards:function(e,t,o,i){var a=Ju(e,i,n);return r(e,t,(function(){return a.prev().map((function(e){return {container:e,offset:e.length}}))}),o).getOrNull()},forwards:function(e,t,o,i){var a=Ju(e,i,n);return r(e,t,(function(){return a.next().map((function(e){return {container:e,offset:0}}))}),o).getOrNull()}}},Zu=Math.round,ec=function(e){return e?{left:Zu(e.left),top:Zu(e.top),bottom:Zu(e.bottom),right:Zu(e.right),width:Zu(e.width),height:Zu(e.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0}},tc=function(e,t){return e=ec(e),t||(e.left=e.left+e.width),e.right=e.left,e.width=0,e},nc=function(e,t,n){return e>=0&&e<=Math.min(t.height,n.height)/2},rc=function(e,t){var n=Math.min(t.height/2,e.height/2);return e.bottom-n<t.top||!(e.top>t.bottom)&&nc(t.top-e.bottom,e,t)},oc=function(e,t){return e.top>t.bottom||!(e.bottom<t.top)&&nc(t.bottom-e.top,e,t)},ic=function(e,t,n){return t>=e.left&&t<=e.right&&n>=e.top&&n<=e.bottom},ac=function(e){var t=e.startContainer,n=e.startOffset;return t.hasChildNodes()&&e.endOffset===n+1?t.childNodes[n]:null},uc=function(e,t){if(Dn(e)&&e.hasChildNodes()){var n=e.childNodes,r=function(e,t,n){return Math.min(Math.max(e,t),n)}(t,0,n.length-1);return n[r]}return e},cc=new RegExp("[̀-ͯ҃-҇҈-҉֑-ֽֿׁ-ׂׄ-ׇׅؐ-ًؚ-ٰٟۖ-ۜ۟-ۤۧ-۪ۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣣ-ंऺ़ु-ै्॑-ॗॢ-ॣঁ়াু-ৄ্ৗৢ-ৣਁ-ਂ਼ੁ-ੂੇ-ੈੋ-੍ੑੰ-ੱੵઁ-ં઼ુ-ૅે-ૈ્ૢ-ૣଁ଼ାିୁ-ୄ୍ୖୗୢ-ୣஂாீ்ௗఀా-ీె-ైొ-్ౕ-ౖౢ-ౣಁ಼ಿೂೆೌ-್ೕ-ೖೢ-ೣഁാു-ൄ്ൗൢ-ൣ්ාි-ුූෟัิ-ฺ็-๎ັິ-ູົ-ຼ່-ໍ༘-ཱ༹༙༵༷-ཾྀ-྄྆-྇ྍ-ྗྙ-ྼ࿆ိ-ူဲ-့္-်ွ-ှၘ-ၙၞ-ၠၱ-ၴႂႅ-ႆႍႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒ-ᝓᝲ-ᝳ឴-឵ិ-ួំ៉-៓៝᠋-᠍ᢩᤠ-ᤢᤧ-ᤨᤲ᤹-᤻ᨗ-ᨘᨛᩖᩘ-ᩞ᩠ᩢᩥ-ᩬᩳ-᩿᩼᪰-᪽᪾ᬀ-ᬃ᬴ᬶ-ᬺᬼᭂ᭫-᭳ᮀ-ᮁᮢ-ᮥᮨ-ᮩ᮫-ᮭ᯦ᯨ-ᯩᯭᯯ-ᯱᰬ-ᰳᰶ-᰷᳐-᳔᳒-᳢᳠-᳨᳭᳴᳸-᳹᷀-᷵᷼-᷿‌-‍⃐-⃜⃝-⃠⃡⃢-⃤⃥-⃰⳯-⵿⳱ⷠ-〪ⷿ-〭〮-゙〯-゚꙯꙰-꙲ꙴ-꙽ꚞ-ꚟ꛰-꛱ꠂ꠆ꠋꠥ-ꠦ꣄꣠-꣱ꤦ-꤭ꥇ-ꥑꦀ-ꦂ꦳ꦶ-ꦹꦼꧥꨩ-ꨮꨱ-ꨲꨵ-ꨶꩃꩌꩼꪰꪲ-ꪴꪷ-ꪸꪾ-꪿꫁ꫬ-ꫭ꫶ꯥꯨ꯭ﬞ︀-️︠-゙︯-゚]"),sc=function(e){return "string"==typeof e&&e.charCodeAt(0)>=768&&cc.test(e)},fc=Dn,lc=qo,dc=On("display","block table"),mc=On("float","left right"),gc=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){for(var n=0;n<e.length;n++)if(!e[n](t))return !1;return !0}}(fc,lc,A(mc)),pc=A(On("white-space","pre pre-line pre-wrap")),hc=Fn,vc=jn,bc=pu.nodeIndex,yc=function(e,t){return t<0&&Dn(e)&&e.hasChildNodes()?void 0:uc(e,t)},Cc=function(e){return "createRange"in e?e.createRange():pu.DOM.createRng()},xc=function(e){return e&&/[\r\n\t ]/.test(e)},wc=function(e){return !!e.setStart&&!!e.setEnd},Sc=function(e){var t=e.startContainer,n=e.startOffset;if(xc(e.toString())&&pc(t.parentNode)&&Fn(t)){var r=t.data;if(xc(r[n-1])||xc(r[n+1]))return !0}return !1},kc=function(e){return 0===e.left&&0===e.right&&0===e.top&&0===e.bottom},Nc=function(e){var t,n=e.getClientRects();return t=n.length>0?ec(n[0]):ec(e.getBoundingClientRect()),!wc(e)&&vc(e)&&kc(t)?function(e){var t=e.ownerDocument,n=Cc(t),r=t.createTextNode(yo),o=e.parentNode;o.insertBefore(r,e),n.setStart(r,0),n.setEnd(r,1);var i=ec(n.getBoundingClientRect());return o.removeChild(r),i}(e):kc(t)&&wc(e)?function(e){var t=e.startContainer,n=e.endContainer,r=e.startOffset,o=e.endOffset;if(t===n&&Fn(n)&&0===r&&1===o){var i=e.cloneRange();return i.setEndAfter(n),Nc(i)}return null}(e):t},Ec=function(e,t){var n=tc(e,t);return n.width=1,n.right=n.left+1,n},_c=function(e){var t=[],n=function(e){var n,r;0!==e.height&&(t.length>0&&(n=e,r=t[t.length-1],n.left===r.left&&n.top===r.top&&n.bottom===r.bottom&&n.right===r.right)||t.push(e));},r=function(e,r){var o=Cc(e.ownerDocument);if(r<e.data.length){if(sc(e.data[r]))return t;if(sc(e.data[r-1])&&(o.setStart(e,r),o.setEnd(e,r+1),!Sc(o)))return n(Ec(Nc(o),!1)),t}r>0&&(o.setStart(e,r-1),o.setEnd(e,r),Sc(o)||n(Ec(Nc(o),!1))),r<e.data.length&&(o.setStart(e,r),o.setEnd(e,r+1),Sc(o)||n(Ec(Nc(o),!0)));},o=e.container(),i=e.offset();if(hc(o))return r(o,i),t;if(fc(o))if(e.isAtEnd()){var a=yc(o,i);hc(a)&&r(a,a.data.length),gc(a)&&!vc(a)&&n(Ec(Nc(a),!1));}else {a=yc(o,i);if(hc(a)&&r(a,0),gc(a)&&e.isAtEnd())return n(Ec(Nc(a),!1)),t;var u=yc(e.container(),e.offset()-1);gc(u)&&!vc(u)&&(dc(u)||dc(a)||!gc(a))&&n(Ec(Nc(u),!1)),gc(a)&&n(Ec(Nc(a),!0));}return t},Ac=function(e,t,n){var r=function(){return n||(n=_c(Ac(e,t))),n};return {container:k(e),offset:k(t),toRange:function(){var n=Cc(e.ownerDocument);return n.setStart(e,t),n.setEnd(e,t),n},getClientRects:r,isVisible:function(){return r().length>0},isAtStart:function(){return hc(e),0===t},isAtEnd:function(){return hc(e)?t>=e.data.length:t>=e.childNodes.length},isEqual:function(n){return n&&e===n.container()&&t===n.offset()},getNode:function(n){return yc(e,n?t-1:t)}}};Ac.fromRangeStart=function(e){return Ac(e.startContainer,e.startOffset)},Ac.fromRangeEnd=function(e){return Ac(e.endContainer,e.endOffset)},Ac.after=function(e){return Ac(e.parentNode,bc(e)+1)},Ac.before=function(e){return Ac(e.parentNode,bc(e))},Ac.isAbove=function(e,t){return Yn(ie(t.getClientRects()),ae(e.getClientRects()),rc).getOr(!1)},Ac.isBelow=function(e,t){return Yn(ae(t.getClientRects()),ie(e.getClientRects()),oc).getOr(!1)},Ac.isAtStart=function(e){return !!e&&e.isAtStart()},Ac.isAtEnd=function(e){return !!e&&e.isAtEnd()},Ac.isTextPosition=function(e){return !!e&&Fn(e.container())},Ac.isElementPosition=function(e){return !1===Ac.isTextPosition(e)};var Rc,Dc=function(e,t){Fn(t)&&0===t.data.length&&e.remove(t);},Tc=function(e,t,n){Hn(n)?function(e,t,n){var r=I.from(n.firstChild),o=I.from(n.lastChild);t.insertNode(n),r.each((function(t){return Dc(e,t.previousSibling)})),o.each((function(t){return Dc(e,t.nextSibling)}));}(e,t,n):function(e,t,n){t.insertNode(n),Dc(e,n.previousSibling),Dc(e,n.nextSibling);}(e,t,n);},Oc=Fn,Bc=Pn,Pc=pu.nodeIndex,Lc=function(e){var t=e.parentNode;return Bc(t)?Lc(t):t},Ic=function(e){return e?Ee(e.childNodes,(function(e,t){return Bc(t)&&"BR"!==t.nodeName?e=e.concat(Ic(t)):e.push(t),e}),[]):[]},Mc=function(e){return function(t){return e===t}},Fc=function(e){return (Oc(e)?"text()":e.nodeName.toLowerCase())+"["+function(e){var t,n;t=Ic(Lc(e)),n=_e(t,Mc(e),e),t=t.slice(0,n+1);var r=Ee(t,(function(e,n,r){return Oc(n)&&Oc(t[r-1])&&e++,e}),0);return t=ke(t,Tn([e.nodeName])),(n=_e(t,Mc(e),e))-r}(e)+"]"},Uc=function(e,t){var n,r,o,i,a,u=[];return n=t.container(),r=t.offset(),Oc(n)?o=function(e,t){for(;(e=e.previousSibling)&&Oc(e);)t+=e.data.length;return t}(n,r):(r>=(i=n.childNodes).length?(o="after",r=i.length-1):o="before",n=i[r]),u.push(Fc(n)),a=function(e,t,n){var r=[];for(t=t.parentNode;!(t===e||n&&n(t));t=t.parentNode)r.push(t);return r}(e,n),a=ke(a,A(Pn)),(u=u.concat(Se(a,(function(e){return Fc(e)})))).reverse().join("/")+","+o},zc=function(e,t){var n;if(!t)return null;var r=t.split(","),o=r[0].split("/");n=r.length>1?r[1]:"before";var i=Ee(o,(function(e,t){var n=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(t);return n?("text()"===n[1]&&(n[1]="#text"),function(e,t,n){var r=Ic(e);return r=ke(r,(function(e,t){return !Oc(e)||!Oc(r[t-1])})),(r=ke(r,Tn([t])))[n]}(e,n[1],parseInt(n[2],10))):null}),e);return i?Oc(i)?function(e,t){for(var n,r=e,o=0;Oc(r);){if(n=r.data.length,t>=o&&t<=o+n){e=r,t-=o;break}if(!Oc(r.nextSibling)){e=r,t=n;break}o+=n,r=r.nextSibling;}return Oc(e)&&t>e.data.length&&(t=e.data.length),Ac(e,t)}(i,parseInt(n,10)):(n="after"===n?Pc(i)+1:Pc(i),Ac(i.parentNode,n)):null},Hc=$n,jc=function(e,t,n,r,o){var i,a=r[o?"startContainer":"endContainer"],u=r[o?"startOffset":"endOffset"],c=[],s=0,f=e.getRoot();for(Fn(a)?c.push(n?function(e,t,n){var r,o;for(o=e(t.data.slice(0,n)).length,r=t.previousSibling;r&&Fn(r);r=r.previousSibling)o+=e(r.data).length;return o}(t,a,u):u):(u>=(i=a.childNodes).length&&i.length&&(s=1,u=Math.max(0,i.length-1)),c.push(e.nodeIndex(i[u],n)+s));a&&a!==f;a=a.parentNode)c.push(e.nodeIndex(a,n));return c},Vc=function(e,t,n){var r=0;return _t.each(e.select(t),(function(e){if("all"!==e.getAttribute("data-mce-bogus"))return e!==n&&void r++})),r},qc=function(e,t){var n,r,o,i=t?"start":"end";n=e[i+"Container"],r=e[i+"Offset"],Dn(n)&&"TR"===n.nodeName&&(n=(o=n.childNodes)[Math.min(t?r:r-1,o.length-1)])&&(r=t?0:n.childNodes.length,e["set"+(t?"Start":"End")](n,r));},$c=function(e){return qc(e,!0),qc(e,!1),e},Wc=function(e,t){var n;if(Dn(e)&&(e=uc(e,t),Hc(e)))return e;if(_o(e)){if(Fn(e)&&No(e)&&(e=e.parentNode),n=e.previousSibling,Hc(n))return n;if(n=e.nextSibling,Hc(n))return n}},Kc=function(e,t,n){var r=n.getNode(),o=r?r.nodeName:null,i=n.getRng();if(Hc(r)||"IMG"===o)return {name:o,index:Vc(n.dom,o,r)};var a=function(e){return Wc(e.startContainer,e.startOffset)||Wc(e.endContainer,e.endOffset)}(i);return a?{name:o=a.tagName,index:Vc(n.dom,o,a)}:function(e,t,n,r){var o=t.dom,i={};return i.start=jc(o,e,n,r,!0),t.isCollapsed()||(i.end=jc(o,e,n,r,!1)),Lo(r)&&(i.isFakeCaret=!0),i}(e,n,t,i)},Xc=function(e,t,n){var r={"data-mce-type":"bookmark",id:t,style:"overflow:hidden;line-height:0px"};return n?e.create("span",r,"&#xFEFF;"):e.create("span",r)},Yc=function(e,t){var n=e.dom,r=e.getRng(),o=n.uniqueId(),i=e.isCollapsed(),a=e.getNode(),u=a.nodeName;if("IMG"===u)return {name:u,index:Vc(n,u,a)};var c=$c(r.cloneRange());if(!i){c.collapse(!1);var s=Xc(n,o+"_end",t);Tc(n,c,s);}(r=$c(r)).collapse(!0);var f=Xc(n,o+"_start",t);return Tc(n,r,f),e.moveToBookmark({id:o,keep:!0}),{id:o}},Gc=function(e,t,n){return 2===t?Kc(wo,n,e):3===t?function(e){var t=e.getRng();return {start:Uc(e.dom.getRoot(),Ac.fromRangeStart(t)),end:Uc(e.dom.getRoot(),Ac.fromRangeEnd(t))}}(e):t?function(e){return {rng:e.getRng()}}(e):Yc(e,!1)},Jc=_(Kc,N,!0),Qc=pu.DOM,Zc=function(e,t,n){var r=e.getParam(t,n);if(-1!==r.indexOf("=")){var o=e.getParam(t,"","hash");return be(o,e.id).getOr(n)}return r},es=function(e){return e.getParam("content_security_policy","")},ts=function(e){if(e.getParam("force_p_newlines",!1))return "p";var t=e.getParam("forced_root_block","p");return !1===t?"":!0===t?"p":t},ns=function(e){return e.getParam("forced_root_block_attrs",{})},rs=function(e){return e.getParam("automatic_uploads",!0,"boolean")},os=function(e){return e.getParam("images_reuse_filename",!1,"boolean")},is=function(e){return e.getParam("icons","","string")},as=function(e){return e.getParam("images_upload_url","","string")},us=function(e){return e.getParam("images_upload_base_path","","string")},cs=function(e){return e.getParam("images_upload_credentials",!1,"boolean")},ss=function(e){return e.getParam("images_upload_handler",null,"function")},fs=function(e){return e.getParam("content_css_cors",!1,"boolean")},ls=function(e){return e.getParam("referrer_policy","","string")},ds=function(e){return e.getParam("language","en","string")},ms=function(e){return e.getParam("indent_use_margin",!1)},gs=function(e){var t=e.getParam("font_css",[]);return m(t)?t:V(t.split(","),Ue)},ps=function(e){var t=e.getParam("object_resizing");return !1!==t&&!wt.iOS&&(l(t)?t:"table,img,figure.image,div,video,iframe")},hs=function(e){return e.getParam("event_root")},vs=function(e){return e.getParam("theme")},bs=function(e){return e.getParam("validate")},ys=function(e){return !1!==e.getParam("inline_boundaries")},Cs=function(e){return e.getParam("content_css_cors")},xs=function(e){return e.getParam("plugins","","string")},ws=Dn,Ss=Fn,ks=function(e){var t=e.parentNode;t&&t.removeChild(e);},Ns=function(e){var t=wo(e);return {count:e.length-t.length,text:t}},Es=function(e){for(var t;-1!==(t=e.data.lastIndexOf(Co));)e.deleteData(t,1);},_s=function(e,t){return Ts(e),t},As=function(e,t){var n=t.container(),r=function(e,t){var n=z(e,t);return -1===n?I.none():I.some(n)}(ue(n.childNodes),e).map((function(e){return e<t.offset()?Ac(n,t.offset()-1):t})).getOr(t);return Ts(e),r},Rs=function(e,t){return Ss(e)&&t.container()===e?function(e,t){var n=Ns(e.data.substr(0,t.offset())),r=Ns(e.data.substr(t.offset()));return (n.text+r.text).length>0?(Es(e),Ac(e,t.offset()-n.count)):t}(e,t):_s(e,t)},Ds=function(e,t){return Ac.isTextPosition(t)?Rs(e,t):function(e,t){return t.container()===e.parentNode?As(e,t):_s(e,t)}(e,t)},Ts=function(e){ws(e)&&_o(e)&&(Ao(e)?e.removeAttribute("data-mce-caret"):ks(e)),Ss(e)&&(Es(e),0===e.data.length&&ks(e));},Os=mt().browser,Bs=$n,Ps=Kn,Ls=Wn,Is=function(e,t,n){var r,o,i=tc(t.getBoundingClientRect(),n);if("BODY"===e.tagName){var a=e.ownerDocument.documentElement;r=e.scrollLeft||a.scrollLeft,o=e.scrollTop||a.scrollTop;}else {var u=e.getBoundingClientRect();r=e.scrollLeft-u.left,o=e.scrollTop-u.top;}i.left+=r,i.right+=r,i.top+=o,i.bottom+=o,i.width=1;var c=t.offsetWidth-t.clientWidth;return c>0&&(n&&(c*=-1),i.left+=c,i.right+=c),i},Ms=function(e,t,n,r){var o,i,a=Eu(),u=ts(e),c=u.length>0?u:"p",s=function(){!function(e){for(var t=Mu(Rt.fromDom(e),"*[contentEditable=false],video,audio,embed,object"),n=0;n<t.length;n++){var r,o=t[n].dom,i=o.previousSibling;Bo(i)&&(1===(r=i.data).length?i.parentNode.removeChild(i):i.deleteData(r.length-1,1)),i=o.nextSibling,Oo(i)&&(1===(r=i.data).length?i.parentNode.removeChild(i):i.deleteData(0,1));}}(t),i&&(Ts(i),i=null),a.on((function(e){cu(e.caret).remove(),a.clear();})),o&&(ro.clearInterval(o),o=void 0);},f=function(){o=ro.setInterval((function(){r()?cu("div.mce-visual-caret",t).toggleClass("mce-visual-caret-hidden"):cu("div.mce-visual-caret",t).addClass("mce-visual-caret-hidden");}),500);};return {show:function(e,r){var o;if(s(),Ls(r))return null;if(!n(r))return i=function(e,t){var n=e.ownerDocument.createTextNode(Co),r=e.parentNode;if(t){if(o=e.previousSibling,ko(o)){if(_o(o))return o;if(Bo(o))return o.splitText(o.data.length-1)}r.insertBefore(n,e);}else {var o=e.nextSibling;if(ko(o)){if(_o(o))return o;if(Oo(o))return o.splitText(1),o}e.nextSibling?r.insertBefore(n,e.nextSibling):r.appendChild(n);}return n}(r,e),o=r.ownerDocument.createRange(),Us(i.nextSibling)?(o.setStart(i,0),o.setEnd(i,0)):(o.setStart(i,1),o.setEnd(i,1)),o;i=To(c,r,e);var u=Is(t,r,e);cu(i).css("top",u.top);var l=cu('<div class="mce-visual-caret" data-mce-bogus="all"></div>').css(Re({},u)).appendTo(t)[0];return a.set({caret:l,element:r,before:e}),e&&cu(l).addClass("mce-visual-caret-before"),f(),(o=r.ownerDocument.createRange()).setStart(i,0),o.setEnd(i,0),o},hide:s,getCss:function(){return ".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}"},reposition:function(){a.on((function(e){var n=Is(t,e.element,e.before);cu(e.caret).css(Re({},n));}));},destroy:function(){return ro.clearInterval(o)}}},Fs=function(){return Os.isIE()||Os.isEdge()||Os.isFirefox()},Us=function(e){return Bs(e)||Ps(e)},zs=function(e){return Us(e)||Ln(e)&&Fs()},Hs=$n,js=Kn,Vs=On("display","block table table-cell table-caption list-item"),qs=_o,$s=No,Ws=Dn,Ks=qo,Xs=function(e){return e>0},Ys=function(e){return e<0},Gs=function(e,t){for(var n;n=e(t);)if(!$s(n))return n;return null},Js=function(e,t,n,r,o){var i=new ao(e,r),a=Hs(e)||$s(e);if(Ys(t)){if(a&&n(e=Gs(i.prev.bind(i),!0)))return e;for(;e=Gs(i.prev.bind(i),o);)if(n(e))return e}if(Xs(t)){if(a&&n(e=Gs(i.next.bind(i),!0)))return e;for(;e=Gs(i.next.bind(i),o);)if(n(e))return e}return null},Qs=function(e,t){for(;e&&e!==t;){if(Vs(e))return e;e=e.parentNode;}return null},Zs=function(e,t,n){return Qs(e.container(),n)===Qs(t.container(),n)},ef=function(e,t){if(!t)return null;var n=t.container(),r=t.offset();return Ws(n)?n.childNodes[r+e]:null},tf=function(e,t){var n=t.ownerDocument.createRange();return e?(n.setStartBefore(t),n.setEndBefore(t)):(n.setStartAfter(t),n.setEndAfter(t)),n},nf=function(e,t,n){return Qs(t,e)===Qs(n,e)},rf=function(e,t,n){for(var r=e?"previousSibling":"nextSibling";n&&n!==t;){var o=n[r];if(qs(o)&&(o=o[r]),Hs(o)||js(o)){if(nf(t,o,n))return o;break}if(Ks(o))break;n=n.parentNode;}return null},of=_(tf,!0),af=_(tf,!1),uf=function(e,t,n){var r,o=_(rf,!0,t),i=_(rf,!1,t),a=n.startContainer,u=n.startOffset;if(No(a)){Ws(a)||(a=a.parentNode);var c=a.getAttribute("data-mce-caret");if("before"===c&&(r=a.nextSibling,zs(r)))return of(r);if("after"===c&&(r=a.previousSibling,zs(r)))return af(r)}if(!n.collapsed)return n;if(Fn(a)){if(qs(a)){if(1===e){if(r=i(a))return of(r);if(r=o(a))return af(r)}if(-1===e){if(r=o(a))return af(r);if(r=i(a))return of(r)}return n}if(Bo(a)&&u>=a.data.length-1)return 1===e&&(r=i(a))?of(r):n;if(Oo(a)&&u<=1)return -1===e&&(r=o(a))?af(r):n;if(u===a.data.length)return (r=i(a))?of(r):n;if(0===u)return (r=o(a))?af(r):n}return n},cf=function(e,t){return I.from(ef(e?0:-1,t)).filter(Hs)},sf=function(e,t,n){var r=uf(e,t,n);return -1===e?Ac.fromRangeStart(r):Ac.fromRangeEnd(r)},ff=function(e){return I.from(e.getNode()).map(Rt.fromDom)},lf=function(e,t){for(;t=e(t);)if(t.isVisible())return t;return t},df=function(e,t){var n=Zs(e,t);return !(n||!jn(e.getNode()))||n};!function(e){e[e.Backwards=-1]="Backwards",e[e.Forwards=1]="Forwards";}(Rc||(Rc={}));var mf,gf=$n,pf=Fn,hf=Dn,vf=jn,bf=qo,yf=function(e){return Ho(e)||function(e){return !!$o(e)&&!0!==Y(ue(e.getElementsByTagName("*")),(function(e,t){return e||Io(t)}),!1)}(e)},Cf=Wo,xf=function(e,t){return e.hasChildNodes()&&t<e.childNodes.length?e.childNodes[t]:null},wf=function(e,t){if(Xs(e)){if(bf(t.previousSibling)&&!pf(t.previousSibling))return Ac.before(t);if(pf(t))return Ac(t,0)}if(Ys(e)){if(bf(t.nextSibling)&&!pf(t.nextSibling))return Ac.after(t);if(pf(t))return Ac(t,t.data.length)}return Ys(e)?vf(t)?Ac.before(t):Ac.after(t):Ac.before(t)},Sf=function(e,t,n){var r,o,i,a;if(!hf(n)||!t)return null;if(t.isEqual(Ac.after(n))&&n.lastChild){if(a=Ac.after(n.lastChild),Ys(e)&&bf(n.lastChild)&&hf(n.lastChild))return vf(n.lastChild)?Ac.before(n.lastChild):a}else a=t;var u=a.container(),c=a.offset();if(pf(u)){if(Ys(e)&&c>0)return Ac(u,--c);if(Xs(e)&&c<u.length)return Ac(u,++c);r=u;}else {if(Ys(e)&&c>0&&(o=xf(u,c-1),bf(o)))return !yf(o)&&(i=Js(o,e,Cf,o))?pf(i)?Ac(i,i.data.length):Ac.after(i):pf(o)?Ac(o,o.data.length):Ac.before(o);if(Xs(e)&&c<u.childNodes.length&&(o=xf(u,c),bf(o)))return vf(o)?function(e,t){var n=t.nextSibling;return n&&bf(n)?pf(n)?Ac(n,0):Ac.before(n):Sf(Rc.Forwards,Ac.after(t),e)}(n,o):!yf(o)&&(i=Js(o,e,Cf,o))?pf(i)?Ac(i,0):Ac.before(i):pf(o)?Ac(o,0):Ac.after(o);r=o||a.getNode();}if((Xs(e)&&a.isAtEnd()||Ys(e)&&a.isAtStart())&&(r=Js(r,e,O,n,!0),Cf(r,n)))return wf(e,r);o=Js(r,e,Cf,n);var s=Ae(K(function(e,t){for(var n=[];e&&e!==t;)n.push(e),e=e.parentNode;return n}(u,n),gf));return !s||o&&s.contains(o)?o?wf(e,o):null:a=Xs(e)?Ac.after(s):Ac.before(s)},kf=function(e){return {next:function(t){return Sf(Rc.Forwards,t,e)},prev:function(t){return Sf(Rc.Backwards,t,e)}}},Nf=function(e){return Ac.isTextPosition(e)?0===e.offset():qo(e.getNode())},Ef=function(e){if(Ac.isTextPosition(e)){var t=e.container();return e.offset()===t.data.length}return qo(e.getNode(!0))},_f=function(e,t){return !Ac.isTextPosition(e)&&!Ac.isTextPosition(t)&&e.getNode()===t.getNode(!0)},Af=function(e,t,n){return e?!_f(t,n)&&(r=t,!(!Ac.isTextPosition(r)&&jn(r.getNode())))&&Ef(t)&&Nf(n):!_f(n,t)&&Nf(t)&&Ef(n);var r;},Rf=function(e,t,n){var r=kf(t);return I.from(e?r.next(n):r.prev(n))},Df=function(e,t,n){return Rf(e,t,n).bind((function(r){return Zs(n,r,t)&&Af(e,n,r)?Rf(e,t,r):I.some(r)}))},Tf=function(e,t,n,r){return Df(e,t,n).bind((function(n){return r(n)?Tf(e,t,n,r):I.some(n)}))},Of=function(e,t){var n,r=e?t.firstChild:t.lastChild;return Fn(r)?I.some(Ac(r,e?0:r.data.length)):r?qo(r)?I.some(e?Ac.before(r):jn(n=r)?Ac.before(n):Ac.after(n)):function(e,t,n){var r=e?Ac.before(n):Ac.after(n);return Rf(e,t,r)}(e,t,r):I.none()},Bf=_(Rf,!0),Pf=_(Rf,!1),Lf=_(Of,!0),If=_(Of,!1),Mf="_mce_caret",Ff=function(e){return Dn(e)&&e.id===Mf},Uf=function(e,t){for(;t&&t!==e;){if(t.id===Mf)return t;t=t.parentNode;}return null},zf=function(e){return _t.isArray(e.start)},Hf=function(e,t){return Dn(t)&&e.isBlock(t)&&!t.innerHTML&&!wt.ie&&(t.innerHTML='<br data-mce-bogus="1" />'),t},jf=function(e,t){return If(e).fold(T,(function(e){return t.setStart(e.container(),e.offset()),t.setEnd(e.container(),e.offset()),!0}))},Vf=function(e,t,n){return !(!function(e){return !1===e.hasChildNodes()}(t)||!Uf(e,t))&&(function(e,t){var n=e.ownerDocument.createTextNode(Co);e.appendChild(n),t.setStart(n,0),t.setEnd(n,0);}(t,n),!0)},qf=function(e,t,n,r){var o,i,a,u,c=n[t?"start":"end"],s=e.getRoot();if(c){for(a=c[0],i=s,o=c.length-1;o>=1;o--){if(u=i.childNodes,Vf(s,i,r))return !0;if(c[o]>u.length-1)return !!Vf(s,i,r)||jf(i,r);i=u[c[o]];}3===i.nodeType&&(a=Math.min(c[0],i.nodeValue.length)),1===i.nodeType&&(a=Math.min(c[0],i.childNodes.length)),t?r.setStart(i,a):r.setEnd(i,a);}return !0},$f=function(e){return Fn(e)&&e.data.length>0},Wf=function(e,t,n){var r,o,i,a,u,c,s=e.get(n.id+"_"+t),f=n.keep;if(s){if(r=s.parentNode,"start"===t?(f?s.hasChildNodes()?(r=s.firstChild,o=1):$f(s.nextSibling)?(r=s.nextSibling,o=0):$f(s.previousSibling)?(r=s.previousSibling,o=s.previousSibling.data.length):(r=s.parentNode,o=e.nodeIndex(s)+1):o=e.nodeIndex(s),u=r,c=o):(f?s.hasChildNodes()?(r=s.firstChild,o=1):$f(s.previousSibling)?(r=s.previousSibling,o=s.previousSibling.data.length):(r=s.parentNode,o=e.nodeIndex(s)):o=e.nodeIndex(s),u=r,c=o),!f){for(a=s.previousSibling,i=s.nextSibling,_t.each(_t.grep(s.childNodes),(function(e){Fn(e)&&(e.nodeValue=e.nodeValue.replace(/\uFEFF/g,""));}));s=e.get(n.id+"_"+t);)e.remove(s,!0);a&&i&&a.nodeType===i.nodeType&&Fn(a)&&!wt.opera&&(o=a.nodeValue.length,a.appendData(i.nodeValue),e.remove(i),u=a,c=o);}return I.some(Ac(u,c))}return I.none()},Kf=function(e,t){var n=e.dom;if(t){if(zf(t))return function(e,t){var n=e.createRng();return qf(e,!0,t,n)&&qf(e,!1,t,n)?I.some(n):I.none()}(n,t);if(function(e){return l(e.start)}(t))return I.some(function(e,t){var n,r=e.createRng();return n=zc(e.getRoot(),t.start),r.setStart(n.container(),n.offset()),n=zc(e.getRoot(),t.end),r.setEnd(n.container(),n.offset()),r}(n,t));if(function(e){return ye(e,"id")}(t))return function(e,t){var n=Wf(e,"start",t),r=Wf(e,"end",t);return Yn(n,r.or(n),(function(t,n){var r=e.createRng();return r.setStart(Hf(e,t.container()),t.offset()),r.setEnd(Hf(e,n.container()),n.offset()),r}))}(n,t);if(function(e){return ye(e,"name")}(t))return function(e,t){return I.from(e.select(t.name)[t.index]).map((function(t){var n=e.createRng();return n.selectNode(t),n}))}(n,t);if(function(e){return ye(e,"rng")}(t))return I.some(t.rng)}return I.none()},Xf=function(e,t,n){return Gc(e,t,n)},Yf=function(e,t){Kf(e,t).each((function(t){e.setRng(t);}));},Gf=function(e){return Dn(e)&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type")},Jf=(mf=yo,function(e){return mf===e}),Qf=function(e){return ""!==e&&-1!==" \f\n\r\t\v".indexOf(e)},Zf=function(e){return !Qf(e)&&!Jf(e)},el=function(e){return !!e.nodeType},tl=function(e,t,n){var r=n.startOffset,o=n.startContainer;if((o!==n.endContainer||!function(e){return e&&/^(IMG)$/.test(e.nodeName)}(o.childNodes[r]))&&Dn(o)){var i=o.childNodes,a=void 0;r<i.length?(o=i[r],a=new ao(o,e.getParent(o,e.isBlock))):(o=i[i.length-1],(a=new ao(o,e.getParent(o,e.isBlock))).next(!0));for(var u=a.current();u;u=a.next())if(Fn(u)&&!il(u))return n.setStart(u,0),void t.setRng(n)}},nl=function(e,t,n){if(e){var r=t?"nextSibling":"previousSibling";for(e=n?e:e[r];e;e=e[r])if(Dn(e)||!il(e))return e}},rl=function(e,t){return el(t)&&(t=t.nodeName),!!e.schema.getTextBlockElements()[t.toLowerCase()]},ol=function(e,t,n){return e.schema.isValidChild(t,n)},il=function(e,t){if(void 0===t&&(t=!1),b(e)&&Fn(e)){var n=t?e.data.replace(/ /g," "):e.data;return Xo(n)}return !1},al=function(e,t){return y(e)?e=e(t):b(t)&&(e=e.replace(/%(\w+)/g,(function(e,n){return t[n]||e}))),e},ul=function(e,t){return t=t||"",e=""+((e=e||"").nodeName||e),t=""+(t.nodeName||t),e.toLowerCase()===t.toLowerCase()},cl=function(e,t,n){return "color"!==n&&"backgroundColor"!==n||(t=e.toHex(t)),"fontWeight"===n&&700===t&&(t="bold"),"fontFamily"===n&&(t=t.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),""+t},sl=function(e,t,n){return cl(e,e.getStyle(t,n),n)},fl=function(e,t){var n;return e.getParent(t,(function(t){return (n=e.getStyle(t,"text-decoration"))&&"none"!==n})),n},ll=function(e,t,n){return e.getParents(t,n,e.getRoot())},dl=function(e,t,n){var r=["inline","block","selector","attributes","styles","classes"],o=function(e){return he(e,(function(e,t){return j(r,(function(e){return e===t}))}))};return j(e.formatter.get(t),(function(t){var r=o(t);return j(e.formatter.get(n),(function(e){var t=o(e);return function(e,t,n){return void 0===n&&(n=u),a(n).eq(e,t)}(r,t)}))}))},ml=function(e){return Ce(e,"block")},gl=function(e){return Ce(e,"selector")},pl=function(e){return Ce(e,"inline")},hl=function(e){return gl(e)&&!1!==e.expand&&!pl(e)},vl=Gf,bl=ll,yl=il,Cl=rl,xl=function(e,t){for(var n=t;n;){if(Dn(n)&&e.getContentEditable(n))return "false"===e.getContentEditable(n)?n:t;n=n.parentNode;}return t},wl=function(e,t,n,r){for(var o=t.data,i=n;e?i>=0:i<o.length;e?i--:i++)if(r(o.charAt(i)))return e?i+1:i;return -1},Sl=function(e,t,n){return wl(e,t,n,(function(e){return Jf(e)||Qf(e)}))},kl=function(e,t,n){return wl(e,t,n,Zf)},Nl=function(e,t,n,r,o,i){var a,u=e.getParent(n,e.isBlock)||t,c=function(t,n,r){var i=Qu(e),c=o?i.backwards:i.forwards;return I.from(c(t,n,(function(e,t){return vl(e.parentNode)?-1:(a=e,r(o,e,t))}),u))};return c(n,r,Sl).bind((function(e){return i?c(e.container,e.offset+(o?-1:0),kl):I.some(e)})).orThunk((function(){return a?I.some({container:a,offset:o?0:a.length}):I.none()}))},El=function(e,t,n,r,o){Fn(r)&&Ve(r.data)&&r[o]&&(r=r[o]);for(var i=bl(e,r),a=0;a<i.length;a++)for(var u=0;u<t.length;u++){var c=t[u];if((!b(c.collapsed)||c.collapsed===n.collapsed)&&(gl(c)&&e.is(i[a],c.selector)))return i[a]}return r},_l=function(e,t,n,r){var o=n,i=e.dom,a=i.getRoot(),u=t[0];if(ml(u)&&(o=u.wrapper?null:i.getParent(n,u.block,a)),!o){var c=i.getParent(n,"LI,TD,TH");o=i.getParent(Fn(n)?n.parentNode:n,(function(t){return t!==a&&Cl(e,t)}),c);}if(o&&ml(u)&&u.wrapper&&(o=bl(i,o,"ul,ol").reverse()[0]||o),!o)for(o=n;o[r]&&!i.isBlock(o[r])&&(o=o[r],!ul(o,"br")););return o||n},Al=function(e,t,n,r){var o=n.parentNode;return !b(n[r])&&(!(o!==t&&!v(o)&&!e.isBlock(o))||Al(e,t,o,r))},Rl=function(e,t,n,r,o){var i,a=n,u=o?"previousSibling":"nextSibling",c=e.getRoot();if(Fn(n)&&!yl(n)&&(o?r>0:r<n.data.length))return n;for(;;){if(!t[0].block_expand&&e.isBlock(a))return a;for(var s=a[u];s;s=s[u]){var f=Fn(s)&&!Al(e,c,s,u);if(!vl(s)&&(!jn(i=s)||!i.getAttribute("data-mce-bogus")||i.nextSibling)&&!yl(s,f))return a}if(a===c||a.parentNode===c){n=a;break}a=a.parentNode;}return n},Dl=function(e){return vl(e.parentNode)||vl(e)},Tl=function(e,t,n,r){void 0===r&&(r=!1);var o=t.startContainer,i=t.startOffset,a=t.endContainer,u=t.endOffset,c=e.dom,s=n[0];(Dn(o)&&o.hasChildNodes()&&(o=uc(o,i),Fn(o)&&(i=0)),Dn(a)&&a.hasChildNodes()&&(a=uc(a,t.collapsed?u:u-1),Fn(a)&&(u=a.nodeValue.length)),o=xl(c,o),a=xl(c,a),Dl(o)&&(o=vl(o)?o:o.parentNode,o=t.collapsed?o.previousSibling||o:o.nextSibling||o,Fn(o)&&(i=t.collapsed?o.length:0)),Dl(a)&&(a=vl(a)?a:a.parentNode,a=t.collapsed?a.nextSibling||a:a.previousSibling||a,Fn(a)&&(u=t.collapsed?0:a.length)),t.collapsed)&&(Nl(c,e.getBody(),o,i,!0,r).each((function(e){var t=e.container,n=e.offset;o=t,i=n;})),Nl(c,e.getBody(),a,u,!1,r).each((function(e){var t=e.container,n=e.offset;a=t,u=n;})));return (pl(s)||s.block_expand)&&(pl(s)&&Fn(o)&&0!==i||(o=Rl(c,n,o,i,!0)),pl(s)&&Fn(a)&&u!==a.nodeValue.length||(a=Rl(c,n,a,u,!1))),hl(s)&&(o=El(c,n,t,o,"previousSibling"),a=El(c,n,t,a,"nextSibling")),(ml(s)||gl(s))&&(o=_l(e,n,o,"previousSibling"),a=_l(e,n,a,"nextSibling"),ml(s)&&(c.isBlock(o)||(o=Rl(c,n,o,i,!0)),c.isBlock(a)||(a=Rl(c,n,a,u,!1)))),Dn(o)&&(i=c.nodeIndex(o),o=o.parentNode),Dn(a)&&(u=c.nodeIndex(a)+1,a=a.parentNode),{startContainer:o,startOffset:i,endContainer:a,endOffset:u}},Ol=function(e,t,n){var r=t.startOffset,o=uc(t.startContainer,r),i=t.endOffset,a=uc(t.endContainer,i-1),u=function(e){var t=e[0];Fn(t)&&t===o&&r>=t.data.length&&e.splice(0,1);var n=e[e.length-1];return 0===i&&e.length>0&&n===a&&Fn(n)&&e.splice(e.length-1,1),e},c=function(e,t,n){for(var r=[];e&&e!==n;e=e[t])r.push(e);return r},s=function(t,n){return e.getParent(t,(function(e){return e.parentNode===n}),n)},f=function(e,t,r){for(var o=r?"nextSibling":"previousSibling",i=e,a=i.parentNode;i&&i!==t;i=a){a=i.parentNode;var s=c(i===e?i:i[o],o);s.length&&(r||s.reverse(),n(u(s)));}};if(o===a)return n(u([o]));var l=e.findCommonAncestor(o,a);if(e.isChildOf(o,a))return f(o,l,!0);if(e.isChildOf(a,o))return f(a,l);var d=s(o,l)||o,m=s(a,l)||a;f(o,d,!0);var g=c(d===o?d:d.nextSibling,"nextSibling",m===a?m.nextSibling:m);g.length&&n(u(g)),f(a,m);},Bl=function(e){var t=[];if(e)for(var n=0;n<e.rangeCount;n++)t.push(e.getRangeAt(n));return t},Pl=function(e){return K(function(e){return Z(e,(function(e){var t=ac(e);return t?[Rt.fromDom(t)]:[]}))}(e),vo)},Ll=function(e,t){var n=Mu(t,"td[data-mce-selected],th[data-mce-selected]");return n.length>0?n:Pl(e)},Il=function(e){return Ll(Bl(e.selection.getSel()),Rt.fromDom(e.getBody()))},Ml=function(e,t){return Gr(e,"table",t)},Fl=function(e){return Zt(e).fold(k([e]),(function(t){return [e].concat(Fl(t))}))},Ul=function(e){return en(e).fold(k([e]),(function(t){return "br"===It(t)?Kt(t).map((function(t){return [e].concat(Ul(t))})).getOr([]):[e].concat(Ul(t))}))},zl=function(e,t){return Yn(function(e){var t=e.startContainer,n=e.startOffset;return Fn(t)?0===n?I.some(Rt.fromDom(t)):I.none():I.from(t.childNodes[n]).map(Rt.fromDom)}(t),function(e){var t=e.endContainer,n=e.endOffset;return Fn(t)?n===t.data.length?I.some(Rt.fromDom(t)):I.none():I.from(t.childNodes[n-1]).map(Rt.fromDom)}(t),(function(t,n){var r=J(Fl(e),_(Bt,t)),o=J(Ul(e),_(Bt,n));return r.isSome()&&o.isSome()})).getOr(!1)},Hl=function(e,t,n,r){var o=n,i=new ao(n,o),a=he(e.schema.getMoveCaretBeforeOnEnterElements(),(function(e,t){return !H(["td","th","table"],t.toLowerCase())}));do{if(Fn(n)&&0!==_t.trim(n.nodeValue).length)return void(r?t.setStart(n,0):t.setEnd(n,n.nodeValue.length));if(a[n.nodeName])return void(r?t.setStartBefore(n):"BR"===n.nodeName?t.setEndBefore(n):t.setEndAfter(n))}while(n=r?i.next():i.prev());"BODY"===o.nodeName&&(r?t.setStart(o,0):t.setEnd(o,o.childNodes.length));},jl=function(e){var t=e.selection.getSel();return t&&t.rangeCount>0},Vl=function(e,t){var n=Il(e);n.length>0?q(n,(function(n){var r=n.dom,o=e.dom.createRng();o.setStartBefore(r),o.setEndAfter(r),t(o,!0);})):t(e.selection.getRng(),!1);},ql=function(e,t,n){var r=Yc(e,t);n(r),e.moveToBookmark(r);},$l=function(e,t){var n=function(t){return e(t)?I.from(t.dom.nodeValue):I.none()};return {get:function(r){if(!e(r))throw new Error("Can only get "+t+" value of a "+t+" node");return n(r).getOr("")},getOption:n,set:function(n,r){if(!e(n))throw new Error("Can only set raw "+t+" value of a "+t+" node");n.dom.nodeValue=r;}}}(zt,"text"),Wl=function(e){return $l.get(e)},Kl=function(e,t,n,r){return Wt(t).fold((function(){return "skipping"}),(function(o){return "br"===r||function(e){return zt(e)&&Wl(e)===Co}(t)?"valid":function(e){return Ut(e)&&Lu(e,Fu())}(t)?"existing":Ff(t.dom)?"caret":ol(e,n,r)&&ol(e,It(o),n)?"valid":"invalid-child"}))},Xl=function(e,t,n,r){var o=t.uid,i=void 0===o?Wu("mce-annotation"):o,a=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}(t,["uid"]),u=Rt.fromTag("span",e);Bu(u,Fu()),Qn(u,""+zu(),i),Qn(u,""+Uu(),n);var c=r(i,a),s=c.attributes,f=void 0===s?{}:s,l=c.classes,d=void 0===l?[]:l;return Zn(u,f),function(e,t){q(t,(function(t){Bu(e,t);}));}(u,d),u},Yl=function(e,t,n,r,o){var i=[],a=Xl(e.getDoc(),o,n,r),u=Eu(),c=function(){u.clear();},s=function(e){q(e,f);},f=function(t){switch(Kl(e,t,"span",It(t))){case"invalid-child":c();var n=Jt(t);s(n),c();break;case"valid":var r=u.get().getOrThunk((function(){var e=Yu(a);return i.push(e),u.set(e),e}));!function(e,t){fn(e,t),mn(t,e);}(t,r);}};return Ol(e.dom,t,(function(e){c(),function(e){var t=V(e,Rt.fromDom);s(t);}(e);})),i},Gl=function(e,t,n,r){e.undoManager.transact((function(){var o=e.selection,i=o.getRng(),a=Il(e).length>0;if(i.collapsed&&!a&&function(e,t){var n=Tl(e,t,[{inline:"span"}]);t.setStart(n.startContainer,n.startOffset),t.setEnd(n.endContainer,n.endOffset),e.selection.setRng(t);}(e,i),o.getRng().collapsed&&!a){var u=Xl(e.getDoc(),r,t,n.decorate);Ku(u,yo),o.getRng().insertNode(u.dom),o.select(u.dom);}else ql(o,!1,(function(){Vl(e,(function(o){Yl(e,o,t,n.decorate,r);}));}));}));},Jl=function(e){var t,n=(t={},{register:function(e,n){t[e]={name:e,settings:n};},lookup:function(e){return be(t,e).map((function(e){return e.settings}))}});qu(e,n);var r=Vu(e);return {register:function(e,t){n.register(e,t);},annotate:function(t,r){n.lookup(t).each((function(n){Gl(e,t,n,r);}));},annotationChanged:function(e,t){r.addListener(e,t);},remove:function(t){Hu(e,I.some(t)).each((function(e){var t=e.elements;q(t,vn);}));},getAll:function(t){var n=function(e,t){var n=Rt.fromDom(e.getBody()),r=Mu(n,"["+Uu()+'="'+t+'"]'),o={};return q(r,(function(e){var t=er(e,zu()),n=be(o,t).getOr([]);o[t]=n.concat([e]);})),o}(e,t);return de(n,(function(e){return V(e,(function(e){return e.dom}))}))}}},Ql=function(e){return {getBookmark:_(Xf,e),moveToBookmark:_(Yf,e)}};Ql.isBookmarkNode=Gf;var Zl=function(e,t){for(;t&&t!==e;){if(qn(t)||$n(t))return t;t=t.parentNode;}return null},ed=function(e,t,n){if(n.collapsed)return !1;if(wt.browser.isIE()&&n.startOffset===n.endOffset-1&&n.startContainer===n.endContainer){var r=n.startContainer.childNodes[n.startOffset];if(Dn(r))return j(r.getClientRects(),(function(n){return ic(n,e,t)}))}return j(n.getClientRects(),(function(n){return ic(n,e,t)}))},td=function(e,t,n){return e.fire(t,n)},nd=function(e,t,n,r){return e.fire("FormatApply",{format:t,node:n,vars:r})},rd=function(e,t,n,r){return e.fire("FormatRemove",{format:t,node:n,vars:r})},od={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,ESC:27,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,modifierPressed:function(e){return e.shiftKey||e.ctrlKey||e.altKey||od.metaKeyPressed(e)},metaKeyPressed:function(e){return wt.mac?e.metaKey:e.ctrlKey&&!e.altKey}},id=$n,ad=function(e,t){var n,r,o,i,a,u,c,s,f,l,d,m,g,p,h,v="data-mce-selected",y=t.dom,C=_t.each,x=t.getDoc(),w=document,S=Math.abs,k=Math.round,N=t.getBody(),E={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]},_=function(e){return e&&("IMG"===e.nodeName||t.dom.is(e,"figure.image"))},A=function(e){return Kn(e)||y.hasClass(e,"mce-preview-object")},R=function(e){var n=e.target;(function(e,t){if("longpress"===e.type||0===e.type.indexOf("touch")){var n=e.touches[0];return _(e.target)&&!ed(n.clientX,n.clientY,t)}return _(e.target)&&!ed(e.clientX,e.clientY,t)})(e,t.selection.getRng())&&!e.isDefaultPrevented()&&t.selection.select(n);},D=function(e){return y.is(e,"figure.image")?[e.querySelector("img")]:y.hasClass(e,"mce-preview-object")&&b(e.firstElementChild)?[e,e.firstElementChild]:[e]},T=function(e){var n=ps(t);return !!n&&("false"!==e.getAttribute("data-mce-resize")&&(e!==t.getBody()&&(y.hasClass(e,"mce-preview-object")?Tt(Rt.fromDom(e.firstElementChild),n):Tt(Rt.fromDom(e),n))))},O=function(e,n,r){if(b(r)){var o=D(e);q(o,(function(e){e.style[n]||!t.schema.isValid(e.nodeName.toLowerCase(),n)?y.setStyle(e,n,r):y.setAttrib(e,n,""+r);}));}},B=function(e,t,n){O(e,"width",t),O(e,"height",n);},P=function(e){var a,v,b,C,x;a=e.screenX-u,v=e.screenY-c,m=a*i[2]+s,g=v*i[3]+f,m=m<5?5:m,g=g<5?5:g,b=(_(n)||A(n))&&!1!==function(e){return e.getParam("resize_img_proportional",!0,"boolean")}(t)?!od.modifierPressed(e):od.modifierPressed(e),b&&(S(a)>S(v)?(g=k(m*l),m=k(g/l)):(m=k(g/l),g=k(m*l))),B(r,m,g),C=(C=i.startPos.x+a)>0?C:0,x=(x=i.startPos.y+v)>0?x:0,y.setStyles(o,{left:C,top:x,display:"block"}),o.innerHTML=m+" &times; "+g,i[2]<0&&r.clientWidth<=m&&y.setStyle(r,"left",undefined+(s-m)),i[3]<0&&r.clientHeight<=g&&y.setStyle(r,"top",undefined+(f-g)),(a=N.scrollWidth-p)+(v=N.scrollHeight-h)!==0&&y.setStyles(o,{left:C-a,top:x-v}),d||(!function(e,t,n,r,o){e.fire("ObjectResizeStart",{target:t,width:n,height:r,origin:o});}(t,n,s,f,"corner-"+i.name),d=!0);},L=function(){var e=d;d=!1,e&&(O(n,"width",m),O(n,"height",g)),y.unbind(x,"mousemove",P),y.unbind(x,"mouseup",L),w!==x&&(y.unbind(w,"mousemove",P),y.unbind(w,"mouseup",L)),y.remove(r),y.remove(o),y.remove(a),I(n),e&&(!function(e,t,n,r,o){e.fire("ObjectResized",{target:t,width:n,height:r,origin:o});}(t,n,m,g,"corner-"+i.name),y.setAttrib(n,"style",y.getAttrib(n,"style"))),t.nodeChanged();},I=function(e){z();var d=y.getPos(e,N),b=d.x,S=d.y,k=e.getBoundingClientRect(),_=k.width||k.right-k.left,R=k.height||k.bottom-k.top;n!==e&&(M(),n=e,m=g=0);var O=t.fire("ObjectSelected",{target:e}),I=y.getAttrib(n,v,"1");T(e)&&!O.isDefaultPrevented()?C(E,(function(e,t){var d,m=function(d){var m,g=D(n)[0];u=d.screenX,c=d.screenY,s=g.clientWidth,f=g.clientHeight,l=f/s,(i=e).name=t,i.startPos={x:_*e[0]+b,y:R*e[1]+S},p=N.scrollWidth,h=N.scrollHeight,a=y.add(N,"div",{class:"mce-resize-backdrop","data-mce-bogus":"all"}),y.setStyles(a,{position:"fixed",left:"0",top:"0",width:"100%",height:"100%"}),r=A(m=n)?y.create("img",{src:wt.transparentSrc}):m.cloneNode(!0),y.addClass(r,"mce-clonedresizable"),y.setAttrib(r,"data-mce-bogus","all"),r.contentEditable="false",y.setStyles(r,{left:b,top:S,margin:0}),B(r,_,R),r.removeAttribute(v),N.appendChild(r),y.bind(x,"mousemove",P),y.bind(x,"mouseup",L),w!==x&&(y.bind(w,"mousemove",P),y.bind(w,"mouseup",L)),o=y.add(N,"div",{class:"mce-resize-helper","data-mce-bogus":"all"},s+" &times; "+f);};(d=y.get("mceResizeHandle"+t))&&y.remove(d),d=y.add(N,"div",{id:"mceResizeHandle"+t,"data-mce-bogus":"all",class:"mce-resizehandle",unselectable:!0,style:"cursor:"+t+"-resize; margin:0; padding:0"}),11===wt.ie&&(d.contentEditable=!1),y.bind(d,"mousedown",(function(e){e.stopImmediatePropagation(),e.preventDefault(),m(e);})),e.elm=d,y.setStyles(d,{left:_*e[0]+b-d.offsetWidth/2,top:R*e[1]+S-d.offsetHeight/2});})):M(),y.getAttrib(n,v)||n.setAttribute(v,I);},M=function(){z(),n&&n.removeAttribute(v),le(E,(function(e,t){var n=y.get("mceResizeHandle"+t);n&&(y.unbind(n),y.remove(n));}));},F=function(n){var r,o=function(e,t){if(e)do{if(e===t)return !0}while(e=e.parentNode)};d||t.removed||(C(y.select("img[data-mce-selected],hr[data-mce-selected]"),(function(e){e.removeAttribute(v);})),r="mousedown"===n.type?n.target:e.getNode(),o(r=y.$(r).closest("table,img,figure.image,hr,video,span.mce-preview-object")[0],N)&&(H(),o(e.getStart(!0),r)&&o(e.getEnd(!0),r))?I(r):M());},U=function(e){return id(Zl(t.getBody(),e))},z=function(){le(E,(function(e){e.elm&&(y.unbind(e.elm),delete e.elm);}));},H=function(){try{t.getDoc().execCommand("enableObjectResizing",!1,"false");}catch(e){}};t.on("init",(function(){if(H(),wt.browser.isIE()||wt.browser.isEdge()){t.on("mousedown click",(function(e){var n=e.target,r=n.nodeName;d||!/^(TABLE|IMG|HR)$/.test(r)||U(n)||(2!==e.button&&t.selection.select(n,"TABLE"===r),"mousedown"===e.type&&t.nodeChanged());}));var e=function(e){var n=function(e){ro.setEditorTimeout(t,(function(){return t.selection.select(e)}));};if(U(e.target)||Kn(e.target))return e.preventDefault(),void n(e.target);/^(TABLE|IMG|HR)$/.test(e.target.nodeName)&&(e.preventDefault(),"IMG"===e.target.tagName&&n(e.target));};y.bind(N,"mscontrolselect",e),t.on("remove",(function(){return y.unbind(N,"mscontrolselect",e)}));}var r=ro.throttle((function(e){t.composing||F(e);}));t.on("nodechange ResizeEditor ResizeWindow ResizeContent drop FullscreenStateChanged",r),t.on("keyup compositionend",(function(e){n&&"TABLE"===n.nodeName&&r(e);})),t.on("hide blur",M),t.on("contextmenu longpress",R,!0);})),t.on("remove",z);return {isResizable:T,showResizeRect:I,hideResizeRect:M,updateResizeRect:F,destroy:function(){n=r=a=null;}}},ud=function(e){return qn(e)||$n(e)},cd=function(e,t,n){var r,o,i=n;if(i.caretPositionFromPoint)(o=i.caretPositionFromPoint(e,t))&&((r=n.createRange()).setStart(o.offsetNode,o.offset),r.collapse(!0));else if(i.caretRangeFromPoint)r=i.caretRangeFromPoint(e,t);else if(i.body.createTextRange){r=i.body.createTextRange();try{r.moveToPoint(e,t),r.collapse(!0);}catch(o){r=function(e,t,n){var r,o=n.elementFromPoint(e,t),i=n.body.createTextRange();if(o&&"HTML"!==o.tagName||(o=n.body),i.moveToElementText(o),(r=(r=_t.toArray(i.getClientRects())).sort((function(e,n){return (e=Math.abs(Math.max(e.top-t,e.bottom-t)))-Math.abs(Math.max(n.top-t,n.bottom-t))}))).length>0){t=(r[0].bottom+r[0].top)/2;try{return i.moveToPoint(e,t),i.collapse(!0),i}catch(e){}}return null}(e,t,n);}return function(e,t){var n=e&&e.parentElement?e.parentElement():null;return $n(function(e,t,n){for(;e&&e!==t;){if(n(e))return e;e=e.parentNode;}return null}(n,t,ud))?null:e}(r,n.body)}return r},sd=function(e,t){return e&&t&&e.startContainer===t.startContainer&&e.startOffset===t.startOffset&&e.endContainer===t.endContainer&&e.endOffset===t.endOffset},fd=function(e,t,n){return null!==function(e,t,n){for(;e&&e!==t;){if(n(e))return e;e=e.parentNode;}return null}(e,t,n)},ld=function(e,t,n){return fd(e,t,(function(e){return e.nodeName===n}))},dd=function(e){return e&&"TABLE"===e.nodeName},md=function(e){return e&&/^(TD|TH|CAPTION)$/.test(e.nodeName)},gd=function(e,t){return _o(e)&&!1===fd(e,t,Ff)},pd=function(e,t,n){for(var r=new ao(t,e.getParent(t.parentNode,e.isBlock)||e.getRoot());t=r[n?"prev":"next"]();)if(jn(t))return !0},hd=function(e,t,n,r,o){var i,a,u=e.getRoot(),c=e.schema.getNonEmptyElements(),s=e.getParent(o.parentNode,e.isBlock)||u;if(r&&jn(o)&&t&&e.isEmpty(s))return I.some(Ac(o.parentNode,e.nodeIndex(o)));for(var f=new ao(o,s);a=f[r?"prev":"next"]();){if("false"===e.getContentEditableParent(a)||gd(a,u))return I.none();if(Fn(a)&&a.nodeValue.length>0)return !1===ld(a,u,"A")?I.some(Ac(a,r?a.nodeValue.length:0)):I.none();if(e.isBlock(a)||c[a.nodeName.toLowerCase()])return I.none();i=a;}return n&&i?I.some(Ac(i,0)):I.none()},vd=function(e,t,n,r){var o,i,a,u,c=e.getRoot(),s=!1;o=r[(n?"start":"end")+"Container"],i=r[(n?"start":"end")+"Offset"];var f=Dn(o)&&i===o.childNodes.length,l=e.schema.getNonEmptyElements();if(u=n,_o(o))return I.none();if(Dn(o)&&i>o.childNodes.length-1&&(u=!1),zn(o)&&(o=c,i=0),o===c){if(u&&(a=o.childNodes[i>0?i-1:0])){if(_o(a))return I.none();if(l[a.nodeName]||dd(a))return I.none()}if(o.hasChildNodes()){if(i=Math.min(!u&&i>0?i-1:i,o.childNodes.length-1),o=o.childNodes[i],i=Fn(o)&&f?o.data.length:0,!t&&o===c.lastChild&&dd(o))return I.none();if(function(e,t){for(;t&&t!==e;){if($n(t))return !0;t=t.parentNode;}return !1}(c,o)||_o(o))return I.none();if(o.hasChildNodes()&&!1===dd(o)){a=o;var d=new ao(o,c);do{if($n(a)||_o(a)){s=!1;break}if(Fn(a)&&a.nodeValue.length>0){i=u?0:a.nodeValue.length,o=a,s=!0;break}if(l[a.nodeName.toLowerCase()]&&!md(a)){i=e.nodeIndex(a),o=a.parentNode,u||i++,s=!0;break}}while(a=u?d.next():d.prev())}}}return t&&(Fn(o)&&0===i&&hd(e,f,t,!0,o).each((function(e){o=e.container(),i=e.offset(),s=!0;})),Dn(o)&&((a=o.childNodes[i])||(a=o.childNodes[i-1]),!a||!jn(a)||function(e,t){return e.previousSibling&&e.previousSibling.nodeName===t}(a,"A")||pd(e,a,!1)||pd(e,a,!0)||hd(e,f,t,!0,a).each((function(e){o=e.container(),i=e.offset(),s=!0;})))),u&&!t&&Fn(o)&&i===o.nodeValue.length&&hd(e,f,t,!1,o).each((function(e){o=e.container(),i=e.offset(),s=!0;})),s?I.some(Ac(o,i)):I.none()},bd=function(e,t){var n=t.collapsed,r=t.cloneRange(),o=Ac.fromRangeStart(t);return vd(e,n,!0,r).each((function(e){n&&Ac.isAbove(o,e)||r.setStart(e.container(),e.offset());})),n||vd(e,n,!1,r).each((function(e){r.setEnd(e.container(),e.offset());})),n&&r.collapse(!0),sd(t,r)?I.none():I.some(r)},yd=function(e,t){return e.splitText(t)},Cd=function(e){var t=e.startContainer,n=e.startOffset,r=e.endContainer,o=e.endOffset;return t===r&&Fn(t)?n>0&&n<t.nodeValue.length&&(t=(r=yd(t,n)).previousSibling,o>n?(t=r=yd(r,o-=n).previousSibling,o=r.nodeValue.length,n=0):o=0):(Fn(t)&&n>0&&n<t.nodeValue.length&&(t=yd(t,n),n=0),Fn(r)&&o>0&&o<r.nodeValue.length&&(o=(r=yd(r,o).previousSibling).nodeValue.length)),{startContainer:t,startOffset:n,endContainer:r,endOffset:o}},xd=function(e){return {walk:function(t,n){return Ol(e,t,n)},split:Cd,normalize:function(t){return bd(e,t).fold(T,(function(e){return t.setStart(e.startContainer,e.startOffset),t.setEnd(e.endContainer,e.endOffset),!0}))}}};xd.compareRanges=sd,xd.getCaretRangeFromPoint=cd,xd.getSelectedNode=ac,xd.getNode=uc;var wd,Sd=function(e,t){var n=function(n){var r=t(n);if(r<=0||null===r){var o=or(n,e);return parseFloat(o)||0}return r},r=function(e,t){return Y(t,(function(t,n){var r=or(e,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?t:t+o}),0)};return {set:function(t,n){if(!C(n)&&!n.match(/^[0-9]+$/))throw new Error(e+".set accepts only positive integer values. Value was "+n);var r=t.dom;Gn(r)&&(r.style[e]=n+"px");},get:n,getOuter:n,aggregate:r,max:function(e,t,n){var o=r(e,n);return t>o?t-o:0}}}("height",(function(e){var t=e.dom;return bn(e)?t.getBoundingClientRect().height:t.offsetHeight})),kd=function(e,t){return e.view(t).fold(k([]),(function(t){var n=e.owner(t),r=kd(e,n);return [t].concat(r)}))},Nd=Object.freeze({__proto__:null,view:function(e){var t;return (e.dom===document?I.none():I.from(null===(t=e.dom.defaultView)||void 0===t?void 0:t.frameElement)).map(Rt.fromDom)},owner:function(e){return qt(e)}}),Ed=function(e){var t=Rt.fromDom(document),n=Sn(t),r=function(e,t){var n=t.owner(e);return kd(t,n)}(e,Nd),o=wn(e),i=X(r,(function(e,t){var n=wn(t);return {left:e.left+n.left,top:e.top+n.top}}),{left:0,top:0});return Cn(i.left+o.left+n.left,i.top+o.top+n.top)},_d=function(e){return "textarea"===It(e)},Ad=function(e,t){var n=function(e){var t=e.dom.ownerDocument,n=t.body,r=t.defaultView,o=t.documentElement;if(n===e.dom)return Cn(n.offsetLeft,n.offsetTop);var i=xn(null==r?void 0:r.pageYOffset,o.scrollTop),a=xn(null==r?void 0:r.pageXOffset,o.scrollLeft),u=xn(o.clientTop,n.clientTop),c=xn(o.clientLeft,n.clientLeft);return wn(e).translate(a-c,i-u)}(e),r=function(e){return Sd.get(e)}(e);return {element:e,bottom:n.top+r,height:r,pos:n,cleanup:t}},Rd=function(e,t){var n=function(e,t){var n=Jt(e);if(0===n.length||_d(e))return {element:e,offset:t};if(t<n.length&&!_d(n[t]))return {element:n[t],offset:0};var r=n[n.length-1];return _d(r)?{element:e,offset:t}:"img"===It(r)?{element:r,offset:1}:zt(r)?{element:r,offset:Wl(r).length}:{element:r,offset:Jt(r).length}}(e,t),r=Rt.fromHtml('<span data-mce-bogus="all" style="display: inline-block;">\ufeff</span>');return fn(n.element,r),Ad(r,(function(){return hn(r)}))},Dd=function(e,t,n,r){Pd(e,(function(o,i){return Od(e,t,n,r)}),n);},Td=function(e,t,n,r,o){var i={elm:r.element.dom,alignToTop:o};(function(e,t){return e.fire("ScrollIntoView",t).isDefaultPrevented()})(e,i)||(n(t,Sn(t).top,r,o),function(e,t){e.fire("AfterScrollIntoView",t);}(e,i));},Od=function(e,t,n,r){var o=Rt.fromDom(e.getBody()),i=Rt.fromDom(e.getDoc());o.dom.offsetWidth;var a=Rd(Rt.fromDom(n.startContainer),n.startOffset);Td(e,i,t,a,r),a.cleanup();},Bd=function(e,t,n,r){var o=Rt.fromDom(e.getDoc());Td(e,o,n,function(e){return Ad(Rt.fromDom(e),x)}(t),r);},Pd=function(e,t,n){var r=n.startContainer,o=n.startOffset,i=n.endContainer,a=n.endOffset;t(Rt.fromDom(r),Rt.fromDom(i));var u=e.dom.createRng();u.setStart(r,o),u.setEnd(i,a),e.selection.setRng(n);},Ld=function(e,t,n,r){var o=e.pos;if(n)kn(o.left,o.top,r);else {var i=o.top-t+e.height;kn(o.left,i,r);}},Id=function(e,t,n,r,o){var i=n+t,a=r.pos.top,u=r.bottom,c=u-a>=n;if(a<t)Ld(r,n,!1!==o,e);else if(a>i){Ld(r,n,c?!1!==o:!0===o,e);}else u>i&&!c&&Ld(r,n,!0===o,e);},Md=function(e,t,n,r){var o=e.dom.defaultView.innerHeight;Id(e,t,o,n,r);},Fd=function(e,t,n,r){var o=e.dom.defaultView.innerHeight;Id(e,t,o,n,r);var i=Ed(n.element),a=_n(window);i.top<a.y?Nn(n.element,!1!==r):i.top>a.bottom&&Nn(n.element,!0===r);},Ud=function(e,t,n){return Dd(e,Md,t,n)},zd=function(e,t,n){return Bd(e,t,Md,n)},Hd=function(e,t,n){return Dd(e,Fd,t,n)},jd=function(e,t,n){return Bd(e,t,Fd,n)},Vd=function(e,t,n){(e.inline?Ud:Hd)(e,t,n);},qd=function(e){var t=an(e).dom;return e.dom===t.activeElement},$d=function(e){return void 0===e&&(e=Rt.fromDom(document)),I.from(e.dom.activeElement).map(Rt.fromDom)},Wd=function(e,t,n,r){return {start:e,soffset:t,finish:n,foffset:r}},Kd=kr([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Xd=(Kd.before,Kd.on,Kd.after,function(e){return e.fold(N,N,N)}),Yd=kr([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Gd={domRange:Yd.domRange,relative:Yd.relative,exact:Yd.exact,exactFromRange:function(e){return Yd.exact(e.start,e.soffset,e.finish,e.foffset)},getWin:function(e){var t=function(e){return e.match({domRange:function(e){return Rt.fromDom(e.startContainer)},relative:function(e,t){return Xd(e)},exact:function(e,t,n,r){return e}})}(e);return $t(t)},range:Wd},Jd=mt().browser,Qd=function(e,t){var n=zt(t)?Wl(t).length:Jt(t).length+1;return e>n?n:e<0?0:e},Zd=function(e){return Gd.range(e.start,Qd(e.soffset,e.start),e.finish,Qd(e.foffset,e.finish))},em=function(e,t){return !Rn(t.dom)&&(Lt(e,t)||Bt(e,t))},tm=function(e){return function(t){return em(e,t.start)&&em(e,t.finish)}},nm=function(e){return !0===e.inline||Jd.isIE()},rm=function(e){return Gd.range(Rt.fromDom(e.startContainer),e.startOffset,Rt.fromDom(e.endContainer),e.endOffset)},om=function(e){return function(e){var t=e.getSelection();return (t&&0!==t.rangeCount?I.from(t.getRangeAt(0)):I.none()).map(rm)}($t(e).dom).filter(tm(e))},im=function(e){var t=document.createRange();try{return t.setStart(e.start.dom,e.soffset),t.setEnd(e.finish.dom,e.foffset),I.some(t)}catch(e){return I.none()}},am=function(e){var t=nm(e)?om(Rt.fromDom(e.getBody())):I.none();e.bookmark=t.isSome()?t:e.bookmark;},um=function(e){return (e.bookmark?e.bookmark:I.none()).bind((function(t){return function(e,t){return I.from(t).filter(tm(e)).map(Zd)}(Rt.fromDom(e.getBody()),t)})).bind(im)},cm={isEditorUIElement:function(e){var t=e.className.toString();return -1!==t.indexOf("tox-")||-1!==t.indexOf("mce-")}},sm=function(e,t){mt().browser.isIE()?function(e){e.on("focusout",(function(){am(e);}));}(e):function(e,t){e.on("mouseup touchend",(function(e){t.throttle();}));}(e,t),e.on("keyup NodeChange",(function(t){(function(e){return "nodechange"===e.type&&e.selectionChange})(t)||am(e);}));},fm=function(e){var t=_u((function(){am(e);}),0);e.on("init",(function(){e.inline&&function(e,t){var n=function(){t.throttle();};pu.DOM.bind(document,"mouseup",n),e.on("remove",(function(){pu.DOM.unbind(document,"mouseup",n);}));}(e,t),sm(e,t);})),e.on("remove",(function(){t.cancel();}));},lm=pu.DOM,dm=function(e,t){var n=function(e){return e.getParam("custom_ui_selector","","string")}(e),r=lm.getParent(t,(function(t){return function(e){return cm.isEditorUIElement(e)}(t)||!!n&&e.dom.is(t,n)}));return null!==r},mm=function(e,t){var n=t.editor;fm(n),n.on("focusin",(function(){var t=e.focusedEditor;t!==n&&(t&&t.fire("blur",{focusedEditor:n}),e.setActive(n),e.focusedEditor=n,n.fire("focus",{blurredEditor:t}),n.focus(!0));})),n.on("focusout",(function(){ro.setEditorTimeout(n,(function(){var t=e.focusedEditor;dm(n,function(e){try{var t=an(Rt.fromDom(e.getElement()));return $d(t).fold((function(){return document.body}),(function(e){return e.dom}))}catch(e){return document.body}}(n))||t!==n||(n.fire("blur",{focusedEditor:null}),e.focusedEditor=null);}));})),wd||(wd=function(t){var n=e.activeEditor;n&&function(e){if(on()&&b(e.target)){var t=Rt.fromDom(e.target);if(Ut(t)&&sn(t)&&e.composed&&e.composedPath){var n=e.composedPath();if(n)return ie(n)}}return I.from(e.target)}(t).each((function(t){t.ownerDocument===document&&(t===document.body||dm(n,t)||e.focusedEditor!==n||(n.fire("blur",{focusedEditor:null}),e.focusedEditor=null));}));},lm.bind(document,"focusin",wd));},gm=function(e,t){e.focusedEditor===t.editor&&(e.focusedEditor=null),e.activeEditor||(lm.unbind(document,"focusin",wd),wd=null);},pm=function(e,t){return function(e){return e.collapsed?I.from(uc(e.startContainer,e.startOffset)).map(Rt.fromDom):I.none()}(t).bind((function(t){return ho(t)?I.some(t):!1===Lt(e,t)?I.some(e):I.none()}))},hm=function(e,t){pm(Rt.fromDom(e.getBody()),t).bind((function(e){return Lf(e.dom)})).fold((function(){e.selection.normalize();}),(function(t){return e.selection.setRng(t.toRange())}));},vm=function(e){if(e.setActive)try{e.setActive();}catch(t){e.focus();}else e.focus();},bm=function(e){return qd(e)||(t=e,$d(an(t)).filter((function(e){return t.dom.contains(e.dom)}))).isSome();var t;},ym=function(e){return e.inline?function(e){var t=e.getBody();return t&&bm(Rt.fromDom(t))}(e):function(e){return e.iframeElement&&qd(Rt.fromDom(e.iframeElement))}(e)},Cm=function(e){return ym(e)||function(e){var t=an(Rt.fromDom(e.getElement()));return $d(t).filter((function(t){return !(void 0!==(n=t.dom.classList)&&(n.contains("tox-edit-area")||n.contains("tox-edit-area__iframe")||n.contains("mce-content-body")))&&dm(e,t.dom);var n;})).isSome()}(e)},xm=function(e){return e.editorManager.setActive(e)},wm=function(e,t){e.removed||(t?xm(e):function(e){var t=e.selection,n=e.getBody(),r=t.getRng();e.quirks.refreshContentEditable(),void 0!==e.bookmark&&!1===ym(e)&&um(e).each((function(t){e.selection.setRng(t),r=t;}));var o=function(e,t){return e.dom.getParent(t,(function(t){return "true"===e.dom.getContentEditable(t)}))}(e,t.getNode());if(e.$.contains(n,o))return vm(o),hm(e,r),void xm(e);e.inline||(wt.opera||vm(n),e.getWin().focus()),(wt.gecko||e.inline)&&(vm(n),hm(e,r)),xm(e);}(e));},Sm=function(e,t,n,r,o){var i=n?t.startContainer:t.endContainer,a=n?t.startOffset:t.endOffset;return I.from(i).map(Rt.fromDom).map((function(e){return r&&t.collapsed?e:Qt(e,o(e,a)).getOr(e)})).bind((function(e){return Ut(e)?I.some(e):Wt(e).filter(Ut)})).map((function(e){return e.dom})).getOr(e)},km=function(e,t,n){return Sm(e,t,!0,n,(function(e,t){return Math.min(tn(e),t)}))},Nm=function(e,t,n){return Sm(e,t,!1,n,(function(e,t){return t>0?t-1:t}))},Em=function(e,t){for(var n=e;e&&Fn(e)&&0===e.length;)e=t?e.nextSibling:e.previousSibling;return e||n},_m=function(e,t){return V(t,(function(t){var n=e.fire("GetSelectionRange",{range:t});return n.range!==t?n.range:t}))},Am={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},Rm=function(e,t,n){var r=n?"lastChild":"firstChild",o=n?"prev":"next";if(e[r])return e[r];if(e!==t){var i=e[o];if(i)return i;for(var a=e.parent;a&&a!==t;a=a.parent)if(i=a[o])return i}},Dm=function(e){if(!Xo(e.value))return !1;var t=e.parent;return !t||"span"===t.name&&!t.attr("style")||!/^[ ]+$/.test(e.value)},Tm=function(e){var t="a"===e.name&&!e.attr("href")&&e.attr("id");return e.attr("name")||e.attr("id")&&!e.firstChild||e.attr("data-mce-bookmark")||t},Om=function(){function e(e,t){this.name=e,this.type=t,1===t&&(this.attributes=[],this.attributes.map={});}return e.create=function(t,n){var r=new e(t,Am[t]||1);return n&&le(n,(function(e,t){r.attr(t,e);})),r},e.prototype.replace=function(e){var t=this;return e.parent&&e.remove(),t.insert(e,t),t.remove(),t},e.prototype.attr=function(e,t){var n,r=this;if("string"!=typeof e)return null!=e&&le(e,(function(e,t){r.attr(t,e);})),r;if(n=r.attributes){if(void 0!==t){if(null===t){if(e in n.map){delete n.map[e];for(var o=n.length;o--;)if(n[o].name===e)return n.splice(o,1),r}return r}if(e in n.map){for(o=n.length;o--;)if(n[o].name===e){n[o].value=t;break}}else n.push({name:e,value:t});return n.map[e]=t,r}return n.map[e]}},e.prototype.clone=function(){var t,n=this,r=new e(n.name,n.type);if(t=n.attributes){var o=[];o.map={};for(var i=0,a=t.length;i<a;i++){var u=t[i];"id"!==u.name&&(o[o.length]={name:u.name,value:u.value},o.map[u.name]=u.value);}r.attributes=o;}return r.value=n.value,r.shortEnded=n.shortEnded,r},e.prototype.wrap=function(e){var t=this;return t.parent.insert(e,t),e.append(t),t},e.prototype.unwrap=function(){for(var e=this,t=e.firstChild;t;){var n=t.next;e.insert(t,e,!0),t=n;}e.remove();},e.prototype.remove=function(){var e=this,t=e.parent,n=e.next,r=e.prev;return t&&(t.firstChild===e?(t.firstChild=n,n&&(n.prev=null)):r.next=n,t.lastChild===e?(t.lastChild=r,r&&(r.next=null)):n.prev=r,e.parent=e.next=e.prev=null),e},e.prototype.append=function(e){var t=this;e.parent&&e.remove();var n=t.lastChild;return n?(n.next=e,e.prev=n,t.lastChild=e):t.lastChild=t.firstChild=e,e.parent=t,e},e.prototype.insert=function(e,t,n){e.parent&&e.remove();var r=t.parent||this;return n?(t===r.firstChild?r.firstChild=e:t.prev.next=e,e.prev=t.prev,e.next=t,t.prev=e):(t===r.lastChild?r.lastChild=e:t.next.prev=e,e.next=t.next,e.prev=t,t.next=e),e.parent=r,e},e.prototype.getAll=function(e){for(var t=[],n=this.firstChild;n;n=Rm(n,this))n.name===e&&t.push(n);return t},e.prototype.children=function(){for(var e=[],t=this.firstChild;t;t=t.next)e.push(t);return e},e.prototype.empty=function(){var e=this;if(e.firstChild){for(var t=[],n=e.firstChild;n;n=Rm(n,e))t.push(n);for(var r=t.length;r--;){(n=t[r]).parent=n.firstChild=n.lastChild=n.next=n.prev=null;}}return e.firstChild=e.lastChild=null,e},e.prototype.isEmpty=function(e,t,n){void 0===t&&(t={});var r=this,o=r.firstChild;if(Tm(r))return !1;if(o)do{if(1===o.type){if(o.attr("data-mce-bogus"))continue;if(e[o.name])return !1;if(Tm(o))return !1}if(8===o.type)return !1;if(3===o.type&&!Dm(o))return !1;if(3===o.type&&o.parent&&t[o.parent.name]&&Xo(o.value))return !1;if(n&&n(o))return !1}while(o=Rm(o,r));return !0},e.prototype.walk=function(e){return Rm(this,null,e)},e}(),Bm=function(e,t){return e.replace(t.re,(function(e){return be(t.uris,e).getOr(e)}))},Pm=_t.each,Lm=_t.trim,Im="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),Mm={ftp:21,http:80,https:443,mailto:25},Fm=["img","video"],Um=function(e,t,n){return !e.allow_html_data_urls&&(/^data:image\//i.test(t)?function(e,t){return b(e)?!e:!b(t)||!H(Fm,t)}(e.allow_svg_data_urls,n)&&/^data:image\/svg\+xml/i.test(t):/^data:/i.test(t))},zm=function(){function e(t,n){t=Lm(t),this.settings=n||{};var r=this.settings.base_uri,o=this;if(/^([\w\-]+):([^\/]{2})/i.test(t)||/^\s*#/.test(t))o.source=t;else {var i=0===t.indexOf("//");if(0!==t.indexOf("/")||i||(t=(r&&r.protocol||"http")+"://mce_host"+t),!/^[\w\-]*:?\/\//.test(t)){var a=this.settings.base_uri?this.settings.base_uri.path:new e(document.location.href).directory;if(this.settings.base_uri&&""==this.settings.base_uri.protocol)t="//mce_host"+o.toAbsPath(a,t);else {var u=/([^#?]*)([#?]?.*)/.exec(t);t=(r&&r.protocol||"http")+"://mce_host"+o.toAbsPath(a,u[1])+u[2];}}t=t.replace(/@@/g,"(mce_at)");var c=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?(\[[a-zA-Z0-9:.%]+\]|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(t);Pm(Im,(function(e,t){var n=c[t];n&&(n=n.replace(/\(mce_at\)/g,"@@")),o[e]=n;})),r&&(o.protocol||(o.protocol=r.protocol),o.userInfo||(o.userInfo=r.userInfo),o.port||"mce_host"!==o.host||(o.port=r.port),o.host&&"mce_host"!==o.host||(o.host=r.host),o.source=""),i&&(o.protocol="");}}return e.parseDataUri=function(e){var t,n=decodeURIComponent(e).split(","),r=/data:([^;]+)/.exec(n[0]);return r&&(t=r[1]),{type:t,data:n[1]}},e.isDomSafe=function(e,t,n){if(void 0===n&&(n={}),n.allow_script_urls)return !0;var r=bi.decode(e).replace(/[\s\u0000-\u001F]+/g,"");try{r=decodeURIComponent(r);}catch(e){r=unescape(r);}return !/((java|vb)script|mhtml):/i.test(r)&&!Um(n,r,t)},e.getDocumentBaseUrl=function(e){var t;return t=0!==e.protocol.indexOf("http")&&"file:"!==e.protocol?e.href:e.protocol+"//"+e.host+e.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(t)&&(t=t.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(t)||(t+="/")),t},e.prototype.setPath=function(e){var t=/^(.*?)\/?(\w+)?$/.exec(e);this.path=t[0],this.directory=t[1],this.file=t[2],this.source="",this.getURI();},e.prototype.toRelative=function(t){var n;if("./"===t)return t;var r=new e(t,{base_uri:this});if("mce_host"!==r.host&&this.host!==r.host&&r.host||this.port!==r.port||this.protocol!==r.protocol&&""!==r.protocol)return r.getURI();var o=this.getURI(),i=r.getURI();return o===i||"/"===o.charAt(o.length-1)&&o.substr(0,o.length-1)===i?o:(n=this.toRelPath(this.path,r.path),r.query&&(n+="?"+r.query),r.anchor&&(n+="#"+r.anchor),n)},e.prototype.toAbsolute=function(t,n){var r=new e(t,{base_uri:this});return r.getURI(n&&this.isSameOrigin(r))},e.prototype.isSameOrigin=function(e){if(this.host==e.host&&this.protocol==e.protocol){if(this.port==e.port)return !0;var t=Mm[this.protocol];if(t&&(this.port||t)==(e.port||t))return !0}return !1},e.prototype.toRelPath=function(e,t){var n,r,o=0,i="",a=e.substring(0,e.lastIndexOf("/")).split("/"),u=t.split("/");if(a.length>=u.length)for(n=0,r=a.length;n<r;n++)if(n>=u.length||a[n]!==u[n]){o=n+1;break}if(a.length<u.length)for(n=0,r=u.length;n<r;n++)if(n>=a.length||a[n]!==u[n]){o=n+1;break}if(1===o)return t;for(n=0,r=a.length-(o-1);n<r;n++)i+="../";for(n=o-1,r=u.length;n<r;n++)i+=n!==o-1?"/"+u[n]:u[n];return i},e.prototype.toAbsPath=function(e,t){var n,r,o=0,i=[],a=/\/$/.test(t)?"/":"",u=e.split("/"),c=t.split("/");for(Pm(u,(function(e){e&&i.push(e);})),u=i,n=c.length-1,i=[];n>=0;n--)0!==c[n].length&&"."!==c[n]&&(".."!==c[n]?o>0?o--:i.push(c[n]):o++);return 0!==(r=(n=u.length-o)<=0?te(i).join("/"):u.slice(0,n).join("/")+"/"+te(i).join("/")).indexOf("/")&&(r="/"+r),a&&r.lastIndexOf("/")!==r.length-1&&(r+=a),r},e.prototype.getURI=function(e){var t;return void 0===e&&(e=!1),this.source&&!e||(t="",e||(this.protocol?t+=this.protocol+"://":t+="//",this.userInfo&&(t+=this.userInfo+"@"),this.host&&(t+=this.host),this.port&&(t+=":"+this.port)),this.path&&(t+=this.path),this.query&&(t+="?"+this.query),this.anchor&&(t+="#"+this.anchor),this.source=t),this.source},e}(),Hm=_t.makeMap("button,fieldset,form,iframe,img,image,input,object,output,select,textarea"),jm=function(e,t,n){for(var r=/<([!?\/])?([A-Za-z0-9\-_:.]+)/g,o=/(?:\s(?:[^'">]+(?:"[^"]*"|'[^']*'))*[^"'>]*(?:"[^">]*|'[^'>]*)?|\s*|\/)>/g,i=e.getShortEndedElements(),a=1,u=n;0!==a;)for(r.lastIndex=u;;){var c=r.exec(t);if(null===c)return u;if("!"===c[1]){u=Me(c[2],"--")?Vm(t,!1,c.index+"!--".length):Vm(t,!0,c.index+1);break}o.lastIndex=r.lastIndex;var s=o.exec(t);if(!g(s)&&s.index===r.lastIndex){"/"===c[1]?a-=1:ye(i,c[2])||(a+=1),u=r.lastIndex+s[0].length;break}}return u},Vm=function(e,t,n){void 0===n&&(n=0);var r=e.toLowerCase();if(-1!==r.indexOf("[if ",n)&&function(e,t){return /^\s*\[if [\w\W]+\]>.*<!\[endif\](--!?)?>/.test(e.substr(t))}(r,n)){var o=r.indexOf("[endif]",n);return r.indexOf(">",o)}if(t){var i=r.indexOf(">",n);return -1!==i?i:r.length}var a=/--!?>/g;a.lastIndex=n;var u=a.exec(e);return u?u.index+u[0].length:r.length},qm=function(e,t){var n=e.exec(t);if(n){var r=n[1],o=n[2];return "string"==typeof r&&"data-mce-bogus"===r.toLowerCase()?o:null}return null},$m=function(e,t){var n;void 0===t&&(t=Ai());var r=null!==(n=(e=e||{}).document)&&void 0!==n?n:document,o=r.createElement("form");!1!==e.fix_self_closing&&(e.fix_self_closing=!0);var i=e.comment?e.comment:x,a=e.cdata?e.cdata:x,u=e.text?e.text:x,c=e.start?e.start:x,s=e.end?e.end:x,f=e.pi?e.pi:x,l=e.doctype?e.doctype:x,d=function(n,d){void 0===d&&(d="html");for(var m,g,p,h,v,b,y,C,x,w,S,k,N,E,_,A,R,D,T,O=n.html,B=0,P=[],L=0,I=bi.decode,M=_t.makeMap("src,href,data,background,action,formaction,poster,xlink:href"),F="html"===d?0:1,U=function(e){var t,n;for(t=P.length;t--&&P[t].name!==e;);if(t>=0){for(n=P.length-1;n>=t;n--)(e=P[n]).valid&&s(e.name);P.length=t;}},z=function(e,t){return u(Bm(e,n),t)},H=function(t){""!==t&&(">"===t.charAt(0)&&(t=" "+t),e.allow_conditional_comments||"[if"!==t.substr(0,3).toLowerCase()||(t=" "+t),i(Bm(t,n)));},j=function(e,t){var n=e||"",r=!Me(n,"--"),o=Vm(O,r,t);return e=O.substr(t,o-t),H(r?n+e:e),o+1},V=function(t,i,a,u,c){if(a=function(e){return Bm(e,n)}((i=i.toLowerCase())in X?i:I(a||u||c||"")),Y&&!C&&!1===function(e){return 0===e.indexOf("data-")||0===e.indexOf("aria-")}(i)){var s=E[i];if(!s&&_){for(var f=_.length;f--&&!(s=_[f]).pattern.test(i););-1===f&&(s=null);}if(!s)return;if(s.validValues&&!(a in s.validValues))return}("name"===i||"id"===i)&&t in Hm&&(a in r||a in o)||M[i]&&!zm.isDomSafe(a,t,e)||C&&(i in M||0===i.indexOf("on"))||(h.map[i]=a,h.push({name:i,value:a}));},q=new RegExp("<(?:(?:!--([\\w\\W]*?)--!?>)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:![Dd][Oo][Cc][Tt][Yy][Pp][Ee]([\\w\\W]*?)>)|(?:!(--)?)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)>)|(?:([A-Za-z][A-Za-z0-9\\-_:.]*)(\\s(?:[^'\">]+(?:\"[^\"]*\"|'[^']*'))*[^\"'>]*(?:\"[^\">]*|'[^'>]*)?|\\s*|\\/)>))","g"),$=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,W=t.getShortEndedElements(),K=e.self_closing_elements||t.getSelfClosingElements(),X=t.getBoolAttrs(),Y=e.validate,G=e.remove_internals,J=e.fix_self_closing,Q=t.getSpecialElements(),Z=O+">";m=q.exec(Z);){var ee=m[0];if(B<m.index&&z(I(O.substr(B,m.index-B))),g=m[7])":"===(g=g.toLowerCase()).charAt(0)&&(g=g.substr(1)),U(g);else if(g=m[8]){if(m.index+ee.length>O.length){z(I(O.substr(m.index))),B=m.index+ee.length;continue}":"===(g=g.toLowerCase()).charAt(0)&&(g=g.substr(1)),x=g in W,J&&K[g]&&P.length>0&&P[P.length-1].name===g&&U(g);var te=qm($,m[9]);if(null!==te){if("all"===te){B=jm(t,O,q.lastIndex),q.lastIndex=B;continue}S=!1;}if(!Y||(w=t.getElementRule(g))){if(S=!0,Y&&(E=w.attributes,_=w.attributePatterns),(N=m[9])?((C=-1!==N.indexOf("data-mce-type"))&&G&&(S=!1),(h=[]).map={},N.replace($,(function(e,t,n,r,o){return V(g,t,n,r,o),""}))):(h=[]).map={},Y&&!C){if(A=w.attributesRequired,R=w.attributesDefault,D=w.attributesForced,w.removeEmptyAttrs&&!h.length&&(S=!1),D)for(v=D.length;v--;)y=(k=D[v]).name,"{$uid}"===(T=k.value)&&(T="mce_"+L++),h.map[y]=T,h.push({name:y,value:T});if(R)for(v=R.length;v--;)(y=(k=R[v]).name)in h.map||("{$uid}"===(T=k.value)&&(T="mce_"+L++),h.map[y]=T,h.push({name:y,value:T}));if(A){for(v=A.length;v--&&!(A[v]in h.map););-1===v&&(S=!1);}if(k=h.map["data-mce-bogus"]){if("all"===k){B=jm(t,O,q.lastIndex),q.lastIndex=B;continue}S=!1;}}S&&c(g,h,x);}else S=!1;if(p=Q[g]){p.lastIndex=B=m.index+ee.length,(m=p.exec(O))?(S&&(b=O.substr(B,m.index-B)),B=m.index+m[0].length):(b=O.substr(B),B=O.length),S&&(b.length>0&&z(b,!0),s(g)),q.lastIndex=B;continue}x||(N&&N.indexOf("/")===N.length-1?S&&s(g):P.push({name:g,valid:S}));}else if(g=m[1])H(g);else if(g=m[2]){if(!(1===F||e.preserve_cdata||P.length>0&&t.isValidChild(P[P.length-1].name,"#cdata"))){B=j("",m.index+2),q.lastIndex=B;continue}a(g);}else if(g=m[3])l(g);else {if((g=m[4])||"<!"===ee){B=j(g,m.index+ee.length),q.lastIndex=B;continue}if(g=m[5]){if(1!==F){B=j("?",m.index+2),q.lastIndex=B;continue}f(g,m[6]);}}B=m.index+ee.length;}for(B<O.length&&z(I(O.substr(B))),v=P.length-1;v>=0;v--)(g=P[v]).valid&&s(g.name);};return {parse:function(e,t){void 0===t&&(t="html"),d(function(e){for(var t,n=/data:[^;]+;base64,([a-z0-9\+\/=\s]+)/gi,r=[],o={},i=Wu("img"),a=0,u=0;t=n.exec(e);){var c=t[0],s=i+"_"+u++;o[s]=c,a<t.index&&r.push(e.substr(a,t.index-a)),r.push(s),a=t.index+c.length;}var f=new RegExp(i+"_[0-9]+","g");return 0===a?{prefix:i,uris:o,html:e,re:f}:(a<e.length&&r.push(e.substr(a)),{prefix:i,uris:o,html:r.join(""),re:f})}(e),t);}}};$m.findEndTag=jm;var Wm=function(e,t){for(var n,r=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,o=e.schema,i=function(e,t){var n=new RegExp(["\\s?("+e.join("|")+')="[^"]+"'].join("|"),"gi");return t.replace(n,"")}(e.getTempAttrs(),t),a=o.getShortEndedElements();n=r.exec(i);){var u=r.lastIndex,c=n[0].length,s=void 0;s=a[n[1]]?u:$m.findEndTag(o,i,u),i=i.substring(0,u-c)+i.substring(s),r.lastIndex=u-c;}return wo(i)},Km=Wm,Xm=function(e,t,n,r){var o,i=function(e,t){return Re(Re({},e),{format:t,get:!0,getInner:!0})}(t,n),a=t.no_events?i:e.fire("BeforeGetContent",i);return o="raw"===a.format?_t.trim(Km(e.serializer,r.innerHTML)):"text"===a.format?e.dom.isEmpty(r)?"":wo(r.innerText||r.textContent):"tree"===a.format?e.serializer.serialize(r,a):function(e,t){var n=ts(e),r=new RegExp("^(<"+n+"[^>]*>(&nbsp;|&#160;|\\s| |<br \\/>|)<\\/"+n+">[\r\n]*|<br \\/>[\r\n]*)$");return t.replace(r,"")}(e,e.serializer.serialize(r,a)),H(["text","tree"],a.format)||bo(Rt.fromDom(r))?a.content=o:a.content=_t.trim(o),a.no_events?a.content:e.fire("GetContent",a).content},Ym=_t.each,Gm=function(e){return {compare:function(t,n){if(t.nodeName!==n.nodeName)return !1;var r=function(t){var n={};return Ym(e.getAttribs(t),(function(r){var o=r.nodeName.toLowerCase();0!==o.indexOf("_")&&"style"!==o&&0!==o.indexOf("data-")&&(n[o]=e.getAttrib(t,o));})),n},o=function(e,t){var n,r;for(r in e)if(ye(e,r)){if(void 0===(n=t[r]))return !1;if(e[r]!==n)return !1;delete t[r];}for(r in t)if(ye(t,r))return !1;return !0};return !!o(r(t),r(n))&&(!!o(e.parseStyle(e.getAttrib(t,"style")),e.parseStyle(e.getAttrib(n,"style")))&&(!Gf(t)&&!Gf(n)))}}},Jm=_t.makeMap,Qm=function(e){var t=[],n=(e=e||{}).indent,r=Jm(e.indent_before||""),o=Jm(e.indent_after||""),i=bi.getEncodeFunc(e.entity_encoding||"raw",e.entities),a="html"===e.element_format;return {start:function(e,u,c){var s,f,l,d;if(n&&r[e]&&t.length>0&&(d=t[t.length-1]).length>0&&"\n"!==d&&t.push("\n"),t.push("<",e),u)for(s=0,f=u.length;s<f;s++)l=u[s],t.push(" ",l.name,'="',i(l.value,!0),'"');t[t.length]=!c||a?">":" />",c&&n&&o[e]&&t.length>0&&(d=t[t.length-1]).length>0&&"\n"!==d&&t.push("\n");},end:function(e){var r;t.push("</",e,">"),n&&o[e]&&t.length>0&&(r=t[t.length-1]).length>0&&"\n"!==r&&t.push("\n");},text:function(e,n){e.length>0&&(t[t.length]=n?e:i(e));},cdata:function(e){t.push("<![CDATA[",e,"]]>");},comment:function(e){t.push("\x3c!--",e,"--\x3e");},pi:function(e,r){r?t.push("<?",e," ",i(r),"?>"):t.push("<?",e,"?>"),n&&t.push("\n");},doctype:function(e){t.push("<!DOCTYPE",e,">",n?"\n":"");},reset:function(){t.length=0;},getContent:function(){return t.join("").replace(/\n$/,"")}}},Zm=function(e,t){void 0===t&&(t=Ai());var n=Qm(e);(e=e||{}).validate=!("validate"in e)||e.validate;return {serialize:function(r){var o=e.validate,i={3:function(e){n.text(e.value,e.raw);},8:function(e){n.comment(e.value);},7:function(e){n.pi(e.name,e.value);},10:function(e){n.doctype(e.value);},4:function(e){n.cdata(e.value);},11:function(e){if(e=e.firstChild)do{a(e);}while(e=e.next)}};n.reset();var a=function(e){var r=i[e.type];if(r)r(e);else {var u=e.name,c=e.shortEnded,s=e.attributes;if(o&&s&&s.length>1){var f=[];f.map={};var l=t.getElementRule(e.name);if(l){for(var d=0,m=l.attributesOrder.length;d<m;d++){if((p=l.attributesOrder[d])in s.map){var g=s.map[p];f.map[p]=g,f.push({name:p,value:g});}}for(d=0,m=s.length;d<m;d++){var p;if(!((p=s[d].name)in f.map)){g=s.map[p];f.map[p]=g,f.push({name:p,value:g});}}s=f;}}if(n.start(e.name,s,c),!c){if(e=e.firstChild)do{a(e);}while(e=e.next);n.end(u);}}};return 1!==r.type||e.inner?i[11](r):a(r),n.getContent()}}},eg=new Set;q(["margin","margin-left","margin-right","margin-top","margin-bottom","padding","padding-left","padding-right","padding-top","padding-bottom","border","border-width","border-style","border-color","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","float","position","left","right","top","bottom","z-index","display","transform","width","max-width","min-width","height","max-height","min-height","overflow","overflow-x","overflow-y","text-overflow","vertical-align","transition","transition-delay","transition-duration","transition-property","transition-timing-function"],(function(e){eg.add(e);}));var tg=["font","text-decoration","text-emphasis"],ng=function(e,t){return se(e.parseStyle(e.getAttrib(t,"style")))},rg=function(e,t){return ee(ng(e,t),(function(e){return !function(e){return eg.has(e)}(e)}))},og=function(e,t,n){var r=ng(e,t),o=ng(e,n),i=function(r){var o=e.getStyle(t,r),i=e.getStyle(n,r);return je(o)&&je(i)&&o!==i};return j(r,(function(e){var t=function(t){return j(t,(function(t){return t===e}))};if(!t(o)&&t(tg)){var n=K(o,(function(e){return j(tg,(function(t){return Me(e,t)}))}));return j(n,i)}return i(e)}))},ig=function(e,t,n){return I.from(n.container()).filter(Fn).exists((function(r){var o=e?0:-1;return t(r.data.charAt(n.offset()+o))}))},ag=_(ig,!0,Qf),ug=_(ig,!1,Qf),cg=function(e){var t=e.container();return Fn(t)&&(0===t.data.length||xo(t.data)&&Ql.isBookmarkNode(t.parentNode))},sg=function(e,t){return function(n){return I.from(ef(e?0:-1,n)).filter(t).isSome()}},fg=function(e){return Vn(e)&&"block"===or(Rt.fromDom(e),"display")},lg=function(e){return $n(e)&&!function(e){return Dn(e)&&"all"===e.getAttribute("data-mce-bogus")}(e)},dg=sg(!0,fg),mg=sg(!1,fg),gg=sg(!0,Kn),pg=sg(!1,Kn),hg=sg(!0,Ln),vg=sg(!1,Ln),bg=sg(!0,lg),yg=sg(!1,lg),Cg=function(e){var t=Mu(e,"br"),n=K(function(e){for(var t=[],n=e.dom;n;)t.push(Rt.fromDom(n)),n=n.lastChild;return t}(e).slice(-1),lo);t.length===n.length&&q(n,hn);},xg=function(e){pn(e),mn(e,Rt.fromHtml('<br data-mce-bogus="1">'));},wg=function(e){en(e).each((function(t){Kt(t).each((function(n){so(e)&&lo(t)&&so(n)&&hn(t);}));}));},Sg=function(e,t,n){return Lt(t,e)?(r=function(e,t){for(var n=y(t)?t:T,r=e.dom,o=[];null!==r.parentNode&&void 0!==r.parentNode;){var i=r.parentNode,a=Rt.fromDom(i);if(o.push(a),!0===n(a))break;r=i;}return o}(e,(function(e){return n(e)||Bt(e,t)})),r.slice(0,-1)):[];var r;},kg=function(e,t){return Sg(e,t,T)},Ng=function(e,t){return [e].concat(kg(e,t))},Eg=function(e,t,n){return Tf(e,t,n,cg)},_g=function(e,t){return J(Ng(Rt.fromDom(t.container()),e),so)},Ag=function(e,t,n){return Eg(e,t.dom,n).forall((function(e){return _g(t,n).fold((function(){return !1===Zs(e,n,t.dom)}),(function(r){return !1===Zs(e,n,t.dom)&&Lt(r,Rt.fromDom(e.container()))}))}))},Rg=function(e,t,n){return _g(t,n).fold((function(){return Eg(e,t.dom,n).forall((function(e){return !1===Zs(e,n,t.dom)}))}),(function(t){return Eg(e,t.dom,n).isNone()}))},Dg=_(Rg,!1),Tg=_(Rg,!0),Og=_(Ag,!1),Bg=_(Ag,!0),Pg=function(e){return ff(e).exists(lo)},Lg=function(e,t,n){var r=K(Ng(Rt.fromDom(n.container()),t),so),o=ie(r).getOr(t);return Rf(e,o.dom,n).filter(Pg)},Ig=function(e,t){return ff(t).exists(lo)||Lg(!0,e,t).isSome()},Mg=function(e,t){return function(e){return I.from(e.getNode(!0)).map(Rt.fromDom)}(t).exists(lo)||Lg(!1,e,t).isSome()},Fg=_(Lg,!1),Ug=_(Lg,!0),zg=function(e){return Ac.isTextPosition(e)&&!e.isAtStart()&&!e.isAtEnd()},Hg=function(e,t){var n=K(Ng(Rt.fromDom(t.container()),e),so);return ie(n).getOr(e)},jg=function(e,t){return zg(t)?ug(t):ug(t)||Pf(Hg(e,t).dom,t).exists(ug)},Vg=function(e,t){return zg(t)?ag(t):ag(t)||Bf(Hg(e,t).dom,t).exists(ag)},qg=function(e){return ff(e).bind((function(e){return Xr(e,Ut)})).exists((function(e){return function(e){return H(["pre","pre-wrap"],e)}(or(e,"white-space"))}))},$g=function(e,t){return function(e,t){return Pf(e.dom,t).isNone()}(e,t)||function(e,t){return Bf(e.dom,t).isNone()}(e,t)||Dg(e,t)||Tg(e,t)||Mg(e,t)||Ig(e,t)},Wg=function(e,t){return !qg(t)&&(Dg(e,t)||Og(e,t)||Mg(e,t)||jg(e,t))},Kg=function(e,t){return !qg(t)&&(Tg(e,t)||Bg(e,t)||Ig(e,t)||Vg(e,t))},Xg=function(e,t){return Wg(e,t)||Kg(e,function(e){var t=e.container(),n=e.offset();return Fn(t)&&n<t.data.length?Ac(t,n+1):e}(t))},Yg=function(e,t){return Jf(e.charAt(t))},Gg=function(e){var t=e.container();return Fn(t)&&Ie(t.data,yo)},Jg=function(e){var t=e.data,n=function(e){var t=e.split("");return V(t,(function(e,n){return Jf(e)&&n>0&&n<t.length-1&&Zf(t[n-1])&&Zf(t[n+1])?" ":e})).join("")}(t);return n!==t&&(e.data=n,!0)},Qg=function(e,t){return I.some(t).filter(Gg).bind((function(t){var n=t.container(),r=function(e,t){var n=t.data,r=Ac(t,0);return !(!Yg(n,0)||Xg(e,r)||(t.data=" "+n.slice(1),0))}(e,n)||Jg(n)||function(e,t){var n=t.data,r=Ac(t,n.length-1);return !(!Yg(n,n.length-1)||Xg(e,r)||(t.data=n.slice(0,-1)+" ",0))}(e,n);return r?I.some(t):I.none()}))},Zg=function(e){var t=Rt.fromDom(e.getBody());e.selection.isCollapsed()&&Qg(t,Ac.fromRangeStart(e.selection.getRng())).each((function(t){e.selection.setRng(t.toRange());}));},ep=function(e,t,n){if(0!==n){var r=Rt.fromDom(e),o=Kr(r,so).getOr(r),i=e.data.slice(t,t+n),a=t+n>=e.data.length&&Kg(o,Ac(e,e.data.length)),u=0===t&&Wg(o,Ac(e,0));e.replaceData(t,n,function(e,t,n){return Y(e,(function(r,o){return Qf(o)||Jf(o)?r.previousCharIsSpace||""===r.str&&t||r.str.length===e.length-1&&n?{previousCharIsSpace:!1,str:r.str+yo}:{previousCharIsSpace:!0,str:r.str+" "}:{previousCharIsSpace:!1,str:r.str+o}}),{previousCharIsSpace:!1,str:""}).str}(i,u,a));}},tp=function(e,t){var n=e.data.slice(t),r=n.length-ze(n).length;ep(e,t,r);},np=function(e,t){var n=e.data.slice(0,t),r=n.length-He(n).length;ep(e,t-r,r);},rp=function(e,t,n,r){void 0===r&&(r=!0);var o=He(e.data).length,i=r?e:t,a=r?t:e;return r?i.appendData(a.data):i.insertData(0,a.data),hn(Rt.fromDom(a)),n&&tp(i,o),i},op=function(e,t){return function(e,t){var n=e.container(),r=e.offset();return !1===Ac.isTextPosition(e)&&n===t.parentNode&&r>Ac.before(t).offset()}(t,e)?Ac(t.container(),t.offset()-1):t},ip=function(e){return qo(e.previousSibling)?I.some((t=e.previousSibling,Fn(t)?Ac(t,t.data.length):Ac.after(t))):e.previousSibling?If(e.previousSibling):I.none();var t;},ap=function(e){return qo(e.nextSibling)?I.some((t=e.nextSibling,Fn(t)?Ac(t,0):Ac.before(t))):e.nextSibling?Lf(e.nextSibling):I.none();var t;},up=function(e,t){return ip(t).orThunk((function(){return ap(t)})).orThunk((function(){return function(e,t){var n=Ac.before(t.previousSibling?t.previousSibling:t.parentNode);return Pf(e,n).fold((function(){return Bf(e,Ac.after(t))}),I.some)}(e,t)}))},cp=function(e,t){return ap(t).orThunk((function(){return ip(t)})).orThunk((function(){return function(e,t){return Bf(e,Ac.after(t)).fold((function(){return Pf(e,Ac.before(t))}),I.some)}(e,t)}))},sp=function(e,t,n){return function(e,t,n){return e?cp(t,n):up(t,n)}(e,t,n).map(_(op,n))},fp=function(e,t,n){n.fold((function(){e.focus();}),(function(n){e.selection.setRng(n.toRange(),t);}));},lp=function(e,t){return t&&ye(e.schema.getBlockElements(),It(t))},dp=function(e){if(ei(e)){var t=Rt.fromHtml('<br data-mce-bogus="1">');return pn(e),mn(e,t),I.some(Ac.before(t.dom))}return I.none()},mp=function(e,t,n){var r,o,i,a,u=Kt(e).filter(zt),c=Xt(e).filter(zt);return hn(e),(r=u,o=c,i=t,a=function(e,t,r){var o=e.dom,i=t.dom,a=o.data.length;return rp(o,i,n),r.container()===i?Ac(o,a):r},r.isSome()&&o.isSome()&&i.isSome()?I.some(a(r.getOrDie(),o.getOrDie(),i.getOrDie())):I.none()).orThunk((function(){return n&&(u.each((function(e){return np(e.dom,e.dom.length)})),c.each((function(e){return tp(e.dom,0)}))),t}))},gp=function(e,t,n,r){void 0===r&&(r=!0);var o,i=sp(t,e.getBody(),n.dom),a=Kr(n,_(lp,e),(o=e.getBody(),function(e){return e.dom===o})),u=mp(n,i,function(e,t){return ye(e.schema.getTextInlineElements(),It(t))}(e,n));e.dom.isEmpty(e.getBody())?(e.setContent(""),e.selection.setCursorLocation()):a.bind(dp).fold((function(){r&&fp(e,t,u);}),(function(n){r&&fp(e,t,I.some(n));}));},pp=function(e){return Mu(e,"td,th")},hp=function(e,t){return {start:e,end:t}},vp=kr([{singleCellTable:["rng","cell"]},{fullTable:["table"]},{partialTable:["cells","outsideDetails"]},{multiTable:["startTableCells","endTableCells","betweenRng"]}]),bp=function(e,t){return Qr(Rt.fromDom(e),"td,th",t)},yp=function(e){return !Bt(e.start,e.end)},Cp=function(e,t){return Ml(e.start,t).bind((function(n){return Ml(e.end,t).bind((function(e){return t=Bt(n,e),r=n,t?I.some(r):I.none();var t,r;}))}))},xp=function(e){return function(t){return Cp(t,e).map((function(e){return function(e,t,n){return {rng:e,table:t,cells:n}}(t,e,pp(e))}))}},wp=function(e,t,n,r){if(n.collapsed||!e.forall(yp))return I.none();if(t.isSameTable){var o=e.bind(xp(r));return I.some({start:o,end:o})}var i=bp(n.startContainer,r),a=bp(n.endContainer,r),u=i.bind(function(e){return function(t){return Ml(t,e).bind((function(e){return ae(pp(e)).map((function(e){return hp(t,e)}))}))}}(r)).bind(xp(r)),c=a.bind(function(e){return function(t){return Ml(t,e).bind((function(e){return ie(pp(e)).map((function(e){return hp(e,t)}))}))}}(r)).bind(xp(r));return I.some({start:u,end:c})},Sp=function(e,t){return Q(e,(function(e){return Bt(e,t)}))},kp=function(e){return Yn(Sp(e.cells,e.rng.start),Sp(e.cells,e.rng.end),(function(t,n){return e.cells.slice(t,n+1)}))},Np=function(e,t,n){return e.exists((function(e){return function(e,t){return !yp(e)&&Cp(e,t).exists((function(e){var t=e.dom.rows;return 1===t.length&&1===t[0].cells.length}))}(e,n)&&zl(e.start,t)}))},Ep=function(e,t){var n=t.startTable,r=t.endTable,o=e.cloneRange();return n.each((function(e){return o.setStartAfter(e.dom)})),r.each((function(e){return o.setEndBefore(e.dom)})),o},_p=function(e,t){var n=function(e){return function(t){return Bt(e,t)}}(e),r=function(e,t){var n=bp(e.startContainer,t),r=bp(e.endContainer,t);return Yn(n,r,hp)}(t,n),o=function(e,t){var n=function(e){return Ml(Rt.fromDom(e),t)},r=n(e.startContainer),o=n(e.endContainer),i=r.isSome(),a=o.isSome(),u=Yn(r,o,Bt).getOr(!1);return {startTable:r,endTable:o,isStartInTable:i,isEndInTable:a,isSameTable:u,isMultiTable:!u&&i&&a}}(t,n);return Np(r,t,n)?r.map((function(e){return vp.singleCellTable(t,e.start)})):o.isMultiTable?function(e,t,n,r){return wp(e,t,n,r).bind((function(e){var r=e.start,o=e.end,i=r.bind(kp).getOr([]),a=o.bind(kp).getOr([]);if(i.length>0&&a.length>0){var u=Ep(n,t);return I.some(vp.multiTable(i,a,u))}return I.none()}))}(r,o,t,n):function(e,t,n,r){return wp(e,t,n,r).bind((function(e){var t=e.start,n=e.end;return t.or(n)})).bind((function(e){var r=t.isSameTable,o=kp(e).getOr([]);if(r&&e.cells.length===o.length)return I.some(vp.fullTable(e.table));if(o.length>0){if(r)return I.some(vp.partialTable(o,I.none()));var i=Ep(n,t);return I.some(vp.partialTable(o,I.some(Re(Re({},t),{rng:i}))))}return I.none()}))}(r,o,t,n)},Ap=function(e){var t;return (8===Mt(t=e)||"#comment"===It(t)?Kt(e):en(e)).bind(Ap).orThunk((function(){return I.some(e)}))},Rp=function(e){return q(e,(function(e){nr(e,"contenteditable"),xg(e);}))},Dp=function(e,t,n,r){var o=n.cloneRange();r?(o.setStart(n.startContainer,n.startOffset),o.setEndAfter(t.dom.lastChild)):(o.setStartBefore(t.dom.firstChild),o.setEnd(n.endContainer,n.endOffset)),Pp(e,o,t,!1);},Tp=function(e){var t=Il(e),n=Rt.fromDom(e.selection.getNode());Wn(n.dom)&&ei(n)?e.selection.setCursorLocation(n.dom,0):e.selection.collapse(!0),t.length>1&&j(t,(function(e){return Bt(e,n)}))&&Qn(n,"data-mce-selected","1");},Op=function(e,t,n){var r=e.selection.getRng(),o=n.bind((function(n){var o=n.rng,i=n.isStartInTable,a=function(e,t){return I.from(e.dom.getParent(t,e.dom.isBlock)).map(Rt.fromDom)}(e,i?o.endContainer:o.startContainer);o.deleteContents(),function(e,t,n){n.each((function(n){t?hn(n):(xg(n),e.selection.setCursorLocation(n.dom,0));}));}(e,i,a.filter(ei));var u=i?t[0]:t[t.length-1];return Dp(e,u,r,i),ei(u)?I.none():I.some(i?t.slice(1):t.slice(0,-1))})).getOr(t);return Rp(o),Tp(e),!0},Bp=function(e,t,n,r){var o=e.selection.getRng(),i=t[0],a=n[n.length-1];Dp(e,i,o,!0),Dp(e,a,o,!1);var u=ei(i)?t:t.slice(1),c=ei(a)?n:n.slice(0,-1);return Rp(u.concat(c)),r.deleteContents(),Tp(e),!0},Pp=function(e,t,n,r){void 0===r&&(r=!0),t.deleteContents();var o,i=Ap(n).getOr(n),a=Rt.fromDom(e.dom.getParent(i.dom,e.dom.isBlock));if(ei(a)&&(xg(a),r&&e.selection.setCursorLocation(a.dom,0)),!Bt(n,a)){var u=Xn(Wt(a),n)?[]:Wt(o=a).map(Jt).map((function(e){return K(e,(function(e){return !Bt(o,e)}))})).getOr([]);q(u.concat(Jt(n)),(function(e){Bt(e,a)||Lt(e,a)||!ei(e)||hn(e);}));}return !0},Lp=function(e,t){return gp(e,!1,t),!0},Ip=function(e,t,n,r){return Fp(t,r).fold((function(){return function(e,t,n){return _p(t,n).map((function(t){return t.fold(_(Pp,e),_(Lp,e),_(Op,e),_(Bp,e))}))}(e,t,n)}),(function(t){return function(e,t){return Up(e,t)}(e,t)})).getOr(!1)},Mp=function(e,t){return J(Ng(t,e),vo)},Fp=function(e,t){return J(Ng(t,e),(n="caption",function(e){return Ut(e)&&It(e)===n}));var n;},Up=function(e,t){return xg(t),e.selection.setCursorLocation(t.dom,0),I.some(!0)},zp=function(e,t,n,r,o){return Df(n,e.getBody(),o).bind((function(i){return function(e,t,n,r){return Lf(e.dom).bind((function(o){return If(e.dom).map((function(e){return t?n.isEqual(o)&&r.isEqual(e):n.isEqual(e)&&r.isEqual(o)}))})).getOr(!0)}(r,n,o,i)?function(e,t){return Up(e,t)}(e,r):function(e,t,n){return Fp(e,Rt.fromDom(n.getNode())).map((function(e){return !1===Bt(e,t)}))}(t,r,i)})).or(I.some(!0))},Hp=function(e,t,n,r){var o=Ac.fromRangeStart(e.selection.getRng());return Mp(n,r).bind((function(r){return ei(r)?Up(e,r):function(e,t,n,r,o){return Df(n,e.getBody(),o).bind((function(e){return Mp(t,Rt.fromDom(e.getNode())).map((function(e){return !1===Bt(e,r)}))}))}(e,n,t,r,o)})).getOr(!1)},jp=function(e,t){return e?hg(t):vg(t)},Vp=function(e,t,n){var r=Rt.fromDom(e.getBody());return Fp(r,n).fold((function(){return Hp(e,t,r,n)||function(e,t){var n=Ac.fromRangeStart(e.selection.getRng());return jp(t,n)||Rf(t,e.getBody(),n).exists((function(e){return jp(t,e)}))}(e,t)}),(function(n){return function(e,t,n,r){var o=Ac.fromRangeStart(e.selection.getRng());return ei(r)?Up(e,r):zp(e,n,t,r,o)}(e,t,r,n).getOr(!1)}))},qp=function(e,t){var n=Rt.fromDom(e.selection.getStart(!0)),r=Il(e);return e.selection.isCollapsed()&&0===r.length?Vp(e,t,n):function(e,t,n){var r=Rt.fromDom(e.getBody()),o=e.selection.getRng();return 0!==n.length?Op(e,n,I.none()):Ip(e,r,o,t)}(e,n,r)},$p=function(e){var t=Ac.fromRangeStart(e),n=Ac.fromRangeEnd(e),r=e.commonAncestorContainer;return Rf(!1,r,n).map((function(o){return !Zs(t,n,r)&&Zs(t,o,r)?function(e,t,n,r){var o=document.createRange();return o.setStart(e,t),o.setEnd(n,r),o}(t.container(),t.offset(),o.container(),o.offset()):e})).getOr(e)},Wp=function(e){return e.collapsed?e:$p(e)},Kp=function(e,t){return e.getBlockElements()[t.name]&&function(e){return e.firstChild&&e.firstChild===e.lastChild}(t)&&function(e){return "br"===e.name||e.value===yo}(t.firstChild)},Xp=function(e,t){var n=t.firstChild,r=t.lastChild;return n&&"meta"===n.name&&(n=n.next),r&&"mce_marker"===r.attr("id")&&(r=r.prev),function(e,t){var n=e.getNonEmptyElements();return t&&(t.isEmpty(n)||Kp(e,t))}(e,r)&&(r=r.prev),!(!n||n!==r)&&("ul"===n.name||"ol"===n.name)},Yp=function(e){return e&&e.firstChild&&e.firstChild===e.lastChild&&function(e){return e.data===yo||jn(e)}(e.firstChild)},Gp=function(e){return e.length>0&&(!(t=e[e.length-1]).firstChild||Yp(t))?e.slice(0,-1):e;var t;},Jp=function(e,t){var n=e.getParent(t,e.isBlock);return n&&"LI"===n.nodeName?n:null},Qp=function(e,t){var n=Ac.after(e),r=kf(t).prev(n);return r?r.toRange():null},Zp=function(e,t,n){var r=e.parentNode;return _t.each(t,(function(t){r.insertBefore(t,e);})),function(e,t){var n=Ac.before(e),r=kf(t).next(n);return r?r.toRange():null}(e,n)},eh=function(e,t,n,r){var o,i=function(e,t,n){var r=t.serialize(n);return function(e){var t=e.firstChild,n=e.lastChild;return t&&"META"===t.nodeName&&t.parentNode.removeChild(t),n&&"mce_marker"===n.id&&n.parentNode.removeChild(n),e}(e.createFragment(r))}(t,e,r),a=Jp(t,n.startContainer),u=Gp((o=i.firstChild,K(o.childNodes,(function(e){return "LI"===e.nodeName})))),c=t.getRoot(),s=function(e){var r=Ac.fromRangeStart(n),o=kf(t.getRoot()),i=1===e?o.prev(r):o.next(r);return !i||Jp(t,i.getNode())!==a};return s(1)?Zp(a,u,c):s(2)?function(e,t,n,r){return r.insertAfter(t.reverse(),e),Qp(t[0],n)}(a,u,c,t):function(e,t,n,r){var o=function(e,t){var n=t.cloneRange(),r=t.cloneRange();return n.setStartBefore(e),r.setEndAfter(e),[n.cloneContents(),r.cloneContents()]}(e,r),i=e.parentNode;return i.insertBefore(o[0],e),_t.each(t,(function(t){i.insertBefore(t,e);})),i.insertBefore(o[1],e),i.removeChild(e),Qp(t[t.length-1],n)}(a,u,c,n)},th=Wn,nh=function(e){var t=e.dom,n=Wp(e.selection.getRng());e.selection.setRng(n);var r=t.getParent(n.startContainer,th);!function(e,t,n){return null!==n&&n===e.getParent(t.endContainer,th)&&zl(Rt.fromDom(n),t)}(t,n,r)?e.getDoc().execCommand("Delete",!1,null):Pp(e,n,Rt.fromDom(r));},rh=function(e,t,n){var r,o,i,a=e.selection,u=e.dom;/^ | $/.test(t)&&(t=function(e,t,n){var r=Rt.fromDom(e.getRoot());return n=Wg(r,Ac.fromRangeStart(t))?n.replace(/^ /,"&nbsp;"):n.replace(/^&nbsp;/," "),Kg(r,Ac.fromRangeEnd(t))?n.replace(/(&nbsp;| )(<br( \/)>)?$/,"&nbsp;"):n.replace(/&nbsp;(<br( \/)?>)?$/," ")}(u,a.getRng(),t));var c=e.parser,s=n.merge,f=Zm({validate:bs(e)},e.schema),l='<span id="mce_marker" data-mce-type="bookmark">&#xFEFF;</span>',d=e.fire("BeforeSetContent",{content:t,format:"html",selection:!0,paste:n.paste});if(d.isDefaultPrevented())e.fire("SetContent",{content:d.content,format:"html",selection:!0,paste:n.paste});else {-1===(t=d.content).indexOf("{$caret}")&&(t+="{$caret}"),t=t.replace(/\{\$caret\}/,l);var m=(o=a.getRng()).startContainer||(o.parentElement?o.parentElement():null),g=e.getBody();m===g&&a.isCollapsed()&&u.isBlock(g.firstChild)&&function(e,t){return t&&!e.schema.getShortEndedElements()[t.nodeName]}(e,g.firstChild)&&u.isEmpty(g.firstChild)&&((o=u.createRng()).setStart(g.firstChild,0),o.setEnd(g.firstChild,0),a.setRng(o)),a.isCollapsed()||nh(e);var p,h={context:(r=a.getNode()).nodeName.toLowerCase(),data:n.data,insert:!0},v=c.parse(t,h);if(!0===n.paste&&Xp(e.schema,v)&&function(e,t){return !!Jp(e,t)}(u,r))return o=eh(f,u,a.getRng(),v),a.setRng(o),void e.fire("SetContent",d);if(function(e){for(var t=e;t=t.walk();)1===t.type&&t.attr("data-mce-fragment","1");}(v),"mce_marker"===(i=v.lastChild).attr("id")){var y=i;for(i=i.prev;i;i=i.walk(!0))if(3===i.type||!u.isBlock(i.name)){e.schema.isValidChild(i.parent.name,"span")&&i.parent.insert(y,i,"br"===i.name);break}}if(e._selectionOverrides.showBlockCaretContainer(r),h.invalid){e.selection.setContent(l),r=a.getNode();var C=e.getBody();for(9===r.nodeType?r=i=C:i=r;i!==C;)r=i,i=i.parentNode;t=r===C?C.innerHTML:u.getOuterHTML(r),t=f.serialize(c.parse(t.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,(function(){return f.serialize(v)})))),r===C?u.setHTML(C,t):u.setOuterHTML(r,t);}else !function(e,t,n){if("all"===n.getAttribute("data-mce-bogus"))n.parentNode.insertBefore(e.dom.createFragment(t),n);else {var r=n.firstChild,o=n.lastChild;!r||r===o&&"BR"===r.nodeName?e.dom.setHTML(n,t):e.selection.setContent(t);}}(e,t=f.serialize(v),r);!function(e,t){var n=e.schema.getTextInlineElements(),r=e.dom;if(t){var o=e.getBody(),i=Gm(r);_t.each(r.select("*[data-mce-fragment]"),(function(e){if(b(n[e.nodeName.toLowerCase()])&&rg(r,e))for(var t=e.parentNode;b(t)&&t!==o&&!og(r,e,t);t=t.parentNode)if(i.compare(t,e)){r.remove(e,!0);break}}));}}(e,s),function(e,t){var n,r=e.dom,o=e.selection;if(t){o.scrollIntoView(t);var i=Zl(e.getBody(),t);if("false"===r.getContentEditable(i))return r.remove(t),void o.select(i);var a=r.createRng(),u=t.previousSibling;if(Fn(u)){if(a.setStart(u,u.nodeValue.length),!wt.ie){var c=t.nextSibling;Fn(c)&&(u.appendData(c.data),c.parentNode.removeChild(c));}}else a.setStartBefore(t),a.setEndBefore(t);var s=r.getParent(t,r.isBlock);r.remove(t),s&&r.isEmpty(s)&&(e.$(s).empty(),a.setStart(s,0),a.setEnd(s,0),th(s)||function(e){return !!e.getAttribute("data-mce-fragment")}(s)||!(n=function(t){var n=Ac.fromRangeStart(t);if(n=kf(e.getBody()).next(n))return n.toRange()}(a))?r.add(s,r.create("br",{"data-mce-bogus":"1"})):(a=n,r.remove(s))),o.setRng(a);}}(e,u.get("mce_marker")),p=e.getBody(),_t.each(p.getElementsByTagName("*"),(function(e){e.removeAttribute("data-mce-fragment");})),function(e,t){I.from(e.getParent(t,"td,th")).map(Rt.fromDom).each(wg);}(u,a.getStart()),e.fire("SetContent",d),e.addVisual();}},oh=function(e,t){t(e),e.firstChild&&oh(e.firstChild,t),e.next&&oh(e.next,t);},ih=function(e,t,n){var r=function(e,t,n){var r={},o={},i=[];for(var a in n.firstChild&&oh(n.firstChild,(function(n){q(e,(function(e){e.name===n.name&&(r[e.name]?r[e.name].nodes.push(n):r[e.name]={filter:e,nodes:[n]});})),q(t,(function(e){"string"==typeof n.attr(e.name)&&(o[e.name]?o[e.name].nodes.push(n):o[e.name]={filter:e,nodes:[n]});}));})),r)ye(r,a)&&i.push(r[a]);for(var u in o)ye(o,u)&&i.push(o[u]);return i}(e,t,n);q(r,(function(e){q(e.filter.callbacks,(function(t){t(e.nodes,e.filter.name,{});}));}));},ah=function(e){return e instanceof Om},uh=function(e,t,n){e.dom.setHTML(e.getBody(),t),!0!==n&&function(e){ym(e)&&Lf(e.getBody()).each((function(t){var n=t.getNode(),r=Ln(n)?Lf(n).getOr(t):t;e.selection.setRng(r.toRange());}));}(e);},ch=function(e,t,n){var r=function(e,t){return Re(Re({format:"html"},e),{set:!0,content:ah(t)?"":t})}(n,t),o=n.no_events?r:e.fire("BeforeSetContent",r);return ah(t)||(t=o.content),I.from(e.getBody()).fold(k(t),(function(n){return ah(t)?function(e,t,n,r){ih(e.parser.getNodeFilters(),e.parser.getAttributeFilters(),n);var o=Zm({validate:e.validate},e.schema).serialize(n);return r.content=bo(Rt.fromDom(t))?o:_t.trim(o),uh(e,r.content,r.no_selection),r.no_events||e.fire("SetContent",r),n}(e,n,t,o):function(e,t,n,r){if(0===n.length||/^\s+$/.test(n)){var o='<br data-mce-bogus="1">';"TABLE"===t.nodeName?n="<tr><td>"+o+"</td></tr>":/^(UL|OL)$/.test(t.nodeName)&&(n="<li>"+o+"</li>");var i=ts(e);i&&e.schema.isValidChild(t.nodeName.toLowerCase(),i.toLowerCase())?(n=o,n=e.dom.createHTML(i,ns(e),n)):n||(n='<br data-mce-bogus="1">'),uh(e,n,r.no_selection),e.fire("SetContent",r);}else "raw"!==r.format&&(n=Zm({validate:e.validate},e.schema).serialize(e.parser.parse(n,{isRootContent:!0,insert:!0}))),r.content=bo(Rt.fromDom(t))?n:_t.trim(n),uh(e,r.content,r.no_selection),r.no_events||e.fire("SetContent",r);return r.content}(e,n,t,o)}))},sh=function(e,t){return function(e,t){var n=e.dom;return n.parentNode?Yr(Rt.fromDom(n.parentNode),(function(n){return !Bt(e,n)&&t(n)})):I.none()}(e,t).isSome()},fh=function(e){return y(e)?e:T},lh=function(e,t,n){var r=t(e),o=fh(n);return r.orThunk((function(){return o(e)?I.none():function(e,t,n){for(var r=e.dom,o=fh(n);r.parentNode;){r=r.parentNode;var i=Rt.fromDom(r),a=t(i);if(a.isSome())return a;if(o(i))break}return I.none()}(e,t,o)}))},dh=ul,mh=function(e,t,n){var r=e.formatter.get(n);if(r)for(var o=0;o<r.length;o++){var i=r[o];if(gl(i)&&!1===i.inherit&&e.dom.is(t,i.selector))return !0}return !1},gh=function(e,t,n,r,o){var i=e.dom.getRoot();return t!==i&&(t=e.dom.getParent(t,(function(t){return !!mh(e,t,n)||(t.parentNode===i||!!vh(e,t,n,r,!0))})),!!vh(e,t,n,r,o))},ph=function(e,t,n){return !!dh(t,n.inline)||(!!dh(t,n.block)||(n.selector?1===t.nodeType&&e.is(t,n.selector):void 0))},hh=function(e,t,n,r,o,i){var a=n[r];if(y(n.onmatch))return n.onmatch(t,n,r);if(a)if(h(a.length)){for(var u in a)if(ye(a,u)){var c="attributes"===r?e.getAttrib(t,u):sl(e,t,u),s=al(a[u],i),f=v(c)||Ve(c);if(f&&v(s))continue;if(o&&f&&!n.exact)return !1;if((!o||n.exact)&&!dh(c,cl(e,s,u)))return !1}}else for(var l=0;l<a.length;l++)if("attributes"===r?e.getAttrib(t,a[l]):sl(e,t,a[l]))return !0;return !0},vh=function(e,t,n,r,o){var i=e.formatter.get(n),a=e.dom;if(i&&t)for(var u=0;u<i.length;u++){var c=i[u];if(ph(e.dom,t,c)&&hh(a,t,c,"attributes",o,r)&&hh(a,t,c,"styles",o,r)){var s=c.classes;if(s)for(var f=0;f<s.length;f++)if(!e.dom.hasClass(t,al(s[f],r)))return;return c}}},bh=function(e,t,n,r,o){if(r)return gh(e,r,t,n,o);if(r=e.selection.getNode(),gh(e,r,t,n,o))return !0;var i=e.selection.getStart();return !(i===r||!gh(e,i,t,n,o))},yh=function(e,t){var n=function(t){return Bt(t,Rt.fromDom(e.getBody()))};return I.from(e.selection.getStart(!0)).bind((function(r){return lh(Rt.fromDom(r),(function(n){return ce(t,(function(t){return function(t,n){return vh(e,t.dom,n)?I.some(n):I.none()}(n,t)}))}),n)})).getOrNull()},Ch=function(e,t,n){return Y(n,(function(n,r){var o=function(e,t){return j(e.formatter.get(t),(function(e){var t=function(e){return e.length>1&&"%"===e.charAt(0)};return j(["styles","attributes"],(function(n){return be(e,n).exists((function(e){var n=m(e)?e:ve(e);return j(n,t)}))}))}))}(e,r);return e.formatter.matchNode(t,r,{},o)?n.concat([r]):n}),[])},xh=Co,wh="_mce_caret",Sh=function(e){return function(e){for(var t=[];e;){if(3===e.nodeType&&e.nodeValue!==xh||e.childNodes.length>1)return [];1===e.nodeType&&t.push(e),e=e.firstChild;}return t}(e).length>0},kh=function(e){if(e){var t=new ao(e,e);for(e=t.current();e;e=t.next())if(Fn(e))return e}return null},Nh=function(e){var t=Rt.fromTag("span");return Zn(t,{id:wh,"data-mce-bogus":"1","data-mce-type":"format-caret"}),e&&mn(t,Rt.fromText(xh)),t},Eh=function(e,t,n){void 0===n&&(n=!0);var r=e.dom,o=e.selection;if(Sh(t))gp(e,!1,Rt.fromDom(t),n);else {var i=o.getRng(),a=r.getParent(t,r.isBlock),u=i.startContainer,c=i.startOffset,s=i.endContainer,f=i.endOffset,l=function(e){var t=kh(e);return t&&t.nodeValue.charAt(0)===xh&&t.deleteData(0,1),t}(t);r.remove(t,!0),u===l&&c>0&&i.setStart(l,c-1),s===l&&f>0&&i.setEnd(l,f-1),a&&r.isEmpty(a)&&xg(Rt.fromDom(a)),o.setRng(i);}},_h=function(e,t,n){void 0===n&&(n=!0);var r=e.dom,o=e.selection;if(t)Eh(e,t,n);else if(!(t=Uf(e.getBody(),o.getStart())))for(;t=r.get(wh);)Eh(e,t,!1);},Ah=function(e,t){return e.appendChild(t),t},Rh=function(e,t){var n=X(e,(function(e,t){return Ah(e,t.cloneNode(!1))}),t);return Ah(n,n.ownerDocument.createTextNode(xh))},Dh=function(e,t,n,r){var o,i,a,u=e.dom,c=e.selection,s=[],f=c.getRng(),l=f.startContainer,d=f.startOffset;for(i=l,3===l.nodeType&&(d!==l.nodeValue.length&&(o=!0),i=i.parentNode);i;){if(vh(e,i,t,n,r)){a=i;break}i.nextSibling&&(o=!0),s.push(i),i=i.parentNode;}if(a)if(o){var m=c.getBookmark();f.collapse(!0);var g=Tl(e,f,e.formatter.get(t),!0);g=Cd(g),e.formatter.remove(t,n,g,r),c.moveToBookmark(m);}else {var p=Uf(e.getBody(),a),h=Nh(!1).dom;!function(e,t,n){var r=e.dom,o=r.getParent(n,_(rl,e));o&&r.isEmpty(o)?n.parentNode.replaceChild(t,n):(Cg(Rt.fromDom(n)),r.isEmpty(n)?n.parentNode.replaceChild(t,n):r.insertAfter(t,n));}(e,h,null!==p?p:a);var v=function(e,t,n,r,o,i){var a=e.formatter,u=e.dom,c=K(se(a.get()),(function(e){return e!==r&&!Ie(e,"removeformat")})),s=Ch(e,n,c);if(K(s,(function(t){return !dl(e,t,r)})).length>0){var f=n.cloneNode(!1);return u.add(t,f),a.remove(r,o,f,i),u.remove(f),I.some(f)}return I.none()}(e,h,a,t,n,r),b=Rh(s.concat(v.toArray()),h);Eh(e,p,!1),c.setCursorLocation(b,1),u.isEmpty(a)&&u.remove(a);}},Th=function(e){e.on("mouseup keydown",(function(t){!function(e,t){var n=e.selection,r=e.getBody();_h(e,null,!1),8!==t&&46!==t||!n.isCollapsed()||n.getStart().innerHTML!==xh||_h(e,Uf(r,n.getStart())),37!==t&&39!==t||_h(e,Uf(r,n.getStart()));}(e,t.keyCode);}));},Oh=function(e,t){var n=e.schema.getTextInlineElements();return ye(n,It(t))&&!Ff(t.dom)&&!Pn(t.dom)},Bh={},Ph=ke,Lh=we;!function(e,t){Bh[e]||(Bh[e]=[]),Bh[e].push(t);}("pre",(function(e){var t,n=e.selection.getRng(),r=Tn(["pre"]);n.collapsed||(t=e.selection.getSelectedBlocks(),Lh(Ph(Ph(t,r),(function(e){return r(e.previousSibling)&&-1!==Ne(t,e.previousSibling)})),(function(e){var t,n;t=e.previousSibling,cu(n=e).remove(),cu(t).append("<br><br>").append(n.childNodes);})));}));var Ih=_t.each,Mh=function(e){return Dn(e)&&!Gf(e)&&!Ff(e)&&!Pn(e)},Fh=function(e,t){for(var n=e;n;n=n[t]){if(Fn(n)&&je(n.data))return e;if(Dn(n)&&!Gf(n))return n}return e},Uh=function(e,t,n){var r=Gm(e);if(t&&n&&(t=Fh(t,"previousSibling"),n=Fh(n,"nextSibling"),r.compare(t,n))){for(var o=t.nextSibling;o&&o!==n;){var i=o;o=o.nextSibling,t.appendChild(i);}return e.remove(n),_t.each(_t.grep(n.childNodes),(function(e){t.appendChild(e);})),t}return n},zh=function(e,t,n,r){if(r&&!1!==t.merge_siblings){var o=Uh(e,nl(r),r);Uh(e,o,nl(o,!0));}},Hh=function(e,t,n){Ih(e.childNodes,(function(e){Mh(e)&&(t(e)&&n(e),e.hasChildNodes()&&Hh(e,t,n));}));},jh=function(e,t){return function(n){return !(!n||!sl(e,n,t))}},Vh=function(e,t,n){return function(r){e.setStyle(r,t,n),""===r.getAttribute("style")&&r.removeAttribute("style"),function(e,t){"SPAN"===t.nodeName&&0===e.getAttribs(t).length&&e.remove(t,!0);}(e,r);}},qh=kr([{keep:[]},{rename:["name"]},{removed:[]}]),$h=/^(src|href|style)$/,Wh=_t.each,Kh=ul,Xh=function(e,t,n){return e.isChildOf(t,n)&&t!==n&&!e.isBlock(n)},Yh=function(e,t,n){var r=t[n?"startContainer":"endContainer"],o=t[n?"startOffset":"endOffset"];if(Dn(r)){var i=r.childNodes.length-1;!n&&o&&o--,r=r.childNodes[o>i?i:o];}return Fn(r)&&n&&o>=r.nodeValue.length&&(r=new ao(r,e.getBody()).next()||r),Fn(r)&&!n&&0===o&&(r=new ao(r,e.getBody()).prev()||r),r},Gh=function(e,t){var n=t?"firstChild":"lastChild";if(function(e){return /^(TR|TH|TD)$/.test(e.nodeName)}(e)&&e[n]){var r=e[n];return "TR"===e.nodeName&&r[n]||r}return e},Jh=function(e,t,n,r){var o=e.create(n,r);return t.parentNode.insertBefore(o,t),o.appendChild(t),o},Qh=function(e,t,n,r,o){var i=Rt.fromDom(t),a=Rt.fromDom(e.create(r,o)),u=n?Gt(i):Yt(i);return gn(a,u),n?(fn(i,a),dn(a,i)):(ln(i,a),mn(a,i)),a.dom},Zh=function(e,t,n,r){var o=nl(t,n,r);return v(o)||"BR"===o.nodeName||e.isBlock(o)},ev=function(e,t,n){var r,o=t.parentNode,i=e.dom,a=ts(e);ml(n)&&(a?o===i.getRoot()&&(n.list_block&&Kh(t,n.list_block)||q(ue(t.childNodes),(function(t){ol(e,a,t.nodeName.toLowerCase())?r?r.appendChild(t):(r=Jh(i,t,a),i.setAttribs(r,e.settings.forced_root_block_attrs)):r=null;}))):i.isBlock(t)&&!i.isBlock(o)&&(Zh(i,t,!1)||Zh(i,t.firstChild,!0,!0)||t.insertBefore(i.create("br"),t.firstChild),Zh(i,t,!0)||Zh(i,t.lastChild,!1,!0)||t.appendChild(i.create("br")))),function(e){return gl(e)&&pl(e)&&Xn(be(e,"mixed"),!0)}(n)&&!Kh(n.inline,t)||i.remove(t,!0);},tv=function(e,t,n,r,o){var i,a=e.dom;if(!function(e,t,n){return !(!pl(n)||!Kh(t,n.inline))||!(!ml(n)||!Kh(t,n.block))||(gl(n)?Dn(t)&&e.is(t,n.selector):void 0)}(a,r,t)&&!function(e,t){return t.links&&"A"===e.nodeName}(r,t))return qh.keep();var u=r;if(pl(t)&&"all"===t.remove&&m(t.preserve_attributes)){var c=K(a.getAttribs(u),(function(e){return H(t.preserve_attributes,e.name.toLowerCase())}));if(a.removeAllAttribs(u),q(c,(function(e){return a.setAttrib(u,e.name,e.value)})),c.length>0)return qh.rename("span")}if("all"!==t.remove){Wh(t.styles,(function(e,r){e=cl(a,al(e,n),r+""),C(r)&&(r=e,o=null),(t.remove_similar||!o||Kh(sl(a,o,r),e))&&a.setStyle(u,r,""),i=!0;})),i&&""===a.getAttrib(u,"style")&&(u.removeAttribute("style"),u.removeAttribute("data-mce-style")),Wh(t.attributes,(function(e,r){var i;if(e=al(e,n),C(r)&&(r=e,o=null),t.remove_similar||!o||Kh(a.getAttrib(o,r),e)){if("class"===r&&(e=a.getAttrib(u,r))&&(i="",q(e.split(/\s+/),(function(e){/mce\-\w+/.test(e)&&(i+=(i?" ":"")+e);})),i))return void a.setAttrib(u,r,i);if($h.test(r)&&u.removeAttribute("data-mce-"+r),"style"===r&&Tn(["li"])(u)&&"none"===a.getStyle(u,"list-style-type"))return u.removeAttribute(r),void a.setStyle(u,"list-style-type","none");"class"===r&&u.removeAttribute("className"),u.removeAttribute(r);}})),Wh(t.classes,(function(e){e=al(e,n),o&&!a.hasClass(o,e)||a.removeClass(u,e);}));for(var s=a.getAttribs(u),f=0;f<s.length;f++){var l=s[f].nodeName;if(0!==l.indexOf("_")&&0!==l.indexOf("data-"))return qh.keep()}}return "none"!==t.remove?(ev(e,u,t),qh.removed()):qh.keep()},nv=function(e,t,n,r,o){return tv(e,t,n,r,o).fold(T,(function(t){return e.dom.rename(r,t),!0}),O)},rv=function(e,t,n,r){return tv(e,t,n,r,r).fold(k(r),(function(t){return e.dom.createFragment().appendChild(r),e.dom.rename(r,t)}),k(null))},ov=function(e,t,n,r,o){var i=e.formatter.get(t),a=i[0],u=!0,c=e.dom,s=e.selection,f=function(r){var u=function(e,t,n,r,o){var i;return q(ll(e.dom,t.parentNode).reverse(),(function(t){if(!i&&"_start"!==t.id&&"_end"!==t.id){var a=vh(e,t,n,r,o);a&&!1!==a.split&&(i=t);}})),i}(e,r,t,n,o);return function(e,t,n,r,o,i,a,u){var c,s,f,l=e.dom;if(n){for(var d=n.parentNode,m=r.parentNode;m&&m!==d;m=m.parentNode){c=l.clone(m,!1);for(var g=0;g<t.length&&null!==(c=rv(e,t[g],u,c));g++);c&&(s&&c.appendChild(s),f||(f=c),s=c);}!i||a.mixed&&l.isBlock(n)||(r=l.split(n,r)),s&&(o.parentNode.insertBefore(s,o),f.appendChild(o),pl(a)&&zh(l,a,0,s));}return r}(e,i,u,r,r,!0,a,n)},l=function(t){return j(i,(function(r){return nv(e,r,n,t,t)}))},d=function(t){var n=!0,r=!1;Dn(t)&&c.getContentEditable(t)&&(n=u,u="true"===c.getContentEditable(t),r=!0);var o=ue(t.childNodes);if(u&&!r){var s=l(t)||j(i,(function(e){return ph(c,t,e)})),f=t.parentNode;!s&&b(f)&&hl(a)&&l(f);}if(a.deep&&o.length){for(var m=0;m<o.length;m++)d(o[m]);r&&(u=n);}q(["underline","line-through","overline"],(function(n){Dn(t)&&e.dom.getStyle(t,"text-decoration")===n&&t.parentNode&&fl(c,t.parentNode)===n&&nv(e,{deep:!1,exact:!0,inline:"span",styles:{textDecoration:n}},null,t);}));},m=function(e){var t=c.get(e?"_start":"_end"),n=t[e?"firstChild":"lastChild"];return function(e){return Gf(e)&&Dn(e)&&("_start"===e.id||"_end"===e.id)}(n)&&(n=n[e?"firstChild":"lastChild"]),Fn(n)&&0===n.data.length&&(n=e?t.previousSibling||t.nextSibling:t.nextSibling||t.previousSibling),c.remove(t,!0),n},g=function(t){var n,r,o=Tl(e,t,i,t.collapsed);if(a.split){if(o=Cd(o),(n=Yh(e,o,!0))!==(r=Yh(e,o))){if(n=Gh(n,!0),r=Gh(r,!1),Xh(c,n,r)){var u=I.from(n.firstChild).getOr(n);return f(Qh(c,u,!0,"span",{id:"_start","data-mce-type":"bookmark"})),void m(!0)}if(Xh(c,r,n)){u=I.from(r.lastChild).getOr(r);return f(Qh(c,u,!1,"span",{id:"_end","data-mce-type":"bookmark"})),void m(!1)}n=Jh(c,n,"span",{id:"_start","data-mce-type":"bookmark"}),r=Jh(c,r,"span",{id:"_end","data-mce-type":"bookmark"});var s=c.createRng();s.setStartAfter(n),s.setEndBefore(r),Ol(c,s,(function(e){q(e,(function(e){Gf(e)||Gf(e.parentNode)||f(e);}));})),f(n),f(r),n=m(!0),r=m();}else n=r=f(n);o.startContainer=n.parentNode?n.parentNode:n,o.startOffset=c.nodeIndex(n),o.endContainer=r.parentNode?r.parentNode:r,o.endOffset=c.nodeIndex(r)+1;}Ol(c,o,(function(e){q(e,d);}));};if(r){if(el(r)){var p=c.createRng();p.setStartBefore(r),p.setEndAfter(r),g(p);}else g(r);rd(e,t,r,n);}else if("false"!==c.getContentEditable(s.getNode()))s.isCollapsed()&&pl(a)&&!Il(e).length?Dh(e,t,n,o):(ql(s,!0,(function(){Vl(e,g);})),pl(a)&&bh(e,t,n,s.getStart())&&tl(c,s,s.getRng()),e.nodeChanged()),rd(e,t,r,n);else {r=s.getNode();for(var h=0;h<i.length&&(!i[h].ceFalseOverride||!nv(e,i[h],n,r,r));h++);rd(e,t,r,n);}},iv=_t.each,av=function(e,t,n,r){iv(t,(function(t){pl(t)&&iv(e.dom.select(t.inline,r),(function(r){Mh(r)&&nv(e,t,n,r,t.exact?r:null);})),function(e,t,n){if(t.clear_child_styles){var r=t.links?"*:not(a)":"*";Ih(e.select(r,n),(function(n){Mh(n)&&Ih(t.styles,(function(t,r){e.setStyle(n,r,"");}));}));}}(e.dom,t,r);}));},uv=_t.each,cv=function(e){return Dn(e)&&!Gf(e)&&!Ff(e)&&!Pn(e)},sv=function(e,t,n,r){var o=e.formatter.get(t),i=o[0],a=!r&&e.selection.isCollapsed(),u=e.dom,c=e.selection,s=function(e,t){if(void 0===t&&(t=i),y(t.onformat)&&t.onformat(e,t,n,r),uv(t.styles,(function(t,r){u.setStyle(e,r,al(t,n));})),t.styles){var o=u.getAttrib(e,"style");o&&u.setAttrib(e,"data-mce-style",o);}uv(t.attributes,(function(t,r){u.setAttrib(e,r,al(t,n));})),uv(t.classes,(function(t){t=al(t,n),u.hasClass(e,t)||u.addClass(e,t);}));},f=function(e,t){var n=!1;return uv(e,(function(e){return !!gl(e)&&(b(e.collapsed)&&e.collapsed!==a?void 0:u.is(t,e.selector)&&!Ff(t)?(s(t,e),n=!0,!1):void 0)})),n},d=function(e){if(l(e)){var t=u.create(e);return s(t),t}return null},m=function(r,a,u){var c=[],l=!0,m=i.inline||i.block,g=d(m);Ol(r,a,(function(a){var d,p=function(a){var h=!1,v=l,y=a.nodeName.toLowerCase(),C=a.parentNode,x=C.nodeName.toLowerCase();if(Dn(a)&&r.getContentEditable(a)&&(v=l,l="true"===r.getContentEditable(a),h=!0),jn(a)&&!function(e,t,n,r){if(function(e){return e.getParam("format_empty_lines",!1,"boolean")}(e)&&pl(t)){var o=Re(Re({},e.schema.getTextBlockElements()),{td:{},th:{},li:{},dt:{},dd:{},figcaption:{},caption:{},details:{},summary:{}}),i=sh(Rt.fromDom(n),(function(e){return Ff(e.dom)}));return Ce(o,r)&&ei(Rt.fromDom(n.parentNode),!1)&&!i}return !1}(e,i,a,x))return d=null,void(ml(i)&&r.remove(a));if(ml(i)&&i.wrapper&&vh(e,a,t,n))d=null;else {if(l&&!h&&ml(i)&&!i.wrapper&&rl(e,y)&&ol(e,x,m)){var w=r.rename(a,m);return s(w),c.push(w),void(d=null)}if(gl(i)){var S=f(o,a);if(!S&&b(C)&&hl(i)&&(S=f(o,C)),!pl(i)||S)return void(d=null)}!l||h||!ol(e,m,y)||!ol(e,x,m)||!u&&Fn(a)&&xo(a.data)||Ff(a)||pl(i)&&r.isBlock(a)?(d=null,q(ue(a.childNodes),p),h&&(l=v),d=null):(d||(d=r.clone(g,!1),a.parentNode.insertBefore(d,a),c.push(d)),d.appendChild(a));}};q(a,p);})),!0===i.links&&q(c,(function(e){var t=function(e){"A"===e.nodeName&&s(e,i),q(ue(e.childNodes),t);};t(e);})),q(c,(function(a){var u=function(e){var t=0;return q(e.childNodes,(function(e){(function(e){return b(e)&&Fn(e)&&0===e.length})(e)||Gf(e)||t++;})),t}(a);!(c.length>1)&&r.isBlock(a)||0!==u?(pl(i)||ml(i)&&i.wrapper)&&(i.exact||1!==u||(a=function(e){var t=J(e.childNodes,cv).filter((function(e){return ph(r,e,i)}));return t.map((function(t){var n=r.clone(t,!1);return s(n),r.replace(n,e,!0),r.remove(t,!0),n})).getOr(e)}(a)),av(e,o,n,a),function(e,t,n,r,o){vh(e,o.parentNode,n,r)&&nv(e,t,r,o)||t.merge_with_parents&&e.dom.getParent(o.parentNode,(function(i){if(vh(e,i,n,r))return nv(e,t,r,o),!0}));}(e,i,t,n,a),function(e,t,n,r){t.styles&&t.styles.backgroundColor&&Hh(r,jh(e,"fontSize"),Vh(e,"backgroundColor",al(t.styles.backgroundColor,n)));}(r,i,n,a),function(e,t,n,r){var o=function(t){if(1===t.nodeType&&t.parentNode&&1===t.parentNode.nodeType){var n=fl(e,t.parentNode);e.getStyle(t,"color")&&n?e.setStyle(t,"text-decoration",n):e.getStyle(t,"text-decoration")===n&&e.setStyle(t,"text-decoration",null);}};t.styles&&(t.styles.color||t.styles.textDecoration)&&(_t.walk(r,o,"childNodes"),o(r));}(r,i,0,a),function(e,t,n,r){!pl(t)||"sub"!==t.inline&&"sup"!==t.inline||(Hh(r,jh(e,"fontSize"),Vh(e,"fontSize","")),e.remove(e.select("sup"===t.inline?"sub":"sup",r),!0));}(r,i,0,a),zh(r,i,0,a)):r.remove(a,!0);}));};if("false"!==u.getContentEditable(c.getNode())){if(i){if(r)if(el(r)){if(!f(o,r)){var g=u.createRng();g.setStartBefore(r),g.setEndAfter(r),m(u,Tl(e,g,o),!0);}}else m(u,r,!0);else if(a&&pl(i)&&!Il(e).length)!function(e,t,n){var r,o,i=e.selection,a=i.getRng(),u=a.startOffset,c=a.startContainer.nodeValue;(r=Uf(e.getBody(),i.getStart()))&&(o=kh(r));var s,f,l=/[^\s\u00a0\u00ad\u200b\ufeff]/;if(c&&u>0&&u<c.length&&l.test(c.charAt(u))&&l.test(c.charAt(u-1))){var d=i.getBookmark();a.collapse(!0);var m=Tl(e,a,e.formatter.get(t));m=Cd(m),e.formatter.apply(t,n,m),i.moveToBookmark(d);}else r&&o.nodeValue===xh||(s=e.getDoc(),f=Nh(!0).dom,o=(r=s.importNode(f,!0)).firstChild,a.insertNode(r),u=1),e.formatter.apply(t,n,r),i.setCursorLocation(o,u);}(e,t,n);else {var p=c.getNode(),h=o[0];e.settings.forced_root_block||!h.defaultBlock||u.getParent(p,u.isBlock)||sv(e,h.defaultBlock),c.setRng(Wp(c.getRng())),ql(c,!0,(function(){Vl(e,(function(t,n){var r=n?t:Tl(e,t,o);m(u,r,!1);}));})),tl(u,c,c.getRng()),e.nodeChanged();}!function(e,t){Lh(Bh[e],(function(e){e(t);}));}(t,e);}nd(e,t,r,n);}else {r=c.getNode();for(var v=0,C=o.length;v<C;v++){var x=o[v];if(x.ceFalseOverride&&gl(x)&&u.is(r,x.selector)){s(r,x);break}}nd(e,t,r,n);}},fv=function(e){return ye(e,"vars")},lv=function(e){return e.selection.getStart()},dv=function(e,t,n,r,o){return G(t,(function(t){var i=e.formatter.matchNode(t,n,null!=o?o:{},r);return !h(i)}),(function(t){return !!mh(e,t,n)||!r&&b(e.formatter.matchNode(t,n,o,!0))}))},mv=function(e,t){var n=null!=t?t:lv(e);return K(ll(e.dom,n),(function(e){return Dn(e)&&!Pn(e)}))},gv=function(e,t,n){var r=mv(e,t);le(n,(function(n,o){var i=function(n){var i=dv(e,r,o,n.similar,fv(n)?n.vars:void 0),a=i.isSome();if(n.state.get()!==a){n.state.set(a);var u=i.getOr(t);fv(n)?n.callback(a,{node:u,format:o,parents:r}):q(n.callbacks,(function(e){return e(a,{node:u,format:o,parents:r})}));}};q([n.withSimilar,n.withoutSimilar],i),q(n.withVars,i);}));},pv=function(e,t,n,r,o,i){return null===t.get()&&function(e,t){e.set({}),t.on("NodeChange",(function(n){gv(t,n.element,e.get());})),t.on("FormatApply FormatRemove",(function(n){var r=I.from(n.node).map((function(e){return el(e)?e:e.startContainer})).bind((function(e){return Dn(e)?I.some(e):I.from(e.parentElement)})).getOrThunk((function(){return lv(t)}));gv(t,r,e.get());}));}(t,e),function(e,t,n,r,o,i){var a=t.get();q(n.split(","),(function(t){var n=be(a,t).getOrThunk((function(){var e={withSimilar:{state:Cu(!1),similar:!0,callbacks:[]},withoutSimilar:{state:Cu(!1),similar:!1,callbacks:[]},withVars:[]};return a[t]=e,e})),u=function(){var n=mv(e);return dv(e,n,t,o,i).isSome()};if(h(i)){var c=o?n.withSimilar:n.withoutSimilar;c.callbacks.push(r),1===c.callbacks.length&&c.state.set(u());}else n.withVars.push({state:Cu(u()),similar:o,vars:i,callback:r});})),t.set(a);}(e,t,n,r,o,i),{unbind:function(){return function(e,t,n){var r=e.get();q(t.split(","),(function(e){return be(r,e).each((function(t){r[e]={withSimilar:Re(Re({},t.withSimilar),{callbacks:K(t.withSimilar.callbacks,(function(e){return e!==n}))}),withoutSimilar:Re(Re({},t.withoutSimilar),{callbacks:K(t.withoutSimilar.callbacks,(function(e){return e!==n}))}),withVars:K(t.withVars,(function(e){return e.callback!==n}))};}))})),e.set(r);}(t,n,r)}}},hv=function(e,t){var n=(t||document).createDocumentFragment();return q(e,(function(e){n.appendChild(e.dom);})),Rt.fromDom(n)},vv=function(e,t,n){return {element:e,width:t,rows:n}},bv=function(e,t){return {element:e,cells:t}},yv=function(e,t){return {x:e,y:t}},Cv=function(e,t){var n=parseInt(er(e,t),10);return isNaN(n)?1:n},xv=function(e,t,n){var r=e.rows;return !!(r[n]?r[n].cells:[])[t]},wv=function(e){return Y(e,(function(e,t){return t.cells.length>e?t.cells.length:e}),0)},Sv=function(e,t){for(var n=e.rows,r=0;r<n.length;r++)for(var o=n[r].cells,i=0;i<o.length;i++)if(Bt(o[i],t))return I.some(yv(i,r));return I.none()},kv=function(e,t,n,r,o){for(var i=[],a=e.rows,u=n;u<=o;u++){var c=a[u].cells,s=t<r?c.slice(t,r+1):c.slice(r,t+1);i.push(bv(a[u].element,s));}return i},Nv=function(e){var t=vv(Yu(e),0,[]);return q(Mu(e,"tr"),(function(e,n){q(Mu(e,"td,th"),(function(r,o){!function(e,t,n,r,o){for(var i=Cv(o,"rowspan"),a=Cv(o,"colspan"),u=e.rows,c=n;c<n+i;c++){u[c]||(u[c]=bv(Gu(r),[]));for(var s=t;s<t+a;s++)u[c].cells[s]=c===n&&s===t?o:Yu(o);}}(t,function(e,t,n){for(;xv(e,t,n);)t++;return t}(t,o,n),n,e,r);}));})),vv(t.element,wv(t.rows),t.rows)},Ev=function(e){return function(e,t){var n=Yu(e.element),r=Rt.fromTag("tbody");return gn(r,t),mn(n,r),n}(e,function(e){return V(e.rows,(function(e){var t=V(e.cells,(function(e){var t=Gu(e);return nr(t,"colspan"),nr(t,"rowspan"),t})),n=Yu(e.element);return gn(n,t),n}))}(e))},_v=function(e,t,n){return Sv(e,t).bind((function(t){return Sv(e,n).map((function(n){return function(e,t,n){var r=t.x,o=t.y,i=n.x,a=n.y,u=o<a?kv(e,r,o,i,a):kv(e,r,a,i,o);return vv(e.element,wv(u),u)}(e,t,n)}))}))},Av=function(e,t){return J(e,(function(e){return "li"===It(e)&&zl(e,t)})).fold(k([]),(function(t){return function(e){return J(e,(function(e){return "ul"===It(e)||"ol"===It(e)}))}(e).map((function(e){var t=Rt.fromTag(It(e)),n=he(ur(e),(function(e,t){return Me(t,"list-style")}));return rr(t,n),[Rt.fromTag("li"),t]})).getOr([])}))},Rv=function(e,t){var n=Rt.fromDom(t.commonAncestorContainer),r=Ng(n,e),o=K(r,(function(e){return fo(e)||co(e)})),i=Av(r,t),a=o.concat(i.length?i:function(e){return po(e)?Wt(e).filter(go).fold(k([]),(function(t){return [e,t]})):go(e)?[e]:[]}(n));return V(a,Yu)},Dv=function(){return hv([])},Tv=function(e,t){return n=Rt.fromDom(t.cloneContents()),r=Rv(e,t),o=Y(r,(function(e,t){return mn(t,e),t}),n),r.length>0?hv([o]):o;var n,r,o;},Ov=function(e,t){return (n=e,r=t[0],Gr(r,"table",_(Bt,n))).bind((function(e){var n=t[0],r=t[t.length-1],o=Nv(e);return _v(o,n,r).map((function(e){return hv([Ev(e)])}))})).getOrThunk(Dv);var n,r;},Bv=function(e,t){var n=Ll(t,e);return n.length>0?Ov(e,n):function(e,t){return t.length>0&&t[0].collapsed?Dv():Tv(e,t[0])}(e,t)},Pv=function(e,t){return t>=0&&t<e.length&&Qf(e.charAt(t))},Lv=function(e,t){var n=wo(e.innerText);return t?function(e){return e.replace(/^[ \f\n\r\t\v]+/,"")}(n):n},Iv=function(e,t,n){void 0===n&&(n={});var r=function(e,t){return Re(Re({},e),{format:t,get:!0,selection:!0})}(n,t),o=e.fire("BeforeGetContent",r);if(o.isDefaultPrevented())return e.fire("GetContent",o),o.content;if("text"===o.format)return function(e){return I.from(e.selection.getRng()).map((function(t){var n=I.from(e.dom.getParent(t.commonAncestorContainer,e.dom.isBlock)),r=e.getBody(),o=function(e){return e.map((function(e){return e.nodeName})).getOr("div").toLowerCase()}(n),i=wt.browser.isIE()&&"pre"!==o,a=e.dom.add(r,o,{"data-mce-bogus":"all",style:"overflow: hidden; opacity: 0;"},t.cloneContents()),u=Lv(a,i),c=wo(a.textContent);if(e.dom.remove(a),Pv(c,0)||Pv(c,c.length-1)){var s=n.getOr(r),f=Lv(s,i),l=f.indexOf(u);return -1===l?u:(Pv(f,l-1)?" ":"")+u+(Pv(f,l+u.length)?" ":"")}return u})).getOr("")}(e);o.getInner=!0;var i=function(e,t){var n=e.selection.getRng(),r=e.dom.create("body"),o=e.selection.getSel(),i=_m(e,Bl(o)),a=t.contextual?Bv(Rt.fromDom(e.getBody()),i).dom:n.cloneContents();return a&&r.appendChild(a),e.selection.serializer.serialize(r,t)}(e,o);return "tree"===o.format?i:(o.content=e.selection.isCollapsed()?"":i,e.fire("GetContent",o),o.content)},Mv=function(e){return Dn(e)?e.outerHTML:Fn(e)?bi.encodeRaw(e.data,!1):Un(e)?"\x3c!--"+e.data+"--\x3e":""},Fv=function(e,t,n){var r=function(e){var t,n=document.createElement("div"),r=document.createDocumentFragment();for(e&&(n.innerHTML=e);t=n.firstChild;)r.appendChild(t);return r}(t);if(e.hasChildNodes()&&n<e.childNodes.length){var o=e.childNodes[n];o.parentNode.insertBefore(r,o);}else e.appendChild(r);},Uv=function(e,t){var n,r,o,i,a,u,c,s,f,l=V(ue(t.childNodes),Mv);return function(e,t){var n=0;q(e,(function(e){0===e[0]?n++:1===e[0]?(Fv(t,e[1],n),n++):2===e[0]&&function(e,t){if(e.hasChildNodes()&&t<e.childNodes.length){var n=e.childNodes[t];n.parentNode.removeChild(n);}}(t,n);}));}((r=e,o=(n=l).length+r.length+2,i=new Array(o),a=new Array(o),u=function(e,t,o,i,a){var c=s(e,t,o,i);if(null===c||c.start===t&&c.diag===t-i||c.end===e&&c.diag===e-o)for(var f=e,l=o;f<t||l<i;)f<t&&l<i&&n[f]===r[l]?(a.push([0,n[f]]),++f,++l):t-e>i-o?(a.push([2,n[f]]),++f):(a.push([1,r[l]]),++l);else {u(e,c.start,o,c.start-c.diag,a);for(var d=c.start;d<c.end;++d)a.push([0,n[d]]);u(c.end,t,c.end-c.diag,i,a);}},c=function(e,t,o,i){for(var a=e;a-t<i&&a<o&&n[a]===r[a-t];)++a;return function(e,t,n){return {start:e,end:t,diag:n}}(e,a,t)},s=function(e,t,o,u){var s=t-e,f=u-o;if(0===s||0===f)return null;var l,d,m,g,p,h=s-f,v=f+s,b=(v%2==0?v:v+1)/2;for(i[1+b]=e,a[1+b]=t+1,l=0;l<=b;++l){for(d=-l;d<=l;d+=2){for(m=d+b,d===-l||d!==l&&i[m-1]<i[m+1]?i[m]=i[m+1]:i[m]=i[m-1]+1,p=(g=i[m])-e+o-d;g<t&&p<u&&n[g]===r[p];)i[m]=++g,++p;if(h%2!=0&&h-l<=d&&d<=h+l&&a[m-h]<=i[m])return c(a[m-h],d+e-o,t,u)}for(d=h-l;d<=h+l;d+=2){for(m=d+b-h,d===h-l||d!==h+l&&a[m+1]<=a[m-1]?a[m]=a[m+1]-1:a[m]=a[m-1],p=(g=a[m]-1)-e+o-d;g>=e&&p>=o&&n[g]===r[p];)a[m]=g--,p--;if(h%2==0&&-l<=d&&d<=l&&a[m]<=i[m+h])return c(a[m],d+e-o,t,u)}}},f=[],u(0,n.length,0,r.length,f),f),t),t},zv=Te((function(){return document.implementation.createHTMLDocument("undo")})),Hv=function(e){var t,n=(t=e.getBody(),K(V(ue(t.childNodes),Mv),(function(e){return e.length>0}))),r=Z(n,(function(t){var n=Wm(e.serializer,t);return n.length>0?[n]:[]})),o=r.join("");return -1!==o.indexOf("</iframe>")?function(e){return {type:"fragmented",fragments:e,content:"",bookmark:null,beforeBookmark:null}}(r):function(e){return {type:"complete",fragments:null,content:e,bookmark:null,beforeBookmark:null}}(o)},jv=function(e,t,n){var r=n?t.beforeBookmark:t.bookmark;"fragmented"===t.type?Uv(t.fragments,e.getBody()):e.setContent(t.content,{format:"raw",no_selection:!b(r)||!zf(r)||!r.isFakeCaret}),e.selection.moveToBookmark(r);},Vv=function(e){return "fragmented"===e.type?e.fragments.join(""):e.content},qv=function(e){var t=Rt.fromTag("body",zv());return Ku(t,Vv(e)),q(Mu(t,"*[data-mce-bogus]"),vn),t.dom.innerHTML},$v=function(e,t){return !(!e||!t)&&(!!function(e,t){return Vv(e)===Vv(t)}(e,t)||function(e,t){return qv(e)===qv(t)}(e,t))},Wv=function(e){return 0===e.get()},Kv=function(e,t,n){Wv(n)&&(e.typing=t);},Xv=function(e,t){e.typing&&(Kv(e,!1,t),e.add());},Yv=function(e){return {undoManager:{beforeChange:function(t,n){return function(e,t,n){Wv(t)&&n.set(Jc(e.selection));}(e,t,n)},add:function(t,n,r,o,i,a){return function(e,t,n,r,o,i,a){var u=Hv(e);if(i=i||{},i=_t.extend(i,u),!1===Wv(r)||e.removed)return null;var c=t.data[n.get()];if(e.fire("BeforeAddUndo",{level:i,lastLevel:c,originalEvent:a}).isDefaultPrevented())return null;if(c&&$v(c,i))return null;t.data[n.get()]&&o.get().each((function(e){t.data[n.get()].beforeBookmark=e;}));var s=function(e){return e.getParam("custom_undo_redo_levels",0,"number")}(e);if(s&&t.data.length>s){for(var f=0;f<t.data.length-1;f++)t.data[f]=t.data[f+1];t.data.length--,n.set(t.data.length);}i.bookmark=Jc(e.selection),n.get()<t.data.length-1&&(t.data.length=n.get()+1),t.data.push(i),n.set(t.data.length-1);var l={level:i,lastLevel:c,originalEvent:a};return n.get()>0?(e.setDirty(!0),e.fire("AddUndo",l),e.fire("change",l)):e.fire("AddUndo",l),i}(e,t,n,r,o,i,a)},undo:function(t,n,r){return function(e,t,n,r){var o;return t.typing&&(t.add(),t.typing=!1,Kv(t,!1,n)),r.get()>0&&(r.set(r.get()-1),o=t.data[r.get()],jv(e,o,!0),e.setDirty(!0),e.fire("Undo",{level:o})),o}(e,t,n,r)},redo:function(t,n){return function(e,t,n){var r;return t.get()<n.length-1&&(t.set(t.get()+1),r=n[t.get()],jv(e,r,!1),e.setDirty(!0),e.fire("Redo",{level:r})),r}(e,t,n)},clear:function(t,n){return function(e,t,n){t.data=[],n.set(0),t.typing=!1,e.fire("ClearUndos");}(e,t,n)},reset:function(e){return function(e){e.clear(),e.add();}(e)},hasUndo:function(t,n){return function(e,t,n){return n.get()>0||t.typing&&t.data[0]&&!$v(Hv(e),t.data[0])}(e,t,n)},hasRedo:function(e,t){return function(e,t){return t.get()<e.data.length-1&&!e.typing}(e,t)},transact:function(e,t,n){return function(e,t,n){return Xv(e,t),e.beforeChange(),e.ignore(n),e.add()}(e,t,n)},ignore:function(e,t){return function(e,t){try{e.set(e.get()+1),t();}finally{e.set(e.get()-1);}}(e,t)},extra:function(t,n,r,o){return function(e,t,n,r,o){if(t.transact(r)){var i=t.data[n.get()].bookmark,a=t.data[n.get()-1];jv(e,a,!0),t.transact(o)&&(t.data[n.get()-1].beforeBookmark=i);}}(e,t,n,r,o)}},formatter:{match:function(t,n,r,o){return bh(e,t,n,r,o)},matchAll:function(t,n){return function(e,t,n){var r=[],o={},i=e.selection.getStart();return e.dom.getParent(i,(function(i){for(var a=0;a<t.length;a++){var u=t[a];!o[u]&&vh(e,i,u,n)&&(o[u]=!0,r.push(u));}}),e.dom.getRoot()),r}(e,t,n)},matchNode:function(t,n,r,o){return vh(e,t,n,r,o)},canApply:function(t){return function(e,t){var n=e.formatter.get(t),r=e.dom;if(n)for(var o=e.selection.getStart(),i=ll(r,o),a=n.length-1;a>=0;a--){var u=n[a];if(!gl(u)||b(u.defaultBlock))return !0;for(var c=i.length-1;c>=0;c--)if(r.is(i[c],u.selector))return !0}return !1}(e,t)},closest:function(t){return yh(e,t)},apply:function(t,n,r){return sv(e,t,n,r)},remove:function(t,n,r,o){return ov(e,t,n,r,o)},toggle:function(t,n,r){return function(e,t,n,r){var o=e.formatter.get(t);!bh(e,t,n,r)||"toggle"in o[0]&&!o[0].toggle?sv(e,t,n,r):ov(e,t,n,r);}(e,t,n,r)},formatChanged:function(t,n,r,o,i){return pv(e,t,n,r,o,i)}},editor:{getContent:function(t,n){return function(e,t,n){return I.from(e.getBody()).fold(k("tree"===t.format?new Om("body",11):""),(function(r){return Xm(e,t,n,r)}))}(e,t,n)},setContent:function(t,n){return ch(e,t,n)},insertContent:function(t,n){return rh(e,t,n)},addVisual:function(t){return function(e,t){var n=e.dom,r=b(t)?t:e.getBody();h(e.hasVisual)&&(e.hasVisual=function(e){return e.getParam("visual",!0,"boolean")}(e)),q(n.select("table,a",r),(function(t){switch(t.nodeName){case"TABLE":var r=function(e){return e.getParam("visual_table_class","mce-item-table","string")}(e),o=n.getAttrib(t,"border");o&&"0"!==o||!e.hasVisual?n.removeClass(t,r):n.addClass(t,r);break;case"A":if(!n.getAttrib(t,"href")){var i=n.getAttrib(t,"name")||t.id,a=function(e){return e.getParam("visual_anchor_class","mce-item-anchor","string")}(e);i&&e.hasVisual?n.addClass(t,a):n.removeClass(t,a);}}})),e.fire("VisualAid",{element:t,hasVisual:e.hasVisual});}(e,t)}},selection:{getContent:function(t,n){return Iv(e,t,n)}},raw:{getModel:function(){return I.none()}}}},Gv=function(e){return ye(e.plugins,"rtc")},Jv=function(e){var t=e;return function(e){return be(e.plugins,"rtc").bind((function(e){return I.from(e.setup)}))}(e).fold((function(){return t.rtcInstance=Yv(e),I.none()}),(function(e){return t.rtcInstance=function(){var e=k(null),t=k("");return {undoManager:{beforeChange:x,add:e,undo:e,redo:e,clear:x,reset:x,hasUndo:T,hasRedo:T,transact:e,ignore:x,extra:x},formatter:{match:T,matchAll:k([]),matchNode:k(void 0),canApply:T,closest:t,apply:x,remove:x,toggle:x,formatChanged:k({unbind:x})},editor:{getContent:t,setContent:t,insertContent:x,addVisual:x},selection:{getContent:t},raw:{getModel:k(I.none())}}}(),I.some((function(){return e().then((function(e){return t.rtcInstance=function(e){var t=function(e){return d(e)?e:{}},n=e.undoManager,r=e.formatter,o=e.editor,i=e.selection,a=e.raw;return {undoManager:{beforeChange:n.beforeChange,add:n.add,undo:n.undo,redo:n.redo,clear:n.clear,reset:n.reset,hasUndo:n.hasUndo,hasRedo:n.hasRedo,transact:function(e,t,r){return n.transact(r)},ignore:function(e,t){return n.ignore(t)},extra:function(e,t,r,o){return n.extra(r,o)}},formatter:{match:function(e,n,o,i){return r.match(e,t(n),i)},matchAll:r.matchAll,matchNode:r.matchNode,canApply:function(e){return r.canApply(e)},closest:function(e){return r.closest(e)},apply:function(e,n,o){return r.apply(e,t(n))},remove:function(e,n,o,i){return r.remove(e,t(n))},toggle:function(e,n,o){return r.toggle(e,t(n))},formatChanged:function(e,t,n,o,i){return r.formatChanged(t,n,o,i)}},editor:{getContent:function(e,t){return o.getContent(e)},setContent:function(e,t){return o.setContent(e,t)},insertContent:function(e,t){return o.insertContent(e)},addVisual:o.addVisual},selection:{getContent:function(e,t){return i.getContent(t)}},raw:{getModel:function(){return I.some(a.getRawModel())}}}}(e),e.rtc.isRemote}))}))}))},Qv=function(e){return e.rtcInstance?e.rtcInstance:Yv(e)},Zv=function(e){var t=e.rtcInstance;if(t)return t;throw new Error("Failed to get RTC instance not yet initialized.")},eb=function(e,t){return void 0===t&&(t={}),function(e,t,n){return Zv(e).selection.getContent(t,n)}(e,t.format?t.format:"html",t)},tb=function(e){return 0===e.dom.length?(hn(e),I.none()):I.some(e)},nb=function(e,t,n,r){e.bind((function(e){return (r?np:tp)(e.dom,r?e.dom.length:0),t.filter(zt).map((function(t){return function(e,t,n,r){var o=e.dom,i=t.dom,a=r?o.length:i.length;r?(rp(o,i,!1,!r),n.setStart(i,a)):(rp(i,o,!1,!r),n.setEnd(i,a));}(e,t,n,r)}))})).orThunk((function(){var e=function(e,t){return e.filter((function(e){return Ql.isBookmarkNode(e.dom)})).bind(t?Xt:Kt)}(t,r).or(t).filter(zt);return e.map((function(e){return function(e,t){Wt(e).each((function(n){var r=e.dom;t&&Wg(n,Ac(r,0))?tp(r,0):!t&&Kg(n,Ac(r,r.length))&&np(r,r.length);}));}(e,r)}))}));},rb=function(e,t,n){void 0===n&&(n={});var r=function(e,t){return Re(Re({format:"html"},e),{set:!0,selection:!0,content:t})}(n,t),o=r;if(!r.no_events){var i=e.fire("BeforeSetContent",r);if(i.isDefaultPrevented())return void e.fire("SetContent",i);o=i;}o.content=function(e,t){if("raw"!==t.format){var n=e.selection.getRng(),r=e.dom.getParent(n.commonAncestorContainer,e.dom.isBlock),o=r?{context:r.nodeName.toLowerCase()}:{},i=e.parser.parse(t.content,Re(Re({isRootContent:!0,forced_root_block:!1},o),t));return Zm({validate:e.validate},e.schema).serialize(i)}return t.content}(e,o);var a=e.selection.getRng();!function(e,t){var n=I.from(t.firstChild).map(Rt.fromDom),r=I.from(t.lastChild).map(Rt.fromDom);e.deleteContents(),e.insertNode(t);var o=n.bind(Kt).filter(zt).bind(tb),i=r.bind(Xt).filter(zt).bind(tb);nb(o,n,e,!0),nb(i,r,e,!1),e.collapse(!1);}(a,a.createContextualFragment(o.content)),e.selection.setRng(a),Vd(e,a),o.no_events||e.fire("SetContent",o);},ob=function(e,t,n){if(e&&ye(e,t)){var r=K(e[t],(function(e){return e!==n}));0===r.length?delete e[t]:e[t]=r;}};var ib,ab,ub=function(e){return !!e.select},cb=function(e){return !(!e||!e.ownerDocument)&&Lt(Rt.fromDom(e.ownerDocument),Rt.fromDom(e))},sb=function(e,t,n,r){var o,i,a=function(e,t){var n,r,o=function(t,n){return J(n,(function(n){return e.is(n,t)}))},i=function(t){return e.getParents(t,null,e.getRoot())};return {selectorChangedWithUnbind:function(e,a){return n||(n={},r={},t.on("NodeChange",(function(e){var t=e.element,a=i(t),u={};_t.each(n,(function(e,t){o(t,a).each((function(n){r[t]||(q(e,(function(e){e(!0,{node:n,selector:t,parents:a});})),r[t]=e),u[t]=e;}));})),_t.each(r,(function(e,n){u[n]||(delete r[n],_t.each(e,(function(e){e(!1,{node:t,selector:n,parents:a});})));}));}))),n[e]||(n[e]=[]),n[e].push(a),o(e,i(t.selection.getStart())).each((function(){r[e]=n[e];})),{unbind:function(){ob(n,e,a),ob(r,e,a);}}}}}(e,r).selectorChangedWithUnbind,u=function(e,t){return rb(r,e,t)},c=function(e){var t=f();t.collapse(!!e),l(t);},s=function(){return t.getSelection?t.getSelection():t.document.selection},f=function(){var n,a,u,c=function(e,t,n){try{return t.compareBoundaryPoints(e,n)}catch(e){return -1}},f=t.document;if(void 0!==r.bookmark&&!1===ym(r)){var l=um(r);if(l.isSome())return l.map((function(e){return _m(r,[e])[0]})).getOr(f.createRange())}try{(n=s())&&!Rn(n.anchorNode)&&(a=n.rangeCount>0?n.getRangeAt(0):n.createRange?n.createRange():f.createRange(),a=_m(r,[a])[0]);}catch(e){}return a||(a=f.createRange?f.createRange():f.body.createTextRange()),a.setStart&&9===a.startContainer.nodeType&&a.collapsed&&(u=e.getRoot(),a.setStart(u,0),a.setEnd(u,0)),o&&i&&(0===c(a.START_TO_START,a,o)&&0===c(a.END_TO_END,a,o)?a=i:(o=null,i=null)),a},l=function(e,t){var n;if(function(e){return !!e&&(!!ub(e)||cb(e.startContainer)&&cb(e.endContainer))}(e)){var a=ub(e)?e:null;if(a){i=null;try{a.select();}catch(e){}}else {var u=s();if(e=r.fire("SetSelectionRange",{range:e,forward:t}).range,u){i=e;try{u.removeAllRanges(),u.addRange(e);}catch(e){}!1===t&&u.extend&&(u.collapse(e.endContainer,e.endOffset),u.extend(e.startContainer,e.startOffset)),o=u.rangeCount>0?u.getRangeAt(0):null;}e.collapsed||e.startContainer!==e.endContainer||!u.setBaseAndExtent||wt.ie||e.endOffset-e.startOffset<2&&e.startContainer.hasChildNodes()&&(n=e.startContainer.childNodes[e.startOffset])&&"IMG"===n.tagName&&(u.setBaseAndExtent(e.startContainer,e.startOffset,e.endContainer,e.endOffset),u.anchorNode===e.startContainer&&u.focusNode===e.endContainer||u.setBaseAndExtent(n,0,n,1)),r.fire("AfterSetSelectionRange",{range:e,forward:t});}}},d=function(){var t=s(),n=null==t?void 0:t.anchorNode,r=null==t?void 0:t.focusNode;if(!t||!n||!r||Rn(n)||Rn(r))return !0;var o=e.createRng();o.setStart(n,t.anchorOffset),o.collapse(!0);var i=e.createRng();return i.setStart(r,t.focusOffset),i.collapse(!0),o.compareBoundaryPoints(o.START_TO_START,i)<=0},m={bookmarkManager:null,controlSelection:null,dom:e,win:t,serializer:n,editor:r,collapse:c,setCursorLocation:function(t,n){var o=e.createRng();b(t)&&b(n)?(o.setStart(t,n),o.setEnd(t,n),l(o),c(!1)):(Hl(e,o,r.getBody(),!0),l(o));},getContent:function(e){return eb(r,e)},setContent:u,getBookmark:function(e,t){return g.getBookmark(e,t)},moveToBookmark:function(e){return g.moveToBookmark(e)},select:function(t,n){return function(e,t,n){return I.from(t).map((function(t){var r=e.nodeIndex(t),o=e.createRng();return o.setStart(t.parentNode,r),o.setEnd(t.parentNode,r+1),n&&(Hl(e,o,t,!0),Hl(e,o,t,!1)),o}))}(e,t,n).each(l),t},isCollapsed:function(){var e=f(),t=s();return !(!e||e.item)&&(e.compareEndPoints?0===e.compareEndPoints("StartToEnd",e):!t||e.collapsed)},isForward:d,setNode:function(t){return u(e.getOuterHTML(t)),t},getNode:function(){return function(e,t){var n,r,o;if(!t)return e;r=t.startContainer,o=t.endContainer;var i=t.startOffset,a=t.endOffset;return n=t.commonAncestorContainer,!t.collapsed&&(r===o&&a-i<2&&r.hasChildNodes()&&(n=r.childNodes[i]),3===r.nodeType&&3===o.nodeType&&(r=r.length===i?Em(r.nextSibling,!0):r.parentNode,o=0===a?Em(o.previousSibling,!1):o.parentNode,r&&r===o))?r:n&&3===n.nodeType?n.parentNode:n}(r.getBody(),f())},getSel:s,setRng:l,getRng:f,getStart:function(e){return km(r.getBody(),f(),e)},getEnd:function(e){return Nm(r.getBody(),f(),e)},getSelectedBlocks:function(t,n){return function(e,t,n,r){var o,i=[],a=e.getRoot();if(n=e.getParent(n||km(a,t,t.collapsed),e.isBlock),r=e.getParent(r||Nm(a,t,t.collapsed),e.isBlock),n&&n!==a&&i.push(n),n&&r&&n!==r){o=n;for(var u=new ao(n,a);(o=u.next())&&o!==r;)e.isBlock(o)&&i.push(o);}return r&&n!==r&&r!==a&&i.push(r),i}(e,f(),t,n)},normalize:function(){var t=f(),n=s();if(!(Bl(n).length>1)&&jl(r)){var o=bd(e,t);return o.each((function(e){l(e,d());})),o.getOr(t)}return t},selectorChanged:function(e,t){return a(e,t),m},selectorChangedWithUnbind:a,getScrollContainer:function(){for(var t,n=e.getRoot();n&&"BODY"!==n.nodeName;){if(n.scrollHeight>n.clientHeight){t=n;break}n=n.parentNode;}return t},scrollIntoView:function(e,t){b(e)?function(e,t,n){(e.inline?zd:jd)(e,t,n);}(r,e,t):Vd(r,f(),t);},placeCaretAt:function(e,t){return l(cd(e,t,r.getDoc()))},getBoundingClientRect:function(){var e=f();return e.collapsed?Ac.fromRangeStart(e).getClientRects()[0]:e.getBoundingClientRect()},destroy:function(){t=o=i=null,p.destroy();}},g=Ql(m),p=ad(m,r);return m.bookmarkManager=g,m.controlSelection=p,m},fb=function(e,t,n){e.addNodeFilter("font",(function(e){q(e,(function(e){var r=t.parse(e.attr("style")),o=e.attr("color"),i=e.attr("face"),a=e.attr("size");o&&(r.color=o),i&&(r["font-family"]=i),a&&(r["font-size"]=n[parseInt(e.attr("size"),10)-1]),e.name="span",e.attr("style",t.serialize(r)),function(e,t){q(t,(function(t){e.attr(t,null);}));}(e,["color","face","size"]);}));}));},lb=function(e,t){var n=Di();t.convert_fonts_to_spans&&fb(e,n,_t.explode(t.font_size_legacy_values)),function(e,t){e.addNodeFilter("strike",(function(e){q(e,(function(e){var n=t.parse(e.attr("style"));n["text-decoration"]="line-through",e.name="span",e.attr("style",t.serialize(n));}));}));}(e,n);},db=function(e){var t,n=decodeURIComponent(e).split(","),r=/data:([^;]+)/.exec(n[0]);return r&&(t=r[1]),{type:t,data:n[1]}},mb=function(e,t){var n;try{n=atob(t);}catch(e){return I.none()}for(var r=new Uint8Array(n.length),o=0;o<r.length;o++)r[o]=n.charCodeAt(o);return I.some(new Blob([r],{type:e}))},gb=function(e){return 0===e.indexOf("blob:")?function(e){return new Zr((function(t,n){var r=function(){n("Cannot convert "+e+" to Blob. Resource might not exist or is inaccessible.");};try{var o=new XMLHttpRequest;o.open("GET",e,!0),o.responseType="blob",o.onload=function(){200===o.status?t(o.response):r();},o.onerror=r,o.send();}catch(e){r();}}))}(e):0===e.indexOf("data:")?(t=e,new Zr((function(e){var n=db(t),r=n.type,o=n.data;mb(r,o).fold((function(){return e(new Blob([]))}),e);}))):null;var t;},pb=0,hb=function(e){return (e||"blobid")+pb++},vb=function(e,t,n,r){var o,i;if(0!==t.src.indexOf("blob:")){var a=db(t.src),u=a.data,c=a.type;o=u,(i=e.getByData(o,c))?n({image:t,blobInfo:i}):gb(t.src).then((function(r){i=e.create(hb(),r,o),e.add(i),n({image:t,blobInfo:i});}),(function(e){r(e);}));}else (i=e.getByUri(t.src))?n({image:t,blobInfo:i}):gb(t.src).then((function(r){(function(e){return new Zr((function(t){var n=new FileReader;n.onloadend=function(){t(n.result);},n.readAsDataURL(e);}))})(r).then((function(a){o=db(a).data,i=e.create(hb(),r,o),e.add(i),n({image:t,blobInfo:i});}));}),(function(e){r(e);}));},bb=function(e,t){var n={};return {findAll:function(r,o){o||(o=O);var i=K(function(e){return e?ue(e.getElementsByTagName("img")):[]}(r),(function(t){var n=t.src;return !!wt.fileApi&&(!t.hasAttribute("data-mce-bogus")&&(!t.hasAttribute("data-mce-placeholder")&&(!(!n||n===wt.transparentSrc)&&(0===n.indexOf("blob:")?!e.isUploaded(n)&&o(t):0===n.indexOf("data:")&&o(t)))))})),a=V(i,(function(e){if(void 0!==n[e.src])return new Zr((function(t){n[e.src].then((function(n){if("string"==typeof n)return n;t({image:e,blobInfo:n.blobInfo});}));}));var r=new Zr((function(n,r){vb(t,e,n,r);})).then((function(e){return delete n[e.image.src],e})).catch((function(t){return delete n[e.src],t}));return n[e.src]=r,r}));return Zr.all(a)}}},yb=function(e,t,n,r){(e.padd_empty_with_br||t.insert)&&n[r.name]?r.empty().append(new Om("br",1)).shortEnded=!0:r.empty().append(new Om("#text",3)).value=yo;},Cb=function(e,t){return e&&e.firstChild&&e.firstChild===e.lastChild&&e.firstChild.name===t},xb=function(e,t,n,r){return r.isEmpty(t,n,(function(t){return function(e,t){var n=e.getElementRule(t.name);return n&&n.paddEmpty}(e,t)}))},wb=function(e,t){var n=t.blob_cache,r=function(e){var r=e.attr("src");(function(e){return e.attr("src")===wt.transparentSrc||b(e.attr("data-mce-placeholder"))})(e)||function(e){return b(e.attr("data-mce-bogus"))}(e)||function(e){var t=/data:([^;]+);base64,([a-z0-9\+\/=\s]+)/i.exec(e);return t?I.some({type:t[1],data:decodeURIComponent(t[2])}):I.none()}(r).filter((function(){return function(e,t){if(t.images_dataimg_filter){var n=new Image;return n.src=e.attr("src"),le(e.attributes.map,(function(e,t){n.setAttribute(t,e);})),t.images_dataimg_filter(n)}return !0}(e,t)})).bind((function(e){var t=e.type,r=e.data;return I.from(n.getByData(r,t)).orThunk((function(){return mb(t,r).map((function(e){var t=n.create(hb(),e,r);return n.add(t),t}))}))})).each((function(t){e.attr("src",t.blobUri());}));};n&&e.addAttributeFilter("src",(function(e){return q(e,r)}));},Sb=_t.makeMap,kb=_t.each,Nb=_t.explode,Eb=_t.extend,_b=function(e,t){void 0===t&&(t=Ai());var n={},r=[],o={},i={};(e=e||{}).validate=!("validate"in e)||e.validate,e.root_name=e.root_name||"body";var a=function(e){var t=e.name;t in n&&((u=o[t])?u.push(e):o[t]=[e]);for(var a=r.length;a--;){var u,c=r[a].name;if(c in e.attributes.map)(u=i[c])?u.push(e):i[c]=[e];}return e},u={schema:t,addAttributeFilter:function(e,t){kb(Nb(e),(function(e){var n;for(n=0;n<r.length;n++)if(r[n].name===e)return void r[n].callbacks.push(t);r.push({name:e,callbacks:[t]});}));},getAttributeFilters:function(){return [].concat(r)},addNodeFilter:function(e,t){kb(Nb(e),(function(e){var r=n[e];r||(n[e]=r=[]),r.push(t);}));},getNodeFilters:function(){var e=[];for(var t in n)ye(n,t)&&e.push({name:t,callbacks:n[t]});return e},filterNode:a,parse:function(u,c){var s,f,l,d,m,g,p,h,v=[];c=c||{},o={},i={};var b=Eb(Sb("script,style,head,html,body,title,meta,param"),t.getBlockElements()),y=t.getNonEmptyElements(),C=t.children,x=e.validate,w=function(e){return !1===e?"":!0===e?"p":e}("forced_root_block"in c?c.forced_root_block:e.forced_root_block),S=t.getWhiteSpaceElements(),k=/^[ \t\r\n]+/,N=/[ \t\r\n]+$/,E=/[ \t\r\n]+/g,_=/^[ \t\r\n]+$/,A=ye(S,c.context)||ye(S,e.root_name),R=function(e,t){var r,i=new Om(e,t);return e in n&&((r=o[e])?r.push(i):o[e]=[i]),i},D=function(e){for(var n=t.getBlockElements(),r=e.prev;r&&3===r.type;){var o=r.value.replace(N,"");if(o.length>0)return void(r.value=o);var i=r.next;if(i){if(3===i.type&&i.value.length){r=r.prev;continue}if(!n[i.name]&&"script"!==i.name&&"style"!==i.name){r=r.prev;continue}}var a=r.prev;r.remove(),r=a;}},T=$m({validate:x,document:e.document,allow_html_data_urls:e.allow_html_data_urls,allow_svg_data_urls:e.allow_svg_data_urls,allow_script_urls:e.allow_script_urls,allow_conditional_comments:e.allow_conditional_comments,preserve_cdata:e.preserve_cdata,self_closing_elements:function(e){var t={};for(var n in e)"li"!==n&&"p"!==n&&(t[n]=e[n]);return t}(t.getSelfClosingElements()),cdata:function(e){h.append(R("#cdata",4)).value=e;},text:function(e,t){var n;A||(e=e.replace(E," "),function(e,t){return e&&(ye(t,e.name)||"br"===e.name)}(h.lastChild,b)&&(e=e.replace(k,""))),0!==e.length&&((n=R("#text",3)).raw=!!t,h.append(n).value=e);},comment:function(e){h.append(R("#comment",8)).value=e;},pi:function(e,t){h.append(R(e,7)).value=t,D(h);},doctype:function(e){h.append(R("#doctype",10)).value=e,D(h);},start:function(e,n,o){var a=x?t.getElementRule(e):{};if(a){var u=R(a.outputName||e,1);u.attributes=n,u.shortEnded=o,h.append(u);var c=C[h.name];c&&C[u.name]&&!c[u.name]&&v.push(u);for(var s=r.length;s--;){var f=r[s].name;f in n.map&&((g=i[f])?g.push(u):i[f]=[u]);}b[e]&&D(u),o||(h=u),!A&&S[e]&&(A=!0);}},end:function(n){var r,o,i,a,u=x?t.getElementRule(n):{};if(u){if(b[n]&&!A){if((r=h.firstChild)&&3===r.type)if((o=r.value.replace(k,"")).length>0)r.value=o,r=r.next;else for(i=r.next,r.remove(),r=i;r&&3===r.type;)o=r.value,i=r.next,(0===o.length||_.test(o))&&(r.remove(),r=i),r=i;if((r=h.lastChild)&&3===r.type)if((o=r.value.replace(N,"")).length>0)r.value=o,r=r.prev;else for(i=r.prev,r.remove(),r=i;r&&3===r.type;)o=r.value,i=r.prev,(0===o.length||_.test(o))&&(r.remove(),r=i),r=i;}if(A&&S[n]&&(A=!1),u.removeEmpty&&xb(t,y,S,h))return a=h.parent,b[h.name]?h.empty().remove():h.unwrap(),void(h=a);u.paddEmpty&&(function(e){return Cb(e,"#text")&&e.firstChild.value===yo}(h)||xb(t,y,S,h))&&yb(e,c,b,h),h=h.parent;}}},t),O=h=new Om(c.context||e.root_name,11);if(T.parse(u,c.format),x&&v.length&&(c.context?c.invalid=!0:function(e){for(var n=Sb("tr,td,th,tbody,thead,tfoot,table"),r=t.getNonEmptyElements(),o=t.getWhiteSpaceElements(),i=t.getTextBlockElements(),u=t.getSpecialElements(),c=function(e,n){if(void 0===n&&(n=e.parent),u[e.name])e.empty().remove();else {for(var r=0,o=e.children();r<o.length;r++){var i=o[r];t.isValidChild(n.name,i.name)||c(i,n);}e.unwrap();}},s=0;s<e.length;s++){var f=e[s],l=void 0,d=void 0,m=void 0;if(f.parent&&!f.fixed)if(i[f.name]&&"li"===f.parent.name){for(var g=f.next;g&&i[g.name];)g.name="li",g.fixed=!0,f.parent.insert(g,f.parent),g=g.next;f.unwrap();}else {var p=[f];for(l=f.parent;l&&!t.isValidChild(l.name,f.name)&&!n[l.name];l=l.parent)p.push(l);if(l&&p.length>1)if(t.isValidChild(l.name,f.name)){p.reverse();for(var h=d=a(p[0].clone()),v=0;v<p.length-1;v++){t.isValidChild(h.name,p[v].name)?(m=a(p[v].clone()),h.append(m)):m=h;for(var b=p[v].firstChild;b&&b!==p[v+1];){var y=b.next;m.append(b),b=y;}h=m;}xb(t,r,o,d)?l.insert(f,p[0],!0):(l.insert(d,p[0],!0),l.insert(f,d)),l=p[0],(xb(t,r,o,l)||Cb(l,"br"))&&l.empty().remove();}else c(f);else if(f.parent){if("li"===f.name){if((g=f.prev)&&("ul"===g.name||"ol"===g.name)){g.append(f);continue}if((g=f.next)&&("ul"===g.name||"ol"===g.name)){g.insert(f,g.firstChild,!0);continue}f.wrap(a(new Om("ul",1)));continue}t.isValidChild(f.parent.name,"div")&&t.isValidChild("div",f.name)?f.wrap(a(new Om("div",1))):c(f);}}}}(v)),w&&("body"===O.name||c.isRootContent)&&function(){var n=O.firstChild,r=null,o=function(e){e&&((n=e.firstChild)&&3===n.type&&(n.value=n.value.replace(k,"")),(n=e.lastChild)&&3===n.type&&(n.value=n.value.replace(N,"")));};if(t.isValidChild(O.name,w.toLowerCase())){for(;n;){var i=n.next;3===n.type||1===n.type&&"p"!==n.name&&!b[n.name]&&!n.attr("data-mce-type")?(r||((r=R(w,1)).attr(e.forced_root_block_attrs),O.insert(r,n)),r.append(n)):(o(r),r=null),n=i;}o(r);}}(),!c.invalid){for(p in o)if(ye(o,p)){for(g=n[p],d=(s=o[p]).length;d--;)s[d].parent||s.splice(d,1);for(f=0,l=g.length;f<l;f++)g[f](s,p,c);}for(f=0,l=r.length;f<l;f++)if((g=r[f]).name in i){for(d=(s=i[g.name]).length;d--;)s[d].parent||s.splice(d,1);for(d=0,m=g.callbacks.length;d<m;d++)g.callbacks[d](s,g.name,c);}}return O}};return function(e,t){var n=e.schema;t.remove_trailing_brs&&e.addNodeFilter("br",(function(e,r,o){var i,a,u,c,s,f,l,d,m=e.length,g=_t.extend({},n.getBlockElements()),p=n.getNonEmptyElements(),h=n.getWhiteSpaceElements();for(g.body=1,i=0;i<m;i++)if(u=(a=e[i]).parent,g[a.parent.name]&&a===u.lastChild){for(s=a.prev;s;){if("span"!==(f=s.name)||"bookmark"!==s.attr("data-mce-type")){"br"===f&&(a=null);break}s=s.prev;}a&&(a.remove(),xb(n,p,h,u)&&(l=n.getElementRule(u.name))&&(l.removeEmpty?u.remove():l.paddEmpty&&yb(t,o,g,u)));}else {for(c=a;u&&u.firstChild===c&&u.lastChild===c&&(c=u,!g[u.name]);)u=u.parent;c===u&&!0!==t.padd_empty_with_br&&((d=new Om("#text",3)).value=yo,a.replace(d));}})),e.addAttributeFilter("href",(function(e){var n,r,o=e.length;if(!t.allow_unsafe_link_target)for(;o--;){var i=e[o];"a"===i.name&&"_blank"===i.attr("target")&&i.attr("rel",(r=void 0,r=(n=i.attr("rel"))?_t.trim(n):"",/\b(noopener)\b/g.test(r)?r:function(e){return e.split(" ").filter((function(e){return e.length>0})).concat(["noopener"]).sort().join(" ")}(r)));}})),t.allow_html_in_named_anchor||e.addAttributeFilter("id,name",(function(e){for(var t,n,r,o,i=e.length;i--;)if("a"===(o=e[i]).name&&o.firstChild&&!o.attr("href")){r=o.parent,t=o.lastChild;do{n=t.prev,r.insert(t,o),t=n;}while(t)}})),t.fix_list_elements&&e.addNodeFilter("ul,ol",(function(e){for(var t,n,r=e.length;r--;)if("ul"===(n=(t=e[r]).parent).name||"ol"===n.name)if(t.prev&&"li"===t.prev.name)t.prev.append(t);else {var o=new Om("li",1);o.attr("style","list-style-type: none"),t.wrap(o);}})),t.validate&&n.getValidClasses()&&e.addAttributeFilter("class",(function(e){for(var t=n.getValidClasses(),r=e.length;r--;){for(var o=e[r],i=o.attr("class").split(" "),a="",u=0;u<i.length;u++){var c=i[u],s=!1,f=t["*"];f&&f[c]&&(s=!0),f=t[o.name],!s&&f&&f[c]&&(s=!0),s&&(a&&(a+=" "),a+=c);}a.length||(a=null),o.attr("class",a);}})),wb(e,t);}(u,e),function(e,t){t.inline_styles&&lb(e,t);}(u,e),u},Ab=function(e,t,n){return function(e,t){return e&&e.hasEventListeners("PreProcess")&&!t.no_events}(e,n)?function(e,t,n){var r,o=e.dom,i=t.cloneNode(!0),a=document.implementation;if(a.createHTMLDocument){var u=a.createHTMLDocument("");_t.each("BODY"===i.nodeName?i.childNodes:[i],(function(e){u.body.appendChild(u.importNode(e,!0));})),i="BODY"!==i.nodeName?u.body.firstChild:u.body,r=o.doc,o.doc=u;}return function(e,t){e.fire("PreProcess",t);}(e,Re(Re({},n),{node:i})),r&&(o.doc=r),i}(e,t,n):t},Rb=function(e,t,n){-1===_t.inArray(t,n)&&(e.addAttributeFilter(n,(function(e,t){for(var n=e.length;n--;)e[n].attr(t,null);})),t.push(n));},Db=function(e,t,n,r,o){var i=function(e,t,n){return Zm(e,t).serialize(n)}(t,n,r);return function(e,t,n){if(!t.no_events&&e){var r=function(e,t){return e.fire("PostProcess",t)}(e,Re(Re({},t),{content:n}));return r.content}return n}(e,o,i)},Tb=function(e,t){var n=["data-mce-selected"],r=t&&t.dom?t.dom:pu.DOM,o=t&&t.schema?t.schema:Ai(e);e.entity_encoding=e.entity_encoding||"named",e.remove_trailing_brs=!("remove_trailing_brs"in e)||e.remove_trailing_brs;var i=_b(e,o);!function(e,t,n){e.addAttributeFilter("data-mce-tabindex",(function(e,t){for(var n=e.length;n--;){var r=e[n];r.attr("tabindex",r.attr("data-mce-tabindex")),r.attr(t,null);}})),e.addAttributeFilter("src,href,style",(function(e,r){for(var o="data-mce-"+r,i=t.url_converter,a=t.url_converter_scope,u=e.length;u--;){var c=e[u],s=c.attr(o);void 0!==s?(c.attr(r,s.length>0?s:null),c.attr(o,null)):(s=c.attr(r),"style"===r?s=n.serializeStyle(n.parseStyle(s),c.name):i&&(s=i.call(a,s,r,c.name)),c.attr(r,s.length>0?s:null));}})),e.addAttributeFilter("class",(function(e){for(var t=e.length;t--;){var n=e[t],r=n.attr("class");r&&(r=n.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),n.attr("class",r.length>0?r:null));}})),e.addAttributeFilter("data-mce-type",(function(e,t,n){for(var r=e.length;r--;){var o=e[r];if("bookmark"===o.attr("data-mce-type")&&!n.cleanup){var i=I.from(o.firstChild).exists((function(e){return !xo(e.value)}));i?o.unwrap():o.remove();}}})),e.addNodeFilter("noscript",(function(e){for(var t=e.length;t--;){var n=e[t].firstChild;n&&(n.value=bi.decode(n.value));}})),e.addNodeFilter("script,style",(function(e,n){for(var r=function(e){return e.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi,"").replace(/\s*(\/\*\s*\]\]>\s*\*\/(-->)?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")},o=e.length;o--;){var i=e[o],a=i.firstChild?i.firstChild.value:"";if("script"===n){var u=i.attr("type");u&&i.attr("type","mce-no/type"===u?null:u.replace(/^mce\-/,"")),"xhtml"===t.element_format&&a.length>0&&(i.firstChild.value="// <![CDATA[\n"+r(a)+"\n// ]]>");}else "xhtml"===t.element_format&&a.length>0&&(i.firstChild.value="\x3c!--\n"+r(a)+"\n--\x3e");}})),e.addNodeFilter("#comment",(function(e){for(var r=e.length;r--;){var o=e[r];t.preserve_cdata&&0===o.value.indexOf("[CDATA[")?(o.name="#cdata",o.type=4,o.value=n.decode(o.value.replace(/^\[CDATA\[|\]\]$/g,""))):0===o.value.indexOf("mce:protected ")&&(o.name="#text",o.type=3,o.raw=!0,o.value=unescape(o.value).substr(14));}})),e.addNodeFilter("xml:namespace,input",(function(e,t){for(var n=e.length;n--;){var r=e[n];7===r.type?r.remove():1===r.type&&("input"!==t||r.attr("type")||r.attr("type","text"));}})),e.addAttributeFilter("data-mce-type",(function(t){q(t,(function(t){"format-caret"===t.attr("data-mce-type")&&(t.isEmpty(e.schema.getNonEmptyElements())?t.remove():t.unwrap());}));})),e.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-type,data-mce-resize,data-mce-placeholder",(function(e,t){for(var n=e.length;n--;)e[n].attr(t,null);}));}(i,e,r);return {schema:o,addNodeFilter:i.addNodeFilter,addAttributeFilter:i.addAttributeFilter,serialize:function(n,a){void 0===a&&(a={});var u=Re({format:"html"},a),c=Ab(t,n,u),s=function(e,t,n){var r=wo(n.getInner?t.innerHTML:e.getOuterHTML(t));return n.selection||bo(Rt.fromDom(t))?r:_t.trim(r)}(r,c,u),f=function(e,t,n){var r=n.selection?Re({forced_root_block:!1},n):n,o=e.parse(t,r);return function(e){var t=function(e){return e&&"br"===e.name},n=e.lastChild;if(t(n)){var r=n.prev;t(r)&&(n.remove(),r.remove());}}(o),o}(i,s,u);return "tree"===u.format?f:Db(t,e,o,f,u)},addRules:o.addValidElements,setRules:o.setValidElements,addTempAttr:_(Rb,i,n),getTempAttrs:k(n),getNodeFilters:i.getNodeFilters,getAttributeFilters:i.getAttributeFilters}},Ob=function(e,t){var n=Tb(e,t);return {schema:n.schema,addNodeFilter:n.addNodeFilter,addAttributeFilter:n.addAttributeFilter,serialize:n.serialize,addRules:n.addRules,setRules:n.setRules,addTempAttr:n.addTempAttr,getTempAttrs:n.getTempAttrs,getNodeFilters:n.getNodeFilters,getAttributeFilters:n.getAttributeFilters}},Bb=function(e,t){return void 0===t&&(t={}),function(e,t,n){return Qv(e).editor.getContent(t,n)}(e,t,t.format?t.format:"html")},Pb=function(e,t,n){return void 0===n&&(n={}),function(e,t,n){return Qv(e).editor.setContent(t,n)}(e,t,n)},Lb=pu.DOM,Ib=function(e){return I.from(e).each((function(e){return e.destroy()}))},Mb=function(e){if(!e.removed){var t=e._selectionOverrides,n=e.editorUpload,r=e.getBody(),o=e.getElement();r&&e.save({is_removing:!0}),e.removed=!0,e.unbindAllNativeEvents(),e.hasHiddenInput&&o&&Lb.remove(o.nextSibling),function(e){e.fire("remove");}(e),e.editorManager.remove(e),!e.inline&&r&&function(e){Lb.setStyle(e.id,"display",e.orgDisplay);}(e),function(e){e.fire("detach");}(e),Lb.remove(e.getContainer()),Ib(t),Ib(n),e.destroy();}},Fb=function(e,t){var n=e.selection,r=e.dom;e.destroyed||(t||e.removed?(t||(e.editorManager.off("beforeunload",e._beforeUnload),e.theme&&e.theme.destroy&&e.theme.destroy(),Ib(n),Ib(r)),function(e){var t=e.formElement;t&&(t._mceOldSubmit&&(t.submit=t._mceOldSubmit,t._mceOldSubmit=null),Lb.unbind(t,"submit reset",e.formEventDelegate));}(e),function(e){e.contentAreaContainer=e.formElement=e.container=e.editorContainer=null,e.bodyElement=e.contentDocument=e.contentWindow=null,e.iframeElement=e.targetElm=null,e.selection&&(e.selection=e.selection.win=e.selection.dom=e.selection.dom.doc=null);}(e),e.destroyed=!0):e.remove());},Ub=(ib=function(e,t){return d(e)&&d(t)?Ub(e,t):t},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(0===e.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<e.length;r++){var o=e[r];for(var i in o)ye(o,i)&&(n[i]=ib(n[i],o[i]));}return n}),zb="autoresize_on_init,content_editable_state,convert_fonts_to_spans,inline_styles,padd_empty_with_br,block_elements,boolean_attributes,editor_deselector,editor_selector,elements,file_browser_callback_types,filepicker_validator_handler,force_hex_style_colors,force_p_newlines,gecko_spellcheck,images_dataimg_filter,media_scripts,mode,move_caret_before_on_enter_elements,non_empty_elements,self_closing_elements,short_ended_elements,special,spellchecker_select_languages,spellchecker_whitelist,tab_focus,table_responsive_width,text_block_elements,text_inline_elements,toolbar_drawer,types,validate,whitespace_elements,paste_word_valid_elements,paste_retain_style_properties,paste_convert_word_fake_lists".split(","),Hb="bbcode,colorpicker,contextmenu,fullpage,legacyoutput,spellchecker,textcolor".split(","),jb="imagetools,toc".split(","),Vb=function(e){var t=K(zb,(function(t){return ye(e,t)})),n=e.forced_root_block;return !1!==n&&""!==n||t.push("forced_root_block (false only)"),re(t)},qb=function(e){var t=_t.makeMap(e.plugins," "),n=function(e){return ye(t,e)},r=De(De([],K(Hb,n),!0),Z(jb,(function(e){return n(e)?[e+" (moving to premium)"]:[]})),!0);return re(r)},$b=mt().deviceType,Wb=$b.isTouch(),Kb=$b.isPhone(),Xb=$b.isTablet(),Yb=["lists","autolink","autosave"],Gb={table_grid:!1,object_resizing:!1,resize:!1},Jb=function(e){var t=m(e)?e.join(" "):e,n=V(l(t)?t.split(" "):[],Ue);return K(n,(function(e){return e.length>0}))},Qb=function(e,t){var n,r,o=(r={},pe(t,(function(t,n){return H(e,n)}),ge(n={}),ge(r)),{t:n,f:r});return function(e,t){return {sections:k(e),settings:k(t)}}(o.t,o.f)},Zb=function(e,t){return ye(e.sections(),t)},ey=function(e,t){return be(e,"toolbar_mode").orThunk((function(){return be(e,"toolbar_drawer").map((function(e){return !1===e?"wrap":e}))})).getOr(t)},ty=function(e,t){var n={resize:!1,toolbar_mode:ey(e,"scrolling"),toolbar_sticky:!1};return Re(Re(Re({},Gb),n),t?{menubar:!1}:{})},ny=function(e,t){var n=t.external_plugins?t.external_plugins:{};return e&&e.external_plugins?_t.extend({},e.external_plugins,n):n},ry=function(e,t,n,r){return e&&function(e,t,n){var r=e.sections();return Zb(e,t)&&r[t].theme===n}(t,"mobile","mobile")?K(r,_(H,Yb)):e&&Zb(t,"mobile")?r:n},oy=function(e,t,n,r){var o=Jb(n.forced_plugins),i=Jb(r.plugins),a=function(e,t){return Zb(e,t)?e.sections()[t]:{}}(t,"mobile"),u=a.plugins?Jb(a.plugins):i,c=function(e,t){return [].concat(Jb(e)).concat(Jb(t))}(o,ry(e,t,i,u));if(wt.browser.isIE()&&H(c,"rtc"))throw new Error("RTC plugin is not supported on IE 11.");return _t.extend(r,{plugins:c.join(" ")})},iy=function(e,t,n,r,o){var i=e?{mobile:ty(o.mobile||{},t)}:{},a=Qb(["mobile"],Ub(i,o)),u=_t.extend(n,r,a.settings(),function(e,t){return e&&Zb(t,"mobile")}(e,a)?function(e,t,n){void 0===n&&(n={});var r=e.sections(),o=be(r,t).getOr({});return _t.extend({},n,o)}(a,"mobile"):{},{validate:!0,external_plugins:ny(r,a.settings())});return oy(e,a,r,u)},ay=function(e,t,n,r,o){var i=function(e,t,n,r,o){var i={id:t,theme:"silver",toolbar_mode:ey(e,"floating"),plugins:"",document_base_url:n,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"<!DOCTYPE html>",visual:!0,font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,inline_styles:!0,convert_fonts_to_spans:!0,indent:!0,indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",entity_encoding:"named",url_converter:o.convertURL,url_converter_scope:o};return Re(Re({},i),r?Gb:{})}(o,t,n,Wb,e),a=iy(Kb||Xb,Kb,i,r,o);return !1!==a.deprecation_warnings&&function(e,t){var n=Vb(e),r=qb(t),o=r.length>0,i=n.length>0,a="mobile"===t.theme;if(o||i||a){var u="\n- ",c=a?"\n\nThemes:\n- mobile":"",s=o?"\n\nPlugins:\n- "+r.join(u):"",f=i?"\n\nSettings:\n- "+n.join(u):"";console.warn("The following deprecated features are currently enabled, these will be removed in TinyMCE 6.0. See https://www.tiny.cloud/docs/release-notes/6.0-upcoming-changes/ for more information."+c+s+f);}}(o,a),a},uy=function(e,t,n){return I.from(t.settings[n]).filter(e)},cy=function(e,t,n,r){var o,i=t in e.settings?e.settings[t]:n;return "hash"===r?function(e){var t={};return "string"==typeof e?q(e.indexOf("=")>0?e.split(/[;,](?![^=;,]*(?:[;,]|$))/):e.split(","),(function(e){var n=e.split("=");n.length>1?t[_t.trim(n[0])]=_t.trim(n[1]):t[_t.trim(n[0])]=_t.trim(n[0]);})):t=e,t}(i):"string"===r?uy(l,e,t).getOr(n):"number"===r?uy(C,e,t).getOr(n):"boolean"===r?uy(p,e,t).getOr(n):"object"===r?uy(d,e,t).getOr(n):"array"===r?uy(m,e,t).getOr(n):"string[]"===r?uy((o=l,function(e){return m(e)&&ee(e,o)}),e,t).getOr(n):"function"===r?uy(y,e,t).getOr(n):i},sy=(ab={},{add:function(e,t){ab[e]=t;},get:function(e){return ab[e]?ab[e]:{icons:{}}},has:function(e){return ye(ab,e)}}),fy=function(e,t){return t.dom[e]},ly=function(e,t){return parseInt(or(t,e),10)},dy=_(fy,"clientWidth"),my=_(fy,"clientHeight"),gy=_(ly,"margin-top"),py=_(ly,"margin-left"),hy=function(e,t,n){var r,o=Rt.fromDom(e.getBody()),i=e.inline?o:(r=o,Rt.fromDom(qt(r).dom.documentElement)),a=function(e,t,n,r){var o=function(e){return e.dom.getBoundingClientRect()}(t);return {x:n-(e?o.left+t.dom.clientLeft+py(t):0),y:r-(e?o.top+t.dom.clientTop+gy(t):0)}}(e.inline,i,t,n);return function(e,t,n){var r=dy(e),o=my(e);return t>=0&&n>=0&&t<=r&&n<=o}(i,a.x,a.y)},vy=function(e){var t,n=e.inline?e.getBody():e.getContentAreaContainer();return (t=n,I.from(t).map(Rt.fromDom)).map(bn).getOr(!1)},by=function(e){var t=[],n=function(){var t,n=e.theme;return n&&n.getNotificationManagerImpl?n.getNotificationManagerImpl():{open:t=function(){throw new Error("Theme did not provide a NotificationManager implementation.")},close:t,reposition:t,getArgs:t}},r=function(){return I.from(t[0])},o=function(){t.length>0&&n().reposition(t);},i=function(e){Q(t,(function(t){return t===e})).each((function(e){t.splice(e,1);}));},a=function(a,u){if(void 0===u&&(u=!0),!e.removed&&vy(e))return u&&e.fire("BeforeOpenNotification",{notification:a}),J(t,(function(e){return t=n().getArgs(e),r=a,!(t.type!==r.type||t.text!==r.text||t.progressBar||t.timeout||r.progressBar||r.timeout);var t,r;})).getOrThunk((function(){e.editorManager.setActive(e);var u=n().open(a,(function(){i(u),o(),r().fold((function(){return e.focus()}),(function(e){return Rt.fromDom(e.getEl()).dom.focus()}));}));return function(e){t.push(e);}(u),o(),e.fire("OpenNotification",{notification:Re({},u)}),u}))},u=k(t);return function(e){e.on("SkinLoaded",(function(){var t=function(e){return e.getParam("service_message")}(e);t&&a({text:t,type:"warning",timeout:0},!1),o();})),e.on("show ResizeEditor ResizeWindow NodeChange",(function(){ro.requestAnimationFrame(o);})),e.on("remove",(function(){q(t.slice(),(function(e){n().close(e);}));}));}(e),{open:a,close:function(){r().each((function(e){n().close(e),i(e),o();}));},getNotifications:u}},yy=Nu.PluginManager,Cy=Nu.ThemeManager;var xy=function(e){var t=[],n=function(){var t,n=e.theme;return n&&n.getWindowManagerImpl?n.getWindowManagerImpl():{open:t=function(){throw new Error("Theme did not provide a WindowManager implementation.")},openUrl:t,alert:t,confirm:t,close:t,getParams:t,setParams:t}},r=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t?t.apply(e,n):void 0}},o=function(n){t.push(n),function(t){e.fire("OpenWindow",{dialog:t});}(n);},i=function(n){!function(t){e.fire("CloseWindow",{dialog:t});}(n),0===(t=K(t,(function(e){return e!==n}))).length&&e.focus();},a=function(t){e.editorManager.setActive(e),am(e);var n=t();return o(n),n};return e.on("remove",(function(){q(t,(function(e){n().close(e);}));})),{open:function(e,t){return a((function(){return n().open(e,t,i)}))},openUrl:function(e){return a((function(){return n().openUrl(e,i)}))},alert:function(e,t,o){var i=n();i.alert(e,r(o||i,t));},confirm:function(e,t,o){var i=n();i.confirm(e,r(o||i,t));},close:function(){I.from(t[t.length-1]).each((function(e){n().close(e),i(e);}));}}},wy=function(e,t){e.notificationManager.open({type:"error",text:t});},Sy=function(e,t){e._skinLoaded?wy(e,t):e.on("SkinLoaded",(function(){wy(e,t);}));},ky=function(e,t,n){td(e,t,{message:n}),console.error(n);},Ny=function(e,t,n){return n?"Failed to load "+e+": "+n+" from url "+t:"Failed to load "+e+" url: "+t},Ey=function(e,t,n){ky(e,"PluginLoadError",Ny("plugin",t,n));},_y=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=window.console;r&&(r.error?r.error.apply(r,De([e],t,!1)):r.log.apply(r,De([e],t,!1)));},Ay=function(e){return Ry(e,function(e){var t=e.getParam("content_css");return l(t)?V(t.split(","),Ue):m(t)?t:!1===t||e.inline?[]:["default"]}(e))},Ry=function(e,t){var n=e.editorManager.baseURL+"/skins/content",r="content"+e.editorManager.suffix+".css",o=!0===e.inline;return V(t,(function(t){return function(e){return /^[a-z0-9\-]+$/i.test(e)}(t)&&!o?n+"/"+t+"/"+r:e.documentBaseURI.toAbsolute(t)}))},Dy=function(e){e.contentCSS=e.contentCSS.concat(Ay(e),function(e){return Ry(e,gs(e))}(e));},Ty=function(){var e={},t=function(e,t){return {status:e,resultUri:t}},n=function(t){return t in e};return {hasBlobUri:n,getResultUri:function(t){var n=e[t];return n?n.resultUri:null},isPending:function(t){return !!n(t)&&1===e[t].status},isUploaded:function(t){return !!n(t)&&2===e[t].status},markPending:function(n){e[n]=t(1,null);},markUploaded:function(n,r){e[n]=t(2,r);},removeFailed:function(t){delete e[t];},destroy:function(){e={};}}},Oy=0,By=function(e){return e+Oy+++(t=function(){return Math.round(4294967295*Math.random()).toString(36)},"s"+(new Date).getTime().toString(36)+t()+t()+t());var t;},Py=function(e,t){var n={},r=function(e,n,r,o){var i=new XMLHttpRequest;i.open("POST",t.url),i.withCredentials=t.credentials,i.upload.onprogress=function(e){o(e.loaded/e.total*100);},i.onerror=function(){r("Image upload failed due to a XHR Transport error. Code: "+i.status);},i.onload=function(){if(i.status<200||i.status>=300)r("HTTP Error: "+i.status);else {var e,o,a=JSON.parse(i.responseText);if(a&&"string"==typeof a.location)n((e=t.basePath,o=a.location,e?e.replace(/\/$/,"")+"/"+o.replace(/^\//,""):o));else r("Invalid JSON: "+i.responseText);}};var a=new FormData;a.append("file",e.blob(),e.filename()),i.send(a);},o=function(e,t){return {url:t,blobInfo:e,status:!0}},i=function(e,t,n){return {url:"",blobInfo:e,status:!1,error:{message:t,options:n}}},a=function(e,t){_t.each(n[e],(function(e){e(t);})),delete n[e];},u=function(r,u){return r=_t.grep(r,(function(t){return !e.isUploaded(t.blobUri())})),Zr.all(_t.map(r,(function(r){return e.isPending(r.blobUri())?function(e){var t=e.blobUri();return new Zr((function(e){n[t]=n[t]||[],n[t].push(e);}))}(r):function(t,n,r){return e.markPending(t.blobUri()),new Zr((function(u){var c;try{var s=function(){c&&c.close();};n(t,(function(n){s(),e.markUploaded(t.blobUri(),n),a(t.blobUri(),o(t,n)),u(o(t,n));}),(function(n,r){var o=r||{};s(),e.removeFailed(t.blobUri()),a(t.blobUri(),i(t,n,o)),u(i(t,n,o));}),(function(e){e<0||e>100||I.from(c).orThunk((function(){return I.from(r).map(R)})).each((function(t){c=t,t.progressBar.value(e);}));}));}catch(e){u(i(t,e.message,{}));}}))}(r,t.handler,u)})))};return !1===y(t.handler)&&(t.handler=r),{upload:function(e,n){return t.url||t.handler!==r?u(e,n):new Zr((function(e){e([]);}))}}},Ly=function(e){return function(){return e.notificationManager.open({text:e.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0})}},Iy=function(e,t){return Py(t,{url:as(e),basePath:us(e),credentials:cs(e),handler:ss(e)})},My=function(e){var t,n,r=function(){var e=[],t=function(e){if(!e.blob||!e.base64)throw new Error("blob and base64 representations of the image are required for BlobInfo to be created");var t,n=e.id||By("blobid"),r=e.name||n,o=e.blob;return {id:k(n),name:k(r),filename:k(e.filename||r+"."+(t=o.type,{"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png","image/apng":"apng","image/avif":"avif","image/svg+xml":"svg","image/webp":"webp","image/bmp":"bmp","image/tiff":"tiff"}[t.toLowerCase()]||"dat")),blob:k(o),base64:k(e.base64),blobUri:k(e.blobUri||URL.createObjectURL(o)),uri:k(e.uri)}},n=function(t){return J(e,t).getOrUndefined()},r=function(e){return n((function(t){return t.id()===e}))};return {create:function(e,n,r,o,i){if(l(e))return t({id:e,name:o,filename:i,blob:n,base64:r});if(d(e))return t(e);throw new Error("Unknown input type")},add:function(t){r(t.id())||e.push(t);},get:r,getByUri:function(e){return n((function(t){return t.blobUri()===e}))},getByData:function(e,t){return n((function(n){return n.base64()===e&&n.blob().type===t}))},findFirst:n,removeByUri:function(t){e=K(e,(function(e){return e.blobUri()!==t||(URL.revokeObjectURL(e.blobUri()),!1)}));},destroy:function(){q(e,(function(e){URL.revokeObjectURL(e.blobUri());})),e=[];}}}(),o=Ty(),i=[],a=function(e){var t=Cu(null);return e.on("change AddUndo",(function(e){t.set(Re({},e.level));})),{fireIfChanged:function(){var n=e.undoManager.data;ae(n).filter((function(e){return !$v(t.get(),e)})).each((function(t){e.setDirty(!0),e.fire("change",{level:t,lastLevel:oe(n,n.length-2).getOrNull()});}));}}}(e),u=function(t){return function(n){return e.selection?t(n):[]}},c=function(e,t,n){var r=0;do{-1!==(r=e.indexOf(t,r))&&(e=e.substring(0,r)+n+e.substr(r+t.length),r+=n.length-t.length+1);}while(-1!==r);return e},s=function(e,t,n){var r='src="'+n+'"'+(n===wt.transparentSrc?' data-mce-placeholder="1"':"");return e=c(e,'src="'+t+'"',r),e=c(e,'data-mce-src="'+t+'"','data-mce-src="'+n+'"')},f=function(t,n){q(e.undoManager.data,(function(e){"fragmented"===e.type?e.fragments=V(e.fragments,(function(e){return s(e,t,n)})):e.content=s(e.content,t,n);}));},m=function(n){return t||(t=Iy(e,o)),h().then(u((function(o){var i=V(o,(function(e){return e.blobInfo}));return t.upload(i,Ly(e)).then(u((function(t){var i=[],u=V(t,(function(t,n){var a=o[n].blobInfo,u=o[n].image;return t.status&&function(e){return e.getParam("images_replace_blob_uris",!0,"boolean")}(e)?(r.removeByUri(u.src),Gv(e)||function(t,n){var r,o=e.convertURL(n,"src");f(t.src,n),e.$(t).attr({src:os(e)?(r=n,r+(-1===r.indexOf("?")?"?":"&")+(new Date).getTime()):n,"data-mce-src":o});}(u,t.url)):t.error&&(t.error.options.remove&&(f(u.getAttribute("src"),wt.transparentSrc),i.push(u)),function(e,t){Sy(e,ku.translate(["Failed to upload image: {0}",t]));}(e,t.error.message)),{element:u,status:t.status,uploadUri:t.url,blobInfo:a}}));return u.length>0&&a.fireIfChanged(),i.length>0&&(Gv(e)?console.error("Removing images on failed uploads is currently unsupported for RTC"):e.undoManager.transact((function(){q(i,(function(t){e.dom.remove(t),r.removeByUri(t.src);}));}))),n&&n(u),u})))})))},g=function(t){if(rs(e))return m(t)},p=function(t){if(!1===ee(i,(function(e){return e(t)})))return !1;if(0===t.getAttribute("src").indexOf("data:")){var n=function(e){return e.getParam("images_dataimg_filter",O,"function")}(e);return n(t)}return !0},h=function(){return n||(n=bb(o,r)),n.findAll(e.getBody(),p).then(u((function(t){return t=K(t,(function(t){return "string"!=typeof t||(Sy(e,t),!1)})),Gv(e)||q(t,(function(e){f(e.image.src,e.blobInfo.blobUri()),e.image.src=e.blobInfo.blobUri(),e.image.removeAttribute("data-mce-src");})),t})))},v=function(t){return t.replace(/src="(blob:[^"]+)"/g,(function(t,n){var i=o.getResultUri(n);if(i)return 'src="'+i+'"';var a=r.getByUri(n);return a||(a=Y(e.editorManager.get(),(function(e,t){return e||t.editorUpload&&t.editorUpload.blobCache.getByUri(n)}),null)),a?'src="data:'+a.blob().type+";base64,"+a.base64()+'"':t}))};return e.on("SetContent",(function(){rs(e)?g():h();})),e.on("RawSaveContent",(function(e){e.content=v(e.content);})),e.on("GetContent",(function(e){e.source_view||"raw"===e.format||"tree"===e.format||(e.content=v(e.content));})),e.on("PostRender",(function(){e.parser.addNodeFilter("img",(function(e){q(e,(function(e){var t=e.attr("src");if(!r.getByUri(t)){var n=o.getResultUri(t);n&&e.attr("src",n);}}));}));})),{blobCache:r,addFilter:function(e){i.push(e);},uploadImages:m,uploadImagesAuto:g,scanForImages:h,destroy:function(){r.destroy(),o.destroy(),n=t=null;}}},Fy=function(e){var t={},n=function(e,r){e&&(l(e)?(m(r)||(r=[r]),q(r,(function(e){h(e.deep)&&(e.deep=!gl(e)),h(e.split)&&(e.split=!gl(e)||pl(e)),h(e.remove)&&gl(e)&&!pl(e)&&(e.remove="none"),gl(e)&&pl(e)&&(e.mixed=!0,e.block_expand=!0),l(e.classes)&&(e.classes=e.classes.split(/\s+/));})),t[e]=r):le(e,(function(e,t){n(t,e);})));};return n(function(e){var t={valigntop:[{selector:"td,th",styles:{verticalAlign:"top"}}],valignmiddle:[{selector:"td,th",styles:{verticalAlign:"middle"}}],valignbottom:[{selector:"td,th",styles:{verticalAlign:"bottom"}}],alignleft:[{selector:"figure.image",collapsed:!1,classes:"align-left",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"left"},inherit:!1,preview:!1,defaultBlock:"div"},{selector:"img,table,audio,video",collapsed:!1,styles:{float:"left"},preview:"font-family font-size"}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"center"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"figure.image",collapsed:!1,classes:"align-center",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"img,audio,video",collapsed:!1,styles:{display:"block",marginLeft:"auto",marginRight:"auto"},preview:!1},{selector:"table",collapsed:!1,styles:{marginLeft:"auto",marginRight:"auto"},preview:"font-family font-size"}],alignright:[{selector:"figure.image",collapsed:!1,classes:"align-right",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"right"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"img,table,audio,video",collapsed:!1,styles:{float:"right"},preview:"font-family font-size"}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"justify"},inherit:!1,defaultBlock:"div",preview:"font-family font-size"}],bold:[{inline:"strong",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all",preserve_attributes:["class","style"]}],italic:[{inline:"em",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all",preserve_attributes:["class","style"]}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all",preserve_attributes:["class","style"]}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:!0},{inline:"strike",remove:"all",preserve_attributes:["class","style"]},{inline:"s",remove:"all",preserve_attributes:["class","style"]}],forecolor:{inline:"span",styles:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},fontname:{inline:"span",toggle:!1,styles:{fontFamily:"%value"},clear_child_styles:!0},fontsize:{inline:"span",toggle:!1,styles:{fontSize:"%value"},clear_child_styles:!0},lineheight:{selector:"h1,h2,h3,h4,h5,h6,p,li,td,th,div",defaultBlock:"p",styles:{lineHeight:"%value"}},fontsize_class:{inline:"span",attributes:{class:"%value"}},blockquote:{block:"blockquote",wrapper:!0,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},code:{inline:"code"},link:{inline:"a",selector:"a",remove:"all",split:!0,deep:!0,onmatch:function(e,t,n){return Dn(e)&&e.hasAttribute("href")},onformat:function(t,n,r){_t.each(r,(function(n,r){e.setAttrib(t,r,n);}));}},lang:{inline:"span",clear_child_styles:!0,remove_similar:!0,attributes:{lang:"%value","data-mce-lang":function(e){var t;return null!==(t=null==e?void 0:e.customValue)&&void 0!==t?t:null}}},removeformat:[{selector:"b,strong,em,i,font,u,strike,s,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins,small",remove:"all",split:!0,expand:!1,block_expand:!0,deep:!0},{selector:"span",attributes:["style","class"],remove:"empty",split:!0,expand:!1,deep:!0},{selector:"*",attributes:["style","class"],split:!1,expand:!1,deep:!0}]};return _t.each("p h1 h2 h3 h4 h5 h6 div address pre dt dd samp".split(/\s/),(function(e){t[e]={block:e,remove:"all"};})),t}(e.dom)),n(function(e){return e.getParam("formats")}(e)),{get:function(e){return b(e)?t[e]:t},has:function(e){return ye(t,e)},register:n,unregister:function(e){return e&&t[e]&&delete t[e],t}}},Uy=_t.each,zy=pu.DOM,Hy=function(e,t){var n,r,o,i=t&&t.schema||Ai({}),a=function(e){r="string"==typeof e?{name:e,classes:[],attrs:{}}:e;var t=zy.create(r.name);return function(e,t){t.classes.length&&zy.addClass(e,t.classes.join(" ")),zy.setAttribs(e,t.attrs);}(t,r),t},u=function(e,t,n){var r,o,c=t.length>0&&t[0],s=c&&c.name,f=function(e,t){var n="string"!=typeof e?e.nodeName.toLowerCase():e,r=i.getElementRule(n),o=r&&r.parentsRequired;return !(!o||!o.length)&&(t&&-1!==_t.inArray(o,t)?t:o[0])}(e,s);if(f)s===f?(o=t[0],t=t.slice(1)):o=f;else if(c)o=t[0],t=t.slice(1);else if(!n)return e;return o&&(r=a(o)).appendChild(e),n&&(r||(r=zy.create("div")).appendChild(e),_t.each(n,(function(t){var n=a(t);r.insertBefore(n,e);}))),u(r,t,o&&o.siblings)};return e&&e.length?(r=e[0],n=a(r),(o=zy.create("div")).appendChild(u(n,e.slice(1),r.siblings)),o):""},jy=function(e){var t,n={classes:[],attrs:{}};return "*"!==(e=n.selector=_t.trim(e))&&(t=e.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g,(function(e,t,r,o,i){switch(t){case"#":n.attrs.id=r;break;case".":n.classes.push(r);break;case":":-1!==_t.inArray("checked disabled enabled read-only required".split(" "),r)&&(n.attrs[r]=r);}if("["===o){var a=i.match(/([\w\-]+)(?:\=\"([^\"]+))?/);a&&(n.attrs[a[1]]=a[2]);}return ""}))),n.name=t||"div",n},Vy=function(e,t){var n,r,o,i="",a=function(e){var t=e.getParam("preview_styles","font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow");return l(t)?t:""}(e);if(""===a)return "";var u=function(e){return e.replace(/%(\w+)/g,"")};if("string"==typeof t){if(!(t=e.formatter.get(t)))return;t=t[0];}if("preview"in t){var c=be(t,"preview");if(Xn(c,!1))return "";a=c.getOr(a);}n=t.block||t.inline||"span";var s,f=(s=t.selector)&&"string"==typeof s?(s=(s=s.split(/\s*,\s*/)[0]).replace(/\s*(~\+|~|\+|>)\s*/g,"$1"),_t.map(s.split(/(?:>|\s+(?![^\[\]]+\]))/),(function(e){var t=_t.map(e.split(/(?:~\+|~|\+)/),jy),n=t.pop();return t.length&&(n.siblings=t),n})).reverse()):[];f.length?(f[0].name||(f[0].name=n),n=t.selector,r=Hy(f,e)):r=Hy([n],e);var d=zy.select(n,r)[0]||r.firstChild;return Uy(t.styles,(function(e,t){var n=u(e);n&&zy.setStyle(d,t,n);})),Uy(t.attributes,(function(e,t){var n=u(e);n&&zy.setAttrib(d,t,n);})),Uy(t.classes,(function(e){var t=u(e);zy.hasClass(d,t)||zy.addClass(d,t);})),e.fire("PreviewFormats"),zy.setStyles(r,{position:"absolute",left:-65535}),e.getBody().appendChild(r),o=zy.getStyle(e.getBody(),"fontSize",!0),o=/px$/.test(o)?parseInt(o,10):0,Uy(a.split(" "),(function(t){var n=zy.getStyle(d,t,!0);if(!("background-color"===t&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(n)&&(n=zy.getStyle(e.getBody(),t,!0),"#ffffff"===zy.toHex(n).toLowerCase())||"color"===t&&"#000000"===zy.toHex(n).toLowerCase())){if("font-size"===t&&/em|%$/.test(n)){if(0===o)return;n=parseFloat(n)/(/%$/.test(n)?100:1)*o+"px";}"border"===t&&n&&(i+="padding:0 2px;"),i+=t+":"+n+";";}})),e.fire("AfterPreviewFormats"),zy.remove(r),i},qy=function(e){var t=Fy(e),n=Cu(null);return function(e){e.addShortcut("meta+b","","Bold"),e.addShortcut("meta+i","","Italic"),e.addShortcut("meta+u","","Underline");for(var t=1;t<=6;t++)e.addShortcut("access+"+t,"",["FormatBlock",!1,"h"+t]);e.addShortcut("access+7","",["FormatBlock",!1,"p"]),e.addShortcut("access+8","",["FormatBlock",!1,"div"]),e.addShortcut("access+9","",["FormatBlock",!1,"address"]);}(e),Th(e),{get:t.get,has:t.has,register:t.register,unregister:t.unregister,apply:function(t,n,r){!function(e,t,n,r){Zv(e).formatter.apply(t,n,r);}(e,t,n,r);},remove:function(t,n,r,o){!function(e,t,n,r,o){Zv(e).formatter.remove(t,n,r,o);}(e,t,n,r,o);},toggle:function(t,n,r){!function(e,t,n,r){Zv(e).formatter.toggle(t,n,r);}(e,t,n,r);},match:function(t,n,r,o){return function(e,t,n,r,o){return Zv(e).formatter.match(t,n,r,o)}(e,t,n,r,o)},closest:function(t){return function(e,t){return Zv(e).formatter.closest(t)}(e,t)},matchAll:function(t,n){return function(e,t,n){return Zv(e).formatter.matchAll(t,n)}(e,t,n)},matchNode:function(t,n,r,o){return function(e,t,n,r,o){return Zv(e).formatter.matchNode(t,n,r,o)}(e,t,n,r,o)},canApply:function(t){return function(e,t){return Zv(e).formatter.canApply(t)}(e,t)},formatChanged:function(t,r,o,i){return function(e,t,n,r,o,i){return Zv(e).formatter.formatChanged(t,n,r,o,i)}(e,n,t,r,o,i)},getCssText:_(Vy,e)}},$y=function(e){switch(e.toLowerCase()){case"undo":case"redo":case"mcerepaint":case"mcefocus":return !0;default:return !1}},Wy=function(e){var t=Eu(),n=Cu(0),r=Cu(0),o={data:[],typing:!1,beforeChange:function(){!function(e,t,n){Zv(e).undoManager.beforeChange(t,n);}(e,n,t);},add:function(i,a){return function(e,t,n,r,o,i,a){return Zv(e).undoManager.add(t,n,r,o,i,a)}(e,o,r,n,t,i,a)},undo:function(){return function(e,t,n,r){return Zv(e).undoManager.undo(t,n,r)}(e,o,n,r)},redo:function(){return function(e,t,n){return Zv(e).undoManager.redo(t,n)}(e,r,o.data)},clear:function(){!function(e,t,n){Zv(e).undoManager.clear(t,n);}(e,o,r);},reset:function(){!function(e,t){Zv(e).undoManager.reset(t);}(e,o);},hasUndo:function(){return function(e,t,n){return Zv(e).undoManager.hasUndo(t,n)}(e,o,r)},hasRedo:function(){return function(e,t,n){return Zv(e).undoManager.hasRedo(t,n)}(e,o,r)},transact:function(t){return function(e,t,n,r){return Zv(e).undoManager.transact(t,n,r)}(e,o,n,t)},ignore:function(t){!function(e,t,n){Zv(e).undoManager.ignore(t,n);}(e,n,t);},extra:function(t,n){!function(e,t,n,r,o){Zv(e).undoManager.extra(t,n,r,o);}(e,o,r,t,n);}};return Gv(e)||function(e,t,n){var r=Cu(!1),o=function(e){Kv(t,!1,n),t.add({},e);};e.on("init",(function(){t.add();})),e.on("BeforeExecCommand",(function(e){var r=e.command;$y(r)||(Xv(t,n),t.beforeChange());})),e.on("ExecCommand",(function(e){var t=e.command;$y(t)||o(e);})),e.on("ObjectResizeStart cut",(function(){t.beforeChange();})),e.on("SaveContent ObjectResized blur",o),e.on("dragend",o),e.on("keyup",(function(n){var i=n.keyCode;n.isDefaultPrevented()||((i>=33&&i<=36||i>=37&&i<=40||45===i||n.ctrlKey)&&(o(),e.nodeChanged()),46!==i&&8!==i||e.nodeChanged(),r.get()&&t.typing&&!1===$v(Hv(e),t.data[0])&&(!1===e.isDirty()&&(e.setDirty(!0),e.fire("change",{level:t.data[0],lastLevel:null})),e.fire("TypingUndo"),r.set(!1),e.nodeChanged()));})),e.on("keydown",(function(e){var i=e.keyCode;if(!e.isDefaultPrevented())if(i>=33&&i<=36||i>=37&&i<=40||45===i)t.typing&&o(e);else {var a=e.ctrlKey&&!e.altKey||e.metaKey;!(i<16||i>20)||224===i||91===i||t.typing||a||(t.beforeChange(),Kv(t,!0,n),t.add({},e),r.set(!0));}})),e.on("mousedown",(function(e){t.typing&&o(e);})),e.on("input",(function(e){var t;e.inputType&&("insertReplacementText"===e.inputType||"insertText"===(t=e).inputType&&null===t.data||function(e){return "insertFromPaste"===e.inputType||"insertFromDrop"===e.inputType}(e))&&o(e);})),e.on("AddUndo Undo Redo ClearUndos",(function(t){t.isDefaultPrevented()||e.nodeChanged();}));}(e,o,n),function(e){e.addShortcut("meta+z","","Undo"),e.addShortcut("meta+y,meta+shift+z","","Redo");}(e),o},Ky=[9,27,od.HOME,od.END,19,20,44,144,145,33,34,45,16,17,18,91,92,93,od.DOWN,od.UP,od.LEFT,od.RIGHT].concat(wt.browser.isFirefox()?[224]:[]),Xy="data-mce-placeholder",Yy=function(e){return "keydown"===e.type||"keyup"===e.type},Gy=function(e){var t=e.keyCode;return t===od.BACKSPACE||t===od.DELETE},Jy=function(e){var t=e.dom,n=ts(e),r=function(e){return e.getParam("placeholder",Qc.getAttrib(e.getElement(),"placeholder"),"string")}(e),o=function(i,a){if(!function(e){if(Yy(e)){var t=e.keyCode;return !Gy(e)&&(od.metaKeyPressed(e)||e.altKey||t>=112&&t<=123||H(Ky,t))}return !1}(i)){var u=e.getBody(),c=!function(e){return Yy(e)&&!(Gy(e)||"keyup"===e.type&&229===e.keyCode)}(i)&&function(e,t,n){if(ei(Rt.fromDom(t),!1)){var r=""===n,o=t.firstElementChild;return !o||!e.getStyle(t.firstElementChild,"padding-left")&&!e.getStyle(t.firstElementChild,"padding-right")&&(r?!e.isBlock(o):n===o.nodeName.toLowerCase())}return !1}(t,u,n);(""!==t.getAttrib(u,Xy)!==c||a)&&(t.setAttrib(u,Xy,c?r:null),t.setAttrib(u,"aria-placeholder",c?r:null),function(e,t){e.fire("PlaceholderToggle",{state:t});}(e,c),e.on(c?"keydown":"keyup",o),e.off(c?"keyup":"keydown",o));}};r&&e.on("init",(function(t){o(t,!0),e.on("change SetContent ExecCommand",o),e.on("paste",(function(t){return ro.setEditorTimeout(e,(function(){return o(t)}))}));}));},Qy=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,Zy=function(e,t){return Tt(Rt.fromDom(t),function(e){return e.getParam("inline_boundaries_selector","a[href],code,.mce-annotation","string")}(e))},eC=function(e){return "rtl"===pu.DOM.getStyle(e,"direction",!0)||(t=e.textContent,Qy.test(t));var t;},tC=function(e,t,n){var r=function(e,t,n){return K(pu.DOM.getParents(n.container(),"*",t),e)}(e,t,n);return I.from(r[r.length-1])},nC=function(e,t){if(!t)return t;var n=t.container(),r=t.offset();return e?Eo(n)?Fn(n.nextSibling)?Ac(n.nextSibling,0):Ac.after(n):Ro(t)?Ac(n,r+1):t:Eo(n)?Fn(n.previousSibling)?Ac(n.previousSibling,n.previousSibling.data.length):Ac.before(n):Do(t)?Ac(n,r-1):t},rC=_(nC,!0),oC=_(nC,!1),iC=function(e){return mo(e)||po(e)},aC=function(e,t){return Lt(e,t)?Xr(t,iC,function(e){return function(t){return Bt(e,Rt.fromDom(t.dom.parentNode))}}(e)):I.none()},uC=function(e){e.dom.isEmpty(e.getBody())&&(e.setContent(""),function(e){var t=e.getBody(),n=t.firstChild&&e.dom.isBlock(t.firstChild)?t.firstChild:t;e.selection.setCursorLocation(n,0);}(e));},cC=function(e,t){return {from:e,to:t}},sC=function(e,t){var n=Rt.fromDom(e),r=Rt.fromDom(t.container());return aC(n,r).map((function(e){return function(e,t){return {block:e,position:t}}(e,t)}))},fC=function(e,t,n){var r=sC(e,Ac.fromRangeStart(n)),o=r.bind((function(n){return Rf(t,e,n.position).bind((function(n){return sC(e,n).map((function(n){return function(e,t,n){return jn(n.position.getNode())&&!1===ei(n.block)?Of(!1,n.block.dom).bind((function(r){return r.isEqual(n.position)?Rf(t,e,r).bind((function(t){return sC(e,t)})):I.some(n)})).getOr(n):n}(e,t,n)}))}))}));return Yn(r,o,cC).filter((function(e){return function(e){return !1===Bt(e.from.block,e.to.block)}(e)&&function(e){return Wt(e.from.block).bind((function(t){return Wt(e.to.block).filter((function(e){return Bt(t,e)}))})).isSome()}(e)&&function(e){return !1===$n(e.from.block.dom)&&!1===$n(e.to.block.dom)}(e)}))},lC=function(e){var t=Jt(e);return Q(t,so).fold(k(t),(function(e){return t.slice(0,e)}))},dC=function(e){var t=lC(e);return q(t,hn),t},mC=function(e,t){var n=Ng(t,e);return J(n.reverse(),(function(e){return ei(e)})).each(hn)},gC=function(e,t,n,r){if(ei(n))return xg(n),Lf(n.dom);0===K(Yt(r),(function(e){return !ei(e)})).length&&ei(t)&&fn(r,Rt.fromTag("br"));var o=Pf(n.dom,Ac.before(r.dom));return q(dC(t),(function(e){fn(r,e);})),mC(e,t),o},pC=function(e,t,n){if(ei(n))return hn(n),ei(t)&&xg(t),Lf(t.dom);var r=If(n.dom);return q(dC(t),(function(e){mn(n,e);})),mC(e,t),r},hC=function(e,t){return Lt(t,e)?function(e,t){var n=Ng(t,e);return I.from(n[n.length-1])}(t,e):I.none()},vC=function(e,t){Of(e,t.dom).map((function(e){return e.getNode()})).map(Rt.fromDom).filter(lo).each(hn);},bC=function(e,t,n){return vC(!0,t),vC(!1,n),hC(t,n).fold(_(pC,e,t,n),_(gC,e,t,n))},yC=function(e,t,n,r){return t?bC(e,r,n):bC(e,n,r)},CC=function(e,t){var n=Rt.fromDom(e.getBody()),r=function(e,t,n){return n.collapsed?fC(e,t,n):I.none()}(n.dom,t,e.selection.getRng()).bind((function(e){return yC(n,t,e.from.block,e.to.block)}));return r.each((function(t){e.selection.setRng(t.toRange());})),r.isSome()},xC=function(e,t){var n=Rt.fromDom(t),r=_(Bt,e);return Kr(n,vo,r).isSome()},wC=function(e,t){var n=Pf(e.dom,Ac.fromRangeStart(t)).isNone(),r=Bf(e.dom,Ac.fromRangeEnd(t)).isNone();return !function(e,t){return xC(e,t.startContainer)||xC(e,t.endContainer)}(e,t)&&n&&r},SC=function(e){var t=Rt.fromDom(e.getBody()),n=e.selection.getRng();return wC(t,n)?function(e){return e.setContent(""),e.selection.setCursorLocation(),!0}(e):function(e,t){var n=t.getRng();return Yn(aC(e,Rt.fromDom(n.startContainer)),aC(e,Rt.fromDom(n.endContainer)),(function(r,o){return !1===Bt(r,o)&&(n.deleteContents(),yC(e,!0,r,o).each((function(e){t.setRng(e.toRange());})),!0)})).getOr(!1)}(t,e.selection)},kC=function(e,t){return !e.selection.isCollapsed()&&SC(e)},NC=qn,EC=$n,_C=function(e,t,n,r,o){return I.from(t._selectionOverrides.showCaret(e,n,r,o))},AC=function(e,t){return e.fire("BeforeObjectSelected",{target:t}).isDefaultPrevented()?I.none():I.some(function(e){var t=e.ownerDocument.createRange();return t.selectNode(e),t}(t))},RC=function(e,t,n){var r=uf(1,e.getBody(),t),o=Ac.fromRangeStart(r),i=o.getNode();if(Us(i))return _C(1,e,i,!o.isAtEnd(),!1);var a=o.getNode(!0);if(Us(a))return _C(1,e,a,!1,!1);var u=e.dom.getParent(o.getNode(),(function(e){return EC(e)||NC(e)}));return Us(u)?_C(1,e,u,!1,n):I.none()},DC=function(e,t,n){return t.collapsed?RC(e,t,n).getOr(t):t},TC=function(e){return bg(e)||gg(e)},OC=function(e){return yg(e)||pg(e)},BC=function(e,t,n,r,o,i){return _C(r,e,i.getNode(!o),o,!0).each((function(n){if(t.collapsed){var r=t.cloneRange();o?r.setEnd(n.startContainer,n.startOffset):r.setStart(n.endContainer,n.endOffset),r.deleteContents();}else t.deleteContents();e.selection.setRng(n);})),function(e,t){Fn(t)&&0===t.data.length&&e.remove(t);}(e.dom,n),!0},PC=function(e,t){return function(e,t){var n=e.selection.getRng();if(!Fn(n.commonAncestorContainer))return !1;var r=t?Rc.Forwards:Rc.Backwards,o=kf(e.getBody()),i=_(lf,t?o.next:o.prev),a=t?TC:OC,u=sf(r,e.getBody(),n),c=nC(t,i(u));if(!c||!df(u,c))return !1;if(a(c))return BC(e,n,u.getNode(),r,t,c);var s=i(c);return !!(s&&a(s)&&df(c,s))&&BC(e,n,u.getNode(),r,t,s)}(e,t)},LC=kr([{remove:["element"]},{moveToElement:["element"]},{moveToPosition:["position"]}]),IC=function(e,t,n,r){var o=r.getNode(!1===t);return aC(Rt.fromDom(e),Rt.fromDom(n.getNode())).map((function(e){return ei(e)?LC.remove(e.dom):LC.moveToElement(o)})).orThunk((function(){return I.some(LC.moveToElement(o))}))},MC=function(e,t,n){return Rf(t,e,n).bind((function(r){return o=r.getNode(),vo(Rt.fromDom(o))||po(Rt.fromDom(o))||function(e,t,n,r){var o=function(t){return fo(Rt.fromDom(t))&&!Zs(n,r,e)};return cf(!t,n).fold((function(){return cf(t,r).fold(T,o)}),o)}(e,t,n,r)?I.none():t&&$n(r.getNode())||!1===t&&$n(r.getNode(!0))?IC(e,t,n,r):t&&yg(n)||!1===t&&bg(n)?I.some(LC.moveToPosition(r)):I.none();var o;}))},FC=function(e,t,n){return function(e,t){var n=t.getNode(!1===e),r=e?"after":"before";return Dn(n)&&n.getAttribute("data-mce-caret")===r}(t,n)?function(e,t){return e&&$n(t.nextSibling)?I.some(LC.moveToElement(t.nextSibling)):!1===e&&$n(t.previousSibling)?I.some(LC.moveToElement(t.previousSibling)):I.none()}(t,n.getNode(!1===t)).fold((function(){return MC(e,t,n)}),I.some):MC(e,t,n).bind((function(t){return function(e,t,n){return n.fold((function(e){return I.some(LC.remove(e))}),(function(e){return I.some(LC.moveToElement(e))}),(function(n){return Zs(t,n,e)?I.none():I.some(LC.moveToPosition(n))}))}(e,n,t)}))},UC=function(e,t){return I.from(Zl(e.getBody(),t))},zC=function(e,t){var n=e.selection.getNode();return UC(e,n).filter($n).fold((function(){return function(e,t,n){var r=uf(t?1:-1,e,n),o=Ac.fromRangeStart(r),i=Rt.fromDom(e);return !1===t&&yg(o)?I.some(LC.remove(o.getNode(!0))):t&&bg(o)?I.some(LC.remove(o.getNode())):!1===t&&bg(o)&&Mg(i,o)?Fg(i,o).map((function(e){return LC.remove(e.getNode())})):t&&yg(o)&&Ig(i,o)?Ug(i,o).map((function(e){return LC.remove(e.getNode())})):FC(e,t,o)}(e.getBody(),t,e.selection.getRng()).exists((function(n){return n.fold(function(e,t){return function(n){return e._selectionOverrides.hideFakeCaret(),gp(e,t,Rt.fromDom(n)),!0}}(e,t),function(e,t){return function(n){var r=t?Ac.before(n):Ac.after(n);return e.selection.setRng(r.toRange()),!0}}(e,t),function(e){return function(t){return e.selection.setRng(t.toRange()),!0}}(e))}))}),O)},HC=function(e,t){var n=e.selection.getNode();return !(!$n(n)||Wn(n))&&UC(e,n.parentNode).filter($n).fold((function(){var n;return n=Rt.fromDom(e.getBody()),q(Mu(n,".mce-offscreen-selection"),hn),gp(e,t,Rt.fromDom(e.selection.getNode())),uC(e),!0}),O)},jC=function(e){var t=e.dom,n=e.selection,r=Zl(e.getBody(),n.getNode());if(qn(r)&&t.isBlock(r)&&t.isEmpty(r)){var o=t.create("br",{"data-mce-bogus":"1"});t.setHTML(r,""),r.appendChild(o),n.setRng(Ac.before(o).toRange());}return !0},VC=function(e,t){return e.selection.isCollapsed()?zC(e,t):HC(e,t)},qC=function(e,t){return !!e.selection.isCollapsed()&&function(e,t){var n=Ac.fromRangeStart(e.selection.getRng());return Rf(t,e.getBody(),n).filter((function(e){return t?dg(e):mg(e)})).bind((function(e){return I.from(ef(t?0:-1,e))})).exists((function(t){return e.selection.select(t),!0}))}(e,t)},$C=Fn,WC=function(e){return $C(e)&&e.data[0]===Co},KC=function(e){return $C(e)&&e.data[e.data.length-1]===Co},XC=function(e){return e.ownerDocument.createTextNode(Co)},YC=function(e,t){return e?function(e){if($C(e.previousSibling))return KC(e.previousSibling)||e.previousSibling.appendData(Co),e.previousSibling;if($C(e))return WC(e)||e.insertData(0,Co),e;var t=XC(e);return e.parentNode.insertBefore(t,e),t}(t):function(e){if($C(e.nextSibling))return WC(e.nextSibling)||e.nextSibling.insertData(0,Co),e.nextSibling;if($C(e))return KC(e)||e.appendData(Co),e;var t=XC(e);return e.nextSibling?e.parentNode.insertBefore(t,e.nextSibling):e.parentNode.appendChild(t),t}(t)},GC=_(YC,!0),JC=_(YC,!1),QC=function(e,t){return Fn(e.container())?YC(t,e.container()):YC(t,e.getNode())},ZC=function(e,t){var n=t.get();return n&&e.container()===n&&Eo(n)},ex=function(e,t){return t.fold((function(t){Ts(e.get());var n=GC(t);return e.set(n),I.some(Ac(n,n.length-1))}),(function(t){return Lf(t).map((function(t){if(ZC(t,e))return Ac(e.get(),1);Ts(e.get());var n=QC(t,!0);return e.set(n),Ac(n,1)}))}),(function(t){return If(t).map((function(t){if(ZC(t,e))return Ac(e.get(),e.get().length-1);Ts(e.get());var n=QC(t,!1);return e.set(n),Ac(n,n.length-1)}))}),(function(t){Ts(e.get());var n=JC(t);return e.set(n),I.some(Ac(n,1))}))},tx=function(e,t){for(var n=0;n<e.length;n++){var r=e[n].apply(null,t);if(r.isSome())return r}return I.none()},nx=kr([{before:["element"]},{start:["element"]},{end:["element"]},{after:["element"]}]),rx=function(e,t){var n=Qs(t,e);return n||e},ox=function(e,t,n){var r=rC(n),o=rx(t,r.container());return tC(e,o,r).fold((function(){return Bf(o,r).bind(_(tC,e,o)).map((function(e){return nx.before(e)}))}),I.none)},ix=function(e,t){return null===Uf(e,t)},ax=function(e,t,n){return tC(e,t,n).filter(_(ix,t))},ux=function(e,t,n){var r=oC(n);return ax(e,t,r).bind((function(e){return Pf(e,r).isNone()?I.some(nx.start(e)):I.none()}))},cx=function(e,t,n){var r=rC(n);return ax(e,t,r).bind((function(e){return Bf(e,r).isNone()?I.some(nx.end(e)):I.none()}))},sx=function(e,t,n){var r=oC(n),o=rx(t,r.container());return tC(e,o,r).fold((function(){return Pf(o,r).bind(_(tC,e,o)).map((function(e){return nx.after(e)}))}),I.none)},fx=function(e){return !1===eC(dx(e))},lx=function(e,t,n){return tx([ox,ux,cx,sx],[e,t,n]).filter(fx)},dx=function(e){return e.fold(N,N,N,N)},mx=function(e){return e.fold(k("before"),k("start"),k("end"),k("after"))},gx=function(e){return e.fold(nx.before,nx.before,nx.after,nx.after)},px=function(e){return e.fold(nx.start,nx.start,nx.end,nx.end)},hx=function(e,t,n,r,o,i){return Yn(tC(t,n,r),tC(t,n,o),(function(t,r){return t!==r&&function(e,t,n){var r=Qs(t,e),o=Qs(n,e);return r&&r===o}(n,t,r)?nx.after(e?t:r):i})).getOr(i)},vx=function(e,t){return e.fold(O,(function(e){return r=t,!(mx(n=e)===mx(r)&&dx(n)===dx(r));var n,r;}))},bx=function(e,t){return e?t.fold(w(I.some,nx.start),I.none,w(I.some,nx.after),I.none):t.fold(I.none,w(I.some,nx.before),I.none,w(I.some,nx.end))},yx=function(e,t,n,r){var o=nC(e,r),i=lx(t,n,o);return lx(t,n,o).bind(_(bx,e)).orThunk((function(){return function(e,t,n,r,o){var i=nC(e,o);return Rf(e,n,i).map(_(nC,e)).fold((function(){return r.map(gx)}),(function(o){return lx(t,n,o).map(_(hx,e,t,n,i,o)).filter(_(vx,r))})).filter(fx)}(e,t,n,i,r)}))};_(yx,!1),_(yx,!0);var Cx,xx=function(e,t,n){var r=e?1:-1;return t.setRng(Ac(n.container(),n.offset()+r).toRange()),t.getSel().modify("move",e?"forward":"backward","word"),!0},wx=function(e,t){var n=t.selection.getRng(),r=e?Ac.fromRangeEnd(n):Ac.fromRangeStart(n);return !!function(e){return y(e.selection.getSel().modify)}(t)&&(e&&Ro(r)?xx(!0,t.selection,r):!(e||!Do(r))&&xx(!1,t.selection,r))};!function(e){e[e.Br=0]="Br",e[e.Block=1]="Block",e[e.Wrap=2]="Wrap",e[e.Eol=3]="Eol";}(Cx||(Cx={}));var Sx,kx=function(e,t){return e===Rc.Backwards?te(t):t},Nx=function(e,t,n){return e===Rc.Forwards?t.next(n):t.prev(n)},Ex=function(e,t,n,r){return jn(r.getNode(t===Rc.Forwards))?Cx.Br:!1===Zs(n,r)?Cx.Block:Cx.Wrap},_x=function(e,t,n,r){for(var o=kf(n),i=r,a=[];i;){var u=Nx(t,o,i);if(!u)break;if(jn(u.getNode(!1)))return t===Rc.Forwards?{positions:kx(t,a).concat([u]),breakType:Cx.Br,breakAt:I.some(u)}:{positions:kx(t,a),breakType:Cx.Br,breakAt:I.some(u)};if(u.isVisible()){if(e(i,u)){var c=Ex(0,t,i,u);return {positions:kx(t,a),breakType:c,breakAt:I.some(u)}}a.push(u),i=u;}else i=u;}return {positions:kx(t,a),breakType:Cx.Eol,breakAt:I.none()}},Ax=function(e,t,n,r){return t(n,r).breakAt.map((function(r){var o=t(n,r).positions;return e===Rc.Backwards?o.concat(r):[r].concat(o)})).getOr([])},Rx=function(e,t){return Y(e,(function(e,n){return e.fold((function(){return I.some(n)}),(function(r){return Yn(ie(r.getClientRects()),ie(n.getClientRects()),(function(e,o){var i=Math.abs(t-e.left);return Math.abs(t-o.left)<=i?n:r})).or(e)}))}),I.none())},Dx=function(e,t){return ie(t.getClientRects()).bind((function(t){return Rx(e,t.left)}))},Tx=_(_x,Ac.isAbove,-1),Ox=_(_x,Ac.isBelow,1),Bx=_(Ax,-1,Tx),Px=_(Ax,1,Ox),Lx=function(e){var t=function(t){return V(t,(function(t){var n=ec(t);return n.node=e,n}))};if(Dn(e))return t(e.getClientRects());if(Fn(e)){var n=e.ownerDocument.createRange();return n.setStart(e,0),n.setEnd(e,e.data.length),t(n.getClientRects())}},Ix=function(e){return Z(e,Lx)};!function(e){e[e.Up=-1]="Up",e[e.Down=1]="Down";}(Sx||(Sx={}));var Mx,Fx,Ux=function(e,t,n,r,o,i){var a=0,u=[],c=function(r){var i=Ix([r]);-1===e&&(i=i.reverse());for(var c=0;c<i.length;c++){var f=i[c];if(!n(f,s)){if(u.length>0&&t(f,Ae(u))&&a++,f.line=a,o(f))return !0;u.push(f);}}},s=Ae(i.getClientRects());if(!s)return u;var f=i.getNode();return c(f),function(e,t,n,r){for(;r=Js(r,e,Wo,t);)if(n(r))return}(e,r,c,f),u},zx=_(Ux,Sx.Up,rc,oc),Hx=_(Ux,Sx.Down,oc,rc),jx=function(e){return function(t){return function(e,t){return t.line>e}(e,t)}},Vx=function(e){return function(t){return function(e,t){return t.line===e}(e,t)}},qx=$n,$x=Js,Wx=function(e,t){return Math.abs(e.left-t)},Kx=function(e,t){return Math.abs(e.right-t)},Xx=function(e,t){return e>=t.left&&e<=t.right},Yx=function(e,t){return e>=t.top&&e<=t.bottom},Gx=function(e,t,n){return void 0===n&&(n=O),Ee(e,(function(e,r){if(Xx(t,r))return n(r)?r:e;if(Xx(t,e))return n(e)?e:r;var o=Math.min(Wx(e,t),Kx(e,t)),i=Math.min(Wx(r,t),Kx(r,t));return i===o&&Ce(r,"node")&&qx(r.node)||i<o?r:e}))},Jx=function(e,t,n,r,o){var i=$x(r,e,Wo,t,!o);do{if(!i||n(i))return}while(i=$x(i,e,Wo,t))},Qx=function(e,t,n){var r=Ix(function(e){return K(ue(e.getElementsByTagName("*")),zs)}(e)),o=K(r,_(Yx,n)),i=function(e){return !Ln(e.node)&&!Kn(e.node)},a=Gx(o,t,i);if(a){var u=i(a);if(a=Gx(function(e,t,n){void 0===n&&(n=!0);var r=[],o=function(e,n){var o=K(Ix([n]),(function(n){return !e(n,t)}));return r=r.concat(o),0===o.length};return r.push(t),Jx(Sx.Up,e,_(o,rc),t.node,n),Jx(Sx.Down,e,_(o,oc),t.node,n),r}(e,a,u),t,i),a&&zs(a.node))return function(e,t){return {node:e.node,before:Wx(e,t)<Kx(e,t)}}(a,t)}return null},Zx=function(e,t){e.selection.setRng(t),Vd(e,e.selection.getRng());},ew=function(e,t,n){return I.some(DC(e,t,n))},tw=function(e,t,n,r,o,i){var a=t===Rc.Forwards,u=kf(e.getBody()),c=_(lf,a?u.next:u.prev),s=a?r:o;if(!n.collapsed){var f=ac(n);if(i(f))return _C(t,e,f,t===Rc.Backwards,!1)}var l=sf(t,e.getBody(),n);if(s(l))return AC(e,l.getNode(!a));var d=nC(a,c(l)),m=Lo(n);if(!d)return m?I.some(n):I.none();if(s(d))return _C(t,e,d.getNode(!a),a,!1);var g=c(d);return g&&s(g)&&df(d,g)?_C(t,e,g.getNode(!a),a,!1):m?ew(e,d.toRange(),!1):I.none()},nw=function(e,t,n,r,o,i){var a=sf(t,e.getBody(),n),u=Ae(a.getClientRects()),c=t===Sx.Down;if(!u)return I.none();var s,f=(c?Hx:zx)(e.getBody(),jx(1),a),l=K(f,Vx(1)),d=u.left,m=Gx(l,d);if(m&&i(m.node)){var g=Math.abs(d-m.left),p=Math.abs(d-m.right);return _C(t,e,m.node,g<p,!1)}if(s=r(a)?a.getNode():o(a)?a.getNode(!0):ac(n)){var h=function(e,t,n,r){var o,i,a,u,c=kf(t),s=[],f=0,l=function(e){return Ae(e.getClientRects())};1===e?(o=c.next,i=oc,a=rc,u=Ac.after(r)):(o=c.prev,i=rc,a=oc,u=Ac.before(r));var d=l(u);do{if(u.isVisible()){var m=l(u);if(!a(m,d)){s.length>0&&i(m,Ae(s))&&f++;var g=ec(m);if(g.position=u,g.line=f,n(g))return s;s.push(g);}}}while(u=o(u));return s}(t,e.getBody(),jx(1),s),v=Gx(K(h,Vx(1)),d);if(v)return ew(e,v.position.toRange(),!1);if(v=Ae(K(h,Vx(0))))return ew(e,v.position.toRange(),!1)}return 0===l.length?rw(e,c).filter(c?o:r).map((function(t){return DC(e,t.toRange(),!1)})):I.none()},rw=function(e,t){var n=e.selection.getRng(),r=e.getBody();if(t){var o=Ac.fromRangeEnd(n),i=Ox(r,o);return ae(i.positions)}o=Ac.fromRangeStart(n),i=Tx(r,o);return ie(i.positions)},ow=function(e,t,n){return rw(e,t).filter(n).exists((function(t){return e.selection.setRng(t.toRange()),!0}))},iw=function(e,t){var n=e.dom.createRng();n.setStart(t.container(),t.offset()),n.setEnd(t.container(),t.offset()),e.selection.setRng(n);},aw=function(e,t){e?t.setAttribute("data-mce-selected","inline-boundary"):t.removeAttribute("data-mce-selected");},uw=function(e,t,n){return ex(t,n).map((function(t){return iw(e,t),n}))},cw=function(e,t){if(e.selection.isCollapsed()&&!0!==e.composing&&t.get()){var n=Ac.fromRangeStart(e.selection.getRng());Ac.isTextPosition(n)&&!1===function(e){return Ro(e)||Do(e)}(n)&&(iw(e,Ds(t.get(),n)),t.set(null));}},sw=function(e,t,n){return !!ys(e)&&function(e,t,n){var r=e.getBody(),o=Ac.fromRangeStart(e.selection.getRng()),i=_(Zy,e);return yx(n,i,r,o).bind((function(n){return uw(e,t,n)}))}(e,t,n).isSome()},fw=function(e,t,n){return !!ys(t)&&wx(e,t)},lw=function(e){var t=Cu(null),n=_(Zy,e);return e.on("NodeChange",(function(r){!ys(e)||wt.browser.isIE()&&r.initial||(function(e,t,n){var r=V(Mu(Rt.fromDom(t.getRoot()),'*[data-mce-selected="inline-boundary"]'),(function(e){return e.dom})),o=K(r,e),i=K(n,e);q(ne(o,i),_(aw,!1)),q(ne(i,o),_(aw,!0));}(n,e.dom,r.parents),cw(e,t),function(e,t,n,r){if(t.selection.isCollapsed()){var o=K(r,e);q(o,(function(r){var o=Ac.fromRangeStart(t.selection.getRng());lx(e,t.getBody(),o).bind((function(e){return uw(t,n,e)}));}));}}(n,e,t,r.parents));})),t},dw=_(fw,!0),mw=_(fw,!1),gw=function(e,t,n){if(ys(e)){var r=rw(e,t).getOrThunk((function(){var n=e.selection.getRng();return t?Ac.fromRangeEnd(n):Ac.fromRangeStart(n)}));return lx(_(Zy,e),e.getBody(),r).exists((function(t){var r=gx(t);return ex(n,r).exists((function(t){return iw(e,t),!0}))}))}return !1},pw=function(e,t){return function(n){return ex(t,n).exists((function(t){return iw(e,t),!0}))}},hw=function(e,t,n,r){var o=e.getBody(),i=_(Zy,e);e.undoManager.ignore((function(){e.selection.setRng(function(e,t){var n=document.createRange();return n.setStart(e.container(),e.offset()),n.setEnd(t.container(),t.offset()),n}(n,r)),e.execCommand("Delete"),lx(i,o,Ac.fromRangeStart(e.selection.getRng())).map(px).map(pw(e,t));})),e.nodeChanged();},vw=function(e,t,n,r){var o=function(e,t){return Qs(t,e)||e}(e.getBody(),r.container()),i=_(Zy,e),a=lx(i,o,r);return a.bind((function(e){return n?e.fold(k(I.some(px(e))),I.none,k(I.some(gx(e))),I.none):e.fold(I.none,k(I.some(gx(e))),I.none,k(I.some(px(e))))})).map(pw(e,t)).getOrThunk((function(){var u=Df(n,o,r),c=u.bind((function(e){return lx(i,o,e)}));return Yn(a,c,(function(){return tC(i,o,r).exists((function(t){return !!function(e){return Yn(Lf(e),If(e),(function(t,n){var r=nC(!0,t),o=nC(!1,n);return Bf(e,r).forall((function(e){return e.isEqual(o)}))})).getOr(!0)}(t)&&(gp(e,n,Rt.fromDom(t)),!0)}))})).orThunk((function(){return c.bind((function(o){return u.map((function(o){return n?hw(e,t,r,o):hw(e,t,o,r),!0}))}))})).getOr(!1)}))},bw=function(e,t,n){if(e.selection.isCollapsed()&&ys(e)){var r=Ac.fromRangeStart(e.selection.getRng());return vw(e,t,n,r)}return !1},yw=function(e){return 1===tn(e)},Cw=function(e,t,n,r){var o=_(Oh,t),i=V(K(r,o),(function(e){return e.dom}));if(0===i.length)gp(t,e,n);else {var a=function(e,t){var n=Nh(!1),r=Rh(t,n.dom);return fn(Rt.fromDom(e),n),hn(Rt.fromDom(e)),Ac(r,0)}(n.dom,i);t.selection.setRng(a.toRange());}},xw=function(e,t){var n=Rt.fromDom(e.getBody()),r=Rt.fromDom(e.selection.getStart()),o=K(function(e,t){var n=Ng(t,e);return Q(n,so).fold(k(n),(function(e){return n.slice(0,e)}))}(n,r),yw);return ae(o).exists((function(n){var r,i=Ac.fromRangeStart(e.selection.getRng());return !(!function(e,t,n){return Yn(Lf(n),If(n),(function(r,o){var i=nC(!0,r),a=nC(!1,o),u=nC(!1,t);return e?Bf(n,u).exists((function(e){return e.isEqual(a)&&t.isEqual(i)})):Pf(n,u).exists((function(e){return e.isEqual(i)&&t.isEqual(a)}))})).getOr(!0)}(t,i,n.dom)||(r=n,Ff(r.dom)&&Sh(r.dom)))&&(Cw(t,e,n,o),!0)}))},ww=function(e,t){return !!e.selection.isCollapsed()&&xw(e,t)},Sw=function(e,t,n){return e._selectionOverrides.hideFakeCaret(),gp(e,t,Rt.fromDom(n)),!0},kw=function(e,t){return e.selection.isCollapsed()?function(e,t){var n=t?gg:pg,r=t?Rc.Forwards:Rc.Backwards,o=sf(r,e.getBody(),e.selection.getRng());return n(o)?Sw(e,t,o.getNode(!t)):I.from(nC(t,o)).filter((function(e){return n(e)&&df(o,e)})).exists((function(n){return Sw(e,t,n.getNode(!t))}))}(e,t):function(e,t){var n=e.selection.getNode();return !!Kn(n)&&Sw(e,t,n)}(e,t)},Nw=function(e){var t=parseInt(e,10);return isNaN(t)?0:t},Ew=function(e,t){return (e||"table"===It(t)?"margin":"padding")+("rtl"===or(t,"direction")?"-right":"-left")},_w=function(e){var t=Rw(e);return !e.mode.isReadOnly()&&(t.length>1||function(e,t){return ee(t,(function(t){var n=Ew(ms(e),t),r=ar(t,n).map(Nw).getOr(0);return "false"!==e.dom.getContentEditable(t.dom)&&r>0}))}(e,t))},Aw=function(e){return go(e)||po(e)},Rw=function(e){return K((t=e.selection.getSelectedBlocks(),V(t,Rt.fromDom)),(function(e){return !Aw(e)&&!function(e){return Wt(e).exists(Aw)}(e)&&Xr(e,(function(e){return qn(e.dom)||$n(e.dom)})).exists((function(e){return qn(e.dom)}))}));var t;},Dw=function(e,t){var n=e.dom,r=e.selection,o=e.formatter,i=function(e){return e.getParam("indentation","40px","string")}(e),a=/[a-z%]+$/i.exec(i)[0],u=parseInt(i,10),c=ms(e),s=ts(e);e.queryCommandState("InsertUnorderedList")||e.queryCommandState("InsertOrderedList")||""!==s||n.getParent(r.getNode(),n.isBlock)||o.apply("div"),q(Rw(e),(function(e){!function(e,t,n,r,o,i){var a=Ew(n,Rt.fromDom(i));if("outdent"===t){var u=Math.max(0,Nw(i.style[a])-r);e.setStyle(i,a,u?u+o:"");}else u=Nw(i.style[a])+r+o,e.setStyle(i,a,u);}(n,t,c,u,a,e.dom);}));},Tw=function(e,t){if(e.selection.isCollapsed()&&_w(e)){var n=e.dom,r=e.selection.getRng(),o=Ac.fromRangeStart(r),i=n.getParent(r.startContainer,n.isBlock);if(null!==i&&Dg(Rt.fromDom(i),o))return Dw(e,"outdent"),!0}return !1},Ow=function(e,t){e.getDoc().execCommand(t,!1,null);},Bw=function(e,t){e.addCommand("delete",(function(){!function(e,t){Tw(e)||VC(e,!1)||PC(e,!1)||bw(e,t,!1)||CC(e,!1)||qp(e)||qC(e,!1)||kw(e,!1)||kC(e)||ww(e,!1)||(Ow(e,"Delete"),uC(e));}(e,t);})),e.addCommand("forwardDelete",(function(){!function(e,t){VC(e,!0)||PC(e,!0)||bw(e,t,!0)||CC(e,!0)||qp(e)||qC(e,!0)||kw(e,!0)||kC(e)||ww(e,!0)||Ow(e,"ForwardDelete");}(e,t);}));},Pw=function(e){return void 0===e.touches||1!==e.touches.length?I.none():I.some(e.touches[0])},Lw=function(e){var t=Eu(),n=Cu(!1),r=Au((function(t){e.fire("longpress",Re(Re({},t),{type:"longpress"})),n.set(!0);}),400);e.on("touchstart",(function(e){Pw(e).each((function(o){r.cancel();var i={x:o.clientX,y:o.clientY,target:e.target};r.throttle(e),n.set(!1),t.set(i);}));}),!0),e.on("touchmove",(function(o){r.cancel(),Pw(o).each((function(r){t.on((function(o){(function(e,t){var n=Math.abs(e.clientX-t.x),r=Math.abs(e.clientY-t.y);return n>5||r>5})(r,o)&&(t.clear(),n.set(!1),e.fire("longpresscancel"));}));}));}),!0),e.on("touchend touchcancel",(function(o){r.cancel(),"touchcancel"!==o.type&&t.get().filter((function(e){return e.target.isEqualNode(o.target)})).each((function(){n.get()?o.preventDefault():e.fire("tap",Re(Re({},o),{type:"tap"}));}));}),!0);},Iw=function(e,t){return ye(e,t.nodeName)},Mw=function(e,t){return !!Fn(t)||!!Dn(t)&&(!Iw(e,t)&&!Gf(t))},Fw=function(e,t){if(Fn(t)){if(0===t.nodeValue.length)return !0;if(/^\s+$/.test(t.nodeValue)&&(!t.nextSibling||Iw(e,t.nextSibling)))return !0}return !1},Uw=function(e){var t,n,r,o=e.dom,i=e.selection,a=e.schema,u=a.getBlockElements(),c=i.getStart(),s=e.getBody(),f=ts(e);if(c&&Dn(c)&&f){var l=s.nodeName.toLowerCase();if(a.isValidChild(l,f.toLowerCase())&&!function(e,t,n){return j(kg(Rt.fromDom(n),Rt.fromDom(t)),(function(t){return Iw(e,t.dom)}))}(u,s,c)){var d=i.getRng(),m=d.startContainer,g=d.startOffset,p=d.endContainer,h=d.endOffset,v=ym(e);for(c=s.firstChild;c;)if(Mw(u,c)){if(Fw(u,c)){n=c,c=c.nextSibling,o.remove(n);continue}t||(t=o.create(f,ns(e)),c.parentNode.insertBefore(t,c),r=!0),n=c,c=c.nextSibling,t.appendChild(n);}else t=null,c=c.nextSibling;r&&v&&(d.setStart(m,g),d.setEnd(p,h),i.setRng(d),e.nodeChanged());}}},zw=function(e,t){t.hasAttribute("data-mce-caret")&&(Po(t),function(e){e.selection.setRng(e.selection.getRng());}(e),e.selection.scrollIntoView(t));},Hw=function(e,t){var n=function(e){return Jr(Rt.fromDom(e.getBody()),"*[data-mce-caret]").map((function(e){return e.dom})).getOrNull()}(e);if(n)return "compositionstart"===t.type?(t.preventDefault(),t.stopPropagation(),void zw(e,n)):void(Ao(n)&&(zw(e,n),e.undoManager.add()))},jw=$n,Vw=function(e,t,n){var r=kf(e.getBody()),o=_(lf,1===t?r.next:r.prev);if(n.collapsed&&function(e){return ""!==ts(e)}(e)){var i=e.dom.getParent(n.startContainer,"PRE");if(!i)return;if(!o(Ac.fromRangeStart(n))){var a=function(e){var t=e.dom.create(ts(e));return (!wt.ie||wt.ie>=11)&&(t.innerHTML='<br data-mce-bogus="1">'),t}(e);1===t?e.$(i).after(a):e.$(i).before(a),e.selection.select(a,!0),e.selection.collapse();}}},qw=function(e,t){var n=t?Rc.Forwards:Rc.Backwards,r=e.selection.getRng();return function(e,t,n){return tw(t,e,n,bg,yg,jw)}(n,e,r).orThunk((function(){return Vw(e,n,r),I.none()}))},$w=function(e,t){var n=t?1:-1,r=e.selection.getRng();return function(e,t,n){return nw(t,e,n,(function(e){return bg(e)||hg(e)}),(function(e){return yg(e)||vg(e)}),jw)}(n,e,r).orThunk((function(){return Vw(e,n,r),I.none()}))},Ww=function(e,t){return qw(e,t).exists((function(t){return Zx(e,t),!0}))},Kw=function(e,t){return $w(e,t).exists((function(t){return Zx(e,t),!0}))},Xw=function(e,t){return ow(e,t,t?yg:bg)},Yw=function(e){return H(["figcaption"],It(e))},Gw=function(e){var t=document.createRange();return t.setStartBefore(e.dom),t.setEndBefore(e.dom),t},Jw=function(e,t,n){n?mn(e,t):dn(e,t);},Qw=function(e,t,n,r){return ""===t?function(e,t){var n=Rt.fromTag("br");return Jw(e,n,t),Gw(n)}(e,r):function(e,t,n,r){var o=Rt.fromTag(n),i=Rt.fromTag("br");return Zn(o,r),mn(o,i),Jw(e,o,t),Gw(i)}(e,r,t,n)},Zw=function(e,t,n){return t?function(e,t){return Ox(e,t).breakAt.isNone()}(e.dom,n):function(e,t){return Tx(e,t).breakAt.isNone()}(e.dom,n)},eS=function(e,t){var n=Rt.fromDom(e.getBody()),r=Ac.fromRangeStart(e.selection.getRng()),o=ts(e),i=ns(e);return function(e,t){var n=_(Bt,t);return Xr(Rt.fromDom(e.container()),so,n).filter(Yw)}(r,n).exists((function(){if(Zw(n,t,r)){var a=Qw(n,o,i,t);return e.selection.setRng(a),!0}return !1}))},tS=function(e,t){return !!e.selection.isCollapsed()&&eS(e,t)},nS=function(e,t){return Z(function(e){return V(e,(function(e){return Re({shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0,action:x},e)}))}(e),(function(e){return function(e,t){return t.keyCode===e.keyCode&&t.shiftKey===e.shiftKey&&t.altKey===e.altKey&&t.ctrlKey===e.ctrlKey&&t.metaKey===e.metaKey}(e,t)?[e]:[]}))},rS=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return function(){return e.apply(null,t)}},oS=function(e,t){return J(nS(e,t),(function(e){return e.action()}))},iS=function(e,t){var n=t?Rc.Forwards:Rc.Backwards,r=e.selection.getRng();return tw(e,n,r,gg,pg,Kn).exists((function(t){return Zx(e,t),!0}))},aS=function(e,t){var n=t?1:-1,r=e.selection.getRng();return nw(e,n,r,gg,pg,Kn).exists((function(t){return Zx(e,t),!0}))},uS=function(e,t){return ow(e,t,t?pg:gg)},cS=function(e,t,n,r,o){var i=Mu(Rt.fromDom(n),"td,th,caption").map((function(e){return e.dom})),a=K(function(e,t){return Z(t,(function(t){var n=function(e,t){return {left:e.left-t,top:e.top-t,right:e.right+2*t,bottom:e.bottom+2*t,width:e.width+t,height:e.height+t}}(ec(t.getBoundingClientRect()),-1);return [{x:n.left,y:e(n),cell:t},{x:n.right,y:e(n),cell:t}]}))}(e,i),(function(e){return t(e,o)}));return function(e,t,n){return Y(e,(function(e,r){return e.fold((function(){return I.some(r)}),(function(e){var o=Math.sqrt(Math.abs(e.x-t)+Math.abs(e.y-n)),i=Math.sqrt(Math.abs(r.x-t)+Math.abs(r.y-n));return I.some(i<o?r:e)}))}),I.none())}(a,r,o).map((function(e){return e.cell}))},sS=_(cS,(function(e){return e.bottom}),(function(e,t){return e.y<t})),fS=_(cS,(function(e){return e.top}),(function(e,t){return e.y>t})),lS=function(e,t){return ie(t.getClientRects()).bind((function(t){return sS(e,t.left,t.top)})).bind((function(e){return Dx(If(n=e).map((function(e){return Tx(n,e).positions.concat(e)})).getOr([]),t);var n;}))},dS=function(e,t){return ae(t.getClientRects()).bind((function(t){return fS(e,t.left,t.top)})).bind((function(e){return Dx(Lf(n=e).map((function(e){return [e].concat(Ox(n,e).positions)})).getOr([]),t);var n;}))},mS=function(e,t,n){var r=e(t,n);return function(e){return e.breakType===Cx.Wrap&&0===e.positions.length}(r)||!jn(n.getNode())&&function(e){return e.breakType===Cx.Br&&1===e.positions.length}(r)?!function(e,t,n){return n.breakAt.exists((function(n){return e(t,n).breakAt.isSome()}))}(e,t,r):r.breakAt.isNone()},gS=_(mS,Tx),pS=_(mS,Ox),hS=function(e,t,n,r){var o=e.selection.getRng(),i=t?1:-1;return !(!Fs()||!function(e,t,n){var r=Ac.fromRangeStart(t);return Of(!e,n).exists((function(e){return e.isEqual(r)}))}(t,o,n))&&(_C(i,e,n,!t,!1).each((function(t){Zx(e,t);})),!0)},vS=function(e,t){var n=t.getNode(e);return Dn(n)&&"TABLE"===n.nodeName?I.some(n):I.none()},bS=function(e,t,n){var r=vS(!!t,n),o=!1===t;r.fold((function(){return Zx(e,n.toRange())}),(function(r){return Of(o,e.getBody()).filter((function(e){return e.isEqual(n)})).fold((function(){return Zx(e,n.toRange())}),(function(o){return function(e,t,n,r){var o=ts(t);o?t.undoManager.transact((function(){var r=Rt.fromTag(o);Zn(r,ns(t)),mn(r,Rt.fromTag("br")),e?ln(Rt.fromDom(n),r):fn(Rt.fromDom(n),r);var i=t.dom.createRng();i.setStart(r.dom,0),i.setEnd(r.dom,0),Zx(t,i);})):Zx(t,r.toRange());}(t,e,r,n)}))}));},yS=function(e,t,n,r){var o=e.selection.getRng(),i=Ac.fromRangeStart(o),a=e.getBody();if(!t&&gS(r,i)){var u=function(e,t,n){return lS(t,n).orThunk((function(){return ie(n.getClientRects()).bind((function(n){return Rx(Bx(e,Ac.before(t)),n.left)}))})).getOr(Ac.before(t))}(a,n,i);return bS(e,t,u),!0}if(t&&pS(r,i)){u=function(e,t,n){return dS(t,n).orThunk((function(){return ie(n.getClientRects()).bind((function(n){return Rx(Px(e,Ac.after(t)),n.left)}))})).getOr(Ac.after(t))}(a,n,i);return bS(e,t,u),!0}return !1},CS=function(e,t,n){return I.from(e.dom.getParent(e.selection.getNode(),"td,th")).bind((function(r){return I.from(e.dom.getParent(r,"table")).map((function(o){return n(e,t,o,r)}))})).getOr(!1)},xS=function(e,t){return CS(e,t,hS)},wS=function(e,t){return CS(e,t,yS)},SS=function(e,t){e.on("keydown",(function(n){!1===n.isDefaultPrevented()&&function(e,t,n){var r=mt().os;oS([{keyCode:od.RIGHT,action:rS(Ww,e,!0)},{keyCode:od.LEFT,action:rS(Ww,e,!1)},{keyCode:od.UP,action:rS(Kw,e,!1)},{keyCode:od.DOWN,action:rS(Kw,e,!0)},{keyCode:od.RIGHT,action:rS(xS,e,!0)},{keyCode:od.LEFT,action:rS(xS,e,!1)},{keyCode:od.UP,action:rS(wS,e,!1)},{keyCode:od.DOWN,action:rS(wS,e,!0)},{keyCode:od.RIGHT,action:rS(iS,e,!0)},{keyCode:od.LEFT,action:rS(iS,e,!1)},{keyCode:od.UP,action:rS(aS,e,!1)},{keyCode:od.DOWN,action:rS(aS,e,!0)},{keyCode:od.RIGHT,action:rS(sw,e,t,!0)},{keyCode:od.LEFT,action:rS(sw,e,t,!1)},{keyCode:od.RIGHT,ctrlKey:!r.isOSX(),altKey:r.isOSX(),action:rS(dw,e,t)},{keyCode:od.LEFT,ctrlKey:!r.isOSX(),altKey:r.isOSX(),action:rS(mw,e,t)},{keyCode:od.UP,action:rS(tS,e,!1)},{keyCode:od.DOWN,action:rS(tS,e,!0)}],n).each((function(e){n.preventDefault();}));}(e,t,n);}));},kS=function(e,t){e.on("keydown",(function(n){!1===n.isDefaultPrevented()&&function(e,t,n){oS([{keyCode:od.BACKSPACE,action:rS(Tw,e,!1)},{keyCode:od.BACKSPACE,action:rS(VC,e,!1)},{keyCode:od.DELETE,action:rS(VC,e,!0)},{keyCode:od.BACKSPACE,action:rS(PC,e,!1)},{keyCode:od.DELETE,action:rS(PC,e,!0)},{keyCode:od.BACKSPACE,action:rS(bw,e,t,!1)},{keyCode:od.DELETE,action:rS(bw,e,t,!0)},{keyCode:od.BACKSPACE,action:rS(qp,e,!1)},{keyCode:od.DELETE,action:rS(qp,e,!0)},{keyCode:od.BACKSPACE,action:rS(qC,e,!1)},{keyCode:od.DELETE,action:rS(qC,e,!0)},{keyCode:od.BACKSPACE,action:rS(kw,e,!1)},{keyCode:od.DELETE,action:rS(kw,e,!0)},{keyCode:od.BACKSPACE,action:rS(kC,e,!1)},{keyCode:od.DELETE,action:rS(kC,e,!0)},{keyCode:od.BACKSPACE,action:rS(CC,e,!1)},{keyCode:od.DELETE,action:rS(CC,e,!0)},{keyCode:od.BACKSPACE,action:rS(ww,e,!1)},{keyCode:od.DELETE,action:rS(ww,e,!0)}],n).each((function(e){n.preventDefault();}));}(e,t,n);})),e.on("keyup",(function(t){!1===t.isDefaultPrevented()&&function(e,t){oS([{keyCode:od.BACKSPACE,action:rS(jC,e)},{keyCode:od.DELETE,action:rS(jC,e)}],t);}(e,t);}));},NS=function(e,t){var n,r=t,o=e.dom,i=e.schema.getMoveCaretBeforeOnEnterElements();if(t){if(/^(LI|DT|DD)$/.test(t.nodeName)){var a=function(e){for(;e;){if(1===e.nodeType||3===e.nodeType&&e.data&&/[\r\n\s]/.test(e.data))return e;e=e.nextSibling;}}(t.firstChild);a&&/^(UL|OL|DL)$/.test(a.nodeName)&&t.insertBefore(o.doc.createTextNode(yo),t.firstChild);}var u=o.createRng();if(t.normalize(),t.hasChildNodes()){for(var c=new ao(t,t);n=c.current();){if(Fn(n)){u.setStart(n,0),u.setEnd(n,0);break}if(i[n.nodeName.toLowerCase()]){u.setStartBefore(n),u.setEndBefore(n);break}r=n,n=c.next();}n||(u.setStart(r,0),u.setEnd(r,0));}else jn(t)?t.nextSibling&&o.isBlock(t.nextSibling)?(u.setStartBefore(t),u.setEndBefore(t)):(u.setStartAfter(t),u.setEndAfter(t)):(u.setStart(t,0),u.setEnd(t,0));e.selection.setRng(u),Vd(e,u);}},ES=function(e){return I.from(e.dom.getParent(e.selection.getStart(!0),e.dom.isBlock))},_S=function(e,t){return e&&e.parentNode&&e.parentNode.nodeName===t},AS=function(e){return e&&/^(OL|UL|LI)$/.test(e.nodeName)},RS=function(e){var t=e.parentNode;return /^(LI|DT|DD)$/.test(t.nodeName)?t:e},DS=function(e,t,n){for(var r=e[n?"firstChild":"lastChild"];r&&!Dn(r);)r=r[n?"nextSibling":"previousSibling"];return r===t},TS=function(e,t,n,r,o){var i=e.dom,a=e.selection.getRng();if(n!==e.getBody()){var u;AS(u=n)&&AS(u.parentNode)&&(o="LI");var c=o?t(o):i.create("BR");if(DS(n,r,!0)&&DS(n,r,!1))if(_S(n,"LI")){var s=RS(n);i.insertAfter(c,s),!function(e){var t;return (null===(t=e.parentNode)||void 0===t?void 0:t.firstChild)===e}(n)?i.remove(n):i.remove(s);}else i.replace(c,n);else if(DS(n,r,!0))_S(n,"LI")?(i.insertAfter(c,RS(n)),c.appendChild(i.doc.createTextNode(" ")),c.appendChild(n)):n.parentNode.insertBefore(c,n),i.remove(r);else if(DS(n,r,!1))i.insertAfter(c,RS(n)),i.remove(r);else {n=RS(n);var f=a.cloneRange();f.setStartAfter(r),f.setEndAfter(n);var l=f.extractContents();"LI"===o&&function(e,t){return e.firstChild&&e.firstChild.nodeName===t}(l,"LI")?(c=l.firstChild,i.insertAfter(l,n)):(i.insertAfter(l,n),i.insertAfter(c,n)),i.remove(r);}NS(e,c);}},OS=function(e,t){return t&&"A"===t.nodeName&&e.isEmpty(t)},BS=function(e){e.innerHTML='<br data-mce-bogus="1">';},PS=function(e,t){return e.nodeName===t||e.previousSibling&&e.previousSibling.nodeName===t},LS=function(e,t){return t&&e.isBlock(t)&&!/^(TD|TH|CAPTION|FORM)$/.test(t.nodeName)&&!/^(fixed|absolute)/i.test(t.style.position)&&"true"!==e.getContentEditable(t)},IS=function(e,t,n){return !1===Fn(t)?n:e?1===n&&t.data.charAt(n-1)===Co?0:n:n===t.data.length-1&&t.data.charAt(n)===Co?t.data.length:n},MS=function(e,t){var n,r,o=e.getRoot();for(n=t;n!==o&&"false"!==e.getContentEditable(n);)"true"===e.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},FS=function(e,t){var n=ts(e);n&&n.toLowerCase()===t.tagName.toLowerCase()&&function(e,t,n){var r=e.dom;I.from(n.style).map(r.parseStyle).each((function(e){var n=ur(Rt.fromDom(t)),o=Re(Re({},n),e);r.setStyles(t,o);}));var o=I.from(n.class).map((function(e){return e.split(/\s+/)})),i=I.from(t.className).map((function(e){return K(e.split(/\s+/),(function(e){return ""!==e}))}));Yn(o,i,(function(e,n){var o=K(n,(function(t){return !H(e,t)})),i=De(De([],e,!0),o,!0);r.setAttrib(t,"class",i.join(" "));}));var a=["style","class"],u=he(n,(function(e,t){return !H(a,t)}));r.setAttribs(t,u);}(e,t,ns(e));},US=function(e,t){var n,r,o,i,a,u,c,s,f,l,d=e.dom,m=e.schema,g=m.getNonEmptyElements(),p=e.selection.getRng(),h=function(t){var n,o,a,u=r,c=m.getTextInlineElements();if(a=n=t||"TABLE"===s||"HR"===s?d.create(t||f):i.cloneNode(!1),!1===function(e){return e.getParam("keep_styles",!0)}(e))d.setAttrib(n,"style",null),d.setAttrib(n,"class",null);else do{if(c[u.nodeName]){if(Ff(u)||Gf(u))continue;o=u.cloneNode(!1),d.setAttrib(o,"id",""),n.hasChildNodes()?(o.appendChild(n.firstChild),n.appendChild(o)):(a=o,n.appendChild(o));}}while((u=u.parentNode)&&u!==x);return FS(e,n),BS(a),n},v=function(e){var t,n,a=IS(e,r,o);if(Fn(r)&&(e?a>0:a<r.nodeValue.length))return !1;if(r.parentNode===i&&l&&!e)return !0;if(e&&Dn(r)&&r===i.firstChild)return !0;if(PS(r,"TABLE")||PS(r,"HR"))return l&&!e||!l&&e;var u=new ao(r,i);for(Fn(r)&&(e&&0===a?u.prev():e||a!==r.nodeValue.length||u.next());t=u.current();){if(Dn(t)){if(!t.getAttribute("data-mce-bogus")&&(n=t.nodeName.toLowerCase(),g[n]&&"br"!==n))return !1}else if(Fn(t)&&!Xo(t.nodeValue))return !1;e?u.prev():u.next();}return !0},b=function(){a=/^(H[1-6]|PRE|FIGURE)$/.test(s)&&"HGROUP"!==w?h(f):h(),function(e){return e.getParam("end_container_on_empty_block",!1)}(e)&&LS(d,c)&&d.isEmpty(i)?a=d.split(c,i):d.insertAfter(a,i),NS(e,a);};bd(d,p).each((function(e){p.setStart(e.startContainer,e.startOffset),p.setEnd(e.endContainer,e.endOffset);})),r=p.startContainer,o=p.startOffset,f=ts(e);var y=!(!t||!t.shiftKey),C=!(!t||!t.ctrlKey);Dn(r)&&r.hasChildNodes()&&(l=o>r.childNodes.length-1,r=r.childNodes[Math.min(o,r.childNodes.length-1)]||r,o=l&&Fn(r)?r.nodeValue.length:0);var x=MS(d,r);if(x){(f&&!y||!f&&y)&&(r=function(e,t,n,r,o){var i,a,u,c,s,f,l=t||"P",d=e.dom,m=MS(d,r);if(!(a=d.getParent(r,d.isBlock))||!LS(d,a)){if(f=(a=a||m)===e.getBody()||function(e){return e&&/^(TD|TH|CAPTION)$/.test(e.nodeName)}(a)?a.nodeName.toLowerCase():a.parentNode.nodeName.toLowerCase(),!a.hasChildNodes())return i=d.create(l),FS(e,i),a.appendChild(i),n.setStart(i,0),n.setEnd(i,0),i;for(c=r;c.parentNode!==a;)c=c.parentNode;for(;c&&!d.isBlock(c);)u=c,c=c.previousSibling;if(u&&e.schema.isValidChild(f,l.toLowerCase())){for(i=d.create(l),FS(e,i),u.parentNode.insertBefore(i,u),c=u;c&&!d.isBlock(c);)s=c.nextSibling,i.appendChild(c),c=s;n.setStart(r,o),n.setEnd(r,o);}}return r}(e,f,p,r,o)),i=d.getParent(r,d.isBlock),c=i?d.getParent(i.parentNode,d.isBlock):null,s=i?i.nodeName.toUpperCase():"";var w=c?c.nodeName.toUpperCase():"";"LI"!==w||C||(i=c,c=c.parentNode,s=w),/^(LI|DT|DD)$/.test(s)&&d.isEmpty(i)?TS(e,h,c,i,f):f&&i===e.getBody()||(f=f||"P",No(i)?(a=Po(i),d.isEmpty(i)&&BS(i),FS(e,a),NS(e,a)):v()?b():v(!0)?(a=i.parentNode.insertBefore(h(),i),NS(e,PS(i,"HR")?a:i)):(n=function(e){var t=e.cloneRange();return t.setStart(e.startContainer,IS(!0,e.startContainer,e.startOffset)),t.setEnd(e.endContainer,IS(!1,e.endContainer,e.endOffset)),t}(p).cloneRange(),n.setEndAfter(i),function(e){q(Iu(Rt.fromDom(e),zt),(function(e){var t=e.dom;t.nodeValue=wo(t.nodeValue);}));}(u=n.extractContents()),function(e){do{Fn(e)&&(e.nodeValue=e.nodeValue.replace(/^[\r\n]+/,"")),e=e.firstChild;}while(e)}(u),a=u.firstChild,d.insertAfter(u,i),function(e,t,n){var r,o=n,i=[];if(o){for(;o=o.firstChild;){if(e.isBlock(o))return;Dn(o)&&!t[o.nodeName.toLowerCase()]&&i.push(o);}for(r=i.length;r--;)(!(o=i[r]).hasChildNodes()||o.firstChild===o.lastChild&&""===o.firstChild.nodeValue||OS(e,o))&&e.remove(o);}}(d,g,a),function(e,t){t.normalize();var n=t.lastChild;n&&!/^(left|right)$/gi.test(e.getStyle(n,"float",!0))||e.add(t,"br");}(d,i),d.isEmpty(i)&&BS(i),a.normalize(),d.isEmpty(a)?(d.remove(a),b()):(FS(e,a),NS(e,a))),d.setAttrib(a,"id",""),e.fire("NewBlock",{newBlock:a}));}},zS=function(e,t,n){var r=e.dom.createRng();n?(r.setStartBefore(t),r.setEndBefore(t)):(r.setStartAfter(t),r.setEndAfter(t)),e.selection.setRng(r),Vd(e,r);},HS=function(e,t){var n,r,o=e.selection,i=e.dom,a=o.getRng();bd(i,a).each((function(e){a.setStart(e.startContainer,e.startOffset),a.setEnd(e.endContainer,e.endOffset);}));var u=a.startOffset,c=a.startContainer;if(1===c.nodeType&&c.hasChildNodes()){var s=u>c.childNodes.length-1;c=c.childNodes[Math.min(u,c.childNodes.length-1)]||c,u=s&&3===c.nodeType?c.nodeValue.length:0;}var f=i.getParent(c,i.isBlock),l=f?i.getParent(f.parentNode,i.isBlock):null,d=l?l.nodeName.toUpperCase():"",m=!(!t||!t.ctrlKey);"LI"!==d||m||(f=l),c&&3===c.nodeType&&u>=c.nodeValue.length&&(function(e,t,n){for(var r,o=new ao(t,n),i=e.getNonEmptyElements();r=o.next();)if(i[r.nodeName.toLowerCase()]||r.length>0)return !0}(e.schema,c,f)||(n=i.create("br"),a.insertNode(n),a.setStartAfter(n),a.setEndAfter(n),r=!0)),n=i.create("br"),Tc(i,a,n),zS(e,n,r),e.undoManager.add();},jS=function(e,t){var n=Rt.fromTag("br");fn(Rt.fromDom(t),n),e.undoManager.add();},VS=function(e,t){qS(e.getBody(),t)||ln(Rt.fromDom(t),Rt.fromTag("br"));var n=Rt.fromTag("br");ln(Rt.fromDom(t),n),zS(e,n.dom,!1),e.undoManager.add();},qS=function(e,t){return n=Ac.after(t),!!jn(n.getNode())||Bf(e,Ac.after(t)).map((function(e){return jn(e.getNode())})).getOr(!1);var n;},$S=function(e){return e&&"A"===e.nodeName&&"href"in e},WS=function(e){return e.fold(T,$S,$S,T)},KS=function(e,t){t.fold(x,_(jS,e),_(VS,e),x);},XS=function(e,t){var n=function(e){var t=_(Zy,e),n=Ac.fromRangeStart(e.selection.getRng());return lx(t,e.getBody(),n).filter(WS)}(e);n.isSome()?n.each(_(KS,e)):HS(e,t);},YS=function(e,t){return ES(e).filter((function(e){return t.length>0&&Tt(Rt.fromDom(e),t)})).isSome()},GS=kr([{br:[]},{block:[]},{none:[]}]),JS=function(e,t){return function(e){return YS(e,function(e){return e.getParam("no_newline_selector","")}(e))}(e)},QS=function(e){return function(t,n){return ""===ts(t)===e}},ZS=function(e){return function(t,n){return function(e){return ES(e).filter((function(e){return po(Rt.fromDom(e))})).isSome()}(t)===e}},ek=function(e,t){return function(n,r){var o=function(e){return ES(e).fold(k(""),(function(e){return e.nodeName.toUpperCase()}))}(n)===e.toUpperCase();return o===t}},tk=function(e){return ek("pre",e)},nk=function(e){return function(t,n){return function(e){return e.getParam("br_in_pre",!0)}(t)===e}},rk=function(e,t){return function(e){return YS(e,function(e){return e.getParam("br_newline_selector",".mce-toc h2,figcaption,caption")}(e))}(e)},ok=function(e,t){return t},ik=function(e){var t=ts(e),n=function(e,t){var n,r,o=e.getRoot();for(n=t;n!==o&&"false"!==e.getContentEditable(n);)"true"===e.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o}(e.dom,e.selection.getStart());return n&&e.schema.isValidChild(n.nodeName,t||"P")},ak=function(e,t){return function(n,r){return Y(e,(function(e,t){return e&&t(n,r)}),!0)?I.some(t):I.none()}},uk=function(e,t){(function(e,t){return tx([ak([JS],GS.none()),ak([ek("summary",!0)],GS.br()),ak([tk(!0),nk(!1),ok],GS.br()),ak([tk(!0),nk(!1)],GS.block()),ak([tk(!0),nk(!0),ok],GS.block()),ak([tk(!0),nk(!0)],GS.br()),ak([ZS(!0),ok],GS.br()),ak([ZS(!0)],GS.block()),ak([QS(!0),ok,ik],GS.block()),ak([QS(!0)],GS.br()),ak([rk],GS.br()),ak([QS(!1),ok],GS.br()),ak([ik],GS.block())],[e,!(!t||!t.shiftKey)]).getOr(GS.none())})(e,t).fold((function(){XS(e,t);}),(function(){US(e,t);}),x);},ck=function(e){e.on("keydown",(function(t){t.keyCode===od.ENTER&&function(e,t){var n;t.isDefaultPrevented()||(t.preventDefault(),(n=e.undoManager).typing&&(n.typing=!1,n.add()),e.undoManager.transact((function(){!1===e.selection.isCollapsed()&&e.execCommand("Delete"),uk(e,t);})));}(e,t);}));},sk=function(e,t){e.on("keydown",(function(n){!1===n.isDefaultPrevented()&&function(e,t,n){oS([{keyCode:od.END,action:rS(Xw,e,!0)},{keyCode:od.HOME,action:rS(Xw,e,!1)},{keyCode:od.END,action:rS(uS,e,!0)},{keyCode:od.HOME,action:rS(uS,e,!1)},{keyCode:od.END,action:rS(gw,e,!0,t)},{keyCode:od.HOME,action:rS(gw,e,!1,t)}],n).each((function(e){n.preventDefault();}));}(e,t,n);}));},fk=mt().browser,lk=function(e){!function(e){var t=_u((function(){e.composing||Zg(e);}),0);fk.isIE()&&(e.on("keypress",(function(e){t.throttle();})),e.on("remove",(function(e){t.cancel();})));}(e),e.on("input",(function(t){!1===t.isComposing&&Zg(e);}));},dk=mt(),mk=function(e){return e.stopImmediatePropagation()},gk=function(e){return e.keyCode===od.PAGE_UP||e.keyCode===od.PAGE_DOWN},pk=function(e,t,n){n&&!e.get()?t.on("NodeChange",mk,!0):!n&&e.get()&&t.off("NodeChange",mk),e.set(n);},hk=function(e,t){if(!dk.os.isOSX()){var n=Cu(!1);e.on("keydown",(function(t){gk(t)&&pk(n,e,!0);})),e.on("keyup",(function(r){!1===r.isDefaultPrevented()&&function(e,t,n){oS([{keyCode:od.PAGE_UP,action:rS(gw,e,!1,t)},{keyCode:od.PAGE_DOWN,action:rS(gw,e,!0,t)}],n);}(e,t,r),gk(r)&&n.get()&&(pk(n,e,!1),e.nodeChanged());}));}},vk=function(e,t){var n=t.container(),r=t.offset();return Fn(n)?(n.insertData(r,e),I.some(Ac(n,r+e.length))):ff(t).map((function(n){var r=Rt.fromText(e);return t.isAtEnd()?ln(n,r):fn(n,r),Ac(r.dom,e.length)}))},bk=_(vk,yo),yk=_(vk," "),Ck=function(e,t){return function(n){return function(e,t){return !qg(t)&&($g(e,t)||jg(e,t)||Vg(e,t))}(e,n)?bk(t):yk(t)}},xk=function(e){var t=Ac.fromRangeStart(e.selection.getRng()),n=Rt.fromDom(e.getBody());if(e.selection.isCollapsed()){var r=_(Zy,e),o=Ac.fromRangeStart(e.selection.getRng());return lx(r,e.getBody(),o).bind(function(e){return function(t){return t.fold((function(t){return Pf(e.dom,Ac.before(t))}),(function(e){return Lf(e)}),(function(e){return If(e)}),(function(t){return Bf(e.dom,Ac.after(t))}))}}(n)).bind(Ck(n,t)).exists(function(e){return function(t){return e.selection.setRng(t.toRange()),e.nodeChanged(),!0}}(e))}return !1},wk=function(e){e.on("keydown",(function(t){!1===t.isDefaultPrevented()&&function(e,t){oS([{keyCode:od.SPACEBAR,action:rS(xk,e)}],t).each((function(e){t.preventDefault();}));}(e,t);}));},Sk=function(e){var t=lw(e);return function(e){e.on("keyup compositionstart",_(Hw,e));}(e),SS(e,t),kS(e,t),ck(e),wk(e),lk(e),sk(e,t),hk(e,t),t},kk=function(){function e(e){var t;this.lastPath=[],this.editor=e;var n=this;"onselectionchange"in e.getDoc()||e.on("NodeChange click mouseup keyup focus",(function(n){var r=e.selection.getRng(),o={startContainer:r.startContainer,startOffset:r.startOffset,endContainer:r.endContainer,endOffset:r.endOffset};"nodechange"!==n.type&&sd(o,t)||e.fire("SelectionChange"),t=o;})),e.on("contextmenu",(function(){e.fire("SelectionChange");})),e.on("SelectionChange",(function(){var t=e.selection.getStart(!0);!t||!wt.range&&e.selection.isCollapsed()||jl(e)&&!n.isSameElementPath(t)&&e.dom.isChildOf(t,e.getBody())&&e.nodeChanged({selectionChange:!0});})),e.on("mouseup",(function(t){!t.isDefaultPrevented()&&jl(e)&&("IMG"===e.selection.getNode().nodeName?ro.setEditorTimeout(e,(function(){e.nodeChanged();})):e.nodeChanged());}));}return e.prototype.nodeChanged=function(e){var t,n,r,o=this.editor.selection;this.editor.initialized&&o&&!this.editor.getParam("disable_nodechange")&&!this.editor.mode.isReadOnly()&&(r=this.editor.getBody(),(t=o.getStart(!0)||r).ownerDocument===this.editor.getDoc()&&this.editor.dom.isChildOf(t,r)||(t=r),n=[],this.editor.dom.getParent(t,(function(e){if(e===r)return !0;n.push(e);})),(e=e||{}).element=t,e.parents=n,this.editor.fire("NodeChange",e));},e.prototype.isSameElementPath=function(e){var t,n=this.editor.$(e).parentsUntil(this.editor.getBody()).add(e);if(n.length===this.lastPath.length){for(t=n.length;t>=0&&n[t]===this.lastPath[t];t--);if(-1===t)return this.lastPath=n,!0}return this.lastPath=n,!1},e}(),Nk=function(e){!function(e){e.on("click",(function(t){e.dom.getParent(t.target,"details")&&t.preventDefault();}));}(e),function(e){e.parser.addNodeFilter("details",(function(e){q(e,(function(e){e.attr("data-mce-open",e.attr("open")),e.attr("open","open");}));})),e.serializer.addNodeFilter("details",(function(e){q(e,(function(e){var t=e.attr("data-mce-open");e.attr("open",l(t)?t:null),e.attr("data-mce-open",null);}));}));}(e);},Ek=function(e){return Dn(e)&&mo(Rt.fromDom(e))},_k=function(e){e.on("click",(function(t){t.detail>=3&&function(e){var t=e.selection.getRng(),n=Ac.fromRangeStart(t),r=Ac.fromRangeEnd(t);if(Ac.isElementPosition(n)){var o=n.container();Ek(o)&&Lf(o).each((function(e){return t.setStart(e.container(),e.offset())}));}Ac.isElementPosition(r)&&(o=n.container(),Ek(o)&&If(o).each((function(e){return t.setEnd(e.container(),e.offset())})));e.selection.setRng(Wp(t));}(e);}));},Ak=function(e){var t=e.getBoundingClientRect(),n=e.ownerDocument,r=n.documentElement,o=n.defaultView;return {top:t.top+o.pageYOffset-r.clientTop,left:t.left+o.pageXOffset-r.clientLeft}},Rk=function(e,t){return n=function(e){return e.inline?Ak(e.getBody()):{left:0,top:0}}(e),r=function(e){var t=e.getBody();return e.inline?{left:t.scrollLeft,top:t.scrollTop}:{left:0,top:0}}(e),o=function(e,t){if(t.target.ownerDocument!==e.getDoc()){var n=Ak(e.getContentAreaContainer()),r=function(e){var t=e.getBody(),n=e.getDoc().documentElement,r={left:t.scrollLeft,top:t.scrollTop},o={left:t.scrollLeft||n.scrollLeft,top:t.scrollTop||n.scrollTop};return e.inline?r:o}(e);return {left:t.pageX-n.left+r.left,top:t.pageY-n.top+r.top}}return {left:t.pageX,top:t.pageY}}(e,t),{pageX:o.left-n.left+r.left,pageY:o.top-n.top+r.top};var n,r,o;},Dk=$n,Tk=qn,Ok=function(e,t,n,r){var o=e.dom,i=t.cloneNode(!0);o.setStyles(i,{width:n,height:r}),o.setAttrib(i,"data-mce-selected",null);var a=o.create("div",{class:"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return o.setStyles(a,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:n,height:r}),o.setStyles(i,{margin:0,boxSizing:"border-box"}),a.appendChild(i),a},Bk=function(e){e&&e.parentNode&&e.parentNode.removeChild(e);},Pk=function(e,t){return function(n){if(function(e){return 0===e.button}(n)){var r=J(t.dom.getParents(n.target),function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){for(var n=0;n<e.length;n++)if(e[n](t))return !0;return !1}}(Dk,Tk)).getOr(null);if(u=t.getBody(),Dk(c=r)&&c!==u){var o=t.dom.getPos(r),i=t.getBody(),a=t.getDoc().documentElement;e.set({element:r,dragging:!1,screenX:n.screenX,screenY:n.screenY,maxX:(t.inline?i.scrollWidth:a.offsetWidth)-2,maxY:(t.inline?i.scrollHeight:a.offsetHeight)-2,relX:n.pageX-o.x,relY:n.pageY-o.y,width:r.offsetWidth,height:r.offsetHeight,ghost:Ok(t,r,r.offsetWidth,r.offsetHeight)});}}var u,c;}},Lk=function(e,t){return function(n){e.on((function(e){if(e.dragging){if(function(e,t,n){return t!==n&&!e.dom.isChildOf(t,n)&&!Dk(t)}(t,(a=t.selection,3===(u=a.getSel().getRangeAt(0).startContainer).nodeType?u.parentNode:u),e.element)){var r=(o=e.element,(i=o.cloneNode(!0)).removeAttribute("data-mce-selected"),i);t.fire("drop",{clientX:n.clientX,clientY:n.clientY}).isDefaultPrevented()||t.undoManager.transact((function(){Bk(e.element),t.insertContent(t.dom.getOuterHTML(r)),t._selectionOverrides.hideFakeCaret();}));}t.fire("dragend");}var o,i,a,u;})),Ik(e);}},Ik=function(e){e.on((function(e){Bk(e.ghost);})),e.clear();},Mk=function(e){var t=Eu(),n=pu.DOM,r=document,o=Pk(t,e),i=function(e,t){var n=ro.throttle((function(e,n){t._selectionOverrides.hideFakeCaret(),t.selection.placeCaretAt(e,n);}),0);return t.on("remove",n.stop),function(r){return e.on((function(e){var o,i,a=Math.max(Math.abs(r.screenX-e.screenX),Math.abs(r.screenY-e.screenY));if(!e.dragging&&a>10){if(t.fire("dragstart",{target:e.element}).isDefaultPrevented())return;e.dragging=!0,t.focus();}if(e.dragging){var u=function(e,t){return {pageX:t.pageX-e.relX,pageY:t.pageY+5}}(e,Rk(t,r));o=e.ghost,i=t.getBody(),o.parentNode!==i&&i.appendChild(o),function(e,t,n,r,o,i){var a=0,u=0;e.style.left=t.pageX+"px",e.style.top=t.pageY+"px",t.pageX+n>o&&(a=t.pageX+n-o),t.pageY+r>i&&(u=t.pageY+r-i),e.style.width=n-a+"px",e.style.height=r-u+"px";}(e.ghost,u,e.width,e.height,e.maxX,e.maxY),n(r.clientX,r.clientY);}}))}}(t,e),a=Lk(t,e),u=function(e,t){return function(){e.on((function(e){e.dragging&&t.fire("dragend");})),Ik(e);}}(t,e);e.on("mousedown",o),e.on("mousemove",i),e.on("mouseup",a),n.bind(r,"mousemove",i),n.bind(r,"mouseup",u),e.on("remove",(function(){n.unbind(r,"mousemove",i),n.unbind(r,"mouseup",u);})),e.on("keydown",(function(e){e.keyCode===od.ESC&&u();}));},Fk=function(e){Mk(e),function(e){e.on("drop",(function(t){var n=void 0!==t.clientX?e.getDoc().elementFromPoint(t.clientX,t.clientY):null;(Dk(n)||"false"===e.dom.getContentEditableParent(n))&&t.preventDefault();}));}(e),function(e){return e.getParam("block_unsupported_drop",!0,"boolean")}(e)&&function(e){var t=function(t){if(!t.isDefaultPrevented()){var n=t.dataTransfer;n&&(H(n.types,"Files")||n.files.length>0)&&(t.preventDefault(),"drop"===t.type&&Sy(e,"Dropped file type is not supported"));}},n=function(n){dm(e,n.target)&&t(n);},r=function(){var r=pu.DOM,o=e.dom,i=document,a=e.inline?e.getBody():e.getDoc(),u=["drop","dragover"];q(u,(function(e){r.bind(i,e,n),o.bind(a,e,t);})),e.on("remove",(function(){q(u,(function(e){r.unbind(i,e,n),o.unbind(a,e,t);}));}));};e.on("init",(function(){ro.setEditorTimeout(e,r,0);}));}(e);},Uk=qn,zk=$n,Hk=function(e,t){return Zl(e.getBody(),t)},jk=function(e){var t,n=e.selection,r=e.dom,o=r.isBlock,i=e.getBody(),a=Ms(e,i,o,(function(){return ym(e)})),u="sel-"+r.uniqueId(),c="data-mce-selected",s=function(e){return e!==i&&(zk(e)||Kn(e))&&r.isChildOf(e,i)},f=function(e){return bg(e)||yg(e)||gg(e)||pg(e)},l=function(e){e&&n.setRng(e);},d=n.getRng,m=function(t,r,o,i){return void 0===i&&(i=!0),e.fire("ShowCaret",{target:r,direction:t,before:o}).isDefaultPrevented()?null:(i&&n.scrollIntoView(r,-1===t),a.show(o,r))},g=function(e){return _o(e)||Oo(e)||Bo(e)},p=function(e){return g(e.startContainer)||g(e.endContainer)},h=function(t){var n=e.schema.getShortEndedElements(),o=r.createRng(),i=t.startContainer,a=t.startOffset,u=t.endContainer,c=t.endOffset;return ye(n,i.nodeName.toLowerCase())?0===a?o.setStartBefore(i):o.setStartAfter(i):o.setStart(i,a),ye(n,u.nodeName.toLowerCase())?0===c?o.setEndBefore(u):o.setEndAfter(u):o.setEnd(u,c),o},b=function(o){var i=o.cloneNode(!0),a=e.fire("ObjectSelected",{target:o,targetClone:i});if(a.isDefaultPrevented())return null;var s=function(t,o,i){var a=e.$,c=Jr(Rt.fromDom(e.getBody()),"#"+u).fold((function(){return a([])}),(function(e){return a([e.dom])}));0===c.length&&(c=a('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>').attr("id",u)).appendTo(e.getBody());var s=r.createRng();o===i&&wt.ie?(c.empty().append('<p style="font-size: 0" data-mce-bogus="all"> </p>').append(o),s.setStartAfter(c[0].firstChild.firstChild),s.setEndAfter(o)):(c.empty().append(yo).append(o).append(yo),s.setStart(c[0].firstChild,1),s.setEnd(c[0].lastChild,0)),c.css({top:r.getPos(t,e.getBody()).y}),c[0].focus();var f=n.getSel();return f.removeAllRanges(),f.addRange(s),s}(o,a.targetClone,i),f=Rt.fromDom(o);return q(Mu(Rt.fromDom(e.getBody()),"*[data-mce-selected]"),(function(e){Bt(f,e)||nr(e,c);})),r.getAttrib(o,c)||o.setAttribute(c,"1"),t=o,x(),s},y=function(e,t){if(!e)return null;if(e.collapsed){if(!p(e)){var n=t?1:-1,o=sf(n,i,e),a=o.getNode(!t);if(zs(a))return m(n,a,!!t&&!o.isAtEnd(),!1);var u=o.getNode(t);if(zs(u))return m(n,u,!t&&!o.isAtEnd(),!1)}return null}var c=e.startContainer,f=e.startOffset,l=e.endOffset;if(3===c.nodeType&&0===f&&zk(c.parentNode)&&(c=c.parentNode,f=r.nodeIndex(c),c=c.parentNode),1!==c.nodeType)return null;if(l===f+1&&c===e.endContainer){var d=c.childNodes[f];if(s(d))return b(d)}return null},C=function(){t&&t.removeAttribute(c),Jr(Rt.fromDom(e.getBody()),"#"+u).each(hn),t=null;},x=function(){a.hide();};return wt.ceFalse&&!Gv(e)&&function(){e.on("mouseup",(function(t){var n=d();n.collapsed&&hy(e,t.clientX,t.clientY)&&RC(e,n,!1).each(l);})),e.on("click",(function(t){var o=Hk(e,t.target);o&&(zk(o)&&(t.preventDefault(),e.focus()),Uk(o)&&r.isChildOf(o,n.getNode())&&C());})),e.on("blur NewBlock",C),e.on("ResizeWindow FullscreenStateChanged",a.reposition);var c=function(t,n){var i,a,u=r.getParent(t,o),c=r.getParent(n,o);return !v(u)&&(!(t===c||!r.isChildOf(u,c)||!1!==zk(Hk(e,u)))||!r.isChildOf(c,u)&&(i=u,a=c,!(r.getParent(i,o)===r.getParent(a,o)))&&function(e){var t=e.firstChild;if(v(t))return !1;var n=Ac.before(t);if(jn(n.getNode())&&1===e.childNodes.length)return !f(n);var r=kf(e).next(n);return r&&!f(r)}(u))};e.on("tap",(function(t){var n=t.target,r=Hk(e,n);zk(r)?(t.preventDefault(),AC(e,r).each(y)):s(n)&&AC(e,n).each(y);}),!0),e.on("mousedown",(function(t){var o=t.target;if((o===i||"HTML"===o.nodeName||r.isChildOf(o,i))&&!1!==hy(e,t.clientX,t.clientY)){var a=Hk(e,o);if(a)zk(a)?(t.preventDefault(),AC(e,a).each(y)):(C(),Uk(a)&&t.shiftKey||ed(t.clientX,t.clientY,n.getRng())||(x(),n.placeCaretAt(t.clientX,t.clientY)));else if(s(o))AC(e,o).each(y);else if(!1===zs(o)){C(),x();var u=Qx(i,t.clientX,t.clientY);if(u&&!c(o,u.node)){t.preventDefault();var f=m(1,u.node,u.before,!1);l(f),e.getBody().focus();}}}})),e.on("keypress",(function(e){od.modifierPressed(e)||zk(n.getNode())&&e.preventDefault();})),e.on("GetSelectionRange",(function(e){var n=e.range;if(t){if(!t.parentNode)return void(t=null);(n=n.cloneRange()).selectNode(t),e.range=n;}})),e.on("SetSelectionRange",(function(e){e.range=h(e.range);var t=y(e.range,e.forward);t&&(e.range=t);})),e.on("AfterSetSelectionRange",(function(e){var t,n=e.range,o=n.startContainer.parentNode;p(n)||"mcepastebin"===o.id||x(),t=o,r.hasClass(t,"mce-offscreen-selection")||C();})),e.on("copy",(function(e){var t,n=e.clipboardData;if(!e.isDefaultPrevented()&&e.clipboardData&&!wt.ie){var o=(t=r.get(u))?t.getElementsByTagName("*")[0]:t;o&&(e.preventDefault(),n.clearData(),n.setData("text/html",o.outerHTML),n.setData("text/plain",o.outerText||o.innerText));}})),Fk(e),function(e){var t=_u((function(){if(!e.removed&&e.getBody().contains(document.activeElement)){var t=e.selection.getRng();if(t.collapsed){var n=DC(e,t,!1);e.selection.setRng(n);}}}),0);e.on("focus",(function(){t.throttle();})),e.on("blur",(function(){t.cancel();}));}(e),function(e){e.on("init",(function(){e.on("focusin",(function(t){var n=t.target;if(Kn(n)){var r=Zl(e.getBody(),n),o=$n(r)?r:n;e.selection.getNode()!==o&&AC(e,o).each((function(t){return e.selection.setRng(t)}));}}));}));}(e);}(),{showCaret:m,showBlockCaretContainer:function(e){e.hasAttribute("data-mce-caret")&&(Po(e),l(d()),n.scrollIntoView(e));},hideFakeCaret:x,destroy:function(){a.destroy(),t=null;}}},Vk=function(e){var t,n,r=_t.each,o=od.BACKSPACE,i=od.DELETE,a=e.dom,u=e.selection,c=e.parser,s=wt.gecko,f=wt.ie,l=wt.webkit,d="data:text/mce-internal,",m=f?"Text":"URL",g=function(t,n){try{e.getDoc().execCommand(t,!1,n);}catch(e){}},p=function(e){return e.isDefaultPrevented()},h=function(){var t=function(e){var t=a.create("body"),n=e.cloneContents();return t.appendChild(n),u.serializer.serialize(t,{format:"html"})};e.on("keydown",(function(n){var r,u,c=n.keyCode;if(!p(n)&&(c===i||c===o)){if(r=e.selection.isCollapsed(),u=e.getBody(),r&&!a.isEmpty(u))return;if(!r&&!function(n){var r=t(n),o=a.createRng();return o.selectNode(e.getBody()),r===t(o)}(e.selection.getRng()))return;n.preventDefault(),e.setContent(""),u.firstChild&&a.isBlock(u.firstChild)?e.selection.setCursorLocation(u.firstChild,0):e.selection.setCursorLocation(u,0),e.nodeChanged();}}));},v=function(){e.shortcuts.add("meta+a",null,"SelectAll");},b=function(){e.inline||a.bind(e.getDoc(),"mousedown mouseup",(function(t){var n;if(t.target===e.getDoc().documentElement)if(n=u.getRng(),e.getBody().focus(),"mousedown"===t.type){if(_o(n.startContainer))return;u.placeCaretAt(t.clientX,t.clientY);}else u.setRng(n);}));},y=function(){Range.prototype.getClientRects||e.on("mousedown",(function(t){if(!p(t)&&"HTML"===t.target.nodeName){var n=e.getBody();n.blur(),ro.setEditorTimeout(e,(function(){n.focus();}));}}));},C=function(){e.on("click",(function(t){var n=t.target;/^(IMG|HR)$/.test(n.nodeName)&&"false"!==a.getContentEditableParent(n)&&(t.preventDefault(),e.selection.select(n),e.nodeChanged()),"A"===n.nodeName&&a.hasClass(n,"mce-item-anchor")&&(t.preventDefault(),u.select(n));}));},w=function(){e.on("keydown",(function(e){if(!p(e)&&e.keyCode===o&&u.isCollapsed()&&0===u.getRng().startOffset){var t=u.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}}));},S=function(){(function(e){return e.getParam("readonly")})(e)||e.on("BeforeExecCommand mousedown",(function(){g("StyleWithCSS",!1),g("enableInlineTableEditing",!1),ps(e)||g("enableObjectResizing",!1);}));},k=function(){e.on("SetContent ExecCommand",(function(e){"setcontent"!==e.type&&"mceInsertLink"!==e.command||r(a.select("a"),(function(e){var t=e.parentNode,n=a.getRoot();if(t.lastChild===e){for(;t&&!a.isBlock(t);){if(t.parentNode.lastChild!==t||t===n)return;t=t.parentNode;}a.add(t,"br",{"data-mce-bogus":1});}}));}));},N=function(){e.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}");},E=function(){e.inline||e.on("keydown",(function(){document.activeElement===document.body&&e.getWin().focus();}));},_=function(){e.inline||(e.contentStyles.push("body {min-height: 150px}"),e.on("click",(function(t){var n;if("HTML"===t.target.nodeName){if(wt.ie>11)return void e.getBody().focus();n=e.selection.getRng(),e.getBody().focus(),e.selection.setRng(n),e.selection.normalize(),e.nodeChanged();}})));},A=function(){wt.mac&&e.on("keydown",(function(t){!od.metaKeyPressed(t)||t.shiftKey||37!==t.keyCode&&39!==t.keyCode||(t.preventDefault(),e.selection.getSel().modify("move",37===t.keyCode?"backward":"forward","lineboundary"));}));},R=function(){e.on("click",(function(e){var t=e.target;do{if("A"===t.tagName)return void e.preventDefault()}while(t=t.parentNode)})),e.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}");},D=function(){e.on("init",(function(){e.dom.bind(e.getBody(),"submit",(function(e){e.preventDefault();}));}));},T=function(){e.on("dragstart",(function(t){!function(t){var n,r;t.dataTransfer&&(e.selection.isCollapsed()&&"IMG"===t.target.tagName&&u.select(t.target),(n=e.selection.getContent()).length>0&&(r=d+escape(e.id)+","+escape(n),t.dataTransfer.setData(m,r)));}(t);})),e.on("drop",(function(t){if(!p(t)){var n=function(e){var t;return e.dataTransfer&&(t=e.dataTransfer.getData(m))&&t.indexOf(d)>=0?(t=t.substr(d.length).split(","),{id:unescape(t[0]),html:unescape(t[1])}):null}(t);if(n&&n.id!==e.id){t.preventDefault();var r=cd(t.x,t.y,e.getDoc());u.setRng(r),o=n.html,i=!0,e.queryCommandSupported("mceInsertClipboardContent")?e.execCommand("mceInsertClipboardContent",!1,{content:o,internal:i}):e.execCommand("mceInsertContent",!1,o);}}var o,i;}));},O=x;return Gv(e)?(l&&(b(),C(),D(),v(),wt.iOS&&(E(),_(),R())),s&&(y(),S(),N(),A())):(e.on("keydown",(function(t){var n,r;if(!p(t)&&t.keyCode===od.BACKSPACE){var o=(n=u.getRng()).startContainer,i=n.startOffset,c=a.getRoot();if(r=o,n.collapsed&&0===i){for(;r&&r.parentNode&&r.parentNode.firstChild===r&&r.parentNode!==c;)r=r.parentNode;"BLOCKQUOTE"===r.tagName&&(e.formatter.toggle("blockquote",null,r),(n=a.createRng()).setStart(o,0),n.setEnd(o,0),u.setRng(n));}}})),h(),wt.windowsPhone||e.on("keyup focusin mouseup",(function(e){od.modifierPressed(e)||u.normalize();}),!0),l&&(b(),C(),ts(e)&&e.on("init",(function(){g("DefaultParagraphSeparator",ts(e));})),D(),w(),c.addNodeFilter("br",(function(e){for(var t=e.length;t--;)"Apple-interchange-newline"===e[t].attr("class")&&e[t].remove();})),wt.iOS?(E(),_(),R()):v()),wt.ie>=11&&(_(),w()),wt.ie&&(v(),g("AutoUrlDetect",!1),T()),s&&(e.on("keydown",(function(t){if(!p(t)&&t.keyCode===o){if(!e.getBody().getElementsByTagName("hr").length)return;if(u.isCollapsed()&&0===u.getRng().startOffset){var n=u.getNode(),r=n.previousSibling;if("HR"===n.nodeName)return a.remove(n),void t.preventDefault();r&&r.nodeName&&"hr"===r.nodeName.toLowerCase()&&(a.remove(r),t.preventDefault());}}})),y(),t=function(){var t=a.getAttribs(u.getStart().cloneNode(!1));return function(){var n=u.getStart();n!==e.getBody()&&(a.setAttrib(n,"style",null),r(t,(function(e){n.setAttributeNode(e.cloneNode(!0));})));}},n=function(){return !u.isCollapsed()&&a.getParent(u.getStart(),a.isBlock)!==a.getParent(u.getEnd(),a.isBlock)},e.on("keypress",(function(r){var o;if(!p(r)&&(8===r.keyCode||46===r.keyCode)&&n())return o=t(),e.getDoc().execCommand("delete",!1,null),o(),r.preventDefault(),!1})),a.bind(e.getDoc(),"cut",(function(r){var o;!p(r)&&n()&&(o=t(),ro.setEditorTimeout(e,(function(){o();})));})),S(),k(),N(),A(),w())),{refreshContentEditable:O,isHidden:function(){if(!s||e.removed)return !1;var t=e.selection.getSel();return !t||!t.rangeCount||0===t.rangeCount}}},qk=pu.DOM,$k=function(e){return e.inline?e.getElement().nodeName.toLowerCase():void 0},Wk=function(e){return he(e,(function(e){return !1===h(e)}))},Kk=function(e){var t=e.settings,n=e.editorUpload.blobCache;return Wk({allow_conditional_comments:t.allow_conditional_comments,allow_html_data_urls:t.allow_html_data_urls,allow_svg_data_urls:t.allow_svg_data_urls,allow_html_in_named_anchor:t.allow_html_in_named_anchor,allow_script_urls:t.allow_script_urls,allow_unsafe_link_target:t.allow_unsafe_link_target,convert_fonts_to_spans:t.convert_fonts_to_spans,fix_list_elements:t.fix_list_elements,font_size_legacy_values:t.font_size_legacy_values,forced_root_block:t.forced_root_block,forced_root_block_attrs:t.forced_root_block_attrs,padd_empty_with_br:t.padd_empty_with_br,preserve_cdata:t.preserve_cdata,remove_trailing_brs:t.remove_trailing_brs,inline_styles:t.inline_styles,root_name:$k(e),validate:!0,blob_cache:n,document:e.getDoc(),images_dataimg_filter:t.images_dataimg_filter})},Xk=function(e){var t=e.dom.getRoot();e.inline||jl(e)&&e.selection.getStart(!0)!==t||Lf(t).each((function(t){var n=t.getNode(),r=Ln(n)?Lf(n).getOr(t):t;wt.browser.isIE()?function(e,t){var n=Rt.fromDom(e.getBody()),r=(nm(e)?I.from(t):I.none()).map(rm).filter(tm(n));e.bookmark=r.isSome()?r:e.bookmark;}(e,r.toRange()):e.selection.setRng(r.toRange());}));},Yk=function(e){e.bindPendingEventDelegates(),e.initialized=!0,function(e){e.fire("Init");}(e),e.focus(!0),Xk(e),e.nodeChanged({initial:!0}),e.execCallback("init_instance_callback",e),function(e){e.settings.auto_focus&&ro.setEditorTimeout(e,(function(){var t;(t=!0===e.settings.auto_focus?e:e.editorManager.get(e.settings.auto_focus)).destroyed||t.focus();}),100);}(e);},Gk=function(e){return e.inline?e.ui.styleSheetLoader:e.dom.styleSheetLoader},Jk=function(e){var t=Gk(e),n=gs(e),r=e.contentCSS,o=function(){t.unloadAll(r),e.inline||e.ui.styleSheetLoader.unloadAll(n);},i=function(){e.removed?o():e.on("remove",o);};if(e.contentStyles.length>0){var a="";_t.each(e.contentStyles,(function(e){a+=e+"\r\n";})),e.dom.addStyle(a);}var u=Zr.all(function(e,t,n){var r=[new Zr((function(n,r){return Gk(e).loadAll(t,n,r)}))];return e.inline?r:r.concat([new Zr((function(t,r){return e.ui.styleSheetLoader.loadAll(n,t,r)}))])}(e,r,n)).then(i).catch(i);return e.settings.content_style&&function(e,t){var n=Rt.fromDom(e.getBody()),r=un(an(n)),o=Rt.fromTag("style");Qn(o,"type","text/css"),mn(o,Rt.fromText(t)),mn(r,o),e.on("remove",(function(){hn(o);}));}(e,e.settings.content_style),u},Qk=function(e){var t=e.settings,n=e.getDoc(),r=e.getBody();!function(e){e.fire("PreInit");}(e),t.browser_spellcheck||t.gecko_spellcheck||(n.body.spellcheck=!1,qk.setAttrib(r,"spellcheck","false")),e.quirks=Vk(e),function(e){e.fire("PostRender");}(e);var o=function(e){return e.getParam("directionality",ku.isRtl()?"rtl":void 0)}(e);void 0!==o&&(r.dir=o),t.protect&&e.on("BeforeSetContent",(function(e){_t.each(t.protect,(function(t){e.content=e.content.replace(t,(function(e){return "\x3c!--mce:protected "+escape(e)+"--\x3e"}));}));})),e.on("SetContent",(function(){e.addVisual(e.getBody());})),e.on("compositionstart compositionend",(function(t){e.composing="compositionstart"===t.type;}));},Zk=function(e){!0!==e.removed&&(!function(e){Gv(e)||e.load({initial:!0,format:"html"}),e.startContent=e.getContent({format:"raw"});}(e),Yk(e));},eN=function(e,t){var n=e.settings,r=e.getElement(),o=e.getDoc();n.inline||(e.getElement().style.visibility=e.orgVisibility),t||e.inline||(o.open(),o.write(e.iframeHTML),o.close()),e.inline&&(qk.addClass(r,"mce-content-body"),e.contentDocument=o=document,e.contentWindow=window,e.bodyElement=r,e.contentAreaContainer=r);var i=e.getBody();i.disabled=!0,e.readonly=!!n.readonly,e.readonly||(e.inline&&"static"===qk.getStyle(i,"position",!0)&&(i.style.position="relative"),i.contentEditable=e.getParam("content_editable_state",!0)),i.disabled=!1,e.editorUpload=My(e),e.schema=Ai(n),e.dom=pu(o,{keep_values:!0,url_converter:e.convertURL,url_converter_scope:e,hex_colors:n.force_hex_style_colors,update_styles:!0,root_element:e.inline?e.getBody():null,collect:function(){return e.inline},schema:e.schema,contentCssCors:fs(e),referrerPolicy:ls(e),onSetAttrib:function(t){e.fire("SetAttrib",t);}}),e.parser=function(e){var t=_b(Kk(e),e.schema);return t.addAttributeFilter("src,href,style,tabindex",(function(t,n){for(var r,o,i=t.length,a=e.dom,u="data-mce-"+n;i--;)if((o=(r=t[i]).attr(n))&&!r.attr(u)){if(0===o.indexOf("data:")||0===o.indexOf("blob:"))continue;"style"===n?((o=a.serializeStyle(a.parseStyle(o),r.name)).length||(o=null),r.attr(u,o),r.attr(n,o)):"tabindex"===n?(r.attr(u,o),r.attr(n,null)):r.attr(u,e.convertURL(o,n,r.name));}})),t.addNodeFilter("script",(function(e){for(var t=e.length;t--;){var n=e[t],r=n.attr("type")||"no/type";0!==r.indexOf("mce-")&&n.attr("type","mce-"+r);}})),e.settings.preserve_cdata&&t.addNodeFilter("#cdata",(function(t){for(var n=t.length;n--;){var r=t[n];r.type=8,r.name="#comment",r.value="[CDATA["+e.dom.encode(r.value)+"]]";}})),t.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",(function(t){for(var n=t.length,r=e.schema.getNonEmptyElements();n--;){var o=t[n];o.isEmpty(r)&&0===o.getAll("br").length&&(o.append(new Om("br",1)).shortEnded=!0);}})),t}(e),e.serializer=Ob(function(e){var t=e.settings;return Re(Re({},Kk(e)),Wk({url_converter:t.url_converter,url_converter_scope:t.url_converter_scope,element_format:t.element_format,entities:t.entities,entity_encoding:t.entity_encoding,indent:t.indent,indent_after:t.indent_after,indent_before:t.indent_before,block_elements:t.block_elements,boolean_attributes:t.boolean_attributes,custom_elements:t.custom_elements,extended_valid_elements:t.extended_valid_elements,invalid_elements:t.invalid_elements,invalid_styles:t.invalid_styles,move_caret_before_on_enter_elements:t.move_caret_before_on_enter_elements,non_empty_elements:t.non_empty_elements,schema:t.schema,self_closing_elements:t.self_closing_elements,short_ended_elements:t.short_ended_elements,special:t.special,text_block_elements:t.text_block_elements,text_inline_elements:t.text_inline_elements,valid_children:t.valid_children,valid_classes:t.valid_classes,valid_elements:t.valid_elements,valid_styles:t.valid_styles,verify_html:t.verify_html,whitespace_elements:t.whitespace_elements}))}(e),e),e.selection=sb(e.dom,e.getWin(),e.serializer,e),e.annotator=Jl(e),e.formatter=qy(e),e.undoManager=Wy(e),e._nodeChangeDispatcher=new kk(e),e._selectionOverrides=jk(e),Lw(e),Nk(e),Gv(e)||_k(e);var a=function(e){return Gv(e)?Cu(null):Sk(e)}(e);Bw(e,a),function(e){ts(e)&&e.on("NodeChange",_(Uw,e));}(e),Jy(e);var u=Jv(e);Qk(e),u.fold((function(){Jk(e).then((function(){return Zk(e)}));}),(function(t){e.setProgressState(!0),Jk(e).then((function(){t().then((function(t){e.setProgressState(!1),Zk(e);}),(function(t){e.notificationManager.open({type:"error",text:String(t)}),Zk(e);}));}));}));},tN=pu.DOM,nN=function(e){var t=function(e){return e.getParam("doctype","<!DOCTYPE html>")}(e)+"<html><head>";((function(e){return e.getParam("document_base_url","")}))(e)!==e.documentBaseUrl&&(t+='<base href="'+e.documentBaseURI.getURI()+'" />'),t+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';var n=function(e){return Zc(e,"body_id","tinymce")}(e),r=function(e){return Zc(e,"body_class","")}(e),o=e.translate(function(e){return e.getParam("iframe_aria_text","Rich Text Area. Press ALT-0 for help.","string")}(e));return es(e)&&(t+='<meta http-equiv="Content-Security-Policy" content="'+es(e)+'" />'),t+='</head><body id="'+n+'" class="mce-content-body '+r+'" data-id="'+e.id+'" aria-label="'+o+'"><br></body></html>'},rN=function(e,t){var n,r,o,i,a=e.translate("Rich Text Area"),u=(n=e.id,r=a,t.height,o=function(e){return e.getParam("iframe_attrs",{})}(e),i=Rt.fromTag("iframe"),Zn(i,o),Zn(i,{id:n+"_ifr",frameBorder:"0",allowTransparency:"true",title:r}),Bu(i,"tox-edit-area__iframe"),i).dom;u.onload=function(){u.onload=null,e.fire("load");};var c=function(e,t){if(document.domain!==window.location.hostname&&wt.browser.isIE()){var n=By("mce");e[n]=function(){eN(e);};var r='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+e.id+'");document.write(ed.iframeHTML);document.close();ed.'+n+"(true);})()";return tN.setAttrib(t,"src",r),!0}return !1}(e,u);return e.contentAreaContainer=t.iframeContainer,e.iframeElement=u,e.iframeHTML=nN(e),tN.add(t.iframeContainer,u),c},oN=pu.DOM,iN=function(e,t,n){var r=yy.get(n),o=yy.urls[n]||e.documentBaseUrl.replace(/\/$/,"");if(n=_t.trim(n),r&&-1===_t.inArray(t,n)){if(_t.each(yy.dependencies(n),(function(n){iN(e,t,n);})),e.plugins[n])return;try{var i=new r(e,o,e.$);e.plugins[n]=i,i.init&&(i.init(e,o),t.push(n));}catch(t){!function(e,t,n){var r=ku.translate(["Failed to initialize plugin: {0}",t]);td(e,"PluginLoadError",{message:r}),_y(r,n),Sy(e,r);}(e,n,t);}}},aN=function(e){return e.replace(/^\-/,"")},uN=function(e){return {editorContainer:e,iframeContainer:e,api:{}}},cN=function(e){var t=e.getElement();return e.inline?uN(null):function(e){var t=oN.create("div");return oN.insertAfter(t,e),uN(t)}(t)},sN=function(e){var t=e.getElement();return e.orgDisplay=t.style.display,l(vs(e))?function(e){return e.theme.renderUI()}(e):y(vs(e))?function(e){var t=e.getElement(),n=vs(e)(e,t);return n.editorContainer.nodeType&&(n.editorContainer.id=n.editorContainer.id||e.id+"_parent"),n.iframeContainer&&n.iframeContainer.nodeType&&(n.iframeContainer.id=n.iframeContainer.id||e.id+"_iframecontainer"),n.height=n.iframeHeight?n.iframeHeight:t.offsetHeight,n}(e):cN(e)},fN=function(e){e.fire("ScriptsLoaded"),function(e){var t=_t.trim(is(e)),n=e.ui.registry.getAll().icons,r=Re(Re({},sy.get("default").icons),sy.get(t).icons);le(r,(function(t,r){ye(n,r)||e.ui.registry.addIcon(r,t);}));}(e),function(e){var t=vs(e);if(l(t)){e.settings.theme=aN(t);var n=Cy.get(t);e.theme=new n(e,Cy.urls[t]),e.theme.init&&e.theme.init(e,Cy.urls[t]||e.documentBaseUrl.replace(/\/$/,""),e.$);}else e.theme={};}(e),function(e){var t=[];_t.each(xs(e).split(/[ ,]/),(function(n){iN(e,t,aN(n));}));}(e);var t=sN(e);!function(e,t){var n={show:I.from(t.show).getOr(x),hide:I.from(t.hide).getOr(x),disable:I.from(t.disable).getOr(x),isDisabled:I.from(t.isDisabled).getOr(T),enable:function(){e.mode.isReadOnly()||I.from(t.enable).map(D);}};e.ui=Re(Re({},e.ui),n);}(e,I.from(t.api).getOr({}));var n={editorContainer:t.editorContainer,iframeContainer:t.iframeContainer};return e.editorContainer=n.editorContainer?n.editorContainer:null,Dy(e),e.inline?eN(e):function(e,t){var n=rN(e,t);t.editorContainer&&(tN.get(t.editorContainer).style.display=e.orgDisplay,e.hidden=tN.isHidden(t.editorContainer)),e.getElement().style.display="none",tN.setAttrib(e.id,"aria-hidden","true"),n||eN(e);}(e,n)},lN=pu.DOM,dN=function(e){return "-"===e.charAt(0)},mN=function(e,t){var n=ds(t),r=function(e){return e.getParam("language_url","","string")}(t);if(!1===ku.hasCode(n)&&"en"!==n){var o=""!==r?r:t.editorManager.baseURL+"/langs/"+n+".js";e.add(o,x,void 0,(function(){!function(e,t,n){ky(e,"LanguageLoadError",Ny("language",t,n));}(t,o,n);}));}},gN=function(e,t,n){return I.from(t).filter((function(e){return e.length>0&&!sy.has(e)})).map((function(t){return {url:e.editorManager.baseURL+"/icons/"+t+"/icons"+n+".js",name:I.some(t)}}))},pN=function(e,t,n){var r=gN(t,"default",n),o=function(e){return I.from(function(e){return e.getParam("icons_url","","string")}(e)).filter((function(e){return e.length>0})).map((function(e){return {url:e,name:I.none()}}))}(t).orThunk((function(){return gN(t,is(t),"")}));q(function(e){for(var t=[],n=function(e){t.push(e);},r=0;r<e.length;r++)e[r].each(n);return t}([r,o]),(function(n){e.add(n.url,x,void 0,(function(){!function(e,t,n){ky(e,"IconsLoadError",Ny("icons",t,n));}(t,n.url,n.name.getOrUndefined());}));}));},hN=function(e,t){var n=yu.ScriptLoader;!function(e,t,n,r){var o=vs(t);if(l(o)){if(!dN(o)&&!ye(Cy.urls,o)){var i=function(e){return e.getParam("theme_url")}(t);i?Cy.load(o,t.documentBaseURI.toAbsolute(i)):Cy.load(o,"themes/"+o+"/theme"+n+".js");}e.loadQueue((function(){Cy.waitFor(o,r);}));}else r();}(n,e,t,(function(){mN(n,e),pN(n,e,t),function(e,t){_t.each(function(e){return e.getParam("external_plugins")}(e),(function(t,n){yy.load(n,t,x,void 0,(function(){Ey(e,t,n);})),e.settings.plugins+=" "+n;})),_t.each(xs(e).split(/[ ,]/),(function(n){if((n=_t.trim(n))&&!yy.urls[n])if(dN(n)){n=n.substr(1,n.length);var r=yy.dependencies(n);_t.each(r,(function(n){var r={prefix:"plugins/",resource:n,suffix:"/plugin"+t+".js"},o=yy.createUrl(r,n);yy.load(o.resource,o,x,void 0,(function(){Ey(e,o.prefix+o.resource+o.suffix,o.resource);}));}));}else {var o={prefix:"plugins/",resource:n,suffix:"/plugin"+t+".js"};yy.load(n,o,x,void 0,(function(){Ey(e,o.prefix+o.resource+o.suffix,n);}));}}));}(e,t),n.loadQueue((function(){e.removed||fN(e);}),e,(function(){e.removed||fN(e);}));}));},vN=function(e){var t=e.id;ku.setCode(ds(e));var n=function(){lN.unbind(window,"ready",n),e.render();};if(Ui.Event.domLoaded){if(e.getElement()&&wt.contentEditable){var r=Rt.fromDom(e.getElement()),o=function(e){return Y(e.dom.attributes,(function(e,t){return e[t.name]=t.value,e}),{})}(r);e.on("remove",(function(){$(r.dom.attributes,(function(e){return nr(r,e.name)})),Zn(r,o);})),e.ui.styleSheetLoader=function(e,t){return io.forElement(e,{contentCssCors:Cs(t),referrerPolicy:ls(t)})}(r,e),!function(e){return e.getParam("inline")}(e)?(e.orgVisibility=e.getElement().style.visibility,e.getElement().style.visibility="hidden"):e.inline=!0;var i=e.getElement().form||lN.getParent(t,"form");i&&(e.formElement=i,function(e){return e.getParam("hidden_input")}(e)&&!Mn(e.getElement())&&(lN.insertAfter(lN.create("input",{type:"hidden",name:t}),t),e.hasHiddenInput=!0),e.formEventDelegate=function(t){e.fire(t.type,t);},lN.bind(i,"submit reset",e.formEventDelegate),e.on("reset",(function(){e.resetContent();})),!function(e){return e.getParam("submit_patch")}(e)||i.submit.nodeType||i.submit.length||i._mceOldSubmit||(i._mceOldSubmit=i.submit,i.submit=function(){return e.editorManager.triggerSave(),e.setDirty(!1),i._mceOldSubmit(i)})),e.windowManager=xy(e),e.notificationManager=by(e),function(e){return "xml"===e.getParam("encoding")}(e)&&e.on("GetContent",(function(e){e.save&&(e.content=lN.encode(e.content));})),function(e){return e.getParam("add_form_submit_trigger")}(e)&&e.on("submit",(function(){e.initialized&&e.save();})),function(e){return e.getParam("add_unload_trigger")}(e)&&(e._beforeUnload=function(){!e.initialized||e.destroyed||e.isHidden()||e.save({format:"raw",no_events:!0,set_dirty:!1});},e.editorManager.on("BeforeUnload",e._beforeUnload)),e.editorManager.add(e),hN(e,e.suffix);}}else lN.bind(window,"ready",n);},bN=function(e,t){return function(e,t){return Zv(e).editor.addVisual(t)}(e,t)},yN={"font-size":"size","font-family":"face"},CN=function(e,t,n){return lh(Rt.fromDom(n),(function(t){return function(t){return ar(t,e).orThunk((function(){return "font"===It(t)?be(yN,e).bind((function(e){return tr(t,e)})):I.none()}))}(t)}),(function(e){return Bt(Rt.fromDom(t),e)}))},xN=function(e){return function(t,n){return I.from(n).map(Rt.fromDom).filter(Ut).bind((function(n){return CN(e,t,n.dom).or(function(e,t){return I.from(pu.DOM.getStyle(t,e,!0))}(e,n.dom))})).getOr("")}},wN=xN("font-size"),SN=w((function(e){return e.replace(/[\'\"\\]/g,"").replace(/,\s+/g,",")}),xN("font-family")),kN=function(e){return Lf(e.getBody()).map((function(e){var t=e.container();return Fn(t)?t.parentNode:t}))},NN=function(e,t){return function(e){return I.from(e.selection.getRng()).bind((function(t){var n=e.getBody();return t.startContainer===n&&0===t.startOffset?I.none():I.from(e.selection.getStart(!0))}))}(e).orThunk(_(kN,e)).map(Rt.fromDom).filter(Ut).bind(t)},EN=function(e,t){return NN(e,S(I.some,t))},_N=function(e,t){if(/^[0-9.]+$/.test(t)){var n=parseInt(t,10);if(n>=1&&n<=7){var r=function(e){return _t.explode(e.getParam("font_size_style_values","xx-small,x-small,small,medium,large,x-large,xx-large"))}(e),o=function(e){return _t.explode(e.getParam("font_size_classes",""))}(e);return o?o[n-1]||t:r[n-1]||t}return t}return t},AN=function(e){var t=e.split(/\s*,\s*/);return V(t,(function(e){return -1===e.indexOf(" ")||Me(e,'"')||Me(e,"'")?e:"'"+e+"'"})).join(",")},RN=function(e,t){var n=function(e){if("string"!=typeof e){var t=_t.extend({paste:e.paste,data:{paste:e.paste}},e);return {content:e.content,details:t}}return {content:e,details:{}}}(t);!function(e,t,n){Qv(e).editor.insertContent(t,n);}(e,n.content,n.details);},DN=_t.each,TN=_t.map,ON=_t.inArray,BN=function(){function e(e){this.commands={state:{},exec:{},value:{}},this.editor=e,this.setupCommands(e);}return e.prototype.execCommand=function(e,t,n,r){var o,i=!1,a=this;if(!a.editor.removed){var u;if("mcefocus"!==e.toLowerCase()&&(/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(e)||r&&r.skip_focus?(u=a.editor,um(u).each((function(e){return u.selection.setRng(e)}))):a.editor.focus()),(r=a.editor.fire("BeforeExecCommand",{command:e,ui:t,value:n})).isDefaultPrevented())return !1;var c=e.toLowerCase();if(o=a.commands.exec[c])return o(c,t,n),a.editor.fire("ExecCommand",{command:e,ui:t,value:n}),!0;if(DN(this.editor.plugins,(function(r){if(r.execCommand&&r.execCommand(e,t,n))return a.editor.fire("ExecCommand",{command:e,ui:t,value:n}),i=!0,!1})),i)return i;if(a.editor.theme&&a.editor.theme.execCommand&&a.editor.theme.execCommand(e,t,n))return a.editor.fire("ExecCommand",{command:e,ui:t,value:n}),!0;try{i=a.editor.getDoc().execCommand(e,t,n);}catch(e){}return !!i&&(a.editor.fire("ExecCommand",{command:e,ui:t,value:n}),!0)}},e.prototype.queryCommandState=function(e){var t;if(!this.editor.quirks.isHidden()&&!this.editor.removed){if(e=e.toLowerCase(),t=this.commands.state[e])return t(e);try{return this.editor.getDoc().queryCommandState(e)}catch(e){}return !1}},e.prototype.queryCommandValue=function(e){var t;if(!this.editor.quirks.isHidden()&&!this.editor.removed){if(e=e.toLowerCase(),t=this.commands.value[e])return t(e);try{return this.editor.getDoc().queryCommandValue(e)}catch(e){}}},e.prototype.addCommands=function(e,t){void 0===t&&(t="exec");var n=this;DN(e,(function(e,r){DN(r.toLowerCase().split(","),(function(r){n.commands[t][r]=e;}));}));},e.prototype.addCommand=function(e,t,n){var r=this;e=e.toLowerCase(),this.commands.exec[e]=function(e,o,i,a){return t.call(n||r.editor,o,i,a)};},e.prototype.queryCommandSupported=function(e){if(e=e.toLowerCase(),this.commands.exec[e])return !0;try{return this.editor.getDoc().queryCommandSupported(e)}catch(e){}return !1},e.prototype.addQueryStateHandler=function(e,t,n){var r=this;e=e.toLowerCase(),this.commands.state[e]=function(){return t.call(n||r.editor)};},e.prototype.addQueryValueHandler=function(e,t,n){var r=this;e=e.toLowerCase(),this.commands.value[e]=function(){return t.call(n||r.editor)};},e.prototype.hasCustomCommand=function(e){return e=e.toLowerCase(),!!this.commands.exec[e]},e.prototype.execNativeCommand=function(e,t,n){return void 0===t&&(t=!1),void 0===n&&(n=null),this.editor.getDoc().execCommand(e,t,n)},e.prototype.isFormatMatch=function(e){return this.editor.formatter.match(e)},e.prototype.toggleFormat=function(e,t){this.editor.formatter.toggle(e,t),this.editor.nodeChanged();},e.prototype.storeSelection=function(e){this.selectionBookmark=this.editor.selection.getBookmark(e);},e.prototype.restoreSelection=function(){this.editor.selection.moveToBookmark(this.selectionBookmark);},e.prototype.setupCommands=function(e){var t=this;this.addCommands({"mceResetDesignMode,mceBeginUndoLevel":x,"mceEndUndoLevel,mceAddUndoLevel":function(){e.undoManager.add();},mceFocus:function(t,n,r){wm(e,r);},"Cut,Copy,Paste":function(n){var r,o=e.getDoc();try{t.execNativeCommand(n);}catch(e){r=!0;}if("paste"!==n||o.queryCommandEnabled(n)||(r=!0),r||!o.queryCommandSupported(n)){var i=e.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");wt.mac&&(i=i.replace(/Ctrl\+/g,"⌘+")),e.notificationManager.open({text:i,type:"error"});}},unlink:function(){if(e.selection.isCollapsed()){var t=e.dom.getParent(e.selection.getStart(),"a");t&&e.dom.remove(t,!0);}else e.formatter.remove("link");},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone":function(n){var r=n.substring(7);"full"===r&&(r="justify"),DN("left,center,right,justify".split(","),(function(t){r!==t&&e.formatter.remove("align"+t);})),"none"!==r&&t.toggleFormat("align"+r);},"InsertUnorderedList,InsertOrderedList":function(n){var r;t.execNativeCommand(n);var o=e.dom.getParent(e.selection.getNode(),"ol,ul");o&&(r=o.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(r.nodeName)&&(t.storeSelection(),e.dom.split(r,o),t.restoreSelection()));},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){t.toggleFormat(e);},"ForeColor,HiliteColor":function(e,n,r){t.toggleFormat(e,{value:r});},FontName:function(t,n,r){!function(e,t){var n=_N(e,t);e.formatter.toggle("fontname",{value:AN(n)}),e.nodeChanged();}(e,r);},FontSize:function(t,n,r){!function(e,t){e.formatter.toggle("fontsize",{value:_N(e,t)}),e.nodeChanged();}(e,r);},LineHeight:function(t,n,r){!function(e,t){e.formatter.toggle("lineheight",{value:String(t)}),e.nodeChanged();}(e,r);},Lang:function(e,n,r){t.toggleFormat(e,{value:r.code,customValue:r.customCode});},RemoveFormat:function(t){e.formatter.remove(t);},mceBlockQuote:function(){t.toggleFormat("blockquote");},FormatBlock:function(e,n,r){return t.toggleFormat(r||"p")},mceCleanup:function(){var t=e.selection.getBookmark();e.setContent(e.getContent()),e.selection.moveToBookmark(t);},mceRemoveNode:function(n,r,o){var i=o||e.selection.getNode();i!==e.getBody()&&(t.storeSelection(),e.dom.remove(i,!0),t.restoreSelection());},mceSelectNodeDepth:function(t,n,r){var o=0;e.dom.getParent(e.selection.getNode(),(function(t){if(1===t.nodeType&&o++===r)return e.selection.select(t),!1}),e.getBody());},mceSelectNode:function(t,n,r){e.selection.select(r);},mceInsertContent:function(t,n,r){RN(e,r);},mceInsertRawHTML:function(t,n,r){e.selection.setContent("tiny_mce_marker");var o=e.getContent();e.setContent(o.replace(/tiny_mce_marker/g,(function(){return r})));},mceInsertNewLine:function(t,n,r){uk(e,r);},mceToggleFormat:function(e,n,r){t.toggleFormat(r);},mceSetContent:function(t,n,r){e.setContent(r);},"Indent,Outdent":function(t){Dw(e,t);},mceRepaint:x,InsertHorizontalRule:function(){e.execCommand("mceInsertContent",!1,"<hr />");},mceToggleVisualAid:function(){e.hasVisual=!e.hasVisual,e.addVisual();},mceReplaceContent:function(t,n,r){e.execCommand("mceInsertContent",!1,r.replace(/\{\$selection\}/g,e.selection.getContent({format:"text"})));},mceInsertLink:function(t,n,r){"string"==typeof r&&(r={href:r});var o=e.dom.getParent(e.selection.getNode(),"a");r.href=r.href.replace(/ /g,"%20"),o&&r.href||e.formatter.remove("link"),r.href&&e.formatter.apply("link",r,o);},selectAll:function(){var t=e.dom.getParent(e.selection.getStart(),qn);if(t){var n=e.dom.createRng();n.selectNodeContents(t),e.selection.setRng(n);}},mceNewDocument:function(){e.setContent("");},InsertLineBreak:function(t,n,r){return XS(e,r),!0}});var n=function(t){return function(){var n=e.selection,r=n.isCollapsed()?[e.dom.getParent(n.getNode(),e.dom.isBlock)]:n.getSelectedBlocks(),o=TN(r,(function(n){return !!e.formatter.matchNode(n,t)}));return -1!==ON(o,!0)}};t.addCommands({JustifyLeft:n("alignleft"),JustifyCenter:n("aligncenter"),JustifyRight:n("alignright"),JustifyFull:n("alignjustify"),"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){return t.isFormatMatch(e)},mceBlockQuote:function(){return t.isFormatMatch("blockquote")},Outdent:function(){return _w(e)},"InsertUnorderedList,InsertOrderedList":function(t){var n=e.dom.getParent(e.selection.getNode(),"ul,ol");return n&&("insertunorderedlist"===t&&"UL"===n.tagName||"insertorderedlist"===t&&"OL"===n.tagName)}},"state"),t.addCommands({Undo:function(){e.undoManager.undo();},Redo:function(){e.undoManager.redo();}}),t.addQueryValueHandler("FontName",(function(){return function(e){return EN(e,(function(t){return SN(e.getBody(),t.dom)})).getOr("")}(e)}),this),t.addQueryValueHandler("FontSize",(function(){return function(e){return EN(e,(function(t){return wN(e.getBody(),t.dom)})).getOr("")}(e)}),this),t.addQueryValueHandler("LineHeight",(function(){return function(e){return EN(e,(function(t){var n=Rt.fromDom(e.getBody()),r=lh(t,(function(e){return ar(e,"line-height")}),_(Bt,n));return r.getOrThunk((function(){var e=parseFloat(or(t,"line-height")),n=parseFloat(or(t,"font-size"));return String(e/n)}))})).getOr("")}(e)}),this);},e}(),PN="data-mce-contenteditable",LN=function(e,t,n){var r,o;Lu(e,t)&&!1===n?(o=t,Du(r=e)?r.dom.classList.remove(o):Ou(r,o),Pu(r)):n&&Bu(e,t);},IN=function(e,t,n){try{e.getDoc().execCommand(t,!1,String(n));}catch(e){}},MN=function(e,t){e.dom.contentEditable=t?"true":"false";},FN=function(e,t){var n=Rt.fromDom(e.getBody());LN(n,"mce-content-readonly",t),t?(e.selection.controlSelection.hideResizeRect(),e._selectionOverrides.hideFakeCaret(),function(e){I.from(e.selection.getNode()).each((function(e){e.removeAttribute("data-mce-selected");}));}(e),e.readonly=!0,MN(n,!1),q(Mu(n,'*[contenteditable="true"]'),(function(e){Qn(e,PN,"true"),MN(e,!1);}))):(e.readonly=!1,MN(n,!0),function(e){q(Mu(e,'*[data-mce-contenteditable="true"]'),(function(e){nr(e,PN),MN(e,!0);}));}(n),IN(e,"StyleWithCSS",!1),IN(e,"enableInlineTableEditing",!1),IN(e,"enableObjectResizing",!1),Cm(e)&&e.focus(),function(e){e.selection.setRng(e.selection.getRng());}(e),e.nodeChanged());},UN=function(e){return e.readonly},zN=function(e){e.parser.addAttributeFilter("contenteditable",(function(t){UN(e)&&q(t,(function(e){e.attr(PN,e.attr("contenteditable")),e.attr("contenteditable","false");}));})),e.serializer.addAttributeFilter(PN,(function(t){UN(e)&&q(t,(function(e){e.attr("contenteditable",e.attr(PN));}));})),e.serializer.addTempAttr(PN);},HN=function(e,t){if(function(e){return "click"===e.type}(t)&&!od.metaKeyPressed(t)){var n=Rt.fromDom(t.target);(function(e,t){return Qr(t,"a",(function(t){return Bt(t,Rt.fromDom(e.getBody()))})).bind((function(e){return tr(e,"href")}))})(e,n).each((function(n){if(t.preventDefault(),/^#/.test(n)){var r=e.dom.select(n+',[name="'+((Me(o=n,i="#")?function(e,t){return e.substring(t)}(o,i.length):o)+'"]'));r.length&&e.selection.scrollIntoView(r[0],!0);}else window.open(n,"_blank","rel=noopener noreferrer,menubar=yes,toolbar=yes,location=yes,status=yes,resizable=yes,scrollbars=yes");var o,i;}));}},jN=_t.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input beforeinput contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchmove touchend touchcancel"," "),VN=function(){function e(e){this.bindings={},this.settings=e||{},this.scope=this.settings.scope||this,this.toggleEvent=this.settings.toggleEvent||T;}return e.isNative=function(e){return !!jN[e.toLowerCase()]},e.prototype.fire=function(e,t){var n=e.toLowerCase(),r=Bi(n,t||{},this.scope);this.settings.beforeFire&&this.settings.beforeFire(r);var o=this.bindings[n];if(o)for(var i=0,a=o.length;i<a;i++){var u=o[i];if(!u.removed){if(u.once&&this.off(n,u.func),r.isImmediatePropagationStopped())return r;if(!1===u.func.call(this.scope,r))return r.preventDefault(),r}}return r},e.prototype.on=function(e,t,n,r){if(!1===t&&(t=T),t){var o={func:t,removed:!1};r&&_t.extend(o,r);for(var i=e.toLowerCase().split(" "),a=i.length;a--;){var u=i[a],c=this.bindings[u];c||(c=[],this.toggleEvent(u,!0)),c=n?De([o],c,!0):De(De([],c,!0),[o],!1),this.bindings[u]=c;}}return this},e.prototype.off=function(e,t){var n=this;if(e)for(var r=e.toLowerCase().split(" "),o=r.length;o--;){var i=r[o],a=this.bindings[i];if(!i)return le(this.bindings,(function(e,t){n.toggleEvent(t,!1),delete n.bindings[t];})),this;if(a){if(t){var u=W(a,(function(e){return e.func===t}));a=u.fail,this.bindings[i]=a,q(u.pass,(function(e){e.removed=!0;}));}else a.length=0;a.length||(this.toggleEvent(e,!1),delete this.bindings[i]);}}else le(this.bindings,(function(e,t){n.toggleEvent(t,!1);})),this.bindings={};return this},e.prototype.once=function(e,t,n){return this.on(e,t,n,{once:!0})},e.prototype.has=function(e){return e=e.toLowerCase(),!(!this.bindings[e]||0===this.bindings[e].length)},e}(),qN=function(e){return e._eventDispatcher||(e._eventDispatcher=new VN({scope:e,toggleEvent:function(t,n){VN.isNative(t)&&e.toggleNativeEvent&&e.toggleNativeEvent(t,n);}})),e._eventDispatcher},$N={fire:function(e,t,n){var r=this;if(r.removed&&"remove"!==e&&"detach"!==e)return t;var o=qN(r).fire(e,t);if(!1!==n&&r.parent)for(var i=r.parent();i&&!o.isPropagationStopped();)i.fire(e,o,!1),i=i.parent();return o},on:function(e,t,n){return qN(this).on(e,t,n)},off:function(e,t){return qN(this).off(e,t)},once:function(e,t){return qN(this).once(e,t)},hasEventListeners:function(e){return qN(this).has(e)}},WN=pu.DOM,KN=function(e,t){if("selectionchange"===t)return e.getDoc();if(!e.inline&&/^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(t))return e.getDoc().documentElement;var n=hs(e);return n?(e.eventRoot||(e.eventRoot=WN.select(n)[0]),e.eventRoot):e.getBody()},XN=function(e,t,n){!function(e){return !e.hidden&&!UN(e)}(e)?UN(e)&&HN(e,n):e.fire(t,n);},YN=function(e,t){var n;if(e.delegates||(e.delegates={}),!e.delegates[t]&&!e.removed){var r=KN(e,t);if(hs(e)){if(Mx||(Mx={},e.editorManager.on("removeEditor",(function(){e.editorManager.activeEditor||Mx&&(le(Mx,(function(t,n){e.dom.unbind(KN(e,n));})),Mx=null);}))),Mx[t])return;n=function(n){for(var r=n.target,o=e.editorManager.get(),i=o.length;i--;){var a=o[i].getBody();(a===r||WN.isChildOf(r,a))&&XN(o[i],t,n);}},Mx[t]=n,WN.bind(r,t,n);}else n=function(n){XN(e,t,n);},WN.bind(r,t,n),e.delegates[t]=n;}},GN=Re(Re({},$N),{bindPendingEventDelegates:function(){var e=this;_t.each(e._pendingNativeEvents,(function(t){YN(e,t);}));},toggleNativeEvent:function(e,t){var n=this;"focus"!==e&&"blur"!==e&&(n.removed||(t?n.initialized?YN(n,e):n._pendingNativeEvents?n._pendingNativeEvents.push(e):n._pendingNativeEvents=[e]:n.initialized&&(n.dom.unbind(KN(n,e),e,n.delegates[e]),delete n.delegates[e])));},unbindAllNativeEvents:function(){var e=this,t=e.getBody(),n=e.dom;e.delegates&&(le(e.delegates,(function(t,n){e.dom.unbind(KN(e,n),n,t);})),delete e.delegates),!e.inline&&t&&n&&(t.onload=null,n.unbind(e.getWin()),n.unbind(e.getDoc())),n&&(n.unbind(t),n.unbind(e.getContainer()));}}),JN=["design","readonly"],QN=function(e,t,n,r){var o=n[t.get()],i=n[r];try{i.activate();}catch(e){return void console.error("problem while activating editor mode "+r+":",e)}o.deactivate(),o.editorReadOnly!==i.editorReadOnly&&FN(e,i.editorReadOnly),t.set(r),function(e,t){e.fire("SwitchMode",{mode:t});}(e,r);},ZN=function(e){var t=Cu("design"),n=Cu({design:{activate:x,deactivate:x,editorReadOnly:!1},readonly:{activate:x,deactivate:x,editorReadOnly:!0}});return function(e){e.serializer?zN(e):e.on("PreInit",(function(){zN(e);}));}(e),function(e){e.on("ShowCaret",(function(t){UN(e)&&t.preventDefault();})),e.on("ObjectSelected",(function(t){UN(e)&&t.preventDefault();}));}(e),{isReadOnly:function(){return UN(e)},set:function(r){return function(e,t,n,r){if(r!==n.get()){if(!ye(t,r))throw new Error("Editor mode '"+r+"' is invalid");e.initialized?QN(e,n,t,r):e.on("init",(function(){return QN(e,n,t,r)}));}}(e,n.get(),t,r)},get:function(){return t.get()},register:function(e,t){n.set(function(e,t,n){var r;if(H(JN,t))throw new Error("Cannot override default mode "+t);return Re(Re({},e),((r={})[t]=Re(Re({},n),{deactivate:function(){try{n.deactivate();}catch(e){console.error("problem while deactivating editor mode "+t+":",e);}}}),r))}(n.get(),e,t));}}},eE=_t.each,tE=_t.explode,nE={f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123},rE=_t.makeMap("alt,ctrl,shift,meta,access"),oE=function(e){var t,n={};eE(tE(e.toLowerCase(),"+"),(function(e){e in rE?n[e]=!0:/^[0-9]{2,}$/.test(e)?n.keyCode=parseInt(e,10):(n.charCode=e.charCodeAt(0),n.keyCode=nE[e]||e.toUpperCase().charCodeAt(0));}));var r=[n.keyCode];for(t in rE)n[t]?r.push(t):n[t]=!1;return n.id=r.join(","),n.access&&(n.alt=!0,wt.mac?n.ctrl=!0:n.shift=!0),n.meta&&(wt.mac?n.meta=!0:(n.ctrl=!0,n.meta=!1)),n},iE=function(){function e(e){this.shortcuts={},this.pendingPatterns=[],this.editor=e;var t=this;e.on("keyup keypress keydown",(function(e){!t.hasModifier(e)&&!t.isFunctionKey(e)||e.isDefaultPrevented()||(eE(t.shortcuts,(function(n){if(t.matchShortcut(e,n))return t.pendingPatterns=n.subpatterns.slice(0),"keydown"===e.type&&t.executeShortcutAction(n),!0})),t.matchShortcut(e,t.pendingPatterns[0])&&(1===t.pendingPatterns.length&&"keydown"===e.type&&t.executeShortcutAction(t.pendingPatterns[0]),t.pendingPatterns.shift()));}));}return e.prototype.add=function(e,t,n,r){var o=this,i=o.normalizeCommandFunc(n);return eE(tE(_t.trim(e)),(function(e){var n=o.createShortcut(e,t,i,r);o.shortcuts[n.id]=n;})),!0},e.prototype.remove=function(e){var t=this.createShortcut(e);return !!this.shortcuts[t.id]&&(delete this.shortcuts[t.id],!0)},e.prototype.normalizeCommandFunc=function(e){var t=this,n=e;return "string"==typeof n?function(){t.editor.execCommand(n,!1,null);}:_t.isArray(n)?function(){t.editor.execCommand(n[0],n[1],n[2]);}:n},e.prototype.createShortcut=function(e,t,n,r){var o=_t.map(tE(e,">"),oE);return o[o.length-1]=_t.extend(o[o.length-1],{func:n,scope:r||this.editor}),_t.extend(o[0],{desc:this.editor.translate(t),subpatterns:o.slice(1)})},e.prototype.hasModifier=function(e){return e.altKey||e.ctrlKey||e.metaKey},e.prototype.isFunctionKey=function(e){return "keydown"===e.type&&e.keyCode>=112&&e.keyCode<=123},e.prototype.matchShortcut=function(e,t){return !!t&&(t.ctrl===e.ctrlKey&&t.meta===e.metaKey&&(t.alt===e.altKey&&t.shift===e.shiftKey&&(!!(e.keyCode===t.keyCode||e.charCode&&e.charCode===t.charCode)&&(e.preventDefault(),!0))))},e.prototype.executeShortcutAction=function(e){return e.func?e.func.call(e.scope):null},e}(),aE=function(){var e=function(){var e={},t={},n={},r={},o={},i={},a={},u=function(e,t){return function(n,r){return e[n.toLowerCase()]=Re(Re({},r),{type:t})}};return {addButton:u(e,"button"),addGroupToolbarButton:u(e,"grouptoolbarbutton"),addToggleButton:u(e,"togglebutton"),addMenuButton:u(e,"menubutton"),addSplitButton:u(e,"splitbutton"),addMenuItem:u(t,"menuitem"),addNestedMenuItem:u(t,"nestedmenuitem"),addToggleMenuItem:u(t,"togglemenuitem"),addAutocompleter:u(n,"autocompleter"),addContextMenu:u(o,"contextmenu"),addContextToolbar:u(i,"contexttoolbar"),addContextForm:u(i,"contextform"),addSidebar:u(a,"sidebar"),addIcon:function(e,t){return r[e.toLowerCase()]=t},getAll:function(){return {buttons:e,menuItems:t,icons:r,popups:n,contextMenus:o,contextToolbars:i,sidebars:a}}}}();return {addAutocompleter:e.addAutocompleter,addButton:e.addButton,addContextForm:e.addContextForm,addContextMenu:e.addContextMenu,addContextToolbar:e.addContextToolbar,addIcon:e.addIcon,addMenuButton:e.addMenuButton,addMenuItem:e.addMenuItem,addNestedMenuItem:e.addNestedMenuItem,addSidebar:e.addSidebar,addSplitButton:e.addSplitButton,addToggleButton:e.addToggleButton,addGroupToolbarButton:e.addGroupToolbarButton,addToggleMenuItem:e.addToggleMenuItem,getAll:e.getAll}},uE=pu.DOM,cE=_t.extend,sE=_t.each,fE=_t.resolve,lE=wt.ie,dE=function(){function e(e,t,n){var r=this;this.plugins={},this.contentCSS=[],this.contentStyles=[],this.loadedCSS={},this.isNotDirty=!1,this.editorManager=n,this.documentBaseUrl=n.documentBaseURL,cE(this,GN),this.settings=ay(this,e,this.documentBaseUrl,n.defaultSettings,t),this.settings.suffix&&(n.suffix=this.settings.suffix),this.suffix=n.suffix,this.settings.base_url&&n._setBaseUrl(this.settings.base_url),this.baseUri=n.baseURI,this.settings.referrer_policy&&(yu.ScriptLoader._setReferrerPolicy(this.settings.referrer_policy),pu.DOM.styleSheetLoader._setReferrerPolicy(this.settings.referrer_policy)),Nu.languageLoad=this.settings.language_load,Nu.baseURL=n.baseURL,this.id=e,this.setDirty(!1),this.documentBaseURI=new zm(this.settings.document_base_url,{base_uri:this.baseUri}),this.baseURI=this.baseUri,this.inline=!!this.settings.inline,this.shortcuts=new iE(this),this.editorCommands=new BN(this),this.settings.cache_suffix&&(wt.cacheSuffix=this.settings.cache_suffix.replace(/^[\?\&]+/,"")),this.ui={registry:aE(),styleSheetLoader:void 0,show:x,hide:x,enable:x,disable:x,isDisabled:T};var o=ZN(this);this.mode=o,this.setMode=o.set,n.fire("SetupEditor",{editor:this}),this.execCallback("setup",this),this.$=cu.overrideDefaults((function(){return {context:r.inline?r.getBody():r.getDoc(),element:r.getBody()}}));}return e.prototype.render=function(){vN(this);},e.prototype.focus=function(e){this.execCommand("mceFocus",!1,e);},e.prototype.hasFocus=function(){return ym(this)},e.prototype.execCallback=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r,o=this,i=o.settings[e];if(i)return o.callbackLookup&&(r=o.callbackLookup[e])&&(i=r.func,r=r.scope),"string"==typeof i&&(r=(r=i.replace(/\.\w+$/,""))?fE(r):0,i=fE(i),o.callbackLookup=o.callbackLookup||{},o.callbackLookup[e]={func:i,scope:r}),i.apply(r||o,t)},e.prototype.translate=function(e){return ku.translate(e)},e.prototype.getParam=function(e,t,n){return cy(this,e,t,n)},e.prototype.hasPlugin=function(e,t){return !!H(xs(this).split(/[ ,]/),e)&&(!t||void 0!==yy.get(e))},e.prototype.nodeChanged=function(e){this._nodeChangeDispatcher.nodeChanged(e);},e.prototype.addCommand=function(e,t,n){this.editorCommands.addCommand(e,t,n);},e.prototype.addQueryStateHandler=function(e,t,n){this.editorCommands.addQueryStateHandler(e,t,n);},e.prototype.addQueryValueHandler=function(e,t,n){this.editorCommands.addQueryValueHandler(e,t,n);},e.prototype.addShortcut=function(e,t,n,r){this.shortcuts.add(e,t,n,r);},e.prototype.execCommand=function(e,t,n,r){return this.editorCommands.execCommand(e,t,n,r)},e.prototype.queryCommandState=function(e){return this.editorCommands.queryCommandState(e)},e.prototype.queryCommandValue=function(e){return this.editorCommands.queryCommandValue(e)},e.prototype.queryCommandSupported=function(e){return this.editorCommands.queryCommandSupported(e)},e.prototype.show=function(){var e=this;e.hidden&&(e.hidden=!1,e.inline?e.getBody().contentEditable="true":(uE.show(e.getContainer()),uE.hide(e.id)),e.load(),e.fire("show"));},e.prototype.hide=function(){var e=this,t=e.getDoc();e.hidden||(lE&&t&&!e.inline&&t.execCommand("SelectAll"),e.save(),e.inline?(e.getBody().contentEditable="false",e===e.editorManager.focusedEditor&&(e.editorManager.focusedEditor=null)):(uE.hide(e.getContainer()),uE.setStyle(e.id,"display",e.orgDisplay)),e.hidden=!0,e.fire("hide"));},e.prototype.isHidden=function(){return !!this.hidden},e.prototype.setProgressState=function(e,t){this.fire("ProgressState",{state:e,time:t});},e.prototype.load=function(e){var t,n=this,r=n.getElement();if(n.removed)return "";if(r){(e=e||{}).load=!0;var o=Mn(r)?r.value:r.innerHTML;return t=n.setContent(o,e),e.element=r,e.no_events||n.fire("LoadContent",e),e.element=r=null,t}},e.prototype.save=function(e){var t,n,r=this,o=r.getElement();if(o&&r.initialized&&!r.removed)return (e=e||{}).save=!0,e.element=o,e.content=r.getContent(e),e.no_events||r.fire("SaveContent",e),"raw"===e.format&&r.fire("RawSaveContent",e),t=e.content,Mn(o)?o.value=t:(!e.is_removing&&r.inline||(o.innerHTML=t),(n=uE.getParent(r.id,"form"))&&sE(n.elements,(function(e){if(e.name===r.id)return e.value=t,!1}))),e.element=o=null,!1!==e.set_dirty&&r.setDirty(!1),t},e.prototype.setContent=function(e,t){return Pb(this,e,t)},e.prototype.getContent=function(e){return Bb(this,e)},e.prototype.insertContent=function(e,t){t&&(e=cE({content:e},t)),this.execCommand("mceInsertContent",!1,e);},e.prototype.resetContent=function(e){void 0===e?Pb(this,this.startContent,{format:"raw"}):Pb(this,e),this.undoManager.reset(),this.setDirty(!1),this.nodeChanged();},e.prototype.isDirty=function(){return !this.isNotDirty},e.prototype.setDirty=function(e){var t=!this.isNotDirty;this.isNotDirty=!e,e&&e!==t&&this.fire("dirty");},e.prototype.getContainer=function(){var e=this;return e.container||(e.container=uE.get(e.editorContainer||e.id+"_parent")),e.container},e.prototype.getContentAreaContainer=function(){return this.contentAreaContainer},e.prototype.getElement=function(){return this.targetElm||(this.targetElm=uE.get(this.id)),this.targetElm},e.prototype.getWin=function(){var e,t=this;return t.contentWindow||(e=t.iframeElement)&&(t.contentWindow=e.contentWindow),t.contentWindow},e.prototype.getDoc=function(){var e,t=this;return t.contentDocument||(e=t.getWin())&&(t.contentDocument=e.document),t.contentDocument},e.prototype.getBody=function(){var e=this.getDoc();return this.bodyElement||(e?e.body:null)},e.prototype.convertURL=function(e,t,n){var r=this,o=r.settings;return o.urlconverter_callback?r.execCallback("urlconverter_callback",e,n,!0,t):!o.convert_urls||n&&"LINK"===n.nodeName||0===e.indexOf("file:")||0===e.length?e:o.relative_urls?r.documentBaseURI.toRelative(e):e=r.documentBaseURI.toAbsolute(e,o.remove_script_host)},e.prototype.addVisual=function(e){bN(this,e);},e.prototype.remove=function(){Mb(this);},e.prototype.destroy=function(e){Fb(this,e);},e.prototype.uploadImages=function(e){return this.editorUpload.uploadImages(e)},e.prototype._scanForImages=function(){return this.editorUpload.scanForImages()},e.prototype.addButton=function(){throw new Error("editor.addButton has been removed in tinymce 5x, use editor.ui.registry.addButton or editor.ui.registry.addToggleButton or editor.ui.registry.addSplitButton instead")},e.prototype.addSidebar=function(){throw new Error("editor.addSidebar has been removed in tinymce 5x, use editor.ui.registry.addSidebar instead")},e.prototype.addMenuItem=function(){throw new Error("editor.addMenuItem has been removed in tinymce 5x, use editor.ui.registry.addMenuItem instead")},e.prototype.addContextToolbar=function(){throw new Error("editor.addContextToolbar has been removed in tinymce 5x, use editor.ui.registry.addContextToolbar instead")},e}(),mE=pu.DOM,gE=_t.explode,pE=_t.each,hE=_t.extend,vE=0,bE=!1,yE=[],CE=[],xE=function(e){var t=e.type;pE(NE.get(),(function(n){switch(t){case"scroll":n.fire("ScrollWindow",e);break;case"resize":n.fire("ResizeWindow",e);}}));},wE=function(e){e!==bE&&(e?cu(window).on("resize scroll",xE):cu(window).off("resize scroll",xE),bE=e);},SE=function(e){var t=CE;delete yE[e.id];for(var n=0;n<yE.length;n++)if(yE[n]===e){yE.splice(n,1);break}return CE=K(CE,(function(t){return e!==t})),NE.activeEditor===e&&(NE.activeEditor=CE.length>0?CE[0]:null),NE.focusedEditor===e&&(NE.focusedEditor=null),t.length!==CE.length},kE="CSS1Compat"!==document.compatMode,NE=Re(Re({},$N),{baseURI:null,baseURL:null,defaultSettings:{},documentBaseURL:null,suffix:null,$:cu,majorVersion:"5",minorVersion:"10.3",releaseDate:"2022-02-09",editors:yE,i18n:ku,activeEditor:null,focusedEditor:null,settings:{},setup:function(){var e,t,n=this,r="";t=zm.getDocumentBaseUrl(document.location),/^[^:]+:\/\/\/?[^\/]+\//.test(t)&&(t=t.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(t)||(t+="/"));var o,i=window.tinymce||window.tinyMCEPreInit;if(i)e=i.base||i.baseURL,r=i.suffix;else {for(var a=document.getElementsByTagName("script"),u=0;u<a.length;u++){var c;if(""!==(c=a[u].src||"")){var s=c.substring(c.lastIndexOf("/"));if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(c)){-1!==s.indexOf(".min")&&(r=".min"),e=c.substring(0,c.lastIndexOf("/"));break}}}if(!e&&document.currentScript)-1!==(c=document.currentScript.src).indexOf(".min")&&(r=".min"),e=c.substring(0,c.lastIndexOf("/"));}n.baseURL=new zm(t).toAbsolute(e),n.documentBaseURL=t,n.baseURI=new zm(n.baseURL),n.suffix=r,(o=n).on("AddEditor",_(mm,o)),o.on("RemoveEditor",_(gm,o));},overrideDefaults:function(e){var t=e.base_url;t&&this._setBaseUrl(t);var n=e.suffix;e.suffix&&(this.suffix=n),this.defaultSettings=e;var r=e.plugin_base_urls;void 0!==r&&le(r,(function(e,t){Nu.PluginManager.urls[t]=e;}));},init:function(e){var t,n=this,r=_t.makeMap("area base basefont br col frame hr img input isindex link meta param embed source wbr track colgroup option table tbody tfoot thead tr th td script noscript style textarea video audio iframe object menu"," "),o=function(e){var t=e.id;return t||(t=be(e,"name").filter((function(e){return !mE.get(e)})).getOrThunk(mE.uniqueId),e.setAttribute("id",t)),t},i=function(e,t){return t.constructor===RegExp?t.test(e.className):mE.hasClass(e,t)},a=function(e){t=e;},u=function(){var t,c=0,s=[],f=function(e,r,o){var i=new dE(e,r,n);s.push(i),i.on("init",(function(){++c===t.length&&a(s);})),i.targetElm=i.targetElm||o,i.render();};mE.unbind(window,"ready",u),function(t){var r=e[t];if(r)r.apply(n,[]);}("onpageload"),t=cu.unique(function(e){var t=[];if(wt.browser.isIE()&&wt.browser.version.major<11)return _y("TinyMCE does not support the browser you are using. For a list of supported browsers please see: https://www.tinymce.com/docs/get-started/system-requirements/"),[];if(kE)return _y("Failed to initialize the editor as the document is not in standards mode. TinyMCE requires standards mode."),[];if(e.types)return pE(e.types,(function(e){t=t.concat(mE.select(e.selector));})),t;if(e.selector)return mE.select(e.selector);if(e.target)return [e.target];switch(e.mode){case"exact":var n=e.elements||"";n.length>0&&pE(gE(n),(function(e){var n=mE.get(e);n?t.push(n):pE(document.forms,(function(n){pE(n.elements,(function(n){n.name===e&&(e="mce_editor_"+vE++,mE.setAttrib(n,"id",e),t.push(n));}));}));}));break;case"textareas":case"specific_textareas":pE(mE.select("textarea"),(function(n){e.editor_deselector&&i(n,e.editor_deselector)||e.editor_selector&&!i(n,e.editor_selector)||t.push(n);}));}return t}(e)),e.types?pE(e.types,(function(n){_t.each(t,(function(t){return !mE.is(t,n.selector)||(f(o(t),hE({},e,n),t),!1)}));})):(_t.each(t,(function(e){var t;(t=n.get(e.id))&&t.initialized&&!(t.getContainer()||t.getBody()).parentNode&&(SE(t),t.unbindAllNativeEvents(),t.destroy(!0),t.removed=!0,t=null);})),0===(t=_t.grep(t,(function(e){return !n.get(e.id)}))).length?a([]):pE(t,(function(t){!function(e,t){return e.inline&&t.tagName.toLowerCase()in r}(e,t)?f(o(t),e,t):_y("Could not initialize inline editor on invalid inline target element",t);})));};return n.settings=e,mE.bind(window,"ready",u),new Zr((function(e){t?e(t):a=function(t){e(t);};}))},get:function(e){return 0===arguments.length?CE.slice(0):l(e)?J(CE,(function(t){return t.id===e})).getOr(null):C(e)&&CE[e]?CE[e]:null},add:function(e){var t=this;return yE[e.id]===e||(null===t.get(e.id)&&("length"!==e.id&&(yE[e.id]=e),yE.push(e),CE.push(e)),wE(!0),t.activeEditor=e,t.fire("AddEditor",{editor:e}),Fx||(Fx=function(e){var n=t.fire("BeforeUnload");if(n.returnValue)return e.preventDefault(),e.returnValue=n.returnValue,n.returnValue},window.addEventListener("beforeunload",Fx))),e},createEditor:function(e,t){return this.add(new dE(e,t,this))},remove:function(e){var t,n,r=this;if(e){if(!l(e))return n=e,g(r.get(n.id))?null:(SE(n)&&r.fire("RemoveEditor",{editor:n}),0===CE.length&&window.removeEventListener("beforeunload",Fx),n.remove(),wE(CE.length>0),n);pE(mE.select(e),(function(e){(n=r.get(e.id))&&r.remove(n);}));}else for(t=CE.length-1;t>=0;t--)r.remove(CE[t]);},execCommand:function(e,t,n){var r=this,o=r.get(n);switch(e){case"mceAddEditor":return r.get(n)||new dE(n,r.settings,r).render(),!0;case"mceRemoveEditor":return o&&o.remove(),!0;case"mceToggleEditor":return o?(o.isHidden()?o.show():o.hide(),!0):(r.execCommand("mceAddEditor",!1,n),!0)}return !!r.activeEditor&&r.activeEditor.execCommand(e,t,n)},triggerSave:function(){pE(CE,(function(e){e.save();}));},addI18n:function(e,t){ku.add(e,t);},translate:function(e){return ku.translate(e)},setActive:function(e){var t=this.activeEditor;this.activeEditor!==e&&(t&&t.fire("deactivate",{relatedTarget:e}),e.fire("activate",{relatedTarget:t})),this.activeEditor=e;},_setBaseUrl:function(e){this.baseURL=new zm(this.documentBaseURL).toAbsolute(e.replace(/\/+$/,"")),this.baseURI=new zm(this.baseURL);}});NE.setup();var EE,_E,AE,RE,DE=Math.min,TE=Math.max,OE=Math.round,BE=function(e,t,n){var r=t.x,o=t.y,i=e.w,a=e.h,u=t.w,c=t.h,s=(n||"").split("");return "b"===s[0]&&(o+=c),"r"===s[1]&&(r+=u),"c"===s[0]&&(o+=OE(c/2)),"c"===s[1]&&(r+=OE(u/2)),"b"===s[3]&&(o-=a),"r"===s[4]&&(r-=i),"c"===s[3]&&(o-=OE(a/2)),"c"===s[4]&&(r-=OE(i/2)),PE(r,o,i,a)},PE=function(e,t,n,r){return {x:e,y:t,w:n,h:r}},LE={inflate:function(e,t,n){return PE(e.x-t,e.y-n,e.w+2*t,e.h+2*n)},relativePosition:BE,findBestRelativePosition:function(e,t,n,r){var o,i;for(i=0;i<r.length;i++)if((o=BE(e,t,r[i])).x>=n.x&&o.x+o.w<=n.w+n.x&&o.y>=n.y&&o.y+o.h<=n.h+n.y)return r[i];return null},intersect:function(e,t){var n=TE(e.x,t.x),r=TE(e.y,t.y),o=DE(e.x+e.w,t.x+t.w),i=DE(e.y+e.h,t.y+t.h);return o-n<0||i-r<0?null:PE(n,r,o-n,i-r)},clamp:function(e,t,n){var r=e.x,o=e.y,i=e.x+e.w,a=e.y+e.h,u=t.x+t.w,c=t.y+t.h,s=TE(0,t.x-r),f=TE(0,t.y-o),l=TE(0,i-u),d=TE(0,a-c);return r+=s,o+=f,n&&(i+=s,a+=f,r-=l,o-=d),PE(r,o,(i-=l)-r,(a-=d)-o)},create:PE,fromClientRect:function(e){return PE(e.left,e.top,e.width,e.height)}},IE=(EE={},_E={},{load:function(e,t){var n='Script at URL "'+t+'" failed to load',r='Script at URL "'+t+"\" did not call `tinymce.Resource.add('"+e+"', data)` within 1 second";if(void 0!==EE[e])return EE[e];var o=new Zr((function(o,i){var a=function(e,t,n){void 0===n&&(n=1e3);var r=!1,o=null,i=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];r||(r=!0,null!==o&&(clearTimeout(o),o=null),e.apply(null,t));}},a=i(e),u=i(t);return {start:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];r||null!==o||(o=setTimeout((function(){return u.apply(null,e)}),n));},resolve:a,reject:u}}(o,i);_E[e]=a.resolve,yu.ScriptLoader.loadScript(t,(function(){return a.start(r)}),(function(){return a.reject(n)}));}));return EE[e]=o,o},add:function(e,t){void 0!==_E[e]&&(_E[e](t),delete _E[e]),EE[e]=Zr.resolve(t);}}),ME=_t.each,FE=_t.extend,UE=function(){};UE.extend=AE=function(e){var t=this.prototype,n=function(){var e,t,n,r=this;if(!RE&&(r.init&&r.init.apply(r,arguments),t=r.Mixins))for(e=t.length;e--;)(n=t[e]).init&&n.init.apply(r,arguments);},r=function(){return this};RE=!0;var o=new this;return RE=!1,e.Mixins&&(ME(e.Mixins,(function(t){for(var n in t)"init"!==n&&(e[n]=t[n]);})),t.Mixins&&(e.Mixins=t.Mixins.concat(e.Mixins))),e.Methods&&ME(e.Methods.split(","),(function(t){e[t]=r;})),e.Properties&&ME(e.Properties.split(","),(function(t){var n="_"+t;e[t]=function(e){var t=this;return void 0!==e?(t[n]=e,t):t[n]};})),e.Statics&&ME(e.Statics,(function(e,t){n[t]=e;})),e.Defaults&&t.Defaults&&(e.Defaults=FE({},t.Defaults,e.Defaults)),le(e,(function(e,n){"function"==typeof e&&t[n]?o[n]=function(e,n){return function(){var r=this,o=r._super;r._super=t[e];var i=n.apply(r,arguments);return r._super=o,i}}(n,e):o[n]=e;})),n.prototype=o,n.constructor=n,n.extend=AE,n};var zE,HE=Math.min,jE=Math.max,VE=Math.round,qE={serialize:function(e){var t=JSON.stringify(e);return l(t)?t.replace(/[\u0080-\uFFFF]/g,(function(e){var t=e.charCodeAt(0).toString(16);return "\\u"+"0000".substring(t.length)+t})):t},parse:function(e){try{return JSON.parse(e)}catch(e){}}},$E={callbacks:{},count:0,send:function(e){var t=this,n=pu.DOM,r=void 0!==e.count?e.count:t.count,o="tinymce_jsonp_"+r;t.callbacks[r]=function(i){n.remove(o),delete t.callbacks[r],e.callback(i);},n.add(n.doc.body,"script",{id:o,src:e.url,type:"text/javascript"}),t.count++;}},WE=Re(Re({},$N),{send:function(e){var t,n=0,r=function(){!e.async||4===t.readyState||n++>1e4?(e.success&&n<1e4&&200===t.status?e.success.call(e.success_scope,""+t.responseText,t,e):e.error&&e.error.call(e.error_scope,n>1e4?"TIMED_OUT":"GENERAL",t,e),t=null):ro.setTimeout(r,10);};if(e.scope=e.scope||this,e.success_scope=e.success_scope||e.scope,e.error_scope=e.error_scope||e.scope,e.async=!1!==e.async,e.data=e.data||"",WE.fire("beforeInitialize",{settings:e}),(t=new XMLHttpRequest).overrideMimeType&&t.overrideMimeType(e.content_type),t.open(e.type||(e.data?"POST":"GET"),e.url,e.async),e.crossDomain&&(t.withCredentials=!0),e.content_type&&t.setRequestHeader("Content-Type",e.content_type),e.requestheaders&&_t.each(e.requestheaders,(function(e){t.setRequestHeader(e.key,e.value);})),t.setRequestHeader("X-Requested-With","XMLHttpRequest"),(t=WE.fire("beforeSend",{xhr:t,settings:e}).xhr).send(e.data),!e.async)return r();ro.setTimeout(r,10);}}),KE=_t.extend,XE=function(){function e(e){this.settings=KE({},e),this.count=0;}return e.sendRPC=function(t){return (new e).send(t)},e.prototype.send=function(e){var t=e.error,n=e.success,r=KE(this.settings,e);r.success=function(e,o){void 0===(e=qE.parse(e))&&(e={error:"JSON Parse error."}),e.error?t.call(r.error_scope||r.scope,e.error,o):n.call(r.success_scope||r.scope,e.result);},r.error=function(e,n){t&&t.call(r.error_scope||r.scope,e,n);},r.data=qE.serialize({id:e.id||"c"+this.count++,method:e.method,params:e.params}),r.content_type="application/json",WE.send(r);},e}();try{var YE="__storage_test__";(zE=window.localStorage).setItem(YE,YE),zE.removeItem(YE);}catch(e){zE=function(){var e={},t=[],n={getItem:function(t){return e[t]||null},setItem:function(n,r){t.push(n),e[n]=String(r);},key:function(e){return t[e]},removeItem:function(n){t=t.filter((function(e){return e===n})),delete e[n];},clear:function(){t=[],e={};},length:0};return Object.defineProperty(n,"length",{get:function(){return t.length},configurable:!1,enumerable:!1}),n}();}var GE={geom:{Rect:LE},util:{Promise:Zr,Delay:ro,Tools:_t,VK:od,URI:zm,Class:UE,EventDispatcher:VN,Observable:$N,I18n:ku,XHR:WE,JSON:qE,JSONRequest:XE,JSONP:$E,LocalStorage:zE,Color:function(e){var t={},n=0,r=0,o=0,i=function(e){var i;return "object"==typeof e?"r"in e?(n=e.r,r=e.g,o=e.b):"v"in e&&function(e,t,i){if(e=(parseInt(e,10)||0)%360,t=parseInt(t,10)/100,i=parseInt(i,10)/100,t=jE(0,HE(t,1)),i=jE(0,HE(i,1)),0!==t){var a=e/60,u=i*t,c=u*(1-Math.abs(a%2-1)),s=i-u;switch(Math.floor(a)){case 0:n=u,r=c,o=0;break;case 1:n=c,r=u,o=0;break;case 2:n=0,r=u,o=c;break;case 3:n=0,r=c,o=u;break;case 4:n=c,r=0,o=u;break;case 5:n=u,r=0,o=c;break;default:n=r=o=0;}n=VE(255*(n+s)),r=VE(255*(r+s)),o=VE(255*(o+s));}else n=r=o=VE(255*i);}(e.h,e.s,e.v):(i=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(e))?(n=parseInt(i[1],10),r=parseInt(i[2],10),o=parseInt(i[3],10)):(i=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(e))?(n=parseInt(i[1],16),r=parseInt(i[2],16),o=parseInt(i[3],16)):(i=/#([0-F])([0-F])([0-F])/gi.exec(e))&&(n=parseInt(i[1]+i[1],16),r=parseInt(i[2]+i[2],16),o=parseInt(i[3]+i[3],16)),n=n<0?0:n>255?255:n,r=r<0?0:r>255?255:r,o=o<0?0:o>255?255:o,t};return e&&i(e),t.toRgb=function(){return {r:n,g:r,b:o}},t.toHsv=function(){return function(e,t,n){var r,o;o=0;var i=HE(e/=255,HE(t/=255,n/=255)),a=jE(e,jE(t,n));return i===a?{h:0,s:0,v:100*(o=i)}:(r=(a-i)/a,o=a,{h:VE(60*((e===i?3:n===i?1:5)-(e===i?t-n:n===i?e-t:n-e)/(a-i))),s:VE(100*r),v:VE(100*o)})}(n,r,o)},t.toHex=function(){var e=function(e){return (e=parseInt(e,10).toString(16)).length>1?e:"0"+e};return "#"+e(n)+e(r)+e(o)},t.parse=i,t},ImageUploader:function(e){var t=Ty(),n=Iy(e,t);return {upload:function(t,r){return void 0===r&&(r=!0),n.upload(t,r?Ly(e):void 0)}}}},dom:{EventUtils:Ui,Sizzle:wa,DomQuery:cu,TreeWalker:ao,TextSeeker:Qu,DOMUtils:pu,ScriptLoader:yu,RangeUtils:xd,Serializer:Ob,StyleSheetLoader:oo,ControlSelection:ad,BookmarkManager:Ql,Selection:sb,Event:Ui.Event},html:{Styles:Di,Entities:bi,Node:Om,Schema:Ai,SaxParser:$m,DomParser:_b,Writer:Qm,Serializer:Zm},Env:wt,AddOnManager:Nu,Annotator:Jl,Formatter:qy,UndoManager:Wy,EditorCommands:BN,WindowManager:xy,NotificationManager:by,EditorObservable:GN,Shortcuts:iE,Editor:dE,FocusManager:cm,EditorManager:NE,DOM:pu.DOM,ScriptLoader:yu.ScriptLoader,PluginManager:yy,ThemeManager:Cy,IconManager:sy,Resource:IE,trim:_t.trim,isArray:_t.isArray,is:_t.is,toArray:_t.toArray,makeMap:_t.makeMap,each:_t.each,map:_t.map,grep:_t.grep,inArray:_t.inArray,extend:_t.extend,create:_t.create,walk:_t.walk,createNS:_t.createNS,resolve:_t.resolve,explode:_t.explode,_addCacheSuffix:_t._addCacheSuffix,isOpera:wt.opera,isWebKit:wt.webkit,isIE:wt.ie,isGecko:wt.gecko,isMac:wt.mac},JE=_t.extend(NE,GE);!function(e){window.tinymce=e,window.tinyMCE=e;}(JE),function(t){try{e.exports=t;}catch(e){}}(JE);}();}(tinymce);
27
27
  var Validator=function(){function t(t,i){if(this.options={errorAlert:"There are errors on the form, please check your answers and try again.",useAjax:!0},this.element=t,this.element){this.options.serializationFunction=function(){return $(this.element).serialize()}.bind(this),this.options=__assign(__assign({},this.options),i),this.element.addEventListener("submit",function(t){t.preventDefault(),t.stopImmediatePropagation(),this.submitForm();}.bind(this));var e='[data-submit="#'+this.element.id+'"]',n=$(e);n&&n.on("click",function(t){t.preventDefault(),t.stopImmediatePropagation(),$(t.currentTarget).data("exit")&&($(this.element).find("input#exit").remove(),$("<input id='exit' />").attr("type","hidden").attr("name","exit").attr("value","true").appendTo(this.element)),this.submitForm();}.bind(this));}}return t.prototype.submitForm=function(){var t;if(this.element.classList.add("was-validated"),this.element.checkValidity()){this.element.classList.add("loading");var i=this.element.querySelector("input[type=checkbox]");if(i&&Array.prototype.slice.call(i).forEach((function(t){$(this).is(":checked")&&$(this).val("true");})),this.options.onSubmit&&this.options.onSubmit(this),this.options.useAjax){var e=this.options.serializationFunction();$.post(this.element.action,e,function(t){this.options.onComplete&&this.options.onComplete(t,this);}.bind(this)).fail(null!==(t=this.options.onError)&&void 0!==t?t:Inline.handleError);}else this.element.submit();}else this.options.errorAlert&&Alerts.error(this.options.errorAlert,null,5e3);},t}();var Handlers=function(){function t(){}return t.prototype.initDefaultHandlers=function(){this.checkboxToCsvInput(),this.iconSelector(),this.initSelectValues(),this.scrollHandlers(),this.selectText(),this.setValueOnClick(),this.submitOnChange();},t.prototype.initSelectValues=function(t){void 0===t&&(t="body"),$(t).find("select[data-selected]").each(this.initSelectValuesHandler);},t.prototype.initSelectValuesHandler=function(t,e){var o=$(this).data("selected");if("undefined"!==o&&""!==o){var a=String(o);$(this).val(a);}},t.prototype.iconSelector=function(t){void 0===t&&(t="body"),$(t).find("[data-hood-icon]").each(this.iconSelectorHandler);},t.prototype.iconSelectorHandler=function(t,e){var o=$(this),a=o.find("input[data-hood-icon-input]"),n=o.find("[data-hood-icon-display]"),i=o.find(".collapse");o.find("[data-hood-icon-key][data-hood-icon-value]").on("click",(function(){o.find("[data-hood-icon-key][data-hood-icon-value]").removeClass("active"),$(this).addClass("active");var t=$(this).data("hoodIconKey"),e=$(this).data("hoodIconValue");$(this),n.html(e),a.val(t),i&&i.removeClass("show");}));},t.prototype.selectText=function(t){void 0===t&&(t="body"),$(t).on("click",".select-text",this.selectTextHandler);},t.prototype.selectTextHandler=function(){var t=$(this);t.select(),t.mouseup((function(){return t.unbind("mouseup"),!1}));},t.prototype.scrollHandlers=function(t){void 0===t&&(t="body"),$(t).on("click",".scroll-top, .scroll-to-top",this.scrollTop),$(t).on("click",".scroll-target, .scroll-to-target",this.scrollTarget),$(t).on("click",".scroll-target-direct, .scroll-to-target-direct",this.scrollTargetDirect);},t.prototype.scrollTop=function(t){return t&&t.preventDefault(),$("html, body").animate({scrollTop:0},800),!1},t.prototype.scrollTarget=function(t){t&&t.preventDefault();var e=$(this).attr("href").split("#")[0];if(e===window.location.pathname||""===e){var o=this.hash,a=$(o),n=$("header.header"),i=0;n&&(i=n.height()),$(this).data("offset")?$("html, body").stop().animate({scrollTop:a.offset().top-$(this).data("offset")},900,"swing"):$("html, body").stop().animate({scrollTop:a.offset().top-i},900,"swing");}},t.prototype.scrollTargetDirect=function(){var t=$("body").scrollTop(),e=$($(this).attr("href")).offset().top;return $("html, body").animate({scrollTop:e},Math.abs(e-t)),!1},t.prototype.checkboxToCsvInput=function(t){void 0===t&&(t="body"),$(t).on("change","input[type=checkbox][data-hood-csv-input]",this.checkboxToCsvInputHandler);},t.prototype.checkboxToCsvInputHandler=function(t){t&&t.preventDefault();var e=new Array;$('input[data-hood-csv-input="'+$(this).data("hoodCsvInput")+'"]').each((function(){$(this).is(":checked")&&e.push($(this).val());}));var o="#"+$(this).data("input"),a=JSON.stringify(e);$(o).val(a);},t.prototype.submitOnChange=function(t){void 0===t&&(t="body"),$(t).on("change",".submit-on-change",this.submitOnChangeHandler);},t.prototype.submitOnChangeHandler=function(t){t&&t.preventDefault(),$(this).parents("form").submit();},t.prototype.setValueOnClick=function(t){void 0===t&&(t="body"),$(t).on("click",".click-select[data-target][data-value]",this.setValueOnClickHandler);},t.prototype.setValueOnClickHandler=function(){var t=$(this),e="#"+t.data("target");$(e).val(t.data("value")),$(e).trigger("change"),$('.click-select.clean[data-target="'+t.data("target")+'"]').each((function(){$(this).removeClass("active");})),$('.click-select.clean[data-target="'+t.data("target")+'"][data-value="'+t.data("value")+'"]').each((function(){$(this).addClass("active");}));},t}();var Uploader=function(){function e(){($(".image-uploader").length||$(".gallery-uploader").length)&&($(".upload-progress-bar").hide(),$(".image-uploader").each(this.singleImage),$(".gallery-uploader").each(this.gallery));}return e.prototype.refreshImage=function(e,r){$(e.data("preview")).css({"background-image":"url("+r.media.smallUrl+")"}),$(e.data("preview")).find("img").attr("src",r.media.smallUrl);},e.prototype.singleImage=function(){var e="#"+$(this).attr("id"),r=$(e),a="#"+$(this).attr("json"),l=null;r.dropzone({url:r.data("url"),maxFiles:1,paramName:"file",parallelUploads:1,acceptedFiles:r.data("types")||".png,.jpg,.jpeg,.gif",autoProcessQueue:!0,previewsContainer:!1,clickable:e,init:function(){l=this;}}),l.on("addedfile",(function(){})),l.on("totaluploadprogress",(function(r){$(".upload-progress-bar."+e.replace("#","")+" .progress-bar").css({width:r+"%"});})),l.on("sending",(function(a){$(".upload-progress-bar."+e.replace("#","")).show(),$(r.data("preview")).addClass("loading");})),l.on("queuecomplete",(function(r){$(".upload-progress-bar."+e.replace("#","")).hide();})),l.on("success",(function(e,o){o.success?(o.media&&($(a).val(JSON.stringify(o.media)),$(r.data("preview")).css({"background-image":"url("+o.media.smallUrl+")"}),$(r.data("preview")).find("img").attr("src",o.media.smallUrl)),Alerts.success("New image added!")):Alerts.error("There was a problem adding the image: "+o.error),l.removeFile(e),$(r.data("preview")).removeClass("loading");}));},e.prototype.gallery=function(){var e="#"+$(this).attr("id"),r=$(e),a=document.querySelector(e+"-template");a.id="";var l=a.parentNode.innerHTML;a.parentNode.removeChild(a);var o=null;r.dropzone({url:r.data("url"),thumbnailWidth:80,thumbnailHeight:80,parallelUploads:5,previewTemplate:l,paramName:"files",acceptedFiles:r.data("types")||".png,.jpg,.jpeg,.gif",autoProcessQueue:!0,previewsContainer:"#previews",clickable:".fileinput-button",init:function(){o=this;}}),$(e+" .cancel").hide(),o.on("addedfile",(function(r){$(r.previewElement.querySelector(".complete")).hide(),$(r.previewElement.querySelector(".cancel")).show(),$(e+" .cancel").show();})),o.on("totaluploadprogress",(function(e,r,a){document.querySelector("#total-progress .progress-bar").style.width=e+"%";})),o.on("sending",(function(e){document.querySelector("#total-progress").style.opacity="1";})),o.on("complete",(function(e){$(e.previewElement.querySelector(".cancel")).hide(),$(e.previewElement.querySelector(".progress")).hide(),$(e.previewElement.querySelector(".complete")).show(),console.error("Uploader.Gallery.Dropzone.OnComplete - Inline.Refresh('.gallery') is not implemented.");})),o.on("queuecomplete",(function(r){document.querySelector("#total-progress").style.opacity="0",$(e+" .cancel").hide();})),o.on("success",(function(e,r){console.error("Uploader.Gallery.Dropzone.OnSuccess - Inline.Refresh('.gallery') is not implemented."),r.success?Alerts.success("New images added!"):Alerts.error("There was a problem adding the profile image: "+r.error);})),$(".actions .cancel").click((function(){o.removeAllFiles(!0);}));},e}();var HoodApi=function(){function t(){this.alerts=new Alerts,this.handlers=new Handlers,this.uploader=new Uploader;}return t.prototype.initialise=function(){this.setupLoaders(),this.handlers.initDefaultHandlers(),this.initContactForms();},t.prototype.setupLoaders=function(){$("body").on("loader-show",(function(){document.body.classList.add("loading");})),$("body").on("loader-hide",(function(){document.body.classList.remove("loading");}));},t.prototype.initGoogleMaps=function(t){void 0===t&&(t=".google-map"),$(t).each((function(){var t=new google.maps.LatLng($(this).data("lat"),$(this).data("long"));console.log("Loading map at: "+$(this).data("lat")+", "+$(this).data("long"));var o=new google.maps.Map(this,{zoom:$(this).data("zoom")||15,center:t,scrollwheel:!1});new google.maps.Marker({position:t,map:o,title:$(this).data("marker")});$(window).on("resize",(function(){google.maps.event.trigger(o,"resize");})),google.maps.event.trigger(o,"resize");}));},t.prototype.initContactForms=function(t){void 0===t&&(t=".contact-form");var o=$(t);o.find(".thank-you").hide(),o.find(".form-content").show();var e=$(t)[0];new Validator(e,{onComplete:function(t){t.success?(o.attr("data-redirect")&&(window.location.href=o.attr("data-redirect")),o.attr("data-alert-message")&&Alerts.success(o.attr("data-alert-message")),o.find(".form").hide(),o.find(".thank-you").show()):o.attr("data-alert-error")?Alerts.error(o.attr("data-alert-error")):(console.error(t.errors),Alerts.error("There are errors on the form, please check your answers and try again."));}.bind(this)});},t}();var Loader=function(){function e(){new CustomEvent("loader-show"),new CustomEvent("loader-hide");}return e.show=function(){$("body").trigger("loader-show");},e.hide=function(){$("body").trigger("loader-hide");},e}();new Loader;$.fn.exists=function(){return $(this).length},$.fn.restrictToSlug=function(t){void 0===t&&(t=/[^0-9a-zA-Z]*/g);var n=$(this),e=function(){var n=$(this).val(),e=n.replace(t,"");n!==e&&$(this).val(e);};n.on("keyup",e),n.on("paste",e),n.on("change",e);},$.fn.restrictToPageSlug=function(t){void 0===t&&(t=/[^0-9a-zA-Z-//]*/g);var n=$(this),e=function(){var n=$(this).val(),e=n.replace(t,"");if((e.match(new RegExp("/","g"))||[]).length>4){var a=e.lastIndexOf("/");e=e.substring(0,a)+e.substring(a+1),Alerts.warning("You can only have up to 4 '/' characters in a url slug.");}n!==e&&$(this).val(e);};n.on("keyup",e),n.on("paste",e),n.on("change",e);},$.fn.restrictToMetaSlug=function(t){void 0===t&&(t=/[^0-9a-zA-Z.]*/g);var n=$(this),e=function(){var n=$(this).val(),e=n.replace(t,"");if((e.match(new RegExp(".","g"))||[]).length>1){var a=e.lastIndexOf(".");e=e.substring(0,a)+e.substring(a+1),Alerts.warning("You can only have up to 1 '.' characters in a meta slug.");}n!==e&&$(this).val(e);};n.on("keyup",e),n.on("paste",e),n.on("change",e);},$.fn.characterCounter=function(){var t=$(this),n=function(){var t=$(this).data("counter"),n=Number($(this).attr("maxlength")),e=$(this).val().length;$(t).text(n-e);var a="text-success";n-e<n/10&&(a="text-danger"),$(t).parent().removeClass("text-success").removeClass("text-danger").addClass(a);};t.on("keyup",n),t.on("paste",n),t.on("change",n);},$.fn.warningAlert=function(){$(this).on("click",(function(t){t.preventDefault();return Alerts.confirm({title:$(t.currentTarget).data("title"),html:$(t.currentTarget).data("warning"),footer:$(t.currentTarget).data("footer"),icon:"warning"},(function(n){if(n.isConfirmed){var e=$(t.currentTarget).attr("href");window.location.href=e;}})),!1}));};
28
28
  Number.prototype.formatCurrency=function(t){return t+" "+this.toFixed(2).replace(/./g,(function(t,e,r){return e>0&&"."!==t&&(r.length-e)%3==0?","+t:t}))},Number.prototype.formatKilobytes=function(){return (this/1024).toFixed(0).replace(/./g,(function(t,e,r){return e>0&&"."!==t&&(r.length-e)%3==0?","+t:t}))+"Kb"},Number.prototype.formatMegabytes=function(){var t=this/1024;return (t/=1024).toFixed(0).replace(/./g,(function(t,e,r){return e>0&&"."!==t&&(r.length-e)%3==0?","+t:t}))+"Mb"};String.prototype.htmlEncode=function(){return $("<div/>").text(this).html()},String.prototype.htmlDecode=function(){return $("<div/>").html(this).text()},String.prototype.contains=function(t){return -1!==this.indexOf(t)},String.prototype.pick=function(t,r){var o,n="";o=void 0===r?t:t+Math.floor(Math.random()*(r-t));for(var e=0;e<o;e++)n+=this.charAt(Math.floor(Math.random()*this.length));return n},String.prototype.shuffle=function(){var t,r,o=this.split(""),n=o.length;if(n)for(;--n;)t=o[r=Math.floor(Math.random()*(n+1))],o[r]=o[n],o[n]=t;return o.join("")},String.prototype.toSeoUrl=function(){var t=this.replace(/[^a-zA-Z0-9]/g," ").replace(/\s+/g,"-").toLowerCase();"-"===t.charAt(0)&&(t=t.substring(1));var r=t.length-1;return "-"===t.charAt(r)&&(t=t.substring(0,r)),t};/*!
29
- * Chart.js v3.7.0
29
+ * Chart.js v3.7.1
30
30
  * https://www.chartjs.org
31
- * (c) 2021 Chart.js Contributors
31
+ * (c) 2022 Chart.js Contributors
32
32
  * Released under the MIT License
33
33
  */
34
34
  const requestAnimFrame="undefined"==typeof window?function(e){return e()}:window.requestAnimationFrame;function throttled(e,t,n){const r=n||(e=>Array.prototype.slice.call(e));let o=!1,a=[];return function(...n){a=r(n),o||(o=!0,requestAnimFrame.call(window,(()=>{o=!1,e.apply(t,a);})));}}function debounce(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const _toLeftRightCenter=e=>"start"===e?"left":"end"===e?"right":"center",_alignStartEnd=(e,t,n)=>"start"===e?t:"end"===e?n:(t+n)/2,_textX=(e,t,n,r)=>e===(r?"left":"right")?n:"center"===e?(t+n)/2:t;function noop(){}const uid=function(){let e=0;return function(){return e++}}();function isNullOrUndef(e){return null==e}function isArray(e){if(Array.isArray&&Array.isArray(e))return !0;const t=Object.prototype.toString.call(e);return "[object"===t.substr(0,7)&&"Array]"===t.substr(-6)}function isObject(e){return null!==e&&"[object Object]"===Object.prototype.toString.call(e)}const isNumberFinite=e=>("number"==typeof e||e instanceof Number)&&isFinite(+e);function finiteOrDefault(e,t){return isNumberFinite(e)?e:t}function valueOrDefault(e,t){return void 0===e?t:e}const toPercentage=(e,t)=>"string"==typeof e&&e.endsWith("%")?parseFloat(e)/100:e/t,toDimension=(e,t)=>"string"==typeof e&&e.endsWith("%")?parseFloat(e)/100*t:+e;function callback(e,t,n){if(e&&"function"==typeof e.call)return e.apply(n,t)}function each(e,t,n,r){let o,a,i;if(isArray(e))if(a=e.length,r)for(o=a-1;o>=0;o--)t.call(n,e[o],o);else for(o=0;o<a;o++)t.call(n,e[o],o);else if(isObject(e))for(i=Object.keys(e),a=i.length,o=0;o<a;o++)t.call(n,e[i[o]],i[o]);}function _elementsEqual(e,t){let n,r,o,a;if(!e||!t||e.length!==t.length)return !1;for(n=0,r=e.length;n<r;++n)if(o=e[n],a=t[n],o.datasetIndex!==a.datasetIndex||o.index!==a.index)return !1;return !0}function clone$1(e){if(isArray(e))return e.map(clone$1);if(isObject(e)){const t=Object.create(null),n=Object.keys(e),r=n.length;let o=0;for(;o<r;++o)t[n[o]]=clone$1(e[n[o]]);return t}return e}function isValidKey(e){return -1===["__proto__","prototype","constructor"].indexOf(e)}function _merger(e,t,n,r){if(!isValidKey(e))return;const o=t[e],a=n[e];isObject(o)&&isObject(a)?merge(o,a,r):t[e]=clone$1(a);}function merge(e,t,n){const r=isArray(t)?t:[t],o=r.length;if(!isObject(e))return e;const a=(n=n||{}).merger||_merger;for(let i=0;i<o;++i){if(!isObject(t=r[i]))continue;const o=Object.keys(t);for(let r=0,i=o.length;r<i;++r)a(o[r],e,t,n);}return e}function mergeIf(e,t){return merge(e,t,{merger:_mergerIf})}function _mergerIf(e,t,n){if(!isValidKey(e))return;const r=t[e],o=n[e];isObject(r)&&isObject(o)?mergeIf(r,o):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=clone$1(o));}function indexOfDotOrLength(e,t){const n=e.indexOf(".",t);return -1===n?e.length:n}function resolveObjectKey(e,t){if(""===t)return e;let n=0,r=indexOfDotOrLength(t,n);for(;e&&r>n;)e=e[t.substr(n,r-n)],n=r+1,r=indexOfDotOrLength(t,n);return e}function _capitalize(e){return e.charAt(0).toUpperCase()+e.slice(1)}const defined=e=>void 0!==e,isFunction=e=>"function"==typeof e,setsEqual=(e,t)=>{if(e.size!==t.size)return !1;for(const n of e)if(!t.has(n))return !1;return !0};function _isClickEvent(e){return "mouseup"===e.type||"click"===e.type||"contextmenu"===e.type}const PI=Math.PI,TAU=2*PI,PITAU=TAU+PI,INFINITY=Number.POSITIVE_INFINITY,RAD_PER_DEG=PI/180,HALF_PI=PI/2,QUARTER_PI=PI/4,TWO_THIRDS_PI=2*PI/3,log10=Math.log10,sign=Math.sign;function niceNum(e){const t=Math.round(e);e=almostEquals(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(log10(e))),r=e/n;return (r<=1?1:r<=2?2:r<=5?5:10)*n}function _factorize(e){const t=[],n=Math.sqrt(e);let r;for(r=1;r<n;r++)e%r==0&&(t.push(r),t.push(e/r));return n===(0|n)&&t.push(n),t.sort(((e,t)=>e-t)).pop(),t}function isNumber(e){return !isNaN(parseFloat(e))&&isFinite(e)}function almostEquals(e,t,n){return Math.abs(e-t)<n}function almostWhole(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function _setMinAndMaxByKey(e,t,n){let r,o,a;for(r=0,o=e.length;r<o;r++)a=e[r][n],isNaN(a)||(t.min=Math.min(t.min,a),t.max=Math.max(t.max,a));}function toRadians(e){return e*(PI/180)}function toDegrees(e){return e*(180/PI)}function _decimalPlaces(e){if(!isNumberFinite(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function getAngleFromPoint(e,t){const n=t.x-e.x,r=t.y-e.y,o=Math.sqrt(n*n+r*r);let a=Math.atan2(r,n);return a<-.5*PI&&(a+=TAU),{angle:a,distance:o}}function distanceBetweenPoints(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function _angleDiff(e,t){return (e-t+PITAU)%TAU-PI}function _normalizeAngle(e){return (e%TAU+TAU)%TAU}function _angleBetween(e,t,n,r){const o=_normalizeAngle(e),a=_normalizeAngle(t),i=_normalizeAngle(n),s=_normalizeAngle(a-o),c=_normalizeAngle(i-o),l=_normalizeAngle(o-a),u=_normalizeAngle(o-i);return o===a||o===i||r&&a===i||s>c&&l<u}function _limitValue(e,t,n){return Math.max(t,Math.min(n,e))}function _int16Range(e){return _limitValue(e,-32768,32767)}function _isBetween(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}const atEdge=e=>0===e||1===e,elasticIn=(e,t,n)=>-Math.pow(2,10*(e-=1))*Math.sin((e-t)*TAU/n),elasticOut=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*TAU/n)+1,effects={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>1-Math.cos(e*HALF_PI),easeOutSine:e=>Math.sin(e*HALF_PI),easeInOutSine:e=>-.5*(Math.cos(PI*e)-1),easeInExpo:e=>0===e?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>1===e?1:1-Math.pow(2,-10*e),easeInOutExpo:e=>atEdge(e)?e:e<.5?.5*Math.pow(2,10*(2*e-1)):.5*(2-Math.pow(2,-10*(2*e-1))),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>atEdge(e)?e:elasticIn(e,.075,.3),easeOutElastic:e=>atEdge(e)?e:elasticOut(e,.075,.3),easeInOutElastic(e){const t=.1125;return atEdge(e)?e:e<.5?.5*elasticIn(2*e,t,.45):.5+.5*elasticOut(2*e-1,t,.45)},easeInBack(e){const t=1.70158;return e*e*((t+1)*e-t)},easeOutBack(e){const t=1.70158;return (e-=1)*e*((t+1)*e+t)+1},easeInOutBack(e){let t=1.70158;return (e/=.5)<1?e*e*((1+(t*=1.525))*e-t)*.5:.5*((e-=2)*e*((1+(t*=1.525))*e+t)+2)},easeInBounce:e=>1-effects.easeOutBounce(1-e),easeOutBounce(e){const t=7.5625,n=2.75;return e<1/n?t*e*e:e<2/n?t*(e-=1.5/n)*e+.75:e<2.5/n?t*(e-=2.25/n)*e+.9375:t*(e-=2.625/n)*e+.984375},easeInOutBounce:e=>e<.5?.5*effects.easeInBounce(2*e):.5*effects.easeOutBounce(2*e-1)+.5},map$1={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},hex="0123456789ABCDEF",h1=e=>hex[15&e],h2=e=>hex[(240&e)>>4]+hex[15&e],eq=e=>(240&e)>>4==(15&e);function isShort(e){return eq(e.r)&&eq(e.g)&&eq(e.b)&&eq(e.a)}function hexParse(e){var t,n=e.length;return "#"===e[0]&&(4===n||5===n?t={r:255&17*map$1[e[1]],g:255&17*map$1[e[2]],b:255&17*map$1[e[3]],a:5===n?17*map$1[e[4]]:255}:7!==n&&9!==n||(t={r:map$1[e[1]]<<4|map$1[e[2]],g:map$1[e[3]]<<4|map$1[e[4]],b:map$1[e[5]]<<4|map$1[e[6]],a:9===n?map$1[e[7]]<<4|map$1[e[8]]:255})),t}function hexString(e){var t=isShort(e)?h1:h2;return e?"#"+t(e.r)+t(e.g)+t(e.b)+(e.a<255?t(e.a):""):e}function round(e){return e+.5|0}const lim=(e,t,n)=>Math.max(Math.min(e,n),t);function p2b(e){return lim(round(2.55*e),0,255)}function n2b(e){return lim(round(255*e),0,255)}function b2n(e){return lim(round(e/2.55)/100,0,1)}function n2p(e){return lim(round(100*e),0,100)}const RGB_RE=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function rgbParse(e){const t=RGB_RE.exec(e);let n,r,o,a=255;if(t){if(t[7]!==n){const e=+t[7];a=255&(t[8]?p2b(e):255*e);}return n=+t[1],r=+t[3],o=+t[5],n=255&(t[2]?p2b(n):n),r=255&(t[4]?p2b(r):r),o=255&(t[6]?p2b(o):o),{r:n,g:r,b:o,a:a}}}function rgbString(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${b2n(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const HUE_RE=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function hsl2rgbn(e,t,n){const r=t*Math.min(n,1-n),o=(t,o=(t+e/30)%12)=>n-r*Math.max(Math.min(o-3,9-o,1),-1);return [o(0),o(8),o(4)]}function hsv2rgbn(e,t,n){const r=(r,o=(r+e/60)%6)=>n-n*t*Math.max(Math.min(o,4-o,1),0);return [r(5),r(3),r(1)]}function hwb2rgbn(e,t,n){const r=hsl2rgbn(e,1,.5);let o;for(t+n>1&&(o=1/(t+n),t*=o,n*=o),o=0;o<3;o++)r[o]*=1-t-n,r[o]+=t;return r}function rgb2hsl(e){const t=e.r/255,n=e.g/255,r=e.b/255,o=Math.max(t,n,r),a=Math.min(t,n,r),i=(o+a)/2;let s,c,l;return o!==a&&(l=o-a,c=i>.5?l/(2-o-a):l/(o+a),s=o===t?(n-r)/l+(n<r?6:0):o===n?(r-t)/l+2:(t-n)/l+4,s=60*s+.5),[0|s,c||0,i]}function calln(e,t,n,r){return (Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(n2b)}function hsl2rgb(e,t,n){return calln(hsl2rgbn,e,t,n)}function hwb2rgb(e,t,n){return calln(hwb2rgbn,e,t,n)}function hsv2rgb(e,t,n){return calln(hsv2rgbn,e,t,n)}function hue(e){return (e%360+360)%360}function hueParse(e){const t=HUE_RE.exec(e);let n,r=255;if(!t)return;t[5]!==n&&(r=t[6]?p2b(+t[5]):n2b(+t[5]));const o=hue(+t[2]),a=+t[3]/100,i=+t[4]/100;return n="hwb"===t[1]?hwb2rgb(o,a,i):"hsv"===t[1]?hsv2rgb(o,a,i):hsl2rgb(o,a,i),{r:n[0],g:n[1],b:n[2],a:r}}function rotate(e,t){var n=rgb2hsl(e);n[0]=hue(n[0]+t),n=hsl2rgb(n),e.r=n[0],e.g=n[1],e.b=n[2];}function hslString(e){if(!e)return;const t=rgb2hsl(e),n=t[0],r=n2p(t[1]),o=n2p(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${o}%, ${b2n(e.a)})`:`hsl(${n}, ${r}%, ${o}%)`}const map$1$1={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},names={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function unpack(){const e={},t=Object.keys(names),n=Object.keys(map$1$1);let r,o,a,i,s;for(r=0;r<t.length;r++){for(i=s=t[r],o=0;o<n.length;o++)a=n[o],s=s.replace(a,map$1$1[a]);a=parseInt(names[i],16),e[s]=[a>>16&255,a>>8&255,255&a];}return e}let names$1;function nameParse(e){names$1||(names$1=unpack(),names$1.transparent=[0,0,0,0]);const t=names$1[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:4===t.length?t[3]:255}}function modHSL(e,t,n){if(e){let r=rgb2hsl(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,0===t?360:1)),r=hsl2rgb(r),e.r=r[0],e.g=r[1],e.b=r[2];}}function clone(e,t){return e?Object.assign(t||{},e):e}function fromObject(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=n2b(e[3]))):(t=clone(e,{r:0,g:0,b:0,a:1})).a=n2b(t.a),t}function functionParse(e){return "r"===e.charAt(0)?rgbParse(e):hueParse(e)}class Color{constructor(e){if(e instanceof Color)return e;const t=typeof e;let n;"object"===t?n=fromObject(e):"string"===t&&(n=hexParse(e)||nameParse(e)||functionParse(e)),this._rgb=n,this._valid=!!n;}get valid(){return this._valid}get rgb(){var e=clone(this._rgb);return e&&(e.a=b2n(e.a)),e}set rgb(e){this._rgb=fromObject(e);}rgbString(){return this._valid?rgbString(this._rgb):this._rgb}hexString(){return this._valid?hexString(this._rgb):this._rgb}hslString(){return this._valid?hslString(this._rgb):this._rgb}mix(e,t){const n=this;if(e){const r=n.rgb,o=e.rgb;let a;const i=t===a?.5:t,s=2*i-1,c=r.a-o.a,l=((s*c==-1?s:(s+c)/(1+s*c))+1)/2;a=1-l,r.r=255&l*r.r+a*o.r+.5,r.g=255&l*r.g+a*o.g+.5,r.b=255&l*r.b+a*o.b+.5,r.a=i*r.a+(1-i)*o.a,n.rgb=r;}return n}clone(){return new Color(this.rgb)}alpha(e){return this._rgb.a=n2b(e),this}clearer(e){return this._rgb.a*=1-e,this}greyscale(){const e=this._rgb,t=round(.3*e.r+.59*e.g+.11*e.b);return e.r=e.g=e.b=t,this}opaquer(e){return this._rgb.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return modHSL(this._rgb,2,e),this}darken(e){return modHSL(this._rgb,2,-e),this}saturate(e){return modHSL(this._rgb,1,e),this}desaturate(e){return modHSL(this._rgb,1,-e),this}rotate(e){return rotate(this._rgb,e),this}}function index_esm(e){return new Color(e)}const isPatternOrGradient=e=>e instanceof CanvasGradient||e instanceof CanvasPattern;function color(e){return isPatternOrGradient(e)?e:index_esm(e)}function getHoverColor(e){return isPatternOrGradient(e)?e:index_esm(e).saturate(.5).darken(.1).hexString()}const overrides=Object.create(null),descriptors=Object.create(null);function getScope$1(e,t){if(!t)return e;const n=t.split(".");for(let t=0,r=n.length;t<r;++t){const r=n[t];e=e[r]||(e[r]=Object.create(null));}return e}function set(e,t,n){return "string"==typeof t?merge(getScope$1(e,t),n):merge(getScope$1(e,""),t)}class Defaults{constructor(e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=e=>e.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(e,t)=>getHoverColor(t.backgroundColor),this.hoverBorderColor=(e,t)=>getHoverColor(t.borderColor),this.hoverColor=(e,t)=>getHoverColor(t.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e);}set(e,t){return set(this,e,t)}get(e){return getScope$1(this,e)}describe(e,t){return set(descriptors,e,t)}override(e,t){return set(overrides,e,t)}route(e,t,n,r){const o=getScope$1(this,e),a=getScope$1(this,n),i="_"+t;Object.defineProperties(o,{[i]:{value:o[t],writable:!0},[t]:{enumerable:!0,get(){const e=this[i],t=a[r];return isObject(e)?Object.assign({},t,e):valueOrDefault(e,t)},set(e){this[i]=e;}}});}}var defaults=new Defaults({_scriptable:e=>!e.startsWith("on"),_indexable:e=>"events"!==e,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function toFontString(e){return !e||isNullOrUndef(e.size)||isNullOrUndef(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function _measureText(e,t,n,r,o){let a=t[o];return a||(a=t[o]=e.measureText(o).width,n.push(o)),a>r&&(r=a),r}function _longestText(e,t,n,r){let o=(r=r||{}).data=r.data||{},a=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(o=r.data={},a=r.garbageCollect=[],r.font=t),e.save(),e.font=t;let i=0;const s=n.length;let c,l,u,f,d;for(c=0;c<s;c++)if(f=n[c],null!=f&&!0!==isArray(f))i=_measureText(e,o,a,i,f);else if(isArray(f))for(l=0,u=f.length;l<u;l++)d=f[l],null==d||isArray(d)||(i=_measureText(e,o,a,i,d));e.restore();const h=a.length/2;if(h>n.length){for(c=0;c<h;c++)delete o[a[c]];a.splice(0,h);}return i}function _alignPixel(e,t,n){const r=e.currentDevicePixelRatio,o=0!==n?Math.max(n/2,.5):0;return Math.round((t-o)*r)/r+o}function clearCanvas(e,t){(t=t||e.getContext("2d")).save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore();}function drawPoint(e,t,n,r){let o,a,i,s,c;const l=t.pointStyle,u=t.rotation,f=t.radius;let d=(u||0)*RAD_PER_DEG;if(l&&"object"==typeof l&&(o=l.toString(),"[object HTMLImageElement]"===o||"[object HTMLCanvasElement]"===o))return e.save(),e.translate(n,r),e.rotate(d),e.drawImage(l,-l.width/2,-l.height/2,l.width,l.height),void e.restore();if(!(isNaN(f)||f<=0)){switch(e.beginPath(),l){default:e.arc(n,r,f,0,TAU),e.closePath();break;case"triangle":e.moveTo(n+Math.sin(d)*f,r-Math.cos(d)*f),d+=TWO_THIRDS_PI,e.lineTo(n+Math.sin(d)*f,r-Math.cos(d)*f),d+=TWO_THIRDS_PI,e.lineTo(n+Math.sin(d)*f,r-Math.cos(d)*f),e.closePath();break;case"rectRounded":c=.516*f,s=f-c,a=Math.cos(d+QUARTER_PI)*s,i=Math.sin(d+QUARTER_PI)*s,e.arc(n-a,r-i,c,d-PI,d-HALF_PI),e.arc(n+i,r-a,c,d-HALF_PI,d),e.arc(n+a,r+i,c,d,d+HALF_PI),e.arc(n-i,r+a,c,d+HALF_PI,d+PI),e.closePath();break;case"rect":if(!u){s=Math.SQRT1_2*f,e.rect(n-s,r-s,2*s,2*s);break}d+=QUARTER_PI;case"rectRot":a=Math.cos(d)*f,i=Math.sin(d)*f,e.moveTo(n-a,r-i),e.lineTo(n+i,r-a),e.lineTo(n+a,r+i),e.lineTo(n-i,r+a),e.closePath();break;case"crossRot":d+=QUARTER_PI;case"cross":a=Math.cos(d)*f,i=Math.sin(d)*f,e.moveTo(n-a,r-i),e.lineTo(n+a,r+i),e.moveTo(n+i,r-a),e.lineTo(n-i,r+a);break;case"star":a=Math.cos(d)*f,i=Math.sin(d)*f,e.moveTo(n-a,r-i),e.lineTo(n+a,r+i),e.moveTo(n+i,r-a),e.lineTo(n-i,r+a),d+=QUARTER_PI,a=Math.cos(d)*f,i=Math.sin(d)*f,e.moveTo(n-a,r-i),e.lineTo(n+a,r+i),e.moveTo(n+i,r-a),e.lineTo(n-i,r+a);break;case"line":a=Math.cos(d)*f,i=Math.sin(d)*f,e.moveTo(n-a,r-i),e.lineTo(n+a,r+i);break;case"dash":e.moveTo(n,r),e.lineTo(n+Math.cos(d)*f,r+Math.sin(d)*f);}e.fill(),t.borderWidth>0&&e.stroke();}}function _isPointInArea(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function clipArea(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip();}function unclipArea(e){e.restore();}function _steppedLineTo(e,t,n,r,o){if(!t)return e.lineTo(n.x,n.y);if("middle"===o){const r=(t.x+n.x)/2;e.lineTo(r,t.y),e.lineTo(r,n.y);}else "after"===o!=!!r?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y);}function _bezierCurveTo(e,t,n,r){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(r?t.cp1x:t.cp2x,r?t.cp1y:t.cp2y,r?n.cp2x:n.cp1x,r?n.cp2y:n.cp1y,n.x,n.y);}function renderText(e,t,n,r,o,a={}){const i=isArray(t)?t:[t],s=a.strokeWidth>0&&""!==a.strokeColor;let c,l;for(e.save(),e.font=o.string,setRenderOpts(e,a),c=0;c<i.length;++c)l=i[c],s&&(a.strokeColor&&(e.strokeStyle=a.strokeColor),isNullOrUndef(a.strokeWidth)||(e.lineWidth=a.strokeWidth),e.strokeText(l,n,r,a.maxWidth)),e.fillText(l,n,r,a.maxWidth),decorateText(e,n,r,l,a),r+=o.lineHeight;e.restore();}function setRenderOpts(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),isNullOrUndef(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline);}function decorateText(e,t,n,r,o){if(o.strikethrough||o.underline){const a=e.measureText(r),i=t-a.actualBoundingBoxLeft,s=t+a.actualBoundingBoxRight,c=n-a.actualBoundingBoxAscent,l=n+a.actualBoundingBoxDescent,u=o.strikethrough?(c+l)/2:l;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=o.decorationWidth||2,e.moveTo(i,u),e.lineTo(s,u),e.stroke();}}function addRoundedRectPath(e,t){const{x:n,y:r,w:o,h:a,radius:i}=t;e.arc(n+i.topLeft,r+i.topLeft,i.topLeft,-HALF_PI,PI,!0),e.lineTo(n,r+a-i.bottomLeft),e.arc(n+i.bottomLeft,r+a-i.bottomLeft,i.bottomLeft,PI,HALF_PI,!0),e.lineTo(n+o-i.bottomRight,r+a),e.arc(n+o-i.bottomRight,r+a-i.bottomRight,i.bottomRight,HALF_PI,0,!0),e.lineTo(n+o,r+i.topRight),e.arc(n+o-i.topRight,r+i.topRight,i.topRight,0,-HALF_PI,!0),e.lineTo(n+i.topLeft,r);}const LINE_HEIGHT=new RegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/),FONT_STYLE=new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);function toLineHeight(e,t){const n=(""+e).match(LINE_HEIGHT);if(!n||"normal"===n[1])return 1.2*t;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100;}return t*e}function _readValueToProps(e,t){const n={},r=isObject(t),o=r?Object.keys(t):t,a=isObject(e)?r?n=>valueOrDefault(e[n],e[t[n]]):t=>e[t]:()=>e;for(const e of o)n[e]=+a(e)||0;return n}function toTRBL(e){return _readValueToProps(e,{top:"y",right:"x",bottom:"y",left:"x"})}function toTRBLCorners(e){return _readValueToProps(e,["topLeft","topRight","bottomLeft","bottomRight"])}function toPadding(e){const t=toTRBL(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function toFont(e,t){e=e||{},t=t||defaults.font;let n=valueOrDefault(e.size,t.size);"string"==typeof n&&(n=parseInt(n,10));let r=valueOrDefault(e.style,t.style);r&&!(""+r).match(FONT_STYLE)&&(console.warn('Invalid font style specified: "'+r+'"'),r="");const o={family:valueOrDefault(e.family,t.family),lineHeight:toLineHeight(valueOrDefault(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:valueOrDefault(e.weight,t.weight),string:""};return o.string=toFontString(o),o}function resolve(e,t,n,r){let o,a,i,s=!0;for(o=0,a=e.length;o<a;++o)if(i=e[o],void 0!==i&&(void 0!==t&&"function"==typeof i&&(i=i(t),s=!1),void 0!==n&&isArray(i)&&(i=i[n%i.length],s=!1),void 0!==i))return r&&!s&&(r.cacheable=!1),i}function _addGrace(e,t,n){const{min:r,max:o}=e,a=toDimension(t,(o-r)/2),i=(e,t)=>n&&0===e?0:e+t;return {min:i(r,-Math.abs(a)),max:i(o,a)}}function createContext(e,t){return Object.assign(Object.create(e),t)}function _lookup(e,t,n){n=n||(n=>e[n]<t);let r,o=e.length-1,a=0;for(;o-a>1;)r=a+o>>1,n(r)?a=r:o=r;return {lo:a,hi:o}}const _lookupByKey=(e,t,n)=>_lookup(e,n,(r=>e[r][t]<n)),_rlookupByKey=(e,t,n)=>_lookup(e,n,(r=>e[r][t]>=n));function _filterBetween(e,t,n){let r=0,o=e.length;for(;r<o&&e[r]<t;)r++;for(;o>r&&e[o-1]>n;)o--;return r>0||o<e.length?e.slice(r,o):e}const arrayEvents=["push","pop","shift","splice","unshift"];function listenArrayEvents(e,t){e._chartjs?e._chartjs.listeners.push(t):(Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),arrayEvents.forEach((t=>{const n="_onData"+_capitalize(t),r=e[t];Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value(...t){const o=r.apply(this,t);return e._chartjs.listeners.forEach((e=>{"function"==typeof e[n]&&e[n](...t);})),o}});})));}function unlistenArrayEvents(e,t){const n=e._chartjs;if(!n)return;const r=n.listeners,o=r.indexOf(t);-1!==o&&r.splice(o,1),r.length>0||(arrayEvents.forEach((t=>{delete e[t];})),delete e._chartjs);}function _arrayUnique(e){const t=new Set;let n,r;for(n=0,r=e.length;n<r;++n)t.add(e[n]);return t.size===r?e:Array.from(t)}function _createResolver(e,t=[""],n=e,r,o=(()=>e[0])){defined(r)||(r=_resolve("_fallback",e));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:n,_fallback:r,_getTarget:o,override:o=>_createResolver([o,...e],t,n,r)};return new Proxy(a,{deleteProperty:(t,n)=>(delete t[n],delete t._keys,delete e[0][n],!0),get:(n,r)=>_cached(n,r,(()=>_resolveWithPrefixes(r,t,e,n))),getOwnPropertyDescriptor:(e,t)=>Reflect.getOwnPropertyDescriptor(e._scopes[0],t),getPrototypeOf:()=>Reflect.getPrototypeOf(e[0]),has:(e,t)=>getKeysFromAllScopes(e).includes(t),ownKeys:e=>getKeysFromAllScopes(e),set(e,t,n){const r=e._storage||(e._storage=o());return e[t]=r[t]=n,delete e._keys,!0}})}function _attachContext(e,t,n,r){const o={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:_descriptors(e,r),setContext:t=>_attachContext(e,t,n,r),override:o=>_attachContext(e.override(o),t,n,r)};return new Proxy(o,{deleteProperty:(t,n)=>(delete t[n],delete e[n],!0),get:(e,t,n)=>_cached(e,t,(()=>_resolveWithContext(e,t,n))),getOwnPropertyDescriptor:(t,n)=>t._descriptors.allKeys?Reflect.has(e,n)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,n),getPrototypeOf:()=>Reflect.getPrototypeOf(e),has:(t,n)=>Reflect.has(e,n),ownKeys:()=>Reflect.ownKeys(e),set:(t,n,r)=>(e[n]=r,delete t[n],!0)})}function _descriptors(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:o=t.allKeys}=e;return {allKeys:o,scriptable:n,indexable:r,isScriptable:isFunction(n)?n:()=>n,isIndexable:isFunction(r)?r:()=>r}}const readKey=(e,t)=>e?e+_capitalize(t):t,needsSubResolver=(e,t)=>isObject(t)&&"adapters"!==e&&(null===Object.getPrototypeOf(t)||t.constructor===Object);function _cached(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];const r=n();return e[t]=r,r}function _resolveWithContext(e,t,n){const{_proxy:r,_context:o,_subProxy:a,_descriptors:i}=e;let s=r[t];return isFunction(s)&&i.isScriptable(t)&&(s=_resolveScriptable(t,s,e,n)),isArray(s)&&s.length&&(s=_resolveArray(t,s,e,i.isIndexable)),needsSubResolver(t,s)&&(s=_attachContext(s,o,a&&a[t],i)),s}function _resolveScriptable(e,t,n,r){const{_proxy:o,_context:a,_subProxy:i,_stack:s}=n;if(s.has(e))throw new Error("Recursion detected: "+Array.from(s).join("->")+"->"+e);return s.add(e),t=t(a,i||r),s.delete(e),needsSubResolver(e,t)&&(t=createSubResolver(o._scopes,o,e,t)),t}function _resolveArray(e,t,n,r){const{_proxy:o,_context:a,_subProxy:i,_descriptors:s}=n;if(defined(a.index)&&r(e))t=t[a.index%t.length];else if(isObject(t[0])){const n=t,r=o._scopes.filter((e=>e!==n));t=[];for(const c of n){const n=createSubResolver(r,o,e,c);t.push(_attachContext(n,a,i&&i[e],s));}}return t}function resolveFallback(e,t,n){return isFunction(e)?e(t,n):e}const getScope=(e,t)=>!0===e?t:"string"==typeof e?resolveObjectKey(t,e):void 0;function addScopes(e,t,n,r,o){for(const a of t){const t=getScope(n,a);if(t){e.add(t);const a=resolveFallback(t._fallback,n,o);if(defined(a)&&a!==n&&a!==r)return a}else if(!1===t&&defined(r)&&n!==r)return null}return !1}function createSubResolver(e,t,n,r){const o=t._rootScopes,a=resolveFallback(t._fallback,n,r),i=[...e,...o],s=new Set;s.add(r);let c=addScopesFromKey(s,i,n,a||n,r);return null!==c&&((!defined(a)||a===n||(c=addScopesFromKey(s,i,a,c,r),null!==c))&&_createResolver(Array.from(s),[""],o,a,(()=>subGetTarget(t,n,r))))}function addScopesFromKey(e,t,n,r,o){for(;n;)n=addScopes(e,t,n,r,o);return n}function subGetTarget(e,t,n){const r=e._getTarget();t in r||(r[t]={});const o=r[t];return isArray(o)&&isObject(n)?n:o}function _resolveWithPrefixes(e,t,n,r){let o;for(const a of t)if(o=_resolve(readKey(a,e),n),defined(o))return needsSubResolver(e,o)?createSubResolver(n,r,e,o):o}function _resolve(e,t){for(const n of t){if(!n)continue;const t=n[e];if(defined(t))return t}}function getKeysFromAllScopes(e){let t=e._keys;return t||(t=e._keys=resolveKeysFromAllScopes(e._scopes)),t}function resolveKeysFromAllScopes(e){const t=new Set;for(const n of e)for(const e of Object.keys(n).filter((e=>!e.startsWith("_"))))t.add(e);return Array.from(t)}const EPSILON=Number.EPSILON||1e-14,getPoint=(e,t)=>t<e.length&&!e[t].skip&&e[t],getValueAxis=e=>"x"===e?"y":"x";function splineCurve(e,t,n,r){const o=e.skip?t:e,a=t,i=n.skip?t:n,s=distanceBetweenPoints(a,o),c=distanceBetweenPoints(i,a);let l=s/(s+c),u=c/(s+c);l=isNaN(l)?0:l,u=isNaN(u)?0:u;const f=r*l,d=r*u;return {previous:{x:a.x-f*(i.x-o.x),y:a.y-f*(i.y-o.y)},next:{x:a.x+d*(i.x-o.x),y:a.y+d*(i.y-o.y)}}}function monotoneAdjust(e,t,n){const r=e.length;let o,a,i,s,c,l=getPoint(e,0);for(let u=0;u<r-1;++u)c=l,l=getPoint(e,u+1),c&&l&&(almostEquals(t[u],0,EPSILON)?n[u]=n[u+1]=0:(o=n[u]/t[u],a=n[u+1]/t[u],s=Math.pow(o,2)+Math.pow(a,2),s<=9||(i=3/Math.sqrt(s),n[u]=o*i*t[u],n[u+1]=a*i*t[u])));}function monotoneCompute(e,t,n="x"){const r=getValueAxis(n),o=e.length;let a,i,s,c=getPoint(e,0);for(let l=0;l<o;++l){if(i=s,s=c,c=getPoint(e,l+1),!s)continue;const o=s[n],u=s[r];i&&(a=(o-i[n])/3,s[`cp1${n}`]=o-a,s[`cp1${r}`]=u-a*t[l]),c&&(a=(c[n]-o)/3,s[`cp2${n}`]=o+a,s[`cp2${r}`]=u+a*t[l]);}}function splineCurveMonotone(e,t="x"){const n=getValueAxis(t),r=e.length,o=Array(r).fill(0),a=Array(r);let i,s,c,l=getPoint(e,0);for(i=0;i<r;++i)if(s=c,c=l,l=getPoint(e,i+1),c){if(l){const e=l[t]-c[t];o[i]=0!==e?(l[n]-c[n])/e:0;}a[i]=s?l?sign(o[i-1])!==sign(o[i])?0:(o[i-1]+o[i])/2:o[i-1]:o[i];}monotoneAdjust(e,o,a),monotoneCompute(e,a,t);}function capControlPoint(e,t,n){return Math.max(Math.min(e,n),t)}function capBezierPoints(e,t){let n,r,o,a,i,s=_isPointInArea(e[0],t);for(n=0,r=e.length;n<r;++n)i=a,a=s,s=n<r-1&&_isPointInArea(e[n+1],t),a&&(o=e[n],i&&(o.cp1x=capControlPoint(o.cp1x,t.left,t.right),o.cp1y=capControlPoint(o.cp1y,t.top,t.bottom)),s&&(o.cp2x=capControlPoint(o.cp2x,t.left,t.right),o.cp2y=capControlPoint(o.cp2y,t.top,t.bottom)));}function _updateBezierControlPoints(e,t,n,r,o){let a,i,s,c;if(t.spanGaps&&(e=e.filter((e=>!e.skip))),"monotone"===t.cubicInterpolationMode)splineCurveMonotone(e,o);else {let n=r?e[e.length-1]:e[0];for(a=0,i=e.length;a<i;++a)s=e[a],c=splineCurve(n,s,e[Math.min(a+1,i-(r?0:1))%i],t.tension),s.cp1x=c.previous.x,s.cp1y=c.previous.y,s.cp2x=c.next.x,s.cp2y=c.next.y,n=s;}t.capBezierPoints&&capBezierPoints(e,n);}function _isDomSupported(){return "undefined"!=typeof window&&"undefined"!=typeof document}function _getParentNode(e){let t=e.parentNode;return t&&"[object ShadowRoot]"===t.toString()&&(t=t.host),t}function parseMaxStyle(e,t,n){let r;return "string"==typeof e?(r=parseInt(e,10),-1!==e.indexOf("%")&&(r=r/100*t.parentNode[n])):r=e,r}const getComputedStyle=e=>window.getComputedStyle(e,null);function getStyle(e,t){return getComputedStyle(e).getPropertyValue(t)}const positions=["top","right","bottom","left"];function getPositionedStyle(e,t,n){const r={};n=n?"-"+n:"";for(let o=0;o<4;o++){const a=positions[o];r[a]=parseFloat(e[t+"-"+a+n])||0;}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const useOffsetPos=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function getCanvasPosition(e,t){const n=e.native||e,r=n.touches,o=r&&r.length?r[0]:n,{offsetX:a,offsetY:i}=o;let s,c,l=!1;if(useOffsetPos(a,i,n.target))s=a,c=i;else {const e=t.getBoundingClientRect();s=o.clientX-e.left,c=o.clientY-e.top,l=!0;}return {x:s,y:c,box:l}}function getRelativePosition$1(e,t){const{canvas:n,currentDevicePixelRatio:r}=t,o=getComputedStyle(n),a="border-box"===o.boxSizing,i=getPositionedStyle(o,"padding"),s=getPositionedStyle(o,"border","width"),{x:c,y:l,box:u}=getCanvasPosition(e,n),f=i.left+(u&&s.left),d=i.top+(u&&s.top);let{width:h,height:g}=t;return a&&(h-=i.width+s.width,g-=i.height+s.height),{x:Math.round((c-f)/h*n.width/r),y:Math.round((l-d)/g*n.height/r)}}function getContainerSize(e,t,n){let r,o;if(void 0===t||void 0===n){const a=_getParentNode(e);if(a){const e=a.getBoundingClientRect(),i=getComputedStyle(a),s=getPositionedStyle(i,"border","width"),c=getPositionedStyle(i,"padding");t=e.width-c.width-s.width,n=e.height-c.height-s.height,r=parseMaxStyle(i.maxWidth,a,"clientWidth"),o=parseMaxStyle(i.maxHeight,a,"clientHeight");}else t=e.clientWidth,n=e.clientHeight;}return {width:t,height:n,maxWidth:r||INFINITY,maxHeight:o||INFINITY}}const round1=e=>Math.round(10*e)/10;function getMaximumSize(e,t,n,r){const o=getComputedStyle(e),a=getPositionedStyle(o,"margin"),i=parseMaxStyle(o.maxWidth,e,"clientWidth")||INFINITY,s=parseMaxStyle(o.maxHeight,e,"clientHeight")||INFINITY,c=getContainerSize(e,t,n);let{width:l,height:u}=c;if("content-box"===o.boxSizing){const e=getPositionedStyle(o,"border","width"),t=getPositionedStyle(o,"padding");l-=t.width+e.width,u-=t.height+e.height;}return l=Math.max(0,l-a.width),u=Math.max(0,r?Math.floor(l/r):u-a.height),l=round1(Math.min(l,i,c.maxWidth)),u=round1(Math.min(u,s,c.maxHeight)),l&&!u&&(u=round1(l/2)),{width:l,height:u}}function retinaScale(e,t,n){const r=t||1,o=Math.floor(e.height*r),a=Math.floor(e.width*r);e.height=o/r,e.width=a/r;const i=e.canvas;return i.style&&(n||!i.style.height&&!i.style.width)&&(i.style.height=`${e.height}px`,i.style.width=`${e.width}px`),(e.currentDevicePixelRatio!==r||i.height!==o||i.width!==a)&&(e.currentDevicePixelRatio=r,i.height=o,i.width=a,e.ctx.setTransform(r,0,0,r,0,0),!0)}const supportsEventListenerOptions=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t);}catch(e){}return e}();function readUsedSize(e,t){const n=getStyle(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function _pointInLine(e,t,n,r){return {x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function _steppedInterpolation(e,t,n,r){return {x:e.x+n*(t.x-e.x),y:"middle"===r?n<.5?e.y:t.y:"after"===r?n<1?e.y:t.y:n>0?t.y:e.y}}function _bezierInterpolation(e,t,n,r){const o={x:e.cp2x,y:e.cp2y},a={x:t.cp1x,y:t.cp1y},i=_pointInLine(e,o,n),s=_pointInLine(o,a,n),c=_pointInLine(a,t,n),l=_pointInLine(i,s,n),u=_pointInLine(s,c,n);return _pointInLine(l,u,n)}const intlCache=new Map;function getNumberFormat(e,t){t=t||{};const n=e+JSON.stringify(t);let r=intlCache.get(n);return r||(r=new Intl.NumberFormat(e,t),intlCache.set(n,r)),r}function formatNumber(e,t,n){return getNumberFormat(t,n).format(e)}const getRightToLeftAdapter=function(e,t){return {x:n=>e+e+t-n,setWidth(e){t=e;},textAlign:e=>"center"===e?e:"right"===e?"left":"right",xPlus:(e,t)=>e-t,leftForLtr:(e,t)=>e-t}};function getRtlAdapter(e,t,n){return e?getRightToLeftAdapter(t,n):{x:e=>e,setWidth(e){},textAlign:e=>e,xPlus:(e,t)=>e+t,leftForLtr:(e,t)=>e}}function overrideTextDirection(e,t){let n,r;"ltr"!==t&&"rtl"!==t||(n=e.canvas.style,r=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=r);}function restoreTextDirection(e,t){void 0!==t&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]));}function propertyFn(e){return "angle"===e?{between:_angleBetween,compare:_angleDiff,normalize:_normalizeAngle}:{between:_isBetween,compare:(e,t)=>e-t,normalize:e=>e}}function normalizeSegment({start:e,end:t,count:n,loop:r,style:o}){return {start:e%n,end:t%n,loop:r&&(t-e+1)%n==0,style:o}}function getSegment(e,t,n){const{property:r,start:o,end:a}=n,{between:i,normalize:s}=propertyFn(r),c=t.length;let l,u,{start:f,end:d,loop:h}=e;if(h){for(f+=c,d+=c,l=0,u=c;l<u&&i(s(t[f%c][r]),o,a);++l)f--,d--;f%=c,d%=c;}return d<f&&(d+=c),{start:f,end:d,loop:h,style:e.style}}function _boundSegment(e,t,n){if(!n)return [e];const{property:r,start:o,end:a}=n,i=t.length,{compare:s,between:c,normalize:l}=propertyFn(r),{start:u,end:f,loop:d,style:h}=getSegment(e,t,n),g=[];let p,b,m,y=!1,_=null;const x=()=>y||c(o,m,p)&&0!==s(o,m),v=()=>!y||0===s(a,p)||c(a,m,p);for(let e=u,n=u;e<=f;++e)b=t[e%i],b.skip||(p=l(b[r]),p!==m&&(y=c(p,o,a),null===_&&x()&&(_=0===s(p,o)?e:n),null!==_&&v()&&(g.push(normalizeSegment({start:_,end:e,loop:d,count:i,style:h})),_=null),n=e,m=p));return null!==_&&g.push(normalizeSegment({start:_,end:f,loop:d,count:i,style:h})),g}function _boundSegments(e,t){const n=[],r=e.segments;for(let o=0;o<r.length;o++){const a=_boundSegment(r[o],e.points,t);a.length&&n.push(...a);}return n}function findStartAndEnd(e,t,n,r){let o=0,a=t-1;if(n&&!r)for(;o<t&&!e[o].skip;)o++;for(;o<t&&e[o].skip;)o++;for(o%=t,n&&(a+=o);a>o&&e[a%t].skip;)a--;return a%=t,{start:o,end:a}}function solidSegments(e,t,n,r){const o=e.length,a=[];let i,s=t,c=e[t];for(i=t+1;i<=n;++i){const n=e[i%o];n.skip||n.stop?c.skip||(r=!1,a.push({start:t%o,end:(i-1)%o,loop:r}),t=s=n.stop?i:null):(s=i,c.skip&&(t=i)),c=n;}return null!==s&&a.push({start:t%o,end:s%o,loop:r}),a}function _computeSegments(e,t){const n=e.points,r=e.options.spanGaps,o=n.length;if(!o)return [];const a=!!e._loop,{start:i,end:s}=findStartAndEnd(n,o,a,r);if(!0===r)return splitByStyles(e,[{start:i,end:s,loop:a}],n,t);return splitByStyles(e,solidSegments(n,i,s<i?s+o:s,!!e._fullLoop&&0===i&&s===o-1),n,t)}function splitByStyles(e,t,n,r){return r&&r.setContext&&n?doSplitByStyles(e,t,n,r):t}function doSplitByStyles(e,t,n,r){const o=e._chart.getContext(),a=readStyle(e.options),{_datasetIndex:i,options:{spanGaps:s}}=e,c=n.length,l=[];let u=a,f=t[0].start,d=f;function h(e,t,r,o){const a=s?-1:1;if(e!==t){for(e+=c;n[e%c].skip;)e-=a;for(;n[t%c].skip;)t+=a;e%c!=t%c&&(l.push({start:e%c,end:t%c,loop:r,style:o}),u=o,f=t%c);}}for(const e of t){f=s?f:e.start;let t,a=n[f%c];for(d=f+1;d<=e.end;d++){const s=n[d%c];t=readStyle(r.setContext(createContext(o,{type:"segment",p0:a,p1:s,p0DataIndex:(d-1)%c,p1DataIndex:d%c,datasetIndex:i}))),styleChanged(t,u)&&h(f,d-1,e.loop,u),a=s,u=t;}f<d-1&&h(f,d-1,e.loop,u);}return l}function readStyle(e){return {backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function styleChanged(e,t){return t&&JSON.stringify(e)!==JSON.stringify(t)}/*!
35
- * Chart.js v3.7.0
35
+ * Chart.js v3.7.1
36
36
  * https://www.chartjs.org
37
- * (c) 2021 Chart.js Contributors
37
+ * (c) 2022 Chart.js Contributors
38
38
  * Released under the MIT License
39
39
  */
40
- class Animator{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0;}_notify(t,e,i,s){const a=e.listeners[s],n=e.duration;a.forEach((s=>s({chart:t,initial:e.initial,numSteps:n,currentStep:Math.min(i-e.start,n)})));}_refresh(){this._request||(this._running=!0,this._request=requestAnimFrame.call(window,(()=>{this._update(),this._request=null,this._running&&this._refresh();})));}_update(t=Date.now()){let e=0;this._charts.forEach(((i,s)=>{if(!i.running||!i.items.length)return;const a=i.items;let n,o=a.length-1,r=!1;for(;o>=0;--o)n=a[o],n._active?(n._total>i.duration&&(i.duration=n._total),n.tick(t),r=!0):(a[o]=a[a.length-1],a.pop());r&&(s.draw(),this._notify(s,i,t,"progress")),a.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=a.length;})),this._lastDate=t,0===e&&(this._running=!1);}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i);}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e);}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce(((t,e)=>Math.max(t,e._duration)),0),this._refresh());}running(t){if(!this._running)return !1;const e=this._charts.get(t);return !!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete");}remove(t){return this._charts.delete(t)}}var animator=new Animator;const transparent="transparent",interpolators={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){const s=color(t||transparent),a=s.valid&&color(e||transparent);return a&&a.valid?a.mix(s,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class Animation{constructor(t,e,i,s){const a=e[i];s=resolve([t.to,s,a,t.from]);const n=resolve([t.from,a,s]);this._active=!0,this._fn=t.fn||interpolators[t.type||typeof n],this._easing=effects[t.easing]||effects.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=n,this._to=s,this._promises=void 0;}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const s=this._target[this._prop],a=i-this._start,n=this._duration-a;this._start=i,this._duration=Math.floor(Math.max(n,t.duration)),this._total+=a,this._loop=!!t.loop,this._to=resolve([t.to,e,s,t.from]),this._from=resolve([t.from,s,e]);}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1));}tick(t){const e=t-this._start,i=this._duration,s=this._prop,a=this._from,n=this._loop,o=this._to;let r;if(this._active=a!==o&&(n||e<i),!this._active)return this._target[s]=o,void this._notify(!0);e<0?this._target[s]=a:(r=e/i%2,r=n&&r>1?2-r:r,r=this._easing(Math.min(1,Math.max(0,r))),this._target[s]=this._fn(a,o,r));}wait(){const t=this._promises||(this._promises=[]);return new Promise(((e,i)=>{t.push({res:e,rej:i});}))}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let t=0;t<i.length;t++)i[t][e]();}}const numbers=["x","y","borderWidth","radius","tension"],colors=["color","borderColor","backgroundColor"];defaults.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});const animationOptions=Object.keys(defaults.animation);defaults.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),defaults.set("animations",{colors:{type:"color",properties:colors},numbers:{type:"number",properties:numbers}}),defaults.describe("animations",{_fallback:"animation"}),defaults.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}});class Animations{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e);}configure(t){if(!isObject(t))return;const e=this._properties;Object.getOwnPropertyNames(t).forEach((i=>{const s=t[i];if(!isObject(s))return;const a={};for(const t of animationOptions)a[t]=s[t];(isArray(s.properties)&&s.properties||[i]).forEach((t=>{t!==i&&e.has(t)||e.set(t,a);}));}));}_animateOptions(t,e){const i=e.options,s=resolveTargetOptions(t,i);if(!s)return [];const a=this._createAnimations(s,i);return i.$shared&&awaitAll(t.options.$animations,i).then((()=>{t.options=i;}),(()=>{})),a}_createAnimations(t,e){const i=this._properties,s=[],a=t.$animations||(t.$animations={}),n=Object.keys(e),o=Date.now();let r;for(r=n.length-1;r>=0;--r){const l=n[r];if("$"===l.charAt(0))continue;if("options"===l){s.push(...this._animateOptions(t,e));continue}const h=e[l];let c=a[l];const d=i.get(l);if(c){if(d&&c.active()){c.update(d,h,o);continue}c.cancel();}d&&d.duration?(a[l]=c=new Animation(d,t,l,h),s.push(c)):t[l]=h;}return s}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(animator.add(this._chart,i),!0):void 0}}function awaitAll(t,e){const i=[],s=Object.keys(e);for(let e=0;e<s.length;e++){const a=t[s[e]];a&&a.active()&&i.push(a.wait());}return Promise.all(i)}function resolveTargetOptions(t,e){if(!e)return;let i=t.options;if(i)return i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}})),i;t.options=e;}function scaleClip(t,e){const i=t&&t.options||{},s=i.reverse,a=void 0===i.min?e:0,n=void 0===i.max?e:0;return {start:s?n:a,end:s?a:n}}function defaultClip(t,e,i){if(!1===i)return !1;const s=scaleClip(t,i),a=scaleClip(e,i);return {top:a.end,right:s.end,bottom:a.start,left:s.start}}function toClip(t){let e,i,s,a;return isObject(t)?(e=t.top,i=t.right,s=t.bottom,a=t.left):e=i=s=a=t,{top:e,right:i,bottom:s,left:a,disabled:!1===t}}function getSortedDatasetIndices(t,e){const i=[],s=t._getSortedDatasetMetas(e);let a,n;for(a=0,n=s.length;a<n;++a)i.push(s[a].index);return i}function applyStack(t,e,i,s={}){const a=t.keys,n="single"===s.mode;let o,r,l,h;if(null!==e){for(o=0,r=a.length;o<r;++o){if(l=+a[o],l===i){if(s.all)continue;break}h=t.values[l],isNumberFinite(h)&&(n||0===e||sign(e)===sign(h))&&(e+=h);}return e}}function convertObjectDataToArray(t){const e=Object.keys(t),i=new Array(e.length);let s,a,n;for(s=0,a=e.length;s<a;++s)n=e[s],i[s]={x:n,y:t[n]};return i}function isStacked(t,e){const i=t&&t.options.stacked;return i||void 0===i&&void 0!==e.stack}function getStackKey(t,e,i){return `${t.id}.${e.id}.${i.stack||i.type}`}function getUserBounds(t){const{min:e,max:i,minDefined:s,maxDefined:a}=t.getUserBounds();return {min:s?e:Number.NEGATIVE_INFINITY,max:a?i:Number.POSITIVE_INFINITY}}function getOrCreateStack(t,e,i){const s=t[e]||(t[e]={});return s[i]||(s[i]={})}function getLastIndexInStack(t,e,i,s){for(const a of e.getMatchingVisibleMetas(s).reverse()){const e=t[a.index];if(i&&e>0||!i&&e<0)return a.index}return null}function updateStacks(t,e){const{chart:i,_cachedMeta:s}=t,a=i._stacks||(i._stacks={}),{iScale:n,vScale:o,index:r}=s,l=n.axis,h=o.axis,c=getStackKey(n,o,s),d=e.length;let u;for(let t=0;t<d;++t){const i=e[t],{[l]:n,[h]:d}=i;u=(i._stacks||(i._stacks={}))[h]=getOrCreateStack(a,c,n),u[r]=d,u._top=getLastIndexInStack(u,o,!0,s.type),u._bottom=getLastIndexInStack(u,o,!1,s.type);}}function getFirstScaleId(t,e){const i=t.scales;return Object.keys(i).filter((t=>i[t].axis===e)).shift()}function createDatasetContext(t,e){return createContext(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function createDataContext(t,e,i){return createContext(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:i,index:e,mode:"default",type:"data"})}function clearStacks(t,e){const i=t.controller.index,s=t.vScale&&t.vScale.axis;if(s){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[s]||void 0===e[s][i])return;delete e[s][i];}}}const isDirectUpdateMode=t=>"reset"===t||"none"===t,cloneIfNotShared=(t,e)=>e?t:Object.assign({},t),createStack=(t,e,i)=>t&&!e.hidden&&e._stacked&&{keys:getSortedDatasetIndices(i,!0),values:null};class DatasetController{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.$context=void 0,this._syncList=[],this.initialize();}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=isStacked(t.vScale,t),this.addElements();}updateIndex(t){this.index!==t&&clearStacks(this._cachedMeta),this.index=t;}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(t,e,i,s)=>"x"===t?e:"r"===t?s:i,a=e.xAxisID=valueOrDefault(i.xAxisID,getFirstScaleId(t,"x")),n=e.yAxisID=valueOrDefault(i.yAxisID,getFirstScaleId(t,"y")),o=e.rAxisID=valueOrDefault(i.rAxisID,getFirstScaleId(t,"r")),r=e.indexAxis,l=e.iAxisID=s(r,a,n,o),h=e.vAxisID=s(r,n,a,o);e.xScale=this.getScaleForId(a),e.yScale=this.getScaleForId(n),e.rScale=this.getScaleForId(o),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(h);}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset");}_destroy(){const t=this._cachedMeta;this._data&&unlistenArrayEvents(this._data,this),t._stacked&&clearStacks(t);}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(isObject(e))this._data=convertObjectDataToArray(e);else if(i!==e){if(i){unlistenArrayEvents(i,this);const t=this._cachedMeta;clearStacks(t),t._parsed=[];}e&&Object.isExtensible(e)&&listenArrayEvents(e,this),this._syncList=[],this._data=e;}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType);}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const a=e._stacked;e._stacked=isStacked(e.vScale,e),e.stack!==i.stack&&(s=!0,clearStacks(e),e.stack=i.stack),this._resyncElements(t),(s||a!==e._stacked)&&updateStacks(this,e._parsed);}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={};}parse(t,e){const{_cachedMeta:i,_data:s}=this,{iScale:a,_stacked:n}=i,o=a.axis;let r,l,h,c=0===t&&e===s.length||i._sorted,d=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=s,i._sorted=!0,h=s;else {h=isArray(s[t])?this.parseArrayData(i,s,t,e):isObject(s[t])?this.parseObjectData(i,s,t,e):this.parsePrimitiveData(i,s,t,e);const a=()=>null===l[o]||d&&l[o]<d[o];for(r=0;r<e;++r)i._parsed[r+t]=l=h[r],c&&(a()&&(c=!1),d=l);i._sorted=c;}n&&updateStacks(this,h);}parsePrimitiveData(t,e,i,s){const{iScale:a,vScale:n}=t,o=a.axis,r=n.axis,l=a.getLabels(),h=a===n,c=new Array(s);let d,u,g;for(d=0,u=s;d<u;++d)g=d+i,c[d]={[o]:h||a.parse(l[g],g),[r]:n.parse(e[g],g)};return c}parseArrayData(t,e,i,s){const{xScale:a,yScale:n}=t,o=new Array(s);let r,l,h,c;for(r=0,l=s;r<l;++r)h=r+i,c=e[h],o[r]={x:a.parse(c[0],h),y:n.parse(c[1],h)};return o}parseObjectData(t,e,i,s){const{xScale:a,yScale:n}=t,{xAxisKey:o="x",yAxisKey:r="y"}=this._parsing,l=new Array(s);let h,c,d,u;for(h=0,c=s;h<c;++h)d=h+i,u=e[d],l[h]={x:a.parse(resolveObjectKey(u,o),d),y:n.parse(resolveObjectKey(u,r),d)};return l}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const s=this.chart,a=this._cachedMeta,n=e[t.axis];return applyStack({keys:getSortedDatasetIndices(s,!0),values:e._stacks[t.axis]},n,a.index,{mode:i})}updateRangeFromParsed(t,e,i,s){const a=i[e.axis];let n=null===a?NaN:a;const o=s&&i._stacks[e.axis];s&&o&&(s.values=o,n=applyStack(s,a,this._cachedMeta.index)),t.min=Math.min(t.min,n),t.max=Math.max(t.max,n);}getMinMax(t,e){const i=this._cachedMeta,s=i._parsed,a=i._sorted&&t===i.iScale,n=s.length,o=this._getOtherScale(t),r=createStack(e,i,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:c}=getUserBounds(o);let d,u;function g(){u=s[d];const e=u[o.axis];return !isNumberFinite(u[t.axis])||h>e||c<e}for(d=0;d<n&&(g()||(this.updateRangeFromParsed(l,t,u,r),!a));++d);if(a)for(d=n-1;d>=0;--d)if(!g()){this.updateRangeFromParsed(l,t,u,r);break}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,a,n;for(s=0,a=e.length;s<a;++s)n=e[s][t.axis],isNumberFinite(n)&&i.push(n);return i}getMaxOverflow(){return !1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,s=e.vScale,a=this.getParsed(t);return {label:i?""+i.getLabelForValue(a[i.axis]):"",value:s?""+s.getLabelForValue(a[s.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=toClip(valueOrDefault(this.options.clip,defaultClip(e.xScale,e.yScale,this.getMaxOverflow())));}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,s=i.data||[],a=e.chartArea,n=[],o=this._drawStart||0,r=this._drawCount||s.length-o,l=this.options.drawActiveElementsOnTop;let h;for(i.dataset&&i.dataset.draw(t,a,o,r),h=o;h<o+r;++h){const e=s[h];e.hidden||(e.active&&l?n.push(e):e.draw(t,a));}for(h=0;h<n.length;++h)n[h].draw(t,a);}getStyle(t,e){const i=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const s=this.getDataset();let a;if(t>=0&&t<this._cachedMeta.data.length){const e=this._cachedMeta.data[t];a=e.$context||(e.$context=createDataContext(this.getContext(),t,e)),a.parsed=this.getParsed(t),a.raw=s.data[t],a.index=a.dataIndex=t;}else a=this.$context||(this.$context=createDatasetContext(this.chart.getContext(),this.index)),a.dataset=s,a.index=a.datasetIndex=this.index;return a.active=!!e,a.mode=i,a}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const s="active"===e,a=this._cachedDataOpts,n=t+"-"+e,o=a[n],r=this.enableOptionSharing&&defined(i);if(o)return cloneIfNotShared(o,r);const l=this.chart.config,h=l.datasetElementScopeKeys(this._type,t),c=s?[`${t}Hover`,"hover",t,""]:[t,""],d=l.getOptionScopes(this.getDataset(),h),u=Object.keys(defaults.elements[t]),g=l.resolveNamedOptions(d,u,(()=>this.getContext(i,s)),c);return g.$shared&&(g.$shared=r,a[n]=Object.freeze(cloneIfNotShared(g,r))),g}_resolveAnimations(t,e,i){const s=this.chart,a=this._cachedDataOpts,n=`animation-${e}`,o=a[n];if(o)return o;let r;if(!1!==s.options.animation){const s=this.chart.config,a=s.datasetAnimationScopeKeys(this._type,e),n=s.getOptionScopes(this.getDataset(),a);r=s.createResolver(n,this.getContext(t,i,e));}const l=new Animations(s,r&&r.animations);return r&&r._cacheable&&(a[n]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return !e||isDirectUpdateMode(t)||this.chart._animationsDisabled}updateElement(t,e,i,s){isDirectUpdateMode(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i);}updateSharedOptions(t,e,i){t&&!isDirectUpdateMode(e)&&this._resolveAnimations(void 0,e).update(t,i);}_setStyle(t,e,i,s){t.active=s;const a=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(a)||a});}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1);}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0);}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1);}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0);}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];const s=i.length,a=e.length,n=Math.min(a,s);n&&this.parse(0,n),a>s?this._insertElements(s,a-s,t):a<s&&this._removeElements(a,s-a);}_insertElements(t,e,i=!0){const s=this._cachedMeta,a=s.data,n=t+e;let o;const r=t=>{for(t.length+=e,o=t.length-1;o>=n;o--)t[o]=t[o-e];};for(r(a),o=t;o<n;++o)a[o]=new this.dataElementType;this._parsing&&r(s._parsed),this.parse(t,e),i&&this.updateElements(a,t,e,"reset");}updateElements(t,e,i,s){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(t,e);i._stacked&&clearStacks(i,s);}i.data.splice(t,e);}_sync(t){if(this._parsing)this._syncList.push(t);else {const[e,i,s]=t;this[e](i,s);}this.chart._dataChanges.push([this.index,...t]);}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t]);}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1]);}_onDataShift(){this._sync(["_removeElements",0,1]);}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i]);}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length]);}}function getAllScaleValues(t,e){if(!t._cache.$bar){const i=t.getMatchingVisibleMetas(e);let s=[];for(let e=0,a=i.length;e<a;e++)s=s.concat(i[e].controller.getAllParsedValues(t));t._cache.$bar=_arrayUnique(s.sort(((t,e)=>t-e)));}return t._cache.$bar}function computeMinSampleSize(t){const e=t.iScale,i=getAllScaleValues(e,t.type);let s,a,n,o,r=e._length;const l=()=>{32767!==n&&-32768!==n&&(defined(o)&&(r=Math.min(r,Math.abs(n-o)||r)),o=n);};for(s=0,a=i.length;s<a;++s)n=e.getPixelForValue(i[s]),l();for(o=void 0,s=0,a=e.ticks.length;s<a;++s)n=e.getPixelForTick(s),l();return r}function computeFitCategoryTraits(t,e,i,s){const a=i.barThickness;let n,o;return isNullOrUndef(a)?(n=e.min*i.categoryPercentage,o=i.barPercentage):(n=a*s,o=1),{chunk:n/s,ratio:o,start:e.pixels[t]-n/2}}function computeFlexCategoryTraits(t,e,i,s){const a=e.pixels,n=a[t];let o=t>0?a[t-1]:null,r=t<a.length-1?a[t+1]:null;const l=i.categoryPercentage;null===o&&(o=n-(null===r?e.end-e.start:r-n)),null===r&&(r=n+n-o);const h=n-(n-Math.min(o,r))/2*l;return {chunk:Math.abs(r-o)/2*l/s,ratio:i.barPercentage,start:h}}function parseFloatBar(t,e,i,s){const a=i.parse(t[0],s),n=i.parse(t[1],s),o=Math.min(a,n),r=Math.max(a,n);let l=o,h=r;Math.abs(o)>Math.abs(r)&&(l=r,h=o),e[i.axis]=h,e._custom={barStart:l,barEnd:h,start:a,end:n,min:o,max:r};}function parseValue(t,e,i,s){return isArray(t)?parseFloatBar(t,e,i,s):e[i.axis]=i.parse(t,s),e}function parseArrayOrPrimitive(t,e,i,s){const a=t.iScale,n=t.vScale,o=a.getLabels(),r=a===n,l=[];let h,c,d,u;for(h=i,c=i+s;h<c;++h)u=e[h],d={},d[a.axis]=r||a.parse(o[h],h),l.push(parseValue(u,d,n,h));return l}function isFloatBar(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}function barSign(t,e,i){return 0!==t?sign(t):(e.isHorizontal()?1:-1)*(e.min>=i?1:-1)}function borderProps(t){let e,i,s,a,n;return t.horizontal?(e=t.base>t.x,i="left",s="right"):(e=t.base<t.y,i="bottom",s="top"),e?(a="end",n="start"):(a="start",n="end"),{start:i,end:s,reverse:e,top:a,bottom:n}}function setBorderSkipped(t,e,i,s){let a=e.borderSkipped;const n={};if(!a)return void(t.borderSkipped=n);const{start:o,end:r,reverse:l,top:h,bottom:c}=borderProps(t);"middle"===a&&i&&(t.enableBorderRadius=!0,(i._top||0)===s?a=h:(i._bottom||0)===s?a=c:(n[parseEdge(c,o,r,l)]=!0,a=h)),n[parseEdge(a,o,r,l)]=!0,t.borderSkipped=n;}function parseEdge(t,e,i,s){return t=s?startEnd(t=swap(t,e,i),i,e):startEnd(t,e,i)}function swap(t,e,i){return t===e?i:t===i?e:t}function startEnd(t,e,i){return "start"===t?e:"end"===t?i:t}function setInflateAmount(t,{inflateAmount:e},i){t.inflateAmount="auto"===e?1===i?.33:0:e;}DatasetController.defaults={},DatasetController.prototype.datasetElementType=null,DatasetController.prototype.dataElementType=null;class BarController extends DatasetController{parsePrimitiveData(t,e,i,s){return parseArrayOrPrimitive(t,e,i,s)}parseArrayData(t,e,i,s){return parseArrayOrPrimitive(t,e,i,s)}parseObjectData(t,e,i,s){const{iScale:a,vScale:n}=t,{xAxisKey:o="x",yAxisKey:r="y"}=this._parsing,l="x"===a.axis?o:r,h="x"===n.axis?o:r,c=[];let d,u,g,p;for(d=i,u=i+s;d<u;++d)p=e[d],g={},g[a.axis]=a.parse(resolveObjectKey(p,l),d),c.push(parseValue(resolveObjectKey(p,h),g,n,d));return c}updateRangeFromParsed(t,e,i,s){super.updateRangeFromParsed(t,e,i,s);const a=i._custom;a&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,a.min),t.max=Math.max(t.max,a.max));}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:s}=e,a=this.getParsed(t),n=a._custom,o=isFloatBar(n)?"["+n.start+", "+n.end+"]":""+s.getLabelForValue(a[s.axis]);return {label:""+i.getLabelForValue(a[i.axis]),value:o}}initialize(){this.enableOptionSharing=!0,super.initialize();this._cachedMeta.stack=this.getDataset().stack;}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t);}updateElements(t,e,i,s){const a="reset"===s,{index:n,_cachedMeta:{vScale:o}}=this,r=o.getBasePixel(),l=o.isHorizontal(),h=this._getRuler(),c=this.resolveDataElementOptions(e,s),d=this.getSharedOptions(c),u=this.includeOptions(s,d);this.updateSharedOptions(d,s,c);for(let c=e;c<e+i;c++){const e=this.getParsed(c),i=a||isNullOrUndef(e[o.axis])?{base:r,head:r}:this._calculateBarValuePixels(c),g=this._calculateBarIndexPixels(c,h),p=(e._stacks||{})[o.axis],f={horizontal:l,base:i.base,enableBorderRadius:!p||isFloatBar(e._custom)||n===p._top||n===p._bottom,x:l?i.head:g.center,y:l?g.center:i.head,height:l?g.size:Math.abs(i.size),width:l?Math.abs(i.size):g.size};u&&(f.options=d||this.resolveDataElementOptions(c,t[c].active?"active":s));const m=f.options||t[c].options;setBorderSkipped(f,m,p,n),setInflateAmount(f,m,h.ratio),this.updateElement(t[c],c,f,s);}}_getStacks(t,e){const i=this._cachedMeta.iScale,s=i.getMatchingVisibleMetas(this._type),a=i.options.stacked,n=s.length,o=[];let r,l;for(r=0;r<n;++r)if(l=s[r],l.controller.options.grouped){if(void 0!==e){const t=l.controller.getParsed(e)[l.controller._cachedMeta.vScale.axis];if(isNullOrUndef(t)||isNaN(t))continue}if((!1===a||-1===o.indexOf(l.stack)||void 0===a&&void 0===l.stack)&&o.push(l.stack),l.index===t)break}return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const s=this._getStacks(t,i),a=void 0!==e?s.indexOf(e):-1;return -1===a?s.length-1:a}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,s=[];let a,n;for(a=0,n=e.data.length;a<n;++a)s.push(i.getPixelForValue(this.getParsed(a)[i.axis],a));const o=t.barThickness;return {min:o||computeMinSampleSize(e),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:o?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i},options:{base:s,minBarLength:a}}=this,n=s||0,o=this.getParsed(t),r=o._custom,l=isFloatBar(r);let h,c,d=o[e.axis],u=0,g=i?this.applyStack(e,o,i):d;g!==d&&(u=g-d,g=d),l&&(d=r.barStart,g=r.barEnd-r.barStart,0!==d&&sign(d)!==sign(r.barEnd)&&(u=0),u+=d);const p=isNullOrUndef(s)||l?u:s;let f=e.getPixelForValue(p);if(h=this.chart.getDataVisibility(t)?e.getPixelForValue(u+g):f,c=h-f,Math.abs(c)<a&&(c=barSign(c,e,n)*a,d===n&&(f-=c/2),h=f+c),f===e.getPixelForValue(n)){const t=sign(c)*e.getLineWidthForValue(n)/2;f+=t,c-=t;}return {size:c,base:f,head:h,center:h+c/2}}_calculateBarIndexPixels(t,e){const i=e.scale,s=this.options,a=s.skipNull,n=valueOrDefault(s.maxBarThickness,1/0);let o,r;if(e.grouped){const i=a?this._getStackCount(t):e.stackCount,l="flex"===s.barThickness?computeFlexCategoryTraits(t,e,s,i):computeFitCategoryTraits(t,e,s,i),h=this._getStackIndex(this.index,this._cachedMeta.stack,a?t:void 0);o=l.start+l.chunk*h+l.chunk/2,r=Math.min(n,l.chunk*l.ratio);}else o=i.getPixelForValue(this.getParsed(t)[i.axis],t),r=Math.min(n,e.min*e.ratio);return {base:o-r/2,head:o+r/2,center:o,size:r}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,s=i.length;let a=0;for(;a<s;++a)null!==this.getParsed(a)[e.axis]&&i[a].draw(this._ctx);}}BarController.id="bar",BarController.defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}},BarController.overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};class BubbleController extends DatasetController{initialize(){this.enableOptionSharing=!0,super.initialize();}parsePrimitiveData(t,e,i,s){const a=super.parsePrimitiveData(t,e,i,s);for(let t=0;t<a.length;t++)a[t]._custom=this.resolveDataElementOptions(t+i).radius;return a}parseArrayData(t,e,i,s){const a=super.parseArrayData(t,e,i,s);for(let t=0;t<a.length;t++){const s=e[i+t];a[t]._custom=valueOrDefault(s[2],this.resolveDataElementOptions(t+i).radius);}return a}parseObjectData(t,e,i,s){const a=super.parseObjectData(t,e,i,s);for(let t=0;t<a.length;t++){const s=e[i+t];a[t]._custom=valueOrDefault(s&&s.r&&+s.r,this.resolveDataElementOptions(t+i).radius);}return a}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,{xScale:i,yScale:s}=e,a=this.getParsed(t),n=i.getLabelForValue(a.x),o=s.getLabelForValue(a.y),r=a._custom;return {label:e.label,value:"("+n+", "+o+(r?", "+r:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t);}updateElements(t,e,i,s){const a="reset"===s,{iScale:n,vScale:o}=this._cachedMeta,r=this.resolveDataElementOptions(e,s),l=this.getSharedOptions(r),h=this.includeOptions(s,l),c=n.axis,d=o.axis;for(let r=e;r<e+i;r++){const e=t[r],i=!a&&this.getParsed(r),l={},u=l[c]=a?n.getPixelForDecimal(.5):n.getPixelForValue(i[c]),g=l[d]=a?o.getBasePixel():o.getPixelForValue(i[d]);l.skip=isNaN(u)||isNaN(g),h&&(l.options=this.resolveDataElementOptions(r,e.active?"active":s),a&&(l.options.radius=0)),this.updateElement(e,r,l,s);}this.updateSharedOptions(l,s,r);}resolveDataElementOptions(t,e){const i=this.getParsed(t);let s=super.resolveDataElementOptions(t,e);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const a=s.radius;return "active"!==e&&(s.radius=0),s.radius+=valueOrDefault(i&&i._custom,a),s}}function getRatioAndOffset(t,e,i){let s=1,a=1,n=0,o=0;if(e<TAU){const r=t,l=r+e,h=Math.cos(r),c=Math.sin(r),d=Math.cos(l),u=Math.sin(l),g=(t,e,s)=>_angleBetween(t,r,l,!0)?1:Math.max(e,e*i,s,s*i),p=(t,e,s)=>_angleBetween(t,r,l,!0)?-1:Math.min(e,e*i,s,s*i),f=g(0,h,d),m=g(HALF_PI,c,u),x=p(PI,h,d),b=p(PI+HALF_PI,c,u);s=(f-x)/2,a=(m-b)/2,n=-(f+x)/2,o=-(m+b)/2;}return {ratioX:s,ratioY:a,offsetX:n,offsetY:o}}BubbleController.id="bubble",BubbleController.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}},BubbleController.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title:()=>""}}}};class DoughnutController extends DatasetController{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0;}linkScales(){}parse(t,e){const i=this.getDataset().data,s=this._cachedMeta;if(!1===this._parsing)s._parsed=i;else {let a,n,o=t=>+i[t];if(isObject(i[t])){const{key:t="value"}=this._parsing;o=e=>+resolveObjectKey(i[e],t);}for(a=t,n=t+e;a<n;++a)s._parsed[a]=o(a);}}_getRotation(){return toRadians(this.options.rotation-90)}_getCircumference(){return toRadians(this.options.circumference)}_getRotationExtents(){let t=TAU,e=-TAU;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)){const s=this.chart.getDatasetMeta(i).controller,a=s._getRotation(),n=s._getCircumference();t=Math.min(t,a),e=Math.max(e,a+n);}return {rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,s=this._cachedMeta,a=s.data,n=this.getMaxBorderWidth()+this.getMaxOffset(a)+this.options.spacing,o=Math.max((Math.min(i.width,i.height)-n)/2,0),r=Math.min(toPercentage(this.options.cutout,o),1),l=this._getRingWeight(this.index),{circumference:h,rotation:c}=this._getRotationExtents(),{ratioX:d,ratioY:u,offsetX:g,offsetY:p}=getRatioAndOffset(c,h,r),f=(i.width-n)/d,m=(i.height-n)/u,x=Math.max(Math.min(f,m)/2,0),b=toDimension(this.options.radius,x),_=(b-Math.max(b*r,0))/this._getVisibleDatasetWeightTotal();this.offsetX=g*b,this.offsetY=p*b,s.total=this.calculateTotal(),this.outerRadius=b-_*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-_*l,0),this.updateElements(a,0,a.length,t);}_circumference(t,e){const i=this.options,s=this._cachedMeta,a=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===s._parsed[t]||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*a/TAU)}updateElements(t,e,i,s){const a="reset"===s,n=this.chart,o=n.chartArea,r=n.options.animation,l=(o.left+o.right)/2,h=(o.top+o.bottom)/2,c=a&&r.animateScale,d=c?0:this.innerRadius,u=c?0:this.outerRadius,g=this.resolveDataElementOptions(e,s),p=this.getSharedOptions(g),f=this.includeOptions(s,p);let m,x=this._getRotation();for(m=0;m<e;++m)x+=this._circumference(m,a);for(m=e;m<e+i;++m){const e=this._circumference(m,a),i=t[m],n={x:l+this.offsetX,y:h+this.offsetY,startAngle:x,endAngle:x+e,circumference:e,outerRadius:u,innerRadius:d};f&&(n.options=p||this.resolveDataElementOptions(m,i.active?"active":s)),x+=e,this.updateElement(i,m,n,s);}this.updateSharedOptions(p,s,g);}calculateTotal(){const t=this._cachedMeta,e=t.data;let i,s=0;for(i=0;i<e.length;i++){const a=t._parsed[i];null===a||isNaN(a)||!this.chart.getDataVisibility(i)||e[i].hidden||(s+=Math.abs(a));}return s}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?TAU*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],a=formatNumber(e._parsed[t],i.options.locale);return {label:s[t]||"",value:a}}getMaxBorderWidth(t){let e=0;const i=this.chart;let s,a,n,o,r;if(!t)for(s=0,a=i.data.datasets.length;s<a;++s)if(i.isDatasetVisible(s)){n=i.getDatasetMeta(s),t=n.data,o=n.controller;break}if(!t)return 0;for(s=0,a=t.length;s<a;++s)r=o.resolveDataElementOptions(s),"inner"!==r.borderAlign&&(e=Math.max(e,r.borderWidth||0,r.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,s=t.length;i<s;++i){const t=this.resolveDataElementOptions(i);e=Math.max(e,t.offset||0,t.hoverOffset||0);}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(valueOrDefault(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}DoughnutController.id="doughnut",DoughnutController.defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"},DoughnutController.descriptors={_scriptable:t=>"spacing"!==t,_indexable:t=>"spacing"!==t},DoughnutController.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map(((e,s)=>{const a=t.getDatasetMeta(0).controller.getStyle(s);return {text:e,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,lineWidth:a.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(s),index:s}}))}return []}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update();}},tooltip:{callbacks:{title:()=>"",label(t){let e=t.label;const i=": "+t.formattedValue;return isArray(e)?(e=e.slice(),e[0]+=i):e+=i,e}}}}};class LineController extends DatasetController{initialize(){this.enableOptionSharing=!0,super.initialize();}update(t){const e=this._cachedMeta,{dataset:i,data:s=[],_dataset:a}=e,n=this.chart._animationsDisabled;let{start:o,count:r}=getStartAndCountOfVisiblePoints(e,s,n);this._drawStart=o,this._drawCount=r,scaleRangesChanged(e)&&(o=0,r=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!a._decimated,i.points=s;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!n,options:l},t),this.updateElements(s,o,r,t);}updateElements(t,e,i,s){const a="reset"===s,{iScale:n,vScale:o,_stacked:r,_dataset:l}=this._cachedMeta,h=this.resolveDataElementOptions(e,s),c=this.getSharedOptions(h),d=this.includeOptions(s,c),u=n.axis,g=o.axis,{spanGaps:p,segment:f}=this.options,m=isNumber(p)?p:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||a||"none"===s;let b=e>0&&this.getParsed(e-1);for(let h=e;h<e+i;++h){const e=t[h],i=this.getParsed(h),p=x?e:{},_=isNullOrUndef(i[g]),y=p[u]=n.getPixelForValue(i[u],h),v=p[g]=a||_?o.getBasePixel():o.getPixelForValue(r?this.applyStack(o,i,r):i[g],h);p.skip=isNaN(y)||isNaN(v)||_,p.stop=h>0&&i[u]-b[u]>m,f&&(p.parsed=i,p.raw=l.data[h]),d&&(p.options=c||this.resolveDataElementOptions(h,e.active?"active":s)),x||this.updateElement(e,h,p,s),b=i;}this.updateSharedOptions(c,s,h);}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const a=s[0].size(this.resolveDataElementOptions(0)),n=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,a,n)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw();}}function getStartAndCountOfVisiblePoints(t,e,i){const s=e.length;let a=0,n=s;if(t._sorted){const{iScale:o,_parsed:r}=t,l=o.axis,{min:h,max:c,minDefined:d,maxDefined:u}=o.getUserBounds();d&&(a=_limitValue(Math.min(_lookupByKey(r,o.axis,h).lo,i?s:_lookupByKey(e,l,o.getPixelForValue(h)).lo),0,s-1)),n=u?_limitValue(Math.max(_lookupByKey(r,o.axis,c).hi+1,i?0:_lookupByKey(e,l,o.getPixelForValue(c)).hi+1),a,s)-a:s-a;}return {start:a,count:n}}function scaleRangesChanged(t){const{xScale:e,yScale:i,_scaleRanges:s}=t,a={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!s)return t._scaleRanges=a,!0;const n=s.xmin!==e.min||s.xmax!==e.max||s.ymin!==i.min||s.ymax!==i.max;return Object.assign(s,a),n}LineController.id="line",LineController.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},LineController.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class PolarAreaController extends DatasetController{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0;}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],a=formatNumber(e._parsed[t].r,i.options.locale);return {label:s[t]||"",value:a}}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t);}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),a=Math.max(s/2,0),n=(a-Math.max(i.cutoutPercentage?a/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=a-n*this.index,this.innerRadius=this.outerRadius-n;}updateElements(t,e,i,s){const a="reset"===s,n=this.chart,o=this.getDataset(),r=n.options.animation,l=this._cachedMeta.rScale,h=l.xCenter,c=l.yCenter,d=l.getIndexAngle(0)-.5*PI;let u,g=d;const p=360/this.countVisibleElements();for(u=0;u<e;++u)g+=this._computeAngle(u,s,p);for(u=e;u<e+i;u++){const e=t[u];let i=g,f=g+this._computeAngle(u,s,p),m=n.getDataVisibility(u)?l.getDistanceFromCenterForValue(o.data[u]):0;g=f,a&&(r.animateScale&&(m=0),r.animateRotate&&(i=f=d));const x={x:h,y:c,innerRadius:0,outerRadius:m,startAngle:i,endAngle:f,options:this.resolveDataElementOptions(u,e.active?"active":s)};this.updateElement(e,u,x,s);}}countVisibleElements(){const t=this.getDataset(),e=this._cachedMeta;let i=0;return e.data.forEach(((e,s)=>{!isNaN(t.data[s])&&this.chart.getDataVisibility(s)&&i++;})),i}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?toRadians(this.resolveDataElementOptions(t,e).angle||i):0}}PolarAreaController.id="polarArea",PolarAreaController.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},PolarAreaController.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map(((e,s)=>{const a=t.getDatasetMeta(0).controller.getStyle(s);return {text:e,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,lineWidth:a.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(s),index:s}}))}return []}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update();}},tooltip:{callbacks:{title:()=>"",label:t=>t.chart.data.labels[t.dataIndex]+": "+t.formattedValue}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class PieController extends DoughnutController{}PieController.id="pie",PieController.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class RadarController extends DatasetController{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return {label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}update(t){const e=this._cachedMeta,i=e.dataset,s=e.data||[],a=e.iScale.getLabels();if(i.points=s,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const n={_loop:!0,_fullLoop:a.length===s.length,options:e};this.updateElement(i,void 0,n,t);}this.updateElements(s,0,s.length,t);}updateElements(t,e,i,s){const a=this.getDataset(),n=this._cachedMeta.rScale,o="reset"===s;for(let r=e;r<e+i;r++){const e=t[r],i=this.resolveDataElementOptions(r,e.active?"active":s),l=n.getPointPositionForValue(r,a.data[r]),h=o?n.xCenter:l.x,c=o?n.yCenter:l.y,d={x:h,y:c,angle:l.angle,skip:isNaN(h)||isNaN(c),options:i};this.updateElement(e,r,d,s);}}}RadarController.id="radar",RadarController.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}},RadarController.overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};class ScatterController extends LineController{}ScatterController.id="scatter",ScatterController.defaults={showLine:!1,fill:!1},ScatterController.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title:()=>"",label:t=>"("+t.label+", "+t.formattedValue+")"}}},scales:{x:{type:"linear"},y:{type:"linear"}}};Object.freeze({__proto__:null,BarController:BarController,BubbleController:BubbleController,DoughnutController:DoughnutController,LineController:LineController,PolarAreaController:PolarAreaController,PieController:PieController,RadarController:RadarController,ScatterController:ScatterController});function abstract(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class DateAdapter{constructor(t){this.options=t||{};}formats(){return abstract()}parse(t,e){return abstract()}format(t,e){return abstract()}add(t,e,i){return abstract()}diff(t,e,i){return abstract()}startOf(t,e,i){return abstract()}endOf(t,e){return abstract()}}DateAdapter.override=function(t){Object.assign(DateAdapter.prototype,t);};var adapters={_date:DateAdapter};function getRelativePosition(t,e){return "native"in t?{x:t.x,y:t.y}:getRelativePosition$1(t,e)}function evaluateAllVisibleItems(t,e){const i=t.getSortedVisibleDatasetMetas();let s,a,n;for(let t=0,o=i.length;t<o;++t){({index:s,data:a}=i[t]);for(let t=0,i=a.length;t<i;++t)n=a[t],n.skip||e(n,s,t);}}function binarySearch(t,e,i,s){const{controller:a,data:n,_sorted:o}=t,r=a._cachedMeta.iScale;if(r&&e===r.axis&&"r"!==e&&o&&n.length){const t=r._reversePixels?_rlookupByKey:_lookupByKey;if(!s)return t(n,e,i);if(a._sharedOptions){const s=n[0],a="function"==typeof s.getRange&&s.getRange(e);if(a){const s=t(n,e,i-a),o=t(n,e,i+a);return {lo:s.lo,hi:o.hi}}}}return {lo:0,hi:n.length-1}}function optimizedEvaluateItems(t,e,i,s,a){const n=t.getSortedVisibleDatasetMetas(),o=i[e];for(let t=0,i=n.length;t<i;++t){const{index:i,data:r}=n[t],{lo:l,hi:h}=binarySearch(n[t],e,o,a);for(let t=l;t<=h;++t){const e=r[t];e.skip||s(e,i,t);}}}function getDistanceMetricForAxis(t){const e=-1!==t.indexOf("x"),i=-1!==t.indexOf("y");return function(t,s){const a=e?Math.abs(t.x-s.x):0,n=i?Math.abs(t.y-s.y):0;return Math.sqrt(Math.pow(a,2)+Math.pow(n,2))}}function getIntersectItems(t,e,i,s){const a=[];if(!_isPointInArea(e,t.chartArea,t._minPadding))return a;return optimizedEvaluateItems(t,i,e,(function(t,i,n){t.inRange(e.x,e.y,s)&&a.push({element:t,datasetIndex:i,index:n});}),!0),a}function getNearestRadialItems(t,e,i,s){let a=[];return optimizedEvaluateItems(t,i,e,(function(t,i,n){const{startAngle:o,endAngle:r}=t.getProps(["startAngle","endAngle"],s),{angle:l}=getAngleFromPoint(t,{x:e.x,y:e.y});_angleBetween(l,o,r)&&a.push({element:t,datasetIndex:i,index:n});})),a}function getNearestCartesianItems(t,e,i,s,a){let n=[];const o=getDistanceMetricForAxis(i);let r=Number.POSITIVE_INFINITY;return optimizedEvaluateItems(t,i,e,(function(i,l,h){const c=i.inRange(e.x,e.y,a);if(s&&!c)return;const d=i.getCenterPoint(a);if(!_isPointInArea(d,t.chartArea,t._minPadding)&&!c)return;const u=o(e,d);u<r?(n=[{element:i,datasetIndex:l,index:h}],r=u):u===r&&n.push({element:i,datasetIndex:l,index:h});})),n}function getNearestItems(t,e,i,s,a){return _isPointInArea(e,t.chartArea,t._minPadding)?"r"!==i||s?getNearestCartesianItems(t,e,i,s,a):getNearestRadialItems(t,e,i,a):[]}function getAxisItems(t,e,i,s){const a=getRelativePosition(e,t),n=[],o=i.axis,r="x"===o?"inXRange":"inYRange";let l=!1;return evaluateAllVisibleItems(t,((t,e,i)=>{t[r](a[o],s)&&n.push({element:t,datasetIndex:e,index:i}),t.inRange(a.x,a.y,s)&&(l=!0);})),i.intersect&&!l?[]:n}var Interaction={modes:{index(t,e,i,s){const a=getRelativePosition(e,t),n=i.axis||"x",o=i.intersect?getIntersectItems(t,a,n,s):getNearestItems(t,a,n,!1,s),r=[];return o.length?(t.getSortedVisibleDatasetMetas().forEach((t=>{const e=o[0].index,i=t.data[e];i&&!i.skip&&r.push({element:i,datasetIndex:t.index,index:e});})),r):[]},dataset(t,e,i,s){const a=getRelativePosition(e,t),n=i.axis||"xy";let o=i.intersect?getIntersectItems(t,a,n,s):getNearestItems(t,a,n,!1,s);if(o.length>0){const e=o[0].datasetIndex,i=t.getDatasetMeta(e).data;o=[];for(let t=0;t<i.length;++t)o.push({element:i[t],datasetIndex:e,index:t});}return o},point:(t,e,i,s)=>getIntersectItems(t,getRelativePosition(e,t),i.axis||"xy",s),nearest:(t,e,i,s)=>getNearestItems(t,getRelativePosition(e,t),i.axis||"xy",i.intersect,s),x:(t,e,i,s)=>getAxisItems(t,e,{axis:"x",intersect:i.intersect},s),y:(t,e,i,s)=>getAxisItems(t,e,{axis:"y",intersect:i.intersect},s)}};const STATIC_POSITIONS=["left","top","right","bottom"];function filterByPosition(t,e){return t.filter((t=>t.pos===e))}function filterDynamicPositionByAxis(t,e){return t.filter((t=>-1===STATIC_POSITIONS.indexOf(t.pos)&&t.box.axis===e))}function sortByWeight(t,e){return t.sort(((t,i)=>{const s=e?i:t,a=e?t:i;return s.weight===a.weight?s.index-a.index:s.weight-a.weight}))}function wrapBoxes(t){const e=[];let i,s,a,n,o,r;for(i=0,s=(t||[]).length;i<s;++i)a=t[i],({position:n,options:{stack:o,stackWeight:r=1}}=a),e.push({index:i,box:a,pos:n,horizontal:a.isHorizontal(),weight:a.weight,stack:o&&n+o,stackWeight:r});return e}function buildStacks(t){const e={};for(const i of t){const{stack:t,pos:s,stackWeight:a}=i;if(!t||!STATIC_POSITIONS.includes(s))continue;const n=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});n.count++,n.weight+=a;}return e}function setLayoutDims(t,e){const i=buildStacks(t),{vBoxMaxWidth:s,hBoxMaxHeight:a}=e;let n,o,r;for(n=0,o=t.length;n<o;++n){r=t[n];const{fullSize:o}=r.box,l=i[r.stack],h=l&&r.stackWeight/l.weight;r.horizontal?(r.width=h?h*s:o&&e.availableWidth,r.height=a):(r.width=s,r.height=h?h*a:o&&e.availableHeight);}return i}function buildLayoutBoxes(t){const e=wrapBoxes(t),i=sortByWeight(e.filter((t=>t.box.fullSize)),!0),s=sortByWeight(filterByPosition(e,"left"),!0),a=sortByWeight(filterByPosition(e,"right")),n=sortByWeight(filterByPosition(e,"top"),!0),o=sortByWeight(filterByPosition(e,"bottom")),r=filterDynamicPositionByAxis(e,"x"),l=filterDynamicPositionByAxis(e,"y");return {fullSize:i,leftAndTop:s.concat(n),rightAndBottom:a.concat(l).concat(o).concat(r),chartArea:filterByPosition(e,"chartArea"),vertical:s.concat(a).concat(l),horizontal:n.concat(o).concat(r)}}function getCombinedMax(t,e,i,s){return Math.max(t[i],e[i])+Math.max(t[s],e[s])}function updateMaxPadding(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right);}function updateDims(t,e,i,s){const{pos:a,box:n}=i,o=t.maxPadding;if(!isObject(a)){i.size&&(t[a]-=i.size);const e=s[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?n.height:n.width),i.size=e.size/e.count,t[a]+=i.size;}n.getPadding&&updateMaxPadding(o,n.getPadding());const r=Math.max(0,e.outerWidth-getCombinedMax(o,t,"left","right")),l=Math.max(0,e.outerHeight-getCombinedMax(o,t,"top","bottom")),h=r!==t.w,c=l!==t.h;return t.w=r,t.h=l,i.horizontal?{same:h,other:c}:{same:c,other:h}}function handleMaxPadding(t){const e=t.maxPadding;function i(i){const s=Math.max(e[i]-t[i],0);return t[i]+=s,s}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom");}function getMargins(t,e){const i=e.maxPadding;function s(t){const s={left:0,top:0,right:0,bottom:0};return t.forEach((t=>{s[t]=Math.max(e[t],i[t]);})),s}return s(t?["left","right"]:["top","bottom"])}function fitBoxes(t,e,i,s){const a=[];let n,o,r,l,h,c;for(n=0,o=t.length,h=0;n<o;++n){r=t[n],l=r.box,l.update(r.width||e.w,r.height||e.h,getMargins(r.horizontal,e));const{same:o,other:d}=updateDims(e,i,r,s);h|=o&&a.length,c=c||d,l.fullSize||a.push(r);}return h&&fitBoxes(a,e,i,s)||c}function setBoxDims(t,e,i,s,a){t.top=i,t.left=e,t.right=e+s,t.bottom=i+a,t.width=s,t.height=a;}function placeBoxes(t,e,i,s){const a=i.padding;let{x:n,y:o}=e;for(const r of t){const t=r.box,l=s[r.stack]||{count:1,placed:0,weight:1},h=r.stackWeight/l.weight||1;if(r.horizontal){const s=e.w*h,n=l.size||t.height;defined(l.start)&&(o=l.start),t.fullSize?setBoxDims(t,a.left,o,i.outerWidth-a.right-a.left,n):setBoxDims(t,e.left+l.placed,o,s,n),l.start=o,l.placed+=s,o=t.bottom;}else {const s=e.h*h,o=l.size||t.width;defined(l.start)&&(n=l.start),t.fullSize?setBoxDims(t,n,a.top,o,i.outerHeight-a.bottom-a.top):setBoxDims(t,n,e.top+l.placed,o,s),l.start=n,l.placed+=s,n=t.right;}}e.x=n,e.y=o;}defaults.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}});var layouts={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return [{z:0,draw(t){e.draw(t);}}]},t.boxes.push(e);},removeBox(t,e){const i=t.boxes?t.boxes.indexOf(e):-1;-1!==i&&t.boxes.splice(i,1);},configure(t,e,i){e.fullSize=i.fullSize,e.position=i.position,e.weight=i.weight;},update(t,e,i,s){if(!t)return;const a=toPadding(t.options.layout.padding),n=Math.max(e-a.width,0),o=Math.max(i-a.height,0),r=buildLayoutBoxes(t.boxes),l=r.vertical,h=r.horizontal;each(t.boxes,(t=>{"function"==typeof t.beforeLayout&&t.beforeLayout();}));const c=l.reduce(((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1),0)||1,d=Object.freeze({outerWidth:e,outerHeight:i,padding:a,availableWidth:n,availableHeight:o,vBoxMaxWidth:n/2/c,hBoxMaxHeight:o/2}),u=Object.assign({},a);updateMaxPadding(u,toPadding(s));const g=Object.assign({maxPadding:u,w:n,h:o,x:a.left,y:a.top},a),p=setLayoutDims(l.concat(h),d);fitBoxes(r.fullSize,g,d,p),fitBoxes(l,g,d,p),fitBoxes(h,g,d,p)&&fitBoxes(l,g,d,p),handleMaxPadding(g),placeBoxes(r.leftAndTop,g,d,p),g.x+=g.w,g.y+=g.h,placeBoxes(r.rightAndBottom,g,d,p),t.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},each(r.chartArea,(e=>{const i=e.box;Object.assign(i,t.chartArea),i.update(g.w,g.h,{left:0,top:0,right:0,bottom:0});}));}};class BasePlatform{acquireContext(t,e){}releaseContext(t){return !1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return !0}updateConfig(t){}}class BasicPlatform extends BasePlatform{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1;}}const EVENT_TYPES={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},isNullOrEmpty=t=>null===t||""===t;function initCanvas(t,e){const i=t.style,s=t.getAttribute("height"),a=t.getAttribute("width");if(t.$chartjs={initial:{height:s,width:a,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",isNullOrEmpty(a)){const e=readUsedSize(t,"width");void 0!==e&&(t.width=e);}if(isNullOrEmpty(s))if(""===t.style.height)t.height=t.width/(e||2);else {const e=readUsedSize(t,"height");void 0!==e&&(t.height=e);}return t}const eventListenerOptions=!!supportsEventListenerOptions&&{passive:!0};function addListener(t,e,i){t.addEventListener(e,i,eventListenerOptions);}function removeListener(t,e,i){t.canvas.removeEventListener(e,i,eventListenerOptions);}function fromNativeEvent(t,e){const i=EVENT_TYPES[t.type]||t.type,{x:s,y:a}=getRelativePosition$1(t,e);return {type:i,chart:e,native:t,x:void 0!==s?s:null,y:void 0!==a?a:null}}function nodeListContains(t,e){for(const i of t)if(i===e||i.contains(e))return !0}function createAttachObserver(t,e,i){const s=t.canvas,a=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||nodeListContains(i.addedNodes,s),e=e&&!nodeListContains(i.removedNodes,s);e&&i();}));return a.observe(document,{childList:!0,subtree:!0}),a}function createDetachObserver(t,e,i){const s=t.canvas,a=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||nodeListContains(i.removedNodes,s),e=e&&!nodeListContains(i.addedNodes,s);e&&i();}));return a.observe(document,{childList:!0,subtree:!0}),a}const drpListeningCharts=new Map;let oldDevicePixelRatio=0;function onWindowResize(){const t=window.devicePixelRatio;t!==oldDevicePixelRatio&&(oldDevicePixelRatio=t,drpListeningCharts.forEach(((e,i)=>{i.currentDevicePixelRatio!==t&&e();})));}function listenDevicePixelRatioChanges(t,e){drpListeningCharts.size||window.addEventListener("resize",onWindowResize),drpListeningCharts.set(t,e);}function unlistenDevicePixelRatioChanges(t){drpListeningCharts.delete(t),drpListeningCharts.size||window.removeEventListener("resize",onWindowResize);}function createResizeObserver(t,e,i){const s=t.canvas,a=s&&_getParentNode(s);if(!a)return;const n=throttled(((t,e)=>{const s=a.clientWidth;i(t,e),s<a.clientWidth&&i();}),window),o=new ResizeObserver((t=>{const e=t[0],i=e.contentRect.width,s=e.contentRect.height;0===i&&0===s||n(i,s);}));return o.observe(a),listenDevicePixelRatioChanges(t,n),o}function releaseObserver(t,e,i){i&&i.disconnect(),"resize"===e&&unlistenDevicePixelRatioChanges(t);}function createProxyAndListen(t,e,i){const s=t.canvas,a=throttled((e=>{null!==t.ctx&&i(fromNativeEvent(e,t));}),t,(t=>{const e=t[0];return [e,e.offsetX,e.offsetY]}));return addListener(s,e,a),a}class DomPlatform extends BasePlatform{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(initCanvas(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e.$chartjs)return !1;const i=e.$chartjs.initial;["height","width"].forEach((t=>{const s=i[t];isNullOrUndef(s)?e.removeAttribute(t):e.setAttribute(t,s);}));const s=i.style||{};return Object.keys(s).forEach((t=>{e.style[t]=s[t];})),e.width=e.width,delete e.$chartjs,!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),a={attach:createAttachObserver,detach:createDetachObserver,resize:createResizeObserver}[e]||createProxyAndListen;s[e]=a(t,e,i);}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;(({attach:releaseObserver,detach:releaseObserver,resize:releaseObserver})[e]||removeListener)(t,e,s),i[e]=void 0;}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return getMaximumSize(t,e,i,s)}isAttached(t){const e=_getParentNode(t);return !(!e||!e.isConnected)}}function _detectPlatform(t){return !_isDomSupported()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?BasicPlatform:DomPlatform}class Element$1{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0;}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return {x:e,y:i}}hasValue(){return isNumber(this.x)&&isNumber(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const s={};return t.forEach((t=>{s[t]=i[t]&&i[t].active()?i[t]._to:this[t];})),s}}Element$1.defaults={},Element$1.defaultRoutes=void 0;const formatters={values:t=>isArray(t)?t:""+t,numeric(t,e,i){if(0===t)return "0";const s=this.chart.options.locale;let a,n=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(a="scientific"),n=calculateDelta(t,i);}const o=log10(Math.abs(n)),r=Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:a,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(l,this.options.ticks.format),formatNumber(t,s,l)},logarithmic(t,e,i){if(0===t)return "0";const s=t/Math.pow(10,Math.floor(log10(t)));return 1===s||2===s||5===s?formatters.numeric.call(this,t,e,i):""}};function calculateDelta(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t)),i}var Ticks={formatters:formatters};function autoSkip(t,e){const i=t.options.ticks,s=i.maxTicksLimit||determineMaxTicks(t),a=i.major.enabled?getMajorIndices(e):[],n=a.length,o=a[0],r=a[n-1],l=[];if(n>s)return skipMajors(e,l,a,n/s),l;const h=calculateSpacing(a,e,s);if(n>0){let t,i;const s=n>1?Math.round((r-o)/(n-1)):null;for(skip(e,l,h,isNullOrUndef(s)?0:o-s,o),t=0,i=n-1;t<i;t++)skip(e,l,h,a[t],a[t+1]);return skip(e,l,h,r,isNullOrUndef(s)?e.length:r+s),l}return skip(e,l,h),l}function determineMaxTicks(t){const e=t.options.offset,i=t._tickSize(),s=t._length/i+(e?0:1),a=t._maxLength/i;return Math.floor(Math.min(s,a))}function calculateSpacing(t,e,i){const s=getEvenSpacing(t),a=e.length/i;if(!s)return Math.max(a,1);const n=_factorize(s);for(let t=0,e=n.length-1;t<e;t++){const e=n[t];if(e>a)return e}return Math.max(a,1)}function getMajorIndices(t){const e=[];let i,s;for(i=0,s=t.length;i<s;i++)t[i].major&&e.push(i);return e}function skipMajors(t,e,i,s){let a,n=0,o=i[0];for(s=Math.ceil(s),a=0;a<t.length;a++)a===o&&(e.push(t[a]),n++,o=i[n*s]);}function skip(t,e,i,s,a){const n=valueOrDefault(s,0),o=Math.min(valueOrDefault(a,t.length),t.length);let r,l,h,c=0;for(i=Math.ceil(i),a&&(r=a-s,i=r/Math.floor(r/i)),h=n;h<0;)c++,h=Math.round(n+c*i);for(l=Math.max(n,0);l<o;l++)l===h&&(e.push(t[l]),c++,h=Math.round(n+c*i));}function getEvenSpacing(t){const e=t.length;let i,s;if(e<2)return !1;for(s=t[0],i=1;i<e;++i)if(t[i]-t[i-1]!==s)return !1;return s}defaults.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Ticks.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),defaults.route("scale.ticks","color","","color"),defaults.route("scale.grid","color","","borderColor"),defaults.route("scale.grid","borderColor","","borderColor"),defaults.route("scale.title","color","","color"),defaults.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t}),defaults.describe("scales",{_fallback:"scale"}),defaults.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t});const reverseAlign=t=>"left"===t?"right":"right"===t?"left":t,offsetFromEdge=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i;function sample(t,e){const i=[],s=t.length/e,a=t.length;let n=0;for(;n<a;n+=s)i.push(t[Math.floor(n)]);return i}function getPixelForGridLine(t,e,i){const s=t.ticks.length,a=Math.min(e,s-1),n=t._startPixel,o=t._endPixel,r=1e-6;let l,h=t.getPixelForTick(a);if(!(i&&(l=1===s?Math.max(h-n,o-h):0===e?(t.getPixelForTick(1)-h)/2:(h-t.getPixelForTick(a-1))/2,h+=a<e?l:-l,h<n-r||h>o+r)))return h}function garbageCollect(t,e){each(t,(t=>{const i=t.gc,s=i.length/2;let a;if(s>e){for(a=0;a<s;++a)delete t.data[i[a]];i.splice(0,s);}}));}function getTickMarkLength(t){return t.drawTicks?t.tickLength:0}function getTitleHeight(t,e){if(!t.display)return 0;const i=toFont(t.font,e),s=toPadding(t.padding);return (isArray(t.text)?t.text.length:1)*i.lineHeight+s.height}function createScaleContext(t,e){return createContext(t,{scale:e,type:"scale"})}function createTickContext(t,e,i){return createContext(t,{tick:i,index:e,type:"tick"})}function titleAlign(t,e,i){let s=_toLeftRightCenter(t);return (i&&"right"!==e||!i&&"right"===e)&&(s=reverseAlign(s)),s}function titleArgs(t,e,i,s){const{top:a,left:n,bottom:o,right:r,chart:l}=t,{chartArea:h,scales:c}=l;let d,u,g,p=0;const f=o-a,m=r-n;if(t.isHorizontal()){if(u=_alignStartEnd(s,n,r),isObject(i)){const t=Object.keys(i)[0],s=i[t];g=c[t].getPixelForValue(s)+f-e;}else g="center"===i?(h.bottom+h.top)/2+f-e:offsetFromEdge(t,i,e);d=r-n;}else {if(isObject(i)){const t=Object.keys(i)[0],s=i[t];u=c[t].getPixelForValue(s)-m+e;}else u="center"===i?(h.left+h.right)/2-m+e:offsetFromEdge(t,i,e);g=_alignStartEnd(s,o,a),p="left"===i?-HALF_PI:HALF_PI;}return {titleX:u,titleY:g,maxWidth:d,rotation:p}}class Scale extends Element$1{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0;}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax);}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:s}=this;return t=finiteOrDefault(t,Number.POSITIVE_INFINITY),e=finiteOrDefault(e,Number.NEGATIVE_INFINITY),i=finiteOrDefault(i,Number.POSITIVE_INFINITY),s=finiteOrDefault(s,Number.NEGATIVE_INFINITY),{min:finiteOrDefault(t,i),max:finiteOrDefault(e,s),minDefined:isNumberFinite(t),maxDefined:isNumberFinite(e)}}getMinMax(t){let e,{min:i,max:s,minDefined:a,maxDefined:n}=this.getUserBounds();if(a&&n)return {min:i,max:s};const o=this.getMatchingVisibleMetas();for(let r=0,l=o.length;r<l;++r)e=o[r].controller.getMinMax(this,t),a||(i=Math.min(i,e.min)),n||(s=Math.max(s,e.max));return i=n&&i>s?s:i,s=a&&i>s?i:s,{min:finiteOrDefault(i,finiteOrDefault(s,i)),max:finiteOrDefault(s,finiteOrDefault(i,s))}}getPadding(){return {left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1;}beforeUpdate(){callback(this.options.beforeUpdate,[this]);}update(t,e,i){const{beginAtZero:s,grace:a,ticks:n}=this.options,o=n.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=_addGrace(this,a,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const r=o<this.ticks.length;this._convertTicksToLabels(r?sample(this.ticks,o):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),n.display&&(n.autoSkip||"auto"===n.source)&&(this.ticks=autoSkip(this,this.ticks),this._labelSizes=null),r&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate();}configure(){let t,e,i=this.options.reverse;this.isHorizontal()?(t=this.left,e=this.right):(t=this.top,e=this.bottom,i=!i),this._startPixel=t,this._endPixel=e,this._reversePixels=i,this._length=e-t,this._alignToPixels=this.options.alignToPixels;}afterUpdate(){callback(this.options.afterUpdate,[this]);}beforeSetDimensions(){callback(this.options.beforeSetDimensions,[this]);}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0;}afterSetDimensions(){callback(this.options.afterSetDimensions,[this]);}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),callback(this.options[t],[this]);}beforeDataLimits(){this._callHooks("beforeDataLimits");}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits");}beforeBuildTicks(){this._callHooks("beforeBuildTicks");}buildTicks(){return []}afterBuildTicks(){this._callHooks("afterBuildTicks");}beforeTickToLabelConversion(){callback(this.options.beforeTickToLabelConversion,[this]);}generateTickLabels(t){const e=this.options.ticks;let i,s,a;for(i=0,s=t.length;i<s;i++)a=t[i],a.label=callback(e.callback,[a.value,i,t],this);}afterTickToLabelConversion(){callback(this.options.afterTickToLabelConversion,[this]);}beforeCalculateLabelRotation(){callback(this.options.beforeCalculateLabelRotation,[this]);}calculateLabelRotation(){const t=this.options,e=t.ticks,i=this.ticks.length,s=e.minRotation||0,a=e.maxRotation;let n,o,r,l=s;if(!this._isVisible()||!e.display||s>=a||i<=1||!this.isHorizontal())return void(this.labelRotation=s);const h=this._getLabelSizes(),c=h.widest.width,d=h.highest.height,u=_limitValue(this.chart.width-c,0,this.maxWidth);n=t.offset?this.maxWidth/i:u/(i-1),c+6>n&&(n=u/(i-(t.offset?.5:1)),o=this.maxHeight-getTickMarkLength(t.grid)-e.padding-getTitleHeight(t.title,this.chart.options.font),r=Math.sqrt(c*c+d*d),l=toDegrees(Math.min(Math.asin(_limitValue((h.highest.height+6)/n,-1,1)),Math.asin(_limitValue(o/r,-1,1))-Math.asin(_limitValue(d/r,-1,1)))),l=Math.max(s,Math.min(a,l))),this.labelRotation=l;}afterCalculateLabelRotation(){callback(this.options.afterCalculateLabelRotation,[this]);}beforeFit(){callback(this.options.beforeFit,[this]);}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:a}}=this,n=this._isVisible(),o=this.isHorizontal();if(n){const n=getTitleHeight(s,e.options.font);if(o?(t.width=this.maxWidth,t.height=getTickMarkLength(a)+n):(t.height=this.maxHeight,t.width=getTickMarkLength(a)+n),i.display&&this.ticks.length){const{first:e,last:s,widest:a,highest:n}=this._getLabelSizes(),r=2*i.padding,l=toRadians(this.labelRotation),h=Math.cos(l),c=Math.sin(l);if(o){const e=i.mirror?0:c*a.width+h*n.height;t.height=Math.min(this.maxHeight,t.height+e+r);}else {const e=i.mirror?0:h*a.width+c*n.height;t.width=Math.min(this.maxWidth,t.width+e+r);}this._calculatePadding(e,s,c,h);}}this._handleMargins(),o?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom);}_calculatePadding(t,e,i,s){const{ticks:{align:a,padding:n},position:o}=this.options,r=0!==this.labelRotation,l="top"!==o&&"x"===this.axis;if(this.isHorizontal()){const o=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1);let c=0,d=0;r?l?(c=s*t.width,d=i*e.height):(c=i*t.height,d=s*e.width):"start"===a?d=e.width:"end"===a?c=t.width:(c=t.width/2,d=e.width/2),this.paddingLeft=Math.max((c-o+n)*this.width/(this.width-o),0),this.paddingRight=Math.max((d-h+n)*this.width/(this.width-h),0);}else {let i=e.height/2,s=t.height/2;"start"===a?(i=0,s=t.height):"end"===a&&(i=e.height,s=0),this.paddingTop=i+n,this.paddingBottom=s+n;}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom));}afterFit(){callback(this.options.afterFit,[this]);}isHorizontal(){const{axis:t,position:e}=this.options;return "top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e<i;e++)isNullOrUndef(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion();}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=sample(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length);}return t}_computeLabelSizes(t,e){const{ctx:i,_longestTextCache:s}=this,a=[],n=[];let o,r,l,h,c,d,u,g,p,f,m,x=0,b=0;for(o=0;o<e;++o){if(h=t[o].label,c=this._resolveTickFontOptions(o),i.font=d=c.string,u=s[d]=s[d]||{data:{},gc:[]},g=c.lineHeight,p=f=0,isNullOrUndef(h)||isArray(h)){if(isArray(h))for(r=0,l=h.length;r<l;++r)m=h[r],isNullOrUndef(m)||isArray(m)||(p=_measureText(i,u.data,u.gc,p,m),f+=g);}else p=_measureText(i,u.data,u.gc,p,h),f=g;a.push(p),n.push(f),x=Math.max(p,x),b=Math.max(f,b);}garbageCollect(s,e);const _=a.indexOf(x),y=n.indexOf(b),v=t=>({width:a[t]||0,height:n[t]||0});return {first:v(0),last:v(e-1),widest:v(_),highest:v(y),widths:a,heights:n}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return _int16Range(this._alignToPixels?_alignPixel(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=createTickContext(this.getContext(),t,i))}return this.$context||(this.$context=createScaleContext(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=toRadians(this.labelRotation),i=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),a=this._getLabelSizes(),n=t.autoSkipPadding||0,o=a?a.widest.width+n:0,r=a?a.highest.height+n:0;return this.isHorizontal()?r*i>o*s?o/i:r/s:r*s<o*i?r/i:o/s}_isVisible(){const t=this.options.display;return "auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,s=this.options,{grid:a,position:n}=s,o=a.offset,r=this.isHorizontal(),l=this.ticks.length+(o?1:0),h=getTickMarkLength(a),c=[],d=a.setContext(this.getContext()),u=d.drawBorder?d.borderWidth:0,g=u/2,p=function(t){return _alignPixel(i,t,u)};let f,m,x,b,_,y,v,S,k,M,P,D;if("top"===n)f=p(this.bottom),y=this.bottom-h,S=f-g,M=p(t.top)+g,D=t.bottom;else if("bottom"===n)f=p(this.top),M=t.top,D=p(t.bottom)-g,y=f+g,S=this.top+h;else if("left"===n)f=p(this.right),_=this.right-h,v=f-g,k=p(t.left)+g,P=t.right;else if("right"===n)f=p(this.left),k=t.left,P=p(t.right)-g,_=f+g,v=this.left+h;else if("x"===e){if("center"===n)f=p((t.top+t.bottom)/2+.5);else if(isObject(n)){const t=Object.keys(n)[0],e=n[t];f=p(this.chart.scales[t].getPixelForValue(e));}M=t.top,D=t.bottom,y=f+g,S=y+h;}else if("y"===e){if("center"===n)f=p((t.left+t.right)/2);else if(isObject(n)){const t=Object.keys(n)[0],e=n[t];f=p(this.chart.scales[t].getPixelForValue(e));}_=f-g,v=_-h,k=t.left,P=t.right;}const w=valueOrDefault(s.ticks.maxTicksLimit,l),C=Math.max(1,Math.ceil(l/w));for(m=0;m<l;m+=C){const t=a.setContext(this.getContext(m)),e=t.lineWidth,s=t.color,n=a.borderDash||[],l=t.borderDashOffset,h=t.tickWidth,d=t.tickColor,u=t.tickBorderDash||[],g=t.tickBorderDashOffset;x=getPixelForGridLine(this,m,o),void 0!==x&&(b=_alignPixel(i,x,e),r?_=v=k=P=b:y=S=M=D=b,c.push({tx1:_,ty1:y,tx2:v,ty2:S,x1:k,y1:M,x2:P,y2:D,width:e,color:s,borderDash:n,borderDashOffset:l,tickWidth:h,tickColor:d,tickBorderDash:u,tickBorderDashOffset:g}));}return this._ticksLength=l,this._borderValue=f,c}_computeLabelItems(t){const e=this.axis,i=this.options,{position:s,ticks:a}=i,n=this.isHorizontal(),o=this.ticks,{align:r,crossAlign:l,padding:h,mirror:c}=a,d=getTickMarkLength(i.grid),u=d+h,g=c?-h:u,p=-toRadians(this.labelRotation),f=[];let m,x,b,_,y,v,S,k,M,P,D,w,C="middle";if("top"===s)v=this.bottom-g,S=this._getXAxisLabelAlignment();else if("bottom"===s)v=this.top+g,S=this._getXAxisLabelAlignment();else if("left"===s){const t=this._getYAxisLabelAlignment(d);S=t.textAlign,y=t.x;}else if("right"===s){const t=this._getYAxisLabelAlignment(d);S=t.textAlign,y=t.x;}else if("x"===e){if("center"===s)v=(t.top+t.bottom)/2+u;else if(isObject(s)){const t=Object.keys(s)[0],e=s[t];v=this.chart.scales[t].getPixelForValue(e)+u;}S=this._getXAxisLabelAlignment();}else if("y"===e){if("center"===s)y=(t.left+t.right)/2-u;else if(isObject(s)){const t=Object.keys(s)[0],e=s[t];y=this.chart.scales[t].getPixelForValue(e);}S=this._getYAxisLabelAlignment(d).textAlign;}"y"===e&&("start"===r?C="top":"end"===r&&(C="bottom"));const A=this._getLabelSizes();for(m=0,x=o.length;m<x;++m){b=o[m],_=b.label;const t=a.setContext(this.getContext(m));k=this.getPixelForTick(m)+a.labelOffset,M=this._resolveTickFontOptions(m),P=M.lineHeight,D=isArray(_)?_.length:1;const e=D/2,i=t.color,r=t.textStrokeColor,h=t.textStrokeWidth;let d;if(n?(y=k,w="top"===s?"near"===l||0!==p?-D*P+P/2:"center"===l?-A.highest.height/2-e*P+P:-A.highest.height+P/2:"near"===l||0!==p?P/2:"center"===l?A.highest.height/2-e*P:A.highest.height-D*P,c&&(w*=-1)):(v=k,w=(1-D)*P/2),t.showLabelBackdrop){const e=toPadding(t.backdropPadding),i=A.heights[m],s=A.widths[m];let a=v+w-e.top,n=y-e.left;switch(C){case"middle":a-=i/2;break;case"bottom":a-=i;}switch(S){case"center":n-=s/2;break;case"right":n-=s;}d={left:n,top:a,width:s+e.width,height:i+e.height,color:t.backdropColor};}f.push({rotation:p,label:_,font:M,color:i,strokeColor:r,strokeWidth:h,textOffset:w,textAlign:S,textBaseline:C,translation:[y,v],backdrop:d});}return f}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-toRadians(this.labelRotation))return "top"===t?"left":"right";let i="center";return "start"===e.align?i="left":"end"===e.align&&(i="right"),i}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:s,padding:a}}=this.options,n=t+a,o=this._getLabelSizes().widest.width;let r,l;return "left"===e?s?(l=this.right+a,"near"===i?r="left":"center"===i?(r="center",l+=o/2):(r="right",l+=o)):(l=this.right-n,"near"===i?r="right":"center"===i?(r="center",l-=o/2):(r="left",l=this.left)):"right"===e?s?(l=this.left+a,"near"===i?r="right":"center"===i?(r="center",l-=o/2):(r="left",l-=o)):(l=this.left+n,"near"===i?r="left":"center"===i?(r="center",l+=o/2):(r="right",l=this.right)):r="right",{textAlign:r,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;return "left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:s,width:a,height:n}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,a,n),t.restore());}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const i=this.ticks.findIndex((e=>e.value===t));if(i>=0){return e.setContext(this.getContext(i)).lineWidth}return 0}drawGrid(t){const e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let a,n;const o=(t,e,s)=>{s.width&&s.color&&(i.save(),i.lineWidth=s.width,i.strokeStyle=s.color,i.setLineDash(s.borderDash||[]),i.lineDashOffset=s.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore());};if(e.display)for(a=0,n=s.length;a<n;++a){const t=s[a];e.drawOnChartArea&&o({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),e.drawTicks&&o({x:t.tx1,y:t.ty1},{x:t.tx2,y:t.ty2},{color:t.tickColor,width:t.tickWidth,borderDash:t.tickBorderDash,borderDashOffset:t.tickBorderDashOffset});}}drawBorder(){const{chart:t,ctx:e,options:{grid:i}}=this,s=i.setContext(this.getContext()),a=i.drawBorder?s.borderWidth:0;if(!a)return;const n=i.setContext(this.getContext(0)).lineWidth,o=this._borderValue;let r,l,h,c;this.isHorizontal()?(r=_alignPixel(t,this.left,a)-a/2,l=_alignPixel(t,this.right,n)+n/2,h=c=o):(h=_alignPixel(t,this.top,a)-a/2,c=_alignPixel(t,this.bottom,n)+n/2,r=l=o),e.save(),e.lineWidth=s.borderWidth,e.strokeStyle=s.borderColor,e.beginPath(),e.moveTo(r,h),e.lineTo(l,c),e.stroke(),e.restore();}drawLabels(t){if(!this.options.ticks.display)return;const e=this.ctx,i=this._computeLabelArea();i&&clipArea(e,i);const s=this._labelItems||(this._labelItems=this._computeLabelItems(t));let a,n;for(a=0,n=s.length;a<n;++a){const t=s[a],i=t.font,n=t.label;t.backdrop&&(e.fillStyle=t.backdrop.color,e.fillRect(t.backdrop.left,t.backdrop.top,t.backdrop.width,t.backdrop.height));let o=t.textOffset;renderText(e,n,0,o,i,t);}i&&unclipArea(e);}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:s}}=this;if(!i.display)return;const a=toFont(i.font),n=toPadding(i.padding),o=i.align;let r=a.lineHeight/2;"bottom"===e||"center"===e||isObject(e)?(r+=n.bottom,isArray(i.text)&&(r+=a.lineHeight*(i.text.length-1))):r+=n.top;const{titleX:l,titleY:h,maxWidth:c,rotation:d}=titleArgs(this,r,e,o);renderText(t,i.text,0,0,a,{color:i.color,maxWidth:c,rotation:d,textAlign:titleAlign(o,e,s),textBaseline:"middle",translation:[l,h]});}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t));}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=valueOrDefault(t.grid&&t.grid.z,-1);return this._isVisible()&&this.draw===Scale.prototype.draw?[{z:i,draw:t=>{this.drawBackground(),this.drawGrid(t),this.drawTitle();}},{z:i+1,draw:()=>{this.drawBorder();}},{z:e,draw:t=>{this.drawLabels(t);}}]:[{z:e,draw:t=>{this.draw(t);}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let a,n;for(a=0,n=e.length;a<n;++a){const n=e[a];n[i]!==this.id||t&&n.type!==t||s.push(n);}return s}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return toFont(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return (this.isHorizontal()?this.width:this.height)/t}}class TypedRegistry{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null);}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let i;isIChartComponent(e)&&(i=this.register(e));const s=this.items,a=t.id,n=this.scope+"."+a;if(!a)throw new Error("class does not have id: "+t);return a in s||(s[a]=t,registerDefaults(t,n,i),this.override&&defaults.override(t.id,t.overrides)),n}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,s=this.scope;i in e&&delete e[i],s&&i in defaults[s]&&(delete defaults[s][i],this.override&&delete overrides[i]);}}function registerDefaults(t,e,i){const s=merge(Object.create(null),[i?defaults.get(i):{},defaults.get(e),t.defaults]);defaults.set(e,s),t.defaultRoutes&&routeDefaults(e,t.defaultRoutes),t.descriptors&&defaults.describe(e,t.descriptors);}function routeDefaults(t,e){Object.keys(e).forEach((i=>{const s=i.split("."),a=s.pop(),n=[t].concat(s).join("."),o=e[i].split("."),r=o.pop(),l=o.join(".");defaults.route(n,a,l,r);}));}function isIChartComponent(t){return "id"in t&&"defaults"in t}class Registry{constructor(){this.controllers=new TypedRegistry(DatasetController,"datasets",!0),this.elements=new TypedRegistry(Element$1,"elements"),this.plugins=new TypedRegistry(Object,"plugins"),this.scales=new TypedRegistry(Scale,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements];}add(...t){this._each("register",t);}remove(...t){this._each("unregister",t);}addControllers(...t){this._each("register",t,this.controllers);}addElements(...t){this._each("register",t,this.elements);}addPlugins(...t){this._each("register",t,this.plugins);}addScales(...t){this._each("register",t,this.scales);}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers);}removeElements(...t){this._each("unregister",t,this.elements);}removePlugins(...t){this._each("unregister",t,this.plugins);}removeScales(...t){this._each("unregister",t,this.scales);}_each(t,e,i){[...e].forEach((e=>{const s=i||this._getRegistryForType(e);i||s.isForType(e)||s===this.plugins&&e.id?this._exec(t,s,e):each(e,(e=>{const s=i||this._getRegistryForType(e);this._exec(t,s,e);}));}));}_exec(t,e,i){const s=_capitalize(t);callback(i["before"+s],[],i),e[t](i),callback(i["after"+s],[],i);}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const s=e.get(t);if(void 0===s)throw new Error('"'+t+'" is not a registered '+i+".");return s}}var registry=new Registry;class PluginService{constructor(){this._init=[];}notify(t,e,i,s){"beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const a=s?this._descriptors(t).filter(s):this._descriptors(t),n=this._notify(a,t,e,i);return "afterDestroy"===e&&(this._notify(a,t,"stop"),this._notify(this._init,t,"uninstall")),n}_notify(t,e,i,s){s=s||{};for(const a of t){const t=a.plugin,n=t[i],o=[e,s,a.options];if(!1===callback(n,o,t)&&s.cancelable)return !1}return !0}invalidate(){isNullOrUndef(this._cache)||(this._oldCache=this._cache,this._cache=void 0);}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,s=valueOrDefault(i.options&&i.options.plugins,{}),a=allPlugins(i);return !1!==s||e?createDescriptors(t,a,s,e):[]}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,s=(t,e)=>t.filter((t=>!e.some((e=>t.plugin.id===e.plugin.id))));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start");}}function allPlugins(t){const e=[],i=Object.keys(registry.plugins.items);for(let t=0;t<i.length;t++)e.push(registry.getPlugin(i[t]));const s=t.plugins||[];for(let t=0;t<s.length;t++){const i=s[t];-1===e.indexOf(i)&&e.push(i);}return e}function getOpts(t,e){return e||!1!==t?!0===t?{}:t:null}function createDescriptors(t,e,i,s){const a=[],n=t.getContext();for(let o=0;o<e.length;o++){const r=e[o],l=getOpts(i[r.id],s);null!==l&&a.push({plugin:r,options:pluginOpts(t.config,r,l,n)});}return a}function pluginOpts(t,e,i,s){const a=t.pluginScopeKeys(e),n=t.getOptionScopes(i,a);return t.createResolver(n,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function getIndexAxis(t,e){const i=defaults.datasets[t]||{};return ((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function getAxisFromDefaultScaleID(t,e){let i=t;return "_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}function getDefaultScaleIDFromAxis(t,e){return t===e?"_index_":"_value_"}function axisFromPosition(t){return "top"===t||"bottom"===t?"x":"left"===t||"right"===t?"y":void 0}function determineAxis(t,e){return "x"===t||"y"===t?t:e.axis||axisFromPosition(e.position)||t.charAt(0).toLowerCase()}function mergeScaleConfig(t,e){const i=overrides[t.type]||{scales:{}},s=e.scales||{},a=getIndexAxis(t.type,e),n=Object.create(null),o=Object.create(null);return Object.keys(s).forEach((t=>{const e=s[t];if(!isObject(e))return console.error(`Invalid scale configuration for scale: ${t}`);if(e._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${t}`);const r=determineAxis(t,e),l=getDefaultScaleIDFromAxis(r,a),h=i.scales||{};n[r]=n[r]||t,o[t]=mergeIf(Object.create(null),[{axis:r},e,h[r],h[l]]);})),t.data.datasets.forEach((i=>{const a=i.type||t.type,r=i.indexAxis||getIndexAxis(a,e),l=(overrides[a]||{}).scales||{};Object.keys(l).forEach((t=>{const e=getAxisFromDefaultScaleID(t,r),a=i[e+"AxisID"]||n[e]||e;o[a]=o[a]||Object.create(null),mergeIf(o[a],[{axis:e},s[a],l[t]]);}));})),Object.keys(o).forEach((t=>{const e=o[t];mergeIf(e,[defaults.scales[e.type],defaults.scale]);})),o}function initOptions(t){const e=t.options||(t.options={});e.plugins=valueOrDefault(e.plugins,{}),e.scales=mergeScaleConfig(t,e);}function initData(t){return (t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}function initConfig(t){return (t=t||{}).data=initData(t.data),initOptions(t),t}const keyCache=new Map,keysCached=new Set;function cachedKeys(t,e){let i=keyCache.get(t);return i||(i=e(),keyCache.set(t,i),keysCached.add(i)),i}const addIfFound=(t,e,i)=>{const s=resolveObjectKey(e,i);void 0!==s&&t.add(s);};class Config{constructor(t){this._config=initConfig(t),this._scopeCache=new Map,this._resolverCache=new Map;}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t;}get data(){return this._config.data}set data(t){this._config.data=initData(t);}get options(){return this._config.options}set options(t){this._config.options=t;}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),initOptions(t);}clearCache(){this._scopeCache.clear(),this._resolverCache.clear();}datasetScopeKeys(t){return cachedKeys(t,(()=>[[`datasets.${t}`,""]]))}datasetAnimationScopeKeys(t,e){return cachedKeys(`${t}.transition.${e}`,(()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]]))}datasetElementScopeKeys(t,e){return cachedKeys(`${t}-${e}`,(()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]]))}pluginScopeKeys(t){const e=t.id;return cachedKeys(`${this.type}-plugin-${e}`,(()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]]))}_cachedScopes(t,e){const i=this._scopeCache;let s=i.get(t);return s&&!e||(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){const{options:s,type:a}=this,n=this._cachedScopes(t,i),o=n.get(e);if(o)return o;const r=new Set;e.forEach((e=>{t&&(r.add(t),e.forEach((e=>addIfFound(r,t,e)))),e.forEach((t=>addIfFound(r,s,t))),e.forEach((t=>addIfFound(r,overrides[a]||{},t))),e.forEach((t=>addIfFound(r,defaults,t))),e.forEach((t=>addIfFound(r,descriptors,t)));}));const l=Array.from(r);return 0===l.length&&l.push(Object.create(null)),keysCached.has(e)&&n.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return [t,overrides[e]||{},defaults.datasets[e]||{},{type:e},defaults,descriptors]}resolveNamedOptions(t,e,i,s=[""]){const a={$shared:!0},{resolver:n,subPrefixes:o}=getResolver(this._resolverCache,t,s);let r=n;if(needContext(n,e)){a.$shared=!1,i=isFunction(i)?i():i;const e=this.createResolver(t,i,o);r=_attachContext(n,i,e);}for(const t of e)a[t]=r[t];return a}createResolver(t,e,i=[""],s){const{resolver:a}=getResolver(this._resolverCache,t,i);return isObject(e)?_attachContext(a,e,void 0,s):a}}function getResolver(t,e,i){let s=t.get(e);s||(s=new Map,t.set(e,s));const a=i.join();let n=s.get(a);if(!n){n={resolver:_createResolver(e,i),subPrefixes:i.filter((t=>!t.toLowerCase().includes("hover")))},s.set(a,n);}return n}const hasFunction=t=>isObject(t)&&Object.getOwnPropertyNames(t).reduce(((e,i)=>e||isFunction(t[i])),!1);function needContext(t,e){const{isScriptable:i,isIndexable:s}=_descriptors(t);for(const a of e){const e=i(a),n=s(a),o=(n||e)&&t[a];if(e&&(isFunction(o)||hasFunction(o))||n&&isArray(o))return !0}return !1}var version="3.7.0";const KNOWN_POSITIONS=["top","bottom","left","right","chartArea"];function positionIsHorizontal(t,e){return "top"===t||"bottom"===t||-1===KNOWN_POSITIONS.indexOf(t)&&"x"===e}function compare2Level(t,e){return function(i,s){return i[t]===s[t]?i[e]-s[e]:i[t]-s[t]}}function onAnimationsComplete(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),callback(i&&i.onComplete,[t],e);}function onAnimationProgress(t){const e=t.chart,i=e.options.animation;callback(i&&i.onProgress,[t],e);}function getCanvas(t){return _isDomSupported()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const instances={},getChart=t=>{const e=getCanvas(t);return Object.values(instances).filter((t=>t.canvas===e)).pop()};function moveNumericKeys(t,e,i){const s=Object.keys(t);for(const a of s){const s=+a;if(s>=e){const n=t[a];delete t[a],(i>0||s>e)&&(t[s+i]=n);}}}function determineLastEvent(t,e,i,s){return i&&"mouseout"!==t.type?s?e:t:null}class Chart{constructor(t,e){const i=this.config=new Config(e),s=getCanvas(t),a=getChart(s);if(a)throw new Error("Canvas is already in use. Chart with ID '"+a.id+"' must be destroyed before the canvas can be reused.");const n=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||_detectPlatform(s)),this.platform.updateConfig(i);const o=this.platform.acquireContext(s,n.aspectRatio),r=o&&o.canvas,l=r&&r.height,h=r&&r.width;this.id=uid(),this.ctx=o,this.canvas=r,this.width=h,this.height=l,this._options=n,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new PluginService,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=debounce((t=>this.update(t)),n.resizeDelay||0),this._dataChanges=[],instances[this.id]=this,o&&r?(animator.listen(this,"complete",onAnimationsComplete),animator.listen(this,"progress",onAnimationProgress),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item");}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:a}=this;return isNullOrUndef(t)?e&&a?a:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t;}get options(){return this._options}set options(t){this.config.options=t;}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():retinaScale(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return clearCanvas(this.canvas,this.ctx),this}stop(){return animator.stop(this),this}resize(t,e){animator.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e);}_resize(t,e){const i=this.options,s=this.canvas,a=i.maintainAspectRatio&&this.aspectRatio,n=this.platform.getMaximumSize(s,t,e,a),o=i.devicePixelRatio||this.platform.getDevicePixelRatio(),r=this.width?"resize":"attach";this.width=n.width,this.height=n.height,this._aspectRatio=this.aspectRatio,retinaScale(this,o,!0)&&(this.notifyPlugins("resize",{size:n}),callback(i.onResize,[this,n],this),this.attached&&this._doResize(r)&&this.render());}ensureScalesHaveIDs(){const t=this.options.scales||{};each(t,((t,e)=>{t.id=e;}));}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce(((t,e)=>(t[e]=!1,t)),{});let a=[];e&&(a=a.concat(Object.keys(e).map((t=>{const i=e[t],s=determineAxis(t,i),a="r"===s,n="x"===s;return {options:i,dposition:a?"chartArea":n?"bottom":"left",dtype:a?"radialLinear":n?"category":"linear"}})))),each(a,(e=>{const a=e.options,n=a.id,o=determineAxis(n,a),r=valueOrDefault(a.type,e.dtype);void 0!==a.position&&positionIsHorizontal(a.position,o)===positionIsHorizontal(e.dposition)||(a.position=e.dposition),s[n]=!0;let l=null;if(n in i&&i[n].type===r)l=i[n];else {l=new(registry.getScale(r))({id:n,type:r,ctx:this.ctx,chart:this}),i[l.id]=l;}l.init(a,t);})),each(s,((t,e)=>{t||delete i[e];})),each(i,(t=>{layouts.configure(this,t,t.options),layouts.addBox(this,t);}));}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort(((t,e)=>t.index-e.index)),i>e){for(let t=e;t<i;++t)this._destroyDatasetMeta(t);t.splice(e,i-e);}this._sortedMetasets=t.slice(0).sort(compare2Level("order","index"));}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach(((t,i)=>{0===e.filter((e=>e===t._dataset)).length&&this._destroyDatasetMeta(i);}));}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i<s;i++){const s=e[i];let a=this.getDatasetMeta(i);const n=s.type||this.config.type;if(a.type&&a.type!==n&&(this._destroyDatasetMeta(i),a=this.getDatasetMeta(i)),a.type=n,a.indexAxis=s.indexAxis||getIndexAxis(n,this.options),a.order=s.order||0,a.index=i,a.label=""+s.label,a.visible=this.isDatasetVisible(i),a.controller)a.controller.updateIndex(i),a.controller.linkScales();else {const e=registry.getController(n),{datasetElementType:s,dataElementType:o}=defaults.datasets[n];Object.assign(e.prototype,{dataElementType:registry.getElement(o),datasetElementType:s&&registry.getElement(s)}),a.controller=new e(this,i),t.push(a.controller);}}return this._updateMetasets(),t}_resetElements(){each(this.data.datasets,((t,e)=>{this.getDatasetMeta(e).controller.reset();}),this);}reset(){this._resetElements(),this.notifyPlugins("reset");}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const a=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let n=0;for(let t=0,e=this.data.datasets.length;t<e;t++){const{controller:e}=this.getDatasetMeta(t),i=!s&&-1===a.indexOf(e);e.buildOrUpdateElements(i),n=Math.max(+e.getMaxOverflow(),n);}n=this._minPadding=i.layout.autoPadding?n:0,this._updateLayout(n),s||each(a,(t=>{t.reset();})),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(compare2Level("z","_idx"));const{_active:o,_lastEvent:r}=this;r?this._eventHandler(r,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render();}_updateScales(){each(this.scales,(t=>{layouts.removeBox(this,t);})),this.ensureScalesHaveIDs(),this.buildOrUpdateScales();}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);setsEqual(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents());}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:a}of e){moveNumericKeys(t,s,"_removeElements"===i?-a:a);}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=e=>new Set(t.filter((t=>t[0]===e)).map(((t,e)=>e+","+t.splice(1).join(",")))),s=i(0);for(let t=1;t<e;t++)if(!setsEqual(s,i(t)))return;return Array.from(s).map((t=>t.split(","))).map((t=>({method:t[1],start:+t[2],count:+t[3]})))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;layouts.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],each(this.boxes,(t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()));}),this),this._layers.forEach(((t,e)=>{t._idx=e;})),this.notifyPlugins("afterLayout");}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t<e;++t)this.getDatasetMeta(t).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,isFunction(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t});}}_updateDataset(t,e){const i=this.getDatasetMeta(t),s={meta:i,index:t,mode:e,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",s)&&(i.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s));}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(animator.has(this)?this.attached&&!animator.running(this)&&animator.start(this):(this.draw(),onAnimationsComplete({chart:this})));}draw(){let t;if(this._resizeBeforeDraw){const{width:t,height:e}=this._resizeBeforeDraw;this._resize(t,e),this._resizeBeforeDraw=null;}if(this.clear(),this.width<=0||this.height<=0)return;if(!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw");}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let s,a;for(s=0,a=e.length;s<a;++s){const a=e[s];t&&!a.visible||i.push(a);}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw");}_drawDataset(t){const e=this.ctx,i=t._clip,s=!i.disabled,a=this.chartArea,n={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",n)&&(s&&clipArea(e,{left:!1===i.left?0:a.left-i.left,right:!1===i.right?this.width:a.right+i.right,top:!1===i.top?0:a.top-i.top,bottom:!1===i.bottom?this.height:a.bottom+i.bottom}),t.controller.draw(),s&&unclipArea(e),n.cancelable=!1,this.notifyPlugins("afterDatasetDraw",n));}getElementsAtEventForMode(t,e,i,s){const a=Interaction.modes[e];return "function"==typeof a?a(this,t,i,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let s=i.filter((t=>t&&t._dataset===e)).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=createContext(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return !1;const i=this.getDatasetMeta(t);return "boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e;}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t];}getDataVisibility(t){return !this._hiddenIndices[t]}_updateVisibility(t,e,i){const s=i?"show":"hide",a=this.getDatasetMeta(t),n=a.controller._resolveAnimations(void 0,s);defined(e)?(a.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),n.update(a,{visible:i}),this.update((e=>e.datasetIndex===t?s:void 0)));}hide(t,e){this._updateVisibility(t,e,!1);}show(t,e){this._updateVisibility(t,e,!0);}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t];}_stop(){let t,e;for(this.stop(),animator.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t);}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),clearCanvas(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),this.notifyPlugins("destroy"),delete instances[this.id],this.notifyPlugins("afterDestroy");}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0;}bindUserEvents(){const t=this._listeners,e=this.platform,i=(i,s)=>{e.addEventListener(this,i,s),t[i]=s;},s=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t);};each(this.options.events,(t=>i(t,s)));}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,s)=>{e.addEventListener(this,i,s),t[i]=s;},s=(i,s)=>{t[i]&&(e.removeEventListener(this,i,s),delete t[i]);},a=(t,e)=>{this.canvas&&this.resize(t,e);};let n;const o=()=>{s("attach",o),this.attached=!0,this.resize(),i("resize",a),i("detach",n);};n=()=>{this.attached=!1,s("resize",a),this._stop(),this._resize(0,0),i("attach",o);},e.isAttached(this.canvas)?o():n();}unbindEvents(){each(this._listeners,((t,e)=>{this.platform.removeEventListener(this,e,t);})),this._listeners={},each(this._responsiveListeners,((t,e)=>{this.platform.removeEventListener(this,e,t);})),this._responsiveListeners=void 0;}updateHoverStyle(t,e,i){const s=i?"set":"remove";let a,n,o,r;for("dataset"===e&&(a=this.getDatasetMeta(t[0].datasetIndex),a.controller["_"+s+"DatasetHoverStyle"]()),o=0,r=t.length;o<r;++o){n=t[o];const e=n&&this.getDatasetMeta(n.datasetIndex).controller;e&&e[s+"HoverStyle"](n.element,n.datasetIndex,n.index);}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map((({datasetIndex:t,index:e})=>{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return {datasetIndex:t,element:i.data[e],index:e}}));!_elementsEqual(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e));}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}_updateHoverStyles(t,e,i){const s=this.options.hover,a=(t,e)=>t.filter((t=>!e.some((e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)))),n=a(e,t),o=i?t:a(t,e);n.length&&this.updateHoverStyle(n,s.mode,!1),o.length&&s.mode&&this.updateHoverStyle(o,s.mode,!0);}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:_isPointInArea(t,this.chartArea,this._minPadding)},s=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,s))return;const a=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(a||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:s=[],options:a}=this,n=e,o=this._getActiveElements(t,s,i,n),r=_isClickEvent(t),l=determineLastEvent(t,this._lastEvent,i,r);i&&(this._lastEvent=null,callback(a.onHover,[t,o,this],this),r&&callback(a.onClick,[t,o,this],this));const h=!_elementsEqual(o,s);return (h||e)&&(this._active=o,this._updateHoverStyles(o,s,e)),this._lastEvent=l,h}_getActiveElements(t,e,i,s){if("mouseout"===t.type)return [];if(!i)return e;const a=this.options.hover;return this.getElementsAtEventForMode(t,a.mode,a,s)}}const invalidatePlugins=()=>each(Chart.instances,(t=>t._plugins.invalidate()));function clipArc(t,e,i){const{startAngle:s,pixelMargin:a,x:n,y:o,outerRadius:r,innerRadius:l}=e;let h=a/r;t.beginPath(),t.arc(n,o,r,s-h,i+h),l>a?(h=a/l,t.arc(n,o,l,i+h,s-h,!0)):t.arc(n,o,a,i+HALF_PI,s-HALF_PI),t.closePath(),t.clip();}function toRadiusCorners(t){return _readValueToProps(t,["outerStart","outerEnd","innerStart","innerEnd"])}function parseBorderRadius$1(t,e,i,s){const a=toRadiusCorners(t.options.borderRadius),n=(i-e)/2,o=Math.min(n,s*e/2),r=t=>{const e=(i-Math.min(n,t))*s/2;return _limitValue(t,0,Math.min(n,e))};return {outerStart:r(a.outerStart),outerEnd:r(a.outerEnd),innerStart:_limitValue(a.innerStart,0,o),innerEnd:_limitValue(a.innerEnd,0,o)}}function rThetaToXY(t,e,i,s){return {x:i+t*Math.cos(e),y:s+t*Math.sin(e)}}function pathArc(t,e,i,s,a){const{x:n,y:o,startAngle:r,pixelMargin:l,innerRadius:h}=e,c=Math.max(e.outerRadius+s+i-l,0),d=h>0?h+s+i+l:0;let u=0;const g=a-r;if(s){const t=((h>0?h-s:0)+(c>0?c-s:0))/2;u=(g-(0!==t?g*t/(t+s):g))/2;}const p=(g-Math.max(.001,g*c-i/PI)/c)/2,f=r+p+u,m=a-p-u,{outerStart:x,outerEnd:b,innerStart:_,innerEnd:y}=parseBorderRadius$1(e,d,c,m-f),v=c-x,S=c-b,k=f+x/v,M=m-b/S,P=d+_,D=d+y,w=f+_/P,C=m-y/D;if(t.beginPath(),t.arc(n,o,c,k,M),b>0){const e=rThetaToXY(S,M,n,o);t.arc(e.x,e.y,b,M,m+HALF_PI);}const A=rThetaToXY(D,m,n,o);if(t.lineTo(A.x,A.y),y>0){const e=rThetaToXY(D,C,n,o);t.arc(e.x,e.y,y,m+HALF_PI,C+Math.PI);}if(t.arc(n,o,d,m-y/d,f+_/d,!0),_>0){const e=rThetaToXY(P,w,n,o);t.arc(e.x,e.y,_,w+Math.PI,f-HALF_PI);}const L=rThetaToXY(v,f,n,o);if(t.lineTo(L.x,L.y),x>0){const e=rThetaToXY(v,k,n,o);t.arc(e.x,e.y,x,f-HALF_PI,k);}t.closePath();}function drawArc(t,e,i,s){const{fullCircles:a,startAngle:n,circumference:o}=e;let r=e.endAngle;if(a){pathArc(t,e,i,s,n+TAU);for(let e=0;e<a;++e)t.fill();isNaN(o)||(r=n+o%TAU,o%TAU==0&&(r+=TAU));}return pathArc(t,e,i,s,r),t.fill(),r}function drawFullCircleBorders(t,e,i){const{x:s,y:a,startAngle:n,pixelMargin:o,fullCircles:r}=e,l=Math.max(e.outerRadius-o,0),h=e.innerRadius+o;let c;for(i&&clipArc(t,e,n+TAU),t.beginPath(),t.arc(s,a,h,n+TAU,n,!0),c=0;c<r;++c)t.stroke();for(t.beginPath(),t.arc(s,a,l,n,n+TAU),c=0;c<r;++c)t.stroke();}function drawBorder(t,e,i,s,a){const{options:n}=e,{borderWidth:o,borderJoinStyle:r}=n,l="inner"===n.borderAlign;o&&(l?(t.lineWidth=2*o,t.lineJoin=r||"round"):(t.lineWidth=o,t.lineJoin=r||"bevel"),e.fullCircles&&drawFullCircleBorders(t,e,l),l&&clipArc(t,e,a),pathArc(t,e,i,s,a),t.stroke());}Object.defineProperties(Chart,{defaults:{enumerable:true,value:defaults},instances:{enumerable:true,value:instances},overrides:{enumerable:true,value:overrides},registry:{enumerable:true,value:registry},version:{enumerable:true,value:version},getChart:{enumerable:true,value:getChart},register:{enumerable:true,value:(...t)=>{registry.add(...t),invalidatePlugins();}},unregister:{enumerable:true,value:(...t)=>{registry.remove(...t),invalidatePlugins();}}});class ArcElement extends Element$1{constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t);}inRange(t,e,i){const s=this.getProps(["x","y"],i),{angle:a,distance:n}=getAngleFromPoint(s,{x:t,y:e}),{startAngle:o,endAngle:r,innerRadius:l,outerRadius:h,circumference:c}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),d=this.options.spacing/2,u=valueOrDefault(c,r-o)>=TAU||_angleBetween(a,o,r),g=_isBetween(n,l+d,h+d);return u&&g}getCenterPoint(t){const{x:e,y:i,startAngle:s,endAngle:a,innerRadius:n,outerRadius:o}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:r,spacing:l}=this.options,h=(s+a)/2,c=(n+o+l+r)/2;return {x:e+Math.cos(h)*c,y:i+Math.sin(h)*c}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,s=(e.offset||0)/2,a=(e.spacing||0)/2;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>TAU?Math.floor(i/TAU):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();let n=0;if(s){n=s/2;const e=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(e)*n,Math.sin(e)*n),this.circumference>=PI&&(n=s);}t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor;drawBorder(t,this,n,a,drawArc(t,this,n,a)),t.restore();}}function setStyle(t,e,i=e){t.lineCap=valueOrDefault(i.borderCapStyle,e.borderCapStyle),t.setLineDash(valueOrDefault(i.borderDash,e.borderDash)),t.lineDashOffset=valueOrDefault(i.borderDashOffset,e.borderDashOffset),t.lineJoin=valueOrDefault(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=valueOrDefault(i.borderWidth,e.borderWidth),t.strokeStyle=valueOrDefault(i.borderColor,e.borderColor);}function lineTo(t,e,i){t.lineTo(i.x,i.y);}function getLineMethod(t){return t.stepped?_steppedLineTo:t.tension||"monotone"===t.cubicInterpolationMode?_bezierCurveTo:lineTo}function pathVars(t,e,i={}){const s=t.length,{start:a=0,end:n=s-1}=i,{start:o,end:r}=e,l=Math.max(a,o),h=Math.min(n,r),c=a<o&&n<o||a>r&&n>r;return {count:s,start:l,loop:e.loop,ilen:h<l&&!c?s+h-l:h-l}}function pathSegment(t,e,i,s){const{points:a,options:n}=e,{count:o,start:r,loop:l,ilen:h}=pathVars(a,i,s),c=getLineMethod(n);let d,u,g,{move:p=!0,reverse:f}=s||{};for(d=0;d<=h;++d)u=a[(r+(f?h-d:d))%o],u.skip||(p?(t.moveTo(u.x,u.y),p=!1):c(t,g,u,f,n.stepped),g=u);return l&&(u=a[(r+(f?h:0))%o],c(t,g,u,f,n.stepped)),!!l}function fastPathSegment(t,e,i,s){const a=e.points,{count:n,start:o,ilen:r}=pathVars(a,i,s),{move:l=!0,reverse:h}=s||{};let c,d,u,g,p,f,m=0,x=0;const b=t=>(o+(h?r-t:t))%n,_=()=>{g!==p&&(t.lineTo(m,p),t.lineTo(m,g),t.lineTo(m,f));};for(l&&(d=a[b(0)],t.moveTo(d.x,d.y)),c=0;c<=r;++c){if(d=a[b(c)],d.skip)continue;const e=d.x,i=d.y,s=0|e;s===u?(i<g?g=i:i>p&&(p=i),m=(x*m+e)/++x):(_(),t.lineTo(e,i),u=s,x=0,g=p=i),f=i;}_();}function _getSegmentMethod(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return !(t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i)?fastPathSegment:pathSegment}function _getInterpolationMethod(t){return t.stepped?_steppedInterpolation:t.tension||"monotone"===t.cubicInterpolationMode?_bezierInterpolation:_pointInLine}function strokePathWithCache(t,e,i,s){let a=e._path;a||(a=e._path=new Path2D,e.path(a,i,s)&&a.closePath()),setStyle(t,e.options),t.stroke(a);}function strokePathDirect(t,e,i,s){const{segments:a,options:n}=e,o=_getSegmentMethod(e);for(const r of a)setStyle(t,n,r.style),t.beginPath(),o(t,e,r,{start:i,end:i+s-1})&&t.closePath(),t.stroke();}ArcElement.id="arc",ArcElement.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0},ArcElement.defaultRoutes={backgroundColor:"backgroundColor"};const usePath2D="function"==typeof Path2D;function draw(t,e,i,s){usePath2D&&!e.options.segment?strokePathWithCache(t,e,i,s):strokePathDirect(t,e,i,s);}class LineElement extends Element$1{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t);}updateControlPoints(t,e){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;_updateBezierControlPoints(this._points,i,t,s,e),this._pointsUpdated=!0;}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1;}get points(){return this._points}get segments(){return this._segments||(this._segments=_computeSegments(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,s=t[e],a=this.points,n=_boundSegments(this,{property:e,start:s,end:s});if(!n.length)return;const o=[],r=_getInterpolationMethod(i);let l,h;for(l=0,h=n.length;l<h;++l){const{start:h,end:c}=n[l],d=a[h],u=a[c];if(d===u){o.push(d);continue}const g=r(d,u,Math.abs((s-d[e])/(u[e]-d[e])),i.stepped);g[e]=t[e],o.push(g);}return 1===o.length?o[0]:o}pathSegment(t,e,i){return _getSegmentMethod(this)(t,this,e,i)}path(t,e,i){const s=this.segments,a=_getSegmentMethod(this);let n=this._loop;e=e||0,i=i||this.points.length-e;for(const o of s)n&=a(t,this,o,{start:e,end:e+i-1});return !!n}draw(t,e,i,s){const a=this.options||{};(this.points||[]).length&&a.borderWidth&&(t.save(),draw(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0);}}function inRange$1(t,e,i,s){const a=t.options,{[i]:n}=t.getProps([i],s);return Math.abs(e-n)<a.radius+a.hitRadius}LineElement.id="line",LineElement.defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0},LineElement.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"},LineElement.descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};class PointElement extends Element$1{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t);}inRange(t,e,i){const s=this.options,{x:a,y:n}=this.getProps(["x","y"],i);return Math.pow(t-a,2)+Math.pow(e-n,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,e){return inRange$1(this,t,"x",e)}inYRange(t,e){return inRange$1(this,t,"y",e)}getCenterPoint(t){const{x:e,y:i}=this.getProps(["x","y"],t);return {x:e,y:i}}size(t){let e=(t=t||this.options||{}).radius||0;e=Math.max(e,e&&t.hoverRadius||0);return 2*(e+(e&&t.borderWidth||0))}draw(t,e){const i=this.options;this.skip||i.radius<.1||!_isPointInArea(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,drawPoint(t,i,this.x,this.y));}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function getBarBounds(t,e){const{x:i,y:s,base:a,width:n,height:o}=t.getProps(["x","y","base","width","height"],e);let r,l,h,c,d;return t.horizontal?(d=o/2,r=Math.min(i,a),l=Math.max(i,a),h=s-d,c=s+d):(d=n/2,r=i-d,l=i+d,h=Math.min(s,a),c=Math.max(s,a)),{left:r,top:h,right:l,bottom:c}}function skipOrLimit(t,e,i,s){return t?0:_limitValue(e,i,s)}function parseBorderWidth(t,e,i){const s=t.options.borderWidth,a=t.borderSkipped,n=toTRBL(s);return {t:skipOrLimit(a.top,n.top,0,i),r:skipOrLimit(a.right,n.right,0,e),b:skipOrLimit(a.bottom,n.bottom,0,i),l:skipOrLimit(a.left,n.left,0,e)}}function parseBorderRadius(t,e,i){const{enableBorderRadius:s}=t.getProps(["enableBorderRadius"]),a=t.options.borderRadius,n=toTRBLCorners(a),o=Math.min(e,i),r=t.borderSkipped,l=s||isObject(a);return {topLeft:skipOrLimit(!l||r.top||r.left,n.topLeft,0,o),topRight:skipOrLimit(!l||r.top||r.right,n.topRight,0,o),bottomLeft:skipOrLimit(!l||r.bottom||r.left,n.bottomLeft,0,o),bottomRight:skipOrLimit(!l||r.bottom||r.right,n.bottomRight,0,o)}}function boundingRects(t){const e=getBarBounds(t),i=e.right-e.left,s=e.bottom-e.top,a=parseBorderWidth(t,i/2,s/2),n=parseBorderRadius(t,i/2,s/2);return {outer:{x:e.left,y:e.top,w:i,h:s,radius:n},inner:{x:e.left+a.l,y:e.top+a.t,w:i-a.l-a.r,h:s-a.t-a.b,radius:{topLeft:Math.max(0,n.topLeft-Math.max(a.t,a.l)),topRight:Math.max(0,n.topRight-Math.max(a.t,a.r)),bottomLeft:Math.max(0,n.bottomLeft-Math.max(a.b,a.l)),bottomRight:Math.max(0,n.bottomRight-Math.max(a.b,a.r))}}}}function inRange(t,e,i,s){const a=null===e,n=null===i,o=t&&!(a&&n)&&getBarBounds(t,s);return o&&(a||_isBetween(e,o.left,o.right))&&(n||_isBetween(i,o.top,o.bottom))}function hasRadius(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function addNormalRectPath(t,e){t.rect(e.x,e.y,e.w,e.h);}function inflateRect(t,e,i={}){const s=t.x!==i.x?-e:0,a=t.y!==i.y?-e:0,n=(t.x+t.w!==i.x+i.w?e:0)-s,o=(t.y+t.h!==i.y+i.h?e:0)-a;return {x:t.x+s,y:t.y+a,w:t.w+n,h:t.h+o,radius:t.radius}}PointElement.id="point",PointElement.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0},PointElement.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};class BarElement extends Element$1{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t);}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:s}}=this,{inner:a,outer:n}=boundingRects(this),o=hasRadius(n.radius)?addRoundedRectPath:addNormalRectPath;t.save(),n.w===a.w&&n.h===a.h||(t.beginPath(),o(t,inflateRect(n,e,a)),t.clip(),o(t,inflateRect(a,-e,n)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),o(t,inflateRect(a,e)),t.fillStyle=s,t.fill(),t.restore();}inRange(t,e,i){return inRange(this,t,e,i)}inXRange(t,e){return inRange(this,t,null,e)}inYRange(t,e){return inRange(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:s,horizontal:a}=this.getProps(["x","y","base","horizontal"],t);return {x:a?(e+s)/2:e,y:a?i:(i+s)/2}}getRange(t){return "x"===t?this.width/2:this.height/2}}BarElement.id="bar",BarElement.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0},BarElement.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};Object.freeze({__proto__:null,ArcElement:ArcElement,LineElement:LineElement,PointElement:PointElement,BarElement:BarElement});function lttbDecimation(t,e,i,s,a){const n=a.samples||s;if(n>=i)return t.slice(e,e+i);const o=[],r=(i-2)/(n-2);let l=0;const h=e+i-1;let c,d,u,g,p,f=e;for(o[l++]=t[f],c=0;c<n-2;c++){let s,a=0,n=0;const h=Math.floor((c+1)*r)+1+e,m=Math.min(Math.floor((c+2)*r)+1,i)+e,x=m-h;for(s=h;s<m;s++)a+=t[s].x,n+=t[s].y;a/=x,n/=x;const b=Math.floor(c*r)+1+e,_=Math.min(Math.floor((c+1)*r)+1,i)+e,{x:y,y:v}=t[f];for(u=g=-1,s=b;s<_;s++)g=.5*Math.abs((y-a)*(t[s].y-v)-(y-t[s].x)*(n-v)),g>u&&(u=g,d=t[s],p=s);o[l++]=d,f=p;}return o[l++]=t[h],o}function minMaxDecimation(t,e,i,s){let a,n,o,r,l,h,c,d,u,g,p=0,f=0;const m=[],x=e+i-1,b=t[e].x,_=t[x].x-b;for(a=e;a<e+i;++a){n=t[a],o=(n.x-b)/_*s,r=n.y;const e=0|o;if(e===l)r<u?(u=r,h=a):r>g&&(g=r,c=a),p=(f*p+n.x)/++f;else {const i=a-1;if(!isNullOrUndef(h)&&!isNullOrUndef(c)){const e=Math.min(h,c),s=Math.max(h,c);e!==d&&e!==i&&m.push({...t[e],x:p}),s!==d&&s!==i&&m.push({...t[s],x:p});}a>0&&i!==d&&m.push(t[i]),m.push(n),l=e,f=0,u=g=r,h=c=d=a;}}return m}function cleanDecimatedDataset(t){if(t._decimated){const e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{value:e});}}function cleanDecimatedData(t){t.data.datasets.forEach((t=>{cleanDecimatedDataset(t);}));}function getStartAndCountOfVisiblePointsSimplified(t,e){const i=e.length;let s,a=0;const{iScale:n}=t,{min:o,max:r,minDefined:l,maxDefined:h}=n.getUserBounds();return l&&(a=_limitValue(_lookupByKey(e,n.axis,o).lo,0,i-1)),s=h?_limitValue(_lookupByKey(e,n.axis,r).hi+1,a,i)-a:i-a,{start:a,count:s}}var plugin_decimation={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,i)=>{if(!i.enabled)return void cleanDecimatedData(t);const s=t.width;t.data.datasets.forEach(((e,a)=>{const{_data:n,indexAxis:o}=e,r=t.getDatasetMeta(a),l=n||e.data;if("y"===resolve([o,t.options.indexAxis]))return;if("line"!==r.type)return;const h=t.scales[r.xAxisID];if("linear"!==h.type&&"time"!==h.type)return;if(t.options.parsing)return;let{start:c,count:d}=getStartAndCountOfVisiblePointsSimplified(r,l);if(d<=(i.threshold||4*s))return void cleanDecimatedDataset(e);let u;switch(isNullOrUndef(n)&&(e._data=l,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t;}})),i.algorithm){case"lttb":u=lttbDecimation(l,c,d,s,i);break;case"min-max":u=minMaxDecimation(l,c,d,s);break;default:throw new Error(`Unsupported decimation algorithm '${i.algorithm}'`)}e._decimated=u;}));},destroy(t){cleanDecimatedData(t);}};function getLineByIndex(t,e){const i=t.getDatasetMeta(e);return i&&t.isDatasetVisible(e)?i.dataset:null}function parseFillOption(t){const e=t.options,i=e.fill;let s=valueOrDefault(i&&i.target,i);return void 0===s&&(s=!!e.backgroundColor),!1!==s&&null!==s&&(!0===s?"origin":s)}function decodeFill(t,e,i){const s=parseFillOption(t);if(isObject(s))return !isNaN(s.value)&&s;let a=parseFloat(s);return isNumberFinite(a)&&Math.floor(a)===a?("-"!==s[0]&&"+"!==s[0]||(a=e+a),!(a===e||a<0||a>=i)&&a):["origin","start","end","stack","shape"].indexOf(s)>=0&&s}function computeLinearBoundary(t){const{scale:e={},fill:i}=t;let s,a=null;return "start"===i?a=e.bottom:"end"===i?a=e.top:isObject(i)?a=e.getPixelForValue(i.value):e.getBasePixel&&(a=e.getBasePixel()),isNumberFinite(a)?(s=e.isHorizontal(),{x:s?a:null,y:s?null:a}):null}class simpleArc{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius;}pathSegment(t,e,i){const{x:s,y:a,radius:n}=this;return e=e||{start:0,end:TAU},t.arc(s,a,n,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:s}=this,a=t.angle;return {x:e+Math.cos(a)*s,y:i+Math.sin(a)*s,angle:a}}}function computeCircularBoundary(t){const{scale:e,fill:i}=t,s=e.options,a=e.getLabels().length,n=[],o=s.reverse?e.max:e.min,r=s.reverse?e.min:e.max;let l,h,c;if(c="start"===i?o:"end"===i?r:isObject(i)?i.value:e.getBaseValue(),s.grid.circular)return h=e.getPointPositionForValue(0,o),new simpleArc({x:h.x,y:h.y,radius:e.getDistanceFromCenterForValue(c)});for(l=0;l<a;++l)n.push(e.getPointPositionForValue(l,c));return n}function computeBoundary(t){return (t.scale||{}).getPointPositionForValue?computeCircularBoundary(t):computeLinearBoundary(t)}function findSegmentEnd(t,e,i){for(;e>t;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function pointsFromSegments(t,e){const{x:i=null,y:s=null}=t||{},a=e.points,n=[];return e.segments.forEach((({start:t,end:e})=>{e=findSegmentEnd(t,e,a);const o=a[t],r=a[e];null!==s?(n.push({x:o.x,y:s}),n.push({x:r.x,y:s})):null!==i&&(n.push({x:i,y:o.y}),n.push({x:i,y:r.y}));})),n}function buildStackLine(t){const{scale:e,index:i,line:s}=t,a=[],n=s.segments,o=s.points,r=getLinesBelow(e,i);r.push(createBoundaryLine({x:null,y:e.bottom},s));for(let t=0;t<n.length;t++){const e=n[t];for(let t=e.start;t<=e.end;t++)addPointsBelow(a,o[t],r);}return new LineElement({points:a,options:{}})}function getLinesBelow(t,e){const i=[],s=t.getMatchingVisibleMetas("line");for(let t=0;t<s.length;t++){const a=s[t];if(a.index===e)break;a.hidden||i.unshift(a.dataset);}return i}function addPointsBelow(t,e,i){const s=[];for(let a=0;a<i.length;a++){const n=i[a],{first:o,last:r,point:l}=findPoint(n,e,"x");if(!(!l||o&&r))if(o)s.unshift(l);else if(t.push(l),!r)break}t.push(...s);}function findPoint(t,e,i){const s=t.interpolate(e,i);if(!s)return {};const a=s[i],n=t.segments,o=t.points;let r=!1,l=!1;for(let t=0;t<n.length;t++){const e=n[t],s=o[e.start][i],h=o[e.end][i];if(_isBetween(a,s,h)){r=a===s,l=a===h;break}}return {first:r,last:l,point:s}}function getTarget(t){const{chart:e,fill:i,line:s}=t;if(isNumberFinite(i))return getLineByIndex(e,i);if("stack"===i)return buildStackLine(t);if("shape"===i)return !0;const a=computeBoundary(t);return a instanceof simpleArc?a:createBoundaryLine(a,s)}function createBoundaryLine(t,e){let i=[],s=!1;return isArray(t)?(s=!0,i=t):i=pointsFromSegments(t,e),i.length?new LineElement({points:i,options:{tension:0},_loop:s,_fullLoop:s}):null}function resolveTarget(t,e,i){let s=t[e].fill;const a=[e];let n;if(!i)return s;for(;!1!==s&&-1===a.indexOf(s);){if(!isNumberFinite(s))return s;if(n=t[s],!n)return !1;if(n.visible)return s;a.push(s),s=n.fill;}return !1}function _clip(t,e,i){t.beginPath(),e.path(t),t.lineTo(e.last().x,i),t.lineTo(e.first().x,i),t.closePath(),t.clip();}function getBounds(t,e,i,s){if(s)return;let a=e[t],n=i[t];return "angle"===t&&(a=_normalizeAngle(a),n=_normalizeAngle(n)),{property:t,start:a,end:n}}function _getEdge(t,e,i,s){return t&&e?s(t[i],e[i]):t?t[i]:e?e[i]:0}function _segments(t,e,i){const s=t.segments,a=t.points,n=e.points,o=[];for(const t of s){let{start:s,end:r}=t;r=findSegmentEnd(s,r,a);const l=getBounds(i,a[s],a[r],t.loop);if(!e.segments){o.push({source:t,target:l,start:a[s],end:a[r]});continue}const h=_boundSegments(e,l);for(const e of h){const s=getBounds(i,n[e.start],n[e.end],e.loop),r=_boundSegment(t,a,s);for(const t of r)o.push({source:t,target:e,start:{[i]:_getEdge(l,s,"start",Math.max)},end:{[i]:_getEdge(l,s,"end",Math.min)}});}}return o}function clipBounds(t,e,i){const{top:s,bottom:a}=e.chart.chartArea,{property:n,start:o,end:r}=i||{};"x"===n&&(t.beginPath(),t.rect(o,s,r-o,a-s),t.clip());}function interpolatedLineTo(t,e,i,s){const a=e.interpolate(i,s);a&&t.lineTo(a.x,a.y);}function _fill(t,e){const{line:i,target:s,property:a,color:n,scale:o}=e,r=_segments(i,s,a);for(const{source:e,target:l,start:h,end:c}of r){const{style:{backgroundColor:r=n}={}}=e,d=!0!==s;t.save(),t.fillStyle=r,clipBounds(t,o,d&&getBounds(a,h,c)),t.beginPath();const u=!!i.pathSegment(t,e);let g;if(d){u?t.closePath():interpolatedLineTo(t,s,c,a);const e=!!s.pathSegment(t,l,{move:u,reverse:!0});g=u&&e,g||interpolatedLineTo(t,s,h,a);}t.closePath(),t.fill(g?"evenodd":"nonzero"),t.restore();}}function doFill(t,e){const{line:i,target:s,above:a,below:n,area:o,scale:r}=e,l=i._loop?"angle":e.axis;t.save(),"x"===l&&n!==a&&(_clip(t,s,o.top),_fill(t,{line:i,target:s,color:a,scale:r,property:l}),t.restore(),t.save(),_clip(t,s,o.bottom)),_fill(t,{line:i,target:s,color:n,scale:r,property:l}),t.restore();}function drawfill(t,e,i){const s=getTarget(e),{line:a,scale:n,axis:o}=e,r=a.options,l=r.fill,h=r.backgroundColor,{above:c=h,below:d=h}=l||{};s&&a.points.length&&(clipArea(t,i),doFill(t,{line:a,target:s,above:c,below:d,area:i,scale:n,axis:o}),unclipArea(t));}var plugin_filler={id:"filler",afterDatasetsUpdate(t,e,i){const s=(t.data.datasets||[]).length,a=[];let n,o,r,l;for(o=0;o<s;++o)n=t.getDatasetMeta(o),r=n.dataset,l=null,r&&r.options&&r instanceof LineElement&&(l={visible:t.isDatasetVisible(o),index:o,fill:decodeFill(r,o,s),chart:t,axis:n.controller.options.indexAxis,scale:n.vScale,line:r}),n.$filler=l,a.push(l);for(o=0;o<s;++o)l=a[o],l&&!1!==l.fill&&(l.fill=resolveTarget(a,o,i.propagate));},beforeDraw(t,e,i){const s="beforeDraw"===i.drawTime,a=t.getSortedVisibleDatasetMetas(),n=t.chartArea;for(let e=a.length-1;e>=0;--e){const i=a[e].$filler;i&&(i.line.updateControlPoints(n,i.axis),s&&drawfill(t.ctx,i,n));}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;const s=t.getSortedVisibleDatasetMetas();for(let e=s.length-1;e>=0;--e){const i=s[e].$filler;i&&drawfill(t.ctx,i,t.chartArea);}},beforeDatasetDraw(t,e,i){const s=e.meta.$filler;s&&!1!==s.fill&&"beforeDatasetDraw"===i.drawTime&&drawfill(t.ctx,s,t.chartArea);},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const getBoxSize=(t,e)=>{let{boxHeight:i=e,boxWidth:s=e}=t;return t.usePointStyle&&(i=Math.min(i,e),s=Math.min(s,e)),{boxWidth:s,boxHeight:i,itemHeight:Math.max(e,i)}};class Legend extends Element$1{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0;}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit();}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height);}buildLabels(){const t=this.options.labels||{};let e=callback(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter((e=>t.filter(e,this.chart.data)))),t.sort&&(e=e.sort(((e,i)=>t.sort(e,i,this.chart.data)))),this.options.reverse&&e.reverse(),this.legendItems=e;}fit(){const{options:t,ctx:e}=this;if(!t.display)return void(this.width=this.height=0);const i=t.labels,s=toFont(i.font),a=s.size,n=this._computeTitleHeight(),{boxWidth:o,itemHeight:r}=getBoxSize(i,a);let l,h;e.font=s.string,this.isHorizontal()?(l=this.maxWidth,h=this._fitRows(n,a,o,r)+10):(h=this.maxHeight,l=this._fitCols(n,a,o,r)+10),this.width=Math.min(l,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight);}_fitRows(t,e,i,s){const{ctx:a,maxWidth:n,options:{labels:{padding:o}}}=this,r=this.legendHitBoxes=[],l=this.lineWidths=[0],h=s+o;let c=t;a.textAlign="left",a.textBaseline="middle";let d=-1,u=-h;return this.legendItems.forEach(((t,g)=>{const p=i+e/2+a.measureText(t.text).width;(0===g||l[l.length-1]+p+2*o>n)&&(c+=h,l[l.length-(g>0?0:1)]=0,u+=h,d++),r[g]={left:0,top:u,row:d,width:p,height:s},l[l.length-1]+=p+o;})),c}_fitCols(t,e,i,s){const{ctx:a,maxHeight:n,options:{labels:{padding:o}}}=this,r=this.legendHitBoxes=[],l=this.columnSizes=[],h=n-t;let c=o,d=0,u=0,g=0,p=0;return this.legendItems.forEach(((t,n)=>{const f=i+e/2+a.measureText(t.text).width;n>0&&u+s+2*o>h&&(c+=d+o,l.push({width:d,height:u}),g+=d+o,p++,d=u=0),r[n]={left:g,top:u,col:p,width:f,height:s},d=Math.max(d,f),u+=s+o;})),c+=d,l.push({width:d,height:u}),c}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:a}}=this,n=getRtlAdapter(a,this.left,this.width);if(this.isHorizontal()){let a=0,o=_alignStartEnd(i,this.left+s,this.right-this.lineWidths[a]);for(const r of e)a!==r.row&&(a=r.row,o=_alignStartEnd(i,this.left+s,this.right-this.lineWidths[a])),r.top+=this.top+t+s,r.left=n.leftForLtr(n.x(o),r.width),o+=r.width+s;}else {let a=0,o=_alignStartEnd(i,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const r of e)r.col!==a&&(a=r.col,o=_alignStartEnd(i,this.top+t+s,this.bottom-this.columnSizes[a].height)),r.top=o,r.left+=this.left+s,r.left=n.leftForLtr(n.x(r.left),r.width),o+=r.height+s;}}isHorizontal(){return "top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const t=this.ctx;clipArea(t,this),this._draw(),unclipArea(t);}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:a,labels:n}=t,o=defaults.color,r=getRtlAdapter(t.rtl,this.left,this.width),l=toFont(n.font),{color:h,padding:c}=n,d=l.size,u=d/2;let g;this.drawTitle(),s.textAlign=r.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=l.string;const{boxWidth:p,boxHeight:f,itemHeight:m}=getBoxSize(n,d),x=this.isHorizontal(),b=this._computeTitleHeight();g=x?{x:_alignStartEnd(a,this.left+c,this.right-i[0]),y:this.top+c+b,line:0}:{x:this.left+c,y:_alignStartEnd(a,this.top+b+c,this.bottom-e[0].height),line:0},overrideTextDirection(this.ctx,t.textDirection);const _=m+c;this.legendItems.forEach(((y,v)=>{s.strokeStyle=y.fontColor||h,s.fillStyle=y.fontColor||h;const S=s.measureText(y.text).width,k=r.textAlign(y.textAlign||(y.textAlign=n.textAlign)),M=p+u+S;let P=g.x,D=g.y;r.setWidth(this.width),x?v>0&&P+M+c>this.right&&(D=g.y+=_,g.line++,P=g.x=_alignStartEnd(a,this.left+c,this.right-i[g.line])):v>0&&D+_>this.bottom&&(P=g.x=P+e[g.line].width+c,g.line++,D=g.y=_alignStartEnd(a,this.top+b+c,this.bottom-e[g.line].height));!function(t,e,i){if(isNaN(p)||p<=0||isNaN(f)||f<0)return;s.save();const a=valueOrDefault(i.lineWidth,1);if(s.fillStyle=valueOrDefault(i.fillStyle,o),s.lineCap=valueOrDefault(i.lineCap,"butt"),s.lineDashOffset=valueOrDefault(i.lineDashOffset,0),s.lineJoin=valueOrDefault(i.lineJoin,"miter"),s.lineWidth=a,s.strokeStyle=valueOrDefault(i.strokeStyle,o),s.setLineDash(valueOrDefault(i.lineDash,[])),n.usePointStyle){const n={radius:p*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:a},o=r.xPlus(t,p/2);drawPoint(s,n,o,e+u);}else {const n=e+Math.max((d-f)/2,0),o=r.leftForLtr(t,p),l=toTRBLCorners(i.borderRadius);s.beginPath(),Object.values(l).some((t=>0!==t))?addRoundedRectPath(s,{x:o,y:n,w:p,h:f,radius:l}):s.rect(o,n,p,f),s.fill(),0!==a&&s.stroke();}s.restore();}(r.x(P),D,y),P=_textX(k,P+p+u,x?P+M:this.right,t.rtl),function(t,e,i){renderText(s,i.text,t,e+m/2,l,{strikethrough:i.hidden,textAlign:r.textAlign(i.textAlign)});}(r.x(P),D,y),x?g.x+=M+c:g.y+=_;})),restoreTextDirection(this.ctx,t.textDirection);}drawTitle(){const t=this.options,e=t.title,i=toFont(e.font),s=toPadding(e.padding);if(!e.display)return;const a=getRtlAdapter(t.rtl,this.left,this.width),n=this.ctx,o=e.position,r=i.size/2,l=s.top+r;let h,c=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),h=this.top+l,c=_alignStartEnd(t.align,c,this.right-d);else {const e=this.columnSizes.reduce(((t,e)=>Math.max(t,e.height)),0);h=l+_alignStartEnd(t.align,this.top,this.bottom-e-t.labels.padding-this._computeTitleHeight());}const u=_alignStartEnd(o,c,c+d);n.textAlign=a.textAlign(_toLeftRightCenter(o)),n.textBaseline="middle",n.strokeStyle=e.color,n.fillStyle=e.color,n.font=i.string,renderText(n,e.text,u,h,i);}_computeTitleHeight(){const t=this.options.title,e=toFont(t.font),i=toPadding(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,a;if(_isBetween(t,this.left,this.right)&&_isBetween(e,this.top,this.bottom))for(a=this.legendHitBoxes,i=0;i<a.length;++i)if(s=a[i],_isBetween(t,s.left,s.left+s.width)&&_isBetween(e,s.top,s.top+s.height))return this.legendItems[i];return null}handleEvent(t){const e=this.options;if(!isListened(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if("mousemove"===t.type){const n=this._hoveredItem,o=(a=i,null!==(s=n)&&null!==a&&s.datasetIndex===a.datasetIndex&&s.index===a.index);n&&!o&&callback(e.onLeave,[t,n,this],this),this._hoveredItem=i,i&&!o&&callback(e.onHover,[t,i,this],this);}else i&&callback(e.onClick,[t,i,this],this);var s,a;}}function isListened(t,e){return !("mousemove"!==t||!e.onHover&&!e.onLeave)||!(!e.onClick||"click"!==t&&"mouseup"!==t)}var plugin_legend={id:"legend",_element:Legend,start(t,e,i){const s=t.legend=new Legend({ctx:t.ctx,options:i,chart:t});layouts.configure(t,s,i),layouts.addBox(t,s);},stop(t){layouts.removeBox(t,t.legend),delete t.legend;},beforeUpdate(t,e,i){const s=t.legend;layouts.configure(t,s,i),s.options=i;},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes();},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event);},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,i){const s=e.datasetIndex,a=i.chart;a.isDatasetVisible(s)?(a.hide(s),e.hidden=!0):(a.show(s),e.hidden=!1);},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:i,pointStyle:s,textAlign:a,color:n}}=t.legend.options;return t._getSortedDatasetMetas().map((t=>{const o=t.controller.getStyle(i?0:void 0),r=toPadding(o.borderWidth);return {text:e[t.index].label,fillStyle:o.backgroundColor,fontColor:n,hidden:!t.visible,lineCap:o.borderCapStyle,lineDash:o.borderDash,lineDashOffset:o.borderDashOffset,lineJoin:o.borderJoinStyle,lineWidth:(r.width+r.height)/4,strokeStyle:o.borderColor,pointStyle:s||o.pointStyle,rotation:o.rotation,textAlign:a||o.textAlign,borderRadius:0,datasetIndex:t.index}}),this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class Title extends Element$1{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0;}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=t,this.height=this.bottom=e;const s=isArray(i.text)?i.text.length:1;this._padding=toPadding(i.padding);const a=s*toFont(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=a:this.width=a;}isHorizontal(){const t=this.options.position;return "top"===t||"bottom"===t}_drawArgs(t){const{top:e,left:i,bottom:s,right:a,options:n}=this,o=n.align;let r,l,h,c=0;return this.isHorizontal()?(l=_alignStartEnd(o,i,a),h=e+t,r=a-i):("left"===n.position?(l=i+t,h=_alignStartEnd(o,s,e),c=-.5*PI):(l=a-t,h=_alignStartEnd(o,e,s),c=.5*PI),r=s-e),{titleX:l,titleY:h,maxWidth:r,rotation:c}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=toFont(e.font),s=i.lineHeight/2+this._padding.top,{titleX:a,titleY:n,maxWidth:o,rotation:r}=this._drawArgs(s);renderText(t,e.text,0,0,i,{color:e.color,maxWidth:o,rotation:r,textAlign:_toLeftRightCenter(e.align),textBaseline:"middle",translation:[a,n]});}}function createTitle(t,e){const i=new Title({ctx:t.ctx,options:e,chart:t});layouts.configure(t,i,e),layouts.addBox(t,i),t.titleBlock=i;}var plugin_title={id:"title",_element:Title,start(t,e,i){createTitle(t,i);},stop(t){const e=t.titleBlock;layouts.removeBox(t,e),delete t.titleBlock;},beforeUpdate(t,e,i){const s=t.titleBlock;layouts.configure(t,s,i),s.options=i;},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const map=new WeakMap;var plugin_subtitle={id:"subtitle",start(t,e,i){const s=new Title({ctx:t.ctx,options:i,chart:t});layouts.configure(t,s,i),layouts.addBox(t,s),map.set(t,s);},stop(t){layouts.removeBox(t,map.get(t)),map.delete(t);},beforeUpdate(t,e,i){const s=map.get(t);layouts.configure(t,s,i),s.options=i;},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const positioners={average(t){if(!t.length)return !1;let e,i,s=0,a=0,n=0;for(e=0,i=t.length;e<i;++e){const i=t[e].element;if(i&&i.hasValue()){const t=i.tooltipPosition();s+=t.x,a+=t.y,++n;}}return {x:s/n,y:a/n}},nearest(t,e){if(!t.length)return !1;let i,s,a,n=e.x,o=e.y,r=Number.POSITIVE_INFINITY;for(i=0,s=t.length;i<s;++i){const s=t[i].element;if(s&&s.hasValue()){const t=s.getCenterPoint(),i=distanceBetweenPoints(e,t);i<r&&(r=i,a=s);}}if(a){const t=a.tooltipPosition();n=t.x,o=t.y;}return {x:n,y:o}}};function pushOrConcat(t,e){return e&&(isArray(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function splitNewlines(t){return ("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function createTooltipItem(t,e){const{element:i,datasetIndex:s,index:a}=e,n=t.getDatasetMeta(s).controller,{label:o,value:r}=n.getLabelAndValue(a);return {chart:t,label:o,parsed:n.getParsed(a),raw:t.data.datasets[s].data[a],formattedValue:r,dataset:n.getDataset(),dataIndex:a,datasetIndex:s,element:i}}function getTooltipSize(t,e){const i=t.chart.ctx,{body:s,footer:a,title:n}=t,{boxWidth:o,boxHeight:r}=e,l=toFont(e.bodyFont),h=toFont(e.titleFont),c=toFont(e.footerFont),d=n.length,u=a.length,g=s.length,p=toPadding(e.padding);let f=p.height,m=0,x=s.reduce(((t,e)=>t+e.before.length+e.lines.length+e.after.length),0);if(x+=t.beforeBody.length+t.afterBody.length,d&&(f+=d*h.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),x){f+=g*(e.displayColors?Math.max(r,l.lineHeight):l.lineHeight)+(x-g)*l.lineHeight+(x-1)*e.bodySpacing;}u&&(f+=e.footerMarginTop+u*c.lineHeight+(u-1)*e.footerSpacing);let b=0;const _=function(t){m=Math.max(m,i.measureText(t).width+b);};return i.save(),i.font=h.string,each(t.title,_),i.font=l.string,each(t.beforeBody.concat(t.afterBody),_),b=e.displayColors?o+2+e.boxPadding:0,each(s,(t=>{each(t.before,_),each(t.lines,_),each(t.after,_);})),b=0,i.font=c.string,each(t.footer,_),i.restore(),m+=p.width,{width:m,height:f}}function determineYAlign(t,e){const{y:i,height:s}=e;return i<s/2?"top":i>t.height-s/2?"bottom":"center"}function doesNotFitWithAlign(t,e,i,s){const{x:a,width:n}=s,o=i.caretSize+i.caretPadding;return "left"===t&&a+n+o>e.width||("right"===t&&a-n-o<0||void 0)}function determineXAlign(t,e,i,s){const{x:a,width:n}=i,{width:o,chartArea:{left:r,right:l}}=t;let h="center";return "center"===s?h=a<=(r+l)/2?"left":"right":a<=n/2?h="left":a>=o-n/2&&(h="right"),doesNotFitWithAlign(h,t,e,i)&&(h="center"),h}function determineAlignment(t,e,i){const s=i.yAlign||e.yAlign||determineYAlign(t,i);return {xAlign:i.xAlign||e.xAlign||determineXAlign(t,e,i,s),yAlign:s}}function alignX(t,e){let{x:i,width:s}=t;return "right"===e?i-=s:"center"===e&&(i-=s/2),i}function alignY(t,e,i){let{y:s,height:a}=t;return "top"===e?s+=i:s-="bottom"===e?a+i:a/2,s}function getBackgroundPoint(t,e,i,s){const{caretSize:a,caretPadding:n,cornerRadius:o}=t,{xAlign:r,yAlign:l}=i,h=a+n,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:g}=toTRBLCorners(o);let p=alignX(e,r);const f=alignY(e,l,h);return "center"===l?"left"===r?p+=h:"right"===r&&(p-=h):"left"===r?p-=Math.max(c,u)+a:"right"===r&&(p+=Math.max(d,g)+a),{x:_limitValue(p,0,s.width-e.width),y:_limitValue(f,0,s.height-e.height)}}function getAlignedX(t,e,i){const s=toPadding(i.padding);return "center"===e?t.x+t.width/2:"right"===e?t.x+t.width-s.right:t.x+s.left}function getBeforeAfterBodyLines(t){return pushOrConcat([],splitNewlines(t))}function createTooltipContext(t,e,i){return createContext(t,{tooltip:e,tooltipItems:i,type:"tooltip"})}function overrideCallbacks(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}class Tooltip extends Element$1{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart||t._chart,this._chart=this.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0;}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0;}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&e.options.animation&&i.animations,a=new Animations(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(a)),a}getContext(){return this.$context||(this.$context=createTooltipContext(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,s=i.beforeTitle.apply(this,[t]),a=i.title.apply(this,[t]),n=i.afterTitle.apply(this,[t]);let o=[];return o=pushOrConcat(o,splitNewlines(s)),o=pushOrConcat(o,splitNewlines(a)),o=pushOrConcat(o,splitNewlines(n)),o}getBeforeBody(t,e){return getBeforeAfterBodyLines(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){const{callbacks:i}=e,s=[];return each(t,(t=>{const e={before:[],lines:[],after:[]},a=overrideCallbacks(i,t);pushOrConcat(e.before,splitNewlines(a.beforeLabel.call(this,t))),pushOrConcat(e.lines,a.label.call(this,t)),pushOrConcat(e.after,splitNewlines(a.afterLabel.call(this,t))),s.push(e);})),s}getAfterBody(t,e){return getBeforeAfterBodyLines(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){const{callbacks:i}=e,s=i.beforeFooter.apply(this,[t]),a=i.footer.apply(this,[t]),n=i.afterFooter.apply(this,[t]);let o=[];return o=pushOrConcat(o,splitNewlines(s)),o=pushOrConcat(o,splitNewlines(a)),o=pushOrConcat(o,splitNewlines(n)),o}_createItems(t){const e=this._active,i=this.chart.data,s=[],a=[],n=[];let o,r,l=[];for(o=0,r=e.length;o<r;++o)l.push(createTooltipItem(this.chart,e[o]));return t.filter&&(l=l.filter(((e,s,a)=>t.filter(e,s,a,i)))),t.itemSort&&(l=l.sort(((e,s)=>t.itemSort(e,s,i)))),each(l,(e=>{const i=overrideCallbacks(t.callbacks,e);s.push(i.labelColor.call(this,e)),a.push(i.labelPointStyle.call(this,e)),n.push(i.labelTextColor.call(this,e));})),this.labelColors=s,this.labelPointStyles=a,this.labelTextColors=n,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let a,n=[];if(s.length){const t=positioners[i.position].call(this,s,this._eventPosition);n=this._createItems(i),this.title=this.getTitle(n,i),this.beforeBody=this.getBeforeBody(n,i),this.body=this.getBody(n,i),this.afterBody=this.getAfterBody(n,i),this.footer=this.getFooter(n,i);const e=this._size=getTooltipSize(this,i),o=Object.assign({},t,e),r=determineAlignment(this.chart,i,o),l=getBackgroundPoint(i,o,r,this.chart);this.xAlign=r.xAlign,this.yAlign=r.yAlign,a={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y};}else 0!==this.opacity&&(a={opacity:0});this._tooltipItems=n,this.$context=void 0,a&&this._resolveAnimations().update(this,a),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e});}drawCaret(t,e,i,s){const a=this.getCaretPosition(t,i,s);e.lineTo(a.x1,a.y1),e.lineTo(a.x2,a.y2),e.lineTo(a.x3,a.y3);}getCaretPosition(t,e,i){const{xAlign:s,yAlign:a}=this,{caretSize:n,cornerRadius:o}=i,{topLeft:r,topRight:l,bottomLeft:h,bottomRight:c}=toTRBLCorners(o),{x:d,y:u}=t,{width:g,height:p}=e;let f,m,x,b,_,y;return "center"===a?(_=u+p/2,"left"===s?(f=d,m=f-n,b=_+n,y=_-n):(f=d+g,m=f+n,b=_-n,y=_+n),x=f):(m="left"===s?d+Math.max(r,h)+n:"right"===s?d+g-Math.max(l,c)-n:this.caretX,"top"===a?(b=u,_=b-n,f=m-n,x=m+n):(b=u+p,_=b+n,f=m+n,x=m-n),y=b),{x1:f,x2:m,x3:x,y1:b,y2:_,y3:y}}drawTitle(t,e,i){const s=this.title,a=s.length;let n,o,r;if(a){const l=getRtlAdapter(i.rtl,this.x,this.width);for(t.x=getAlignedX(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",n=toFont(i.titleFont),o=i.titleSpacing,e.fillStyle=i.titleColor,e.font=n.string,r=0;r<a;++r)e.fillText(s[r],l.x(t.x),t.y+n.lineHeight/2),t.y+=n.lineHeight+o,r+1===a&&(t.y+=i.titleMarginBottom-o);}}_drawColorBox(t,e,i,s,a){const n=this.labelColors[i],o=this.labelPointStyles[i],{boxHeight:r,boxWidth:l,boxPadding:h}=a,c=toFont(a.bodyFont),d=getAlignedX(this,"left",a),u=s.x(d),g=r<c.lineHeight?(c.lineHeight-r)/2:0,p=e.y+g;if(a.usePointStyle){const e={radius:Math.min(l,r)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},i=s.leftForLtr(u,l)+l/2,h=p+r/2;t.strokeStyle=a.multiKeyBackground,t.fillStyle=a.multiKeyBackground,drawPoint(t,e,i,h),t.strokeStyle=n.borderColor,t.fillStyle=n.backgroundColor,drawPoint(t,e,i,h);}else {t.lineWidth=n.borderWidth||1,t.strokeStyle=n.borderColor,t.setLineDash(n.borderDash||[]),t.lineDashOffset=n.borderDashOffset||0;const e=s.leftForLtr(u,l-h),i=s.leftForLtr(s.xPlus(u,1),l-h-2),o=toTRBLCorners(n.borderRadius);Object.values(o).some((t=>0!==t))?(t.beginPath(),t.fillStyle=a.multiKeyBackground,addRoundedRectPath(t,{x:e,y:p,w:l,h:r,radius:o}),t.fill(),t.stroke(),t.fillStyle=n.backgroundColor,t.beginPath(),addRoundedRectPath(t,{x:i,y:p+1,w:l-2,h:r-2,radius:o}),t.fill()):(t.fillStyle=a.multiKeyBackground,t.fillRect(e,p,l,r),t.strokeRect(e,p,l,r),t.fillStyle=n.backgroundColor,t.fillRect(i,p+1,l-2,r-2));}t.fillStyle=this.labelTextColors[i];}drawBody(t,e,i){const{body:s}=this,{bodySpacing:a,bodyAlign:n,displayColors:o,boxHeight:r,boxWidth:l,boxPadding:h}=i,c=toFont(i.bodyFont);let d=c.lineHeight,u=0;const g=getRtlAdapter(i.rtl,this.x,this.width),p=function(i){e.fillText(i,g.x(t.x+u),t.y+d/2),t.y+=d+a;},f=g.textAlign(n);let m,x,b,_,y,v,S;for(e.textAlign=n,e.textBaseline="middle",e.font=c.string,t.x=getAlignedX(this,f,i),e.fillStyle=i.bodyColor,each(this.beforeBody,p),u=o&&"right"!==f?"center"===n?l/2+h:l+2+h:0,_=0,v=s.length;_<v;++_){for(m=s[_],x=this.labelTextColors[_],e.fillStyle=x,each(m.before,p),b=m.lines,o&&b.length&&(this._drawColorBox(e,t,_,g,i),d=Math.max(c.lineHeight,r)),y=0,S=b.length;y<S;++y)p(b[y]),d=c.lineHeight;each(m.after,p);}u=0,d=c.lineHeight,each(this.afterBody,p),t.y-=a;}drawFooter(t,e,i){const s=this.footer,a=s.length;let n,o;if(a){const r=getRtlAdapter(i.rtl,this.x,this.width);for(t.x=getAlignedX(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=r.textAlign(i.footerAlign),e.textBaseline="middle",n=toFont(i.footerFont),e.fillStyle=i.footerColor,e.font=n.string,o=0;o<a;++o)e.fillText(s[o],r.x(t.x),t.y+n.lineHeight/2),t.y+=n.lineHeight+i.footerSpacing;}}drawBackground(t,e,i,s){const{xAlign:a,yAlign:n}=this,{x:o,y:r}=t,{width:l,height:h}=i,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:g}=toTRBLCorners(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(o+c,r),"top"===n&&this.drawCaret(t,e,i,s),e.lineTo(o+l-d,r),e.quadraticCurveTo(o+l,r,o+l,r+d),"center"===n&&"right"===a&&this.drawCaret(t,e,i,s),e.lineTo(o+l,r+h-g),e.quadraticCurveTo(o+l,r+h,o+l-g,r+h),"bottom"===n&&this.drawCaret(t,e,i,s),e.lineTo(o+u,r+h),e.quadraticCurveTo(o,r+h,o,r+h-u),"center"===n&&"left"===a&&this.drawCaret(t,e,i,s),e.lineTo(o,r+c),e.quadraticCurveTo(o,r,o+c,r),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke();}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,s=i&&i.x,a=i&&i.y;if(s||a){const i=positioners[t.position].call(this,this._active,this._eventPosition);if(!i)return;const n=this._size=getTooltipSize(this,t),o=Object.assign({},i,this._size),r=determineAlignment(e,t,o),l=getBackgroundPoint(t,o,r,e);s._to===l.x&&a._to===l.y||(this.xAlign=r.xAlign,this.yAlign=r.yAlign,this.width=n.width,this.height=n.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l));}}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},a={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const n=toPadding(e.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&o&&(t.save(),t.globalAlpha=i,this.drawBackground(a,t,s,e),overrideTextDirection(t,e.textDirection),a.y+=n.top,this.drawTitle(a,t,e),this.drawBody(a,t,e),this.drawFooter(a,t,e),restoreTextDirection(t,e.textDirection),t.restore());}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map((({datasetIndex:t,index:e})=>{const i=this.chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return {datasetIndex:t,element:i.data[e],index:e}})),a=!_elementsEqual(i,s),n=this._positionChanged(s,e);(a||n)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0));}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return !1;this._ignoreReplayEvents=!1;const s=this.options,a=this._active||[],n=this._getActiveElements(t,a,e,i),o=this._positionChanged(n,t),r=e||!_elementsEqual(n,a)||o;return r&&(this._active=n,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),r}_getActiveElements(t,e,i,s){const a=this.options;if("mouseout"===t.type)return [];if(!s)return e;const n=this.chart.getElementsAtEventForMode(t,a.mode,a,i);return a.reverse&&n.reverse(),n}_positionChanged(t,e){const{caretX:i,caretY:s,options:a}=this,n=positioners[a.position].call(this,t,e);return !1!==n&&(i!==n.x||s!==n.y)}}Tooltip.positioners=positioners;var plugin_tooltip={id:"tooltip",_element:Tooltip,positioners:positioners,afterInit(t,e,i){i&&(t.tooltip=new Tooltip({chart:t,options:i}));},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i);},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i);},afterDraw(t){const e=t.tooltip,i={tooltip:e};!1!==t.notifyPlugins("beforeTooltipDraw",i)&&(e&&e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i));},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.changed=!0);}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:noop,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,s=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(s>0&&e.dataIndex<s)return i[e.dataIndex]}return ""},afterTitle:noop,beforeBody:noop,beforeLabel:noop,label(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const i=t.formattedValue;return isNullOrUndef(i)||(e+=i),e},labelColor(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return {borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return {pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:noop,afterBody:noop,beforeFooter:noop,footer:noop,afterFooter:noop}},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};Object.freeze({__proto__:null,Decimation:plugin_decimation,Filler:plugin_filler,Legend:plugin_legend,SubTitle:plugin_subtitle,Title:plugin_title,Tooltip:plugin_tooltip});const addIfString=(t,e,i,s)=>("string"==typeof e?(i=t.push(e)-1,s.unshift({index:i,label:e})):isNaN(e)&&(i=null),i);function findOrAddLabel(t,e,i,s){const a=t.indexOf(e);if(-1===a)return addIfString(t,e,i,s);return a!==t.lastIndexOf(e)?i:a}const validIndex=(t,e)=>null===t?null:_limitValue(Math.round(t),0,e);class CategoryScale extends Scale{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[];}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:i,label:s}of e)t[i]===s&&t.splice(i,1);this._addedLabels=[];}super.init(t);}parse(t,e){if(isNullOrUndef(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:findOrAddLabel(i,t,valueOrDefault(e,t),this._addedLabels),validIndex(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s;}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,s=[];let a=this.getLabels();a=0===t&&e===a.length-1?a:a.slice(t,e+1),this._valueRange=Math.max(a.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let i=t;i<=e;i++)s.push({value:i});return s}getLabelForValue(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels);}getPixelForValue(t){return "number"!=typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function generateTicks$1(t,e){const i=[],{bounds:s,step:a,min:n,max:o,precision:r,count:l,maxTicks:h,maxDigits:c,includeBounds:d}=t,u=a||1,g=h-1,{min:p,max:f}=e,m=!isNullOrUndef(n),x=!isNullOrUndef(o),b=!isNullOrUndef(l),_=(f-p)/(c+1);let y,v,S,k,M=niceNum((f-p)/g/u)*u;if(M<1e-14&&!m&&!x)return [{value:p},{value:f}];k=Math.ceil(f/M)-Math.floor(p/M),k>g&&(M=niceNum(k*M/g/u)*u),isNullOrUndef(r)||(y=Math.pow(10,r),M=Math.ceil(M*y)/y),"ticks"===s?(v=Math.floor(p/M)*M,S=Math.ceil(f/M)*M):(v=p,S=f),m&&x&&a&&almostWhole((o-n)/a,M/1e3)?(k=Math.round(Math.min((o-n)/M,h)),M=(o-n)/k,v=n,S=o):b?(v=m?n:v,S=x?o:S,k=l-1,M=(S-v)/k):(k=(S-v)/M,k=almostEquals(k,Math.round(k),M/1e3)?Math.round(k):Math.ceil(k));const P=Math.max(_decimalPlaces(M),_decimalPlaces(v));y=Math.pow(10,isNullOrUndef(r)?P:r),v=Math.round(v*y)/y,S=Math.round(S*y)/y;let D=0;for(m&&(d&&v!==n?(i.push({value:n}),v<n&&D++,almostEquals(Math.round((v+D*M)*y)/y,n,relativeLabelSize(n,_,t))&&D++):v<n&&D++);D<k;++D)i.push({value:Math.round((v+D*M)*y)/y});return x&&d&&S!==o?i.length&&almostEquals(i[i.length-1].value,o,relativeLabelSize(o,_,t))?i[i.length-1].value=o:i.push({value:o}):x&&S!==o||i.push({value:S}),i}function relativeLabelSize(t,e,{horizontal:i,minRotation:s}){const a=toRadians(s),n=(i?Math.sin(a):Math.cos(a))||.001,o=.75*e*(""+t).length;return Math.min(e/n,o)}CategoryScale.id="category",CategoryScale.defaults={ticks:{callback:CategoryScale.prototype.getLabelForValue}};class LinearScaleBase extends Scale{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0;}parse(t,e){return isNullOrUndef(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:s,max:a}=this;const n=t=>s=e?s:t,o=t=>a=i?a:t;if(t){const t=sign(s),e=sign(a);t<0&&e<0?o(0):t>0&&e>0&&n(0);}if(s===a){let e=1;(a>=Number.MAX_SAFE_INTEGER||s<=Number.MIN_SAFE_INTEGER)&&(e=Math.abs(.05*a)),o(a+e),t||n(s-e);}this.min=s,this.max=a;}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:s}=t;return s?(e=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s=generateTicks$1({maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},this._range||this);return "ticks"===t.bounds&&_setMinAndMaxByKey(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-e)/Math.max(t.length-1,1)/2;e-=s,i+=s;}this._startValue=e,this._endValue=i,this._valueRange=i-e;}getLabelForValue(t){return formatNumber(t,this.chart.options.locale,this.options.ticks.format)}}class LinearScale extends LinearScaleBase{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=isNumberFinite(t)?t:0,this.max=isNumberFinite(e)?e:1,this.handleTickRangeOptions();}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=toRadians(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,a=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,a.lineHeight/s))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}function isMajor(t){return 1===t/Math.pow(10,Math.floor(log10(t)))}function generateTicks(t,e){const i=Math.floor(log10(e.max)),s=Math.ceil(e.max/Math.pow(10,i)),a=[];let n=finiteOrDefault(t.min,Math.pow(10,Math.floor(log10(e.min)))),o=Math.floor(log10(n)),r=Math.floor(n/Math.pow(10,o)),l=o<0?Math.pow(10,Math.abs(o)):1;do{a.push({value:n,major:isMajor(n)}),++r,10===r&&(r=1,++o,l=o>=0?1:l),n=Math.round(r*Math.pow(10,o)*l)/l;}while(o<i||o===i&&r<s);const h=finiteOrDefault(t.max,n);return a.push({value:h,major:isMajor(n)}),a}LinearScale.id="linear",LinearScale.defaults={ticks:{callback:Ticks.formatters.numeric}};class LogarithmicScale extends Scale{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0;}parse(t,e){const i=LinearScaleBase.prototype.parse.apply(this,[t,e]);if(0!==i)return isNumberFinite(i)&&i>0?i:null;this._zero=!0;}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=isNumberFinite(t)?Math.max(0,t):null,this.max=isNumberFinite(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions();}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,s=this.max;const a=e=>i=t?i:e,n=t=>s=e?s:t,o=(t,e)=>Math.pow(10,Math.floor(log10(t))+e);i===s&&(i<=0?(a(1),n(10)):(a(o(i,-1)),n(o(s,1)))),i<=0&&a(o(s,-1)),s<=0&&n(o(i,1)),this._zero&&this.min!==this._suggestedMin&&i===o(this.min,0)&&a(o(i,-1)),this.min=i,this.max=s;}buildTicks(){const t=this.options,e=generateTicks({min:this._userMin,max:this._userMax},this);return "ticks"===t.bounds&&_setMinAndMaxByKey(e,this,"value"),t.reverse?(e.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),e}getLabelForValue(t){return void 0===t?"0":formatNumber(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=log10(t),this._valueRange=log10(this.max)-log10(t);}getPixelForValue(t){return void 0!==t&&0!==t||(t=this.min),null===t||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(log10(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function getTickBackdropHeight(t){const e=t.ticks;if(e.display&&t.display){const t=toPadding(e.backdropPadding);return valueOrDefault(e.font&&e.font.size,defaults.font.size)+t.height}return 0}function measureLabelSize(t,e,i){return i=isArray(i)?i:[i],{w:_longestText(t,e.string,i),h:i.length*e.lineHeight}}function determineLimits(t,e,i,s,a){return t===s||t===a?{start:e-i/2,end:e+i/2}:t<s||t>a?{start:e-i,end:e}:{start:e,end:e+i}}function fitWithPointLabels(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},i=Object.assign({},e),s=[],a=[],n=t._pointLabels.length,o=t.options.pointLabels,r=o.centerPointLabels?PI/n:0;for(let l=0;l<n;l++){const n=o.setContext(t.getPointLabelContext(l));a[l]=n.padding;const h=t.getPointPosition(l,t.drawingArea+a[l],r),c=toFont(n.font),d=measureLabelSize(t.ctx,c,t._pointLabels[l]);s[l]=d;const u=_normalizeAngle(t.getIndexAngle(l)+r),g=Math.round(toDegrees(u));updateLimits(i,e,u,determineLimits(g,h.x,d.w,0,180),determineLimits(g,h.y,d.h,90,270));}t.setCenterPoint(e.l-i.l,i.r-e.r,e.t-i.t,i.b-e.b),t._pointLabelItems=buildPointLabelItems(t,s,a);}function updateLimits(t,e,i,s,a){const n=Math.abs(Math.sin(i)),o=Math.abs(Math.cos(i));let r=0,l=0;s.start<e.l?(r=(e.l-s.start)/n,t.l=Math.min(t.l,e.l-r)):s.end>e.r&&(r=(s.end-e.r)/n,t.r=Math.max(t.r,e.r+r)),a.start<e.t?(l=(e.t-a.start)/o,t.t=Math.min(t.t,e.t-l)):a.end>e.b&&(l=(a.end-e.b)/o,t.b=Math.max(t.b,e.b+l));}function buildPointLabelItems(t,e,i){const s=[],a=t._pointLabels.length,n=t.options,o=getTickBackdropHeight(n)/2,r=t.drawingArea,l=n.pointLabels.centerPointLabels?PI/a:0;for(let n=0;n<a;n++){const a=t.getPointPosition(n,r+o+i[n],l),h=Math.round(toDegrees(_normalizeAngle(a.angle+HALF_PI))),c=e[n],d=yForAngle(a.y,c.h,h),u=getTextAlignForAngle(h),g=leftForTextAlign(a.x,c.w,u);s.push({x:a.x,y:d,textAlign:u,left:g,top:d,right:g+c.w,bottom:d+c.h});}return s}function getTextAlignForAngle(t){return 0===t||180===t?"center":t<180?"left":"right"}function leftForTextAlign(t,e,i){return "right"===i?t-=e:"center"===i&&(t-=e/2),t}function yForAngle(t,e,i){return 90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e),t}function drawPointLabels(t,e){const{ctx:i,options:{pointLabels:s}}=t;for(let a=e-1;a>=0;a--){const e=s.setContext(t.getPointLabelContext(a)),n=toFont(e.font),{x:o,y:r,textAlign:l,left:h,top:c,right:d,bottom:u}=t._pointLabelItems[a],{backdropColor:g}=e;if(!isNullOrUndef(g)){const t=toPadding(e.backdropPadding);i.fillStyle=g,i.fillRect(h-t.left,c-t.top,d-h+t.width,u-c+t.height);}renderText(i,t._pointLabels[a],o,r+n.lineHeight/2,n,{color:e.color,textAlign:l,textBaseline:"middle"});}}function pathRadiusLine(t,e,i,s){const{ctx:a}=t;if(i)a.arc(t.xCenter,t.yCenter,e,0,TAU);else {let i=t.getPointPosition(0,e);a.moveTo(i.x,i.y);for(let n=1;n<s;n++)i=t.getPointPosition(n,e),a.lineTo(i.x,i.y);}}function drawRadiusLine(t,e,i,s){const a=t.ctx,n=e.circular,{color:o,lineWidth:r}=e;!n&&!s||!o||!r||i<0||(a.save(),a.strokeStyle=o,a.lineWidth=r,a.setLineDash(e.borderDash),a.lineDashOffset=e.borderDashOffset,a.beginPath(),pathRadiusLine(t,i,n,s),a.closePath(),a.stroke(),a.restore());}function createPointLabelContext(t,e,i){return createContext(t,{label:i,index:e,type:"pointLabel"})}LogarithmicScale.id="logarithmic",LogarithmicScale.defaults={ticks:{callback:Ticks.formatters.logarithmic,major:{enabled:!0}}};class RadialLinearScale extends LinearScaleBase{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[];}setDimensions(){const t=this._padding=toPadding(getTickBackdropHeight(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2);}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=isNumberFinite(t)&&!isNaN(t)?t:0,this.max=isNumberFinite(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions();}computeTickLimit(){return Math.ceil(this.drawingArea/getTickBackdropHeight(this.options))}generateTickLabels(t){LinearScaleBase.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map(((t,e)=>{const i=callback(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""})).filter(((t,e)=>this.chart.getDataVisibility(e)));}fit(){const t=this.options;t.display&&t.pointLabels.display?fitWithPointLabels(this):this.setCenterPoint(0,0,0,0);}setCenterPoint(t,e,i,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,s));}getIndexAngle(t){const e=TAU/(this._pointLabels.length||1),i=this.options.startAngle||0;return _normalizeAngle(t*e+toRadians(i))}getDistanceFromCenterForValue(t){if(isNullOrUndef(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(isNullOrUndef(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return createPointLabelContext(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const s=this.getIndexAngle(t)-HALF_PI+i;return {x:Math.cos(s)*e+this.xCenter,y:Math.sin(s)*e+this.yCenter,angle:s}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:s,bottom:a}=this._pointLabelItems[t];return {left:e,top:i,right:s,bottom:a}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),pathRadiusLine(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore();}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:s}=e,a=this._pointLabels.length;let n,o,r;if(e.pointLabels.display&&drawPointLabels(this,a),s.display&&this.ticks.forEach(((t,e)=>{if(0!==e){o=this.getDistanceFromCenterForValue(t.value);drawRadiusLine(this,s.setContext(this.getContext(e-1)),o,a);}})),i.display){for(t.save(),n=a-1;n>=0;n--){const s=i.setContext(this.getPointLabelContext(n)),{color:a,lineWidth:l}=s;l&&a&&(t.lineWidth=l,t.strokeStyle=a,t.setLineDash(s.borderDash),t.lineDashOffset=s.borderDashOffset,o=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),r=this.getPointPosition(n,o),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(r.x,r.y),t.stroke());}t.restore();}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let a,n;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach(((s,o)=>{if(0===o&&!e.reverse)return;const r=i.setContext(this.getContext(o)),l=toFont(r.font);if(a=this.getDistanceFromCenterForValue(this.ticks[o].value),r.showLabelBackdrop){t.font=l.string,n=t.measureText(s.label).width,t.fillStyle=r.backdropColor;const e=toPadding(r.backdropPadding);t.fillRect(-n/2-e.left,-a-l.size/2-e.top,n+e.width,l.size+e.height);}renderText(t,s.label,0,-a,l,{color:r.color});})),t.restore();}drawTitle(){}}RadialLinearScale.id="radialLinear",RadialLinearScale.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ticks.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5,centerPointLabels:!1}},RadialLinearScale.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},RadialLinearScale.descriptors={angleLines:{_fallback:"grid"}};const INTERVALS={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},UNITS=Object.keys(INTERVALS);function sorter(t,e){return t-e}function parse(t,e){if(isNullOrUndef(e))return null;const i=t._adapter,{parser:s,round:a,isoWeekday:n}=t._parseOpts;let o=e;return "function"==typeof s&&(o=s(o)),isNumberFinite(o)||(o="string"==typeof s?i.parse(o,s):i.parse(o)),null===o?null:(a&&(o="week"!==a||!isNumber(n)&&!0!==n?i.startOf(o,a):i.startOf(o,"isoWeek",n)),+o)}function determineUnitForAutoTicks(t,e,i,s){const a=UNITS.length;for(let n=UNITS.indexOf(t);n<a-1;++n){const t=INTERVALS[UNITS[n]],a=t.steps?t.steps:Number.MAX_SAFE_INTEGER;if(t.common&&Math.ceil((i-e)/(a*t.size))<=s)return UNITS[n]}return UNITS[a-1]}function determineUnitForFormatting(t,e,i,s,a){for(let n=UNITS.length-1;n>=UNITS.indexOf(i);n--){const i=UNITS[n];if(INTERVALS[i].common&&t._adapter.diff(a,s,i)>=e-1)return i}return UNITS[i?UNITS.indexOf(i):0]}function determineMajorUnit(t){for(let e=UNITS.indexOf(t)+1,i=UNITS.length;e<i;++e)if(INTERVALS[UNITS[e]].common)return UNITS[e]}function addTick(t,e,i){if(i){if(i.length){const{lo:s,hi:a}=_lookup(i,e);t[i[s]>=e?i[s]:i[a]]=!0;}}else t[e]=!0;}function setMajorTicks(t,e,i,s){const a=t._adapter,n=+a.startOf(e[0].value,s),o=e[e.length-1].value;let r,l;for(r=n;r<=o;r=+a.add(r,1,s))l=i[r],l>=0&&(e[l].major=!0);return e}function ticksFromTimestamps(t,e,i){const s=[],a={},n=e.length;let o,r;for(o=0;o<n;++o)r=e[o],a[r]=o,s.push({value:r,major:!1});return 0!==n&&i?setMajorTicks(t,s,a,i):s}class TimeScale extends Scale{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0;}init(t,e){const i=t.time||(t.time={}),s=this._adapter=new adapters._date(t.adapters.date);mergeIf(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized;}parse(t,e){return void 0===t?null:parse(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]};}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:s,max:a,minDefined:n,maxDefined:o}=this.getUserBounds();function r(t){n||isNaN(t.min)||(s=Math.min(s,t.min)),o||isNaN(t.max)||(a=Math.max(a,t.max));}n&&o||(r(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||r(this.getMinMax(!1))),s=isNumberFinite(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),a=isNumberFinite(a)&&!isNaN(a)?a:+e.endOf(Date.now(),i)+1,this.min=Math.min(s,a-1),this.max=Math.max(s+1,a);}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,s="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const a=this.min,n=this.max,o=_filterBetween(s,a,n);return this._unit=e.unit||(i.autoSkip?determineUnitForAutoTicks(e.minUnit,this.min,this.max,this._getLabelCapacity(a)):determineUnitForFormatting(this,o.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?determineMajorUnit(this._unit):void 0,this.initOffsets(s),t.reverse&&o.reverse(),ticksFromTimestamps(this,o,this._majorUnit)}initOffsets(t){let e,i,s=0,a=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),s=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,i=this.getDecimalForValue(t[t.length-1]),a=1===t.length?i:(i-this.getDecimalForValue(t[t.length-2]))/2);const n=t.length<3?.5:.25;s=_limitValue(s,0,n),a=_limitValue(a,0,n),this._offsets={start:s,end:a,factor:1/(s+1+a)};}_generate(){const t=this._adapter,e=this.min,i=this.max,s=this.options,a=s.time,n=a.unit||determineUnitForAutoTicks(a.minUnit,e,i,this._getLabelCapacity(e)),o=valueOrDefault(a.stepSize,1),r="week"===n&&a.isoWeekday,l=isNumber(r)||!0===r,h={};let c,d,u=e;if(l&&(u=+t.startOf(u,"isoWeek",r)),u=+t.startOf(u,l?"day":n),t.diff(i,e,n)>1e5*o)throw new Error(e+" and "+i+" are too far apart with stepSize of "+o+" "+n);const g="data"===s.ticks.source&&this.getDataTimestamps();for(c=u,d=0;c<i;c=+t.add(c,o,n),d++)addTick(h,c,g);return c!==i&&"ticks"!==s.bounds&&1!==d||addTick(h,c,g),Object.keys(h).sort(((t,e)=>t-e)).map((t=>+t))}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}_tickFormatFunction(t,e,i,s){const a=this.options,n=a.time.displayFormats,o=this._unit,r=this._majorUnit,l=o&&n[o],h=r&&n[r],c=i[e],d=r&&h&&c&&c.major,u=this._adapter.format(t,s||(d?h:l)),g=a.ticks.callback;return g?callback(g,[u,e,i],this):u}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e<i;++e)s=t[e],s.label=this._tickFormatFunction(s.value,e,t);}getDecimalForValue(t){return null===t?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,s=toRadians(this.isHorizontal()?e.maxRotation:e.minRotation),a=Math.cos(s),n=Math.sin(s),o=this._resolveTickFontOptions(0).size;return {w:i*a+o*n,h:i*n+o*a}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,s=i[e.unit]||i.millisecond,a=this._tickFormatFunction(t,0,ticksFromTimestamps(this,[t],this._majorUnit),s),n=this._getLabelSize(a),o=Math.floor(this.isHorizontal()?this.width/n.w:this.height/n.h)-1;return o>0?o:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(t=0,e=s.length;t<e;++t)i=i.concat(s[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(i)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const s=this.getLabels();for(e=0,i=s.length;e<i;++e)t.push(parse(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return _arrayUnique(t.sort(sorter))}}function interpolate(t,e,i){let s,a,n,o,r=0,l=t.length-1;i?(e>=t[r].pos&&e<=t[l].pos&&({lo:r,hi:l}=_lookupByKey(t,"pos",e)),({pos:s,time:n}=t[r]),({pos:a,time:o}=t[l])):(e>=t[r].time&&e<=t[l].time&&({lo:r,hi:l}=_lookupByKey(t,"time",e)),({time:s,pos:n}=t[r]),({time:a,pos:o}=t[l]));const h=a-s;return h?n+(o-n)*(e-s)/h:n}TimeScale.id="time",TimeScale.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};class TimeSeriesScale extends TimeScale{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0;}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=interpolate(e,this.min),this._tableRange=interpolate(e,this.max)-this._minPos,super.initOffsets(t);}buildLookupTable(t){const{min:e,max:i}=this,s=[],a=[];let n,o,r,l,h;for(n=0,o=t.length;n<o;++n)l=t[n],l>=e&&l<=i&&s.push(l);if(s.length<2)return [{time:e,pos:0},{time:i,pos:1}];for(n=0,o=s.length;n<o;++n)h=s[n+1],r=s[n-1],l=s[n],Math.round((h+r)/2)!==l&&a.push({time:l,pos:n/(o-1)});return a}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return t=e.length&&i.length?this.normalize(e.concat(i)):e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return (interpolate(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return interpolate(this._table,i*this._tableRange+this._minPos,!0)}}TimeSeriesScale.id="timeseries",TimeSeriesScale.defaults=TimeScale.defaults;Object.freeze({__proto__:null,CategoryScale:CategoryScale,LinearScale:LinearScale,LogarithmicScale:LogarithmicScale,RadialLinearScale:RadialLinearScale,TimeScale:TimeScale,TimeSeriesScale:TimeSeriesScale});var App=function(i){function o(){var o=i.call(this)||this;return o.initialise(),o}return __extends(o,i),o}(HoodApi);window.hood=new App;exports.App=App;Object.defineProperty(exports,'__esModule',{value:true});}));
40
+ class Animator{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0;}_notify(t,e,i,s){const n=e.listeners[s],a=e.duration;n.forEach((s=>s({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(i-e.start,a)})));}_refresh(){this._request||(this._running=!0,this._request=requestAnimFrame.call(window,(()=>{this._update(),this._request=null,this._running&&this._refresh();})));}_update(t=Date.now()){let e=0;this._charts.forEach(((i,s)=>{if(!i.running||!i.items.length)return;const n=i.items;let a,o=n.length-1,r=!1;for(;o>=0;--o)a=n[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(t),r=!0):(n[o]=n[n.length-1],n.pop());r&&(s.draw(),this._notify(s,i,t,"progress")),n.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=n.length;})),this._lastDate=t,0===e&&(this._running=!1);}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i);}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e);}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce(((t,e)=>Math.max(t,e._duration)),0),this._refresh());}running(t){if(!this._running)return !1;const e=this._charts.get(t);return !!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete");}remove(t){return this._charts.delete(t)}}var animator=new Animator;const transparent="transparent",interpolators={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){const s=color(t||transparent),n=s.valid&&color(e||transparent);return n&&n.valid?n.mix(s,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class Animation{constructor(t,e,i,s){const n=e[i];s=resolve([t.to,s,n,t.from]);const a=resolve([t.from,n,s]);this._active=!0,this._fn=t.fn||interpolators[t.type||typeof a],this._easing=effects[t.easing]||effects.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=a,this._to=s,this._promises=void 0;}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const s=this._target[this._prop],n=i-this._start,a=this._duration-n;this._start=i,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=n,this._loop=!!t.loop,this._to=resolve([t.to,e,s,t.from]),this._from=resolve([t.from,s,e]);}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1));}tick(t){const e=t-this._start,i=this._duration,s=this._prop,n=this._from,a=this._loop,o=this._to;let r;if(this._active=n!==o&&(a||e<i),!this._active)return this._target[s]=o,void this._notify(!0);e<0?this._target[s]=n:(r=e/i%2,r=a&&r>1?2-r:r,r=this._easing(Math.min(1,Math.max(0,r))),this._target[s]=this._fn(n,o,r));}wait(){const t=this._promises||(this._promises=[]);return new Promise(((e,i)=>{t.push({res:e,rej:i});}))}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let t=0;t<i.length;t++)i[t][e]();}}const numbers=["x","y","borderWidth","radius","tension"],colors=["color","borderColor","backgroundColor"];defaults.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});const animationOptions=Object.keys(defaults.animation);defaults.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),defaults.set("animations",{colors:{type:"color",properties:colors},numbers:{type:"number",properties:numbers}}),defaults.describe("animations",{_fallback:"animation"}),defaults.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}});class Animations{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e);}configure(t){if(!isObject(t))return;const e=this._properties;Object.getOwnPropertyNames(t).forEach((i=>{const s=t[i];if(!isObject(s))return;const n={};for(const t of animationOptions)n[t]=s[t];(isArray(s.properties)&&s.properties||[i]).forEach((t=>{t!==i&&e.has(t)||e.set(t,n);}));}));}_animateOptions(t,e){const i=e.options,s=resolveTargetOptions(t,i);if(!s)return [];const n=this._createAnimations(s,i);return i.$shared&&awaitAll(t.options.$animations,i).then((()=>{t.options=i;}),(()=>{})),n}_createAnimations(t,e){const i=this._properties,s=[],n=t.$animations||(t.$animations={}),a=Object.keys(e),o=Date.now();let r;for(r=a.length-1;r>=0;--r){const l=a[r];if("$"===l.charAt(0))continue;if("options"===l){s.push(...this._animateOptions(t,e));continue}const h=e[l];let c=n[l];const d=i.get(l);if(c){if(d&&c.active()){c.update(d,h,o);continue}c.cancel();}d&&d.duration?(n[l]=c=new Animation(d,t,l,h),s.push(c)):t[l]=h;}return s}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(animator.add(this._chart,i),!0):void 0}}function awaitAll(t,e){const i=[],s=Object.keys(e);for(let e=0;e<s.length;e++){const n=t[s[e]];n&&n.active()&&i.push(n.wait());}return Promise.all(i)}function resolveTargetOptions(t,e){if(!e)return;let i=t.options;if(i)return i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}})),i;t.options=e;}function scaleClip(t,e){const i=t&&t.options||{},s=i.reverse,n=void 0===i.min?e:0,a=void 0===i.max?e:0;return {start:s?a:n,end:s?n:a}}function defaultClip(t,e,i){if(!1===i)return !1;const s=scaleClip(t,i),n=scaleClip(e,i);return {top:n.end,right:s.end,bottom:n.start,left:s.start}}function toClip(t){let e,i,s,n;return isObject(t)?(e=t.top,i=t.right,s=t.bottom,n=t.left):e=i=s=n=t,{top:e,right:i,bottom:s,left:n,disabled:!1===t}}function getSortedDatasetIndices(t,e){const i=[],s=t._getSortedDatasetMetas(e);let n,a;for(n=0,a=s.length;n<a;++n)i.push(s[n].index);return i}function applyStack(t,e,i,s={}){const n=t.keys,a="single"===s.mode;let o,r,l,h;if(null!==e){for(o=0,r=n.length;o<r;++o){if(l=+n[o],l===i){if(s.all)continue;break}h=t.values[l],isNumberFinite(h)&&(a||0===e||sign(e)===sign(h))&&(e+=h);}return e}}function convertObjectDataToArray(t){const e=Object.keys(t),i=new Array(e.length);let s,n,a;for(s=0,n=e.length;s<n;++s)a=e[s],i[s]={x:a,y:t[a]};return i}function isStacked(t,e){const i=t&&t.options.stacked;return i||void 0===i&&void 0!==e.stack}function getStackKey(t,e,i){return `${t.id}.${e.id}.${i.stack||i.type}`}function getUserBounds(t){const{min:e,max:i,minDefined:s,maxDefined:n}=t.getUserBounds();return {min:s?e:Number.NEGATIVE_INFINITY,max:n?i:Number.POSITIVE_INFINITY}}function getOrCreateStack(t,e,i){const s=t[e]||(t[e]={});return s[i]||(s[i]={})}function getLastIndexInStack(t,e,i,s){for(const n of e.getMatchingVisibleMetas(s).reverse()){const e=t[n.index];if(i&&e>0||!i&&e<0)return n.index}return null}function updateStacks(t,e){const{chart:i,_cachedMeta:s}=t,n=i._stacks||(i._stacks={}),{iScale:a,vScale:o,index:r}=s,l=a.axis,h=o.axis,c=getStackKey(a,o,s),d=e.length;let u;for(let t=0;t<d;++t){const i=e[t],{[l]:a,[h]:d}=i;u=(i._stacks||(i._stacks={}))[h]=getOrCreateStack(n,c,a),u[r]=d,u._top=getLastIndexInStack(u,o,!0,s.type),u._bottom=getLastIndexInStack(u,o,!1,s.type);}}function getFirstScaleId(t,e){const i=t.scales;return Object.keys(i).filter((t=>i[t].axis===e)).shift()}function createDatasetContext(t,e){return createContext(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function createDataContext(t,e,i){return createContext(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:i,index:e,mode:"default",type:"data"})}function clearStacks(t,e){const i=t.controller.index,s=t.vScale&&t.vScale.axis;if(s){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[s]||void 0===e[s][i])return;delete e[s][i];}}}const isDirectUpdateMode=t=>"reset"===t||"none"===t,cloneIfNotShared=(t,e)=>e?t:Object.assign({},t),createStack=(t,e,i)=>t&&!e.hidden&&e._stacked&&{keys:getSortedDatasetIndices(i,!0),values:null};class DatasetController{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.$context=void 0,this._syncList=[],this.initialize();}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=isStacked(t.vScale,t),this.addElements();}updateIndex(t){this.index!==t&&clearStacks(this._cachedMeta),this.index=t;}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(t,e,i,s)=>"x"===t?e:"r"===t?s:i,n=e.xAxisID=valueOrDefault(i.xAxisID,getFirstScaleId(t,"x")),a=e.yAxisID=valueOrDefault(i.yAxisID,getFirstScaleId(t,"y")),o=e.rAxisID=valueOrDefault(i.rAxisID,getFirstScaleId(t,"r")),r=e.indexAxis,l=e.iAxisID=s(r,n,a,o),h=e.vAxisID=s(r,a,n,o);e.xScale=this.getScaleForId(n),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(o),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(h);}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset");}_destroy(){const t=this._cachedMeta;this._data&&unlistenArrayEvents(this._data,this),t._stacked&&clearStacks(t);}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(isObject(e))this._data=convertObjectDataToArray(e);else if(i!==e){if(i){unlistenArrayEvents(i,this);const t=this._cachedMeta;clearStacks(t),t._parsed=[];}e&&Object.isExtensible(e)&&listenArrayEvents(e,this),this._syncList=[],this._data=e;}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType);}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const n=e._stacked;e._stacked=isStacked(e.vScale,e),e.stack!==i.stack&&(s=!0,clearStacks(e),e.stack=i.stack),this._resyncElements(t),(s||n!==e._stacked)&&updateStacks(this,e._parsed);}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={};}parse(t,e){const{_cachedMeta:i,_data:s}=this,{iScale:n,_stacked:a}=i,o=n.axis;let r,l,h,c=0===t&&e===s.length||i._sorted,d=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=s,i._sorted=!0,h=s;else {h=isArray(s[t])?this.parseArrayData(i,s,t,e):isObject(s[t])?this.parseObjectData(i,s,t,e):this.parsePrimitiveData(i,s,t,e);const n=()=>null===l[o]||d&&l[o]<d[o];for(r=0;r<e;++r)i._parsed[r+t]=l=h[r],c&&(n()&&(c=!1),d=l);i._sorted=c;}a&&updateStacks(this,h);}parsePrimitiveData(t,e,i,s){const{iScale:n,vScale:a}=t,o=n.axis,r=a.axis,l=n.getLabels(),h=n===a,c=new Array(s);let d,u,g;for(d=0,u=s;d<u;++d)g=d+i,c[d]={[o]:h||n.parse(l[g],g),[r]:a.parse(e[g],g)};return c}parseArrayData(t,e,i,s){const{xScale:n,yScale:a}=t,o=new Array(s);let r,l,h,c;for(r=0,l=s;r<l;++r)h=r+i,c=e[h],o[r]={x:n.parse(c[0],h),y:a.parse(c[1],h)};return o}parseObjectData(t,e,i,s){const{xScale:n,yScale:a}=t,{xAxisKey:o="x",yAxisKey:r="y"}=this._parsing,l=new Array(s);let h,c,d,u;for(h=0,c=s;h<c;++h)d=h+i,u=e[d],l[h]={x:n.parse(resolveObjectKey(u,o),d),y:a.parse(resolveObjectKey(u,r),d)};return l}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const s=this.chart,n=this._cachedMeta,a=e[t.axis];return applyStack({keys:getSortedDatasetIndices(s,!0),values:e._stacks[t.axis]},a,n.index,{mode:i})}updateRangeFromParsed(t,e,i,s){const n=i[e.axis];let a=null===n?NaN:n;const o=s&&i._stacks[e.axis];s&&o&&(s.values=o,a=applyStack(s,n,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a);}getMinMax(t,e){const i=this._cachedMeta,s=i._parsed,n=i._sorted&&t===i.iScale,a=s.length,o=this._getOtherScale(t),r=createStack(e,i,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:c}=getUserBounds(o);let d,u;function g(){u=s[d];const e=u[o.axis];return !isNumberFinite(u[t.axis])||h>e||c<e}for(d=0;d<a&&(g()||(this.updateRangeFromParsed(l,t,u,r),!n));++d);if(n)for(d=a-1;d>=0;--d)if(!g()){this.updateRangeFromParsed(l,t,u,r);break}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,n,a;for(s=0,n=e.length;s<n;++s)a=e[s][t.axis],isNumberFinite(a)&&i.push(a);return i}getMaxOverflow(){return !1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,s=e.vScale,n=this.getParsed(t);return {label:i?""+i.getLabelForValue(n[i.axis]):"",value:s?""+s.getLabelForValue(n[s.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=toClip(valueOrDefault(this.options.clip,defaultClip(e.xScale,e.yScale,this.getMaxOverflow())));}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,s=i.data||[],n=e.chartArea,a=[],o=this._drawStart||0,r=this._drawCount||s.length-o,l=this.options.drawActiveElementsOnTop;let h;for(i.dataset&&i.dataset.draw(t,n,o,r),h=o;h<o+r;++h){const e=s[h];e.hidden||(e.active&&l?a.push(e):e.draw(t,n));}for(h=0;h<a.length;++h)a[h].draw(t,n);}getStyle(t,e){const i=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const s=this.getDataset();let n;if(t>=0&&t<this._cachedMeta.data.length){const e=this._cachedMeta.data[t];n=e.$context||(e.$context=createDataContext(this.getContext(),t,e)),n.parsed=this.getParsed(t),n.raw=s.data[t],n.index=n.dataIndex=t;}else n=this.$context||(this.$context=createDatasetContext(this.chart.getContext(),this.index)),n.dataset=s,n.index=n.datasetIndex=this.index;return n.active=!!e,n.mode=i,n}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const s="active"===e,n=this._cachedDataOpts,a=t+"-"+e,o=n[a],r=this.enableOptionSharing&&defined(i);if(o)return cloneIfNotShared(o,r);const l=this.chart.config,h=l.datasetElementScopeKeys(this._type,t),c=s?[`${t}Hover`,"hover",t,""]:[t,""],d=l.getOptionScopes(this.getDataset(),h),u=Object.keys(defaults.elements[t]),g=l.resolveNamedOptions(d,u,(()=>this.getContext(i,s)),c);return g.$shared&&(g.$shared=r,n[a]=Object.freeze(cloneIfNotShared(g,r))),g}_resolveAnimations(t,e,i){const s=this.chart,n=this._cachedDataOpts,a=`animation-${e}`,o=n[a];if(o)return o;let r;if(!1!==s.options.animation){const s=this.chart.config,n=s.datasetAnimationScopeKeys(this._type,e),a=s.getOptionScopes(this.getDataset(),n);r=s.createResolver(a,this.getContext(t,i,e));}const l=new Animations(s,r&&r.animations);return r&&r._cacheable&&(n[a]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return !e||isDirectUpdateMode(t)||this.chart._animationsDisabled}updateElement(t,e,i,s){isDirectUpdateMode(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i);}updateSharedOptions(t,e,i){t&&!isDirectUpdateMode(e)&&this._resolveAnimations(void 0,e).update(t,i);}_setStyle(t,e,i,s){t.active=s;const n=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(n)||n});}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1);}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0);}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1);}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0);}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];const s=i.length,n=e.length,a=Math.min(n,s);a&&this.parse(0,a),n>s?this._insertElements(s,n-s,t):n<s&&this._removeElements(n,s-n);}_insertElements(t,e,i=!0){const s=this._cachedMeta,n=s.data,a=t+e;let o;const r=t=>{for(t.length+=e,o=t.length-1;o>=a;o--)t[o]=t[o-e];};for(r(n),o=t;o<a;++o)n[o]=new this.dataElementType;this._parsing&&r(s._parsed),this.parse(t,e),i&&this.updateElements(n,t,e,"reset");}updateElements(t,e,i,s){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(t,e);i._stacked&&clearStacks(i,s);}i.data.splice(t,e);}_sync(t){if(this._parsing)this._syncList.push(t);else {const[e,i,s]=t;this[e](i,s);}this.chart._dataChanges.push([this.index,...t]);}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t]);}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1]);}_onDataShift(){this._sync(["_removeElements",0,1]);}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i]);}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length]);}}function getAllScaleValues(t,e){if(!t._cache.$bar){const i=t.getMatchingVisibleMetas(e);let s=[];for(let e=0,n=i.length;e<n;e++)s=s.concat(i[e].controller.getAllParsedValues(t));t._cache.$bar=_arrayUnique(s.sort(((t,e)=>t-e)));}return t._cache.$bar}function computeMinSampleSize(t){const e=t.iScale,i=getAllScaleValues(e,t.type);let s,n,a,o,r=e._length;const l=()=>{32767!==a&&-32768!==a&&(defined(o)&&(r=Math.min(r,Math.abs(a-o)||r)),o=a);};for(s=0,n=i.length;s<n;++s)a=e.getPixelForValue(i[s]),l();for(o=void 0,s=0,n=e.ticks.length;s<n;++s)a=e.getPixelForTick(s),l();return r}function computeFitCategoryTraits(t,e,i,s){const n=i.barThickness;let a,o;return isNullOrUndef(n)?(a=e.min*i.categoryPercentage,o=i.barPercentage):(a=n*s,o=1),{chunk:a/s,ratio:o,start:e.pixels[t]-a/2}}function computeFlexCategoryTraits(t,e,i,s){const n=e.pixels,a=n[t];let o=t>0?n[t-1]:null,r=t<n.length-1?n[t+1]:null;const l=i.categoryPercentage;null===o&&(o=a-(null===r?e.end-e.start:r-a)),null===r&&(r=a+a-o);const h=a-(a-Math.min(o,r))/2*l;return {chunk:Math.abs(r-o)/2*l/s,ratio:i.barPercentage,start:h}}function parseFloatBar(t,e,i,s){const n=i.parse(t[0],s),a=i.parse(t[1],s),o=Math.min(n,a),r=Math.max(n,a);let l=o,h=r;Math.abs(o)>Math.abs(r)&&(l=r,h=o),e[i.axis]=h,e._custom={barStart:l,barEnd:h,start:n,end:a,min:o,max:r};}function parseValue(t,e,i,s){return isArray(t)?parseFloatBar(t,e,i,s):e[i.axis]=i.parse(t,s),e}function parseArrayOrPrimitive(t,e,i,s){const n=t.iScale,a=t.vScale,o=n.getLabels(),r=n===a,l=[];let h,c,d,u;for(h=i,c=i+s;h<c;++h)u=e[h],d={},d[n.axis]=r||n.parse(o[h],h),l.push(parseValue(u,d,a,h));return l}function isFloatBar(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}function barSign(t,e,i){return 0!==t?sign(t):(e.isHorizontal()?1:-1)*(e.min>=i?1:-1)}function borderProps(t){let e,i,s,n,a;return t.horizontal?(e=t.base>t.x,i="left",s="right"):(e=t.base<t.y,i="bottom",s="top"),e?(n="end",a="start"):(n="start",a="end"),{start:i,end:s,reverse:e,top:n,bottom:a}}function setBorderSkipped(t,e,i,s){let n=e.borderSkipped;const a={};if(!n)return void(t.borderSkipped=a);const{start:o,end:r,reverse:l,top:h,bottom:c}=borderProps(t);"middle"===n&&i&&(t.enableBorderRadius=!0,(i._top||0)===s?n=h:(i._bottom||0)===s?n=c:(a[parseEdge(c,o,r,l)]=!0,n=h)),a[parseEdge(n,o,r,l)]=!0,t.borderSkipped=a;}function parseEdge(t,e,i,s){return t=s?startEnd(t=swap(t,e,i),i,e):startEnd(t,e,i)}function swap(t,e,i){return t===e?i:t===i?e:t}function startEnd(t,e,i){return "start"===t?e:"end"===t?i:t}function setInflateAmount(t,{inflateAmount:e},i){t.inflateAmount="auto"===e?1===i?.33:0:e;}DatasetController.defaults={},DatasetController.prototype.datasetElementType=null,DatasetController.prototype.dataElementType=null;class BarController extends DatasetController{parsePrimitiveData(t,e,i,s){return parseArrayOrPrimitive(t,e,i,s)}parseArrayData(t,e,i,s){return parseArrayOrPrimitive(t,e,i,s)}parseObjectData(t,e,i,s){const{iScale:n,vScale:a}=t,{xAxisKey:o="x",yAxisKey:r="y"}=this._parsing,l="x"===n.axis?o:r,h="x"===a.axis?o:r,c=[];let d,u,g,p;for(d=i,u=i+s;d<u;++d)p=e[d],g={},g[n.axis]=n.parse(resolveObjectKey(p,l),d),c.push(parseValue(resolveObjectKey(p,h),g,a,d));return c}updateRangeFromParsed(t,e,i,s){super.updateRangeFromParsed(t,e,i,s);const n=i._custom;n&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,n.min),t.max=Math.max(t.max,n.max));}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:s}=e,n=this.getParsed(t),a=n._custom,o=isFloatBar(a)?"["+a.start+", "+a.end+"]":""+s.getLabelForValue(n[s.axis]);return {label:""+i.getLabelForValue(n[i.axis]),value:o}}initialize(){this.enableOptionSharing=!0,super.initialize();this._cachedMeta.stack=this.getDataset().stack;}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t);}updateElements(t,e,i,s){const n="reset"===s,{index:a,_cachedMeta:{vScale:o}}=this,r=o.getBasePixel(),l=o.isHorizontal(),h=this._getRuler(),c=this.resolveDataElementOptions(e,s),d=this.getSharedOptions(c),u=this.includeOptions(s,d);this.updateSharedOptions(d,s,c);for(let c=e;c<e+i;c++){const e=this.getParsed(c),i=n||isNullOrUndef(e[o.axis])?{base:r,head:r}:this._calculateBarValuePixels(c),g=this._calculateBarIndexPixels(c,h),p=(e._stacks||{})[o.axis],f={horizontal:l,base:i.base,enableBorderRadius:!p||isFloatBar(e._custom)||a===p._top||a===p._bottom,x:l?i.head:g.center,y:l?g.center:i.head,height:l?g.size:Math.abs(i.size),width:l?Math.abs(i.size):g.size};u&&(f.options=d||this.resolveDataElementOptions(c,t[c].active?"active":s));const m=f.options||t[c].options;setBorderSkipped(f,m,p,a),setInflateAmount(f,m,h.ratio),this.updateElement(t[c],c,f,s);}}_getStacks(t,e){const i=this._cachedMeta.iScale,s=i.getMatchingVisibleMetas(this._type),n=i.options.stacked,a=s.length,o=[];let r,l;for(r=0;r<a;++r)if(l=s[r],l.controller.options.grouped){if(void 0!==e){const t=l.controller.getParsed(e)[l.controller._cachedMeta.vScale.axis];if(isNullOrUndef(t)||isNaN(t))continue}if((!1===n||-1===o.indexOf(l.stack)||void 0===n&&void 0===l.stack)&&o.push(l.stack),l.index===t)break}return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const s=this._getStacks(t,i),n=void 0!==e?s.indexOf(e):-1;return -1===n?s.length-1:n}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,s=[];let n,a;for(n=0,a=e.data.length;n<a;++n)s.push(i.getPixelForValue(this.getParsed(n)[i.axis],n));const o=t.barThickness;return {min:o||computeMinSampleSize(e),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:o?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i},options:{base:s,minBarLength:n}}=this,a=s||0,o=this.getParsed(t),r=o._custom,l=isFloatBar(r);let h,c,d=o[e.axis],u=0,g=i?this.applyStack(e,o,i):d;g!==d&&(u=g-d,g=d),l&&(d=r.barStart,g=r.barEnd-r.barStart,0!==d&&sign(d)!==sign(r.barEnd)&&(u=0),u+=d);const p=isNullOrUndef(s)||l?u:s;let f=e.getPixelForValue(p);if(h=this.chart.getDataVisibility(t)?e.getPixelForValue(u+g):f,c=h-f,Math.abs(c)<n&&(c=barSign(c,e,a)*n,d===a&&(f-=c/2),h=f+c),f===e.getPixelForValue(a)){const t=sign(c)*e.getLineWidthForValue(a)/2;f+=t,c-=t;}return {size:c,base:f,head:h,center:h+c/2}}_calculateBarIndexPixels(t,e){const i=e.scale,s=this.options,n=s.skipNull,a=valueOrDefault(s.maxBarThickness,1/0);let o,r;if(e.grouped){const i=n?this._getStackCount(t):e.stackCount,l="flex"===s.barThickness?computeFlexCategoryTraits(t,e,s,i):computeFitCategoryTraits(t,e,s,i),h=this._getStackIndex(this.index,this._cachedMeta.stack,n?t:void 0);o=l.start+l.chunk*h+l.chunk/2,r=Math.min(a,l.chunk*l.ratio);}else o=i.getPixelForValue(this.getParsed(t)[i.axis],t),r=Math.min(a,e.min*e.ratio);return {base:o-r/2,head:o+r/2,center:o,size:r}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,s=i.length;let n=0;for(;n<s;++n)null!==this.getParsed(n)[e.axis]&&i[n].draw(this._ctx);}}BarController.id="bar",BarController.defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}},BarController.overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};class BubbleController extends DatasetController{initialize(){this.enableOptionSharing=!0,super.initialize();}parsePrimitiveData(t,e,i,s){const n=super.parsePrimitiveData(t,e,i,s);for(let t=0;t<n.length;t++)n[t]._custom=this.resolveDataElementOptions(t+i).radius;return n}parseArrayData(t,e,i,s){const n=super.parseArrayData(t,e,i,s);for(let t=0;t<n.length;t++){const s=e[i+t];n[t]._custom=valueOrDefault(s[2],this.resolveDataElementOptions(t+i).radius);}return n}parseObjectData(t,e,i,s){const n=super.parseObjectData(t,e,i,s);for(let t=0;t<n.length;t++){const s=e[i+t];n[t]._custom=valueOrDefault(s&&s.r&&+s.r,this.resolveDataElementOptions(t+i).radius);}return n}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,{xScale:i,yScale:s}=e,n=this.getParsed(t),a=i.getLabelForValue(n.x),o=s.getLabelForValue(n.y),r=n._custom;return {label:e.label,value:"("+a+", "+o+(r?", "+r:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t);}updateElements(t,e,i,s){const n="reset"===s,{iScale:a,vScale:o}=this._cachedMeta,r=this.resolveDataElementOptions(e,s),l=this.getSharedOptions(r),h=this.includeOptions(s,l),c=a.axis,d=o.axis;for(let r=e;r<e+i;r++){const e=t[r],i=!n&&this.getParsed(r),l={},u=l[c]=n?a.getPixelForDecimal(.5):a.getPixelForValue(i[c]),g=l[d]=n?o.getBasePixel():o.getPixelForValue(i[d]);l.skip=isNaN(u)||isNaN(g),h&&(l.options=this.resolveDataElementOptions(r,e.active?"active":s),n&&(l.options.radius=0)),this.updateElement(e,r,l,s);}this.updateSharedOptions(l,s,r);}resolveDataElementOptions(t,e){const i=this.getParsed(t);let s=super.resolveDataElementOptions(t,e);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const n=s.radius;return "active"!==e&&(s.radius=0),s.radius+=valueOrDefault(i&&i._custom,n),s}}function getRatioAndOffset(t,e,i){let s=1,n=1,a=0,o=0;if(e<TAU){const r=t,l=r+e,h=Math.cos(r),c=Math.sin(r),d=Math.cos(l),u=Math.sin(l),g=(t,e,s)=>_angleBetween(t,r,l,!0)?1:Math.max(e,e*i,s,s*i),p=(t,e,s)=>_angleBetween(t,r,l,!0)?-1:Math.min(e,e*i,s,s*i),f=g(0,h,d),m=g(HALF_PI,c,u),x=p(PI,h,d),b=p(PI+HALF_PI,c,u);s=(f-x)/2,n=(m-b)/2,a=-(f+x)/2,o=-(m+b)/2;}return {ratioX:s,ratioY:n,offsetX:a,offsetY:o}}BubbleController.id="bubble",BubbleController.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}},BubbleController.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title:()=>""}}}};class DoughnutController extends DatasetController{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0;}linkScales(){}parse(t,e){const i=this.getDataset().data,s=this._cachedMeta;if(!1===this._parsing)s._parsed=i;else {let n,a,o=t=>+i[t];if(isObject(i[t])){const{key:t="value"}=this._parsing;o=e=>+resolveObjectKey(i[e],t);}for(n=t,a=t+e;n<a;++n)s._parsed[n]=o(n);}}_getRotation(){return toRadians(this.options.rotation-90)}_getCircumference(){return toRadians(this.options.circumference)}_getRotationExtents(){let t=TAU,e=-TAU;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)){const s=this.chart.getDatasetMeta(i).controller,n=s._getRotation(),a=s._getCircumference();t=Math.min(t,n),e=Math.max(e,n+a);}return {rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,s=this._cachedMeta,n=s.data,a=this.getMaxBorderWidth()+this.getMaxOffset(n)+this.options.spacing,o=Math.max((Math.min(i.width,i.height)-a)/2,0),r=Math.min(toPercentage(this.options.cutout,o),1),l=this._getRingWeight(this.index),{circumference:h,rotation:c}=this._getRotationExtents(),{ratioX:d,ratioY:u,offsetX:g,offsetY:p}=getRatioAndOffset(c,h,r),f=(i.width-a)/d,m=(i.height-a)/u,x=Math.max(Math.min(f,m)/2,0),b=toDimension(this.options.radius,x),_=(b-Math.max(b*r,0))/this._getVisibleDatasetWeightTotal();this.offsetX=g*b,this.offsetY=p*b,s.total=this.calculateTotal(),this.outerRadius=b-_*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-_*l,0),this.updateElements(n,0,n.length,t);}_circumference(t,e){const i=this.options,s=this._cachedMeta,n=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===s._parsed[t]||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*n/TAU)}updateElements(t,e,i,s){const n="reset"===s,a=this.chart,o=a.chartArea,r=a.options.animation,l=(o.left+o.right)/2,h=(o.top+o.bottom)/2,c=n&&r.animateScale,d=c?0:this.innerRadius,u=c?0:this.outerRadius,g=this.resolveDataElementOptions(e,s),p=this.getSharedOptions(g),f=this.includeOptions(s,p);let m,x=this._getRotation();for(m=0;m<e;++m)x+=this._circumference(m,n);for(m=e;m<e+i;++m){const e=this._circumference(m,n),i=t[m],a={x:l+this.offsetX,y:h+this.offsetY,startAngle:x,endAngle:x+e,circumference:e,outerRadius:u,innerRadius:d};f&&(a.options=p||this.resolveDataElementOptions(m,i.active?"active":s)),x+=e,this.updateElement(i,m,a,s);}this.updateSharedOptions(p,s,g);}calculateTotal(){const t=this._cachedMeta,e=t.data;let i,s=0;for(i=0;i<e.length;i++){const n=t._parsed[i];null===n||isNaN(n)||!this.chart.getDataVisibility(i)||e[i].hidden||(s+=Math.abs(n));}return s}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?TAU*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],n=formatNumber(e._parsed[t],i.options.locale);return {label:s[t]||"",value:n}}getMaxBorderWidth(t){let e=0;const i=this.chart;let s,n,a,o,r;if(!t)for(s=0,n=i.data.datasets.length;s<n;++s)if(i.isDatasetVisible(s)){a=i.getDatasetMeta(s),t=a.data,o=a.controller;break}if(!t)return 0;for(s=0,n=t.length;s<n;++s)r=o.resolveDataElementOptions(s),"inner"!==r.borderAlign&&(e=Math.max(e,r.borderWidth||0,r.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,s=t.length;i<s;++i){const t=this.resolveDataElementOptions(i);e=Math.max(e,t.offset||0,t.hoverOffset||0);}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(valueOrDefault(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}DoughnutController.id="doughnut",DoughnutController.defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"},DoughnutController.descriptors={_scriptable:t=>"spacing"!==t,_indexable:t=>"spacing"!==t},DoughnutController.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map(((e,s)=>{const n=t.getDatasetMeta(0).controller.getStyle(s);return {text:e,fillStyle:n.backgroundColor,strokeStyle:n.borderColor,lineWidth:n.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(s),index:s}}))}return []}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update();}},tooltip:{callbacks:{title:()=>"",label(t){let e=t.label;const i=": "+t.formattedValue;return isArray(e)?(e=e.slice(),e[0]+=i):e+=i,e}}}}};class LineController extends DatasetController{initialize(){this.enableOptionSharing=!0,super.initialize();}update(t){const e=this._cachedMeta,{dataset:i,data:s=[],_dataset:n}=e,a=this.chart._animationsDisabled;let{start:o,count:r}=getStartAndCountOfVisiblePoints(e,s,a);this._drawStart=o,this._drawCount=r,scaleRangesChanged(e)&&(o=0,r=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!n._decimated,i.points=s;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!a,options:l},t),this.updateElements(s,o,r,t);}updateElements(t,e,i,s){const n="reset"===s,{iScale:a,vScale:o,_stacked:r,_dataset:l}=this._cachedMeta,h=this.resolveDataElementOptions(e,s),c=this.getSharedOptions(h),d=this.includeOptions(s,c),u=a.axis,g=o.axis,{spanGaps:p,segment:f}=this.options,m=isNumber(p)?p:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||n||"none"===s;let b=e>0&&this.getParsed(e-1);for(let h=e;h<e+i;++h){const e=t[h],i=this.getParsed(h),p=x?e:{},_=isNullOrUndef(i[g]),y=p[u]=a.getPixelForValue(i[u],h),v=p[g]=n||_?o.getBasePixel():o.getPixelForValue(r?this.applyStack(o,i,r):i[g],h);p.skip=isNaN(y)||isNaN(v)||_,p.stop=h>0&&i[u]-b[u]>m,f&&(p.parsed=i,p.raw=l.data[h]),d&&(p.options=c||this.resolveDataElementOptions(h,e.active?"active":s)),x||this.updateElement(e,h,p,s),b=i;}this.updateSharedOptions(c,s,h);}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const n=s[0].size(this.resolveDataElementOptions(0)),a=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,n,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw();}}function getStartAndCountOfVisiblePoints(t,e,i){const s=e.length;let n=0,a=s;if(t._sorted){const{iScale:o,_parsed:r}=t,l=o.axis,{min:h,max:c,minDefined:d,maxDefined:u}=o.getUserBounds();d&&(n=_limitValue(Math.min(_lookupByKey(r,o.axis,h).lo,i?s:_lookupByKey(e,l,o.getPixelForValue(h)).lo),0,s-1)),a=u?_limitValue(Math.max(_lookupByKey(r,o.axis,c).hi+1,i?0:_lookupByKey(e,l,o.getPixelForValue(c)).hi+1),n,s)-n:s-n;}return {start:n,count:a}}function scaleRangesChanged(t){const{xScale:e,yScale:i,_scaleRanges:s}=t,n={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!s)return t._scaleRanges=n,!0;const a=s.xmin!==e.min||s.xmax!==e.max||s.ymin!==i.min||s.ymax!==i.max;return Object.assign(s,n),a}LineController.id="line",LineController.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},LineController.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class PolarAreaController extends DatasetController{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0;}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],n=formatNumber(e._parsed[t].r,i.options.locale);return {label:s[t]||"",value:n}}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t);}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),n=Math.max(s/2,0),a=(n-Math.max(i.cutoutPercentage?n/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=n-a*this.index,this.innerRadius=this.outerRadius-a;}updateElements(t,e,i,s){const n="reset"===s,a=this.chart,o=this.getDataset(),r=a.options.animation,l=this._cachedMeta.rScale,h=l.xCenter,c=l.yCenter,d=l.getIndexAngle(0)-.5*PI;let u,g=d;const p=360/this.countVisibleElements();for(u=0;u<e;++u)g+=this._computeAngle(u,s,p);for(u=e;u<e+i;u++){const e=t[u];let i=g,f=g+this._computeAngle(u,s,p),m=a.getDataVisibility(u)?l.getDistanceFromCenterForValue(o.data[u]):0;g=f,n&&(r.animateScale&&(m=0),r.animateRotate&&(i=f=d));const x={x:h,y:c,innerRadius:0,outerRadius:m,startAngle:i,endAngle:f,options:this.resolveDataElementOptions(u,e.active?"active":s)};this.updateElement(e,u,x,s);}}countVisibleElements(){const t=this.getDataset(),e=this._cachedMeta;let i=0;return e.data.forEach(((e,s)=>{!isNaN(t.data[s])&&this.chart.getDataVisibility(s)&&i++;})),i}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?toRadians(this.resolveDataElementOptions(t,e).angle||i):0}}PolarAreaController.id="polarArea",PolarAreaController.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},PolarAreaController.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map(((e,s)=>{const n=t.getDatasetMeta(0).controller.getStyle(s);return {text:e,fillStyle:n.backgroundColor,strokeStyle:n.borderColor,lineWidth:n.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(s),index:s}}))}return []}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update();}},tooltip:{callbacks:{title:()=>"",label:t=>t.chart.data.labels[t.dataIndex]+": "+t.formattedValue}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class PieController extends DoughnutController{}PieController.id="pie",PieController.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class RadarController extends DatasetController{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return {label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}update(t){const e=this._cachedMeta,i=e.dataset,s=e.data||[],n=e.iScale.getLabels();if(i.points=s,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const a={_loop:!0,_fullLoop:n.length===s.length,options:e};this.updateElement(i,void 0,a,t);}this.updateElements(s,0,s.length,t);}updateElements(t,e,i,s){const n=this.getDataset(),a=this._cachedMeta.rScale,o="reset"===s;for(let r=e;r<e+i;r++){const e=t[r],i=this.resolveDataElementOptions(r,e.active?"active":s),l=a.getPointPositionForValue(r,n.data[r]),h=o?a.xCenter:l.x,c=o?a.yCenter:l.y,d={x:h,y:c,angle:l.angle,skip:isNaN(h)||isNaN(c),options:i};this.updateElement(e,r,d,s);}}}RadarController.id="radar",RadarController.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}},RadarController.overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};class ScatterController extends LineController{}ScatterController.id="scatter",ScatterController.defaults={showLine:!1,fill:!1},ScatterController.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title:()=>"",label:t=>"("+t.label+", "+t.formattedValue+")"}}},scales:{x:{type:"linear"},y:{type:"linear"}}};Object.freeze({__proto__:null,BarController:BarController,BubbleController:BubbleController,DoughnutController:DoughnutController,LineController:LineController,PolarAreaController:PolarAreaController,PieController:PieController,RadarController:RadarController,ScatterController:ScatterController});function abstract(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class DateAdapter{constructor(t){this.options=t||{};}formats(){return abstract()}parse(t,e){return abstract()}format(t,e){return abstract()}add(t,e,i){return abstract()}diff(t,e,i){return abstract()}startOf(t,e,i){return abstract()}endOf(t,e){return abstract()}}DateAdapter.override=function(t){Object.assign(DateAdapter.prototype,t);};var adapters={_date:DateAdapter};function getRelativePosition(t,e){return "native"in t?{x:t.x,y:t.y}:getRelativePosition$1(t,e)}function evaluateAllVisibleItems(t,e){const i=t.getSortedVisibleDatasetMetas();let s,n,a;for(let t=0,o=i.length;t<o;++t){({index:s,data:n}=i[t]);for(let t=0,i=n.length;t<i;++t)a=n[t],a.skip||e(a,s,t);}}function binarySearch(t,e,i,s){const{controller:n,data:a,_sorted:o}=t,r=n._cachedMeta.iScale;if(r&&e===r.axis&&"r"!==e&&o&&a.length){const t=r._reversePixels?_rlookupByKey:_lookupByKey;if(!s)return t(a,e,i);if(n._sharedOptions){const s=a[0],n="function"==typeof s.getRange&&s.getRange(e);if(n){const s=t(a,e,i-n),o=t(a,e,i+n);return {lo:s.lo,hi:o.hi}}}}return {lo:0,hi:a.length-1}}function optimizedEvaluateItems(t,e,i,s,n){const a=t.getSortedVisibleDatasetMetas(),o=i[e];for(let t=0,i=a.length;t<i;++t){const{index:i,data:r}=a[t],{lo:l,hi:h}=binarySearch(a[t],e,o,n);for(let t=l;t<=h;++t){const e=r[t];e.skip||s(e,i,t);}}}function getDistanceMetricForAxis(t){const e=-1!==t.indexOf("x"),i=-1!==t.indexOf("y");return function(t,s){const n=e?Math.abs(t.x-s.x):0,a=i?Math.abs(t.y-s.y):0;return Math.sqrt(Math.pow(n,2)+Math.pow(a,2))}}function getIntersectItems(t,e,i,s){const n=[];if(!_isPointInArea(e,t.chartArea,t._minPadding))return n;return optimizedEvaluateItems(t,i,e,(function(t,i,a){t.inRange(e.x,e.y,s)&&n.push({element:t,datasetIndex:i,index:a});}),!0),n}function getNearestRadialItems(t,e,i,s){let n=[];return optimizedEvaluateItems(t,i,e,(function(t,i,a){const{startAngle:o,endAngle:r}=t.getProps(["startAngle","endAngle"],s),{angle:l}=getAngleFromPoint(t,{x:e.x,y:e.y});_angleBetween(l,o,r)&&n.push({element:t,datasetIndex:i,index:a});})),n}function getNearestCartesianItems(t,e,i,s,n){let a=[];const o=getDistanceMetricForAxis(i);let r=Number.POSITIVE_INFINITY;return optimizedEvaluateItems(t,i,e,(function(i,l,h){const c=i.inRange(e.x,e.y,n);if(s&&!c)return;const d=i.getCenterPoint(n);if(!_isPointInArea(d,t.chartArea,t._minPadding)&&!c)return;const u=o(e,d);u<r?(a=[{element:i,datasetIndex:l,index:h}],r=u):u===r&&a.push({element:i,datasetIndex:l,index:h});})),a}function getNearestItems(t,e,i,s,n){return _isPointInArea(e,t.chartArea,t._minPadding)?"r"!==i||s?getNearestCartesianItems(t,e,i,s,n):getNearestRadialItems(t,e,i,n):[]}function getAxisItems(t,e,i,s){const n=getRelativePosition(e,t),a=[],o=i.axis,r="x"===o?"inXRange":"inYRange";let l=!1;return evaluateAllVisibleItems(t,((t,e,i)=>{t[r](n[o],s)&&a.push({element:t,datasetIndex:e,index:i}),t.inRange(n.x,n.y,s)&&(l=!0);})),i.intersect&&!l?[]:a}var Interaction={modes:{index(t,e,i,s){const n=getRelativePosition(e,t),a=i.axis||"x",o=i.intersect?getIntersectItems(t,n,a,s):getNearestItems(t,n,a,!1,s),r=[];return o.length?(t.getSortedVisibleDatasetMetas().forEach((t=>{const e=o[0].index,i=t.data[e];i&&!i.skip&&r.push({element:i,datasetIndex:t.index,index:e});})),r):[]},dataset(t,e,i,s){const n=getRelativePosition(e,t),a=i.axis||"xy";let o=i.intersect?getIntersectItems(t,n,a,s):getNearestItems(t,n,a,!1,s);if(o.length>0){const e=o[0].datasetIndex,i=t.getDatasetMeta(e).data;o=[];for(let t=0;t<i.length;++t)o.push({element:i[t],datasetIndex:e,index:t});}return o},point:(t,e,i,s)=>getIntersectItems(t,getRelativePosition(e,t),i.axis||"xy",s),nearest:(t,e,i,s)=>getNearestItems(t,getRelativePosition(e,t),i.axis||"xy",i.intersect,s),x:(t,e,i,s)=>getAxisItems(t,e,{axis:"x",intersect:i.intersect},s),y:(t,e,i,s)=>getAxisItems(t,e,{axis:"y",intersect:i.intersect},s)}};const STATIC_POSITIONS=["left","top","right","bottom"];function filterByPosition(t,e){return t.filter((t=>t.pos===e))}function filterDynamicPositionByAxis(t,e){return t.filter((t=>-1===STATIC_POSITIONS.indexOf(t.pos)&&t.box.axis===e))}function sortByWeight(t,e){return t.sort(((t,i)=>{const s=e?i:t,n=e?t:i;return s.weight===n.weight?s.index-n.index:s.weight-n.weight}))}function wrapBoxes(t){const e=[];let i,s,n,a,o,r;for(i=0,s=(t||[]).length;i<s;++i)n=t[i],({position:a,options:{stack:o,stackWeight:r=1}}=n),e.push({index:i,box:n,pos:a,horizontal:n.isHorizontal(),weight:n.weight,stack:o&&a+o,stackWeight:r});return e}function buildStacks(t){const e={};for(const i of t){const{stack:t,pos:s,stackWeight:n}=i;if(!t||!STATIC_POSITIONS.includes(s))continue;const a=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=n;}return e}function setLayoutDims(t,e){const i=buildStacks(t),{vBoxMaxWidth:s,hBoxMaxHeight:n}=e;let a,o,r;for(a=0,o=t.length;a<o;++a){r=t[a];const{fullSize:o}=r.box,l=i[r.stack],h=l&&r.stackWeight/l.weight;r.horizontal?(r.width=h?h*s:o&&e.availableWidth,r.height=n):(r.width=s,r.height=h?h*n:o&&e.availableHeight);}return i}function buildLayoutBoxes(t){const e=wrapBoxes(t),i=sortByWeight(e.filter((t=>t.box.fullSize)),!0),s=sortByWeight(filterByPosition(e,"left"),!0),n=sortByWeight(filterByPosition(e,"right")),a=sortByWeight(filterByPosition(e,"top"),!0),o=sortByWeight(filterByPosition(e,"bottom")),r=filterDynamicPositionByAxis(e,"x"),l=filterDynamicPositionByAxis(e,"y");return {fullSize:i,leftAndTop:s.concat(a),rightAndBottom:n.concat(l).concat(o).concat(r),chartArea:filterByPosition(e,"chartArea"),vertical:s.concat(n).concat(l),horizontal:a.concat(o).concat(r)}}function getCombinedMax(t,e,i,s){return Math.max(t[i],e[i])+Math.max(t[s],e[s])}function updateMaxPadding(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right);}function updateDims(t,e,i,s){const{pos:n,box:a}=i,o=t.maxPadding;if(!isObject(n)){i.size&&(t[n]-=i.size);const e=s[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?a.height:a.width),i.size=e.size/e.count,t[n]+=i.size;}a.getPadding&&updateMaxPadding(o,a.getPadding());const r=Math.max(0,e.outerWidth-getCombinedMax(o,t,"left","right")),l=Math.max(0,e.outerHeight-getCombinedMax(o,t,"top","bottom")),h=r!==t.w,c=l!==t.h;return t.w=r,t.h=l,i.horizontal?{same:h,other:c}:{same:c,other:h}}function handleMaxPadding(t){const e=t.maxPadding;function i(i){const s=Math.max(e[i]-t[i],0);return t[i]+=s,s}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom");}function getMargins(t,e){const i=e.maxPadding;function s(t){const s={left:0,top:0,right:0,bottom:0};return t.forEach((t=>{s[t]=Math.max(e[t],i[t]);})),s}return s(t?["left","right"]:["top","bottom"])}function fitBoxes(t,e,i,s){const n=[];let a,o,r,l,h,c;for(a=0,o=t.length,h=0;a<o;++a){r=t[a],l=r.box,l.update(r.width||e.w,r.height||e.h,getMargins(r.horizontal,e));const{same:o,other:d}=updateDims(e,i,r,s);h|=o&&n.length,c=c||d,l.fullSize||n.push(r);}return h&&fitBoxes(n,e,i,s)||c}function setBoxDims(t,e,i,s,n){t.top=i,t.left=e,t.right=e+s,t.bottom=i+n,t.width=s,t.height=n;}function placeBoxes(t,e,i,s){const n=i.padding;let{x:a,y:o}=e;for(const r of t){const t=r.box,l=s[r.stack]||{count:1,placed:0,weight:1},h=r.stackWeight/l.weight||1;if(r.horizontal){const s=e.w*h,a=l.size||t.height;defined(l.start)&&(o=l.start),t.fullSize?setBoxDims(t,n.left,o,i.outerWidth-n.right-n.left,a):setBoxDims(t,e.left+l.placed,o,s,a),l.start=o,l.placed+=s,o=t.bottom;}else {const s=e.h*h,o=l.size||t.width;defined(l.start)&&(a=l.start),t.fullSize?setBoxDims(t,a,n.top,o,i.outerHeight-n.bottom-n.top):setBoxDims(t,a,e.top+l.placed,o,s),l.start=a,l.placed+=s,a=t.right;}}e.x=a,e.y=o;}defaults.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}});var layouts={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return [{z:0,draw(t){e.draw(t);}}]},t.boxes.push(e);},removeBox(t,e){const i=t.boxes?t.boxes.indexOf(e):-1;-1!==i&&t.boxes.splice(i,1);},configure(t,e,i){e.fullSize=i.fullSize,e.position=i.position,e.weight=i.weight;},update(t,e,i,s){if(!t)return;const n=toPadding(t.options.layout.padding),a=Math.max(e-n.width,0),o=Math.max(i-n.height,0),r=buildLayoutBoxes(t.boxes),l=r.vertical,h=r.horizontal;each(t.boxes,(t=>{"function"==typeof t.beforeLayout&&t.beforeLayout();}));const c=l.reduce(((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1),0)||1,d=Object.freeze({outerWidth:e,outerHeight:i,padding:n,availableWidth:a,availableHeight:o,vBoxMaxWidth:a/2/c,hBoxMaxHeight:o/2}),u=Object.assign({},n);updateMaxPadding(u,toPadding(s));const g=Object.assign({maxPadding:u,w:a,h:o,x:n.left,y:n.top},n),p=setLayoutDims(l.concat(h),d);fitBoxes(r.fullSize,g,d,p),fitBoxes(l,g,d,p),fitBoxes(h,g,d,p)&&fitBoxes(l,g,d,p),handleMaxPadding(g),placeBoxes(r.leftAndTop,g,d,p),g.x+=g.w,g.y+=g.h,placeBoxes(r.rightAndBottom,g,d,p),t.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},each(r.chartArea,(e=>{const i=e.box;Object.assign(i,t.chartArea),i.update(g.w,g.h,{left:0,top:0,right:0,bottom:0});}));}};class BasePlatform{acquireContext(t,e){}releaseContext(t){return !1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return !0}updateConfig(t){}}class BasicPlatform extends BasePlatform{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1;}}const EVENT_TYPES={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},isNullOrEmpty=t=>null===t||""===t;function initCanvas(t,e){const i=t.style,s=t.getAttribute("height"),n=t.getAttribute("width");if(t.$chartjs={initial:{height:s,width:n,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",isNullOrEmpty(n)){const e=readUsedSize(t,"width");void 0!==e&&(t.width=e);}if(isNullOrEmpty(s))if(""===t.style.height)t.height=t.width/(e||2);else {const e=readUsedSize(t,"height");void 0!==e&&(t.height=e);}return t}const eventListenerOptions=!!supportsEventListenerOptions&&{passive:!0};function addListener(t,e,i){t.addEventListener(e,i,eventListenerOptions);}function removeListener(t,e,i){t.canvas.removeEventListener(e,i,eventListenerOptions);}function fromNativeEvent(t,e){const i=EVENT_TYPES[t.type]||t.type,{x:s,y:n}=getRelativePosition$1(t,e);return {type:i,chart:e,native:t,x:void 0!==s?s:null,y:void 0!==n?n:null}}function nodeListContains(t,e){for(const i of t)if(i===e||i.contains(e))return !0}function createAttachObserver(t,e,i){const s=t.canvas,n=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||nodeListContains(i.addedNodes,s),e=e&&!nodeListContains(i.removedNodes,s);e&&i();}));return n.observe(document,{childList:!0,subtree:!0}),n}function createDetachObserver(t,e,i){const s=t.canvas,n=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||nodeListContains(i.removedNodes,s),e=e&&!nodeListContains(i.addedNodes,s);e&&i();}));return n.observe(document,{childList:!0,subtree:!0}),n}const drpListeningCharts=new Map;let oldDevicePixelRatio=0;function onWindowResize(){const t=window.devicePixelRatio;t!==oldDevicePixelRatio&&(oldDevicePixelRatio=t,drpListeningCharts.forEach(((e,i)=>{i.currentDevicePixelRatio!==t&&e();})));}function listenDevicePixelRatioChanges(t,e){drpListeningCharts.size||window.addEventListener("resize",onWindowResize),drpListeningCharts.set(t,e);}function unlistenDevicePixelRatioChanges(t){drpListeningCharts.delete(t),drpListeningCharts.size||window.removeEventListener("resize",onWindowResize);}function createResizeObserver(t,e,i){const s=t.canvas,n=s&&_getParentNode(s);if(!n)return;const a=throttled(((t,e)=>{const s=n.clientWidth;i(t,e),s<n.clientWidth&&i();}),window),o=new ResizeObserver((t=>{const e=t[0],i=e.contentRect.width,s=e.contentRect.height;0===i&&0===s||a(i,s);}));return o.observe(n),listenDevicePixelRatioChanges(t,a),o}function releaseObserver(t,e,i){i&&i.disconnect(),"resize"===e&&unlistenDevicePixelRatioChanges(t);}function createProxyAndListen(t,e,i){const s=t.canvas,n=throttled((e=>{null!==t.ctx&&i(fromNativeEvent(e,t));}),t,(t=>{const e=t[0];return [e,e.offsetX,e.offsetY]}));return addListener(s,e,n),n}class DomPlatform extends BasePlatform{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(initCanvas(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e.$chartjs)return !1;const i=e.$chartjs.initial;["height","width"].forEach((t=>{const s=i[t];isNullOrUndef(s)?e.removeAttribute(t):e.setAttribute(t,s);}));const s=i.style||{};return Object.keys(s).forEach((t=>{e.style[t]=s[t];})),e.width=e.width,delete e.$chartjs,!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),n={attach:createAttachObserver,detach:createDetachObserver,resize:createResizeObserver}[e]||createProxyAndListen;s[e]=n(t,e,i);}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;(({attach:releaseObserver,detach:releaseObserver,resize:releaseObserver})[e]||removeListener)(t,e,s),i[e]=void 0;}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return getMaximumSize(t,e,i,s)}isAttached(t){const e=_getParentNode(t);return !(!e||!e.isConnected)}}function _detectPlatform(t){return !_isDomSupported()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?BasicPlatform:DomPlatform}class Element$1{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0;}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return {x:e,y:i}}hasValue(){return isNumber(this.x)&&isNumber(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const s={};return t.forEach((t=>{s[t]=i[t]&&i[t].active()?i[t]._to:this[t];})),s}}Element$1.defaults={},Element$1.defaultRoutes=void 0;const formatters={values:t=>isArray(t)?t:""+t,numeric(t,e,i){if(0===t)return "0";const s=this.chart.options.locale;let n,a=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(n="scientific"),a=calculateDelta(t,i);}const o=log10(Math.abs(a)),r=Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:n,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(l,this.options.ticks.format),formatNumber(t,s,l)},logarithmic(t,e,i){if(0===t)return "0";const s=t/Math.pow(10,Math.floor(log10(t)));return 1===s||2===s||5===s?formatters.numeric.call(this,t,e,i):""}};function calculateDelta(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t)),i}var Ticks={formatters:formatters};function autoSkip(t,e){const i=t.options.ticks,s=i.maxTicksLimit||determineMaxTicks(t),n=i.major.enabled?getMajorIndices(e):[],a=n.length,o=n[0],r=n[a-1],l=[];if(a>s)return skipMajors(e,l,n,a/s),l;const h=calculateSpacing(n,e,s);if(a>0){let t,i;const s=a>1?Math.round((r-o)/(a-1)):null;for(skip(e,l,h,isNullOrUndef(s)?0:o-s,o),t=0,i=a-1;t<i;t++)skip(e,l,h,n[t],n[t+1]);return skip(e,l,h,r,isNullOrUndef(s)?e.length:r+s),l}return skip(e,l,h),l}function determineMaxTicks(t){const e=t.options.offset,i=t._tickSize(),s=t._length/i+(e?0:1),n=t._maxLength/i;return Math.floor(Math.min(s,n))}function calculateSpacing(t,e,i){const s=getEvenSpacing(t),n=e.length/i;if(!s)return Math.max(n,1);const a=_factorize(s);for(let t=0,e=a.length-1;t<e;t++){const e=a[t];if(e>n)return e}return Math.max(n,1)}function getMajorIndices(t){const e=[];let i,s;for(i=0,s=t.length;i<s;i++)t[i].major&&e.push(i);return e}function skipMajors(t,e,i,s){let n,a=0,o=i[0];for(s=Math.ceil(s),n=0;n<t.length;n++)n===o&&(e.push(t[n]),a++,o=i[a*s]);}function skip(t,e,i,s,n){const a=valueOrDefault(s,0),o=Math.min(valueOrDefault(n,t.length),t.length);let r,l,h,c=0;for(i=Math.ceil(i),n&&(r=n-s,i=r/Math.floor(r/i)),h=a;h<0;)c++,h=Math.round(a+c*i);for(l=Math.max(a,0);l<o;l++)l===h&&(e.push(t[l]),c++,h=Math.round(a+c*i));}function getEvenSpacing(t){const e=t.length;let i,s;if(e<2)return !1;for(s=t[0],i=1;i<e;++i)if(t[i]-t[i-1]!==s)return !1;return s}defaults.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Ticks.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),defaults.route("scale.ticks","color","","color"),defaults.route("scale.grid","color","","borderColor"),defaults.route("scale.grid","borderColor","","borderColor"),defaults.route("scale.title","color","","color"),defaults.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t}),defaults.describe("scales",{_fallback:"scale"}),defaults.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t});const reverseAlign=t=>"left"===t?"right":"right"===t?"left":t,offsetFromEdge=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i;function sample(t,e){const i=[],s=t.length/e,n=t.length;let a=0;for(;a<n;a+=s)i.push(t[Math.floor(a)]);return i}function getPixelForGridLine(t,e,i){const s=t.ticks.length,n=Math.min(e,s-1),a=t._startPixel,o=t._endPixel,r=1e-6;let l,h=t.getPixelForTick(n);if(!(i&&(l=1===s?Math.max(h-a,o-h):0===e?(t.getPixelForTick(1)-h)/2:(h-t.getPixelForTick(n-1))/2,h+=n<e?l:-l,h<a-r||h>o+r)))return h}function garbageCollect(t,e){each(t,(t=>{const i=t.gc,s=i.length/2;let n;if(s>e){for(n=0;n<s;++n)delete t.data[i[n]];i.splice(0,s);}}));}function getTickMarkLength(t){return t.drawTicks?t.tickLength:0}function getTitleHeight(t,e){if(!t.display)return 0;const i=toFont(t.font,e),s=toPadding(t.padding);return (isArray(t.text)?t.text.length:1)*i.lineHeight+s.height}function createScaleContext(t,e){return createContext(t,{scale:e,type:"scale"})}function createTickContext(t,e,i){return createContext(t,{tick:i,index:e,type:"tick"})}function titleAlign(t,e,i){let s=_toLeftRightCenter(t);return (i&&"right"!==e||!i&&"right"===e)&&(s=reverseAlign(s)),s}function titleArgs(t,e,i,s){const{top:n,left:a,bottom:o,right:r,chart:l}=t,{chartArea:h,scales:c}=l;let d,u,g,p=0;const f=o-n,m=r-a;if(t.isHorizontal()){if(u=_alignStartEnd(s,a,r),isObject(i)){const t=Object.keys(i)[0],s=i[t];g=c[t].getPixelForValue(s)+f-e;}else g="center"===i?(h.bottom+h.top)/2+f-e:offsetFromEdge(t,i,e);d=r-a;}else {if(isObject(i)){const t=Object.keys(i)[0],s=i[t];u=c[t].getPixelForValue(s)-m+e;}else u="center"===i?(h.left+h.right)/2-m+e:offsetFromEdge(t,i,e);g=_alignStartEnd(s,o,n),p="left"===i?-HALF_PI:HALF_PI;}return {titleX:u,titleY:g,maxWidth:d,rotation:p}}class Scale extends Element$1{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0;}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax);}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:s}=this;return t=finiteOrDefault(t,Number.POSITIVE_INFINITY),e=finiteOrDefault(e,Number.NEGATIVE_INFINITY),i=finiteOrDefault(i,Number.POSITIVE_INFINITY),s=finiteOrDefault(s,Number.NEGATIVE_INFINITY),{min:finiteOrDefault(t,i),max:finiteOrDefault(e,s),minDefined:isNumberFinite(t),maxDefined:isNumberFinite(e)}}getMinMax(t){let e,{min:i,max:s,minDefined:n,maxDefined:a}=this.getUserBounds();if(n&&a)return {min:i,max:s};const o=this.getMatchingVisibleMetas();for(let r=0,l=o.length;r<l;++r)e=o[r].controller.getMinMax(this,t),n||(i=Math.min(i,e.min)),a||(s=Math.max(s,e.max));return i=a&&i>s?s:i,s=n&&i>s?i:s,{min:finiteOrDefault(i,finiteOrDefault(s,i)),max:finiteOrDefault(s,finiteOrDefault(i,s))}}getPadding(){return {left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1;}beforeUpdate(){callback(this.options.beforeUpdate,[this]);}update(t,e,i){const{beginAtZero:s,grace:n,ticks:a}=this.options,o=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=_addGrace(this,n,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const r=o<this.ticks.length;this._convertTicksToLabels(r?sample(this.ticks,o):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||"auto"===a.source)&&(this.ticks=autoSkip(this,this.ticks),this._labelSizes=null),r&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate();}configure(){let t,e,i=this.options.reverse;this.isHorizontal()?(t=this.left,e=this.right):(t=this.top,e=this.bottom,i=!i),this._startPixel=t,this._endPixel=e,this._reversePixels=i,this._length=e-t,this._alignToPixels=this.options.alignToPixels;}afterUpdate(){callback(this.options.afterUpdate,[this]);}beforeSetDimensions(){callback(this.options.beforeSetDimensions,[this]);}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0;}afterSetDimensions(){callback(this.options.afterSetDimensions,[this]);}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),callback(this.options[t],[this]);}beforeDataLimits(){this._callHooks("beforeDataLimits");}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits");}beforeBuildTicks(){this._callHooks("beforeBuildTicks");}buildTicks(){return []}afterBuildTicks(){this._callHooks("afterBuildTicks");}beforeTickToLabelConversion(){callback(this.options.beforeTickToLabelConversion,[this]);}generateTickLabels(t){const e=this.options.ticks;let i,s,n;for(i=0,s=t.length;i<s;i++)n=t[i],n.label=callback(e.callback,[n.value,i,t],this);}afterTickToLabelConversion(){callback(this.options.afterTickToLabelConversion,[this]);}beforeCalculateLabelRotation(){callback(this.options.beforeCalculateLabelRotation,[this]);}calculateLabelRotation(){const t=this.options,e=t.ticks,i=this.ticks.length,s=e.minRotation||0,n=e.maxRotation;let a,o,r,l=s;if(!this._isVisible()||!e.display||s>=n||i<=1||!this.isHorizontal())return void(this.labelRotation=s);const h=this._getLabelSizes(),c=h.widest.width,d=h.highest.height,u=_limitValue(this.chart.width-c,0,this.maxWidth);a=t.offset?this.maxWidth/i:u/(i-1),c+6>a&&(a=u/(i-(t.offset?.5:1)),o=this.maxHeight-getTickMarkLength(t.grid)-e.padding-getTitleHeight(t.title,this.chart.options.font),r=Math.sqrt(c*c+d*d),l=toDegrees(Math.min(Math.asin(_limitValue((h.highest.height+6)/a,-1,1)),Math.asin(_limitValue(o/r,-1,1))-Math.asin(_limitValue(d/r,-1,1)))),l=Math.max(s,Math.min(n,l))),this.labelRotation=l;}afterCalculateLabelRotation(){callback(this.options.afterCalculateLabelRotation,[this]);}beforeFit(){callback(this.options.beforeFit,[this]);}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:n}}=this,a=this._isVisible(),o=this.isHorizontal();if(a){const a=getTitleHeight(s,e.options.font);if(o?(t.width=this.maxWidth,t.height=getTickMarkLength(n)+a):(t.height=this.maxHeight,t.width=getTickMarkLength(n)+a),i.display&&this.ticks.length){const{first:e,last:s,widest:n,highest:a}=this._getLabelSizes(),r=2*i.padding,l=toRadians(this.labelRotation),h=Math.cos(l),c=Math.sin(l);if(o){const e=i.mirror?0:c*n.width+h*a.height;t.height=Math.min(this.maxHeight,t.height+e+r);}else {const e=i.mirror?0:h*n.width+c*a.height;t.width=Math.min(this.maxWidth,t.width+e+r);}this._calculatePadding(e,s,c,h);}}this._handleMargins(),o?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom);}_calculatePadding(t,e,i,s){const{ticks:{align:n,padding:a},position:o}=this.options,r=0!==this.labelRotation,l="top"!==o&&"x"===this.axis;if(this.isHorizontal()){const o=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1);let c=0,d=0;r?l?(c=s*t.width,d=i*e.height):(c=i*t.height,d=s*e.width):"start"===n?d=e.width:"end"===n?c=t.width:(c=t.width/2,d=e.width/2),this.paddingLeft=Math.max((c-o+a)*this.width/(this.width-o),0),this.paddingRight=Math.max((d-h+a)*this.width/(this.width-h),0);}else {let i=e.height/2,s=t.height/2;"start"===n?(i=0,s=t.height):"end"===n&&(i=e.height,s=0),this.paddingTop=i+a,this.paddingBottom=s+a;}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom));}afterFit(){callback(this.options.afterFit,[this]);}isHorizontal(){const{axis:t,position:e}=this.options;return "top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e<i;e++)isNullOrUndef(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion();}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=sample(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length);}return t}_computeLabelSizes(t,e){const{ctx:i,_longestTextCache:s}=this,n=[],a=[];let o,r,l,h,c,d,u,g,p,f,m,x=0,b=0;for(o=0;o<e;++o){if(h=t[o].label,c=this._resolveTickFontOptions(o),i.font=d=c.string,u=s[d]=s[d]||{data:{},gc:[]},g=c.lineHeight,p=f=0,isNullOrUndef(h)||isArray(h)){if(isArray(h))for(r=0,l=h.length;r<l;++r)m=h[r],isNullOrUndef(m)||isArray(m)||(p=_measureText(i,u.data,u.gc,p,m),f+=g);}else p=_measureText(i,u.data,u.gc,p,h),f=g;n.push(p),a.push(f),x=Math.max(p,x),b=Math.max(f,b);}garbageCollect(s,e);const _=n.indexOf(x),y=a.indexOf(b),v=t=>({width:n[t]||0,height:a[t]||0});return {first:v(0),last:v(e-1),widest:v(_),highest:v(y),widths:n,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return _int16Range(this._alignToPixels?_alignPixel(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=createTickContext(this.getContext(),t,i))}return this.$context||(this.$context=createScaleContext(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=toRadians(this.labelRotation),i=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),n=this._getLabelSizes(),a=t.autoSkipPadding||0,o=n?n.widest.width+a:0,r=n?n.highest.height+a:0;return this.isHorizontal()?r*i>o*s?o/i:r/s:r*s<o*i?r/i:o/s}_isVisible(){const t=this.options.display;return "auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,s=this.options,{grid:n,position:a}=s,o=n.offset,r=this.isHorizontal(),l=this.ticks.length+(o?1:0),h=getTickMarkLength(n),c=[],d=n.setContext(this.getContext()),u=d.drawBorder?d.borderWidth:0,g=u/2,p=function(t){return _alignPixel(i,t,u)};let f,m,x,b,_,y,v,S,k,M,P,D;if("top"===a)f=p(this.bottom),y=this.bottom-h,S=f-g,M=p(t.top)+g,D=t.bottom;else if("bottom"===a)f=p(this.top),M=t.top,D=p(t.bottom)-g,y=f+g,S=this.top+h;else if("left"===a)f=p(this.right),_=this.right-h,v=f-g,k=p(t.left)+g,P=t.right;else if("right"===a)f=p(this.left),k=t.left,P=p(t.right)-g,_=f+g,v=this.left+h;else if("x"===e){if("center"===a)f=p((t.top+t.bottom)/2+.5);else if(isObject(a)){const t=Object.keys(a)[0],e=a[t];f=p(this.chart.scales[t].getPixelForValue(e));}M=t.top,D=t.bottom,y=f+g,S=y+h;}else if("y"===e){if("center"===a)f=p((t.left+t.right)/2);else if(isObject(a)){const t=Object.keys(a)[0],e=a[t];f=p(this.chart.scales[t].getPixelForValue(e));}_=f-g,v=_-h,k=t.left,P=t.right;}const w=valueOrDefault(s.ticks.maxTicksLimit,l),C=Math.max(1,Math.ceil(l/w));for(m=0;m<l;m+=C){const t=n.setContext(this.getContext(m)),e=t.lineWidth,s=t.color,a=n.borderDash||[],l=t.borderDashOffset,h=t.tickWidth,d=t.tickColor,u=t.tickBorderDash||[],g=t.tickBorderDashOffset;x=getPixelForGridLine(this,m,o),void 0!==x&&(b=_alignPixel(i,x,e),r?_=v=k=P=b:y=S=M=D=b,c.push({tx1:_,ty1:y,tx2:v,ty2:S,x1:k,y1:M,x2:P,y2:D,width:e,color:s,borderDash:a,borderDashOffset:l,tickWidth:h,tickColor:d,tickBorderDash:u,tickBorderDashOffset:g}));}return this._ticksLength=l,this._borderValue=f,c}_computeLabelItems(t){const e=this.axis,i=this.options,{position:s,ticks:n}=i,a=this.isHorizontal(),o=this.ticks,{align:r,crossAlign:l,padding:h,mirror:c}=n,d=getTickMarkLength(i.grid),u=d+h,g=c?-h:u,p=-toRadians(this.labelRotation),f=[];let m,x,b,_,y,v,S,k,M,P,D,w,C="middle";if("top"===s)v=this.bottom-g,S=this._getXAxisLabelAlignment();else if("bottom"===s)v=this.top+g,S=this._getXAxisLabelAlignment();else if("left"===s){const t=this._getYAxisLabelAlignment(d);S=t.textAlign,y=t.x;}else if("right"===s){const t=this._getYAxisLabelAlignment(d);S=t.textAlign,y=t.x;}else if("x"===e){if("center"===s)v=(t.top+t.bottom)/2+u;else if(isObject(s)){const t=Object.keys(s)[0],e=s[t];v=this.chart.scales[t].getPixelForValue(e)+u;}S=this._getXAxisLabelAlignment();}else if("y"===e){if("center"===s)y=(t.left+t.right)/2-u;else if(isObject(s)){const t=Object.keys(s)[0],e=s[t];y=this.chart.scales[t].getPixelForValue(e);}S=this._getYAxisLabelAlignment(d).textAlign;}"y"===e&&("start"===r?C="top":"end"===r&&(C="bottom"));const A=this._getLabelSizes();for(m=0,x=o.length;m<x;++m){b=o[m],_=b.label;const t=n.setContext(this.getContext(m));k=this.getPixelForTick(m)+n.labelOffset,M=this._resolveTickFontOptions(m),P=M.lineHeight,D=isArray(_)?_.length:1;const e=D/2,i=t.color,r=t.textStrokeColor,h=t.textStrokeWidth;let d;if(a?(y=k,w="top"===s?"near"===l||0!==p?-D*P+P/2:"center"===l?-A.highest.height/2-e*P+P:-A.highest.height+P/2:"near"===l||0!==p?P/2:"center"===l?A.highest.height/2-e*P:A.highest.height-D*P,c&&(w*=-1)):(v=k,w=(1-D)*P/2),t.showLabelBackdrop){const e=toPadding(t.backdropPadding),i=A.heights[m],s=A.widths[m];let n=v+w-e.top,a=y-e.left;switch(C){case"middle":n-=i/2;break;case"bottom":n-=i;}switch(S){case"center":a-=s/2;break;case"right":a-=s;}d={left:a,top:n,width:s+e.width,height:i+e.height,color:t.backdropColor};}f.push({rotation:p,label:_,font:M,color:i,strokeColor:r,strokeWidth:h,textOffset:w,textAlign:S,textBaseline:C,translation:[y,v],backdrop:d});}return f}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-toRadians(this.labelRotation))return "top"===t?"left":"right";let i="center";return "start"===e.align?i="left":"end"===e.align&&(i="right"),i}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:s,padding:n}}=this.options,a=t+n,o=this._getLabelSizes().widest.width;let r,l;return "left"===e?s?(l=this.right+n,"near"===i?r="left":"center"===i?(r="center",l+=o/2):(r="right",l+=o)):(l=this.right-a,"near"===i?r="right":"center"===i?(r="center",l-=o/2):(r="left",l=this.left)):"right"===e?s?(l=this.left+n,"near"===i?r="right":"center"===i?(r="center",l-=o/2):(r="left",l-=o)):(l=this.left+a,"near"===i?r="left":"center"===i?(r="center",l+=o/2):(r="right",l=this.right)):r="right",{textAlign:r,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;return "left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:s,width:n,height:a}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,n,a),t.restore());}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const i=this.ticks.findIndex((e=>e.value===t));if(i>=0){return e.setContext(this.getContext(i)).lineWidth}return 0}drawGrid(t){const e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let n,a;const o=(t,e,s)=>{s.width&&s.color&&(i.save(),i.lineWidth=s.width,i.strokeStyle=s.color,i.setLineDash(s.borderDash||[]),i.lineDashOffset=s.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore());};if(e.display)for(n=0,a=s.length;n<a;++n){const t=s[n];e.drawOnChartArea&&o({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),e.drawTicks&&o({x:t.tx1,y:t.ty1},{x:t.tx2,y:t.ty2},{color:t.tickColor,width:t.tickWidth,borderDash:t.tickBorderDash,borderDashOffset:t.tickBorderDashOffset});}}drawBorder(){const{chart:t,ctx:e,options:{grid:i}}=this,s=i.setContext(this.getContext()),n=i.drawBorder?s.borderWidth:0;if(!n)return;const a=i.setContext(this.getContext(0)).lineWidth,o=this._borderValue;let r,l,h,c;this.isHorizontal()?(r=_alignPixel(t,this.left,n)-n/2,l=_alignPixel(t,this.right,a)+a/2,h=c=o):(h=_alignPixel(t,this.top,n)-n/2,c=_alignPixel(t,this.bottom,a)+a/2,r=l=o),e.save(),e.lineWidth=s.borderWidth,e.strokeStyle=s.borderColor,e.beginPath(),e.moveTo(r,h),e.lineTo(l,c),e.stroke(),e.restore();}drawLabels(t){if(!this.options.ticks.display)return;const e=this.ctx,i=this._computeLabelArea();i&&clipArea(e,i);const s=this._labelItems||(this._labelItems=this._computeLabelItems(t));let n,a;for(n=0,a=s.length;n<a;++n){const t=s[n],i=t.font,a=t.label;t.backdrop&&(e.fillStyle=t.backdrop.color,e.fillRect(t.backdrop.left,t.backdrop.top,t.backdrop.width,t.backdrop.height));let o=t.textOffset;renderText(e,a,0,o,i,t);}i&&unclipArea(e);}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:s}}=this;if(!i.display)return;const n=toFont(i.font),a=toPadding(i.padding),o=i.align;let r=n.lineHeight/2;"bottom"===e||"center"===e||isObject(e)?(r+=a.bottom,isArray(i.text)&&(r+=n.lineHeight*(i.text.length-1))):r+=a.top;const{titleX:l,titleY:h,maxWidth:c,rotation:d}=titleArgs(this,r,e,o);renderText(t,i.text,0,0,n,{color:i.color,maxWidth:c,rotation:d,textAlign:titleAlign(o,e,s),textBaseline:"middle",translation:[l,h]});}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t));}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=valueOrDefault(t.grid&&t.grid.z,-1);return this._isVisible()&&this.draw===Scale.prototype.draw?[{z:i,draw:t=>{this.drawBackground(),this.drawGrid(t),this.drawTitle();}},{z:i+1,draw:()=>{this.drawBorder();}},{z:e,draw:t=>{this.drawLabels(t);}}]:[{z:e,draw:t=>{this.draw(t);}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let n,a;for(n=0,a=e.length;n<a;++n){const a=e[n];a[i]!==this.id||t&&a.type!==t||s.push(a);}return s}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return toFont(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return (this.isHorizontal()?this.width:this.height)/t}}class TypedRegistry{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null);}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let i;isIChartComponent(e)&&(i=this.register(e));const s=this.items,n=t.id,a=this.scope+"."+n;if(!n)throw new Error("class does not have id: "+t);return n in s||(s[n]=t,registerDefaults(t,a,i),this.override&&defaults.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,s=this.scope;i in e&&delete e[i],s&&i in defaults[s]&&(delete defaults[s][i],this.override&&delete overrides[i]);}}function registerDefaults(t,e,i){const s=merge(Object.create(null),[i?defaults.get(i):{},defaults.get(e),t.defaults]);defaults.set(e,s),t.defaultRoutes&&routeDefaults(e,t.defaultRoutes),t.descriptors&&defaults.describe(e,t.descriptors);}function routeDefaults(t,e){Object.keys(e).forEach((i=>{const s=i.split("."),n=s.pop(),a=[t].concat(s).join("."),o=e[i].split("."),r=o.pop(),l=o.join(".");defaults.route(a,n,l,r);}));}function isIChartComponent(t){return "id"in t&&"defaults"in t}class Registry{constructor(){this.controllers=new TypedRegistry(DatasetController,"datasets",!0),this.elements=new TypedRegistry(Element$1,"elements"),this.plugins=new TypedRegistry(Object,"plugins"),this.scales=new TypedRegistry(Scale,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements];}add(...t){this._each("register",t);}remove(...t){this._each("unregister",t);}addControllers(...t){this._each("register",t,this.controllers);}addElements(...t){this._each("register",t,this.elements);}addPlugins(...t){this._each("register",t,this.plugins);}addScales(...t){this._each("register",t,this.scales);}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers);}removeElements(...t){this._each("unregister",t,this.elements);}removePlugins(...t){this._each("unregister",t,this.plugins);}removeScales(...t){this._each("unregister",t,this.scales);}_each(t,e,i){[...e].forEach((e=>{const s=i||this._getRegistryForType(e);i||s.isForType(e)||s===this.plugins&&e.id?this._exec(t,s,e):each(e,(e=>{const s=i||this._getRegistryForType(e);this._exec(t,s,e);}));}));}_exec(t,e,i){const s=_capitalize(t);callback(i["before"+s],[],i),e[t](i),callback(i["after"+s],[],i);}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const s=e.get(t);if(void 0===s)throw new Error('"'+t+'" is not a registered '+i+".");return s}}var registry=new Registry;class PluginService{constructor(){this._init=[];}notify(t,e,i,s){"beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const n=s?this._descriptors(t).filter(s):this._descriptors(t),a=this._notify(n,t,e,i);return "afterDestroy"===e&&(this._notify(n,t,"stop"),this._notify(this._init,t,"uninstall")),a}_notify(t,e,i,s){s=s||{};for(const n of t){const t=n.plugin,a=t[i],o=[e,s,n.options];if(!1===callback(a,o,t)&&s.cancelable)return !1}return !0}invalidate(){isNullOrUndef(this._cache)||(this._oldCache=this._cache,this._cache=void 0);}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,s=valueOrDefault(i.options&&i.options.plugins,{}),n=allPlugins(i);return !1!==s||e?createDescriptors(t,n,s,e):[]}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,s=(t,e)=>t.filter((t=>!e.some((e=>t.plugin.id===e.plugin.id))));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start");}}function allPlugins(t){const e=[],i=Object.keys(registry.plugins.items);for(let t=0;t<i.length;t++)e.push(registry.getPlugin(i[t]));const s=t.plugins||[];for(let t=0;t<s.length;t++){const i=s[t];-1===e.indexOf(i)&&e.push(i);}return e}function getOpts(t,e){return e||!1!==t?!0===t?{}:t:null}function createDescriptors(t,e,i,s){const n=[],a=t.getContext();for(let o=0;o<e.length;o++){const r=e[o],l=getOpts(i[r.id],s);null!==l&&n.push({plugin:r,options:pluginOpts(t.config,r,l,a)});}return n}function pluginOpts(t,e,i,s){const n=t.pluginScopeKeys(e),a=t.getOptionScopes(i,n);return t.createResolver(a,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function getIndexAxis(t,e){const i=defaults.datasets[t]||{};return ((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function getAxisFromDefaultScaleID(t,e){let i=t;return "_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}function getDefaultScaleIDFromAxis(t,e){return t===e?"_index_":"_value_"}function axisFromPosition(t){return "top"===t||"bottom"===t?"x":"left"===t||"right"===t?"y":void 0}function determineAxis(t,e){return "x"===t||"y"===t?t:e.axis||axisFromPosition(e.position)||t.charAt(0).toLowerCase()}function mergeScaleConfig(t,e){const i=overrides[t.type]||{scales:{}},s=e.scales||{},n=getIndexAxis(t.type,e),a=Object.create(null),o=Object.create(null);return Object.keys(s).forEach((t=>{const e=s[t];if(!isObject(e))return console.error(`Invalid scale configuration for scale: ${t}`);if(e._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${t}`);const r=determineAxis(t,e),l=getDefaultScaleIDFromAxis(r,n),h=i.scales||{};a[r]=a[r]||t,o[t]=mergeIf(Object.create(null),[{axis:r},e,h[r],h[l]]);})),t.data.datasets.forEach((i=>{const n=i.type||t.type,r=i.indexAxis||getIndexAxis(n,e),l=(overrides[n]||{}).scales||{};Object.keys(l).forEach((t=>{const e=getAxisFromDefaultScaleID(t,r),n=i[e+"AxisID"]||a[e]||e;o[n]=o[n]||Object.create(null),mergeIf(o[n],[{axis:e},s[n],l[t]]);}));})),Object.keys(o).forEach((t=>{const e=o[t];mergeIf(e,[defaults.scales[e.type],defaults.scale]);})),o}function initOptions(t){const e=t.options||(t.options={});e.plugins=valueOrDefault(e.plugins,{}),e.scales=mergeScaleConfig(t,e);}function initData(t){return (t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}function initConfig(t){return (t=t||{}).data=initData(t.data),initOptions(t),t}const keyCache=new Map,keysCached=new Set;function cachedKeys(t,e){let i=keyCache.get(t);return i||(i=e(),keyCache.set(t,i),keysCached.add(i)),i}const addIfFound=(t,e,i)=>{const s=resolveObjectKey(e,i);void 0!==s&&t.add(s);};class Config{constructor(t){this._config=initConfig(t),this._scopeCache=new Map,this._resolverCache=new Map;}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t;}get data(){return this._config.data}set data(t){this._config.data=initData(t);}get options(){return this._config.options}set options(t){this._config.options=t;}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),initOptions(t);}clearCache(){this._scopeCache.clear(),this._resolverCache.clear();}datasetScopeKeys(t){return cachedKeys(t,(()=>[[`datasets.${t}`,""]]))}datasetAnimationScopeKeys(t,e){return cachedKeys(`${t}.transition.${e}`,(()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]]))}datasetElementScopeKeys(t,e){return cachedKeys(`${t}-${e}`,(()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]]))}pluginScopeKeys(t){const e=t.id;return cachedKeys(`${this.type}-plugin-${e}`,(()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]]))}_cachedScopes(t,e){const i=this._scopeCache;let s=i.get(t);return s&&!e||(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){const{options:s,type:n}=this,a=this._cachedScopes(t,i),o=a.get(e);if(o)return o;const r=new Set;e.forEach((e=>{t&&(r.add(t),e.forEach((e=>addIfFound(r,t,e)))),e.forEach((t=>addIfFound(r,s,t))),e.forEach((t=>addIfFound(r,overrides[n]||{},t))),e.forEach((t=>addIfFound(r,defaults,t))),e.forEach((t=>addIfFound(r,descriptors,t)));}));const l=Array.from(r);return 0===l.length&&l.push(Object.create(null)),keysCached.has(e)&&a.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return [t,overrides[e]||{},defaults.datasets[e]||{},{type:e},defaults,descriptors]}resolveNamedOptions(t,e,i,s=[""]){const n={$shared:!0},{resolver:a,subPrefixes:o}=getResolver(this._resolverCache,t,s);let r=a;if(needContext(a,e)){n.$shared=!1,i=isFunction(i)?i():i;const e=this.createResolver(t,i,o);r=_attachContext(a,i,e);}for(const t of e)n[t]=r[t];return n}createResolver(t,e,i=[""],s){const{resolver:n}=getResolver(this._resolverCache,t,i);return isObject(e)?_attachContext(n,e,void 0,s):n}}function getResolver(t,e,i){let s=t.get(e);s||(s=new Map,t.set(e,s));const n=i.join();let a=s.get(n);if(!a){a={resolver:_createResolver(e,i),subPrefixes:i.filter((t=>!t.toLowerCase().includes("hover")))},s.set(n,a);}return a}const hasFunction=t=>isObject(t)&&Object.getOwnPropertyNames(t).reduce(((e,i)=>e||isFunction(t[i])),!1);function needContext(t,e){const{isScriptable:i,isIndexable:s}=_descriptors(t);for(const n of e){const e=i(n),a=s(n),o=(a||e)&&t[n];if(e&&(isFunction(o)||hasFunction(o))||a&&isArray(o))return !0}return !1}var version="3.7.1";const KNOWN_POSITIONS=["top","bottom","left","right","chartArea"];function positionIsHorizontal(t,e){return "top"===t||"bottom"===t||-1===KNOWN_POSITIONS.indexOf(t)&&"x"===e}function compare2Level(t,e){return function(i,s){return i[t]===s[t]?i[e]-s[e]:i[t]-s[t]}}function onAnimationsComplete(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),callback(i&&i.onComplete,[t],e);}function onAnimationProgress(t){const e=t.chart,i=e.options.animation;callback(i&&i.onProgress,[t],e);}function getCanvas(t){return _isDomSupported()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const instances={},getChart=t=>{const e=getCanvas(t);return Object.values(instances).filter((t=>t.canvas===e)).pop()};function moveNumericKeys(t,e,i){const s=Object.keys(t);for(const n of s){const s=+n;if(s>=e){const a=t[n];delete t[n],(i>0||s>e)&&(t[s+i]=a);}}}function determineLastEvent(t,e,i,s){return i&&"mouseout"!==t.type?s?e:t:null}class Chart{constructor(t,e){const i=this.config=new Config(e),s=getCanvas(t),n=getChart(s);if(n)throw new Error("Canvas is already in use. Chart with ID '"+n.id+"' must be destroyed before the canvas can be reused.");const a=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||_detectPlatform(s)),this.platform.updateConfig(i);const o=this.platform.acquireContext(s,a.aspectRatio),r=o&&o.canvas,l=r&&r.height,h=r&&r.width;this.id=uid(),this.ctx=o,this.canvas=r,this.width=h,this.height=l,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new PluginService,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=debounce((t=>this.update(t)),a.resizeDelay||0),this._dataChanges=[],instances[this.id]=this,o&&r?(animator.listen(this,"complete",onAnimationsComplete),animator.listen(this,"progress",onAnimationProgress),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item");}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:n}=this;return isNullOrUndef(t)?e&&n?n:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t;}get options(){return this._options}set options(t){this.config.options=t;}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():retinaScale(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return clearCanvas(this.canvas,this.ctx),this}stop(){return animator.stop(this),this}resize(t,e){animator.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e);}_resize(t,e){const i=this.options,s=this.canvas,n=i.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(s,t,e,n),o=i.devicePixelRatio||this.platform.getDevicePixelRatio(),r=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,retinaScale(this,o,!0)&&(this.notifyPlugins("resize",{size:a}),callback(i.onResize,[this,a],this),this.attached&&this._doResize(r)&&this.render());}ensureScalesHaveIDs(){const t=this.options.scales||{};each(t,((t,e)=>{t.id=e;}));}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce(((t,e)=>(t[e]=!1,t)),{});let n=[];e&&(n=n.concat(Object.keys(e).map((t=>{const i=e[t],s=determineAxis(t,i),n="r"===s,a="x"===s;return {options:i,dposition:n?"chartArea":a?"bottom":"left",dtype:n?"radialLinear":a?"category":"linear"}})))),each(n,(e=>{const n=e.options,a=n.id,o=determineAxis(a,n),r=valueOrDefault(n.type,e.dtype);void 0!==n.position&&positionIsHorizontal(n.position,o)===positionIsHorizontal(e.dposition)||(n.position=e.dposition),s[a]=!0;let l=null;if(a in i&&i[a].type===r)l=i[a];else {l=new(registry.getScale(r))({id:a,type:r,ctx:this.ctx,chart:this}),i[l.id]=l;}l.init(n,t);})),each(s,((t,e)=>{t||delete i[e];})),each(i,(t=>{layouts.configure(this,t,t.options),layouts.addBox(this,t);}));}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort(((t,e)=>t.index-e.index)),i>e){for(let t=e;t<i;++t)this._destroyDatasetMeta(t);t.splice(e,i-e);}this._sortedMetasets=t.slice(0).sort(compare2Level("order","index"));}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach(((t,i)=>{0===e.filter((e=>e===t._dataset)).length&&this._destroyDatasetMeta(i);}));}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i<s;i++){const s=e[i];let n=this.getDatasetMeta(i);const a=s.type||this.config.type;if(n.type&&n.type!==a&&(this._destroyDatasetMeta(i),n=this.getDatasetMeta(i)),n.type=a,n.indexAxis=s.indexAxis||getIndexAxis(a,this.options),n.order=s.order||0,n.index=i,n.label=""+s.label,n.visible=this.isDatasetVisible(i),n.controller)n.controller.updateIndex(i),n.controller.linkScales();else {const e=registry.getController(a),{datasetElementType:s,dataElementType:o}=defaults.datasets[a];Object.assign(e.prototype,{dataElementType:registry.getElement(o),datasetElementType:s&&registry.getElement(s)}),n.controller=new e(this,i),t.push(n.controller);}}return this._updateMetasets(),t}_resetElements(){each(this.data.datasets,((t,e)=>{this.getDatasetMeta(e).controller.reset();}),this);}reset(){this._resetElements(),this.notifyPlugins("reset");}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const n=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let t=0,e=this.data.datasets.length;t<e;t++){const{controller:e}=this.getDatasetMeta(t),i=!s&&-1===n.indexOf(e);e.buildOrUpdateElements(i),a=Math.max(+e.getMaxOverflow(),a);}a=this._minPadding=i.layout.autoPadding?a:0,this._updateLayout(a),s||each(n,(t=>{t.reset();})),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(compare2Level("z","_idx"));const{_active:o,_lastEvent:r}=this;r?this._eventHandler(r,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render();}_updateScales(){each(this.scales,(t=>{layouts.removeBox(this,t);})),this.ensureScalesHaveIDs(),this.buildOrUpdateScales();}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);setsEqual(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents());}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:n}of e){moveNumericKeys(t,s,"_removeElements"===i?-n:n);}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=e=>new Set(t.filter((t=>t[0]===e)).map(((t,e)=>e+","+t.splice(1).join(",")))),s=i(0);for(let t=1;t<e;t++)if(!setsEqual(s,i(t)))return;return Array.from(s).map((t=>t.split(","))).map((t=>({method:t[1],start:+t[2],count:+t[3]})))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;layouts.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],each(this.boxes,(t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()));}),this),this._layers.forEach(((t,e)=>{t._idx=e;})),this.notifyPlugins("afterLayout");}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t<e;++t)this.getDatasetMeta(t).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,isFunction(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t});}}_updateDataset(t,e){const i=this.getDatasetMeta(t),s={meta:i,index:t,mode:e,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",s)&&(i.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s));}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(animator.has(this)?this.attached&&!animator.running(this)&&animator.start(this):(this.draw(),onAnimationsComplete({chart:this})));}draw(){let t;if(this._resizeBeforeDraw){const{width:t,height:e}=this._resizeBeforeDraw;this._resize(t,e),this._resizeBeforeDraw=null;}if(this.clear(),this.width<=0||this.height<=0)return;if(!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw");}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let s,n;for(s=0,n=e.length;s<n;++s){const n=e[s];t&&!n.visible||i.push(n);}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw");}_drawDataset(t){const e=this.ctx,i=t._clip,s=!i.disabled,n=this.chartArea,a={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",a)&&(s&&clipArea(e,{left:!1===i.left?0:n.left-i.left,right:!1===i.right?this.width:n.right+i.right,top:!1===i.top?0:n.top-i.top,bottom:!1===i.bottom?this.height:n.bottom+i.bottom}),t.controller.draw(),s&&unclipArea(e),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a));}getElementsAtEventForMode(t,e,i,s){const n=Interaction.modes[e];return "function"==typeof n?n(this,t,i,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let s=i.filter((t=>t&&t._dataset===e)).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=createContext(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return !1;const i=this.getDatasetMeta(t);return "boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e;}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t];}getDataVisibility(t){return !this._hiddenIndices[t]}_updateVisibility(t,e,i){const s=i?"show":"hide",n=this.getDatasetMeta(t),a=n.controller._resolveAnimations(void 0,s);defined(e)?(n.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),a.update(n,{visible:i}),this.update((e=>e.datasetIndex===t?s:void 0)));}hide(t,e){this._updateVisibility(t,e,!1);}show(t,e){this._updateVisibility(t,e,!0);}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t];}_stop(){let t,e;for(this.stop(),animator.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t);}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),clearCanvas(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),this.notifyPlugins("destroy"),delete instances[this.id],this.notifyPlugins("afterDestroy");}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0;}bindUserEvents(){const t=this._listeners,e=this.platform,i=(i,s)=>{e.addEventListener(this,i,s),t[i]=s;},s=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t);};each(this.options.events,(t=>i(t,s)));}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,s)=>{e.addEventListener(this,i,s),t[i]=s;},s=(i,s)=>{t[i]&&(e.removeEventListener(this,i,s),delete t[i]);},n=(t,e)=>{this.canvas&&this.resize(t,e);};let a;const o=()=>{s("attach",o),this.attached=!0,this.resize(),i("resize",n),i("detach",a);};a=()=>{this.attached=!1,s("resize",n),this._stop(),this._resize(0,0),i("attach",o);},e.isAttached(this.canvas)?o():a();}unbindEvents(){each(this._listeners,((t,e)=>{this.platform.removeEventListener(this,e,t);})),this._listeners={},each(this._responsiveListeners,((t,e)=>{this.platform.removeEventListener(this,e,t);})),this._responsiveListeners=void 0;}updateHoverStyle(t,e,i){const s=i?"set":"remove";let n,a,o,r;for("dataset"===e&&(n=this.getDatasetMeta(t[0].datasetIndex),n.controller["_"+s+"DatasetHoverStyle"]()),o=0,r=t.length;o<r;++o){a=t[o];const e=a&&this.getDatasetMeta(a.datasetIndex).controller;e&&e[s+"HoverStyle"](a.element,a.datasetIndex,a.index);}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map((({datasetIndex:t,index:e})=>{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return {datasetIndex:t,element:i.data[e],index:e}}));!_elementsEqual(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e));}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}_updateHoverStyles(t,e,i){const s=this.options.hover,n=(t,e)=>t.filter((t=>!e.some((e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)))),a=n(e,t),o=i?t:n(t,e);a.length&&this.updateHoverStyle(a,s.mode,!1),o.length&&s.mode&&this.updateHoverStyle(o,s.mode,!0);}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:_isPointInArea(t,this.chartArea,this._minPadding)},s=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,s))return;const n=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(n||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:s=[],options:n}=this,a=e,o=this._getActiveElements(t,s,i,a),r=_isClickEvent(t),l=determineLastEvent(t,this._lastEvent,i,r);i&&(this._lastEvent=null,callback(n.onHover,[t,o,this],this),r&&callback(n.onClick,[t,o,this],this));const h=!_elementsEqual(o,s);return (h||e)&&(this._active=o,this._updateHoverStyles(o,s,e)),this._lastEvent=l,h}_getActiveElements(t,e,i,s){if("mouseout"===t.type)return [];if(!i)return e;const n=this.options.hover;return this.getElementsAtEventForMode(t,n.mode,n,s)}}const invalidatePlugins=()=>each(Chart.instances,(t=>t._plugins.invalidate()));function clipArc(t,e,i){const{startAngle:s,pixelMargin:n,x:a,y:o,outerRadius:r,innerRadius:l}=e;let h=n/r;t.beginPath(),t.arc(a,o,r,s-h,i+h),l>n?(h=n/l,t.arc(a,o,l,i+h,s-h,!0)):t.arc(a,o,n,i+HALF_PI,s-HALF_PI),t.closePath(),t.clip();}function toRadiusCorners(t){return _readValueToProps(t,["outerStart","outerEnd","innerStart","innerEnd"])}function parseBorderRadius$1(t,e,i,s){const n=toRadiusCorners(t.options.borderRadius),a=(i-e)/2,o=Math.min(a,s*e/2),r=t=>{const e=(i-Math.min(a,t))*s/2;return _limitValue(t,0,Math.min(a,e))};return {outerStart:r(n.outerStart),outerEnd:r(n.outerEnd),innerStart:_limitValue(n.innerStart,0,o),innerEnd:_limitValue(n.innerEnd,0,o)}}function rThetaToXY(t,e,i,s){return {x:i+t*Math.cos(e),y:s+t*Math.sin(e)}}function pathArc(t,e,i,s,n){const{x:a,y:o,startAngle:r,pixelMargin:l,innerRadius:h}=e,c=Math.max(e.outerRadius+s+i-l,0),d=h>0?h+s+i+l:0;let u=0;const g=n-r;if(s){const t=((h>0?h-s:0)+(c>0?c-s:0))/2;u=(g-(0!==t?g*t/(t+s):g))/2;}const p=(g-Math.max(.001,g*c-i/PI)/c)/2,f=r+p+u,m=n-p-u,{outerStart:x,outerEnd:b,innerStart:_,innerEnd:y}=parseBorderRadius$1(e,d,c,m-f),v=c-x,S=c-b,k=f+x/v,M=m-b/S,P=d+_,D=d+y,w=f+_/P,C=m-y/D;if(t.beginPath(),t.arc(a,o,c,k,M),b>0){const e=rThetaToXY(S,M,a,o);t.arc(e.x,e.y,b,M,m+HALF_PI);}const A=rThetaToXY(D,m,a,o);if(t.lineTo(A.x,A.y),y>0){const e=rThetaToXY(D,C,a,o);t.arc(e.x,e.y,y,m+HALF_PI,C+Math.PI);}if(t.arc(a,o,d,m-y/d,f+_/d,!0),_>0){const e=rThetaToXY(P,w,a,o);t.arc(e.x,e.y,_,w+Math.PI,f-HALF_PI);}const L=rThetaToXY(v,f,a,o);if(t.lineTo(L.x,L.y),x>0){const e=rThetaToXY(v,k,a,o);t.arc(e.x,e.y,x,f-HALF_PI,k);}t.closePath();}function drawArc(t,e,i,s){const{fullCircles:n,startAngle:a,circumference:o}=e;let r=e.endAngle;if(n){pathArc(t,e,i,s,a+TAU);for(let e=0;e<n;++e)t.fill();isNaN(o)||(r=a+o%TAU,o%TAU==0&&(r+=TAU));}return pathArc(t,e,i,s,r),t.fill(),r}function drawFullCircleBorders(t,e,i){const{x:s,y:n,startAngle:a,pixelMargin:o,fullCircles:r}=e,l=Math.max(e.outerRadius-o,0),h=e.innerRadius+o;let c;for(i&&clipArc(t,e,a+TAU),t.beginPath(),t.arc(s,n,h,a+TAU,a,!0),c=0;c<r;++c)t.stroke();for(t.beginPath(),t.arc(s,n,l,a,a+TAU),c=0;c<r;++c)t.stroke();}function drawBorder(t,e,i,s,n){const{options:a}=e,{borderWidth:o,borderJoinStyle:r}=a,l="inner"===a.borderAlign;o&&(l?(t.lineWidth=2*o,t.lineJoin=r||"round"):(t.lineWidth=o,t.lineJoin=r||"bevel"),e.fullCircles&&drawFullCircleBorders(t,e,l),l&&clipArc(t,e,n),pathArc(t,e,i,s,n),t.stroke());}Object.defineProperties(Chart,{defaults:{enumerable:true,value:defaults},instances:{enumerable:true,value:instances},overrides:{enumerable:true,value:overrides},registry:{enumerable:true,value:registry},version:{enumerable:true,value:version},getChart:{enumerable:true,value:getChart},register:{enumerable:true,value:(...t)=>{registry.add(...t),invalidatePlugins();}},unregister:{enumerable:true,value:(...t)=>{registry.remove(...t),invalidatePlugins();}}});class ArcElement extends Element$1{constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t);}inRange(t,e,i){const s=this.getProps(["x","y"],i),{angle:n,distance:a}=getAngleFromPoint(s,{x:t,y:e}),{startAngle:o,endAngle:r,innerRadius:l,outerRadius:h,circumference:c}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),d=this.options.spacing/2,u=valueOrDefault(c,r-o)>=TAU||_angleBetween(n,o,r),g=_isBetween(a,l+d,h+d);return u&&g}getCenterPoint(t){const{x:e,y:i,startAngle:s,endAngle:n,innerRadius:a,outerRadius:o}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:r,spacing:l}=this.options,h=(s+n)/2,c=(a+o+l+r)/2;return {x:e+Math.cos(h)*c,y:i+Math.sin(h)*c}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,s=(e.offset||0)/2,n=(e.spacing||0)/2;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>TAU?Math.floor(i/TAU):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();let a=0;if(s){a=s/2;const e=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(e)*a,Math.sin(e)*a),this.circumference>=PI&&(a=s);}t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor;drawBorder(t,this,a,n,drawArc(t,this,a,n)),t.restore();}}function setStyle(t,e,i=e){t.lineCap=valueOrDefault(i.borderCapStyle,e.borderCapStyle),t.setLineDash(valueOrDefault(i.borderDash,e.borderDash)),t.lineDashOffset=valueOrDefault(i.borderDashOffset,e.borderDashOffset),t.lineJoin=valueOrDefault(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=valueOrDefault(i.borderWidth,e.borderWidth),t.strokeStyle=valueOrDefault(i.borderColor,e.borderColor);}function lineTo(t,e,i){t.lineTo(i.x,i.y);}function getLineMethod(t){return t.stepped?_steppedLineTo:t.tension||"monotone"===t.cubicInterpolationMode?_bezierCurveTo:lineTo}function pathVars(t,e,i={}){const s=t.length,{start:n=0,end:a=s-1}=i,{start:o,end:r}=e,l=Math.max(n,o),h=Math.min(a,r),c=n<o&&a<o||n>r&&a>r;return {count:s,start:l,loop:e.loop,ilen:h<l&&!c?s+h-l:h-l}}function pathSegment(t,e,i,s){const{points:n,options:a}=e,{count:o,start:r,loop:l,ilen:h}=pathVars(n,i,s),c=getLineMethod(a);let d,u,g,{move:p=!0,reverse:f}=s||{};for(d=0;d<=h;++d)u=n[(r+(f?h-d:d))%o],u.skip||(p?(t.moveTo(u.x,u.y),p=!1):c(t,g,u,f,a.stepped),g=u);return l&&(u=n[(r+(f?h:0))%o],c(t,g,u,f,a.stepped)),!!l}function fastPathSegment(t,e,i,s){const n=e.points,{count:a,start:o,ilen:r}=pathVars(n,i,s),{move:l=!0,reverse:h}=s||{};let c,d,u,g,p,f,m=0,x=0;const b=t=>(o+(h?r-t:t))%a,_=()=>{g!==p&&(t.lineTo(m,p),t.lineTo(m,g),t.lineTo(m,f));};for(l&&(d=n[b(0)],t.moveTo(d.x,d.y)),c=0;c<=r;++c){if(d=n[b(c)],d.skip)continue;const e=d.x,i=d.y,s=0|e;s===u?(i<g?g=i:i>p&&(p=i),m=(x*m+e)/++x):(_(),t.lineTo(e,i),u=s,x=0,g=p=i),f=i;}_();}function _getSegmentMethod(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return !(t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i)?fastPathSegment:pathSegment}function _getInterpolationMethod(t){return t.stepped?_steppedInterpolation:t.tension||"monotone"===t.cubicInterpolationMode?_bezierInterpolation:_pointInLine}function strokePathWithCache(t,e,i,s){let n=e._path;n||(n=e._path=new Path2D,e.path(n,i,s)&&n.closePath()),setStyle(t,e.options),t.stroke(n);}function strokePathDirect(t,e,i,s){const{segments:n,options:a}=e,o=_getSegmentMethod(e);for(const r of n)setStyle(t,a,r.style),t.beginPath(),o(t,e,r,{start:i,end:i+s-1})&&t.closePath(),t.stroke();}ArcElement.id="arc",ArcElement.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0},ArcElement.defaultRoutes={backgroundColor:"backgroundColor"};const usePath2D="function"==typeof Path2D;function draw(t,e,i,s){usePath2D&&!e.options.segment?strokePathWithCache(t,e,i,s):strokePathDirect(t,e,i,s);}class LineElement extends Element$1{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t);}updateControlPoints(t,e){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;_updateBezierControlPoints(this._points,i,t,s,e),this._pointsUpdated=!0;}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1;}get points(){return this._points}get segments(){return this._segments||(this._segments=_computeSegments(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,s=t[e],n=this.points,a=_boundSegments(this,{property:e,start:s,end:s});if(!a.length)return;const o=[],r=_getInterpolationMethod(i);let l,h;for(l=0,h=a.length;l<h;++l){const{start:h,end:c}=a[l],d=n[h],u=n[c];if(d===u){o.push(d);continue}const g=r(d,u,Math.abs((s-d[e])/(u[e]-d[e])),i.stepped);g[e]=t[e],o.push(g);}return 1===o.length?o[0]:o}pathSegment(t,e,i){return _getSegmentMethod(this)(t,this,e,i)}path(t,e,i){const s=this.segments,n=_getSegmentMethod(this);let a=this._loop;e=e||0,i=i||this.points.length-e;for(const o of s)a&=n(t,this,o,{start:e,end:e+i-1});return !!a}draw(t,e,i,s){const n=this.options||{};(this.points||[]).length&&n.borderWidth&&(t.save(),draw(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0);}}function inRange$1(t,e,i,s){const n=t.options,{[i]:a}=t.getProps([i],s);return Math.abs(e-a)<n.radius+n.hitRadius}LineElement.id="line",LineElement.defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0},LineElement.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"},LineElement.descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};class PointElement extends Element$1{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t);}inRange(t,e,i){const s=this.options,{x:n,y:a}=this.getProps(["x","y"],i);return Math.pow(t-n,2)+Math.pow(e-a,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,e){return inRange$1(this,t,"x",e)}inYRange(t,e){return inRange$1(this,t,"y",e)}getCenterPoint(t){const{x:e,y:i}=this.getProps(["x","y"],t);return {x:e,y:i}}size(t){let e=(t=t||this.options||{}).radius||0;e=Math.max(e,e&&t.hoverRadius||0);return 2*(e+(e&&t.borderWidth||0))}draw(t,e){const i=this.options;this.skip||i.radius<.1||!_isPointInArea(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,drawPoint(t,i,this.x,this.y));}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function getBarBounds(t,e){const{x:i,y:s,base:n,width:a,height:o}=t.getProps(["x","y","base","width","height"],e);let r,l,h,c,d;return t.horizontal?(d=o/2,r=Math.min(i,n),l=Math.max(i,n),h=s-d,c=s+d):(d=a/2,r=i-d,l=i+d,h=Math.min(s,n),c=Math.max(s,n)),{left:r,top:h,right:l,bottom:c}}function skipOrLimit(t,e,i,s){return t?0:_limitValue(e,i,s)}function parseBorderWidth(t,e,i){const s=t.options.borderWidth,n=t.borderSkipped,a=toTRBL(s);return {t:skipOrLimit(n.top,a.top,0,i),r:skipOrLimit(n.right,a.right,0,e),b:skipOrLimit(n.bottom,a.bottom,0,i),l:skipOrLimit(n.left,a.left,0,e)}}function parseBorderRadius(t,e,i){const{enableBorderRadius:s}=t.getProps(["enableBorderRadius"]),n=t.options.borderRadius,a=toTRBLCorners(n),o=Math.min(e,i),r=t.borderSkipped,l=s||isObject(n);return {topLeft:skipOrLimit(!l||r.top||r.left,a.topLeft,0,o),topRight:skipOrLimit(!l||r.top||r.right,a.topRight,0,o),bottomLeft:skipOrLimit(!l||r.bottom||r.left,a.bottomLeft,0,o),bottomRight:skipOrLimit(!l||r.bottom||r.right,a.bottomRight,0,o)}}function boundingRects(t){const e=getBarBounds(t),i=e.right-e.left,s=e.bottom-e.top,n=parseBorderWidth(t,i/2,s/2),a=parseBorderRadius(t,i/2,s/2);return {outer:{x:e.left,y:e.top,w:i,h:s,radius:a},inner:{x:e.left+n.l,y:e.top+n.t,w:i-n.l-n.r,h:s-n.t-n.b,radius:{topLeft:Math.max(0,a.topLeft-Math.max(n.t,n.l)),topRight:Math.max(0,a.topRight-Math.max(n.t,n.r)),bottomLeft:Math.max(0,a.bottomLeft-Math.max(n.b,n.l)),bottomRight:Math.max(0,a.bottomRight-Math.max(n.b,n.r))}}}}function inRange(t,e,i,s){const n=null===e,a=null===i,o=t&&!(n&&a)&&getBarBounds(t,s);return o&&(n||_isBetween(e,o.left,o.right))&&(a||_isBetween(i,o.top,o.bottom))}function hasRadius(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function addNormalRectPath(t,e){t.rect(e.x,e.y,e.w,e.h);}function inflateRect(t,e,i={}){const s=t.x!==i.x?-e:0,n=t.y!==i.y?-e:0,a=(t.x+t.w!==i.x+i.w?e:0)-s,o=(t.y+t.h!==i.y+i.h?e:0)-n;return {x:t.x+s,y:t.y+n,w:t.w+a,h:t.h+o,radius:t.radius}}PointElement.id="point",PointElement.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0},PointElement.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};class BarElement extends Element$1{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t);}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:s}}=this,{inner:n,outer:a}=boundingRects(this),o=hasRadius(a.radius)?addRoundedRectPath:addNormalRectPath;t.save(),a.w===n.w&&a.h===n.h||(t.beginPath(),o(t,inflateRect(a,e,n)),t.clip(),o(t,inflateRect(n,-e,a)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),o(t,inflateRect(n,e)),t.fillStyle=s,t.fill(),t.restore();}inRange(t,e,i){return inRange(this,t,e,i)}inXRange(t,e){return inRange(this,t,null,e)}inYRange(t,e){return inRange(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:s,horizontal:n}=this.getProps(["x","y","base","horizontal"],t);return {x:n?(e+s)/2:e,y:n?i:(i+s)/2}}getRange(t){return "x"===t?this.width/2:this.height/2}}BarElement.id="bar",BarElement.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0},BarElement.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};Object.freeze({__proto__:null,ArcElement:ArcElement,LineElement:LineElement,PointElement:PointElement,BarElement:BarElement});function lttbDecimation(t,e,i,s,n){const a=n.samples||s;if(a>=i)return t.slice(e,e+i);const o=[],r=(i-2)/(a-2);let l=0;const h=e+i-1;let c,d,u,g,p,f=e;for(o[l++]=t[f],c=0;c<a-2;c++){let s,n=0,a=0;const h=Math.floor((c+1)*r)+1+e,m=Math.min(Math.floor((c+2)*r)+1,i)+e,x=m-h;for(s=h;s<m;s++)n+=t[s].x,a+=t[s].y;n/=x,a/=x;const b=Math.floor(c*r)+1+e,_=Math.min(Math.floor((c+1)*r)+1,i)+e,{x:y,y:v}=t[f];for(u=g=-1,s=b;s<_;s++)g=.5*Math.abs((y-n)*(t[s].y-v)-(y-t[s].x)*(a-v)),g>u&&(u=g,d=t[s],p=s);o[l++]=d,f=p;}return o[l++]=t[h],o}function minMaxDecimation(t,e,i,s){let n,a,o,r,l,h,c,d,u,g,p=0,f=0;const m=[],x=e+i-1,b=t[e].x,_=t[x].x-b;for(n=e;n<e+i;++n){a=t[n],o=(a.x-b)/_*s,r=a.y;const e=0|o;if(e===l)r<u?(u=r,h=n):r>g&&(g=r,c=n),p=(f*p+a.x)/++f;else {const i=n-1;if(!isNullOrUndef(h)&&!isNullOrUndef(c)){const e=Math.min(h,c),s=Math.max(h,c);e!==d&&e!==i&&m.push({...t[e],x:p}),s!==d&&s!==i&&m.push({...t[s],x:p});}n>0&&i!==d&&m.push(t[i]),m.push(a),l=e,f=0,u=g=r,h=c=d=n;}}return m}function cleanDecimatedDataset(t){if(t._decimated){const e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{value:e});}}function cleanDecimatedData(t){t.data.datasets.forEach((t=>{cleanDecimatedDataset(t);}));}function getStartAndCountOfVisiblePointsSimplified(t,e){const i=e.length;let s,n=0;const{iScale:a}=t,{min:o,max:r,minDefined:l,maxDefined:h}=a.getUserBounds();return l&&(n=_limitValue(_lookupByKey(e,a.axis,o).lo,0,i-1)),s=h?_limitValue(_lookupByKey(e,a.axis,r).hi+1,n,i)-n:i-n,{start:n,count:s}}var plugin_decimation={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,i)=>{if(!i.enabled)return void cleanDecimatedData(t);const s=t.width;t.data.datasets.forEach(((e,n)=>{const{_data:a,indexAxis:o}=e,r=t.getDatasetMeta(n),l=a||e.data;if("y"===resolve([o,t.options.indexAxis]))return;if("line"!==r.type)return;const h=t.scales[r.xAxisID];if("linear"!==h.type&&"time"!==h.type)return;if(t.options.parsing)return;let{start:c,count:d}=getStartAndCountOfVisiblePointsSimplified(r,l);if(d<=(i.threshold||4*s))return void cleanDecimatedDataset(e);let u;switch(isNullOrUndef(a)&&(e._data=l,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t;}})),i.algorithm){case"lttb":u=lttbDecimation(l,c,d,s,i);break;case"min-max":u=minMaxDecimation(l,c,d,s);break;default:throw new Error(`Unsupported decimation algorithm '${i.algorithm}'`)}e._decimated=u;}));},destroy(t){cleanDecimatedData(t);}};function getLineByIndex(t,e){const i=t.getDatasetMeta(e);return i&&t.isDatasetVisible(e)?i.dataset:null}function parseFillOption(t){const e=t.options,i=e.fill;let s=valueOrDefault(i&&i.target,i);return void 0===s&&(s=!!e.backgroundColor),!1!==s&&null!==s&&(!0===s?"origin":s)}function decodeFill(t,e,i){const s=parseFillOption(t);if(isObject(s))return !isNaN(s.value)&&s;let n=parseFloat(s);return isNumberFinite(n)&&Math.floor(n)===n?("-"!==s[0]&&"+"!==s[0]||(n=e+n),!(n===e||n<0||n>=i)&&n):["origin","start","end","stack","shape"].indexOf(s)>=0&&s}function computeLinearBoundary(t){const{scale:e={},fill:i}=t;let s,n=null;return "start"===i?n=e.bottom:"end"===i?n=e.top:isObject(i)?n=e.getPixelForValue(i.value):e.getBasePixel&&(n=e.getBasePixel()),isNumberFinite(n)?(s=e.isHorizontal(),{x:s?n:null,y:s?null:n}):null}class simpleArc{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius;}pathSegment(t,e,i){const{x:s,y:n,radius:a}=this;return e=e||{start:0,end:TAU},t.arc(s,n,a,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:s}=this,n=t.angle;return {x:e+Math.cos(n)*s,y:i+Math.sin(n)*s,angle:n}}}function computeCircularBoundary(t){const{scale:e,fill:i}=t,s=e.options,n=e.getLabels().length,a=[],o=s.reverse?e.max:e.min,r=s.reverse?e.min:e.max;let l,h,c;if(c="start"===i?o:"end"===i?r:isObject(i)?i.value:e.getBaseValue(),s.grid.circular)return h=e.getPointPositionForValue(0,o),new simpleArc({x:h.x,y:h.y,radius:e.getDistanceFromCenterForValue(c)});for(l=0;l<n;++l)a.push(e.getPointPositionForValue(l,c));return a}function computeBoundary(t){return (t.scale||{}).getPointPositionForValue?computeCircularBoundary(t):computeLinearBoundary(t)}function findSegmentEnd(t,e,i){for(;e>t;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function pointsFromSegments(t,e){const{x:i=null,y:s=null}=t||{},n=e.points,a=[];return e.segments.forEach((({start:t,end:e})=>{e=findSegmentEnd(t,e,n);const o=n[t],r=n[e];null!==s?(a.push({x:o.x,y:s}),a.push({x:r.x,y:s})):null!==i&&(a.push({x:i,y:o.y}),a.push({x:i,y:r.y}));})),a}function buildStackLine(t){const{scale:e,index:i,line:s}=t,n=[],a=s.segments,o=s.points,r=getLinesBelow(e,i);r.push(createBoundaryLine({x:null,y:e.bottom},s));for(let t=0;t<a.length;t++){const e=a[t];for(let t=e.start;t<=e.end;t++)addPointsBelow(n,o[t],r);}return new LineElement({points:n,options:{}})}function getLinesBelow(t,e){const i=[],s=t.getMatchingVisibleMetas("line");for(let t=0;t<s.length;t++){const n=s[t];if(n.index===e)break;n.hidden||i.unshift(n.dataset);}return i}function addPointsBelow(t,e,i){const s=[];for(let n=0;n<i.length;n++){const a=i[n],{first:o,last:r,point:l}=findPoint(a,e,"x");if(!(!l||o&&r))if(o)s.unshift(l);else if(t.push(l),!r)break}t.push(...s);}function findPoint(t,e,i){const s=t.interpolate(e,i);if(!s)return {};const n=s[i],a=t.segments,o=t.points;let r=!1,l=!1;for(let t=0;t<a.length;t++){const e=a[t],s=o[e.start][i],h=o[e.end][i];if(_isBetween(n,s,h)){r=n===s,l=n===h;break}}return {first:r,last:l,point:s}}function getTarget(t){const{chart:e,fill:i,line:s}=t;if(isNumberFinite(i))return getLineByIndex(e,i);if("stack"===i)return buildStackLine(t);if("shape"===i)return !0;const n=computeBoundary(t);return n instanceof simpleArc?n:createBoundaryLine(n,s)}function createBoundaryLine(t,e){let i=[],s=!1;return isArray(t)?(s=!0,i=t):i=pointsFromSegments(t,e),i.length?new LineElement({points:i,options:{tension:0},_loop:s,_fullLoop:s}):null}function resolveTarget(t,e,i){let s=t[e].fill;const n=[e];let a;if(!i)return s;for(;!1!==s&&-1===n.indexOf(s);){if(!isNumberFinite(s))return s;if(a=t[s],!a)return !1;if(a.visible)return s;n.push(s),s=a.fill;}return !1}function _clip(t,e,i){const{segments:s,points:n}=e;let a=!0,o=!1;t.beginPath();for(const r of s){const{start:s,end:l}=r,h=n[s],c=n[findSegmentEnd(s,l,n)];a?(t.moveTo(h.x,h.y),a=!1):(t.lineTo(h.x,i),t.lineTo(h.x,h.y)),o=!!e.pathSegment(t,r,{move:o}),o?t.closePath():t.lineTo(c.x,i);}t.lineTo(e.first().x,i),t.closePath(),t.clip();}function getBounds(t,e,i,s){if(s)return;let n=e[t],a=i[t];return "angle"===t&&(n=_normalizeAngle(n),a=_normalizeAngle(a)),{property:t,start:n,end:a}}function _getEdge(t,e,i,s){return t&&e?s(t[i],e[i]):t?t[i]:e?e[i]:0}function _segments(t,e,i){const s=t.segments,n=t.points,a=e.points,o=[];for(const t of s){let{start:s,end:r}=t;r=findSegmentEnd(s,r,n);const l=getBounds(i,n[s],n[r],t.loop);if(!e.segments){o.push({source:t,target:l,start:n[s],end:n[r]});continue}const h=_boundSegments(e,l);for(const e of h){const s=getBounds(i,a[e.start],a[e.end],e.loop),r=_boundSegment(t,n,s);for(const t of r)o.push({source:t,target:e,start:{[i]:_getEdge(l,s,"start",Math.max)},end:{[i]:_getEdge(l,s,"end",Math.min)}});}}return o}function clipBounds(t,e,i){const{top:s,bottom:n}=e.chart.chartArea,{property:a,start:o,end:r}=i||{};"x"===a&&(t.beginPath(),t.rect(o,s,r-o,n-s),t.clip());}function interpolatedLineTo(t,e,i,s){const n=e.interpolate(i,s);n&&t.lineTo(n.x,n.y);}function _fill(t,e){const{line:i,target:s,property:n,color:a,scale:o}=e,r=_segments(i,s,n);for(const{source:e,target:l,start:h,end:c}of r){const{style:{backgroundColor:r=a}={}}=e,d=!0!==s;t.save(),t.fillStyle=r,clipBounds(t,o,d&&getBounds(n,h,c)),t.beginPath();const u=!!i.pathSegment(t,e);let g;if(d){u?t.closePath():interpolatedLineTo(t,s,c,n);const e=!!s.pathSegment(t,l,{move:u,reverse:!0});g=u&&e,g||interpolatedLineTo(t,s,h,n);}t.closePath(),t.fill(g?"evenodd":"nonzero"),t.restore();}}function doFill(t,e){const{line:i,target:s,above:n,below:a,area:o,scale:r}=e,l=i._loop?"angle":e.axis;t.save(),"x"===l&&a!==n&&(_clip(t,s,o.top),_fill(t,{line:i,target:s,color:n,scale:r,property:l}),t.restore(),t.save(),_clip(t,s,o.bottom)),_fill(t,{line:i,target:s,color:a,scale:r,property:l}),t.restore();}function drawfill(t,e,i){const s=getTarget(e),{line:n,scale:a,axis:o}=e,r=n.options,l=r.fill,h=r.backgroundColor,{above:c=h,below:d=h}=l||{};s&&n.points.length&&(clipArea(t,i),doFill(t,{line:n,target:s,above:c,below:d,area:i,scale:a,axis:o}),unclipArea(t));}var plugin_filler={id:"filler",afterDatasetsUpdate(t,e,i){const s=(t.data.datasets||[]).length,n=[];let a,o,r,l;for(o=0;o<s;++o)a=t.getDatasetMeta(o),r=a.dataset,l=null,r&&r.options&&r instanceof LineElement&&(l={visible:t.isDatasetVisible(o),index:o,fill:decodeFill(r,o,s),chart:t,axis:a.controller.options.indexAxis,scale:a.vScale,line:r}),a.$filler=l,n.push(l);for(o=0;o<s;++o)l=n[o],l&&!1!==l.fill&&(l.fill=resolveTarget(n,o,i.propagate));},beforeDraw(t,e,i){const s="beforeDraw"===i.drawTime,n=t.getSortedVisibleDatasetMetas(),a=t.chartArea;for(let e=n.length-1;e>=0;--e){const i=n[e].$filler;i&&(i.line.updateControlPoints(a,i.axis),s&&drawfill(t.ctx,i,a));}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;const s=t.getSortedVisibleDatasetMetas();for(let e=s.length-1;e>=0;--e){const i=s[e].$filler;i&&drawfill(t.ctx,i,t.chartArea);}},beforeDatasetDraw(t,e,i){const s=e.meta.$filler;s&&!1!==s.fill&&"beforeDatasetDraw"===i.drawTime&&drawfill(t.ctx,s,t.chartArea);},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const getBoxSize=(t,e)=>{let{boxHeight:i=e,boxWidth:s=e}=t;return t.usePointStyle&&(i=Math.min(i,e),s=Math.min(s,e)),{boxWidth:s,boxHeight:i,itemHeight:Math.max(e,i)}};class Legend extends Element$1{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0;}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit();}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height);}buildLabels(){const t=this.options.labels||{};let e=callback(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter((e=>t.filter(e,this.chart.data)))),t.sort&&(e=e.sort(((e,i)=>t.sort(e,i,this.chart.data)))),this.options.reverse&&e.reverse(),this.legendItems=e;}fit(){const{options:t,ctx:e}=this;if(!t.display)return void(this.width=this.height=0);const i=t.labels,s=toFont(i.font),n=s.size,a=this._computeTitleHeight(),{boxWidth:o,itemHeight:r}=getBoxSize(i,n);let l,h;e.font=s.string,this.isHorizontal()?(l=this.maxWidth,h=this._fitRows(a,n,o,r)+10):(h=this.maxHeight,l=this._fitCols(a,n,o,r)+10),this.width=Math.min(l,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight);}_fitRows(t,e,i,s){const{ctx:n,maxWidth:a,options:{labels:{padding:o}}}=this,r=this.legendHitBoxes=[],l=this.lineWidths=[0],h=s+o;let c=t;n.textAlign="left",n.textBaseline="middle";let d=-1,u=-h;return this.legendItems.forEach(((t,g)=>{const p=i+e/2+n.measureText(t.text).width;(0===g||l[l.length-1]+p+2*o>a)&&(c+=h,l[l.length-(g>0?0:1)]=0,u+=h,d++),r[g]={left:0,top:u,row:d,width:p,height:s},l[l.length-1]+=p+o;})),c}_fitCols(t,e,i,s){const{ctx:n,maxHeight:a,options:{labels:{padding:o}}}=this,r=this.legendHitBoxes=[],l=this.columnSizes=[],h=a-t;let c=o,d=0,u=0,g=0,p=0;return this.legendItems.forEach(((t,a)=>{const f=i+e/2+n.measureText(t.text).width;a>0&&u+s+2*o>h&&(c+=d+o,l.push({width:d,height:u}),g+=d+o,p++,d=u=0),r[a]={left:g,top:u,col:p,width:f,height:s},d=Math.max(d,f),u+=s+o;})),c+=d,l.push({width:d,height:u}),c}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:n}}=this,a=getRtlAdapter(n,this.left,this.width);if(this.isHorizontal()){let n=0,o=_alignStartEnd(i,this.left+s,this.right-this.lineWidths[n]);for(const r of e)n!==r.row&&(n=r.row,o=_alignStartEnd(i,this.left+s,this.right-this.lineWidths[n])),r.top+=this.top+t+s,r.left=a.leftForLtr(a.x(o),r.width),o+=r.width+s;}else {let n=0,o=_alignStartEnd(i,this.top+t+s,this.bottom-this.columnSizes[n].height);for(const r of e)r.col!==n&&(n=r.col,o=_alignStartEnd(i,this.top+t+s,this.bottom-this.columnSizes[n].height)),r.top=o,r.left+=this.left+s,r.left=a.leftForLtr(a.x(r.left),r.width),o+=r.height+s;}}isHorizontal(){return "top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const t=this.ctx;clipArea(t,this),this._draw(),unclipArea(t);}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:n,labels:a}=t,o=defaults.color,r=getRtlAdapter(t.rtl,this.left,this.width),l=toFont(a.font),{color:h,padding:c}=a,d=l.size,u=d/2;let g;this.drawTitle(),s.textAlign=r.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=l.string;const{boxWidth:p,boxHeight:f,itemHeight:m}=getBoxSize(a,d),x=this.isHorizontal(),b=this._computeTitleHeight();g=x?{x:_alignStartEnd(n,this.left+c,this.right-i[0]),y:this.top+c+b,line:0}:{x:this.left+c,y:_alignStartEnd(n,this.top+b+c,this.bottom-e[0].height),line:0},overrideTextDirection(this.ctx,t.textDirection);const _=m+c;this.legendItems.forEach(((y,v)=>{s.strokeStyle=y.fontColor||h,s.fillStyle=y.fontColor||h;const S=s.measureText(y.text).width,k=r.textAlign(y.textAlign||(y.textAlign=a.textAlign)),M=p+u+S;let P=g.x,D=g.y;r.setWidth(this.width),x?v>0&&P+M+c>this.right&&(D=g.y+=_,g.line++,P=g.x=_alignStartEnd(n,this.left+c,this.right-i[g.line])):v>0&&D+_>this.bottom&&(P=g.x=P+e[g.line].width+c,g.line++,D=g.y=_alignStartEnd(n,this.top+b+c,this.bottom-e[g.line].height));!function(t,e,i){if(isNaN(p)||p<=0||isNaN(f)||f<0)return;s.save();const n=valueOrDefault(i.lineWidth,1);if(s.fillStyle=valueOrDefault(i.fillStyle,o),s.lineCap=valueOrDefault(i.lineCap,"butt"),s.lineDashOffset=valueOrDefault(i.lineDashOffset,0),s.lineJoin=valueOrDefault(i.lineJoin,"miter"),s.lineWidth=n,s.strokeStyle=valueOrDefault(i.strokeStyle,o),s.setLineDash(valueOrDefault(i.lineDash,[])),a.usePointStyle){const a={radius:p*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:n},o=r.xPlus(t,p/2);drawPoint(s,a,o,e+u);}else {const a=e+Math.max((d-f)/2,0),o=r.leftForLtr(t,p),l=toTRBLCorners(i.borderRadius);s.beginPath(),Object.values(l).some((t=>0!==t))?addRoundedRectPath(s,{x:o,y:a,w:p,h:f,radius:l}):s.rect(o,a,p,f),s.fill(),0!==n&&s.stroke();}s.restore();}(r.x(P),D,y),P=_textX(k,P+p+u,x?P+M:this.right,t.rtl),function(t,e,i){renderText(s,i.text,t,e+m/2,l,{strikethrough:i.hidden,textAlign:r.textAlign(i.textAlign)});}(r.x(P),D,y),x?g.x+=M+c:g.y+=_;})),restoreTextDirection(this.ctx,t.textDirection);}drawTitle(){const t=this.options,e=t.title,i=toFont(e.font),s=toPadding(e.padding);if(!e.display)return;const n=getRtlAdapter(t.rtl,this.left,this.width),a=this.ctx,o=e.position,r=i.size/2,l=s.top+r;let h,c=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),h=this.top+l,c=_alignStartEnd(t.align,c,this.right-d);else {const e=this.columnSizes.reduce(((t,e)=>Math.max(t,e.height)),0);h=l+_alignStartEnd(t.align,this.top,this.bottom-e-t.labels.padding-this._computeTitleHeight());}const u=_alignStartEnd(o,c,c+d);a.textAlign=n.textAlign(_toLeftRightCenter(o)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=i.string,renderText(a,e.text,u,h,i);}_computeTitleHeight(){const t=this.options.title,e=toFont(t.font),i=toPadding(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,n;if(_isBetween(t,this.left,this.right)&&_isBetween(e,this.top,this.bottom))for(n=this.legendHitBoxes,i=0;i<n.length;++i)if(s=n[i],_isBetween(t,s.left,s.left+s.width)&&_isBetween(e,s.top,s.top+s.height))return this.legendItems[i];return null}handleEvent(t){const e=this.options;if(!isListened(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if("mousemove"===t.type){const a=this._hoveredItem,o=(n=i,null!==(s=a)&&null!==n&&s.datasetIndex===n.datasetIndex&&s.index===n.index);a&&!o&&callback(e.onLeave,[t,a,this],this),this._hoveredItem=i,i&&!o&&callback(e.onHover,[t,i,this],this);}else i&&callback(e.onClick,[t,i,this],this);var s,n;}}function isListened(t,e){return !("mousemove"!==t||!e.onHover&&!e.onLeave)||!(!e.onClick||"click"!==t&&"mouseup"!==t)}var plugin_legend={id:"legend",_element:Legend,start(t,e,i){const s=t.legend=new Legend({ctx:t.ctx,options:i,chart:t});layouts.configure(t,s,i),layouts.addBox(t,s);},stop(t){layouts.removeBox(t,t.legend),delete t.legend;},beforeUpdate(t,e,i){const s=t.legend;layouts.configure(t,s,i),s.options=i;},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes();},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event);},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,i){const s=e.datasetIndex,n=i.chart;n.isDatasetVisible(s)?(n.hide(s),e.hidden=!0):(n.show(s),e.hidden=!1);},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:i,pointStyle:s,textAlign:n,color:a}}=t.legend.options;return t._getSortedDatasetMetas().map((t=>{const o=t.controller.getStyle(i?0:void 0),r=toPadding(o.borderWidth);return {text:e[t.index].label,fillStyle:o.backgroundColor,fontColor:a,hidden:!t.visible,lineCap:o.borderCapStyle,lineDash:o.borderDash,lineDashOffset:o.borderDashOffset,lineJoin:o.borderJoinStyle,lineWidth:(r.width+r.height)/4,strokeStyle:o.borderColor,pointStyle:s||o.pointStyle,rotation:o.rotation,textAlign:n||o.textAlign,borderRadius:0,datasetIndex:t.index}}),this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class Title extends Element$1{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0;}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=t,this.height=this.bottom=e;const s=isArray(i.text)?i.text.length:1;this._padding=toPadding(i.padding);const n=s*toFont(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=n:this.width=n;}isHorizontal(){const t=this.options.position;return "top"===t||"bottom"===t}_drawArgs(t){const{top:e,left:i,bottom:s,right:n,options:a}=this,o=a.align;let r,l,h,c=0;return this.isHorizontal()?(l=_alignStartEnd(o,i,n),h=e+t,r=n-i):("left"===a.position?(l=i+t,h=_alignStartEnd(o,s,e),c=-.5*PI):(l=n-t,h=_alignStartEnd(o,e,s),c=.5*PI),r=s-e),{titleX:l,titleY:h,maxWidth:r,rotation:c}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=toFont(e.font),s=i.lineHeight/2+this._padding.top,{titleX:n,titleY:a,maxWidth:o,rotation:r}=this._drawArgs(s);renderText(t,e.text,0,0,i,{color:e.color,maxWidth:o,rotation:r,textAlign:_toLeftRightCenter(e.align),textBaseline:"middle",translation:[n,a]});}}function createTitle(t,e){const i=new Title({ctx:t.ctx,options:e,chart:t});layouts.configure(t,i,e),layouts.addBox(t,i),t.titleBlock=i;}var plugin_title={id:"title",_element:Title,start(t,e,i){createTitle(t,i);},stop(t){const e=t.titleBlock;layouts.removeBox(t,e),delete t.titleBlock;},beforeUpdate(t,e,i){const s=t.titleBlock;layouts.configure(t,s,i),s.options=i;},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const map=new WeakMap;var plugin_subtitle={id:"subtitle",start(t,e,i){const s=new Title({ctx:t.ctx,options:i,chart:t});layouts.configure(t,s,i),layouts.addBox(t,s),map.set(t,s);},stop(t){layouts.removeBox(t,map.get(t)),map.delete(t);},beforeUpdate(t,e,i){const s=map.get(t);layouts.configure(t,s,i),s.options=i;},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const positioners={average(t){if(!t.length)return !1;let e,i,s=0,n=0,a=0;for(e=0,i=t.length;e<i;++e){const i=t[e].element;if(i&&i.hasValue()){const t=i.tooltipPosition();s+=t.x,n+=t.y,++a;}}return {x:s/a,y:n/a}},nearest(t,e){if(!t.length)return !1;let i,s,n,a=e.x,o=e.y,r=Number.POSITIVE_INFINITY;for(i=0,s=t.length;i<s;++i){const s=t[i].element;if(s&&s.hasValue()){const t=s.getCenterPoint(),i=distanceBetweenPoints(e,t);i<r&&(r=i,n=s);}}if(n){const t=n.tooltipPosition();a=t.x,o=t.y;}return {x:a,y:o}}};function pushOrConcat(t,e){return e&&(isArray(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function splitNewlines(t){return ("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function createTooltipItem(t,e){const{element:i,datasetIndex:s,index:n}=e,a=t.getDatasetMeta(s).controller,{label:o,value:r}=a.getLabelAndValue(n);return {chart:t,label:o,parsed:a.getParsed(n),raw:t.data.datasets[s].data[n],formattedValue:r,dataset:a.getDataset(),dataIndex:n,datasetIndex:s,element:i}}function getTooltipSize(t,e){const i=t.chart.ctx,{body:s,footer:n,title:a}=t,{boxWidth:o,boxHeight:r}=e,l=toFont(e.bodyFont),h=toFont(e.titleFont),c=toFont(e.footerFont),d=a.length,u=n.length,g=s.length,p=toPadding(e.padding);let f=p.height,m=0,x=s.reduce(((t,e)=>t+e.before.length+e.lines.length+e.after.length),0);if(x+=t.beforeBody.length+t.afterBody.length,d&&(f+=d*h.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),x){f+=g*(e.displayColors?Math.max(r,l.lineHeight):l.lineHeight)+(x-g)*l.lineHeight+(x-1)*e.bodySpacing;}u&&(f+=e.footerMarginTop+u*c.lineHeight+(u-1)*e.footerSpacing);let b=0;const _=function(t){m=Math.max(m,i.measureText(t).width+b);};return i.save(),i.font=h.string,each(t.title,_),i.font=l.string,each(t.beforeBody.concat(t.afterBody),_),b=e.displayColors?o+2+e.boxPadding:0,each(s,(t=>{each(t.before,_),each(t.lines,_),each(t.after,_);})),b=0,i.font=c.string,each(t.footer,_),i.restore(),m+=p.width,{width:m,height:f}}function determineYAlign(t,e){const{y:i,height:s}=e;return i<s/2?"top":i>t.height-s/2?"bottom":"center"}function doesNotFitWithAlign(t,e,i,s){const{x:n,width:a}=s,o=i.caretSize+i.caretPadding;return "left"===t&&n+a+o>e.width||("right"===t&&n-a-o<0||void 0)}function determineXAlign(t,e,i,s){const{x:n,width:a}=i,{width:o,chartArea:{left:r,right:l}}=t;let h="center";return "center"===s?h=n<=(r+l)/2?"left":"right":n<=a/2?h="left":n>=o-a/2&&(h="right"),doesNotFitWithAlign(h,t,e,i)&&(h="center"),h}function determineAlignment(t,e,i){const s=i.yAlign||e.yAlign||determineYAlign(t,i);return {xAlign:i.xAlign||e.xAlign||determineXAlign(t,e,i,s),yAlign:s}}function alignX(t,e){let{x:i,width:s}=t;return "right"===e?i-=s:"center"===e&&(i-=s/2),i}function alignY(t,e,i){let{y:s,height:n}=t;return "top"===e?s+=i:s-="bottom"===e?n+i:n/2,s}function getBackgroundPoint(t,e,i,s){const{caretSize:n,caretPadding:a,cornerRadius:o}=t,{xAlign:r,yAlign:l}=i,h=n+a,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:g}=toTRBLCorners(o);let p=alignX(e,r);const f=alignY(e,l,h);return "center"===l?"left"===r?p+=h:"right"===r&&(p-=h):"left"===r?p-=Math.max(c,u)+n:"right"===r&&(p+=Math.max(d,g)+n),{x:_limitValue(p,0,s.width-e.width),y:_limitValue(f,0,s.height-e.height)}}function getAlignedX(t,e,i){const s=toPadding(i.padding);return "center"===e?t.x+t.width/2:"right"===e?t.x+t.width-s.right:t.x+s.left}function getBeforeAfterBodyLines(t){return pushOrConcat([],splitNewlines(t))}function createTooltipContext(t,e,i){return createContext(t,{tooltip:e,tooltipItems:i,type:"tooltip"})}function overrideCallbacks(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}class Tooltip extends Element$1{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart||t._chart,this._chart=this.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0;}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0;}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&e.options.animation&&i.animations,n=new Animations(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(n)),n}getContext(){return this.$context||(this.$context=createTooltipContext(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,s=i.beforeTitle.apply(this,[t]),n=i.title.apply(this,[t]),a=i.afterTitle.apply(this,[t]);let o=[];return o=pushOrConcat(o,splitNewlines(s)),o=pushOrConcat(o,splitNewlines(n)),o=pushOrConcat(o,splitNewlines(a)),o}getBeforeBody(t,e){return getBeforeAfterBodyLines(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){const{callbacks:i}=e,s=[];return each(t,(t=>{const e={before:[],lines:[],after:[]},n=overrideCallbacks(i,t);pushOrConcat(e.before,splitNewlines(n.beforeLabel.call(this,t))),pushOrConcat(e.lines,n.label.call(this,t)),pushOrConcat(e.after,splitNewlines(n.afterLabel.call(this,t))),s.push(e);})),s}getAfterBody(t,e){return getBeforeAfterBodyLines(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){const{callbacks:i}=e,s=i.beforeFooter.apply(this,[t]),n=i.footer.apply(this,[t]),a=i.afterFooter.apply(this,[t]);let o=[];return o=pushOrConcat(o,splitNewlines(s)),o=pushOrConcat(o,splitNewlines(n)),o=pushOrConcat(o,splitNewlines(a)),o}_createItems(t){const e=this._active,i=this.chart.data,s=[],n=[],a=[];let o,r,l=[];for(o=0,r=e.length;o<r;++o)l.push(createTooltipItem(this.chart,e[o]));return t.filter&&(l=l.filter(((e,s,n)=>t.filter(e,s,n,i)))),t.itemSort&&(l=l.sort(((e,s)=>t.itemSort(e,s,i)))),each(l,(e=>{const i=overrideCallbacks(t.callbacks,e);s.push(i.labelColor.call(this,e)),n.push(i.labelPointStyle.call(this,e)),a.push(i.labelTextColor.call(this,e));})),this.labelColors=s,this.labelPointStyles=n,this.labelTextColors=a,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let n,a=[];if(s.length){const t=positioners[i.position].call(this,s,this._eventPosition);a=this._createItems(i),this.title=this.getTitle(a,i),this.beforeBody=this.getBeforeBody(a,i),this.body=this.getBody(a,i),this.afterBody=this.getAfterBody(a,i),this.footer=this.getFooter(a,i);const e=this._size=getTooltipSize(this,i),o=Object.assign({},t,e),r=determineAlignment(this.chart,i,o),l=getBackgroundPoint(i,o,r,this.chart);this.xAlign=r.xAlign,this.yAlign=r.yAlign,n={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y};}else 0!==this.opacity&&(n={opacity:0});this._tooltipItems=a,this.$context=void 0,n&&this._resolveAnimations().update(this,n),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e});}drawCaret(t,e,i,s){const n=this.getCaretPosition(t,i,s);e.lineTo(n.x1,n.y1),e.lineTo(n.x2,n.y2),e.lineTo(n.x3,n.y3);}getCaretPosition(t,e,i){const{xAlign:s,yAlign:n}=this,{caretSize:a,cornerRadius:o}=i,{topLeft:r,topRight:l,bottomLeft:h,bottomRight:c}=toTRBLCorners(o),{x:d,y:u}=t,{width:g,height:p}=e;let f,m,x,b,_,y;return "center"===n?(_=u+p/2,"left"===s?(f=d,m=f-a,b=_+a,y=_-a):(f=d+g,m=f+a,b=_-a,y=_+a),x=f):(m="left"===s?d+Math.max(r,h)+a:"right"===s?d+g-Math.max(l,c)-a:this.caretX,"top"===n?(b=u,_=b-a,f=m-a,x=m+a):(b=u+p,_=b+a,f=m+a,x=m-a),y=b),{x1:f,x2:m,x3:x,y1:b,y2:_,y3:y}}drawTitle(t,e,i){const s=this.title,n=s.length;let a,o,r;if(n){const l=getRtlAdapter(i.rtl,this.x,this.width);for(t.x=getAlignedX(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",a=toFont(i.titleFont),o=i.titleSpacing,e.fillStyle=i.titleColor,e.font=a.string,r=0;r<n;++r)e.fillText(s[r],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+o,r+1===n&&(t.y+=i.titleMarginBottom-o);}}_drawColorBox(t,e,i,s,n){const a=this.labelColors[i],o=this.labelPointStyles[i],{boxHeight:r,boxWidth:l,boxPadding:h}=n,c=toFont(n.bodyFont),d=getAlignedX(this,"left",n),u=s.x(d),g=r<c.lineHeight?(c.lineHeight-r)/2:0,p=e.y+g;if(n.usePointStyle){const e={radius:Math.min(l,r)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},i=s.leftForLtr(u,l)+l/2,h=p+r/2;t.strokeStyle=n.multiKeyBackground,t.fillStyle=n.multiKeyBackground,drawPoint(t,e,i,h),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,drawPoint(t,e,i,h);}else {t.lineWidth=a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const e=s.leftForLtr(u,l-h),i=s.leftForLtr(s.xPlus(u,1),l-h-2),o=toTRBLCorners(a.borderRadius);Object.values(o).some((t=>0!==t))?(t.beginPath(),t.fillStyle=n.multiKeyBackground,addRoundedRectPath(t,{x:e,y:p,w:l,h:r,radius:o}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),addRoundedRectPath(t,{x:i,y:p+1,w:l-2,h:r-2,radius:o}),t.fill()):(t.fillStyle=n.multiKeyBackground,t.fillRect(e,p,l,r),t.strokeRect(e,p,l,r),t.fillStyle=a.backgroundColor,t.fillRect(i,p+1,l-2,r-2));}t.fillStyle=this.labelTextColors[i];}drawBody(t,e,i){const{body:s}=this,{bodySpacing:n,bodyAlign:a,displayColors:o,boxHeight:r,boxWidth:l,boxPadding:h}=i,c=toFont(i.bodyFont);let d=c.lineHeight,u=0;const g=getRtlAdapter(i.rtl,this.x,this.width),p=function(i){e.fillText(i,g.x(t.x+u),t.y+d/2),t.y+=d+n;},f=g.textAlign(a);let m,x,b,_,y,v,S;for(e.textAlign=a,e.textBaseline="middle",e.font=c.string,t.x=getAlignedX(this,f,i),e.fillStyle=i.bodyColor,each(this.beforeBody,p),u=o&&"right"!==f?"center"===a?l/2+h:l+2+h:0,_=0,v=s.length;_<v;++_){for(m=s[_],x=this.labelTextColors[_],e.fillStyle=x,each(m.before,p),b=m.lines,o&&b.length&&(this._drawColorBox(e,t,_,g,i),d=Math.max(c.lineHeight,r)),y=0,S=b.length;y<S;++y)p(b[y]),d=c.lineHeight;each(m.after,p);}u=0,d=c.lineHeight,each(this.afterBody,p),t.y-=n;}drawFooter(t,e,i){const s=this.footer,n=s.length;let a,o;if(n){const r=getRtlAdapter(i.rtl,this.x,this.width);for(t.x=getAlignedX(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=r.textAlign(i.footerAlign),e.textBaseline="middle",a=toFont(i.footerFont),e.fillStyle=i.footerColor,e.font=a.string,o=0;o<n;++o)e.fillText(s[o],r.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+i.footerSpacing;}}drawBackground(t,e,i,s){const{xAlign:n,yAlign:a}=this,{x:o,y:r}=t,{width:l,height:h}=i,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:g}=toTRBLCorners(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(o+c,r),"top"===a&&this.drawCaret(t,e,i,s),e.lineTo(o+l-d,r),e.quadraticCurveTo(o+l,r,o+l,r+d),"center"===a&&"right"===n&&this.drawCaret(t,e,i,s),e.lineTo(o+l,r+h-g),e.quadraticCurveTo(o+l,r+h,o+l-g,r+h),"bottom"===a&&this.drawCaret(t,e,i,s),e.lineTo(o+u,r+h),e.quadraticCurveTo(o,r+h,o,r+h-u),"center"===a&&"left"===n&&this.drawCaret(t,e,i,s),e.lineTo(o,r+c),e.quadraticCurveTo(o,r,o+c,r),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke();}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,s=i&&i.x,n=i&&i.y;if(s||n){const i=positioners[t.position].call(this,this._active,this._eventPosition);if(!i)return;const a=this._size=getTooltipSize(this,t),o=Object.assign({},i,this._size),r=determineAlignment(e,t,o),l=getBackgroundPoint(t,o,r,e);s._to===l.x&&n._to===l.y||(this.xAlign=r.xAlign,this.yAlign=r.yAlign,this.width=a.width,this.height=a.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l));}}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},n={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const a=toPadding(e.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&o&&(t.save(),t.globalAlpha=i,this.drawBackground(n,t,s,e),overrideTextDirection(t,e.textDirection),n.y+=a.top,this.drawTitle(n,t,e),this.drawBody(n,t,e),this.drawFooter(n,t,e),restoreTextDirection(t,e.textDirection),t.restore());}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map((({datasetIndex:t,index:e})=>{const i=this.chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return {datasetIndex:t,element:i.data[e],index:e}})),n=!_elementsEqual(i,s),a=this._positionChanged(s,e);(n||a)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0));}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return !1;this._ignoreReplayEvents=!1;const s=this.options,n=this._active||[],a=this._getActiveElements(t,n,e,i),o=this._positionChanged(a,t),r=e||!_elementsEqual(a,n)||o;return r&&(this._active=a,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),r}_getActiveElements(t,e,i,s){const n=this.options;if("mouseout"===t.type)return [];if(!s)return e;const a=this.chart.getElementsAtEventForMode(t,n.mode,n,i);return n.reverse&&a.reverse(),a}_positionChanged(t,e){const{caretX:i,caretY:s,options:n}=this,a=positioners[n.position].call(this,t,e);return !1!==a&&(i!==a.x||s!==a.y)}}Tooltip.positioners=positioners;var plugin_tooltip={id:"tooltip",_element:Tooltip,positioners:positioners,afterInit(t,e,i){i&&(t.tooltip=new Tooltip({chart:t,options:i}));},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i);},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i);},afterDraw(t){const e=t.tooltip,i={tooltip:e};!1!==t.notifyPlugins("beforeTooltipDraw",i)&&(e&&e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i));},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.changed=!0);}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:noop,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,s=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(s>0&&e.dataIndex<s)return i[e.dataIndex]}return ""},afterTitle:noop,beforeBody:noop,beforeLabel:noop,label(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const i=t.formattedValue;return isNullOrUndef(i)||(e+=i),e},labelColor(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return {borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return {pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:noop,afterBody:noop,beforeFooter:noop,footer:noop,afterFooter:noop}},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};Object.freeze({__proto__:null,Decimation:plugin_decimation,Filler:plugin_filler,Legend:plugin_legend,SubTitle:plugin_subtitle,Title:plugin_title,Tooltip:plugin_tooltip});const addIfString=(t,e,i,s)=>("string"==typeof e?(i=t.push(e)-1,s.unshift({index:i,label:e})):isNaN(e)&&(i=null),i);function findOrAddLabel(t,e,i,s){const n=t.indexOf(e);if(-1===n)return addIfString(t,e,i,s);return n!==t.lastIndexOf(e)?i:n}const validIndex=(t,e)=>null===t?null:_limitValue(Math.round(t),0,e);class CategoryScale extends Scale{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[];}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:i,label:s}of e)t[i]===s&&t.splice(i,1);this._addedLabels=[];}super.init(t);}parse(t,e){if(isNullOrUndef(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:findOrAddLabel(i,t,valueOrDefault(e,t),this._addedLabels),validIndex(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s;}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,s=[];let n=this.getLabels();n=0===t&&e===n.length-1?n:n.slice(t,e+1),this._valueRange=Math.max(n.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let i=t;i<=e;i++)s.push({value:i});return s}getLabelForValue(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels);}getPixelForValue(t){return "number"!=typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function generateTicks$1(t,e){const i=[],{bounds:s,step:n,min:a,max:o,precision:r,count:l,maxTicks:h,maxDigits:c,includeBounds:d}=t,u=n||1,g=h-1,{min:p,max:f}=e,m=!isNullOrUndef(a),x=!isNullOrUndef(o),b=!isNullOrUndef(l),_=(f-p)/(c+1);let y,v,S,k,M=niceNum((f-p)/g/u)*u;if(M<1e-14&&!m&&!x)return [{value:p},{value:f}];k=Math.ceil(f/M)-Math.floor(p/M),k>g&&(M=niceNum(k*M/g/u)*u),isNullOrUndef(r)||(y=Math.pow(10,r),M=Math.ceil(M*y)/y),"ticks"===s?(v=Math.floor(p/M)*M,S=Math.ceil(f/M)*M):(v=p,S=f),m&&x&&n&&almostWhole((o-a)/n,M/1e3)?(k=Math.round(Math.min((o-a)/M,h)),M=(o-a)/k,v=a,S=o):b?(v=m?a:v,S=x?o:S,k=l-1,M=(S-v)/k):(k=(S-v)/M,k=almostEquals(k,Math.round(k),M/1e3)?Math.round(k):Math.ceil(k));const P=Math.max(_decimalPlaces(M),_decimalPlaces(v));y=Math.pow(10,isNullOrUndef(r)?P:r),v=Math.round(v*y)/y,S=Math.round(S*y)/y;let D=0;for(m&&(d&&v!==a?(i.push({value:a}),v<a&&D++,almostEquals(Math.round((v+D*M)*y)/y,a,relativeLabelSize(a,_,t))&&D++):v<a&&D++);D<k;++D)i.push({value:Math.round((v+D*M)*y)/y});return x&&d&&S!==o?i.length&&almostEquals(i[i.length-1].value,o,relativeLabelSize(o,_,t))?i[i.length-1].value=o:i.push({value:o}):x&&S!==o||i.push({value:S}),i}function relativeLabelSize(t,e,{horizontal:i,minRotation:s}){const n=toRadians(s),a=(i?Math.sin(n):Math.cos(n))||.001,o=.75*e*(""+t).length;return Math.min(e/a,o)}CategoryScale.id="category",CategoryScale.defaults={ticks:{callback:CategoryScale.prototype.getLabelForValue}};class LinearScaleBase extends Scale{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0;}parse(t,e){return isNullOrUndef(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:s,max:n}=this;const a=t=>s=e?s:t,o=t=>n=i?n:t;if(t){const t=sign(s),e=sign(n);t<0&&e<0?o(0):t>0&&e>0&&a(0);}if(s===n){let e=1;(n>=Number.MAX_SAFE_INTEGER||s<=Number.MIN_SAFE_INTEGER)&&(e=Math.abs(.05*n)),o(n+e),t||a(s-e);}this.min=s,this.max=n;}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:s}=t;return s?(e=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s=generateTicks$1({maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},this._range||this);return "ticks"===t.bounds&&_setMinAndMaxByKey(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-e)/Math.max(t.length-1,1)/2;e-=s,i+=s;}this._startValue=e,this._endValue=i,this._valueRange=i-e;}getLabelForValue(t){return formatNumber(t,this.chart.options.locale,this.options.ticks.format)}}class LinearScale extends LinearScaleBase{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=isNumberFinite(t)?t:0,this.max=isNumberFinite(e)?e:1,this.handleTickRangeOptions();}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=toRadians(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,n=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,n.lineHeight/s))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}function isMajor(t){return 1===t/Math.pow(10,Math.floor(log10(t)))}function generateTicks(t,e){const i=Math.floor(log10(e.max)),s=Math.ceil(e.max/Math.pow(10,i)),n=[];let a=finiteOrDefault(t.min,Math.pow(10,Math.floor(log10(e.min)))),o=Math.floor(log10(a)),r=Math.floor(a/Math.pow(10,o)),l=o<0?Math.pow(10,Math.abs(o)):1;do{n.push({value:a,major:isMajor(a)}),++r,10===r&&(r=1,++o,l=o>=0?1:l),a=Math.round(r*Math.pow(10,o)*l)/l;}while(o<i||o===i&&r<s);const h=finiteOrDefault(t.max,a);return n.push({value:h,major:isMajor(a)}),n}LinearScale.id="linear",LinearScale.defaults={ticks:{callback:Ticks.formatters.numeric}};class LogarithmicScale extends Scale{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0;}parse(t,e){const i=LinearScaleBase.prototype.parse.apply(this,[t,e]);if(0!==i)return isNumberFinite(i)&&i>0?i:null;this._zero=!0;}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=isNumberFinite(t)?Math.max(0,t):null,this.max=isNumberFinite(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions();}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,s=this.max;const n=e=>i=t?i:e,a=t=>s=e?s:t,o=(t,e)=>Math.pow(10,Math.floor(log10(t))+e);i===s&&(i<=0?(n(1),a(10)):(n(o(i,-1)),a(o(s,1)))),i<=0&&n(o(s,-1)),s<=0&&a(o(i,1)),this._zero&&this.min!==this._suggestedMin&&i===o(this.min,0)&&n(o(i,-1)),this.min=i,this.max=s;}buildTicks(){const t=this.options,e=generateTicks({min:this._userMin,max:this._userMax},this);return "ticks"===t.bounds&&_setMinAndMaxByKey(e,this,"value"),t.reverse?(e.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),e}getLabelForValue(t){return void 0===t?"0":formatNumber(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=log10(t),this._valueRange=log10(this.max)-log10(t);}getPixelForValue(t){return void 0!==t&&0!==t||(t=this.min),null===t||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(log10(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function getTickBackdropHeight(t){const e=t.ticks;if(e.display&&t.display){const t=toPadding(e.backdropPadding);return valueOrDefault(e.font&&e.font.size,defaults.font.size)+t.height}return 0}function measureLabelSize(t,e,i){return i=isArray(i)?i:[i],{w:_longestText(t,e.string,i),h:i.length*e.lineHeight}}function determineLimits(t,e,i,s,n){return t===s||t===n?{start:e-i/2,end:e+i/2}:t<s||t>n?{start:e-i,end:e}:{start:e,end:e+i}}function fitWithPointLabels(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},i=Object.assign({},e),s=[],n=[],a=t._pointLabels.length,o=t.options.pointLabels,r=o.centerPointLabels?PI/a:0;for(let l=0;l<a;l++){const a=o.setContext(t.getPointLabelContext(l));n[l]=a.padding;const h=t.getPointPosition(l,t.drawingArea+n[l],r),c=toFont(a.font),d=measureLabelSize(t.ctx,c,t._pointLabels[l]);s[l]=d;const u=_normalizeAngle(t.getIndexAngle(l)+r),g=Math.round(toDegrees(u));updateLimits(i,e,u,determineLimits(g,h.x,d.w,0,180),determineLimits(g,h.y,d.h,90,270));}t.setCenterPoint(e.l-i.l,i.r-e.r,e.t-i.t,i.b-e.b),t._pointLabelItems=buildPointLabelItems(t,s,n);}function updateLimits(t,e,i,s,n){const a=Math.abs(Math.sin(i)),o=Math.abs(Math.cos(i));let r=0,l=0;s.start<e.l?(r=(e.l-s.start)/a,t.l=Math.min(t.l,e.l-r)):s.end>e.r&&(r=(s.end-e.r)/a,t.r=Math.max(t.r,e.r+r)),n.start<e.t?(l=(e.t-n.start)/o,t.t=Math.min(t.t,e.t-l)):n.end>e.b&&(l=(n.end-e.b)/o,t.b=Math.max(t.b,e.b+l));}function buildPointLabelItems(t,e,i){const s=[],n=t._pointLabels.length,a=t.options,o=getTickBackdropHeight(a)/2,r=t.drawingArea,l=a.pointLabels.centerPointLabels?PI/n:0;for(let a=0;a<n;a++){const n=t.getPointPosition(a,r+o+i[a],l),h=Math.round(toDegrees(_normalizeAngle(n.angle+HALF_PI))),c=e[a],d=yForAngle(n.y,c.h,h),u=getTextAlignForAngle(h),g=leftForTextAlign(n.x,c.w,u);s.push({x:n.x,y:d,textAlign:u,left:g,top:d,right:g+c.w,bottom:d+c.h});}return s}function getTextAlignForAngle(t){return 0===t||180===t?"center":t<180?"left":"right"}function leftForTextAlign(t,e,i){return "right"===i?t-=e:"center"===i&&(t-=e/2),t}function yForAngle(t,e,i){return 90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e),t}function drawPointLabels(t,e){const{ctx:i,options:{pointLabels:s}}=t;for(let n=e-1;n>=0;n--){const e=s.setContext(t.getPointLabelContext(n)),a=toFont(e.font),{x:o,y:r,textAlign:l,left:h,top:c,right:d,bottom:u}=t._pointLabelItems[n],{backdropColor:g}=e;if(!isNullOrUndef(g)){const t=toPadding(e.backdropPadding);i.fillStyle=g,i.fillRect(h-t.left,c-t.top,d-h+t.width,u-c+t.height);}renderText(i,t._pointLabels[n],o,r+a.lineHeight/2,a,{color:e.color,textAlign:l,textBaseline:"middle"});}}function pathRadiusLine(t,e,i,s){const{ctx:n}=t;if(i)n.arc(t.xCenter,t.yCenter,e,0,TAU);else {let i=t.getPointPosition(0,e);n.moveTo(i.x,i.y);for(let a=1;a<s;a++)i=t.getPointPosition(a,e),n.lineTo(i.x,i.y);}}function drawRadiusLine(t,e,i,s){const n=t.ctx,a=e.circular,{color:o,lineWidth:r}=e;!a&&!s||!o||!r||i<0||(n.save(),n.strokeStyle=o,n.lineWidth=r,n.setLineDash(e.borderDash),n.lineDashOffset=e.borderDashOffset,n.beginPath(),pathRadiusLine(t,i,a,s),n.closePath(),n.stroke(),n.restore());}function createPointLabelContext(t,e,i){return createContext(t,{label:i,index:e,type:"pointLabel"})}LogarithmicScale.id="logarithmic",LogarithmicScale.defaults={ticks:{callback:Ticks.formatters.logarithmic,major:{enabled:!0}}};class RadialLinearScale extends LinearScaleBase{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[];}setDimensions(){const t=this._padding=toPadding(getTickBackdropHeight(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2);}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=isNumberFinite(t)&&!isNaN(t)?t:0,this.max=isNumberFinite(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions();}computeTickLimit(){return Math.ceil(this.drawingArea/getTickBackdropHeight(this.options))}generateTickLabels(t){LinearScaleBase.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map(((t,e)=>{const i=callback(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""})).filter(((t,e)=>this.chart.getDataVisibility(e)));}fit(){const t=this.options;t.display&&t.pointLabels.display?fitWithPointLabels(this):this.setCenterPoint(0,0,0,0);}setCenterPoint(t,e,i,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,s));}getIndexAngle(t){const e=TAU/(this._pointLabels.length||1),i=this.options.startAngle||0;return _normalizeAngle(t*e+toRadians(i))}getDistanceFromCenterForValue(t){if(isNullOrUndef(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(isNullOrUndef(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return createPointLabelContext(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const s=this.getIndexAngle(t)-HALF_PI+i;return {x:Math.cos(s)*e+this.xCenter,y:Math.sin(s)*e+this.yCenter,angle:s}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:s,bottom:n}=this._pointLabelItems[t];return {left:e,top:i,right:s,bottom:n}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),pathRadiusLine(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore();}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:s}=e,n=this._pointLabels.length;let a,o,r;if(e.pointLabels.display&&drawPointLabels(this,n),s.display&&this.ticks.forEach(((t,e)=>{if(0!==e){o=this.getDistanceFromCenterForValue(t.value);drawRadiusLine(this,s.setContext(this.getContext(e-1)),o,n);}})),i.display){for(t.save(),a=n-1;a>=0;a--){const s=i.setContext(this.getPointLabelContext(a)),{color:n,lineWidth:l}=s;l&&n&&(t.lineWidth=l,t.strokeStyle=n,t.setLineDash(s.borderDash),t.lineDashOffset=s.borderDashOffset,o=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),r=this.getPointPosition(a,o),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(r.x,r.y),t.stroke());}t.restore();}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let n,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach(((s,o)=>{if(0===o&&!e.reverse)return;const r=i.setContext(this.getContext(o)),l=toFont(r.font);if(n=this.getDistanceFromCenterForValue(this.ticks[o].value),r.showLabelBackdrop){t.font=l.string,a=t.measureText(s.label).width,t.fillStyle=r.backdropColor;const e=toPadding(r.backdropPadding);t.fillRect(-a/2-e.left,-n-l.size/2-e.top,a+e.width,l.size+e.height);}renderText(t,s.label,0,-n,l,{color:r.color});})),t.restore();}drawTitle(){}}RadialLinearScale.id="radialLinear",RadialLinearScale.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ticks.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5,centerPointLabels:!1}},RadialLinearScale.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},RadialLinearScale.descriptors={angleLines:{_fallback:"grid"}};const INTERVALS={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},UNITS=Object.keys(INTERVALS);function sorter(t,e){return t-e}function parse(t,e){if(isNullOrUndef(e))return null;const i=t._adapter,{parser:s,round:n,isoWeekday:a}=t._parseOpts;let o=e;return "function"==typeof s&&(o=s(o)),isNumberFinite(o)||(o="string"==typeof s?i.parse(o,s):i.parse(o)),null===o?null:(n&&(o="week"!==n||!isNumber(a)&&!0!==a?i.startOf(o,n):i.startOf(o,"isoWeek",a)),+o)}function determineUnitForAutoTicks(t,e,i,s){const n=UNITS.length;for(let a=UNITS.indexOf(t);a<n-1;++a){const t=INTERVALS[UNITS[a]],n=t.steps?t.steps:Number.MAX_SAFE_INTEGER;if(t.common&&Math.ceil((i-e)/(n*t.size))<=s)return UNITS[a]}return UNITS[n-1]}function determineUnitForFormatting(t,e,i,s,n){for(let a=UNITS.length-1;a>=UNITS.indexOf(i);a--){const i=UNITS[a];if(INTERVALS[i].common&&t._adapter.diff(n,s,i)>=e-1)return i}return UNITS[i?UNITS.indexOf(i):0]}function determineMajorUnit(t){for(let e=UNITS.indexOf(t)+1,i=UNITS.length;e<i;++e)if(INTERVALS[UNITS[e]].common)return UNITS[e]}function addTick(t,e,i){if(i){if(i.length){const{lo:s,hi:n}=_lookup(i,e);t[i[s]>=e?i[s]:i[n]]=!0;}}else t[e]=!0;}function setMajorTicks(t,e,i,s){const n=t._adapter,a=+n.startOf(e[0].value,s),o=e[e.length-1].value;let r,l;for(r=a;r<=o;r=+n.add(r,1,s))l=i[r],l>=0&&(e[l].major=!0);return e}function ticksFromTimestamps(t,e,i){const s=[],n={},a=e.length;let o,r;for(o=0;o<a;++o)r=e[o],n[r]=o,s.push({value:r,major:!1});return 0!==a&&i?setMajorTicks(t,s,n,i):s}class TimeScale extends Scale{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0;}init(t,e){const i=t.time||(t.time={}),s=this._adapter=new adapters._date(t.adapters.date);mergeIf(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized;}parse(t,e){return void 0===t?null:parse(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]};}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:s,max:n,minDefined:a,maxDefined:o}=this.getUserBounds();function r(t){a||isNaN(t.min)||(s=Math.min(s,t.min)),o||isNaN(t.max)||(n=Math.max(n,t.max));}a&&o||(r(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||r(this.getMinMax(!1))),s=isNumberFinite(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),n=isNumberFinite(n)&&!isNaN(n)?n:+e.endOf(Date.now(),i)+1,this.min=Math.min(s,n-1),this.max=Math.max(s+1,n);}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,s="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const n=this.min,a=this.max,o=_filterBetween(s,n,a);return this._unit=e.unit||(i.autoSkip?determineUnitForAutoTicks(e.minUnit,this.min,this.max,this._getLabelCapacity(n)):determineUnitForFormatting(this,o.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?determineMajorUnit(this._unit):void 0,this.initOffsets(s),t.reverse&&o.reverse(),ticksFromTimestamps(this,o,this._majorUnit)}initOffsets(t){let e,i,s=0,n=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),s=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,i=this.getDecimalForValue(t[t.length-1]),n=1===t.length?i:(i-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;s=_limitValue(s,0,a),n=_limitValue(n,0,a),this._offsets={start:s,end:n,factor:1/(s+1+n)};}_generate(){const t=this._adapter,e=this.min,i=this.max,s=this.options,n=s.time,a=n.unit||determineUnitForAutoTicks(n.minUnit,e,i,this._getLabelCapacity(e)),o=valueOrDefault(n.stepSize,1),r="week"===a&&n.isoWeekday,l=isNumber(r)||!0===r,h={};let c,d,u=e;if(l&&(u=+t.startOf(u,"isoWeek",r)),u=+t.startOf(u,l?"day":a),t.diff(i,e,a)>1e5*o)throw new Error(e+" and "+i+" are too far apart with stepSize of "+o+" "+a);const g="data"===s.ticks.source&&this.getDataTimestamps();for(c=u,d=0;c<i;c=+t.add(c,o,a),d++)addTick(h,c,g);return c!==i&&"ticks"!==s.bounds&&1!==d||addTick(h,c,g),Object.keys(h).sort(((t,e)=>t-e)).map((t=>+t))}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}_tickFormatFunction(t,e,i,s){const n=this.options,a=n.time.displayFormats,o=this._unit,r=this._majorUnit,l=o&&a[o],h=r&&a[r],c=i[e],d=r&&h&&c&&c.major,u=this._adapter.format(t,s||(d?h:l)),g=n.ticks.callback;return g?callback(g,[u,e,i],this):u}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e<i;++e)s=t[e],s.label=this._tickFormatFunction(s.value,e,t);}getDecimalForValue(t){return null===t?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,s=toRadians(this.isHorizontal()?e.maxRotation:e.minRotation),n=Math.cos(s),a=Math.sin(s),o=this._resolveTickFontOptions(0).size;return {w:i*n+o*a,h:i*a+o*n}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,s=i[e.unit]||i.millisecond,n=this._tickFormatFunction(t,0,ticksFromTimestamps(this,[t],this._majorUnit),s),a=this._getLabelSize(n),o=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return o>0?o:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(t=0,e=s.length;t<e;++t)i=i.concat(s[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(i)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const s=this.getLabels();for(e=0,i=s.length;e<i;++e)t.push(parse(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return _arrayUnique(t.sort(sorter))}}function interpolate(t,e,i){let s,n,a,o,r=0,l=t.length-1;i?(e>=t[r].pos&&e<=t[l].pos&&({lo:r,hi:l}=_lookupByKey(t,"pos",e)),({pos:s,time:a}=t[r]),({pos:n,time:o}=t[l])):(e>=t[r].time&&e<=t[l].time&&({lo:r,hi:l}=_lookupByKey(t,"time",e)),({time:s,pos:a}=t[r]),({time:n,pos:o}=t[l]));const h=n-s;return h?a+(o-a)*(e-s)/h:a}TimeScale.id="time",TimeScale.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};class TimeSeriesScale extends TimeScale{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0;}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=interpolate(e,this.min),this._tableRange=interpolate(e,this.max)-this._minPos,super.initOffsets(t);}buildLookupTable(t){const{min:e,max:i}=this,s=[],n=[];let a,o,r,l,h;for(a=0,o=t.length;a<o;++a)l=t[a],l>=e&&l<=i&&s.push(l);if(s.length<2)return [{time:e,pos:0},{time:i,pos:1}];for(a=0,o=s.length;a<o;++a)h=s[a+1],r=s[a-1],l=s[a],Math.round((h+r)/2)!==l&&n.push({time:l,pos:a/(o-1)});return n}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return t=e.length&&i.length?this.normalize(e.concat(i)):e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return (interpolate(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return interpolate(this._table,i*this._tableRange+this._minPos,!0)}}TimeSeriesScale.id="timeseries",TimeSeriesScale.defaults=TimeScale.defaults;Object.freeze({__proto__:null,CategoryScale:CategoryScale,LinearScale:LinearScale,LogarithmicScale:LogarithmicScale,RadialLinearScale:RadialLinearScale,TimeScale:TimeScale,TimeSeriesScale:TimeSeriesScale});var App=function(i){function o(){var o=i.call(this)||this;return o.initialise(),o}return __extends(o,i),o}(HoodApi);window.hood=new App;exports.App=App;Object.defineProperty(exports,'__esModule',{value:true});}));
41
41
  if (typeof this !== 'undefined' && this.hood){ this.hoodCMS = this.Hood = this.hoodCMS = this.HoodCMS = this.hood }