PageSourceSearch

https://nbstsa-fe-prod.onrender.com/_next/static/chunks/804.db597daf79066a83.js

js nbstsa-fe-prod.onrender.com collected 2026-10-03 11:42:19 UTC 25,027 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[804],{1804:(e,t,r)=>{r.r(t),r.d(t,{CKEditor:()=>V,CKEditorContext:()=>P,loadCKEditorCloud:()=>O,useCKEditorCloud:()=>Y,useMultiRootEditor:()=>J,withCKEditorCloud:()=>Q});var n,i=r(4232);let o=new Map;function s(e,{attributes:t}={}){if(o.has(e))return o.get(e);let r=document.querySelector(`script[src="${e}"]`);r&&(console.warn(`Script with "${e}" src is already present in DOM!`),r.remove());let n=new Promise((r,n)=>{let i=document.createElement("script");for(let[e,o]of(i.onerror=n,i.onload=()=>{r()},Object.entries(t||{})))i.setAttribute(e,o);i.setAttribute("data-injected-by","ckeditor-integration"),i.type="text/javascript",i.async=!0,i.src=e,document.head.appendChild(i);let s=new MutationObserver(t=>{t.flatMap(e=>Array.from(e.removedNodes)).includes(i)&&(o.delete(e),s.disconnect())});s.observe(document.head,{childList:!0,subtree:!0})});return o.set(e,n),n}async function a(e,t){await Promise.all(e.map(e=>s(e,t)))}let l=new Map;function u(e,t){return t.length=0,t.push(...e),t}function c(e,t){for(let e of Object.getOwnPropertyNames(t))delete t[e];for(let[r,n]of Object.entries(e))n!==t&&"prototype"!==r&&"__proto__"!==r&&(t[r]=n);return t}let d=Array(256).fill("").map((e,t)=>("0"+t.toString(16)).slice(-2));function h(){let[e,t,r,n]=crypto.getRandomValues(new Uint32Array(4));return"e"+d[(0|e)&255]+d[e>>8&255]+d[e>>16&255]+d[e>>24&255]+d[(0|t)&255]+d[t>>8&255]+d[t>>16&255]+d[t>>24&255]+d[(0|r)&255]+d[r>>8&255]+d[r>>16&255]+d[r>>24&255]+d[(0|n)&255]+d[n>>8&255]+d[n>>16&255]+d[n>>24&255]}function f(e){return Array.from(new Set(e))}async function m(e,t){return function(e,{timeOutAfter:t=500,retryAfter:r=100}={}){return new Promise((n,i)=>{let o=Date.now(),s=null,a=setTimeout(()=>{i(s??Error("Timeout"))},t),l=async()=>{try{let t=await e();clearTimeout(a),n(t)}catch(e){s=e,Date.now()-o>t?i(e):setTimeout(l,r)}};l()})}(()=>{let t=e.map(e=>window[e]).filter(Boolean)[0];if(!t)throw Error(`Window entry "${e.join(",")}" not found.`);return t},t)}function p(e,t){return Object.fromEntries(Object.entries(e).map(([e,r])=>[e,t(r,e)]))}function y(e,t){return t.filter(t=>!e.includes(t))}function g(e){return!!e&&/^\d+\.\d+\.\d+/.test(e)}function b(e){return!!e&&["nightly","alpha","internal","nightly-","staging"].some(t=>e.includes(t))}function w(e){if(!g(e))throw Error(`Invalid semantic version: ${e||"<blank>"}.`);let[t,r,n]=e.split(".");return{major:Number.parseInt(t,10),minor:Number.parseInt(r,10),patch:Number.parseInt(n,10)}}function v(e){if(b(e))return 3;let{major:t}=w(e);switch(!0){case t>=44:return 3;case t>=38:return 2;default:return 1}}function E(){let{CKEDITOR_VERSION:e,CKEDITOR:t}=window;return g(e)||b(e)?{source:t?"cdn":"npm",version:e}:null}function C(e,t){switch(t||=function(){let e=E();return e?v(e.version):null}()||void 0){case 1:case 2:return void 0===e;case 3:return"GPL"===e;default:return!1}}function k(e,t,r){return`https://cdn.ckeditor.com/${e}/${r}/${t}`}async function _(e){let{htmlAttributes:t={},scripts:r=[],stylesheets:n=[],preload:i,beforeInject:o,checkPluginLoaded:a}=R(e);for(let e of(o?.(),i||(i=f([...n.filter(e=>"string"==typeof e),...r.filter(e=>"string"==typeof e)])),i))!function(e,{attributes:t}={}){if(document.head.querySelector(`link[href="${e}"][rel="preload"]`))return;let r=document.createElement("link");for(let[e,n]of Object.entries(t||{}))r.setAttribute(e,n);r.setAttribute("data-injected-by","ckeditor-integration"),r.rel="preload",r.as=function(e){switch(!0){case/\.css$/.test(e):return"style";case/\.js$/.test(e):return"script";default:return"fetch"}}(e),r.href=e,document.head.insertBefore(r,document.head.firstChild)}(e,{attributes:t});for(let e of(await Promise.all(f(n).map(e=>(function({href:e,placementInHead:t="start",attributes:r={}}){if(l.has(e))return l.get(e);let n=document.querySelector(`link[href="${e}"][rel="stylesheet"]`);n&&(console.warn(`Stylesheet with "${e}" href is already present in DOM!`),n.remove());let i=new Promise((n,i)=>{let o=document.createElement("link");for(let[e,t]of Object.entries(r||{}))o.setAttribute(e,t);o.setAttribute("data-injected-by","ckeditor-integration"),o.rel="stylesheet",o.href=e,o.onerror=i,o.onload=()=>{n()};let s=Array.from(document.head.querySelectorAll('link[data-injected-by="ckeditor-integration"]'));switch(t){case"start":s.length?s.slice(-1)[0].after(o):document.head.insertBefore(o,document.head.firstChild);break;case"end":document.head.appendChild(o)}let a=new MutationObserver(t=>{t.flatMap(e=>
1Array.from(e.removedNodes)).includes(o)&&(l.delete(e),a.disconnect())});a.observe(document.head,{childList:!0,subtree:!0})});return l.set(e,i),i})({href:e,attributes:t,placementInHead:"start"}))),f(r))){let r={attributes:t};"string"==typeof e?await s(e,r):await e(r)}return a?.()}function R(e){return Array.isArray(e)?{scripts:e.filter(e=>"function"==typeof e||e.endsWith(".js")),stylesheets:e.filter(e=>e.endsWith(".css"))}:"function"==typeof e?{checkPluginLoaded:e}:e}function j(e){var t;let r=p((t=e=>null!=e,Object.fromEntries(Object.entries(e).filter(([e,r])=>t(r,e)))),R),n=Object.values(r).reduce((e,t)=>(e.scripts.push(...t.scripts??[]),e.stylesheets.push(...t.stylesheets??[]),e.preload.push(...t.preload??[]),e),{preload:[],scripts:[],stylesheets:[]}),i=async()=>{let e=Object.create(null);for(let[t,n]of Object.entries(r))e[t]=await n?.checkPluginLoaded?.();return e};return{...n,beforeInject:()=>{for(let e of Object.values(r))e.beforeInject?.()},checkPluginLoaded:i}}function O(e){let{version:t,translations:r,plugins:n,premium:i,ckbox:o,createCustomCdnUrl:s,injectedHtmlElementsAttributes:l={crossorigin:"anonymous"}}=e;var u=t;if(b(u)&&console.warn("You are using a testing version of CKEditor 5. Please remember that it is not suitable for production environments."),!function(e){if(b(e))return!0;let{major:t}=w(e);return 3===v(e)||43===t}(u))throw Error(`The CKEditor 5 CDN can't be used with the given editor version: ${u}. Please make sure you are using at least the CKEditor 5 version 44.`);let c=j({CKEditor:function({version:e,translations:t,createCustomCdnUrl:r=k}){let n={scripts:[r("ckeditor5","ckeditor5.umd.js",e),...y(["en"],t||[]).map(t=>r("ckeditor5",`translations/${t}.umd.js`,e))],stylesheets:[r("ckeditor5","ckeditor5.css",e)]};return{preload:[...n.stylesheets,...n.scripts],scripts:[async e=>a(n.scripts,e)],stylesheets:n.stylesheets,checkPluginLoaded:async()=>m(["CKEDITOR"]),beforeInject:()=>{let t=E();switch(t?.source){case"npm":throw Error("CKEditor 5 is already loaded from npm. Check the migration guide for more details: "+function(e,t="latest"){return`https://ckeditor.com/docs/ckeditor5/${t}/${e}`}("updating/migration-to-cdn/vanilla-js.html"));case"cdn":if(t.version!==e)throw Error(`CKEditor 5 is already loaded from CDN in version ${t.version}. Remove the old <script> and <link> tags loading CKEditor 5 to allow loading the ${e} version.`)}}}}({version:t,translations:r,createCustomCdnUrl:s}),...i&&{CKEditorPremiumFeatures:function({version:e,translations:t,createCustomCdnUrl:r=k}){let n={scripts:[r("ckeditor5-premium-features","ckeditor5-premium-features.umd.js",e),...y(["en"],t||[]).map(t=>r("ckeditor5-premium-features",`translations/${t}.umd.js`,e))],stylesheets:[r("ckeditor5-premium-features","ckeditor5-premium-features.css",e)]};return{preload:[...n.stylesheets,...n.scripts],scripts:[async e=>a(n.scripts,e)],stylesheets:n.stylesheets,checkPluginLoaded:async()=>m(["CKEDITOR_PREMIUM_FEATURES"])}}({version:t,translations:r,createCustomCdnUrl:s})},...o&&{CKBox:function({version:e,theme:t="lark",translations:r,createCustomCdnUrl:n=function(e,t,r){return`https://cdn.ckbox.io/${e}/${r}/${t}`}}){return{scripts:[n("ckbox","ckbox.js",e),...y(["en"],r||[]).map(t=>n("ckbox",`translations/${t}.js`,e))],...t&&{stylesheets:[n("ckbox",`styles/themes/${t}.css`,e)]},checkPluginLoaded:async()=>m(["CKBox"]),beforeInject:()=>{let t=function(){let e=window.CKBox?.version;return g(e)?{source:"cdn",version:e}:null}();if(t&&t.version!==e)throw Error(`CKBox is already loaded from CDN in version ${t.version}. Remove the old <script> and <link> tags loading CKBox to allow loading the ${e} version.`)}}}(o)},loadedPlugins:j(p(n??{},(e,t)=>{if(e)return{checkPluginLoaded:async()=>m([t]),...R(e)}}))});return _({...c,htmlAttributes:l})}var A=Object.defineProperty,S=(e,t,r)=>((e,t,r)=>t in e?A(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);let M=class e{constructor(e,t){S(this,"_lifecycle"),S(this,"_element"),S(this,"_releaseLock",null),S(this,"_value",null),S(this,"_afterMountCallbacks",[]),S(this,"_state",{destroyedBeforeInitialization:!1,mountingInProgress:null}),S(this,"release",function(e){let t=null;return(...r)=>(t||(t={current:e(...r)}),t.current)}(()=>{let{_releaseLock:e,_state:t,_element:r,_lifecycle:n}=this;t.mountingInProgress?t.mountingInProgress.then(()=>n.unmount({element:r,mountResult:this.value})).catch(e=>{console.error("CKEditor unmounting error:",e)}).then(e.resolve).then(()=>{this._value=null}):(t.destroyedBeforeInitialization=!0,e.resolve())})),this._element=e,this._lifecycle=t,this._lock()}get value(){return this._value}discard(){this._value=null,this._releaseLock=null,this._afterMountCallbacks=[],this._state={destroyedBeforeInitialization:!1,mountingInProgress:null}}unsafeSetValue(e){this._value=e,this._afterMountCallbacks.forEach(t=>{(!this._lifecycle.isValueValid||this._lifecycle.isValueValid(e))&&t(e)}),this._afterMountCallbacks=[]}runAfterMount(e){let{_value:t,_afterMountCallbacks:r}=this;if(t){if(this._lifecycle.isValueValid&&!this._lifecycle.isValueValid(t))return;e(t)}else r.push(e)}_lock(){let{_semaphores:t}=e,{_state:r,_element:n,_lifecycle:i}=this,o=t.get(n)||Promise.resolve(null),s=function(){let e={resolve:null,promise:null};return e.promise=new Promise(t=>{e.resolve=t}),e}();this._releaseLock=s;let a=o.then(()=>r.destroyedBeforeInitialization?Promise.resolve(void 0):(r.mountingInProgress=i.mount().then(e=>(e&&this.unsafeSetValue(e),e)),r.mountingInProgress)).then(async e=>{e&&i.afterMount&&await i.afterMount({element:n,mountResult:e})}).then(()=>s.promise).catch(e=>{console.error("CKEditor mounting error:",e)}).then(()=>{t.get(n)===a&&t.delete(n)});t.set(n,a)}};S(M,"_semaphores",new Map);let x="$__CKEditorReactContextMetadata",D=e=>{let t=(0,i.useRef)();return t.current=e,(0,i.useCallback)((...e)=>t.current(...e),[])},K=i.createContext(null),P=e=>{let{id:t,context:r,watchdogConfig:n,children:o,config:s,onReady:a,contextWatchdog:l,isLayoutReady:u=!0,onChangeInitializedEditors:c,onError:d=(e,t)=>console.error(e,t)}=e,f=(()=>{let e=(0,i.useRef)(!1);return(0,i.useEffect)(()=>(e.current=!0,()=>{e.current=!1}),[]),e})(),m=(0,i.useRef)(null),[p,y]=(0,i.useState)({status:"initializing"});function g(e){return m.current===e&&f.current}return(0,i.useEffect)(()=>{u?function(){let e=(m.current=h(),m.current),t=new l(r,n);t.on("error",(t,r)=>{g(e)&&d(r.error,{phase:"runtime",willContextRestart:r.causesRestart})}),t.on("stateChange",()=>{a&&"ready"===t.state&&g(e)&&a(t.context,t)}),t.create(s).then(()=>{g(e)?y({status:"initialized",watchdog:t}):t.destroy()}).catch(t=>
1{g(e)&&(d(t,{phase:"initialization",willContextRestart:!1}),y({status:"error",error:t}))})}():y({status:"initializing"})},[t,u]),(0,i.useEffect)(()=>()=>{"initialized"===p.status&&p.watchdog.destroy()},[p]),(({currentContextWatchdog:e,onChangeInitializedEditors:t})=>{let r=D(t||(()=>{}));(0,i.useEffect)(()=>{var t;if("initialized"!==e.status)return;let{watchdog:n}=e,i=null==(t=null==n?void 0:n.context)?void 0:t.editors;if(!i)return;let o=()=>{r([...i].reduce((e,t)=>{var r;if("ready"!==t.state)return e;let n=t.config.get(x);return e[null!=(r=null==n?void 0:n.name)?r:t.id]={instance:t,metadata:n},e},Object.create({})),n)},s=e=>{e.once("ready",o,{priority:"lowest"}),e.once("destroy",o,{priority:"lowest"})},a=(e,t)=>{s(t)};return i.forEach(s),i.on("add",a),Array.from(i).some(e=>"ready"===e.state)&&o(),()=>{i.off("add",a)}},[e])})({currentContextWatchdog:p,onChangeInitializedEditors:c}),i.createElement(K.Provider,{value:p},o)},$=e=>t=>(e=>!!e&&"object"==typeof e&&"status"in e&&["initializing","initialized","error"].includes(e.status))(t)&&t.status===e,I=$("initializing"),L=e=>$("initialized")(e)&&"ready"===e.watchdog.state,N=(n={version:"11.0.0",frameworkVersion:i.version},function(e){C(e.config.get("licenseKey"))||e.on("collectUsageData",(e,{setUsageData:t})=>{t("integration.react",n)})});function T(e){if(C(e.licenseKey))return e;let t=e.extraPlugins||[];return{...e,extraPlugins:[...t,...[N].filter(e=>!t.includes(e))]}}let W="Lock from React integration (@ckeditor/ckeditor5-react)";class V extends i.Component{constructor(e){super(e),S(this,"domContainer",i.createRef()),S(this,"editorSemaphore",null),this._checkVersion()}_checkVersion(){let{CKEDITOR_VERSION:e}=window;if(!e)return console.warn('Cannot find the "CKEDITOR_VERSION" in the "window" scope.');let[t]=e.split(".").map(Number);t>=42||e.startsWith("0.0.0")||console.warn("The <CKEditor> component requires using CKEditor 5 in version 42+ or nightly build.")}get _semaphoreValue(){let{editorSemaphore:e}=this;return e?e.value:null}get watchdog(){let{_semaphoreValue:e}=this;return e?e.watchdog:null}get editor(){let{_semaphoreValue:e}=this;return e?e.instance:null}shouldComponentUpdate(e){let{props:t,editorSemaphore:r}=this;return e.id!==t.id||e.disableWatchdog!==t.disableWatchdog||(r&&(r.runAfterMount(({instance:r})=>{this._shouldUpdateEditorData(t,e,r)&&r.data.set(e.data)}),"disabled"in e&&r.runAfterMount(({instance:t})=>{e.disabled?t.enableReadOnlyMode(W):t.disableReadOnlyMode(W)})),!1)}componentDidMount(){I(this.context)||this._initLifeCycleSemaphore()}componentDidUpdate(){I(this.context)||this._initLifeCycleSemaphore()}componentWillUnmount(){this._unlockLifeCycleSemaphore()}_unlockLifeCycleSemaphore(){this.editorSemaphore&&(this.editorSemaphore.release(),this.editorSemaphore=null)}_initLifeCycleSemaphore(){this._unlockLifeCycleSemaphore(),this.editorSemaphore=new M(this.domContainer.current,{isValueValid:e=>e&&!!e.instance,mount:async()=>{var e,t;try{return await this._initializeEditor()}catch(r){throw null==(t=(e=this.props).onError)||t.call(e,r,{phase:"initialization",willEditorRestart:!1}),r}},afterMount:({mountResult:e})=>{let{onReady:t}=this.props;t&&null!==this.domContainer.current&&t(e.instance)},unmount:async({element:e,mountResult:t})=>{let{onAfterDestroy:r}=this.props;try{await this._destroyEditor(t),e.innerHTML=""}finally{r&&r(t.instance)}}})}render(){return i.createElement("div",{ref:this.domContainer})}async _initializeEditor(){if(this.props.disableWatchdog)return{instance:await this._createEditor(this.domContainer.current,this._getConfig()),watchdog:null};let e=L(this.context)?new B(this.context.watchdog):new this.props.editor.EditorWatchdog(this.props.editor,this.props.watchdogConfig),t={current:0};return e.setCreator(async(r,n)=>{var i;let{editorSemaphore:o}=this,{onAfterDestroy:s}=this.props;t.current>0&&s&&(null==(i=null==o?void 0:o.value)?void 0:i.instance)&&s(o.value.instance);let a=await this._createEditor(r,n);return o&&t.current>0&&(o.unsafeSetValue({instance:a,watchdog:e}),setTimeout(()=>{this.props.onReady&&this.props.onReady(e.editor)})),t.current++,a}),e.on("error",(e,{error:t,causesRestart:r})=>{(this.props.onError||console.error)(t,{phase:"runtime",willEditorRestart:r})}),await e.create(this.domContainer.current,this._getConfig()),{watchdog:e,instance:e.editor}}
1_createEditor(e,t){let{contextItemMetadata:r}=this.props;return r&&(t={...t,[x]:r}),this.props.editor.create(e,T(t)).then(e=>{"disabled"in this.props&&this.props.disabled&&e.enableReadOnlyMode(W);let t=e.model.document,r=e.editing.view.document;return t.on("change:data",t=>{this.props.onChange&&this.props.onChange(t,e)}),r.on("focus",t=>{this.props.onFocus&&this.props.onFocus(t,e)}),r.on("blur",t=>{this.props.onBlur&&this.props.onBlur(t,e)}),e})}async _destroyEditor(e){let{watchdog:t,instance:r}=e;return new Promise((e,n)=>{setTimeout(async()=>{try{if(t)return await t.destroy(),e();if(r)return await r.destroy(),e();e()}catch(e){console.error(e),n(e)}})})}_shouldUpdateEditorData(e,t,r){return e.data!==t.data&&r.data.get()!==t.data}_getConfig(){let e=this.props.config||{};return this.props.data&&e.initialData&&console.warn("Editor data should be provided either using `config.initialData` or `content` property. The config value takes precedence over `content` property and will be used when both are specified."),{...e,initialData:e.initialData||this.props.data||""}}}S(V,"contextType",K);class B{constructor(e){S(this,"_contextWatchdog"),S(this,"_id"),S(this,"_creator"),this._contextWatchdog=e,this._id=h()}setCreator(e){this._creator=e}create(e,t){return this._contextWatchdog.add({sourceElementOrData:e,config:t,creator:this._creator,id:this._id,type:"editor"})}on(e,t){this._contextWatchdog.on("itemError",(e,{itemId:r,error:n})=>{r===this._id&&t(null,{error:n,causesRestart:void 0})})}destroy(){return"ready"===this._contextWatchdog.state?this._contextWatchdog.remove(this._id):Promise.resolve()}get editor(){return this._contextWatchdog.getItem(this._id)}}function z(...e){return t=>{e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}}let U=(e,t)=>{let[r,n]=(0,i.useState)(null);!function(e,t){if(e===t)return!0;if(!e||!t)return!1;for(let r=0;r<e.length;++r)if(e[r]!==t[r])return!1;return!0}(r,t)&&(e(),n([...t]))},F=(e,t,r)=>{U(()=>{e&&e.runAfterMount(t)},[e,...r])},q="Lock from React integration (@ckeditor/ckeditor5-react)",J=e=>{let t=(0,i.useRef)(e.semaphoreElement||null),r=(()=>{let e=(0,i.useRef)(null),[t,r]=(0,i.useState)(()=>Date.now()),n=()=>{r(Date.now())},o=(t=!0)=>{e.current&&(e.current.release(),e.current=null),t&&r(Date.now())},s=t=>{e.current&&e.current.runAfterMount(t)};return{get current(){return e.current},revision:t,createAttributeRef:t=>({get current(){if(!e.current||!e.current.value)return null;return e.current.value[t]}}),unsafeSetValue:t=>{var r;null==(r=e.current)||r.unsafeSetValue(t),n()},release:o,replace:t=>{o(!1),e.current=t(),n(),s(n)},runAfterMount:s}})(),n={watchdog:r.createAttributeRef("watchdog"),instance:r.createAttributeRef("instance")},o=(0,i.useContext)(K),[s,a]=(0,i.useState)(()=>Object.keys(e.data)),[l,d]=(0,i.useState)({...e.data}),[h,m]=(0,i.useState)({...e.rootsAttributes}),p=(0,i.useRef)(!0);(0,i.useEffect)(()=>{let i=t.current;if((!o||L(o))&&i&&!1!==e.isLayoutReady)return r.replace(()=>new M(i,{mount:C,afterMount:({mountResult:r})=>{let{onReady:n}=e;n&&null!==t.current&&n(r.instance)},unmount:async({element:t,mountResult:r})=>{let{onAfterDestroy:n}=e;try{await E(r),t.innerHTML=""}finally{n&&n(r.instance)}}})),()=>{(()=>{let e=n.instance.current;e&&Object.values(e.ui.view.editables).forEach(t=>{t.name&&!e.editing.view.getDomRoot(t.name)&&e.editing.view.attachDomRoot(document.createElement("div"),t.name)})})(),r.release(!1)}},[e.id,e.isLayoutReady,null==o?void 0:o.status]);let y=()=>{let t=e.config||{};return e.data&&t.initialData&&console.warn("Editor data should be provided either using `config.initialData` or `data` property. The config value takes precedence over `data` property and will be used when both are specified."),{...t,rootsAttributes:h}},g=D((t,r)=>{let n=t.model.document;if(!e.disableTwoWayDataBinding){let e={},r={};
1n.differ.getChanges().forEach(r=>{let n;if(!(n="insert"==r.type||"remove"==r.type?r.position.root:r.range.root).isAttached())return;let{rootName:i}=n;e[i]=t.getData({rootName:i})}),n.differ.getChangedRoots().forEach(n=>{if(n.state){void 0!==e[n.name]&&delete e[n.name];return}let i=n.name;r[i]=t.getRootAttributes(i)}),Object.keys(e).length&&d(t=>({...t,...e})),Object.keys(r).length&&m(e=>({...e,...r}))}e.onChange&&e.onChange(r,t)}),b=D((t,r,n)=>{let i=n.rootName;e.disableTwoWayDataBinding||(d(e=>({...e,[i]:t.getData({rootName:i})})),m(e=>({...e,[i]:t.getRootAttributes(i)}))),a(e=>f([...e,n.rootName]))}),w=D((t,r,n)=>{let i=n.rootName;e.disableTwoWayDataBinding||(d(e=>{let{[i]:t,...r}=e;return{...r}}),m(e=>{let{[i]:t,...r}=e;return{...r}})),a(e=>e.filter(e=>e!==i))}),v=D((t,r)=>(c({...e.rootsAttributes},h),c({...e.data},l),u(Object.keys(e.data),s),e.editor.create(t,T(r)).then(t=>{let r=t.getFullData();c({...r},l),c({...t.getRootsAttributes()},h),u(Object.keys(r),s),e.disabled&&t.enableReadOnlyMode(q);let n=t.model.document,i=t.editing.view.document;return n.on("change:data",e=>g(t,e)),t.on("addRoot",(e,r)=>b(t,e,r)),t.on("detachRoot",(e,r)=>w(t,e,r)),i.on("focus",r=>{e.onFocus&&e.onFocus(r,t)}),i.on("blur",r=>{e.onBlur&&e.onBlur(r,t)}),t}))),E=e=>{let{watchdog:t,instance:r}=e;return new Promise((e,n)=>{setTimeout(async()=>{try{if(t)return await t.destroy(),e();if(r)return await r.destroy(),e();e()}catch(e){console.error(e),n(e)}})})},C=async()=>{if(e.disableWatchdog)return{instance:await v(e.data,y()),watchdog:null};let t=L(o)?new B(o.watchdog):new e.editor.EditorWatchdog(e.editor,e.watchdogConfig),i={current:0};return t.setCreator(async(o,s)=>{let{onAfterDestroy:a}=e;i.current>0&&a&&n.instance.current&&a(n.instance.current);let u=await v(l,s);return i.current>0&&(r.unsafeSetValue({instance:u,watchdog:t}),setTimeout(()=>{e.onReady&&e.onReady(t.editor)})),i.current++,u}),t.on("error",(t,{error:r,causesRestart:n})=>{(e.onError||console.error)(r,{phase:"runtime",willEditorRestart:n})}),await t.create(l,y()).catch(t=>{throw(e.onError||console.error)(t,{phase:"initialization",willEditorRestart:!1}),t}),{watchdog:t,instance:t.editor}},k=(0,i.useCallback)(e=>{r.runAfterMount(()=>{p.current=!0,d(e)})},[d]),_=(0,i.useCallback)(e=>{r.runAfterMount(()=>{p.current=!0,m(e)})},[m]),R=i.createElement(G,{ref:t,editor:n.instance.current});F(r.current,({instance:t})=>{e.disabled?t.enableReadOnlyMode(q):t.disableReadOnlyMode(q)},[e.disabled]),F(r.current,({instance:e})=>{if(p.current){p.current=!1;let t=Object.keys(l),r=Object.keys(h);if(!t.every(e=>r.includes(e)))throw console.error("`data` and `attributes` objects must have the same keys (roots)."),Error("`data` and `attributes` objects must have the same keys (roots).");let n=e.getFullData(),i=e.getRootsAttributes(),{addedKeys:o,removedKeys:s}=((e,t)=>{let r=Object.keys(e),n=Object.keys(t);return{addedKeys:n.filter(e=>!r.includes(e)),removedKeys:r.filter(e=>!n.includes(e))}})(n,l||{}),a=t.filter(e=>void 0!==n[e]&&JSON.stringify(n[e])!==JSON.stringify(l[e])),u=r.filter(e=>JSON.stringify(i[e])!==JSON.stringify(h[e]));setTimeout(()=>{e.model.change(t=>{o.forEach(t=>{e.addRoot(t,{data:l[t]||"",attributes:(null==h?void 0:h[t])||{},isUndoable:!0})}),s.forEach(t=>{e.detachRoot(t,!0)}),a.length&&(t=>{let r=t.reduce((e,t)=>({...e,[t]:l[t]}),Object.create(null));e.data.set(r,{suppressErrorInCollaboration:!0})})(a),u.length&&((t,r)=>{r.forEach(r=>{Object.keys(h[r]).forEach(t=>{e.registerRootAttribute(t)}),t.clearAttributes(e.model.document.getRoot(r)),t.setAttributes(h[r],e.model.document.getRoot(r))})})(t,u)})})}},[l,h]);let j=s.map(e=>i.createElement(H,{key:e,id:e,rootName:e,semaphore:r}));return{editor:n.instance.current,editableElements:j,toolbarElement:R,data:l,setData:k,attributes:h,setAttributes:_}},H=(0,i.memo)((0,i.forwardRef)(({id:e,semaphore:t,rootName:r},n)=>{let o=(0,i.useRef)(null);return(0,i.useEffect)(()=>{let e,n;return t.runAfterMount(({instance:t})=>{if(!o.current)return;let{ui:i,model:s}=n=t,a=s.document.getRoot(r);a&&n.ui.getEditableElement(r)&&n.detachEditable(a),e=i.view.createEditable(r,o.current),i.addEditable(e),t.editing.view.forceRender()}),()=>{if(n&&"destroyed"!==n.state&&o.current){let e=n.model.document.getRoot(r);e&&n.detachEditable(e)}}},[t.revision]),i.createElement("div",{key:t.revision,id:e,ref:z(n,o)})}));H.displayName="EditorEditable";let G=(0,i.forwardRef)(({editor:e},t)=>{let r=(0,i.useRef)(null);return(0,i.useEffect)(()=>{let t=r.current;if(!e||!t)return;let n=e.ui.view.toolbar.element;return t.appendChild(n),()=>{t.contains(n)&&t.removeChild(n)}},[e&&e.id]),i.createElement("div",{ref:z(r,t)})});function Y(e){let t=((e,t)=>{let[r,n]=(e=>{let[t,r]=(0,i.useState)({status:"idle"}),n=(()=>{let e=(0,i.useRef)(!1);return(0,i.useEffect)(()=>(e.current=!1,()=>{e.current=!0}),[]),e})(),o=(0,i.useRef)(null);return[D(async(...i)=>{if(n.current||"undefined"==typeof window)return null;let s=h();
1o.current=s;try{"loading"!==t.status&&r({status:"loading"});let a=await e(...i);return n.current||o.current!==s||r({status:"success",data:a}),a}catch(e){console.error(e),n.current||o.current!==s||r({status:"error",error:e})}return null}),t]})(e);return(U(r,t),"idle"===n.status)?{status:"loading"}:n})(async()=>O(e),[JSON.stringify(e)]);return"success"===t.status?{...t.data,status:"success"}:t}G.displayName="EditorToolbarWrapper";let Q=e=>t=>{let r=r=>{var n,o;let s=Y(e.cloud);switch(s.status){case"error":if(!e.renderError)return"Unable to load CKEditor Cloud data!";return e.renderError(s.error);case"success":return i.createElement(t,{...r,cloud:s});default:return null!=(o=null==(n=e.renderLoader)?void 0:n.call(e))?o:null}};return r.displayName="ComponentWithCKEditorCloud",r}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.