/*!
 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
 * For licensing, see LICENSE.md.
 */(()=>{var e={237:e=>{"use strict";e.exports=CKEditor5.dll},311:(e,t,i)=>{e.exports=i(237)("./src/ui.js")},584:(e,t,i)=>{e.exports=i(237)("./src/utils.js")},782:(e,t,i)=>{e.exports=i(237)("./src/core.js")},783:(e,t,i)=>{e.exports=i(237)("./src/engine.js")}},t={};function i(o){var r=t[o];if(void 0!==r)return r.exports;var n=t[o]={exports:{}};return e[o](n,n.exports,i),n.exports}i.d=(e,t)=>{for(var o in t)i.o(t,o)&&!i.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};(()=>{"use strict";i.r(o),i.d(o,{BalloonEditor:()=>c,BalloonEditorUI:()=>s,BalloonEditorUIView:()=>l});var e=i(782),t=i(311),r=i(584),n=i(783);class s extends t.EditorUI{view;constructor(e,t){super(e),this.view=t}get element(){return this.view.editable.element}init(){const e=this.editor,t=this.view,i=e.editing.view,o=t.editable,r=i.document.getRoot();o.name=r.rootName,t.render();const n=o.element;this.setEditableElement(o.name,n),o.bind("isFocused").to(this.focusTracker),i.attachDomRoot(n),this._initPlaceholder(),this.initMenuBar(this.view.menuBarView),this.fire("ready")}destroy(){super.destroy();const e=this.view,t=this.editor.editing.view;t.getDomRoot(e.editable.name)&&t.detachDomRoot(e.editable.name),e.destroy()}_initPlaceholder(){const e=this.editor,t=e.editing.view,i=t.document.getRoot(),o=e.config.get("placeholder");if(o){const e="string"==typeof o?o:o[i.rootName];e&&(i.placeholder=e)}(0,n.enableViewPlaceholder)({view:t,element:i,isDirectHost:!1,keepOnFocus:!0})}}class l extends t.EditorUIView{editable;menuBarView;constructor(e,i,o,r){super(e),this.editable=new t.InlineEditableUIView(e,i,o,{label:r}),this.menuBarView=new t.MenuBarView(e),this.menuBarView.extendTemplate({attributes:{class:["ck-reset_all","ck-rounded-corners"],dir:e.uiLanguageDirection}})}render(){super.render(),this.registerChild(this.editable),this.registerChild(this.menuBarView)}}function a(e){return function(e){return"object"==typeof e&&null!==e}(e)&&1===e.nodeType&&!function(e){if("object"!=typeof e)return!1;if(null==e)return!1;if(null===Object.getPrototypeOf(e))return!0;if("[object Object]"!==Object.prototype.toString.call(e)){const t=e[Symbol.toStringTag];return null!=t&&(!!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}(e)}class c extends((0,e.ElementApiMixin)(e.Editor)){static get editorName(){return"BalloonEditor"}ui;constructor(i,o={}){if(!d(i)&&void 0!==o.initialData)throw new r.CKEditorError("editor-create-initial-data",null);super(o),void 0===this.config.get("initialData")&&this.config.set("initialData",function(e){return d(e)?(0,r.getDataFromElement)(e):e}(i)),d(i)&&(this.sourceElement=i,(0,e.secureSourceElement)(this,i));const n=this.config.get("plugins");n.push(t.BalloonToolbar),this.config.set("plugins",n),this.config.define("balloonToolbar",this.config.get("toolbar")),this.model.document.createRoot();const a=new l(this.locale,this.editing.view,this.sourceElement,this.config.get("label"));this.ui=new s(this,a),(0,e.attachToForm)(this)}destroy(){const e=this.getData();return this.ui.destroy(),super.destroy().then(()=>{this.sourceElement&&this.updateSourceElement(e)})}static create(e,t={}){return new Promise(i=>{if(d(e)&&"TEXTAREA"===e.tagName)throw new r.CKEditorError("editor-wrong-element",null);const o=new this(e,t);i(o.initPlugins().then(()=>o.ui.init()).then(()=>o.data.init(o.config.get("initialData"))).then(()=>o.fire("ready")).then(()=>o))})}}function d(e){return a(e)}})(),(window.CKEditor5=window.CKEditor5||{}).editorBalloon=o})();