From 38507bbb94f974deffa48d6eda7f7f4178ccf43a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=9C=D0=B0=D0=BA=D1=81=D0=B8=D0=BC?=
Date: Mon, 20 Jul 2020 14:49:05 +0500
Subject: [PATCH] update react build
---
php/react/asset-manifest.json | 16 +++++-----
php/react/index.html | 2 +-
...nifest.9a88b51448b0eef5b302b92cf53039e4.js | 30 -------------------
...nifest.ad7608aa14a5a0c6a5b8f2f91855b69f.js | 30 +++++++++++++++++++
php/react/service-worker.js | 2 +-
php/react/static/js/2.3e36c635.chunk.js | 3 ++
...js.LICENSE => 2.3e36c635.chunk.js.LICENSE} | 18 +++++------
...1.chunk.js.map => 2.3e36c635.chunk.js.map} | 2 +-
php/react/static/js/2.54356701.chunk.js | 3 --
php/react/static/js/main.56e05b03.chunk.js | 2 --
.../static/js/main.56e05b03.chunk.js.map | 1 -
php/react/static/js/main.b0b97791.chunk.js | 2 ++
.../static/js/main.b0b97791.chunk.js.map | 1 +
spa-react/package.json | 2 +-
14 files changed, 57 insertions(+), 57 deletions(-)
delete mode 100644 php/react/precache-manifest.9a88b51448b0eef5b302b92cf53039e4.js
create mode 100644 php/react/precache-manifest.ad7608aa14a5a0c6a5b8f2f91855b69f.js
create mode 100644 php/react/static/js/2.3e36c635.chunk.js
rename php/react/static/js/{2.54356701.chunk.js.LICENSE => 2.3e36c635.chunk.js.LICENSE} (100%)
rename php/react/static/js/{2.54356701.chunk.js.map => 2.3e36c635.chunk.js.map} (73%)
delete mode 100644 php/react/static/js/2.54356701.chunk.js
delete mode 100644 php/react/static/js/main.56e05b03.chunk.js
delete mode 100644 php/react/static/js/main.56e05b03.chunk.js.map
create mode 100644 php/react/static/js/main.b0b97791.chunk.js
create mode 100644 php/react/static/js/main.b0b97791.chunk.js.map
diff --git a/php/react/asset-manifest.json b/php/react/asset-manifest.json
index 4bedf90..207cc6a 100644
--- a/php/react/asset-manifest.json
+++ b/php/react/asset-manifest.json
@@ -1,25 +1,25 @@
{
"files": {
"main.css": "./static/css/main.629dc5cc.chunk.css",
- "main.js": "./static/js/main.56e05b03.chunk.js",
- "main.js.map": "./static/js/main.56e05b03.chunk.js.map",
+ "main.js": "./static/js/main.b0b97791.chunk.js",
+ "main.js.map": "./static/js/main.b0b97791.chunk.js.map",
"runtime-main.js": "./static/js/runtime-main.f5e9acab.js",
"runtime-main.js.map": "./static/js/runtime-main.f5e9acab.js.map",
"static/css/2.764ccc25.chunk.css": "./static/css/2.764ccc25.chunk.css",
- "static/js/2.54356701.chunk.js": "./static/js/2.54356701.chunk.js",
- "static/js/2.54356701.chunk.js.map": "./static/js/2.54356701.chunk.js.map",
+ "static/js/2.3e36c635.chunk.js": "./static/js/2.3e36c635.chunk.js",
+ "static/js/2.3e36c635.chunk.js.map": "./static/js/2.3e36c635.chunk.js.map",
"index.html": "./index.html",
- "precache-manifest.9a88b51448b0eef5b302b92cf53039e4.js": "./precache-manifest.9a88b51448b0eef5b302b92cf53039e4.js",
+ "precache-manifest.ad7608aa14a5a0c6a5b8f2f91855b69f.js": "./precache-manifest.ad7608aa14a5a0c6a5b8f2f91855b69f.js",
"service-worker.js": "./service-worker.js",
"static/css/2.764ccc25.chunk.css.map": "./static/css/2.764ccc25.chunk.css.map",
"static/css/main.629dc5cc.chunk.css.map": "./static/css/main.629dc5cc.chunk.css.map",
- "static/js/2.54356701.chunk.js.LICENSE": "./static/js/2.54356701.chunk.js.LICENSE"
+ "static/js/2.3e36c635.chunk.js.LICENSE": "./static/js/2.3e36c635.chunk.js.LICENSE"
},
"entrypoints": [
"static/js/runtime-main.f5e9acab.js",
"static/css/2.764ccc25.chunk.css",
- "static/js/2.54356701.chunk.js",
+ "static/js/2.3e36c635.chunk.js",
"static/css/main.629dc5cc.chunk.css",
- "static/js/main.56e05b03.chunk.js"
+ "static/js/main.b0b97791.chunk.js"
]
}
\ No newline at end of file
diff --git a/php/react/index.html b/php/react/index.html
index c31946f..7a1fea7 100644
--- a/php/react/index.html
+++ b/php/react/index.html
@@ -1 +1 @@
-Tasks
\ No newline at end of file
+Tasks
\ No newline at end of file
diff --git a/php/react/precache-manifest.9a88b51448b0eef5b302b92cf53039e4.js b/php/react/precache-manifest.9a88b51448b0eef5b302b92cf53039e4.js
deleted file mode 100644
index 72ca715..0000000
--- a/php/react/precache-manifest.9a88b51448b0eef5b302b92cf53039e4.js
+++ /dev/null
@@ -1,30 +0,0 @@
-self.__precacheManifest = (self.__precacheManifest || []).concat([
- {
- "revision": "eb7b73a89f3446c26c95250bf982fc0b",
- "url": "./index.html"
- },
- {
- "revision": "9e80264898a7d770f785",
- "url": "./static/css/2.764ccc25.chunk.css"
- },
- {
- "revision": "6046a7118e2b308630b2",
- "url": "./static/css/main.629dc5cc.chunk.css"
- },
- {
- "revision": "9e80264898a7d770f785",
- "url": "./static/js/2.54356701.chunk.js"
- },
- {
- "revision": "07387c8408fbdbfbdecc0797f00eefd9",
- "url": "./static/js/2.54356701.chunk.js.LICENSE"
- },
- {
- "revision": "6046a7118e2b308630b2",
- "url": "./static/js/main.56e05b03.chunk.js"
- },
- {
- "revision": "43ae00e8c71e27ece866",
- "url": "./static/js/runtime-main.f5e9acab.js"
- }
-]);
\ No newline at end of file
diff --git a/php/react/precache-manifest.ad7608aa14a5a0c6a5b8f2f91855b69f.js b/php/react/precache-manifest.ad7608aa14a5a0c6a5b8f2f91855b69f.js
new file mode 100644
index 0000000..3a63d7f
--- /dev/null
+++ b/php/react/precache-manifest.ad7608aa14a5a0c6a5b8f2f91855b69f.js
@@ -0,0 +1,30 @@
+self.__precacheManifest = (self.__precacheManifest || []).concat([
+ {
+ "revision": "5c2658977169e179602cc324c08b96b2",
+ "url": "./index.html"
+ },
+ {
+ "revision": "906450e0ab0030bb2740",
+ "url": "./static/css/2.764ccc25.chunk.css"
+ },
+ {
+ "revision": "2bbbcea50a10669f56e1",
+ "url": "./static/css/main.629dc5cc.chunk.css"
+ },
+ {
+ "revision": "906450e0ab0030bb2740",
+ "url": "./static/js/2.3e36c635.chunk.js"
+ },
+ {
+ "revision": "19bcc61eb74197a0e5e9d75bcef2c977",
+ "url": "./static/js/2.3e36c635.chunk.js.LICENSE"
+ },
+ {
+ "revision": "2bbbcea50a10669f56e1",
+ "url": "./static/js/main.b0b97791.chunk.js"
+ },
+ {
+ "revision": "43ae00e8c71e27ece866",
+ "url": "./static/js/runtime-main.f5e9acab.js"
+ }
+]);
\ No newline at end of file
diff --git a/php/react/service-worker.js b/php/react/service-worker.js
index c44cac4..723cb90 100644
--- a/php/react/service-worker.js
+++ b/php/react/service-worker.js
@@ -14,7 +14,7 @@
importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js");
importScripts(
- "./precache-manifest.9a88b51448b0eef5b302b92cf53039e4.js"
+ "./precache-manifest.ad7608aa14a5a0c6a5b8f2f91855b69f.js"
);
self.addEventListener('message', (event) => {
diff --git a/php/react/static/js/2.3e36c635.chunk.js b/php/react/static/js/2.3e36c635.chunk.js
new file mode 100644
index 0000000..471f5d2
--- /dev/null
+++ b/php/react/static/js/2.3e36c635.chunk.js
@@ -0,0 +1,3 @@
+/*! For license information please see 2.3e36c635.chunk.js.LICENSE */
+(this["webpackJsonpspa-react"]=this["webpackJsonpspa-react"]||[]).push([[2],[function(e,t,n){"use strict";e.exports=n(44)},function(e,t,n){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t=0;r--){var i=t[r](e);if(i)return i}return function(t,r){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function z(e,t){return e===t}function V(e){var t=void 0===e?{}:e,n=t.connectHOC,r=void 0===n?T:n,i=t.mapStateToPropsFactories,o=void 0===i?N:i,a=t.mapDispatchToPropsFactories,s=void 0===a?O:a,l=t.mergePropsFactories,u=void 0===l?D:l,c=t.selectorFactory,h=void 0===c?L:c;return function(e,t,n,i){void 0===i&&(i={});var a=i,l=a.pure,c=void 0===l||l,p=a.areStatesEqual,v=void 0===p?z:p,m=a.areOwnPropsEqual,g=void 0===m?S:m,y=a.areStatePropsEqual,b=void 0===y?S:y,k=a.areMergedPropsEqual,w=void 0===k?S:k,_=Object(d.a)(a,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),x=F(e,o,"mapStateToProps"),T=F(t,s,"mapDispatchToProps"),C=F(n,u,"mergeProps");return r(h,Object(f.a)({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:x,initMapDispatchToProps:T,initMergeProps:C,pure:c,areStatesEqual:v,areOwnPropsEqual:g,areStatePropsEqual:b,areMergedPropsEqual:w},_))}}var B=V();var U,H=n(20);n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return B})),U=H.unstable_batchedUpdates,a=U},function(e,t,n){"use strict";function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function i(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}n.d(t,"a",(function(){return i}))},function(e,t,n){"use strict";function r(e){return(r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"===typeof Symbol&&"symbol"===r(Symbol.iterator)?function(e){return r(e)}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":r(e)})(e)}var o=n(11);function a(e,t){return!t||"object"!==i(t)&&"function"!==typeof t?Object(o.a)(e):t}n.d(t,"a",(function(){return a}))},function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return m})),n.d(t,"b",(function(){return f})),n.d(t,"c",(function(){return u})),n.d(t,"d",(function(){return v})),n.d(t,"e",(function(){return s}));var r=n(28),i=function(){return Math.random().toString(36).substring(7).split("").join(".")},o={INIT:"@@redux/INIT"+i(),REPLACE:"@@redux/REPLACE"+i(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+i()}};function a(e){if("object"!==typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function s(e,t,n){var i;if("function"===typeof t&&"function"===typeof n||"function"===typeof n&&"function"===typeof arguments[3])throw new Error("It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function.");if("function"===typeof t&&"undefined"===typeof n&&(n=t,t=void 0),"undefined"!==typeof n){if("function"!==typeof n)throw new Error("Expected the enhancer to be a function.");return n(s)(e,t)}if("function"!==typeof e)throw new Error("Expected the reducer to be a function.");var l=e,u=t,c=[],f=c,d=!1;function h(){f===c&&(f=c.slice())}function p(){if(d)throw new Error("You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return u}function v(e){if("function"!==typeof e)throw new Error("Expected the listener to be a function.");if(d)throw new Error("You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api-reference/store#subscribelistener for more details.");var t=!0;return h(),f.push(e),function(){if(t){if(d)throw new Error("You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api-reference/store#subscribelistener for more details.");t=!1,h();var n=f.indexOf(e);f.splice(n,1),c=null}}}function m(e){if(!a(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if("undefined"===typeof e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(d)throw new Error("Reducers may not dispatch actions.");try{d=!0,u=l(u,e)}finally{d=!1}for(var t=c=f,n=0;n=0;i--)l(e(r[i]),n)}(i)},remove:function(n){var r=f();t||s(r),n&&0===e(":focus",n).length?d(n):t.children().length&&t.remove()},error:function(e,t,n){return c({type:o.error,iconClass:f().iconClasses.error,message:e,optionsOverride:n,title:t})},getContainer:s,info:function(e,t,n){return c({type:o.info,iconClass:f().iconClasses.info,message:e,optionsOverride:n,title:t})},options:{},subscribe:function(e){n=e},success:function(e,t,n){return c({type:o.success,iconClass:f().iconClasses.success,message:e,optionsOverride:n,title:t})},version:"2.1.4",warning:function(e,t,n){return c({type:o.warning,iconClass:f().iconClasses.warning,message:e,optionsOverride:n,title:t})}};return a;function s(n,r){return n||(n=f()),(t=e("#"+n.containerId)).length?t:(r&&(t=function(n){return(t=e("").attr("id",n.containerId).addClass(n.positionClass)).appendTo(e(n.target)),t}(n)),t)}function l(t,n,r){var i=!(!r||!r.force)&&r.force;return!(!t||!i&&0!==e(":focus",t).length)&&(t[n.hideMethod]({duration:n.hideDuration,easing:n.hideEasing,complete:function(){d(t)}}),!0)}function u(e){n&&n(e)}function c(n){var o=f(),a=n.iconClass||o.iconClass;if("undefined"!==typeof n.optionsOverride&&(o=e.extend(o,n.optionsOverride),a=n.optionsOverride.iconClass||a),!function(e,t){if(e.preventDuplicates){if(t.message===r)return!0;r=t.message}return!1}(o,n)){i++,t=s(o,!0);var l=null,c=e(""),h=e(""),p=e(""),v=e(""),m=e(o.closeHtml),g={intervalId:null,hideEta:null,maxHideTime:null},y={toastId:i,state:"visible",startTime:new Date,options:o,map:n};return n.iconClass&&c.addClass(o.toastClass).addClass(a),function(){if(n.title){var e=n.title;o.escapeHtml&&(e=b(n.title)),h.append(e).addClass(o.titleClass),c.append(h)}}(),function(){if(n.message){var e=n.message;o.escapeHtml&&(e=b(n.message)),p.append(e).addClass(o.messageClass),c.append(p)}}(),o.closeButton&&(m.addClass(o.closeClass).attr("role","button"),c.prepend(m)),o.progressBar&&(v.addClass(o.progressClass),c.prepend(v)),o.rtl&&c.addClass("rtl"),o.newestOnTop?t.prepend(c):t.append(c),function(){var e="";switch(n.iconClass){case"toast-success":case"toast-info":e="polite";break;default:e="assertive"}c.attr("aria-live",e)}(),c.hide(),c[o.showMethod]({duration:o.showDuration,easing:o.showEasing,complete:o.onShown}),o.timeOut>0&&(l=setTimeout(k,o.timeOut),g.maxHideTime=parseFloat(o.timeOut),g.hideEta=(new Date).getTime()+g.maxHideTime,o.progressBar&&(g.intervalId=setInterval(x,10))),o.closeOnHover&&c.hover(_,w),!o.onclick&&o.tapToDismiss&&c.click(k),o.closeButton&&m&&m.click((function(e){e.stopPropagation?e.stopPropagation():void 0!==e.cancelBubble&&!0!==e.cancelBubble&&(e.cancelBubble=!0),o.onCloseClick&&o.onCloseClick(e),k(!0)})),o.onclick&&c.click((function(e){o.onclick(e),k()})),u(y),o.debug&&console&&console.log(y),c}function b(e){return null==e&&(e=""),e.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function k(t){var n=t&&!1!==o.closeMethod?o.closeMethod:o.hideMethod,r=t&&!1!==o.closeDuration?o.closeDuration:o.hideDuration,i=t&&!1!==o.closeEasing?o.closeEasing:o.hideEasing;if(!e(":focus",c).length||t)return clearTimeout(g.intervalId),c[n]({duration:r,easing:i,complete:function(){d(c),clearTimeout(l),o.onHidden&&"hidden"!==y.state&&o.onHidden(),y.state="hidden",y.endTime=new Date,u(y)}})}function w(){(o.timeOut>0||o.extendedTimeOut>0)&&(l=setTimeout(k,o.extendedTimeOut),g.maxHideTime=parseFloat(o.extendedTimeOut),g.hideEta=(new Date).getTime()+g.maxHideTime)}function _(){clearTimeout(l),g.hideEta=0,c.stop(!0,!0)[o.showMethod]({duration:o.showDuration,easing:o.showEasing})}function x(){var e=(g.hideEta-(new Date).getTime())/g.maxHideTime*100;v.width(e+"%")}}function f(){return e.extend({},{tapToDismiss:!0,toastClass:"toast",containerId:"toast-container",debug:!1,showMethod:"fadeIn",showDuration:300,showEasing:"swing",onShown:void 0,hideMethod:"fadeOut",hideDuration:1e3,hideEasing:"swing",onHidden:void 0,closeMethod:!1,closeDuration:!1,closeEasing:!1,closeOnHover:!0,extendedTimeOut:1e3,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},iconClass:"toast-info",positionClass:"toast-top-right",timeOut:5e3,titleClass:"toast-title",messageClass:"toast-message",escapeHtml:!1,target:"body",closeHtml:'',closeClass:"toast-close-button",newestOnTop:!0,preventDuplicates:!1,progressBar:!1,progressClass:"toast-progress",rtl:!1},a.options)}function d(e){t||(t=s()),e.is(":visible")||(e.remove(),e=null,0===t.children().length&&(t.remove(),r=void 0))}}()}.apply(t,r))||(e.exports=i)},function(e,t,n){"use strict";var r=n(21),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(e){return r.isMemo(e)?a:s[e.$$typeof]||i}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=a;var u=Object.defineProperty,c=Object.getOwnPropertyNames,f=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,h=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,n,r){if("string"!==typeof n){if(p){var i=h(n);i&&i!==p&&e(t,i,r)}var a=c(n);f&&(a=a.concat(f(n)));for(var s=l(t),v=l(n),m=0;m=0;d--){var h=a[d];"."===h?i(a,d):".."===h?(i(a,d),f++):f&&(i(a,d),f--)}if(!u)for(;f--;f)a.unshift("..");!u||""===a[0]||a[0]&&r(a[0])||a.unshift("");var p=a.join("/");return n&&"/"!==p.substr(-1)&&(p+="/"),p}},function(e,t,n){"use strict";function r(e){return e.valueOf?e.valueOf():Object.prototype.valueOf.call(e)}t.a=function e(t,n){if(t===n)return!0;if(null==t||null==n)return!1;if(Array.isArray(t))return Array.isArray(n)&&t.length===n.length&&t.every((function(t,r){return e(t,n[r])}));if("object"===typeof t||"object"===typeof n){var i=r(t),o=r(n);return i!==t||o!==n?e(i,o):Object.keys(Object.assign({},t,n)).every((function(r){return e(t[r],n[r])}))}return!1}},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t1?n-1:0),i=1;i/gm),F=o(/^data-[\-\w.\u00B7-\uFFFF]/),z=o(/^aria-[\-\w]+$/),V=o(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),B=o(/^(?:\w+script|data):/i),U=o(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g),H="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function q(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:W(),n=function(t){return e(t)};if(n.version="2.0.8",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;var o=t.document,a=!1,s=!1,l=t.document,x=t.DocumentFragment,T=t.HTMLTemplateElement,$=t.Node,G=t.NodeFilter,Q=t.NamedNodeMap,K=void 0===Q?t.NamedNodeMap||t.MozNamedAttrMap:Q,J=t.Text,X=t.Comment,Z=t.DOMParser,ee=t.trustedTypes;if("function"===typeof T){var te=l.createElement("template");te.content&&te.content.ownerDocument&&(l=te.content.ownerDocument)}var ne=Y(ee,o),re=ne?ne.createHTML(""):"",ie=l,oe=ie.implementation,ae=ie.createNodeIterator,se=ie.getElementsByTagName,le=ie.createDocumentFragment,ue=o.importNode,ce={};n.isSupported=oe&&"undefined"!==typeof oe.createHTMLDocument&&9!==l.documentMode;var fe=j,de=L,he=F,pe=z,ve=B,me=U,ge=V,ye=null,be=C({},[].concat(q(E),q(A),q(P),q(M),q(O))),ke=null,we=C({},[].concat(q(N),q(I),q(D),q(R))),_e=null,xe=null,Te=!0,Ce=!0,Se=!1,Ee=!1,Ae=!1,Pe=!1,Me=!1,Oe=!1,Ne=!1,Ie=!1,De=!1,Re=!1,je=!0,Le=!0,Fe=!1,ze={},Ve=C({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","plaintext","script","style","svg","template","thead","title","video","xmp"]),Be=C({},["audio","video","img","source","image"]),Ue=null,He=C({},["alt","class","for","id","label","name","pattern","placeholder","summary","title","value","style","xmlns"]),qe=null,We=l.createElement("form"),Ye=function(e){qe&&qe===e||(e&&"object"===("undefined"===typeof e?"undefined":H(e))||(e={}),ye="ALLOWED_TAGS"in e?C({},e.ALLOWED_TAGS):be,ke="ALLOWED_ATTR"in e?C({},e.ALLOWED_ATTR):we,Ue="ADD_URI_SAFE_ATTR"in e?C(S(He),e.ADD_URI_SAFE_ATTR):He,_e="FORBID_TAGS"in e?C({},e.FORBID_TAGS):{},xe="FORBID_ATTR"in e?C({},e.FORBID_ATTR):{},ze="USE_PROFILES"in e&&e.USE_PROFILES,Te=!1!==e.ALLOW_ARIA_ATTR,Ce=!1!==e.ALLOW_DATA_ATTR,Se=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ee=e.SAFE_FOR_JQUERY||!1,Ae=e.SAFE_FOR_TEMPLATES||!1,Pe=e.WHOLE_DOCUMENT||!1,Ne=e.RETURN_DOM||!1,Ie=e.RETURN_DOM_FRAGMENT||!1,De=e.RETURN_DOM_IMPORT||!1,Re=e.RETURN_TRUSTED_TYPE||!1,Oe=e.FORCE_BODY||!1,je=!1!==e.SANITIZE_DOM,Le=!1!==e.KEEP_CONTENT,Fe=e.IN_PLACE||!1,ge=e.ALLOWED_URI_REGEXP||ge,Ae&&(Ce=!1),Ie&&(Ne=!0),ze&&(ye=C({},[].concat(q(O))),ke=[],!0===ze.html&&(C(ye,E),C(ke,N)),!0===ze.svg&&(C(ye,A),C(ke,I),C(ke,R)),!0===ze.svgFilters&&(C(ye,P),C(ke,I),C(ke,R)),!0===ze.mathMl&&(C(ye,M),C(ke,D),C(ke,R))),e.ADD_TAGS&&(ye===be&&(ye=S(ye)),C(ye,e.ADD_TAGS)),e.ADD_ATTR&&(ke===we&&(ke=S(ke)),C(ke,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&C(Ue,e.ADD_URI_SAFE_ATTR),Le&&(ye["#text"]=!0),Pe&&C(ye,["html","head","body"]),ye.table&&(C(ye,["tbody"]),delete _e.tbody),i&&i(e),qe=e)},$e=function(e){h(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){e.outerHTML=re}},Ge=function(e,t){try{h(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(r){h(n.removed,{attribute:null,from:t})}t.removeAttribute(e)},Qe=function(e){var t=void 0,n=void 0;if(Oe)e=""+e;else{var r=m(e,/^[\s]+/);n=r&&r[0]}var i=ne?ne.createHTML(e):e;if(a)try{t=(new Z).parseFromString(i,"text/html")}catch(u){}if(s&&C(_e,["title"]),!t||!t.documentElement){var o=(t=oe.createHTMLDocument("")).body;o.parentNode.removeChild(o.parentNode.firstElementChild),o.outerHTML=i}return e&&n&&t.body.insertBefore(l.createTextNode(n),t.body.childNodes[0]||null),se.call(t,Pe?"html":"body")[0]};n.isSupported&&(function(){try{Qe('",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},r={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(e){var t=e%100;if(t>3&&t<21)return"th";switch(t%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},i=function(e){return("0"+e).slice(-2)},o=function(e){return!0===e?1:0};function a(e,t,n){var r;return void 0===n&&(n=!1),function(){var i=this,o=arguments;null!==r&&clearTimeout(r),r=window.setTimeout((function(){r=null,n||e.apply(i,o)}),t),n&&!r&&e.apply(i,o)}}var s=function(e){return e instanceof Array?e:[e]};function l(e,t,n){if(!0===n)return e.classList.add(t);e.classList.remove(t)}function u(e,t,n){var r=window.document.createElement(e);return t=t||"",n=n||"",r.className=t,void 0!==n&&(r.textContent=n),r}function c(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function f(e,t){var n=u("div","numInputWrapper"),r=u("input","numInput "+e),i=u("span","arrowUp"),o=u("span","arrowDown");if(-1===navigator.userAgent.indexOf("MSIE 9.0")?r.type="number":(r.type="text",r.pattern="\\d*"),void 0!==t)for(var a in t)r.setAttribute(a,t[a]);return n.appendChild(r),n.appendChild(i),n.appendChild(o),n}var d=function(){},h=function(e,t,n){return n.months[t?"shorthand":"longhand"][e]},p={D:d,F:function(e,t,n){e.setMonth(n.months.longhand.indexOf(t))},G:function(e,t){e.setHours(parseFloat(t))},H:function(e,t){e.setHours(parseFloat(t))},J:function(e,t){e.setDate(parseFloat(t))},K:function(e,t,n){e.setHours(e.getHours()%12+12*o(new RegExp(n.amPM[1],"i").test(t)))},M:function(e,t,n){e.setMonth(n.months.shorthand.indexOf(t))},S:function(e,t){e.setSeconds(parseFloat(t))},U:function(e,t){return new Date(1e3*parseFloat(t))},W:function(e,t,n){var r=parseInt(t),i=new Date(e.getFullYear(),0,2+7*(r-1),0,0,0,0);return i.setDate(i.getDate()-i.getDay()+n.firstDayOfWeek),i},Y:function(e,t){e.setFullYear(parseFloat(t))},Z:function(e,t){return new Date(t)},d:function(e,t){e.setDate(parseFloat(t))},h:function(e,t){e.setHours(parseFloat(t))},i:function(e,t){e.setMinutes(parseFloat(t))},j:function(e,t){e.setDate(parseFloat(t))},l:d,m:function(e,t){e.setMonth(parseFloat(t)-1)},n:function(e,t){e.setMonth(parseFloat(t)-1)},s:function(e,t){e.setSeconds(parseFloat(t))},u:function(e,t){return new Date(parseFloat(t))},w:d,y:function(e,t){e.setFullYear(2e3+parseFloat(t))}},v={D:"(\\w+)",F:"(\\w+)",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"(\\w+)",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"(\\w+)",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},m={Z:function(e){return e.toISOString()},D:function(e,t,n){return t.weekdays.shorthand[m.w(e,t,n)]},F:function(e,t,n){return h(m.n(e,t,n)-1,!1,t)},G:function(e,t,n){return i(m.h(e,t,n))},H:function(e){return i(e.getHours())},J:function(e,t){return void 0!==t.ordinal?e.getDate()+t.ordinal(e.getDate()):e.getDate()},K:function(e,t){return t.amPM[o(e.getHours()>11)]},M:function(e,t){return h(e.getMonth(),!0,t)},S:function(e){return i(e.getSeconds())},U:function(e){return e.getTime()/1e3},W:function(e,t,n){return n.getWeek(e)},Y:function(e){return e.getFullYear()},d:function(e){return i(e.getDate())},h:function(e){return e.getHours()%12?e.getHours()%12:12},i:function(e){return i(e.getMinutes())},j:function(e){return e.getDate()},l:function(e,t){return t.weekdays.longhand[e.getDay()]},m:function(e){return i(e.getMonth()+1)},n:function(e){return e.getMonth()+1},s:function(e){return e.getSeconds()},u:function(e){return e.getTime()},w:function(e){return e.getDay()},y:function(e){return String(e.getFullYear()).substring(2)}},g=function(e){var t=e.config,i=void 0===t?n:t,o=e.l10n,a=void 0===o?r:o;return function(e,t,n){var r=n||a;return void 0!==i.formatDate?i.formatDate(e,t,r):t.split("").map((function(t,n,o){return m[t]&&"\\"!==o[n-1]?m[t](e,r,i):"\\"!==t?t:""})).join("")}},y=function(e){var t=e.config,i=void 0===t?n:t,o=e.l10n,a=void 0===o?r:o;return function(e,t,r,o){if(0===e||e){var s,l=o||a,u=e;if(e instanceof Date)s=new Date(e.getTime());else if("string"!==typeof e&&void 0!==e.toFixed)s=new Date(e);else if("string"===typeof e){var c=t||(i||n).dateFormat,f=String(e).trim();if("today"===f)s=new Date,r=!0;else if(/Z$/.test(f)||/GMT$/.test(f))s=new Date(e);else if(i&&i.parseDate)s=i.parseDate(e,c);else{s=i&&i.noCalendar?new Date((new Date).setHours(0,0,0,0)):new Date((new Date).getFullYear(),0,1,0,0,0,0);for(var d=void 0,h=[],m=0,g=0,y="";mMath.min(t,n)&&ea&&(c=n===m.hourElement?c-a-o(!m.amPM):r,d&&L(void 0,1,m.hourElement)),m.amPM&&f&&(1===s?c+l===23:Math.abs(c-l)>s)&&(m.amPM.textContent=m.l10n.amPM[o(m.amPM.textContent===m.l10n.amPM[0])]),n.value=i(c)}}(e);var t=m._input.value;E(),be(),m._input.value!==t&&m._debouncedChange()}function E(){if(void 0!==m.hourElement&&void 0!==m.minuteElement){var e,t,n=(parseInt(m.hourElement.value.slice(-2),10)||0)%24,r=(parseInt(m.minuteElement.value,10)||0)%60,i=void 0!==m.secondElement?(parseInt(m.secondElement.value,10)||0)%60:0;void 0!==m.amPM&&(e=n,t=m.amPM.textContent,n=e%12+12*o(t===m.l10n.amPM[1]));var a=void 0!==m.config.minTime||m.config.minDate&&m.minDateHasTime&&m.latestSelectedDateObj&&0===b(m.latestSelectedDateObj,m.config.minDate,!0);if(void 0!==m.config.maxTime||m.config.maxDate&&m.maxDateHasTime&&m.latestSelectedDateObj&&0===b(m.latestSelectedDateObj,m.config.maxDate,!0)){var s=void 0!==m.config.maxTime?m.config.maxTime:m.config.maxDate;(n=Math.min(n,s.getHours()))===s.getHours()&&(r=Math.min(r,s.getMinutes())),r===s.getMinutes()&&(i=Math.min(i,s.getSeconds()))}if(a){var l=void 0!==m.config.minTime?m.config.minTime:m.config.minDate;(n=Math.max(n,l.getHours()))===l.getHours()&&(r=Math.max(r,l.getMinutes())),r===l.getMinutes()&&(i=Math.max(i,l.getSeconds()))}M(n,r,i)}}function A(e){var t=e||m.latestSelectedDateObj;t&&M(t.getHours(),t.getMinutes(),t.getSeconds())}function P(){var e=m.config.defaultHour,t=m.config.defaultMinute,n=m.config.defaultSeconds;if(void 0!==m.config.minDate){var r=m.config.minDate.getHours(),i=m.config.minDate.getMinutes();(e=Math.max(e,r))===r&&(t=Math.max(i,t)),e===r&&t===i&&(n=m.config.minDate.getSeconds())}if(void 0!==m.config.maxDate){var o=m.config.maxDate.getHours(),a=m.config.maxDate.getMinutes();(e=Math.min(e,o))===o&&(t=Math.min(a,t)),e===o&&t===a&&(n=m.config.maxDate.getSeconds())}M(e,t,n)}function M(e,t,n){void 0!==m.latestSelectedDateObj&&m.latestSelectedDateObj.setHours(e%24,t,n||0,0),m.hourElement&&m.minuteElement&&!m.isMobile&&(m.hourElement.value=i(m.config.time_24hr?e:(12+e)%12+12*o(e%12===0)),m.minuteElement.value=i(t),void 0!==m.amPM&&(m.amPM.textContent=m.l10n.amPM[o(e>=12)]),void 0!==m.secondElement&&(m.secondElement.value=i(n)))}function O(e){var t=parseInt(e.target.value)+(e.delta||0);(t/1e3>1||"Enter"===e.key&&!/[^\d]/.test(t.toString()))&&X(t)}function N(e,t,n,r){return t instanceof Array?t.forEach((function(t){return N(e,t,n,r)})):e instanceof Array?e.forEach((function(e){return N(e,t,n,r)})):(e.addEventListener(t,n,r),void m._handlers.push({element:e,event:t,handler:n,options:r}))}function I(e){return function(t){1===t.which&&e(t)}}function D(){pe("onChange")}function R(e,t){var n=void 0!==e?m.parseDate(e):m.latestSelectedDateObj||(m.config.minDate&&m.config.minDate>m.now?m.config.minDate:m.config.maxDate&&m.config.maxDate=0&&b(e,m.selectedDates[1])<=0}(t)&&!me(t)&&o.classList.add("inRange"),m.weekNumbers&&1===m.config.showMonths&&"prevMonthDay"!==e&&n%7===1&&m.weekNumbers.insertAdjacentHTML("beforeend",""+m.config.getWeek(t)+""),pe("onDayCreate",o),o}function z(e){e.focus(),"range"===m.config.mode&&ne(e)}function V(e){for(var t=e>0?0:m.config.showMonths-1,n=e>0?m.config.showMonths:-1,r=t;r!=n;r+=e)for(var i=m.daysContainer.children[r],o=e>0?0:i.children.length-1,a=e>0?i.children.length:-1,s=o;s!=a;s+=e){var l=i.children[s];if(-1===l.className.indexOf("hidden")&&Z(l.dateObj))return l}}function B(e,t){var n=ee(document.activeElement||document.body),r=void 0!==e?e:n?document.activeElement:void 0!==m.selectedDateElem&&ee(m.selectedDateElem)?m.selectedDateElem:void 0!==m.todayDateElem&&ee(m.todayDateElem)?m.todayDateElem:V(t>0?1:-1);return void 0===r?m._input.focus():n?void function(e,t){for(var n=-1===e.className.indexOf("Month")?e.dateObj.getMonth():m.currentMonth,r=t>0?m.config.showMonths:-1,i=t>0?1:-1,o=n-m.currentMonth;o!=r;o+=i)for(var a=m.daysContainer.children[o],s=n-m.currentMonth===o?e.$i+t:t<0?a.children.length-1:0,l=a.children.length,u=s;u>=0&&u0?l:-1);u+=i){var c=a.children[u];if(-1===c.className.indexOf("hidden")&&Z(c.dateObj)&&Math.abs(e.$i-u)>=Math.abs(t))return z(c)}m.changeMonth(i),B(V(i),0)}(r,t):z(r)}function U(e,t){for(var n=(new Date(e,t,1).getDay()-m.l10n.firstDayOfWeek+7)%7,r=m.utils.getDaysInMonth((t-1+12)%12),i=m.utils.getDaysInMonth(t),o=window.document.createDocumentFragment(),a=m.config.showMonths>1,s=a?"prevMonthDay hidden":"prevMonthDay",l=a?"nextMonthDay hidden":"nextMonthDay",c=r+1-n,f=0;c<=r;c++,f++)o.appendChild(F(s,new Date(e,t-1,c),c,f));for(c=1;c<=i;c++,f++)o.appendChild(F("",new Date(e,t,c),c,f));for(var d=i+1;d<=42-n&&(1===m.config.showMonths||f%7!==0);d++,f++)o.appendChild(F(l,new Date(e,t+1,d%i),d,f));var h=u("div","dayContainer");return h.appendChild(o),h}function H(){if(void 0!==m.daysContainer){c(m.daysContainer),m.weekNumbers&&c(m.weekNumbers);for(var e=document.createDocumentFragment(),t=0;t1||"dropdown"!==m.config.monthSelectorType)){var e=function(e){return!(void 0!==m.config.minDate&&m.currentYear===m.config.minDate.getFullYear()&&em.config.maxDate.getMonth())};m.monthsDropdownContainer.tabIndex=-1,m.monthsDropdownContainer.innerHTML="";for(var t=0;t<12;t++)if(e(t)){var n=u("option","flatpickr-monthDropdown-month");n.value=new Date(m.currentYear,t).getMonth().toString(),n.textContent=h(t,m.config.shorthandCurrentMonth,m.l10n),n.tabIndex=-1,m.currentMonth===t&&(n.selected=!0),m.monthsDropdownContainer.appendChild(n)}}}function W(){var e,t=u("div","flatpickr-month"),n=window.document.createDocumentFragment();m.config.showMonths>1||"static"===m.config.monthSelectorType?e=u("span","cur-month"):(m.monthsDropdownContainer=u("select","flatpickr-monthDropdown-months"),N(m.monthsDropdownContainer,"change",(function(e){var t=e.target,n=parseInt(t.value,10);m.changeMonth(n-m.currentMonth),pe("onMonthChange")})),q(),e=m.monthsDropdownContainer);var r=f("cur-year",{tabindex:"-1"}),i=r.getElementsByTagName("input")[0];i.setAttribute("aria-label",m.l10n.yearAriaLabel),m.config.minDate&&i.setAttribute("min",m.config.minDate.getFullYear().toString()),m.config.maxDate&&(i.setAttribute("max",m.config.maxDate.getFullYear().toString()),i.disabled=!!m.config.minDate&&m.config.minDate.getFullYear()===m.config.maxDate.getFullYear());var o=u("div","flatpickr-current-month");return o.appendChild(e),o.appendChild(r),n.appendChild(o),t.appendChild(n),{container:t,yearElement:i,monthElement:e}}function Y(){c(m.monthNav),m.monthNav.appendChild(m.prevMonthNav),m.config.showMonths&&(m.yearElements=[],m.monthElements=[]);for(var e=m.config.showMonths;e--;){var t=W();m.yearElements.push(t.yearElement),m.monthElements.push(t.monthElement),m.monthNav.appendChild(t.container)}m.monthNav.appendChild(m.nextMonthNav)}function $(){m.weekdayContainer?c(m.weekdayContainer):m.weekdayContainer=u("div","flatpickr-weekdays");for(var e=m.config.showMonths;e--;){var t=u("div","flatpickr-weekdaycontainer");m.weekdayContainer.appendChild(t)}return G(),m.weekdayContainer}function G(){if(m.weekdayContainer){var e=m.l10n.firstDayOfWeek,t=m.l10n.weekdays.shorthand.slice();e>0&&e\n "+t.join("")+"\n \n "}}function Q(e,t){void 0===t&&(t=!0);var n=t?e:e-m.currentMonth;n<0&&!0===m._hidePrevMonthArrow||n>0&&!0===m._hideNextMonthArrow||(m.currentMonth+=n,(m.currentMonth<0||m.currentMonth>11)&&(m.currentYear+=m.currentMonth>11?1:-1,m.currentMonth=(m.currentMonth+12)%12,pe("onYearChange"),q()),H(),pe("onMonthChange"),ge())}function K(e){return!(!m.config.appendTo||!m.config.appendTo.contains(e))||m.calendarContainer.contains(e)}function J(e){if(m.isOpen&&!m.config.inline){var t="function"===typeof(a=e).composedPath?a.composedPath()[0]:a.target,n=K(t),r=t===m.input||t===m.altInput||m.element.contains(t)||e.path&&e.path.indexOf&&(~e.path.indexOf(m.input)||~e.path.indexOf(m.altInput)),i="blur"===e.type?r&&e.relatedTarget&&!K(e.relatedTarget):!r&&!n&&!K(e.relatedTarget),o=!m.config.ignoredFocusElements.some((function(e){return e.contains(t)}));i&&o&&(void 0!==m.timeContainer&&void 0!==m.minuteElement&&void 0!==m.hourElement&&S(),m.close(),"range"===m.config.mode&&1===m.selectedDates.length&&(m.clear(!1),m.redraw()))}var a}function X(e){if(!(!e||m.config.minDate&&em.config.maxDate.getFullYear())){var t=e,n=m.currentYear!==t;m.currentYear=t||m.currentYear,m.config.maxDate&&m.currentYear===m.config.maxDate.getFullYear()?m.currentMonth=Math.min(m.config.maxDate.getMonth(),m.currentMonth):m.config.minDate&&m.currentYear===m.config.minDate.getFullYear()&&(m.currentMonth=Math.max(m.config.minDate.getMonth(),m.currentMonth)),n&&(m.redraw(),pe("onYearChange"),q())}}function Z(e,t){void 0===t&&(t=!0);var n=m.parseDate(e,void 0,t);if(m.config.minDate&&n&&b(n,m.config.minDate,void 0!==t?t:!m.minDateHasTime)<0||m.config.maxDate&&n&&b(n,m.config.maxDate,void 0!==t?t:!m.maxDateHasTime)>0)return!1;if(0===m.config.enable.length&&0===m.config.disable.length)return!0;if(void 0===n)return!1;for(var r=m.config.enable.length>0,i=r?m.config.enable:m.config.disable,o=0,a=void 0;o=a.from.getTime()&&n.getTime()<=a.to.getTime())return r}return!r}function ee(e){return void 0!==m.daysContainer&&-1===e.className.indexOf("hidden")&&m.daysContainer.contains(e)}function te(e){var t=e.target===m._input,n=m.config.allowInput,r=m.isOpen&&(!n||!t),i=m.config.inline&&t&&!n;if(13===e.keyCode&&t){if(n)return m.setDate(m._input.value,!0,e.target===m.altInput?m.config.altFormat:m.config.dateFormat),e.target.blur();m.open()}else if(K(e.target)||r||i){var o=!!m.timeContainer&&m.timeContainer.contains(e.target);switch(e.keyCode){case 13:o?(e.preventDefault(),S(),ue()):ce(e);break;case 27:e.preventDefault(),ue();break;case 8:case 46:t&&!m.config.allowInput&&(e.preventDefault(),m.clear());break;case 37:case 39:if(o||t)m.hourElement&&m.hourElement.focus();else if(e.preventDefault(),void 0!==m.daysContainer&&(!1===n||document.activeElement&&ee(document.activeElement))){var a=39===e.keyCode?1:-1;e.ctrlKey?(e.stopPropagation(),Q(a),B(V(1),0)):B(void 0,a)}break;case 38:case 40:e.preventDefault();var s=40===e.keyCode?1:-1;m.daysContainer&&void 0!==e.target.$i||e.target===m.input||e.target===m.altInput?e.ctrlKey?(e.stopPropagation(),X(m.currentYear-s),B(V(1),0)):o||B(void 0,7*s):e.target===m.currentYearElement?X(m.currentYear-s):m.config.enableTime&&(!o&&m.hourElement&&m.hourElement.focus(),S(e),m._debouncedChange());break;case 9:if(o){var l=[m.hourElement,m.minuteElement,m.secondElement,m.amPM].concat(m.pluginElements).filter((function(e){return e})),u=l.indexOf(e.target);if(-1!==u){var c=l[u+(e.shiftKey?-1:1)];e.preventDefault(),(c||m._input).focus()}}else!m.config.noCalendar&&m.daysContainer&&m.daysContainer.contains(e.target)&&e.shiftKey&&(e.preventDefault(),m._input.focus())}}if(void 0!==m.amPM&&e.target===m.amPM)switch(e.key){case m.l10n.amPM[0].charAt(0):case m.l10n.amPM[0].charAt(0).toLowerCase():m.amPM.textContent=m.l10n.amPM[0],E(),be();break;case m.l10n.amPM[1].charAt(0):case m.l10n.amPM[1].charAt(0).toLowerCase():m.amPM.textContent=m.l10n.amPM[1],E(),be()}(t||K(e.target))&&pe("onKeyDown",e)}function ne(e){if(1===m.selectedDates.length&&(!e||e.classList.contains("flatpickr-day")&&!e.classList.contains("flatpickr-disabled"))){for(var t=e?e.dateObj.getTime():m.days.firstElementChild.dateObj.getTime(),n=m.parseDate(m.selectedDates[0],void 0,!0).getTime(),r=Math.min(t,m.selectedDates[0].getTime()),i=Math.max(t,m.selectedDates[0].getTime()),o=!1,a=0,s=0,l=r;lr&&la)?a=l:l>n&&(!s||l0&&u0&&u>s;return f?(l.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach((function(e){l.classList.remove(e)})),"continue"):o&&!f?"continue":(["startRange","inRange","endRange","notAllowed"].forEach((function(e){l.classList.remove(e)})),void(void 0!==e&&(e.classList.add(t<=m.selectedDates[0].getTime()?"startRange":"endRange"),nt&&u===n&&l.classList.add("endRange"),u>=a&&(0===s||u<=s)&&k(u,n,t)&&l.classList.add("inRange"))))},d=0,h=c.children.length;d0||n.getMinutes()>0||n.getSeconds()>0),m.selectedDates&&(m.selectedDates=m.selectedDates.filter((function(e){return Z(e)})),m.selectedDates.length||"min"!==e||A(n),be()),m.daysContainer&&(le(),void 0!==n?m.currentYearElement[e]=n.getFullYear().toString():m.currentYearElement.removeAttribute(e),m.currentYearElement.disabled=!!r&&void 0!==n&&r.getFullYear()===n.getFullYear())}}function ae(){"object"!==typeof m.config.locale&&"undefined"===typeof C.l10ns[m.config.locale]&&m.config.errorHandler(new Error("flatpickr: invalid locale "+m.config.locale)),m.l10n=e({},C.l10ns.default,"object"===typeof m.config.locale?m.config.locale:"default"!==m.config.locale?C.l10ns[m.config.locale]:void 0),v.K="("+m.l10n.amPM[0]+"|"+m.l10n.amPM[1]+"|"+m.l10n.amPM[0].toLowerCase()+"|"+m.l10n.amPM[1].toLowerCase()+")",void 0===e({},p,JSON.parse(JSON.stringify(d.dataset||{}))).time_24hr&&void 0===C.defaultConfig.time_24hr&&(m.config.time_24hr=m.l10n.time_24hr),m.formatDate=g(m),m.parseDate=y({config:m.config,l10n:m.l10n})}function se(e){if(void 0!==m.calendarContainer){pe("onPreCalendarPosition");var t=e||m._positionElement,n=Array.prototype.reduce.call(m.calendarContainer.children,(function(e,t){return e+t.offsetHeight}),0),r=m.calendarContainer.offsetWidth,i=m.config.position.split(" "),o=i[0],a=i.length>1?i[1]:null,s=t.getBoundingClientRect(),u=window.innerHeight-s.bottom,c="above"===o||"below"!==o&&un,f=window.pageYOffset+s.top+(c?-n-2:t.offsetHeight+2);if(l(m.calendarContainer,"arrowTop",!c),l(m.calendarContainer,"arrowBottom",c),!m.config.inline){var d=window.pageXOffset+s.left-(null!=a&&"center"===a?(r-s.width)/2:0),h=window.document.body.offsetWidth-(window.pageXOffset+s.right),p=d+r>window.document.body.offsetWidth,v=h+r>window.document.body.offsetWidth;if(l(m.calendarContainer,"rightMost",p),!m.config.static)if(m.calendarContainer.style.top=f+"px",p)if(v){var g=document.styleSheets[0];if(void 0===g)return;var y=window.document.body.offsetWidth,b=Math.max(0,y/2-r/2),k=g.cssRules.length,w="{left:"+s.left+"px;right:auto;}";l(m.calendarContainer,"rightMost",!1),l(m.calendarContainer,"centerMost",!0),g.insertRule(".flatpickr-calendar.centerMost:before,.flatpickr-calendar.centerMost:after"+w,k),m.calendarContainer.style.left=b+"px",m.calendarContainer.style.right="auto"}else m.calendarContainer.style.left="auto",m.calendarContainer.style.right=h+"px";else m.calendarContainer.style.left=d+"px",m.calendarContainer.style.right="auto"}}}function le(){m.config.noCalendar||m.isMobile||(ge(),H())}function ue(){m._input.focus(),-1!==window.navigator.userAgent.indexOf("MSIE")||void 0!==navigator.msMaxTouchPoints?setTimeout(m.close,0):m.close()}function ce(e){e.preventDefault(),e.stopPropagation();var t=function e(t,n){return n(t)?t:t.parentNode?e(t.parentNode,n):void 0}(e.target,(function(e){return e.classList&&e.classList.contains("flatpickr-day")&&!e.classList.contains("flatpickr-disabled")&&!e.classList.contains("notAllowed")}));if(void 0!==t){var n=t,r=m.latestSelectedDateObj=new Date(n.dateObj.getTime()),i=(r.getMonth()m.currentMonth+m.config.showMonths-1)&&"range"!==m.config.mode;if(m.selectedDateElem=n,"single"===m.config.mode)m.selectedDates=[r];else if("multiple"===m.config.mode){var o=me(r);o?m.selectedDates.splice(parseInt(o),1):m.selectedDates.push(r)}else"range"===m.config.mode&&(2===m.selectedDates.length&&m.clear(!1,!1),m.latestSelectedDateObj=r,m.selectedDates.push(r),0!==b(r,m.selectedDates[0],!0)&&m.selectedDates.sort((function(e,t){return e.getTime()-t.getTime()})));if(E(),i){var a=m.currentYear!==r.getFullYear();m.currentYear=r.getFullYear(),m.currentMonth=r.getMonth(),a&&(pe("onYearChange"),q()),pe("onMonthChange")}if(ge(),H(),be(),m.config.enableTime&&setTimeout((function(){return m.showTimeInput=!0}),50),i||"range"===m.config.mode||1!==m.config.showMonths?void 0!==m.selectedDateElem&&void 0===m.hourElement&&m.selectedDateElem&&m.selectedDateElem.focus():z(n),void 0!==m.hourElement&&void 0!==m.hourElement&&m.hourElement.focus(),m.config.closeOnSelect){var s="single"===m.config.mode&&!m.config.enableTime,l="range"===m.config.mode&&2===m.selectedDates.length&&!m.config.enableTime;(s||l)&&ue()}D()}}m.parseDate=y({config:m.config,l10n:m.l10n}),m._handlers=[],m.pluginElements=[],m.loadedPlugins=[],m._bind=N,m._setHoursFromDate=A,m._positionCalendar=se,m.changeMonth=Q,m.changeYear=X,m.clear=function(e,t){void 0===e&&(e=!0),void 0===t&&(t=!0),m.input.value="",void 0!==m.altInput&&(m.altInput.value=""),void 0!==m.mobileInput&&(m.mobileInput.value=""),m.selectedDates=[],m.latestSelectedDateObj=void 0,!0===t&&(m.currentYear=m._initialDate.getFullYear(),m.currentMonth=m._initialDate.getMonth()),m.showTimeInput=!1,!0===m.config.enableTime&&P(),m.redraw(),e&&pe("onChange")},m.close=function(){m.isOpen=!1,m.isMobile||(void 0!==m.calendarContainer&&m.calendarContainer.classList.remove("open"),void 0!==m._input&&m._input.classList.remove("active")),pe("onClose")},m._createElement=u,m.destroy=function(){void 0!==m.config&&pe("onDestroy");for(var e=m._handlers.length;e--;){var t=m._handlers[e];t.element.removeEventListener(t.event,t.handler,t.options)}if(m._handlers=[],m.mobileInput)m.mobileInput.parentNode&&m.mobileInput.parentNode.removeChild(m.mobileInput),m.mobileInput=void 0;else if(m.calendarContainer&&m.calendarContainer.parentNode)if(m.config.static&&m.calendarContainer.parentNode){var n=m.calendarContainer.parentNode;if(n.lastChild&&n.removeChild(n.lastChild),n.parentNode){for(;n.firstChild;)n.parentNode.insertBefore(n.firstChild,n);n.parentNode.removeChild(n)}}else m.calendarContainer.parentNode.removeChild(m.calendarContainer);m.altInput&&(m.input.type="text",m.altInput.parentNode&&m.altInput.parentNode.removeChild(m.altInput),delete m.altInput),m.input&&(m.input.type=m.input._type,m.input.classList.remove("flatpickr-input"),m.input.removeAttribute("readonly"),m.input.value=""),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach((function(e){try{delete m[e]}catch(t){}}))},m.isEnabled=Z,m.jumpToDate=R,m.open=function(e,t){if(void 0===t&&(t=m._positionElement),!0===m.isMobile)return e&&(e.preventDefault(),e.target&&e.target.blur()),void 0!==m.mobileInput&&(m.mobileInput.focus(),m.mobileInput.click()),void pe("onOpen");if(!m._input.disabled&&!m.config.inline){var n=m.isOpen;m.isOpen=!0,n||(m.calendarContainer.classList.add("open"),m._input.classList.add("active"),pe("onOpen"),se(t)),!0===m.config.enableTime&&!0===m.config.noCalendar&&(0===m.selectedDates.length&&ie(),!1!==m.config.allowInput||void 0!==e&&m.timeContainer.contains(e.relatedTarget)||setTimeout((function(){return m.hourElement.select()}),50))}},m.redraw=le,m.set=function(e,n){if(null!==e&&"object"===typeof e)for(var r in Object.assign(m.config,e),e)void 0!==fe[r]&&fe[r].forEach((function(e){return e()}));else m.config[e]=n,void 0!==fe[e]?fe[e].forEach((function(e){return e()})):t.indexOf(e)>-1&&(m.config[e]=s(n));m.redraw(),be(!1)},m.setDate=function(e,t,n){if(void 0===t&&(t=!1),void 0===n&&(n=m.config.dateFormat),0!==e&&!e||e instanceof Array&&0===e.length)return m.clear(t);de(e,n),m.showTimeInput=m.selectedDates.length>0,m.latestSelectedDateObj=m.selectedDates[m.selectedDates.length-1],m.redraw(),R(),A(),0===m.selectedDates.length&&m.clear(!1),be(t),t&&pe("onChange")},m.toggle=function(e){if(!0===m.isOpen)return m.close();m.open(e)};var fe={locale:[ae,G],showMonths:[Y,T,$],minDate:[R],maxDate:[R]};function de(e,t){var n=[];if(e instanceof Array)n=e.map((function(e){return m.parseDate(e,t)}));else if(e instanceof Date||"number"===typeof e)n=[m.parseDate(e,t)];else if("string"===typeof e)switch(m.config.mode){case"single":case"time":n=[m.parseDate(e,t)];break;case"multiple":n=e.split(m.config.conjunction).map((function(e){return m.parseDate(e,t)}));break;case"range":n=e.split(m.l10n.rangeSeparator).map((function(e){return m.parseDate(e,t)}))}else m.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(e)));m.selectedDates=n.filter((function(e){return e instanceof Date&&Z(e,!1)})),"range"===m.config.mode&&m.selectedDates.sort((function(e,t){return e.getTime()-t.getTime()}))}function he(e){return e.slice().map((function(e){return"string"===typeof e||"number"===typeof e||e instanceof Date?m.parseDate(e,void 0,!0):e&&"object"===typeof e&&e.from&&e.to?{from:m.parseDate(e.from,void 0),to:m.parseDate(e.to,void 0)}:e})).filter((function(e){return e}))}function pe(e,t){if(void 0!==m.config){var n=m.config[e];if(void 0!==n&&n.length>0)for(var r=0;n[r]&&r1||"static"===m.config.monthSelectorType?m.monthElements[t].textContent=h(n.getMonth(),m.config.shorthandCurrentMonth,m.l10n)+" ":m.monthsDropdownContainer.value=n.getMonth().toString(),e.value=n.getFullYear().toString()})),m._hidePrevMonthArrow=void 0!==m.config.minDate&&(m.currentYear===m.config.minDate.getFullYear()?m.currentMonth<=m.config.minDate.getMonth():m.currentYearm.config.maxDate.getMonth():m.currentYear>m.config.maxDate.getFullYear()))}function ye(e){return m.selectedDates.map((function(t){return m.formatDate(t,e)})).filter((function(e,t,n){return"range"!==m.config.mode||m.config.enableTime||n.indexOf(e)===t})).join("range"!==m.config.mode?m.config.conjunction:m.l10n.rangeSeparator)}function be(e){void 0===e&&(e=!0),void 0!==m.mobileInput&&m.mobileFormatStr&&(m.mobileInput.value=void 0!==m.latestSelectedDateObj?m.formatDate(m.latestSelectedDateObj,m.mobileFormatStr):""),m.input.value=ye(m.config.dateFormat),void 0!==m.altInput&&(m.altInput.value=ye(m.config.altFormat)),!1!==e&&pe("onValueUpdate")}function ke(e){var t=m.prevMonthNav.contains(e.target),n=m.nextMonthNav.contains(e.target);t||n?Q(t?-1:1):m.yearElements.indexOf(e.target)>=0?e.target.select():e.target.classList.contains("arrowUp")?m.changeYear(m.currentYear+1):e.target.classList.contains("arrowDown")&&m.changeYear(m.currentYear-1)}return function(){m.element=m.input=d,m.isOpen=!1,function(){var r=["wrap","weekNumbers","allowInput","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],i=e({},p,JSON.parse(JSON.stringify(d.dataset||{}))),o={};m.config.parseDate=i.parseDate,m.config.formatDate=i.formatDate,Object.defineProperty(m.config,"enable",{get:function(){return m.config._enable},set:function(e){m.config._enable=he(e)}}),Object.defineProperty(m.config,"disable",{get:function(){return m.config._disable},set:function(e){m.config._disable=he(e)}});var a="time"===i.mode;if(!i.dateFormat&&(i.enableTime||a)){var l=C.defaultConfig.dateFormat||n.dateFormat;o.dateFormat=i.noCalendar||a?"H:i"+(i.enableSeconds?":S":""):l+" H:i"+(i.enableSeconds?":S":"")}if(i.altInput&&(i.enableTime||a)&&!i.altFormat){var u=C.defaultConfig.altFormat||n.altFormat;o.altFormat=i.noCalendar||a?"h:i"+(i.enableSeconds?":S K":" K"):u+" h:i"+(i.enableSeconds?":S":"")+" K"}i.altInputClass||(m.config.altInputClass=m.input.className+" "+m.config.altInputClass),Object.defineProperty(m.config,"minDate",{get:function(){return m.config._minDate},set:oe("min")}),Object.defineProperty(m.config,"maxDate",{get:function(){return m.config._maxDate},set:oe("max")});var c=function(e){return function(t){m.config["min"===e?"_minTime":"_maxTime"]=m.parseDate(t,"H:i:S")}};Object.defineProperty(m.config,"minTime",{get:function(){return m.config._minTime},set:c("min")}),Object.defineProperty(m.config,"maxTime",{get:function(){return m.config._maxTime},set:c("max")}),"time"===i.mode&&(m.config.noCalendar=!0,m.config.enableTime=!0),Object.assign(m.config,o,i);for(var f=0;f-1?m.config[v]=s(h[v]).map(x).concat(m.config[v]):"undefined"===typeof i[v]&&(m.config[v]=h[v])}pe("onParseConfig")}(),ae(),m.input=m.config.wrap?d.querySelector("[data-input]"):d,m.input?(m.input._type=m.input.type,m.input.type="text",m.input.classList.add("flatpickr-input"),m._input=m.input,m.config.altInput&&(m.altInput=u(m.input.nodeName,m.config.altInputClass),m._input=m.altInput,m.altInput.placeholder=m.input.placeholder,m.altInput.disabled=m.input.disabled,m.altInput.required=m.input.required,m.altInput.tabIndex=m.input.tabIndex,m.altInput.type="text",m.input.setAttribute("type","hidden"),!m.config.static&&m.input.parentNode&&m.input.parentNode.insertBefore(m.altInput,m.input.nextSibling)),m.config.allowInput||m._input.setAttribute("readonly","readonly"),m._positionElement=m.config.positionElement||m._input):m.config.errorHandler(new Error("Invalid input element specified")),function(){m.selectedDates=[],m.now=m.parseDate(m.config.now)||new Date;var e=m.config.defaultDate||("INPUT"!==m.input.nodeName&&"TEXTAREA"!==m.input.nodeName||!m.input.placeholder||m.input.value!==m.input.placeholder?m.input.value:null);e&&de(e,m.config.dateFormat),m._initialDate=m.selectedDates.length>0?m.selectedDates[0]:m.config.minDate&&m.config.minDate.getTime()>m.now.getTime()?m.config.minDate:m.config.maxDate&&m.config.maxDate.getTime()0&&(m.latestSelectedDateObj=m.selectedDates[0]),void 0!==m.config.minTime&&(m.config.minTime=m.parseDate(m.config.minTime,"H:i")),void 0!==m.config.maxTime&&(m.config.maxTime=m.parseDate(m.config.maxTime,"H:i")),m.minDateHasTime=!!m.config.minDate&&(m.config.minDate.getHours()>0||m.config.minDate.getMinutes()>0||m.config.minDate.getSeconds()>0),m.maxDateHasTime=!!m.config.maxDate&&(m.config.maxDate.getHours()>0||m.config.maxDate.getMinutes()>0||m.config.maxDate.getSeconds()>0),Object.defineProperty(m,"showTimeInput",{get:function(){return m._showTimeInput},set:function(e){m._showTimeInput=e,m.calendarContainer&&l(m.calendarContainer,"showTimeInput",e),m.isOpen&&se()}})}(),m.utils={getDaysInMonth:function(e,t){return void 0===e&&(e=m.currentMonth),void 0===t&&(t=m.currentYear),1===e&&(t%4===0&&t%100!==0||t%400===0)?29:m.l10n.daysInMonth[e]}},m.isMobile||function(){var e=window.document.createDocumentFragment();if(m.calendarContainer=u("div","flatpickr-calendar"),m.calendarContainer.tabIndex=-1,!m.config.noCalendar){if(e.appendChild((m.monthNav=u("div","flatpickr-months"),m.yearElements=[],m.monthElements=[],m.prevMonthNav=u("span","flatpickr-prev-month"),m.prevMonthNav.innerHTML=m.config.prevArrow,m.nextMonthNav=u("span","flatpickr-next-month"),m.nextMonthNav.innerHTML=m.config.nextArrow,Y(),Object.defineProperty(m,"_hidePrevMonthArrow",{get:function(){return m.__hidePrevMonthArrow},set:function(e){m.__hidePrevMonthArrow!==e&&(l(m.prevMonthNav,"flatpickr-disabled",e),m.__hidePrevMonthArrow=e)}}),Object.defineProperty(m,"_hideNextMonthArrow",{get:function(){return m.__hideNextMonthArrow},set:function(e){m.__hideNextMonthArrow!==e&&(l(m.nextMonthNav,"flatpickr-disabled",e),m.__hideNextMonthArrow=e)}}),m.currentYearElement=m.yearElements[0],ge(),m.monthNav)),m.innerContainer=u("div","flatpickr-innerContainer"),m.config.weekNumbers){var t=function(){m.calendarContainer.classList.add("hasWeeks");var e=u("div","flatpickr-weekwrapper");e.appendChild(u("span","flatpickr-weekday",m.l10n.weekAbbreviation));var t=u("div","flatpickr-weeks");return e.appendChild(t),{weekWrapper:e,weekNumbers:t}}(),n=t.weekWrapper,r=t.weekNumbers;m.innerContainer.appendChild(n),m.weekNumbers=r,m.weekWrapper=n}m.rContainer=u("div","flatpickr-rContainer"),m.rContainer.appendChild($()),m.daysContainer||(m.daysContainer=u("div","flatpickr-days"),m.daysContainer.tabIndex=-1),H(),m.rContainer.appendChild(m.daysContainer),m.innerContainer.appendChild(m.rContainer),e.appendChild(m.innerContainer)}m.config.enableTime&&e.appendChild(function(){m.calendarContainer.classList.add("hasTime"),m.config.noCalendar&&m.calendarContainer.classList.add("noCalendar"),m.timeContainer=u("div","flatpickr-time"),m.timeContainer.tabIndex=-1;var e=u("span","flatpickr-time-separator",":"),t=f("flatpickr-hour",{"aria-label":m.l10n.hourAriaLabel});m.hourElement=t.getElementsByTagName("input")[0];var n=f("flatpickr-minute",{"aria-label":m.l10n.minuteAriaLabel});if(m.minuteElement=n.getElementsByTagName("input")[0],m.hourElement.tabIndex=m.minuteElement.tabIndex=-1,m.hourElement.value=i(m.latestSelectedDateObj?m.latestSelectedDateObj.getHours():m.config.time_24hr?m.config.defaultHour:function(e){switch(e%24){case 0:case 12:return 12;default:return e%12}}(m.config.defaultHour)),m.minuteElement.value=i(m.latestSelectedDateObj?m.latestSelectedDateObj.getMinutes():m.config.defaultMinute),m.hourElement.setAttribute("step",m.config.hourIncrement.toString()),m.minuteElement.setAttribute("step",m.config.minuteIncrement.toString()),m.hourElement.setAttribute("min",m.config.time_24hr?"0":"1"),m.hourElement.setAttribute("max",m.config.time_24hr?"23":"12"),m.minuteElement.setAttribute("min","0"),m.minuteElement.setAttribute("max","59"),m.timeContainer.appendChild(t),m.timeContainer.appendChild(e),m.timeContainer.appendChild(n),m.config.time_24hr&&m.timeContainer.classList.add("time24hr"),m.config.enableSeconds){m.timeContainer.classList.add("hasSeconds");var r=f("flatpickr-second");m.secondElement=r.getElementsByTagName("input")[0],m.secondElement.value=i(m.latestSelectedDateObj?m.latestSelectedDateObj.getSeconds():m.config.defaultSeconds),m.secondElement.setAttribute("step",m.minuteElement.getAttribute("step")),m.secondElement.setAttribute("min","0"),m.secondElement.setAttribute("max","59"),m.timeContainer.appendChild(u("span","flatpickr-time-separator",":")),m.timeContainer.appendChild(r)}return m.config.time_24hr||(m.amPM=u("span","flatpickr-am-pm",m.l10n.amPM[o((m.latestSelectedDateObj?m.hourElement.value:m.config.defaultHour)>11)]),m.amPM.title=m.l10n.toggleTitle,m.amPM.tabIndex=-1,m.timeContainer.appendChild(m.amPM)),m.timeContainer}()),l(m.calendarContainer,"rangeMode","range"===m.config.mode),l(m.calendarContainer,"animate",!0===m.config.animate),l(m.calendarContainer,"multiMonth",m.config.showMonths>1),m.calendarContainer.appendChild(e);var a=void 0!==m.config.appendTo&&void 0!==m.config.appendTo.nodeType;if((m.config.inline||m.config.static)&&(m.calendarContainer.classList.add(m.config.inline?"inline":"static"),m.config.inline&&(!a&&m.element.parentNode?m.element.parentNode.insertBefore(m.calendarContainer,m._input.nextSibling):void 0!==m.config.appendTo&&m.config.appendTo.appendChild(m.calendarContainer)),m.config.static)){var s=u("div","flatpickr-wrapper");m.element.parentNode&&m.element.parentNode.insertBefore(s,m.element),s.appendChild(m.element),m.altInput&&s.appendChild(m.altInput),s.appendChild(m.calendarContainer)}m.config.static||m.config.inline||(void 0!==m.config.appendTo?m.config.appendTo:window.document.body).appendChild(m.calendarContainer)}(),function(){if(m.config.wrap&&["open","close","toggle","clear"].forEach((function(e){Array.prototype.forEach.call(m.element.querySelectorAll("[data-"+e+"]"),(function(t){return N(t,"click",m[e])}))})),m.isMobile)!function(){var e=m.config.enableTime?m.config.noCalendar?"time":"datetime-local":"date";m.mobileInput=u("input",m.input.className+" flatpickr-mobile"),m.mobileInput.step=m.input.getAttribute("step")||"any",m.mobileInput.tabIndex=1,m.mobileInput.type=e,m.mobileInput.disabled=m.input.disabled,m.mobileInput.required=m.input.required,m.mobileInput.placeholder=m.input.placeholder,m.mobileFormatStr="datetime-local"===e?"Y-m-d\\TH:i:S":"date"===e?"Y-m-d":"H:i:S",m.selectedDates.length>0&&(m.mobileInput.defaultValue=m.mobileInput.value=m.formatDate(m.selectedDates[0],m.mobileFormatStr)),m.config.minDate&&(m.mobileInput.min=m.formatDate(m.config.minDate,"Y-m-d")),m.config.maxDate&&(m.mobileInput.max=m.formatDate(m.config.maxDate,"Y-m-d")),m.input.type="hidden",void 0!==m.altInput&&(m.altInput.type="hidden");try{m.input.parentNode&&m.input.parentNode.insertBefore(m.mobileInput,m.input.nextSibling)}catch(t){}N(m.mobileInput,"change",(function(e){m.setDate(e.target.value,!1,m.mobileFormatStr),pe("onChange"),pe("onClose")}))}();else{var e=a(re,50);m._debouncedChange=a(D,_),m.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&N(m.daysContainer,"mouseover",(function(e){"range"===m.config.mode&&ne(e.target)})),N(window.document.body,"keydown",te),m.config.inline||m.config.static||N(window,"resize",e),void 0!==window.ontouchstart?N(window.document,"touchstart",J):N(window.document,"mousedown",I(J)),N(window.document,"focus",J,{capture:!0}),!0===m.config.clickOpens&&(N(m._input,"focus",m.open),N(m._input,"mousedown",I(m.open))),void 0!==m.daysContainer&&(N(m.monthNav,"mousedown",I(ke)),N(m.monthNav,["keyup","increment"],O),N(m.daysContainer,"mousedown",I(ce))),void 0!==m.timeContainer&&void 0!==m.minuteElement&&void 0!==m.hourElement&&(N(m.timeContainer,["increment"],S),N(m.timeContainer,"blur",S,{capture:!0}),N(m.timeContainer,"mousedown",I(j)),N([m.hourElement,m.minuteElement],["focus","click"],(function(e){return e.target.select()})),void 0!==m.secondElement&&N(m.secondElement,"focus",(function(){return m.secondElement&&m.secondElement.select()})),void 0!==m.amPM&&N(m.amPM,"mousedown",I((function(e){S(e),D()}))))}}(),(m.selectedDates.length||m.config.noCalendar)&&(m.config.enableTime&&A(m.config.noCalendar?m.latestSelectedDateObj||m.config.minDate:void 0),be(!1)),T(),m.showTimeInput=m.selectedDates.length>0||m.config.noCalendar;var r=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!m.isMobile&&r&&se(),pe("onReady")}(),m}function T(e,t){for(var n=Array.prototype.slice.call(e).filter((function(e){return e instanceof HTMLElement})),r=[],i=0;i:first-child{margin-top:var(--ck-spacing-large)}.ck.ck-editor__editable_inline>:last-child{margin-bottom:var(--ck-spacing-large)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_n]:after{border-bottom-color:var(--ck-color-base-foreground)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_s]:after{border-top-color:var(--ck-color-base-foreground)}"},function(e,t,n){var r=n(20);"string"==typeof r&&(r=[[e.i,r,""]]),n(1)(r,{injectType:"singletonStyleTag",insert:"head",singleton:!0}),r.locals&&(e.exports=r.locals)},function(e,t){e.exports=".ck.ck-label{display:block}.ck.ck-voice-label{display:none}.ck.ck-label{font-weight:700}"},function(e,t,n){var r=n(22);"string"==typeof r&&(r=[[e.i,r,""]]),n(1)(r,{injectType:"singletonStyleTag",insert:"head",singleton:!0}),r.locals&&(e.exports=r.locals)},function(e,t){e.exports=".ck.ck-sticky-panel .ck-sticky-panel__content_sticky{z-index:var(--ck-z-modal);position:fixed;top:0}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky_bottom-limit{top:auto;position:absolute}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky{box-shadow:var(--ck-drop-shadow),0 0;border-width:0 1px 1px;border-top-left-radius:0;border-top-right-radius:0}"},function(e,t,n){var r=n(24);"string"==typeof r&&(r=[[e.i,r,""]]),n(1)(r,{injectType:"singletonStyleTag",insert:"head",singleton:!0}),r.locals&&(e.exports=r.locals)},function(e,t){e.exports=".ck.ck-dropdown{display:inline-block;position:relative}.ck.ck-dropdown .ck-dropdown__arrow{pointer-events:none;z-index:var(--ck-z-default)}.ck.ck-dropdown .ck-button.ck-dropdown__button{width:100%}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on .ck-tooltip{display:none}.ck.ck-dropdown .ck-dropdown__panel{-webkit-backface-visibility:hidden;display:none;z-index:var(--ck-z-modal);position:absolute}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel-visible{display:inline-block}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw{bottom:100%}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sw{top:100%;bottom:auto}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se{left:0}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sw{right:0}:root{--ck-dropdown-arrow-size:calc(0.5*var(--ck-icon-size))}.ck.ck-dropdown{font-size:inherit}.ck.ck-dropdown .ck-dropdown__arrow{width:var(--ck-dropdown-arrow-size)}[dir=ltr] .ck.ck-dropdown .ck-dropdown__arrow{right:var(--ck-spacing-standard);margin-left:var(--ck-spacing-small)}[dir=rtl] .ck.ck-dropdown .ck-dropdown__arrow{left:var(--ck-spacing-standard);margin-right:var(--ck-spacing-small)}.ck.ck-dropdown.ck-disabled .ck-dropdown__arrow{opacity:var(--ck-disabled-opacity)}[dir=ltr] .ck.ck-dropdown .ck-button.ck-dropdown__button:not(.ck-button_with-text){padding-left:var(--ck-spacing-small)}[dir=rtl] .ck.ck-dropdown .ck-button.ck-dropdown__button:not(.ck-button_with-text){padding-right:var(--ck-spacing-small)}.ck.ck-dropdown .ck-button.ck-dropdown__button .ck-button__label{width:7em;overflow:hidden;text-overflow:ellipsis}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-disabled .ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on{border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-dropdown__panel{box-shadow:var(--ck-drop-shadow),0 0;border-radius:0}.ck-rounded-corners .ck.ck-dropdown__panel,.ck.ck-dropdown__panel.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0}.ck.ck-dropdown__panel{background:var(--ck-color-dropdown-panel-background);border:1px solid var(--ck-color-dropdown-panel-border);bottom:0;min-width:100%}"},function(e,t,n){var r=n(26);"string"==typeof r&&(r=[[e.i,r,""]]),n(1)(r,{injectType:"singletonStyleTag",insert:"head",singleton:!0}),r.locals&&(e.exports=r.locals)},function(e,t){e.exports=".ck.ck-icon{vertical-align:middle}:root{--ck-icon-size:calc(var(--ck-line-height-base)*var(--ck-font-size-normal))}.ck.ck-icon{width:var(--ck-icon-size);height:var(--ck-icon-size);font-size:.8333350694em;will-change:transform}.ck.ck-icon,.ck.ck-icon *{color:inherit;cursor:inherit}.ck.ck-icon :not([fill]){fill:currentColor}"},function(e,t,n){var r=n(28);"string"==typeof r&&(r=[[e.i,r,""]]),n(1)(r,{injectType:"singletonStyleTag",insert:"head",singleton:!0}),r.locals&&(e.exports=r.locals)},function(e,t){e.exports='.ck.ck-tooltip,.ck.ck-tooltip .ck-tooltip__text:after{position:absolute;pointer-events:none;-webkit-backface-visibility:hidden}.ck.ck-tooltip{visibility:hidden;opacity:0;display:none;z-index:var(--ck-z-modal)}.ck.ck-tooltip .ck-tooltip__text{display:inline-block}.ck.ck-tooltip .ck-tooltip__text:after{content:"";width:0;height:0}:root{--ck-tooltip-arrow-size:5px}.ck.ck-tooltip{left:50%;top:0;transition:opacity .2s ease-in-out .2s}.ck.ck-tooltip .ck-tooltip__text{border-radius:0}.ck-rounded-corners .ck.ck-tooltip .ck-tooltip__text,.ck.ck-tooltip .ck-tooltip__text.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-tooltip .ck-tooltip__text{font-size:.9em;line-height:1.5;color:var(--ck-color-tooltip-text);padding:var(--ck-spacing-small) var(--ck-spacing-medium);background:var(--ck-color-tooltip-background);position:relative;left:-50%}.ck.ck-tooltip .ck-tooltip__text:after{transition:opacity .2s ease-in-out .2s;border-style:solid;left:50%}.ck.ck-tooltip.ck-tooltip_s{bottom:calc(-1*var(--ck-tooltip-arrow-size));transform:translateY(100%)}.ck.ck-tooltip.ck-tooltip_s .ck-tooltip__text:after{top:calc(-1*var(--ck-tooltip-arrow-size));transform:translateX(-50%);border-left-color:transparent;border-bottom-color:var(--ck-color-tooltip-background);border-right-color:transparent;border-top-color:transparent;border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:var(--ck-tooltip-arrow-size);border-right-width:var(--ck-tooltip-arrow-size);border-top-width:0}.ck.ck-tooltip.ck-tooltip_n{top:calc(-1*var(--ck-tooltip-arrow-size));transform:translateY(-100%)}.ck.ck-tooltip.ck-tooltip_n .ck-tooltip__text:after{bottom:calc(-1*var(--ck-tooltip-arrow-size));transform:translateX(-50%);border-left-color:transparent;border-bottom-color:transparent;border-right-color:transparent;border-top-color:var(--ck-color-tooltip-background);border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:0;border-right-width:var(--ck-tooltip-arrow-size);border-top-width:var(--ck-tooltip-arrow-size)}'},function(e,t,n){var r=n(30);"string"==typeof r&&(r=[[e.i,r,""]]),n(1)(r,{injectType:"singletonStyleTag",insert:"head",singleton:!0}),r.locals&&(e.exports=r.locals)},function(e,t){e.exports=".ck.ck-button,a.ck.ck-button{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ck.ck-button .ck-tooltip,a.ck.ck-button .ck-tooltip{display:block}@media (hover:none){.ck.ck-button .ck-tooltip,a.ck.ck-button .ck-tooltip{display:none}}.ck.ck-button,a.ck.ck-button{position:relative;display:inline-flex;align-items:center;justify-content:left}.ck.ck-button .ck-button__label,a.ck.ck-button .ck-button__label{display:none}.ck.ck-button.ck-button_with-text .ck-button__label,a.ck.ck-button.ck-button_with-text .ck-button__label{display:inline-block}.ck.ck-button:not(.ck-button_with-text),a.ck.ck-button:not(.ck-button_with-text){justify-content:center}.ck.ck-button:hover .ck-tooltip,a.ck.ck-button:hover .ck-tooltip{visibility:visible;opacity:1}.ck.ck-button:focus:not(:hover) .ck-tooltip,a.ck.ck-button:focus:not(:hover) .ck-tooltip{display:none}.ck.ck-button,a.ck.ck-button{background:var(--ck-color-button-default-background)}.ck.ck-button:not(.ck-disabled):hover,a.ck.ck-button:not(.ck-disabled):hover{background:var(--ck-color-button-default-hover-background)}.ck.ck-button:not(.ck-disabled):active,a.ck.ck-button:not(.ck-disabled):active{background:var(--ck-color-button-default-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-default-active-shadow)}.ck.ck-button.ck-disabled,a.ck.ck-button.ck-disabled{background:var(--ck-color-button-default-disabled-background)}.ck.ck-button,a.ck.ck-button{border-radius:0}.ck-rounded-corners .ck.ck-button,.ck-rounded-corners a.ck.ck-button,.ck.ck-button.ck-rounded-corners,a.ck.ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-button,a.ck.ck-button{white-space:nowrap;cursor:default;vertical-align:middle;padding:var(--ck-spacing-tiny);text-align:center;min-width:var(--ck-ui-component-min-height);min-height:var(--ck-ui-component-min-height);line-height:1;font-size:inherit;border:1px solid transparent;transition:box-shadow .2s ease-in-out,border .2s ease-in-out;-webkit-appearance:none}.ck.ck-button:active,.ck.ck-button:focus,a.ck.ck-button:active,a.ck.ck-button:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0}.ck.ck-button .ck-button__icon use,.ck.ck-button .ck-button__icon use *,a.ck.ck-button .ck-button__icon use,a.ck.ck-button .ck-button__icon use *{color:inherit}.ck.ck-button .ck-button__label,a.ck.ck-button .ck-button__label{font-size:inherit;font-weight:inherit;color:inherit;cursor:inherit;vertical-align:middle}[dir=ltr] .ck.ck-button .ck-button__label,[dir=ltr] a.ck.ck-button .ck-button__label{text-align:left}[dir=rtl] .ck.ck-button .ck-button__label,[dir=rtl] a.ck.ck-button .ck-button__label{text-align:right}.ck.ck-button .ck-button__keystroke,a.ck.ck-button .ck-button__keystroke{color:inherit}[dir=ltr] .ck.ck-button .ck-button__keystroke,[dir=ltr] a.ck.ck-button .ck-button__keystroke{margin-left:var(--ck-spacing-large)}[dir=rtl] .ck.ck-button .ck-button__keystroke,[dir=rtl] a.ck.ck-button .ck-button__keystroke{margin-right:var(--ck-spacing-large)}.ck.ck-button .ck-button__keystroke,a.ck.ck-button .ck-button__keystroke{font-weight:700;opacity:.7}.ck.ck-button.ck-disabled:active,.ck.ck-button.ck-disabled:focus,a.ck.ck-button.ck-disabled:active,a.ck.ck-button.ck-disabled:focus{box-shadow:var(--ck-focus-disabled-outer-shadow),0 0}.ck.ck-button.ck-disabled .ck-button__icon,a.ck.ck-button.ck-disabled .ck-button__icon{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-disabled .ck-button__label,a.ck.ck-button.ck-disabled .ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-disabled .ck-button__keystroke,a.ck.ck-button.ck-disabled .ck-button__keystroke{opacity:.3}.ck.ck-button.ck-button_with-text,a.ck.ck-button.ck-button_with-text{padding:var(--ck-spacing-tiny) var(--ck-spacing-standard)}[dir=ltr] .ck.ck-button.ck-button_with-text .ck-button__icon,[dir=ltr] a.ck.ck-button.ck-button_with-text .ck-button__icon{margin-left:calc(-1*var(--ck-spacing-small));margin-right:var(--ck-spacing-small)}[dir=rtl] .ck.ck-button.ck-button_with-text .ck-button__icon,[dir=rtl] a.ck.ck-button.ck-button_with-text .ck-button__icon{margin-right:calc(-1*var(--ck-spacing-small));margin-left:var(--ck-spacing-small)}.ck.ck-button.ck-button_with-keystroke .ck-button__label,a.ck.ck-button.ck-button_with-keystroke .ck-button__label{flex-grow:1}.ck.ck-button.ck-on,a.ck.ck-button.ck-on{background:var(--ck-color-button-on-background)}.ck.ck-button.ck-on:not(.ck-disabled):hover,a.ck.ck-button.ck-on:not(.ck-disabled):hover{background:var(--ck-color-button-on-hover-background)}.ck.ck-button.ck-on:not(.ck-disabled):active,a.ck.ck-button.ck-on:not(.ck-disabled):active{background:var(--ck-color-button-on-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-on-active-shadow)}.ck.ck-button.ck-on.ck-disabled,a.ck.ck-button.ck-on.ck-disabled{background:var(--ck-color-button-on-disabled-background)}.ck.ck-button.ck-button-save,a.ck.ck-button.ck-button-save{color:var(--ck-color-button-save)}.ck.ck-button.ck-button-cancel,a.ck.ck-button.ck-button-cancel{color:var(--ck-color-button-cancel)}.ck.ck-button-action,a.ck.ck-button-action{background:var(--ck-color-button-action-background)}.ck.ck-button-action:not(.ck-disabled):hover,a.ck.ck-button-action:not(.ck-disabled):hover{background:var(--ck-color-button-action-hover-background)}.ck.ck-button-action:not(.ck-disabled):active,a.ck.ck-button-action:not(.ck-disabled):active{background:var(--ck-color-button-action-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-action-active-shadow)}.ck.ck-button-action.ck-disabled,a.ck.ck-button-action.ck-disabled{background:var(--ck-color-button-action-disabled-background)}.ck.ck-button-action,a.ck.ck-button-action{color:var(--ck-color-button-action-text)}.ck.ck-button-bold,a.ck.ck-button-bold{font-weight:700}"},function(e,t,n){var r=n(32);"string"==typeof r&&(r=[[e.i,r,""]]),n(1)(r,{injectType:"singletonStyleTag",insert:"head",singleton:!0}),r.locals&&(e.exports=r.locals)},function(e,t){e.exports=".ck.ck-list{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-direction:column}.ck.ck-list .ck-list__item,.ck.ck-list .ck-list__separator{display:block}.ck.ck-list .ck-list__item>:focus{position:relative;z-index:var(--ck-z-default)}.ck.ck-list{border-radius:0}.ck-rounded-corners .ck.ck-list,.ck.ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-list{list-style-type:none;background:var(--ck-color-list-background)}.ck.ck-list__item{cursor:default;min-width:12em}.ck.ck-list__item .ck-button{min-height:unset;width:100%;text-align:left;border-radius:0;padding:calc(0.2*var(--ck-line-height-base)*var(--ck-font-size-base)) calc(0.4*var(--ck-line-height-base)*var(--ck-font-size-base))}.ck.ck-list__item .ck-button .ck-button__label{line-height:calc(1.2*var(--ck-line-height-base)*var(--ck-font-size-base))}.ck.ck-list__item .ck-button:active{box-shadow:none}.ck.ck-list__item .ck-button.ck-on{background:var(--ck-color-list-button-on-background);color:var(--ck-color-list-button-on-text)}.ck.ck-list__item .ck-button.ck-on:active{box-shadow:none}.ck.ck-list__item .ck-button.ck-on:hover:not(.ck-disabled){background:var(--ck-color-list-button-on-background-focus)}.ck.ck-list__item .ck-button.ck-on:focus:not(.ck-disabled){border-color:var(--ck-color-base-background)}.ck.ck-list__item .ck-button:hover:not(.ck-disabled){background:var(--ck-color-list-button-hover-background)}.ck.ck-list__item .ck-switchbutton.ck-on{background:var(--ck-color-list-background);color:inherit}.ck.ck-list__item .ck-switchbutton.ck-on:hover:not(.ck-disabled){background:var(--ck-color-list-button-hover-background);color:inherit}.ck.ck-list__separator{height:1px;width:100%;background:var(--ck-color-base-border)}"},function(e,t,n){var r=n(34);"string"==typeof r&&(r=[[e.i,r,""]]),n(1)(r,{injectType:"singletonStyleTag",insert:"head",singleton:!0}),r.locals&&(e.exports=r.locals)},function(e,t){e.exports=".ck.ck-button.ck-switchbutton .ck-button__toggle,.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{display:block}:root{--ck-switch-button-toggle-width:2.6153846154em;--ck-switch-button-toggle-inner-size:1.0769230769em;--ck-switch-button-toggle-spacing:1px;--ck-switch-button-translation:1.3846153847em}[dir=ltr] .ck.ck-button.ck-switchbutton .ck-button__label{margin-right:calc(2*var(--ck-spacing-large))}[dir=rtl] .ck.ck-button.ck-switchbutton .ck-button__label{margin-left:calc(2*var(--ck-spacing-large))}.ck.ck-button.ck-switchbutton .ck-button__toggle{border-radius:0}.ck-rounded-corners .ck.ck-button.ck-switchbutton .ck-button__toggle,.ck.ck-button.ck-switchbutton .ck-button__toggle.ck-rounded-corners{border-radius:var(--ck-border-radius)}[dir=ltr] .ck.ck-button.ck-switchbutton .ck-button__toggle{margin-left:auto}[dir=rtl] .ck.ck-button.ck-switchbutton .ck-button__toggle{margin-right:auto}.ck.ck-button.ck-switchbutton .ck-button__toggle{transition:background .4s ease;width:var(--ck-switch-button-toggle-width);background:var(--ck-color-switch-button-off-background)}.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{border-radius:0}.ck-rounded-corners .ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner,.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner.ck-rounded-corners{border-radius:var(--ck-border-radius);border-radius:calc(0.5*var(--ck-border-radius))}.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{margin:var(--ck-switch-button-toggle-spacing);width:var(--ck-switch-button-toggle-inner-size);height:var(--ck-switch-button-toggle-inner-size);background:var(--ck-color-switch-button-inner-background);transition:all .3s ease}.ck.ck-button.ck-switchbutton .ck-button__toggle:hover{background:var(--ck-color-switch-button-off-hover-background)}.ck.ck-button.ck-switchbutton .ck-button__toggle:hover .ck-button__toggle__inner{box-shadow:0 0 0 5px var(--ck-color-switch-button-inner-shadow)}.ck.ck-button.ck-switchbutton.ck-disabled .ck-button__toggle{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle{background:var(--ck-color-switch-button-on-background)}.ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle:hover{background:var(--ck-color-switch-button-on-hover-background)}[dir=ltr] .ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle .ck-button__toggle__inner{transform:translateX(var(--ck-switch-button-translation))}[dir=rtl] .ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle .ck-button__toggle__inner{transform:translateX(calc(-1*var(--ck-switch-button-translation)))}"},function(e,t,n){var r=n(36);"string"==typeof r&&(r=[[e.i,r,""]]),n(1)(r,{injectType:"singletonStyleTag",insert:"head",singleton:!0}),r.locals&&(e.exports=r.locals)},function(e,t){e.exports=".ck.ck-toolbar-dropdown .ck.ck-toolbar .ck.ck-toolbar__items{flex-wrap:nowrap}.ck.ck-toolbar-dropdown .ck-dropdown__panel .ck-button:focus{z-index:calc(var(--ck-z-default) + 1)}.ck.ck-toolbar-dropdown .ck-toolbar{border:0}"},function(e,t,n){var r=n(38);"string"==typeof r&&(r=[[e.i,r,""]]),n(1)(r,{injectType:"singletonStyleTag",insert:"head",singleton:!0}),r.locals&&(e.exports=r.locals)},function(e,t){e.exports=".ck.ck-dropdown .ck-dropdown__panel .ck-list{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list,.ck.ck-dropdown .ck-dropdown__panel .ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0}.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button,.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button,.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}"},function(e,t,n){var r=n(40);"string"==typeof r&&(r=[[e.i,r,""]]),n(1)(r,{injectType:"singletonStyleTag",insert:"head",singleton:!0}),r.locals&&(e.exports=r.locals)},function(e,t){e.exports=".ck.ck-toolbar{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-flow:row nowrap;align-items:center}.ck.ck-toolbar>.ck-toolbar__items{display:flex;flex-flow:row wrap;align-items:center;flex-grow:1}.ck.ck-toolbar .ck.ck-toolbar__separator{display:inline-block}.ck.ck-toolbar .ck.ck-toolbar__separator:first-child,.ck.ck-toolbar .ck.ck-toolbar__separator:last-child{display:none}.ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items{flex-wrap:nowrap}.ck.ck-toolbar.ck-toolbar_vertical>.ck-toolbar__items{flex-direction:column}.ck.ck-toolbar.ck-toolbar_floating>.ck-toolbar__items{flex-wrap:nowrap}.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown>.ck-dropdown__button .ck-dropdown__arrow{display:none}.ck.ck-toolbar{border-radius:0}.ck-rounded-corners .ck.ck-toolbar,.ck.ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-toolbar{background:var(--ck-color-toolbar-background);padding:0 var(--ck-spacing-small);border:1px solid var(--ck-color-toolbar-border)}.ck.ck-toolbar>.ck-toolbar__items>*{margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small);margin-right:var(--ck-spacing-small)}.ck.ck-toolbar.ck-toolbar_vertical{padding:0}.ck.ck-toolbar.ck-toolbar_vertical>.ck-toolbar__items>.ck{width:100%;margin:0;border-radius:0;border:0}.ck.ck-toolbar>.ck-toolbar__items>*,.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown{margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small)}.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown>.ck.ck-button.ck-dropdown__button{padding-left:var(--ck-spacing-tiny)}.ck.ck-toolbar .ck.ck-toolbar__separator{align-self:stretch;width:1px;min-width:1px;margin-top:0;margin-bottom:0;background:var(--ck-color-toolbar-border)}.ck-toolbar-container .ck.ck-toolbar{border:0}.ck.ck-toolbar[dir=rtl]>.ck.ck-toolbar__grouped-dropdown,[dir=rtl] .ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown{padding-right:var(--ck-spacing-small)}.ck.ck-toolbar[dir=rtl]>.ck.ck-toolbar__items>*,[dir=rtl] .ck.ck-toolbar>.ck.ck-toolbar__items>*{margin-left:var(--ck-spacing-small);margin-right:0}.ck.ck-toolbar[dir=rtl]>.ck.ck-toolbar__items>:last-child,[dir=rtl] .ck.ck-toolbar>.ck.ck-toolbar__items>:last-child{margin-left:0}.ck.ck-toolbar[dir=rtl].ck-toolbar_grouping>.ck-toolbar__items,[dir=rtl] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items{margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=ltr]>.ck.ck-toolbar__grouped-dropdown,[dir=ltr] .ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown{padding-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=ltr]>.ck.ck-toolbar__items>:last-child,[dir=ltr] .ck.ck-toolbar>.ck.ck-toolbar__items>:last-child{margin-right:0}.ck.ck-toolbar[dir=ltr].ck-toolbar_grouping>.ck-toolbar__items,[dir=ltr] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items{margin-right:var(--ck-spacing-small)}"},function(e,t,n){var r=n(42);"string"==typeof r&&(r=[[e.i,r,""]]),n(1)(r,{injectType:"singletonStyleTag",insert:"head",singleton:!0}),r.locals&&(e.exports=r.locals)},function(e,t){e.exports=".ck.ck-editor{position:relative}.ck.ck-editor .ck-editor__top .ck-sticky-panel .ck-toolbar{z-index:var(--ck-z-modal)}.ck.ck-editor__top .ck-sticky-panel .ck-toolbar{border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-toolbar,.ck.ck-editor__top .ck-sticky-panel .ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius);border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-editor__top .ck-sticky-panel .ck-toolbar{border-bottom-width:0}.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar{border-bottom-width:1px;border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar,.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius);border-radius:0}.ck.ck-editor__main>.ck-editor__editable{background:var(--ck-color-base-background);border-radius:0}.ck-rounded-corners .ck.ck-editor__main>.ck-editor__editable,.ck.ck-editor__main>.ck-editor__editable.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}.ck.ck-editor__main>.ck-editor__editable:not(.ck-focused){border-color:var(--ck-color-base-border)}"},function(e,t,n){var r=n(44);"string"==typeof r&&(r=[[e.i,r,""]]),n(1)(r,{injectType:"singletonStyleTag",insert:"head",singleton:!0}),r.locals&&(e.exports=r.locals)},function(e,t){e.exports=".ck-content blockquote{overflow:hidden;padding-right:1.5em;padding-left:1.5em;margin-left:0;margin-right:0;font-style:italic;border-left:5px solid #ccc}.ck-content[dir=rtl] blockquote{border-left:0;border-right:5px solid #ccc}"},function(e,t,n){var r=n(46);"string"==typeof r&&(r=[[e.i,r,""]]),n(1)(r,{injectType:"singletonStyleTag",insert:"head",singleton:!0}),r.locals&&(e.exports=r.locals)},function(e,t){e.exports=".ck .ck-link_selected{background:var(--ck-color-link-selected-background)}"},function(e,t,n){var r=n(48);"string"==typeof r&&(r=[[e.i,r,""]]),n(1)(r,{injectType:"singletonStyleTag",insert:"head",singleton:!0}),r.locals&&(e.exports=r.locals)},function(e,t){e.exports=":root{--ck-color-resizer:var(--ck-color-focus-border);--ck-resizer-size:10px;--ck-resizer-border-width:1px;--ck-resizer-border-radius:2px;--ck-resizer-offset:calc(var(--ck-resizer-size)/-2 - 2px);--ck-resizer-tooltip-offset:10px;--ck-color-resizer-tooltip-background:#262626;--ck-color-resizer-tooltip-text:#f2f2f2}.ck .ck-widget.ck-widget_with-selection-handle{position:relative}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{position:absolute}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon{display:block}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected .ck-widget__selection-handle,.ck .ck-widget.ck-widget_with-selection-handle:hover .ck-widget__selection-handle{visibility:visible}.ck .ck-size-view{background:var(--ck-color-resizer-tooltip-background);color:var(--ck-color-resizer-tooltip-text);border:1px solid var(--ck-color-resizer-tooltip-text);border-radius:var(--ck-resizer-border-radius);font-size:var(--ck-font-size-tiny);display:block;padding:var(--ck-spacing-small)}.ck .ck-size-view.ck-orientation-bottom-left,.ck .ck-size-view.ck-orientation-bottom-right,.ck .ck-size-view.ck-orientation-top-left,.ck .ck-size-view.ck-orientation-top-right{position:absolute}.ck .ck-size-view.ck-orientation-top-left{top:var(--ck-resizer-tooltip-offset);left:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-top-right{top:var(--ck-resizer-tooltip-offset);right:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-bottom-right{bottom:var(--ck-resizer-tooltip-offset);right:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-bottom-left{bottom:var(--ck-resizer-tooltip-offset);left:var(--ck-resizer-tooltip-offset)}:root{--ck-widget-outline-thickness:3px;--ck-widget-handler-icon-size:16px;--ck-widget-handler-animation-duration:200ms;--ck-widget-handler-animation-curve:ease;--ck-color-widget-blurred-border:#dedede;--ck-color-widget-hover-border:#ffc83d;--ck-color-widget-editable-focus-background:var(--ck-color-base-background);--ck-color-widget-drag-handler-icon-color:var(--ck-color-base-background)}.ck .ck-widget{outline-width:var(--ck-widget-outline-thickness);outline-style:solid;outline-color:transparent;transition:outline-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve)}.ck .ck-widget.ck-widget_selected,.ck .ck-widget.ck-widget_selected:hover{outline:var(--ck-widget-outline-thickness) solid var(--ck-color-focus-border)}.ck .ck-widget:hover{outline-color:var(--ck-color-widget-hover-border)}.ck .ck-editor__nested-editable{border:1px solid transparent}.ck .ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck .ck-editor__nested-editable:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0;background-color:var(--ck-color-widget-editable-focus-background)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{padding:4px;box-sizing:border-box;background-color:transparent;opacity:0;transition:background-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),visibility var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),opacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);border-radius:var(--ck-border-radius) var(--ck-border-radius) 0 0;transform:translateY(-100%);left:calc(0px - var(--ck-widget-outline-thickness))}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon{width:var(--ck-widget-handler-icon-size);height:var(--ck-widget-handler-icon-size);color:var(--ck-color-widget-drag-handler-icon-color)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator{opacity:0;transition:opacity .3s var(--ck-widget-handler-animation-curve)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle:hover .ck-icon .ck-icon__selected-indicator{opacity:1}.ck .ck-widget.ck-widget_with-selection-handle:hover .ck-widget__selection-handle{opacity:1;background-color:var(--ck-color-widget-hover-border)}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected .ck-widget__selection-handle,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover .ck-widget__selection-handle{opacity:1;background-color:var(--ck-color-focus-border)}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected .ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover .ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator{opacity:1}.ck-editor__editable>.ck-widget.ck-widget_with-selection-handle:first-child,.ck-editor__editable blockquote>.ck-widget.ck-widget_with-selection-handle:first-child{margin-top:calc(1em + var(--ck-widget-handler-icon-size))}.ck[dir=rtl] .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{left:auto;right:calc(0px - var(--ck-widget-outline-thickness))}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected,.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover{outline-color:var(--ck-color-widget-blurred-border)}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle .ck-widget__selection-handle,.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle .ck-widget__selection-handle:hover,.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover.ck-widget_with-selection-handle .ck-widget__selection-handle,.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover.ck-widget_with-selection-handle .ck-widget__selection-handle:hover{background:var(--ck-color-widget-blurred-border)}.ck-editor__editable.ck-read-only .ck-widget{--ck-widget-outline-thickness:0}"},function(e,t,n){var r=n(50);"string"==typeof r&&(r=[[e.i,r,""]]),n(1)(r,{injectType:"singletonStyleTag",insert:"head",singleton:!0}),r.locals&&(e.exports=r.locals)},function(e,t){e.exports=".ck.ck-labeled-input .ck-labeled-input__status{font-size:var(--ck-font-size-small);margin-top:var(--ck-spacing-small);white-space:normal}.ck.ck-labeled-input .ck-labeled-input__status_error{color:var(--ck-color-base-error)}"},function(e,t,n){var r=n(52);"string"==typeof r&&(r=[[e.i,r,""]]),n(1)(r,{injectType:"singletonStyleTag",insert:"head",singleton:!0}),r.locals&&(e.exports=r.locals)},function(e,t){e.exports=":root{--ck-input-text-width:18em}.ck.ck-input-text{border-radius:0}.ck-rounded-corners .ck.ck-input-text,.ck.ck-input-text.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-input-text{box-shadow:var(--ck-inner-shadow),0 0;background:var(--ck-color-input-background);border:1px solid var(--ck-color-input-border);padding:var(--ck-spacing-extra-tiny) var(--ck-spacing-medium);min-width:var(--ck-input-text-width);min-height:var(--ck-ui-component-min-height);transition:box-shadow .2s ease-in-out,border .2s ease-in-out}.ck.ck-input-text:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),var(--ck-inner-shadow)}.ck.ck-input-text[readonly]{border:1px solid var(--ck-color-input-disabled-border);background:var(--ck-color-input-disabled-background);color:var(--ck-color-input-disabled-text)}.ck.ck-input-text[readonly]:focus{box-shadow:var(--ck-focus-disabled-outer-shadow),var(--ck-inner-shadow)}.ck.ck-input-text.ck-error{border-color:var(--ck-color-input-error-border);animation:ck-text-input-shake .3s ease both}.ck.ck-input-text.ck-error:focus{box-shadow:var(--ck-focus-error-outer-shadow),var(--ck-inner-shadow)}@keyframes ck-text-input-shake{20%{transform:translateX(-2px)}40%{transform:translateX(2px)}60%{transform:translateX(-1px)}80%{transform:translateX(1px)}}"},function(e,t,n){var r=n(54);"string"==typeof r&&(r=[[e.i,r,""]]),n(1)(r,{injectType:"singletonStyleTag",insert:"head",singleton:!0}),r.locals&&(e.exports=r.locals)},function(e,t){e.exports=".ck.ck-text-alternative-form{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-text-alternative-form .ck-labeled-input{display:inline-block}.ck.ck-text-alternative-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-text-alternative-form{flex-wrap:wrap}.ck.ck-text-alternative-form .ck-labeled-input{flex-basis:100%}.ck.ck-text-alternative-form .ck-button{flex-basis:50%}}.ck.ck-text-alternative-form{padding:var(--ck-spacing-standard)}.ck.ck-text-alternative-form:focus{outline:none}[dir=ltr] .ck.ck-text-alternative-form>:not(:first-child),[dir=rtl] .ck.ck-text-alternative-form>:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-text-alternative-form{padding:0;width:calc(0.8*var(--ck-input-text-width))}.ck.ck-text-alternative-form .ck-labeled-input{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-text-alternative-form .ck-labeled-input .ck-input-text{min-width:0;width:100%}.ck.ck-text-alternative-form .ck-button{padding:var(--ck-spacing-standard);margin-top:var(--ck-spacing-standard);border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-text-alternative-form .ck-button{margin-left:0}[dir=ltr] .ck.ck-text-alternative-form .ck-button:first-of-type{border-right:1px solid var(--ck-color-base-border)}[dir=rtl] .ck.ck-text-alternative-form .ck-button{margin-left:0}[dir=rtl] .ck.ck-text-alternative-form .ck-button:last-of-type{border-right:1px solid var(--ck-color-base-border)}}"},function(e,t,n){var r=n(56);"string"==typeof r&&(r=[[e.i,r,""]]),n(1)(r,{injectType:"singletonStyleTag",insert:"head",singleton:!0}),r.locals&&(e.exports=r.locals)},function(e,t){e.exports=':root{--ck-balloon-panel-arrow-z-index:calc(var(--ck-z-default) - 3)}.ck.ck-balloon-panel{display:none;position:absolute;z-index:var(--ck-z-modal)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{content:"";position:absolute}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel[class*=arrow_n]:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel[class*=arrow_n]:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel[class*=arrow_s]:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel[class*=arrow_s]:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel.ck-balloon-panel_visible{display:block}:root{--ck-balloon-arrow-offset:2px;--ck-balloon-arrow-height:10px;--ck-balloon-arrow-half-width:8px}.ck.ck-balloon-panel{border-radius:0}.ck-rounded-corners .ck.ck-balloon-panel,.ck.ck-balloon-panel.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-balloon-panel{box-shadow:var(--ck-drop-shadow),0 0;min-height:15px;background:var(--ck-color-panel-background);border:1px solid var(--ck-color-panel-border)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{width:0;height:0;border-style:solid}.ck.ck-balloon-panel[class*=arrow_n]:after,.ck.ck-balloon-panel[class*=arrow_n]:before{border-left-width:var(--ck-balloon-arrow-half-width);border-bottom-width:var(--ck-balloon-arrow-height);border-right-width:var(--ck-balloon-arrow-half-width);border-top-width:0}.ck.ck-balloon-panel[class*=arrow_n]:before{border-bottom-color:var(--ck-color-panel-border)}.ck.ck-balloon-panel[class*=arrow_n]:after,.ck.ck-balloon-panel[class*=arrow_n]:before{border-left-color:transparent;border-right-color:transparent;border-top-color:transparent}.ck.ck-balloon-panel[class*=arrow_n]:after{border-bottom-color:var(--ck-color-panel-background);margin-top:var(--ck-balloon-arrow-offset)}.ck.ck-balloon-panel[class*=arrow_s]:after,.ck.ck-balloon-panel[class*=arrow_s]:before{border-left-width:var(--ck-balloon-arrow-half-width);border-bottom-width:0;border-right-width:var(--ck-balloon-arrow-half-width);border-top-width:var(--ck-balloon-arrow-height)}.ck.ck-balloon-panel[class*=arrow_s]:before{border-top-color:var(--ck-color-panel-border)}.ck.ck-balloon-panel[class*=arrow_s]:after,.ck.ck-balloon-panel[class*=arrow_s]:before{border-left-color:transparent;border-bottom-color:transparent;border-right-color:transparent}.ck.ck-balloon-panel[class*=arrow_s]:after{border-top-color:var(--ck-color-panel-background);margin-bottom:var(--ck-balloon-arrow-offset)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:before{left:50%;margin-left:calc(-1*var(--ck-balloon-arrow-half-width));top:calc(-1*var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:before{left:calc(2*var(--ck-balloon-arrow-half-width));top:calc(-1*var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:before{right:calc(2*var(--ck-balloon-arrow-half-width));top:calc(-1*var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:before{left:50%;margin-left:calc(-1*var(--ck-balloon-arrow-half-width));bottom:calc(-1*var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:before{left:calc(2*var(--ck-balloon-arrow-half-width));bottom:calc(-1*var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:before{right:calc(2*var(--ck-balloon-arrow-half-width));bottom:calc(-1*var(--ck-balloon-arrow-height))}'},function(e,t,n){var r=n(58);"string"==typeof r&&(r=[[e.i,r,""]]),n(1)(r,{injectType:"singletonStyleTag",insert:"head",singleton:!0}),r.locals&&(e.exports=r.locals)},function(e,t){e.exports=".ck .ck-balloon-rotator__navigation{display:flex;align-items:center;justify-content:center}.ck .ck-balloon-rotator__content .ck-toolbar{justify-content:center}.ck .ck-balloon-rotator__navigation{background:var(--ck-color-toolbar-background);border-bottom:1px solid var(--ck-color-toolbar-border);padding:0 var(--ck-spacing-small)}.ck .ck-balloon-rotator__navigation>*{margin-right:var(--ck-spacing-small);margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small)}.ck .ck-balloon-rotator__navigation .ck-balloon-rotator__counter{margin-right:var(--ck-spacing-standard);margin-left:var(--ck-spacing-small)}.ck .ck-balloon-rotator__content .ck.ck-annotation-wrapper{box-shadow:none}"},function(e,t,n){var r=n(60);"string"==typeof r&&(r=[[e.i,r,""]]),n(1)(r,{injectType:"singletonStyleTag",insert:"head",singleton:!0}),r.locals&&(e.exports=r.locals)},function(e,t){e.exports=".ck .ck-fake-panel{position:absolute;z-index:calc(var(--ck-z-modal) - 1)}.ck .ck-fake-panel div{position:absolute}.ck .ck-fake-panel div:first-child{z-index:2}.ck .ck-fake-panel div:nth-child(2){z-index:1}:root{--ck-balloon-fake-panel-offset-horizontal:6px;--ck-balloon-fake-panel-offset-vertical:6px}.ck .ck-fake-panel div{box-shadow:var(--ck-drop-shadow),0 0;min-height:15px;background:var(--ck-color-panel-background);border:1px solid var(--ck-color-panel-border);border-radius:var(--ck-border-radius);width:100%;height:100%}.ck .ck-fake-panel div:first-child{margin-left:var(--ck-balloon-fake-panel-offset-horizontal);margin-top:var(--ck-balloon-fake-panel-offset-vertical)}.ck .ck-fake-panel div:nth-child(2){margin-left:calc(var(--ck-balloon-fake-panel-offset-horizontal)*2);margin-top:calc(var(--ck-balloon-fake-panel-offset-vertical)*2)}.ck .ck-fake-panel div:nth-child(3){margin-left:calc(var(--ck-balloon-fake-panel-offset-horizontal)*3);margin-top:calc(var(--ck-balloon-fake-panel-offset-vertical)*3)}.ck .ck-balloon-panel_arrow_s+.ck-fake-panel,.ck .ck-balloon-panel_arrow_se+.ck-fake-panel,.ck .ck-balloon-panel_arrow_sw+.ck-fake-panel{--ck-balloon-fake-panel-offset-vertical:-6px}"},function(e,t,n){var r=n(62);"string"==typeof r&&(r=[[e.i,r,""]]),n(1)(r,{injectType:"singletonStyleTag",insert:"head",singleton:!0}),r.locals&&(e.exports=r.locals)},function(e,t){e.exports=".ck-content .image{display:table;clear:both;text-align:center;margin:1em auto}.ck-content .image>img{display:block;margin:0 auto;max-width:100%;min-width:50px}"},function(e,t,n){var r=n(64);"string"==typeof r&&(r=[[e.i,r,""]]),n(1)(r,{injectType:"singletonStyleTag",insert:"head",singleton:!0}),r.locals&&(e.exports=r.locals)},function(e,t){e.exports=".ck.ck-editor__editable .image{position:relative}.ck.ck-editor__editable .image .ck-progress-bar{position:absolute;top:0;left:0}.ck.ck-editor__editable .image.ck-appear{animation:fadeIn .7s}.ck.ck-editor__editable .image .ck-progress-bar{height:2px;width:0;background:var(--ck-color-upload-bar-background);transition:width .1s}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}"},function(e,t,n){var r=n(66);"string"==typeof r&&(r=[[e.i,r,""]]),n(1)(r,{injectType:"singletonStyleTag",insert:"head",singleton:!0}),r.locals&&(e.exports=r.locals)},function(e,t){e.exports='.ck-image-upload-complete-icon{display:block;position:absolute;top:10px;right:10px;border-radius:50%}.ck-image-upload-complete-icon:after{content:"";position:absolute}:root{--ck-color-image-upload-icon:#fff;--ck-color-image-upload-icon-background:#008a00;--ck-image-upload-icon-size:20px;--ck-image-upload-icon-width:2px}.ck-image-upload-complete-icon{width:var(--ck-image-upload-icon-size);height:var(--ck-image-upload-icon-size);opacity:0;background:var(--ck-color-image-upload-icon-background);animation-name:ck-upload-complete-icon-show,ck-upload-complete-icon-hide;animation-fill-mode:forwards,forwards;animation-duration:.5s,.5s;font-size:var(--ck-image-upload-icon-size);animation-delay:0ms,3s}.ck-image-upload-complete-icon:after{left:25%;top:50%;opacity:0;height:0;width:0;transform:scaleX(-1) rotate(135deg);transform-origin:left top;border-top:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);border-right:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);animation-name:ck-upload-complete-icon-check;animation-duration:.5s;animation-delay:.5s;animation-fill-mode:forwards;box-sizing:border-box}@keyframes ck-upload-complete-icon-show{0%{opacity:0}to{opacity:1}}@keyframes ck-upload-complete-icon-hide{0%{opacity:1}to{opacity:0}}@keyframes ck-upload-complete-icon-check{0%{opacity:1;width:0;height:0}33%{width:.3em;height:0}to{opacity:1;width:.3em;height:.45em}}'},function(e,t,n){var r=n(68);"string"==typeof r&&(r=[[e.i,r,""]]),n(1)(r,{injectType:"singletonStyleTag",insert:"head",singleton:!0}),r.locals&&(e.exports=r.locals)},function(e,t){e.exports='.ck .ck-upload-placeholder-loader{position:absolute;display:flex;align-items:center;justify-content:center;top:0;left:0}.ck .ck-upload-placeholder-loader:before{content:"";position:relative}:root{--ck-color-upload-placeholder-loader:#b3b3b3;--ck-upload-placeholder-loader-size:32px}.ck .ck-image-upload-placeholder{width:100%;margin:0}.ck .ck-upload-placeholder-loader{width:100%;height:100%}.ck .ck-upload-placeholder-loader:before{width:var(--ck-upload-placeholder-loader-size);height:var(--ck-upload-placeholder-loader-size);border-radius:50%;border-top:3px solid var(--ck-color-upload-placeholder-loader);border-right:2px solid transparent;animation:ck-upload-placeholder-loader 1s linear infinite}@keyframes ck-upload-placeholder-loader{to{transform:rotate(1turn)}}'},function(e,t){e.exports=".ck.ck-heading_heading1{font-size:20px}.ck.ck-heading_heading2{font-size:17px}.ck.ck-heading_heading3{font-size:14px}.ck[class*=ck-heading_heading]{font-weight:700}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__button .ck-button__label{width:8em}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__panel .ck-list__item{min-width:18em}"},function(e,t,n){var r=n(71);"string"==typeof r&&(r=[[e.i,r,""]]),n(1)(r,{injectType:"singletonStyleTag",insert:"head",singleton:!0}),r.locals&&(e.exports=r.locals)},function(e,t){e.exports=".ck-content .image>figcaption{display:table-caption;caption-side:bottom;word-break:break-word;color:#333;background-color:#f7f7f7;padding:.6em;font-size:.75em;outline-offset:-1px}"},function(e,t,n){var r=n(73);"string"==typeof r&&(r=[[e.i,r,""]]),n(1)(r,{injectType:"singletonStyleTag",insert:"head",singleton:!0}),r.locals&&(e.exports=r.locals)},function(e,t){e.exports=":root{--ck-image-style-spacing:1.5em}.ck-content .image-style-align-center,.ck-content .image-style-align-left,.ck-content .image-style-align-right,.ck-content .image-style-side{max-width:50%}.ck-content .image-style-side{float:right;margin-left:var(--ck-image-style-spacing)}.ck-content .image-style-align-left{float:left;margin-right:var(--ck-image-style-spacing)}.ck-content .image-style-align-center{margin-left:auto;margin-right:auto}.ck-content .image-style-align-right{float:right;margin-left:var(--ck-image-style-spacing)}"},function(e,t,n){var r=n(75);"string"==typeof r&&(r=[[e.i,r,""]]),n(1)(r,{injectType:"singletonStyleTag",insert:"head",singleton:!0}),r.locals&&(e.exports=r.locals)},function(e,t){e.exports=".ck.ck-link-form{display:flex}.ck.ck-link-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-link-form{flex-wrap:wrap}.ck.ck-link-form .ck-labeled-input{flex-basis:100%}.ck.ck-link-form .ck-button{flex-basis:50%}}.ck.ck-link-form_layout-vertical{display:block}.ck.ck-link-form{padding:var(--ck-spacing-standard)}.ck.ck-link-form:focus{outline:none}[dir=ltr] .ck.ck-link-form>:not(:first-child),[dir=rtl] .ck.ck-link-form>:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-link-form{padding:0;width:calc(0.8*var(--ck-input-text-width))}.ck.ck-link-form .ck-labeled-input{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-link-form .ck-labeled-input .ck-input-text{min-width:0;width:100%}.ck.ck-link-form .ck-button{padding:var(--ck-spacing-standard);margin-top:var(--ck-spacing-standard);border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-link-form .ck-button{margin-left:0}[dir=ltr] .ck.ck-link-form .ck-button:first-of-type{border-right:1px solid var(--ck-color-base-border)}[dir=rtl] .ck.ck-link-form .ck-button{margin-left:0}[dir=rtl] .ck.ck-link-form .ck-button:last-of-type{border-right:1px solid var(--ck-color-base-border)}}.ck.ck-link-form_layout-vertical{padding:0;min-width:var(--ck-input-text-width)}.ck.ck-link-form_layout-vertical .ck-labeled-input{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) var(--ck-spacing-small)}.ck.ck-link-form_layout-vertical .ck-labeled-input .ck-input-text{min-width:0;width:100%}.ck.ck-link-form_layout-vertical .ck-button{padding:var(--ck-spacing-standard);margin:0;border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border);width:50%}[dir=ltr] .ck.ck-link-form_layout-vertical .ck-button{margin-left:0}[dir=ltr] .ck.ck-link-form_layout-vertical .ck-button:first-of-type{border-right:1px solid var(--ck-color-base-border)}[dir=rtl] .ck.ck-link-form_layout-vertical .ck-button{margin-left:0}[dir=rtl] .ck.ck-link-form_layout-vertical .ck-button:last-of-type{border-right:1px solid var(--ck-color-base-border)}.ck.ck-link-form_layout-vertical .ck.ck-list{margin-left:0}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton{border:0;width:100%}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton:hover{background:none}"},function(e,t,n){var r=n(77);"string"==typeof r&&(r=[[e.i,r,""]]),n(1)(r,{injectType:"singletonStyleTag",insert:"head",singleton:!0}),r.locals&&(e.exports=r.locals)},function(e,t){e.exports=".ck.ck-link-actions{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-link-actions .ck-link-actions__preview{display:inline-block}.ck.ck-link-actions .ck-link-actions__preview .ck-button__label{overflow:hidden}@media screen and (max-width:600px){.ck.ck-link-actions{flex-wrap:wrap}.ck.ck-link-actions .ck-link-actions__preview{flex-basis:100%}.ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){flex-basis:50%}}.ck.ck-link-actions{padding:var(--ck-spacing-standard)}.ck.ck-link-actions .ck-button.ck-link-actions__preview{padding-left:0;padding-right:0}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{padding:0 var(--ck-spacing-medium);color:var(--ck-color-link-default);text-overflow:ellipsis;cursor:pointer;max-width:var(--ck-input-text-width);min-width:3em;text-align:center}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label:hover{text-decoration:underline}.ck.ck-link-actions .ck-button.ck-link-actions__preview,.ck.ck-link-actions .ck-button.ck-link-actions__preview:active,.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus,.ck.ck-link-actions .ck-button.ck-link-actions__preview:hover{background:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:active{box-shadow:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus .ck-button__label{text-decoration:underline}.ck.ck-link-actions:focus{outline:none}[dir=ltr] .ck.ck-link-actions .ck-button:not(:first-child),[dir=rtl] .ck.ck-link-actions .ck-button:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-link-actions{padding:0;width:calc(0.8*var(--ck-input-text-width))}.ck.ck-link-actions .ck-button.ck-link-actions__preview{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{min-width:0;max-width:100%}.ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){padding:var(--ck-spacing-standard);margin-top:var(--ck-spacing-standard);border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){margin-left:0}[dir=ltr] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview):first-of-type{border-right:1px solid var(--ck-color-base-border)}[dir=rtl] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){margin-left:0}[dir=rtl] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview):last-of-type{border-right:1px solid var(--ck-color-base-border)}}"},function(e,t,n){var r=n(79);"string"==typeof r&&(r=[[e.i,r,""]]),n(1)(r,{injectType:"singletonStyleTag",insert:"head",singleton:!0}),r.locals&&(e.exports=r.locals)},function(e,t){e.exports='.ck-media__wrapper .ck-media__placeholder{display:flex;flex-direction:column;align-items:center}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url .ck-tooltip{display:block}@media (hover:none){.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url .ck-tooltip{display:none}}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url{max-width:100%;position:relative}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url:hover .ck-tooltip{visibility:visible;opacity:1}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url .ck-media__placeholder__url__text{overflow:hidden;display:block}.ck-media__wrapper[data-oembed-url*="facebook.com"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="google.com/maps"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck-media__placeholder__icon *{display:none}.ck-editor__editable:not(.ck-read-only) .ck-media__wrapper>:not(.ck-media__placeholder),.ck-editor__editable:not(.ck-read-only) .ck-widget:not(.ck-widget_selected) .ck-media__placeholder{pointer-events:none}:root{--ck-media-embed-placeholder-icon-size:3em;--ck-color-media-embed-placeholder-url-text:#757575;--ck-color-media-embed-placeholder-url-text-hover:var(--ck-color-base-text)}.ck-media__wrapper{margin:0 auto}.ck-media__wrapper .ck-media__placeholder{padding:calc(3*var(--ck-spacing-standard));background:var(--ck-color-base-foreground)}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__icon{min-width:var(--ck-media-embed-placeholder-icon-size);height:var(--ck-media-embed-placeholder-icon-size);margin-bottom:var(--ck-spacing-large);background-position:50%;background-size:cover}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__icon .ck-icon{width:100%;height:100%}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url__text{color:var(--ck-color-media-embed-placeholder-url-text);white-space:nowrap;text-align:center;font-style:italic;text-overflow:ellipsis}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url__text:hover{color:var(--ck-color-media-embed-placeholder-url-text-hover);cursor:pointer;text-decoration:underline}.ck-media__wrapper[data-oembed-url*="open.spotify.com"]{max-width:300px;max-height:380px}.ck-media__wrapper[data-oembed-url*="google.com/maps"] .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNTAuMzc4IiBoZWlnaHQ9IjI1NC4xNjciIHZpZXdCb3g9IjAgMCA2Ni4yNDYgNjcuMjQ4Ij48ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTcyLjUzMSAtMjE4LjQ1NSkgc2NhbGUoLjk4MDEyKSI+PHJlY3Qgcnk9IjUuMjM4IiByeD0iNS4yMzgiIHk9IjIzMS4zOTkiIHg9IjE3Ni4wMzEiIGhlaWdodD0iNjAuMDk5IiB3aWR0aD0iNjAuMDk5IiBmaWxsPSIjMzRhNjY4IiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjxwYXRoIGQ9Ik0yMDYuNDc3IDI2MC45bC0yOC45ODcgMjguOTg3YTUuMjE4IDUuMjE4IDAgMDAzLjc4IDEuNjFoNDkuNjIxYzEuNjk0IDAgMy4xOS0uNzk4IDQuMTQ2LTIuMDM3eiIgZmlsbD0iIzVjODhjNSIvPjxwYXRoIGQ9Ik0yMjYuNzQyIDIyMi45ODhjLTkuMjY2IDAtMTYuNzc3IDcuMTctMTYuNzc3IDE2LjAxNC4wMDcgMi43NjIuNjYzIDUuNDc0IDIuMDkzIDcuODc1LjQzLjcwMy44MyAxLjQwOCAxLjE5IDIuMTA3LjMzMy41MDIuNjUgMS4wMDUuOTUgMS41MDguMzQzLjQ3Ny42NzMuOTU3Ljk4OCAxLjQ0IDEuMzEgMS43NjkgMi41IDMuNTAyIDMuNjM3IDUuMTY4Ljc5MyAxLjI3NSAxLjY4MyAyLjY0IDIuNDY2IDMuOTkgMi4zNjMgNC4wOTQgNC4wMDcgOC4wOTIgNC42IDEzLjkxNHYuMDEyYy4xODIuNDEyLjUxNi42NjYuODc5LjY2Ny40MDMtLjAwMS43NjgtLjMxNC45My0uNzk5LjYwMy01Ljc1NiAyLjIzOC05LjcyOSA0LjU4NS0xMy43OTQuNzgyLTEuMzUgMS42NzMtMi43MTUgMi40NjUtMy45OSAxLjEzNy0xLjY2NiAyLjMyOC0zLjQgMy42MzgtNS4xNjkuMzE1LS40ODIuNjQ1LS45NjIuOTg4LTEuNDM5LjMtLjUwMy42MTctMS4wMDYuOTUtMS41MDguMzU5LS43Ljc2LTEuNDA0IDEuMTktMi4xMDcgMS40MjYtMi40MDIgMi01LjExNCAyLjAwNC03Ljg3NSAwLTguODQ0LTcuNTExLTE2LjAxNC0xNi43NzYtMTYuMDE0eiIgZmlsbD0iI2RkNGIzZSIgcGFpbnQtb3JkZXI9Im1hcmtlcnMgc3Ryb2tlIGZpbGwiLz48ZWxsaXBzZSByeT0iNS41NjQiIHJ4PSI1LjgyOCIgY3k9IjIzOS4wMDIiIGN4PSIyMjYuNzQyIiBmaWxsPSIjODAyZDI3IiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjxwYXRoIGQ9Ik0xOTAuMzAxIDIzNy4yODNjLTQuNjcgMC04LjQ1NyAzLjg1My04LjQ1NyA4LjYwNnMzLjc4NiA4LjYwNyA4LjQ1NyA4LjYwN2MzLjA0MyAwIDQuODA2LS45NTggNi4zMzctMi41MTYgMS41My0xLjU1NyAyLjA4Ny0zLjkxMyAyLjA4Ny02LjI5IDAtLjM2Mi0uMDIzLS43MjItLjA2NC0xLjA3OWgtOC4yNTd2My4wNDNoNC44NWMtLjE5Ny43NTktLjUzMSAxLjQ1LTEuMDU4IDEuOTg2LS45NDIuOTU4LTIuMDI4IDEuNTQ4LTMuOTAxIDEuNTQ4LTIuODc2IDAtNS4yMDgtMi4zNzItNS4yMDgtNS4yOTkgMC0yLjkyNiAyLjMzMi01LjI5OSA1LjIwOC01LjI5OSAxLjM5OSAwIDIuNjE4LjQwNyAzLjU4NCAxLjI5M2wyLjM4MS0yLjM4YzAtLjAwMi0uMDAzLS4wMDQtLjAwNC0uMDA1LTEuNTg4LTEuNTI0LTMuNjItMi4yMTUtNS45NTUtMi4yMTV6bTQuNDMgNS42NmwuMDAzLjAwNnYtLjAwM3oiIGZpbGw9IiNmZmYiIHBhaW50LW9yZGVyPSJtYXJrZXJzIHN0cm9rZSBmaWxsIi8+PHBhdGggZD0iTTIxNS4xODQgMjUxLjkyOWwtNy45OCA3Ljk3OSAyOC40NzcgMjguNDc1YTUuMjMzIDUuMjMzIDAgMDAuNDQ5LTIuMTIzdi0zMS4xNjVjLS40NjkuNjc1LS45MzQgMS4zNDktMS4zODIgMi4wMDUtLjc5MiAxLjI3NS0xLjY4MiAyLjY0LTIuNDY1IDMuOTktMi4zNDcgNC4wNjUtMy45ODIgOC4wMzgtNC41ODUgMTMuNzk0LS4xNjIuNDg1LS41MjcuNzk4LS45My43OTktLjM2My0uMDAxLS42OTctLjI1NS0uODc5LS42Njd2LS4wMTJjLS41OTMtNS44MjItMi4yMzctOS44Mi00LjYtMTMuOTE0LS43ODMtMS4zNS0xLjY3My0yLjcxNS0yLjQ2Ni0zLjk5LTEuMTM3LTEuNjY2LTIuMzI3LTMuNC0zLjYzNy01LjE2OWwtLjAwMi0uMDAzeiIgZmlsbD0iI2MzYzNjMyIvPjxwYXRoIGQ9Ik0yMTIuOTgzIDI0OC40OTVsLTM2Ljk1MiAzNi45NTN2LjgxMmE1LjIyNyA1LjIyNyAwIDAwNS4yMzggNS4yMzhoMS4wMTVsMzUuNjY2LTM1LjY2NmExMzYuMjc1IDEzNi4yNzUgMCAwMC0yLjc2NC0zLjkgMzcuNTc1IDM3LjU3NSAwIDAwLS45ODktMS40NCAzNS4xMjcgMzUuMTI3IDAgMDAtLjk1LTEuNTA4Yy0uMDgzLS4xNjItLjE3Ni0uMzI2LS4yNjQtLjQ4OXoiIGZpbGw9IiNmZGRjNGYiIHBhaW50LW9yZGVyPSJtYXJrZXJzIHN0cm9rZSBmaWxsIi8+PHBhdGggZD0iTTIxMS45OTggMjYxLjA4M2wtNi4xNTIgNi4xNTEgMjQuMjY0IDI0LjI2NGguNzgxYTUuMjI3IDUuMjI3IDAgMDA1LjIzOS01LjIzOHYtMS4wNDV6IiBmaWxsPSIjZmZmIiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjwvZz48L3N2Zz4=)}.ck-media__wrapper[data-oembed-url*="facebook.com"] .ck-media__placeholder{background:#4268b3}.ck-media__wrapper[data-oembed-url*="facebook.com"] .ck-media__placeholder .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAyNCIgaGVpZ2h0PSIxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik05NjcuNDg0IDBINTYuNTE3QzI1LjMwNCAwIDAgMjUuMzA0IDAgNTYuNTE3djkxMC45NjZDMCA5OTguNjk0IDI1LjI5NyAxMDI0IDU2LjUyMiAxMDI0SDU0N1Y2MjhINDE0VjQ3M2gxMzNWMzU5LjAyOWMwLTEzMi4yNjIgODAuNzczLTIwNC4yODIgMTk4Ljc1Ni0yMDQuMjgyIDU2LjUxMyAwIDEwNS4wODYgNC4yMDggMTE5LjI0NCA2LjA4OVYyOTlsLTgxLjYxNi4wMzdjLTYzLjk5MyAwLTc2LjM4NCAzMC40OTItNzYuMzg0IDc1LjIzNlY0NzNoMTUzLjQ4N2wtMTkuOTg2IDE1NUg3MDd2Mzk2aDI2MC40ODRjMzEuMjEzIDAgNTYuNTE2LTI1LjMwMyA1Ni41MTYtNTYuNTE2VjU2LjUxNUMxMDI0IDI1LjMwMyA5OTguNjk3IDAgOTY3LjQ4NCAwIiBmaWxsPSIjRkZGRkZFIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ck-media__wrapper[data-oembed-url*="facebook.com"] .ck-media__placeholder .ck-media__placeholder__url__text{color:#cdf}.ck-media__wrapper[data-oembed-url*="facebook.com"] .ck-media__placeholder .ck-media__placeholder__url__text:hover{color:#fff}.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder{background:linear-gradient(-135deg,#1400c8,#b900b4,#f50000)}.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTA0IiBoZWlnaHQ9IjUwNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PGRlZnM+PHBhdGggaWQ9ImEiIGQ9Ik0wIC4xNTloNTAzLjg0MVY1MDMuOTRIMHoiLz48L2RlZnM+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48bWFzayBpZD0iYiIgZmlsbD0iI2ZmZiI+PHVzZSB4bGluazpocmVmPSIjYSIvPjwvbWFzaz48cGF0aCBkPSJNMjUxLjkyMS4xNTljLTY4LjQxOCAwLTc2Ljk5Ny4yOS0xMDMuODY3IDEuNTE2LTI2LjgxNCAxLjIyMy00NS4xMjcgNS40ODItNjEuMTUxIDExLjcxLTE2LjU2NiA2LjQzNy0zMC42MTUgMTUuMDUxLTQ0LjYyMSAyOS4wNTYtMTQuMDA1IDE0LjAwNi0yMi42MTkgMjguMDU1LTI5LjA1NiA0NC42MjEtNi4yMjggMTYuMDI0LTEwLjQ4NyAzNC4zMzctMTEuNzEgNjEuMTUxQy4yOSAxNzUuMDgzIDAgMTgzLjY2MiAwIDI1Mi4wOGMwIDY4LjQxNy4yOSA3Ni45OTYgMS41MTYgMTAzLjg2NiAxLjIyMyAyNi44MTQgNS40ODIgNDUuMTI3IDExLjcxIDYxLjE1MSA2LjQzNyAxNi41NjYgMTUuMDUxIDMwLjYxNSAyOS4wNTYgNDQuNjIxIDE0LjAwNiAxNC4wMDUgMjguMDU1IDIyLjYxOSA0NC42MjEgMjkuMDU3IDE2LjAyNCA2LjIyNyAzNC4zMzcgMTAuNDg2IDYxLjE1MSAxMS43MDkgMjYuODcgMS4yMjYgMzUuNDQ5IDEuNTE2IDEwMy44NjcgMS41MTYgNjguNDE3IDAgNzYuOTk2LS4yOSAxMDMuODY2LTEuNTE2IDI2LjgxNC0xLjIyMyA0NS4xMjctNS40ODIgNjEuMTUxLTExLjcwOSAxNi41NjYtNi40MzggMzAuNjE1LTE1LjA1MiA0NC42MjEtMjkuMDU3IDE0LjAwNS0xNC4wMDYgMjIuNjE5LTI4LjA1NSAyOS4wNTctNDQuNjIxIDYuMjI3LTE2LjAyNCAxMC40ODYtMzQuMzM3IDExLjcwOS02MS4xNTEgMS4yMjYtMjYuODcgMS41MTYtMzUuNDQ5IDEuNTE2LTEwMy44NjYgMC02OC40MTgtLjI5LTc2Ljk5Ny0xLjUxNi0xMDMuODY3LTEuMjIzLTI2LjgxNC01LjQ4Mi00NS4xMjctMTEuNzA5LTYxLjE1MS02LjQzOC0xNi41NjYtMTUuMDUyLTMwLjYxNS0yOS4wNTctNDQuNjIxLTE0LjAwNi0xNC4wMDUtMjguMDU1LTIyLjYxOS00NC42MjEtMjkuMDU2LTE2LjAyNC02LjIyOC0zNC4zMzctMTAuNDg3LTYxLjE1MS0xMS43MUMzMjguOTE3LjQ0OSAzMjAuMzM4LjE1OSAyNTEuOTIxLjE1OXptMCA0NS4zOTFjNjcuMjY1IDAgNzUuMjMzLjI1NyAxMDEuNzk3IDEuNDY5IDI0LjU2MiAxLjEyIDM3LjkwMSA1LjIyNCA0Ni43NzggOC42NzQgMTEuNzU5IDQuNTcgMjAuMTUxIDEwLjAyOSAyOC45NjYgMTguODQ1IDguODE2IDguODE1IDE0LjI3NSAxNy4yMDcgMTguODQ1IDI4Ljk2NiAzLjQ1IDguODc3IDcuNTU0IDIyLjIxNiA4LjY3NCA0Ni43NzggMS4yMTIgMjYuNTY0IDEuNDY5IDM0LjUzMiAxLjQ2OSAxMDEuNzk4IDAgNjcuMjY1LS4yNTcgNzUuMjMzLTEuNDY5IDEwMS43OTctMS4xMiAyNC41NjItNS4yMjQgMzcuOTAxLTguNjc0IDQ2Ljc3OC00LjU3IDExLjc1OS0xMC4wMjkgMjAuMTUxLTE4Ljg0NSAyOC45NjYtOC44MTUgOC44MTYtMTcuMjA3IDE0LjI3NS0yOC45NjYgMTguODQ1LTguODc3IDMuNDUtMjIuMjE2IDcuNTU0LTQ2Ljc3OCA4LjY3NC0yNi41NiAxLjIxMi0zNC41MjcgMS40NjktMTAxLjc5NyAxLjQ2OS02Ny4yNzEgMC03NS4yMzctLjI1Ny0xMDEuNzk4LTEuNDY5LTI0LjU2Mi0xLjEyLTM3LjkwMS01LjIyNC00Ni43NzgtOC42NzQtMTEuNzU5LTQuNTctMjAuMTUxLTEwLjAyOS0yOC45NjYtMTguODQ1LTguODE1LTguODE1LTE0LjI3NS0xNy4yMDctMTguODQ1LTI4Ljk2Ni0zLjQ1LTguODc3LTcuNTU0LTIyLjIxNi04LjY3NC00Ni43NzgtMS4yMTItMjYuNTY0LTEuNDY5LTM0LjUzMi0xLjQ2OS0xMDEuNzk3IDAtNjcuMjY2LjI1Ny03NS4yMzQgMS40NjktMTAxLjc5OCAxLjEyLTI0LjU2MiA1LjIyNC0zNy45MDEgOC42NzQtNDYuNzc4IDQuNTctMTEuNzU5IDEwLjAyOS0yMC4xNTEgMTguODQ1LTI4Ljk2NiA4LjgxNS04LjgxNiAxNy4yMDctMTQuMjc1IDI4Ljk2Ni0xOC44NDUgOC44NzctMy40NSAyMi4yMTYtNy41NTQgNDYuNzc4LTguNjc0IDI2LjU2NC0xLjIxMiAzNC41MzItMS40NjkgMTAxLjc5OC0xLjQ2OXoiIGZpbGw9IiNGRkYiIG1hc2s9InVybCgjYikiLz48cGF0aCBkPSJNMjUxLjkyMSAzMzYuMDUzYy00Ni4zNzggMC04My45NzQtMzcuNTk2LTgzLjk3NC04My45NzMgMC00Ni4zNzggMzcuNTk2LTgzLjk3NCA4My45NzQtODMuOTc0IDQ2LjM3NyAwIDgzLjk3MyAzNy41OTYgODMuOTczIDgzLjk3NCAwIDQ2LjM3Ny0zNy41OTYgODMuOTczLTgzLjk3MyA4My45NzN6bTAtMjEzLjMzOGMtNzEuNDQ3IDAtMTI5LjM2NSA1Ny45MTgtMTI5LjM2NSAxMjkuMzY1IDAgNzEuNDQ2IDU3LjkxOCAxMjkuMzY0IDEyOS4zNjUgMTI5LjM2NCA3MS40NDYgMCAxMjkuMzY0LTU3LjkxOCAxMjkuMzY0LTEyOS4zNjQgMC03MS40NDctNTcuOTE4LTEyOS4zNjUtMTI5LjM2NC0xMjkuMzY1ek00MTYuNjI3IDExNy42MDRjMCAxNi42OTYtMTMuNTM1IDMwLjIzLTMwLjIzMSAzMC4yMy0xNi42OTUgMC0zMC4yMy0xMy41MzQtMzAuMjMtMzAuMjMgMC0xNi42OTYgMTMuNTM1LTMwLjIzMSAzMC4yMy0zMC4yMzEgMTYuNjk2IDAgMzAuMjMxIDEzLjUzNSAzMC4yMzEgMzAuMjMxIiBmaWxsPSIjRkZGIi8+PC9nPjwvc3ZnPg==)}.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder .ck-media__placeholder__url__text{color:#ffe0fe}.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder .ck-media__placeholder__url__text:hover{color:#fff}.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck.ck-media__placeholder{background:linear-gradient(90deg,#71c6f4,#0d70a5)}.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck.ck-media__placeholder .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0MDAgNDAwIj48cGF0aCBkPSJNNDAwIDIwMGMwIDExMC41LTg5LjUgMjAwLTIwMCAyMDBTMCAzMTAuNSAwIDIwMCA4OS41IDAgMjAwIDBzMjAwIDg5LjUgMjAwIDIwMHpNMTYzLjQgMzA1LjVjODguNyAwIDEzNy4yLTczLjUgMTM3LjItMTM3LjIgMC0yLjEgMC00LjItLjEtNi4yIDkuNC02LjggMTcuNi0xNS4zIDI0LjEtMjUtOC42IDMuOC0xNy45IDYuNC0yNy43IDcuNiAxMC02IDE3LjYtMTUuNCAyMS4yLTI2LjctOS4zIDUuNS0xOS42IDkuNS0zMC42IDExLjctOC44LTkuNC0yMS4zLTE1LjItMzUuMi0xNS4yLTI2LjYgMC00OC4yIDIxLjYtNDguMiA0OC4yIDAgMy44LjQgNy41IDEuMyAxMS00MC4xLTItNzUuNi0yMS4yLTk5LjQtNTAuNC00LjEgNy4xLTYuNSAxNS40LTYuNSAyNC4yIDAgMTYuNyA4LjUgMzEuNSAyMS41IDQwLjEtNy45LS4yLTE1LjMtMi40LTIxLjgtNnYuNmMwIDIzLjQgMTYuNiA0Mi44IDM4LjcgNDcuMy00IDEuMS04LjMgMS43LTEyLjcgMS43LTMuMSAwLTYuMS0uMy05LjEtLjkgNi4xIDE5LjIgMjMuOSAzMy4xIDQ1IDMzLjUtMTYuNSAxMi45LTM3LjMgMjAuNi01OS45IDIwLjYtMy45IDAtNy43LS4yLTExLjUtLjcgMjEuMSAxMy44IDQ2LjUgMjEuOCA3My43IDIxLjgiIGZpbGw9IiNmZmYiLz48L3N2Zz4=)}.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck.ck-media__placeholder .ck-media__placeholder__url__text{color:#b8e6ff}.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck.ck-media__placeholder .ck-media__placeholder__url__text:hover{color:#fff}'},function(e,t,n){var r=n(81);"string"==typeof r&&(r=[[e.i,r,""]]),n(1)(r,{injectType:"singletonStyleTag",insert:"head",singleton:!0}),r.locals&&(e.exports=r.locals)},function(e,t){e.exports=".ck.ck-media-form{display:flex;align-items:flex-start;flex-direction:row;flex-wrap:nowrap}.ck.ck-media-form .ck-labeled-input{display:inline-block}.ck.ck-media-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-media-form{flex-wrap:wrap}.ck.ck-media-form .ck-labeled-input{flex-basis:100%}.ck.ck-media-form .ck-button{flex-basis:50%}}.ck.ck-media-form{padding:var(--ck-spacing-standard)}.ck.ck-media-form:focus{outline:none}[dir=ltr] .ck.ck-media-form>:not(:first-child),[dir=rtl] .ck.ck-media-form>:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-media-form{padding:0;width:calc(0.8*var(--ck-input-text-width))}.ck.ck-media-form .ck-labeled-input{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-media-form .ck-labeled-input .ck-input-text{min-width:0;width:100%}.ck.ck-media-form .ck-labeled-input .ck-labeled-input__error{white-space:normal}.ck.ck-media-form .ck-button{padding:var(--ck-spacing-standard);margin-top:var(--ck-spacing-standard);border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-media-form .ck-button{margin-left:0}[dir=ltr] .ck.ck-media-form .ck-button:first-of-type{border-right:1px solid var(--ck-color-base-border)}[dir=rtl] .ck.ck-media-form .ck-button{margin-left:0}[dir=rtl] .ck.ck-media-form .ck-button:last-of-type{border-right:1px solid var(--ck-color-base-border)}}"},function(e,t,n){var r=n(83);"string"==typeof r&&(r=[[e.i,r,""]]),n(1)(r,{injectType:"singletonStyleTag",insert:"head",singleton:!0}),r.locals&&(e.exports=r.locals)},function(e,t){e.exports=".ck-content .media{clear:both;margin:1em 0;display:block;min-width:15em}"},function(e,t,n){var r=n(85);"string"==typeof r&&(r=[[e.i,r,""]]),n(1)(r,{injectType:"singletonStyleTag",insert:"head",singleton:!0}),r.locals&&(e.exports=r.locals)},function(e,t){e.exports=":root{--ck-color-table-focused-cell-background:#f5fafe}.ck-widget.table td.ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck-widget.table th.ck-editor__nested-editable.ck-editor__nested-editable_focused{background:var(--ck-color-table-focused-cell-background);border-style:none;outline:1px solid var(--ck-color-focus-border);outline-offset:-1px}"},function(e,t,n){var r=n(87);"string"==typeof r&&(r=[[e.i,r,""]]),n(1)(r,{injectType:"singletonStyleTag",insert:"head",singleton:!0}),r.locals&&(e.exports=r.locals)},function(e,t){e.exports=".ck .ck-insert-table-dropdown__grid{display:flex;flex-direction:row;flex-wrap:wrap}:root{--ck-insert-table-dropdown-padding:10px;--ck-insert-table-dropdown-box-height:11px;--ck-insert-table-dropdown-box-width:12px;--ck-insert-table-dropdown-box-margin:1px}.ck .ck-insert-table-dropdown__grid{width:calc(var(--ck-insert-table-dropdown-box-width)*10 + var(--ck-insert-table-dropdown-box-margin)*20 + var(--ck-insert-table-dropdown-padding)*2);padding:var(--ck-insert-table-dropdown-padding) var(--ck-insert-table-dropdown-padding) 0}.ck .ck-insert-table-dropdown__label{text-align:center}.ck .ck-insert-table-dropdown-grid-box{width:var(--ck-insert-table-dropdown-box-width);height:var(--ck-insert-table-dropdown-box-height);margin:var(--ck-insert-table-dropdown-box-margin);border:1px solid var(--ck-color-base-border);border-radius:1px}.ck .ck-insert-table-dropdown-grid-box.ck-on{border-color:var(--ck-color-focus-border);background:var(--ck-color-focus-outer-shadow)}"},function(e,t,n){var r=n(89);"string"==typeof r&&(r=[[e.i,r,""]]),n(1)(r,{injectType:"singletonStyleTag",insert:"head",singleton:!0}),r.locals&&(e.exports=r.locals)},function(e,t){e.exports=".ck-content .table{margin:1em auto;display:table}.ck-content .table table{border-collapse:collapse;border-spacing:0;border:1px double #b3b3b3}.ck-content .table table td,.ck-content .table table th{min-width:2em;padding:.4em;border-color:#d9d9d9}.ck-content .table table th{font-weight:700;background:#fafafa}"},function(e,t,n){"use strict";var r=s.mark(ia),m=s.mark(oa),g=s.mark(Ml);n.r(t);var y=n(3),b=y.a.Symbol,k=Object.prototype,w=k.hasOwnProperty,_=k.toString,x=b?b.toStringTag:void 0,T=Object.prototype.toString,C=b?b.toStringTag:void 0,S=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":C&&C in Object(e)?function(e){var t=w.call(e,x),n=e[x];try{e[x]=void 0;var r=!0}catch(e){}var i=_.call(e);return r&&(t?e[x]=n:delete e[x]),i}(e):function(e){return T.call(e)}(e)},E=function(e,t){return function(n){return e(t(n))}},A=E(Object.getPrototypeOf,Object),P=function(e){return null!=e&&"object"==typeof e},M=Function.prototype,O=Object.prototype,N=M.toString,I=O.hasOwnProperty,D=N.call(Object),R=function(e){if(!P(e)||"[object Object]"!=S(e))return!1;var t=A(e);if(null===t)return!0;var n=I.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&N.call(n)==D},j=function(e,t){return e===t||e!=e&&t!=t},L=function(e,t){for(var n=e.length;n--;)if(j(e[n][0],t))return n;return-1},F=Array.prototype.splice;function z(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1},z.prototype.set=function(e,t){var n=this.__data__,r=L(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var V,B=z,U=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},H=function(e){if(!U(e))return!1;var t=S(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},q=y.a["__core-js_shared__"],W=(V=/[^.]+$/.exec(q&&q.keys&&q.keys.IE_PROTO||""))?"Symbol(src)_1."+V:"",Y=Function.prototype.toString,$=function(e){if(null!=e){try{return Y.call(e)}catch(e){}try{return e+""}catch(e){}}return""},G=/^\[object .+?Constructor\]$/,Q=Function.prototype,K=Object.prototype,J=Q.toString,X=K.hasOwnProperty,Z=RegExp("^"+J.call(X).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ee=function(e){return!(!U(e)||function(e){return!!W&&W in e}(e))&&(H(e)?Z:G).test($(e))},te=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return ee(n)?n:void 0},ne=te(y.a,"Map"),re=te(Object,"create"),ie=Object.prototype.hasOwnProperty,oe=Object.prototype.hasOwnProperty;function ae(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991},Ae={};Ae["[object Float32Array]"]=Ae["[object Float64Array]"]=Ae["[object Int8Array]"]=Ae["[object Int16Array]"]=Ae["[object Int32Array]"]=Ae["[object Uint8Array]"]=Ae["[object Uint8ClampedArray]"]=Ae["[object Uint16Array]"]=Ae["[object Uint32Array]"]=!0,Ae["[object Arguments]"]=Ae["[object Array]"]=Ae["[object ArrayBuffer]"]=Ae["[object Boolean]"]=Ae["[object DataView]"]=Ae["[object Date]"]=Ae["[object Error]"]=Ae["[object Function]"]=Ae["[object Map]"]=Ae["[object Number]"]=Ae["[object Object]"]=Ae["[object RegExp]"]=Ae["[object Set]"]=Ae["[object String]"]=Ae["[object WeakMap]"]=!1;var Pe=function(e){return function(t){return e(t)}},Me=n(4),Oe=Me.a&&Me.a.isTypedArray,Ne=Oe?Pe(Oe):function(e){return P(e)&&Ee(e.length)&&!!Ae[S(e)]},Ie=Object.prototype.hasOwnProperty,De=function(e,t){var n=xe(e),r=!n&&_e(e),i=!n&&!r&&Object(Te.a)(e),o=!n&&!r&&!i&&Ne(e),a=n||r||i||o,s=a?function(e,t){for(var n=-1,r=Array(e);++n3&&void 0!==arguments[3]&&arguments[3];if(R(t))this._setObjectToTarget(e,t,r);else{var i=t.split(".");t=i.pop();var o=!0,a=!1,s=void 0;try{for(var l,u=i[Symbol.iterator]();!(o=(l=u.next()).done);o=!0){var c=l.value;R(e[c])||(e[c]={}),e=e[c]}}catch(f){a=!0,s=f}finally{try{o||null==u.return||u.return()}finally{if(a)throw s}}if(R(n))return R(e[t])||(e[t]={}),e=e[t],void this._setObjectToTarget(e,n,r);r&&void 0!==e[t]||(e[t]=n)}}},{key:"_getFromSource",value:function(e,t){var n=t.split(".");t=n.pop();var r=!0,i=!1,o=void 0;try{for(var a,s=n[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var l=a.value;if(!R(e[l])){e=null;break}e=e[l]}}catch(u){i=!0,o=u}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return e?function(e){return Pt(e,Nt)}(e[t]):void 0}},{key:"_setObjectToTarget",value:function(e,t,n){var r=this;Object.keys(t).forEach((function(i){r._setToTarget(e,i,t[i],n)}))}}]),e}();function Nt(e){return Mt(e)?e:void 0}var It=n(0),Dt=function e(t,n){f(this,e),this.source=t,this.name=n,this.path=[],this.stop=function e(){e.called=!0},this.off=function e(){e.called=!0}};function Rt(){for(var e="e",t=0;t<8;t++)e+=Math.floor(65536*(1+Math.random())).toString(16).substring(1);return e}var jt={get:function(e){return"number"!=typeof e?this[e]||this.normal:e},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5};n(6);var Lt=Symbol("listeningTo"),Ft=Symbol("emitterId"),zt={on:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.listenTo(this,e,t,n)},once:function(e,t,n){var r=!1;this.listenTo(this,e,(function(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o3&&void 0!==arguments[3]?arguments[3]:{};this[Lt]||(this[Lt]={});var a=this[Lt];Bt(e)||Vt(e);var s=Bt(e);(r=a[s])||(r=a[s]={emitter:e,callbacks:{}}),(i=r.callbacks[t])||(i=r.callbacks[t]=[]),i.push(n),function(e,t){var n=Ut(e);if(!n[t]){for(var r=t,i=null,o=[];""!==r&&!n[r];)n[r]={callbacks:[],childEvents:[]},o.push(n[r]),i&&n[r].childEvents.push(i),i=r,r=r.substr(0,r.lastIndexOf(":"));if(""!==r){var a=!0,s=!1,l=void 0;try{for(var u,c=o[Symbol.iterator]();!(a=(u=c.next()).done);a=!0)u.value.callbacks=n[r].callbacks.slice()}catch(f){s=!0,l=f}finally{try{a||null==c.return||c.return()}finally{if(s)throw l}}n[r].childEvents.push(i)}}}(e,t);var l=Ht(e,t),u=jt.get(o.priority),c={callback:n,priority:u},f=!0,d=!1,h=void 0;try{for(var p,v=l[Symbol.iterator]();!(f=(p=v.next()).done);f=!0){for(var m=p.value,g=!1,y=0;y-1?e(t,n.substr(0,n.lastIndexOf(":"))):null}(this,n),i=arguments.length,o=new Array(i>1?i-1:0),a=1;a1?t-1:0),r=1;r0&&void 0!==arguments[0]?arguments[0]:{includeSelf:!1,parentFirst:!1},t=[],n=e.includeSelf?this:this.parent;n;)t[e.parentFirst?"push":"unshift"](n),n=n.parent;return t}},{key:"getCommonAncestor",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getAncestors(t),r=e.getAncestors(t),i=0;n[i]==r[i]&&n[i];)i++;return 0===i?null:n[i-1]}},{key:"isBefore",value:function(e){if(this==e)return!1;if(this.root!==e.root)return!1;var t=this.getPath(),n=e.getPath(),r=$t(t,n);switch(r){case"prefix":return!0;case"extension":return!1;default:return t[r]t.data.length)throw new It.b("view-textproxy-wrong-offsetintext: Given offsetInText value is incorrect.",this);if(r<0||n+r>t.data.length)throw new It.b("view-textproxy-wrong-length: Given length value is incorrect.",this);this.data=t.data.substring(n,n+r),this.offsetInText=n}return d(e,[{key:"is",value:function(e){return"textProxy"==e||"view:textProxy"==e}},{key:"getAncestors",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{includeSelf:!1,parentFirst:!1},t=[],n=e.includeSelf?this.textNode:this.parent;null!==n;)t[e.parentFirst?"push":"unshift"](n),n=n.parent;return t}},{key:"offsetSize",get:function(){return this.data.length}},{key:"isPartial",get:function(){return this.data.length!==this.textNode.data.length}},{key:"parent",get:function(){return this.textNode.parent}},{key:"root",get:function(){return this.textNode.root}},{key:"document",get:function(){return this.textNode.document}}]),e}();function Xt(e){var t=new Map;for(var n in e)t.set(n,e[n]);return t}function Zt(e){return!(!e||!e[Symbol.iterator])}var en=function(){function e(){f(this,e),this._patterns=[],this.add.apply(this,arguments)}return d(e,[{key:"add",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n0?e:null}},{key:"getElementName",value:function(){if(1!==this._patterns.length)return null;var e=this._patterns[0],t=e.name;return"function"==typeof e||!t||t instanceof RegExp?null:t}}]),e}();function tn(e,t){if("function"==typeof t)return t(e);var n={};return t.name&&(n.name=function(e,t){return e instanceof RegExp?e.test(t):e===t}(t.name,e.name),!n.name)?null:t.attributes&&(n.attributes=function(e,t){var n=[];for(var r in e){var i=e[r];if(!t.hasAttribute(r))return null;var o=t.getAttribute(r);if(!0===i)n.push(r);else if(i instanceof RegExp){if(!i.test(o))return null;n.push(r)}else{if(o!==i)return null;n.push(r)}}return n}(t.attributes,e),!n.attributes)?null:!(t.classes&&(n.classes=function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var l=a.value;if(l instanceof RegExp){var u=t.getClassNames(),c=!0,f=!1,d=void 0;try{for(var h,p=u[Symbol.iterator]();!(c=(h=p.next()).done);c=!0){var v=h.value;l.test(v)&&n.push(v)}}catch(m){f=!0,d=m}finally{try{c||null==p.return||p.return()}finally{if(f)throw d}}if(0===n.length)return null}else{if(!t.hasClass(l))return null;n.push(l)}}}catch(m){i=!0,o=m}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(t.classes,e),!n.classes))&&!(t.styles&&(n.styles=function(e,t){var n=[];for(var r in e){var i=e[r];if(!t.hasStyle(r))return null;var o=t.getStyle(r);if(i instanceof RegExp){if(!i.test(o))return null;n.push(r)}else{if(o!==i)return null;n.push(r)}}return n}(t.styles,e),!n.styles))&&n}var nn=function(e){function t(e,n,r){var i;if(f(this,t),(i=h(this,p(t).call(this))).name=e,i._attrs=function(e){e=R(e)?Xt(e):new Map(e);var t=!0,n=!1,r=void 0;try{for(var i,o=e[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value,s=c(a,2),l=s[0],u=s[1];null===u?e.delete(l):"string"!=typeof u&&e.set(l,String(u))}}catch(f){n=!0,r=f}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}return e}(n),i._children=[],r&&i._insertChild(0,r),i._classes=new Set,i._attrs.has("class")){var o=i._attrs.get("class");on(i._classes,o),i._attrs.delete("class")}return i._styles=new Map,i._attrs.has("style")&&(rn(i._styles,i._attrs.get("style")),i._attrs.delete("style")),i._customProperties=new Map,h(i)}return v(t,e),d(t,[{key:"is",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=e.replace(/^view:/,"");return n?"element"==r&&n==this.name:"element"==r||r==this.name||l(p(t.prototype),"is",this).call(this,e)}},{key:"getChild",value:function(e){return this._children[e]}},{key:"getChildIndex",value:function(e){return this._children.indexOf(e)}},{key:"getChildren",value:function(){return this._children[Symbol.iterator]()}},{key:"getAttributeKeys",value:s.mark((function e(){return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=this._classes.size>0,!e.t0){e.next=4;break}return e.next=4,"class";case 4:if(e.t1=this._styles.size>0,!e.t1){e.next=8;break}return e.next=8,"style";case 8:return e.delegateYield(this._attrs.keys(),"t2",9);case 9:case"end":return e.stop()}}),e,this)}))},{key:"getAttributes",value:s.mark((function e(){return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.delegateYield(this._attrs.entries(),"t0",1);case 1:if(e.t1=this._classes.size>0,!e.t1){e.next=5;break}return e.next=5,["class",this.getAttribute("class")];case 5:if(e.t2=this._styles.size>0,!e.t2){e.next=9;break}return e.next=9,["style",this.getAttribute("style")];case 9:case"end":return e.stop()}}),e,this)}))},{key:"getAttribute",value:function(e){if("class"==e)return this._classes.size>0?u(this._classes).join(" "):void 0;if("style"!=e)return this._attrs.get(e);if(this._styles.size>0){var t="",n=!0,r=!1,i=void 0;try{for(var o,a=this._styles[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value,l=c(s,2),f=l[0],d=l[1];t+="".concat(f,":").concat(d,";")}}catch(h){r=!0,i=h}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}return t}}},{key:"hasAttribute",value:function(e){return"class"==e?this._classes.size>0:"style"==e?this._styles.size>0:this._attrs.has(e)}},{key:"isSimilar",value:function(e){if(!(e instanceof t))return!1;if(this===e)return!0;if(this.name!=e.name)return!1;if(this._attrs.size!==e._attrs.size||this._classes.size!==e._classes.size||this._styles.size!==e._styles.size)return!1;var n=!0,r=!1,i=void 0;try{for(var o,a=this._attrs[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value,l=c(s,2),u=l[0],f=l[1];if(!e._attrs.has(u)||e._attrs.get(u)!==f)return!1}}catch(E){r=!0,i=E}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}var d=!0,h=!1,p=void 0;try{for(var v,m=this._classes[Symbol.iterator]();!(d=(v=m.next()).done);d=!0){var g=v.value;if(!e._classes.has(g))return!1}}catch(E){h=!0,p=E}finally{try{d||null==m.return||m.return()}finally{if(h)throw p}}var y=!0,b=!1,k=void 0;try{for(var w,_=this._styles[Symbol.iterator]();!(y=(w=_.next()).done);y=!0){var x=w.value,T=c(x,2),C=T[0],S=T[1];if(!e._styles.has(C)||e._styles.get(C)!==S)return!1}}catch(E){b=!0,k=E}finally{try{y||null==_.return||_.return()}finally{if(b)throw k}}return!0}},{key:"hasClass",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&void 0!==arguments[0]&&arguments[0],t=[];if(e){var n=!0,r=!1,i=void 0;try{for(var o,a=this.getChildren()[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;t.push(s._clone(e))}}catch(u){r=!0,i=u}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}}var l=new this.constructor(this.name,this._attrs,t);return l._classes=new Set(this._classes),l._styles=new Map(this._styles),l._customProperties=new Map(this._customProperties),l.getFillerOffset=this.getFillerOffset,l}},{key:"_appendChild",value:function(e){return this._insertChild(this.childCount,e)}},{key:"_insertChild",value:function(e,t){this._fireChange("children",this);var n=0,r=function(e){return"string"==typeof e?[new Kt(e)]:(Zt(e)||(e=[e]),Array.from(e).map((function(e){return"string"==typeof e?new Kt(e):e instanceof Jt?new Kt(e.data):e})))}(t),i=!0,o=!1,a=void 0;try{for(var s,l=r[Symbol.iterator]();!(i=(s=l.next()).done);i=!0){var u=s.value;null!==u.parent&&u._remove(),u.parent=this,this._children.splice(e,0,u),e++,n++}}catch(c){o=!0,a=c}finally{try{i||null==l.return||l.return()}finally{if(o)throw a}}return n}},{key:"_removeChildren",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this._fireChange("children",this);for(var n=e;n0&&(this._classes.clear(),!0):"style"==e?this._styles.size>0&&(this._styles.clear(),!0):this._attrs.delete(e)}},{key:"_addClass",value:function(e){var t=this;this._fireChange("attributes",this),(e=Array.isArray(e)?e:[e]).forEach((function(e){return t._classes.add(e)}))}},{key:"_removeClass",value:function(e){var t=this;this._fireChange("attributes",this),(e=Array.isArray(e)?e:[e]).forEach((function(e){return t._classes.delete(e)}))}},{key:"_setStyle",value:function(e,t){if(this._fireChange("attributes",this),R(e))for(var n=0,r=Object.keys(e);n1&&void 0!==arguments[1]?arguments[1]:null,r=e&&e.replace(/^view:/,"");return n?"containerElement"==r&&n==this.name||l(p(t.prototype),"is",this).call(this,e,n):"containerElement"==r||l(p(t.prototype),"is",this).call(this,e)}}]),t}(nn);function sn(){var e=u(this.getChildren()),t=e[this.childCount-1];if(t&&t.is("element","br"))return this.childCount;var n=!0,r=!1,i=void 0;try{for(var o,a=e[Symbol.iterator]();!(n=(o=a.next()).done);n=!0)if(!o.value.is("uiElement"))return null}catch(s){r=!0,i=s}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}return this.childCount}var ln=function(e){return e},un=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)},cn=Math.max,fn=function(e){return function(){return e}},dn=he?function(e,t){return he(e,"toString",{configurable:!0,enumerable:!1,value:fn(t),writable:!0})}:ln,hn=Date.now,pn=function(e){var t=0,n=0;return function(){var r=hn(),i=16-(r-n);if(n=r,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(dn),vn=function(e,t){return pn(function(e,t,n){return t=cn(void 0===t?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=cn(r.length-t,0),a=Array(o);++i1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,a&&function(e,t,n){if(!U(n))return!1;var r=typeof t;return!!("number"==r?ze(n)&&Se(t,n.length):"string"==r&&t in n)&&j(n[t],e)}(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),t=Object(t);++r1)throw new It.b("observable-bind-to-no-callback: Binding multiple observables only possible with callback.",this);if(i>1&&n.callback)throw new It.b("observable-bind-to-extra-callback: Cannot bind multiple properties and use a callback in one binding.",this);n.to.forEach((function(e){if(e.properties.length&&e.properties.length!==i)throw new It.b("observable-bind-to-properties-length: The number of properties must match.",t);e.properties.length||(e.properties=t._bindProperties)})),this._to=n.to,n.callback&&(this._bindings.get(r[0]).callback=n.callback),e=this._observable,this._to.forEach((function(t){var n,r=e[yn];r.get(t.observable)||e.listenTo(t.observable,"change",(function(i,o){(n=r.get(t.observable)[o])&&n.forEach((function(t){Sn(e,t.property)}))}))})),function(e){var t;e._bindings.forEach((function(n,r){e._to.forEach((function(i){t=i.properties[n.callback?0:e._bindProperties.indexOf(r)],n.to.push([i.observable,t]),function(e,t,n,r){var i=e[yn],o=i.get(n),a=o||{};a[r]||(a[r]=new Set),a[r].add(t),o||i.set(n,a)}(e._observable,n,i.observable,t)}))}))}(this),this._bindProperties.forEach((function(e){Sn(t._observable,e)}))}function Tn(e,t,n){if(this._bindings.size>1)throw new It.b("observable-bind-to-many-not-one-binding: Cannot bind multiple properties with toMany().",this);this.to.apply(this,u(function(e,t){var n=e.map((function(e){return[e,t]}));return Array.prototype.concat.apply([],n)}(e,t)).concat([n]))}function Cn(e){return e.every((function(e){return"string"==typeof e}))}function Sn(e,t){var n,r=e[bn].get(t);n=r.callback?r.callback.apply(e,r.to.map((function(e){return e[0][e[1]]}))):(n=r.to[0])[0][n[1]],e.hasOwnProperty(t)?e[t]=n:e.set(t,n)}var En=Symbol("document"),An=function(e){function t(e,n,r){var i;return f(this,t),(i=h(this,p(t).call(this,e,n,r))).set("isReadOnly",!1),i.set("isFocused",!1),i}return v(t,e),d(t,[{key:"is",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=e&&e.replace(/^view:/,"");return n?"editableElement"==r&&n==this.name||l(p(t.prototype),"is",this).call(this,e,n):"editableElement"==r||l(p(t.prototype),"is",this).call(this,e)}},{key:"destroy",value:function(){this.stopListening()}},{key:"document",get:function(){return this.getCustomProperty(En)}},{key:"_document",set:function(e){var t=this;if(this.getCustomProperty(En))throw new It.b("view-editableelement-document-already-set: View document is already set.",this);this._setCustomProperty(En,e),this.bind("isReadOnly").to(e),this.bind("isFocused").to(e,"isFocused",(function(n){return n&&e.selection.editableElement==t})),this.listenTo(e.selection,"change",(function(){t.isFocused=e.isFocused&&e.selection.editableElement==t}))}}]),t}(an);Yt(An,wn);var Pn=Symbol("rootName"),Mn=function(e){function t(e){var n;return f(this,t),(n=h(this,p(t).call(this,e))).rootName="main",n}return v(t,e),d(t,[{key:"is",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=e.replace(/^view:/,"");return n?"rootElement"==r&&n==this.name||l(p(t.prototype),"is",this).call(this,e,n):"rootElement"==r||l(p(t.prototype),"is",this).call(this,e)}},{key:"rootName",get:function(){return this.getCustomProperty(Pn)},set:function(e){this._setCustomProperty(Pn,e)}},{key:"_name",set:function(e){this.name=e}}]),t}(An),On=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(f(this,e),!t.boundaries&&!t.startPosition)throw new It.b("view-tree-walker-no-start-position: Neither boundaries nor starting position have been defined.",null);if(t.direction&&"forward"!=t.direction&&"backward"!=t.direction)throw new It.b("view-tree-walker-unknown-direction: Only `backward` and `forward` direction allowed.",t.startPosition,{direction:t.direction});this.boundaries=t.boundaries||null,t.startPosition?this.position=Nn._createAt(t.startPosition):this.position=Nn._createAt(t.boundaries["backward"==t.direction?"end":"start"]),this.direction=t.direction||"forward",this.singleCharacters=!!t.singleCharacters,this.shallow=!!t.shallow,this.ignoreElementEnd=!!t.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null}return d(e,[{key:Symbol.iterator,value:function(){return this}},{key:"skip",value:function(e){var t,n,r;do{var i;r=this.position,t=(i=this.next()).done,n=i.value}while(!t&&e(n));t||(this.position=r)}},{key:"next",value:function(){return"forward"==this.direction?this._next():this._previous()}},{key:"_next",value:function(){var e,t=this.position.clone(),n=this.position,r=t.parent;if(null===r.parent&&t.offset===r.childCount)return{done:!0};if(r===this._boundaryEndParent&&t.offset==this.boundaries.end.offset)return{done:!0};if(r instanceof Kt){if(t.isAtEnd)return this.position=Nn._createAfter(r),this._next();e=r.data[t.offset]}else e=r.getChild(t.offset);if(e instanceof nn)return this.shallow?t.offset++:t=new Nn(e,0),this.position=t,this._formatReturnValue("elementStart",e,n,t,1);if(e instanceof Kt){if(this.singleCharacters)return t=new Nn(e,0),this.position=t,this._next();var i,o=e.data.length;return e==this._boundaryEndParent?(o=this.boundaries.end.offset,i=new Jt(e,0,o),t=Nn._createAfter(i)):(i=new Jt(e,0,e.data.length),t.offset++),this.position=t,this._formatReturnValue("text",i,n,t,o)}if("string"==typeof e){var a;a=this.singleCharacters?1:(r===this._boundaryEndParent?this.boundaries.end.offset:r.data.length)-t.offset;var s=new Jt(r,t.offset,a);return t.offset+=a,this.position=t,this._formatReturnValue("text",s,n,t,a)}return t=Nn._createAfter(r),this.position=t,this.ignoreElementEnd?this._next():this._formatReturnValue("elementEnd",r,n,t)}},{key:"_previous",value:function(){var e,t=this.position.clone(),n=this.position,r=t.parent;if(null===r.parent&&0===t.offset)return{done:!0};if(r==this._boundaryStartParent&&t.offset==this.boundaries.start.offset)return{done:!0};if(r instanceof Kt){if(t.isAtStart)return this.position=Nn._createBefore(r),this._previous();e=r.data[t.offset-1]}else e=r.getChild(t.offset-1);if(e instanceof nn)return this.shallow?(t.offset--,this.position=t,this._formatReturnValue("elementStart",e,n,t,1)):(t=new Nn(e,e.childCount),this.position=t,this.ignoreElementEnd?this._previous():this._formatReturnValue("elementEnd",e,n,t));if(e instanceof Kt){if(this.singleCharacters)return t=new Nn(e,e.data.length),this.position=t,this._previous();var i,o=e.data.length;if(e==this._boundaryStartParent){var a=this.boundaries.start.offset;o=(i=new Jt(e,a,e.data.length-a)).data.length,t=Nn._createBefore(i)}else i=new Jt(e,0,e.data.length),t.offset--;return this.position=t,this._formatReturnValue("text",i,n,t,o)}if("string"==typeof e){var s;if(this.singleCharacters)s=1;else{var l=r===this._boundaryStartParent?this.boundaries.start.offset:0;s=t.offset-l}t.offset-=s;var u=new Jt(r,t.offset,s);return this.position=t,this._formatReturnValue("text",u,n,t,s)}return t=Nn._createBefore(r),this.position=t,this._formatReturnValue("elementStart",r,n,t,1)}},{key:"_formatReturnValue",value:function(e,t,n,r,i){return t instanceof Jt&&(t.offsetInText+t.data.length==t.textNode.data.length&&("forward"!=this.direction||this.boundaries&&this.boundaries.end.isEqual(this.position)?n=Nn._createAfter(t.textNode):(r=Nn._createAfter(t.textNode),this.position=r)),0===t.offsetInText&&("backward"!=this.direction||this.boundaries&&this.boundaries.start.isEqual(this.position)?n=Nn._createBefore(t.textNode):(r=Nn._createBefore(t.textNode),this.position=r))),{done:!1,value:{type:e,item:t,previousPosition:n,nextPosition:r,length:i}}}}]),e}(),Nn=function(){function e(t,n){f(this,e),this.parent=t,this.offset=n}return d(e,[{key:"getShiftedBy",value:function(t){var n=e._createAt(this),r=n.offset+t;return n.offset=r<0?0:r,n}},{key:"getLastMatchingPosition",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.startPosition=this;var n=new On(t);return n.skip(e),n.position}},{key:"getAncestors",value:function(){return this.parent.is("documentFragment")?[this.parent]:this.parent.getAncestors({includeSelf:!0})}},{key:"getCommonAncestor",value:function(e){for(var t=this.getAncestors(),n=e.getAncestors(),r=0;t[r]==n[r]&&t[r];)r++;return 0===r?null:t[r-1]}},{key:"is",value:function(e){return"position"==e||"view:position"==e}},{key:"isEqual",value:function(e){return this.parent==e.parent&&this.offset==e.offset}},{key:"isBefore",value:function(e){return"before"==this.compareWith(e)}},{key:"isAfter",value:function(e){return"after"==this.compareWith(e)}},{key:"compareWith",value:function(e){if(this.root!==e.root)return"different";if(this.isEqual(e))return"same";var t=this.parent.is("node")?this.parent.getPath():[],n=e.parent.is("node")?e.parent.getPath():[];t.push(this.offset),n.push(e.offset);var r=$t(t,n);switch(r){case"prefix":return"before";case"extension":return"after";default:return t[r]0&&void 0!==arguments[0]?arguments[0]:{};return e.startPosition=this,new On(e)}},{key:"clone",value:function(){return new e(this.parent,this.offset)}},{key:"nodeAfter",get:function(){return this.parent.is("text")?null:this.parent.getChild(this.offset)||null}},{key:"nodeBefore",get:function(){return this.parent.is("text")?null:this.parent.getChild(this.offset-1)||null}},{key:"isAtStart",get:function(){return 0===this.offset}},{key:"isAtEnd",get:function(){var e=this.parent.is("text")?this.parent.data.length:this.parent.childCount;return this.offset===e}},{key:"root",get:function(){return this.parent.root}},{key:"editableElement",get:function(){for(var e=this.parent;!(e instanceof An);){if(!e.parent)return null;e=e.parent}return e}}],[{key:"_createAt",value:function(t,n){if(t instanceof e)return new this(t.parent,t.offset);var r=t;if("end"==n)n=r.is("text")?r.data.length:r.childCount;else{if("before"==n)return this._createBefore(r);if("after"==n)return this._createAfter(r);if(0!==n&&!n)throw new It.b("view-createPositionAt-offset-required: View#createPositionAt() requires the offset when the first parameter is a view item.",r)}return new e(r,n)}},{key:"_createAfter",value:function(t){if(t.is("textProxy"))return new e(t.textNode,t.offsetInText+t.data.length);if(!t.parent)throw new It.b("view-position-after-root: You can not make position after root.",t,{root:t});return new e(t.parent,t.index+1)}},{key:"_createBefore",value:function(t){if(t.is("textProxy"))return new e(t.textNode,t.offsetInText);if(!t.parent)throw new It.b("view-position-before-root: You can not make position before root.",t,{root:t});return new e(t.parent,t.index)}}]),e}(),In=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;f(this,e),this.start=t.clone(),this.end=n?n.clone():t.clone()}return d(e,[{key:Symbol.iterator,value:s.mark((function e(){return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.delegateYield(new On({boundaries:this,ignoreElementEnd:!0}),"t0",1);case 1:case"end":return e.stop()}}),e,this)}))},{key:"getEnlarged",value:function(){var t=this.start.getLastMatchingPosition(Dn,{direction:"backward"}),n=this.end.getLastMatchingPosition(Dn);return t.parent.is("text")&&t.isAtStart&&(t=Nn._createBefore(t.parent)),n.parent.is("text")&&n.isAtEnd&&(n=Nn._createAfter(n.parent)),new e(t,n)}},{key:"getTrimmed",value:function(){var t=this.start.getLastMatchingPosition(Dn);if(t.isAfter(this.end)||t.isEqual(this.end))return new e(t,t);var n=this.end.getLastMatchingPosition(Dn,{direction:"backward"}),r=t.nodeAfter,i=n.nodeBefore;return r&&r.is("text")&&(t=new Nn(r,0)),i&&i.is("text")&&(n=new Nn(i,i.data.length)),new e(t,n)}},{key:"isEqual",value:function(e){return this==e||this.start.isEqual(e.start)&&this.end.isEqual(e.end)}},{key:"containsPosition",value:function(e){return e.isAfter(this.start)&&e.isBefore(this.end)}},{key:"containsRange",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e.isCollapsed&&(t=!1);var n=this.containsPosition(e.start)||t&&this.start.isEqual(e.start),r=this.containsPosition(e.end)||t&&this.end.isEqual(e.end);return n&&r}},{key:"getDifference",value:function(t){var n=[];return this.isIntersecting(t)?(this.containsPosition(t.start)&&n.push(new e(this.start,t.start)),this.containsPosition(t.end)&&n.push(new e(t.end,this.end))):n.push(this.clone()),n}},{key:"getIntersection",value:function(t){if(this.isIntersecting(t)){var n=this.start,r=this.end;return this.containsPosition(t.start)&&(n=t.start),this.containsPosition(t.end)&&(r=t.end),new e(n,r)}return null}},{key:"getWalker",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.boundaries=this,new On(e)}},{key:"getCommonAncestor",value:function(){return this.start.getCommonAncestor(this.end)}},{key:"clone",value:function(){return new e(this.start,this.end)}},{key:"getItems",value:s.mark((function e(){var t,n,r,i,o,a,l,u,c=arguments;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(t=c.length>0&&void 0!==c[0]?c[0]:{}).boundaries=this,t.ignoreElementEnd=!0,n=new On(t),r=!0,i=!1,o=void 0,e.prev=6,a=n[Symbol.iterator]();case 8:if(r=(l=a.next()).done){e.next=15;break}return u=l.value,e.next=12,u.item;case 12:r=!0,e.next=8;break;case 15:e.next=21;break;case 17:e.prev=17,e.t0=e.catch(6),i=!0,o=e.t0;case 21:e.prev=21,e.prev=22,r||null==a.return||a.return();case 24:if(e.prev=24,!i){e.next=27;break}throw o;case 27:return e.finish(24);case 28:return e.finish(21);case 29:case"end":return e.stop()}}),e,this,[[6,17,21,29],[22,,24,28]])}))},{key:"getPositions",value:s.mark((function e(){var t,n,r,i,o,a,l,u,c=arguments;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(t=c.length>0&&void 0!==c[0]?c[0]:{}).boundaries=this,n=new On(t),e.next=5,n.position;case 5:r=!0,i=!1,o=void 0,e.prev=8,a=n[Symbol.iterator]();case 10:if(r=(l=a.next()).done){e.next=17;break}return u=l.value,e.next=14,u.nextPosition;case 14:r=!0,e.next=10;break;case 17:e.next=23;break;case 19:e.prev=19,e.t0=e.catch(8),i=!0,o=e.t0;case 23:e.prev=23,e.prev=24,r||null==a.return||a.return();case 26:if(e.prev=26,!i){e.next=29;break}throw o;case 29:return e.finish(26);case 30:return e.finish(23);case 31:case"end":return e.stop()}}),e,this,[[8,19,23,31],[24,,26,30]])}))},{key:"is",value:function(e){return"range"==e||"view:range"==e}},{key:"isIntersecting",value:function(e){return this.start.isBefore(e.end)&&this.end.isAfter(e.start)}},{key:"isCollapsed",get:function(){return this.start.isEqual(this.end)}},{key:"isFlat",get:function(){return this.start.parent===this.end.parent}},{key:"root",get:function(){return this.start.root}}],[{key:"_createFromParentsAndOffsets",value:function(e,t,n,r){return new this(new Nn(e,t),new Nn(n,r))}},{key:"_createFromPositionAndShift",value:function(e,t){var n=e,r=e.getShiftedBy(t);return t>0?new this(n,r):new this(r,n)}},{key:"_createIn",value:function(e){return this._createFromParentsAndOffsets(e,0,e,e.childCount)}},{key:"_createOn",value:function(e){var t=e.is("textProxy")?e.offsetSize:1;return this._createFromPositionAndShift(Nn._createBefore(e),t)}}]),e}();function Dn(e){return!(!e.item.is("attributeElement")&&!e.item.is("uiElement"))}function Rn(e){var t=0,n=!0,r=!1,i=void 0;try{for(var o,a=e[Symbol.iterator]();!(n=(o=a.next()).done);n=!0)o.value,t++}catch(s){r=!0,i=s}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}return t}var jn=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;f(this,e),this._ranges=[],this._lastRangeBackward=!1,this._isFake=!1,this._fakeSelectionLabel="",this.setTo(t,n,r)}return d(e,[{key:"getRanges",value:s.mark((function e(){var t,n,r,i,o,a;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=!0,n=!1,r=void 0,e.prev=3,i=this._ranges[Symbol.iterator]();case 5:if(t=(o=i.next()).done){e.next=12;break}return a=o.value,e.next=9,a.clone();case 9:t=!0,e.next=5;break;case 12:e.next=18;break;case 14:e.prev=14,e.t0=e.catch(3),n=!0,r=e.t0;case 18:e.prev=18,e.prev=19,t||null==i.return||i.return();case 21:if(e.prev=21,!n){e.next=24;break}throw r;case 24:return e.finish(21);case 25:return e.finish(18);case 26:case"end":return e.stop()}}),e,this,[[3,14,18,26],[19,,21,25]])}))},{key:"getFirstRange",value:function(){var e=null,t=!0,n=!1,r=void 0;try{for(var i,o=this._ranges[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value;e&&!a.start.isBefore(e.start)||(e=a)}}catch(s){n=!0,r=s}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}return e?e.clone():null}},{key:"getLastRange",value:function(){var e=null,t=!0,n=!1,r=void 0;try{for(var i,o=this._ranges[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value;e&&!a.end.isAfter(e.end)||(e=a)}}catch(s){n=!0,r=s}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}return e?e.clone():null}},{key:"getFirstPosition",value:function(){var e=this.getFirstRange();return e?e.start.clone():null}},{key:"getLastPosition",value:function(){var e=this.getLastRange();return e?e.end.clone():null}},{key:"isEqual",value:function(e){if(this.isFake!=e.isFake)return!1;if(this.isFake&&this.fakeSelectionLabel!=e.fakeSelectionLabel)return!1;if(this.rangeCount!=e.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(e.anchor)||!this.focus.isEqual(e.focus))return!1;var t=!0,n=!1,r=void 0;try{for(var i,o=this._ranges[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value,s=!1,l=!0,u=!1,c=void 0;try{for(var f,d=e._ranges[Symbol.iterator]();!(l=(f=d.next()).done);l=!0){var h=f.value;if(a.isEqual(h)){s=!0;break}}}catch(p){u=!0,c=p}finally{try{l||null==d.return||d.return()}finally{if(u)throw c}}if(!s)return!1}}catch(p){n=!0,r=p}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}return!0}},{key:"isSimilar",value:function(e){if(this.isBackward!=e.isBackward)return!1;var t=Rn(this.getRanges());if(t!=Rn(e.getRanges()))return!1;if(0==t)return!0;var n=!0,r=!1,i=void 0;try{for(var o,a=this.getRanges()[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;s=s.getTrimmed();var l=!1,u=!0,c=!1,f=void 0;try{for(var d,h=e.getRanges()[Symbol.iterator]();!(u=(d=h.next()).done);u=!0){var p=d.value;if(p=p.getTrimmed(),s.start.isEqual(p.start)&&s.end.isEqual(p.end)){l=!0;break}}}catch(v){c=!0,f=v}finally{try{u||null==h.return||h.return()}finally{if(c)throw f}}if(!l)return!1}}catch(v){r=!0,i=v}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}return!0}},{key:"getSelectedElement",value:function(){if(1!==this.rangeCount)return null;var e=this.getFirstRange(),t=e.start.nodeAfter,n=e.end.nodeBefore;return e.start.parent.is("text")&&e.start.isAtEnd&&e.start.parent.nextSibling&&(t=e.start.parent.nextSibling),e.end.parent.is("text")&&e.end.isAtStart&&e.end.parent.previousSibling&&(n=e.end.parent.previousSibling),t instanceof nn&&t==n?t:null}},{key:"setTo",value:function(t,n,r){if(null===t)this._setRanges([]),this._setFakeOptions(n);else if(t instanceof e||t instanceof Ln)this._setRanges(t.getRanges(),t.isBackward),this._setFakeOptions({fake:t.isFake,label:t.fakeSelectionLabel});else if(t instanceof In)this._setRanges([t],n&&n.backward),this._setFakeOptions(n);else if(t instanceof Nn)this._setRanges([new In(t)]),this._setFakeOptions(n);else if(t instanceof Qt){var i,o=!!r&&!!r.backward;if(void 0===n)throw new It.b("view-selection-setTo-required-second-parameter: selection.setTo requires the second parameter when the first parameter is a node.",this);i="in"==n?In._createIn(t):"on"==n?In._createOn(t):new In(Nn._createAt(t,n)),this._setRanges([i],o),this._setFakeOptions(r)}else{if(!Zt(t))throw new It.b("view-selection-setTo-not-selectable: Cannot set selection to given place.",this);this._setRanges(t,n&&n.backward),this._setFakeOptions(n)}this.fire("change")}},{key:"setFocus",value:function(e,t){if(null===this.anchor)throw new It.b("view-selection-setFocus-no-ranges: Cannot set selection focus if there are no ranges in selection.",this);var n=Nn._createAt(e,t);if("same"!=n.compareWith(this.focus)){var r=this.anchor;this._ranges.pop(),"before"==n.compareWith(r)?this._addRange(new In(n,r),!0):this._addRange(new In(r,n)),this.fire("change")}}},{key:"is",value:function(e){return"selection"==e||"view:selection"==e}},{key:"_setRanges",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e=Array.from(e),this._ranges=[];var n=!0,r=!1,i=void 0;try{for(var o,a=e[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;this._addRange(s)}}catch(l){r=!0,i=l}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}this._lastRangeBackward=!!t}},{key:"_setFakeOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._isFake=!!e.fake,this._fakeSelectionLabel=e.fake&&e.label||""}},{key:"_addRange",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!(e instanceof In))throw new It.b("view-selection-add-range-not-range: Selection range set to an object that is not an instance of view.Range",this);this._pushRange(e),this._lastRangeBackward=!!t}},{key:"_pushRange",value:function(e){var t=!0,n=!1,r=void 0;try{for(var i,o=this._ranges[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value;if(e.isIntersecting(a))throw new It.b("view-selection-range-intersects: Trying to add a range that intersects with another range from selection.",this,{addedRange:e,intersectingRange:a})}}catch(s){n=!0,r=s}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}this._ranges.push(new In(e.start,e.end))}},{key:"isFake",get:function(){return this._isFake}},{key:"fakeSelectionLabel",get:function(){return this._fakeSelectionLabel}},{key:"anchor",get:function(){if(!this._ranges.length)return null;var e=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?e.end:e.start).clone()}},{key:"focus",get:function(){if(!this._ranges.length)return null;var e=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?e.start:e.end).clone()}},{key:"isCollapsed",get:function(){return 1===this.rangeCount&&this._ranges[0].isCollapsed}},{key:"rangeCount",get:function(){return this._ranges.length}},{key:"isBackward",get:function(){return!this.isCollapsed&&this._lastRangeBackward}},{key:"editableElement",get:function(){return this.anchor?this.anchor.editableElement:null}}]),e}();Yt(jn,zt);var Ln=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;f(this,e),this._selection=new jn,this._selection.delegate("change").to(this),this._selection.setTo(t,n,r)}return d(e,[{key:"getRanges",value:s.mark((function e(){return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.delegateYield(this._selection.getRanges(),"t0",1);case 1:case"end":return e.stop()}}),e,this)}))},{key:"getFirstRange",value:function(){return this._selection.getFirstRange()}},{key:"getLastRange",value:function(){return this._selection.getLastRange()}},{key:"getFirstPosition",value:function(){return this._selection.getFirstPosition()}},{key:"getLastPosition",value:function(){return this._selection.getLastPosition()}},{key:"getSelectedElement",value:function(){return this._selection.getSelectedElement()}},{key:"isEqual",value:function(e){return this._selection.isEqual(e)}},{key:"isSimilar",value:function(e){return this._selection.isSimilar(e)}},{key:"is",value:function(e){return"selection"==e||"documentSelection"==e||"view:selection"==e||"view:documentSelection"==e}},{key:"_setTo",value:function(e,t,n){this._selection.setTo(e,t,n)}},{key:"_setFocus",value:function(e,t){this._selection.setFocus(e,t)}},{key:"isFake",get:function(){return this._selection.isFake}},{key:"fakeSelectionLabel",get:function(){return this._selection.fakeSelectionLabel}},{key:"anchor",get:function(){return this._selection.anchor}},{key:"focus",get:function(){return this._selection.focus}},{key:"isCollapsed",get:function(){return this._selection.isCollapsed}},{key:"rangeCount",get:function(){return this._selection.rangeCount}},{key:"isBackward",get:function(){return this._selection.isBackward}},{key:"editableElement",get:function(){return this._selection.editableElement}},{key:"_ranges",get:function(){return this._selection._ranges}}]),e}();Yt(Ln,zt);var Fn=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};f(this,e),this._items=[],this._itemMap=new Map,this._idProperty=t.idProperty||"id",this._bindToExternalToInternalMap=new WeakMap,this._bindToInternalToExternalMap=new WeakMap,this._skippedIndexesFromExternal=[]}return d(e,[{key:"add",value:function(e,t){var n,r=this._idProperty;if(r in e){if("string"!=typeof(n=e[r]))throw new It.b("collection-add-invalid-id",this);if(this.get(n))throw new It.b("collection-add-item-already-exists",this)}else e[r]=n=Rt();if(void 0===t)t=this._items.length;else if(t>this._items.length||t<0)throw new It.b("collection-add-item-invalid-index",this);return this._items.splice(t,0,e),this._itemMap.set(n,e),this.fire("add",e,t),this}},{key:"get",value:function(e){var t;if("string"==typeof e)t=this._itemMap.get(e);else{if("number"!=typeof e)throw new It.b("collection-get-invalid-arg: Index or id must be given.",this);t=this._items[e]}return t||null}},{key:"has",value:function(e){if("string"==typeof e)return this._itemMap.has(e);var t=e[this._idProperty];return this._itemMap.has(t)}},{key:"getIndex",value:function(e){var t;return t="string"==typeof e?this._itemMap.get(e):e,this._items.indexOf(t)}},{key:"remove",value:function(e){var t,n,r,i=!1,o=this._idProperty;if("string"==typeof e?(n=e,i=!(r=this._itemMap.get(n)),r&&(t=this._items.indexOf(r))):"number"==typeof e?(t=e,i=!(r=this._items[t]),r&&(n=r[o])):(n=(r=e)[o],i=-1==(t=this._items.indexOf(r))||!this._itemMap.get(n)),i)throw new It.b("collection-remove-404: Item not found.",this);this._items.splice(t,1),this._itemMap.delete(n);var a=this._bindToInternalToExternalMap.get(r);return this._bindToInternalToExternalMap.delete(r),this._bindToExternalToInternalMap.delete(a),this.fire("remove",r,t),r}},{key:"map",value:function(e,t){return this._items.map(e,t)}},{key:"find",value:function(e,t){return this._items.find(e,t)}},{key:"filter",value:function(e,t){return this._items.filter(e,t)}},{key:"clear",value:function(){for(this._bindToCollection&&(this.stopListening(this._bindToCollection),this._bindToCollection=null);this.length;)this.remove(0)}},{key:"bindTo",value:function(e){var t=this;if(this._bindToCollection)throw new It.b("collection-bind-to-rebind: The collection cannot be bound more than once.",this);return this._bindToCollection=e,{as:function(e){t._setUpBindToBinding((function(t){return new e(t)}))},using:function(e){"function"==typeof e?t._setUpBindToBinding((function(t){return e(t)})):t._setUpBindToBinding((function(t){return t[e]}))}}}},{key:"_setUpBindToBinding",value:function(e){var t=this,n=this._bindToCollection,r=function(r,i,o){var a=n._bindToCollection==t,s=n._bindToInternalToExternalMap.get(i);if(a&&s)t._bindToExternalToInternalMap.set(i,s),t._bindToInternalToExternalMap.set(s,i);else{var l=e(i);if(!l)return void t._skippedIndexesFromExternal.push(o);var u=o,c=!0,f=!1,d=void 0;try{for(var h,p=t._skippedIndexesFromExternal[Symbol.iterator]();!(c=(h=p.next()).done);c=!0)o>h.value&&u--}catch(w){f=!0,d=w}finally{try{c||null==p.return||p.return()}finally{if(f)throw d}}var v=!0,m=!1,g=void 0;try{for(var y,b=n._skippedIndexesFromExternal[Symbol.iterator]();!(v=(y=b.next()).done);v=!0)u>=y.value&&u++}catch(w){m=!0,g=w}finally{try{v||null==b.return||b.return()}finally{if(m)throw g}}t._bindToExternalToInternalMap.set(i,l),t._bindToInternalToExternalMap.set(l,i),t.add(l,u);for(var k=0;kt&&e.push(t),e}),[])}))}},{key:Symbol.iterator,value:function(){return this._items[Symbol.iterator]()}},{key:"length",get:function(){return this._items.length}},{key:"first",get:function(){return this._items[0]||null}},{key:"last",get:function(){return this._items[this.length-1]||null}}]),e}();Yt(Fn,zt);var zn=function(){function e(){f(this,e),this.selection=new Ln,this.roots=new Fn({idProperty:"rootName"}),this.set("isReadOnly",!1),this.set("isFocused",!1),this.set("isComposing",!1),this._postFixers=new Set}return d(e,[{key:"getRoot",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"main";return this.roots.get(e)}},{key:"registerPostFixer",value:function(e){this._postFixers.add(e)}},{key:"destroy",value:function(){this.roots.map((function(e){return e.destroy()})),this.stopListening()}},{key:"_callPostFixers",value:function(e){var t=!1;do{var n=!0,r=!1,i=void 0;try{for(var o,a=this._postFixers[Symbol.iterator]();!(n=(o=a.next()).done)&&!(t=(0,o.value)(e));n=!0);}catch(s){r=!0,i=s}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}}while(t)}}]),e}();Yt(zn,wn);var Vn=10,Bn=function(e){function t(e,n,r){var i;return f(this,t),(i=h(this,p(t).call(this,e,n,r))).getFillerOffset=Un,i._priority=Vn,i._id=null,i._clonesGroup=null,i}return v(t,e),d(t,[{key:"getElementsWithSameId",value:function(){if(null===this.id)throw new It.b("attribute-element-get-elements-with-same-id-no-id: Cannot get elements with the same id for an attribute element without id.",this);return new Set(this._clonesGroup)}},{key:"is",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=e&&e.replace(/^view:/,"");return n?"attributeElement"==r&&n==this.name||l(p(t.prototype),"is",this).call(this,e,n):"attributeElement"==r||l(p(t.prototype),"is",this).call(this,e)}},{key:"isSimilar",value:function(e){return null!==this.id||null!==e.id?this.id===e.id:l(p(t.prototype),"isSimilar",this).call(this,e)&&this.priority==e.priority}},{key:"_clone",value:function(e){var n=l(p(t.prototype),"_clone",this).call(this,e);return n._priority=this._priority,n._id=this._id,n}},{key:"priority",get:function(){return this._priority}},{key:"id",get:function(){return this._id}}]),t}(nn);function Un(){if(Hn(this))return null;for(var e=this.parent;e&&e.is("attributeElement");){if(Hn(e)>1)return null;e=e.parent}return!e||Hn(e)>1?null:this.childCount}function Hn(e){return Array.from(e.getChildren()).filter((function(e){return!e.is("uiElement")})).length}Bn.DEFAULT_PRIORITY=Vn;var qn=function(e){function t(e,n,r){var i;return f(this,t),(i=h(this,p(t).call(this,e,n,r))).getFillerOffset=Wn,i}return v(t,e),d(t,[{key:"is",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=e.replace(/^view:/,"");return n?"emptyElement"==r&&n==this.name||l(p(t.prototype),"is",this).call(this,e,n):"emptyElement"==r||l(p(t.prototype),"is",this).call(this,e)}},{key:"_insertChild",value:function(e,t){if(t&&(t instanceof Qt||Array.from(t).length>0))throw new It.b("view-emptyelement-cannot-add: Cannot add child nodes to EmptyElement instance.",[this,t])}}]),t}(nn);function Wn(){return null}var Yn=navigator.userAgent.toLowerCase(),$n={isMac:function(e){return e.indexOf("macintosh")>-1}(Yn),isEdge:function(e){return!!e.match(/edge\/(\d+.?\d*)/)}(Yn),isGecko:function(e){return!!e.match(/gecko\/\d+/)}(Yn),isSafari:function(e){return e.indexOf(" applewebkit/")>-1&&-1===e.indexOf("chrome")}(Yn),isAndroid:function(e){return e.indexOf("android")>-1}(Yn),features:{isRegExpUnicodePropertySupported:function(){var e=!1;try{e=0==="\u0107".search(new RegExp("[\\p{L}]","u"))}catch(e){}return e}()}},Gn={"\u2318":"ctrl","\u21e7":"shift","\u2325":"alt"},Qn={ctrl:"\u2318",shift:"\u21e7",alt:"\u2325"},Kn=function(){for(var e={arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,backspace:8,delete:46,enter:13,space:32,esc:27,tab:9,ctrl:1114112,cmd:1114112,shift:2228224,alt:4456448},t=65;t<=90;t++)e[String.fromCharCode(t).toLowerCase()]=t;for(var n=48;n<=57;n++)e[n-48]=n;for(var r=112;r<=123;r++)e["f"+(r-111)]=r;return e}();function Jn(e){var t;if("string"==typeof e){if(!(t=Kn[e.toLowerCase()]))throw new It.b("keyboard-unknown-key: Unknown key name.",null,{key:e})}else t=e.keyCode+(e.altKey?Kn.alt:0)+(e.ctrlKey?Kn.ctrl:0)+(e.shiftKey?Kn.shift:0);return t}function Xn(e){return"string"==typeof e&&(e=er(e)),e.map((function(e){return"string"==typeof e?Jn(e):e})).reduce((function(e,t){return t+e}),0)}function Zn(e){return $n.isMac?er(e).map((function(e){return Qn[e.toLowerCase()]||e})).reduce((function(e,t){return e.slice(-1)in Gn?e+t:e+"+"+t})):e}function er(e){return e.split(/\s*\+\s*/)}var tr=function(e){function t(e,n,r){var i;return f(this,t),(i=h(this,p(t).call(this,e,n,r))).getFillerOffset=nr,i}return v(t,e),d(t,[{key:"is",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=e.replace(/^view:/,"");return n?"uiElement"==r&&n==this.name||l(p(t.prototype),"is",this).call(this,e,n):"uiElement"==r||l(p(t.prototype),"is",this).call(this,e)}},{key:"_insertChild",value:function(e,t){if(t&&(t instanceof Qt||Array.from(t).length>0))throw new It.b("view-uielement-cannot-add: Cannot add child nodes to UIElement instance.",this)}},{key:"render",value:function(e){return this.toDomElement(e)}},{key:"toDomElement",value:function(e){var t=e.createElement(this.name),n=!0,r=!1,i=void 0;try{for(var o,a=this.getAttributeKeys()[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;t.setAttribute(s,this.getAttribute(s))}}catch(l){r=!0,i=l}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}return t}}]),t}(nn);function nr(){return null}var rr=function(){function e(t){f(this,e),this._children=[],t&&this._insertChild(0,t)}return d(e,[{key:Symbol.iterator,value:function(){return this._children[Symbol.iterator]()}},{key:"is",value:function(e){return"documentFragment"==e||"view:documentFragment"==e}},{key:"_appendChild",value:function(e){return this._insertChild(this.childCount,e)}},{key:"getChild",value:function(e){return this._children[e]}},{key:"getChildIndex",value:function(e){return this._children.indexOf(e)}},{key:"getChildren",value:function(){return this._children[Symbol.iterator]()}},{key:"_insertChild",value:function(e,t){this._fireChange("children",this);var n=0,r=function(e){return"string"==typeof e?[new Kt(e)]:(Zt(e)||(e=[e]),Array.from(e).map((function(e){return"string"==typeof e?new Kt(e):e instanceof Jt?new Kt(e.data):e})))}(t),i=!0,o=!1,a=void 0;try{for(var s,l=r[Symbol.iterator]();!(i=(s=l.next()).done);i=!0){var u=s.value;null!==u.parent&&u._remove(),u.parent=this,this._children.splice(e,0,u),e++,n++}}catch(c){o=!0,a=c}finally{try{i||null==l.return||l.return()}finally{if(o)throw a}}return n}},{key:"_removeChildren",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this._fireChange("children",this);for(var n=e;n2&&void 0!==arguments[2]?arguments[2]:{},r=new Bn(e,t);return n.priority&&(r._priority=n.priority),n.id&&(r._id=n.id),r}},{key:"createContainerElement",value:function(e,t){return new an(e,t)}},{key:"createEditableElement",value:function(e,t){var n=new An(e,t);return n._document=this.document,n}},{key:"createEmptyElement",value:function(e,t){return new qn(e,t)}},{key:"createUIElement",value:function(e,t,n){var r=new tr(e,t);return n&&(r.render=n),r}},{key:"setAttribute",value:function(e,t,n){n._setAttribute(e,t)}},{key:"removeAttribute",value:function(e,t){t._removeAttribute(e)}},{key:"addClass",value:function(e,t){t._addClass(e)}},{key:"removeClass",value:function(e,t){t._removeClass(e)}},{key:"setStyle",value:function(e,t,n){R(e)&&void 0===n&&(n=t),n._setStyle(e,t)}},{key:"removeStyle",value:function(e,t){t._removeStyle(e)}},{key:"setCustomProperty",value:function(e,t,n){n._setCustomProperty(e,t)}},{key:"removeCustomProperty",value:function(e,t){return t._removeCustomProperty(e)}},{key:"breakAttributes",value:function(e){return e instanceof Nn?this._breakAttributes(e):this._breakAttributesRange(e)}},{key:"breakContainer",value:function(e){var t=e.parent;if(!t.is("containerElement"))throw new It.b("view-writer-break-non-container-element: Trying to break an element which is not a container element.",this.document);if(!t.parent)throw new It.b("view-writer-break-root: Trying to break root element.",this.document);if(e.isAtStart)return Nn._createBefore(t);if(!e.isAtEnd){var n=t._clone(!1);this.insert(Nn._createAfter(t),n);var r=new In(e,Nn._createAt(t,"end")),i=new Nn(n,0);this.move(r,i)}return Nn._createAfter(t)}},{key:"mergeAttributes",value:function(e){var t=e.offset,n=e.parent;if(n.is("text"))return e;if(n.is("attributeElement")&&0===n.childCount){var r=n.parent,i=n.index;return n._remove(),this._removeFromClonedElementsGroup(n),this.mergeAttributes(new Nn(r,i))}var o=n.getChild(t-1),a=n.getChild(t);if(!o||!a)return e;if(o.is("text")&&a.is("text"))return ur(o,a);if(o.is("attributeElement")&&a.is("attributeElement")&&o.isSimilar(a)){var s=o.childCount;return o._appendChild(a.getChildren()),a._remove(),this._removeFromClonedElementsGroup(a),this.mergeAttributes(new Nn(o,s))}return e}},{key:"mergeContainers",value:function(e){var t=e.nodeBefore,n=e.nodeAfter;if(!(t&&n&&t.is("containerElement")&&n.is("containerElement")))throw new It.b("view-writer-merge-containers-invalid-position: Element before and after given position cannot be merged.",this.document);var r=t.getChild(t.childCount-1),i=r instanceof Kt?Nn._createAt(r,"end"):Nn._createAt(t,"end");return this.move(In._createIn(n),Nn._createAt(t,"end")),this.remove(In._createOn(n)),i}},{key:"insert",value:function(e,t){!function e(t,n){var r=!0,i=!1,o=void 0;try{for(var a,s=function(){var t=a.value;if(!cr.some((function(e){return t instanceof e})))throw new It.b("view-writer-insert-invalid-node",n);t.is("text")||e(t.getChildren(),n)},l=t[Symbol.iterator]();!(r=(a=l.next()).done);r=!0)s()}catch(u){i=!0,o=u}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}}(t=Zt(t)?u(t):[t],this.document);var n=or(e);if(!n)throw new It.b("view-writer-invalid-position-container",this.document);var r=this._breakAttributes(e,!0),i=n._insertChild(r.offset,t),o=!0,a=!1,s=void 0;try{for(var l,c=t[Symbol.iterator]();!(o=(l=c.next()).done);o=!0){var f=l.value;this._addToClonedElementsGroup(f)}}catch(v){a=!0,s=v}finally{try{o||null==c.return||c.return()}finally{if(a)throw s}}var d=r.getShiftedBy(i),h=this.mergeAttributes(r);if(0===i)return new In(h,h);h.isEqual(r)||d.offset--;var p=this.mergeAttributes(d);return new In(h,p)}},{key:"remove",value:function(e){var t=e instanceof In?e:In._createOn(e);if(dr(t,this.document),t.isCollapsed)return new rr;var n=this._breakAttributesRange(t,!0),r=n.start,i=n.end,o=r.parent,a=i.offset-r.offset,s=o._removeChildren(r.offset,a),l=!0,u=!1,c=void 0;try{for(var f,d=s[Symbol.iterator]();!(l=(f=d.next()).done);l=!0){var h=f.value;this._removeFromClonedElementsGroup(h)}}catch(v){u=!0,c=v}finally{try{l||null==d.return||d.return()}finally{if(u)throw c}}var p=this.mergeAttributes(r);return t.start=p,t.end=p.clone(),new rr(s)}},{key:"clear",value:function(e,t){dr(e,this.document);var n=e.getWalker({direction:"backward",ignoreElementEnd:!0}),r=!0,i=!1,o=void 0;try{for(var a,s=n[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var l=a.value,u=l.item,c=void 0;if(u.is("element")&&t.isSimilar(u))c=In._createOn(u);else if(!l.nextPosition.isAfter(e.start)&&u.is("textProxy")){var f=u.getAncestors().find((function(e){return e.is("element")&&t.isSimilar(e)}));f&&(c=In._createIn(f))}c&&(c.end.isAfter(e.end)&&(c.end=e.end),c.start.isBefore(e.start)&&(c.start=e.start),this.remove(c))}}catch(d){i=!0,o=d}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}}},{key:"move",value:function(e,t){var n;if(t.isAfter(e.end)){var r=(t=this._breakAttributes(t,!0)).parent,i=r.childCount;e=this._breakAttributesRange(e,!0),n=this.remove(e),t.offset+=r.childCount-i}else n=this.remove(e);return this.insert(t,n)}},{key:"wrap",value:function(e,t){if(!(t instanceof Bn))throw new It.b("view-writer-wrap-invalid-attribute",this.document);if(dr(e,this.document),e.isCollapsed){var n=e.start;n.parent.is("element")&&(i=n.parent,!Array.from(i.getChildren()).some((function(e){return!e.is("uiElement")})))&&(n=n.getLastMatchingPosition((function(e){return e.item.is("uiElement")}))),n=this._wrapPosition(n,t);var r=this.document.selection;return r.isCollapsed&&r.getFirstPosition().isEqual(e.start)&&this.setSelection(n),new In(n)}return this._wrapRange(e,t);var i}},{key:"unwrap",value:function(e,t){if(!(t instanceof Bn))throw new It.b("view-writer-unwrap-invalid-attribute",this.document);if(dr(e,this.document),e.isCollapsed)return e;var n=this._breakAttributesRange(e,!0),r=n.start,i=n.end,o=r.parent,a=this._unwrapChildren(o,r.offset,i.offset,t),s=this.mergeAttributes(a.start);s.isEqual(a.start)||a.end.offset--;var l=this.mergeAttributes(a.end);return new In(s,l)}},{key:"rename",value:function(e,t){var n=new an(e,t.getAttributes());return this.insert(Nn._createAfter(t),n),this.move(In._createIn(t),Nn._createAt(n,0)),this.remove(In._createOn(t)),n}},{key:"clearClonedElementsGroup",value:function(e){this._cloneGroups.delete(e)}},{key:"createPositionAt",value:function(e,t){return Nn._createAt(e,t)}},{key:"createPositionAfter",value:function(e){return Nn._createAfter(e)}},{key:"createPositionBefore",value:function(e){return Nn._createBefore(e)}},{key:"createRange",value:function(e,t){return new In(e,t)}},{key:"createRangeOn",value:function(e){return In._createOn(e)}},{key:"createRangeIn",value:function(e){return In._createIn(e)}},{key:"createSelection",value:function(e,t,n){return new jn(e,t,n)}},{key:"_wrapChildren",value:function(e,t,n,r){for(var i=t,o=[];i1&&void 0!==arguments[1]&&arguments[1],n=e.start,r=e.end;if(dr(e,this.document),e.isCollapsed){var i=this._breakAttributes(e.start,t);return new In(i,i)}var o=this._breakAttributes(r,t),a=o.parent.childCount,s=this._breakAttributes(n,t);return o.offset+=o.parent.childCount-a,new In(s,o)}},{key:"_breakAttributes",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.offset,r=e.parent;if(e.parent.is("emptyElement"))throw new It.b("view-writer-cannot-break-empty-element",this.document);if(e.parent.is("uiElement"))throw new It.b("view-writer-cannot-break-ui-element",this.document);if(!t&&r.is("text")&&fr(r.parent))return e.clone();if(fr(r))return e.clone();if(r.is("text"))return this._breakAttributes(lr(e),t);if(n==r.childCount){var i=new Nn(r.parent,r.index+1);return this._breakAttributes(i,t)}if(0===n){var o=new Nn(r.parent,r.index);return this._breakAttributes(o,t)}var a=r.index+1,s=r._clone();r.parent._insertChild(a,s),this._addToClonedElementsGroup(s);var l=r.childCount-n,u=r._removeChildren(n,l);s._appendChild(u);var c=new Nn(r.parent,a);return this._breakAttributes(c,t)}},{key:"_addToClonedElementsGroup",value:function(e){if(e.root.is("rootElement")){if(e.is("element")){var t=!0,n=!1,r=void 0;try{for(var i,o=e.getChildren()[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value;this._addToClonedElementsGroup(a)}}catch(u){n=!0,r=u}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}}var s=e.id;if(s){var l=this._cloneGroups.get(s);l||(l=new Set,this._cloneGroups.set(s,l)),l.add(e),e._clonesGroup=l}}}},{key:"_removeFromClonedElementsGroup",value:function(e){if(e.is("element")){var t=!0,n=!1,r=void 0;try{for(var i,o=e.getChildren()[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value;this._removeFromClonedElementsGroup(a)}}catch(u){n=!0,r=u}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}}var s=e.id;if(s){var l=this._cloneGroups.get(s);l&&l.delete(e)}}}]),e}();function or(e){for(var t=e.parent;!fr(t);){if(!t)return;t=t.parent}return t}function ar(e,t){return e.priorityt.priority)&&e.getIdentity()3&&void 0!==arguments[3]&&arguments[3];n=n||function(e,t){return e===t},Array.isArray(e)||(e=Array.from(e)),Array.isArray(t)||(t=Array.from(t));var i=function(e,t,n){var r=Tr(e,t,n);if(-1===r)return{firstIndex:-1,lastIndexOld:-1,lastIndexNew:-1};var i=Tr(Cr(e,r),Cr(t,r),n);return{firstIndex:r,lastIndexOld:e.length-i,lastIndexNew:t.length-i}}(e,t,n);return r?function(e,t){var n=e.firstIndex,r=e.lastIndexOld,i=e.lastIndexNew;if(-1===n)return Array(t).fill("equal");var o=[];return n>0&&(o=o.concat(Array(n).fill("equal"))),i-n>0&&(o=o.concat(Array(i-n).fill("insert"))),r-n>0&&(o=o.concat(Array(r-n).fill("delete"))),i0&&n.push({index:r,type:"insert",values:e.slice(r,o)}),i-r>0&&n.push({index:r+(o-r),type:"delete",howMany:i-r}),n}(t,i)}function Tr(e,t,n){for(var r=0;r200||a>200||o+a>300)return Sr.fastDiff(e,t,n,!0);if(as?-1:1;f[o+c]&&(f[o]=f[o+c].slice(0)),f[o]||(f[o]=[]),f[o].push(a>s?r:i);for(var h=Math.max(a,s),p=h-o;pc;p--)d[p]=h(p);d[c]=h(c),v++}while(d[c]!==u);return f[c].slice(1)}function Er(e,t,n){e.insertBefore(n,e.childNodes[t]||null)}function Ar(e){var t=e.parentNode;t&&t.removeChild(e)}function Pr(e){if(e){if(e.defaultView)return e instanceof e.defaultView.Document;if(e.ownerDocument&&e.ownerDocument.defaultView)return e instanceof e.ownerDocument.defaultView.Node}return!1}Sr.fastDiff=xr;var Mr=function(){function e(t,n){f(this,e),this.domDocuments=new Set,this.domConverter=t,this.markedAttributes=new Set,this.markedChildren=new Set,this.markedTexts=new Set,this.selection=n,this.isFocused=!1,this._inlineFiller=null,this._fakeSelectionContainer=null}return d(e,[{key:"markToSync",value:function(e,t){if("text"===e)this.domConverter.mapViewToDom(t.parent)&&this.markedTexts.add(t);else{if(!this.domConverter.mapViewToDom(t))return;if("attributes"===e)this.markedAttributes.add(t);else{if("children"!==e)throw new It.b("view-renderer-unknown-type: Unknown type passed to Renderer.markToSync.",this);this.markedChildren.add(t)}}}},{key:"render",value:function(){var e,t=!0,n=!1,r=void 0;try{for(var i,o=this.markedChildren[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value;this._updateChildrenMappings(a)}}catch(E){n=!0,r=E}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}this._inlineFiller&&!this._isSelectionInInlineFiller()&&this._removeInlineFiller(),this._inlineFiller?e=this._getInlineFillerPosition():this._needsInlineFillerAtSelection()&&(e=this.selection.getFirstPosition(),this.markedChildren.add(e.parent));var s=!0,l=!1,u=void 0;try{for(var c,f=this.markedAttributes[Symbol.iterator]();!(s=(c=f.next()).done);s=!0){var d=c.value;this._updateAttrs(d)}}catch(E){l=!0,u=E}finally{try{s||null==f.return||f.return()}finally{if(l)throw u}}var h=!0,p=!1,v=void 0;try{for(var m,g=this.markedChildren[Symbol.iterator]();!(h=(m=g.next()).done);h=!0){var y=m.value;this._updateChildren(y,{inlineFillerPosition:e})}}catch(E){p=!0,v=E}finally{try{h||null==g.return||g.return()}finally{if(p)throw v}}var b=!0,k=!1,w=void 0;try{for(var _,x=this.markedTexts[Symbol.iterator]();!(b=(_=x.next()).done);b=!0){var T=_.value;!this.markedChildren.has(T.parent)&&this.domConverter.mapViewToDom(T.parent)&&this._updateText(T,{inlineFillerPosition:e})}}catch(E){k=!0,w=E}finally{try{b||null==x.return||x.return()}finally{if(k)throw w}}if(e){var C=this.domConverter.viewPositionToDom(e),S=C.parent.ownerDocument;br(C.parent)?this._inlineFiller=C.parent:this._inlineFiller=Or(S,C.parent,C.offset)}else this._inlineFiller=null;this._updateSelection(),this._updateFocus(),this.markedTexts.clear(),this.markedAttributes.clear(),this.markedChildren.clear()}},{key:"_updateChildrenMappings",value:function(e){var t=this.domConverter.mapViewToDom(e);if(t){var n=this.domConverter.mapViewToDom(e).childNodes,r=Array.from(this.domConverter.viewChildrenToDom(e,t.ownerDocument,{withChildren:!1})),i=this._diffNodeLists(n,r),o=this._findReplaceActions(i,n,r);if(-1!==o.indexOf("replace")){var a={equal:0,insert:0,delete:0},s=!0,l=!1,u=void 0;try{for(var c,f=o[Symbol.iterator]();!(s=(c=f.next()).done);s=!0){var d=c.value;if("replace"===d){var h=a.equal+a.insert,p=a.equal+a.delete,v=e.getChild(h);v&&!v.is("uiElement")&&this._updateElementMappings(v,n[p]),Ar(r[h]),a.equal++}else a[d]++}}catch(m){l=!0,u=m}finally{try{s||null==f.return||f.return()}finally{if(l)throw u}}}}}},{key:"_updateElementMappings",value:function(e,t){this.domConverter.unbindDomElement(t),this.domConverter.bindElements(t,e),this.markedChildren.add(e),this.markedAttributes.add(e)}},{key:"_getInlineFillerPosition",value:function(){var e=this.selection.getFirstPosition();return e.parent.is("text")?Nn._createBefore(this.selection.getFirstPosition().parent):e}},{key:"_isSelectionInInlineFiller",value:function(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;var e=this.selection.getFirstPosition(),t=this.domConverter.viewPositionToDom(e);return!!(t&&pr(t.parent)&&br(t.parent))}},{key:"_removeInlineFiller",value:function(){var e=this._inlineFiller;if(!br(e))throw new It.b("view-renderer-filler-was-lost: The inline filler node was lost.",this);kr(e)?e.parentNode.removeChild(e):e.data=e.data.substr(gr),this._inlineFiller=null}},{key:"_needsInlineFillerAtSelection",value:function(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;var e=this.selection.getFirstPosition(),t=e.parent,n=e.offset;if(!this.domConverter.mapViewToDom(t.root))return!1;if(!t.is("element"))return!1;if(!function(e){if("false"==e.getAttribute("contenteditable"))return!1;var t=e.findAncestor((function(e){return e.hasAttribute("contenteditable")}));return!t||"true"==t.getAttribute("contenteditable")}(t))return!1;if(n===t.getFillerOffset())return!1;var r=e.nodeBefore,i=e.nodeAfter;return!(r instanceof Kt||i instanceof Kt)}},{key:"_updateText",value:function(e,t){var n=this.domConverter.findCorrespondingDomText(e),r=this.domConverter.viewToDom(e,n.ownerDocument),i=n.data,o=r.data,a=t.inlineFillerPosition;if(a&&a.parent==e.parent&&a.offset==e.index&&(o=yr+o),i!=o){var s=xr(i,o),l=!0,u=!1,c=void 0;try{for(var f,d=s[Symbol.iterator]();!(l=(f=d.next()).done);l=!0){var h=f.value;"insert"===h.type?n.insertData(h.index,h.values.join("")):n.deleteData(h.index,h.howMany)}}catch(p){u=!0,c=p}finally{try{l||null==d.return||d.return()}finally{if(u)throw c}}}}},{key:"_updateAttrs",value:function(e){var t=this.domConverter.mapViewToDom(e);if(t){var n=Array.from(t.attributes).map((function(e){return e.name})),r=e.getAttributeKeys(),i=!0,o=!1,a=void 0;try{for(var s,l=r[Symbol.iterator]();!(i=(s=l.next()).done);i=!0){var u=s.value;t.setAttribute(u,e.getAttribute(u))}}catch(m){o=!0,a=m}finally{try{i||null==l.return||l.return()}finally{if(o)throw a}}var c=!0,f=!1,d=void 0;try{for(var h,p=n[Symbol.iterator]();!(c=(h=p.next()).done);c=!0){var v=h.value;e.hasAttribute(v)||t.removeAttribute(v)}}catch(m){f=!0,d=m}finally{try{c||null==p.return||p.return()}finally{if(f)throw d}}}}},{key:"_updateChildren",value:function(e,t){var n=this.domConverter.mapViewToDom(e);if(n){var r=t.inlineFillerPosition,i=this.domConverter.mapViewToDom(e).childNodes,o=Array.from(this.domConverter.viewChildrenToDom(e,n.ownerDocument,{bind:!0,inlineFillerPosition:r}));r&&r.parent===e&&Or(n.ownerDocument,o,r.offset);var a=this._diffNodeLists(i,o),s=0,l=new Set,u=!0,c=!1,f=void 0;try{for(var d,h=a[Symbol.iterator]();!(u=(d=h.next()).done);u=!0){var p=d.value;"insert"===p?(Er(n,s,o[s]),s++):"delete"===p?(l.add(i[s]),Ar(i[s])):(this._markDescendantTextToSync(this.domConverter.domToView(o[s])),s++)}}catch(w){c=!0,f=w}finally{try{u||null==h.return||h.return()}finally{if(c)throw f}}var v=!0,m=!1,g=void 0;try{for(var y,b=l[Symbol.iterator]();!(v=(y=b.next()).done);v=!0){var k=y.value;k.parentNode||this.domConverter.unbindDomElement(k)}}catch(w){m=!0,g=w}finally{try{v||null==b.return||b.return()}finally{if(m)throw g}}}}},{key:"_diffNodeLists",value:function(e,t){return Sr(e=function(e,t){var n=Array.from(e);return 0!=n.length&&t?(n[n.length-1]==t&&n.pop(),n):n}(e,this._fakeSelectionContainer),t,Ir.bind(null,this.domConverter))}},{key:"_findReplaceActions",value:function(e,t,n){if(-1===e.indexOf("insert")||-1===e.indexOf("delete"))return e;var r=[],i=[],o=[],a={equal:0,insert:0,delete:0},s=!0,l=!1,u=void 0;try{for(var c,f=e[Symbol.iterator]();!(s=(c=f.next()).done);s=!0){var d=c.value;"insert"===d?o.push(n[a.equal+a.insert]):"delete"===d?i.push(t[a.equal+a.delete]):((r=r.concat(Sr(i,o,Nr).map((function(e){return"equal"===e?"replace":e})))).push("equal"),i=[],o=[]),a[d]++}}catch(h){l=!0,u=h}finally{try{s||null==f.return||f.return()}finally{if(l)throw u}}return r.concat(Sr(i,o,Nr).map((function(e){return"equal"===e?"replace":e})))}},{key:"_markDescendantTextToSync",value:function(e){if(e)if(e.is("text"))this.markedTexts.add(e);else if(e.is("element")){var t=!0,n=!1,r=void 0;try{for(var i,o=e.getChildren()[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value;this._markDescendantTextToSync(a)}}catch(s){n=!0,r=s}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}}}},{key:"_updateSelection",value:function(){if(0===this.selection.rangeCount)return this._removeDomSelection(),void this._removeFakeSelection();var e=this.domConverter.mapViewToDom(this.selection.editableElement);this.isFocused&&e&&(this.selection.isFake?this._updateFakeSelection(e):(this._removeFakeSelection(),this._updateDomSelection(e)))}},{key:"_updateFakeSelection",value:function(e){var t=e.ownerDocument;this._fakeSelectionContainer||(this._fakeSelectionContainer=function(e){var t=e.createElement("div");return Object.assign(t.style,{position:"fixed",top:0,left:"-9999px",width:"42px"}),t.textContent="\xa0",t}(t));var n=this._fakeSelectionContainer;if(this.domConverter.bindFakeSelection(n,this.selection),this._fakeSelectionNeedsUpdate(e)){n.parentElement&&n.parentElement==e||e.appendChild(n),n.textContent=this.selection.fakeSelectionLabel||"\xa0";var r=t.getSelection(),i=t.createRange();r.removeAllRanges(),i.selectNodeContents(n),r.addRange(i)}}},{key:"_updateDomSelection",value:function(e){var t=e.ownerDocument.defaultView.getSelection();if(this._domSelectionNeedsUpdate(t)){var n=this.domConverter.viewPositionToDom(this.selection.anchor),r=this.domConverter.viewPositionToDom(this.selection.focus);e.focus(),t.collapse(n.parent,n.offset),t.extend(r.parent,r.offset),$n.isGecko&&function(e,t){var n=e.parent;if(n.nodeType==Node.ELEMENT_NODE&&e.offset==n.childNodes.length-1){var r=n.childNodes[e.offset];r&&"BR"==r.tagName&&t.addRange(t.getRangeAt(0))}}(r,t)}}},{key:"_domSelectionNeedsUpdate",value:function(e){if(!this.domConverter.isDomSelectionCorrect(e))return!0;var t=e&&this.domConverter.domSelectionToView(e);return(!t||!this.selection.isEqual(t))&&!(!this.selection.isCollapsed&&this.selection.isSimilar(t))}},{key:"_fakeSelectionNeedsUpdate",value:function(e){var t=this._fakeSelectionContainer,n=e.ownerDocument.getSelection();return!t||t.parentElement!==e||n.anchorNode!==t&&!t.contains(n.anchorNode)||t.textContent!==this.selection.fakeSelectionLabel}},{key:"_removeDomSelection",value:function(){var e=!0,t=!1,n=void 0;try{for(var r,i=this.domDocuments[Symbol.iterator]();!(e=(r=i.next()).done);e=!0){var o=r.value;if(o.getSelection().rangeCount){var a=o.activeElement,s=this.domConverter.mapDomToView(a);a&&s&&o.getSelection().removeAllRanges()}}}catch(l){t=!0,n=l}finally{try{e||null==i.return||i.return()}finally{if(t)throw n}}}},{key:"_removeFakeSelection",value:function(){var e=this._fakeSelectionContainer;e&&e.remove()}},{key:"_updateFocus",value:function(){if(this.isFocused){var e=this.selection.editableElement;e&&this.domConverter.focus(e)}}}]),e}();function Or(e,t,n){var r=t instanceof Array?t:t.childNodes,i=r[n];if(pr(i))return i.data=yr+i.data,i;var o=e.createTextNode(yr);return Array.isArray(t)?r.splice(n,0,o):Er(t,n,o),o}function Nr(e,t){return Pr(e)&&Pr(t)&&!pr(e)&&!pr(t)&&e.tagName.toLowerCase()===t.tagName.toLowerCase()}function Ir(e,t,n){return t===n||(pr(t)&&pr(n)?t.data===n.data:!(!e.isBlockFiller(t)||!e.isBlockFiller(n)))}Yt(Mr,wn);var Dr={window:window,document:document};function Rr(e){for(var t=0;e.previousSibling;)e=e.previousSibling,t++;return t}function jr(e){for(var t=[];e&&e.nodeType!=Node.DOCUMENT_NODE;)t.unshift(e),e=e.parentNode;return t}var Lr=mr(document),Fr=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};f(this,e),this.blockFillerMode=t.blockFillerMode||"br",this.preElements=["pre"],this.blockElements=["p","div","h1","h2","h3","h4","h5","h6","li","dd","dt","figcaption"],this._blockFiller="br"==this.blockFillerMode?mr:vr,this._domToViewMapping=new WeakMap,this._viewToDomMapping=new WeakMap,this._fakeSelectionMapping=new WeakMap}return d(e,[{key:"bindFakeSelection",value:function(e,t){this._fakeSelectionMapping.set(e,new jn(t))}},{key:"fakeSelectionToView",value:function(e){return this._fakeSelectionMapping.get(e)}},{key:"bindElements",value:function(e,t){this._domToViewMapping.set(e,t),this._viewToDomMapping.set(t,e)}},{key:"unbindDomElement",value:function(e){var t=this._domToViewMapping.get(e);if(t){this._domToViewMapping.delete(e),this._viewToDomMapping.delete(t);for(var n=0,r=Array.from(e.childNodes);n2&&void 0!==arguments[2]?arguments[2]:{};if(e.is("text")){var i=this._processDataFromViewText(e);return t.createTextNode(i)}if(this.mapViewToDom(e))return this.mapViewToDom(e);if(e.is("documentFragment"))n=t.createDocumentFragment(),r.bind&&this.bindDocumentFragments(n,e);else{if(e.is("uiElement"))return n=e.render(t),r.bind&&this.bindElements(n,e),n;n=e.hasAttribute("xmlns")?t.createElementNS(e.getAttribute("xmlns"),e.name):t.createElement(e.name),r.bind&&this.bindElements(n,e);var o=!0,a=!1,s=void 0;try{for(var l,u=e.getAttributeKeys()[Symbol.iterator]();!(o=(l=u.next()).done);o=!0){var c=l.value;n.setAttribute(c,e.getAttribute(c))}}catch(g){a=!0,s=g}finally{try{o||null==u.return||u.return()}finally{if(a)throw s}}}if(r.withChildren||void 0===r.withChildren){var f=!0,d=!1,h=void 0;try{for(var p,v=this.viewChildrenToDom(e,t,r)[Symbol.iterator]();!(f=(p=v.next()).done);f=!0){var m=p.value;n.appendChild(m)}}catch(g){d=!0,h=g}finally{try{f||null==v.return||v.return()}finally{if(d)throw h}}}return n}},{key:"viewChildrenToDom",value:s.mark((function e(t,n){var r,i,o,a,l,u,c,f,d,h=arguments;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=h.length>2&&void 0!==h[2]?h[2]:{},i=t.getFillerOffset&&t.getFillerOffset(),o=0,a=!0,l=!1,u=void 0,e.prev=6,c=t.getChildren()[Symbol.iterator]();case 8:if(a=(f=c.next()).done){e.next=20;break}if(d=f.value,e.t0=i===o,!e.t0){e.next=14;break}return e.next=14,this._blockFiller(n);case 14:return e.next=16,this.viewToDom(d,n,r);case 16:o++;case 17:a=!0,e.next=8;break;case 20:e.next=26;break;case 22:e.prev=22,e.t1=e.catch(6),l=!0,u=e.t1;case 26:e.prev=26,e.prev=27,a||null==c.return||c.return();case 29:if(e.prev=29,!l){e.next=32;break}throw u;case 32:return e.finish(29);case 33:return e.finish(26);case 34:if(e.t2=i===o,!e.t2){e.next=38;break}return e.next=38,this._blockFiller(n);case 38:case"end":return e.stop()}}),e,this,[[6,22,26,34],[27,,29,33]])}))},{key:"viewRangeToDom",value:function(e){var t=this.viewPositionToDom(e.start),n=this.viewPositionToDom(e.end),r=document.createRange();return r.setStart(t.parent,t.offset),r.setEnd(n.parent,n.offset),r}},{key:"viewPositionToDom",value:function(e){var t,n,r,i=e.parent;if(i.is("text")){var o=this.findCorrespondingDomText(i);if(!o)return null;var a=e.offset;return br(o)&&(a+=gr),{parent:o,offset:a}}if(0===e.offset){if(!(t=this.mapViewToDom(i)))return null;r=t.childNodes[0]}else{var s=e.nodeBefore;if(!(n=s.is("text")?this.findCorrespondingDomText(s):this.mapViewToDom(e.nodeBefore)))return null;t=n.parentNode,r=n.nextSibling}return pr(r)&&br(r)?{parent:r,offset:gr}:{parent:t,offset:n?Rr(n)+1:0}}},{key:"domToView",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.isBlockFiller(e,this.blockFillerMode))return null;var n,r=this.getParentUIElement(e,this._domToViewMapping);if(r)return r;if(pr(e)){if(kr(e))return null;var i=this._processDataFromDomText(e);return""===i?null:new Kt(i)}if(this.isComment(e))return null;if(this.mapDomToView(e))return this.mapDomToView(e);if(this.isDocumentFragment(e))n=new rr,t.bind&&this.bindDocumentFragments(e,n);else{var o=t.keepOriginalCase?e.tagName:e.tagName.toLowerCase();n=new nn(o),t.bind&&this.bindElements(e,n);for(var a=e.attributes,s=a.length-1;s>=0;s--)n._setAttribute(a[s].name,a[s].value)}if(t.withChildren||void 0===t.withChildren){var l=!0,u=!1,c=void 0;try{for(var f,d=this.domChildrenToView(e,t)[Symbol.iterator]();!(l=(f=d.next()).done);l=!0){var h=f.value;n._appendChild(h)}}catch(p){u=!0,c=p}finally{try{l||null==d.return||d.return()}finally{if(u)throw c}}}return n}},{key:"domChildrenToView",value:s.mark((function e(t){var n,r,i,o,a=arguments;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=a.length>1&&void 0!==a[1]?a[1]:{},r=0;case 2:if(!(r1?n-1:0),i=1;i2&&void 0!==arguments[2]?arguments[2]:{};if(!this._domListeners||!this._domListeners[e]){var r=this._createDomListener(e,!!n.useCapture);this._domNode.addEventListener(e,r,!!n.useCapture),this._domListeners||(this._domListeners={}),this._domListeners[e]=r}},detach:function(e){var t;!this._domListeners[e]||(t=this._events[e])&&t.callbacks.length||this._domListeners[e].removeListener()},_createDomListener:function(e,t){var n=this,r=function(t){n.fire(e,t)};return r.removeListener=function(){n._domNode.removeEventListener(e,r,t),delete n._domListeners[e]},r}});var Yr=function(){function e(t){f(this,e),this.view=t,this.document=t.document,this.isEnabled=!1}return d(e,[{key:"enable",value:function(){this.isEnabled=!0}},{key:"disable",value:function(){this.isEnabled=!1}},{key:"destroy",value:function(){this.disable(),this.stopListening()}}]),e}();function $r(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new ce;++ts))return!1;var u=o.get(e);if(u&&o.get(t))return u==t;var c=-1,f=!0,d=2&n?new Gr:void 0;for(o.set(e,t),o.set(t,e);++c=t||n<0||f&&e-u>=o}function v(){var e=pi();if(p(e))return m(e);s=setTimeout(v,function(e){var n=t-(e-l);return f?xi(n,o-(e-u)):n}(e))}function m(e){return s=void 0,d&&r?h(e):(r=i=void 0,a)}function g(){var e=pi(),n=p(e);if(r=arguments,i=this,l=e,n){if(void 0===s)return function(e){return u=e,s=setTimeout(v,t),c?h(e):a}(l);if(f)return clearTimeout(s),s=setTimeout(v,t),h(l)}return void 0===s&&(s=setTimeout(v,t)),a}return t=wi(t)||0,U(n)&&(c=!!n.leading,o=(f="maxWait"in n)?_i(wi(n.maxWait)||0,t):o,d="trailing"in n?!!n.trailing:d),g.cancel=function(){void 0!==s&&clearTimeout(s),u=0,r=l=i=s=void 0},g.flush=function(){return void 0===s?a:m(pi())},g},Ci=function(e){function t(e){var n;return f(this,t),(n=h(this,p(t).call(this,e)))._fireSelectionChangeDoneDebounced=Ti((function(e){return n.document.fire("selectionChangeDone",e)}),200),n}return v(t,e),d(t,[{key:"observe",value:function(){var e=this,t=this.document;t.on("keydown",(function(n,r){t.selection.isFake&&function(e){return e==Kn.arrowright||e==Kn.arrowleft||e==Kn.arrowup||e==Kn.arrowdown}(r.keyCode)&&e.isEnabled&&(r.preventDefault(),e._handleSelectionMove(r.keyCode))}),{priority:"lowest"})}},{key:"destroy",value:function(){l(p(t.prototype),"destroy",this).call(this),this._fireSelectionChangeDoneDebounced.cancel()}},{key:"_handleSelectionMove",value:function(e){var t=this.document.selection,n=new jn(t.getRanges(),{backward:t.isBackward,fake:!1});e!=Kn.arrowleft&&e!=Kn.arrowup||n.setTo(n.getFirstPosition()),e!=Kn.arrowright&&e!=Kn.arrowdown||n.setTo(n.getLastPosition());var r={oldSelection:t,newSelection:n,domSelection:null};this.document.fire("selectionChange",r),this._fireSelectionChangeDoneDebounced(r)}}]),t}(Yr),Si=function(e){function t(e){var n;return f(this,t),(n=h(this,p(t).call(this,e))).mutationObserver=e.getObserver(ci),n.selection=n.document.selection,n.domConverter=e.domConverter,n._documents=new WeakSet,n._fireSelectionChangeDoneDebounced=Ti((function(e){return n.document.fire("selectionChangeDone",e)}),200),n._clearInfiniteLoopInterval=setInterval((function(){return n._clearInfiniteLoop()}),1e3),n._loopbackCounter=0,n}return v(t,e),d(t,[{key:"observe",value:function(e){var t=this,n=e.ownerDocument;this._documents.has(n)||(this.listenTo(n,"selectionchange",(function(){t._handleSelectionChange(n)})),this._documents.add(n))}},{key:"destroy",value:function(){l(p(t.prototype),"destroy",this).call(this),clearInterval(this._clearInfiniteLoopInterval),this._fireSelectionChangeDoneDebounced.cancel()}},{key:"_handleSelectionChange",value:function(e){if(this.isEnabled&&(this.document.isFocused||this.document.isReadOnly)){this.mutationObserver.flush();var t=e.defaultView.getSelection(),n=this.domConverter.domSelectionToView(t);if(!(this.selection.isEqual(n)&&this.domConverter.isDomSelectionCorrect(t)||++this._loopbackCounter>60))if(this.selection.isSimilar(n))this.view.forceRender();else{var r={oldSelection:this.selection,newSelection:n,domSelection:t};this.document.fire("selectionChange",r),this._fireSelectionChangeDoneDebounced(r)}}}},{key:"_clearInfiniteLoop",value:function(){this._loopbackCounter=0}}]),t}(Yr),Ei=function(e){function t(e){var n;f(this,t),(n=h(this,p(t).call(this,e))).domEventType=["focus","blur"],n.useCapture=!0;var r=n.document;return r.on("focus",(function(){r.isFocused=!0,n._renderTimeoutId=setTimeout((function(){return e.forceRender()}),50)})),r.on("blur",(function(t,n){var i=r.selection.editableElement;null!==i&&i!==n.target||(r.isFocused=!1,e.forceRender())})),n}return v(t,e),d(t,[{key:"onDomEvent",value:function(e){this.fire(e.type,e)}},{key:"destroy",value:function(){this._renderTimeoutId&&clearTimeout(this._renderTimeoutId),l(p(t.prototype),"destroy",this).call(this)}}]),t}(di),Ai=function(e){function t(e){var n;f(this,t),(n=h(this,p(t).call(this,e))).domEventType=["compositionstart","compositionupdate","compositionend"];var r=n.document;return r.on("compositionstart",(function(){r.isComposing=!0})),r.on("compositionend",(function(){r.isComposing=!1})),n}return v(t,e),d(t,[{key:"onDomEvent",value:function(e){this.fire(e.type,e)}}]),t}(di),Pi=function(e){function t(e){var n;return f(this,t),(n=h(this,p(t).call(this,e))).domEventType=["beforeinput"],n}return v(t,e),d(t,[{key:"onDomEvent",value:function(e){this.fire(e.type,e)}}]),t}(di);function Mi(e){return"[object Range]"==Object.prototype.toString.apply(e)}function Oi(e){var t=e.ownerDocument.defaultView.getComputedStyle(e);return{top:parseInt(t.borderTopWidth,10),right:parseInt(t.borderRightWidth,10),bottom:parseInt(t.borderBottomWidth,10),left:parseInt(t.borderLeftWidth,10)}}var Ni=["top","right","bottom","left","width","height"],Ii=function(){function e(t){f(this,e);var n=Mi(t);if(Object.defineProperty(this,"_source",{value:t._source||t,writable:!0,enumerable:!1}),Mt(t)||n)Di(this,n?e.getDomRangeRects(t)[0]:t.getBoundingClientRect());else if(Ur(t)){var r=t.innerWidth,i=t.innerHeight;Di(this,{top:0,right:r,bottom:i,left:0,width:r,height:i})}else Di(this,t)}return d(e,[{key:"clone",value:function(){return new e(this)}},{key:"moveTo",value:function(e,t){return this.top=t,this.right=e+this.width,this.bottom=t+this.height,this.left=e,this}},{key:"moveBy",value:function(e,t){return this.top+=t,this.right+=e,this.left+=e,this.bottom+=t,this}},{key:"getIntersection",value:function(t){var n={top:Math.max(this.top,t.top),right:Math.min(this.right,t.right),bottom:Math.min(this.bottom,t.bottom),left:Math.max(this.left,t.left)};return n.width=n.right-n.left,n.height=n.bottom-n.top,n.width<0||n.height<0?null:new e(n)}},{key:"getIntersectionArea",value:function(e){var t=this.getIntersection(e);return t?t.getArea():0}},{key:"getArea",value:function(){return this.width*this.height}},{key:"getVisible",value:function(){var t=this._source,n=this.clone();if(!Ri(t))for(var r=t.parentNode||t.commonAncestorContainer;r&&!Ri(r);){var i=new e(r),o=n.getIntersection(i);if(!o)return null;o.getArea()t.bottom}function Vi(e,t){return e.topt.right}function Hi(e){return Mi(e)?e.startContainer.ownerDocument.defaultView:e.ownerDocument.defaultView}function qi(e){if(Mi(e)){var t=e.commonAncestorContainer;return pr(t)&&(t=t.parentNode),t}return e.parentNode}function Wi(e,t){var n=Hi(e),r=new Ii(e);if(n===t)return r;for(var i=n;i!=t;){var o=i.frameElement,a=new Ii(o).excludeScrollbarsAndBorders();r.moveBy(a.left,a.top),i=i.parent}return r}Object.assign({},{scrollViewportToShowTarget:ji,scrollAncestorsToShowTarget:function(e){Fi(qi(e),(function(){return new Ii(e)}))}});var Yi=function(){function e(){var t=this;f(this,e),this.document=new zn,this.domConverter=new Fr,this.domRoots=new Map,this.set("isRenderingInProgress",!1),this._renderer=new Mr(this.domConverter,this.document.selection),this._renderer.bind("isFocused").to(this.document),this._initialDomRootAttributes=new WeakMap,this._observers=new Map,this._ongoingChange=!1,this._postFixersInProgress=!1,this._renderingDisabled=!1,this._hasChangedSinceTheLastRendering=!1,this._writer=new ir(this.document),this.addObserver(ci),this.addObserver(Si),this.addObserver(Ei),this.addObserver(hi),this.addObserver(Ci),this.addObserver(Ai),$n.isAndroid&&this.addObserver(Pi),this.document.on("keydown",_r),function(e){e.document.on("keydown",(function(t,n){return function(e,t,n){if(t.keyCode==Kn.arrowright){var r=t.domTarget.ownerDocument.defaultView.getSelection(),i=1==r.rangeCount&&r.getRangeAt(0).collapsed;if(i||t.shiftKey){var o=r.focusNode,a=r.focusOffset,s=n.domPositionToView(o,a);if(null===s)return;var l=!1,u=s.getLastMatchingPosition((function(e){return e.item.is("uiElement")&&(l=!0),!(!e.item.is("uiElement")&&!e.item.is("attributeElement"))}));if(l){var c=n.viewPositionToDom(u);i?r.collapse(c.parent,c.offset):r.extend(c.parent,c.offset)}}}}(0,n,e.domConverter)}))}(this),this.on("render",(function(){t._render(),t.document.fire("layoutChanged"),t._hasChangedSinceTheLastRendering=!1})),this.listenTo(this.document.selection,"change",(function(){t._hasChangedSinceTheLastRendering=!0}))}return d(e,[{key:"attachDomRoot",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"main",r=this.document.getRoot(n);r._name=e.tagName.toLowerCase();for(var i={},o=0,a=Array.from(e.attributes);o0&&void 0!==arguments[0]?arguments[0]:"main";return this.domRoots.get(e)}},{key:"addObserver",value:function(e){var t=this._observers.get(e);if(t)return t;t=new e(this),this._observers.set(e,t);var n=!0,r=!1,i=void 0;try{for(var o,a=this.domRoots[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value,l=c(s,2),u=l[0],f=l[1];t.observe(f,u)}}catch(d){r=!0,i=d}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}return t.enable(),t}},{key:"getObserver",value:function(e){return this._observers.get(e)}},{key:"disableObservers",value:function(){var e=!0,t=!1,n=void 0;try{for(var r,i=this._observers.values()[Symbol.iterator]();!(e=(r=i.next()).done);e=!0)r.value.disable()}catch(o){t=!0,n=o}finally{try{e||null==i.return||i.return()}finally{if(t)throw n}}}},{key:"enableObservers",value:function(){var e=!0,t=!1,n=void 0;try{for(var r,i=this._observers.values()[Symbol.iterator]();!(e=(r=i.next()).done);e=!0)r.value.enable()}catch(o){t=!0,n=o}finally{try{e||null==i.return||i.return()}finally{if(t)throw n}}}},{key:"scrollToTheSelection",value:function(){var e=this.document.selection.getFirstRange();e&&ji({target:this.domConverter.viewRangeToDom(e),viewportOffset:20})}},{key:"focus",value:function(){if(!this.document.isFocused){var e=this.document.selection.editableElement;e&&(this.domConverter.focus(e),this.forceRender())}}},{key:"change",value:function(e){if(this.isRenderingInProgress||this._postFixersInProgress)throw new It.b("cannot-change-view-tree: Attempting to make changes to the view when it is in an incorrect state: rendering or post-fixers are in progress. This may cause some unexpected behavior and inconsistency between the DOM and the view.",this);try{if(this._ongoingChange)return e(this._writer);this._ongoingChange=!0;var t=e(this._writer);return this._ongoingChange=!1,!this._renderingDisabled&&this._hasChangedSinceTheLastRendering&&(this._postFixersInProgress=!0,this.document._callPostFixers(this._writer),this._postFixersInProgress=!1,this.fire("render")),t}catch(e){It.b.rethrowUnexpectedError(e,this)}}},{key:"forceRender",value:function(){this._hasChangedSinceTheLastRendering=!0,this.change((function(){}))}},{key:"destroy",value:function(){var e=!0,t=!1,n=void 0;try{for(var r,i=this._observers.values()[Symbol.iterator]();!(e=(r=i.next()).done);e=!0)r.value.destroy()}catch(o){t=!0,n=o}finally{try{e||null==i.return||i.return()}finally{if(t)throw n}}this.document.destroy(),this.stopListening()}},{key:"createPositionAt",value:function(e,t){return Nn._createAt(e,t)}},{key:"createPositionAfter",value:function(e){return Nn._createAfter(e)}},{key:"createPositionBefore",value:function(e){return Nn._createBefore(e)}},{key:"createRange",value:function(e,t){return new In(e,t)}},{key:"createRangeOn",value:function(e){return In._createOn(e)}},{key:"createRangeIn",value:function(e){return In._createIn(e)}},{key:"createSelection",value:function(e,t,n){return new jn(e,t,n)}},{key:"_disableRendering",value:function(e){this._renderingDisabled=e,0==e&&this.change((function(){}))}},{key:"_render",value:function(){this.isRenderingInProgress=!0,this.disableObservers(),this._renderer.render(),this.enableObservers(),this.isRenderingInProgress=!1}}]),e}();function $i(e){return R(e)?Xt(e):new Map(e)}Yt(Yi,wn);var Gi=function(){function e(t){f(this,e),this.parent=null,this._attrs=$i(t)}return d(e,[{key:"getPath",value:function(){for(var e=[],t=this;t.parent;)e.unshift(t.startOffset),t=t.parent;return e}},{key:"getAncestors",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{includeSelf:!1,parentFirst:!1},t=[],n=e.includeSelf?this:this.parent;n;)t[e.parentFirst?"push":"unshift"](n),n=n.parent;return t}},{key:"getCommonAncestor",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getAncestors(t),r=e.getAncestors(t),i=0;n[i]==r[i]&&n[i];)i++;return 0===i?null:n[i-1]}},{key:"isBefore",value:function(e){if(this==e)return!1;if(this.root!==e.root)return!1;var t=this.getPath(),n=e.getPath(),r=$t(t,n);switch(r){case"prefix":return!0;case"extension":return!1;default:return t[r]t.offsetSize)throw new It.b("model-textproxy-wrong-offsetintext: Given offsetInText value is incorrect.",this);if(r<0||n+r>t.offsetSize)throw new It.b("model-textproxy-wrong-length: Given length value is incorrect.",this);this.data=t.data.substring(n,n+r),this.offsetInText=n}return d(e,[{key:"is",value:function(e){return"textProxy"==e||"model:textProxy"==e}},{key:"getPath",value:function(){var e=this.textNode.getPath();return e.length>0&&(e[e.length-1]+=this.offsetInText),e}},{key:"getAncestors",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{includeSelf:!1,parentFirst:!1},t=[],n=e.includeSelf?this:this.parent;n;)t[e.parentFirst?"push":"unshift"](n),n=n.parent;return t}},{key:"hasAttribute",value:function(e){return this.textNode.hasAttribute(e)}},{key:"getAttribute",value:function(e){return this.textNode.getAttribute(e)}},{key:"getAttributes",value:function(){return this.textNode.getAttributes()}},{key:"getAttributeKeys",value:function(){return this.textNode.getAttributeKeys()}},{key:"startOffset",get:function(){return null!==this.textNode.startOffset?this.textNode.startOffset+this.offsetInText:null}},{key:"offsetSize",get:function(){return this.data.length}},{key:"endOffset",get:function(){return null!==this.startOffset?this.startOffset+this.offsetSize:null}},{key:"isPartial",get:function(){return this.offsetSize!==this.textNode.offsetSize}},{key:"parent",get:function(){return this.textNode.parent}},{key:"root",get:function(){return this.textNode.root}},{key:"document",get:function(){return this.textNode.document}}]),e}(),Ji=function(){function e(t){f(this,e),this._nodes=[],t&&this._insertNodes(0,t)}return d(e,[{key:Symbol.iterator,value:function(){return this._nodes[Symbol.iterator]()}},{key:"getNode",value:function(e){return this._nodes[e]||null}},{key:"getNodeIndex",value:function(e){var t=this._nodes.indexOf(e);return-1==t?null:t}},{key:"getNodeStartOffset",value:function(e){var t=this.getNodeIndex(e);return null===t?null:this._nodes.slice(0,t).reduce((function(e,t){return e+t.offsetSize}),0)}},{key:"indexToOffset",value:function(e){if(e==this._nodes.length)return this.maxOffset;var t=this._nodes[e];if(!t)throw new It.b("model-nodelist-index-out-of-bounds: Given index cannot be found in the node list.",this);return this.getNodeStartOffset(t)}},{key:"offsetToIndex",value:function(e){var t=0,n=!0,r=!1,i=void 0;try{for(var o,a=this._nodes[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;if(e>=t&&e1&&void 0!==arguments[1]?arguments[1]:1;return this._nodes.splice(e,t)}},{key:"toJSON",value:function(){return this._nodes.map((function(e){return e.toJSON()}))}},{key:"length",get:function(){return this._nodes.length}},{key:"maxOffset",get:function(){return this._nodes.reduce((function(e,t){return e+t.offsetSize}),0)}}]),e}(),Xi=function(e){function t(e,n,r){var i;return f(this,t),(i=h(this,p(t).call(this,n))).name=e,i._children=new Ji,r&&i._insertChild(0,r),i}return v(t,e),d(t,[{key:"is",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=e.replace(/^model:/,"");return n?"element"==r&&n==this.name:"element"==r||r==this.name||l(p(t.prototype),"is",this).call(this,e)}},{key:"getChild",value:function(e){return this._children.getNode(e)}},{key:"getChildren",value:function(){return this._children[Symbol.iterator]()}},{key:"getChildIndex",value:function(e){return this._children.getNodeIndex(e)}},{key:"getChildStartOffset",value:function(e){return this._children.getNodeStartOffset(e)}},{key:"offsetToIndex",value:function(e){return this._children.offsetToIndex(e)}},{key:"getNodeByPath",value:function(e){var t=this,n=!0,r=!1,i=void 0;try{for(var o,a=e[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;t=t.getChild(t.offsetToIndex(s))}}catch(l){r=!0,i=l}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}return t}},{key:"toJSON",value:function(){var e=l(p(t.prototype),"toJSON",this).call(this);if(e.name=this.name,this._children.length>0){e.children=[];var n=!0,r=!1,i=void 0;try{for(var o,a=this._children[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;e.children.push(s.toJSON())}}catch(u){r=!0,i=u}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}}return e}},{key:"_clone",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=e?Array.from(this._children).map((function(e){return e._clone(!0)})):null;return new t(this.name,this.getAttributes(),n)}},{key:"_appendChild",value:function(e){this._insertChild(this.childCount,e)}},{key:"_insertChild",value:function(e,t){var n=function(e){return"string"==typeof e?[new Qi(e)]:(Zt(e)||(e=[e]),Array.from(e).map((function(e){return"string"==typeof e?new Qi(e):e instanceof Ki?new Qi(e.data,e.getAttributes()):e})))}(t),r=!0,i=!1,o=void 0;try{for(var a,s=n[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var l=a.value;null!==l.parent&&l._remove(),l.parent=this}}catch(u){i=!0,o=u}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}this._children._insertNodes(e,n)}},{key:"_removeChildren",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this._children._removeNodes(e,t),r=!0,i=!1,o=void 0;try{for(var a,s=n[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var l=a.value;l.parent=null}}catch(u){i=!0,o=u}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}},{key:"childCount",get:function(){return this._children.length}},{key:"maxOffset",get:function(){return this._children.maxOffset}},{key:"isEmpty",get:function(){return 0===this.childCount}}],[{key:"fromJSON",value:function(e){var n=null;if(e.children){n=[];var r=!0,i=!1,o=void 0;try{for(var a,s=e.children[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var l=a.value;l.name?n.push(t.fromJSON(l)):n.push(Qi.fromJSON(l))}}catch(u){i=!0,o=u}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}}return new t(e.name,e.attributes,n)}}]),t}(Gi),Zi=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(f(this,e),!t.boundaries&&!t.startPosition)throw new It.b("model-tree-walker-no-start-position: Neither boundaries nor starting position have been defined.",null);var n=t.direction||"forward";if("forward"!=n&&"backward"!=n)throw new It.b("model-tree-walker-unknown-direction: Only `backward` and `forward` direction allowed.",t,{direction:n});this.direction=n,this.boundaries=t.boundaries||null,t.startPosition?this.position=t.startPosition.clone():this.position=to._createAt(this.boundaries["backward"==this.direction?"end":"start"]),this.position.stickiness="toNone",this.singleCharacters=!!t.singleCharacters,this.shallow=!!t.shallow,this.ignoreElementEnd=!!t.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null,this._visitedParent=this.position.parent}return d(e,[{key:Symbol.iterator,value:function(){return this}},{key:"skip",value:function(e){var t,n,r,i;do{var o;r=this.position,i=this._visitedParent,t=(o=this.next()).done,n=o.value}while(!t&&e(n));t||(this.position=r,this._visitedParent=i)}},{key:"next",value:function(){return"forward"==this.direction?this._next():this._previous()}},{key:"_next",value:function(){var e=this.position,t=this.position.clone(),n=this._visitedParent;if(null===n.parent&&t.offset===n.maxOffset)return{done:!0};if(n===this._boundaryEndParent&&t.offset==this.boundaries.end.offset)return{done:!0};var r=t.textNode?t.textNode:t.nodeAfter;if(r instanceof Xi)return this.shallow?t.offset++:(t.path.push(0),this._visitedParent=r),this.position=t,eo("elementStart",r,e,t,1);if(r instanceof Qi){var i;if(this.singleCharacters)i=1;else{var o=r.endOffset;this._boundaryEndParent==n&&this.boundaries.end.offseto&&(o=this.boundaries.start.offset),i=t.offset-o}var a=t.offset-r.startOffset,s=new Ki(r,a-i,i);return t.offset-=i,this.position=t,eo("text",s,e,t,i)}return t.path.pop(),this.position=t,this._visitedParent=n.parent,eo("elementStart",n,e,t,1)}}]),e}();function eo(e,t,n,r,i){return{done:!1,value:{type:e,item:t,previousPosition:n,nextPosition:r,length:i}}}var to=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"toNone";if(f(this,e),!t.is("element")&&!t.is("documentFragment"))throw new It.b("model-position-root-invalid: Position root invalid.",t);if(!(n instanceof Array)||0===n.length)throw new It.b("model-position-path-incorrect-format: Position path must be an array with at least one item.",t,{path:n});n=t.getPath().concat(n),t=t.root,this.root=t,this.path=n,this.stickiness=r}return d(e,[{key:"compareWith",value:function(e){if(this.root!=e.root)return"different";var t=$t(this.path,e.path);switch(t){case"same":return"same";case"prefix":return"before";case"extension":return"after";default:return this.path[t]1&&void 0!==arguments[1]?arguments[1]:{};t.startPosition=this;var n=new Zi(t);return n.skip(e),n.position}},{key:"getParentPath",value:function(){return this.path.slice(0,-1)}},{key:"getAncestors",value:function(){return this.parent.is("documentFragment")?[this.parent]:this.parent.getAncestors({includeSelf:!0})}},{key:"getCommonPath",value:function(e){if(this.root!=e.root)return[];var t=$t(this.path,e.path),n="string"==typeof t?Math.min(this.path.length,e.path.length):t;return this.path.slice(0,n)}},{key:"getCommonAncestor",value:function(e){for(var t=this.getAncestors(),n=e.getAncestors(),r=0;t[r]==n[r]&&t[r];)r++;return 0===r?null:t[r-1]}},{key:"getShiftedBy",value:function(e){var t=this.clone(),n=t.offset+e;return t.offset=n<0?0:n,t}},{key:"isAfter",value:function(e){return"after"==this.compareWith(e)}},{key:"isBefore",value:function(e){return"before"==this.compareWith(e)}},{key:"isEqual",value:function(e){return"same"==this.compareWith(e)}},{key:"isTouching",value:function(t){var n=null,r=null;switch(this.compareWith(t)){case"same":return!0;case"before":n=e._createAt(this),r=e._createAt(t);break;case"after":n=e._createAt(t),r=e._createAt(this);break;default:return!1}for(var i=n.parent;n.path.length+r.path.length;){if(n.isEqual(r))return!0;if(n.path.length>r.path.length){if(n.offset!==i.maxOffset)return!1;n.path=n.path.slice(0,-1),i=i.parent,n.offset++}else{if(0!==r.offset)return!1;r.path=r.path.slice(0,-1)}}}},{key:"is",value:function(e){return"position"==e||"model:position"==e}},{key:"hasSameParentAs",value:function(e){return this.root===e.root&&"same"==$t(this.getParentPath(),e.getParentPath())}},{key:"getTransformedByOperation",value:function(t){var n;switch(t.type){case"insert":n=this._getTransformedByInsertOperation(t);break;case"move":case"remove":case"reinsert":n=this._getTransformedByMoveOperation(t);break;case"split":n=this._getTransformedBySplitOperation(t);break;case"merge":n=this._getTransformedByMergeOperation(t);break;default:n=e._createAt(this)}return n}},{key:"_getTransformedByInsertOperation",value:function(e){return this._getTransformedByInsertion(e.position,e.howMany)}},{key:"_getTransformedByMoveOperation",value:function(e){return this._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany)}},{key:"_getTransformedBySplitOperation",value:function(e){var t=e.movedRange;return t.containsPosition(this)||t.start.isEqual(this)&&"toNext"==this.stickiness?this._getCombined(e.splitPosition,e.moveTargetPosition):e.graveyardPosition?this._getTransformedByMove(e.graveyardPosition,e.insertionPosition,1):this._getTransformedByInsertion(e.insertionPosition,1)}},{key:"_getTransformedByMergeOperation",value:function(t){var n,r=t.movedRange;return r.containsPosition(this)||r.start.isEqual(this)?(n=this._getCombined(t.sourcePosition,t.targetPosition),t.sourcePosition.isBefore(t.targetPosition)&&(n=n._getTransformedByDeletion(t.deletionPosition,1))):n=this.isEqual(t.deletionPosition)?e._createAt(t.deletionPosition):this._getTransformedByMove(t.deletionPosition,t.graveyardPosition,1),n}},{key:"_getTransformedByDeletion",value:function(t,n){var r=e._createAt(this);if(this.root!=t.root)return r;if("same"==$t(t.getParentPath(),this.getParentPath())){if(t.offsetthis.offset)return null;r.offset-=n}}else if("prefix"==$t(t.getParentPath(),this.getParentPath())){var i=t.path.length-1;if(t.offset<=this.path[i]){if(t.offset+n>this.path[i])return null;r.path[i]-=n}}return r}},{key:"_getTransformedByInsertion",value:function(t,n){var r=e._createAt(this);if(this.root!=t.root)return r;if("same"==$t(t.getParentPath(),this.getParentPath()))(t.offset2&&void 0!==arguments[2]?arguments[2]:"toNone";if(t instanceof e)return new e(t.root,t.path,t.stickiness);var i=t;if("end"==n)n=i.maxOffset;else{if("before"==n)return this._createBefore(i,r);if("after"==n)return this._createAfter(i,r);if(0!==n&&!n)throw new It.b("model-createPositionAt-offset-required: Model#createPositionAt() requires the offset when the first parameter is a model item.",[this,t])}if(!i.is("element")&&!i.is("documentFragment"))throw new It.b("model-position-parent-incorrect: Position parent have to be a element or document fragment.",[this,t]);var o=i.getPath();return o.push(n),new this(i.root,o,r)}},{key:"_createAfter",value:function(e,t){if(!e.parent)throw new It.b("model-position-after-root: You cannot make a position after root.",[this,e],{root:e});return this._createAt(e.parent,e.endOffset,t)}},{key:"_createBefore",value:function(e,t){if(!e.parent)throw new It.b("model-position-before-root: You cannot make a position before root.",e,{root:e});return this._createAt(e.parent,e.startOffset,t)}},{key:"fromJSON",value:function(t,n){if("$graveyard"===t.root){var r=new e(n.graveyard,t.path);return r.stickiness=t.stickiness,r}if(!n.getRoot(t.root))throw new It.b("model-position-fromjson-no-root: Cannot create position for document. Root with specified name does not exist.",n,{rootName:t.root});return new e(n.getRoot(t.root),t.path,t.stickiness)}}]),e}(),no=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;f(this,e),this.start=to._createAt(t),this.end=n?to._createAt(n):to._createAt(t),this.start.stickiness=this.isCollapsed?"toNone":"toNext",this.end.stickiness=this.isCollapsed?"toNone":"toPrevious"}return d(e,[{key:Symbol.iterator,value:s.mark((function e(){return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.delegateYield(new Zi({boundaries:this,ignoreElementEnd:!0}),"t0",1);case 1:case"end":return e.stop()}}),e,this)}))},{key:"containsPosition",value:function(e){return e.isAfter(this.start)&&e.isBefore(this.end)}},{key:"containsRange",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e.isCollapsed&&(t=!1);var n=this.containsPosition(e.start)||t&&this.start.isEqual(e.start),r=this.containsPosition(e.end)||t&&this.end.isEqual(e.end);return n&&r}},{key:"containsItem",value:function(e){var t=to._createBefore(e);return this.containsPosition(t)||this.start.isEqual(t)}},{key:"is",value:function(e){return"range"==e||"model:range"==e}},{key:"isEqual",value:function(e){return this.start.isEqual(e.start)&&this.end.isEqual(e.end)}},{key:"isIntersecting",value:function(e){return this.start.isBefore(e.end)&&this.end.isAfter(e.start)}},{key:"getDifference",value:function(t){var n=[];return this.isIntersecting(t)?(this.containsPosition(t.start)&&n.push(new e(this.start,t.start)),this.containsPosition(t.end)&&n.push(new e(t.end,this.end))):n.push(new e(this.start,this.end)),n}},{key:"getIntersection",value:function(t){if(this.isIntersecting(t)){var n=this.start,r=this.end;return this.containsPosition(t.start)&&(n=t.start),this.containsPosition(t.end)&&(r=t.end),new e(n,r)}return null}},{key:"getMinimalFlatRanges",value:function(){for(var t=[],n=this.start.getCommonPath(this.end).length,r=to._createAt(this.start),i=r.parent;r.path.length>n+1;){var o=i.maxOffset-r.offset;0!==o&&t.push(new e(r,r.getShiftedBy(o))),r.path=r.path.slice(0,-1),r.offset++,i=i.parent}for(;r.path.length<=this.end.path.length;){var a=this.end.path[r.path.length-1],s=a-r.offset;0!==s&&t.push(new e(r,r.getShiftedBy(s))),r.offset=a,r.path.push(0)}return t}},{key:"getWalker",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.boundaries=this,new Zi(e)}},{key:"getItems",value:s.mark((function e(){var t,n,r,i,o,a,l,u,c=arguments;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(t=c.length>0&&void 0!==c[0]?c[0]:{}).boundaries=this,t.ignoreElementEnd=!0,n=new Zi(t),r=!0,i=!1,o=void 0,e.prev=6,a=n[Symbol.iterator]();case 8:if(r=(l=a.next()).done){e.next=15;break}return u=l.value,e.next=12,u.item;case 12:r=!0,e.next=8;break;case 15:e.next=21;break;case 17:e.prev=17,e.t0=e.catch(6),i=!0,o=e.t0;case 21:e.prev=21,e.prev=22,r||null==a.return||a.return();case 24:if(e.prev=24,!i){e.next=27;break}throw o;case 27:return e.finish(24);case 28:return e.finish(21);case 29:case"end":return e.stop()}}),e,this,[[6,17,21,29],[22,,24,28]])}))},{key:"getPositions",value:s.mark((function e(){var t,n,r,i,o,a,l,u,c=arguments;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(t=c.length>0&&void 0!==c[0]?c[0]:{}).boundaries=this,n=new Zi(t),e.next=5,n.position;case 5:r=!0,i=!1,o=void 0,e.prev=8,a=n[Symbol.iterator]();case 10:if(r=(l=a.next()).done){e.next=17;break}return u=l.value,e.next=14,u.nextPosition;case 14:r=!0,e.next=10;break;case 17:e.next=23;break;case 19:e.prev=19,e.t0=e.catch(8),i=!0,o=e.t0;case 23:e.prev=23,e.prev=24,r||null==a.return||a.return();case 26:if(e.prev=26,!i){e.next=29;break}throw o;case 29:return e.finish(26);case 30:return e.finish(23);case 31:case"end":return e.stop()}}),e,this,[[8,19,23,31],[24,,26,30]])}))},{key:"getTransformedByOperation",value:function(t){switch(t.type){case"insert":return this._getTransformedByInsertOperation(t);case"move":case"remove":case"reinsert":return this._getTransformedByMoveOperation(t);case"split":return[this._getTransformedBySplitOperation(t)];case"merge":return[this._getTransformedByMergeOperation(t)]}return[new e(this.start,this.end)]}},{key:"getTransformedByOperations",value:function(t){var n=[new e(this.start,this.end)],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done);r=!0)for(var l=a.value,c=0;c1&&void 0!==arguments[1]&&arguments[1];return this._getTransformedByInsertion(e.position,e.howMany,t)}},{key:"_getTransformedByMoveOperation",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.sourcePosition,r=e.howMany,i=e.targetPosition;return this._getTransformedByMove(n,i,r,t)}},{key:"_getTransformedBySplitOperation",value:function(t){var n=this.start._getTransformedBySplitOperation(t),r=this.end._getTransformedBySplitOperation(t);return this.end.isEqual(t.insertionPosition)&&(r=this.end.getShiftedBy(1)),n.root!=r.root&&(r=this.end.getShiftedBy(-1)),new e(n,r)}},{key:"_getTransformedByMergeOperation",value:function(t){if(this.start.isEqual(t.targetPosition)&&this.end.isEqual(t.deletionPosition))return new e(this.start);var n=this.start._getTransformedByMergeOperation(t),r=this.end._getTransformedByMergeOperation(t);return n.root!=r.root&&(r=this.end.getShiftedBy(-1)),n.isAfter(r)?(t.sourcePosition.isBefore(t.targetPosition)?(n=to._createAt(r)).offset=0:(t.deletionPosition.isEqual(n)||(r=t.deletionPosition),n=t.targetPosition),new e(n,r)):new e(n,r)}},{key:"_getTransformedByInsertion",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(r&&this.containsPosition(t))return[new e(this.start,t),new e(t.getShiftedBy(n),this.end._getTransformedByInsertion(t,n))];var i=new e(this.start,this.end);return i.start=i.start._getTransformedByInsertion(t,n),i.end=i.end._getTransformedByInsertion(t,n),[i]}},{key:"_getTransformedByMove",value:function(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(this.isCollapsed){var o=this.start._getTransformedByMove(t,n,r);return[new e(o)]}var a,s=e._createFromPositionAndShift(t,r),l=n._getTransformedByDeletion(t,r);if(this.containsPosition(n)&&!i&&(s.containsPosition(this.start)||s.containsPosition(this.end))){var u=this.start._getTransformedByMove(t,n,r),c=this.end._getTransformedByMove(t,n,r);return[new e(u,c)]}var f=this.getDifference(s),d=null,h=this.getIntersection(s);if(1==f.length?d=new e(f[0].start._getTransformedByDeletion(t,r),f[0].end._getTransformedByDeletion(t,r)):2==f.length&&(d=new e(this.start,this.end._getTransformedByDeletion(t,r))),a=d?d._getTransformedByInsertion(l,r,null!==h||i):[],h){var p=new e(h.start._getCombined(s.start,l),h.end._getCombined(s.start,l));2==a.length?a.splice(1,0,p):a.push(p)}return a}},{key:"_getTransformedByDeletion",value:function(t,n){var r=this.start._getTransformedByDeletion(t,n),i=this.end._getTransformedByDeletion(t,n);return null==r&&null==i?null:(null==r&&(r=t),null==i&&(i=t),new e(r,i))}},{key:"isCollapsed",get:function(){return this.start.isEqual(this.end)}},{key:"isFlat",get:function(){return"same"==$t(this.start.getParentPath(),this.end.getParentPath())}},{key:"root",get:function(){return this.start.root}}],[{key:"_createFromPositionAndShift",value:function(e,t){var n=e,r=e.getShiftedBy(t);return t>0?new this(n,r):new this(r,n)}},{key:"_createIn",value:function(e){return new this(to._createAt(e,0),to._createAt(e,e.maxOffset))}},{key:"_createOn",value:function(e){return this._createFromPositionAndShift(to._createBefore(e),e.offsetSize)}},{key:"_createFromRanges",value:function(e){if(0===e.length)throw new It.b("range-create-from-ranges-empty-array: At least one range has to be passed.",null);if(1==e.length)return e[0].clone();var t=e[0];e.sort((function(e,t){return e.start.isAfter(t.start)?1:-1}));var n=e.indexOf(t),r=new this(t.start,t.end);if(n>0)for(var i=n-1;e[i].end.isEqual(r.start);i++)r.start=to._createAt(e[i].start);for(var o=n+1;o1&&void 0!==arguments[1]?arguments[1]:{isPhantom:!1},n={modelPosition:e,mapper:this,isPhantom:t.isPhantom};return this.fire("modelToViewPosition",n),n.viewPosition}},{key:"markerNameToElements",value:function(e){var t=this._markerNameToElements.get(e);if(!t)return null;var n=new Set,r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var l=a.value;if(l.is("attributeElement")){var u=!0,c=!1,f=void 0;try{for(var d,h=l.getElementsWithSameId()[Symbol.iterator]();!(u=(d=h.next()).done);u=!0){var p=d.value;n.add(p)}}catch(v){c=!0,f=v}finally{try{u||null==h.return||h.return()}finally{if(c)throw f}}}else n.add(l)}}catch(v){i=!0,o=v}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}},{key:"registerViewToModelLength",value:function(e,t){this._viewToModelLengthCallbacks.set(e,t)}},{key:"findMappedViewAncestor",value:function(e){for(var t=e.parent;!this._viewToModelMapping.has(t);)t=t.parent;return t}},{key:"_toModelOffset",value:function(e,t,n){if(n!=e)return this._toModelOffset(e.parent,e.index,n)+this._toModelOffset(e,t,e);if(e.is("text"))return t;for(var r=0,i=0;i1?t[0]+":"+t[1]:t[0]}var ao=function(){function e(t){f(this,e),this.conversionApi=mn({dispatcher:this},t)}return d(e,[{key:"convertChanges",value:function(e,t,n){var r=!0,i=!1,o=void 0;try{for(var a,s=e.getMarkersToRemove()[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var l=a.value;this.convertMarkerRemove(l.name,l.range,n)}}catch(A){i=!0,o=A}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}var u=!0,c=!1,f=void 0;try{for(var d,h=e.getChanges()[Symbol.iterator]();!(u=(d=h.next()).done);u=!0){var p=d.value;"insert"==p.type?this.convertInsert(no._createFromPositionAndShift(p.position,p.length),n):"remove"==p.type?this.convertRemove(p.position,p.length,p.name,n):this.convertAttribute(p.range,p.attributeKey,p.attributeOldValue,p.attributeNewValue,n)}}catch(A){c=!0,f=A}finally{try{u||null==h.return||h.return()}finally{if(c)throw f}}var v=!0,m=!1,g=void 0;try{for(var y,b=this.conversionApi.mapper.flushUnboundMarkerNames()[Symbol.iterator]();!(v=(y=b.next()).done);v=!0){var k=y.value,w=t.get(k).getRange();this.convertMarkerRemove(k,w,n),this.convertMarkerAdd(k,w,n)}}catch(A){m=!0,g=A}finally{try{v||null==b.return||b.return()}finally{if(m)throw g}}var _=!0,x=!1,T=void 0;try{for(var C,S=e.getMarkersToAdd()[Symbol.iterator]();!(_=(C=S.next()).done);_=!0){var E=C.value;this.convertMarkerAdd(E.name,E.range,n)}}catch(A){x=!0,T=A}finally{try{_||null==S.return||S.return()}finally{if(x)throw T}}}},{key:"convertInsert",value:function(e,t){this.conversionApi.writer=t,this.conversionApi.consumable=this._createInsertConsumable(e);var n=!0,r=!1,i=void 0;try{for(var o,a=e[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value,l=s.item,u={item:l,range:no._createFromPositionAndShift(s.previousPosition,s.length)};this._testAndFire("insert",u);var c=!0,f=!1,d=void 0;try{for(var h,p=l.getAttributeKeys()[Symbol.iterator]();!(c=(h=p.next()).done);c=!0){var v=h.value;u.attributeKey=v,u.attributeOldValue=null,u.attributeNewValue=l.getAttribute(v),this._testAndFire("attribute:".concat(v),u)}}catch(m){f=!0,d=m}finally{try{c||null==p.return||p.return()}finally{if(f)throw d}}}}catch(m){r=!0,i=m}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}this._clearConversionApi()}},{key:"convertRemove",value:function(e,t,n,r){this.conversionApi.writer=r,this.fire("remove:"+n,{position:e,length:t},this.conversionApi),this._clearConversionApi()}},{key:"convertAttribute",value:function(e,t,n,r,i){this.conversionApi.writer=i,this.conversionApi.consumable=this._createConsumableForRange(e,"attribute:".concat(t));var o=!0,a=!1,s=void 0;try{for(var l,u=e[Symbol.iterator]();!(o=(l=u.next()).done);o=!0){var c=l.value,f={item:c.item,range:no._createFromPositionAndShift(c.previousPosition,c.length),attributeKey:t,attributeOldValue:n,attributeNewValue:r};this._testAndFire("attribute:".concat(t),f)}}catch(d){a=!0,s=d}finally{try{o||null==u.return||u.return()}finally{if(a)throw s}}this._clearConversionApi()}},{key:"convertSelection",value:function(e,t,n){var r=Array.from(t.getMarkersAtPosition(e.getFirstPosition()));if(this.conversionApi.writer=n,this.conversionApi.consumable=this._createSelectionConsumable(e,r),this.fire("selection",{selection:e},this.conversionApi),e.isCollapsed){var i=!0,o=!1,a=void 0;try{for(var s,l=r[Symbol.iterator]();!(i=(s=l.next()).done);i=!0){var u=s.value,c=u.getRange();if(so(e.getFirstPosition(),u,this.conversionApi.mapper)){var f={item:e,markerName:u.name,markerRange:c};this.conversionApi.consumable.test(e,"addMarker:"+u.name)&&this.fire("addMarker:"+u.name,f,this.conversionApi)}}}catch(b){o=!0,a=b}finally{try{i||null==l.return||l.return()}finally{if(o)throw a}}var d=!0,h=!1,p=void 0;try{for(var v,m=e.getAttributeKeys()[Symbol.iterator]();!(d=(v=m.next()).done);d=!0){var g=v.value,y={item:e,range:e.getFirstRange(),attributeKey:g,attributeOldValue:null,attributeNewValue:e.getAttribute(g)};this.conversionApi.consumable.test(e,"attribute:"+y.attributeKey)&&this.fire("attribute:"+y.attributeKey+":$text",y,this.conversionApi)}}catch(b){h=!0,p=b}finally{try{d||null==m.return||m.return()}finally{if(h)throw p}}this._clearConversionApi()}}},{key:"convertMarkerAdd",value:function(e,t,n){if(t.root.document&&"$graveyard"!=t.root.rootName){this.conversionApi.writer=n;var r="addMarker:"+e,i=new io;if(i.add(t,r),this.conversionApi.consumable=i,this.fire(r,{markerName:e,markerRange:t},this.conversionApi),i.test(t,r)){this.conversionApi.consumable=this._createConsumableForRange(t,r);var o=!0,a=!1,s=void 0;try{for(var l,u=t.getItems()[Symbol.iterator]();!(o=(l=u.next()).done);o=!0){var c=l.value;if(this.conversionApi.consumable.test(c,r)){var f={item:c,range:no._createOn(c),markerName:e,markerRange:t};this.fire(r,f,this.conversionApi)}}}catch(d){a=!0,s=d}finally{try{o||null==u.return||u.return()}finally{if(a)throw s}}this._clearConversionApi()}}}},{key:"convertMarkerRemove",value:function(e,t,n){t.root.document&&"$graveyard"!=t.root.rootName&&(this.conversionApi.writer=n,this.fire("removeMarker:"+e,{markerName:e,markerRange:t},this.conversionApi),this._clearConversionApi())}},{key:"_createInsertConsumable",value:function(e){var t=new io,n=!0,r=!1,i=void 0;try{for(var o,a=e[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value.item;t.add(s,"insert");var l=!0,u=!1,c=void 0;try{for(var f,d=s.getAttributeKeys()[Symbol.iterator]();!(l=(f=d.next()).done);l=!0){var h=f.value;t.add(s,"attribute:"+h)}}catch(p){u=!0,c=p}finally{try{l||null==d.return||d.return()}finally{if(u)throw c}}}}catch(p){r=!0,i=p}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}return t}},{key:"_createConsumableForRange",value:function(e,t){var n=new io,r=!0,i=!1,o=void 0;try{for(var a,s=e.getItems()[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var l=a.value;n.add(l,t)}}catch(u){i=!0,o=u}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}},{key:"_createSelectionConsumable",value:function(e,t){var n=new io;n.add(e,"selection");var r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var l=a.value;n.add(e,"addMarker:"+l.name)}}catch(v){i=!0,o=v}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}var u=!0,c=!1,f=void 0;try{for(var d,h=e.getAttributeKeys()[Symbol.iterator]();!(u=(d=h.next()).done);u=!0){var p=d.value;n.add(e,"attribute:"+p)}}catch(v){c=!0,f=v}finally{try{u||null==h.return||h.return()}finally{if(c)throw f}}return n}},{key:"_testAndFire",value:function(e,t){if(this.conversionApi.consumable.test(t.item,e)){var n=t.item.name||"$text";this.fire(e+":"+n,t,this.conversionApi)}}},{key:"_clearConversionApi",value:function(){delete this.conversionApi.writer,delete this.conversionApi.consumable}}]),e}();function so(e,t,n){var r=t.getRange(),i=Array.from(e.getAncestors());return i.shift(),i.reverse(),!i.some((function(e){if(r.containsItem(e))return!!n.toViewElement(e).getCustomProperty("addHighlight")}))}Yt(ao,zt);var lo=function(){function e(t,n,r){f(this,e),this._lastRangeBackward=!1,this._ranges=[],this._attrs=new Map,t&&this.setTo(t,n,r)}return d(e,[{key:"isEqual",value:function(e){if(this.rangeCount!=e.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(e.anchor)||!this.focus.isEqual(e.focus))return!1;var t=!0,n=!1,r=void 0;try{for(var i,o=this._ranges[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value,s=!1,l=!0,u=!1,c=void 0;try{for(var f,d=e._ranges[Symbol.iterator]();!(l=(f=d.next()).done);l=!0){var h=f.value;if(a.isEqual(h)){s=!0;break}}}catch(p){u=!0,c=p}finally{try{l||null==d.return||d.return()}finally{if(u)throw c}}if(!s)return!1}}catch(p){n=!0,r=p}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}return!0}},{key:"getRanges",value:s.mark((function e(){var t,n,r,i,o,a;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=!0,n=!1,r=void 0,e.prev=3,i=this._ranges[Symbol.iterator]();case 5:if(t=(o=i.next()).done){e.next=12;break}return a=o.value,e.next=9,new no(a.start,a.end);case 9:t=!0,e.next=5;break;case 12:e.next=18;break;case 14:e.prev=14,e.t0=e.catch(3),n=!0,r=e.t0;case 18:e.prev=18,e.prev=19,t||null==i.return||i.return();case 21:if(e.prev=21,!n){e.next=24;break}throw r;case 24:return e.finish(21);case 25:return e.finish(18);case 26:case"end":return e.stop()}}),e,this,[[3,14,18,26],[19,,21,25]])}))},{key:"getFirstRange",value:function(){var e=null,t=!0,n=!1,r=void 0;try{for(var i,o=this._ranges[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value;e&&!a.start.isBefore(e.start)||(e=a)}}catch(s){n=!0,r=s}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}return e?new no(e.start,e.end):null}},{key:"getLastRange",value:function(){var e=null,t=!0,n=!1,r=void 0;try{for(var i,o=this._ranges[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value;e&&!a.end.isAfter(e.end)||(e=a)}}catch(s){n=!0,r=s}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}return e?new no(e.start,e.end):null}},{key:"getFirstPosition",value:function(){var e=this.getFirstRange();return e?e.start.clone():null}},{key:"getLastPosition",value:function(){var e=this.getLastRange();return e?e.end.clone():null}},{key:"setTo",value:function(t,n,r){if(null===t)this._setRanges([]);else if(t instanceof e)this._setRanges(t.getRanges(),t.isBackward);else if(t&&"function"==typeof t.getRanges)this._setRanges(t.getRanges(),t.isBackward);else if(t instanceof no)this._setRanges([t],!!n&&!!n.backward);else if(t instanceof to)this._setRanges([new no(t)]);else if(t instanceof Gi){var i,o=!!r&&!!r.backward;if("in"==n)i=no._createIn(t);else if("on"==n)i=no._createOn(t);else{if(void 0===n)throw new It.b("model-selection-setTo-required-second-parameter: selection.setTo requires the second parameter when the first parameter is a node.",[this,t]);i=new no(to._createAt(t,n))}this._setRanges([i],o)}else{if(!Zt(t))throw new It.b("model-selection-setTo-not-selectable: Cannot set the selection to the given place.",[this,t]);this._setRanges(t,n&&!!n.backward)}}},{key:"_setRanges",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=(e=Array.from(e)).some((function(n){if(!(n instanceof no))throw new It.b("model-selection-set-ranges-not-range: Selection range set to an object that is not an instance of model.Range.",[t,e]);return t._ranges.every((function(e){return!e.isEqual(n)}))}));if(e.length!==this._ranges.length||r){this._removeAllRanges();var i=!0,o=!1,a=void 0;try{for(var s,l=e[Symbol.iterator]();!(i=(s=l.next()).done);i=!0){var u=s.value;this._pushRange(u)}}catch(c){o=!0,a=c}finally{try{i||null==l.return||l.return()}finally{if(o)throw a}}this._lastRangeBackward=!!n,this.fire("change:range",{directChange:!0})}}},{key:"setFocus",value:function(e,t){if(null===this.anchor)throw new It.b("model-selection-setFocus-no-ranges: Cannot set selection focus if there are no ranges in selection.",[this,e]);var n=to._createAt(e,t);if("same"!=n.compareWith(this.focus)){var r=this.anchor;this._ranges.length&&this._popRange(),"before"==n.compareWith(r)?(this._pushRange(new no(n,r)),this._lastRangeBackward=!0):(this._pushRange(new no(r,n)),this._lastRangeBackward=!1),this.fire("change:range",{directChange:!0})}}},{key:"getAttribute",value:function(e){return this._attrs.get(e)}},{key:"getAttributes",value:function(){return this._attrs.entries()}},{key:"getAttributeKeys",value:function(){return this._attrs.keys()}},{key:"hasAttribute",value:function(e){return this._attrs.has(e)}},{key:"removeAttribute",value:function(e){this.hasAttribute(e)&&(this._attrs.delete(e),this.fire("change:attribute",{attributeKeys:[e],directChange:!0}))}},{key:"setAttribute",value:function(e,t){this.getAttribute(e)!==t&&(this._attrs.set(e,t),this.fire("change:attribute",{attributeKeys:[e],directChange:!0}))}},{key:"getSelectedElement",value:function(){if(1!==this.rangeCount)return null;var e=this.getFirstRange(),t=e.start.nodeAfter,n=e.end.nodeBefore;return t instanceof Xi&&t==n?t:null}},{key:"is",value:function(e){return"selection"==e||"model:selection"==e}},{key:"getSelectedBlocks",value:s.mark((function e(){var t,n,r,i,o,a,l,u,c,f,d,h,p,v,m,g;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=new WeakSet,n=!0,r=!1,i=void 0,e.prev=4,o=this.getRanges()[Symbol.iterator]();case 6:if(n=(a=o.next()).done){e.next=50;break}if(l=a.value,u=fo(l.start,t),e.t0=u&&ho(u,l),!e.t0){e.next=13;break}return e.next=13,u;case 13:c=!0,f=!1,d=void 0,e.prev=16,h=l.getWalker()[Symbol.iterator]();case 18:if(c=(p=h.next()).done){e.next=28;break}if(v=p.value,m=v.item,e.t1="elementEnd"==v.type&&co(m,t,l),!e.t1){e.next=25;break}return e.next=25,m;case 25:c=!0,e.next=18;break;case 28:e.next=34;break;case 30:e.prev=30,e.t2=e.catch(16),f=!0,d=e.t2;case 34:e.prev=34,e.prev=35,c||null==h.return||h.return();case 37:if(e.prev=37,!f){e.next=40;break}throw d;case 40:return e.finish(37);case 41:return e.finish(34);case 42:if(g=fo(l.end,t),e.t3=g&&!l.end.isTouching(to._createAt(g,0))&&ho(g,l),!e.t3){e.next=47;break}return e.next=47,g;case 47:n=!0,e.next=6;break;case 50:e.next=56;break;case 52:e.prev=52,e.t4=e.catch(4),r=!0,i=e.t4;case 56:e.prev=56,e.prev=57,n||null==o.return||o.return();case 59:if(e.prev=59,!r){e.next=62;break}throw i;case 62:return e.finish(59);case 63:return e.finish(56);case 64:case"end":return e.stop()}}),e,this,[[4,52,56,64],[16,30,34,42],[35,,37,41],[57,,59,63]])}))},{key:"containsEntireContent",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.anchor.root,t=to._createAt(e,0),n=to._createAt(e,"end");return t.isTouching(this.getFirstPosition())&&n.isTouching(this.getLastPosition())}},{key:"_pushRange",value:function(e){this._checkRange(e),this._ranges.push(new no(e.start,e.end))}},{key:"_checkRange",value:function(e){for(var t=0;t0;)this._popRange()}},{key:"_popRange",value:function(){this._ranges.pop()}},{key:"anchor",get:function(){if(this._ranges.length>0){var e=this._ranges[this._ranges.length-1];return this._lastRangeBackward?e.end:e.start}return null}},{key:"focus",get:function(){if(this._ranges.length>0){var e=this._ranges[this._ranges.length-1];return this._lastRangeBackward?e.start:e.end}return null}},{key:"isCollapsed",get:function(){return 1===this._ranges.length&&this._ranges[0].isCollapsed}},{key:"rangeCount",get:function(){return this._ranges.length}},{key:"isBackward",get:function(){return!this.isCollapsed&&this._lastRangeBackward}}]),e}();function uo(e,t){return!t.has(e)&&(t.add(e),e.document.model.schema.isBlock(e)&&e.parent)}function co(e,t,n){return uo(e,t)&&ho(e,n)}function fo(e,t){var n=e.parent.document.model.schema,r=e.parent.getAncestors({parentFirst:!0,includeSelf:!0}),i=!1,o=r.find((function(e){return!i&&!(i=n.isLimit(e))&&uo(e,t)}));return r.forEach((function(e){return t.add(e)})),o}function ho(e,t){var n=function(e){for(var t=e.document.model.schema,n=e.parent;n;){if(t.isBlock(n))return n;n=n.parent}}(e);return!n||!t.containsRange(no._createOn(n),!0)}Yt(lo,zt);var po=function(e){function t(e,n){var r;return f(this,t),r=h(this,p(t).call(this,e,n)),vo.call(o(r)),r}return v(t,e),d(t,[{key:"detach",value:function(){this.stopListening()}},{key:"is",value:function(e){return"liveRange"==e||"model:liveRange"==e||l(p(t.prototype),"is",this).call(this,e)}},{key:"toRange",value:function(){return new no(this.start,this.end)}}],[{key:"fromRange",value:function(e){return new t(e.start,e.end)}}]),t}(no);function vo(){var e=this;this.listenTo(this.root.document.model,"applyOperation",(function(t,n){var r=n[0];r.isDocumentOperation&&mo.call(e,r)}),{priority:"low"})}function mo(e){var t=this.getTransformedByOperation(e),n=no._createFromRanges(t),r=!n.isEqual(this),i=function(e,t){switch(t.type){case"insert":return e.containsPosition(t.position);case"move":case"remove":case"reinsert":case"merge":return e.containsPosition(t.sourcePosition)||e.start.isEqual(t.sourcePosition)||e.containsPosition(t.targetPosition);case"split":return e.containsPosition(t.splitPosition)||e.containsPosition(t.insertionPosition)}return!1}(this,e),o=null;if(r){"$graveyard"==n.root.rootName&&(o="remove"==e.type?e.sourcePosition:e.deletionPosition);var a=this.toRange();this.start=n.start,this.end=n.end,this.fire("change:range",a,{deletionPosition:o})}else i&&this.fire("change:content",this.toRange(),{deletionPosition:o})}Yt(po,zt);var go="selection:",yo=function(){function e(t){f(this,e),this._selection=new bo(t),this._selection.delegate("change:range").to(this),this._selection.delegate("change:attribute").to(this)}return d(e,[{key:"getRanges",value:function(){return this._selection.getRanges()}},{key:"getFirstPosition",value:function(){return this._selection.getFirstPosition()}},{key:"getLastPosition",value:function(){return this._selection.getLastPosition()}},{key:"getFirstRange",value:function(){return this._selection.getFirstRange()}},{key:"getLastRange",value:function(){return this._selection.getLastRange()}},{key:"getSelectedBlocks",value:function(){return this._selection.getSelectedBlocks()}},{key:"getSelectedElement",value:function(){return this._selection.getSelectedElement()}},{key:"containsEntireContent",value:function(e){return this._selection.containsEntireContent(e)}},{key:"destroy",value:function(){this._selection.destroy()}},{key:"getAttributeKeys",value:function(){return this._selection.getAttributeKeys()}},{key:"getAttributes",value:function(){return this._selection.getAttributes()}},{key:"getAttribute",value:function(e){return this._selection.getAttribute(e)}},{key:"hasAttribute",value:function(e){return this._selection.hasAttribute(e)}},{key:"refresh",value:function(){this._selection._updateMarkers(),this._selection._updateAttributes(!1)}},{key:"is",value:function(e){return"selection"==e||"model:selection"==e||"documentSelection"==e||"model:documentSelection"==e}},{key:"_setFocus",value:function(e,t){this._selection.setFocus(e,t)}},{key:"_setTo",value:function(e,t,n){this._selection.setTo(e,t,n)}},{key:"_setAttribute",value:function(e,t){this._selection.setAttribute(e,t)}},{key:"_removeAttribute",value:function(e){this._selection.removeAttribute(e)}},{key:"_getStoredAttributes",value:function(){return this._selection._getStoredAttributes()}},{key:"_overrideGravity",value:function(){return this._selection.overrideGravity()}},{key:"_restoreGravity",value:function(e){this._selection.restoreGravity(e)}},{key:"isCollapsed",get:function(){return this._selection.isCollapsed}},{key:"anchor",get:function(){return this._selection.anchor}},{key:"focus",get:function(){return this._selection.focus}},{key:"rangeCount",get:function(){return this._selection.rangeCount}},{key:"hasOwnRange",get:function(){return this._selection.hasOwnRange}},{key:"isBackward",get:function(){return this._selection.isBackward}},{key:"isGravityOverridden",get:function(){return this._selection.isGravityOverridden}},{key:"markers",get:function(){return this._selection.markers}},{key:"_ranges",get:function(){return this._selection._ranges}}],[{key:"_getStoreAttributeKey",value:function(e){return go+e}},{key:"_isStoreAttributeKey",value:function(e){return e.startsWith(go)}}]),e}();Yt(yo,zt);var bo=function(e){function t(e){var n;return f(this,t),(n=h(this,p(t).call(this))).markers=new Fn({idProperty:"name"}),n._model=e.model,n._document=e,n._attributePriority=new Map,n._fixGraveyardRangesData=[],n._hasChangedRange=!1,n._overriddenGravityRegister=new Set,n.listenTo(n._model,"applyOperation",(function(e,t){var r=t[0];if(r.isDocumentOperation&&"marker"!=r.type&&"rename"!=r.type&&"noop"!=r.type){for(;n._fixGraveyardRangesData.length;){var i=n._fixGraveyardRangesData.shift(),o=i.liveRange,a=i.sourcePosition;n._fixGraveyardSelection(o,a)}n._hasChangedRange&&(n._hasChangedRange=!1,n.fire("change:range",{directChange:!1}))}}),{priority:"lowest"}),n.on("change:range",(function(){var e=!0,t=!1,r=void 0;try{for(var i,a=n.getRanges()[Symbol.iterator]();!(e=(i=a.next()).done);e=!0){var s=i.value;if(!n._document._validateSelectionRange(s))throw new It.b("document-selection-wrong-position: Range from document selection starts or ends at incorrect position.",o(n),{range:s})}}catch(l){t=!0,r=l}finally{try{e||null==a.return||a.return()}finally{if(t)throw r}}})),n.listenTo(n._model.markers,"update",(function(){return n._updateMarkers()})),n.listenTo(n._document,"change",(function(e,t){!function(e,t){var n=e.document.differ,r=!0,i=!1,o=void 0;try{for(var a,s=function(){var n=a.value;if("insert"!=n.type)return"continue";var r=n.position.parent;n.length===r.maxOffset&&e.enqueueChange(t,(function(e){var t=Array.from(r.getAttributeKeys()).filter((function(e){return e.startsWith(go)})),n=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var l=a.value;e.removeAttribute(l,r)}}catch(u){i=!0,o=u}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}}))},l=n.getChanges()[Symbol.iterator]();!(r=(a=l.next()).done);r=!0)s()}catch(u){i=!0,o=u}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}}(n._model,t)})),n}return v(t,e),d(t,[{key:"destroy",value:function(){for(var e=0;e0&&this.fire("change:attribute",{attributeKeys:d,directChange:!1})}},{key:"_setAttribute",value:function(e,n){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=r?"normal":"low";return("low"!=i||"normal"!=this._attributePriority.get(e))&&l(p(t.prototype),"getAttribute",this).call(this,e)!==n&&(this._attrs.set(e,n),this._attributePriority.set(e,i),!0)}},{key:"_removeAttribute",value:function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=n?"normal":"low";return("low"!=r||"normal"!=this._attributePriority.get(e))&&(this._attributePriority.set(e,r),!!l(p(t.prototype),"hasAttribute",this).call(this,e)&&(this._attrs.delete(e),!0))}},{key:"_setAttributesTo",value:function(e){var t=new Set,n=!0,r=!1,i=void 0;try{for(var o,a=this.getAttributes()[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value,l=c(s,2),u=l[0],f=l[1];e.get(u)!==f&&this._removeAttribute(u,!1)}}catch(w){r=!0,i=w}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}var d=!0,h=!1,p=void 0;try{for(var v,m=e[Symbol.iterator]();!(d=(v=m.next()).done);d=!0){var g=v.value,y=c(g,2),b=y[0],k=y[1];this._setAttribute(b,k,!1)&&t.add(b)}}catch(w){h=!0,p=w}finally{try{d||null==m.return||m.return()}finally{if(h)throw p}}return t}},{key:"_getStoredAttributes",value:s.mark((function e(){var t,n,r,i,o,a,l,u;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.getFirstPosition().parent,!this.isCollapsed||!t.isEmpty){e.next=30;break}n=!0,r=!1,i=void 0,e.prev=5,o=t.getAttributeKeys()[Symbol.iterator]();case 7:if(n=(a=o.next()).done){e.next=16;break}if(!(l=a.value).startsWith(go)){e.next=13;break}return u=l.substr(go.length),e.next=13,[u,t.getAttribute(l)];case 13:n=!0,e.next=7;break;case 16:e.next=22;break;case 18:e.prev=18,e.t0=e.catch(5),r=!0,i=e.t0;case 22:e.prev=22,e.prev=23,n||null==o.return||o.return();case 25:if(e.prev=25,!r){e.next=28;break}throw i;case 28:return e.finish(25);case 29:return e.finish(22);case 30:case"end":return e.stop()}}),e,this,[[5,18,22,30],[23,,25,29]])}))},{key:"_getSurroundingAttributes",value:function(){var e=this.getFirstPosition(),t=this._model.schema,n=null;if(this.isCollapsed){var r=e.textNode?e.textNode:e.nodeBefore,i=e.textNode?e.textNode:e.nodeAfter;if(this.isGravityOverridden||(n=ko(r)),n||(n=ko(i)),!this.isGravityOverridden&&!n)for(var o=r;o&&!n;)n=ko(o=o.previousSibling);if(!n)for(var a=i;a&&!n;)n=ko(a=a.nextSibling);n||(n=this._getStoredAttributes())}else{var s=this.getFirstRange(),l=!0,u=!1,c=void 0;try{for(var f,d=s[Symbol.iterator]();!(l=(f=d.next()).done);l=!0){var h=f.value;if(h.item.is("element")&&t.isObject(h.item))break;if("text"==h.type){n=h.item.getAttributes();break}}}catch(p){u=!0,c=p}finally{try{l||null==d.return||d.return()}finally{if(u)throw c}}}return n}},{key:"_fixGraveyardSelection",value:function(e,t){var n=t.clone(),r=this._model.schema.getNearestSelectionRange(n),i=this._ranges.indexOf(e);if(this._ranges.splice(i,1),e.detach(),r){var o=this._prepareRange(r);this._ranges.splice(i,0,o)}}},{key:"isCollapsed",get:function(){return 0===this._ranges.length?this._document._getDefaultRange().isCollapsed:l(p(t.prototype),"isCollapsed",this)}},{key:"anchor",get:function(){return l(p(t.prototype),"anchor",this)||this._document._getDefaultRange().start}},{key:"focus",get:function(){return l(p(t.prototype),"focus",this)||this._document._getDefaultRange().end}},{key:"rangeCount",get:function(){return this._ranges.length?this._ranges.length:1}},{key:"hasOwnRange",get:function(){return this._ranges.length>0}},{key:"isGravityOverridden",get:function(){return!!this._overriddenGravityRegister.size}}]),t}(lo);function ko(e){return e instanceof Ki||e instanceof Qi?e.getAttributes():null}var wo=function(){function e(t){f(this,e),this._dispatchers=t}return d(e,[{key:"add",value:function(e){var t=!0,n=!1,r=void 0;try{for(var i,o=this._dispatchers[Symbol.iterator]();!(t=(i=o.next()).done);t=!0)e(i.value)}catch(a){n=!0,r=a}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}return this}}]),e}(),_o=function(e){return At(e,5)},xo=function(e){function t(){return f(this,t),h(this,p(t).apply(this,arguments))}return v(t,e),d(t,[{key:"elementToElement",value:function(e){return this.add(function(e){return(e=_o(e)).view=Co(e.view,"container"),function(t){t.on("insert:"+e.model,function(e){return function(t,n,r){var i=e(n.item,r.writer);if(i&&r.consumable.consume(n.item,"insert")){var o=r.mapper.toViewPosition(n.range.start);r.mapper.bindElements(n.item,i),r.writer.insert(o,i)}}}(e.view),{priority:e.converterPriority||"normal"})}}(e))}},{key:"attributeToElement",value:function(e){return this.add(function(e){var t="attribute:"+((e=_o(e)).model.key?e.model.key:e.model);if(e.model.name&&(t+=":"+e.model.name),e.model.values){var n=!0,r=!1,i=void 0;try{for(var o,a=e.model.values[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;e.view[s]=Co(e.view[s],"attribute")}}catch(u){r=!0,i=u}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}}else e.view=Co(e.view,"attribute");var l=So(e);return function(n){n.on(t,function(e){return function(t,n,r){var i=e(n.attributeOldValue,r.writer),o=e(n.attributeNewValue,r.writer);if((i||o)&&r.consumable.consume(n.item,t.name)){var a=r.writer,s=a.document.selection;if(n.item instanceof lo||n.item instanceof yo)a.wrap(s.getFirstRange(),o);else{var l=r.mapper.toViewRange(n.range);null!==n.attributeOldValue&&i&&(l=a.unwrap(l,i)),null!==n.attributeNewValue&&o&&a.wrap(l,o)}}}}(l),{priority:e.converterPriority||"normal"})}}(e))}},{key:"attributeToAttribute",value:function(e){return this.add(function(e){var t="attribute:"+((e=_o(e)).model.key?e.model.key:e.model);if(e.model.name&&(t+=":"+e.model.name),e.model.values){var n=!0,r=!1,i=void 0;try{for(var o,a=e.model.values[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;e.view[s]=Eo(e.view[s])}}catch(u){r=!0,i=u}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}}else e.view=Eo(e.view);var l=So(e);return function(n){n.on(t,function(e){return function(t,n,r){var i=e(n.attributeOldValue,n),o=e(n.attributeNewValue,n);if((i||o)&&r.consumable.consume(n.item,t.name)){var a=r.mapper.toViewElement(n.item),s=r.writer;if(!a)throw new It.b("conversion-attribute-to-attribute-on-text: Trying to convert text node's attribute with attribute-to-attribute converter.",[n,r]);if(null!==n.attributeOldValue&&i)if("class"==i.key){var l=Array.isArray(i.value)?i.value:[i.value],c=!0,f=!1,d=void 0;try{for(var h,p=l[Symbol.iterator]();!(c=(h=p.next()).done);c=!0){var v=h.value;s.removeClass(v,a)}}catch(u){f=!0,d=u}finally{try{c||null==p.return||p.return()}finally{if(f)throw d}}}else if("style"==i.key)for(var m=0,g=Object.keys(i.value);m1&&void 0!==arguments[1]?arguments[1]:null,n=null===t||function(e){return e.getAttribute(t)},r="object"!=typeof e.model?e.model:e.model.key,i="object"!=typeof e.model||void 0===e.model.value?n:e.model.value;e.model={key:r,value:i}}function Io(e,t){var n=new en(e.view);return function(r,i,o){var a=n.match(i.viewItem);if(a){var s=e.model.key,l="function"==typeof e.model.value?e.model.value(i.viewItem):e.model.value;null!==l&&(function(e,t){var n="function"==typeof e?e(t):e;return!("object"==typeof n&&!Oo(n))&&!n.classes&&!n.attributes&&!n.styles}(e.view,i.viewItem)?a.match.name=!0:delete a.match.name,o.consumable.test(i.viewItem,a.match)&&(i.modelRange||(i=Object.assign(i,o.convertChildren(i.viewItem,i.modelCursor))),function(e,t,n,r){for(var i=!1,o=0,a=Array.from(e.getItems({shallow:n}));o1&&void 0!==arguments[1]?arguments[1]:[];f(this,e),this._editor=t,this._availablePlugins=new Map,this._plugins=new Map;var r=!0,i=!1,o=void 0;try{for(var a,s=n[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var l=a.value;this._availablePlugins.set(l,l),l.pluginName&&this._availablePlugins.set(l.pluginName,l)}}catch(u){i=!0,o=u}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}}return d(e,[{key:Symbol.iterator,value:s.mark((function e(){var t,n,r,i,o,a;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=!0,n=!1,r=void 0,e.prev=3,i=this._plugins[Symbol.iterator]();case 5:if(t=(o=i.next()).done){e.next=14;break}if(a=o.value,e.t0="function"==typeof a[0],!e.t0){e.next=11;break}return e.next=11,a;case 11:t=!0,e.next=5;break;case 14:e.next=20;break;case 16:e.prev=16,e.t1=e.catch(3),n=!0,r=e.t1;case 20:e.prev=20,e.prev=21,t||null==i.return||i.return();case 23:if(e.prev=23,!n){e.next=26;break}throw r;case 26:return e.finish(23);case 27:return e.finish(20);case 28:case"end":return e.stop()}}),e,this,[[3,16,20,28],[21,,23,27]])}))},{key:"get",value:function(e){var t=this._plugins.get(e);if(!t){var n=e;throw"function"==typeof e&&(n=e.pluginName||e.name),new It.b("plugincollection-plugin-not-loaded: The requested plugin is not loaded.",this._editor,{plugin:n})}return t}},{key:"has",value:function(e){return this._plugins.has(e)}},{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=this,r=this._editor,i=new Set,o=[],a=h(e),s=h(t),l=function(e){var t=[],n=!0,r=!1,i=void 0;try{for(var o,a=e[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;d(s)||t.push(s)}}catch(l){r=!0,i=l}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}return t.length?t:null}(e);if(l){var u="plugincollection-plugin-not-found: Some plugins are not available and could not be loaded.";return console.error(Object(It.a)(u),{plugins:l}),Promise.reject(new It.b(u,this._editor,{plugins:l}))}return Promise.all(a.map(c)).then((function(){return f(o,"init")})).then((function(){return f(o,"afterInit")})).then((function(){return o}));function c(e){if(!s.includes(e)&&!n._plugins.has(e)&&!i.has(e))return function(e){return new Promise((function(a){i.add(e),e.requires&&e.requires.forEach((function(n){var i=d(n);if(t.includes(i))throw new It.b("plugincollection-required: Cannot load a plugin because one of its dependencies is listed inthe `removePlugins` option.",r,{plugin:i,requiredBy:e});c(i)}));var s=new e(r);n._add(e,s),o.push(s),a()}))}(e).catch((function(t){throw console.error(Object(It.a)("plugincollection-load: It was not possible to load the plugin."),{plugin:e}),t}))}function f(e,t){return e.reduce((function(e,n){return n[t]?e.then(n[t].bind(n)):e}),Promise.resolve())}function d(e){return"function"==typeof e?e:n._availablePlugins.get(e)}function h(e){return e.map((function(e){return d(e)})).filter((function(e){return!!e}))}}},{key:"destroy",value:function(){var e=Array.from(this).map((function(e){return c(e,2)[1]})).filter((function(e){return"function"==typeof e.destroy})).map((function(e){return e.destroy()}));return Promise.all(e)}},{key:"_add",value:function(e,t){this._plugins.set(e,t);var n=e.pluginName;if(n){if(this._plugins.has(n))throw new It.b("plugincollection-plugin-name-conflict: Two plugins with the same name were loaded.",null,{pluginName:n,plugin1:this._plugins.get(n).constructor,plugin2:e});this._plugins.set(n,t)}}}]),e}();Yt(Ro,zt);var jo=function(){function e(){f(this,e),this._commands=new Map}return d(e,[{key:"add",value:function(e,t){this._commands.set(e,t)}},{key:"get",value:function(e){return this._commands.get(e)}},{key:"execute",value:function(e){var t=this.get(e);if(!t)throw new It.b("commandcollection-command-not-found: Command does not exist.",this,{commandName:e});for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i0&&void 0!==arguments[0]?arguments[0]:{};f(this,e),this.uiLanguage=n.uiLanguage||"en",this.contentLanguage=n.contentLanguage||this.uiLanguage,this.uiLanguageDirection=zo(this.uiLanguage),this.contentLanguageDirection=zo(this.contentLanguage),this.t=function(){return t._t.apply(t,arguments)}}return d(e,[{key:"_t",value:function(e,t){var n=function(e,t){var n=Object.keys(window.CKEDITOR_TRANSLATIONS).length;return 1===n&&(e=Object.keys(window.CKEDITOR_TRANSLATIONS)[0]),0!==n&&function(e,t){return e in window.CKEDITOR_TRANSLATIONS&&t in window.CKEDITOR_TRANSLATIONS[e]}(e,t)?window.CKEDITOR_TRANSLATIONS[e][t].replace(/ \[context: [^\]]+\]$/,""):t.replace(/ \[context: [^\]]+\]$/,"")}(this.uiLanguage,e);return t&&(n=n.replace(/%(\d+)/g,(function(e,n){return n1&&void 0!==arguments[1]?arguments[1]:null;if(e instanceof to){var n=e.nodeBefore,r=e.nodeAfter;if(!(n instanceof Xi))throw new It.b("schema-check-merge-no-element-before: The node before the merge position must be an element.",this);if(!(r instanceof Xi))throw new It.b("schema-check-merge-no-element-after: The node after the merge position must be an element.",this);return this.checkMerge(n,r)}var i=!0,o=!1,a=void 0;try{for(var s,l=t.getChildren()[Symbol.iterator]();!(i=(s=l.next()).done);i=!0){var u=s.value;if(!this.checkChild(e,u))return!1}}catch(c){o=!0,a=c}finally{try{i||null==l.return||l.return()}finally{if(o)throw a}}return!0}},{key:"addChildCheck",value:function(e){this.on("checkChild",(function(t,n){var r=c(n,2),i=r[0],o=r[1];if(o){var a=e(i,o);"boolean"==typeof a&&(t.stop(),t.return=a)}}),{priority:"high"})}},{key:"addAttributeCheck",value:function(e){this.on("checkAttribute",(function(t,n){var r=c(n,2),i=r[0],o=r[1],a=e(i,o);"boolean"==typeof a&&(t.stop(),t.return=a)}),{priority:"high"})}},{key:"setAttributeProperties",value:function(e,t){this._attributeProperties[e]=Object.assign(this.getAttributeProperties(e),t)}},{key:"getAttributeProperties",value:function(e){return this._attributeProperties[e]||{}}},{key:"getLimitElement",value:function(e){var t;for(t=e instanceof to?e.parent:(e instanceof no?[e]:Array.from(e.getRanges())).reduce((function(e,t){var n=t.getCommonAncestor();return e?e.getCommonAncestor(n,{includeSelf:!0}):n}),null);!this.isLimit(t)&&t.parent;)t=t.parent;return t}},{key:"checkAttributeInSelection",value:function(e,t){if(e.isCollapsed){var n=[].concat(u(e.getFirstPosition().getAncestors()),[new Qi("",e.getAttributes())]);return this.checkAttribute(n,t)}var r=e.getRanges(),i=!0,o=!1,a=void 0;try{for(var s,l=r[Symbol.iterator]();!(i=(s=l.next()).done);i=!0){var c=s.value,f=!0,d=!1,h=void 0;try{for(var p,v=c[Symbol.iterator]();!(f=(p=v.next()).done);f=!0){var m=p.value;if(this.checkAttribute(m.item,t))return!0}}catch(g){d=!0,h=g}finally{try{f||null==v.return||v.return()}finally{if(d)throw h}}}}catch(g){o=!0,a=g}finally{try{i||null==l.return||l.return()}finally{if(o)throw a}}return!1}},{key:"getValidRanges",value:s.mark((function e(t,n){var r,i,o,a,l,u;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=s.mark((function e(t){var n,r,i,o,a,l;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=!0,r=!1,i=void 0,e.prev=3,o=t[Symbol.iterator]();case 5:if(n=(a=o.next()).done){e.next=11;break}return l=a.value,e.delegateYield(l.getMinimalFlatRanges(),"t0",8);case 8:n=!0,e.next=5;break;case 11:e.next=17;break;case 13:e.prev=13,e.t1=e.catch(3),r=!0,i=e.t1;case 17:e.prev=17,e.prev=18,n||null==o.return||o.return();case 20:if(e.prev=20,!r){e.next=23;break}throw i;case 23:return e.finish(20);case 24:return e.finish(17);case 25:case"end":return e.stop()}}),e,null,[[3,13,17,25],[18,,20,24]])}))(t),r=!0,i=!1,o=void 0,e.prev=4,a=t[Symbol.iterator]();case 6:if(r=(l=a.next()).done){e.next=12;break}return u=l.value,e.delegateYield(this._getValidRangesForRange(u,n),"t0",9);case 9:r=!0,e.next=6;break;case 12:e.next=18;break;case 14:e.prev=14,e.t1=e.catch(4),i=!0,o=e.t1;case 18:e.prev=18,e.prev=19,r||null==a.return||a.return();case 21:if(e.prev=21,!i){e.next=24;break}throw o;case 24:return e.finish(21);case 25:return e.finish(18);case 26:case"end":return e.stop()}}),e,this,[[4,14,18,26],[19,,21,25]])}))},{key:"getNearestSelectionRange",value:function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"both";if(this.checkChild(e,"$text"))return new no(e);"both"!=r&&"backward"!=r||(t=new Zi({startPosition:e,direction:"backward"})),"both"!=r&&"forward"!=r||(n=new Zi({startPosition:e}));var i=!0,o=!1,a=void 0;try{for(var l,u=s.mark((function e(t,n){var r,i,o;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=!1;case 1:if(r){e.next=18;break}if(r=!0,!t){e.next=9;break}if(i=t.next(),e.t0=i.done,e.t0){e.next=9;break}return r=!1,e.next=9,{walker:t,value:i.value};case 9:if(!n){e.next=16;break}if(o=n.next(),e.t1=o.done,e.t1){e.next=16;break}return r=!1,e.next=16,{walker:n,value:o.value};case 16:e.next=1;break;case 18:case"end":return e.stop()}}),e)}))(t,n)[Symbol.iterator]();!(i=(l=u.next()).done);i=!0){var c=l.value,f=c.walker==t?"elementEnd":"elementStart",d=c.value;if(d.type==f&&this.isObject(d.item))return no._createOn(d.item);if(this.checkChild(d.nextPosition,"$text"))return new no(d.nextPosition)}}catch(h){o=!0,a=h}finally{try{i||null==u.return||u.return()}finally{if(o)throw a}}return null}},{key:"findAllowedParent",value:function(e,t){for(var n=e.parent;n;){if(this.checkChild(n,t))return n;if(this.isLimit(n))return null;n=n.parent}return null}},{key:"removeDisallowedAttributes",value:function(e,t){var n=!0,r=!1,i=void 0;try{for(var o,a=e[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;if(s.is("text"))ea(this,s,t);else{var l=no._createIn(s).getPositions(),u=!0,c=!1,f=void 0;try{for(var d,h=l[Symbol.iterator]();!(u=(d=h.next()).done);u=!0){var p=d.value;ea(this,p.nodeBefore||p.parent,t)}}catch(v){c=!0,f=v}finally{try{u||null==h.return||h.return()}finally{if(c)throw f}}}}}catch(v){r=!0,i=v}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}}},{key:"createContext",value:function(e){return new Ho(e)}},{key:"_clearCache",value:function(){this._compiledDefinitions=null}},{key:"_compile",value:function(){for(var e={},t=this._sourceDefinitions,n=Object.keys(t),r=0,i=n;r2&&void 0!==arguments[2]?arguments[2]:t.length-1,r=t.getItem(n);if(e.allowIn.includes(r.name)){if(0==n)return!0;var i=this.getDefinition(r);return this._checkContextMatch(i,t,n-1)}return!1}},{key:"_getValidRangesForRange",value:s.mark((function e(t,n){var r,i,o,a,l,u,c,f;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t.start,i=t.start,o=!0,a=!1,l=void 0,e.prev=4,u=t.getItems({shallow:!0})[Symbol.iterator]();case 6:if(o=(c=u.next()).done){e.next=22;break}if(f=c.value,e.t0=f.is("element"),!e.t0){e.next=11;break}return e.delegateYield(this._getValidRangesForRange(no._createIn(f),n),"t1",11);case 11:if(e.t2=this.checkAttribute(f,n),e.t2){e.next=18;break}if(e.t3=r.isEqual(i),e.t3){e.next=17;break}return e.next=17,new no(r,i);case 17:r=to._createAfter(f);case 18:i=to._createAfter(f);case 19:o=!0,e.next=6;break;case 22:e.next=28;break;case 24:e.prev=24,e.t4=e.catch(4),a=!0,l=e.t4;case 28:e.prev=28,e.prev=29,o||null==u.return||u.return();case 31:if(e.prev=31,!a){e.next=34;break}throw l;case 34:return e.finish(31);case 35:return e.finish(28);case 36:if(e.t5=r.isEqual(i),e.t5){e.next=40;break}return e.next=40,new no(r,i);case 40:case"end":return e.stop()}}),e,this,[[4,24,28,36],[29,,31,35]])}))}]),e}();Yt(Uo,wn);var Ho=function(){function e(t){if(f(this,e),t instanceof e)return t;"string"==typeof t?t=[t]:Array.isArray(t)||(t=t.getAncestors({includeSelf:!0})),t[0]&&"string"!=typeof t[0]&&t[0].is("documentFragment")&&t.shift(),this._items=t.map(Zo)}return d(e,[{key:Symbol.iterator,value:function(){return this._items[Symbol.iterator]()}},{key:"push",value:function(t){var n=new e([t]);return n._items=[].concat(u(this._items),u(n._items)),n}},{key:"getItem",value:function(e){return this._items[e]}},{key:"getNames",value:s.mark((function e(){return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.delegateYield(this._items.map((function(e){return e.name})),"t0",1);case 1:case"end":return e.stop()}}),e,this)}))},{key:"endsWith",value:function(e){return Array.from(this.getNames()).join(" ").endsWith(e)}},{key:"length",get:function(){return this._items.length}},{key:"last",get:function(){return this._items[this._items.length-1]}}]),e}();function qo(e,t){var n={name:t,allowIn:[],allowContentOf:[],allowWhere:[],allowAttributes:[],allowAttributesOf:[],inheritTypesFrom:[]};return function(e,t){var n=!0,r=!1,i=void 0;try{for(var o,a=e[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value,l=Object.keys(s).filter((function(e){return e.startsWith("is")})),u=!0,c=!1,f=void 0;try{for(var d,h=l[Symbol.iterator]();!(u=(d=h.next()).done);u=!0){var p=d.value;t[p]=s[p]}}catch(v){c=!0,f=v}finally{try{u||null==h.return||h.return()}finally{if(c)throw f}}}}catch(v){r=!0,i=v}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}}(e,n),Jo(e,n,"allowIn"),Jo(e,n,"allowContentOf"),Jo(e,n,"allowWhere"),Jo(e,n,"allowAttributes"),Jo(e,n,"allowAttributesOf"),Jo(e,n,"inheritTypesFrom"),function(e,t){var n=!0,r=!1,i=void 0;try{for(var o,a=e[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value.inheritAllFrom;s&&(t.allowContentOf.push(s),t.allowWhere.push(s),t.allowAttributesOf.push(s),t.inheritTypesFrom.push(s))}}catch(l){r=!0,i=l}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}}(e,n),n}function Wo(e,t){var n=!0,r=!1,i=void 0;try{for(var o,a=e[t].allowContentOf[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;e[s]&&Xo(e,s).forEach((function(e){e.allowIn.push(t)}))}}catch(l){r=!0,i=l}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}delete e[t].allowContentOf}function Yo(e,t){var n=!0,r=!1,i=void 0;try{for(var o,a=e[t].allowWhere[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=e[o.value];if(s){var l,c=s.allowIn;(l=e[t].allowIn).push.apply(l,u(c))}}}catch(f){r=!0,i=f}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}delete e[t].allowWhere}function $o(e,t){var n=!0,r=!1,i=void 0;try{for(var o,a=e[t].allowAttributesOf[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=e[o.value];if(s){var l,c=s.allowAttributes;(l=e[t].allowAttributes).push.apply(l,u(c))}}}catch(f){r=!0,i=f}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}delete e[t].allowAttributesOf}function Go(e,t){var n=e[t],r=!0,i=!1,o=void 0;try{for(var a,s=n.inheritTypesFrom[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var l=e[a.value];if(l){var u=Object.keys(l).filter((function(e){return e.startsWith("is")})),c=!0,f=!1,d=void 0;try{for(var h,p=u[Symbol.iterator]();!(c=(h=p.next()).done);c=!0){var v=h.value;v in n||(n[v]=l[v])}}catch(m){f=!0,d=m}finally{try{c||null==p.return||p.return()}finally{if(f)throw d}}}}}catch(m){i=!0,o=m}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}delete n.inheritTypesFrom}function Qo(e,t){var n=e[t],r=n.allowIn.filter((function(t){return e[t]}));n.allowIn=Array.from(new Set(r))}function Ko(e,t){var n=e[t];n.allowAttributes=Array.from(new Set(n.allowAttributes))}function Jo(e,t,n){var r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var l,c=a.value;"string"==typeof c[n]?t[n].push(c[n]):Array.isArray(c[n])&&(l=t[n]).push.apply(l,u(c[n]))}}catch(f){i=!0,o=f}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}}function Xo(e,t){var n,r=e[t];return(n=e,Object.keys(n).map((function(e){return n[e]}))).filter((function(e){return e.allowIn.includes(r.name)}))}function Zo(e){return"string"==typeof e?{name:e,getAttributeKeys:s.mark((function e(){return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})),getAttribute:function(){}}:{name:e.is("element")?e.name:"$text",getAttributeKeys:s.mark((function t(){return s.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.delegateYield(e.getAttributeKeys(),"t0",1);case 1:case"end":return t.stop()}}),t)})),getAttribute:function(t){return e.getAttribute(t)}}}function ea(e,t,n){var r=!0,i=!1,o=void 0;try{for(var a,s=t.getAttributeKeys()[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var l=a.value;e.checkAttribute(t,l)||n.removeAttribute(l,t)}}catch(u){i=!0,o=u}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}}var ta=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};f(this,e),this._splitParts=new Map,this._modelCursor=null,this.conversionApi=Object.assign({},t),this.conversionApi.convertItem=this._convertItem.bind(this),this.conversionApi.convertChildren=this._convertChildren.bind(this),this.conversionApi.splitToAllowedParent=this._splitToAllowedParent.bind(this),this.conversionApi.getSplitParts=this._getSplitParts.bind(this)}return d(e,[{key:"convert",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["$root"];this.fire("viewCleanup",e),this._modelCursor=function(e,t){var n,r=!0,i=!1,o=void 0;try{for(var a,s=new Ho(e)[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var l=a.value,u={},c=!0,f=!1,d=void 0;try{for(var h,p=l.getAttributeKeys()[Symbol.iterator]();!(c=(h=p.next()).done);c=!0){var v=h.value;u[v]=l.getAttribute(v)}}catch(g){f=!0,d=g}finally{try{c||null==p.return||p.return()}finally{if(f)throw d}}var m=t.createElement(l.name,u);n&&t.append(m,n),n=to._createAt(m,0)}}catch(g){i=!0,o=g}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(n,t),this.conversionApi.writer=t,this.conversionApi.consumable=Vo.createFrom(e),this.conversionApi.store={};var r=this._convertItem(e,this._modelCursor),i=r.modelRange,o=t.createDocumentFragment();if(i){this._removeEmptyElements();for(var a=0,s=Array.from(this._modelCursor.parent.getChildren());a1&&void 0!==arguments[1]?arguments[1]:"$root",n=this.processor.toView(e);return this.toModel(n,t)}},{key:"toModel",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"$root";return this.model.change((function(r){return t.upcastDispatcher.convert(e,r,n)}))}},{key:"destroy",value:function(){this.stopListening()}},{key:"_checkIfRootsExists",value:function(e){var t=!0,n=!1,r=void 0;try{for(var i,o=e[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value;if(!this.model.document.getRootNames().includes(a))return!1}}catch(s){n=!0,r=s}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}return!0}}]),e}();Yt(na,wn);var ra=function(){function e(t,n){f(this,e),this._helpers=new Map,this._downcast=Array.isArray(t)?t:[t],this._createConversionHelpers({name:"downcast",dispatchers:this._downcast,isDowncast:!0}),this._upcast=Array.isArray(n)?n:[n],this._createConversionHelpers({name:"upcast",dispatchers:this._upcast,isDowncast:!1})}return d(e,[{key:"addAlias",value:function(e,t){var n=this._downcast.includes(t);if(!this._upcast.includes(t)&&!n)throw new It.b("conversion-add-alias-dispatcher-not-registered: Trying to register and alias for a dispatcher that nas not been registered.",this);this._createConversionHelpers({name:e,dispatchers:[t],isDowncast:n})}},{key:"for",value:function(e){if(!this._helpers.has(e))throw new It.b("conversion-for-unknown-group: Trying to add a converter to an unknown dispatchers group.",this);return this._helpers.get(e)}},{key:"elementToElement",value:function(e){this.for("downcast").elementToElement(e);var t=!0,n=!1,r=void 0;try{for(var i,o=ia(e)[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value,s=a.model,l=a.view;this.for("upcast").elementToElement({model:s,view:l,converterPriority:e.converterPriority})}}catch(u){n=!0,r=u}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}}},{key:"attributeToElement",value:function(e){this.for("downcast").attributeToElement(e);var t=!0,n=!1,r=void 0;try{for(var i,o=ia(e)[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value,s=a.model,l=a.view;this.for("upcast").elementToAttribute({view:l,model:s,converterPriority:e.converterPriority})}}catch(u){n=!0,r=u}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}}},{key:"attributeToAttribute",value:function(e){this.for("downcast").attributeToAttribute(e);var t=!0,n=!1,r=void 0;try{for(var i,o=ia(e)[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value,s=a.model,l=a.view;this.for("upcast").attributeToAttribute({view:l,model:s})}}catch(u){n=!0,r=u}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}}},{key:"_createConversionHelpers",value:function(e){var t=e.name,n=e.dispatchers,r=e.isDowncast;if(this._helpers.has(t))throw new It.b("conversion-group-exists: Trying to register a group name that has already been registered.",this);var i=r?new xo(n):new Po(n);this._helpers.set(t,i)}}]),e}();function ia(e){var t,n,i,o,a,l,u,c,f;return s.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!e.model.values){r.next=29;break}t=!0,n=!1,i=void 0,r.prev=4,o=e.model.values[Symbol.iterator]();case 6:if(t=(a=o.next()).done){r.next=13;break}return l=a.value,u={key:e.model.key,value:l},c=e.view[l],f=e.upcastAlso?e.upcastAlso[l]:void 0,r.delegateYield(oa(u,c,f),"t0",10);case 10:t=!0,r.next=6;break;case 13:r.next=19;break;case 15:r.prev=15,r.t1=r.catch(4),n=!0,i=r.t1;case 19:r.prev=19,r.prev=20,t||null==o.return||o.return();case 22:if(r.prev=22,!n){r.next=25;break}throw i;case 25:return r.finish(22);case 26:return r.finish(19);case 27:r.next=30;break;case 29:return r.delegateYield(oa(e.model,e.view,e.upcastAlso),"t2",30);case 30:case"end":return r.stop()}}),r,null,[[4,15,19,27],[20,,22,26]])}function oa(e,t,n){var r,i,o,a,l,u;return s.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,{model:e,view:t};case 2:if(!n){s.next=30;break}n=Array.isArray(n)?n:[n],r=!0,i=!1,o=void 0,s.prev=7,a=n[Symbol.iterator]();case 9:if(r=(l=a.next()).done){s.next=16;break}return u=l.value,s.next=13,{model:e,view:u};case 13:r=!0,s.next=9;break;case 16:s.next=22;break;case 18:s.prev=18,s.t0=s.catch(7),i=!0,o=s.t0;case 22:s.prev=22,s.prev=23,r||null==a.return||a.return();case 25:if(s.prev=25,!i){s.next=28;break}throw o;case 28:return s.finish(25);case 29:return s.finish(22);case 30:case"end":return s.stop()}}),m,null,[[7,18,22,30],[23,,25,29]])}var aa=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";f(this,e),this.operations=[],this.type=t}return d(e,[{key:"addOperation",value:function(e){return e.batch=this,this.operations.push(e),e}},{key:"baseVersion",get:function(){var e=!0,t=!1,n=void 0;try{for(var r,i=this.operations[Symbol.iterator]();!(e=(r=i.next()).done);e=!0){var o=r.value;if(null!==o.baseVersion)return o.baseVersion}}catch(a){t=!0,n=a}finally{try{e||null==i.return||i.return()}finally{if(t)throw n}}return null}}]),e}(),sa=function(){function e(t){f(this,e),this.baseVersion=t,this.isDocumentOperation=null!==this.baseVersion,this.batch=null}return d(e,[{key:"_validate",value:function(){}},{key:"toJSON",value:function(){var e=Object.assign({},this);return e.__className=this.constructor.className,delete e.batch,delete e.isDocumentOperation,e}}],[{key:"fromJSON",value:function(e){return new this(e.baseVersion)}},{key:"className",get:function(){return"Operation"}}]),e}(),la=function(){function e(t){f(this,e),this.markers=new Map,this._children=new Ji,t&&this._insertChild(0,t)}return d(e,[{key:Symbol.iterator,value:function(){return this.getChildren()}},{key:"is",value:function(e){return"documentFragment"==e||"model:documentFragment"==e}},{key:"getChild",value:function(e){return this._children.getNode(e)}},{key:"getChildren",value:function(){return this._children[Symbol.iterator]()}},{key:"getChildIndex",value:function(e){return this._children.getNodeIndex(e)}},{key:"getChildStartOffset",value:function(e){return this._children.getNodeStartOffset(e)}},{key:"getPath",value:function(){return[]}},{key:"getNodeByPath",value:function(e){var t=this,n=!0,r=!1,i=void 0;try{for(var o,a=e[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;t=t.getChild(t.offsetToIndex(s))}}catch(l){r=!0,i=l}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}return t}},{key:"offsetToIndex",value:function(e){return this._children.offsetToIndex(e)}},{key:"toJSON",value:function(){var e=[],t=!0,n=!1,r=void 0;try{for(var i,o=this._children[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value;e.push(a.toJSON())}}catch(s){n=!0,r=s}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}return e}},{key:"_appendChild",value:function(e){this._insertChild(this.childCount,e)}},{key:"_insertChild",value:function(e,t){var n=function(e){return"string"==typeof e?[new Qi(e)]:(Zt(e)||(e=[e]),Array.from(e).map((function(e){return"string"==typeof e?new Qi(e):e instanceof Ki?new Qi(e.data,e.getAttributes()):e})))}(t),r=!0,i=!1,o=void 0;try{for(var a,s=n[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var l=a.value;null!==l.parent&&l._remove(),l.parent=this}}catch(u){i=!0,o=u}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}this._children._insertNodes(e,n)}},{key:"_removeChildren",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this._children._removeNodes(e,t),r=!0,i=!1,o=void 0;try{for(var a,s=n[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var l=a.value;l.parent=null}}catch(u){i=!0,o=u}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}},{key:"childCount",get:function(){return this._children.length}},{key:"maxOffset",get:function(){return this._children.maxOffset}},{key:"isEmpty",get:function(){return 0===this.childCount}},{key:"root",get:function(){return this}},{key:"parent",get:function(){return null}}],[{key:"fromJSON",value:function(t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var l=a.value;l.name?n.push(Xi.fromJSON(l)):n.push(Qi.fromJSON(l))}}catch(u){i=!0,o=u}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return new e(n)}}]),e}();function ua(e,t){var n=(t=da(t)).reduce((function(e,t){return e+t.offsetSize}),0),r=e.parent;pa(e);var i=e.index;return r._insertChild(i,t),ha(r,i+t.length),ha(r,i),new no(e,e.getShiftedBy(n))}function ca(e){if(!e.isFlat)throw new It.b("operation-utils-remove-range-not-flat: Trying to remove a range which starts and ends in different element.",this);var t=e.start.parent;pa(e.start),pa(e.end);var n=t._removeChildren(e.start.index,e.end.index-e.start.index);return ha(t,e.start.index),n}function fa(e,t){if(!e.isFlat)throw new It.b("operation-utils-move-range-not-flat: Trying to move a range which starts and ends in different element.",this);var n=ca(e);return ua(t=t._getTransformedByDeletion(e.start,e.end.offset-e.start.offset),n)}function da(e){var t=[];e instanceof Array||(e=[e]);for(var n=0;ne.maxOffset)throw new It.b("move-operation-nodes-do-not-exist: The nodes which should be moved do not exist.",this);if(e===t&&n=n&&this.targetPosition.path[i]2&&void 0!==arguments[2]?arguments[2]:"main";return f(this,t),(r=h(this,p(t).call(this,n)))._doc=e,r.rootName=i,r}return v(t,e),d(t,[{key:"is",value:function(e,n){var r=e.replace("model:","");return n?"rootElement"==r&&n==this.name||l(p(t.prototype),"is",this).call(this,e,n):"rootElement"==r||l(p(t.prototype),"is",this).call(this,e)}},{key:"toJSON",value:function(){return this.rootName}},{key:"document",get:function(){return this._doc}}]),t}(Xi),Ea=function(){function e(t,n){f(this,e),this.model=t,this.batch=n}return d(e,[{key:"createText",value:function(e,t){return new Qi(e,t)}},{key:"createElement",value:function(e,t){return new Xi(e,t)}},{key:"createDocumentFragment",value:function(){return new la}},{key:"insert",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(this._assertWriterUsedCorrectly(),!(e instanceof Qi&&""==e.data)){var r=to._createAt(t,n);if(e.parent){if(Na(e.root,r.root))return void this.move(no._createOn(e),r);if(e.root.document)throw new It.b("model-writer-insert-forbidden-move: Cannot move a node from a document to a different tree. It is forbidden to move a node that was already in a document outside of it.",this);this.remove(e)}var i=r.root.document?r.root.document.version:null,o=new ka(r,e,i);if(e instanceof Qi&&(o.shouldReceiveAttributes=!0),this.batch.addOperation(o),this.model.applyOperation(o),e instanceof la){var a=!0,s=!1,l=void 0;try{for(var u,f=e.markers[Symbol.iterator]();!(a=(u=f.next()).done);a=!0){var d=u.value,h=c(d,2),p=h[0],v=h[1],m=to._createAt(v.root,0),g={range:new no(v.start._getCombined(m,r),v.end._getCombined(m,r)),usingOperation:!0,affectsData:!0};this.model.markers.has(p)?this.updateMarker(p,g):this.addMarker(p,g)}}catch(y){s=!0,l=y}finally{try{a||null==f.return||f.return()}finally{if(s)throw l}}}}}},{key:"insertText",value:function(e,t,n,r){t instanceof la||t instanceof Xi||t instanceof to?this.insert(this.createText(e),t,n):this.insert(this.createText(e,t),n,r)}},{key:"insertElement",value:function(e,t,n,r){t instanceof la||t instanceof Xi||t instanceof to?this.insert(this.createElement(e),t,n):this.insert(this.createElement(e,t),n,r)}},{key:"append",value:function(e,t){this.insert(e,t,"end")}},{key:"appendText",value:function(e,t,n){t instanceof la||t instanceof Xi?this.insert(this.createText(e),t,"end"):this.insert(this.createText(e,t),n,"end")}},{key:"appendElement",value:function(e,t,n){t instanceof la||t instanceof Xi?this.insert(this.createElement(e),t,"end"):this.insert(this.createElement(e,t),n,"end")}},{key:"setAttribute",value:function(e,t,n){if(this._assertWriterUsedCorrectly(),n instanceof no){var r=n.getMinimalFlatRanges(),i=!0,o=!1,a=void 0;try{for(var s,l=r[Symbol.iterator]();!(i=(s=l.next()).done);i=!0)Aa(this,e,t,s.value)}catch(u){o=!0,a=u}finally{try{i||null==l.return||l.return()}finally{if(o)throw a}}}else Pa(this,e,t,n)}},{key:"setAttributes",value:function(e,t){var n=!0,r=!1,i=void 0;try{for(var o,a=$i(e)[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value,l=c(s,2),u=l[0],f=l[1];this.setAttribute(u,f,t)}}catch(d){r=!0,i=d}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}}},{key:"removeAttribute",value:function(e,t){if(this._assertWriterUsedCorrectly(),t instanceof no){var n=t.getMinimalFlatRanges(),r=!0,i=!1,o=void 0;try{for(var a,s=n[Symbol.iterator]();!(r=(a=s.next()).done);r=!0)Aa(this,e,null,a.value)}catch(l){i=!0,o=l}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}}else Pa(this,e,null,t)}},{key:"clearAttributes",value:function(e){var t=this;this._assertWriterUsedCorrectly();var n=function(e){var n=!0,r=!1,i=void 0;try{for(var o,a=e.getAttributeKeys()[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;t.removeAttribute(s,e)}}catch(l){r=!0,i=l}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}};if(e instanceof no){var r=!0,i=!1,o=void 0;try{for(var a,s=e.getItems()[Symbol.iterator]();!(r=(a=s.next()).done);r=!0)n(a.value)}catch(l){i=!0,o=l}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}}else n(e)}},{key:"move",value:function(e,t,n){if(this._assertWriterUsedCorrectly(),!(e instanceof no))throw new It.b("writer-move-invalid-range: Invalid range to move.",this);if(!e.isFlat)throw new It.b("writer-move-range-not-flat: Range to move is not flat.",this);var r=to._createAt(t,n);if(!r.isEqual(e.start)){if(this._addOperationForAffectedMarkers("move",e),!Na(e.root,r.root))throw new It.b("writer-move-different-document: Range is going to be moved between different documents.",this);var i=e.root.document?e.root.document.version:null,o=new ba(e.start,e.end.offset-e.start.offset,r,i);this.batch.addOperation(o),this.model.applyOperation(o)}}},{key:"remove",value:function(e){this._assertWriterUsedCorrectly();var t=(e instanceof no?e:no._createOn(e)).getMinimalFlatRanges().reverse(),n=!0,r=!1,i=void 0;try{for(var o,a=t[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;this._addOperationForAffectedMarkers("move",s),Oa(s.start,s.end.offset-s.start.offset,this.batch,this.model)}}catch(l){r=!0,i=l}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}}},{key:"merge",value:function(e){this._assertWriterUsedCorrectly();var t=e.nodeBefore,n=e.nodeAfter;if(this._addOperationForAffectedMarkers("merge",e),!(t instanceof Xi))throw new It.b("writer-merge-no-element-before: Node before merge position must be an element.",this);if(!(n instanceof Xi))throw new It.b("writer-merge-no-element-after: Node after merge position must be an element.",this);e.root.document?this._merge(e):this._mergeDetached(e)}},{key:"createPositionFromPath",value:function(e,t,n){return this.model.createPositionFromPath(e,t,n)}},{key:"createPositionAt",value:function(e,t){return this.model.createPositionAt(e,t)}},{key:"createPositionAfter",value:function(e){return this.model.createPositionAfter(e)}},{key:"createPositionBefore",value:function(e){return this.model.createPositionBefore(e)}},{key:"createRange",value:function(e,t){return this.model.createRange(e,t)}},{key:"createRangeIn",value:function(e){return this.model.createRangeIn(e)}},{key:"createRangeOn",value:function(e){return this.model.createRangeOn(e)}},{key:"createSelection",value:function(e,t,n){return this.model.createSelection(e,t,n)}},{key:"_mergeDetached",value:function(e){var t=e.nodeBefore,n=e.nodeAfter;this.move(no._createIn(n),to._createAt(t,"end")),this.remove(n)}},{key:"_merge",value:function(e){var t=to._createAt(e.nodeBefore,"end"),n=to._createAt(e.nodeAfter,0),r=e.root.document.graveyard,i=new to(r,[0]),o=e.root.document.version,a=new Ta(n,e.nodeAfter.maxOffset,t,i,o);this.batch.addOperation(a),this.model.applyOperation(a)}},{key:"rename",value:function(e,t){if(this._assertWriterUsedCorrectly(),!(e instanceof Xi))throw new It.b("writer-rename-not-element-instance: Trying to rename an object which is not an instance of Element.",this);var n=e.root.document?e.root.document.version:null,r=new _a(to._createBefore(e),e.name,t,n);this.batch.addOperation(r),this.model.applyOperation(r)}},{key:"split",value:function(e,t){this._assertWriterUsedCorrectly();var n,r,i=e.parent;if(!i.parent)throw new It.b("writer-split-element-no-parent: Element with no parent can not be split.",this);if(t||(t=i.parent),!e.parent.getAncestors({includeSelf:!0}).includes(t))throw new It.b("writer-split-invalid-limit-element: Limit element is not a position ancestor.",this);do{var o=i.root.document?i.root.document.version:null,a=i.maxOffset-e.offset,s=new Ca(e,a,null,o);this.batch.addOperation(s),this.model.applyOperation(s),n||r||(n=i,r=e.parent.nextSibling),i=(e=this.createPositionAfter(e.parent)).parent}while(i!==t);return{position:e,range:new no(to._createAt(n,"end"),to._createAt(r,0))}}},{key:"wrap",value:function(e,t){if(this._assertWriterUsedCorrectly(),!e.isFlat)throw new It.b("writer-wrap-range-not-flat: Range to wrap is not flat.",this);var n=t instanceof Xi?t:new Xi(t);if(n.childCount>0)throw new It.b("writer-wrap-element-not-empty: Element to wrap with is not empty.",this);if(null!==n.parent)throw new It.b("writer-wrap-element-attached: Element to wrap with is already attached to tree model.",this);this.insert(n,e.start);var r=new no(e.start.getShiftedBy(1),e.end.getShiftedBy(1));this.move(r,to._createAt(n,0))}},{key:"unwrap",value:function(e){if(this._assertWriterUsedCorrectly(),null===e.parent)throw new It.b("writer-unwrap-element-no-parent: Trying to unwrap an element which has no parent.",this);this.move(no._createIn(e),this.createPositionAfter(e)),this.remove(e)}},{key:"addMarker",value:function(e,t){if(this._assertWriterUsedCorrectly(),!t||"boolean"!=typeof t.usingOperation)throw new It.b("writer-addMarker-no-usingOperation: The options.usingOperation parameter is required when adding a new marker.",this);var n=t.usingOperation,r=t.range,i=void 0!==t.affectsData&&t.affectsData;if(this.model.markers.has(e))throw new It.b("writer-addMarker-marker-exists: Marker with provided name already exists.",this);if(!r)throw new It.b("writer-addMarker-no-range: Range parameter is required when adding a new marker.",this);return n?(Ma(this,e,null,r,i),this.model.markers.get(e)):this.model.markers._set(e,r,n,i)}},{key:"updateMarker",value:function(e,t){this._assertWriterUsedCorrectly();var n="string"==typeof e?e:e.name,r=this.model.markers.get(n);if(!r)throw new It.b("writer-updateMarker-marker-not-exists: Marker with provided name does not exists.",this);if(t){var i="boolean"==typeof t.usingOperation,o="boolean"==typeof t.affectsData,a=o?t.affectsData:r.affectsData;if(!i&&!t.range&&!o)throw new It.b("writer-updateMarker-wrong-options: One of the options is required - provide range, usingOperations or affectsData.",this);var s=r.getRange(),l=t.range?t.range:s;i&&t.usingOperation!==r.managedUsingOperations?t.usingOperation?Ma(this,n,null,l,a):(Ma(this,n,s,null,a),this.model.markers._set(n,l,void 0,a)):r.managedUsingOperations?Ma(this,n,s,l,a):this.model.markers._set(n,l,void 0,a)}else this.model.markers._refresh(r)}},{key:"removeMarker",value:function(e){this._assertWriterUsedCorrectly();var t="string"==typeof e?e:e.name;if(!this.model.markers.has(t))throw new It.b("writer-removeMarker-no-marker: Trying to remove marker which does not exist.",this);var n=this.model.markers.get(t);n.managedUsingOperations?Ma(this,t,n.getRange(),null,n.affectsData):this.model.markers._remove(t)}},{key:"setSelection",value:function(e,t,n){this._assertWriterUsedCorrectly(),this.model.document.selection._setTo(e,t,n)}},{key:"setSelectionFocus",value:function(e,t){this._assertWriterUsedCorrectly(),this.model.document.selection._setFocus(e,t)}},{key:"setSelectionAttribute",value:function(e,t){if(this._assertWriterUsedCorrectly(),"string"==typeof e)this._setSelectionAttribute(e,t);else{var n=!0,r=!1,i=void 0;try{for(var o,a=$i(e)[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value,l=c(s,2),u=l[0],f=l[1];this._setSelectionAttribute(u,f)}}catch(d){r=!0,i=d}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}}}},{key:"removeSelectionAttribute",value:function(e){if(this._assertWriterUsedCorrectly(),"string"==typeof e)this._removeSelectionAttribute(e);else{var t=!0,n=!1,r=void 0;try{for(var i,o=e[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value;this._removeSelectionAttribute(a)}}catch(s){n=!0,r=s}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}}}},{key:"overrideSelectionGravity",value:function(){return this.model.document.selection._overrideGravity()}},{key:"restoreSelectionGravity",value:function(e){this.model.document.selection._restoreGravity(e)}},{key:"_setSelectionAttribute",value:function(e,t){var n=this.model.document.selection;if(n.isCollapsed&&n.anchor.parent.isEmpty){var r=yo._getStoreAttributeKey(e);this.setAttribute(r,t,n.anchor.parent)}n._setAttribute(e,t)}},{key:"_removeSelectionAttribute",value:function(e){var t=this.model.document.selection;if(t.isCollapsed&&t.anchor.parent.isEmpty){var n=yo._getStoreAttributeKey(e);this.removeAttribute(n,t.anchor.parent)}t._removeAttribute(e)}},{key:"_assertWriterUsedCorrectly",value:function(){if(this.model._currentWriter!==this)throw new It.b("writer-incorrect-use: Trying to use a writer outside the change() block.",this)}},{key:"_addOperationForAffectedMarkers",value:function(e,t){var n=!0,r=!1,i=void 0;try{for(var o,a=this.model.markers[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;if(s.managedUsingOperations){var l=s.getRange(),u=!1;if("move"==e)u=t.containsPosition(l.start)||t.start.isEqual(l.start)||t.containsPosition(l.end)||t.end.isEqual(l.end);else{var c=t.nodeBefore,f=t.nodeAfter,d=l.start.parent==c&&l.start.isAtEnd,h=l.end.parent==f&&0==l.end.offset,p=l.end.nodeAfter==f,v=l.start.nodeAfter==f;u=d||h||p||v}u&&this.updateMarker(s.name,{range:l})}}}catch(m){r=!0,i=m}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}}}]),e}();function Aa(e,t,n,r){var i,o,a,s=e.model,l=s.document,u=r.start,c=!0,f=!1,d=void 0;try{for(var h,p=r.getWalker({shallow:!0})[Symbol.iterator]();!(c=(h=p.next()).done);c=!0){var v=h.value;a=v.item.getAttribute(t),i&&o!=a&&(o!=n&&m(),u=i),i=v.nextPosition,o=a}}catch(g){f=!0,d=g}finally{try{c||null==p.return||p.return()}finally{if(f)throw d}}function m(){var r=new no(u,i),a=r.root.document?l.version:null,c=new ga(r,t,o,n,a);e.batch.addOperation(c),s.applyOperation(c)}i instanceof to&&i!=u&&o!=n&&m()}function Pa(e,t,n,r){var i,o,a=e.model,s=a.document,l=r.getAttribute(t);if(l!=n){if(r.root===r){var u=r.document?s.version:null;o=new xa(r,t,l,n,u)}else{var c=(i=new no(to._createBefore(r),e.createPositionAfter(r))).root.document?s.version:null;o=new ga(i,t,l,n,c)}e.batch.addOperation(o),a.applyOperation(o)}}function Ma(e,t,n,r,i){var o=e.model,a=o.document,s=new wa(t,n,r,o.markers,i,a.version);e.batch.addOperation(s),o.applyOperation(s)}function Oa(e,t,n,r){var i;if(e.root.document){var o=r.document,a=new to(o.graveyard,[0]);i=new ba(e,t,a,o.version)}else i=new ya(e,t);n.addOperation(i),r.applyOperation(i)}function Na(e,t){return e===t||e instanceof Sa&&t instanceof Sa}var Ia=function(){function e(t){f(this,e),this._markerCollection=t,this._changesInElement=new Map,this._elementSnapshots=new Map,this._changedMarkers=new Map,this._changeCount=0,this._cachedChanges=null,this._cachedChangesWithGraveyard=null}return d(e,[{key:"refreshItem",value:function(e){if(!this._isInInsertedElement(e.parent)){this._markRemove(e.parent,e.startOffset,e.offsetSize),this._markInsert(e.parent,e.startOffset,e.offsetSize);var t=no._createOn(e),n=!0,r=!1,i=void 0;try{for(var o,a=this._markerCollection.getMarkersIntersectingRange(t)[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value,l=s.getRange();this.bufferMarkerChange(s.name,l,l,s.affectsData)}}catch(u){r=!0,i=u}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}this._cachedChanges=null}}},{key:"bufferOperation",value:function(e){switch(e.type){case"insert":if(this._isInInsertedElement(e.position.parent))return;this._markInsert(e.position.parent,e.position.offset,e.nodes.maxOffset);break;case"addAttribute":case"removeAttribute":case"changeAttribute":var t=!0,n=!1,r=void 0;try{for(var i,o=e.range.getItems({shallow:!0})[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value;this._isInInsertedElement(a.parent)||this._markAttribute(a)}}catch(w){n=!0,r=w}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}break;case"remove":case"move":case"reinsert":if(e.sourcePosition.isEqual(e.targetPosition)||e.sourcePosition.getShiftedBy(e.howMany).isEqual(e.targetPosition))return;var s=this._isInInsertedElement(e.sourcePosition.parent),l=this._isInInsertedElement(e.targetPosition.parent);s||this._markRemove(e.sourcePosition.parent,e.sourcePosition.offset,e.howMany),l||this._markInsert(e.targetPosition.parent,e.getMovedRangeStart().offset,e.howMany);break;case"rename":if(this._isInInsertedElement(e.position.parent))return;this._markRemove(e.position.parent,e.position.offset,1),this._markInsert(e.position.parent,e.position.offset,1);var u=no._createFromPositionAndShift(e.position,1),c=!0,f=!1,d=void 0;try{for(var h,p=this._markerCollection.getMarkersIntersectingRange(u)[Symbol.iterator]();!(c=(h=p.next()).done);c=!0){var v=h.value,m=v.getRange();this.bufferMarkerChange(v.name,m,m,v.affectsData)}}catch(w){f=!0,d=w}finally{try{c||null==p.return||p.return()}finally{if(f)throw d}}break;case"split":var g=e.splitPosition.parent;this._isInInsertedElement(g)||this._markRemove(g,e.splitPosition.offset,e.howMany),this._isInInsertedElement(e.insertionPosition.parent)||this._markInsert(e.insertionPosition.parent,e.insertionPosition.offset,1),e.graveyardPosition&&this._markRemove(e.graveyardPosition.parent,e.graveyardPosition.offset,1);break;case"merge":var y=e.sourcePosition.parent;this._isInInsertedElement(y.parent)||this._markRemove(y.parent,y.startOffset,1);var b=e.graveyardPosition.parent;this._markInsert(b,e.graveyardPosition.offset,1);var k=e.targetPosition.parent;this._isInInsertedElement(k)||this._markInsert(k,e.targetPosition.offset,y.maxOffset)}this._cachedChanges=null}},{key:"bufferMarkerChange",value:function(e,t,n,r){var i=this._changedMarkers.get(e);i?(i.newRange=n,i.affectsData=r,null==i.oldRange&&null==i.newRange&&this._changedMarkers.delete(e)):this._changedMarkers.set(e,{oldRange:t,newRange:n,affectsData:r})}},{key:"getMarkersToRemove",value:function(){var e=[],t=!0,n=!1,r=void 0;try{for(var i,o=this._changedMarkers[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value,s=c(a,2),l=s[0],u=s[1];null!=u.oldRange&&e.push({name:l,range:u.oldRange})}}catch(f){n=!0,r=f}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}return e}},{key:"getMarkersToAdd",value:function(){var e=[],t=!0,n=!1,r=void 0;try{for(var i,o=this._changedMarkers[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value,s=c(a,2),l=s[0],u=s[1];null!=u.newRange&&e.push({name:l,range:u.newRange})}}catch(f){n=!0,r=f}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}return e}},{key:"getChangedMarkers",value:function(){return Array.from(this._changedMarkers).map((function(e){return{name:e[0],data:{oldRange:e[1].oldRange,newRange:e[1].newRange}}}))}},{key:"hasDataChanges",value:function(){var e=!0,t=!1,n=void 0;try{for(var r,i=this._changedMarkers[Symbol.iterator]();!(e=(r=i.next()).done);e=!0){var o=r.value;if(c(o,2)[1].affectsData)return!0}}catch(a){t=!0,n=a}finally{try{e||null==i.return||i.return()}finally{if(t)throw n}}return this._changesInElement.size>0}},{key:"getChanges",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{includeChangesInGraveyard:!1};if(this._cachedChanges)return e.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice();var t=[],n=!0,r=!1,i=void 0;try{for(var o,a=this._changesInElement.keys()[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value,l=this._changesInElement.get(s).sort((function(e,t){return e.offset===t.offset?e.type!=t.type?"remove"==e.type?-1:1:0:e.offsets.offset){if(l>u){var m={type:"attribute",offset:u,howMany:l-u,count:this._changeCount++};this._handleChange(m,t),t.push(m)}e.nodesToHandle=s.offset-e.offset,e.howMany=e.nodesToHandle}else e.offset>=s.offset&&e.offsetu?(e.nodesToHandle=l-u,e.offset=u):e.nodesToHandle=0);if("remove"==s.type&&e.offsets.offset){var g={type:"attribute",offset:s.offset,howMany:l-s.offset,count:this._changeCount++};this._handleChange(g,t),t.push(g),e.nodesToHandle=s.offset-e.offset,e.howMany=e.nodesToHandle}"attribute"==s.type&&(e.offset>=s.offset&&l<=u?(e.nodesToHandle=0,e.howMany=0,e.offset=0):e.offset<=s.offset&&l>=u&&(s.howMany=0))}}}catch(y){r=!0,i=y}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}e.howMany=e.nodesToHandle,delete e.nodesToHandle}},{key:"_getInsertDiff",value:function(e,t,n){return{type:"insert",position:to._createAt(e,t),name:n,length:1,changeCount:this._changeCount++}}},{key:"_getRemoveDiff",value:function(e,t,n){return{type:"remove",position:to._createAt(e,t),name:n,length:1,changeCount:this._changeCount++}}},{key:"_getAttributesDiff",value:function(e,t,n){var r=[];n=new Map(n);var i=!0,o=!1,a=void 0;try{for(var s,l=t[Symbol.iterator]();!(i=(s=l.next()).done);i=!0){var u=s.value,f=c(u,2),d=f[0],h=f[1],p=n.has(d)?n.get(d):null;p!==h&&r.push({type:"attribute",position:e.start,range:e.clone(),length:1,attributeKey:d,attributeOldValue:h,attributeNewValue:p,changeCount:this._changeCount++}),n.delete(d)}}catch(T){o=!0,a=T}finally{try{i||null==l.return||l.return()}finally{if(o)throw a}}var v=!0,m=!1,g=void 0;try{for(var y,b=n[Symbol.iterator]();!(v=(y=b.next()).done);v=!0){var k=y.value,w=c(k,2),_=w[0],x=w[1];r.push({type:"attribute",position:e.start,range:e.clone(),length:1,attributeKey:_,attributeOldValue:null,attributeNewValue:x,changeCount:this._changeCount++})}}catch(T){m=!0,g=T}finally{try{v||null==b.return||b.return()}finally{if(m)throw g}}return r}},{key:"_isInInsertedElement",value:function(e){var t=e.parent;if(!t)return!1;var n=this._changesInElement.get(t),r=e.startOffset;if(n){var i=!0,o=!1,a=void 0;try{for(var s,l=n[Symbol.iterator]();!(i=(s=l.next()).done);i=!0){var u=s.value;if("insert"==u.type&&r>=u.offset&&rr){for(var d=0;d0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.POSITIVE_INFINITY;return e<0?[]:this._operations.slice(e,t)}},{key:"getOperation",value:function(e){return this._operations[e]}},{key:"setOperationAsUndone",value:function(e,t){this._undoPairs.set(t,e),this._undoneOperations.add(e)}},{key:"isUndoingOperation",value:function(e){return this._undoPairs.has(e)}},{key:"isUndoneOperation",value:function(e){return this._undoneOperations.has(e)}},{key:"getUndoneOperation",value:function(e){return this._undoPairs.get(e)}}]),e}();function Fa(e,t){return!!(n=e.charAt(t-1))&&1==n.length&&/[\ud800-\udbff]/.test(n)&&function(e){return!!e&&1==e.length&&/[\udc00-\udfff]/.test(e)}(e.charAt(t));var n}function za(e,t){return!!(n=e.charAt(t))&&1==n.length&&/[\u0300-\u036f\u1ab0-\u1aff\u1dc0-\u1dff\u20d0-\u20ff\ufe20-\ufe2f]/.test(n);var n}var Va="$graveyard",Ba=function(){function e(t){var n=this;f(this,e),this.model=t,this.version=0,this.history=new La(this),this.selection=new yo(this),this.roots=new Fn({idProperty:"rootName"}),this.differ=new Ia(t.markers),this._postFixers=new Set,this._hasSelectionChangedFromTheLastChangeBlock=!1,this.createRoot("$root",Va),this.listenTo(t,"applyOperation",(function(e,t){var r=t[0];if(r.isDocumentOperation&&r.baseVersion!==n.version)throw new It.b("model-document-applyOperation-wrong-version: Only operations with matching versions can be applied.",n,{operation:r})}),{priority:"highest"}),this.listenTo(t,"applyOperation",(function(e,t){var r=t[0];r.isDocumentOperation&&n.differ.bufferOperation(r)}),{priority:"high"}),this.listenTo(t,"applyOperation",(function(e,t){var r=t[0];r.isDocumentOperation&&(n.version++,n.history.addOperation(r))}),{priority:"low"}),this.listenTo(this.selection,"change",(function(){n._hasSelectionChangedFromTheLastChangeBlock=!0})),this.listenTo(t.markers,"update",(function(e,t,r,i){n.differ.bufferMarkerChange(t.name,r,i,t.affectsData),null===r&&t.on("change",(function(e,r){n.differ.bufferMarkerChange(t.name,r,t.getRange(),t.affectsData)}))}))}return d(e,[{key:"createRoot",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"$root",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"main";if(this.roots.get(t))throw new It.b("model-document-createRoot-name-exists: Root with specified name already exists.",this,{name:t});var n=new Sa(this,e,t);return this.roots.add(n),n}},{key:"destroy",value:function(){this.selection.destroy(),this.stopListening()}},{key:"getRoot",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"main";return this.roots.get(e)}},{key:"getRootNames",value:function(){return Array.from(this.roots,(function(e){return e.rootName})).filter((function(e){return e!=Va}))}},{key:"registerPostFixer",value:function(e){this._postFixers.add(e)}},{key:"toJSON",value:function(){var e=Gt(this);return e.selection="[engine.model.DocumentSelection]",e.model="[engine.model.Model]",e}},{key:"_handleChangeBlock",value:function(e){this._hasDocumentChangedFromTheLastChangeBlock()&&(this._callPostFixers(e),this.selection.refresh(),this.differ.hasDataChanges()?this.fire("change:data",e.batch):this.fire("change",e.batch),this.selection.refresh(),this.differ.reset()),this._hasSelectionChangedFromTheLastChangeBlock=!1}},{key:"_hasDocumentChangedFromTheLastChangeBlock",value:function(){return!this.differ.isEmpty||this._hasSelectionChangedFromTheLastChangeBlock}},{key:"_getDefaultRoot",value:function(){var e=!0,t=!1,n=void 0;try{for(var r,i=this.roots[Symbol.iterator]();!(e=(r=i.next()).done);e=!0){var o=r.value;if(o!==this.graveyard)return o}}catch(a){t=!0,n=a}finally{try{e||null==i.return||i.return()}finally{if(t)throw n}}return this.graveyard}},{key:"_getDefaultRange",value:function(){var e=this._getDefaultRoot(),t=this.model,n=t.schema,r=t.createPositionFromPath(e,[0]);return n.getNearestSelectionRange(r)||t.createRange(r)}},{key:"_validateSelectionRange",value:function(e){return Ua(e.start)&&Ua(e.end)}},{key:"_callPostFixers",value:function(e){var t=!1;do{var n=!0,r=!1,i=void 0;try{for(var o,a=this._postFixers[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;if(this.selection.refresh(),t=s(e))break}}catch(l){r=!0,i=l}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}}while(t)}},{key:"graveyard",get:function(){return this.getRoot(Va)}}]),e}();function Ua(e){var t=e.textNode;if(t){var n=t.data,r=e.offset-t.startOffset;return!Fa(n,r)&&!za(n,r)}return!0}Yt(Ba,zt);var Ha=function(){function e(){f(this,e),this._markers=new Map}return d(e,[{key:Symbol.iterator,value:function(){return this._markers.values()}},{key:"has",value:function(e){return this._markers.has(e)}},{key:"get",value:function(e){return this._markers.get(e)||null}},{key:"_set",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=e instanceof qa?e.name:e,o=this._markers.get(i);if(o){var a=o.getRange(),s=!1;return a.isEqual(t)||(o._attachLiveRange(po.fromRange(t)),s=!0),n!=o.managedUsingOperations&&(o._managedUsingOperations=n,s=!0),"boolean"==typeof r&&r!=o.affectsData&&(o._affectsData=r,s=!0),s&&this.fire("update:"+i,o,a,t),o}var l=po.fromRange(t),u=new qa(i,l,n,r);return this._markers.set(i,u),this.fire("update:"+i,u,null,t),u}},{key:"_remove",value:function(e){var t=e instanceof qa?e.name:e,n=this._markers.get(t);return!!n&&(this._markers.delete(t),this.fire("update:"+t,n,n.getRange(),null),this._destroyMarker(n),!0)}},{key:"_refresh",value:function(e){var t=e instanceof qa?e.name:e,n=this._markers.get(t);if(!n)throw new It.b("markercollection-refresh-marker-not-exists: Marker with provided name does not exists.",this);var r=n.getRange();this.fire("update:"+t,n,r,r,n.managedUsingOperations,n.affectsData)}},{key:"getMarkersAtPosition",value:s.mark((function e(t){var n,r,i,o,a,l;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=!0,r=!1,i=void 0,e.prev=3,o=this[Symbol.iterator]();case 5:if(n=(a=o.next()).done){e.next=14;break}if(l=a.value,e.t0=l.getRange().containsPosition(t),!e.t0){e.next=11;break}return e.next=11,l;case 11:n=!0,e.next=5;break;case 14:e.next=20;break;case 16:e.prev=16,e.t1=e.catch(3),r=!0,i=e.t1;case 20:e.prev=20,e.prev=21,n||null==o.return||o.return();case 23:if(e.prev=23,!r){e.next=26;break}throw i;case 26:return e.finish(23);case 27:return e.finish(20);case 28:case"end":return e.stop()}}),e,this,[[3,16,20,28],[21,,23,27]])}))},{key:"getMarkersIntersectingRange",value:s.mark((function e(t){var n,r,i,o,a,l;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=!0,r=!1,i=void 0,e.prev=3,o=this[Symbol.iterator]();case 5:if(n=(a=o.next()).done){e.next=14;break}if(l=a.value,e.t0=null!==l.getRange().getIntersection(t),!e.t0){e.next=11;break}return e.next=11,l;case 11:n=!0,e.next=5;break;case 14:e.next=20;break;case 16:e.prev=16,e.t1=e.catch(3),r=!0,i=e.t1;case 20:e.prev=20,e.prev=21,n||null==o.return||o.return();case 23:if(e.prev=23,!r){e.next=26;break}throw i;case 26:return e.finish(23);case 27:return e.finish(20);case 28:case"end":return e.stop()}}),e,this,[[3,16,20,28],[21,,23,27]])}))},{key:"destroy",value:function(){var e=!0,t=!1,n=void 0;try{for(var r,i=this._markers.values()[Symbol.iterator]();!(e=(r=i.next()).done);e=!0){var o=r.value;this._destroyMarker(o)}}catch(a){t=!0,n=a}finally{try{e||null==i.return||i.return()}finally{if(t)throw n}}this._markers=null,this.stopListening()}},{key:"getMarkersGroup",value:s.mark((function e(t){var n,r,i,o,a,l;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=!0,r=!1,i=void 0,e.prev=3,o=this._markers.values()[Symbol.iterator]();case 5:if(n=(a=o.next()).done){e.next=14;break}if(l=a.value,e.t0=l.name.startsWith(t+":"),!e.t0){e.next=11;break}return e.next=11,l;case 11:n=!0,e.next=5;break;case 14:e.next=20;break;case 16:e.prev=16,e.t1=e.catch(3),r=!0,i=e.t1;case 20:e.prev=20,e.prev=21,n||null==o.return||o.return();case 23:if(e.prev=23,!r){e.next=26;break}throw i;case 26:return e.finish(23);case 27:return e.finish(20);case 28:case"end":return e.stop()}}),e,this,[[3,16,20,28],[21,,23,27]])}))},{key:"_destroyMarker",value:function(e){e.stopListening(),e._detachLiveRange()}}]),e}();Yt(Ha,zt);var qa=function(){function e(t,n,r,i){f(this,e),this.name=t,this._liveRange=this._attachLiveRange(n),this._managedUsingOperations=r,this._affectsData=i}return d(e,[{key:"getStart",value:function(){if(!this._liveRange)throw new It.b("marker-destroyed: Cannot use a destroyed marker instance.",this);return this._liveRange.start.clone()}},{key:"getEnd",value:function(){if(!this._liveRange)throw new It.b("marker-destroyed: Cannot use a destroyed marker instance.",this);return this._liveRange.end.clone()}},{key:"getRange",value:function(){if(!this._liveRange)throw new It.b("marker-destroyed: Cannot use a destroyed marker instance.",this);return this._liveRange.toRange()}},{key:"is",value:function(e){return"marker"==e||"model:marker"==e}},{key:"_attachLiveRange",value:function(e){return this._liveRange&&this._detachLiveRange(),e.delegate("change:range").to(this),e.delegate("change:content").to(this),this._liveRange=e,e}},{key:"_detachLiveRange",value:function(){this._liveRange.stopDelegating("change:range",this),this._liveRange.stopDelegating("change:content",this),this._liveRange.detach(),this._liveRange=null}},{key:"managedUsingOperations",get:function(){if(!this._liveRange)throw new It.b("marker-destroyed: Cannot use a destroyed marker instance.",this);return this._managedUsingOperations}},{key:"affectsData",get:function(){if(!this._liveRange)throw new It.b("marker-destroyed: Cannot use a destroyed marker instance.",this);return this._affectsData}}]),e}();Yt(qa,zt);var Wa=function(e){function t(e,n){var r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"toNone";if(f(this,t),!(r=h(this,p(t).call(this,e,n,i))).root.is("rootElement"))throw new It.b("model-liveposition-root-not-rootelement: LivePosition's root has to be an instance of RootElement.",e);return Ya.call(o(r)),h(r)}return v(t,e),d(t,[{key:"detach",value:function(){this.stopListening()}},{key:"is",value:function(e){return"livePosition"==e||"model:livePosition"==e||l(p(t.prototype),"is",this).call(this,e)}},{key:"toPosition",value:function(){return new to(this.root,this.path.slice(),this.stickiness)}}],[{key:"fromPosition",value:function(e,t){return new this(e.root,e.path.slice(),t||e.stickiness)}}]),t}(to);function Ya(){var e=this;this.listenTo(this.root.document.model,"applyOperation",(function(t,n){var r=n[0];r.isDocumentOperation&&$a.call(e,r)}),{priority:"low"})}function $a(e){var t=this.getTransformedByOperation(e);if(!this.isEqual(t)){var n=this.toPosition();this.path=t.path,this.root=t.root,this.fire("change",n)}}Yt(Wa,zt);var Ga=function(){function e(t,n,r){f(this,e),this.model=t,this.writer=n,this.position=r,this.canMergeWith=new Set([this.position.parent]),this.schema=t.schema,this._filterAttributesOf=[],this._affectedStart=null,this._affectedEnd=null}return d(e,[{key:"handleNodes",value:function(e,t){e=Array.from(e);for(var n=0;n1){var p=i[0].start,v=i[i.length-1].end;h=[new no(p,v)]}e.setSelection(h,{backward:n.isBackward})}}(t,e)}))}(this)}return d(e,[{key:"change",value:function(e){try{return 0===this._pendingChanges.length?(this._pendingChanges.push({batch:new aa,callback:e}),this._runPendingChanges()[0]):e(this._currentWriter)}catch(e){It.b.rethrowUnexpectedError(e,this)}}},{key:"enqueueChange",value:function(e,t){try{"string"==typeof e?e=new aa(e):"function"==typeof e&&(t=e,e=new aa),this._pendingChanges.push({batch:e,callback:t}),1==this._pendingChanges.length&&this._runPendingChanges()}catch(e){It.b.rethrowUnexpectedError(e,this)}}},{key:"applyOperation",value:function(e){e._execute()}},{key:"insertContent",value:function(e,t,n){return function(e,t,n,r){return e.change((function(i){var o,a=(o=n?n instanceof lo||n instanceof yo?n:i.createSelection(n,r):e.document.selection).getFirstPosition();o.isCollapsed||e.deleteContent(o,{doNotAutoparagraph:!0});var s,l=new Ga(e,i,a);s=t.is("documentFragment")?t.getChildren():[t],l.handleNodes(s,{isFirst:!0,isLast:!0});var u=l.getSelectionRange();u&&(o instanceof yo?i.setSelection(u):o.setTo(u));var c=l.getAffectedRange()||e.createRange(a);return l.destroy(),c}))}(this,e,t,n)}},{key:"deleteContent",value:function(e,t){!function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t.isCollapsed){var r=t.getFirstRange();if("$graveyard"!=r.root.rootName){var i=e.schema;e.change((function(e){if(n.doNotResetEntireContent||!function(e,t){var n=e.getLimitElement(t);if(!t.containsEntireContent(n))return!1;var r=t.getFirstRange();return r.start.parent!=r.end.parent&&e.checkChild(n,"paragraph")}(i,t)){var o=r.start,a=Wa.fromPosition(r.end,"toNext");if(r.start.isTouching(r.end)||e.remove(r),n.leaveUnmerged||(function e(t,n,r){var i=n.parent,o=r.parent;if(i!=o&&!t.model.schema.isLimit(i)&&!t.model.schema.isLimit(o)&&function(e,t,n){var r=new no(e,t),i=!0,o=!1,a=void 0;try{for(var s,l=r.getWalker()[Symbol.iterator]();!(i=(s=l.next()).done);i=!0){var u=s.value;if(n.isLimit(u.item))return!1}}catch(c){o=!0,a=c}finally{try{i||null==l.return||l.return()}finally{if(o)throw a}}return!0}(n,r,t.model.schema)){for(n=t.createPositionAfter(i),(r=t.createPositionBefore(o)).isEqual(n)||t.insert(o,n),t.merge(n);r.parent.isEmpty;){var a=r.parent;r=t.createPositionBefore(a),t.remove(a)}e(t,n,r)}}(e,o,a),i.removeDisallowedAttributes(o.parent.getChildren(),e)),Ka(e,t,o),function(e,t){var n=e.checkChild(t,"$text"),r=e.checkChild(t,"paragraph");return!n&&r}(i,o)){var s=i.getNearestSelectionRange(o);n.doNotAutoparagraph&&s?Ka(e,t,s):Qa(e,o,t)}a.detach()}else!function(e,t){var n=e.model.schema.getLimitElement(t);e.remove(e.createRangeIn(n)),Qa(e,e.createPositionAt(n,0),t)}(e,t)}))}}}(this,e,t)}},{key:"modifySelection",value:function(e,t){!function(e,t){for(var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=e.schema,o="backward"!=r.direction,a=r.unit?r.unit:"character",s=t.focus,l=new Zi({boundaries:Za(s,o),singleCharacters:!0,direction:o?"forward":"backward"}),u={walker:l,schema:i,isForward:o,unit:a},c=function(){if(n.done)return{v:void 0};var r=Xa(u,n.value);return r?{v:void(t instanceof yo?e.change((function(e){e.setSelectionFocus(r)})):t.setFocus(r))}:void 0};n=l.next();){var f=c();if("object"===typeof f)return f.v}}(this,e,t)}},{key:"getSelectedContent",value:function(e){return function(e,t){return e.change((function(e){var n=e.createDocumentFragment(),r=t.getFirstRange();if(!r||r.isCollapsed)return n;var i,o=r.start.root,a=r.start.getCommonPath(r.end),s=o.getNodeByPath(a),l=(i=r.start.parent==r.end.parent?r:e.createRange(e.createPositionAt(s,r.start.path[a.length]),e.createPositionAt(s,r.end.path[a.length]+1))).end.offset-i.start.offset,u=!0,c=!1,f=void 0;try{for(var d,h=i.getItems({shallow:!0})[Symbol.iterator]();!(u=(d=h.next()).done);u=!0){var p=d.value;p.is("textProxy")?e.appendText(p.data,p.getAttributes(),n):e.append(p._clone(!0),n)}}catch(g){c=!0,f=g}finally{try{u||null==h.return||h.return()}finally{if(c)throw f}}if(i!=r){var v=r._getTransformedByMove(i.start,e.createPositionAt(n,0),l)[0],m=e.createRange(e.createPositionAt(n,0),v.start);ns(e.createRange(v.end,e.createPositionAt(n,"end")),e),ns(m,e)}return n}))}(this,e)}},{key:"hasContent",value:function(e,t){var n=e instanceof Xi?no._createIn(e):e;if(n.isCollapsed)return!1;var r=!0,i=!1,o=void 0;try{for(var a,s=this.markers.getMarkersIntersectingRange(n)[Symbol.iterator]();!(r=(a=s.next()).done);r=!0)if(a.value.affectsData)return!0}catch(m){i=!0,o=m}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}var l=(t||{}).ignoreWhitespaces,u=void 0!==l&&l,c=!0,f=!1,d=void 0;try{for(var h,p=n.getItems()[Symbol.iterator]();!(c=(h=p.next()).done);c=!0){var v=h.value;if(v.is("textProxy")){if(!u)return!0;if(-1!==v.data.search(/\S/))return!0}else if(this.schema.isObject(v))return!0}}catch(m){f=!0,d=m}finally{try{c||null==p.return||p.return()}finally{if(f)throw d}}return!1}},{key:"createPositionFromPath",value:function(e,t,n){return new to(e,t,n)}},{key:"createPositionAt",value:function(e,t){return to._createAt(e,t)}},{key:"createPositionAfter",value:function(e){return to._createAfter(e)}},{key:"createPositionBefore",value:function(e){return to._createBefore(e)}},{key:"createRange",value:function(e,t){return new no(e,t)}},{key:"createRangeIn",value:function(e){return no._createIn(e)}},{key:"createRangeOn",value:function(e){return no._createOn(e)}},{key:"createSelection",value:function(e,t,n){return new lo(e,t,n)}},{key:"createBatch",value:function(e){return new aa(e)}},{key:"destroy",value:function(){this.document.destroy(),this.stopListening()}},{key:"_runPendingChanges",value:function(){var e=[];for(this.fire("_beforeChanges");this._pendingChanges.length;){var t=this._pendingChanges[0].batch;this._currentWriter=new Ea(this,t);var n=this._pendingChanges[0].callback(this._currentWriter);e.push(n),this.document._handleChangeBlock(this._currentWriter),this._pendingChanges.shift(),this._currentWriter=null}return this.fire("_afterChanges"),e}}]),e}();Yt(as,wn);var ss=function(){function e(){f(this,e),this._listener=Object.create(Hr)}return d(e,[{key:"listenTo",value:function(e){var t=this;this._listener.listenTo(e,"keydown",(function(e,n){t._listener.fire("_keydown:"+Jn(n),n)}))}},{key:"set",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Xn(e),i=n.priority;this._listener.listenTo(this._listener,"_keydown:"+r,(function(e,n){t(n,(function(){n.preventDefault(),n.stopPropagation(),e.stop()})),e.return=!0}),{priority:i})}},{key:"press",value:function(e){return!!this._listener.fire("_keydown:"+Jn(e),e)}},{key:"destroy",value:function(){this._listener.stopListening()}}]),e}(),ls=function(e){function t(e){var n;return f(this,t),(n=h(this,p(t).call(this))).editor=e,n}return v(t,e),d(t,[{key:"set",value:function(e,n){var r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("string"==typeof n){var o=n;n=function(e,t){r.editor.execute(o),t()}}l(p(t.prototype),"set",this).call(this,e,n,i)}}]),t}(ss),us=function(){function t(e){var n=this;f(this,t);var r=this.constructor.builtinPlugins;this.config=new Ot(e,this.constructor.defaultConfig),this.config.define("plugins",r),this.plugins=new Ro(this,r),this.commands=new jo;var i=this.config.get("language")||{};this.locale=new Fo({uiLanguage:"string"==typeof i?i:i.ui,contentLanguage:this.config.get("language.content")}),this.t=this.locale.t,this.set("state","initializing"),this.once("ready",(function(){return n.state="ready"}),{priority:"high"}),this.once("destroy",(function(){return n.state="destroyed"}),{priority:"high"}),this.set("isReadOnly",!1),this.model=new as,this.data=new na(this.model),this.editing=new Do(this.model),this.editing.view.document.bind("isReadOnly").to(this),this.conversion=new ra([this.editing.downcastDispatcher,this.data.downcastDispatcher],this.data.upcastDispatcher),this.conversion.addAlias("dataDowncast",this.data.downcastDispatcher),this.conversion.addAlias("editingDowncast",this.editing.downcastDispatcher),this.keystrokes=new ls(this),this.keystrokes.listenTo(this.editing.view.document)}return d(t,[{key:"initPlugins",value:function(){var e=this.config,t=e.get("plugins")||[],n=e.get("removePlugins")||[],r=e.get("extraPlugins")||[];return this.plugins.init(t.concat(r),n)}},{key:"destroy",value:function(){var e=this,t=Promise.resolve();return"initializing"==this.state&&(t=new Promise((function(t){return e.once("ready",t)}))),t.then((function(){e.fire("destroy"),e.stopListening(),e.commands.destroy()})).then((function(){return e.plugins.destroy()})).then((function(){e.model.destroy(),e.data.destroy(),e.editing.destroy(),e.keystrokes.destroy()}))}},{key:"execute",value:function(){try{var t;(t=this.commands).execute.apply(t,arguments)}catch(e){It.b.rethrowUnexpectedError(e,this)}}}]),t}();Yt(us,wn);var cs={updateSourceElement:function(){if(!this.sourceElement)throw new It.b("editor-missing-sourceelement: Cannot update the source element of a detached editor.",this);var e,t;e=this.sourceElement,t=this.data.get(),e instanceof HTMLTextAreaElement&&(e.value=t),e.innerHTML=t}},fs=function(){function e(){f(this,e)}return d(e,[{key:"getHtml",value:function(e){var t=document.implementation.createHTMLDocument("").createElement("div");return t.appendChild(e),t.innerHTML}}]),e}(),ds=function(){function e(){f(this,e),this._domParser=new DOMParser,this._domConverter=new Fr({blockFillerMode:"nbsp"}),this._htmlWriter=new fs}return d(e,[{key:"toData",value:function(e){var t=this._domConverter.viewToDom(e,document);return this._htmlWriter.getHtml(t)}},{key:"toView",value:function(e){var t=this._toDom(e);return this._domConverter.domToView(t)}},{key:"_toDom",value:function(e){for(var t=this._domParser.parseFromString(e,"text/html"),n=t.createDocumentFragment(),r=t.body.childNodes;r.length>0;)n.appendChild(r[0]);return n}}]),e}(),hs=function(){function e(t){f(this,e),this.editor=t,this._components=new Map}return d(e,[{key:"names",value:s.mark((function e(){var t,n,r,i,o,a;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=!0,n=!1,r=void 0,e.prev=3,i=this._components.values()[Symbol.iterator]();case 5:if(t=(o=i.next()).done){e.next=12;break}return a=o.value,e.next=9,a.originalName;case 9:t=!0,e.next=5;break;case 12:e.next=18;break;case 14:e.prev=14,e.t0=e.catch(3),n=!0,r=e.t0;case 18:e.prev=18,e.prev=19,t||null==i.return||i.return();case 21:if(e.prev=21,!n){e.next=24;break}throw r;case 24:return e.finish(21);case 25:return e.finish(18);case 26:case"end":return e.stop()}}),e,this,[[3,14,18,26],[19,,21,25]])}))},{key:"add",value:function(e,t){if(this.has(e))throw new It.b("componentfactory-item-exists: The item already exists in the component factory.",this,{name:e});this._components.set(ps(e),{callback:t,originalName:e})}},{key:"create",value:function(e){if(!this.has(e))throw new It.b("componentfactory-item-missing: The required component is not registered in the factory.",this,{name:e});return this._components.get(ps(e)).callback(this.editor.locale)}},{key:"has",value:function(e){return this._components.has(ps(e))}}]),e}();function ps(e){return String(e).toLowerCase()}var vs=function(){function e(){f(this,e),this.set("isFocused",!1),this.set("focusedElement",null),this._elements=new Set,this._nextEventLoopTimeout=null}return d(e,[{key:"add",value:function(e){var t=this;if(this._elements.has(e))throw new It.b("focusTracker-add-element-already-exist",this);this.listenTo(e,"focus",(function(){return t._focus(e)}),{useCapture:!0}),this.listenTo(e,"blur",(function(){return t._blur()}),{useCapture:!0}),this._elements.add(e)}},{key:"remove",value:function(e){e===this.focusedElement&&this._blur(e),this._elements.has(e)&&(this.stopListening(e),this._elements.delete(e))}},{key:"destroy",value:function(){this.stopListening()}},{key:"_focus",value:function(e){clearTimeout(this._nextEventLoopTimeout),this.focusedElement=e,this.isFocused=!0}},{key:"_blur",value:function(){var e=this;clearTimeout(this._nextEventLoopTimeout),this._nextEventLoopTimeout=setTimeout((function(){e.focusedElement=null,e.isFocused=!1}),0)}}]),e}();Yt(vs,Hr),Yt(vs,wn);var ms=function(){function e(t){var n=this;f(this,e),this.editor=t,this.componentFactory=new hs(t),this.focusTracker=new vs,this._editableElementsMap=new Map,this.listenTo(t.editing.view.document,"layoutChanged",(function(){return n.update()}))}return d(e,[{key:"update",value:function(){this.fire("update")}},{key:"destroy",value:function(){this.stopListening(),this.focusTracker.destroy();var e=!0,t=!1,n=void 0;try{for(var r,i=this._editableElementsMap.values()[Symbol.iterator]();!(e=(r=i.next()).done);e=!0)r.value.ckeditorInstance=null}catch(o){t=!0,n=o}finally{try{e||null==i.return||i.return()}finally{if(t)throw n}}this._editableElementsMap=new Map}},{key:"setEditableElement",value:function(e,t){this._editableElementsMap.set(e,t),t.ckeditorInstance||(t.ckeditorInstance=this.editor)}},{key:"getEditableElement",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"main";return this._editableElementsMap.get(e)}},{key:"getEditableElementsNames",value:function(){return this._editableElementsMap.keys()}},{key:"element",get:function(){return null}},{key:"_editableElements",get:function(){return console.warn("editor-ui-deprecated-editable-elements: The EditorUI#_editableElements property has been deprecated and will be removed in the near future.",{editorUI:this}),this._editableElementsMap}}]),e}();Yt(ms,zt),n(13);var gs=new WeakMap;function ys(e){var t=e.view,n=e.element,r=e.text,i=e.isDirectHost,o=void 0===i||i,a=t.document;gs.has(a)||(gs.set(a,new Map),a.registerPostFixer((function(e){return bs(a,e)}))),gs.get(a).set(n,{text:r,isDirectHost:o}),t.change((function(e){return bs(a,e)}))}function bs(e,t){var n=gs.get(e),r=!1,i=!0,o=!1,a=void 0;try{for(var s,l=n[Symbol.iterator]();!(i=(s=l.next()).done);i=!0){var u=s.value,f=c(u,2);ks(t,f[0],f[1])&&(r=!0)}}catch(d){o=!0,a=d}finally{try{i||null==l.return||l.return()}finally{if(o)throw a}}return r}function ks(e,t,n){var r=n.text,i=n.isDirectHost?t:function(e){if(1===e.childCount){var t=e.getChild(0);if(t.is("element")&&!t.is("uiElement"))return t}return null}(t),o=!1;return!!i&&(n.hostElement=i,i.getAttribute("data-placeholder")!==r&&(e.setAttribute("data-placeholder",r,i),o=!0),function(e){var t=e.document;if(!t)return!1;var n=!Array.from(e.getChildren()).some((function(e){return!e.is("uiElement")}));if(!t.isFocused&&n)return!0;var r=t.selection.anchor;return!(!n||!r||r.parent===e)}(i)?function(e,t){return!t.hasClass("ck-placeholder")&&(e.addClass("ck-placeholder",t),!0)}(e,i)&&(o=!0):function(e,t){return!!t.hasClass("ck-placeholder")&&(e.removeClass("ck-placeholder",t),!0)}(e,i)&&(o=!0),o)}var ws=function(){function e(){f(this,e),this._replacedElements=[]}return d(e,[{key:"replace",value:function(e,t){this._replacedElements.push({element:e,newElement:t}),e.style.display="none",t&&e.parentNode.insertBefore(t,e.nextSibling)}},{key:"restore",value:function(){this._replacedElements.forEach((function(e){var t=e.element,n=e.newElement;t.style.display="",n&&n.remove()})),this._replacedElements=[]}}]),e}(),_s=function(e){function t(e,n){var r,i;return f(this,t),(r=h(this,p(t).call(this,e))).view=n,r._toolbarConfig=(i=e.config.get("toolbar"),Array.isArray(i)?{items:i}:i?Object.assign({items:[]},i):{items:[]}),r._elementReplacer=new ws,r}return v(t,e),d(t,[{key:"init",value:function(e){var t=this.editor,n=this.view,r=t.editing.view,i=n.editable,o=r.document.getRoot();i.name=o.rootName,n.render();var a=i.element;this.setEditableElement(i.name,a),this.focusTracker.add(a),n.editable.bind("isFocused").to(this.focusTracker),r.attachDomRoot(a),e&&this._elementReplacer.replace(e,this.element),this._initPlaceholder(),this._initToolbar(),this.fire("ready")}},{key:"destroy",value:function(){var e=this.view,n=this.editor.editing.view;this._elementReplacer.restore(),n.detachDomRoot(e.editable.name),e.destroy(),l(p(t.prototype),"destroy",this).call(this)}},{key:"_initToolbar",value:function(){var e=this.editor,t=this.view,n=e.editing.view;t.stickyPanel.bind("isActive").to(this.focusTracker,"isFocused"),t.stickyPanel.limiterElement=t.element,this._toolbarConfig.viewportTopOffset&&(t.stickyPanel.viewportTopOffset=this._toolbarConfig.viewportTopOffset),t.toolbar.fillFromConfig(this._toolbarConfig.items,this.componentFactory),function(e){var t=e.origin,n=e.originKeystrokeHandler,r=e.originFocusTracker,i=e.toolbar,o=e.beforeFocus,a=e.afterBlur;r.add(i.element),n.set("Alt+F10",(function(e,t){r.isFocused&&!i.focusTracker.isFocused&&(o&&o(),i.focus(),t())})),i.keystrokes.set("Esc",(function(e,n){i.focusTracker.isFocused&&(t.focus(),a&&a(),n())}))}({origin:n,originFocusTracker:this.focusTracker,originKeystrokeHandler:e.keystrokes,toolbar:t.toolbar})}},{key:"_initPlaceholder",value:function(){var e=this.editor,t=e.editing.view,n=t.document.getRoot(),r=e.sourceElement,i=e.config.get("placeholder")||r&&"textarea"===r.tagName.toLowerCase()&&r.getAttribute("placeholder");i&&ys({view:t,element:n,text:i,isDirectHost:!1})}},{key:"element",get:function(){return this.view.element}}]),t}(ms),xs=function(e){function t(e){var n;return f(this,t),(n=h(this,p(t).call(this,{idProperty:"viewUid"}))).on("add",(function(e,t,r){t.isRendered||t.render(),t.element&&n._parentElement&&n._parentElement.insertBefore(t.element,n._parentElement.children[r])})),n.on("remove",(function(e,t){t.element&&n._parentElement&&t.element.remove()})),n.locale=e,n._parentElement=null,n}return v(t,e),d(t,[{key:"destroy",value:function(){this.map((function(e){return e.destroy()}))}},{key:"setParent",value:function(e){this._parentElement=e}},{key:"delegate",value:function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;rl&&y():!i&&r?f>s&&y():d>l&&f>=s?y():d>=l&&f>s&&y(),f===u})),o?[a,o]:null}(r,f,u,i&&new Ii(i).getVisible(),o&&new Ii(Dr.window))||rl(r[0],f,u),h=c(d,2);s=h[0],a=h[1]}else{var p=rl(r[0],f,u),v=c(p,2);s=v[0],a=v[1]}var m=il(a),g=m.left,y=m.top;if(l){var b=il(new Ii(l)),k=Oi(l);g-=b.left,y-=b.top,g+=l.scrollLeft,y+=l.scrollTop,g-=k.left,y-=k.top}return{left:g,top:y,name:s}}function rl(e,t,n){var r=e(t,n),i=r.left,o=r.top;return[r.name,n.clone().moveTo(i,o)]}function il(e){var t=e.left,n=e.top,r=Dr.window;return{left:t+r.scrollX,top:n+r.scrollY}}n(23);var ol=function(e){function t(e,n,r){var i;f(this,t);var o=(i=h(this,p(t).call(this,e))).bindTemplate;return i.buttonView=n,i.panelView=r,i.set("isOpen",!1),i.set("isEnabled",!0),i.set("class"),i.set("panelPosition","auto"),i.focusTracker=new vs,i.keystrokes=new ss,i.setTemplate({tag:"div",attributes:{class:["ck","ck-dropdown",o.to("class"),o.if("isEnabled","ck-disabled",(function(e){return!e}))]},children:[n,r]}),n.extendTemplate({attributes:{class:["ck-dropdown__button"]}}),i}return v(t,e),d(t,[{key:"render",value:function(){var e=this;l(p(t.prototype),"render",this).call(this),this.listenTo(this.buttonView,"open",(function(){e.isOpen=!e.isOpen})),this.panelView.bind("isVisible").to(this,"isOpen"),this.on("change:isOpen",(function(){e.isOpen&&("auto"===e.panelPosition?e.panelView.position=t._getOptimalPosition({element:e.panelView.element,target:e.buttonView.element,fitInViewport:!0,positions:e._panelPositions}).name:e.panelView.position=e.panelPosition)})),this.keystrokes.listenTo(this.element),this.focusTracker.add(this.element);var n=function(t,n){e.isOpen&&(e.buttonView.focus(),e.isOpen=!1,n())};this.keystrokes.set("arrowdown",(function(t,n){e.buttonView.isEnabled&&!e.isOpen&&(e.isOpen=!0,n())})),this.keystrokes.set("arrowright",(function(t,n){e.isOpen&&n()})),this.keystrokes.set("arrowleft",n),this.keystrokes.set("esc",n)}},{key:"focus",value:function(){this.buttonView.focus()}},{key:"_panelPositions",get:function(){var e=t.defaultPanelPositions,n=e.southEast,r=e.southWest,i=e.northEast,o=e.northWest;return"ltr"===this.locale.uiLanguageDirection?[n,r,i,o]:[r,n,o,i]}}]),t}(Hs);ol.defaultPanelPositions={southEast:function(e){return{top:e.bottom,left:e.left,name:"se"}},southWest:function(e,t){return{top:e.bottom,left:e.left-t.width+e.width,name:"sw"}},northEast:function(e,t){return{top:e.top-t.height,left:e.left,name:"ne"}},northWest:function(e,t){return{top:e.bottom-t.height,left:e.left-t.width+e.width,name:"nw"}}},ol._getOptimalPosition=nl,n(25);var al=function(e){function t(){var e;f(this,t);var n=(e=h(this,p(t).call(this))).bindTemplate;return e.set("content",""),e.set("viewBox","0 0 20 20"),e.set("fillColor",""),e.setTemplate({tag:"svg",ns:"http://www.w3.org/2000/svg",attributes:{class:["ck","ck-icon"],viewBox:n.to("viewBox")}}),e}return v(t,e),d(t,[{key:"render",value:function(){var e=this;l(p(t.prototype),"render",this).call(this),this._updateXMLContent(),this._colorFillPaths(),this.on("change:content",(function(){e._updateXMLContent(),e._colorFillPaths()})),this.on("change:fillColor",(function(){e._colorFillPaths()}))}},{key:"_updateXMLContent",value:function(){if(this.content){var e=(new DOMParser).parseFromString(this.content.trim(),"image/svg+xml").querySelector("svg"),t=e.getAttribute("viewBox");for(t&&(this.viewBox=t),this.element.innerHTML="";e.childNodes.length>0;)this.element.appendChild(e.childNodes[0])}}},{key:"_colorFillPaths",value:function(){var e=this;this.fillColor&&this.element.querySelectorAll(".ck-icon__fill").forEach((function(t){t.style.fill=e.fillColor}))}}]),t}(Hs);n(27);var sl=function(e){function t(e){var n;f(this,t),(n=h(this,p(t).call(this,e))).set("text",""),n.set("position","s");var r=n.bindTemplate;return n.setTemplate({tag:"span",attributes:{class:["ck","ck-tooltip",r.to("position",(function(e){return"ck-tooltip_"+e})),r.if("text","ck-hidden",(function(e){return!e.trim()}))]},children:[{tag:"span",attributes:{class:["ck","ck-tooltip__text"]},children:[{text:r.to("text")}]}]}),n}return v(t,e),t}(Hs);n(29);var ll=function(e){function t(e){var n;f(this,t);var r=(n=h(this,p(t).call(this,e))).bindTemplate,i=Rt();return n.set("class"),n.set("labelStyle"),n.set("icon"),n.set("isEnabled",!0),n.set("isOn",!1),n.set("isVisible",!0),n.set("isToggleable",!1),n.set("keystroke"),n.set("label"),n.set("tabindex",-1),n.set("tooltip"),n.set("tooltipPosition","s"),n.set("type","button"),n.set("withText",!1),n.set("withKeystroke",!1),n.children=n.createCollection(),n.tooltipView=n._createTooltipView(),n.labelView=n._createLabelView(i),n.iconView=new al,n.iconView.extendTemplate({attributes:{class:"ck-button__icon"}}),n.keystrokeView=n._createKeystrokeView(),n.bind("_tooltipString").to(o(n),"tooltip",o(n),"label",o(n),"keystroke",n._getTooltipString.bind(o(n))),n.setTemplate({tag:"button",attributes:{class:["ck","ck-button",r.to("class"),r.if("isEnabled","ck-disabled",(function(e){return!e})),r.if("isVisible","ck-hidden",(function(e){return!e})),r.to("isOn",(function(e){return e?"ck-on":"ck-off"})),r.if("withText","ck-button_with-text"),r.if("withKeystroke","ck-button_with-keystroke")],type:r.to("type",(function(e){return e||"button"})),tabindex:r.to("tabindex"),"aria-labelledby":"ck-editor__aria-label_".concat(i),"aria-disabled":r.if("isEnabled",!0,(function(e){return!e})),"aria-pressed":r.to("isOn",(function(e){return!!n.isToggleable&&String(e)}))},children:n.children,on:{mousedown:r.to((function(e){e.preventDefault()})),click:r.to((function(e){n.isEnabled?n.fire("execute"):e.preventDefault()}))}}),n}return v(t,e),d(t,[{key:"render",value:function(){l(p(t.prototype),"render",this).call(this),this.icon&&(this.iconView.bind("content").to(this,"icon"),this.children.add(this.iconView)),this.children.add(this.tooltipView),this.children.add(this.labelView),this.withKeystroke&&this.children.add(this.keystrokeView)}},{key:"focus",value:function(){this.element.focus()}},{key:"_createTooltipView",value:function(){var e=new sl;return e.bind("text").to(this,"_tooltipString"),e.bind("position").to(this,"tooltipPosition"),e}},{key:"_createLabelView",value:function(e){var t=new Hs,n=this.bindTemplate;return t.setTemplate({tag:"span",attributes:{class:["ck","ck-button__label"],style:n.to("labelStyle"),id:"ck-editor__aria-label_".concat(e)},children:[{text:this.bindTemplate.to("label")}]}),t}},{key:"_createKeystrokeView",value:function(){var e=new Hs;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__keystroke"]},children:[{text:this.bindTemplate.to("keystroke",(function(e){return Zn(e)}))}]}),e}},{key:"_getTooltipString",value:function(e,t,n){return e?"string"==typeof e?e:(n&&(n=Zn(n)),e instanceof Function?e(t,n):"".concat(t).concat(n?" (".concat(n,")"):"")):""}}]),t}(Hs),ul=function(e){function t(e){var n;return f(this,t),(n=h(this,p(t).call(this,e))).arrowView=n._createArrowView(),n.extendTemplate({attributes:{"aria-haspopup":!0}}),n.delegate("execute").to(o(n),"open"),n}return v(t,e),d(t,[{key:"render",value:function(){l(p(t.prototype),"render",this).call(this),this.children.add(this.arrowView)}},{key:"_createArrowView",value:function(){var e=new al;return e.content='',e.extendTemplate({attributes:{class:"ck-dropdown__arrow"}}),e}}]),t}(ll);n(31);var cl=function(e){function t(){var e;return f(this,t),(e=h(this,p(t).call(this))).items=e.createCollection(),e.focusTracker=new vs,e.keystrokes=new ss,e._focusCycler=new Js({focusables:e.items,focusTracker:e.focusTracker,keystrokeHandler:e.keystrokes,actions:{focusPrevious:"arrowup",focusNext:"arrowdown"}}),e.setTemplate({tag:"ul",attributes:{class:["ck","ck-reset","ck-list"]},children:e.items}),e}return v(t,e),d(t,[{key:"render",value:function(){var e=this;l(p(t.prototype),"render",this).call(this);var n=!0,r=!1,i=void 0;try{for(var o,a=this.items[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;this.focusTracker.add(s.element)}}catch(u){r=!0,i=u}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}this.items.on("add",(function(t,n){e.focusTracker.add(n.element)})),this.items.on("remove",(function(t,n){e.focusTracker.remove(n.element)})),this.keystrokes.listenTo(this.element)}},{key:"focus",value:function(){this._focusCycler.focusFirst()}},{key:"focusLast",value:function(){this._focusCycler.focusLast()}}]),t}(Hs),fl=function(e){function t(e){var n;return f(this,t),(n=h(this,p(t).call(this,e))).children=n.createCollection(),n.setTemplate({tag:"li",attributes:{class:["ck","ck-list__item"]},children:n.children}),n}return v(t,e),d(t,[{key:"focus",value:function(){this.children.first.focus()}}]),t}(Hs),dl=function(e){function t(e){var n;return f(this,t),(n=h(this,p(t).call(this,e))).setTemplate({tag:"li",attributes:{class:["ck","ck-list__separator"]}}),n}return v(t,e),t}(Hs);n(33);var hl=function(e){function t(e){var n;return f(this,t),(n=h(this,p(t).call(this,e))).isToggleable=!0,n.toggleSwitchView=n._createToggleView(),n.extendTemplate({attributes:{class:"ck-switchbutton"}}),n}return v(t,e),d(t,[{key:"render",value:function(){l(p(t.prototype),"render",this).call(this),this.children.add(this.toggleSwitchView)}},{key:"_createToggleView",value:function(){var e=new Hs;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__toggle"]},children:[{tag:"span",attributes:{class:["ck","ck-button__toggle__inner"]}}]}),e}}]),t}(ll);function pl(e){var t=e.emitter,n=e.activator,r=e.callback,i=e.contextElements;t.listenTo(document,"mousedown",(function(e,t){var o=t.target;if(n()){var a=!0,s=!1,l=void 0;try{for(var u,c=i[Symbol.iterator]();!(a=(u=c.next()).done);a=!0)if(u.value.contains(o))return}catch(f){s=!0,l=f}finally{try{a||null==c.return||c.return()}finally{if(s)throw l}}r()}}))}function vl(e){var t=new(arguments.length>1&&void 0!==arguments[1]?arguments[1]:ul)(e),n=new tl(e),r=new ol(e,t,n);return t.bind("isEnabled").to(r),t instanceof ul?t.bind("isOn").to(r,"isOpen"):t.arrowView.bind("isOn").to(r,"isOpen"),function(e){(function(e){e.on("render",(function(){pl({emitter:e,activator:function(){return e.isOpen},callback:function(){e.isOpen=!1},contextElements:[e.element]})}))})(e),function(e){e.on("execute",(function(t){t.source instanceof hl||(e.isOpen=!1)}))}(e),function(e){e.keystrokes.set("arrowdown",(function(t,n){e.isOpen&&(e.panelView.focus(),n())})),e.keystrokes.set("arrowup",(function(t,n){e.isOpen&&(e.panelView.focusLast(),n())}))}(e)}(r),r}function ml(e,t){var n=e.locale,r=e.listView=new cl(n);r.items.bindTo(t).using((function(e){var t=e.type,r=e.model;if("separator"===t)return new dl(n);if("button"===t||"switchbutton"===t){var i,o,a=new fl(n);return(i=o="button"===t?new ll(n):new hl(n)).bind.apply(i,u(Object.keys(r))).to(r),o.delegate("execute").to(a),a.children.add(o),a}})),e.panelView.children.add(r),r.items.delegate("execute").to(e)}n(35),n(37),n(39);var gl=function(e){function t(e,n){var r;f(this,t);var i,a=(r=h(this,p(t).call(this,e))).bindTemplate,s=r.t;return r.options=n||{},r.set("ariaLabel",s("bq")),r.items=r.createCollection(),r.focusTracker=new vs,r.keystrokes=new ss,r.set("class"),r.itemsView=new yl(e),r.children=r.createCollection(),r.children.add(r.itemsView),r.focusables=r.createCollection(),r._focusCycler=new Js({focusables:r.focusables,focusTracker:r.focusTracker,keystrokeHandler:r.keystrokes,actions:{focusPrevious:["arrowleft","arrowup"],focusNext:["arrowright","arrowdown"]}}),r.setTemplate({tag:"div",attributes:{class:["ck","ck-toolbar",a.to("class")],role:"toolbar","aria-label":a.to("ariaLabel")},children:r.children,on:{mousedown:(i=o(r),i.bindTemplate.to((function(e){e.target===i.element&&e.preventDefault()})))}}),r._behavior=r.options.shouldGroupWhenFull?new kl(o(r)):new bl(o(r)),r}return v(t,e),d(t,[{key:"render",value:function(){var e=this;l(p(t.prototype),"render",this).call(this);var n=!0,r=!1,i=void 0;try{for(var o,a=this.items[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;this.focusTracker.add(s.element)}}catch(u){r=!0,i=u}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}this.items.on("add",(function(t,n){e.focusTracker.add(n.element)})),this.items.on("remove",(function(t,n){e.focusTracker.remove(n.element)})),this.keystrokes.listenTo(this.element),this._behavior.render(this)}},{key:"destroy",value:function(){return this._behavior.destroy(),l(p(t.prototype),"destroy",this).call(this)}},{key:"focus",value:function(){this._focusCycler.focusFirst()}},{key:"focusLast",value:function(){this._focusCycler.focusLast()}},{key:"fillFromConfig",value:function(e,t){var n=this;e.map((function(e){"|"==e?n.items.add(new Zs):t.has(e)?n.items.add(t.create(e)):console.warn(Object(It.a)("toolbarview-item-unavailable: The requested toolbar item is unavailable."),{name:e})}))}}]),t}(Hs),yl=function(e){function t(e){var n;return f(this,t),(n=h(this,p(t).call(this,e))).children=n.createCollection(),n.setTemplate({tag:"div",attributes:{class:["ck","ck-toolbar__items"]},children:n.children}),n}return v(t,e),t}(Hs),bl=function(){function e(t){f(this,e);var n=t.bindTemplate;t.set("isVertical",!1),t.itemsView.children.bindTo(t.items).using((function(e){return e})),t.focusables.bindTo(t.items).using((function(e){return e})),t.extendTemplate({attributes:{class:[n.if("isVertical","ck-toolbar_vertical")]}})}return d(e,[{key:"render",value:function(){}},{key:"destroy",value:function(){}}]),e}(),kl=function(){function e(t){var n=this;f(this,e),this.viewChildren=t.children,this.viewFocusables=t.focusables,this.viewItemsView=t.itemsView,this.viewFocusTracker=t.focusTracker,this.viewLocale=t.locale,this.ungroupedItems=t.createCollection(),this.groupedItems=t.createCollection(),this.groupedItemsDropdown=this._createGroupedItemsDropdown(),this.resizeObserver=null,this.cachedPadding=null,t.itemsView.children.bindTo(this.ungroupedItems).using((function(e){return e})),this.ungroupedItems.on("add",this._updateFocusCycleableItems.bind(this)),this.ungroupedItems.on("remove",this._updateFocusCycleableItems.bind(this)),t.children.on("add",this._updateFocusCycleableItems.bind(this)),t.children.on("remove",this._updateFocusCycleableItems.bind(this)),t.items.on("add",(function(e,t,r){r>n.ungroupedItems.length?n.groupedItems.add(t,r-n.ungroupedItems.length):n.ungroupedItems.add(t,r),n._updateGrouping()})),t.items.on("remove",(function(e,t,r){r>n.ungroupedItems.length?n.groupedItems.remove(t):n.ungroupedItems.remove(t),n._updateGrouping()})),t.extendTemplate({attributes:{class:["ck-toolbar_grouping"]}})}return d(e,[{key:"render",value:function(e){this.viewElement=e.element,this._enableGroupingOnResize()}},{key:"destroy",value:function(){this.groupedItemsDropdown.destroy(),this.resizeObserver.disconnect()}},{key:"_updateGrouping",value:function(){if(this.viewElement.ownerDocument.body.contains(this.viewElement)){for(var e;this._areItemsOverflowing;)this._groupLastItem(),e=!0;if(!e&&this.groupedItems.length){for(;this.groupedItems.length&&!this._areItemsOverflowing;)this._ungroupFirstItem();this._areItemsOverflowing&&this._groupLastItem()}}}},{key:"_enableGroupingOnResize",value:function(){var e,t,n=this;this.resizeObserver=(t=function(t){var r=c(t,1)[0];e&&e===r.contentRect.width||(n._updateGrouping(),e=r.contentRect.width)},"function"==typeof Dr.window.ResizeObserver?new Dr.window.ResizeObserver(t):new el(t)),this.resizeObserver.observe(this.viewElement),this._updateGrouping()}},{key:"_groupLastItem",value:function(){this.groupedItems.length||(this.viewChildren.add(new Zs),this.viewChildren.add(this.groupedItemsDropdown),this.viewFocusTracker.add(this.groupedItemsDropdown.element)),this.groupedItems.add(this.ungroupedItems.remove(this.ungroupedItems.last),0)}},{key:"_ungroupFirstItem",value:function(){this.ungroupedItems.add(this.groupedItems.remove(this.groupedItems.first)),this.groupedItems.length||(this.viewChildren.remove(this.groupedItemsDropdown),this.viewChildren.remove(this.viewChildren.last),this.viewFocusTracker.remove(this.groupedItemsDropdown.element))}},{key:"_createGroupedItemsDropdown",value:function(){var e=this.viewLocale,t=e.t,n=vl(e);return n.class="ck-toolbar__grouped-dropdown",n.panelPosition="ltr"===e.uiLanguageDirection?"sw":"se",function(e,t){var n=e.locale,r=n.t,i=e.toolbarView=new gl(n);i.set("ariaLabel",r("bm")),e.extendTemplate({attributes:{class:["ck-toolbar-dropdown"]}}),[].map((function(e){return i.items.add(e)})),e.panelView.children.add(i),i.items.delegate("execute").to(e)}(n),n.buttonView.set({label:t("br"),tooltip:!0,icon:'\n'}),n.toolbarView.items.bindTo(this.groupedItems).using((function(e){return e})),n}},{key:"_updateFocusCycleableItems",value:function(){var e=this;this.viewFocusables.clear(),this.ungroupedItems.map((function(t){e.viewFocusables.add(t)})),this.groupedItems.length&&this.viewFocusables.add(this.groupedItemsDropdown)}},{key:"_areItemsOverflowing",get:function(){if(!this.ungroupedItems.length)return!1;var e=this.viewElement,t=this.viewLocale.uiLanguageDirection,n=new Ii(e.lastChild),r=new Ii(e);if(!this.cachedPadding){var i=Dr.window.getComputedStyle(e),o="ltr"===t?"paddingRight":"paddingLeft";this.cachedPadding=Number.parseInt(i[o])}return"ltr"===t?n.right>r.right-this.cachedPadding:n.left2&&void 0!==arguments[2]?arguments[2]:{};return f(this,t),(r=h(this,p(t).call(this,e))).stickyPanel=new Ks(e),r.toolbar=new gl(e,{shouldGroupWhenFull:i.shouldToolbarGroupWhenFull}),r.editable=new $s(e,n),r}return v(t,e),d(t,[{key:"render",value:function(){l(p(t.prototype),"render",this).call(this),this.stickyPanel.content.add(this.toolbar),this.top.add(this.stickyPanel),this.main.add(this.editable)}}]),t}(Ys),_l=function(e){function t(e,n){var r;f(this,t),r=h(this,p(t).call(this,n)),Mt(e)&&(r.sourceElement=e),r.data.processor=new ds,r.model.document.createRoot();var i=!r.config.get("toolbar.shouldNotGroupWhenFull"),a=new wl(r.locale,r.editing.view,{shouldToolbarGroupWhenFull:i});return r.ui=new _s(o(r),a),function(e){if(!H(e.updateSourceElement))throw new It.b("attachtoform-missing-elementapi-interface: Editor passed to attachToForm() must implement ElementApi.",e);var t=e.sourceElement;if(t&&"textarea"===t.tagName.toLowerCase()&&t.form){var n,r=t.form,i=function(){return e.updateSourceElement()};H(r.submit)&&(n=r.submit,r.submit=function(){i(),n.apply(r)}),r.addEventListener("submit",i),e.on("destroy",(function(){r.removeEventListener("submit",i),n&&(r.submit=n)}))}}(o(r)),r}return v(t,e),d(t,[{key:"destroy",value:function(){return this.sourceElement&&this.updateSourceElement(),this.ui.destroy(),l(p(t.prototype),"destroy",this).call(this)}}],[{key:"create",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(r){var i=new t(e,n);r(i.initPlugins().then((function(){return i.ui.init(Mt(e)?e:null)})).then((function(){if(!Mt(e)&&n.initialData)throw new It.b("editor-create-initial-data: The config.initialData option cannot be used together with initial data passed in Editor.create().",null);var t=n.initialData||function(e){return Mt(e)?(t=e)instanceof HTMLTextAreaElement?t.value:t.innerHTML:e;var t}(e);return i.data.init(t)})).then((function(){return i.fire("ready")})).then((function(){return i})))}))}}]),t}(us);Yt(_l,{setData:function(e){this.data.set(e)},getData:function(e){return this.data.get(e)}}),Yt(_l,cs);var xl=function(){function e(t){f(this,e),this.editor=t}return d(e,[{key:"destroy",value:function(){this.stopListening()}}]),e}();Yt(xl,wn);var Tl=function(){function e(t){f(this,e),this.files=function(e){var t=e.files?Array.from(e.files):[],n=e.items?Array.from(e.items):[];return t.length?t:n.filter((function(e){return"file"===e.kind})).map((function(e){return e.getAsFile()}))}(t),this._native=t}return d(e,[{key:"getData",value:function(e){return this._native.getData(e)}},{key:"setData",value:function(e,t){this._native.setData(e,t)}},{key:"types",get:function(){return this._native.types}}]),e}(),Cl=function(e){function t(e){var n;f(this,t);var r=(n=h(this,p(t).call(this,e))).document;function i(e,t){t.preventDefault();var n=t.dropRange?[t.dropRange]:Array.from(r.selection.getRanges()),i=new Dt(r,"clipboardInput");r.fire(i,{dataTransfer:t.dataTransfer,targetRanges:n}),i.stop.called&&t.stopPropagation()}return n.domEventType=["paste","copy","cut","drop","dragover"],n.listenTo(r,"paste",i,{priority:"low"}),n.listenTo(r,"drop",i,{priority:"low"}),n}return v(t,e),d(t,[{key:"onDomEvent",value:function(e){var t={dataTransfer:new Tl(e.clipboardData?e.clipboardData:e.dataTransfer)};"drop"==e.type&&(t.dropRange=function(e,t){var n,r=t.target.ownerDocument,i=t.clientX,o=t.clientY;return r.caretRangeFromPoint&&r.caretRangeFromPoint(i,o)?n=r.caretRangeFromPoint(i,o):t.rangeParent&&((n=r.createRange()).setStart(t.rangeParent,t.rangeOffset),n.collapse(!0)),n?e.domConverter.domRangeToView(n):e.document.selection.getFirstRange()}(this.view,e)),this.fire(e.type,e,t)}}]),t}(di),Sl=["figcaption","li"],El=function(e){function t(){return f(this,t),h(this,p(t).apply(this,arguments))}return v(t,e),d(t,[{key:"init",value:function(){var e=this,t=this.editor,n=t.model.document,r=t.editing.view,i=r.document;function o(e,r){var o=r.dataTransfer;r.preventDefault();var a=t.data.toView(t.model.getSelectedContent(n.selection));i.fire("clipboardOutput",{dataTransfer:o,content:a,method:e.name})}this._htmlDataProcessor=new ds,r.addObserver(Cl),this.listenTo(i,"clipboardInput",(function(e){t.isReadOnly&&e.stop()}),{priority:"highest"}),this.listenTo(i,"clipboardInput",(function(t,n){var i=n.dataTransfer,o="";i.getData("text/html")?o=function(e){return e.replace(/(\s+)<\/span>/g,(function(e,t){return 1==t.length?" ":t}))}(i.getData("text/html")):i.getData("text/plain")&&(o=function(e){return(e=e.replace(//g,">").replace(/\n/g,"
").replace(/^\s/," ").replace(/\s$/," ").replace(/\s\s/g," ")).indexOf("
")>-1&&(e="
".concat(e,"
")),e}(i.getData("text/plain"))),o=e._htmlDataProcessor.toView(o),e.fire("inputTransformation",{content:o,dataTransfer:i}),r.scrollToTheSelection()}),{priority:"low"}),this.listenTo(this,"inputTransformation",(function(t,n){if(!n.content.isEmpty){var r=e.editor.data,i=e.editor.model,o=r.toModel(n.content,"$clipboardHolder");if(0==o.childCount)return;i.insertContent(o)}}),{priority:"low"}),this.listenTo(i,"copy",o,{priority:"low"}),this.listenTo(i,"cut",(function(e,n){t.isReadOnly?n.preventDefault():o(e,n)}),{priority:"low"}),this.listenTo(i,"clipboardOutput",(function(r,i){i.content.isEmpty||(i.dataTransfer.setData("text/html",e._htmlDataProcessor.toData(i.content)),i.dataTransfer.setData("text/plain",function e(t){var n="";if(t.is("text")||t.is("textProxy"))n=t.data;else if(t.is("img")&&t.hasAttribute("alt"))n=t.getAttribute("alt");else{var r=null,i=!0,o=!1,a=void 0;try{for(var s,l=t.getChildren()[Symbol.iterator]();!(i=(s=l.next()).done);i=!0){var u=s.value,c=e(u);r&&(r.is("containerElement")||u.is("containerElement"))&&(Sl.includes(r.name)||Sl.includes(u.name)?n+="\n":n+="\n\n"),n+=c,r=u}}catch(f){o=!0,a=f}finally{try{i||null==l.return||l.return()}finally{if(o)throw a}}}return n}(i.content))),"cut"==i.method&&t.model.deleteContent(n.selection)}),{priority:"low"})}}],[{key:"pluginName",get:function(){return"Clipboard"}}]),t}(xl),Al=function(){function e(t){var n=this;f(this,e),this.editor=t,this.set("value",void 0),this.set("isEnabled",!1),this._disableStack=new Set,this.decorate("execute"),this.listenTo(this.editor.model.document,"change",(function(){n.refresh()})),this.on("execute",(function(e){n.isEnabled||e.stop()}),{priority:"high"}),this.listenTo(t,"change:isReadOnly",(function(e,t,r){r?n.forceDisabled("readOnlyMode"):n.clearForceDisabled("readOnlyMode")}))}return d(e,[{key:"refresh",value:function(){this.isEnabled=!0}},{key:"forceDisabled",value:function(e){this._disableStack.add(e),1==this._disableStack.size&&(this.on("set:isEnabled",Pl,{priority:"highest"}),this.isEnabled=!1)}},{key:"clearForceDisabled",value:function(e){this._disableStack.delete(e),0==this._disableStack.size&&(this.off("set:isEnabled",Pl),this.refresh())}},{key:"execute",value:function(){}},{key:"destroy",value:function(){this.stopListening()}}]),e}();function Pl(e){e.return=!1,e.stop()}function Ml(e,t){var n,r,i,o,a,l;return s.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:n=!0,r=!1,i=void 0,s.prev=3,o=t[Symbol.iterator]();case 5:if(n=(a=o.next()).done){s.next=14;break}if(l=a.value,s.t0=l&&e.getAttributeProperties(l[0]).copyOnEnter,!s.t0){s.next=11;break}return s.next=11,l;case 11:n=!0,s.next=5;break;case 14:s.next=20;break;case 16:s.prev=16,s.t1=s.catch(3),r=!0,i=s.t1;case 20:s.prev=20,s.prev=21,n||null==o.return||o.return();case 23:if(s.prev=23,!r){s.next=26;break}throw i;case 26:return s.finish(23);case 27:return s.finish(20);case 28:case"end":return s.stop()}}),g,null,[[3,16,20,28],[21,,23,27]])}Yt(Al,wn);var Ol=function(e){function t(){return f(this,t),h(this,p(t).apply(this,arguments))}return v(t,e),d(t,[{key:"execute",value:function(){var e=this,t=this.editor.model,n=t.document;t.change((function(r){!function(e,t,n,r){var i=n.isCollapsed,o=n.getFirstRange(),a=o.start.parent,s=o.end.parent;if(r.isLimit(a)||r.isLimit(s))i||a!=s||e.deleteContent(n);else if(i){var l=Ml(t.model.schema,n.getAttributes());Nl(t,o.start),t.setSelectionAttribute(l)}else{var u=!(o.start.isAtStart&&o.end.isAtEnd),c=a==s;e.deleteContent(n,{leaveUnmerged:u}),u&&(c?Nl(t,n.focus):t.setSelection(s,0))}}(e.editor.model,r,n.selection,t.schema),e.fire("afterExecute",{writer:r})}))}}]),t}(Al);function Nl(e,t){e.split(t),e.setSelection(t.parent.nextSibling,0)}var Il=function(e){function t(e){var n;f(this,t);var r=(n=h(this,p(t).call(this,e))).document;return r.on("keydown",(function(e,t){var i;n.isEnabled&&t.keyCode==Kn.enter&&(r.once("enter",(function(e){return i=e}),{priority:"highest"}),r.fire("enter",new fi(r,t.domEvent,{isSoft:t.shiftKey})),i&&i.stop.called&&e.stop())})),n}return v(t,e),d(t,[{key:"observe",value:function(){}}]),t}(Yr),Dl=function(e){function t(){return f(this,t),h(this,p(t).apply(this,arguments))}return v(t,e),d(t,[{key:"init",value:function(){var e=this.editor,t=e.editing.view,n=t.document;t.addObserver(Il),e.commands.add("enter",new Ol(e)),this.listenTo(n,"enter",(function(n,r){r.preventDefault(),r.isSoft||(e.execute("enter"),t.scrollToTheSelection())}),{priority:"low"})}}],[{key:"pluginName",get:function(){return"Enter"}}]),t}(xl),Rl=function(e){function t(){return f(this,t),h(this,p(t).apply(this,arguments))}return v(t,e),d(t,[{key:"execute",value:function(){var e=this,t=this.editor.model,n=t.document;t.change((function(r){!function(e,t,n){var r=n.isCollapsed,i=n.getFirstRange(),o=i.start.parent,a=i.end.parent,s=o==a;if(r){var l=Ml(e.schema,n.getAttributes());jl(t,i.end),t.removeSelectionAttribute(n.getAttributeKeys()),t.setSelectionAttribute(l)}else{var u=!(i.start.isAtStart&&i.end.isAtEnd);e.deleteContent(n,{leaveUnmerged:u}),s?jl(t,n.focus):u&&t.setSelection(a,0)}}(t,r,n.selection),e.fire("afterExecute",{writer:r})}))}},{key:"refresh",value:function(){var e=this.editor.model,t=e.document;this.isEnabled=function(e,t){if(t.rangeCount>1)return!1;var n=t.anchor;if(!n||!e.checkChild(n,"softBreak"))return!1;var r=t.getFirstRange(),i=r.start.parent,o=r.end.parent;return!Ll(i,e)&&!Ll(o,e)||i===o}(e.schema,t.selection)}}]),t}(Al);function jl(e,t){var n=e.createElement("softBreak");e.insert(n,t),e.setSelection(n,"after")}function Ll(e,t){return!e.is("rootElement")&&(t.isLimit(e)||Ll(e.parent,t))}for(var Fl=function(e){function t(){return f(this,t),h(this,p(t).apply(this,arguments))}return v(t,e),d(t,[{key:"init",value:function(){var e=this.editor,t=e.model.schema,n=e.conversion,r=e.editing.view,i=r.document;t.register("softBreak",{allowWhere:"$text",isInline:!0}),n.for("upcast").elementToElement({model:"softBreak",view:"br"}),n.for("downcast").elementToElement({model:"softBreak",view:function(e,t){return t.createEmptyElement("br")}}),r.addObserver(Il),e.commands.add("shiftEnter",new Rl(e)),this.listenTo(i,"enter",(function(t,n){n.preventDefault(),n.isSoft&&(e.execute("shiftEnter"),r.scrollToTheSelection())}),{priority:"low"})}}],[{key:"pluginName",get:function(){return"ShiftEnter"}}]),t}(xl),zl=function(){function e(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20;f(this,e),this.model=t,this.size=0,this.limit=r,this.isLocked=!1,this._changeCallback=function(e,t){"transparent"!=t.type&&t!==n._batch&&n._reset(!0)},this._selectionChangeCallback=function(){n._reset()},this.model.document.on("change",this._changeCallback),this.model.document.selection.on("change:range",this._selectionChangeCallback),this.model.document.selection.on("change:attribute",this._selectionChangeCallback)}return d(e,[{key:"input",value:function(e){this.size+=e,this.size>=this.limit&&this._reset(!0)}},{key:"lock",value:function(){this.isLocked=!0}},{key:"unlock",value:function(){this.isLocked=!1}},{key:"destroy",value:function(){this.model.document.off("change",this._changeCallback),this.model.document.selection.off("change:range",this._selectionChangeCallback),this.model.document.selection.off("change:attribute",this._selectionChangeCallback)}},{key:"_reset",value:function(e){this.isLocked&&!e||(this._batch=null,this.size=0)}},{key:"batch",get:function(){return this._batch||(this._batch=this.model.createBatch()),this._batch}}]),e}(),Vl=function(e){function t(e,n){var r;return f(this,t),(r=h(this,p(t).call(this,e)))._buffer=new zl(e.model,n),r._batches=new WeakSet,r}return v(t,e),d(t,[{key:"destroy",value:function(){l(p(t.prototype),"destroy",this).call(this),this._buffer.destroy()}},{key:"execute",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.editor.model,r=n.document,i=t.text||"",o=i.length,a=t.range||r.selection.getFirstRange(),s=t.resultRange;n.enqueueChange(this._buffer.batch,(function(t){var l=a.isCollapsed;e._buffer.lock(),n.deleteContent(n.createSelection(a)),i&&n.insertContent(t.createText(i,r.selection.getAttributes()),a.start),s?t.setSelection(s):l&&t.setSelection(a.start.getShiftedBy(o)),e._buffer.unlock(),e._buffer.input(o),e._batches.add(e._buffer.batch)}))}},{key:"buffer",get:function(){return this._buffer}}]),t}(Al),Bl=[Jn("arrowUp"),Jn("arrowRight"),Jn("arrowDown"),Jn("arrowLeft"),9,16,17,18,19,20,27,33,34,35,36,45,91,93,144,145,173,174,175,176,177,178,179,255],Ul=112;Ul<=135;Ul++)Bl.push(Ul);function Hl(e){if(e.newChildren.length-e.oldChildren.length==1){var t=function(e,t){var n,r=[],i=0;return e.forEach((function(e){"equal"==e?(o(),i++):"insert"==e?(a("insert")?n.values.push(t[i]):(o(),n={type:"insert",index:i,values:[t[i]]}),i++):a("delete")?n.howMany++:(o(),n={type:"delete",index:i,howMany:1})})),o(),r;function o(){n&&(r.push(n),n=null)}function a(e){return n&&n.type==e}}(Sr(e.oldChildren,e.newChildren,ql),e.newChildren);if(!(t.length>1)){var n=t[0];return n.values[0]&&n.values[0].is("text")?n:void 0}}}function ql(e,t){return e&&e.is("text")&&t&&t.is("text")?e.data===t.data:e===t}var Wl=function(){function e(t){f(this,e),this.editor=t,this.editing=this.editor.editing}return d(e,[{key:"handle",value:function(e,t){if(function(e){if(0==e.length)return!1;var t=!0,n=!1,r=void 0;try{for(var i,o=e[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value;if("children"===a.type&&!Hl(a))return!0}}catch(s){n=!0,r=s}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}return!1}(e))this._handleContainerChildrenMutations(e,t);else{var n=!0,r=!1,i=void 0;try{for(var o,a=e[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;this._handleTextMutation(s,t),this._handleTextNodeInsertion(s)}}catch(l){r=!0,i=l}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}}}},{key:"_handleContainerChildrenMutations",value:function(e,t){var n=function(e){var t=e.map((function(e){return e.node})).reduce((function(e,t){return e.getCommonAncestor(t,{includeSelf:!0})}));if(t)return t.getAncestors({includeSelf:!0,parentFirst:!0}).find((function(e){return e.is("containerElement")||e.is("rootElement")}))}(e);if(n){var r=this.editor.editing.view.domConverter.mapViewToDom(n),i=new Fr,o=this.editor.data.toModel(i.domToView(r)).getChild(0),a=this.editor.editing.mapper.toModelElement(n);if(a){var s=Array.from(o.getChildren()),l=Array.from(a.getChildren()),u=s[s.length-1],c=l[l.length-1];u&&u.is("softBreak")&&c&&!c.is("softBreak")&&s.pop();var f=this.editor.model.schema;if(Yl(s,f)&&Yl(l,f)){var d=s.map((function(e){return e.is("text")?e.data:"@"})).join("").replace(/\u00A0/g," "),h=l.map((function(e){return e.is("text")?e.data:"@"})).join("").replace(/\u00A0/g," ");if(h!==d){var p=$l(Sr(h,d)),v=p.firstChangeAt,m=p.insertions,g=p.deletions,y=null;t&&(y=this.editing.mapper.toModelRange(t.getFirstRange()));var b=d.substr(v,m),k=this.editor.model.createRange(this.editor.model.createPositionAt(a,v),this.editor.model.createPositionAt(a,v+g));this.editor.execute("input",{text:b,range:k,resultRange:y})}}}}}},{key:"_handleTextMutation",value:function(e,t){if("text"==e.type){var n=e.newText.replace(/\u00A0/g," "),r=e.oldText.replace(/\u00A0/g," ");if(r!==n){var i=$l(Sr(r,n)),o=i.firstChangeAt,a=i.insertions,s=i.deletions,l=null;t&&(l=this.editing.mapper.toModelRange(t.getFirstRange()));var u=this.editing.view.createPositionAt(e.node,o),c=this.editing.mapper.toModelPosition(u),f=this.editor.model.createRange(c,c.getShiftedBy(s)),d=n.substr(o,a);this.editor.execute("input",{text:d,range:f,resultRange:l})}}}},{key:"_handleTextNodeInsertion",value:function(e){if("children"==e.type){var t=Hl(e),n=this.editing.view.createPositionAt(e.node,t.index),r=this.editing.mapper.toModelPosition(n),i=t.values[0].data;this.editor.execute("input",{text:i.replace(/\u00A0/g," "),range:this.editor.model.createRange(r)})}}}]),e}();function Yl(e,t){return e.every((function(e){return t.isInline(e)}))}function $l(e){for(var t=null,n=null,r=0;r0&&void 0!==arguments[0]?arguments[0]:{},n=this.editor.model,r=n.document;n.enqueueChange(this._buffer.batch,(function(i){e._buffer.lock();var o=i.createSelection(t.selection||r.selection),a=o.isCollapsed;if(o.isCollapsed&&n.modifySelection(o,{direction:e.direction,unit:t.unit}),e._shouldEntireContentBeReplacedWithParagraph(t.sequence||1))e._replaceEntireContentWithParagraph(i);else if(!o.isCollapsed){var s=0;o.getFirstRange().getMinimalFlatRanges().forEach((function(e){s+=Rn(e.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))})),n.deleteContent(o,{doNotResetEntireContent:a}),e._buffer.input(s),i.setSelection(o),e._buffer.unlock()}}))}},{key:"_shouldEntireContentBeReplacedWithParagraph",value:function(e){if(e>1)return!1;var t=this.editor.model,n=t.document.selection,r=t.schema.getLimitElement(n);if(!n.isCollapsed||!n.containsEntireContent(r))return!1;if(!t.schema.checkChild(r,"paragraph"))return!1;var i=r.getChild(0);return!i||"paragraph"!==i.name}},{key:"_replaceEntireContentWithParagraph",value:function(e){var t=this.editor.model,n=t.document.selection,r=t.schema.getLimitElement(n),i=e.createElement("paragraph");e.remove(e.createRangeIn(r)),e.insert(i,r),e.setSelection(i,0)}},{key:"buffer",get:function(){return this._buffer}}]),t}(Al),Kl=function(e){function t(e){var n;f(this,t),n=h(this,p(t).call(this,e));var r=e.document,i=0;function o(e,t,n){var i;r.once("delete",(function(e){return i=e}),{priority:Number.POSITIVE_INFINITY}),r.fire("delete",new fi(r,t,n)),i&&i.stop.called&&e.stop()}return r.on("keyup",(function(e,t){t.keyCode!=Kn.delete&&t.keyCode!=Kn.backspace||(i=0)})),r.on("keydown",(function(e,t){var n={};if(t.keyCode==Kn.delete)n.direction="forward",n.unit="character";else{if(t.keyCode!=Kn.backspace)return;n.direction="backward",n.unit="codePoint"}var r=$n.isMac?t.altKey:t.ctrlKey;n.unit=r?"word":n.unit,n.sequence=++i,o(e,t.domEvent,n)})),$n.isAndroid&&r.on("beforeinput",(function(t,n){if("deleteContentBackward"==n.domEvent.inputType){var r={unit:"codepoint",direction:"backward",sequence:1},i=n.domTarget.ownerDocument.defaultView.getSelection();i.anchorNode==i.focusNode&&i.anchorOffset+1!=i.focusOffset&&(r.selectionToRemove=e.domConverter.domSelectionToView(i)),o(t,n.domEvent,r)}})),n}return v(t,e),d(t,[{key:"observe",value:function(){}}]),t}(Yr),Jl=function(e){function t(){return f(this,t),h(this,p(t).apply(this,arguments))}return v(t,e),d(t,[{key:"init",value:function(){var e=this.editor,t=e.editing.view,n=t.document;if(t.addObserver(Kl),e.commands.add("forwardDelete",new Ql(e,"forward")),e.commands.add("delete",new Ql(e,"backward")),this.listenTo(n,"delete",(function(n,r){var i={unit:r.unit,sequence:r.sequence};if(r.selectionToRemove){var o=e.model.createSelection(),a=[],s=!0,l=!1,u=void 0;try{for(var c,f=r.selectionToRemove.getRanges()[Symbol.iterator]();!(s=(c=f.next()).done);s=!0){var d=c.value;a.push(e.editing.mapper.toModelRange(d))}}catch(h){l=!0,u=h}finally{try{s||null==f.return||f.return()}finally{if(l)throw u}}o.setTo(a),i.selection=o}e.execute("forward"==r.direction?"forwardDelete":"delete",i),r.preventDefault(),t.scrollToTheSelection()})),$n.isAndroid){var r=null;this.listenTo(n,"delete",(function(e,t){var n=t.domTarget.ownerDocument.defaultView.getSelection();r={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}}),{priority:"lowest"}),this.listenTo(n,"keyup",(function(e,t){if(r){var n=t.domTarget.ownerDocument.defaultView.getSelection();n.collapse(r.anchorNode,r.anchorOffset),n.extend(r.focusNode,r.focusOffset),r=null}}))}}}],[{key:"pluginName",get:function(){return"Delete"}}]),t}(xl),Xl=function(e){function t(){return f(this,t),h(this,p(t).apply(this,arguments))}return v(t,e),d(t,null,[{key:"requires",get:function(){return[Gl,Jl]}},{key:"pluginName",get:function(){return"Typing"}}]),t}(xl),Zl=function(e){function t(){return f(this,t),h(this,p(t).apply(this,arguments))}return v(t,e),d(t,[{key:"clone",value:function(){return new t(this.baseVersion)}},{key:"getReversed",value:function(){return new t(this.baseVersion+1)}},{key:"_execute",value:function(){}},{key:"type",get:function(){return"noop"}}],[{key:"className",get:function(){return"NoOperation"}}]),t}(sa),eu=new Map;function tu(e,t,n){var r=eu.get(e);r||(r=new Map,eu.set(e,r)),r.set(t,n)}function nu(e){return[e]}function ru(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=function(e,t){var n=eu.get(e);return n&&n.has(t)?n.get(t):nu}(e.constructor,t.constructor);try{return r(e=e.clone(),t,n)}catch(e){throw e}}function iu(e,t,n){e=e.slice(),t=t.slice();var r=new ou(n.document,n.useRelations,n.forceWeakRemove);r.setOriginalOperations(e),r.setOriginalOperations(t);var i=r.originalOperations;if(0==e.length||0==t.length)return{operationsA:e,operationsB:t,originalOperations:i};var o=new WeakMap,a=!0,s=!1,l=void 0;try{for(var c,f=e[Symbol.iterator]();!(a=(c=f.next()).done);a=!0){var d=c.value;o.set(d,0)}}catch(M){s=!0,l=M}finally{try{a||null==f.return||f.return()}finally{if(s)throw l}}for(var h={nextBaseVersionA:e[e.length-1].baseVersion+1,nextBaseVersionB:t[t.length-1].baseVersion+1,originalOperationsACount:e.length,originalOperationsBCount:t.length},p=0;p2&&void 0!==arguments[2]&&arguments[2];f(this,e),this.originalOperations=new Map,this._history=t.history,this._useRelations=n,this._forceWeakRemove=!!r,this._relations=new Map}return d(e,[{key:"setOriginalOperations",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=t?this.originalOperations.get(t):null,r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var l=a.value;this.originalOperations.set(l,n||l)}}catch(u){i=!0,o=u}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}}},{key:"updateRelation",value:function(e,t){switch(e.constructor){case ba:switch(t.constructor){case Ta:e.targetPosition.isEqual(t.sourcePosition)||t.movedRange.containsPosition(e.targetPosition)?this._setRelation(e,t,"insertAtSource"):e.targetPosition.isEqual(t.deletionPosition)?this._setRelation(e,t,"insertBetween"):e.targetPosition.isAfter(t.sourcePosition)&&this._setRelation(e,t,"moveTargetAfter");break;case ba:e.targetPosition.isEqual(t.sourcePosition)||e.targetPosition.isBefore(t.sourcePosition)?this._setRelation(e,t,"insertBefore"):this._setRelation(e,t,"insertAfter")}break;case Ca:switch(t.constructor){case Ta:e.splitPosition.isBefore(t.sourcePosition)&&this._setRelation(e,t,"splitBefore");break;case ba:(e.splitPosition.isEqual(t.sourcePosition)||e.splitPosition.isBefore(t.sourcePosition))&&this._setRelation(e,t,"splitBefore")}break;case Ta:switch(t.constructor){case Ta:e.targetPosition.isEqual(t.sourcePosition)||this._setRelation(e,t,"mergeTargetNotMoved"),e.sourcePosition.isEqual(t.targetPosition)&&this._setRelation(e,t,"mergeSourceNotMoved"),e.sourcePosition.isEqual(t.sourcePosition)&&this._setRelation(e,t,"mergeSameElement");break;case Ca:e.sourcePosition.isEqual(t.splitPosition)&&this._setRelation(e,t,"splitAtSource")}break;case wa:var n=e.newRange;if(!n)return;switch(t.constructor){case ba:var r=no._createFromPositionAndShift(t.sourcePosition,t.howMany),i=r.containsPosition(n.start)||r.start.isEqual(n.start),o=r.containsPosition(n.end)||r.end.isEqual(n.end);!i&&!o||r.containsRange(n)||this._setRelation(e,t,{side:i?"left":"right",path:i?n.start.path.slice():n.end.path.slice()});break;case Ta:var a=n.start.isEqual(t.targetPosition),s=n.start.isEqual(t.deletionPosition),l=n.end.isEqual(t.deletionPosition),u=n.end.isEqual(t.sourcePosition);(a||s||l||u)&&this._setRelation(e,t,{wasInLeftElement:a,wasStartBeforeMergedElement:s,wasEndBeforeMergedElement:l,wasInRightElement:u})}}}},{key:"getContext",value:function(e,t,n){return{aIsStrong:n,aWasUndone:this._wasUndone(e),bWasUndone:this._wasUndone(t),abRelation:this._useRelations?this._getRelation(e,t):null,baRelation:this._useRelations?this._getRelation(t,e):null,forceWeakRemove:this._forceWeakRemove}}},{key:"_wasUndone",value:function(e){var t=this.originalOperations.get(e);return t.wasUndone||this._history.isUndoneOperation(t)}},{key:"_getRelation",value:function(e,t){var n=this.originalOperations.get(t),r=this._history.getUndoneOperation(n);if(!r)return null;var i=this.originalOperations.get(e),o=this._relations.get(i);return o&&o.get(r)||null}},{key:"_setRelation",value:function(e,t,n){var r=this.originalOperations.get(e),i=this.originalOperations.get(t),o=this._relations.get(r);o||(o=new Map,this._relations.set(r,o)),o.set(i,n)}}]),e}();function au(e,t){var n=!0,r=!1,i=void 0;try{for(var o,a=e[Symbol.iterator]();!(n=(o=a.next()).done);n=!0)o.value.baseVersion=t++}catch(s){r=!0,i=s}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}}function su(e,t){for(var n=0;n0)return e.sourcePosition=t.moveTargetPosition.clone(),e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t),[e]}return e.sourcePosition.hasSameParentAs(t.splitPosition)&&(e.howMany=t.splitPosition.offset),e.sourcePosition=e.sourcePosition._getTransformedBySplitOperation(t),e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t),[e]})),tu(ba,ka,(function(e,t){var n=no._createFromPositionAndShift(e.sourcePosition,e.howMany)._getTransformedByInsertOperation(t,!1)[0];return e.sourcePosition=n.start,e.howMany=n.end.offset-n.start.offset,e.targetPosition.isEqual(t.position)||(e.targetPosition=e.targetPosition._getTransformedByInsertOperation(t)),[e]})),tu(ba,ba,(function(e,t,n){var r,i=no._createFromPositionAndShift(e.sourcePosition,e.howMany),o=no._createFromPositionAndShift(t.sourcePosition,t.howMany),a=n.aIsStrong,s=!n.aIsStrong;if("insertBefore"==n.abRelation||"insertAfter"==n.baRelation?s=!0:"insertAfter"!=n.abRelation&&"insertBefore"!=n.baRelation||(s=!1),r=e.targetPosition.isEqual(t.targetPosition)&&s?e.targetPosition._getTransformedByDeletion(t.sourcePosition,t.howMany):e.targetPosition._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),uu(e,t)&&uu(t,e))return[t.getReversed()];if(i.containsPosition(t.targetPosition)&&i.containsRange(o,!0))return i.start=i.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),i.end=i.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),cu([i],r);if(o.containsPosition(e.targetPosition)&&o.containsRange(i,!0))return i.start=i.start._getCombined(t.sourcePosition,t.getMovedRangeStart()),i.end=i.end._getCombined(t.sourcePosition,t.getMovedRangeStart()),cu([i],r);var l=$t(e.sourcePosition.getParentPath(),t.sourcePosition.getParentPath());if("prefix"==l||"extension"==l)return i.start=i.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),i.end=i.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),cu([i],r);"remove"!=e.type||"remove"==t.type||n.aWasUndone||n.forceWeakRemove?"remove"==e.type||"remove"!=t.type||n.bWasUndone||n.forceWeakRemove||(a=!1):a=!0;var c=[],f=i.getDifference(o),d=!0,h=!1,p=void 0;try{for(var v,m=f[Symbol.iterator]();!(d=(v=m.next()).done);d=!0){var g=v.value;g.start=g.start._getTransformedByDeletion(t.sourcePosition,t.howMany),g.end=g.end._getTransformedByDeletion(t.sourcePosition,t.howMany);var y="same"==$t(g.start.getParentPath(),t.getMovedRangeStart().getParentPath()),b=g._getTransformedByInsertion(t.getMovedRangeStart(),t.howMany,y);c.push.apply(c,u(b))}}catch(w){h=!0,p=w}finally{try{d||null==m.return||m.return()}finally{if(h)throw p}}var k=i.getIntersection(o);return null!==k&&a&&(k.start=k.start._getCombined(t.sourcePosition,t.getMovedRangeStart()),k.end=k.end._getCombined(t.sourcePosition,t.getMovedRangeStart()),0===c.length?c.push(k):1==c.length?o.start.isBefore(i.start)||o.start.isEqual(i.start)?c.unshift(k):c.push(k):c.splice(1,0,k)),0===c.length?[new Zl(e.baseVersion)]:cu(c,r)})),tu(ba,Ca,(function(e,t,n){var r=e.targetPosition.clone();e.targetPosition.isEqual(t.insertionPosition)&&t.graveyardPosition&&"moveTargetAfter"!=n.abRelation||(r=e.targetPosition._getTransformedBySplitOperation(t));var i=no._createFromPositionAndShift(e.sourcePosition,e.howMany);if(i.end.isEqual(t.insertionPosition))return t.graveyardPosition||e.howMany++,e.targetPosition=r,[e];if(i.start.hasSameParentAs(t.splitPosition)&&i.containsPosition(t.splitPosition)){var o=new no(t.splitPosition,i.end);return o=o._getTransformedBySplitOperation(t),cu([new no(i.start,t.splitPosition),o],r)}e.targetPosition.isEqual(t.splitPosition)&&"insertAtSource"==n.abRelation&&(r=t.moveTargetPosition),e.targetPosition.isEqual(t.insertionPosition)&&"insertBetween"==n.abRelation&&(r=e.targetPosition);var a=[i._getTransformedBySplitOperation(t)];if(t.graveyardPosition){var s=i.start.isEqual(t.graveyardPosition)||i.containsPosition(t.graveyardPosition);e.howMany>1&&s&&!n.aWasUndone&&a.push(no._createFromPositionAndShift(t.insertionPosition,1))}return cu(a,r)})),tu(ba,Ta,(function(e,t,n){var r=no._createFromPositionAndShift(e.sourcePosition,e.howMany);if(t.deletionPosition.hasSameParentAs(e.sourcePosition)&&r.containsPosition(t.sourcePosition))if("remove"!=e.type||n.forceWeakRemove){if(1==e.howMany)return n.bWasUndone?(e.sourcePosition=t.graveyardPosition.clone(),e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t),[e]):[new Zl(0)]}else if(!n.aWasUndone){var i=[],o=t.graveyardPosition.clone(),a=t.targetPosition._getTransformedByMergeOperation(t);e.howMany>1&&(i.push(new ba(e.sourcePosition,e.howMany-1,e.targetPosition,0)),o=o._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany-1),a=a._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany-1));var s=t.deletionPosition._getCombined(e.sourcePosition,e.targetPosition),l=new ba(o,1,s,0),u=l.getMovedRangeStart().path.slice();u.push(0);var c=new to(l.targetPosition.root,u);a=a._getTransformedByMove(o,s,1);var f=new ba(a,t.howMany,c,0);return i.push(l),i.push(f),i}var d=no._createFromPositionAndShift(e.sourcePosition,e.howMany)._getTransformedByMergeOperation(t);return e.sourcePosition=d.start,e.howMany=d.end.offset-d.start.offset,e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t),[e]})),tu(_a,ka,(function(e,t){return e.position=e.position._getTransformedByInsertOperation(t),[e]})),tu(_a,Ta,(function(e,t){return e.position.isEqual(t.deletionPosition)?(e.position=t.graveyardPosition.clone(),e.position.stickiness="toNext",[e]):(e.position=e.position._getTransformedByMergeOperation(t),[e])})),tu(_a,ba,(function(e,t){return e.position=e.position._getTransformedByMoveOperation(t),[e]})),tu(_a,_a,(function(e,t,n){if(e.position.isEqual(t.position)){if(!n.aIsStrong)return[new Zl(0)];e.oldName=t.newName}return[e]})),tu(_a,Ca,(function(e,t){if("same"==$t(e.position.path,t.splitPosition.getParentPath())&&!t.graveyardPosition){var n=new _a(e.position.getShiftedBy(1),e.oldName,e.newName,0);return[e,n]}return e.position=e.position._getTransformedBySplitOperation(t),[e]})),tu(xa,xa,(function(e,t,n){if(e.root===t.root&&e.key===t.key){if(!n.aIsStrong||e.newValue===t.newValue)return[new Zl(0)];e.oldValue=t.newValue}return[e]})),tu(Ca,ka,(function(e,t){return e.splitPosition.hasSameParentAs(t.position)&&e.splitPosition.offset0}},{key:"addBatch",value:function(e){var t=this.editor.model.document.selection,n={ranges:t.hasOwnRange?Array.from(t.getRanges()):[],isBackward:t.isBackward};this._stack.push({batch:e,selection:n}),this.refresh()}},{key:"clearStack",value:function(){this._stack=[],this.refresh()}},{key:"_restoreSelection",value:function(e,t,n){var r=this.editor.model,i=r.document,o=[],a=!0,s=!1,l=void 0;try{for(var u,c=e[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var f=du(u.value,n).find((function(e){return e.start.root!=i.graveyard}));f&&o.push(f)}}catch(d){s=!0,l=d}finally{try{a||null==c.return||c.return()}finally{if(s)throw l}}o.length&&r.change((function(e){e.setSelection(o,{backward:t})}))}},{key:"_undo",value:function(e,t){var n=this.editor.model,r=n.document;this._createdBatches.add(t);var i=e.operations.slice().filter((function(e){return e.isDocumentOperation}));i.reverse();var o=!0,a=!1,s=void 0;try{for(var l,u=i[Symbol.iterator]();!(o=(l=u.next()).done);o=!0){var c=l.value,f=c.baseVersion+1,d=Array.from(r.history.getOperations(f)),h=iu([c.getReversed()],d,{useRelations:!0,document:this.editor.model.document,padWithNoOps:!1,forceWeakRemove:!0}).operationsA,p=!0,v=!1,m=void 0;try{for(var g,y=h[Symbol.iterator]();!(p=(g=y.next()).done);p=!0){var b=g.value;t.addOperation(b),n.applyOperation(b),r.history.setOperationAsUndone(c,b)}}catch(k){v=!0,m=k}finally{try{p||null==y.return||y.return()}finally{if(v)throw m}}}}catch(k){a=!0,s=k}finally{try{o||null==u.return||u.return()}finally{if(a)throw s}}}}]),t}(Al);function du(e,t){var n=e.getTransformedByOperations(t);n.sort((function(e,t){return e.start.isBefore(t.start)?-1:1}));for(var r=1;r0&&void 0!==arguments[0]?arguments[0]:null,n=t?this._stack.findIndex((function(e){return e.batch==t})):this._stack.length-1,r=this._stack.splice(n,1)[0],i=this.editor.model.createBatch("transparent");this.editor.model.enqueueChange(i,(function(){e._undo(r.batch,i);var t=e.editor.model.document.history.getOperations(r.batch.baseVersion);e._restoreSelection(r.selection.ranges,r.selection.isBackward,t),e.fire("revert",r.batch,i)})),this.refresh()}}]),t}(fu),pu=function(e){function t(){return f(this,t),h(this,p(t).apply(this,arguments))}return v(t,e),d(t,[{key:"execute",value:function(){var e=this,t=this._stack.pop(),n=this.editor.model.createBatch("transparent");this.editor.model.enqueueChange(n,(function(){var r=t.batch.operations[t.batch.operations.length-1].baseVersion+1,i=e.editor.model.document.history.getOperations(r);e._restoreSelection(t.selection.ranges,t.selection.isBackward,i),e._undo(t.batch,n)})),this.refresh()}}]),t}(fu),vu=function(e){function t(e){var n;return f(this,t),(n=h(this,p(t).call(this,e)))._batchRegistry=new WeakSet,n}return v(t,e),d(t,null,[{key:"pluginName",get:function(){return"UndoEditing"}}]),d(t,[{key:"init",value:function(){var e=this,t=this.editor;this._undoCommand=new hu(t),this._redoCommand=new pu(t),t.commands.add("undo",this._undoCommand),t.commands.add("redo",this._redoCommand),this.listenTo(t.model,"applyOperation",(function(t,n){var r=n[0];if(r.isDocumentOperation){var i=r.batch,o=e._redoCommand._createdBatches.has(i),a=e._undoCommand._createdBatches.has(i);e._batchRegistry.has(i)||"transparent"==i.type&&!o&&!a||(o?e._undoCommand.addBatch(i):a||(e._undoCommand.addBatch(i),e._redoCommand.clearStack()),e._batchRegistry.add(i))}}),{priority:"highest"}),this.listenTo(this._undoCommand,"revert",(function(t,n,r){e._redoCommand.addBatch(r)})),t.keystrokes.set("CTRL+Z","undo"),t.keystrokes.set("CTRL+Y","redo"),t.keystrokes.set("CTRL+SHIFT+Z","redo")}}]),t}(xl),mu='',gu='',yu=function(e){function t(){return f(this,t),h(this,p(t).apply(this,arguments))}return v(t,e),d(t,[{key:"init",value:function(){var e=this.editor,t=e.locale,n=e.t,r="ltr"==t.uiLanguageDirection?mu:gu,i="ltr"==t.uiLanguageDirection?gu:mu;this._addButton("undo",n("bs"),"CTRL+Z",r),this._addButton("redo",n("bt"),"CTRL+Y",i)}},{key:"_addButton",value:function(e,t,n,r){var i=this,o=this.editor;o.ui.componentFactory.add(e,(function(a){var s=o.commands.get(e),l=new ll(a);return l.set({label:t,icon:r,keystroke:n,tooltip:!0}),l.bind("isEnabled").to(s,"isEnabled"),i.listenTo(l,"execute",(function(){return o.execute(e)})),l}))}}]),t}(xl),bu=function(e){function t(){return f(this,t),h(this,p(t).apply(this,arguments))}return v(t,e),d(t,null,[{key:"requires",get:function(){return[vu,yu]}},{key:"pluginName",get:function(){return"Undo"}}]),t}(xl),ku=function(e){function t(){return f(this,t),h(this,p(t).apply(this,arguments))}return v(t,e),d(t,[{key:"init",value:function(){this.set("hasAny",!1),this._actions=new Fn({idProperty:"_id"}),this._actions.delegate("add","remove").to(this)}},{key:"add",value:function(e){if("string"!=typeof e)throw new It.b("pendingactions-add-invalid-message: The message must be a string.",this);var t=Object.create(wn);return t.set("message",e),this._actions.add(t),this.hasAny=!0,t}},{key:"remove",value:function(e){this._actions.remove(e),this.hasAny=!!this._actions.length}},{key:Symbol.iterator,value:function(){return this._actions[Symbol.iterator]()}},{key:"first",get:function(){return this._actions.get(0)}}],[{key:"pluginName",get:function(){return"PendingActions"}}]),t}(xl),wu=function(){function e(){var t=this;f(this,e);var n=new window.FileReader;this._reader=n,this._data=void 0,this.set("loaded",0),n.onprogress=function(e){t.loaded=e.loaded}}return d(e,[{key:"read",value:function(e){var t=this,n=this._reader;return this.total=e.size,new Promise((function(r,i){n.onload=function(){var e=n.result;t._data=e,r(e)},n.onerror=function(){i("error")},n.onabort=function(){i("aborted")},t._reader.readAsDataURL(e)}))}},{key:"abort",value:function(){this._reader.abort()}},{key:"error",get:function(){return this._reader.error}},{key:"data",get:function(){return this._data}}]),e}();Yt(wu,wn);var _u=function(e){function t(){return f(this,t),h(this,p(t).apply(this,arguments))}return v(t,e),d(t,[{key:"init",value:function(){var e=this;this.loaders=new Fn,this.loaders.on("add",(function(){return e._updatePendingAction()})),this.loaders.on("remove",(function(){return e._updatePendingAction()})),this._loadersMap=new Map,this._pendingAction=null,this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(function(e,t){return t?e/t*100:0}))}},{key:"getLoader",value:function(e){return this._loadersMap.get(e)||null}},{key:"createLoader",value:function(e){var t=this;if(!this.createUploadAdapter)return console.warn(Object(It.a)("filerepository-no-upload-adapter: Upload adapter is not defined.")),null;var n=new xu(Promise.resolve(e),this.createUploadAdapter);return this.loaders.add(n),this._loadersMap.set(e,n),e instanceof Promise&&n.file.then((function(e){t._loadersMap.set(e,n)})).catch((function(){})),n.on("change:uploaded",(function(){var e=0,n=!0,r=!1,i=void 0;try{for(var o,a=t.loaders[Symbol.iterator]();!(n=(o=a.next()).done);n=!0)e+=o.value.uploaded}catch(s){r=!0,i=s}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}t.uploaded=e})),n.on("change:uploadTotal",(function(){var e=0,n=!0,r=!1,i=void 0;try{for(var o,a=t.loaders[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;s.uploadTotal&&(e+=s.uploadTotal)}}catch(l){r=!0,i=l}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}t.uploadTotal=e})),n}},{key:"destroyLoader",value:function(e){var t=this,n=e instanceof xu?e:this.getLoader(e);n._destroy(),this.loaders.remove(n),this._loadersMap.forEach((function(e,r){e===n&&t._loadersMap.delete(r)}))}},{key:"_updatePendingAction",value:function(){var e=this.editor.plugins.get(ku);if(this.loaders.length){if(!this._pendingAction){var t=this.editor.t,n=function(e){return"".concat(t("ay")," ").concat(parseInt(e),"%.")};this._pendingAction=e.add(n(this.uploadedPercent)),this._pendingAction.bind("message").to(this,"uploadedPercent",n)}}else e.remove(this._pendingAction),this._pendingAction=null}}],[{key:"pluginName",get:function(){return"FileRepository"}},{key:"requires",get:function(){return[ku]}}]),t}(xl);Yt(_u,wn);var xu=function(){function e(t,n){f(this,e),this.id=Rt(),this._filePromiseWrapper=this._createFilePromiseWrapper(t),this._adapter=n(this),this._reader=new wu,this.set("status","idle"),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(function(e,t){return t?e/t*100:0})),this.set("uploadResponse",null)}return d(e,[{key:"read",value:function(){var e=this;if("idle"!=this.status)throw new It.b("filerepository-read-wrong-status: You cannot call read if the status is different than idle.",this);return this.status="reading",this.file.then((function(t){return e._reader.read(t)})).then((function(t){if("reading"!==e.status)throw e.status;return e.status="idle",t})).catch((function(t){if("aborted"===t)throw e.status="aborted","aborted";throw e.status="error",e._reader.error?e._reader.error:t}))}},{key:"upload",value:function(){var e=this;if("idle"!=this.status)throw new It.b("filerepository-upload-wrong-status: You cannot call upload if the status is different than idle.",this);return this.status="uploading",this.file.then((function(){return e._adapter.upload()})).then((function(t){return e.uploadResponse=t,e.status="idle",t})).catch((function(t){if("aborted"===e.status)throw"aborted";throw e.status="error",t}))}},{key:"abort",value:function(){var e=this.status;this.status="aborted",this._filePromiseWrapper.isFulfilled?"reading"==e?this._reader.abort():"uploading"==e&&this._adapter.abort&&this._adapter.abort():(this._filePromiseWrapper.promise.catch((function(){})),this._filePromiseWrapper.rejecter("aborted")),this._destroy()}},{key:"_destroy",value:function(){this._filePromiseWrapper=void 0,this._reader=void 0,this._adapter=void 0,this.uploadResponse=void 0}},{key:"_createFilePromiseWrapper",value:function(e){var t={};return t.promise=new Promise((function(n,r){t.rejecter=r,t.isFulfilled=!1,e.then((function(e){t.isFulfilled=!0,n(e)})).catch((function(e){t.isFulfilled=!0,r(e)}))})),t}},{key:"file",get:function(){var e=this;return this._filePromiseWrapper?this._filePromiseWrapper.promise.then((function(t){return e._filePromiseWrapper?t:null})):Promise.resolve(null)}},{key:"data",get:function(){return this._reader.data}}]),e}();Yt(xu,wn);var Tu="ckCsrfToken",Cu=40,Su="abcdefghijklmnopqrstuvwxyz0123456789",Eu=function(e){function t(){return f(this,t),h(this,p(t).apply(this,arguments))}return v(t,e),d(t,[{key:"init",value:function(){var e=this,t=this.editor.config.get("ckfinder.uploadUrl");t&&(this.editor.plugins.get(_u).createUploadAdapter=function(n){return new Au(n,t,e.editor.t)})}}],[{key:"requires",get:function(){return[_u]}},{key:"pluginName",get:function(){return"CKFinderUploadAdapter"}}]),t}(xl),Au=function(){function e(t,n,r){f(this,e),this.loader=t,this.url=n,this.t=r}return d(e,[{key:"upload",value:function(){var e=this;return this.loader.file.then((function(t){return new Promise((function(n,r){e._initRequest(),e._initListeners(n,r,t),e._sendRequest(t)}))}))}},{key:"abort",value:function(){this.xhr&&this.xhr.abort()}},{key:"_initRequest",value:function(){var e=this.xhr=new XMLHttpRequest;e.open("POST",this.url,!0),e.responseType="json"}},{key:"_initListeners",value:function(e,t,n){var r=this.xhr,i=this.loader,o=(0,this.t)("a")+" ".concat(n.name,".");r.addEventListener("error",(function(){return t(o)})),r.addEventListener("abort",(function(){return t()})),r.addEventListener("load",(function(){var n=r.response;if(!n||!n.uploaded)return t(n&&n.error&&n.error.message?n.error.message:o);e({default:n.url})})),r.upload&&r.upload.addEventListener("progress",(function(e){e.lengthComputable&&(i.uploadTotal=e.total,i.uploaded=e.loaded)}))}},{key:"_sendRequest",value:function(e){var t=new FormData;t.append("upload",e),t.append("ckCsrfToken",function(){var e,t,n=function(e){e=e.toLowerCase();var t=document.cookie.split(";"),n=!0,r=!1,i=void 0;try{for(var o,a=t[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value.split("=");if(decodeURIComponent(s[0].trim().toLowerCase())===e)return decodeURIComponent(s[1])}}catch(l){r=!0,i=l}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}return null}(Tu);return n&&n.length==Cu||(n=function(e){var t="",n=new Uint8Array(e);window.crypto.getRandomValues(n);for(var r=0;r.5?i.toUpperCase():i}return t}(Cu),e=Tu,t=n,document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(t)+";path=/"),n}()),this.xhr.send(t)}}]),e}(),Pu=function(){function e(t,n,r){f(this,e);var i,o=null;"function"==typeof r?i=r:(o=t.commands.get(r),i=function(){t.execute(r)}),t.model.document.on("change",(function(e,r){if((!o||o.isEnabled)&&"transparent"!=r.type){var a=Array.from(t.model.document.differ.getChanges()),s=a[0];if(1==a.length&&"insert"===s.type&&"$text"==s.name&&1==s.length){var l=s.position.parent;if(l.is("paragraph")&&1===l.childCount){var u=n.exec(l.getChild(0).data);u&&t.model.enqueueChange((function(e){var t=e.createPositionAt(l,0),n=e.createPositionAt(l,u[0].length),r=new po(t,n);!1!==i({match:u})&&e.remove(r),r.detach()}))}}}}))}return d(e,null,[{key:"pluginName",get:function(){return"BlockAutoformatEditing"}}]),e}(),Mu=function(){function e(t,n,r){var i,o,a,s;f(this,e),n instanceof RegExp?i=n:a=n,"string"==typeof r?o=r:s=r,a=a||function(e){for(var t,n=[],r=[];null!==(t=i.exec(e))&&!(t&&t.length<4);){var o=t,a=o.index,s=o[1],l=o[2],u=o[3],c=s+l+u,f=[a+=t[0].length-c.length,a+s.length],d=[a+s.length+l.length,a+s.length+l.length+u.length];n.push(f),n.push(d),r.push([a+s.length,a+s.length+l.length])}return{remove:n,format:r}},s=s||function(e,n){var r=t.model.schema.getValidRanges(n,o),i=!0,a=!1,s=void 0;try{for(var l,u=r[Symbol.iterator]();!(i=(l=u.next()).done);i=!0){var c=l.value;e.setAttribute(o,!0,c)}}catch(f){a=!0,s=f}finally{try{i||null==u.return||u.return()}finally{if(a)throw s}}e.removeSelectionAttribute(o)},t.model.document.on("change",(function(e,n){if("transparent"!=n.type){var r=t.model,i=r.document.selection;if(i.isCollapsed){var o=Array.from(r.document.differ.getChanges()),l=o[0];if(1==o.length&&"insert"===l.type&&"$text"==l.name&&1==l.length){var u=i.focus,c=u.parent,f=function(e,t){var n=e.start;return{text:Array.from(e.getItems()).reduce((function(e,r){return r.is("text")||r.is("textProxy")?e+r.data:(n=t.createPositionAfter(r),"")}),""),range:t.createRange(n,e.end)}}(r.createRange(r.createPositionAt(c,0),u),r),d=f.text,h=f.range,p=a(d),v=Ou(h.start,p.format,r),m=Ou(h.start,p.remove,r);v.length&&m.length&&r.enqueueChange((function(e){if(!1!==s(e,v)){var t=!0,n=!1,r=void 0;try{for(var i,o=m.reverse()[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value;e.remove(a)}}catch(l){n=!0,r=l}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}}}))}}}}))}return d(e,null,[{key:"pluginName",get:function(){return"InlineAutoformatEditing"}}]),e}();function Ou(e,t,n){return t.filter((function(e){return void 0!==e[0]&&void 0!==e[1]})).map((function(t){return n.createRange(e.getShiftedBy(t[0]),e.getShiftedBy(t[1]))}))}function Nu(e,t){return function(n,r){if(!e.commands.get(t).isEnabled)return!1;var i=e.model.schema.getValidRanges(r,t),o=!0,a=!1,s=void 0;try{for(var l,u=i[Symbol.iterator]();!(o=(l=u.next()).done);o=!0){var c=l.value;n.setAttribute(t,!0,c)}}catch(f){a=!0,s=f}finally{try{o||null==u.return||u.return()}finally{if(a)throw s}}n.removeSelectionAttribute(t)}}var Iu=function(e){function t(e,n){var r;return f(this,t),(r=h(this,p(t).call(this,e))).attributeKey=n,r}return v(t,e),d(t,[{key:"refresh",value:function(){var e=this.editor.model,t=e.document;this.value=this._getValueFromFirstAllowedNode(),this.isEnabled=e.schema.checkAttributeInSelection(t.selection,this.attributeKey)}},{key:"execute",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.editor.model,r=n.document.selection,i=void 0===t.forceValue?!this.value:t.forceValue;n.change((function(t){if(r.isCollapsed)i?t.setSelectionAttribute(e.attributeKey,!0):t.removeSelectionAttribute(e.attributeKey);else{var o=n.schema.getValidRanges(r.getRanges(),e.attributeKey),a=!0,s=!1,l=void 0;try{for(var u,c=o[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var f=u.value;i?t.setAttribute(e.attributeKey,i,f):t.removeAttribute(e.attributeKey,f)}}catch(d){s=!0,l=d}finally{try{a||null==c.return||c.return()}finally{if(s)throw l}}}}))}},{key:"_getValueFromFirstAllowedNode",value:function(){var e=this.editor.model,t=e.schema,n=e.document.selection;if(n.isCollapsed)return n.hasAttribute(this.attributeKey);var r=!0,i=!1,o=void 0;try{for(var a,s=n.getRanges()[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var l=a.value,u=!0,c=!1,f=void 0;try{for(var d,h=l.getItems()[Symbol.iterator]();!(u=(d=h.next()).done);u=!0){var p=d.value;if(t.checkAttribute(p,this.attributeKey))return p.hasAttribute(this.attributeKey)}}catch(v){c=!0,f=v}finally{try{u||null==h.return||h.return()}finally{if(c)throw f}}}}catch(v){i=!0,o=v}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return!1}}]),t}(Al),Du="bold",Ru=function(e){function t(){return f(this,t),h(this,p(t).apply(this,arguments))}return v(t,e),d(t,[{key:"init",value:function(){var e=this.editor;e.model.schema.extend("$text",{allowAttributes:Du}),e.model.schema.setAttributeProperties(Du,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:Du,view:"strong",upcastAlso:["b",function(e){var t=e.getStyle("font-weight");return t?"bold"==t||Number(t)>=600?{name:!0,styles:["font-weight"]}:void 0:null}]}),e.commands.add(Du,new Iu(e,Du)),e.keystrokes.set("CTRL+B",Du)}}],[{key:"pluginName",get:function(){return"BoldEditing"}}]),t}(xl),ju="bold",Lu=function(e){function t(){return f(this,t),h(this,p(t).apply(this,arguments))}return v(t,e),d(t,[{key:"init",value:function(){var e=this,t=this.editor,n=t.t;t.ui.componentFactory.add(ju,(function(r){var i=t.commands.get(ju),o=new ll(r);return o.set({label:n("ag"),icon:'',keystroke:"CTRL+B",tooltip:!0,isToggleable:!0}),o.bind("isOn","isEnabled").to(i,"value","isEnabled"),e.listenTo(o,"execute",(function(){return t.execute(ju)})),o}))}}]),t}(xl),Fu="italic",zu=function(e){function t(){return f(this,t),h(this,p(t).apply(this,arguments))}return v(t,e),d(t,[{key:"init",value:function(){var e=this.editor;e.model.schema.extend("$text",{allowAttributes:Fu}),e.model.schema.setAttributeProperties(Fu,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:Fu,view:"i",upcastAlso:["em",{styles:{"font-style":"italic"}}]}),e.commands.add(Fu,new Iu(e,Fu)),e.keystrokes.set("CTRL+I",Fu)}}],[{key:"pluginName",get:function(){return"ItalicEditing"}}]),t}(xl),Vu="italic",Bu=function(e){function t(){return f(this,t),h(this,p(t).apply(this,arguments))}return v(t,e),d(t,[{key:"init",value:function(){var e=this,t=this.editor,n=t.t;t.ui.componentFactory.add(Vu,(function(r){var i=t.commands.get(Vu),o=new ll(r);return o.set({label:n("d"),icon:'',keystroke:"CTRL+I",tooltip:!0,isToggleable:!0}),o.bind("isOn","isEnabled").to(i,"value","isEnabled"),e.listenTo(o,"execute",(function(){return t.execute(Vu)})),o}))}}]),t}(xl);function Uu(e){var t=e.next();return t.done?null:t.value}var Hu=function(e){function t(){return f(this,t),h(this,p(t).apply(this,arguments))}return v(t,e),d(t,[{key:"refresh",value:function(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}},{key:"execute",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.editor.model,r=n.schema,i=n.document.selection,o=Array.from(i.getSelectedBlocks()),a=void 0===t.forceValue?!this.value:t.forceValue;n.change((function(t){if(a){var n=o.filter((function(e){return qu(e)||Yu(r,e)}));e._applyQuote(t,n)}else e._removeQuote(t,o.filter(qu))}))}},{key:"_getValue",value:function(){var e=Uu(this.editor.model.document.selection.getSelectedBlocks());return!(!e||!qu(e))}},{key:"_checkEnabled",value:function(){if(this.value)return!0;var e=this.editor.model.document.selection,t=this.editor.model.schema,n=Uu(e.getSelectedBlocks());return!!n&&Yu(t,n)}},{key:"_removeQuote",value:function(e,t){Wu(e,t).reverse().forEach((function(t){if(t.start.isAtStart&&t.end.isAtEnd)e.unwrap(t.start.parent);else if(t.start.isAtStart){var n=e.createPositionBefore(t.start.parent);e.move(t,n)}else{t.end.isAtEnd||e.split(t.end);var r=e.createPositionAfter(t.end.parent);e.move(t,r)}}))}},{key:"_applyQuote",value:function(e,t){var n=[];Wu(e,t).reverse().forEach((function(t){var r=qu(t.start);r||(r=e.createElement("blockQuote"),e.wrap(t,r)),n.push(r)})),n.reverse().reduce((function(t,n){return t.nextSibling==n?(e.merge(e.createPositionAfter(t)),t):n}))}}]),t}(Al);function qu(e){return"blockQuote"==e.parent.name?e.parent:null}function Wu(e,t){for(var n,r=0,i=[];r',tooltip:!0,isToggleable:!0}),o.bind("isOn","isEnabled").to(i,"value","isEnabled"),e.listenTo(o,"execute",(function(){return t.execute("blockQuote")})),o}))}}]),t}(xl),Qu=function(e){function t(){return f(this,t),h(this,p(t).apply(this,arguments))}return v(t,e),d(t,[{key:"init",value:function(){var e=this.editor,t=e.ui.componentFactory,n=e.t;t.add("ckfinder",(function(t){var r=e.commands.get("ckfinder"),i=new ll(t);return i.set({label:n("g"),icon:'',tooltip:!0}),i.bind("isEnabled").to(r),i.on("execute",(function(){e.execute("ckfinder"),e.editing.view.focus()})),i}))}}],[{key:"pluginName",get:function(){return"CKFinderUI"}}]),t}(xl),Ku=function(e){function t(){return f(this,t),h(this,p(t).apply(this,arguments))}return v(t,e),d(t,[{key:"observe",value:function(e){var t=this;this.listenTo(e,"load",(function(e,n){"IMG"==n.target.tagName&&t._fireEvents(n)}),{useCapture:!0})}},{key:"_fireEvents",value:function(e){this.isEnabled&&(this.document.fire("layoutChanged"),this.document.fire("imageLoaded",e))}}]),t}(Yr);function Ju(e){return function(n){n.on("attribute:".concat(e,":image"),t)};function t(e,t,n){if(n.consumable.consume(t.item,e.name)){var r=n.writer,i=n.mapper.toViewElement(t.item).getChild(0);null!==t.attributeNewValue?r.setAttribute(t.attributeKey,t.attributeNewValue,i):r.removeAttribute(t.attributeKey,i)}}}var Xu=function(){function e(){f(this,e),this._stack=[]}return d(e,[{key:"add",value:function(e,t){var n=this._stack,r=n[0];this._insertDescriptor(e);var i=n[0];r===i||Zu(r,i)||this.fire("change:top",{oldDescriptor:r,newDescriptor:i,writer:t})}},{key:"remove",value:function(e,t){var n=this._stack,r=n[0];this._removeDescriptor(e);var i=n[0];r===i||Zu(r,i)||this.fire("change:top",{oldDescriptor:r,newDescriptor:i,writer:t})}},{key:"_insertDescriptor",value:function(e){var t=this._stack,n=t.findIndex((function(t){return t.id===e.id}));if(!Zu(e,t[n])){n>-1&&t.splice(n,1);for(var r=0;t[r]&&ec(t[r],e);)r++;t.splice(r,0,e)}}},{key:"_removeDescriptor",value:function(e){var t=this._stack,n=t.findIndex((function(t){return t.id===e}));n>-1&&t.splice(n,1)}}]),e}();function Zu(e,t){return e&&t&&e.priority==t.priority&&tc(e.classes)==tc(t.classes)}function ec(e,t){return e.priority>t.priority||!(e.prioritytc(t.classes)}function tc(e){return Array.isArray(e)?e.sort().join(","):e}Yt(Xu,zt);var nc='',rc="ck-widget",ic="ck-widget_selected";function oc(e){return!!e.is("element")&&!!e.getCustomProperty("widget")}function ac(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return $n.isEdge||t.setAttribute("contenteditable","false",e),t.addClass(rc,e),t.setCustomProperty("widget",!0,e),e.getFillerOffset=cc,n.label&&function(e,t,n){n.setCustomProperty("widgetLabel",t,e)}(e,n.label,t),n.hasSelectionHandle&&function(e,t){var n=t.createUIElement("div",{class:"ck ck-widget__selection-handle"},(function(e){var t=this.toDomElement(e),n=new al;return n.set("content",nc),n.render(),t.appendChild(n.element),t}));t.insert(t.createPositionAt(e,0),n),t.addClass(["ck-widget_with-selection-handle"],e)}(e,t),function(e,t,n,r){var i=new Xu;i.on("change:top",(function(t,i){i.oldDescriptor&&r(e,i.oldDescriptor,i.writer),i.newDescriptor&&n(e,i.newDescriptor,i.writer)})),t.setCustomProperty("addHighlight",(function(e,t,n){return i.add(t,n)}),e),t.setCustomProperty("removeHighlight",(function(e,t,n){return i.remove(t,n)}),e)}(e,t,(function(e,t,n){return n.addClass(r(t.classes),e)}),(function(e,t,n){return n.removeClass(r(t.classes),e)})),e;function r(e){return Array.isArray(e)?e:[e]}}function sc(e){var t=e.getCustomProperty("widgetLabel");return t?"function"==typeof t?t():t:""}function lc(e,t){return t.addClass(["ck-editor__editable","ck-editor__nested-editable"],e),$n.isEdge||(t.setAttribute("contenteditable",e.isReadOnly?"false":"true",e),e.on("change:isReadOnly",(function(n,r,i){t.setAttribute("contenteditable",i?"false":"true",e)}))),e.on("change:isFocused",(function(n,r,i){i?t.addClass("ck-editor__nested-editable_focused",e):t.removeClass("ck-editor__nested-editable_focused",e)})),e}function uc(e,t){var n=e.getSelectedElement();if(n&&t.schema.isBlock(n))return t.createPositionAfter(n);var r=e.getSelectedBlocks().next().value;if(r){if(r.isEmpty)return t.createPositionAt(r,0);var i=t.createPositionAfter(r);return e.focus.isTouching(i)?i:t.createPositionBefore(r)}return e.focus}function cc(){return null}function fc(e){var t=e.getSelectedElement();return t&&function(e){return!!e.getCustomProperty("image")&&oc(e)}(t)?t:null}function dc(e){return!!e&&e.is("image")}function hc(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=e.createElement("image",n),i=uc(t.document.selection,t);t.insertContent(r,i),r.parent&&e.setSelection(r,"on")}function pc(e){var t=e.schema,n=e.document.selection;return function(e,t,n){var r=function(e,t){var n=uc(e,t).parent;return n.isEmpty&&!n.is("$root")?n.parent:n}(e,n);return t.checkChild(r,"image")}(n,t,e)&&!function(e,t){var n=e.getSelectedElement();return n&&t.isObject(n)}(n,t)&&function(e){return u(e.focus.getAncestors()).every((function(e){return!e.is("image")}))}(n)}var vc=function(e){function t(){return f(this,t),h(this,p(t).apply(this,arguments))}return v(t,e),d(t,[{key:"refresh",value:function(){this.isEnabled=pc(this.editor.model)}},{key:"execute",value:function(e){var t=this.editor.model;t.change((function(n){var r=Array.isArray(e.source)?e.source:[e.source],i=!0,o=!1,a=void 0;try{for(var s,l=r[Symbol.iterator]();!(i=(s=l.next()).done);i=!0){var u=s.value;hc(n,t,{src:u})}}catch(c){o=!0,a=c}finally{try{i||null==l.return||l.return()}finally{if(o)throw a}}}))}}]),t}(Al),mc=function(e){function t(){return f(this,t),h(this,p(t).apply(this,arguments))}return v(t,e),d(t,[{key:"init",value:function(){var e=this.editor,t=e.model.schema,n=e.t,r=e.conversion;e.editing.view.addObserver(Ku),t.register("image",{isObject:!0,isBlock:!0,allowWhere:"$block",allowAttributes:["alt","src","srcset"]}),r.for("dataDowncast").elementToElement({model:"image",view:function(e,t){return gc(t)}}),r.for("editingDowncast").elementToElement({model:"image",view:function(e,t){return function(e,t,n){return t.setCustomProperty("image",!0,e),ac(e,t,{label:function(){var t=e.getChild(0).getAttribute("alt");return t?"".concat(t," ").concat(n):n}})}(gc(t),t,n("i"))}}),r.for("downcast").add(Ju("src")).add(Ju("alt")).add(function(){return function(t){t.on("attribute:srcset:image",e)};function e(e,t,n){if(n.consumable.consume(t.item,e.name)){var r=n.writer,i=n.mapper.toViewElement(t.item).getChild(0);if(null===t.attributeNewValue){var o=t.attributeOldValue;o.data&&(r.removeAttribute("srcset",i),r.removeAttribute("sizes",i),o.width&&r.removeAttribute("width",i))}else{var a=t.attributeNewValue;a.data&&(r.setAttribute("srcset",a.data,i),r.setAttribute("sizes","100vw",i),a.width&&r.setAttribute("width",a.width,i))}}}}()),r.for("upcast").elementToElement({view:{name:"img",attributes:{src:!0}},model:function(e,t){return t.createElement("image",{src:e.getAttribute("src")})}}).attributeToAttribute({view:{name:"img",key:"alt"},model:"alt"}).attributeToAttribute({view:{name:"img",key:"srcset"},model:{key:"srcset",value:function(e){var t={data:e.getAttribute("srcset")};return e.hasAttribute("width")&&(t.width=e.getAttribute("width")),t}}}).add(function(){return function(t){t.on("element:figure",e)};function e(e,t,n){if(n.consumable.test(t.viewItem,{name:!0,classes:"image"})){var r=Array.from(t.viewItem.getChildren()).find((function(e){return e.is("img")}));if(r&&r.hasAttribute("src")&&n.consumable.test(r,{name:!0})){var i=n.convertItem(r,t.modelCursor),o=Uu(i.modelRange.getItems());o&&(n.convertChildren(t.viewItem,n.writer.createPositionAt(o,0)),t.modelRange=i.modelRange,t.modelCursor=i.modelCursor)}}}}()),e.commands.add("imageInsert",new vc(e))}}],[{key:"pluginName",get:function(){return"ImageEditing"}}]),t}(xl);function gc(e){var t=e.createEmptyElement("img"),n=e.createContainerElement("figure",{class:"image"});return e.insert(e.createPositionAt(n,0),t),n}function yc(e,t,n){return n.createRange(bc(e,t,!0,n),bc(e,t,!1,n))}function bc(e,t,n,r){for(var i=e.textNode||(n?e.nodeBefore:e.nodeAfter),o=null;i&&i.getAttribute("linkHref")==t;)o=i,i=n?i.previousSibling:i.nextSibling;return o?r.createPositionAt(o,n?"before":"after"):e}var kc=function(e){function t(e){var n;return f(this,t),(n=h(this,p(t).call(this,e))).manualDecorators=new Fn,n}return v(t,e),d(t,[{key:"restoreManualDecoratorStates",value:function(){var e=!0,t=!1,n=void 0;try{for(var r,i=this.manualDecorators[Symbol.iterator]();!(e=(r=i.next()).done);e=!0){var o=r.value;o.value=this._getDecoratorStateFromModel(o.id)}}catch(a){t=!0,n=a}finally{try{e||null==i.return||i.return()}finally{if(t)throw n}}}},{key:"refresh",value:function(){var e=this.editor.model,t=e.document;this.value=t.selection.getAttribute("linkHref");var n=!0,r=!1,i=void 0;try{for(var o,a=this.manualDecorators[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;s.value=this._getDecoratorStateFromModel(s.id)}}catch(l){r=!0,i=l}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}this.isEnabled=e.schema.checkAttributeInSelection(t.selection,"linkHref")}},{key:"execute",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.editor.model,r=n.document.selection,i=[],o=[];for(var a in t)t[a]?i.push(a):o.push(a);n.change((function(t){if(r.isCollapsed){var a=r.getFirstPosition();if(r.hasAttribute("linkHref")){var s=yc(a,r.getAttribute("linkHref"),n);t.setAttribute("linkHref",e,s),i.forEach((function(e){t.setAttribute(e,!0,s)})),o.forEach((function(e){t.removeAttribute(e,s)})),t.setSelection(s)}else if(""!==e){var l=$i(r.getAttributes());l.set("linkHref",e),i.forEach((function(e){l.set(e,!0)}));var u=t.createText(e,l);n.insertContent(u,a),t.setSelection(t.createRangeOn(u))}}else{var c=n.schema.getValidRanges(r.getRanges(),"linkHref"),f=!0,d=!1,h=void 0;try{for(var p,v=function(){var n=p.value;t.setAttribute("linkHref",e,n),i.forEach((function(e){t.setAttribute(e,!0,n)})),o.forEach((function(e){t.removeAttribute(e,n)}))},m=c[Symbol.iterator]();!(f=(p=m.next()).done);f=!0)v()}catch(g){d=!0,h=g}finally{try{f||null==m.return||m.return()}finally{if(d)throw h}}}}))}},{key:"_getDecoratorStateFromModel",value:function(e){return this.editor.model.document.selection.getAttribute(e)||!1}}]),t}(Al),wc=function(e){function t(){return f(this,t),h(this,p(t).apply(this,arguments))}return v(t,e),d(t,[{key:"refresh",value:function(){this.isEnabled=this.editor.model.document.selection.hasAttribute("linkHref")}},{key:"execute",value:function(){var e=this.editor,t=this.editor.model,n=t.document.selection,r=e.commands.get("link");t.change((function(e){var i=n.isCollapsed?[yc(n.getFirstPosition(),n.getAttribute("linkHref"),t)]:n.getRanges(),o=!0,a=!1,s=void 0;try{for(var l,u=i[Symbol.iterator]();!(o=(l=u.next()).done);o=!0){var c=l.value;if(e.removeAttribute("linkHref",c),r){var f=!0,d=!1,h=void 0;try{for(var p,v=r.manualDecorators[Symbol.iterator]();!(f=(p=v.next()).done);f=!0){var m=p.value;e.removeAttribute(m.id,c)}}catch(g){d=!0,h=g}finally{try{f||null==v.return||v.return()}finally{if(d)throw h}}}}}catch(g){a=!0,s=g}finally{try{o||null==u.return||u.return()}finally{if(a)throw s}}}))}}]),t}(Al),_c=function(e,t,n){var r=e.length;return n=void 0===n?r:n,!t&&n>=r?e:function(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r1&&void 0!==arguments[1]?arguments[1]:{};this._showNotification({message:e,type:"success",namespace:t.namespace,title:t.title})}},{key:"showInfo",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._showNotification({message:e,type:"info",namespace:t.namespace,title:t.title})}},{key:"showWarning",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._showNotification({message:e,type:"warning",namespace:t.namespace,title:t.title})}},{key:"_showNotification",value:function(e){var t="show:".concat(e.type)+(e.namespace?":".concat(e.namespace):"");this.fire(t,{message:e.message,type:e.type,title:e.title||""})}}],[{key:"pluginName",get:function(){return"Notification"}}]),t}(xl),nf=function(e){function t(e){var n;return f(this,t),(n=h(this,p(t).call(this,e))).stopListening(n.editor.model.document,"change"),n.listenTo(n.editor.model.document,"change",(function(){return n.refresh()}),{priority:"low"}),n}return v(t,e),d(t,[{key:"refresh",value:function(){var e=this.editor.commands.get("imageInsert"),t=this.editor.commands.get("link");this.isEnabled=e.isEnabled||t.isEnabled}},{key:"execute",value:function(){var e=this.editor,t=this.editor.config.get("ckfinder.openerMethod")||"modal";if("popup"!=t&&"modal"!=t)throw new It.b('ckfinder-unknown-openerMethod: The openerMethod config option must by "popup" or "modal".',e);var n=this.editor.config.get("ckfinder.options")||{};n.chooseFiles=!0;var r=n.onInit;n.language||(n.language=e.locale.uiLanguage),n.onInit=function(t){r&&r(t),t.on("files:choose",(function(n){var r=n.data.files.toArray(),i=r.filter((function(e){return!e.isImage()})),o=r.filter((function(e){return e.isImage()})),a=!0,s=!1,l=void 0;try{for(var u,c=i[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var f=u.value;e.execute("link",f.getUrl())}}catch(k){s=!0,l=k}finally{try{a||null==c.return||c.return()}finally{if(s)throw l}}var d=[],h=!0,p=!1,v=void 0;try{for(var m,g=o[Symbol.iterator]();!(h=(m=g.next()).done);h=!0){var y=m.value,b=y.getUrl();d.push(b||t.request("file:getProxyUrl",{file:y}))}}catch(k){p=!0,v=k}finally{try{h||null==g.return||g.return()}finally{if(p)throw v}}d.length&&rf(e,d)})),t.on("file:choose:resizedImage",(function(t){var n=t.data.resizedUrl;if(n)rf(e,[n]);else{var r=e.plugins.get("Notification"),i=e.locale.t;r.showWarning(i("at"),{title:i("au"),namespace:"ckfinder"})}}))},window.CKFinder[t](n)}}]),t}(Al);function rf(e,t){if(e.commands.get("imageInsert").isEnabled)e.execute("imageInsert",{source:t});else{var n=e.plugins.get("Notification"),r=e.locale.t;n.showWarning(r("av"),{title:r("aw"),namespace:"ckfinder"})}}var of=function(e){function t(){return f(this,t),h(this,p(t).apply(this,arguments))}return v(t,e),d(t,[{key:"init",value:function(){var e=this.editor;e.commands.add("ckfinder",new nf(e))}}],[{key:"pluginName",get:function(){return"CKFinderEditing"}},{key:"requires",get:function(){return[tf,mc,ef]}}]),t}(xl),af=/^data:(\S*?);base64,/,sf=function(){function e(t,n,r){if(f(this,e),!t)throw new It.b("fileuploader-missing-file: File must be provided as the first argument",null);if(!n)throw new It.b("fileuploader-missing-token: Token must be provided as the second argument.",null);if(!r)throw new It.b("fileuploader-missing-api-address: Api address must be provided as the third argument.",null);this.file=function(e){if("string"!=typeof e)return!1;var t=e.match(af);return!(!t||!t.length)}(t)?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:512;try{for(var n=e.match(af)[1],r=atob(e.replace(af,"")),i=[],o=0;o299)return e.fire("error",r.message||r.error)}))}},{key:"_sendRequest",value:function(){var e=this,t=new FormData,n=this.xhr;return t.append("file",this.file),new Promise((function(r,i){n.addEventListener("load",(function(){var t=n.status,o=n.response;return t<200||t>299?o.message?i(new It.b("fileuploader-uploading-data-failed: Uploading file failed.",e,{message:o.message})):i(o.error):r(o)})),n.addEventListener("error",(function(){return i(new Error("Network Error"))})),n.addEventListener("abort",(function(){return i(new Error("Abort"))})),n.send(t)}))}}]),e}();Yt(sf,zt);var lf={refreshInterval:36e5,autoRefresh:!0},uf=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:lf;if(f(this,e),!t)throw new It.b("token-missing-token-url: A `tokenUrl` must be provided as the first constructor argument.",this);this.set("value",n.initValue),this._refresh="function"==typeof t?t:function(){return function(e){return new Promise((function(t,n){var r=new XMLHttpRequest;r.open("GET",e),r.addEventListener("load",(function(){var e=r.status,i=r.response;return e<200||e>299?n(new It.b("token-cannot-download-new-token: Cannot download new token from the provided url.",null)):t(i)})),r.addEventListener("error",(function(){return n(new Error("Network Error"))})),r.addEventListener("abort",(function(){return n(new Error("Abort"))})),r.send()}))}(t)},this._options=Object.assign({},lf,n)}return d(e,[{key:"init",value:function(){var e=this;return new Promise((function(t,n){e._options.autoRefresh&&e._startRefreshing(),e.value?t(e):e._refreshToken().then(t).catch(n)}))}},{key:"_refreshToken",value:function(){var e=this;return this._refresh().then((function(t){return e.set("value",t)})).then((function(){return e}))}},{key:"destroy",value:function(){this._stopRefreshing()}},{key:"_startRefreshing",value:function(){var e=this;this._refreshInterval=setInterval((function(){return e._refreshToken()}),this._options.refreshInterval)}},{key:"_stopRefreshing",value:function(){clearInterval(this._refreshInterval)}}],[{key:"create",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:lf;return new e(t,n).init()}}]),e}();Yt(uf,wn);var cf=uf,ff=function(e){function t(){return f(this,t),h(this,p(t).apply(this,arguments))}return v(t,e),d(t,[{key:"init",value:function(){var e=this.editor.config.get("cloudServices")||{};for(var n in e)this[n]=e[n];if(this.tokenUrl)return this.token=new t.Token(this.tokenUrl),this.token.init();this.token=null}}],[{key:"pluginName",get:function(){return"CloudServices"}}]),t}(xl);ff.Token=cf;var df=function(e){function t(){return f(this,t),h(this,p(t).apply(this,arguments))}return v(t,e),d(t,[{key:"init",value:function(){var e=this,n=this.editor,r=n.plugins.get(ff),i=r.token,o=r.uploadUrl;i&&(this._uploadGateway=new t._UploadGateway(i,o),n.plugins.get(_u).createUploadAdapter=function(t){return new hf(e._uploadGateway,t)})}}],[{key:"requires",get:function(){return[_u,ff]}}]),t}(xl),hf=function(){function e(t,n){f(this,e),this.uploadGateway=t,this.loader=n}return d(e,[{key:"upload",value:function(){var e=this;return this.loader.file.then((function(t){return e.fileUploader=e.uploadGateway.upload(t),e.fileUploader.on("progress",(function(t,n){e.loader.uploadTotal=n.total,e.loader.uploaded=n.uploaded})),e.fileUploader.send()}))}},{key:"abort",value:function(){this.fileUploader.abort()}}]),e}();df._UploadGateway=function(){function e(t,n){if(f(this,e),!t)throw new It.b("uploadgateway-missing-token: Token must be provided.",null);if(!n)throw new It.b("uploadgateway-missing-api-address: Api address must be provided.",null);this._token=t,this._apiAddress=n}return d(e,[{key:"upload",value:function(e){return new sf(e,this._token,this._apiAddress)}}]),e}();var pf=function(e){function t(e){var n;return f(this,t),(n=h(this,p(t).call(this,e))).domEventType="mousedown",n}return v(t,e),d(t,[{key:"onDomEvent",value:function(e){this.fire(e.type,e)}}]),t}(di);n(47);var vf=Xn("Ctrl+A"),mf=function(e){function t(){return f(this,t),h(this,p(t).apply(this,arguments))}return v(t,e),d(t,[{key:"init",value:function(){var e=this,t=this.editor.editing.view,n=t.document;this._previouslySelected=new Set,this.editor.editing.downcastDispatcher.on("selection",(function(t,n,r){e._clearPreviouslySelectedWidgets(r.writer);var i=r.writer,o=i.document.selection,a=o.getSelectedElement(),s=null,l=!0,u=!1,c=void 0;try{for(var f,d=o.getRanges()[Symbol.iterator]();!(l=(f=d.next()).done);l=!0){var h=f.value,p=!0,v=!1,m=void 0;try{for(var g,y=h[Symbol.iterator]();!(p=(g=y.next()).done);p=!0){var b=g.value.item;oc(b)&&!gf(b,s)&&(i.addClass(ic,b),e._previouslySelected.add(b),s=b,b==a&&i.setSelection(o.getRanges(),{fake:!0,label:sc(a)}))}}catch(k){v=!0,m=k}finally{try{p||null==y.return||y.return()}finally{if(v)throw m}}}}catch(k){u=!0,c=k}finally{try{l||null==d.return||d.return()}finally{if(u)throw c}}}),{priority:"low"}),t.addObserver(pf),this.listenTo(n,"mousedown",(function(){return e._onMousedown.apply(e,arguments)})),this.listenTo(n,"keydown",(function(){return e._onKeydown.apply(e,arguments)}),{priority:"high"}),this.listenTo(n,"delete",(function(t,n){e._handleDelete("forward"==n.direction)&&(n.preventDefault(),t.stop())}),{priority:"high"})}},{key:"_onMousedown",value:function(e,t){var n=this.editor,r=n.editing.view,i=r.document,o=t.target;if(function(e){for(;e;){if(e.is("editableElement")&&!e.is("rootElement"))return!0;if(oc(e))return!1;e=e.parent}return!1}(o)){if($n.isSafari&&t.domEvent.detail>=3){var a=n.editing.mapper.toModelElement(o);this.editor.model.change((function(e){t.preventDefault(),e.setSelection(a,"in")}))}}else if(oc(o)||(o=o.findAncestor(oc))){t.preventDefault(),i.isFocused||r.focus();var s=n.editing.mapper.toModelElement(o);this._setSelectionOverElement(s)}}},{key:"_onKeydown",value:function(e,t){var n=t.keyCode,r="ltr"===this.editor.locale.contentLanguageDirection,i=n==Kn.arrowdown||n==Kn[r?"arrowright":"arrowleft"],o=!1;!function(e){return e==Kn.arrowright||e==Kn.arrowleft||e==Kn.arrowup||e==Kn.arrowdown}(n)?function(e){return Jn(e)==vf}(t)?o=this._selectAllNestedEditableContent()||this._selectAllContent():n===Kn.enter&&(o=this._handleEnterKey(t.shiftKey)):o=this._handleArrowKeys(i),o&&(t.preventDefault(),e.stop())}},{key:"_handleDelete",value:function(e){var t=this;if(!this.editor.isReadOnly){var n=this.editor.model.document.selection;if(n.isCollapsed){var r=this._getObjectElementNextToSelection(e);return r?(this.editor.model.change((function(e){for(var i=n.anchor.parent;i.isEmpty;){var o=i;i=o.parent,e.remove(o)}t._setSelectionOverElement(r)})),!0):void 0}}}},{key:"_handleArrowKeys",value:function(e){var t=this.editor.model,n=t.schema,r=t.document.selection,i=r.getSelectedElement();if(i&&n.isObject(i)){var o=e?r.getLastPosition():r.getFirstPosition(),a=n.getNearestSelectionRange(o,e?"forward":"backward");return a&&t.change((function(e){e.setSelection(a)})),!0}if(r.isCollapsed){var s=this._getObjectElementNextToSelection(e);return s&&n.isObject(s)?(this._setSelectionOverElement(s),!0):void 0}}},{key:"_handleEnterKey",value:function(e){var t,n,r=this.editor.model,i=r.document.selection.getSelectedElement();if(t=i,n=r.schema,t&&n.isObject(t)&&!n.isInline(t))return r.change((function(t){var n=t.createPositionAt(i,e?"before":"after"),o=t.createElement("paragraph");if(r.schema.isBlock(i.parent)){var a=r.schema.findAllowedParent(n,o);n=t.split(n,a).position}t.insert(o,n),t.setSelection(o,"in")})),!0}},{key:"_selectAllNestedEditableContent",value:function(){var e=this.editor.model,t=e.document.selection,n=e.schema.getLimitElement(t);return t.getFirstRange().root!=n&&(e.change((function(e){e.setSelection(e.createRangeIn(n))})),!0)}},{key:"_selectAllContent",value:function(){var e=this.editor.model,t=this.editor.editing,n=t.view.document.selection.getSelectedElement();if(n&&oc(n)){var r=t.mapper.toModelElement(n.parent);return e.change((function(e){e.setSelection(e.createRangeIn(r))})),!0}return!1}},{key:"_setSelectionOverElement",value:function(e){this.editor.model.change((function(t){t.setSelection(t.createRangeOn(e))}))}},{key:"_getObjectElementNextToSelection",value:function(e){var t=this.editor.model,n=t.schema,r=t.document.selection,i=t.createSelection(r);t.modifySelection(i,{direction:e?"forward":"backward"});var o=e?i.focus.nodeBefore:i.focus.nodeAfter;return o&&n.isObject(o)?o:null}},{key:"_clearPreviouslySelectedWidgets",value:function(e){var t=!0,n=!1,r=void 0;try{for(var i,o=this._previouslySelected[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value;e.removeClass(ic,a)}}catch(s){n=!0,r=s}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}this._previouslySelected.clear()}}],[{key:"pluginName",get:function(){return"Widget"}}]),t}(xl);function gf(e,t){return!!t&&Array.from(e.getAncestors()).includes(t)}var yf=function(e){function t(){return f(this,t),h(this,p(t).apply(this,arguments))}return v(t,e),d(t,[{key:"refresh",value:function(){var e=this.editor.model.document.selection.getSelectedElement();this.isEnabled=dc(e),dc(e)&&e.hasAttribute("alt")?this.value=e.getAttribute("alt"):this.value=!1}},{key:"execute",value:function(e){var t=this.editor.model,n=t.document.selection.getSelectedElement();t.change((function(t){t.setAttribute("alt",e.newValue,n)}))}}]),t}(Al),bf=function(e){function t(){return f(this,t),h(this,p(t).apply(this,arguments))}return v(t,e),d(t,[{key:"init",value:function(){this.editor.commands.add("imageTextAlternative",new yf(this.editor))}}],[{key:"pluginName",get:function(){return"ImageTextAlternativeEditing"}}]),t}(xl);n(49);var kf=function(e){function t(e,n){var r;f(this,t),r=h(this,p(t).call(this,e));var i="ck-input-".concat(Rt()),a="ck-status-".concat(Rt());r.set("label"),r.set("value"),r.set("isReadOnly",!1),r.set("errorText",null),r.set("infoText",null),r.labelView=r._createLabelView(i),r.inputView=r._createInputView(n,i,a),r.statusView=r._createStatusView(a),r.bind("_statusText").to(o(r),"errorText",o(r),"infoText",(function(e,t){return e||t}));var s=r.bindTemplate;return r.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-input",s.if("isReadOnly","ck-disabled")]},children:[r.labelView,r.inputView,r.statusView]}),r}return v(t,e),d(t,[{key:"_createLabelView",value:function(e){var t=new Ws(this.locale);return t.for=e,t.bind("text").to(this,"label"),t}},{key:"_createInputView",value:function(e,t,n){var r=this,i=new e(this.locale,n);return i.id=t,i.ariaDescribedById=n,i.bind("value").to(this),i.bind("isReadOnly").to(this),i.bind("hasError").to(this,"errorText",(function(e){return!!e})),i.on("input",(function(){r.errorText=null})),i}},{key:"_createStatusView",value:function(e){var t=new Hs(this.locale),n=this.bindTemplate;return t.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-input__status",n.if("errorText","ck-labeled-input__status_error"),n.if("_statusText","ck-hidden",(function(e){return!e}))],id:e,role:n.if("errorText","alert")},children:[{text:n.to("_statusText")}]}),t}},{key:"select",value:function(){this.inputView.select()}},{key:"focus",value:function(){this.inputView.focus()}}]),t}(Hs);n(51);var wf=function(e){function t(e){var n;f(this,t),(n=h(this,p(t).call(this,e))).set("value"),n.set("id"),n.set("placeholder"),n.set("isReadOnly",!1),n.set("hasError",!1),n.set("ariaDescribedById");var r=n.bindTemplate;return n.setTemplate({tag:"input",attributes:{type:"text",class:["ck","ck-input","ck-input-text",r.if("hasError","ck-error")],id:r.to("id"),placeholder:r.to("placeholder"),readonly:r.to("isReadOnly"),"aria-invalid":r.if("hasError",!0),"aria-describedby":r.to("ariaDescribedById")},on:{input:r.to("input")}}),n}return v(t,e),d(t,[{key:"render",value:function(){var e=this;l(p(t.prototype),"render",this).call(this);var n=function(t){e.element.value=t||0===t?t:""};n(this.value),this.on("change:value",(function(e,t,r){n(r)}))}},{key:"select",value:function(){this.element.select()}},{key:"focus",value:function(){this.element.focus()}}]),t}(Hs);function _f(e){var t=e.view;t.listenTo(t.element,"submit",(function(e,n){n.preventDefault(),t.fire("submit")}),{useCapture:!0})}var xf='',Tf='';n(53);var Cf=function(e){function t(e){var n;f(this,t);var r=(n=h(this,p(t).call(this,e))).locale.t;return n.focusTracker=new vs,n.keystrokes=new ss,n.labeledInput=n._createLabeledInputView(),n.saveButtonView=n._createButton(r("bf"),xf,"ck-button-save"),n.saveButtonView.type="submit",n.cancelButtonView=n._createButton(r("bg"),Tf,"ck-button-cancel","cancel"),n._focusables=new xs,n._focusCycler=new Js({focusables:n._focusables,focusTracker:n.focusTracker,keystrokeHandler:n.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),n.setTemplate({tag:"form",attributes:{class:["ck","ck-text-alternative-form"],tabindex:"-1"},children:[n.labeledInput,n.saveButtonView,n.cancelButtonView]}),n}return v(t,e),d(t,[{key:"render",value:function(){var e=this;l(p(t.prototype),"render",this).call(this),this.keystrokes.listenTo(this.element),_f({view:this}),[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach((function(t){e._focusables.add(t),e.focusTracker.add(t.element)}))}},{key:"_createButton",value:function(e,t,n,r){var i=new ll(this.locale);return i.set({label:e,icon:t,tooltip:!0}),i.extendTemplate({attributes:{class:n}}),r&&i.delegate("execute").to(this,r),i}},{key:"_createLabeledInputView",value:function(){var e=this.locale.t,t=new kf(this.locale,wf);return t.label=e("cd"),t.inputView.placeholder=e("cd"),t}}]),t}(Hs);n(55);var Sf=Gs("px"),Ef=Dr.document.body,Af=function(e){function t(e){var n;f(this,t);var r=(n=h(this,p(t).call(this,e))).bindTemplate;return n.set("top",0),n.set("left",0),n.set("position","arrow_nw"),n.set("isVisible",!1),n.set("withArrow",!0),n.set("class"),n.content=n.createCollection(),n.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-panel",r.to("position",(function(e){return"ck-balloon-panel_".concat(e)})),r.if("isVisible","ck-balloon-panel_visible"),r.if("withArrow","ck-balloon-panel_with-arrow"),r.to("class")],style:{top:r.to("top",Sf),left:r.to("left",Sf)}},children:n.content}),n}return v(t,e),d(t,[{key:"show",value:function(){this.isVisible=!0}},{key:"hide",value:function(){this.isVisible=!1}},{key:"attachTo",value:function(e){this.show();var n=t.defaultPositions,r=Object.assign({},{element:this.element,positions:[n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast,n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast],limiter:Ef,fitInViewport:!0},e),i=t._getOptimalPosition(r),o=parseInt(i.left),a=parseInt(i.top),s=i.name;Object.assign(this,{top:a,left:o,position:s})}},{key:"pin",value:function(e){var t=this;this.unpin(),this._pinWhenIsVisibleCallback=function(){t.isVisible?t._startPinning(e):t._stopPinning()},this._startPinning(e),this.listenTo(this,"change:isVisible",this._pinWhenIsVisibleCallback)}},{key:"unpin",value:function(){this._pinWhenIsVisibleCallback&&(this._stopPinning(),this.stopListening(this,"change:isVisible",this._pinWhenIsVisibleCallback),this._pinWhenIsVisibleCallback=null,this.hide())}},{key:"_startPinning",value:function(e){var t=this;this.attachTo(e);var n=Pf(e.target),r=e.limiter?Pf(e.limiter):Ef;this.listenTo(Dr.document,"scroll",(function(i,o){var a=o.target,s=n&&a.contains(n),l=r&&a.contains(r);!s&&!l&&n&&r||t.attachTo(e)}),{useCapture:!0}),this.listenTo(Dr.window,"resize",(function(){t.attachTo(e)}))}},{key:"_stopPinning",value:function(){this.stopListening(Dr.document,"scroll"),this.stopListening(Dr.window,"resize")}}]),t}(Hs);function Pf(e){return Mt(e)?e:Mi(e)?e.commonAncestorContainer:"function"==typeof e?Pf(e()):null}function Mf(e,t){return e.top-t.height-Af.arrowVerticalOffset}function Of(e){return e.bottom+Af.arrowVerticalOffset}Af.arrowHorizontalOffset=25,Af.arrowVerticalOffset=10,Af._getOptimalPosition=nl,Af.defaultPositions={northArrowSouth:function(e,t){return{top:Mf(e,t),left:e.left+e.width/2-t.width/2,name:"arrow_s"}},northArrowSouthEast:function(e,t){return{top:Mf(e,t),left:e.left+e.width/2-t.width+Af.arrowHorizontalOffset,name:"arrow_se"}},northArrowSouthWest:function(e,t){return{top:Mf(e,t),left:e.left+e.width/2-Af.arrowHorizontalOffset,name:"arrow_sw"}},northWestArrowSouth:function(e,t){return{top:Mf(e,t),left:e.left-t.width/2,name:"arrow_s"}},northWestArrowSouthWest:function(e,t){return{top:Mf(e,t),left:e.left-Af.arrowHorizontalOffset,name:"arrow_sw"}},northWestArrowSouthEast:function(e,t){return{top:Mf(e,t),left:e.left-t.width+Af.arrowHorizontalOffset,name:"arrow_se"}},northEastArrowSouth:function(e,t){return{top:Mf(e,t),left:e.right-t.width/2,name:"arrow_s"}},northEastArrowSouthEast:function(e,t){return{top:Mf(e,t),left:e.right-t.width+Af.arrowHorizontalOffset,name:"arrow_se"}},northEastArrowSouthWest:function(e,t){return{top:Mf(e,t),left:e.right-Af.arrowHorizontalOffset,name:"arrow_sw"}},southArrowNorth:function(e,t){return{top:Of(e),left:e.left+e.width/2-t.width/2,name:"arrow_n"}},southArrowNorthEast:function(e,t){return{top:Of(e),left:e.left+e.width/2-t.width+Af.arrowHorizontalOffset,name:"arrow_ne"}},southArrowNorthWest:function(e,t){return{top:Of(e),left:e.left+e.width/2-Af.arrowHorizontalOffset,name:"arrow_nw"}},southWestArrowNorth:function(e,t){return{top:Of(e),left:e.left-t.width/2,name:"arrow_n"}},southWestArrowNorthWest:function(e,t){return{top:Of(e),left:e.left-Af.arrowHorizontalOffset,name:"arrow_nw"}},southWestArrowNorthEast:function(e,t){return{top:Of(e),left:e.left-t.width+Af.arrowHorizontalOffset,name:"arrow_ne"}},southEastArrowNorth:function(e,t){return{top:Of(e),left:e.right-t.width/2,name:"arrow_n"}},southEastArrowNorthEast:function(e,t){return{top:Of(e),left:e.right-t.width+Af.arrowHorizontalOffset,name:"arrow_ne"}},southEastArrowNorthWest:function(e,t){return{top:Of(e),left:e.right-Af.arrowHorizontalOffset,name:"arrow_nw"}}};var Nf='\n',If='\n';n(57),n(59);var Df=Gs("px"),Rf=function(e){function t(e){var n;return f(this,t),(n=h(this,p(t).call(this,e))).positionLimiter=function(){var e=n.editor.editing.view,t=e.document.selection.editableElement;return t?e.domConverter.mapViewToDom(t.root):null},n.set("visibleView",null),n.view=new Af(e.locale),e.ui.view.body.add(n.view),e.ui.focusTracker.add(n.view.element),n._viewToStack=new Map,n._idToStack=new Map,n.set("_numberOfStacks",0),n.set("_singleViewMode",!1),n._rotatorView=n._createRotatorView(),n._fakePanelsView=n._createFakePanelsView(),n}return v(t,e),d(t,null,[{key:"pluginName",get:function(){return"ContextualBalloon"}}]),d(t,[{key:"hasView",value:function(e){return Array.from(this._viewToStack.keys()).includes(e)}},{key:"add",value:function(e){if(this.hasView(e.view))throw new It.b("contextualballoon-add-view-exist: Cannot add configuration of the same view twice.",[this,e]);var t=e.stackId||"main";if(!this._idToStack.has(t))return this._idToStack.set(t,new Map([[e.view,e]])),this._viewToStack.set(e.view,this._idToStack.get(t)),this._numberOfStacks=this._idToStack.size,void(this._visibleStack&&!e.singleViewMode||this.showStack(t));var n=this._idToStack.get(t);e.singleViewMode&&this.showStack(t),n.set(e.view,e),this._viewToStack.set(e.view,n),n===this._visibleStack&&this._showView(e)}},{key:"remove",value:function(e){if(!this.hasView(e))throw new It.b("contextualballoon-remove-view-not-exist: Cannot remove the configuration of a non-existent view.",[this,e]);var t=this._viewToStack.get(e);this._singleViewMode&&this.visibleView===e&&(this._singleViewMode=!1),this.visibleView===e&&(1===t.size?this._idToStack.size>1?this._showNextStack():(this.view.hide(),this.visibleView=null,this._rotatorView.hideView()):this._showView(Array.from(t.values())[t.size-2])),1===t.size?(this._idToStack.delete(this._getStackId(t)),this._numberOfStacks=this._idToStack.size):t.delete(e),this._viewToStack.delete(e)}},{key:"updatePosition",value:function(e){e&&(this._visibleStack.get(this.visibleView).position=e),this.view.pin(this._getBalloonPosition()),this._fakePanelsView.updatePosition()}},{key:"showStack",value:function(e){this.visibleStack=e;var t=this._idToStack.get(e);if(!t)throw new It.b("contextualballoon-showstack-stack-not-exist: Cannot show a stack that does not exist.",this);this._visibleStack!==t&&this._showView(Array.from(t.values()).pop())}},{key:"_getStackId",value:function(e){return Array.from(this._idToStack.entries()).find((function(t){return t[1]===e}))[0]}},{key:"_showNextStack",value:function(){var e=Array.from(this._idToStack.values()),t=e.indexOf(this._visibleStack)+1;e[t]||(t=0),this.showStack(this._getStackId(e[t]))}},{key:"_showPrevStack",value:function(){var e=Array.from(this._idToStack.values()),t=e.indexOf(this._visibleStack)-1;e[t]||(t=e.length-1),this.showStack(this._getStackId(e[t]))}},{key:"_createRotatorView",value:function(){var e=this,t=new jf(this.editor.locale),n=this.editor.locale.t;return this.view.content.add(t),t.bind("isNavigationVisible").to(this,"_numberOfStacks",this,"_singleViewMode",(function(e,t){return!t&&e>1})),t.on("change:isNavigationVisible",(function(){return e.updatePosition()}),{priority:"low"}),t.bind("counter").to(this,"visibleView",this,"_numberOfStacks",(function(t,r){if(r<2)return"";var i=Array.from(e._idToStack.values()).indexOf(e._visibleStack)+1;return n("bn",[i,r])})),t.buttonNextView.on("execute",(function(){t.focusTracker.isFocused&&e.editor.editing.view.focus(),e._showNextStack()})),t.buttonPrevView.on("execute",(function(){t.focusTracker.isFocused&&e.editor.editing.view.focus(),e._showPrevStack()})),t}},{key:"_createFakePanelsView",value:function(){var e=new Lf(this.editor.locale,this.view);return e.bind("numberOfPanels").to(this,"_numberOfStacks",this,"_singleViewMode",(function(e,t){return!t&&e>=2?Math.min(e-1,2):0})),e.listenTo(this.view,"change:top",(function(){return e.updatePosition()})),e.listenTo(this.view,"change:left",(function(){return e.updatePosition()})),this.editor.ui.view.body.add(e),e}},{key:"_showView",value:function(e){var t=e.view,n=e.balloonClassName,r=void 0===n?"":n,i=e.withArrow,o=void 0===i||i,a=e.singleViewMode,s=void 0!==a&&a;this.view.class=r,this.view.withArrow=o,this._rotatorView.showView(t),this.visibleView=t,this.view.pin(this._getBalloonPosition()),this._fakePanelsView.updatePosition(),s&&(this._singleViewMode=!0)}},{key:"_getBalloonPosition",value:function(){var e=Array.from(this._visibleStack.values()).pop().position;return e&&!e.limiter&&(e=Object.assign({},e,{limiter:this.positionLimiter})),e}},{key:"_visibleStack",get:function(){return this._viewToStack.get(this.visibleView)}}]),t}(xl),jf=function(e){function t(e){var n;f(this,t),n=h(this,p(t).call(this,e));var r=e.t,i=n.bindTemplate;return n.set("isNavigationVisible",!0),n.focusTracker=new vs,n.buttonPrevView=n._createButtonView(r("bo"),Nf),n.buttonNextView=n._createButtonView(r("bp"),If),n.content=n.createCollection(),n.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-rotator"],"z-index":"-1"},children:[{tag:"div",attributes:{class:["ck-balloon-rotator__navigation",i.to("isNavigationVisible",(function(e){return e?"":"ck-hidden"}))]},children:[n.buttonPrevView,{tag:"span",attributes:{class:["ck-balloon-rotator__counter"]},children:[{text:i.to("counter")}]},n.buttonNextView]},{tag:"div",attributes:{class:"ck-balloon-rotator__content"},children:n.content}]}),n}return v(t,e),d(t,[{key:"render",value:function(){l(p(t.prototype),"render",this).call(this),this.focusTracker.add(this.element)}},{key:"showView",value:function(e){this.hideView(),this.content.add(e)}},{key:"hideView",value:function(){this.content.clear()}},{key:"_createButtonView",value:function(e,t){var n=new ll(this.locale);return n.set({label:e,icon:t,tooltip:!0}),n}}]),t}(Hs),Lf=function(e){function t(e,n){var r;f(this,t);var i=(r=h(this,p(t).call(this,e))).bindTemplate;return r.set("top",0),r.set("left",0),r.set("height",0),r.set("width",0),r.set("numberOfPanels",0),r.content=r.createCollection(),r._balloonPanelView=n,r.setTemplate({tag:"div",attributes:{class:["ck-fake-panel",i.to("numberOfPanels",(function(e){return e?"":"ck-hidden"}))],style:{top:i.to("top",Df),left:i.to("left",Df),width:i.to("width",Df),height:i.to("height",Df)}},children:r.content}),r.on("change:numberOfPanels",(function(e,t,n,i){n>i?r._addPanels(n-i):r._removePanels(i-n),r.updatePosition()})),r}return v(t,e),d(t,[{key:"_addPanels",value:function(e){for(;e--;){var t=new Hs;t.setTemplate({tag:"div"}),this.content.add(t),this.registerChild(t)}}},{key:"_removePanels",value:function(e){for(;e--;){var t=this.content.last;this.content.remove(t),this.deregisterChild(t),t.destroy()}}},{key:"updatePosition",value:function(){if(this.numberOfPanels){var e=this._balloonPanelView,t=e.top,n=e.left,r=new Ii(this._balloonPanelView.element),i=r.width,o=r.height;Object.assign(this,{top:t,left:n,width:i,height:o})}}}]),t}(Hs);function Ff(e){var t=e.editing.view,n=Af.defaultPositions;return{target:t.domConverter.viewToDom(t.document.selection.getSelectedElement()),positions:[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast]}}var zf=function(e){function t(){return f(this,t),h(this,p(t).apply(this,arguments))}return v(t,e),d(t,[{key:"init",value:function(){this._createButton(),this._createForm()}},{key:"destroy",value:function(){l(p(t.prototype),"destroy",this).call(this),this._form.destroy()}},{key:"_createButton",value:function(){var e=this,t=this.editor,n=t.t;t.ui.componentFactory.add("imageTextAlternative",(function(r){var i=t.commands.get("imageTextAlternative"),o=new ll(r);return o.set({label:n("bv"),icon:'',tooltip:!0}),o.bind("isEnabled").to(i,"isEnabled"),e.listenTo(o,"execute",(function(){return e._showForm()})),o}))}},{key:"_createForm",value:function(){var e=this,t=this.editor,n=t.editing.view.document;this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new Cf(t.locale),this._form.render(),this.listenTo(this._form,"submit",(function(){t.execute("imageTextAlternative",{newValue:e._form.labeledInput.inputView.element.value}),e._hideForm(!0)})),this.listenTo(this._form,"cancel",(function(){e._hideForm(!0)})),this._form.keystrokes.set("Esc",(function(t,n){e._hideForm(!0),n()})),this.listenTo(t.ui,"update",(function(){fc(n.selection)?e._isVisible&&function(e){var t=e.plugins.get("ContextualBalloon");if(fc(e.editing.view.document.selection)){var n=Ff(e);t.updatePosition(n)}}(t):e._hideForm(!0)})),pl({emitter:this._form,activator:function(){return e._isVisible},contextElements:[this._balloon.view.element],callback:function(){return e._hideForm()}})}},{key:"_showForm",value:function(){if(!this._isVisible){var e=this.editor,t=e.commands.get("imageTextAlternative"),n=this._form.labeledInput;this._isInBalloon||this._balloon.add({view:this._form,position:Ff(e)}),n.value=n.inputView.element.value=t.value||"",this._form.labeledInput.select()}}},{key:"_hideForm",value:function(e){this._isInBalloon&&(this._form.focusTracker.isFocused&&this._form.saveButtonView.focus(),this._balloon.remove(this._form),e&&this.editor.editing.view.focus())}},{key:"_isVisible",get:function(){return this._balloon.visibleView===this._form}},{key:"_isInBalloon",get:function(){return this._balloon.hasView(this._form)}}],[{key:"requires",get:function(){return[Rf]}},{key:"pluginName",get:function(){return"ImageTextAlternativeUI"}}]),t}(xl),Vf=function(e){function t(){return f(this,t),h(this,p(t).apply(this,arguments))}return v(t,e),d(t,null,[{key:"requires",get:function(){return[bf,zf]}},{key:"pluginName",get:function(){return"ImageTextAlternative"}}]),t}(xl);n(61);var Bf=function(e){function t(){return f(this,t),h(this,p(t).apply(this,arguments))}return v(t,e),d(t,null,[{key:"requires",get:function(){return[mc,mf,Vf]}},{key:"pluginName",get:function(){return"Image"}}]),t}(xl),Uf=function(e){function t(e){var n;return f(this,t),(n=h(this,p(t).call(this,e))).buttonView=new ll(e),n._fileInputView=new Hf(e),n._fileInputView.bind("acceptedType").to(o(n)),n._fileInputView.bind("allowMultipleFiles").to(o(n)),n._fileInputView.delegate("done").to(o(n)),n.setTemplate({tag:"span",attributes:{class:"ck-file-dialog-button"},children:[n.buttonView,n._fileInputView]}),n.buttonView.on("execute",(function(){n._fileInputView.open()})),n}return v(t,e),d(t,[{key:"focus",value:function(){this.buttonView.focus()}}]),t}(Hs),Hf=function(e){function t(e){var n;f(this,t),(n=h(this,p(t).call(this,e))).set("acceptedType"),n.set("allowMultipleFiles",!1);var r=n.bindTemplate;return n.setTemplate({tag:"input",attributes:{class:["ck-hidden"],type:"file",tabindex:"-1",accept:r.to("acceptedType"),multiple:r.to("allowMultipleFiles")},on:{change:r.to((function(){n.element&&n.element.files&&n.element.files.length&&n.fire("done",n.element.files),n.element.value=""}))}}),n}return v(t,e),d(t,[{key:"open",value:function(){this.element.click()}}]),t}(Hs);function qf(e){var t=e.map((function(e){return e.replace("+","\\+")}));return new RegExp("^image\\/(".concat(t.join("|"),")$"))}function Wf(e){return new Promise((function(t,n){var r=e.getAttribute("src");fetch(r).then((function(e){return e.blob()})).then((function(e){var i=function(e,t){return e.type?e.type:t.match(/data:(image\/\w+);base64/)?t.match(/data:(image\/\w+);base64/)[1].toLowerCase():"image/jpeg"}(e,r),o=function(e,t,n){try{return new File([e],t,{type:n})}catch(e){return null}}(e,"image.".concat(i.replace("image/","")),i);o?t(o):n()})).catch(n)}))}var Yf=function(e){function t(){return f(this,t),h(this,p(t).apply(this,arguments))}return v(t,e),d(t,[{key:"init",value:function(){var e=this.editor,t=e.t;e.ui.componentFactory.add("imageUpload",(function(n){var r=new Uf(n),i=e.commands.get("imageUpload"),o=e.config.get("image.upload.types"),a=qf(o);return r.set({acceptedType:o.map((function(e){return"image/".concat(e)})).join(","),allowMultipleFiles:!0}),r.buttonView.set({label:t("j"),icon:'',tooltip:!0}),r.buttonView.bind("isEnabled").to(i),r.on("done",(function(t,n){var r=Array.from(n).filter((function(e){return a.test(e.type)}));r.length&&e.execute("imageUpload",{file:r})})),r}))}}]),t}(xl),$f='';n(63),n(65),n(67);var Gf=function(e){function t(e){var n;return f(this,t),(n=h(this,p(t).call(this,e))).placeholder="data:image/svg+xml;utf8,"+encodeURIComponent($f),n}return v(t,e),d(t,[{key:"init",value:function(){var e=this;this.editor.editing.downcastDispatcher.on("attribute:uploadStatus:image",(function(){return e.uploadStatusChange.apply(e,arguments)}))}},{key:"uploadStatusChange",value:function(e,t,n){var r=this.editor,i=t.item,o=i.getAttribute("uploadId");if(n.consumable.consume(t.item,e.name)){var a=r.plugins.get(_u),s=o?t.attributeNewValue:null,l=this.placeholder,u=r.editing.mapper.toViewElement(i),c=n.writer;if("reading"==s)return Qf(u,c),void Kf(l,u,c);if("uploading"==s){var f=a.loaders.get(o);return Qf(u,c),void(f?(Jf(u,c),function(e,t,n,r){var i=function(e){var t=e.createUIElement("div",{class:"ck-progress-bar"});return e.setCustomProperty("progressBar",!0,t),t}(t);t.insert(t.createPositionAt(e,"end"),i),n.on("change:uploadedPercent",(function(e,t,n){r.change((function(e){e.setStyle("width",n+"%",i)}))}))}(u,c,f,r.editing.view),function(e,t,n){if(n.data){var r=e.getChild(0);t.setAttribute("src",n.data,r)}}(u,c,f)):Kf(l,u,c))}"complete"==s&&a.loaders.get(o)&&!$n.isEdge&&function(e,t,n){var r=t.createUIElement("div",{class:"ck-image-upload-complete-icon"});t.insert(t.createPositionAt(e,"end"),r),setTimeout((function(){n.change((function(e){return e.remove(e.createRangeOn(r))}))}),3e3)}(u,c,r.editing.view),function(e,t){Zf(e,t,"progressBar")}(u,c),Jf(u,c),function(e,t){t.removeClass("ck-appear",e)}(u,c)}}}]),t}(xl);function Qf(e,t){e.hasClass("ck-appear")||t.addClass("ck-appear",e)}function Kf(e,t,n){t.hasClass("ck-image-upload-placeholder")||n.addClass("ck-image-upload-placeholder",t);var r=t.getChild(0);r.getAttribute("src")!==e&&n.setAttribute("src",e,r),Xf(t,"placeholder")||n.insert(n.createPositionAfter(r),function(e){var t=e.createUIElement("div",{class:"ck-upload-placeholder-loader"});return e.setCustomProperty("placeholder",!0,t),t}(n))}function Jf(e,t){e.hasClass("ck-image-upload-placeholder")&&t.removeClass("ck-image-upload-placeholder",e),Zf(e,t,"placeholder")}function Xf(e,t){var n=!0,r=!1,i=void 0;try{for(var o,a=e.getChildren()[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;if(s.getCustomProperty(t))return s}}catch(l){r=!0,i=l}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}}function Zf(e,t,n){var r=Xf(e,n);r&&t.remove(t.createRangeOn(r))}var ed=function(){function e(){f(this,e)}return d(e,[{key:"createDocumentFragment",value:function(e){return new rr(e)}},{key:"createElement",value:function(e,t,n){return new nn(e,t,n)}},{key:"createText",value:function(e){return new Kt(e)}},{key:"clone",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e._clone(t)}},{key:"appendChild",value:function(e,t){return t._appendChild(e)}},{key:"insertChild",value:function(e,t,n){return n._insertChild(e,t)}},{key:"removeChildren",value:function(e,t,n){return n._removeChildren(e,t)}},{key:"remove",value:function(e){var t=e.parent;return t?this.removeChildren(t.getChildIndex(e),1,t):[]}},{key:"replace",value:function(e,t){var n=e.parent;if(n){var r=n.getChildIndex(e);return this.removeChildren(r,1,n),this.insertChild(r,t,n),!0}return!1}},{key:"unwrapElement",value:function(e){var t=e.parent;if(t){var n=t.getChildIndex(e);this.remove(e),this.insertChild(n,e.getChildren(),t)}}},{key:"rename",value:function(e,t){var n=new nn(e,t.getAttributes(),t.getChildren());return this.replace(t,n)?n:null}},{key:"setAttribute",value:function(e,t,n){n._setAttribute(e,t)}},{key:"removeAttribute",value:function(e,t){t._removeAttribute(e)}},{key:"addClass",value:function(e,t){t._addClass(e)}},{key:"removeClass",value:function(e,t){t._removeClass(e)}},{key:"setStyle",value:function(e,t,n){R(e)&&void 0===n&&(n=t),n._setStyle(e,t)}},{key:"removeStyle",value:function(e,t){t._removeStyle(e)}},{key:"setCustomProperty",value:function(e,t,n){n._setCustomProperty(e,t)}},{key:"removeCustomProperty",value:function(e,t){return t._removeCustomProperty(e)}},{key:"createPositionAt",value:function(e,t){return Nn._createAt(e,t)}},{key:"createPositionAfter",value:function(e){return Nn._createAfter(e)}},{key:"createPositionBefore",value:function(e){return Nn._createBefore(e)}},{key:"createRange",value:function(e,t){return new In(e,t)}},{key:"createRangeOn",value:function(e){return In._createOn(e)}},{key:"createRangeIn",value:function(e){return In._createIn(e)}},{key:"createSelection",value:function(e,t,n){return new jn(e,t,n)}}]),e}(),td=function(e){function t(){return f(this,t),h(this,p(t).apply(this,arguments))}return v(t,e),d(t,[{key:"refresh",value:function(){this.isEnabled=pc(this.editor.model)}},{key:"execute",value:function(e){var t=this.editor,n=t.model,r=t.plugins.get(_u);n.change((function(t){var i=Array.isArray(e.file)?e.file:[e.file],o=!0,a=!1,s=void 0;try{for(var l,u=i[Symbol.iterator]();!(o=(l=u.next()).done);o=!0){var c=l.value;nd(t,n,r,c)}}catch(f){a=!0,s=f}finally{try{o||null==u.return||u.return()}finally{if(a)throw s}}}))}}]),t}(Al);function nd(e,t,n,r){var i=n.createLoader(r);i&&hc(e,t,{uploadId:i.id})}var rd=function(e){function t(e){var n;return f(this,t),n=h(this,p(t).call(this,e)),e.config.define("image",{upload:{types:["jpeg","png","gif","bmp","webp","tiff"]}}),n}return v(t,e),d(t,null,[{key:"requires",get:function(){return[_u,tf,El]}},{key:"pluginName",get:function(){return"ImageUploadEditing"}}]),d(t,[{key:"init",value:function(){var e=this,t=this.editor,n=t.model.document,r=t.model.schema,i=t.conversion,o=t.plugins.get(_u),a=qf(t.config.get("image.upload.types"));r.extend("image",{allowAttributes:["uploadId","uploadStatus"]}),t.commands.add("imageUpload",new td(t)),i.for("upcast").attributeToAttribute({view:{name:"img",key:"uploadId"},model:"uploadId"}),this.listenTo(t.editing.view.document,"clipboardInput",(function(e,n){if(!function(e){return Array.from(e.types).includes("text/html")&&""!==e.getData("text/html")}(n.dataTransfer)){var r=Array.from(n.dataTransfer.files).filter((function(e){return!!e&&a.test(e.type)})),i=n.targetRanges.map((function(e){return t.editing.mapper.toModelRange(e)}));t.model.change((function(n){n.setSelection(i),r.length&&(e.stop(),t.model.enqueueChange("default",(function(){t.execute("imageUpload",{file:r})})))}))}})),this.listenTo(t.plugins.get(El),"inputTransformation",(function(e,n){var r=Array.from(t.editing.view.createRangeIn(n.content)).filter((function(e){return function(e){return!(!e.is("element","img")||!e.getAttribute("src"))&&(e.getAttribute("src").match(/^data:image\/\w+;base64,/g)||e.getAttribute("src").match(/^blob:/g))}(e.item)&&!e.item.getAttribute("uploadProcessed")})).map((function(e){return{promise:Wf(e.item),imageElement:e.item}}));if(r.length){var i=new ed,a=!0,s=!1,l=void 0;try{for(var u,c=r[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var f=u.value;i.setAttribute("uploadProcessed",!0,f.imageElement);var d=o.createLoader(f.promise);d&&(i.setAttribute("src","",f.imageElement),i.setAttribute("uploadId",d.id,f.imageElement))}}catch(h){s=!0,l=h}finally{try{a||null==c.return||c.return()}finally{if(s)throw l}}}})),t.editing.view.document.on("dragover",(function(e,t){t.preventDefault()})),n.on("change",(function(){var r=n.differ.getChanges({includeChangesInGraveyard:!0}),i=!0,a=!1,s=void 0;try{for(var l,u=r[Symbol.iterator]();!(i=(l=u.next()).done);i=!0){var c=l.value;if("insert"==c.type&&"$text"!=c.name){var f=c.position.nodeAfter,d="$graveyard"==c.position.root.rootName,h=!0,p=!1,v=void 0;try{for(var m,g=id(t,f)[Symbol.iterator]();!(h=(m=g.next()).done);h=!0){var y=m.value,b=y.getAttribute("uploadId");if(b){var k=o.loaders.get(b);k&&(d?k.abort():"idle"==k.status&&e._readAndUpload(k,y))}}}catch(w){p=!0,v=w}finally{try{h||null==g.return||g.return()}finally{if(p)throw v}}}}}catch(w){a=!0,s=w}finally{try{i||null==u.return||u.return()}finally{if(a)throw s}}}))}},{key:"_readAndUpload",value:function(e,t){var n=this,r=this.editor,i=r.model,o=r.locale.t,a=r.plugins.get(_u),s=r.plugins.get(tf);return i.enqueueChange("transparent",(function(e){e.setAttribute("uploadStatus","reading",t)})),e.read().then((function(){var n=e.upload();if($n.isSafari){var o=r.editing.mapper.toViewElement(t).getChild(0);r.editing.view.once("render",(function(){if(o.parent){var e=r.editing.view.domConverter.mapViewToDom(o.parent);if(e){var t=e.style.display;e.style.display="none",e._ckHack=e.offsetHeight,e.style.display=t}}}))}return i.enqueueChange("transparent",(function(e){e.setAttribute("uploadStatus","uploading",t)})),n})).then((function(e){i.enqueueChange("transparent",(function(r){r.setAttributes({uploadStatus:"complete",src:e.default},t),n._parseAndSetSrcsetAttributeOnImage(e,t,r)})),l()})).catch((function(n){if("error"!==e.status&&"aborted"!==e.status)throw n;"error"==e.status&&n&&s.showWarning(n,{title:o("an"),namespace:"upload"}),l(),i.enqueueChange("transparent",(function(e){e.remove(t)}))}));function l(){i.enqueueChange("transparent",(function(e){e.removeAttribute("uploadId",t),e.removeAttribute("uploadStatus",t)})),a.destroyLoader(e)}}},{key:"_parseAndSetSrcsetAttributeOnImage",value:function(e,t,n){var r=0,i=Object.keys(e).filter((function(e){var t=parseInt(e,10);if(!isNaN(t))return r=Math.max(r,t),!0})).map((function(t){return"".concat(e[t]," ").concat(t,"w")})).join(", ");""!=i&&n.setAttribute("srcset",{data:i,width:r},t)}}]),t}(xl);function id(e,t){return Array.from(e.model.createRangeOn(t)).filter((function(e){return e.item.is("image")})).map((function(e){return e.item}))}var od=function(e){function t(){return f(this,t),h(this,p(t).apply(this,arguments))}return v(t,e),d(t,null,[{key:"pluginName",get:function(){return"ImageUpload"}},{key:"requires",get:function(){return[rd,Yf,Gf]}}]),t}(xl),ad=function(e){function t(){return f(this,t),h(this,p(t).apply(this,arguments))}return v(t,e),d(t,[{key:"refresh",value:function(){var e=this.editor.model,t=Uu(e.document.selection.getSelectedBlocks());this.value=!!t&&t.is("paragraph"),this.isEnabled=!!t&&sd(t,e.schema)}},{key:"execute",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.editor.model,n=t.document;t.change((function(r){var i=(e.selection||n.selection).getSelectedBlocks(),o=!0,a=!1,s=void 0;try{for(var l,u=i[Symbol.iterator]();!(o=(l=u.next()).done);o=!0){var c=l.value;!c.is("paragraph")&&sd(c,t.schema)&&r.rename(c,"paragraph")}}catch(f){a=!0,s=f}finally{try{o||null==u.return||u.return()}finally{if(a)throw s}}}))}}]),t}(Al);function sd(e,t){return t.checkChild(e.parent,"paragraph")&&!t.isObject(e)}var ld=function(e){function t(){return f(this,t),h(this,p(t).apply(this,arguments))}return v(t,e),d(t,[{key:"init",value:function(){var e=this,n=this.editor,r=n.model,i=n.data;n.commands.add("paragraph",new ad(n)),r.schema.register("paragraph",{inheritAllFrom:"$block"}),n.conversion.elementToElement({model:"paragraph",view:"p"}),n.conversion.for("upcast").elementToElement({model:function(e,n){return t.paragraphLikeElements.has(e.name)?e.isEmpty?null:n.createElement("paragraph"):null},converterPriority:"low"}),i.upcastDispatcher.on("element",(function(e,t,n){n.consumable.test(t.viewItem,{name:t.viewItem.name})&&cd(t.viewItem,t.modelCursor,n.schema)&&Object.assign(t,ud(t.viewItem,t.modelCursor,n))}),{priority:"low"}),i.upcastDispatcher.on("text",(function(e,t,n){t.modelRange||cd(t.viewItem,t.modelCursor,n.schema)&&Object.assign(t,ud(t.viewItem,t.modelCursor,n))}),{priority:"lowest"}),r.document.registerPostFixer((function(t){return e._autoparagraphEmptyRoots(t)})),n.data.on("ready",(function(){r.enqueueChange("transparent",(function(t){return e._autoparagraphEmptyRoots(t)}))}),{priority:"lowest"})}},{key:"_autoparagraphEmptyRoots",value:function(e){var t=this.editor.model,n=!0,r=!1,i=void 0;try{for(var o,a=t.document.getRootNames()[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value,l=t.document.getRoot(s);if(l.isEmpty&&"$graveyard"!=l.rootName&&t.schema.checkChild(l,"paragraph"))return e.insertElement("paragraph",l),!0}}catch(u){r=!0,i=u}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}}}],[{key:"pluginName",get:function(){return"Paragraph"}}]),t}(xl);function ud(e,t,n){var r=n.writer.createElement("paragraph");return n.writer.insert(r,t),n.convertItem(e,n.writer.createPositionAt(r,0))}function cd(e,t,n){var r=n.createContext(t);return!!n.checkChild(r,"paragraph")&&!!n.checkChild(r.push("paragraph"),e)}ld.paragraphLikeElements=new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td"]);var fd=function(e){function t(e,n){var r;return f(this,t),(r=h(this,p(t).call(this,e))).modelElements=n,r}return v(t,e),d(t,[{key:"refresh",value:function(){var e=this,t=Uu(this.editor.model.document.selection.getSelectedBlocks());this.value=!!t&&this.modelElements.includes(t.name)&&t.name,this.isEnabled=!!t&&this.modelElements.some((function(n){return dd(t,n,e.editor.model.schema)}))}},{key:"execute",value:function(e){var t=this.editor.model,n=t.document,r=e.value;t.change((function(e){var i=Array.from(n.selection.getSelectedBlocks()).filter((function(e){return dd(e,r,t.schema)})),o=!0,a=!1,s=void 0;try{for(var l,u=i[Symbol.iterator]();!(o=(l=u.next()).done);o=!0){var c=l.value;c.is(r)||e.rename(c,r)}}catch(f){a=!0,s=f}finally{try{o||null==u.return||u.return()}finally{if(a)throw s}}}))}}]),t}(Al);function dd(e,t,n){return n.checkChild(e.parent,t)&&!n.isObject(e)}var hd="paragraph",pd=function(e){function t(e){var n;return f(this,t),n=h(this,p(t).call(this,e)),e.config.define("heading",{options:[{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h2",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h3",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h4",title:"Heading 3",class:"ck-heading_heading3"}]}),n}return v(t,e),d(t,null,[{key:"pluginName",get:function(){return"HeadingEditing"}}]),d(t,[{key:"init",value:function(){var e=this.editor,t=e.config.get("heading.options"),n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var l=a.value;l.model!==hd&&(e.model.schema.register(l.model,{inheritAllFrom:"$block"}),e.conversion.elementToElement(l),n.push(l.model))}}catch(u){i=!0,o=u}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}this._addDefaultH1Conversion(e),e.commands.add("heading",new fd(e,n))}},{key:"afterInit",value:function(){var e=this.editor,t=e.commands.get("enter"),n=e.config.get("heading.options");t&&this.listenTo(t,"afterExecute",(function(t,r){var i=e.model.document.selection.getFirstPosition().parent;n.some((function(e){return i.is(e.model)}))&&!i.is(hd)&&0===i.childCount&&r.writer.rename(i,hd)}))}},{key:"_addDefaultH1Conversion",value:function(e){e.conversion.for("upcast").elementToElement({model:"heading1",view:"h1",converterPriority:jt.get("low")+1})}}],[{key:"requires",get:function(){return[ld]}}]),t}(xl),vd=function e(t,n){f(this,e),n&&mn(this,n),t&&this.set(t)};Yt(vd,wn),n(10);var md=function(e){function t(){return f(this,t),h(this,p(t).apply(this,arguments))}return v(t,e),d(t,[{key:"init",value:function(){var e=this,t=this.editor,n=t.t,r=function(e){var t=e.t,n={Paragraph:t("bw"),"Heading 1":t("bx"),"Heading 2":t("by"),"Heading 3":t("bz"),"Heading 4":t("ca"),"Heading 5":t("cb"),"Heading 6":t("cc")};return e.config.get("heading.options").map((function(e){var t=n[e.title];return t&&t!=e.title&&(e.title=t),e}))}(t),i=n("e"),o=n("f");t.ui.componentFactory.add("heading",(function(n){var a={},s=new Fn,l=t.commands.get("heading"),u=t.commands.get("paragraph"),c=[l],f=!0,d=!1,h=void 0;try{for(var p,v=function(){var e=p.value,t={type:"button",model:new vd({label:e.title,class:e.class,withText:!0})};"paragraph"===e.model?(t.model.bind("isOn").to(u,"value"),t.model.set("commandName","paragraph"),c.push(u)):(t.model.bind("isOn").to(l,"value",(function(t){return t===e.model})),t.model.set({commandName:"heading",commandValue:e.model})),s.add(t),a[e.model]=e.title},m=r[Symbol.iterator]();!(f=(p=m.next()).done);f=!0)v()}catch(y){d=!0,h=y}finally{try{f||null==m.return||m.return()}finally{if(d)throw h}}var g=vl(n);return ml(g,s),g.buttonView.set({isOn:!1,withText:!0,tooltip:o}),g.extendTemplate({attributes:{class:["ck-heading-dropdown"]}}),g.bind("isEnabled").toMany(c,"isEnabled",(function(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1])||arguments[1];return function(n,r,i){var o=r.item;if((o.childCount||t)&&dc(o.parent)){if(!i.consumable.consume(r.item,"insert"))return;var a=i.mapper.toViewElement(r.range.start.parent),s=e(i.writer),l=i.writer;o.childCount||l.addClass("ck-hidden",s),function(e,t,n,r){var i=r.writer.createPositionAt(n,"end");r.writer.insert(i,e),r.mapper.bindElements(t,e)}(s,r.item,a,i)}}}function wd(e){var t=e.getAncestors({includeSelf:!0}).find((function(e){return"caption"==e.name}));return t&&t.parent&&"image"==t.parent.name?t:null}function _d(e,t){return!e.childCount&&!e.hasClass("ck-hidden")&&(t.addClass("ck-hidden",e),!0)}function xd(e,t){return!!e.hasClass("ck-hidden")&&(t.removeClass("ck-hidden",e),!0)}n(70);var Td=function(e){function t(e,n){var r;return f(this,t),(r=h(this,p(t).call(this,e))).defaultStyle=!1,r.styles=n.reduce((function(e,t){return e[t.name]=t,t.isDefault&&(r.defaultStyle=t.name),e}),{}),r}return v(t,e),d(t,[{key:"refresh",value:function(){var e=this.editor.model.document.selection.getSelectedElement();if(this.isEnabled=dc(e),e)if(e.hasAttribute("imageStyle")){var t=e.getAttribute("imageStyle");this.value=!!this.styles[t]&&t}else this.value=this.defaultStyle;else this.value=!1}},{key:"execute",value:function(e){var t=this,n=e.value,r=this.editor.model,i=r.document.selection.getSelectedElement();r.change((function(e){t.styles[n].isDefault?e.removeAttribute("imageStyle",i):e.setAttribute("imageStyle",n,i)}))}}]),t}(Al);function Cd(e,t){var n=!0,r=!1,i=void 0;try{for(var o,a=t[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;if(s.name===e)return s}}catch(l){r=!0,i=l}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}}var Sd='',Ed='',Ad='',Pd='',Md={full:{name:"full",title:"Full size image",icon:Sd,isDefault:!0},side:{name:"side",title:"Side image",icon:Pd,className:"image-style-side"},alignLeft:{name:"alignLeft",title:"Left aligned image",icon:Ed,className:"image-style-align-left"},alignCenter:{name:"alignCenter",title:"Centered image",icon:Ad,className:"image-style-align-center"},alignRight:{name:"alignRight",title:"Right aligned image",icon:Pd,className:"image-style-align-right"}},Od={full:Sd,left:Ed,right:Pd,center:Ad};function Nd(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map(Id)}function Id(e){if("string"==typeof e){var t=e;Md[t]?e=Object.assign({},Md[t]):(console.warn(Object(It.a)("image-style-not-found: There is no such image style of given name."),{name:t}),e={name:t})}else if(Md[e.name]){var n=Md[e.name],r=Object.assign({},e);for(var i in n)e.hasOwnProperty(i)||(r[i]=n[i]);e=r}return"string"==typeof e.icon&&Od[e.icon]&&(e.icon=Od[e.icon]),e}var Dd=function(e){function t(){return f(this,t),h(this,p(t).apply(this,arguments))}return v(t,e),d(t,[{key:"init",value:function(){var e=this.editor,t=e.model.schema,n=e.data,r=e.editing;e.config.define("image.styles",["full","side"]);var i=Nd(e.config.get("image.styles"));t.extend("image",{allowAttributes:"imageStyle"});var o=function(e){return function(t,n,r){if(r.consumable.consume(n.item,t.name)){var i=Cd(n.attributeNewValue,e),o=Cd(n.attributeOldValue,e),a=r.mapper.toViewElement(n.item),s=r.writer;o&&s.removeClass(o.className,a),i&&s.addClass(i.className,a)}}}(i);r.downcastDispatcher.on("attribute:imageStyle:image",o),n.downcastDispatcher.on("attribute:imageStyle:image",o),n.upcastDispatcher.on("element:figure",function(e){var t=e.filter((function(e){return!e.isDefault}));return function(e,n,r){if(n.modelRange){var i=n.viewItem,o=Uu(n.modelRange.getItems());if(r.schema.checkAttribute(o,"imageStyle")){var a=!0,s=!1,l=void 0;try{for(var u,c=t[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var f=u.value;r.consumable.consume(i,{classes:f.className})&&r.writer.setAttribute("imageStyle",f.name,o)}}catch(d){s=!0,l=d}finally{try{a||null==c.return||c.return()}finally{if(s)throw l}}}}}}(i),{priority:"low"}),e.commands.add("imageStyle",new Td(e,i))}}],[{key:"pluginName",get:function(){return"ImageStyleEditing"}}]),t}(xl);n(72);var Rd=function(e){function t(){return f(this,t),h(this,p(t).apply(this,arguments))}return v(t,e),d(t,[{key:"init",value:function(){var e=function(e,t){var n=!0,r=!1,i=void 0;try{for(var o,a=e[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;t[s.title]&&(s.title=t[s.title])}}catch(l){r=!0,i=l}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}return e}(Nd(this.editor.config.get("image.styles")),this.localizedDefaultStylesTitles),t=!0,n=!1,r=void 0;try{for(var i,o=e[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value;this._createButton(a)}}catch(s){n=!0,r=s}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}}},{key:"_createButton",value:function(e){var t=this,n=this.editor,r="imageStyle:".concat(e.name);n.ui.componentFactory.add(r,(function(r){var i=n.commands.get("imageStyle"),o=new ll(r);return o.set({label:e.title,icon:e.icon,tooltip:!0,isToggleable:!0}),o.bind("isEnabled").to(i,"isEnabled"),o.bind("isOn").to(i,"value",(function(t){return t===e.name})),t.listenTo(o,"execute",(function(){return n.execute("imageStyle",{value:e.name})})),o}))}},{key:"localizedDefaultStylesTitles",get:function(){var e=this.editor.t;return{"Full size image":e("ah"),"Side image":e("ai"),"Left aligned image":e("aj"),"Centered image":e("ak"),"Right aligned image":e("al")}}}],[{key:"pluginName",get:function(){return"ImageStyleUI"}}]),t}(xl),jd=function(e){function t(){return f(this,t),h(this,p(t).apply(this,arguments))}return v(t,e),d(t,[{key:"init",value:function(){var e=this,t=this.editor;if(t.plugins.has("BalloonToolbar")){var n=t.plugins.get("BalloonToolbar");this.listenTo(n,"show",(function(e){(function(e){var t=e.getSelectedElement();return!(!t||!oc(t))})(t.editing.view.document.selection)&&e.stop()}),{priority:"high"})}this._toolbarDefinitions=new Map,this._balloon=this.editor.plugins.get("ContextualBalloon"),this.listenTo(t.ui,"update",(function(){e._updateToolbarsVisibility()})),this.listenTo(t.ui.focusTracker,"change:isFocused",(function(){e._updateToolbarsVisibility()}),{priority:"low"})}},{key:"destroy",value:function(){l(p(t.prototype),"destroy",this).call(this);var e=!0,n=!1,r=void 0;try{for(var i,o=this._toolbarDefinitions.values()[Symbol.iterator]();!(e=(i=o.next()).done);e=!0)i.value.view.destroy()}catch(a){n=!0,r=a}finally{try{e||null==o.return||o.return()}finally{if(n)throw r}}}},{key:"register",value:function(e,t){var n=t.ariaLabel,r=t.items,i=t.getRelatedElement,o=t.balloonClassName,a=void 0===o?"ck-toolbar-container":o,s=this.editor,l=s.t,u=new gl(s.locale);if(u.ariaLabel=n||l("ax"),this._toolbarDefinitions.has(e))throw new It.b("widget-toolbar-duplicated: Toolbar with the given id was already added.",this,{toolbarId:e});u.fillFromConfig(r,s.ui.componentFactory),this._toolbarDefinitions.set(e,{view:u,getRelatedElement:i,balloonClassName:a})}},{key:"_updateToolbarsVisibility",value:function(){var e=0,t=null,n=null,r=!0,i=!1,o=void 0;try{for(var a,s=this._toolbarDefinitions.values()[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var l=a.value,u=l.getRelatedElement(this.editor.editing.view.document.selection);if(this.editor.ui.focusTracker.isFocused)if(u){var c=u.getAncestors().length;c>e&&(e=c,t=u,n=l)}else this._isToolbarInBalloon(l)&&this._hideToolbar(l);else this._isToolbarVisible(l)&&this._hideToolbar(l)}}catch(f){i=!0,o=f}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}n&&this._showToolbar(n,t)}},{key:"_hideToolbar",value:function(e){this._balloon.remove(e.view),this.stopListening(this._balloon,"change:visibleView")}},{key:"_showToolbar",value:function(e,t){var n=this;this._isToolbarVisible(e)?Ld(this.editor,t):this._isToolbarInBalloon(e)||(this._balloon.add({view:e.view,position:Fd(this.editor,t),balloonClassName:e.balloonClassName}),this.listenTo(this._balloon,"change:visibleView",(function(){var e=!0,t=!1,r=void 0;try{for(var i,o=n._toolbarDefinitions.values()[Symbol.iterator]();!(e=(i=o.next()).done);e=!0){var a=i.value;if(n._isToolbarVisible(a)){var s=a.getRelatedElement(n.editor.editing.view.document.selection);Ld(n.editor,s)}}}catch(l){t=!0,r=l}finally{try{e||null==o.return||o.return()}finally{if(t)throw r}}})))}},{key:"_isToolbarVisible",value:function(e){return this._balloon.visibleView===e.view}},{key:"_isToolbarInBalloon",value:function(e){return this._balloon.hasView(e.view)}}],[{key:"requires",get:function(){return[Rf]}},{key:"pluginName",get:function(){return"WidgetToolbarRepository"}}]),t}(xl);function Ld(e,t){var n=e.plugins.get("ContextualBalloon"),r=Fd(e,t);n.updatePosition(r)}function Fd(e,t){var n=e.editing.view,r=Af.defaultPositions;return{target:n.domConverter.mapViewToDom(t),positions:[r.northArrowSouth,r.northArrowSouthWest,r.northArrowSouthEast,r.southArrowNorth,r.southArrowNorthWest,r.southArrowNorthEast]}}var zd=function(e){function t(e){var n;return f(this,t),(n=h(this,p(t).call(this,e)))._childCommands=[],n}return v(t,e),d(t,[{key:"refresh",value:function(){}},{key:"execute",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n\n',Ud='\n',Hd=function(e){function t(){return f(this,t),h(this,p(t).apply(this,arguments))}return v(t,e),d(t,[{key:"init",value:function(){var e=this.editor,t=e.locale,n=e.t,r="ltr"==t.uiLanguageDirection?Bd:Ud,i="ltr"==t.uiLanguageDirection?Ud:Bd;this._defineButton("indent",n("k"),r),this._defineButton("outdent",n("l"),i)}},{key:"_defineButton",value:function(e,t,n){var r=this,i=this.editor;i.ui.componentFactory.add(e,(function(o){var a=i.commands.get(e),s=new ll(o);return s.set({label:t,icon:n,tooltip:!0}),s.bind("isOn","isEnabled").to(a,"value","isEnabled"),r.listenTo(s,"execute",(function(){return i.execute(e)})),s}))}}],[{key:"pluginName",get:function(){return"IndentUI"}}]),t}(xl),qd=function(e){function t(e){var n;return f(this,t),(n=h(this,p(t).call(this,e))).domEventType="click",n}return v(t,e),d(t,[{key:"onDomEvent",value:function(e){this.fire(e.type,e)}}]),t}(di);n(74);var Wd=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];f(this,t),n=h(this,p(t).call(this,e));var i=e.t;n.focusTracker=new vs,n.keystrokes=new ss,n.urlInputView=n._createUrlInput(),n.saveButtonView=n._createButton(i("bf"),xf,"ck-button-save"),n.saveButtonView.type="submit",n.cancelButtonView=n._createButton(i("bg"),Tf,"ck-button-cancel","cancel"),n._manualDecoratorSwitches=n._createManualDecoratorSwitches(r),n.children=n._createFormChildren(r),n._focusables=new xs,n._focusCycler=new Js({focusables:n._focusables,focusTracker:n.focusTracker,keystrokeHandler:n.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});var o=["ck","ck-link-form"];return r.length&&o.push("ck-link-form_layout-vertical"),n.setTemplate({tag:"form",attributes:{class:o,tabindex:"-1"},children:n.children}),n}return v(t,e),d(t,[{key:"getDecoratorSwitchesState",value:function(){return Array.from(this._manualDecoratorSwitches).reduce((function(e,t){return e[t.name]=t.isOn,e}),{})}},{key:"render",value:function(){var e=this;l(p(t.prototype),"render",this).call(this),_f({view:this}),[this.urlInputView].concat(u(this._manualDecoratorSwitches),[this.saveButtonView,this.cancelButtonView]).forEach((function(t){e._focusables.add(t),e.focusTracker.add(t.element)})),this.keystrokes.listenTo(this.element)}},{key:"focus",value:function(){this._focusCycler.focusFirst()}},{key:"_createUrlInput",value:function(){var e=this.locale.t,t=new kf(this.locale,wf);return t.label=e("bk"),t.inputView.placeholder="https://example.com",t}},{key:"_createButton",value:function(e,t,n,r){var i=new ll(this.locale);return i.set({label:e,icon:t,tooltip:!0}),i.extendTemplate({attributes:{class:n}}),r&&i.delegate("execute").to(this,r),i}},{key:"_createManualDecoratorSwitches",value:function(e){var t=this,n=this.createCollection(),r=!0,i=!1,o=void 0;try{for(var a,s=function(){var e=a.value,r=new hl(t.locale);r.set({name:e.id,label:e.label,withText:!0}),r.bind("isOn").to(e,"value"),r.on("execute",(function(){e.set("value",!r.isOn)})),n.add(r)},l=e[Symbol.iterator]();!(r=(a=l.next()).done);r=!0)s()}catch(u){i=!0,o=u}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}},{key:"_createFormChildren",value:function(e){var t=this.createCollection();if(t.add(this.urlInputView),e.length){var n=new Hs;n.setTemplate({tag:"ul",children:this._manualDecoratorSwitches.map((function(e){return{tag:"li",children:[e],attributes:{class:["ck","ck-list__item"]}}})),attributes:{class:["ck","ck-reset","ck-list"]}}),t.add(n)}return t.add(this.saveButtonView),t.add(this.cancelButtonView),t}}]),t}(Hs),Yd='',$d='';n(76);var Gd=function(e){function t(e){var n;f(this,t),n=h(this,p(t).call(this,e));var r=e.t;return n.focusTracker=new vs,n.keystrokes=new ss,n.previewButtonView=n._createPreviewButton(),n.unlinkButtonView=n._createButton(r("bb"),Yd,"unlink"),n.editButtonView=n._createButton(r("bc"),$d,"edit"),n.set("href"),n._focusables=new xs,n._focusCycler=new Js({focusables:n._focusables,focusTracker:n.focusTracker,keystrokeHandler:n.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),n.setTemplate({tag:"div",attributes:{class:["ck","ck-link-actions"],tabindex:"-1"},children:[n.previewButtonView,n.editButtonView,n.unlinkButtonView]}),n}return v(t,e),d(t,[{key:"render",value:function(){var e=this;l(p(t.prototype),"render",this).call(this),[this.previewButtonView,this.editButtonView,this.unlinkButtonView].forEach((function(t){e._focusables.add(t),e.focusTracker.add(t.element)})),this.keystrokes.listenTo(this.element)}},{key:"focus",value:function(){this._focusCycler.focusFirst()}},{key:"_createButton",value:function(e,t,n){var r=new ll(this.locale);return r.set({label:e,icon:t,tooltip:!0}),r.delegate("execute").to(this,n),r}},{key:"_createPreviewButton",value:function(){var e=new ll(this.locale),t=this.bindTemplate,n=this.t;return e.set({withText:!0,tooltip:n("bd")}),e.extendTemplate({attributes:{class:["ck","ck-link-actions__preview"],href:t.to("href",(function(e){return e&&Uc(e)})),target:"_blank",rel:"noopener noreferrer"}}),e.bind("label").to(this,"href",(function(e){return e||n("be")})),e.bind("isEnabled").to(this,"href",(function(e){return!!e})),e.template.tag="a",e.template.eventListeners={},e}}]),t}(Hs),Qd="Ctrl+K",Kd=function(e){function t(){return f(this,t),h(this,p(t).apply(this,arguments))}return v(t,e),d(t,[{key:"init",value:function(){var e=this.editor;e.editing.view.addObserver(qd),this.actionsView=this._createActionsView(),this.formView=this._createFormView(),this._balloon=e.plugins.get(Rf),this._createToolbarLinkButton(),this._enableUserBalloonInteractions()}},{key:"destroy",value:function(){l(p(t.prototype),"destroy",this).call(this),this.formView.destroy()}},{key:"_createActionsView",value:function(){var e=this,t=this.editor,n=new Gd(t.locale),r=t.commands.get("link"),i=t.commands.get("unlink");return n.bind("href").to(r,"value"),n.editButtonView.bind("isEnabled").to(r),n.unlinkButtonView.bind("isEnabled").to(i),this.listenTo(n,"edit",(function(){e._addFormView()})),this.listenTo(n,"unlink",(function(){t.execute("unlink"),e._hideUI()})),n.keystrokes.set("Esc",(function(t,n){e._hideUI(),n()})),n.keystrokes.set(Qd,(function(t,n){e._addFormView(),n()})),n}},{key:"_createFormView",value:function(){var e=this,t=this.editor,n=t.commands.get("link"),r=new Wd(t.locale,n.manualDecorators);return r.urlInputView.bind("value").to(n,"value"),r.urlInputView.bind("isReadOnly").to(n,"isEnabled",(function(e){return!e})),r.saveButtonView.bind("isEnabled").to(n),this.listenTo(r,"submit",(function(){t.execute("link",r.urlInputView.inputView.element.value,r.getDecoratorSwitchesState()),e._closeFormView()})),this.listenTo(r,"cancel",(function(){e._closeFormView()})),r.keystrokes.set("Esc",(function(t,n){e._closeFormView(),n()})),r}},{key:"_createToolbarLinkButton",value:function(){var e=this,t=this.editor,n=t.commands.get("link"),r=t.t;t.keystrokes.set(Qd,(function(t,r){r(),n.isEnabled&&e._showUI(!0)})),t.ui.componentFactory.add("link",(function(t){var i=new ll(t);return i.isEnabled=!0,i.label=r("as"),i.icon='',i.keystroke=Qd,i.tooltip=!0,i.isToggleable=!0,i.bind("isEnabled").to(n,"isEnabled"),i.bind("isOn").to(n,"value",(function(e){return!!e})),e.listenTo(i,"execute",(function(){return e._showUI(!0)})),i}))}},{key:"_enableUserBalloonInteractions",value:function(){var e=this,t=this.editor.editing.view.document;this.listenTo(t,"click",(function(){e._getSelectedLinkElement()&&e._showUI()})),this.editor.keystrokes.set("Tab",(function(t,n){e._areActionsVisible&&!e.actionsView.focusTracker.isFocused&&(e.actionsView.focus(),n())}),{priority:"high"}),this.editor.keystrokes.set("Esc",(function(t,n){e._isUIVisible&&(e._hideUI(),n())})),pl({emitter:this.formView,activator:function(){return e._isUIInPanel},contextElements:[this._balloon.view.element],callback:function(){return e._hideUI()}})}},{key:"_addActionsView",value:function(){this._areActionsInPanel||this._balloon.add({view:this.actionsView,position:this._getBalloonPositionData()})}},{key:"_addFormView",value:function(){if(!this._isFormInPanel){var e=this.editor.commands.get("link");this._balloon.add({view:this.formView,position:this._getBalloonPositionData()}),this._balloon.visibleView===this.formView&&this.formView.urlInputView.select(),this.formView.urlInputView.inputView.element.value=e.value||""}}},{key:"_closeFormView",value:function(){var e=this.editor.commands.get("link");e.restoreManualDecoratorStates(),void 0!==e.value?this._removeFormView():this._hideUI()}},{key:"_removeFormView",value:function(){this._isFormInPanel&&(this.formView.saveButtonView.focus(),this._balloon.remove(this.formView),this.editor.editing.view.focus())}},{key:"_showUI",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.editor.commands.get("link").isEnabled&&(this._getSelectedLinkElement()?(this._areActionsVisible?this._addFormView():this._addActionsView(),e&&this._balloon.showStack("main")):(this._addActionsView(),e&&this._balloon.showStack("main"),this._addFormView()),this._startUpdatingUI())}},{key:"_hideUI",value:function(){if(this._isUIInPanel){var e=this.editor;this.stopListening(e.ui,"update"),this.stopListening(this._balloon,"change:visibleView"),e.editing.view.focus(),this._removeFormView(),this._balloon.remove(this.actionsView)}}},{key:"_startUpdatingUI",value:function(){var e=this,t=this.editor,n=t.editing.view.document,r=this._getSelectedLinkElement(),i=a(),o=function(){var t=e._getSelectedLinkElement(),n=a();r&&!t||!r&&n!==i?e._hideUI():e._isUIVisible&&e._balloon.updatePosition(e._getBalloonPositionData()),r=t,i=n};function a(){return n.selection.focus.getAncestors().reverse().find((function(e){return e.is("element")}))}this.listenTo(t.ui,"update",o),this.listenTo(this._balloon,"change:visibleView",o)}},{key:"_getBalloonPositionData",value:function(){var e=this.editor.editing.view,t=e.document,n=this._getSelectedLinkElement();return{target:n?e.domConverter.mapViewToDom(n):e.domConverter.viewRangeToDom(t.selection.getFirstRange())}}},{key:"_getSelectedLinkElement",value:function(){var e=this.editor.editing.view,t=e.document.selection;if(t.isCollapsed)return Jd(t.getFirstPosition());var n=t.getFirstRange().getTrimmed(),r=Jd(n.start),i=Jd(n.end);return r&&r==i&&e.createRangeIn(r).getTrimmed().isEqual(n)?r:null}},{key:"_isFormInPanel",get:function(){return this._balloon.hasView(this.formView)}},{key:"_areActionsInPanel",get:function(){return this._balloon.hasView(this.actionsView)}},{key:"_areActionsVisible",get:function(){return this._balloon.visibleView===this.actionsView}},{key:"_isUIInPanel",get:function(){return this._isFormInPanel||this._areActionsInPanel}},{key:"_isUIVisible",get:function(){return this._balloon.visibleView==this.formView||this._areActionsVisible}}],[{key:"requires",get:function(){return[Rf]}},{key:"pluginName",get:function(){return"LinkUI"}}]),t}(xl);function Jd(e){return e.getAncestors().find((function(e){return function(e){return e.is("attributeElement")&&!!e.getCustomProperty("link")}(e)}))}var Xd=function(e){function t(e,n){var r;return f(this,t),(r=h(this,p(t).call(this,e))).type=n,r}return v(t,e),d(t,[{key:"refresh",value:function(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}},{key:"execute",value:function(){var e=this,t=this.editor.model,n=t.document,r=Array.from(n.selection.getSelectedBlocks()).filter((function(e){return eh(e,t.schema)})),i=!0===this.value;t.change((function(t){if(i){for(var n=r[r.length-1].nextSibling,o=Number.POSITIVE_INFINITY,a=[];n&&"listItem"==n.name&&0!==n.getAttribute("listIndent");){var s=n.getAttribute("listIndent");s=n;)o>i.getAttribute("listIndent")&&(o=i.getAttribute("listIndent")),i.getAttribute("listIndent")==o&&e[t?"unshift":"push"](i),i=i[t?"previousSibling":"nextSibling"]}function eh(e,t){return t.checkChild(e.parent,"listItem")&&!t.isObject(e)}var th=function(e){function t(e,n){var r;return f(this,t),(r=h(this,p(t).call(this,e)))._indentBy="forward"==n?1:-1,r}return v(t,e),d(t,[{key:"refresh",value:function(){this.isEnabled=this._checkEnabled()}},{key:"execute",value:function(){var e=this,t=this.editor.model,n=t.document,r=Array.from(n.selection.getSelectedBlocks());t.change((function(t){for(var n=r[r.length-1],i=n.nextSibling;i&&"listItem"==i.name&&i.getAttribute("listIndent")>n.getAttribute("listIndent");)r.push(i),i=i.nextSibling;e._indentBy<0&&(r=r.reverse());var o=!0,a=!1,s=void 0;try{for(var l,u=r[Symbol.iterator]();!(o=(l=u.next()).done);o=!0){var c=l.value,f=c.getAttribute("listIndent")+e._indentBy;f<0?t.rename(c,"paragraph"):t.setAttribute("listIndent",f,c)}}catch(d){a=!0,s=d}finally{try{o||null==u.return||u.return()}finally{if(a)throw s}}}))}},{key:"_checkEnabled",value:function(){var e=Uu(this.editor.model.document.selection.getSelectedBlocks());if(!e||!e.is("listItem"))return!1;if(this._indentBy>0){for(var t=e.getAttribute("listIndent"),n=e.getAttribute("listType"),r=e.previousSibling;r&&r.is("listItem")&&r.getAttribute("listIndent")>=t;){if(r.getAttribute("listIndent")==t)return r.getAttribute("listType")==n;r=r.previousSibling}return!1}return!0}}]),t}(Al);function nh(e,t,n,r){var i=t.parent,o=n.mapper,a=n.writer,s=o.toViewPosition(r.createPositionBefore(e)),l=oh(e.previousSibling,{sameIndent:!0,smallerIndent:!0,listIndent:e.getAttribute("listIndent")}),u=e.previousSibling;if(l&&l.getAttribute("listIndent")==e.getAttribute("listIndent")){var c=o.toViewElement(l);s=a.breakContainer(a.createPositionAfter(c))}else s=u&&"listItem"==u.name?o.toViewPosition(r.createPositionAt(u,"end")):o.toViewPosition(r.createPositionBefore(e));if(s=ih(s),a.insert(s,i),u&&"listItem"==u.name){var f=o.toViewElement(u),d=a.createRange(a.createPositionAt(f,0),s).getWalker({ignoreElementEnd:!0}),h=!0,p=!1,v=void 0;try{for(var m,g=d[Symbol.iterator]();!(h=(m=g.next()).done);h=!0){var y=m.value;if(y.item.is("li")){var b=a.breakContainer(a.createPositionBefore(y.item)),k=y.item.parent,w=a.createPositionAt(t,"end");rh(a,w.nodeBefore,w.nodeAfter),a.move(a.createRangeOn(k),w),d.position=b}}}catch(O){p=!0,v=O}finally{try{h||null==g.return||g.return()}finally{if(p)throw v}}}else{var _=i.nextSibling;if(_&&(_.is("ul")||_.is("ol"))){var x=null,T=!0,C=!1,S=void 0;try{for(var E,A=_.getChildren()[Symbol.iterator]();!(T=(E=A.next()).done);T=!0){var P=E.value,M=o.toModelElement(P);if(!(M&&M.getAttribute("listIndent")>e.getAttribute("listIndent")))break;x=P}}catch(O){C=!0,S=O}finally{try{T||null==A.return||A.return()}finally{if(C)throw S}}x&&(a.breakContainer(a.createPositionAfter(x)),a.move(a.createRangeOn(x.parent),a.createPositionAt(t,"end")))}}rh(a,i,i.nextSibling),rh(a,i.previousSibling,i)}function rh(e,t,n){return!t||!n||"ul"!=t.name&&"ol"!=t.name?null:t.name!=n.name||t.getAttribute("class")!==n.getAttribute("class")?null:e.mergeContainers(e.createPositionAfter(t))}function ih(e){return e.getLastMatchingPosition((function(e){return e.item.is("uiElement")}))}function oh(e,t){for(var n=!!t.sameIndent,r=!!t.smallerIndent,i=t.listIndent,o=e;o&&"listItem"==o.name;){var a=o.getAttribute("listIndent");if(n&&i==a||r&&i>a)return o;o=o.previousSibling}return null}function ah(e,t,n,r){e.ui.componentFactory.add(t,(function(i){var o=e.commands.get(t),a=new ll(i);return a.set({label:n,icon:r,tooltip:!0,isToggleable:!0}),a.bind("isOn","isEnabled").to(o,"value","isEnabled"),a.on("execute",(function(){return e.execute(t)})),a}))}function sh(){var e=!this.isEmpty&&("ul"==this.getChild(0).name||"ol"==this.getChild(0).name);return this.isEmpty||e?0:sn.call(this)}function lh(e){return function(t,n,r){var i=r.consumable;if(i.test(n.item,"insert")&&i.test(n.item,"attribute:listType")&&i.test(n.item,"attribute:listIndent")){i.consume(n.item,"insert"),i.consume(n.item,"attribute:listType"),i.consume(n.item,"attribute:listIndent");var o=n.item;nh(o,function(e,t){var n=t.mapper,r=t.writer,i="numbered"==e.getAttribute("listType")?"ol":"ul",o=function(e){var t=e.createContainerElement("li");return t.getFillerOffset=sh,t}(r),a=r.createContainerElement(i,null);return r.insert(r.createPositionAt(a,0),o),n.bindElements(e,o),o}(o,r),r,e)}}}function uh(e,t,n){if(n.consumable.consume(t.item,"attribute:listType")){var r=n.mapper.toViewElement(t.item),i=n.writer;i.breakContainer(i.createPositionBefore(r)),i.breakContainer(i.createPositionAfter(r));var o=r.parent,a="numbered"==t.attributeNewValue?"ol":"ul";i.rename(a,o)}}function ch(e,t,n){var r=n.mapper.toViewElement(t.item).parent,i=n.writer;rh(i,r,r.nextSibling),rh(i,r.previousSibling,r);var o=!0,a=!1,s=void 0;try{for(var l,u=t.item.getChildren()[Symbol.iterator]();!(o=(l=u.next()).done);o=!0){var c=l.value;n.consumable.consume(c,"insert")}}catch(f){a=!0,s=f}finally{try{o||null==u.return||u.return()}finally{if(a)throw s}}}function fh(e,t,n){if("listItem"!=t.item.name){for(var r=n.mapper.toViewPosition(t.range.start),i=n.writer,o=[];("ul"==r.parent.name||"ol"==r.parent.name)&&"li"==(r=i.breakContainer(r)).parent.name;){var a=r,s=i.createPositionAt(r.parent,"end");if(!a.isEqual(s)){var l=i.remove(i.createRange(a,s));o.push(l)}r=i.createPositionAfter(r.parent)}if(o.length>0){for(var u=0;u0){var f=rh(i,c,c.nextSibling);f&&f.parent==c&&r.offset--}}rh(i,r.nodeBefore,r.nodeAfter)}}}function dh(e,t,n){var r=n.mapper.toViewPosition(t.position),i=r.nodeBefore,o=r.nodeAfter;rh(n.writer,i,o)}function hh(e,t,n){if(n.consumable.consume(t.viewItem,{name:!0})){var r=n.writer,i=r.createElement("listItem"),o=function(e){for(var t=0,n=e.parent;n;){if(n.is("li"))t++;else{var r=n.previousSibling;r&&r.is("li")&&t++}n=n.parent}return t}(t.viewItem);r.setAttribute("listIndent",o,i);var a=t.viewItem.parent&&"ol"==t.viewItem.parent.name?"numbered":"bulleted";r.setAttribute("listType",a,i);var s=n.splitToAllowedParent(i,t.modelCursor);if(!s)return;r.insert(i,s.position);var l=function(e,t,n){var r=n.writer,i=n.schema,o=r.createPositionAfter(e),a=!0,s=!1,l=void 0;try{for(var u,c=t[Symbol.iterator]();!(a=(u=c.next()).done);a=!0){var f=u.value;if("ul"==f.name||"ol"==f.name)o=n.convertItem(f,o).modelCursor;else{var d=n.convertItem(f,r.createPositionAt(e,"end")),h=d.modelRange.start.nodeAfter;h&&h.is("element")&&!i.checkChild(e,h.name)&&(e=d.modelCursor.parent.is("listItem")?d.modelCursor.parent:yh(d.modelCursor),o=r.createPositionAfter(e))}}}catch(p){s=!0,l=p}finally{try{a||null==c.return||c.return()}finally{if(s)throw l}}return o}(i,t.viewItem.getChildren(),n);t.modelRange=r.createRange(t.modelCursor,l),s.cursorParent?t.modelCursor=r.createPositionAt(s.cursorParent,0):t.modelCursor=t.modelRange.end}}function ph(e,t,n){if(n.consumable.test(t.viewItem,{name:!0}))for(var r=0,i=Array.from(t.viewItem.getChildren());r0)for(;a&&a.is("listItem");)a._setAttribute("listIndent",a.getAttribute("listIndent")+u),a=a.nextSibling}}}function yh(e){var t,n=new Zi({startPosition:e});do{t=n.next()}while(!t.value.item.is("listItem"));return t.value.item}function bh(e,t,n,r,i,o){var a,s=oh(t.nodeBefore,{sameIndent:!0,smallerIndent:!0,listIndent:e,foo:"b"}),l=i.mapper,c=i.writer,f=s?s.getAttribute("listIndent"):null;if(s)if(f==e){var d=l.toViewElement(s).parent;a=c.createPositionAfter(d)}else{var h=o.createPositionAt(s,"end");a=l.toViewPosition(h)}else a=n;a=ih(a);for(var p=0,v=u(r.getChildren());pn){var a=void 0;null===r?(r=o-n,a=n):(r>o&&(r=o),a=o-r),t.setAttribute("listIndent",a,e),i=!0}else r=null,n=e.getAttribute("listIndent")+1;e=e.nextSibling}}function C(e){for(var n=[],r=null;e&&e.is("listItem");){var o=e.getAttribute("listIndent");if(r&&r.getAttribute("listIndent")>o&&(n=n.slice(0,o+1)),0!=o)if(n[o]){var a=n[o];e.getAttribute("listType")!=a&&(t.setAttribute("listType",a,e),i=!0)}else n[o]=e.getAttribute("listType");r=e,e=e.nextSibling}}}(t.model,e)})),i.mapper.registerViewToModelLength("li",_h),r.mapper.registerViewToModelLength("li",_h),i.mapper.on("modelToViewPosition",mh(i.view)),i.mapper.on("viewToModelPosition",(n=t.model,function(e,t){var r=t.viewPosition,i=r.parent,o=t.mapper;if("ul"==i.name||"ol"==i.name){if(r.isAtEnd){var a=o.toModelElement(r.nodeBefore),s=o.getModelLength(r.nodeBefore);t.modelPosition=n.createPositionBefore(a).getShiftedBy(s)}else{var l=o.toModelElement(r.nodeAfter);t.modelPosition=n.createPositionBefore(l)}e.stop()}else if("li"==i.name&&r.nodeBefore&&("ul"==r.nodeBefore.name||"ol"==r.nodeBefore.name)){for(var u=o.toModelElement(i),c=1,f=r.nodeBefore;f&&kh(f);)c+=o.getModelLength(f),f=f.previousSibling;t.modelPosition=n.createPositionBefore(u).getShiftedBy(c),e.stop()}})),r.mapper.on("modelToViewPosition",mh(i.view)),t.conversion.for("editingDowncast").add((function(e){e.on("insert",fh,{priority:"high"}),e.on("insert:listItem",lh(t.model)),e.on("attribute:listType:listItem",uh,{priority:"high"}),e.on("attribute:listType:listItem",ch,{priority:"low"}),e.on("attribute:listIndent:listItem",function(e){return function(t,n,r){if(r.consumable.consume(n.item,"attribute:listIndent")){var i=r.mapper.toViewElement(n.item),o=r.writer;o.breakContainer(o.createPositionBefore(i)),o.breakContainer(o.createPositionAfter(i));var a=i.parent,s=a.previousSibling,l=o.createRangeOn(a);o.remove(l),s&&s.nextSibling&&rh(o,s,s.nextSibling),bh(n.attributeOldValue+1,n.range.start,l.start,i,r,e),nh(n.item,i,r,e);var u=!0,c=!1,f=void 0;try{for(var d,h=n.item.getChildren()[Symbol.iterator]();!(u=(d=h.next()).done);u=!0){var p=d.value;r.consumable.consume(p,"insert")}}catch(v){c=!0,f=v}finally{try{u||null==h.return||h.return()}finally{if(c)throw f}}}}}(t.model)),e.on("remove:listItem",function(e){return function(t,n,r){var i=r.mapper.toViewPosition(n.position).getLastMatchingPosition((function(e){return!e.item.is("li")})).nodeAfter,o=r.writer;o.breakContainer(o.createPositionBefore(i)),o.breakContainer(o.createPositionAfter(i));var a=i.parent,s=a.previousSibling,l=o.createRangeOn(a),u=o.remove(l);s&&s.nextSibling&&rh(o,s,s.nextSibling),bh(r.mapper.toModelElement(i).getAttribute("listIndent")+1,n.position,l.start,i,r,e);var c=!0,f=!1,d=void 0;try{for(var h,p=o.createRangeIn(u).getItems()[Symbol.iterator]();!(c=(h=p.next()).done);c=!0){var v=h.value;r.mapper.unbindViewElement(v)}}catch(m){f=!0,d=m}finally{try{c||null==p.return||p.return()}finally{if(f)throw d}}t.stop()}}(t.model)),e.on("remove",dh,{priority:"low"})})),t.conversion.for("dataDowncast").add((function(e){e.on("insert",fh,{priority:"high"}),e.on("insert:listItem",lh(t.model))})),t.conversion.for("upcast").add((function(e){e.on("element:ul",ph,{priority:"high"}),e.on("element:ol",ph,{priority:"high"}),e.on("element:li",vh,{priority:"high"}),e.on("element:li",hh)})),t.model.on("insertContent",gh,{priority:"high"}),t.commands.add("numberedList",new Xd(t,"numbered")),t.commands.add("bulletedList",new Xd(t,"bulleted")),t.commands.add("indentList",new th(t,"forward")),t.commands.add("outdentList",new th(t,"backward"));var o=i.view.document;this.listenTo(o,"enter",(function(t,n){var r=e.editor.model.document,i=r.selection.getLastPosition().parent;r.selection.isCollapsed&&"listItem"==i.name&&i.isEmpty&&(e.editor.execute("outdentList"),n.preventDefault(),t.stop())})),this.listenTo(o,"delete",(function(t,n){if("backward"===n.direction){var r=e.editor.model.document.selection;if(r.isCollapsed){var i=r.getFirstPosition();if(i.isAtStart){var o=i.parent;"listItem"===o.name&&(o.previousSibling&&"listItem"===o.previousSibling.name||(e.editor.execute("outdentList"),n.preventDefault(),t.stop()))}}}}),{priority:"high"});var a=function(t){return function(n,r){e.editor.commands.get(t).isEnabled&&(e.editor.execute(t),r())}};t.keystrokes.set("Tab",a("indentList")),t.keystrokes.set("Shift+Tab",a("outdentList"))}},{key:"afterInit",value:function(){var e=this.editor.commands,t=e.get("indent"),n=e.get("outdent");t&&t.registerChildCommand(e.get("indentList")),n&&n.registerChildCommand(e.get("outdentList"))}}],[{key:"pluginName",get:function(){return"ListEditing"}},{key:"requires",get:function(){return[ld]}}]),t}(xl);function _h(e){var t=1,n=!0,r=!1,i=void 0;try{for(var o,a=e.getChildren()[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;if("ul"==s.name||"ol"==s.name){var l=!0,u=!1,c=void 0;try{for(var f,d=s.getChildren()[Symbol.iterator]();!(l=(f=d.next()).done);l=!0)t+=_h(f.value)}catch(h){u=!0,c=h}finally{try{l||null==d.return||d.return()}finally{if(u)throw c}}}}}catch(h){r=!0,i=h}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}return t}var xh=function(e){function t(){return f(this,t),h(this,p(t).apply(this,arguments))}return v(t,e),d(t,[{key:"init",value:function(){var e=this.editor.t;ah(this.editor,"numberedList",e("ae"),''),ah(this.editor,"bulletedList",e("af"),'')}}]),t}(xl);function Th(e,t){return function(e){e.on("attribute:url:media",n)};function n(n,r,i){if(i.consumable.consume(r.item,n.name)){var o=r.attributeNewValue,a=i.writer,s=i.mapper.toViewElement(r.item);a.remove(a.createRangeIn(s));var l=e.getMediaViewElement(a,o,t);a.insert(a.createPositionAt(s,0),l)}}}function Ch(e,t,n,r){var i=e.createContainerElement("figure",{class:"media"});return i.getFillerOffset=Ah,e.insert(e.createPositionAt(i,0),t.getMediaViewElement(e,n,r)),i}function Sh(e){var t=e.getSelectedElement();return t&&t.is("media")?t:null}function Eh(e,t,n){e.change((function(r){var i=r.createElement("media",{url:t});e.insertContent(i,n),r.setSelection(i,"on")}))}function Ah(){return null}var Ph=function(e){function t(){return f(this,t),h(this,p(t).apply(this,arguments))}return v(t,e),d(t,[{key:"refresh",value:function(){var e=this.editor.model,t=e.document.selection,n=e.schema,r=t.getFirstPosition(),i=Sh(t),o=r.parent;o!=o.root&&(o=o.parent),this.value=i?i.getAttribute("url"):null,this.isEnabled=n.checkChild(o,"media")}},{key:"execute",value:function(e){var t=this.editor.model,n=t.document.selection,r=Sh(n);if(r)t.change((function(t){t.setAttribute("url",e,r)}));else{var i=uc(n,t);Eh(t,e,i)}}}]),t}(Al),Mh=function(){function e(t,n){f(this,e);var r=n.providers,i=n.extraProviders||[],o=new Set(n.removeProviders),a=r.concat(i).filter((function(e){var t=e.name;return t?!o.has(t):(console.warn(Object(It.a)("media-embed-no-provider-name: The configured media provider has no name and cannot be used."),{provider:e}),!1)}));this.locale=t,this.providerDefinitions=a}return d(e,[{key:"hasMedia",value:function(e){return!!this._getMedia(e)}},{key:"getMediaViewElement",value:function(e,t,n){return this._getMedia(t).getViewElement(e,n)}},{key:"_getMedia",value:function(e){if(!e)return new Oh(this.locale);e=e.trim();var t=!0,n=!1,r=void 0;try{for(var i,o=this.providerDefinitions[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value,s=a.html,l=a.url;Array.isArray(l)||(l=[l]);var u=!0,c=!1,f=void 0;try{for(var d,h=l[Symbol.iterator]();!(u=(d=h.next()).done);u=!0){var p=d.value,v=this._getUrlMatches(e,p);if(v)return new Oh(this.locale,e,v,s)}}catch(m){c=!0,f=m}finally{try{u||null==h.return||h.return()}finally{if(c)throw f}}}}catch(m){n=!0,r=m}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}return null}},{key:"_getUrlMatches",value:function(e,t){var n=e.match(t);if(n)return n;var r=e.replace(/^https?:\/\//,"");return(n=r.match(t))||(n=(r=r.replace(/^www\./,"")).match(t))||null}}]),e}(),Oh=function(){function e(t,n,r,i){f(this,e),this.url=this._getValidUrl(n),this._t=t.t,this._match=r,this._previewRenderer=i}return d(e,[{key:"getViewElement",value:function(e,t){var n={};if(t.renderForEditingView||t.renderMediaPreview&&this.url&&this._previewRenderer){this.url&&(n["data-oembed-url"]=this.url),t.renderForEditingView&&(n.class="ck-media__wrapper");var r=this._getPreviewHtml(t);return e.createUIElement("div",n,(function(e){var t=this.toDomElement(e);return t.innerHTML=r,t}))}return this.url&&(n.url=this.url),e.createEmptyElement("oembed",n)}},{key:"_getPreviewHtml",value:function(e){return this._previewRenderer?this._previewRenderer(this._match):this.url&&e.renderForEditingView?this._getPlaceholderHtml():""}},{key:"_getPlaceholderHtml",value:function(){var e=new sl,t=new al;return e.text=this._t("Open media in new tab"),t.content='',t.viewBox="0 0 64 42",new Ts({tag:"div",attributes:{class:"ck ck-reset_all ck-media__placeholder"},children:[{tag:"div",attributes:{class:"ck-media__placeholder__icon"},children:[t]},{tag:"a",attributes:{class:"ck-media__placeholder__url",target:"_blank",rel:"noopener noreferrer",href:this.url},children:[{tag:"span",attributes:{class:"ck-media__placeholder__url__text"},children:[this.url]},e]}]}).render().outerHTML}},{key:"_getValidUrl",value:function(e){return e?e.match(/^https?/)?e:"https://"+e:null}}]),e}();n(78);var Nh=function(e){function t(e){var n;return f(this,t),n=h(this,p(t).call(this,e)),e.config.define("mediaEmbed",{providers:[{name:"dailymotion",url:/^dailymotion\.com\/video\/(\w+)/,html:function(e){return''+'
'}},{name:"spotify",url:[/^open\.spotify\.com\/(artist\/\w+)/,/^open\.spotify\.com\/(album\/\w+)/,/^open\.spotify\.com\/(track\/\w+)/],html:function(e){return''+'
'}},{name:"youtube",url:[/^(?:m\.)?youtube\.com\/watch\?v=([\w-]+)/,/^(?:m\.)?youtube\.com\/v\/([\w-]+)/,/^youtube\.com\/embed\/([\w-]+)/,/^youtu\.be\/([\w-]+)/],html:function(e){return''+'
'}},{name:"vimeo",url:[/^vimeo\.com\/(\d+)/,/^vimeo\.com\/[^/]+\/[^/]+\/video\/(\d+)/,/^vimeo\.com\/album\/[^/]+\/video\/(\d+)/,/^vimeo\.com\/channels\/[^/]+\/(\d+)/,/^vimeo\.com\/groups\/[^/]+\/videos\/(\d+)/,/^vimeo\.com\/ondemand\/[^/]+\/(\d+)/,/^player\.vimeo\.com\/video\/(\d+)/],html:function(e){return''+'
'}},{name:"instagram",url:/^instagram\.com\/p\/(\w+)/},{name:"twitter",url:/^twitter\.com/},{name:"googleMaps",url:/^google\.com\/maps/},{name:"flickr",url:/^flickr\.com/},{name:"facebook",url:/^facebook\.com/}]}),n.registry=new Mh(e.locale,e.config.get("mediaEmbed")),n}return v(t,e),d(t,null,[{key:"pluginName",get:function(){return"MediaEmbedEditing"}}]),d(t,[{key:"init",value:function(){var e=this.editor,t=e.model.schema,n=e.t,r=e.conversion,i=e.config.get("mediaEmbed.previewsInData"),o=this.registry;e.commands.add("mediaEmbed",new Ph(e)),t.register("media",{isObject:!0,isBlock:!0,allowWhere:"$block",allowAttributes:["url"]}),r.for("dataDowncast").elementToElement({model:"media",view:function(e,t){var n=e.getAttribute("url");return Ch(t,o,n,{renderMediaPreview:n&&i})}}),r.for("dataDowncast").add(Th(o,{renderMediaPreview:i})),r.for("editingDowncast").elementToElement({model:"media",view:function(e,t){var r=e.getAttribute("url");return function(e,t,n){return t.setCustomProperty("media",!0,e),ac(e,t,{label:n})}(Ch(t,o,r,{renderForEditingView:!0}),t,n("ar"))}}),r.for("editingDowncast").add(Th(o,{renderForEditingView:!0})),r.for("upcast").elementToElement({view:{name:"oembed",attributes:{url:!0}},model:function(e,t){var n=e.getAttribute("url");if(o.hasMedia(n))return t.createElement("media",{url:n})}}).elementToElement({view:{name:"div",attributes:{"data-oembed-url":!0}},model:function(e,t){var n=e.getAttribute("data-oembed-url");if(o.hasMedia(n))return t.createElement("media",{url:n})}})}}]),t}(xl),Ih=/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w.-]+)+[\w\-._~:/?#[\]@!$&'()*+,;=]+$/,Dh=function(e){function t(e){var n;return f(this,t),(n=h(this,p(t).call(this,e)))._timeoutId=null,n._positionToInsert=null,n}return v(t,e),d(t,null,[{key:"requires",get:function(){return[El,bu]}},{key:"pluginName",get:function(){return"AutoMediaEmbed"}}]),d(t,[{key:"init",value:function(){var e=this,t=this.editor,n=t.model.document;this.listenTo(t.plugins.get(El),"inputTransformation",(function(){var t=n.selection.getFirstRange(),r=Wa.fromPosition(t.start);r.stickiness="toPrevious";var i=Wa.fromPosition(t.end);i.stickiness="toNext",n.once("change:data",(function(){e._embedMediaBetweenPositions(r,i),r.detach(),i.detach()}),{priority:"high"})})),t.commands.get("undo").on("execute",(function(){e._timeoutId&&(Dr.window.clearTimeout(e._timeoutId),e._positionToInsert.detach(),e._timeoutId=null,e._positionToInsert=null)}),{priority:"high"})}},{key:"_embedMediaBetweenPositions",value:function(e,t){var n=this,r=this.editor,i=r.plugins.get(Nh).registry,o=new po(e,t),a=o.getWalker({ignoreElementEnd:!0}),s="",l=!0,u=!1,c=void 0;try{for(var f,d=a[Symbol.iterator]();!(l=(f=d.next()).done);l=!0){var h=f.value;h.item.is("textProxy")&&(s+=h.item.data)}}catch(p){u=!0,c=p}finally{try{l||null==d.return||d.return()}finally{if(u)throw c}}(s=s.trim()).match(Ih)&&i.hasMedia(s)&&r.commands.get("mediaEmbed").isEnabled&&(this._positionToInsert=Wa.fromPosition(e),this._timeoutId=Dr.window.setTimeout((function(){r.model.change((function(e){var t;n._timeoutId=null,e.remove(o),"$graveyard"!==n._positionToInsert.root.rootName&&(t=n._positionToInsert),Eh(r.model,s,t),n._positionToInsert.detach(),n._positionToInsert=null}))}),100))}}]),t}(xl);n(80);var Rh=function(e){function t(e,n){var r;f(this,t),r=h(this,p(t).call(this,n));var i=n.t;return r.focusTracker=new vs,r.keystrokes=new ss,r.urlInputView=r._createUrlInput(),r.saveButtonView=r._createButton(i("bf"),xf,"ck-button-save"),r.saveButtonView.type="submit",r.cancelButtonView=r._createButton(i("bg"),Tf,"ck-button-cancel","cancel"),r._focusables=new xs,r._focusCycler=new Js({focusables:r._focusables,focusTracker:r.focusTracker,keystrokeHandler:r.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),r._validators=e,r.setTemplate({tag:"form",attributes:{class:["ck","ck-media-form"],tabindex:"-1"},children:[r.urlInputView,r.saveButtonView,r.cancelButtonView]}),r}return v(t,e),d(t,[{key:"render",value:function(){var e=this;l(p(t.prototype),"render",this).call(this),_f({view:this}),[this.urlInputView,this.saveButtonView,this.cancelButtonView].forEach((function(t){e._focusables.add(t),e.focusTracker.add(t.element)})),this.keystrokes.listenTo(this.element);var n=function(e){return e.stopPropagation()};this.keystrokes.set("arrowright",n),this.keystrokes.set("arrowleft",n),this.keystrokes.set("arrowup",n),this.keystrokes.set("arrowdown",n),this.listenTo(this.urlInputView.element,"selectstart",(function(e,t){t.stopPropagation()}),{priority:"high"})}},{key:"focus",value:function(){this._focusCycler.focusFirst()}},{key:"isValid",value:function(){this.resetFormStatus();var e=!0,t=!1,n=void 0;try{for(var r,i=this._validators[Symbol.iterator]();!(e=(r=i.next()).done);e=!0){var o=(0,r.value)(this);if(o)return this.urlInputView.errorText=o,!1}}catch(a){t=!0,n=a}finally{try{e||null==i.return||i.return()}finally{if(t)throw n}}return!0}},{key:"resetFormStatus",value:function(){this.urlInputView.errorText=null,this.urlInputView.infoText=this._urlInputViewInfoDefault}},{key:"_createUrlInput",value:function(){var e=this,t=this.locale.t,n=new kf(this.locale,wf),r=n.inputView;return this._urlInputViewInfoDefault=t("bh"),this._urlInputViewInfoTip=t("bi"),n.label=t("bj"),n.infoText=this._urlInputViewInfoDefault,r.placeholder="https://example.com",r.on("input",(function(){n.infoText=r.element.value?e._urlInputViewInfoTip:e._urlInputViewInfoDefault})),n}},{key:"_createButton",value:function(e,t,n,r){var i=new ll(this.locale);return i.set({label:e,icon:t,tooltip:!0}),i.extendTemplate({attributes:{class:n}}),r&&i.delegate("execute").to(this,r),i}},{key:"url",get:function(){return this.urlInputView.inputView.element.value.trim()},set:function(e){this.urlInputView.inputView.element.value=e.trim()}}]),t}(Hs),jh=function(e){function t(){return f(this,t),h(this,p(t).apply(this,arguments))}return v(t,e),d(t,[{key:"init",value:function(){var e=this,t=this.editor,n=t.commands.get("mediaEmbed"),r=t.plugins.get(Nh).registry;this.form=new Rh(function(e,t){return[function(t){if(!t.url.length)return e("ap")},function(n){if(!t.hasMedia(n.url))return e("aq")}]}(t.t,r),t.locale),t.ui.componentFactory.add("mediaEmbed",(function(r){var i=vl(r);return e._setUpDropdown(i,e.form,n,t),e._setUpForm(e.form,i,n),i}))}},{key:"_setUpDropdown",value:function(e,t,n){var r=this.editor,i=r.t,o=e.buttonView;function a(){r.editing.view.focus(),e.isOpen=!1}e.bind("isEnabled").to(n),e.panelView.children.add(t),o.set({label:i("ao"),icon:'',tooltip:!0}),o.on("open",(function(){t.url=n.value||"",t.urlInputView.select(),t.focus()}),{priority:"low"}),e.on("submit",(function(){t.isValid()&&(r.execute("mediaEmbed",t.url),a())})),e.on("change:isOpen",(function(){return t.resetFormStatus()})),e.on("cancel",(function(){return a()}))}},{key:"_setUpForm",value:function(e,t,n){e.delegate("submit","cancel").to(t),e.urlInputView.bind("value").to(n,"value"),e.urlInputView.bind("isReadOnly").to(n,"isEnabled",(function(e){return!e})),e.saveButtonView.bind("isEnabled").to(n)}}],[{key:"requires",get:function(){return[Nh]}},{key:"pluginName",get:function(){return"MediaEmbedUI"}}]),t}(xl);function Lh(e){var t={},n=e.getStyle("mso-list");if(n){var r=n.match(/(^|\s+)l(\d+)/i),i=n.match(/\s*lfo(\d+)/i),o=n.match(/\s*level(\d+)/i);r&&i&&o&&(t.id=r[2],t.order=i[1],t.indent=o[1])}return t}n(82);var Fh=/id=("|')docs-internal-guid-[-0-9a-f]+("|')/i,zh=function(){function e(){f(this,e)}return d(e,[{key:"isActive",value:function(e){return Fh.test(e)}},{key:"execute",value:function(e){var t=new ed;!function(e,t){var n=!0,r=!1,i=void 0;try{for(var o,a=e.getChildren()[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;if(s.is("b")&&"normal"===s.getStyle("font-weight")){var l=e.getChildIndex(s);t.remove(s),t.insertChild(l,s.getChildren(),e)}}}catch(u){r=!0,i=u}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}}(e.content,t),function(e,t){var n=!0,r=!1,i=void 0;try{for(var o,a=t.createRangeIn(e)[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value.item;if(s.is("li")){var l=s.getChild(0);l.is("p")&&t.unwrapElement(l)}}}catch(u){r=!0,i=u}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}}(e.content,t)}}]),e}();function Vh(e){return e.replace(/(\s+)<\/span>/g,(function(e,t){return 1===t.length?" ":Array(t.length+1).join("\xa0 ").substr(0,t.length)}))}var Bh=//i,Uh=/xmlns:o="urn:schemas-microsoft-com/i,Hh=function(){function e(){f(this,e)}return d(e,[{key:"isActive",value:function(e){return Bh.test(e)||Uh.test(e)}},{key:"execute",value:function(e){var t=function(e){var t=new DOMParser,n=function(e){return Vh(Vh(e)).replace(/([\s]*?)[\r\n]+(\s*<\/span>)/g,"$1$2").replace(/<\/span>/g,"").replace(/ <\//g,"\xa0").replace(/ <\/o:p>/g,"\xa0").replace(/( |\u00A0)<\/o:p>/g,"").replace(/>(\s*[\r\n]\s*)<")}(function(e){var t=e.match(/<\/body>(.*?)(<\/html>|$)/);return t&&t[1]&&(e=e.slice(0,t.index)+e.slice(t.index).replace(t[1],"")),e}(e=e.replace(/';\n }\n\n /* Stringify, in case dirty is an object */\n if (typeof dirty !== 'string' && !_isNode(dirty)) {\n // eslint-disable-next-line no-negated-condition\n if (typeof dirty.toString !== 'function') {\n throw typeErrorCreate('toString is not a function');\n } else {\n dirty = dirty.toString();\n if (typeof dirty !== 'string') {\n throw typeErrorCreate('dirty is not a string, aborting');\n }\n }\n }\n\n /* Check we can run. Otherwise fall back or ignore */\n if (!DOMPurify.isSupported) {\n if (\n typeof window.toStaticHTML === 'object' ||\n typeof window.toStaticHTML === 'function'\n ) {\n if (typeof dirty === 'string') {\n return window.toStaticHTML(dirty);\n }\n\n if (_isNode(dirty)) {\n return window.toStaticHTML(dirty.outerHTML);\n }\n }\n\n return dirty;\n }\n\n /* Assign config vars */\n if (!SET_CONFIG) {\n _parseConfig(cfg);\n }\n\n /* Clean up removed elements */\n DOMPurify.removed = [];\n\n /* Check if dirty is correctly typed for IN_PLACE */\n if (typeof dirty === 'string') {\n IN_PLACE = false;\n }\n\n if (IN_PLACE) {\n /* No special handling necessary for in-place sanitization */\n } else if (dirty instanceof Node) {\n /* If dirty is a DOM element, append to an empty document to avoid\n elements being stripped by the parser */\n body = _initDocument('');\n importedNode = body.ownerDocument.importNode(dirty, true);\n if (importedNode.nodeType === 1 && importedNode.nodeName === 'BODY') {\n /* Node is already a body, use as is */\n body = importedNode;\n } else if (importedNode.nodeName === 'HTML') {\n body = importedNode;\n } else {\n // eslint-disable-next-line unicorn/prefer-node-append\n body.appendChild(importedNode);\n }\n } else {\n /* Exit directly if we have nothing to do */\n if (\n !RETURN_DOM &&\n !SAFE_FOR_TEMPLATES &&\n !WHOLE_DOCUMENT &&\n RETURN_TRUSTED_TYPE &&\n dirty.indexOf('<') === -1\n ) {\n return trustedTypesPolicy\n ? trustedTypesPolicy.createHTML(dirty)\n : dirty;\n }\n\n /* Initialize the document to work on */\n body = _initDocument(dirty);\n\n /* Check we have a DOM node from the data */\n if (!body) {\n return RETURN_DOM ? null : emptyHTML;\n }\n }\n\n /* Remove first element node (ours) if FORCE_BODY is set */\n if (body && FORCE_BODY) {\n _forceRemove(body.firstChild);\n }\n\n /* Get node iterator */\n const nodeIterator = _createIterator(IN_PLACE ? dirty : body);\n\n /* Now start iterating over the created document */\n while ((currentNode = nodeIterator.nextNode())) {\n /* Fix IE's strange behavior with manipulated textNodes #89 */\n if (currentNode.nodeType === 3 && currentNode === oldNode) {\n continue;\n }\n\n /* Sanitize tags and elements */\n if (_sanitizeElements(currentNode)) {\n continue;\n }\n\n /* Shadow DOM detected, sanitize it */\n if (currentNode.content instanceof DocumentFragment) {\n _sanitizeShadowDOM(currentNode.content);\n }\n\n /* Check attributes, sanitize if necessary */\n _sanitizeAttributes(currentNode);\n\n oldNode = currentNode;\n }\n\n oldNode = null;\n\n /* If we sanitized `dirty` in-place, return it. */\n if (IN_PLACE) {\n return dirty;\n }\n\n /* Return sanitized string or DOM */\n if (RETURN_DOM) {\n if (RETURN_DOM_FRAGMENT) {\n returnNode = createDocumentFragment.call(body.ownerDocument);\n\n while (body.firstChild) {\n // eslint-disable-next-line unicorn/prefer-node-append\n returnNode.appendChild(body.firstChild);\n }\n } else {\n returnNode = body;\n }\n\n if (RETURN_DOM_IMPORT) {\n /* AdoptNode() is not used because internal state is not reset\n (e.g. the past names map of a HTMLFormElement), this is safe\n in theory but we would rather not risk another attack vector.\n The state that is cloned by importNode() is explicitly defined\n by the specs. */\n returnNode = importNode.call(originalDocument, returnNode, true);\n }\n\n return returnNode;\n }\n\n let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;\n\n /* Sanitize final string template-safe */\n if (SAFE_FOR_TEMPLATES) {\n serializedHTML = stringReplace(serializedHTML, MUSTACHE_EXPR, ' ');\n serializedHTML = stringReplace(serializedHTML, ERB_EXPR, ' ');\n }\n\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE\n ? trustedTypesPolicy.createHTML(serializedHTML)\n : serializedHTML;\n };\n\n /**\n * Public method to set the configuration once\n * setConfig\n *\n * @param {Object} cfg configuration object\n */\n DOMPurify.setConfig = function(cfg) {\n _parseConfig(cfg);\n SET_CONFIG = true;\n };\n\n /**\n * Public method to remove the configuration\n * clearConfig\n *\n */\n DOMPurify.clearConfig = function() {\n CONFIG = null;\n SET_CONFIG = false;\n };\n\n /**\n * Public method to check if an attribute value is valid.\n * Uses last set config, if any. Otherwise, uses config defaults.\n * isValidAttribute\n *\n * @param {string} tag Tag name of containing element.\n * @param {string} attr Attribute name.\n * @param {string} value Attribute value.\n * @return {Boolean} Returns true if `value` is valid. Otherwise, returns false.\n */\n DOMPurify.isValidAttribute = function(tag, attr, value) {\n /* Initialize shared config vars if necessary. */\n if (!CONFIG) {\n _parseConfig({});\n }\n\n const lcTag = stringToLowerCase(tag);\n const lcName = stringToLowerCase(attr);\n return _isValidAttribute(lcTag, lcName, value);\n };\n\n /**\n * AddHook\n * Public method to add DOMPurify hooks\n *\n * @param {String} entryPoint entry point for the hook to add\n * @param {Function} hookFunction function to execute\n */\n DOMPurify.addHook = function(entryPoint, hookFunction) {\n if (typeof hookFunction !== 'function') {\n return;\n }\n\n hooks[entryPoint] = hooks[entryPoint] || [];\n arrayPush(hooks[entryPoint], hookFunction);\n };\n\n /**\n * RemoveHook\n * Public method to remove a DOMPurify hook at a given entryPoint\n * (pops it from the stack of hooks if more are present)\n *\n * @param {String} entryPoint entry point for the hook to remove\n */\n DOMPurify.removeHook = function(entryPoint) {\n if (hooks[entryPoint]) {\n arrayPop(hooks[entryPoint]);\n }\n };\n\n /**\n * RemoveHooks\n * Public method to remove all DOMPurify hooks at a given entryPoint\n *\n * @param {String} entryPoint entry point for the hooks to remove\n */\n DOMPurify.removeHooks = function(entryPoint) {\n if (hooks[entryPoint]) {\n hooks[entryPoint] = [];\n }\n };\n\n /**\n * RemoveAllHooks\n * Public method to remove all DOMPurify hooks\n *\n */\n DOMPurify.removeAllHooks = function() {\n hooks = {};\n };\n\n return DOMPurify;\n}\n\nexport default createDOMPurify();\n","/* flatpickr v4.6.3, @license MIT */\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global = global || self, global.flatpickr = factory());\n}(this, function () { 'use strict';\n\n /*! *****************************************************************************\r\n Copyright (c) Microsoft Corporation. All rights reserved.\r\n Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\n this file except in compliance with the License. You may obtain a copy of the\r\n License at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\n THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\n WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\n MERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\n See the Apache Version 2.0 License for specific language governing permissions\r\n and limitations under the License.\r\n ***************************************************************************** */\r\n\r\n var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n };\n\n var HOOKS = [\n \"onChange\",\n \"onClose\",\n \"onDayCreate\",\n \"onDestroy\",\n \"onKeyDown\",\n \"onMonthChange\",\n \"onOpen\",\n \"onParseConfig\",\n \"onReady\",\n \"onValueUpdate\",\n \"onYearChange\",\n \"onPreCalendarPosition\",\n ];\n var defaults = {\n _disable: [],\n _enable: [],\n allowInput: false,\n altFormat: \"F j, Y\",\n altInput: false,\n altInputClass: \"form-control input\",\n animate: typeof window === \"object\" &&\n window.navigator.userAgent.indexOf(\"MSIE\") === -1,\n ariaDateFormat: \"F j, Y\",\n clickOpens: true,\n closeOnSelect: true,\n conjunction: \", \",\n dateFormat: \"Y-m-d\",\n defaultHour: 12,\n defaultMinute: 0,\n defaultSeconds: 0,\n disable: [],\n disableMobile: false,\n enable: [],\n enableSeconds: false,\n enableTime: false,\n errorHandler: function (err) {\n return typeof console !== \"undefined\" && console.warn(err);\n },\n getWeek: function (givenDate) {\n var date = new Date(givenDate.getTime());\n date.setHours(0, 0, 0, 0);\n // Thursday in current week decides the year.\n date.setDate(date.getDate() + 3 - ((date.getDay() + 6) % 7));\n // January 4 is always in week 1.\n var week1 = new Date(date.getFullYear(), 0, 4);\n // Adjust to Thursday in week 1 and count number of weeks from date to week1.\n return (1 +\n Math.round(((date.getTime() - week1.getTime()) / 86400000 -\n 3 +\n ((week1.getDay() + 6) % 7)) /\n 7));\n },\n hourIncrement: 1,\n ignoredFocusElements: [],\n inline: false,\n locale: \"default\",\n minuteIncrement: 5,\n mode: \"single\",\n monthSelectorType: \"dropdown\",\n nextArrow: \"\",\n noCalendar: false,\n now: new Date(),\n onChange: [],\n onClose: [],\n onDayCreate: [],\n onDestroy: [],\n onKeyDown: [],\n onMonthChange: [],\n onOpen: [],\n onParseConfig: [],\n onReady: [],\n onValueUpdate: [],\n onYearChange: [],\n onPreCalendarPosition: [],\n plugins: [],\n position: \"auto\",\n positionElement: undefined,\n prevArrow: \"\",\n shorthandCurrentMonth: false,\n showMonths: 1,\n static: false,\n time_24hr: false,\n weekNumbers: false,\n wrap: false\n };\n\n var english = {\n weekdays: {\n shorthand: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n longhand: [\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n ]\n },\n months: {\n shorthand: [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n ],\n longhand: [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n ]\n },\n daysInMonth: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],\n firstDayOfWeek: 0,\n ordinal: function (nth) {\n var s = nth % 100;\n if (s > 3 && s < 21)\n return \"th\";\n switch (s % 10) {\n case 1:\n return \"st\";\n case 2:\n return \"nd\";\n case 3:\n return \"rd\";\n default:\n return \"th\";\n }\n },\n rangeSeparator: \" to \",\n weekAbbreviation: \"Wk\",\n scrollTitle: \"Scroll to increment\",\n toggleTitle: \"Click to toggle\",\n amPM: [\"AM\", \"PM\"],\n yearAriaLabel: \"Year\",\n hourAriaLabel: \"Hour\",\n minuteAriaLabel: \"Minute\",\n time_24hr: false\n };\n\n var pad = function (number) { return (\"0\" + number).slice(-2); };\n var int = function (bool) { return (bool === true ? 1 : 0); };\n /* istanbul ignore next */\n function debounce(func, wait, immediate) {\n if (immediate === void 0) { immediate = false; }\n var timeout;\n return function () {\n var context = this, args = arguments;\n timeout !== null && clearTimeout(timeout);\n timeout = window.setTimeout(function () {\n timeout = null;\n if (!immediate)\n func.apply(context, args);\n }, wait);\n if (immediate && !timeout)\n func.apply(context, args);\n };\n }\n var arrayify = function (obj) {\n return obj instanceof Array ? obj : [obj];\n };\n\n function toggleClass(elem, className, bool) {\n if (bool === true)\n return elem.classList.add(className);\n elem.classList.remove(className);\n }\n function createElement(tag, className, content) {\n var e = window.document.createElement(tag);\n className = className || \"\";\n content = content || \"\";\n e.className = className;\n if (content !== undefined)\n e.textContent = content;\n return e;\n }\n function clearNode(node) {\n while (node.firstChild)\n node.removeChild(node.firstChild);\n }\n function findParent(node, condition) {\n if (condition(node))\n return node;\n else if (node.parentNode)\n return findParent(node.parentNode, condition);\n return undefined; // nothing found\n }\n function createNumberInput(inputClassName, opts) {\n var wrapper = createElement(\"div\", \"numInputWrapper\"), numInput = createElement(\"input\", \"numInput \" + inputClassName), arrowUp = createElement(\"span\", \"arrowUp\"), arrowDown = createElement(\"span\", \"arrowDown\");\n if (navigator.userAgent.indexOf(\"MSIE 9.0\") === -1) {\n numInput.type = \"number\";\n }\n else {\n numInput.type = \"text\";\n numInput.pattern = \"\\\\d*\";\n }\n if (opts !== undefined)\n for (var key in opts)\n numInput.setAttribute(key, opts[key]);\n wrapper.appendChild(numInput);\n wrapper.appendChild(arrowUp);\n wrapper.appendChild(arrowDown);\n return wrapper;\n }\n function getEventTarget(event) {\n if (typeof event.composedPath === \"function\") {\n var path = event.composedPath();\n return path[0];\n }\n return event.target;\n }\n\n var doNothing = function () { return undefined; };\n var monthToStr = function (monthNumber, shorthand, locale) { return locale.months[shorthand ? \"shorthand\" : \"longhand\"][monthNumber]; };\n var revFormat = {\n D: doNothing,\n F: function (dateObj, monthName, locale) {\n dateObj.setMonth(locale.months.longhand.indexOf(monthName));\n },\n G: function (dateObj, hour) {\n dateObj.setHours(parseFloat(hour));\n },\n H: function (dateObj, hour) {\n dateObj.setHours(parseFloat(hour));\n },\n J: function (dateObj, day) {\n dateObj.setDate(parseFloat(day));\n },\n K: function (dateObj, amPM, locale) {\n dateObj.setHours((dateObj.getHours() % 12) +\n 12 * int(new RegExp(locale.amPM[1], \"i\").test(amPM)));\n },\n M: function (dateObj, shortMonth, locale) {\n dateObj.setMonth(locale.months.shorthand.indexOf(shortMonth));\n },\n S: function (dateObj, seconds) {\n dateObj.setSeconds(parseFloat(seconds));\n },\n U: function (_, unixSeconds) { return new Date(parseFloat(unixSeconds) * 1000); },\n W: function (dateObj, weekNum, locale) {\n var weekNumber = parseInt(weekNum);\n var date = new Date(dateObj.getFullYear(), 0, 2 + (weekNumber - 1) * 7, 0, 0, 0, 0);\n date.setDate(date.getDate() - date.getDay() + locale.firstDayOfWeek);\n return date;\n },\n Y: function (dateObj, year) {\n dateObj.setFullYear(parseFloat(year));\n },\n Z: function (_, ISODate) { return new Date(ISODate); },\n d: function (dateObj, day) {\n dateObj.setDate(parseFloat(day));\n },\n h: function (dateObj, hour) {\n dateObj.setHours(parseFloat(hour));\n },\n i: function (dateObj, minutes) {\n dateObj.setMinutes(parseFloat(minutes));\n },\n j: function (dateObj, day) {\n dateObj.setDate(parseFloat(day));\n },\n l: doNothing,\n m: function (dateObj, month) {\n dateObj.setMonth(parseFloat(month) - 1);\n },\n n: function (dateObj, month) {\n dateObj.setMonth(parseFloat(month) - 1);\n },\n s: function (dateObj, seconds) {\n dateObj.setSeconds(parseFloat(seconds));\n },\n u: function (_, unixMillSeconds) {\n return new Date(parseFloat(unixMillSeconds));\n },\n w: doNothing,\n y: function (dateObj, year) {\n dateObj.setFullYear(2000 + parseFloat(year));\n }\n };\n var tokenRegex = {\n D: \"(\\\\w+)\",\n F: \"(\\\\w+)\",\n G: \"(\\\\d\\\\d|\\\\d)\",\n H: \"(\\\\d\\\\d|\\\\d)\",\n J: \"(\\\\d\\\\d|\\\\d)\\\\w+\",\n K: \"\",\n M: \"(\\\\w+)\",\n S: \"(\\\\d\\\\d|\\\\d)\",\n U: \"(.+)\",\n W: \"(\\\\d\\\\d|\\\\d)\",\n Y: \"(\\\\d{4})\",\n Z: \"(.+)\",\n d: \"(\\\\d\\\\d|\\\\d)\",\n h: \"(\\\\d\\\\d|\\\\d)\",\n i: \"(\\\\d\\\\d|\\\\d)\",\n j: \"(\\\\d\\\\d|\\\\d)\",\n l: \"(\\\\w+)\",\n m: \"(\\\\d\\\\d|\\\\d)\",\n n: \"(\\\\d\\\\d|\\\\d)\",\n s: \"(\\\\d\\\\d|\\\\d)\",\n u: \"(.+)\",\n w: \"(\\\\d\\\\d|\\\\d)\",\n y: \"(\\\\d{2})\"\n };\n var formats = {\n // get the date in UTC\n Z: function (date) { return date.toISOString(); },\n // weekday name, short, e.g. Thu\n D: function (date, locale, options) {\n return locale.weekdays.shorthand[formats.w(date, locale, options)];\n },\n // full month name e.g. January\n F: function (date, locale, options) {\n return monthToStr(formats.n(date, locale, options) - 1, false, locale);\n },\n // padded hour 1-12\n G: function (date, locale, options) {\n return pad(formats.h(date, locale, options));\n },\n // hours with leading zero e.g. 03\n H: function (date) { return pad(date.getHours()); },\n // day (1-30) with ordinal suffix e.g. 1st, 2nd\n J: function (date, locale) {\n return locale.ordinal !== undefined\n ? date.getDate() + locale.ordinal(date.getDate())\n : date.getDate();\n },\n // AM/PM\n K: function (date, locale) { return locale.amPM[int(date.getHours() > 11)]; },\n // shorthand month e.g. Jan, Sep, Oct, etc\n M: function (date, locale) {\n return monthToStr(date.getMonth(), true, locale);\n },\n // seconds 00-59\n S: function (date) { return pad(date.getSeconds()); },\n // unix timestamp\n U: function (date) { return date.getTime() / 1000; },\n W: function (date, _, options) {\n return options.getWeek(date);\n },\n // full year e.g. 2016\n Y: function (date) { return date.getFullYear(); },\n // day in month, padded (01-30)\n d: function (date) { return pad(date.getDate()); },\n // hour from 1-12 (am/pm)\n h: function (date) { return (date.getHours() % 12 ? date.getHours() % 12 : 12); },\n // minutes, padded with leading zero e.g. 09\n i: function (date) { return pad(date.getMinutes()); },\n // day in month (1-30)\n j: function (date) { return date.getDate(); },\n // weekday name, full, e.g. Thursday\n l: function (date, locale) {\n return locale.weekdays.longhand[date.getDay()];\n },\n // padded month number (01-12)\n m: function (date) { return pad(date.getMonth() + 1); },\n // the month number (1-12)\n n: function (date) { return date.getMonth() + 1; },\n // seconds 0-59\n s: function (date) { return date.getSeconds(); },\n // Unix Milliseconds\n u: function (date) { return date.getTime(); },\n // number of the day of the week\n w: function (date) { return date.getDay(); },\n // last two digits of year e.g. 16 for 2016\n y: function (date) { return String(date.getFullYear()).substring(2); }\n };\n\n var createDateFormatter = function (_a) {\n var _b = _a.config, config = _b === void 0 ? defaults : _b, _c = _a.l10n, l10n = _c === void 0 ? english : _c;\n return function (dateObj, frmt, overrideLocale) {\n var locale = overrideLocale || l10n;\n if (config.formatDate !== undefined) {\n return config.formatDate(dateObj, frmt, locale);\n }\n return frmt\n .split(\"\")\n .map(function (c, i, arr) {\n return formats[c] && arr[i - 1] !== \"\\\\\"\n ? formats[c](dateObj, locale, config)\n : c !== \"\\\\\"\n ? c\n : \"\";\n })\n .join(\"\");\n };\n };\n var createDateParser = function (_a) {\n var _b = _a.config, config = _b === void 0 ? defaults : _b, _c = _a.l10n, l10n = _c === void 0 ? english : _c;\n return function (date, givenFormat, timeless, customLocale) {\n if (date !== 0 && !date)\n return undefined;\n var locale = customLocale || l10n;\n var parsedDate;\n var dateOrig = date;\n if (date instanceof Date)\n parsedDate = new Date(date.getTime());\n else if (typeof date !== \"string\" &&\n date.toFixed !== undefined // timestamp\n )\n // create a copy\n parsedDate = new Date(date);\n else if (typeof date === \"string\") {\n // date string\n var format = givenFormat || (config || defaults).dateFormat;\n var datestr = String(date).trim();\n if (datestr === \"today\") {\n parsedDate = new Date();\n timeless = true;\n }\n else if (/Z$/.test(datestr) ||\n /GMT$/.test(datestr) // datestrings w/ timezone\n )\n parsedDate = new Date(date);\n else if (config && config.parseDate)\n parsedDate = config.parseDate(date, format);\n else {\n parsedDate =\n !config || !config.noCalendar\n ? new Date(new Date().getFullYear(), 0, 1, 0, 0, 0, 0)\n : new Date(new Date().setHours(0, 0, 0, 0));\n var matched = void 0, ops = [];\n for (var i = 0, matchIndex = 0, regexStr = \"\"; i < format.length; i++) {\n var token_1 = format[i];\n var isBackSlash = token_1 === \"\\\\\";\n var escaped = format[i - 1] === \"\\\\\" || isBackSlash;\n if (tokenRegex[token_1] && !escaped) {\n regexStr += tokenRegex[token_1];\n var match = new RegExp(regexStr).exec(date);\n if (match && (matched = true)) {\n ops[token_1 !== \"Y\" ? \"push\" : \"unshift\"]({\n fn: revFormat[token_1],\n val: match[++matchIndex]\n });\n }\n }\n else if (!isBackSlash)\n regexStr += \".\"; // don't really care\n ops.forEach(function (_a) {\n var fn = _a.fn, val = _a.val;\n return (parsedDate = fn(parsedDate, val, locale) || parsedDate);\n });\n }\n parsedDate = matched ? parsedDate : undefined;\n }\n }\n /* istanbul ignore next */\n if (!(parsedDate instanceof Date && !isNaN(parsedDate.getTime()))) {\n config.errorHandler(new Error(\"Invalid date provided: \" + dateOrig));\n return undefined;\n }\n if (timeless === true)\n parsedDate.setHours(0, 0, 0, 0);\n return parsedDate;\n };\n };\n /**\n * Compute the difference in dates, measured in ms\n */\n function compareDates(date1, date2, timeless) {\n if (timeless === void 0) { timeless = true; }\n if (timeless !== false) {\n return (new Date(date1.getTime()).setHours(0, 0, 0, 0) -\n new Date(date2.getTime()).setHours(0, 0, 0, 0));\n }\n return date1.getTime() - date2.getTime();\n }\n var isBetween = function (ts, ts1, ts2) {\n return ts > Math.min(ts1, ts2) && ts < Math.max(ts1, ts2);\n };\n var duration = {\n DAY: 86400000\n };\n\n if (typeof Object.assign !== \"function\") {\n Object.assign = function (target) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n if (!target) {\n throw TypeError(\"Cannot convert undefined or null to object\");\n }\n var _loop_1 = function (source) {\n if (source) {\n Object.keys(source).forEach(function (key) { return (target[key] = source[key]); });\n }\n };\n for (var _a = 0, args_1 = args; _a < args_1.length; _a++) {\n var source = args_1[_a];\n _loop_1(source);\n }\n return target;\n };\n }\n\n var DEBOUNCED_CHANGE_MS = 300;\n function FlatpickrInstance(element, instanceConfig) {\n var self = {\n config: __assign({}, defaults, flatpickr.defaultConfig),\n l10n: english\n };\n self.parseDate = createDateParser({ config: self.config, l10n: self.l10n });\n self._handlers = [];\n self.pluginElements = [];\n self.loadedPlugins = [];\n self._bind = bind;\n self._setHoursFromDate = setHoursFromDate;\n self._positionCalendar = positionCalendar;\n self.changeMonth = changeMonth;\n self.changeYear = changeYear;\n self.clear = clear;\n self.close = close;\n self._createElement = createElement;\n self.destroy = destroy;\n self.isEnabled = isEnabled;\n self.jumpToDate = jumpToDate;\n self.open = open;\n self.redraw = redraw;\n self.set = set;\n self.setDate = setDate;\n self.toggle = toggle;\n function setupHelperFunctions() {\n self.utils = {\n getDaysInMonth: function (month, yr) {\n if (month === void 0) { month = self.currentMonth; }\n if (yr === void 0) { yr = self.currentYear; }\n if (month === 1 && ((yr % 4 === 0 && yr % 100 !== 0) || yr % 400 === 0))\n return 29;\n return self.l10n.daysInMonth[month];\n }\n };\n }\n function init() {\n self.element = self.input = element;\n self.isOpen = false;\n parseConfig();\n setupLocale();\n setupInputs();\n setupDates();\n setupHelperFunctions();\n if (!self.isMobile)\n build();\n bindEvents();\n if (self.selectedDates.length || self.config.noCalendar) {\n if (self.config.enableTime) {\n setHoursFromDate(self.config.noCalendar\n ? self.latestSelectedDateObj || self.config.minDate\n : undefined);\n }\n updateValue(false);\n }\n setCalendarWidth();\n self.showTimeInput =\n self.selectedDates.length > 0 || self.config.noCalendar;\n var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);\n /* TODO: investigate this further\n \n Currently, there is weird positioning behavior in safari causing pages\n to scroll up. https://github.com/chmln/flatpickr/issues/563\n \n However, most browsers are not Safari and positioning is expensive when used\n in scale. https://github.com/chmln/flatpickr/issues/1096\n */\n if (!self.isMobile && isSafari) {\n positionCalendar();\n }\n triggerEvent(\"onReady\");\n }\n function bindToInstance(fn) {\n return fn.bind(self);\n }\n function setCalendarWidth() {\n var config = self.config;\n if (config.weekNumbers === false && config.showMonths === 1)\n return;\n else if (config.noCalendar !== true) {\n window.requestAnimationFrame(function () {\n if (self.calendarContainer !== undefined) {\n self.calendarContainer.style.visibility = \"hidden\";\n self.calendarContainer.style.display = \"block\";\n }\n if (self.daysContainer !== undefined) {\n var daysWidth = (self.days.offsetWidth + 1) * config.showMonths;\n self.daysContainer.style.width = daysWidth + \"px\";\n self.calendarContainer.style.width =\n daysWidth +\n (self.weekWrapper !== undefined\n ? self.weekWrapper.offsetWidth\n : 0) +\n \"px\";\n self.calendarContainer.style.removeProperty(\"visibility\");\n self.calendarContainer.style.removeProperty(\"display\");\n }\n });\n }\n }\n /**\n * The handler for all events targeting the time inputs\n */\n function updateTime(e) {\n if (self.selectedDates.length === 0) {\n setDefaultTime();\n }\n if (e !== undefined && e.type !== \"blur\") {\n timeWrapper(e);\n }\n var prevValue = self._input.value;\n setHoursFromInputs();\n updateValue();\n if (self._input.value !== prevValue) {\n self._debouncedChange();\n }\n }\n function ampm2military(hour, amPM) {\n return (hour % 12) + 12 * int(amPM === self.l10n.amPM[1]);\n }\n function military2ampm(hour) {\n switch (hour % 24) {\n case 0:\n case 12:\n return 12;\n default:\n return hour % 12;\n }\n }\n /**\n * Syncs the selected date object time with user's time input\n */\n function setHoursFromInputs() {\n if (self.hourElement === undefined || self.minuteElement === undefined)\n return;\n var hours = (parseInt(self.hourElement.value.slice(-2), 10) || 0) % 24, minutes = (parseInt(self.minuteElement.value, 10) || 0) % 60, seconds = self.secondElement !== undefined\n ? (parseInt(self.secondElement.value, 10) || 0) % 60\n : 0;\n if (self.amPM !== undefined) {\n hours = ampm2military(hours, self.amPM.textContent);\n }\n var limitMinHours = self.config.minTime !== undefined ||\n (self.config.minDate &&\n self.minDateHasTime &&\n self.latestSelectedDateObj &&\n compareDates(self.latestSelectedDateObj, self.config.minDate, true) ===\n 0);\n var limitMaxHours = self.config.maxTime !== undefined ||\n (self.config.maxDate &&\n self.maxDateHasTime &&\n self.latestSelectedDateObj &&\n compareDates(self.latestSelectedDateObj, self.config.maxDate, true) ===\n 0);\n if (limitMaxHours) {\n var maxTime = self.config.maxTime !== undefined\n ? self.config.maxTime\n : self.config.maxDate;\n hours = Math.min(hours, maxTime.getHours());\n if (hours === maxTime.getHours())\n minutes = Math.min(minutes, maxTime.getMinutes());\n if (minutes === maxTime.getMinutes())\n seconds = Math.min(seconds, maxTime.getSeconds());\n }\n if (limitMinHours) {\n var minTime = self.config.minTime !== undefined\n ? self.config.minTime\n : self.config.minDate;\n hours = Math.max(hours, minTime.getHours());\n if (hours === minTime.getHours())\n minutes = Math.max(minutes, minTime.getMinutes());\n if (minutes === minTime.getMinutes())\n seconds = Math.max(seconds, minTime.getSeconds());\n }\n setHours(hours, minutes, seconds);\n }\n /**\n * Syncs time input values with a date\n */\n function setHoursFromDate(dateObj) {\n var date = dateObj || self.latestSelectedDateObj;\n if (date)\n setHours(date.getHours(), date.getMinutes(), date.getSeconds());\n }\n function setDefaultHours() {\n var hours = self.config.defaultHour;\n var minutes = self.config.defaultMinute;\n var seconds = self.config.defaultSeconds;\n if (self.config.minDate !== undefined) {\n var minHr = self.config.minDate.getHours();\n var minMinutes = self.config.minDate.getMinutes();\n hours = Math.max(hours, minHr);\n if (hours === minHr)\n minutes = Math.max(minMinutes, minutes);\n if (hours === minHr && minutes === minMinutes)\n seconds = self.config.minDate.getSeconds();\n }\n if (self.config.maxDate !== undefined) {\n var maxHr = self.config.maxDate.getHours();\n var maxMinutes = self.config.maxDate.getMinutes();\n hours = Math.min(hours, maxHr);\n if (hours === maxHr)\n minutes = Math.min(maxMinutes, minutes);\n if (hours === maxHr && minutes === maxMinutes)\n seconds = self.config.maxDate.getSeconds();\n }\n setHours(hours, minutes, seconds);\n }\n /**\n * Sets the hours, minutes, and optionally seconds\n * of the latest selected date object and the\n * corresponding time inputs\n * @param {Number} hours the hour. whether its military\n * or am-pm gets inferred from config\n * @param {Number} minutes the minutes\n * @param {Number} seconds the seconds (optional)\n */\n function setHours(hours, minutes, seconds) {\n if (self.latestSelectedDateObj !== undefined) {\n self.latestSelectedDateObj.setHours(hours % 24, minutes, seconds || 0, 0);\n }\n if (!self.hourElement || !self.minuteElement || self.isMobile)\n return;\n self.hourElement.value = pad(!self.config.time_24hr\n ? ((12 + hours) % 12) + 12 * int(hours % 12 === 0)\n : hours);\n self.minuteElement.value = pad(minutes);\n if (self.amPM !== undefined)\n self.amPM.textContent = self.l10n.amPM[int(hours >= 12)];\n if (self.secondElement !== undefined)\n self.secondElement.value = pad(seconds);\n }\n /**\n * Handles the year input and incrementing events\n * @param {Event} event the keyup or increment event\n */\n function onYearInput(event) {\n var year = parseInt(event.target.value) + (event.delta || 0);\n if (year / 1000 > 1 ||\n (event.key === \"Enter\" && !/[^\\d]/.test(year.toString()))) {\n changeYear(year);\n }\n }\n /**\n * Essentially addEventListener + tracking\n * @param {Element} element the element to addEventListener to\n * @param {String} event the event name\n * @param {Function} handler the event handler\n */\n function bind(element, event, handler, options) {\n if (event instanceof Array)\n return event.forEach(function (ev) { return bind(element, ev, handler, options); });\n if (element instanceof Array)\n return element.forEach(function (el) { return bind(el, event, handler, options); });\n element.addEventListener(event, handler, options);\n self._handlers.push({\n element: element,\n event: event,\n handler: handler,\n options: options\n });\n }\n /**\n * A mousedown handler which mimics click.\n * Minimizes latency, since we don't need to wait for mouseup in most cases.\n * Also, avoids handling right clicks.\n *\n * @param {Function} handler the event handler\n */\n function onClick(handler) {\n return function (evt) {\n evt.which === 1 && handler(evt);\n };\n }\n function triggerChange() {\n triggerEvent(\"onChange\");\n }\n /**\n * Adds all the necessary event listeners\n */\n function bindEvents() {\n if (self.config.wrap) {\n [\"open\", \"close\", \"toggle\", \"clear\"].forEach(function (evt) {\n Array.prototype.forEach.call(self.element.querySelectorAll(\"[data-\" + evt + \"]\"), function (el) {\n return bind(el, \"click\", self[evt]);\n });\n });\n }\n if (self.isMobile) {\n setupMobile();\n return;\n }\n var debouncedResize = debounce(onResize, 50);\n self._debouncedChange = debounce(triggerChange, DEBOUNCED_CHANGE_MS);\n if (self.daysContainer && !/iPhone|iPad|iPod/i.test(navigator.userAgent))\n bind(self.daysContainer, \"mouseover\", function (e) {\n if (self.config.mode === \"range\")\n onMouseOver(e.target);\n });\n bind(window.document.body, \"keydown\", onKeyDown);\n if (!self.config.inline && !self.config.static)\n bind(window, \"resize\", debouncedResize);\n if (window.ontouchstart !== undefined)\n bind(window.document, \"touchstart\", documentClick);\n else\n bind(window.document, \"mousedown\", onClick(documentClick));\n bind(window.document, \"focus\", documentClick, { capture: true });\n if (self.config.clickOpens === true) {\n bind(self._input, \"focus\", self.open);\n bind(self._input, \"mousedown\", onClick(self.open));\n }\n if (self.daysContainer !== undefined) {\n bind(self.monthNav, \"mousedown\", onClick(onMonthNavClick));\n bind(self.monthNav, [\"keyup\", \"increment\"], onYearInput);\n bind(self.daysContainer, \"mousedown\", onClick(selectDate));\n }\n if (self.timeContainer !== undefined &&\n self.minuteElement !== undefined &&\n self.hourElement !== undefined) {\n var selText = function (e) {\n return e.target.select();\n };\n bind(self.timeContainer, [\"increment\"], updateTime);\n bind(self.timeContainer, \"blur\", updateTime, { capture: true });\n bind(self.timeContainer, \"mousedown\", onClick(timeIncrement));\n bind([self.hourElement, self.minuteElement], [\"focus\", \"click\"], selText);\n if (self.secondElement !== undefined)\n bind(self.secondElement, \"focus\", function () { return self.secondElement && self.secondElement.select(); });\n if (self.amPM !== undefined) {\n bind(self.amPM, \"mousedown\", onClick(function (e) {\n updateTime(e);\n triggerChange();\n }));\n }\n }\n }\n /**\n * Set the calendar view to a particular date.\n * @param {Date} jumpDate the date to set the view to\n * @param {boolean} triggerChange if change events should be triggered\n */\n function jumpToDate(jumpDate, triggerChange) {\n var jumpTo = jumpDate !== undefined\n ? self.parseDate(jumpDate)\n : self.latestSelectedDateObj ||\n (self.config.minDate && self.config.minDate > self.now\n ? self.config.minDate\n : self.config.maxDate && self.config.maxDate < self.now\n ? self.config.maxDate\n : self.now);\n var oldYear = self.currentYear;\n var oldMonth = self.currentMonth;\n try {\n if (jumpTo !== undefined) {\n self.currentYear = jumpTo.getFullYear();\n self.currentMonth = jumpTo.getMonth();\n }\n }\n catch (e) {\n /* istanbul ignore next */\n e.message = \"Invalid date supplied: \" + jumpTo;\n self.config.errorHandler(e);\n }\n if (triggerChange && self.currentYear !== oldYear) {\n triggerEvent(\"onYearChange\");\n buildMonthSwitch();\n }\n if (triggerChange &&\n (self.currentYear !== oldYear || self.currentMonth !== oldMonth)) {\n triggerEvent(\"onMonthChange\");\n }\n self.redraw();\n }\n /**\n * The up/down arrow handler for time inputs\n * @param {Event} e the click event\n */\n function timeIncrement(e) {\n if (~e.target.className.indexOf(\"arrow\"))\n incrementNumInput(e, e.target.classList.contains(\"arrowUp\") ? 1 : -1);\n }\n /**\n * Increments/decrements the value of input associ-\n * ated with the up/down arrow by dispatching an\n * \"increment\" event on the input.\n *\n * @param {Event} e the click event\n * @param {Number} delta the diff (usually 1 or -1)\n * @param {Element} inputElem the input element\n */\n function incrementNumInput(e, delta, inputElem) {\n var target = e && e.target;\n var input = inputElem ||\n (target && target.parentNode && target.parentNode.firstChild);\n var event = createEvent(\"increment\");\n event.delta = delta;\n input && input.dispatchEvent(event);\n }\n function build() {\n var fragment = window.document.createDocumentFragment();\n self.calendarContainer = createElement(\"div\", \"flatpickr-calendar\");\n self.calendarContainer.tabIndex = -1;\n if (!self.config.noCalendar) {\n fragment.appendChild(buildMonthNav());\n self.innerContainer = createElement(\"div\", \"flatpickr-innerContainer\");\n if (self.config.weekNumbers) {\n var _a = buildWeeks(), weekWrapper = _a.weekWrapper, weekNumbers = _a.weekNumbers;\n self.innerContainer.appendChild(weekWrapper);\n self.weekNumbers = weekNumbers;\n self.weekWrapper = weekWrapper;\n }\n self.rContainer = createElement(\"div\", \"flatpickr-rContainer\");\n self.rContainer.appendChild(buildWeekdays());\n if (!self.daysContainer) {\n self.daysContainer = createElement(\"div\", \"flatpickr-days\");\n self.daysContainer.tabIndex = -1;\n }\n buildDays();\n self.rContainer.appendChild(self.daysContainer);\n self.innerContainer.appendChild(self.rContainer);\n fragment.appendChild(self.innerContainer);\n }\n if (self.config.enableTime) {\n fragment.appendChild(buildTime());\n }\n toggleClass(self.calendarContainer, \"rangeMode\", self.config.mode === \"range\");\n toggleClass(self.calendarContainer, \"animate\", self.config.animate === true);\n toggleClass(self.calendarContainer, \"multiMonth\", self.config.showMonths > 1);\n self.calendarContainer.appendChild(fragment);\n var customAppend = self.config.appendTo !== undefined &&\n self.config.appendTo.nodeType !== undefined;\n if (self.config.inline || self.config.static) {\n self.calendarContainer.classList.add(self.config.inline ? \"inline\" : \"static\");\n if (self.config.inline) {\n if (!customAppend && self.element.parentNode)\n self.element.parentNode.insertBefore(self.calendarContainer, self._input.nextSibling);\n else if (self.config.appendTo !== undefined)\n self.config.appendTo.appendChild(self.calendarContainer);\n }\n if (self.config.static) {\n var wrapper = createElement(\"div\", \"flatpickr-wrapper\");\n if (self.element.parentNode)\n self.element.parentNode.insertBefore(wrapper, self.element);\n wrapper.appendChild(self.element);\n if (self.altInput)\n wrapper.appendChild(self.altInput);\n wrapper.appendChild(self.calendarContainer);\n }\n }\n if (!self.config.static && !self.config.inline)\n (self.config.appendTo !== undefined\n ? self.config.appendTo\n : window.document.body).appendChild(self.calendarContainer);\n }\n function createDay(className, date, dayNumber, i) {\n var dateIsEnabled = isEnabled(date, true), dayElement = createElement(\"span\", \"flatpickr-day \" + className, date.getDate().toString());\n dayElement.dateObj = date;\n dayElement.$i = i;\n dayElement.setAttribute(\"aria-label\", self.formatDate(date, self.config.ariaDateFormat));\n if (className.indexOf(\"hidden\") === -1 &&\n compareDates(date, self.now) === 0) {\n self.todayDateElem = dayElement;\n dayElement.classList.add(\"today\");\n dayElement.setAttribute(\"aria-current\", \"date\");\n }\n if (dateIsEnabled) {\n dayElement.tabIndex = -1;\n if (isDateSelected(date)) {\n dayElement.classList.add(\"selected\");\n self.selectedDateElem = dayElement;\n if (self.config.mode === \"range\") {\n toggleClass(dayElement, \"startRange\", self.selectedDates[0] &&\n compareDates(date, self.selectedDates[0], true) === 0);\n toggleClass(dayElement, \"endRange\", self.selectedDates[1] &&\n compareDates(date, self.selectedDates[1], true) === 0);\n if (className === \"nextMonthDay\")\n dayElement.classList.add(\"inRange\");\n }\n }\n }\n else {\n dayElement.classList.add(\"flatpickr-disabled\");\n }\n if (self.config.mode === \"range\") {\n if (isDateInRange(date) && !isDateSelected(date))\n dayElement.classList.add(\"inRange\");\n }\n if (self.weekNumbers &&\n self.config.showMonths === 1 &&\n className !== \"prevMonthDay\" &&\n dayNumber % 7 === 1) {\n self.weekNumbers.insertAdjacentHTML(\"beforeend\", \"\" + self.config.getWeek(date) + \"\");\n }\n triggerEvent(\"onDayCreate\", dayElement);\n return dayElement;\n }\n function focusOnDayElem(targetNode) {\n targetNode.focus();\n if (self.config.mode === \"range\")\n onMouseOver(targetNode);\n }\n function getFirstAvailableDay(delta) {\n var startMonth = delta > 0 ? 0 : self.config.showMonths - 1;\n var endMonth = delta > 0 ? self.config.showMonths : -1;\n for (var m = startMonth; m != endMonth; m += delta) {\n var month = self.daysContainer.children[m];\n var startIndex = delta > 0 ? 0 : month.children.length - 1;\n var endIndex = delta > 0 ? month.children.length : -1;\n for (var i = startIndex; i != endIndex; i += delta) {\n var c = month.children[i];\n if (c.className.indexOf(\"hidden\") === -1 && isEnabled(c.dateObj))\n return c;\n }\n }\n return undefined;\n }\n function getNextAvailableDay(current, delta) {\n var givenMonth = current.className.indexOf(\"Month\") === -1\n ? current.dateObj.getMonth()\n : self.currentMonth;\n var endMonth = delta > 0 ? self.config.showMonths : -1;\n var loopDelta = delta > 0 ? 1 : -1;\n for (var m = givenMonth - self.currentMonth; m != endMonth; m += loopDelta) {\n var month = self.daysContainer.children[m];\n var startIndex = givenMonth - self.currentMonth === m\n ? current.$i + delta\n : delta < 0\n ? month.children.length - 1\n : 0;\n var numMonthDays = month.children.length;\n for (var i = startIndex; i >= 0 && i < numMonthDays && i != (delta > 0 ? numMonthDays : -1); i += loopDelta) {\n var c = month.children[i];\n if (c.className.indexOf(\"hidden\") === -1 &&\n isEnabled(c.dateObj) &&\n Math.abs(current.$i - i) >= Math.abs(delta))\n return focusOnDayElem(c);\n }\n }\n self.changeMonth(loopDelta);\n focusOnDay(getFirstAvailableDay(loopDelta), 0);\n return undefined;\n }\n function focusOnDay(current, offset) {\n var dayFocused = isInView(document.activeElement || document.body);\n var startElem = current !== undefined\n ? current\n : dayFocused\n ? document.activeElement\n : self.selectedDateElem !== undefined && isInView(self.selectedDateElem)\n ? self.selectedDateElem\n : self.todayDateElem !== undefined && isInView(self.todayDateElem)\n ? self.todayDateElem\n : getFirstAvailableDay(offset > 0 ? 1 : -1);\n if (startElem === undefined)\n return self._input.focus();\n if (!dayFocused)\n return focusOnDayElem(startElem);\n getNextAvailableDay(startElem, offset);\n }\n function buildMonthDays(year, month) {\n var firstOfMonth = (new Date(year, month, 1).getDay() - self.l10n.firstDayOfWeek + 7) % 7;\n var prevMonthDays = self.utils.getDaysInMonth((month - 1 + 12) % 12);\n var daysInMonth = self.utils.getDaysInMonth(month), days = window.document.createDocumentFragment(), isMultiMonth = self.config.showMonths > 1, prevMonthDayClass = isMultiMonth ? \"prevMonthDay hidden\" : \"prevMonthDay\", nextMonthDayClass = isMultiMonth ? \"nextMonthDay hidden\" : \"nextMonthDay\";\n var dayNumber = prevMonthDays + 1 - firstOfMonth, dayIndex = 0;\n // prepend days from the ending of previous month\n for (; dayNumber <= prevMonthDays; dayNumber++, dayIndex++) {\n days.appendChild(createDay(prevMonthDayClass, new Date(year, month - 1, dayNumber), dayNumber, dayIndex));\n }\n // Start at 1 since there is no 0th day\n for (dayNumber = 1; dayNumber <= daysInMonth; dayNumber++, dayIndex++) {\n days.appendChild(createDay(\"\", new Date(year, month, dayNumber), dayNumber, dayIndex));\n }\n // append days from the next month\n for (var dayNum = daysInMonth + 1; dayNum <= 42 - firstOfMonth &&\n (self.config.showMonths === 1 || dayIndex % 7 !== 0); dayNum++, dayIndex++) {\n days.appendChild(createDay(nextMonthDayClass, new Date(year, month + 1, dayNum % daysInMonth), dayNum, dayIndex));\n }\n //updateNavigationCurrentMonth();\n var dayContainer = createElement(\"div\", \"dayContainer\");\n dayContainer.appendChild(days);\n return dayContainer;\n }\n function buildDays() {\n if (self.daysContainer === undefined) {\n return;\n }\n clearNode(self.daysContainer);\n // TODO: week numbers for each month\n if (self.weekNumbers)\n clearNode(self.weekNumbers);\n var frag = document.createDocumentFragment();\n for (var i = 0; i < self.config.showMonths; i++) {\n var d = new Date(self.currentYear, self.currentMonth, 1);\n d.setMonth(self.currentMonth + i);\n frag.appendChild(buildMonthDays(d.getFullYear(), d.getMonth()));\n }\n self.daysContainer.appendChild(frag);\n self.days = self.daysContainer.firstChild;\n if (self.config.mode === \"range\" && self.selectedDates.length === 1) {\n onMouseOver();\n }\n }\n function buildMonthSwitch() {\n if (self.config.showMonths > 1 ||\n self.config.monthSelectorType !== \"dropdown\")\n return;\n var shouldBuildMonth = function (month) {\n if (self.config.minDate !== undefined &&\n self.currentYear === self.config.minDate.getFullYear() &&\n month < self.config.minDate.getMonth()) {\n return false;\n }\n return !(self.config.maxDate !== undefined &&\n self.currentYear === self.config.maxDate.getFullYear() &&\n month > self.config.maxDate.getMonth());\n };\n self.monthsDropdownContainer.tabIndex = -1;\n self.monthsDropdownContainer.innerHTML = \"\";\n for (var i = 0; i < 12; i++) {\n if (!shouldBuildMonth(i))\n continue;\n var month = createElement(\"option\", \"flatpickr-monthDropdown-month\");\n month.value = new Date(self.currentYear, i).getMonth().toString();\n month.textContent = monthToStr(i, self.config.shorthandCurrentMonth, self.l10n);\n month.tabIndex = -1;\n if (self.currentMonth === i) {\n month.selected = true;\n }\n self.monthsDropdownContainer.appendChild(month);\n }\n }\n function buildMonth() {\n var container = createElement(\"div\", \"flatpickr-month\");\n var monthNavFragment = window.document.createDocumentFragment();\n var monthElement;\n if (self.config.showMonths > 1 ||\n self.config.monthSelectorType === \"static\") {\n monthElement = createElement(\"span\", \"cur-month\");\n }\n else {\n self.monthsDropdownContainer = createElement(\"select\", \"flatpickr-monthDropdown-months\");\n bind(self.monthsDropdownContainer, \"change\", function (e) {\n var target = e.target;\n var selectedMonth = parseInt(target.value, 10);\n self.changeMonth(selectedMonth - self.currentMonth);\n triggerEvent(\"onMonthChange\");\n });\n buildMonthSwitch();\n monthElement = self.monthsDropdownContainer;\n }\n var yearInput = createNumberInput(\"cur-year\", { tabindex: \"-1\" });\n var yearElement = yearInput.getElementsByTagName(\"input\")[0];\n yearElement.setAttribute(\"aria-label\", self.l10n.yearAriaLabel);\n if (self.config.minDate) {\n yearElement.setAttribute(\"min\", self.config.minDate.getFullYear().toString());\n }\n if (self.config.maxDate) {\n yearElement.setAttribute(\"max\", self.config.maxDate.getFullYear().toString());\n yearElement.disabled =\n !!self.config.minDate &&\n self.config.minDate.getFullYear() === self.config.maxDate.getFullYear();\n }\n var currentMonth = createElement(\"div\", \"flatpickr-current-month\");\n currentMonth.appendChild(monthElement);\n currentMonth.appendChild(yearInput);\n monthNavFragment.appendChild(currentMonth);\n container.appendChild(monthNavFragment);\n return {\n container: container,\n yearElement: yearElement,\n monthElement: monthElement\n };\n }\n function buildMonths() {\n clearNode(self.monthNav);\n self.monthNav.appendChild(self.prevMonthNav);\n if (self.config.showMonths) {\n self.yearElements = [];\n self.monthElements = [];\n }\n for (var m = self.config.showMonths; m--;) {\n var month = buildMonth();\n self.yearElements.push(month.yearElement);\n self.monthElements.push(month.monthElement);\n self.monthNav.appendChild(month.container);\n }\n self.monthNav.appendChild(self.nextMonthNav);\n }\n function buildMonthNav() {\n self.monthNav = createElement(\"div\", \"flatpickr-months\");\n self.yearElements = [];\n self.monthElements = [];\n self.prevMonthNav = createElement(\"span\", \"flatpickr-prev-month\");\n self.prevMonthNav.innerHTML = self.config.prevArrow;\n self.nextMonthNav = createElement(\"span\", \"flatpickr-next-month\");\n self.nextMonthNav.innerHTML = self.config.nextArrow;\n buildMonths();\n Object.defineProperty(self, \"_hidePrevMonthArrow\", {\n get: function () { return self.__hidePrevMonthArrow; },\n set: function (bool) {\n if (self.__hidePrevMonthArrow !== bool) {\n toggleClass(self.prevMonthNav, \"flatpickr-disabled\", bool);\n self.__hidePrevMonthArrow = bool;\n }\n }\n });\n Object.defineProperty(self, \"_hideNextMonthArrow\", {\n get: function () { return self.__hideNextMonthArrow; },\n set: function (bool) {\n if (self.__hideNextMonthArrow !== bool) {\n toggleClass(self.nextMonthNav, \"flatpickr-disabled\", bool);\n self.__hideNextMonthArrow = bool;\n }\n }\n });\n self.currentYearElement = self.yearElements[0];\n updateNavigationCurrentMonth();\n return self.monthNav;\n }\n function buildTime() {\n self.calendarContainer.classList.add(\"hasTime\");\n if (self.config.noCalendar)\n self.calendarContainer.classList.add(\"noCalendar\");\n self.timeContainer = createElement(\"div\", \"flatpickr-time\");\n self.timeContainer.tabIndex = -1;\n var separator = createElement(\"span\", \"flatpickr-time-separator\", \":\");\n var hourInput = createNumberInput(\"flatpickr-hour\", {\n \"aria-label\": self.l10n.hourAriaLabel\n });\n self.hourElement = hourInput.getElementsByTagName(\"input\")[0];\n var minuteInput = createNumberInput(\"flatpickr-minute\", {\n \"aria-label\": self.l10n.minuteAriaLabel\n });\n self.minuteElement = minuteInput.getElementsByTagName(\"input\")[0];\n self.hourElement.tabIndex = self.minuteElement.tabIndex = -1;\n self.hourElement.value = pad(self.latestSelectedDateObj\n ? self.latestSelectedDateObj.getHours()\n : self.config.time_24hr\n ? self.config.defaultHour\n : military2ampm(self.config.defaultHour));\n self.minuteElement.value = pad(self.latestSelectedDateObj\n ? self.latestSelectedDateObj.getMinutes()\n : self.config.defaultMinute);\n self.hourElement.setAttribute(\"step\", self.config.hourIncrement.toString());\n self.minuteElement.setAttribute(\"step\", self.config.minuteIncrement.toString());\n self.hourElement.setAttribute(\"min\", self.config.time_24hr ? \"0\" : \"1\");\n self.hourElement.setAttribute(\"max\", self.config.time_24hr ? \"23\" : \"12\");\n self.minuteElement.setAttribute(\"min\", \"0\");\n self.minuteElement.setAttribute(\"max\", \"59\");\n self.timeContainer.appendChild(hourInput);\n self.timeContainer.appendChild(separator);\n self.timeContainer.appendChild(minuteInput);\n if (self.config.time_24hr)\n self.timeContainer.classList.add(\"time24hr\");\n if (self.config.enableSeconds) {\n self.timeContainer.classList.add(\"hasSeconds\");\n var secondInput = createNumberInput(\"flatpickr-second\");\n self.secondElement = secondInput.getElementsByTagName(\"input\")[0];\n self.secondElement.value = pad(self.latestSelectedDateObj\n ? self.latestSelectedDateObj.getSeconds()\n : self.config.defaultSeconds);\n self.secondElement.setAttribute(\"step\", self.minuteElement.getAttribute(\"step\"));\n self.secondElement.setAttribute(\"min\", \"0\");\n self.secondElement.setAttribute(\"max\", \"59\");\n self.timeContainer.appendChild(createElement(\"span\", \"flatpickr-time-separator\", \":\"));\n self.timeContainer.appendChild(secondInput);\n }\n if (!self.config.time_24hr) {\n // add self.amPM if appropriate\n self.amPM = createElement(\"span\", \"flatpickr-am-pm\", self.l10n.amPM[int((self.latestSelectedDateObj\n ? self.hourElement.value\n : self.config.defaultHour) > 11)]);\n self.amPM.title = self.l10n.toggleTitle;\n self.amPM.tabIndex = -1;\n self.timeContainer.appendChild(self.amPM);\n }\n return self.timeContainer;\n }\n function buildWeekdays() {\n if (!self.weekdayContainer)\n self.weekdayContainer = createElement(\"div\", \"flatpickr-weekdays\");\n else\n clearNode(self.weekdayContainer);\n for (var i = self.config.showMonths; i--;) {\n var container = createElement(\"div\", \"flatpickr-weekdaycontainer\");\n self.weekdayContainer.appendChild(container);\n }\n updateWeekdays();\n return self.weekdayContainer;\n }\n function updateWeekdays() {\n if (!self.weekdayContainer) {\n return;\n }\n var firstDayOfWeek = self.l10n.firstDayOfWeek;\n var weekdays = self.l10n.weekdays.shorthand.slice();\n if (firstDayOfWeek > 0 && firstDayOfWeek < weekdays.length) {\n weekdays = weekdays.splice(firstDayOfWeek, weekdays.length).concat(weekdays.splice(0, firstDayOfWeek));\n }\n for (var i = self.config.showMonths; i--;) {\n self.weekdayContainer.children[i].innerHTML = \"\\n \\n \" + weekdays.join(\"\") + \"\\n \\n \";\n }\n }\n /* istanbul ignore next */\n function buildWeeks() {\n self.calendarContainer.classList.add(\"hasWeeks\");\n var weekWrapper = createElement(\"div\", \"flatpickr-weekwrapper\");\n weekWrapper.appendChild(createElement(\"span\", \"flatpickr-weekday\", self.l10n.weekAbbreviation));\n var weekNumbers = createElement(\"div\", \"flatpickr-weeks\");\n weekWrapper.appendChild(weekNumbers);\n return {\n weekWrapper: weekWrapper,\n weekNumbers: weekNumbers\n };\n }\n function changeMonth(value, isOffset) {\n if (isOffset === void 0) { isOffset = true; }\n var delta = isOffset ? value : value - self.currentMonth;\n if ((delta < 0 && self._hidePrevMonthArrow === true) ||\n (delta > 0 && self._hideNextMonthArrow === true))\n return;\n self.currentMonth += delta;\n if (self.currentMonth < 0 || self.currentMonth > 11) {\n self.currentYear += self.currentMonth > 11 ? 1 : -1;\n self.currentMonth = (self.currentMonth + 12) % 12;\n triggerEvent(\"onYearChange\");\n buildMonthSwitch();\n }\n buildDays();\n triggerEvent(\"onMonthChange\");\n updateNavigationCurrentMonth();\n }\n function clear(triggerChangeEvent, toInitial) {\n if (triggerChangeEvent === void 0) { triggerChangeEvent = true; }\n if (toInitial === void 0) { toInitial = true; }\n self.input.value = \"\";\n if (self.altInput !== undefined)\n self.altInput.value = \"\";\n if (self.mobileInput !== undefined)\n self.mobileInput.value = \"\";\n self.selectedDates = [];\n self.latestSelectedDateObj = undefined;\n if (toInitial === true) {\n self.currentYear = self._initialDate.getFullYear();\n self.currentMonth = self._initialDate.getMonth();\n }\n self.showTimeInput = false;\n if (self.config.enableTime === true) {\n setDefaultHours();\n }\n self.redraw();\n if (triggerChangeEvent)\n // triggerChangeEvent is true (default) or an Event\n triggerEvent(\"onChange\");\n }\n function close() {\n self.isOpen = false;\n if (!self.isMobile) {\n if (self.calendarContainer !== undefined) {\n self.calendarContainer.classList.remove(\"open\");\n }\n if (self._input !== undefined) {\n self._input.classList.remove(\"active\");\n }\n }\n triggerEvent(\"onClose\");\n }\n function destroy() {\n if (self.config !== undefined)\n triggerEvent(\"onDestroy\");\n for (var i = self._handlers.length; i--;) {\n var h = self._handlers[i];\n h.element.removeEventListener(h.event, h.handler, h.options);\n }\n self._handlers = [];\n if (self.mobileInput) {\n if (self.mobileInput.parentNode)\n self.mobileInput.parentNode.removeChild(self.mobileInput);\n self.mobileInput = undefined;\n }\n else if (self.calendarContainer && self.calendarContainer.parentNode) {\n if (self.config.static && self.calendarContainer.parentNode) {\n var wrapper = self.calendarContainer.parentNode;\n wrapper.lastChild && wrapper.removeChild(wrapper.lastChild);\n if (wrapper.parentNode) {\n while (wrapper.firstChild)\n wrapper.parentNode.insertBefore(wrapper.firstChild, wrapper);\n wrapper.parentNode.removeChild(wrapper);\n }\n }\n else\n self.calendarContainer.parentNode.removeChild(self.calendarContainer);\n }\n if (self.altInput) {\n self.input.type = \"text\";\n if (self.altInput.parentNode)\n self.altInput.parentNode.removeChild(self.altInput);\n delete self.altInput;\n }\n if (self.input) {\n self.input.type = self.input._type;\n self.input.classList.remove(\"flatpickr-input\");\n self.input.removeAttribute(\"readonly\");\n self.input.value = \"\";\n }\n [\n \"_showTimeInput\",\n \"latestSelectedDateObj\",\n \"_hideNextMonthArrow\",\n \"_hidePrevMonthArrow\",\n \"__hideNextMonthArrow\",\n \"__hidePrevMonthArrow\",\n \"isMobile\",\n \"isOpen\",\n \"selectedDateElem\",\n \"minDateHasTime\",\n \"maxDateHasTime\",\n \"days\",\n \"daysContainer\",\n \"_input\",\n \"_positionElement\",\n \"innerContainer\",\n \"rContainer\",\n \"monthNav\",\n \"todayDateElem\",\n \"calendarContainer\",\n \"weekdayContainer\",\n \"prevMonthNav\",\n \"nextMonthNav\",\n \"monthsDropdownContainer\",\n \"currentMonthElement\",\n \"currentYearElement\",\n \"navigationCurrentMonth\",\n \"selectedDateElem\",\n \"config\",\n ].forEach(function (k) {\n try {\n delete self[k];\n }\n catch (_) { }\n });\n }\n function isCalendarElem(elem) {\n if (self.config.appendTo && self.config.appendTo.contains(elem))\n return true;\n return self.calendarContainer.contains(elem);\n }\n function documentClick(e) {\n if (self.isOpen && !self.config.inline) {\n var eventTarget_1 = getEventTarget(e);\n var isCalendarElement = isCalendarElem(eventTarget_1);\n var isInput = eventTarget_1 === self.input ||\n eventTarget_1 === self.altInput ||\n self.element.contains(eventTarget_1) ||\n // web components\n // e.path is not present in all browsers. circumventing typechecks\n (e.path &&\n e.path.indexOf &&\n (~e.path.indexOf(self.input) ||\n ~e.path.indexOf(self.altInput)));\n var lostFocus = e.type === \"blur\"\n ? isInput &&\n e.relatedTarget &&\n !isCalendarElem(e.relatedTarget)\n : !isInput &&\n !isCalendarElement &&\n !isCalendarElem(e.relatedTarget);\n var isIgnored = !self.config.ignoredFocusElements.some(function (elem) {\n return elem.contains(eventTarget_1);\n });\n if (lostFocus && isIgnored) {\n if (self.timeContainer !== undefined &&\n self.minuteElement !== undefined &&\n self.hourElement !== undefined) {\n updateTime();\n }\n self.close();\n if (self.config.mode === \"range\" && self.selectedDates.length === 1) {\n self.clear(false);\n self.redraw();\n }\n }\n }\n }\n function changeYear(newYear) {\n if (!newYear ||\n (self.config.minDate && newYear < self.config.minDate.getFullYear()) ||\n (self.config.maxDate && newYear > self.config.maxDate.getFullYear()))\n return;\n var newYearNum = newYear, isNewYear = self.currentYear !== newYearNum;\n self.currentYear = newYearNum || self.currentYear;\n if (self.config.maxDate &&\n self.currentYear === self.config.maxDate.getFullYear()) {\n self.currentMonth = Math.min(self.config.maxDate.getMonth(), self.currentMonth);\n }\n else if (self.config.minDate &&\n self.currentYear === self.config.minDate.getFullYear()) {\n self.currentMonth = Math.max(self.config.minDate.getMonth(), self.currentMonth);\n }\n if (isNewYear) {\n self.redraw();\n triggerEvent(\"onYearChange\");\n buildMonthSwitch();\n }\n }\n function isEnabled(date, timeless) {\n if (timeless === void 0) { timeless = true; }\n var dateToCheck = self.parseDate(date, undefined, timeless); // timeless\n if ((self.config.minDate &&\n dateToCheck &&\n compareDates(dateToCheck, self.config.minDate, timeless !== undefined ? timeless : !self.minDateHasTime) < 0) ||\n (self.config.maxDate &&\n dateToCheck &&\n compareDates(dateToCheck, self.config.maxDate, timeless !== undefined ? timeless : !self.maxDateHasTime) > 0))\n return false;\n if (self.config.enable.length === 0 && self.config.disable.length === 0)\n return true;\n if (dateToCheck === undefined)\n return false;\n var bool = self.config.enable.length > 0, array = bool ? self.config.enable : self.config.disable;\n for (var i = 0, d = void 0; i < array.length; i++) {\n d = array[i];\n if (typeof d === \"function\" &&\n d(dateToCheck) // disabled by function\n )\n return bool;\n else if (d instanceof Date &&\n dateToCheck !== undefined &&\n d.getTime() === dateToCheck.getTime())\n // disabled by date\n return bool;\n else if (typeof d === \"string\" && dateToCheck !== undefined) {\n // disabled by date string\n var parsed = self.parseDate(d, undefined, true);\n return parsed && parsed.getTime() === dateToCheck.getTime()\n ? bool\n : !bool;\n }\n else if (\n // disabled by range\n typeof d === \"object\" &&\n dateToCheck !== undefined &&\n d.from &&\n d.to &&\n dateToCheck.getTime() >= d.from.getTime() &&\n dateToCheck.getTime() <= d.to.getTime())\n return bool;\n }\n return !bool;\n }\n function isInView(elem) {\n if (self.daysContainer !== undefined)\n return (elem.className.indexOf(\"hidden\") === -1 &&\n self.daysContainer.contains(elem));\n return false;\n }\n function onKeyDown(e) {\n // e.key e.keyCode\n // \"Backspace\" 8\n // \"Tab\" 9\n // \"Enter\" 13\n // \"Escape\" (IE \"Esc\") 27\n // \"ArrowLeft\" (IE \"Left\") 37\n // \"ArrowUp\" (IE \"Up\") 38\n // \"ArrowRight\" (IE \"Right\") 39\n // \"ArrowDown\" (IE \"Down\") 40\n // \"Delete\" (IE \"Del\") 46\n var isInput = e.target === self._input;\n var allowInput = self.config.allowInput;\n var allowKeydown = self.isOpen && (!allowInput || !isInput);\n var allowInlineKeydown = self.config.inline && isInput && !allowInput;\n if (e.keyCode === 13 && isInput) {\n if (allowInput) {\n self.setDate(self._input.value, true, e.target === self.altInput\n ? self.config.altFormat\n : self.config.dateFormat);\n return e.target.blur();\n }\n else {\n self.open();\n }\n }\n else if (isCalendarElem(e.target) ||\n allowKeydown ||\n allowInlineKeydown) {\n var isTimeObj = !!self.timeContainer &&\n self.timeContainer.contains(e.target);\n switch (e.keyCode) {\n case 13:\n if (isTimeObj) {\n e.preventDefault();\n updateTime();\n focusAndClose();\n }\n else\n selectDate(e);\n break;\n case 27: // escape\n e.preventDefault();\n focusAndClose();\n break;\n case 8:\n case 46:\n if (isInput && !self.config.allowInput) {\n e.preventDefault();\n self.clear();\n }\n break;\n case 37:\n case 39:\n if (!isTimeObj && !isInput) {\n e.preventDefault();\n if (self.daysContainer !== undefined &&\n (allowInput === false ||\n (document.activeElement && isInView(document.activeElement)))) {\n var delta_1 = e.keyCode === 39 ? 1 : -1;\n if (!e.ctrlKey)\n focusOnDay(undefined, delta_1);\n else {\n e.stopPropagation();\n changeMonth(delta_1);\n focusOnDay(getFirstAvailableDay(1), 0);\n }\n }\n }\n else if (self.hourElement)\n self.hourElement.focus();\n break;\n case 38:\n case 40:\n e.preventDefault();\n var delta = e.keyCode === 40 ? 1 : -1;\n if ((self.daysContainer && e.target.$i !== undefined) ||\n e.target === self.input ||\n e.target === self.altInput) {\n if (e.ctrlKey) {\n e.stopPropagation();\n changeYear(self.currentYear - delta);\n focusOnDay(getFirstAvailableDay(1), 0);\n }\n else if (!isTimeObj)\n focusOnDay(undefined, delta * 7);\n }\n else if (e.target === self.currentYearElement) {\n changeYear(self.currentYear - delta);\n }\n else if (self.config.enableTime) {\n if (!isTimeObj && self.hourElement)\n self.hourElement.focus();\n updateTime(e);\n self._debouncedChange();\n }\n break;\n case 9:\n if (isTimeObj) {\n var elems = [\n self.hourElement,\n self.minuteElement,\n self.secondElement,\n self.amPM,\n ]\n .concat(self.pluginElements)\n .filter(function (x) { return x; });\n var i = elems.indexOf(e.target);\n if (i !== -1) {\n var target = elems[i + (e.shiftKey ? -1 : 1)];\n e.preventDefault();\n (target || self._input).focus();\n }\n }\n else if (!self.config.noCalendar &&\n self.daysContainer &&\n self.daysContainer.contains(e.target) &&\n e.shiftKey) {\n e.preventDefault();\n self._input.focus();\n }\n break;\n default:\n break;\n }\n }\n if (self.amPM !== undefined && e.target === self.amPM) {\n switch (e.key) {\n case self.l10n.amPM[0].charAt(0):\n case self.l10n.amPM[0].charAt(0).toLowerCase():\n self.amPM.textContent = self.l10n.amPM[0];\n setHoursFromInputs();\n updateValue();\n break;\n case self.l10n.amPM[1].charAt(0):\n case self.l10n.amPM[1].charAt(0).toLowerCase():\n self.amPM.textContent = self.l10n.amPM[1];\n setHoursFromInputs();\n updateValue();\n break;\n }\n }\n if (isInput || isCalendarElem(e.target)) {\n triggerEvent(\"onKeyDown\", e);\n }\n }\n function onMouseOver(elem) {\n if (self.selectedDates.length !== 1 ||\n (elem &&\n (!elem.classList.contains(\"flatpickr-day\") ||\n elem.classList.contains(\"flatpickr-disabled\"))))\n return;\n var hoverDate = elem\n ? elem.dateObj.getTime()\n : self.days.firstElementChild.dateObj.getTime(), initialDate = self.parseDate(self.selectedDates[0], undefined, true).getTime(), rangeStartDate = Math.min(hoverDate, self.selectedDates[0].getTime()), rangeEndDate = Math.max(hoverDate, self.selectedDates[0].getTime());\n var containsDisabled = false;\n var minRange = 0, maxRange = 0;\n for (var t = rangeStartDate; t < rangeEndDate; t += duration.DAY) {\n if (!isEnabled(new Date(t), true)) {\n containsDisabled =\n containsDisabled || (t > rangeStartDate && t < rangeEndDate);\n if (t < initialDate && (!minRange || t > minRange))\n minRange = t;\n else if (t > initialDate && (!maxRange || t < maxRange))\n maxRange = t;\n }\n }\n for (var m = 0; m < self.config.showMonths; m++) {\n var month = self.daysContainer.children[m];\n var _loop_1 = function (i, l) {\n var dayElem = month.children[i], date = dayElem.dateObj;\n var timestamp = date.getTime();\n var outOfRange = (minRange > 0 && timestamp < minRange) ||\n (maxRange > 0 && timestamp > maxRange);\n if (outOfRange) {\n dayElem.classList.add(\"notAllowed\");\n [\"inRange\", \"startRange\", \"endRange\"].forEach(function (c) {\n dayElem.classList.remove(c);\n });\n return \"continue\";\n }\n else if (containsDisabled && !outOfRange)\n return \"continue\";\n [\"startRange\", \"inRange\", \"endRange\", \"notAllowed\"].forEach(function (c) {\n dayElem.classList.remove(c);\n });\n if (elem !== undefined) {\n elem.classList.add(hoverDate <= self.selectedDates[0].getTime()\n ? \"startRange\"\n : \"endRange\");\n if (initialDate < hoverDate && timestamp === initialDate)\n dayElem.classList.add(\"startRange\");\n else if (initialDate > hoverDate && timestamp === initialDate)\n dayElem.classList.add(\"endRange\");\n if (timestamp >= minRange &&\n (maxRange === 0 || timestamp <= maxRange) &&\n isBetween(timestamp, initialDate, hoverDate))\n dayElem.classList.add(\"inRange\");\n }\n };\n for (var i = 0, l = month.children.length; i < l; i++) {\n _loop_1(i, l);\n }\n }\n }\n function onResize() {\n if (self.isOpen && !self.config.static && !self.config.inline)\n positionCalendar();\n }\n function setDefaultTime() {\n self.setDate(self.config.minDate !== undefined\n ? new Date(self.config.minDate.getTime())\n : new Date(), true);\n setDefaultHours();\n updateValue();\n }\n function open(e, positionElement) {\n if (positionElement === void 0) { positionElement = self._positionElement; }\n if (self.isMobile === true) {\n if (e) {\n e.preventDefault();\n e.target && e.target.blur();\n }\n if (self.mobileInput !== undefined) {\n self.mobileInput.focus();\n self.mobileInput.click();\n }\n triggerEvent(\"onOpen\");\n return;\n }\n if (self._input.disabled || self.config.inline)\n return;\n var wasOpen = self.isOpen;\n self.isOpen = true;\n if (!wasOpen) {\n self.calendarContainer.classList.add(\"open\");\n self._input.classList.add(\"active\");\n triggerEvent(\"onOpen\");\n positionCalendar(positionElement);\n }\n if (self.config.enableTime === true && self.config.noCalendar === true) {\n if (self.selectedDates.length === 0) {\n setDefaultTime();\n }\n if (self.config.allowInput === false &&\n (e === undefined ||\n !self.timeContainer.contains(e.relatedTarget))) {\n setTimeout(function () { return self.hourElement.select(); }, 50);\n }\n }\n }\n function minMaxDateSetter(type) {\n return function (date) {\n var dateObj = (self.config[\"_\" + type + \"Date\"] = self.parseDate(date, self.config.dateFormat));\n var inverseDateObj = self.config[\"_\" + (type === \"min\" ? \"max\" : \"min\") + \"Date\"];\n if (dateObj !== undefined) {\n self[type === \"min\" ? \"minDateHasTime\" : \"maxDateHasTime\"] =\n dateObj.getHours() > 0 ||\n dateObj.getMinutes() > 0 ||\n dateObj.getSeconds() > 0;\n }\n if (self.selectedDates) {\n self.selectedDates = self.selectedDates.filter(function (d) { return isEnabled(d); });\n if (!self.selectedDates.length && type === \"min\")\n setHoursFromDate(dateObj);\n updateValue();\n }\n if (self.daysContainer) {\n redraw();\n if (dateObj !== undefined)\n self.currentYearElement[type] = dateObj.getFullYear().toString();\n else\n self.currentYearElement.removeAttribute(type);\n self.currentYearElement.disabled =\n !!inverseDateObj &&\n dateObj !== undefined &&\n inverseDateObj.getFullYear() === dateObj.getFullYear();\n }\n };\n }\n function parseConfig() {\n var boolOpts = [\n \"wrap\",\n \"weekNumbers\",\n \"allowInput\",\n \"clickOpens\",\n \"time_24hr\",\n \"enableTime\",\n \"noCalendar\",\n \"altInput\",\n \"shorthandCurrentMonth\",\n \"inline\",\n \"static\",\n \"enableSeconds\",\n \"disableMobile\",\n ];\n var userConfig = __assign({}, instanceConfig, JSON.parse(JSON.stringify(element.dataset || {})));\n var formats = {};\n self.config.parseDate = userConfig.parseDate;\n self.config.formatDate = userConfig.formatDate;\n Object.defineProperty(self.config, \"enable\", {\n get: function () { return self.config._enable; },\n set: function (dates) {\n self.config._enable = parseDateRules(dates);\n }\n });\n Object.defineProperty(self.config, \"disable\", {\n get: function () { return self.config._disable; },\n set: function (dates) {\n self.config._disable = parseDateRules(dates);\n }\n });\n var timeMode = userConfig.mode === \"time\";\n if (!userConfig.dateFormat && (userConfig.enableTime || timeMode)) {\n var defaultDateFormat = flatpickr.defaultConfig.dateFormat || defaults.dateFormat;\n formats.dateFormat =\n userConfig.noCalendar || timeMode\n ? \"H:i\" + (userConfig.enableSeconds ? \":S\" : \"\")\n : defaultDateFormat + \" H:i\" + (userConfig.enableSeconds ? \":S\" : \"\");\n }\n if (userConfig.altInput &&\n (userConfig.enableTime || timeMode) &&\n !userConfig.altFormat) {\n var defaultAltFormat = flatpickr.defaultConfig.altFormat || defaults.altFormat;\n formats.altFormat =\n userConfig.noCalendar || timeMode\n ? \"h:i\" + (userConfig.enableSeconds ? \":S K\" : \" K\")\n : defaultAltFormat + (\" h:i\" + (userConfig.enableSeconds ? \":S\" : \"\") + \" K\");\n }\n if (!userConfig.altInputClass) {\n self.config.altInputClass =\n self.input.className + \" \" + self.config.altInputClass;\n }\n Object.defineProperty(self.config, \"minDate\", {\n get: function () { return self.config._minDate; },\n set: minMaxDateSetter(\"min\")\n });\n Object.defineProperty(self.config, \"maxDate\", {\n get: function () { return self.config._maxDate; },\n set: minMaxDateSetter(\"max\")\n });\n var minMaxTimeSetter = function (type) { return function (val) {\n self.config[type === \"min\" ? \"_minTime\" : \"_maxTime\"] = self.parseDate(val, \"H:i:S\");\n }; };\n Object.defineProperty(self.config, \"minTime\", {\n get: function () { return self.config._minTime; },\n set: minMaxTimeSetter(\"min\")\n });\n Object.defineProperty(self.config, \"maxTime\", {\n get: function () { return self.config._maxTime; },\n set: minMaxTimeSetter(\"max\")\n });\n if (userConfig.mode === \"time\") {\n self.config.noCalendar = true;\n self.config.enableTime = true;\n }\n Object.assign(self.config, formats, userConfig);\n for (var i = 0; i < boolOpts.length; i++)\n self.config[boolOpts[i]] =\n self.config[boolOpts[i]] === true ||\n self.config[boolOpts[i]] === \"true\";\n HOOKS.filter(function (hook) { return self.config[hook] !== undefined; }).forEach(function (hook) {\n self.config[hook] = arrayify(self.config[hook] || []).map(bindToInstance);\n });\n self.isMobile =\n !self.config.disableMobile &&\n !self.config.inline &&\n self.config.mode === \"single\" &&\n !self.config.disable.length &&\n !self.config.enable.length &&\n !self.config.weekNumbers &&\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);\n for (var i = 0; i < self.config.plugins.length; i++) {\n var pluginConf = self.config.plugins[i](self) || {};\n for (var key in pluginConf) {\n if (HOOKS.indexOf(key) > -1) {\n self.config[key] = arrayify(pluginConf[key])\n .map(bindToInstance)\n .concat(self.config[key]);\n }\n else if (typeof userConfig[key] === \"undefined\")\n self.config[key] = pluginConf[key];\n }\n }\n triggerEvent(\"onParseConfig\");\n }\n function setupLocale() {\n if (typeof self.config.locale !== \"object\" &&\n typeof flatpickr.l10ns[self.config.locale] === \"undefined\")\n self.config.errorHandler(new Error(\"flatpickr: invalid locale \" + self.config.locale));\n self.l10n = __assign({}, flatpickr.l10ns[\"default\"], (typeof self.config.locale === \"object\"\n ? self.config.locale\n : self.config.locale !== \"default\"\n ? flatpickr.l10ns[self.config.locale]\n : undefined));\n tokenRegex.K = \"(\" + self.l10n.amPM[0] + \"|\" + self.l10n.amPM[1] + \"|\" + self.l10n.amPM[0].toLowerCase() + \"|\" + self.l10n.amPM[1].toLowerCase() + \")\";\n var userConfig = __assign({}, instanceConfig, JSON.parse(JSON.stringify(element.dataset || {})));\n if (userConfig.time_24hr === undefined &&\n flatpickr.defaultConfig.time_24hr === undefined) {\n self.config.time_24hr = self.l10n.time_24hr;\n }\n self.formatDate = createDateFormatter(self);\n self.parseDate = createDateParser({ config: self.config, l10n: self.l10n });\n }\n function positionCalendar(customPositionElement) {\n if (self.calendarContainer === undefined)\n return;\n triggerEvent(\"onPreCalendarPosition\");\n var positionElement = customPositionElement || self._positionElement;\n var calendarHeight = Array.prototype.reduce.call(self.calendarContainer.children, (function (acc, child) { return acc + child.offsetHeight; }), 0), calendarWidth = self.calendarContainer.offsetWidth, configPos = self.config.position.split(\" \"), configPosVertical = configPos[0], configPosHorizontal = configPos.length > 1 ? configPos[1] : null, inputBounds = positionElement.getBoundingClientRect(), distanceFromBottom = window.innerHeight - inputBounds.bottom, showOnTop = configPosVertical === \"above\" ||\n (configPosVertical !== \"below\" &&\n distanceFromBottom < calendarHeight &&\n inputBounds.top > calendarHeight);\n var top = window.pageYOffset +\n inputBounds.top +\n (!showOnTop ? positionElement.offsetHeight + 2 : -calendarHeight - 2);\n toggleClass(self.calendarContainer, \"arrowTop\", !showOnTop);\n toggleClass(self.calendarContainer, \"arrowBottom\", showOnTop);\n if (self.config.inline)\n return;\n var left = window.pageXOffset +\n inputBounds.left -\n (configPosHorizontal != null && configPosHorizontal === \"center\"\n ? (calendarWidth - inputBounds.width) / 2\n : 0);\n var right = window.document.body.offsetWidth - (window.pageXOffset + inputBounds.right);\n var rightMost = left + calendarWidth > window.document.body.offsetWidth;\n var centerMost = right + calendarWidth > window.document.body.offsetWidth;\n toggleClass(self.calendarContainer, \"rightMost\", rightMost);\n if (self.config.static)\n return;\n self.calendarContainer.style.top = top + \"px\";\n if (!rightMost) {\n self.calendarContainer.style.left = left + \"px\";\n self.calendarContainer.style.right = \"auto\";\n }\n else if (!centerMost) {\n self.calendarContainer.style.left = \"auto\";\n self.calendarContainer.style.right = right + \"px\";\n }\n else {\n var doc = document.styleSheets[0];\n // some testing environments don't have css support\n if (doc === undefined)\n return;\n var bodyWidth = window.document.body.offsetWidth;\n var centerLeft = Math.max(0, bodyWidth / 2 - calendarWidth / 2);\n var centerBefore = \".flatpickr-calendar.centerMost:before\";\n var centerAfter = \".flatpickr-calendar.centerMost:after\";\n var centerIndex = doc.cssRules.length;\n var centerStyle = \"{left:\" + inputBounds.left + \"px;right:auto;}\";\n toggleClass(self.calendarContainer, \"rightMost\", false);\n toggleClass(self.calendarContainer, \"centerMost\", true);\n doc.insertRule(centerBefore + \",\" + centerAfter + centerStyle, centerIndex);\n self.calendarContainer.style.left = centerLeft + \"px\";\n self.calendarContainer.style.right = \"auto\";\n }\n }\n function redraw() {\n if (self.config.noCalendar || self.isMobile)\n return;\n updateNavigationCurrentMonth();\n buildDays();\n }\n function focusAndClose() {\n self._input.focus();\n if (window.navigator.userAgent.indexOf(\"MSIE\") !== -1 ||\n navigator.msMaxTouchPoints !== undefined) {\n // hack - bugs in the way IE handles focus keeps the calendar open\n setTimeout(self.close, 0);\n }\n else {\n self.close();\n }\n }\n function selectDate(e) {\n e.preventDefault();\n e.stopPropagation();\n var isSelectable = function (day) {\n return day.classList &&\n day.classList.contains(\"flatpickr-day\") &&\n !day.classList.contains(\"flatpickr-disabled\") &&\n !day.classList.contains(\"notAllowed\");\n };\n var t = findParent(e.target, isSelectable);\n if (t === undefined)\n return;\n var target = t;\n var selectedDate = (self.latestSelectedDateObj = new Date(target.dateObj.getTime()));\n var shouldChangeMonth = (selectedDate.getMonth() < self.currentMonth ||\n selectedDate.getMonth() >\n self.currentMonth + self.config.showMonths - 1) &&\n self.config.mode !== \"range\";\n self.selectedDateElem = target;\n if (self.config.mode === \"single\")\n self.selectedDates = [selectedDate];\n else if (self.config.mode === \"multiple\") {\n var selectedIndex = isDateSelected(selectedDate);\n if (selectedIndex)\n self.selectedDates.splice(parseInt(selectedIndex), 1);\n else\n self.selectedDates.push(selectedDate);\n }\n else if (self.config.mode === \"range\") {\n if (self.selectedDates.length === 2) {\n self.clear(false, false);\n }\n self.latestSelectedDateObj = selectedDate;\n self.selectedDates.push(selectedDate);\n // unless selecting same date twice, sort ascendingly\n if (compareDates(selectedDate, self.selectedDates[0], true) !== 0)\n self.selectedDates.sort(function (a, b) { return a.getTime() - b.getTime(); });\n }\n setHoursFromInputs();\n if (shouldChangeMonth) {\n var isNewYear = self.currentYear !== selectedDate.getFullYear();\n self.currentYear = selectedDate.getFullYear();\n self.currentMonth = selectedDate.getMonth();\n if (isNewYear) {\n triggerEvent(\"onYearChange\");\n buildMonthSwitch();\n }\n triggerEvent(\"onMonthChange\");\n }\n updateNavigationCurrentMonth();\n buildDays();\n updateValue();\n if (self.config.enableTime)\n setTimeout(function () { return (self.showTimeInput = true); }, 50);\n // maintain focus\n if (!shouldChangeMonth &&\n self.config.mode !== \"range\" &&\n self.config.showMonths === 1)\n focusOnDayElem(target);\n else if (self.selectedDateElem !== undefined &&\n self.hourElement === undefined) {\n self.selectedDateElem && self.selectedDateElem.focus();\n }\n if (self.hourElement !== undefined)\n self.hourElement !== undefined && self.hourElement.focus();\n if (self.config.closeOnSelect) {\n var single = self.config.mode === \"single\" && !self.config.enableTime;\n var range = self.config.mode === \"range\" &&\n self.selectedDates.length === 2 &&\n !self.config.enableTime;\n if (single || range) {\n focusAndClose();\n }\n }\n triggerChange();\n }\n var CALLBACKS = {\n locale: [setupLocale, updateWeekdays],\n showMonths: [buildMonths, setCalendarWidth, buildWeekdays],\n minDate: [jumpToDate],\n maxDate: [jumpToDate]\n };\n function set(option, value) {\n if (option !== null && typeof option === \"object\") {\n Object.assign(self.config, option);\n for (var key in option) {\n if (CALLBACKS[key] !== undefined)\n CALLBACKS[key].forEach(function (x) { return x(); });\n }\n }\n else {\n self.config[option] = value;\n if (CALLBACKS[option] !== undefined)\n CALLBACKS[option].forEach(function (x) { return x(); });\n else if (HOOKS.indexOf(option) > -1)\n self.config[option] = arrayify(value);\n }\n self.redraw();\n updateValue(false);\n }\n function setSelectedDate(inputDate, format) {\n var dates = [];\n if (inputDate instanceof Array)\n dates = inputDate.map(function (d) { return self.parseDate(d, format); });\n else if (inputDate instanceof Date || typeof inputDate === \"number\")\n dates = [self.parseDate(inputDate, format)];\n else if (typeof inputDate === \"string\") {\n switch (self.config.mode) {\n case \"single\":\n case \"time\":\n dates = [self.parseDate(inputDate, format)];\n break;\n case \"multiple\":\n dates = inputDate\n .split(self.config.conjunction)\n .map(function (date) { return self.parseDate(date, format); });\n break;\n case \"range\":\n dates = inputDate\n .split(self.l10n.rangeSeparator)\n .map(function (date) { return self.parseDate(date, format); });\n break;\n default:\n break;\n }\n }\n else\n self.config.errorHandler(new Error(\"Invalid date supplied: \" + JSON.stringify(inputDate)));\n self.selectedDates = dates.filter(function (d) { return d instanceof Date && isEnabled(d, false); });\n if (self.config.mode === \"range\")\n self.selectedDates.sort(function (a, b) { return a.getTime() - b.getTime(); });\n }\n function setDate(date, triggerChange, format) {\n if (triggerChange === void 0) { triggerChange = false; }\n if (format === void 0) { format = self.config.dateFormat; }\n if ((date !== 0 && !date) || (date instanceof Array && date.length === 0))\n return self.clear(triggerChange);\n setSelectedDate(date, format);\n self.showTimeInput = self.selectedDates.length > 0;\n self.latestSelectedDateObj =\n self.selectedDates[self.selectedDates.length - 1];\n self.redraw();\n jumpToDate();\n setHoursFromDate();\n if (self.selectedDates.length === 0) {\n self.clear(false);\n }\n updateValue(triggerChange);\n if (triggerChange)\n triggerEvent(\"onChange\");\n }\n function parseDateRules(arr) {\n return arr\n .slice()\n .map(function (rule) {\n if (typeof rule === \"string\" ||\n typeof rule === \"number\" ||\n rule instanceof Date) {\n return self.parseDate(rule, undefined, true);\n }\n else if (rule &&\n typeof rule === \"object\" &&\n rule.from &&\n rule.to)\n return {\n from: self.parseDate(rule.from, undefined),\n to: self.parseDate(rule.to, undefined)\n };\n return rule;\n })\n .filter(function (x) { return x; }); // remove falsy values\n }\n function setupDates() {\n self.selectedDates = [];\n self.now = self.parseDate(self.config.now) || new Date();\n // Workaround IE11 setting placeholder as the input's value\n var preloadedDate = self.config.defaultDate ||\n ((self.input.nodeName === \"INPUT\" ||\n self.input.nodeName === \"TEXTAREA\") &&\n self.input.placeholder &&\n self.input.value === self.input.placeholder\n ? null\n : self.input.value);\n if (preloadedDate)\n setSelectedDate(preloadedDate, self.config.dateFormat);\n self._initialDate =\n self.selectedDates.length > 0\n ? self.selectedDates[0]\n : self.config.minDate &&\n self.config.minDate.getTime() > self.now.getTime()\n ? self.config.minDate\n : self.config.maxDate &&\n self.config.maxDate.getTime() < self.now.getTime()\n ? self.config.maxDate\n : self.now;\n self.currentYear = self._initialDate.getFullYear();\n self.currentMonth = self._initialDate.getMonth();\n if (self.selectedDates.length > 0)\n self.latestSelectedDateObj = self.selectedDates[0];\n if (self.config.minTime !== undefined)\n self.config.minTime = self.parseDate(self.config.minTime, \"H:i\");\n if (self.config.maxTime !== undefined)\n self.config.maxTime = self.parseDate(self.config.maxTime, \"H:i\");\n self.minDateHasTime =\n !!self.config.minDate &&\n (self.config.minDate.getHours() > 0 ||\n self.config.minDate.getMinutes() > 0 ||\n self.config.minDate.getSeconds() > 0);\n self.maxDateHasTime =\n !!self.config.maxDate &&\n (self.config.maxDate.getHours() > 0 ||\n self.config.maxDate.getMinutes() > 0 ||\n self.config.maxDate.getSeconds() > 0);\n Object.defineProperty(self, \"showTimeInput\", {\n get: function () { return self._showTimeInput; },\n set: function (bool) {\n self._showTimeInput = bool;\n if (self.calendarContainer)\n toggleClass(self.calendarContainer, \"showTimeInput\", bool);\n self.isOpen && positionCalendar();\n }\n });\n }\n function setupInputs() {\n self.input = self.config.wrap\n ? element.querySelector(\"[data-input]\")\n : element;\n /* istanbul ignore next */\n if (!self.input) {\n self.config.errorHandler(new Error(\"Invalid input element specified\"));\n return;\n }\n // hack: store previous type to restore it after destroy()\n self.input._type = self.input.type;\n self.input.type = \"text\";\n self.input.classList.add(\"flatpickr-input\");\n self._input = self.input;\n if (self.config.altInput) {\n // replicate self.element\n self.altInput = createElement(self.input.nodeName, self.config.altInputClass);\n self._input = self.altInput;\n self.altInput.placeholder = self.input.placeholder;\n self.altInput.disabled = self.input.disabled;\n self.altInput.required = self.input.required;\n self.altInput.tabIndex = self.input.tabIndex;\n self.altInput.type = \"text\";\n self.input.setAttribute(\"type\", \"hidden\");\n if (!self.config.static && self.input.parentNode)\n self.input.parentNode.insertBefore(self.altInput, self.input.nextSibling);\n }\n if (!self.config.allowInput)\n self._input.setAttribute(\"readonly\", \"readonly\");\n self._positionElement = self.config.positionElement || self._input;\n }\n function setupMobile() {\n var inputType = self.config.enableTime\n ? self.config.noCalendar\n ? \"time\"\n : \"datetime-local\"\n : \"date\";\n self.mobileInput = createElement(\"input\", self.input.className + \" flatpickr-mobile\");\n self.mobileInput.step = self.input.getAttribute(\"step\") || \"any\";\n self.mobileInput.tabIndex = 1;\n self.mobileInput.type = inputType;\n self.mobileInput.disabled = self.input.disabled;\n self.mobileInput.required = self.input.required;\n self.mobileInput.placeholder = self.input.placeholder;\n self.mobileFormatStr =\n inputType === \"datetime-local\"\n ? \"Y-m-d\\\\TH:i:S\"\n : inputType === \"date\"\n ? \"Y-m-d\"\n : \"H:i:S\";\n if (self.selectedDates.length > 0) {\n self.mobileInput.defaultValue = self.mobileInput.value = self.formatDate(self.selectedDates[0], self.mobileFormatStr);\n }\n if (self.config.minDate)\n self.mobileInput.min = self.formatDate(self.config.minDate, \"Y-m-d\");\n if (self.config.maxDate)\n self.mobileInput.max = self.formatDate(self.config.maxDate, \"Y-m-d\");\n self.input.type = \"hidden\";\n if (self.altInput !== undefined)\n self.altInput.type = \"hidden\";\n try {\n if (self.input.parentNode)\n self.input.parentNode.insertBefore(self.mobileInput, self.input.nextSibling);\n }\n catch (_a) { }\n bind(self.mobileInput, \"change\", function (e) {\n self.setDate(e.target.value, false, self.mobileFormatStr);\n triggerEvent(\"onChange\");\n triggerEvent(\"onClose\");\n });\n }\n function toggle(e) {\n if (self.isOpen === true)\n return self.close();\n self.open(e);\n }\n function triggerEvent(event, data) {\n // If the instance has been destroyed already, all hooks have been removed\n if (self.config === undefined)\n return;\n var hooks = self.config[event];\n if (hooks !== undefined && hooks.length > 0) {\n for (var i = 0; hooks[i] && i < hooks.length; i++)\n hooks[i](self.selectedDates, self.input.value, self, data);\n }\n if (event === \"onChange\") {\n self.input.dispatchEvent(createEvent(\"change\"));\n // many front-end frameworks bind to the input event\n self.input.dispatchEvent(createEvent(\"input\"));\n }\n }\n function createEvent(name) {\n var e = document.createEvent(\"Event\");\n e.initEvent(name, true, true);\n return e;\n }\n function isDateSelected(date) {\n for (var i = 0; i < self.selectedDates.length; i++) {\n if (compareDates(self.selectedDates[i], date) === 0)\n return \"\" + i;\n }\n return false;\n }\n function isDateInRange(date) {\n if (self.config.mode !== \"range\" || self.selectedDates.length < 2)\n return false;\n return (compareDates(date, self.selectedDates[0]) >= 0 &&\n compareDates(date, self.selectedDates[1]) <= 0);\n }\n function updateNavigationCurrentMonth() {\n if (self.config.noCalendar || self.isMobile || !self.monthNav)\n return;\n self.yearElements.forEach(function (yearElement, i) {\n var d = new Date(self.currentYear, self.currentMonth, 1);\n d.setMonth(self.currentMonth + i);\n if (self.config.showMonths > 1 ||\n self.config.monthSelectorType === \"static\") {\n self.monthElements[i].textContent =\n monthToStr(d.getMonth(), self.config.shorthandCurrentMonth, self.l10n) + \" \";\n }\n else {\n self.monthsDropdownContainer.value = d.getMonth().toString();\n }\n yearElement.value = d.getFullYear().toString();\n });\n self._hidePrevMonthArrow =\n self.config.minDate !== undefined &&\n (self.currentYear === self.config.minDate.getFullYear()\n ? self.currentMonth <= self.config.minDate.getMonth()\n : self.currentYear < self.config.minDate.getFullYear());\n self._hideNextMonthArrow =\n self.config.maxDate !== undefined &&\n (self.currentYear === self.config.maxDate.getFullYear()\n ? self.currentMonth + 1 > self.config.maxDate.getMonth()\n : self.currentYear > self.config.maxDate.getFullYear());\n }\n function getDateStr(format) {\n return self.selectedDates\n .map(function (dObj) { return self.formatDate(dObj, format); })\n .filter(function (d, i, arr) {\n return self.config.mode !== \"range\" ||\n self.config.enableTime ||\n arr.indexOf(d) === i;\n })\n .join(self.config.mode !== \"range\"\n ? self.config.conjunction\n : self.l10n.rangeSeparator);\n }\n /**\n * Updates the values of inputs associated with the calendar\n */\n function updateValue(triggerChange) {\n if (triggerChange === void 0) { triggerChange = true; }\n if (self.mobileInput !== undefined && self.mobileFormatStr) {\n self.mobileInput.value =\n self.latestSelectedDateObj !== undefined\n ? self.formatDate(self.latestSelectedDateObj, self.mobileFormatStr)\n : \"\";\n }\n self.input.value = getDateStr(self.config.dateFormat);\n if (self.altInput !== undefined) {\n self.altInput.value = getDateStr(self.config.altFormat);\n }\n if (triggerChange !== false)\n triggerEvent(\"onValueUpdate\");\n }\n function onMonthNavClick(e) {\n var isPrevMonth = self.prevMonthNav.contains(e.target);\n var isNextMonth = self.nextMonthNav.contains(e.target);\n if (isPrevMonth || isNextMonth) {\n changeMonth(isPrevMonth ? -1 : 1);\n }\n else if (self.yearElements.indexOf(e.target) >= 0) {\n e.target.select();\n }\n else if (e.target.classList.contains(\"arrowUp\")) {\n self.changeYear(self.currentYear + 1);\n }\n else if (e.target.classList.contains(\"arrowDown\")) {\n self.changeYear(self.currentYear - 1);\n }\n }\n function timeWrapper(e) {\n e.preventDefault();\n var isKeyDown = e.type === \"keydown\", input = e.target;\n if (self.amPM !== undefined && e.target === self.amPM) {\n self.amPM.textContent =\n self.l10n.amPM[int(self.amPM.textContent === self.l10n.amPM[0])];\n }\n var min = parseFloat(input.getAttribute(\"min\")), max = parseFloat(input.getAttribute(\"max\")), step = parseFloat(input.getAttribute(\"step\")), curValue = parseInt(input.value, 10), delta = e.delta ||\n (isKeyDown ? (e.which === 38 ? 1 : -1) : 0);\n var newValue = curValue + step * delta;\n if (typeof input.value !== \"undefined\" && input.value.length === 2) {\n var isHourElem = input === self.hourElement, isMinuteElem = input === self.minuteElement;\n if (newValue < min) {\n newValue =\n max +\n newValue +\n int(!isHourElem) +\n (int(isHourElem) && int(!self.amPM));\n if (isMinuteElem)\n incrementNumInput(undefined, -1, self.hourElement);\n }\n else if (newValue > max) {\n newValue =\n input === self.hourElement ? newValue - max - int(!self.amPM) : min;\n if (isMinuteElem)\n incrementNumInput(undefined, 1, self.hourElement);\n }\n if (self.amPM &&\n isHourElem &&\n (step === 1\n ? newValue + curValue === 23\n : Math.abs(newValue - curValue) > step)) {\n self.amPM.textContent =\n self.l10n.amPM[int(self.amPM.textContent === self.l10n.amPM[0])];\n }\n input.value = pad(newValue);\n }\n }\n init();\n return self;\n }\n /* istanbul ignore next */\n function _flatpickr(nodeList, config) {\n // static list\n var nodes = Array.prototype.slice\n .call(nodeList)\n .filter(function (x) { return x instanceof HTMLElement; });\n var instances = [];\n for (var i = 0; i < nodes.length; i++) {\n var node = nodes[i];\n try {\n if (node.getAttribute(\"data-fp-omit\") !== null)\n continue;\n if (node._flatpickr !== undefined) {\n node._flatpickr.destroy();\n node._flatpickr = undefined;\n }\n node._flatpickr = FlatpickrInstance(node, config || {});\n instances.push(node._flatpickr);\n }\n catch (e) {\n console.error(e);\n }\n }\n return instances.length === 1 ? instances[0] : instances;\n }\n /* istanbul ignore next */\n if (typeof HTMLElement !== \"undefined\" &&\n typeof HTMLCollection !== \"undefined\" &&\n typeof NodeList !== \"undefined\") {\n // browser env\n HTMLCollection.prototype.flatpickr = NodeList.prototype.flatpickr = function (config) {\n return _flatpickr(this, config);\n };\n HTMLElement.prototype.flatpickr = function (config) {\n return _flatpickr([this], config);\n };\n }\n /* istanbul ignore next */\n var flatpickr = function (selector, config) {\n if (typeof selector === \"string\") {\n return _flatpickr(window.document.querySelectorAll(selector), config);\n }\n else if (selector instanceof Node) {\n return _flatpickr([selector], config);\n }\n else {\n return _flatpickr(selector, config);\n }\n };\n /* istanbul ignore next */\n flatpickr.defaultConfig = {};\n flatpickr.l10ns = {\n en: __assign({}, english),\n \"default\": __assign({}, english)\n };\n flatpickr.localize = function (l10n) {\n flatpickr.l10ns[\"default\"] = __assign({}, flatpickr.l10ns[\"default\"], l10n);\n };\n flatpickr.setDefaults = function (config) {\n flatpickr.defaultConfig = __assign({}, flatpickr.defaultConfig, config);\n };\n flatpickr.parseDate = createDateParser({});\n flatpickr.formatDate = createDateFormatter({});\n flatpickr.compareDates = compareDates;\n /* istanbul ignore next */\n if (typeof jQuery !== \"undefined\" && typeof jQuery.fn !== \"undefined\") {\n jQuery.fn.flatpickr = function (config) {\n return _flatpickr(this, config);\n };\n }\n // eslint-disable-next-line @typescript-eslint/camelcase\n Date.prototype.fp_incr = function (days) {\n return new Date(this.getFullYear(), this.getMonth(), this.getDate() + (typeof days === \"string\" ? parseInt(days, 10) : days));\n };\n if (typeof window !== \"undefined\") {\n window.flatpickr = flatpickr;\n }\n\n return flatpickr;\n\n}));\n","(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n typeof define === 'function' && define.amd ? define(['exports'], factory) :\n (global = global || self, factory(global.ru = {}));\n}(this, function (exports) { 'use strict';\n\n var fp = typeof window !== \"undefined\" && window.flatpickr !== undefined\n ? window.flatpickr\n : {\n l10ns: {}\n };\n var Russian = {\n weekdays: {\n shorthand: [\"Вс\", \"Пн\", \"Вт\", \"Ср\", \"Чт\", \"Пт\", \"Сб\"],\n longhand: [\n \"Воскресенье\",\n \"Понедельник\",\n \"Вторник\",\n \"Среда\",\n \"Четверг\",\n \"Пятница\",\n \"Суббота\",\n ]\n },\n months: {\n shorthand: [\n \"Янв\",\n \"Фев\",\n \"Март\",\n \"Апр\",\n \"Май\",\n \"Июнь\",\n \"Июль\",\n \"Авг\",\n \"Сен\",\n \"Окт\",\n \"Ноя\",\n \"Дек\",\n ],\n longhand: [\n \"Январь\",\n \"Февраль\",\n \"Март\",\n \"Апрель\",\n \"Май\",\n \"Июнь\",\n \"Июль\",\n \"Август\",\n \"Сентябрь\",\n \"Октябрь\",\n \"Ноябрь\",\n \"Декабрь\",\n ]\n },\n firstDayOfWeek: 1,\n ordinal: function () {\n return \"\";\n },\n rangeSeparator: \" — \",\n weekAbbreviation: \"Нед.\",\n scrollTitle: \"Прокрутите для увеличения\",\n toggleTitle: \"Нажмите для переключения\",\n amPM: [\"ДП\", \"ПП\"],\n yearAriaLabel: \"Год\",\n time_24hr: true\n };\n fp.l10ns.ru = Russian;\n var ru = fp.l10ns;\n\n exports.Russian = Russian;\n exports.default = ru;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n}));\n","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ClassicEditor\"] = factory();\n\telse\n\t\troot[\"ClassicEditor\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 90);\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module utils/ckeditorerror\n */\n\n/**\n * URL to the documentation with error codes.\n */\nexport const DOCUMENTATION_URL =\n\t'https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html';\n\n/**\n * The CKEditor error class.\n *\n * You should throw `CKEditorError` when:\n *\n * * An unexpected situation occurred and the editor (most probably) will not work properly. Such exception will be handled\n * by the {@link module:watchdog/watchdog~Watchdog watchdog} (if it is integrated),\n * * If the editor is incorrectly integrated or the editor API is used in the wrong way. This way you will give\n * feedback to the developer as soon as possible. Keep in mind that for common integration issues which should not\n * stop editor initialization (like missing upload adapter, wrong name of a toolbar component) we use `console.warn()` with\n * {@link module:utils/ckeditorerror~attachLinkToDocumentation `attachLinkToDocumentation()`}\n * to improve developers experience and let them see the working editor as soon as possible.\n *\n *\t\t/**\n *\t\t * Error thrown when a plugin cannot be loaded due to JavaScript errors, lack of plugins with a given name, etc.\n *\t\t *\n *\t\t * @error plugin-load\n *\t\t * @param pluginName The name of the plugin that could not be loaded.\n *\t\t * @param moduleName The name of the module which tried to load this plugin.\n *\t\t * /\n *\t\tthrow new CKEditorError( 'plugin-load: It was not possible to load the \"{$pluginName}\" plugin in module \"{$moduleName}', {\n *\t\t\tpluginName: 'foo',\n *\t\t\tmoduleName: 'bar'\n *\t\t} );\n *\n * @extends Error\n */\nexport default class CKEditorError extends Error {\n\t/**\n\t * Creates an instance of the CKEditorError class.\n\t *\n\t * @param {String} message The error message in an `error-name: Error message.` format.\n\t * During the minification process the \"Error message\" part will be removed to limit the code size\n\t * and a link to this error documentation will be added to the `message`.\n\t * @param {Object|null} context A context of the error by which the {@link module:watchdog/watchdog~Watchdog watchdog}\n\t * is able to determine which editor crashed. It should be an editor instance or a property connected to it. It can be also\n\t * a `null` value if the editor should not be restarted in case of the error (e.g. during the editor initialization).\n\t * The error context should be checked using the `areConnectedThroughProperties( editor, context )` utility\n\t * to check if the object works as the context.\n\t * @param {Object} [data] Additional data describing the error. A stringified version of this object\n\t * will be appended to the error message, so the data are quickly visible in the console. The original\n\t * data object will also be later available under the {@link #data} property.\n\t */\n\tconstructor( message, context, data ) {\n\t\tmessage = attachLinkToDocumentation( message );\n\n\t\tif ( data ) {\n\t\t\tmessage += ' ' + JSON.stringify( data );\n\t\t}\n\n\t\tsuper( message );\n\n\t\t/**\n\t\t * @type {String}\n\t\t */\n\t\tthis.name = 'CKEditorError';\n\n\t\t/**\n\t\t * A context of the error by which the Watchdog is able to determine which editor crashed.\n\t\t *\n\t\t * @type {Object|null}\n\t\t */\n\t\tthis.context = context;\n\n\t\t/**\n\t\t * The additional error data passed to the constructor. Undefined if none was passed.\n\t\t *\n\t\t * @type {Object|undefined}\n\t\t */\n\t\tthis.data = data;\n\t}\n\n\t/**\n\t * Checks if the error is of the `CKEditorError` type.\n\t */\n\tis( type ) {\n\t\treturn type === 'CKEditorError';\n\t}\n\n\t/**\n\t * A utility that ensures the the thrown error is a {@link module:utils/ckeditorerror~CKEditorError} one.\n\t * It is useful when combined with the {@link module:watchdog/watchdog~Watchdog} feature, which can restart the editor in case\n\t * of a {@link module:utils/ckeditorerror~CKEditorError} error.\n\t *\n\t * @param {Error} err An error.\n\t * @param {Object} context An object connected through properties with the editor instance. This context will be used\n\t * by the watchdog to verify which editor should be restarted.\n\t */\n\tstatic rethrowUnexpectedError( err, context ) {\n\t\tif ( err.is && err.is( 'CKEditorError' ) ) {\n\t\t\tthrow err;\n\t\t}\n\n\t\t/**\n\t\t * An unexpected error occurred inside the CKEditor 5 codebase. This error will look like the original one\n\t\t * to make the debugging easier.\n\t\t *\n\t\t * This error is only useful when the editor is initialized using the {@link module:watchdog/watchdog~Watchdog} feature.\n\t\t * In case of such error (or any {@link module:utils/ckeditorerror~CKEditorError} error) the watchdog should restart the editor.\n\t\t *\n\t\t * @error unexpected-error\n\t\t */\n\t\tconst error = new CKEditorError( err.message, context );\n\n\t\t// Restore the original stack trace to make the error look like the original one.\n\t\t// See https://github.com/ckeditor/ckeditor5/issues/5595 for more details.\n\t\terror.stack = err.stack;\n\n\t\tthrow error;\n\t}\n}\n\n/**\n * Attaches the link to the documentation at the end of the error message. Use whenever you log a warning or error on the\n * console. It is also used by {@link module:utils/ckeditorerror~CKEditorError}.\n *\n *\t\t /**\n *\t\t * There was a problem processing the configuration of the toolbar. The item with the given\n *\t\t * name does not exist so it was omitted when rendering the toolbar.\n *\t\t *\n *\t\t * @error toolbarview-item-unavailable\n *\t\t * @param {String} name The name of the component.\n *\t\t * /\n *\t\t console.warn( attachLinkToDocumentation(\n *\t\t \t'toolbarview-item-unavailable: The requested toolbar item is unavailable.' ), { name } );\n *\n * @param {String} message Message to be logged.\n * @returns {String}\n */\nexport function attachLinkToDocumentation( message ) {\n\tconst matchedErrorName = message.match( /^([^:]+):/ );\n\n\tif ( !matchedErrorName ) {\n\t\treturn message;\n\t}\n\n\treturn message + ` Read more: ${ DOCUMENTATION_URL }#error-${ matchedErrorName[ 1 ] }\\n`;\n}\n","\"use strict\";\n\nvar stylesInDom = {};\n\nvar isOldIE = function isOldIE() {\n var memo;\n return function memorize() {\n if (typeof memo === 'undefined') {\n // Test for IE <= 9 as proposed by Browserhacks\n // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805\n // Tests for existence of standard globals is to allow style-loader\n // to operate correctly into non-standard environments\n // @see https://github.com/webpack-contrib/style-loader/issues/177\n memo = Boolean(window && document && document.all && !window.atob);\n }\n\n return memo;\n };\n}();\n\nvar getTarget = function getTarget() {\n var memo = {};\n return function memorize(target) {\n if (typeof memo[target] === 'undefined') {\n var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself\n\n if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {\n try {\n // This will throw an exception if access to iframe is blocked\n // due to cross-origin restrictions\n styleTarget = styleTarget.contentDocument.head;\n } catch (e) {\n // istanbul ignore next\n styleTarget = null;\n }\n }\n\n memo[target] = styleTarget;\n }\n\n return memo[target];\n };\n}();\n\nfunction listToStyles(list, options) {\n var styles = [];\n var newStyles = {};\n\n for (var i = 0; i < list.length; i++) {\n var item = list[i];\n var id = options.base ? item[0] + options.base : item[0];\n var css = item[1];\n var media = item[2];\n var sourceMap = item[3];\n var part = {\n css: css,\n media: media,\n sourceMap: sourceMap\n };\n\n if (!newStyles[id]) {\n styles.push(newStyles[id] = {\n id: id,\n parts: [part]\n });\n } else {\n newStyles[id].parts.push(part);\n }\n }\n\n return styles;\n}\n\nfunction addStylesToDom(styles, options) {\n for (var i = 0; i < styles.length; i++) {\n var item = styles[i];\n var domStyle = stylesInDom[item.id];\n var j = 0;\n\n if (domStyle) {\n domStyle.refs++;\n\n for (; j < domStyle.parts.length; j++) {\n domStyle.parts[j](item.parts[j]);\n }\n\n for (; j < item.parts.length; j++) {\n domStyle.parts.push(addStyle(item.parts[j], options));\n }\n } else {\n var parts = [];\n\n for (; j < item.parts.length; j++) {\n parts.push(addStyle(item.parts[j], options));\n }\n\n stylesInDom[item.id] = {\n id: item.id,\n refs: 1,\n parts: parts\n };\n }\n }\n}\n\nfunction insertStyleElement(options) {\n var style = document.createElement('style');\n\n if (typeof options.attributes.nonce === 'undefined') {\n var nonce = typeof __webpack_nonce__ !== 'undefined' ? __webpack_nonce__ : null;\n\n if (nonce) {\n options.attributes.nonce = nonce;\n }\n }\n\n Object.keys(options.attributes).forEach(function (key) {\n style.setAttribute(key, options.attributes[key]);\n });\n\n if (typeof options.insert === 'function') {\n options.insert(style);\n } else {\n var target = getTarget(options.insert || 'head');\n\n if (!target) {\n throw new Error(\"Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.\");\n }\n\n target.appendChild(style);\n }\n\n return style;\n}\n\nfunction removeStyleElement(style) {\n // istanbul ignore if\n if (style.parentNode === null) {\n return false;\n }\n\n style.parentNode.removeChild(style);\n}\n/* istanbul ignore next */\n\n\nvar replaceText = function replaceText() {\n var textStore = [];\n return function replace(index, replacement) {\n textStore[index] = replacement;\n return textStore.filter(Boolean).join('\\n');\n };\n}();\n\nfunction applyToSingletonTag(style, index, remove, obj) {\n var css = remove ? '' : obj.css; // For old IE\n\n /* istanbul ignore if */\n\n if (style.styleSheet) {\n style.styleSheet.cssText = replaceText(index, css);\n } else {\n var cssNode = document.createTextNode(css);\n var childNodes = style.childNodes;\n\n if (childNodes[index]) {\n style.removeChild(childNodes[index]);\n }\n\n if (childNodes.length) {\n style.insertBefore(cssNode, childNodes[index]);\n } else {\n style.appendChild(cssNode);\n }\n }\n}\n\nfunction applyToTag(style, options, obj) {\n var css = obj.css;\n var media = obj.media;\n var sourceMap = obj.sourceMap;\n\n if (media) {\n style.setAttribute('media', media);\n }\n\n if (sourceMap && btoa) {\n css += \"\\n/*# sourceMappingURL=data:application/json;base64,\".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), \" */\");\n } // For old IE\n\n /* istanbul ignore if */\n\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n while (style.firstChild) {\n style.removeChild(style.firstChild);\n }\n\n style.appendChild(document.createTextNode(css));\n }\n}\n\nvar singleton = null;\nvar singletonCounter = 0;\n\nfunction addStyle(obj, options) {\n var style;\n var update;\n var remove;\n\n if (options.singleton) {\n var styleIndex = singletonCounter++;\n style = singleton || (singleton = insertStyleElement(options));\n update = applyToSingletonTag.bind(null, style, styleIndex, false);\n remove = applyToSingletonTag.bind(null, style, styleIndex, true);\n } else {\n style = insertStyleElement(options);\n update = applyToTag.bind(null, style, options);\n\n remove = function remove() {\n removeStyleElement(style);\n };\n }\n\n update(obj);\n return function updateStyle(newObj) {\n if (newObj) {\n if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) {\n return;\n }\n\n update(obj = newObj);\n } else {\n remove();\n }\n };\n}\n\nmodule.exports = function (list, options) {\n options = options || {};\n options.attributes = typeof options.attributes === 'object' ? options.attributes : {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of