import{Command as x,Plugin as u}from"@ckeditor/ckeditor5-core";import{global as h,createElement as n,Rect as a,ResizeObserver as L,env as _}from"@ckeditor/ckeditor5-utils";import{BodyCollection as I,ButtonView as p,DialogViewPosition as g,MenuBarView as D,MenuBarMenuListItemButtonView as b}from"@ckeditor/ckeditor5-ui";import{IconPreviousArrow as m,IconDocumentOutlineToggle as F,IconFullscreenLeave as A,IconFullscreenEnter as B}from"@ckeditor/ckeditor5-icons";/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/const k=28;class c{_placeholderMap;_wrapper=null;_document;_annotationsUIsData=null;_paginationBodyCollection=null;_hasLeftCollapseButton=!1;_collapseLeftSidebarButton=null;_resizeObserver=null;_sidebarsWidths={left:0,right:0};_keepLeftSidebarHidden=!1;_forceShowLeftSidebar=!1;_sourceEditingCallback=(e,t,i)=>{this.getWrapper().querySelector(".ck-fullscreen__document-outline-header").style.display=i?"none":""};_hiddenElements=new Map;_savedAncestorsScrollPositions=new Map;_showRevisionViewerCallback=null;_closeRevisionViewerCallback=null;_aiTabsData=null;constructor(e){this._placeholderMap=new Map,e.plugins.has("RevisionHistory")&&(this._showRevisionViewerCallback=e.config.get("revisionHistory").showRevisionViewerCallback,this._closeRevisionViewerCallback=e.config.get("revisionHistory").closeRevisionViewerCallback),this._editor=e,this._document=this._editor.sourceElement?this._editor.sourceElement.ownerDocument:h.document,this._editor.config.define("fullscreen.container",this._document.body),e.on("destroy",()=>{this._wrapper&&this.destroy(),this._resizeObserver&&this._resizeObserver.destroy()})}moveToFullscreen(e,t){const i=n(this._document,"div");i.setAttribute("data-ck-fullscreen-placeholder",t),e.replaceWith(i),this.getWrapper().querySelector(`[data-ck-fullscreen="${t}"]`).append(e),this._placeholderMap.set(t,{placeholderElement:i,movedElement:e})}restoreMovedElementLocation(e){if(!this._placeholderMap.has(e))return;const{placeholderElement:t,movedElement:i}=this._placeholderMap.get(e);t.replaceWith(i),t.remove(),this._placeholderMap.delete(e),this._placeholderMap.size===0&&this._destroyContainer()}getWrapper(){return this._wrapper||(this._wrapper=n(this._document,"div",{class:"ck ck-fullscreen__main-wrapper"}),this._wrapper.innerHTML=`
				<div class="ck ck-fullscreen__top-wrapper ck-reset_all">
					<div class="ck ck-fullscreen__menu-bar" data-ck-fullscreen="menu-bar"></div>
					<div class="ck ck-fullscreen__toolbar" data-ck-fullscreen="toolbar"></div>
				</div>
				<div class="ck ck-fullscreen__editable-wrapper">
					<div class="ck ck-fullscreen__sidebar ck-fullscreen__left-sidebar" data-ck-fullscreen="left-sidebar"></div>
					<div class="ck ck-fullscreen__editable" data-ck-fullscreen="editable">
						<div class="ck ck-fullscreen__pagination-view" data-ck-fullscreen="pagination-view"></div>
					</div>
					<div class="ck ck-fullscreen__sidebar ck-fullscreen__right-sidebar" data-ck-fullscreen="right-sidebar"></div>
					<div class="ck ck-fullscreen__right-edge" data-ck-fullscreen="right-edge"></div>
				</div>
				<div class="ck ck-fullscreen__bottom-wrapper">
					<div class="ck ck-fullscreen__body-wrapper" data-ck-fullscreen="body-wrapper"></div>
				</div>
			`,this._editor.config.get("fullscreen.container").appendChild(this._wrapper)),this._wrapper}enable(){this._saveAncestorsScrollPositions(this._editor.ui.getEditableElement()),this.defaultOnEnter(),this._editor.config.get("fullscreen.container")===this._document.body&&(this._document.body.classList.add("ck-fullscreen"),this._document.body.parentElement.classList.add("ck-fullscreen"));/* istanbul ignore if -- @preserve */this._editor.plugins.has("PresenceListUI")&&this._generatePresenceListContainer();/* istanbul ignore if -- @preserve */this._editor.plugins.has("DocumentOutlineUI")&&this._generateDocumentOutlineContainer(),this._hasLeftCollapseButton&&this._generateCollapseButton();/* istanbul ignore next -- @preserve */if(this._editor.plugins.has("Pagination")&&this._editor.plugins.get("Pagination").isEnabled){const e=this._editor.plugins.get("PaginationRenderer");e.setupScrollableAncestor(),this._paginationBodyCollection=new I(this._editor.locale),this._paginationBodyCollection.attachToDom(),e.linesRepository.setViewCollection(this._paginationBodyCollection),this._editor.once("destroy",()=>{this._paginationBodyCollection.detachFromDom()}),this.moveToFullscreen(this._paginationBodyCollection.bodyCollectionContainer,"body-wrapper")}/* istanbul ignore if -- @preserve */if(this._editor.plugins.has("AnnotationsUIs")&&this._overrideAnnotationsUIs(),this._editor.plugins.has("RevisionHistory")){/* istanbul ignore if -- @preserve */this._editor.plugins.get("RevisionHistory").isRevisionViewerOpen&&this._editor.config.get("revisionHistory.closeRevisionViewerCallback")(),this._overrideRevisionHistoryCallbacks()}/* istanbul ignore if -- @preserve */this._editor.plugins.has("AITabs")&&this._handleAITabsTransfer(),this._editor.plugins.has("SourceEditing")&&this._editor.plugins.has("DocumentOutlineUI")&&this._editor.plugins.get("SourceEditing").on("change:isSourceEditingMode",this._sourceEditingCallback),this._editor.plugins.has("Dialog")&&this._registerFullscreenDialogPositionAdjustments();for(const e of this._editor.config.get("fullscreen.container").children)e!==this._wrapper&&!e.classList.contains("ck-body-wrapper")&&!e.classList.contains("ckbox-wrapper")&&e.style.display!=="none"&&(this._hiddenElements.set(e,e.style.display),e.style.display="none");this._sidebarsWidths={left:this._wrapper.querySelector(".ck-fullscreen__left-sidebar").scrollWidth,right:this._wrapper.querySelector(".ck-fullscreen__right-sidebar").scrollWidth},this._adjustVisibleElements(),this._setupResizeObserver(),this._editor.config.get("fullscreen.onEnterCallback")&&this._editor.config.get("fullscreen.onEnterCallback")(this.getWrapper())}disable(){this._editor.config.get("fullscreen.onLeaveCallback")&&this._editor.config.get("fullscreen.onLeaveCallback")(this.getWrapper()),this._document.body.classList.remove("ck-fullscreen"),this._document.body.parentElement.classList.remove("ck-fullscreen");/* istanbul ignore if -- @preserve */this._editor.plugins.has("DocumentOutlineUI")&&this._restoreDocumentOutlineDefaultContainer();/* istanbul ignore if -- @preserve */this._annotationsUIsData&&this._restoreAnnotationsUIs(),this._editor.plugins.has("RevisionHistory")&&this._restoreRevisionHistoryCallbacks();/* istanbul ignore if -- @preserve */this._editor.plugins.has("AITabs")&&this._restoreAITabs(),this._editor.plugins.has("SourceEditing")&&this._editor.plugins.has("DocumentOutlineUI")&&this._editor.plugins.get("SourceEditing").off("change:isSourceEditingMode",this._sourceEditingCallback);for(const e of this._placeholderMap.keys())this.restoreMovedElementLocation(e);this._destroyContainer(),this._editor.ui.view.toolbar&&this._editor.ui.view.toolbar.switchBehavior(this._editor.config.get("toolbar.shouldNotGroupWhenFull")===!0?"static":"dynamic");for(const[e,t]of this._savedAncestorsScrollPositions)e.scrollTo({left:t.scrollLeft,top:t.scrollTop,behavior:"instant"});this._savedAncestorsScrollPositions.clear();/* istanbul ignore next -- @preserve */if(this._editor.plugins.has("Pagination")&&this._editor.plugins.get("Pagination").isEnabled){const e=this._editor.plugins.get("PaginationRenderer");e.setupScrollableAncestor(),e.linesRepository.setViewCollection(this._editor.ui.view.body),this._paginationBodyCollection.detachFromDom(),this._paginationBodyCollection?.destroy()}this._editor.plugins.has("Dialog")&&this._unregisterFullscreenDialogPositionAdjustments(),this._keepLeftSidebarHidden=!1,this._resizeObserver?.destroy()}destroy(){for(const{placeholderElement:e,movedElement:t}of this._placeholderMap.values())e.remove(),t.remove();this._destroyContainer(),this._document.body.classList.remove("ck-fullscreen"),this._document.body.parentElement.classList.remove("ck-fullscreen")}defaultOnEnter(){return this.getWrapper()}_destroyContainer(){if(this._wrapper){this._wrapper.remove(),this._wrapper=null;for(const[e,t]of this._hiddenElements)e.style.display=t;this._hiddenElements.clear()}}_generatePresenceListContainer(){const e=this._editor.t,t=n(document,"div",{class:"ck ck-fullscreen__left-sidebar-item"});t.innerHTML=`
			<div class="ck ck-fullscreen__left-sidebar-header"></div>
			<div class="ck ck-fullscreen__presence-list" data-ck-fullscreen="presence-list"></div>
		`,t.firstElementChild.innerText=e("Connected users"),document.querySelector('[data-ck-fullscreen="left-sidebar-sticky"]')||document.querySelector('[data-ck-fullscreen="left-sidebar"]').appendChild(n(document,"div",{class:"ck ck-fullscreen__left-sidebar-sticky","data-ck-fullscreen":"left-sidebar-sticky"})),document.querySelector('[data-ck-fullscreen="left-sidebar-sticky"]').appendChild(t);const i=this._editor.plugins.get("PresenceListUI");this.moveToFullscreen(i.view.element,"presence-list"),this._hasLeftCollapseButton=!0}_generateDocumentOutlineContainer(){const e=this._editor.t,t=n(document,"div",{class:"ck-fullscreen__left-sidebar-item ck-fullscreen__left-sidebar-item--no-margin"});t.innerHTML=`
			<div class="ck ck-fullscreen__left-sidebar-header ck-fullscreen__document-outline-header"></div>
		`,t.firstElementChild.innerText=e("Document outline");const i=n(document,"div",{class:"ck ck-fullscreen__left-sidebar-item ck-fullscreen__document-outline-wrapper"});i.innerHTML=`
			<div class="ck ck-fullscreen__document-outline" data-ck-fullscreen="document-outline"></div>
		`,document.querySelector('[data-ck-fullscreen="left-sidebar-sticky"]')||document.querySelector('[data-ck-fullscreen="left-sidebar"]').appendChild(n(document,"div",{class:"ck ck-fullscreen__left-sidebar-sticky","data-ck-fullscreen":"left-sidebar-sticky"})),document.querySelector('[data-ck-fullscreen="left-sidebar"]').appendChild(i),document.querySelector('[data-ck-fullscreen="left-sidebar-sticky"]').appendChild(t);const s=this._editor.plugins.get("DocumentOutlineUI");s.view.documentOutlineContainer=document.querySelector('[data-ck-fullscreen="left-sidebar"]'),this.moveToFullscreen(s.view.element,"document-outline"),this._hasLeftCollapseButton=!0}_restoreDocumentOutlineDefaultContainer(){const e=this._editor.plugins.get("DocumentOutlineUI");e.view.documentOutlineContainer=e.view.element}_generateCollapseButton(){const e=new p(this._editor.locale),t=document.querySelector(".ck-fullscreen__left-sidebar"),i=this._editor.t;e.set({label:i("Toggle sidebar"),class:"ck-fullscreen__left-sidebar-toggle-button",tooltip:i("Hide left sidebar"),tooltipPosition:"se",icon:m}),e.on("execute",()=>{t.classList.contains("ck-fullscreen__left-sidebar--collapsed")?(this._forceShowLeftSidebar=!0,this._keepLeftSidebarHidden=!1,this._showLeftSidebar()):(this._keepLeftSidebarHidden=!0,this._hideLeftSidebar()),this._editor.editing.view.focus()}),e.render(),this._collapseLeftSidebarButton=e,t.prepend(e.element)}_overrideAnnotationsUIs(){const e=this._editor.plugins.get("AnnotationsUIs");this._annotationsUIsData=new Map(e.uisData),e.deactivateAll();const t=this._editor.plugins.get("Sidebar");t.container?(this._switchAnnotationsUI("wideSidebar"),this.moveToFullscreen(t.container.firstElementChild,"right-sidebar"),t.setContainer(this.getWrapper().querySelector('[data-ck-fullscreen="right-sidebar"]'))):(t.setContainer(this.getWrapper().querySelector('[data-ck-fullscreen="right-sidebar"]')),this._switchAnnotationsUI("wideSidebar"),this.moveToFullscreen(t.container.firstElementChild,"right-sidebar"))}_restoreAnnotationsUIs(){const e=this._editor.plugins.get("Sidebar"),t=e.context.config.get("sidebar.container");t&&e.setContainer(t);const i=this._editor.plugins.get("AnnotationsUIs");i.deactivateAll();for(const[s,r]of[...this._annotationsUIsData])i.activate(s,r.filter);this._annotationsUIsData=null}_overrideRevisionHistoryCallbacks(){/* istanbul ignore next -- @preserve */this._editor.config.set("revisionHistory.showRevisionViewerCallback",async()=>{const e=await this._showRevisionViewerCallback();return this._editor.plugins.has("DocumentOutlineUI")&&(this.getWrapper().querySelector(".ck-fullscreen__document-outline-header").style.display="none"),this.restoreMovedElementLocation("editable"),this.restoreMovedElementLocation("toolbar"),this.restoreMovedElementLocation("right-sidebar"),this._annotationsUIsData&&this._restoreAnnotationsUIs(),this._editor.ui.view.menuBarView&&this._editor.ui.view.menuBarView.disable(),this.moveToFullscreen(e.ui.getEditableElement(),"editable"),this.moveToFullscreen(e.ui.view.toolbar.element,"toolbar"),this.moveToFullscreen(this._editor.config.get("revisionHistory.viewerSidebarContainer"),"right-sidebar"),e});/* istanbul ignore next -- @preserve */this._editor.config.set("revisionHistory.closeRevisionViewerCallback",async()=>{this.restoreMovedElementLocation("toolbar"),this.restoreMovedElementLocation("editable"),this.restoreMovedElementLocation("right-sidebar"),this._editor.plugins.has("DocumentOutlineUI")&&(this.getWrapper().querySelector(".ck-fullscreen__document-outline-header").style.display=""),this.moveToFullscreen(this._editor.ui.getEditableElement(),"editable"),this.moveToFullscreen(this._editor.ui.view.toolbar.element,"toolbar"),await this._closeRevisionViewerCallback(),this._editor.plugins.has("AnnotationsUIs")&&this._overrideAnnotationsUIs(),this._editor.ui.view.menuBarView&&this._editor.ui.view.menuBarView.enable()})}_restoreRevisionHistoryCallbacks(){/* istanbul ignore next -- @preserve */this._editor.config.set("revisionHistory.showRevisionViewerCallback",async()=>this._showRevisionViewerCallback());/* istanbul ignore next -- @preserve */this._editor.config.set("revisionHistory.closeRevisionViewerCallback",async()=>this._closeRevisionViewerCallback())}_registerFullscreenDialogPositionAdjustments(){const e=this._editor.plugins.get("Dialog");this._setNewDialogPosition(),e.on("change:isOpen",this.updateDialogPositionCallback,{priority:"highest"})}_unregisterFullscreenDialogPositionAdjustments(){const e=this._editor.plugins.get("Dialog"),t=e.view;t&&t.position===null&&(t.position=g.EDITOR_TOP_SIDE),t&&t.updatePosition(),e.off("change:isOpen",this.updateDialogPositionCallback)}updateDialogPositionCallback=this._updateDialogPosition.bind(this);_updateDialogPosition(e,t,i){i&&this._setNewDialogPosition()}_setNewDialogPosition(){const t=this._editor.plugins.get("Dialog").view;if(!t||t.position!==g.EDITOR_TOP_SIDE)return;const i=new a(this._wrapper.querySelector(".ck-fullscreen__right-edge")).getVisible(),s=i?this._wrapper.querySelector(".ck-fullscreen__right-edge"):this._wrapper,r=new a(s).getVisible(),o=new a(document.querySelector(".ck-fullscreen__editable")).getVisible(),d=new a(t.element.querySelector(".ck-dialog")).getVisible(),C=new a(document.querySelector(".ck-fullscreen__editable-wrapper")).excludeScrollbarsAndBorders().getVisible().width-new a(document.querySelector(".ck-fullscreen__editable-wrapper")).getVisible().width;if(r&&o&&d){t.position=null;const T=i?r.left-d.width-k:r.left+r.width-d.width-k+C;t.moveTo(T,o.top)}}_saveAncestorsScrollPositions(e){let t=e.parentElement;if(t)for(;t;){const i=t.style.overflowY||h.window.getComputedStyle(t).overflowY,s=t.style.overflowX||h.window.getComputedStyle(t).overflowX;i==="auto"||i==="scroll"||s==="auto"||s==="scroll"?this._savedAncestorsScrollPositions.set(t,{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}):t.tagName==="HTML"&&this._savedAncestorsScrollPositions.set(t,{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}),t=t.parentElement}}_handleAITabsTransfer(){const e=this._editor.plugins.get("AITabs");this._aiTabsData={side:e.side,type:e.type},this.moveToFullscreen(e.view.element,"right-edge"),e.side="right",e.type="sidebar",e.view.element.addEventListener("transitionend",t=>this._handleAISidebarTransitions(t))}_handleAISidebarTransitions(e){const t=this._editor.plugins.get("AITabs");e.target===t.view.element&&e.propertyName.includes("width")&&this._adjustVisibleElements()}_restoreAITabs(){const e=this._editor.plugins.get("AITabs");e.side=this._aiTabsData?.side,e.type=this._aiTabsData?.type,this._aiTabsData=null,e.view.element.removeEventListener("transitionend",this._handleAISidebarTransitions)}_adjustVisibleElements(){const e=this._wrapper.querySelector(".ck-fullscreen__editable-wrapper");if(this._forceShowLeftSidebar){this._forceShowLeftSidebar=!1;return}if(e.scrollWidth>e.clientWidth)this._hideLeftSidebar(),e.scrollWidth>e.clientWidth&&this._hideRightSidebar();else{let t=[...e.children].reduce((i,s)=>i+s.scrollWidth,0);t+this._sidebarsWidths.right<e.clientWidth&&(this._showRightSidebar(),t=[...e.children].reduce((i,s)=>i+s.scrollWidth,0)),t+this._sidebarsWidths.left<e.clientWidth&&!this._keepLeftSidebarHidden&&this._showLeftSidebar()}}_switchAnnotationsUI(e){const t=this._editor.plugins.get("AnnotationsUIs");t.deactivateAll();const i=new Map;for(const[s,r]of[...this._annotationsUIsData])r.filter!==t.defaultFilter&&i.set(s,r.filter);i.has(e)?t.activate(e,i.get(e)):i.size?t.activate(e,s=>[...i.values()].some(r=>r(s))):t.switchTo(e)}_setupResizeObserver(){const e=this._wrapper.querySelector(".ck-fullscreen__editable-wrapper");this._resizeObserver&&this._resizeObserver.destroy(),this._resizeObserver=new L(e,()=>{this._adjustVisibleElements()})}_hideLeftSidebar(){const e=this._editor.t;this._collapseLeftSidebarButton&&(this._wrapper.querySelector(".ck-fullscreen__left-sidebar").classList.add("ck-fullscreen__left-sidebar--collapsed"),this._collapseLeftSidebarButton.icon=F,this._collapseLeftSidebarButton.tooltip=e("Show left sidebar"))}_showLeftSidebar(){const e=this._editor.t;this._collapseLeftSidebarButton&&(this._wrapper.querySelector(".ck-fullscreen__left-sidebar").classList.remove("ck-fullscreen__left-sidebar--collapsed"),this._collapseLeftSidebarButton.icon=m,this._collapseLeftSidebarButton.tooltip=e("Hide left sidebar"))}_hideRightSidebar(){this._wrapper.querySelector(".ck-fullscreen__right-sidebar").firstChild&&(this._switchAnnotationsUI("narrowSidebar"),this._wrapper.querySelector(".ck-fullscreen__right-sidebar").classList.add("ck-fullscreen__right-sidebar--collapsed"))}_showRightSidebar(){this._wrapper.querySelector(".ck-fullscreen__right-sidebar").firstChild&&(this._switchAnnotationsUI("wideSidebar"),this._wrapper.querySelector(".ck-fullscreen__right-sidebar").classList.remove("ck-fullscreen__right-sidebar--collapsed"))}}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class v extends c{_editor;constructor(e){super(e),this._editor=e}defaultOnEnter(){const e=this._editor.ui,t=e.view;/* istanbul ignore next -- @preserve */return this._editor.plugins.has("Pagination")&&this._editor.plugins.get("Pagination").isEnabled&&this.moveToFullscreen(e.getEditableElement().parentElement.querySelector(".ck-pagination-view"),"pagination-view"),this.moveToFullscreen(e.getEditableElement(),"editable"),this.moveToFullscreen(t.toolbar.element,"toolbar"),t.toolbar.switchBehavior(this._editor.config.get("fullscreen.toolbar.shouldNotGroupWhenFull")===!0?"static":"dynamic"),this.getWrapper().setAttribute("dir",t.element.getAttribute("dir")),this.getWrapper().classList.add("ck-rounded-corners"),this._editor.config.get("fullscreen.menuBar.isVisible")&&(t.menuBarView||(t.menuBarView=new D(this._editor.locale),t.menuBarView.render(),e.initMenuBar(t.menuBarView)),this.moveToFullscreen(t.menuBarView.element,"menu-bar")),this.getWrapper()}}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class w extends c{_editor;constructor(e){super(e),this._editor=e}defaultOnEnter(){/* istanbul ignore next -- @preserve */return this._editor.plugins.has("Pagination")&&this._editor.plugins.get("Pagination").isEnabled&&this.moveToFullscreen(this._editor.ui.getEditableElement().parentElement.querySelector(".ck-pagination-view"),"pagination-view"),this.moveToFullscreen(this._editor.ui.getEditableElement(),"editable"),this.moveToFullscreen(this._editor.ui.view.toolbar.element,"toolbar"),this._editor.ui.view.toolbar.switchBehavior(this._editor.config.get("fullscreen.toolbar.shouldNotGroupWhenFull")===!0?"static":"dynamic"),this._editor.config.get("fullscreen.menuBar.isVisible")&&this.moveToFullscreen(this._editor.ui.view.menuBarView.element,"menu-bar"),this.getWrapper()}}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class y extends x{fullscreenHandler;constructor(e){super(e),this.affectsData=!1,this.isEnabled=!0,this.value=!1,V(e)?this.fullscreenHandler=new v(e):O(e)?this.fullscreenHandler=new w(e):this.fullscreenHandler=new c(e)}execute(){this.value?this._disableFullscreenMode():this._enableFullscreenMode()}_enableFullscreenMode(){this.fullscreenHandler.enable(),this.value=!0}_disableFullscreenMode(){this.fullscreenHandler.disable(),this.value=!1}}function V(l){return l.constructor.editorName==="ClassicEditor"}function O(l){return l.constructor.editorName==="DecoupledEditor"}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class f extends u{static get pluginName(){return"FullscreenEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define("fullscreen.menuBar.isVisible",!0),e.config.define("fullscreen.toolbar.shouldNotGroupWhenFull",e.config.get("toolbar.shouldNotGroupWhenFull")===!0)}init(){this.editor.commands.add("toggleFullscreen",new y(this.editor));const e=this.editor.locale.t;this.editor.keystrokes.set("Ctrl+Shift+F",(t,i)=>{this.editor.execute("toggleFullscreen"),_.isBlink||(this.editor.editing.view.document.isFocused=!1,this.editor.ui.view.toolbar.focusTracker.focusedElement=null),this.editor.editing.view.scrollToTheSelection(),this.editor.editing.view.focus(),i()}),this.editor.accessibility.addKeystrokeInfos({keystrokes:[{label:e("Toggle fullscreen mode"),keystroke:"CTRL+SHIFT+F"}],categoryId:"navigation"})}}function P(l,{insertAt:e}={}){if(typeof document>"u")return;const t=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",window.litNonce&&i.setAttribute("nonce",window.litNonce),e==="top"&&t.firstChild?t.insertBefore(i,t.firstChild):t.appendChild(i),i.styleSheet?i.styleSheet.cssText=l:i.appendChild(document.createTextNode(l))}P('body.ck-fullscreen,html.ck-fullscreen{--ck-z-fullscreen:10000;overflow:hidden;--ck-z-default:calc(var(--ck-z-fullscreen) + 1);--ck-z-panel:calc(var(--ck-z-default) + 999);--ck-z-dialog:100000}body.ck-fullscreen .ckbox-reset:not(#n)>.ckbox--dialog,html.ck-fullscreen .ckbox-reset:not(#n)>.ckbox--dialog{--ckbox-z-index-root:calc(var(--ck-z-dialog) + 1)}body.ck-fullscreen .ckbox:not(#n) .ckbox-img-editor,html.ck-fullscreen .ckbox:not(#n) .ckbox-img-editor{--ckbox-z-index-preview:calc(var(--ck-z-dialog) + 1)}body.ck-fullscreen .ck-pagination-view-line,html.ck-fullscreen .ck-pagination-view-line{z-index:calc(var(--ck-z-fullscreen) + 1)}body.ck-fullscreen .page-break__label,html.ck-fullscreen .page-break__label{z-index:calc(var(--ck-z-fullscreen) + 2)}.ck.ck-fullscreen__main-wrapper{background:var(--ck-color-base-foreground);display:flex;flex-direction:column;height:100%;left:0;position:fixed;top:0;width:100%;z-index:var(--ck-z-fullscreen)}.ck.ck-fullscreen__main-wrapper .ck.ck-revision-history-ui__changes-navigation{margin-bottom:0;margin-top:0}:not(body>.ck-fullscreen__main-wrapper).ck-fullscreen__main-wrapper{position:absolute}.ck-fullscreen__main-wrapper:not(body>.ck-fullscreen__main-wrapper) .ck-fullscreen__top-wrapper{border-left:1px solid var(--ck-color-base-border);border-radius:var(--ck-border-radius) 0;border-right:1px solid var(--ck-color-base-border);border-top:1px solid var(--ck-color-base-border)}.ck-fullscreen__menu-bar .ck.ck-menu-bar{border:none}.ck.ck-fullscreen__toolbar .ck-toolbar{border-left:0;border-radius:0;border-right:0}.ck-fullscreen__main-wrapper .ck-fullscreen__editable-wrapper{--ck-fullscreen-editor-top-margin:28px;--ck-fullscreen-editor-bottom-margin:28px;display:flex;justify-content:flex-start;max-height:100%;overflow:auto}.ck-fullscreen__main-wrapper .ck-fullscreen__editable{height:100%;margin-left:auto;margin-top:var(--ck-fullscreen-editor-top-margin)}.ck-fullscreen__main-wrapper .ck-fullscreen__editable:after{content:"";display:block;height:var(--ck-fullscreen-editor-bottom-margin)}.ck-fullscreen__main-wrapper .ck-fullscreen__editable .ck.ck-editor__editable:not(.ck-editor__nested-editable){background:#fff;border:1px solid var(--ck-color-base-border);box-shadow:0 2px 3px rgba(0,0,0,.078);box-sizing:border-box;height:fit-content;margin:0;max-width:210.52917mm;min-height:297mm;padding:20mm 12mm;width:210.52917mm}.ck-fullscreen__main-wrapper .ck-fullscreen__editable .ck-source-editing-area{width:210.52917mm}.ck-fullscreen__sidebar{margin-left:10px;margin-top:var(--ck-fullscreen-editor-top-margin);width:270px}.ck-fullscreen__left-sidebar{font-family:Helvetica,Arial,sans-serif;--ck-user-avatar-size:28px;align-self:flex-start;background-color:transparent;box-sizing:border-box;display:flex;flex-direction:column;height:100%;margin-right:10px;margin-top:0;position:sticky;top:0}.ck-fullscreen__left-sidebar .ck-button.ck-fullscreen__left-sidebar-toggle-button{--ck-icon-size:20px;--ck-ui-component-min-height:0px;align-self:flex-start;border-radius:100%;margin-bottom:var(--ck-spacing-large);margin-top:var(--ck-fullscreen-editor-top-margin);opacity:.5;padding-top:0}.ck-fullscreen__left-sidebar>.ck-fullscreen__left-sidebar-sticky{min-width:270px}.ck-fullscreen__left-sidebar>.ck-fullscreen__left-sidebar-sticky:first-child{padding-top:var(--ck-fullscreen-editor-top-margin)}.ck-fullscreen__left-sidebar.ck-fullscreen__left-sidebar--collapsed{width:65px}.ck-fullscreen__left-sidebar.ck-fullscreen__left-sidebar--collapsed>:not(.ck-fullscreen__left-sidebar-toggle-button){display:none}.ck-fullscreen__left-sidebar .ck.ck-presence-list--collapsed{--ck-user-avatar-size:32px}.ck-fullscreen__left-sidebar .ck-presence-list__users-counter__text,.ck-fullscreen__left-sidebar .ck-user{font-size:.85em}.ck-fullscreen__left-sidebar-item{margin-bottom:var(--ck-spacing-medium);padding:var(--ck-spacing-medium)}.ck-fullscreen__left-sidebar-item:first-child{padding-top:0}.ck-fullscreen__left-sidebar-item:last-child{margin-bottom:0}.ck-fullscreen__left-sidebar-header{--ck-fullscreen-presence-list-header-font-size:0.875em;color:var(--ck-document-outline-item-default-color);font-size:var(--ck-fullscreen-presence-list-header-font-size);font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ck-fullscreen__left-sidebar--sticky{position:sticky;top:0}.ck-fullscreen__left-sidebar--sticky>:first-child{padding-top:0}.ck-fullscreen__presence-list{margin-top:var(--ck-spacing-medium)}.ck-fullscreen__left-sidebar-item--no-margin{margin:0}.ck-fullscreen__left-sidebar .ck.ck-document-outline{padding-left:0;padding-right:0;padding-top:0}.ck-fullscreen__document-outline-wrapper{overflow-y:auto;padding-top:0}.ck-fullscreen__sidebar.ck-fullscreen__right-sidebar{margin-right:auto;margin-top:var(--ck-fullscreen-editor-top-margin)}.ck-fullscreen__sidebar.ck-fullscreen__right-sidebar:not(.ck-fullscreen__right-sidebar--collapsed)>:first-child{min-width:270px}.ck-fullscreen__sidebar.ck-fullscreen__right-sidebar.ck-fullscreen__right-sidebar--collapsed{width:65px}.ck-fullscreen__sidebar.ck-fullscreen__right-sidebar.ck-fullscreen__right-sidebar--collapsed>:first-child{min-width:65px}.ck.ck-fullscreen__right-edge{margin-left:10px;margin-top:0;position:sticky;top:0}.ck.ck-fullscreen__right-edge>:first-child{border-bottom:none;border-right:none;border-top:none;height:100%;width:495px}');/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/const S="toggleFullscreen";class E extends u{static get requires(){return[f]}static get pluginName(){return"FullscreenUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.ui.componentFactory.add("fullscreen",()=>this._createButton(p)),e.ui.componentFactory.add("menuBar:fullscreen",()=>this._createButton(b))}_createButton(e){const t=this.editor,i=t.t,s=t.commands.get(S),r=new e(t.locale);return r.set({isToggleable:!0}),r.bind("isEnabled").to(s,"isEnabled"),r.bind("isOn").to(s,"value"),r instanceof b?r.set({role:"menuitemcheckbox",label:i("Fullscreen mode")}):(r.bind("icon").to(s,"value",o=>o?A:B),r.bind("label").to(s,"value",o=>i(o?"Leave fullscreen mode":"Enter fullscreen mode")),r.set({tooltip:!0})),this.listenTo(r,"execute",()=>{t.execute(S),_.isBlink||(this.editor.ui.view.toolbar.focusTracker.focusedElement=null),t.editing.view.scrollToTheSelection(),t.editing.view.focus()}),r}}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class R extends u{static get requires(){return[f,E]}static get pluginName(){return"Fullscreen"}static get isOfficialPlugin(){return!0}}export{R as Fullscreen,c as FullscreenAbstractEditorHandler,v as FullscreenClassicEditorHandler,y as FullscreenCommand,w as FullscreenDecoupledEditorHandler,f as FullscreenEditing,E as FullscreenUI};
