ckeditor5
Version:
A set of ready-to-use rich text editors created with a powerful framework. Made with real-time collaborative editing in mind.
11 lines (10 loc) • 1.85 MB
JavaScript
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.CKEDITOR = {}));
})(this, (function (exports) { 'use strict';
/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/
exports.global = void 0;try{exports.global={window:window,document:document};}catch{exports.global={window:{},document:{}};}function t(){try{return navigator.userAgent.toLowerCase()}catch{return ""}}const i=t(),n={isMac:s(i),isWindows:o(i),isGecko:r(i),isSafari:a(i),isiOS:l(i),isAndroid:c(i),isBlink:u(i),get isMediaForcedColors(){return h()},get isMotionReduced(){return m()},features:{isRegExpUnicodePropertySupported:d()}};function s(e){return e.indexOf("macintosh")>-1}function o(e){return e.indexOf("windows")>-1}function r(e){return !!e.match(/gecko\/\d+/)}function a(e){return e.indexOf(" applewebkit/")>-1&&-1===e.indexOf("chrome")}function l(e){return !!e.match(/iphone|ipad/i)||s(e)&&navigator.maxTouchPoints>0}function c(e){return e.indexOf("android")>-1}function u(e){return e.indexOf("chrome/")>-1&&e.indexOf("edge/")<0}function d(){let e=false;try{e=0==="ć".search(new RegExp("[\\p{L}]","u"));}catch{}return e}function h(){return !!exports.global.window.matchMedia&&exports.global.window.matchMedia("(forced-colors: active)").matches}function m(){return !!exports.global.window.matchMedia&&exports.global.window.matchMedia("(prefers-reduced-motion)").matches}function g(e,t,i,n){i=i||function(e,t){return e===t};const s=Array.isArray(e)?e:Array.prototype.slice.call(e),o=Array.isArray(t)?t:Array.prototype.slice.call(t),r=function(e,t,i){const n=f(e,t,i);if(-1===n)return {firstIndex:-1,lastIndexOld:-1,lastIndexNew:-1};const s=p(e,n),o=p(t,n),r=f(s,o,i),a=e.length-r,l=t.length-r;return {firstIndex:n,lastIndexOld:a,lastIndexNew:l}}(s,o,i),a=n?function(e,t){const{firstIndex:i,lastIndexOld:n,lastIndexNew:s}=e;if(-1===i)return Array(t).fill("equal");let o=[];i>0&&(o=o.concat(Array(i).fill("equal")));s-i>0&&(o=o.concat(Array(s-i).fill("insert")));n-i>0&&(o=o.concat(Array(n-i).fill("delete")));s<t&&(o=o.concat(Array(t-s).fill("equal")));return o}(r,o.length):function(e,t){const i=[],{firstIndex:n,lastIndexOld:s,lastIndexNew:o}=t;o-n>0&&i.push({index:n,type:"insert",values:e.slice(n,o)});s-n>0&&i.push({index:n+(o-n),type:"delete",howMany:s-n});return i}(o,r);return a}function f(e,t,i){for(let n=0;n<Math.max(e.length,t.length);n++)if(void 0===e[n]||void 0===t[n]||!i(e[n],t[n]))return n;return -1}function p(e,t){return e.slice(t).reverse()}function b(e,t,i){i=i||function(e,t){return e===t};const n=e.length,s=t.length;if(n>200||s>200||n+s>300)return b.fastDiff(e,t,i,true);let o,r;if(s<n){const i=e;e=t,t=i,o="delete",r="insert";}else o="insert",r="delete";const a=e.length,l=t.length,c=l-a,u={},d={};function h(n){const s=(void 0!==d[n-1]?d[n-1]:-1)+1,c=void 0!==d[n+1]?d[n+1]:-1,h=s>c?-1:1;u[n+h]&&(u[n]=u[n+h].slice(0)),u[n]||(u[n]=[]),u[n].push(s>c?o:r);let m=Math.max(s,c),g=m-n;for(;g<a&&m<l&&i(e[g],t[m]);)g++,m++,u[n].push("equal");return m}let m,g=0;do{for(m=-g;m<c;m++)d[m]=h(m);for(m=c+g;m>c;m--)d[m]=h(m);d[c]=h(c),g++;}while(d[c]!==l);return u[c].slice(1)}function w(e,t){const i=[];let n=0,s=null;return e.forEach(e=>{"equal"==e?(o(),n++):"insert"==e?(s&&"insert"==s.type?s.values.push(t[n]):(o(),s={type:"insert",index:n,values:[t[n]]}),n++):s&&"delete"==s.type?s.howMany++:(o(),s={type:"delete",index:n,howMany:1});}),o(),i;function o(){s&&(i.push(s),s=null);}}function v(e,t){if(e===t&&("object"==typeof(i=e)&&null!==i))return true;var i;const n=_(e),s=_(t);for(const e of n)if(s.has(e))return true;return false}function _(e){const t=[e],i=new Set;for(;t.length>0;){const e=t.shift();if(!i.has(e)&&!y(e))if(i.add(e),e[Symbol.iterator])try{t.push(...e);}catch{}else t.push(...Object.values(e));}return i}function y(e){const t=Object.prototype.toString.call(e);return "[object Number]"===t||"[object Boolean]"===t||"[object String]"===t||"[object Symbol]"===t||"[object Function]"===t||"[object Date]"===t||"[object RegExp]"===t||null==e||e instanceof EventTarget||e instanceof Event}function k(){return function e(){e.called=true;}}b.fastDiff=g;class C{source;name;path;stop;off;return;constructor(e,t){this.source=e,this.name=t,this.path=[],this.stop=function e(){e.called=true;},this.off=function e(){e.called=true;};}}const x=new Array(256).fill("").map((e,t)=>("0"+t.toString(16)).slice(-2));function A(){const[e,t,i,n]=crypto.getRandomValues(new Uint32Array(4));return "e"+x[255&e]+x[e>>8&255]+x[e>>16&255]+x[e>>24&255]+x[255&t]+x[t>>8&255]+x[t>>16&255]+x[t>>24&255]+x[255&i]+x[i>>8&255]+x[i>>16&255]+x[i>>24&255]+x[255&n]+x[n>>8&255]+x[n>>16&255]+x[n>>24&255]}const T={get(e="normal"){return "number"!=typeof e?this[e]||this.normal:e},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5};function E(e,t){const i=T.get(t.priority);let n=0,s=e.length;for(;n<s;){const t=n+s>>1;T.get(e[t].priority)<i?s=t:n=t+1;}e.splice(n,0,t);}const S="https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html";class I extends Error{context;data;constructor(e,t,i,n){super(function(e,t,i){const n=new WeakSet,s=(e,t)=>{if("object"==typeof t&&null!==t){if(n.has(t))return `[object ${t.constructor.name}]`;n.add(t);}return t},o=t?` ${JSON.stringify(t,s)}`:"",r=O(e),a=i?`\nOriginal error: ${i.name}: ${i.message}`:"";return e+o+r+a}(e,i,n)),this.name="CKEditorError",this.context=t,this.data=i,n&&(this.stack=n.stack);}is(e){return "CKEditorError"===e}static rethrowUnexpectedError(e,t){if(e.is&&e.is("CKEditorError"))throw e;throw new I("unexpected-error",t,void 0,e)}}function P(e,t){console.warn(...R(e,t));}function V(e,t){console.error(...R(e,t));}function O(e){return `\nRead more: ${S}#error-${e}`}function R(e,t){const i=O(e);return t?[e,t,i]:[e,i]}const B="47.0.0",M=new Date(2025,9,1);if(globalThis.CKEDITOR_VERSION)throw new I("ckeditor-duplicated-modules",null);globalThis.CKEDITOR_VERSION=B;const L=Symbol("listeningTo"),F=Symbol("emitterId"),N=Symbol("delegations"),D=z(Object);function z(e){if(!e)return D;return class extends e{on(e,t,i){this.listenTo(this,e,t,i);}once(e,t,i){let n=false;this.listenTo(this,e,(e,...i)=>{n||(n=true,e.off(),t.call(this,e,...i));},i);}off(e,t){this.stopListening(this,e,t);}listenTo(e,t,i,n={}){let s,o;this[L]||(this[L]={});const r=this[L];q(e)||U(e);const a=q(e);(s=r[a])||(s=r[a]={emitter:e,callbacks:{}}),(o=s.callbacks[t])||(o=s.callbacks[t]=[]),o.push(i),function(e,t,i,n,s){t._addEventListener?t._addEventListener(i,n,s):e._addEventListener.call(t,i,n,s);}(this,e,t,i,n);}stopListening(e,t,i){const n=this[L];let s=e&&q(e);const o=n&&s?n[s]:void 0,r=o&&t?o.callbacks[t]:void 0;if(!(!n||e&&!o||t&&!r))if(i){K(this,e,t,i);-1!==r.indexOf(i)&&(1===r.length?delete o.callbacks[t]:K(this,e,t,i));}else if(r){for(;i=r.pop();)K(this,e,t,i);delete o.callbacks[t];}else if(o){for(t in o.callbacks)this.stopListening(e,t);delete n[s];}else {for(s in n)this.stopListening(n[s].emitter);delete this[L];}}fire(e,...t){try{const i=e instanceof C?e:new C(this,e),n=i.name;let s=function(e,t){if(!e._events)return null;let i=t;do{const t=e._events[i];if(t&&t.callbacks&&t.callbacks.length)return t.callbacks;const n=i.lastIndexOf(":");i=n>-1?i.substring(0,n):"";}while(i);return null}(this,n);if(i.path.push(this),s){s=s.slice();for(let e=0;e<s.length;e++){const o=s[e].callback;if(o.call(this,i,...t),i.off.called&&(delete i.off.called,this._removeEventListener(n,o)),i.stop.called)break}}const o=this[N];if(o){const e=o.get(n),s=o.get("*");e&&G(e,i,t),s&&G(s,i,t);}return i.return}catch(e){I.rethrowUnexpectedError(e,this);}}delegate(...e){return {to:(t,i)=>{this[N]||(this[N]=new Map),e.forEach(e=>{const n=this[N].get(e);n?n.set(t,i):this[N].set(e,new Map([[t,i]]));});}}}stopDelegating(e,t){if(this[N])if(e)if(t){const i=this[N].get(e);i&&i.delete(t);}else this[N].delete(e);else this[N].clear();}_addEventListener(e,t,i){!function(e,t){const i=$(e);if(i[t])return;let n=t,s=null;const o=[];for(;""!==n&&!i[n];)i[n]=j(),o.push(i[n]),s&&i[n].childEvents.push(s),s=n,n=n.substr(0,n.lastIndexOf(":"));if(""!==n){for(const e of o)e.callbacks=i[n].callbacks.slice();i[n].childEvents.push(s);}}(this,e);const n=W(this,e),s={callback:t,priority:T.get(i.priority)};for(const e of n)E(e,s);}_removeEventListener(e,t){const i=W(this,e);for(const e of i)for(let i=0;i<e.length;i++)e[i].callback==t&&(e.splice(i,1),i--);}}}function H(e,t){const i=e[L];return i&&i[t]?i[t].emitter:null}function U(e,t){e[F]||(e[F]=t||A());}function q(e){return e[F]}function $(e){return e._events||Object.defineProperty(e,"_events",{value:{}}),e._events}function j(){return {callbacks:[],childEvents:[]}}function W(e,t){const i=$(e)[t];if(!i)return [];let n=[i.callbacks];for(let t=0;t<i.childEvents.length;t++){const s=W(e,i.childEvents[t]);n=n.concat(s);}return n}function G(e,t,i){for(let[n,s]of e){s?"function"==typeof s&&(s=s(t.name)):s=t.name;const e=new C(t.source,s);e.path=[...t.path],n.fire(e,...i);}}function K(e,t,i,n){t._removeEventListener?t._removeEventListener(i,n):e._removeEventListener.call(t,i,n);}function J(e){return null!=e&&"function"!=typeof e&&function(e){return Number.isSafeInteger(e)&&e>=0}(e.length)}function Q(e){return e}function Y(e){return "__proto__"===e}function Z(e){switch(typeof e){case "number":case "symbol":return false;case "string":return e.includes(".")||e.includes("[")||e.includes("]")}}function X(e){return "string"==typeof e||"symbol"==typeof e?e:Object.is(e?.valueOf?.(),-0)?"-0":String(e)}function ee(e){const t=[],i=e.length;if(0===i)return t;let n=0,s="",o="",r=false;for(46===e.charCodeAt(0)&&(t.push(""),n++);n<i;){const a=e[n];o?"\\"===a&&n+1<i?(n++,s+=e[n]):a===o?o="":s+=a:r?'"'===a||"'"===a?o=a:"]"===a?(r=false,t.push(s),s=""):s+=a:"["===a?(r=true,s&&(t.push(s),s="")):"."===a?s&&(t.push(s),s=""):s+=a,n++;}return s&&t.push(s),t}function te(e,t,i){if(null==e)return i;switch(typeof t){case "string":{if(Y(t))return i;const n=e[t];return void 0===n?Z(t)?te(e,ee(t),i):i:n}case "number":case "symbol":{"number"==typeof t&&(t=X(t));const n=e[t];return void 0===n?i:n}default:{if(Array.isArray(t))return function(e,t,i){if(0===t.length)return i;let n=e;for(let e=0;e<t.length;e++){if(null==n)return i;if(Y(t[e]))return i;n=n[t[e]];}if(void 0===n)return i;return n}(e,t,i);if(Y(t=Object.is(t?.valueOf(),-0)?"-0":String(t)))return i;const n=e[t];return void 0===n?i:n}}}function ie(e){return null!==e&&("object"==typeof e||"function"==typeof e)}function ne(e){return null==e||"object"!=typeof e&&"function"!=typeof e}function se(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function oe(e,t,i,n){if(t===e)return true;switch(typeof t){case "object":return function(e,t,i,n){if(null==t)return true;if(Array.isArray(t))return re(e,t,i,n);if(t instanceof Map)return function(e,t,i,n){if(0===t.size)return true;if(!(e instanceof Map))return false;for(const[s,o]of t.entries()){if(false===i(e.get(s),o,s,e,t,n))return false}return true}(e,t,i,n);if(t instanceof Set)return function(e,t,i,n){if(0===t.size)return true;if(!(e instanceof Set))return false;return re([...e],[...t],i,n)}(e,t,i,n);const s=Object.keys(t);if(null==e)return 0===s.length;if(0===s.length)return true;if(n&&n.has(t))return n.get(t)===e;n&&n.set(t,e);try{for(let o=0;o<s.length;o++){const r=s[o];if(!ne(e)&&!(r in e))return !1;if(void 0===t[r]&&void 0!==e[r])return !1;if(null===t[r]&&null!==e[r])return !1;if(!i(e[r],t[r],r,e,t,n))return !1}return !0}finally{n&&n.delete(t);}}(e,t,i,n);case "function":return Object.keys(t).length>0?oe(e,{...t},i,n):se(e,t);default:return ie(e)?"string"!=typeof t||""===t:se(e,t)}}function re(e,t,i,n){if(0===t.length)return true;if(!Array.isArray(e))return false;const s=new Set;for(let o=0;o<t.length;o++){const r=t[o];let a=false;for(let l=0;l<e.length;l++){if(s.has(l))continue;let c=false;if(i(e[l],r,o,e,t,n)&&(c=true),c){s.add(l),a=true;break}}if(!a)return false}return true}function ae(e,t){return function(e,t,i){return "function"!=typeof i?ae(e,t):oe(e,t,function e(t,n,s,o,r,a){const l=i(t,n,s,o,r,a);return void 0!==l?Boolean(l):oe(t,n,e,a)},new Map)}(e,t,()=>{})}function le(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function ce(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const ue="[object RegExp]",de="[object String]",he="[object Number]",me="[object Boolean]",ge="[object Arguments]",fe="[object Symbol]",pe="[object Date]",be="[object Map]",we="[object Set]",ve="[object Array]",_e="[object ArrayBuffer]",ye="[object Object]",ke="[object DataView]",Ce="[object Uint8Array]",xe="[object Uint8ClampedArray]",Ae="[object Uint16Array]",Te="[object Uint32Array]",Ee="[object Int8Array]",Se="[object Int16Array]",Ie="[object Int32Array]",Pe="[object Float32Array]",Ve="[object Float64Array]";function Oe(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Re(e,t,i,n=new Map,s=void 0){const o=s?.(e,t,i,n);if(null!=o)return o;if(ne(e))return e;if(n.has(e))return n.get(e);if(Array.isArray(e)){const t=new Array(e.length);n.set(e,t);for(let o=0;o<e.length;o++)t[o]=Re(e[o],o,i,n,s);return Object.hasOwn(e,"index")&&(t.index=e.index),Object.hasOwn(e,"input")&&(t.input=e.input),t}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const t=new RegExp(e.source,e.flags);return t.lastIndex=e.lastIndex,t}if(e instanceof Map){const t=new Map;n.set(e,t);for(const[o,r]of e)t.set(o,Re(r,o,i,n,s));return t}if(e instanceof Set){const t=new Set;n.set(e,t);for(const o of e)t.add(Re(o,void 0,i,n,s));return t}if("undefined"!=typeof Buffer&&Buffer.isBuffer(e))return e.subarray();if(Oe(e)){const t=new(Object.getPrototypeOf(e).constructor)(e.length);n.set(e,t);for(let o=0;o<e.length;o++)t[o]=Re(e[o],o,i,n,s);return t}if(e instanceof ArrayBuffer||"undefined"!=typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){const t=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return n.set(e,t),Be(t,e,i,n,s),t}if("undefined"!=typeof File&&e instanceof File){const t=new File([e],e.name,{type:e.type});return n.set(e,t),Be(t,e,i,n,s),t}if(e instanceof Blob){const t=new Blob([e],{type:e.type});return n.set(e,t),Be(t,e,i,n,s),t}if(e instanceof Error){const t=new e.constructor;return n.set(e,t),t.message=e.message,t.name=e.name,t.stack=e.stack,t.cause=e.cause,Be(t,e,i,n,s),t}if("object"==typeof e&&function(e){switch(ce(e)){case ge:case ve:case _e:case ke:case me:case pe:case Pe:case Ve:case Ee:case Se:case Ie:case be:case he:case ye:case ue:case we:case de:case fe:case Ce:case xe:case Ae:case Te:return true;default:return false}}(e)){const t=Object.create(Object.getPrototypeOf(e));return n.set(e,t),Be(t,e,i,n,s),t}return e}function Be(e,t,i=e,n,s){const o=[...Object.keys(t),...le(t)];for(let r=0;r<o.length;r++){const a=o[r],l=Object.getOwnPropertyDescriptor(e,a);(null==l||l.writable)&&(e[a]=Re(t[a],a,i,n,s));}}function Me(e){var t;return e=Re(t=e,void 0,t,new Map,void 0),t=>ae(t,e)}function Le(e,t){return function(e,t){return Re(e,void 0,e,new Map,t)}(e,(i,n,s,o)=>{const r=t?.(i,n,s,o);if(null!=r)return r;if("object"==typeof e)switch(Object.prototype.toString.call(e)){case he:case de:case me:{const t=new e.constructor(e?.valueOf());return Be(t,e),t}case ge:{const t={};return Be(t,e),t.length=e.length,t[Symbol.iterator]=e[Symbol.iterator],t}default:return}})}function Fe(e){return Le(e)}const Ne=/^(?:0|[1-9]\d*)$/;function De(e,t=Number.MAX_SAFE_INTEGER){switch(typeof e){case "number":return Number.isInteger(e)&&e>=0&&e<t;case "symbol":return false;case "string":return Ne.test(e)}}function ze(e){return null!==e&&"object"==typeof e&&"[object Arguments]"===ce(e)}function He(e,t){switch(typeof e){case "object":Object.is(e?.valueOf(),-0)&&(e="-0");break;case "number":e=X(e);}return t=Fe(t),function(i){const n=te(i,e);return void 0===n?function(e,t){let i;if(i=Array.isArray(t)?t:"string"==typeof t&&Z(t)&&null==e?.[t]?ee(t):[t],0===i.length)return false;let n=e;for(let e=0;e<i.length;e++){const t=i[e];if(!(null!=n&&Object.hasOwn(n,t)||(Array.isArray(n)||ze(n))&&De(t)&&t<n.length))return false;n=n[t];}return true}(i,e):void 0===t?void 0===n:ae(n,t)}}function Ue(e){if(null==e)return Q;switch(typeof e){case "function":return e;case "object":return Array.isArray(e)&&2===e.length?He(e[0],e[1]):Me(e);case "string":case "symbol":case "number":return function(e){return function(t){return te(t,e)}}(e)}}function qe(e){return "object"==typeof e&&null!==e}function $e(e){return "symbol"==typeof e||e instanceof Symbol}function je(e){if(!e)return 0===e?e:0;if((e=function(e){return $e(e)?NaN:Number(e)}(e))===1/0||e===-1/0){return (e<0?-1:1)*Number.MAX_VALUE}return e==e?e:0}function We(e){return "string"==typeof e||e instanceof String}function Ge(e,t){if(null==e)return {};return function(e,t){const i={};for(let n=0;n<e.length;n++){const s=e[n],o=t(s);Object.hasOwn(i,o)||(i[o]=[]),i[o].push(s);}return i}(J(e)?Array.from(e):Object.values(e),Ue(t??Q))}const Ke=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Je=/^\w*$/;function Qe(e){return e}const Ye=(e,t,i)=>{const n=e[t];Object.hasOwn(e,t)&&se(n,i)&&(void 0!==i||t in e)||(e[t]=i);};function Ze(e,t,i,n){if(null==e&&!ie(e))return e;const s=(o=t,r=e,!Array.isArray(o)&&("number"==typeof o||"boolean"==typeof o||null==o||$e(o)||"string"==typeof o&&(Je.test(o)||!Ke.test(o))||null!=r&&Object.hasOwn(r,o))?[t]:Array.isArray(t)?t:"string"==typeof t?ee(t):[t]);var o,r;let a=e;for(let t=0;t<s.length&&null!=a;t++){const o=X(s[t]);if(Y(o))continue;let r;if(t===s.length-1)r=i(a[o]);else {const i=a[o],l=n?.(i,o,e);r=void 0!==l?l:ie(i)?i:De(s[t+1])?[]:{};}Ye(a,o,r),a=a[o];}return e}function Xe(e,t,i){return Ze(e,t,()=>i,()=>{})}function et(e,t,{signal:i,edges:n}={}){let s,o=null;const r=null!=n&&n.includes("leading"),a=null==n||n.includes("trailing"),l=()=>{null!==o&&(e.apply(s,o),s=void 0,o=null);};let c=null;const u=()=>{null!=c&&clearTimeout(c),c=setTimeout(()=>{c=null,a&&l(),h();},t);},d=()=>{null!==c&&(clearTimeout(c),c=null);},h=()=>{d(),s=void 0,o=null;},m=function(...e){if(i?.aborted)return;s=this,o=e;const t=null==c;u(),r&&t&&l();};return m.schedule=u,m.cancel=h,m.flush=()=>{d(),l();},i?.addEventListener("abort",h,{once:true}),m}function tt(e,t=0,i={}){"object"!=typeof i&&(i={});const{leading:n=false,trailing:s=true,maxWait:o}=i,r=Array(2);let a;n&&(r[0]="leading"),s&&(r[1]="trailing");let l=null;const c=et(function(...t){a=e.apply(this,t),l=null;},t,{edges:r}),u=function(...t){return null!=o&&(null===l&&(l=Date.now()),Date.now()-l>=o)?(a=e.apply(this,t),l=Date.now(),c.cancel(),c.schedule(),a):(c.apply(this,t),a)};return u.cancel=c.cancel,u.flush=()=>(c.flush(),a),u}function it(e,t=0,i={}){"object"!=typeof i&&(i={});const{leading:n=true,trailing:s=true}=i;return tt(e,t,{leading:n,trailing:s,maxWait:t})}function nt(e){if(null==e)return "";if("string"==typeof e)return e;if(Array.isArray(e))return e.map(nt).join(",");const t=String(e);return "0"===t&&Object.is(Number(e),-0)?"-0":t}function st(e){if(!e||"object"!=typeof e)return false;const t=Object.getPrototypeOf(e);return !(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t))&&"[object Object]"===Object.prototype.toString.call(e)}function ot(e,t,i){return rt(e,t,void 0,void 0,void 0,void 0,i)}function rt(e,t,i,n,s,o,r){const a=r(e,t,i,n,s,o);if(void 0!==a)return a;if(typeof e==typeof t)switch(typeof e){case "bigint":case "string":case "boolean":case "symbol":case "undefined":case "function":return e===t;case "number":return e===t||Object.is(e,t);case "object":return at(e,t,o,r)}return at(e,t,o,r)}function at(e,t,i,n){if(Object.is(e,t))return true;let s=ce(e),o=ce(t);if(s===ge&&(s=ye),o===ge&&(o=ye),s!==o)return false;switch(s){case de:return e.toString()===t.toString();case he:return se(e.valueOf(),t.valueOf());case me:case pe:case fe:return Object.is(e.valueOf(),t.valueOf());case ue:return e.source===t.source&&e.flags===t.flags;case "[object Function]":return e===t}const r=(i=i??new Map).get(e),a=i.get(t);if(null!=r&&null!=a)return r===t;i.set(e,t),i.set(t,e);try{switch(s){case be:if(e.size!==t.size)return !1;for(const[s,o]of e.entries())if(!t.has(s)||!rt(o,t.get(s),s,e,t,i,n))return !1;return !0;case we:{if(e.size!==t.size)return !1;const s=Array.from(e.values()),o=Array.from(t.values());for(let r=0;r<s.length;r++){const a=s[r],l=o.findIndex(s=>rt(a,s,void 0,e,t,i,n));if(-1===l)return !1;o.splice(l,1);}return !0}case ve:case Ce:case xe:case Ae:case Te:case "[object BigUint64Array]":case Ee:case Se:case Ie:case "[object BigInt64Array]":case Pe:case Ve:if("undefined"!=typeof Buffer&&Buffer.isBuffer(e)!==Buffer.isBuffer(t))return !1;if(e.length!==t.length)return !1;for(let s=0;s<e.length;s++)if(!rt(e[s],t[s],s,e,t,i,n))return !1;return !0;case _e:return e.byteLength===t.byteLength&&at(new Uint8Array(e),new Uint8Array(t),i,n);case ke:return e.byteLength===t.byteLength&&e.byteOffset===t.byteOffset&&at(new Uint8Array(e),new Uint8Array(t),i,n);case "[object Error]":return e.name===t.name&&e.message===t.message;case ye:{if(!(at(e.constructor,t.constructor,i,n)||st(e)&&st(t)))return !1;const s=[...Object.keys(e),...le(e)],o=[...Object.keys(t),...le(t)];if(s.length!==o.length)return !1;for(let o=0;o<s.length;o++){const r=s[o],a=e[r];if(!Object.hasOwn(t,r))return !1;if(!rt(a,t[r],r,e,t,i,n))return !1}return !0}default:return !1}}finally{i.delete(e),i.delete(t);}}function lt(){}function ct(e,t){return ot(e,t,lt)}function ut(e){return Oe(e)}function dt(e,t){if((e=function(e){const t=je(e),i=t%1;return i?t-i:t}(e))<1||!Number.isSafeInteger(e))return [];const i=new Array(e);for(let n=0;n<e;n++)i[n]="function"==typeof t?t(n):n;return i}function ht(e){if(null==e)return [];switch(typeof e){case "object":case "function":return J(e)?function(e){const t=dt(e.length,e=>`${e}`),i=new Set(t);(function(e){return "undefined"!=typeof Buffer&&Buffer.isBuffer(e)})(e)&&(i.add("offset"),i.add("parent"));ut(e)&&(i.add("buffer"),i.add("byteLength"),i.add("byteOffset"));return [...t,...mt(e).filter(e=>!i.has(e))]}(e):function(e){const t=e?.constructor;return e===("function"==typeof t?t.prototype:Object.prototype)}(e)?function(e){const t=mt(e);return t.filter(e=>"constructor"!==e)}(e):mt(e);default:return mt(Object(e))}}function mt(e){const t=[];for(const i in e)t.push(i);return t}function gt(e,...t){for(let i=0;i<t.length;i++)ft(e,t[i]);return e}function ft(e,t){const i=ht(t);for(let n=0;n<i.length;n++){const s=i[n];s in e&&se(e[s],t[s])||(e[s]=t[s]);}}function pt(e){if(ne(e))return e;const t=ce(e);if(!function(e){switch(ce(e)){case ge:case ve:case _e:case ke:case me:case pe:case Pe:case Ve:case Ee:case Se:case Ie:case be:case he:case ye:case ue:case we:case de:case fe:case Ce:case xe:case Ae:case Te:return true;default:return false}}(e))return {};if(i=e,Array.isArray(i)){const t=Array.from(e);return e.length>0&&"string"==typeof e[0]&&Object.hasOwn(e,"index")&&(t.index=e.index,t.input=e.input),t}var i;if(ut(e)){const t=e;return new(t.constructor)(t.buffer,t.byteOffset,t.length)}if(t===_e)return new ArrayBuffer(e.byteLength);if(t===ke){const t=e,i=t.buffer,n=t.byteOffset,s=t.byteLength,o=new ArrayBuffer(s),r=new Uint8Array(i,n,s);return new Uint8Array(o).set(r),new DataView(o)}if(t===me||t===he||t===de){const i=new(e.constructor)(e.valueOf());return t===de?function(e,t){const i=t.valueOf().length;for(const n in t)Object.hasOwn(t,n)&&(Number.isNaN(Number(n))||Number(n)>=i)&&(e[n]=t[n]);}(i,e):bt(i,e),i}if(t===pe)return new Date(Number(e));if(t===ue){const t=e,i=new RegExp(t.source,t.flags);return i.lastIndex=t.lastIndex,i}if(t===fe)return Object(Symbol.prototype.valueOf.call(e));if(t===be){const t=e,i=new Map;return t.forEach((e,t)=>{i.set(t,e);}),i}if(t===we){const t=e,i=new Set;return t.forEach(e=>{i.add(e);}),i}if(t===ge){const t=e,i={};return bt(i,t),i.length=t.length,i[Symbol.iterator]=t[Symbol.iterator],i}const n={};return function(e,t){const i=Object.getPrototypeOf(t);if(null!==i){"function"==typeof t.constructor&&Object.setPrototypeOf(e,i);}}(n,e),bt(n,e),function(e,t){const i=Object.getOwnPropertySymbols(t);for(let n=0;n<i.length;n++){const s=i[n];Object.prototype.propertyIsEnumerable.call(t,s)&&(e[s]=t[s]);}}(n,e),n}function bt(e,t){for(const i in t)Object.hasOwn(t,i)&&(e[i]=t[i]);}function wt(e){if("object"!=typeof e)return false;if(null==e)return false;if(null===Object.getPrototypeOf(e))return true;if("[object Object]"!==Object.prototype.toString.call(e)){const t=e[Symbol.toStringTag];if(null==t)return false;return !!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable&&e.toString()===`[object ${t}]`}let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function vt(e,t=Q){return null==e?{}:function(e,t){const i={},n=Object.keys(e);for(let s=0;s<n.length;s++){const o=n[s],r=e[o];i[o]=t(r,o,e);}return i}(e,Ue(t))}function _t(e,...t){const i=t.slice(0,-1),n=t[t.length-1];let s=e;for(let e=0;e<i.length;e++){s=yt(s,i[e],n,new Map);}return s}function yt(e,t,i,n){if(ne(e)&&(e=Object(e)),null==t||"object"!=typeof t)return e;if(n.has(t))return function(e){if(ne(e))return e;if(Array.isArray(e)||Oe(e)||e instanceof ArrayBuffer||"undefined"!=typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer)return e.slice(0);const t=Object.getPrototypeOf(e),i=t.constructor;if(e instanceof Date||e instanceof Map||e instanceof Set)return new i(e);if(e instanceof RegExp){const t=new i(e);return t.lastIndex=e.lastIndex,t}if(e instanceof DataView)return new i(e.buffer.slice(0));if(e instanceof Error){const t=new i(e.message);return t.stack=e.stack,t.name=e.name,t.cause=e.cause,t}if("undefined"!=typeof File&&e instanceof File)return new i([e],e.name,{type:e.type,lastModified:e.lastModified});if("object"==typeof e){const i=Object.create(t);return Object.assign(i,e)}return e}(n.get(t));if(n.set(t,e),Array.isArray(t)){t=t.slice();for(let e=0;e<t.length;e++)t[e]=t[e]??void 0;}const s=[...Object.keys(t),...le(t)];for(let o=0;o<s.length;o++){const r=s[o];if(Y(r))continue;let a=t[r],l=e[r];if(ze(a)&&(a={...a}),ze(l)&&(l={...l}),"undefined"!=typeof Buffer&&Buffer.isBuffer(a)&&(a=Fe(a)),Array.isArray(a))if("object"==typeof l&&null!=l){const e=[],t=Reflect.ownKeys(l);for(let i=0;i<t.length;i++){const n=t[i];e[n]=l[n];}l=e;}else l=[];const c=i(l,a,r,e,t,n);null!=c?e[r]=c:Array.isArray(a)||qe(l)&&qe(a)?e[r]=yt(l,a,i,n):null==l&&wt(a)?e[r]=yt({},a,i,n):null==l&&ut(a)?e[r]=Fe(a):void 0!==l&&void 0===a||(e[r]=a);}return e}function kt(e,...t){return _t(e,...t,lt)}function Ct(e){return "function"==typeof e}function xt(e){return qe(e)&&1===e.nodeType&&!wt(e)}function At(e,t){if(!Number.isInteger(e)||e<0)throw new Error("n must be a non-negative integer.");let i=0;return (...n)=>{if(++i>=e)return t(...n)}}function Tt(e,t,i){return "function"!=typeof i&&(i=()=>{}),ot(e,t,(...n)=>{const s=i(...n);return void 0!==s?Boolean(s):e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?Tt(Array.from(e),Array.from(t),At(2,i)):void 0})}const Et=/\p{Lu}?\p{Ll}+|[0-9]+|\p{Lu}+(?!\p{Ll})|\p{Emoji_Presentation}|\p{Extended_Pictographic}|\p{L}+/gu;const St={"&":"&","<":"<",">":">",'"':""","'":"'"};function It(e){return nt(e).replace(/[&<>"']/g,e=>St[e])}function Pt(e){return function(e){return e.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&")}(nt(e))}function Vt(e){const t=function(e){return Array.from(e.match(Et)??[])}(function(e){return "string"!=typeof e&&(e=nt(e)),e.replace(/['\u2019]/g,"")}(e).trim());let i="";for(let e=0;e<t.length;e++){const n=t[e];i&&(i+=" "),n===n.toUpperCase()?i+=n:i+=n[0].toUpperCase()+n.slice(1).toLowerCase();}return i}function Ot(e){return function(e){return e.substring(0,1).toUpperCase()+e.substring(1)}(nt(e))}const Rt=Symbol("observableProperties"),Bt=Symbol("boundObservables"),Mt=Symbol("boundProperties"),Lt=Symbol("decoratedMethods"),Ft=Symbol("decoratedOriginal"),Nt=Dt(z());function Dt(e){if(!e)return Nt;return class extends e{set(e,t){if(ie(e))return void Object.keys(e).forEach(t=>{this.set(t,e[t]);},this);zt(this);const i=this[Rt];if(e in this&&!i.has(e))throw new I("observable-set-cannot-override",this);Object.defineProperty(this,e,{enumerable:true,configurable:true,get:()=>i.get(e),set(t){const n=i.get(e);let s=this.fire(`set:${e}`,e,t,n);void 0===s&&(s=t),n===s&&i.has(e)||(i.set(e,s),this.fire(`change:${e}`,e,s,n));}}),this[e]=t;}bind(...e){if(!e.length||!qt(e))throw new I("observable-bind-wrong-properties",this);if(new Set(e).size!==e.length)throw new I("observable-bind-duplicate-properties",this);zt(this);const t=this[Mt];e.forEach(e=>{if(t.has(e))throw new I("observable-bind-rebind",this)});const i=new Map;return e.forEach(e=>{const n={property:e,to:[]};t.set(e,n),i.set(e,n);}),{to:Ht,toMany:Ut,_observable:this,_bindProperties:e,_to:[],_bindings:i}}unbind(...e){if(!this[Rt])return;const t=this[Mt],i=this[Bt];if(e.length){if(!qt(e))throw new I("observable-unbind-wrong-properties",this);e.forEach(e=>{const n=t.get(e);n&&(n.to.forEach(([e,t])=>{const s=i.get(e),o=s[t];o.delete(n),o.size||delete s[t],Object.keys(s).length||(i.delete(e),this.stopListening(e,"change"));}),t.delete(e));});}else i.forEach((e,t)=>{this.stopListening(t,"change");}),i.clear(),t.clear();}decorate(e){zt(this);const t=this[e];if(!t)throw new I("observablemixin-cannot-decorate-undefined",this,{object:this,methodName:e});this.on(e,(e,i)=>{e.return=t.apply(this,i);}),this[e]=function(...t){return this.fire(e,t)},this[e][Ft]=t,this[Lt]||(this[Lt]=[]),this[Lt].push(e);}stopListening(e,t,i){if(!e&&this[Lt]){for(const e of this[Lt])this[e]=this[e][Ft];delete this[Lt];}super.stopListening(e,t,i);}[Rt];[Lt];[Mt];[Bt]}}function zt(e){e[Rt]||(Object.defineProperty(e,Rt,{value:new Map}),Object.defineProperty(e,Bt,{value:new Map}),Object.defineProperty(e,Mt,{value:new Map}));}function Ht(...e){const t=function(...e){if(!e.length)throw new I("observable-bind-to-parse-error",null);const t={to:[]};let i;"function"==typeof e[e.length-1]&&(t.callback=e.pop());return e.forEach(e=>{if("string"==typeof e)i.properties.push(e);else {if("object"!=typeof e)throw new I("observable-bind-to-parse-error",null);i={observable:e,properties:[]},t.to.push(i);}}),t}(...e),i=Array.from(this._bindings.keys()),n=i.length;if(!t.callback&&t.to.length>1)throw new I("observable-bind-to-no-callback",this);if(n>1&&t.callback)throw new I("observable-bind-to-extra-callback",this);var s;t.to.forEach(e=>{if(e.properties.length&&e.properties.length!==n)throw new I("observable-bind-to-properties-length",this);e.properties.length||(e.properties=this._bindProperties);}),this._to=t.to,t.callback&&(this._bindings.get(i[0]).callback=t.callback),s=this._observable,this._to.forEach(e=>{const t=s[Bt];let i;t.get(e.observable)||s.listenTo(e.observable,"change",(n,o)=>{i=t.get(e.observable)[o],i&&i.forEach(e=>{$t(s,e.property);});});}),function(e){let t;e._bindings.forEach((i,n)=>{e._to.forEach(s=>{t=s.properties[i.callback?0:e._bindProperties.indexOf(n)],i.to.push([s.observable,t]),function(e,t,i,n){const s=e[Bt],o=s.get(i),r=o||{};r[n]||(r[n]=new Set);r[n].add(t),o||s.set(i,r);}(e._observable,i,s.observable,t);});});}(this),this._bindProperties.forEach(e=>{$t(this._observable,e);});}function Ut(e,t,i){if(this._bindings.size>1)throw new I("observable-bind-to-many-not-one-binding",this);this.to(...function(e,t){const i=e.map(e=>[e,t]);return Array.prototype.concat.apply([],i)}(e,t),i);}function qt(e){return e.every(e=>"string"==typeof e)}function $t(e,t){const i=e[Mt].get(t);let n;i.callback?n=i.callback.apply(e,i.to.map(e=>e[0][e[1]])):(n=i.to[0],n=n[0][n[1]]),Object.prototype.hasOwnProperty.call(e,t)?e[t]=n:e.set(t,n);}class jt{_replacedElements;constructor(){this._replacedElements=[];}replace(e,t){this._replacedElements.push({element:e,newElement:t}),e.style.display="none",t&&e.parentNode.insertBefore(t,e.nextSibling);}restore(){this._replacedElements.forEach(({element:e,newElement:t})=>{e.style.display="",t&&t.remove();}),this._replacedElements=[];}}function Wt(e){let t=new AbortController;function i(...i){return t.abort(),t=new AbortController,e(t.signal,...i)}return i.abort=()=>t.abort(),i}function Gt(e){let t=0;for(const i of e)t++;return t}function Kt(e,t){const i=Math.min(e.length,t.length);for(let n=0;n<i;n++)if(e[n]!=t[n])return n;return e.length==t.length?"same":e.length<t.length?"prefix":"extension"}function Jt(e){return !(!e||!e[Symbol.iterator])}function Qt(e,t,i={},n=[]){const s=i&&i.xmlns,o=s?e.createElementNS(s,t):e.createElement(t);for(const e in i)o.setAttribute(e,i[e]);!We(n)&&Jt(n)||(n=[n]);for(let t of n)We(t)&&(t=e.createTextNode(t)),o.appendChild(t);return o}class Yt{_config;constructor(e,t){this._config=Object.create(null),t&&this.define(Zt(t)),e&&this._setObjectToTarget(this._config,e);}set(e,t){this._setToTarget(this._config,e,t);}define(e,t){this._setToTarget(this._config,e,t,true);}get(e){return this._getFromSource(this._config,e)}*names(){for(const e of Object.keys(this._config))yield e;}_setToTarget(e,t,i,n=false){if(wt(t))return void this._setObjectToTarget(e,t,n);const s=t.split(".");t=s.pop();for(const t of s)wt(e[t])||(e[t]=Object.create(null)),e=e[t];if(wt(i))return wt(e[t])||(e[t]=Object.create(null)),e=e[t],void this._setObjectToTarget(e,i,n);n&&void 0!==e[t]||(e[t]=i);}_getFromSource(e,t){const i=t.split(".");t=i.pop();for(const t of i){if(!wt(e[t])){e=null;break}e=e[t];}return e?Zt(e[t]):void 0}_setObjectToTarget(e,t,i){Object.keys(t).forEach(n=>{this._setToTarget(e,n,t[n],i);});}}function Zt(e){return Le(e,Xt)}function Xt(e){return xt(e)||"function"==typeof e?e:void 0}function ei(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 false}function ti(e){const t=Object.prototype.toString.apply(e);return "[object Window]"==t||"[object global]"==t}const ii=ni(z());function ni(t){if(!t)return ii;return class extends t{listenTo(t,i,n,s={}){if(ei(t)||ti(t)||t instanceof exports.global.window.EventTarget){const e={capture:!!s.useCapture,passive:!!s.usePassive},o=this._getProxyEmitter(t,e)||new si(t,e);this.listenTo(o,i,n,s);}else super.listenTo(t,i,n,s);}stopListening(t,i,n){if(ei(t)||ti(t)||t instanceof exports.global.window.EventTarget){const e=this._getAllProxyEmitters(t);for(const t of e)this.stopListening(t,i,n);}else super.stopListening(t,i,n);}_getProxyEmitter(e,t){return H(this,oi(e,t))}_getAllProxyEmitters(e){return [{capture:false,passive:false},{capture:false,passive:true},{capture:true,passive:false},{capture:true,passive:true}].map(t=>this._getProxyEmitter(e,t)).filter(e=>!!e)}}}class si extends(z()){_domNode;_options;constructor(e,t){super(),U(this,oi(e,t)),this._domNode=e,this._options=t;}_domListeners;attach(e){if(this._domListeners&&this._domListeners[e])return;const t=this._createDomListener(e);this._domNode.addEventListener(e,t,this._options),this._domListeners||(this._domListeners={}),this._domListeners[e]=t;}detach(e){let t;!this._domListeners[e]||(t=this._events[e])&&t.callbacks.length||this._domListeners[e].removeListener();}_addEventListener(e,t,i){this.attach(e),z().prototype._addEventListener.call(this,e,t,i);}_removeEventListener(e,t){z().prototype._removeEventListener.call(this,e,t),this.detach(e);}_createDomListener(e){const t=t=>{this.fire(e,t);};return t.removeListener=()=>{this._domNode.removeEventListener(e,t,this._options),delete this._domListeners[e];},t}}function oi(e,t){let i=function(e){return e["data-ck-expando"]||(e["data-ck-expando"]=A())}(e);for(const e of Object.keys(t).sort())t[e]&&(i+="-"+e);return i}function ri(t){let i=t.parentElement;if(!i)return null;for(;"BODY"!=i.tagName;){const t=i.style.overflowY||exports.global.window.getComputedStyle(i).overflowY;if("auto"===t||"scroll"===t)break;if(i=i.parentElement,!i)return null}return i}function ai(e){const t=[];let i=e;for(;i&&i.nodeType!=Node.DOCUMENT_NODE;)t.unshift(i),i=i.parentNode;return t}function li(e){return e instanceof HTMLTextAreaElement?e.value:e.innerHTML}function ci(e){const 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)}}function ui(e){if(!e.target)return null;const t=e.target.ownerDocument,i=e.clientX,n=e.clientY;let s=null;return t.caretRangeFromPoint&&t.caretRangeFromPoint(i,n)?s=t.caretRangeFromPoint(i,n):e.rangeParent&&(s=t.createRange(),s.setStart(e.rangeParent,e.rangeOffset),s.collapse(true)),s}function di(e,t){const i=ai(e),n=ai(t);let s=0;for(;i[s]==n[s]&&i[s];)s++;return 0===s?null:i[s-1]}function hi(t){return t&&t.parentNode?t.offsetParent===exports.global.document.body?null:t.offsetParent:null}function mi(e){return "[object Text]"==Object.prototype.toString.call(e)}function gi(e){return "[object Range]"==Object.prototype.toString.apply(e)}const fi=["top","right","bottom","left","width","height"];class pi{top;right;bottom;left;width;height;_source;constructor(e){const t=gi(e);if(Object.defineProperty(this,"_source",{value:e._source||e,writable:true,enumerable:false}),vi(e)||t)if(t){const t=pi.getDomRangeRects(e);bi(this,pi.getBoundingRect(t));}else bi(this,e.getBoundingClientRect());else if(ti(e)){const{innerWidth:t,innerHeight:i}=e;bi(this,{top:0,right:t,bottom:i,left:0,width:t,height:i});}else bi(this,e);}clone(){return new pi(this)}moveTo(e,t){return this.top=t,this.right=e+this.width,this.bottom=t+this.height,this.left=e,this}moveBy(e,t){return this.top+=t,this.right+=e,this.left+=e,this.bottom+=t,this}getIntersection(e){const t={top:Math.max(this.top,e.top),right:Math.min(this.right,e.right),bottom:Math.min(this.bottom,e.bottom),left:Math.max(this.left,e.left),width:0,height:0};if(t.width=t.right-t.left,t.height=t.bottom-t.top,t.width<0||t.height<0)return null;{const e=new pi(t);return e._source=this._source,e}}getIntersectionArea(e){const t=this.getIntersection(e);return t?t.getArea():0}getArea(){return this.width*this.height}getVisible(){const e=this._source;let t=this.clone();if(wi(e))return t;let i,n=e,s=e.parentNode||e.commonAncestorContainer;for(;s&&!wi(s);){const e="visible"===yi(s);n instanceof HTMLElement&&"absolute"===_i(n)&&(i=n);const o=_i(s);if(e||i&&("relative"===o&&e||"relative"!==o)){n=s,s=s.parentNode;continue}const r=new pi(s),a=t.getIntersection(r);if(!a)return null;a.getArea()<t.getArea()&&(t=a),n=s,s=s.parentNode;}return t}isEqual(e){for(const t of fi)if(this[t]!==e[t])return false;return true}contains(e){const t=this.getIntersection(e);return !(!t||!t.isEqual(e))}toAbsoluteRect(){const{scrollX:t,scrollY:i}=exports.global.window,n=this.clone().moveBy(t,i);if(vi(n._source)){const e=hi(n._source);e&&function(e,t){const i=new pi(t),n=ci(t);let s=0,o=0;s-=i.left,o-=i.top,s+=t.scrollLeft,o+=t.scrollTop,s-=n.left,o-=n.top,e.moveBy(s,o);}(n,e);}return n}excludeScrollbarsAndBorders(){const e=this._source;let t,i,n;if(ti(e))t=e.innerWidth-e.document.documentElement.clientWidth,i=e.innerHeight-e.document.documentElement.clientHeight,n=e.getComputedStyle(e.document.documentElement).direction;else {const s=ci(e);t=e.offsetWidth-e.clientWidth-s.left-s.right,i=e.offsetHeight-e.clientHeight-s.top-s.bottom,n=e.ownerDocument.defaultView.getComputedStyle(e).direction,this.left+=s.left,this.top+=s.top,this.right-=s.right,this.bottom-=s.bottom,this.width=this.right-this.left,this.height=this.bottom-this.top;}return this.width-=t,"ltr"===n?this.right-=t:this.left+=t,this.height-=i,this.bottom-=i,this}static getDomRangeRects(e){const t=[],i=Array.from(e.getClientRects());if(i.length)for(const e of i)t.push(new pi(e));else {let i=e.startContainer;mi(i)&&(i=i.parentNode);const n=new pi(i.getBoundingClientRect());n.right=n.left,n.width=0,t.push(n);}return t}static getBoundingRect(e){const t={left:Number.POSITIVE_INFINITY,top:Number.POSITIVE_INFINITY,right:Number.NEGATIVE_INFINITY,bottom:Number.NEGATIVE_INFINITY,width:0,height:0};let i=0;for(const n of e)i++,t.left=Math.min(t.left,n.left),t.top=Math.min(t.top,n.top),t.right=Math.max(t.right,n.right),t.bottom=Math.max(t.bottom,n.bottom);return 0==i?null:(t.width=t.right-t.left,t.height=t.bottom-t.top,new pi(t))}}function bi(e,t){for(const i of fi)e[i]=t[i];}function wi(e){return !!vi(e)&&e===e.ownerDocument.body}function vi(e){return null!==e&&"object"==typeof e&&1===e.nodeType&&"function"==typeof e.getBoundingClientRect}function _i(e){return e instanceof HTMLElement?e.ownerDocument.defaultView.getComputedStyle(e).position:"static"}function yi(e){return e instanceof HTMLElement?e.ownerDocument.defaultView.getComputedStyle(e).overflow:"visible"}class ki{_element;_callback;static _observerInstance=null;static _elementCallbacks=null;constructor(e,t){ki._observerInstance||ki._createObserver(),this._element=e,this._callback=t,ki._addElementCallback(e,t),ki._observerInstance.observe(e);}get element(){return this._element}destroy(){ki._deleteElementCallback(this._element,this._callback);}static _addElementCallback(e,t){ki._elementCallbacks||(ki._elementCallbacks=new Map);let i=ki._elementCallbacks.get(e);i||(i=new Set,ki._elementCallbacks.set(e,i)),i.add(t);}static _deleteElementCallback(e,t){const i=ki._getElementCallbacks(e);i&&(i.delete(t),i.size||(ki._elementCallbacks.delete(e),ki._observerInstance.unobserve(e))),ki._elementCallbacks&&!ki._elementCallbacks.size&&(ki._observerInstance=null,ki._elementCallbacks=null);}static _getElementCallbacks(e){return ki._elementCallbacks?ki._elementCallbacks.get(e):null}static _createObserver(){ki._observerInstance=new exports.global.window.ResizeObserver(e=>{for(const t of e){const e=ki._getElementCallbacks(t.target);if(e)for(const i of e)i(t);}});}}function Ci(e,t){e instanceof HTMLTextAreaElement&&(e.value=t),e.innerHTML=t;}function xi(e){return t=>t+e}function Ai(e){let t=0;for(;e.previousSibling;)e=e.previousSibling,t++;return t}function Ti(e,t,i){e.insertBefore(i,e.childNodes[t]||null);}function Ei(e){return e&&e.nodeType===Node.COMMENT_NODE}function Si(t){try{exports.global.document.createAttribute(t);}catch{return false}return true}function Ii(e){return !!e&&(mi(e)?Ii(e.parentElement):!!e.getClientRects&&!!e.getClientRects().length)}function Pi({element:t,target:i,positions:n,limiter:s,fitInViewport:o,viewportOffsetConfig:r}){Ct(i)&&(i=i()),Ct(s)&&(s=s());const a=hi(t),l=function(t){t=Object.assign({top:0,bottom:0,left:0,right:0},t);const i=new pi(exports.global.window);return i.top+=t.top,i.height-=t.top,i.bottom-=t.bottom,i.height-=t.bottom,i}(r),c=new pi(t),u=Vi(i,l);let d;if(!u||!l.getIntersection(u))return null;const h={targetRect:u,elementRect:c,positionedElementAncestor:a,viewportRect:l};if(s||o){if(s){const e=Vi(s,l);e&&(h.limiterRect=e);}d=function(e,t){const{elementRect:i}=t,n=i.getArea(),s=e.map(e=>new Oi(e,t)).filter(e=>!!e.name);let o=0,r=null;for(const e of s){const{limiterIntersectionArea:t,viewportIntersectionArea:i}=e;if(t===n)return e;const s=i**2+t**2;s>o&&(o=s,r=e);}return r}(n,h);}else d=new Oi(n[0],h);return d}function Vi(e,t){const i=new pi(e).getVisible();return i?i.getIntersection(t):null}class Oi{name;config;_positioningFunctionCoordinates;_options;_cachedRect;_cachedAbsoluteRect;constructor(e,t){const i=e(t.targetRect,t.elementRect,t.viewportRect,t.limiterRect);if(!i)return;const{left:n,top:s,name:o,config:r}=i;this.name=o,this.config=r,this._positioningFunctionCoordinates={left:n,top:s},this._options=t;}get left(){return this._absoluteRect.left}get top(){return this._absoluteRect.top}get limiterIntersectionArea(){const e=this._options.limiterRect;return e?e.getIntersectionArea(this._rect):0}get viewportIntersectionArea(){return this._options.viewportRect.getIntersectionArea(this._rect)}get _rect(){return this._cachedRect||(this._cachedRect=this._options.elementRect.clone().moveTo(this._positioningFunctionCoordinates.left,this._positioningFunctionCoordinates.top)),this._cachedRect}get _absoluteRect(){return this._cachedAbsoluteRect||(this._cachedAbsoluteRect=this._rect.toAbsoluteRect()),this._cachedAbsoluteRect}}function Ri(e){const t=e.parentNode;t&&t.removeChild(e);}function Bi(){const t=exports.global.window.visualViewport;if(!t||!n.isiOS&&!n.isSafari)return {left:0,top:0};return {left:Math.max(Math.round(t.offsetLeft),0),top:Math.max(Math.round(t.offsetTop),0)}}function Mi({target:e,viewportOffset:t=0,ancestorOffset:i=0,alignToTop:n,forceScroll:s}){const o=qi(e);let r=o,a=null;for(t=function(e){if("number"==typeof e)return {top:e,bottom:e,left:e,right:e};return e}(t);r;){let l;l=$i(r==o?e:a),Ni({parent:l,getRect:()=>ji(e,r),alignToTop:n,ancestorOffset:i,forceScroll:s});let c=ji(e,r);const u=ji(l,r);if(c.height>u.height){const e=c.getIntersection(u);e&&(c=e);}if(Fi({window:r,rect:c,viewportOffset:t,alignToTop:n,forceScroll:s}),r.parent!=r){if(a=r.frameElement,r=r.parent,!a)return}else r=null;}}function Li(e,t,i){Ni({parent:$i(e),getRect:()=>new pi(e),ancestorOffset:t,limiterElement:i});}function Fi({window:e,rect:t,alignToTop:i,forceScroll:n,viewportOffset:s}){const o=t.clone().moveBy(0,s.bottom),r=t.clone().moveBy(0,-s.top),a=new pi(e).excludeScrollbarsAndBorders(),l=i&&n,c=[r,o].every(e=>a.contains(e));let{scrollX:u,scrollY:d}=e;const h=u,m=d;l?d-=a.top-t.top+s.top:c||(zi(r,a)?d-=a.top-t.top+s.top:Di(o,a)&&(d+=i?t.top-a.top-s.top:t.bottom-a.bottom+s.bottom)),c||(Hi(t,a)?u-=a.left-t.left+s.left:Ui(t,a)&&(u+=t.right-a.right+s.right)),u==h&&d===m||e.scrollTo(u,d);}function Ni({parent:e,getRect:t,alignToTop:i,forceScroll:n,ancestorOffset:s=0,limiterElement:o}){const r=qi(e),a=i&&n;let l,c,u;const d=o||r.document.body;for(;e!=d;)c=t(),l=new pi(e).excludeScrollbarsAndBorders(),u=l.contains(c),a?e.scrollTop-=l.top-c.top+s:u||(zi(c,l)?e.scrollTop-=l.top-c.top+s:Di(c,l)&&(e.scrollTop+=i?c.top-l.top-s:c.bottom-l.bottom+s)),u||(Hi(c,l)?e.scrollLeft-=l.left-c.left+s:Ui(c,l)&&(e.scrollLeft+=c.right-l.right+s)),e=e.parentNode;}function Di(e,t){return e.bottom>t.bottom}function zi(e,t){return e.top<t.top}function Hi(e,t){return e.left<t.left}function Ui(e,t){return e.right>t.right}function qi(e){return gi(e)?e.startContainer.ownerDocument.defaultView:e.ownerDocument.defaultView}function $i(e){if(gi(e)){let t=e.commonAncestorContainer;return mi(t)&&(t=t.parentNode),t}return e.parentNode}function ji(e,t){const i=qi(e),n=new pi(e);if(i===t)return n;{let e=i;for(;e!=t;){const t=e.frameElement,i=new pi(t).excludeScrollbarsAndBorders();n.moveBy(i.left,i.top),e=e.parent;}}return n}const Wi={ctrl:"⌃",cmd:"⌘",alt:"⌥",shift:"⇧"},Gi={ctrl:"Ctrl+",alt:"Alt+",shift:"Shift+"},Ki={37:"←",38:"↑",39:"→",40:"↓",9:"⇥",33:"Page Up",34:"Page Down"},Ji=sn(),Qi=Object.fromEntries(Object.entries(Ji).map(([e,t])=>{let i;return i=t in Ki?Ki[t]:e.charAt(0).toUpperCase()+e.slice(1),[t,i]}));function Yi(e){let t;if("string"==typeof e){if(t=Ji[e.toLowerCase()],!t)throw new I("keyboard-unknown-key",null,{key:e})}else t=e.keyCode+(e.altKey?Ji.alt:0)+(e.ctrlKey?Ji.ctrl:0)+(e.shiftKey?Ji.shift:0)+(e.metaKey?Ji.cmd:0);return t}function Zi(e){return "string"==typeof e&&(e=function(e){return e.split("+").map(e=>e.trim())}(e)),e.map(e=>"string"==typeof e?function(e){if(e.endsWith("!"))return Yi(e.slice(0,-1));const t=Yi(e);return (n.isMac||n.isiOS)&&t==Ji.ctrl?Ji.cmd:t}(e):e).reduce((e,t)=>t+e,0)}function Xi(e,t){let i=Zi(e);const s=t?"Mac"===t:n.isMac||n.isiOS;return Object.entries(s?Wi:Gi).reduce((e,[t,n])=>(0!=(i&Ji[t])&&(i&=~Ji[t],e+=n),e),"")+(i?Qi[i]:"")}function en(e){return e==Ji.arrowright||e==Ji.arrowleft||e==Ji.arrowup||e==Ji.arrowdown}function tn(e,t){const i="ltr"===t;switch(e){case Ji.arrowleft:return i?"left":"right";case Ji.arrowright:return i?"right":"left";case Ji.arrowup:return "up";case Ji.arrowdown:return "down"}}function nn(e,t){const i=tn(e,t);return "down"===i||"right"===i}function sn(){const e={pageup:33,pagedown:34,end:35,home:36,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,backspace:8,delete:46,enter:13,space:32,esc:27,tab:9,ctrl:1114112,shift:2228224,alt:4456448,cmd:8912896};for(let t=65;t<=90;t++){e[String.fromCharCode(t).toLowerCase()]=t;}for(let t=48;t<=57;t++)e[t-48]=t;for(let t=112;t<=123;t++)e["f"+(t-111)]=t;return Object.assign(e,{"'":222,",":108,"-":109,".":110,"/":111,";":186,"=":187,"[":219,"\\":220,"]":221,"`":223}),e}const on=["ar","ara","dv","div","fa","per","fas","he","heb","ku","kur","ug","uig","ur","urd"];function rn(e){return on.includes(e)?"rtl":"ltr"}function an(e){return Array.isArray(e)?e:[e]}function ln(t,i,n){exports.global.window.CKEDITOR_TRANSLATIONS[t]||(exports.global.window.CKEDITOR_TRANSLATIONS[t]={});const s=exports.global.window.CKEDITOR_TRANSLATIONS[t];s.dictionary=s.dictionary||{},s.getPluralForm=n||s.getPluralForm,Object.assign(s.dictionary,i);}function cn(t,i,n=1,s){if("number"!=typeof n)throw new I("translation-service-quantity-not-a-number",null,{quantity:n});const o=s||exports.global.window.CKEDITOR_TRANSLATIONS,r=function(e){return Object.keys(e).length}(o);1===r&&(t=Object.keys(o)[0]);const a=i.id||i.string;if(0===r||!function(e,t,i){return !!i[e]&&!!i[e].dictionary[t]}(t,a,o))return 1!==n?i.plural:i.string;const l=o[t].dictionary,c=o[t].getPluralForm||(e=>1===e?0:1),u=l[a];if("string"==typeof u)return u;return u[Number(c(n))]}function un(){exports.global.window.CKEDITOR_TRANSLATIONS&&(exports.global.window.CKEDITOR_TRANSLATIONS={});}function dn(e){return Array.isArray(e)?e.reduce((e,t)=>kt(e,t)):e}exports.global.window.CKEDITOR_TRANSLATIONS||(exports.global.window.CKEDITOR_TRANSLATIONS={});class hn{uiLanguage;uiLanguageDirection;contentLanguage;contentLanguageDirection;t;translations;constructor({uiLanguage:e="en",contentLanguage:t,translations:i}={}){this.uiLanguage=e,this.contentLanguage=t||this.uiLanguage,this.uiLanguageDirection=rn(this.uiLanguage),this.contentLanguageDirection=rn(this.contentLanguage),this.