diff --git a/config/ckeditor-field.php b/config/ckeditor-field.php index 46ac0d4..8a6da6b 100644 --- a/config/ckeditor-field.php +++ b/config/ckeditor-field.php @@ -84,5 +84,5 @@ | CKEditor 4 is only supported. This will not work with CKEditor 5 | */ - 'ckeditor_url' => 'https://cdn.ckeditor.com/4.20.2/full-all/ckeditor.js', + 'ckeditor_url' => 'https://cdn.ckeditor.com/4.21.0/full-all/ckeditor.js', ]; diff --git a/dist/js/field.js b/dist/js/field.js index 3feed83..cf83f6b 100644 --- a/dist/js/field.js +++ b/dist/js/field.js @@ -1,2 +1,2 @@ /*! For license information please see field.js.LICENSE.txt */ -(()=>{var t,e={4303:(t,e,r)=>{"use strict";const n=Vue;var o=["innerHTML"];const i={props:["resourceName","field"]};var a=r(3744);const s=(0,a.Z)(i,[["render",function(t,e,r,i,a,s){return(0,n.openBlock)(),(0,n.createElementBlock)("span",{innerHTML:r.field.value},null,8,o)}]]);const u={props:["index","resource","resourceName","resourceId","field"]},c=(0,a.Z)(u,[["render",function(t,e,r,o,i,a){var s=(0,n.resolveComponent)("Excerpt"),u=(0,n.resolveComponent)("PanelItem");return(0,n.openBlock)(),(0,n.createBlock)(u,{index:r.index,field:r.field},{value:(0,n.withCtx)((function(){return[(0,n.createVNode)(s,{content:r.field.value,"plain-text":!0,"should-show":r.field.shouldShow},null,8,["content","should-show"])]})),_:1},8,["index","field"])}]]);var l=r(3906),f=r.n(l),p={preventInitialLoading:{type:Boolean,default:!1},showHelpText:{type:Boolean,default:!1},shownViaNewRelationModal:{type:Boolean,default:!1},resourceId:{type:[Number,String]},resourceName:{type:String},relatedResourceId:{type:[Number,String]},relatedResourceName:{type:String},field:{type:Object,required:!0},viaResource:{type:String,required:!1},viaResourceId:{type:[String,Number],required:!1},viaRelationship:{type:String,required:!1},relationshipType:{type:String,default:""},shouldOverrideMeta:{type:Boolean,default:!1},disablePagination:{type:Boolean,default:!1},clickAction:{type:String,default:"view",validator:function(t){return["edit","select","ignore","detail"].includes(t)}},mode:{type:String,default:"form",validator:function(t){return["form","modal","action-modal","action-fullscreen"].includes(t)}}};function d(t){return f()(p,t)}function h(){return"undefined"!=typeof navigator&&"undefined"!=typeof window?window:void 0!==r.g?r.g:{}}const y="function"==typeof Proxy,v="devtools-plugin:setup";let m,g;function b(){return void 0!==m||("undefined"!=typeof window&&window.performance?(m=!0,g=window.performance):void 0!==r.g&&(null===(t=r.g.perf_hooks)||void 0===t?void 0:t.performance)?(m=!0,g=r.g.perf_hooks.performance):m=!1),m?g.now():Date.now();var t}class w{constructor(t,e){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=t,this.hook=e;const r={};if(t.settings)for(const e in t.settings){const n=t.settings[e];r[e]=n.defaultValue}const n=`__vue-devtools-plugin-settings__${t.id}`;let o=Object.assign({},r);try{const t=localStorage.getItem(n),e=JSON.parse(t);Object.assign(o,e)}catch(t){}this.fallbacks={getSettings:()=>o,setSettings(t){try{localStorage.setItem(n,JSON.stringify(t))}catch(t){}o=t},now:()=>b()},e&&e.on("plugin:settings:set",((t,e)=>{t===this.plugin.id&&this.fallbacks.setSettings(e)})),this.proxiedOn=new Proxy({},{get:(t,e)=>this.target?this.target.on[e]:(...t)=>{this.onQueue.push({method:e,args:t})}}),this.proxiedTarget=new Proxy({},{get:(t,e)=>this.target?this.target[e]:"on"===e?this.proxiedOn:Object.keys(this.fallbacks).includes(e)?(...t)=>(this.targetQueue.push({method:e,args:t,resolve:()=>{}}),this.fallbacks[e](...t)):(...t)=>new Promise((r=>{this.targetQueue.push({method:e,args:t,resolve:r})}))})}async setRealTarget(t){this.target=t;for(const t of this.onQueue)this.target.on[t.method](...t.args);for(const t of this.targetQueue)t.resolve(await this.target[t.method](...t.args))}}function O(t,e){const r=t,n=h(),o=h().__VUE_DEVTOOLS_GLOBAL_HOOK__,i=y&&r.enableEarlyProxy;if(!o||!n.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__&&i){const t=i?new w(r,o):null;(n.__VUE_DEVTOOLS_PLUGINS__=n.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:r,setupFn:e,proxy:t}),t&&e(t.proxiedTarget)}else o.emit(v,t,e)}var S="store";function j(t,e){Object.keys(t).forEach((function(r){return e(t[r],r)}))}function x(t){return null!==t&&"object"==typeof t}function _(t,e,r){return e.indexOf(t)<0&&(r&&r.prepend?e.unshift(t):e.push(t)),function(){var r=e.indexOf(t);r>-1&&e.splice(r,1)}}function E(t,e){t._actions=Object.create(null),t._mutations=Object.create(null),t._wrappedGetters=Object.create(null),t._modulesNamespaceMap=Object.create(null);var r=t.state;A(t,r,[],t._modules.root,!0),P(t,r,e)}function P(t,e,r){var o=t._state;t.getters={},t._makeLocalGettersCache=Object.create(null);var i=t._wrappedGetters,a={};j(i,(function(e,r){a[r]=function(t,e){return function(){return t(e)}}(e,t),Object.defineProperty(t.getters,r,{get:function(){return a[r]()},enumerable:!0})})),t._state=(0,n.reactive)({data:e}),t.strict&&function(t){(0,n.watch)((function(){return t._state.data}),(function(){0}),{deep:!0,flush:"sync"})}(t),o&&r&&t._withCommit((function(){o.data=null}))}function A(t,e,r,n,o){var i=!r.length,a=t._modules.getNamespace(r);if(n.namespaced&&(t._modulesNamespaceMap[a],t._modulesNamespaceMap[a]=n),!i&&!o){var s=T(e,r.slice(0,-1)),u=r[r.length-1];t._withCommit((function(){s[u]=n.state}))}var c=n.context=function(t,e,r){var n=""===e,o={dispatch:n?t.dispatch:function(r,n,o){var i=I(r,n,o),a=i.payload,s=i.options,u=i.type;return s&&s.root||(u=e+u),t.dispatch(u,a)},commit:n?t.commit:function(r,n,o){var i=I(r,n,o),a=i.payload,s=i.options,u=i.type;s&&s.root||(u=e+u),t.commit(u,a,s)}};return Object.defineProperties(o,{getters:{get:n?function(){return t.getters}:function(){return k(t,e)}},state:{get:function(){return T(t.state,r)}}}),o}(t,a,r);n.forEachMutation((function(e,r){!function(t,e,r,n){var o=t._mutations[e]||(t._mutations[e]=[]);o.push((function(e){r.call(t,n.state,e)}))}(t,a+r,e,c)})),n.forEachAction((function(e,r){var n=e.root?r:a+r,o=e.handler||e;!function(t,e,r,n){var o=t._actions[e]||(t._actions[e]=[]);o.push((function(e){var o,i=r.call(t,{dispatch:n.dispatch,commit:n.commit,getters:n.getters,state:n.state,rootGetters:t.getters,rootState:t.state},e);return(o=i)&&"function"==typeof o.then||(i=Promise.resolve(i)),t._devtoolHook?i.catch((function(e){throw t._devtoolHook.emit("vuex:error",e),e})):i}))}(t,n,o,c)})),n.forEachGetter((function(e,r){!function(t,e,r,n){if(t._wrappedGetters[e])return void 0;t._wrappedGetters[e]=function(t){return r(n.state,n.getters,t.state,t.getters)}}(t,a+r,e,c)})),n.forEachChild((function(n,i){A(t,e,r.concat(i),n,o)}))}function k(t,e){if(!t._makeLocalGettersCache[e]){var r={},n=e.length;Object.keys(t.getters).forEach((function(o){if(o.slice(0,n)===e){var i=o.slice(n);Object.defineProperty(r,i,{get:function(){return t.getters[o]},enumerable:!0})}})),t._makeLocalGettersCache[e]=r}return t._makeLocalGettersCache[e]}function T(t,e){return e.reduce((function(t,e){return t[e]}),t)}function I(t,e,r){return x(t)&&t.type&&(r=e,e=t,t=t.type),{type:t,payload:e,options:r}}var N="vuex bindings",C="vuex:mutations",F="vuex:actions",R="vuex",D=0;function M(t,e){O({id:"org.vuejs.vuex",app:t,label:"Vuex",homepage:"https://next.vuex.vuejs.org/",logo:"https://vuejs.org/images/icons/favicon-96x96.png",packageName:"vuex",componentStateTypes:[N]},(function(r){r.addTimelineLayer({id:C,label:"Vuex Mutations",color:L}),r.addTimelineLayer({id:F,label:"Vuex Actions",color:L}),r.addInspector({id:R,label:"Vuex",icon:"storage",treeFilterPlaceholder:"Filter stores..."}),r.on.getInspectorTree((function(r){if(r.app===t&&r.inspectorId===R)if(r.filter){var n=[];$(n,e._modules.root,r.filter,""),r.rootNodes=n}else r.rootNodes=[B(e._modules.root,"")]})),r.on.getInspectorState((function(r){if(r.app===t&&r.inspectorId===R){var n=r.nodeId;k(e,n),r.state=function(t,e,r){e="root"===r?e:e[r];var n=Object.keys(e),o={state:Object.keys(t.state).map((function(e){return{key:e,editable:!0,value:t.state[e]}}))};if(n.length){var i=function(t){var e={};return Object.keys(t).forEach((function(r){var n=r.split("/");if(n.length>1){var o=e,i=n.pop();n.forEach((function(t){o[t]||(o[t]={_custom:{value:{},display:t,tooltip:"Module",abstract:!0}}),o=o[t]._custom.value})),o[i]=q((function(){return t[r]}))}else e[r]=q((function(){return t[r]}))})),e}(e);o.getters=Object.keys(i).map((function(t){return{key:t.endsWith("/")?V(t):t,editable:!1,value:q((function(){return i[t]}))}}))}return o}((o=e._modules,(a=(i=n).split("/").filter((function(t){return t}))).reduce((function(t,e,r){var n=t[e];if(!n)throw new Error('Missing module "'+e+'" for path "'+i+'".');return r===a.length-1?n:n._children}),"root"===i?o:o.root._children)),"root"===n?e.getters:e._makeLocalGettersCache,n)}var o,i,a})),r.on.editInspectorState((function(r){if(r.app===t&&r.inspectorId===R){var n=r.nodeId,o=r.path;"root"!==n&&(o=n.split("/").filter(Boolean).concat(o)),e._withCommit((function(){r.set(e._state.data,o,r.state.value)}))}})),e.subscribe((function(t,e){var n={};t.payload&&(n.payload=t.payload),n.state=e,r.notifyComponentUpdate(),r.sendInspectorTree(R),r.sendInspectorState(R),r.addTimelineEvent({layerId:C,event:{time:Date.now(),title:t.type,data:n}})})),e.subscribeAction({before:function(t,e){var n={};t.payload&&(n.payload=t.payload),t._id=D++,t._time=Date.now(),n.state=e,r.addTimelineEvent({layerId:F,event:{time:t._time,title:t.type,groupId:t._id,subtitle:"start",data:n}})},after:function(t,e){var n={},o=Date.now()-t._time;n.duration={_custom:{type:"duration",display:o+"ms",tooltip:"Action duration",value:o}},t.payload&&(n.payload=t.payload),n.state=e,r.addTimelineEvent({layerId:F,event:{time:Date.now(),title:t.type,groupId:t._id,subtitle:"end",data:n}})}})}))}var L=8702998,U={label:"namespaced",textColor:16777215,backgroundColor:6710886};function V(t){return t&&"root"!==t?t.split("/").slice(-2,-1)[0]:"Root"}function B(t,e){return{id:e||"root",label:V(e),tags:t.namespaced?[U]:[],children:Object.keys(t._children).map((function(r){return B(t._children[r],e+r+"/")}))}}function $(t,e,r,n){n.includes(r)&&t.push({id:n||"root",label:n.endsWith("/")?n.slice(0,n.length-1):n||"Root",tags:e.namespaced?[U]:[]}),Object.keys(e._children).forEach((function(o){$(t,e._children[o],r,n+o+"/")}))}function q(t){try{return t()}catch(t){return t}}var W=function(t,e){this.runtime=e,this._children=Object.create(null),this._rawModule=t;var r=t.state;this.state=("function"==typeof r?r():r)||{}},z={namespaced:{configurable:!0}};z.namespaced.get=function(){return!!this._rawModule.namespaced},W.prototype.addChild=function(t,e){this._children[t]=e},W.prototype.removeChild=function(t){delete this._children[t]},W.prototype.getChild=function(t){return this._children[t]},W.prototype.hasChild=function(t){return t in this._children},W.prototype.update=function(t){this._rawModule.namespaced=t.namespaced,t.actions&&(this._rawModule.actions=t.actions),t.mutations&&(this._rawModule.mutations=t.mutations),t.getters&&(this._rawModule.getters=t.getters)},W.prototype.forEachChild=function(t){j(this._children,t)},W.prototype.forEachGetter=function(t){this._rawModule.getters&&j(this._rawModule.getters,t)},W.prototype.forEachAction=function(t){this._rawModule.actions&&j(this._rawModule.actions,t)},W.prototype.forEachMutation=function(t){this._rawModule.mutations&&j(this._rawModule.mutations,t)},Object.defineProperties(W.prototype,z);var G=function(t){this.register([],t,!1)};function H(t,e,r){if(e.update(r),r.modules)for(var n in r.modules){if(!e.getChild(n))return void 0;H(t.concat(n),e.getChild(n),r.modules[n])}}G.prototype.get=function(t){return t.reduce((function(t,e){return t.getChild(e)}),this.root)},G.prototype.getNamespace=function(t){var e=this.root;return t.reduce((function(t,r){return t+((e=e.getChild(r)).namespaced?r+"/":"")}),"")},G.prototype.update=function(t){H([],this.root,t)},G.prototype.register=function(t,e,r){var n=this;void 0===r&&(r=!0);var o=new W(e,r);0===t.length?this.root=o:this.get(t.slice(0,-1)).addChild(t[t.length-1],o);e.modules&&j(e.modules,(function(e,o){n.register(t.concat(o),e,r)}))},G.prototype.unregister=function(t){var e=this.get(t.slice(0,-1)),r=t[t.length-1],n=e.getChild(r);n&&n.runtime&&e.removeChild(r)},G.prototype.isRegistered=function(t){var e=this.get(t.slice(0,-1)),r=t[t.length-1];return!!e&&e.hasChild(r)};var J=function(t){var e=this;void 0===t&&(t={});var r=t.plugins;void 0===r&&(r=[]);var n=t.strict;void 0===n&&(n=!1);var o=t.devtools;this._committing=!1,this._actions=Object.create(null),this._actionSubscribers=[],this._mutations=Object.create(null),this._wrappedGetters=Object.create(null),this._modules=new G(t),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._makeLocalGettersCache=Object.create(null),this._devtools=o;var i=this,a=this.dispatch,s=this.commit;this.dispatch=function(t,e){return a.call(i,t,e)},this.commit=function(t,e,r){return s.call(i,t,e,r)},this.strict=n;var u=this._modules.root.state;A(this,u,[],this._modules.root),P(this,u),r.forEach((function(t){return t(e)}))},Q={state:{configurable:!0}};J.prototype.install=function(t,e){t.provide(e||S,this),t.config.globalProperties.$store=this,void 0!==this._devtools&&this._devtools&&M(t,this)},Q.state.get=function(){return this._state.data},Q.state.set=function(t){0},J.prototype.commit=function(t,e,r){var n=this,o=I(t,e,r),i=o.type,a=o.payload,s=(o.options,{type:i,payload:a}),u=this._mutations[i];u&&(this._withCommit((function(){u.forEach((function(t){t(a)}))})),this._subscribers.slice().forEach((function(t){return t(s,n.state)})))},J.prototype.dispatch=function(t,e){var r=this,n=I(t,e),o=n.type,i=n.payload,a={type:o,payload:i},s=this._actions[o];if(s){try{this._actionSubscribers.slice().filter((function(t){return t.before})).forEach((function(t){return t.before(a,r.state)}))}catch(t){0}var u=s.length>1?Promise.all(s.map((function(t){return t(i)}))):s[0](i);return new Promise((function(t,e){u.then((function(e){try{r._actionSubscribers.filter((function(t){return t.after})).forEach((function(t){return t.after(a,r.state)}))}catch(t){0}t(e)}),(function(t){try{r._actionSubscribers.filter((function(t){return t.error})).forEach((function(e){return e.error(a,r.state,t)}))}catch(t){0}e(t)}))}))}},J.prototype.subscribe=function(t,e){return _(t,this._subscribers,e)},J.prototype.subscribeAction=function(t,e){return _("function"==typeof t?{before:t}:t,this._actionSubscribers,e)},J.prototype.watch=function(t,e,r){var o=this;return(0,n.watch)((function(){return t(o.state,o.getters)}),e,Object.assign({},r))},J.prototype.replaceState=function(t){var e=this;this._withCommit((function(){e._state.data=t}))},J.prototype.registerModule=function(t,e,r){void 0===r&&(r={}),"string"==typeof t&&(t=[t]),this._modules.register(t,e),A(this,this.state,t,this._modules.get(t),r.preserveState),P(this,this.state)},J.prototype.unregisterModule=function(t){var e=this;"string"==typeof t&&(t=[t]),this._modules.unregister(t),this._withCommit((function(){delete T(e.state,t.slice(0,-1))[t[t.length-1]]})),E(this)},J.prototype.hasModule=function(t){return"string"==typeof t&&(t=[t]),this._modules.isRegistered(t)},J.prototype.hotUpdate=function(t){this._modules.update(t),E(this,!0)},J.prototype._withCommit=function(t){var e=this._committing;this._committing=!0,t(),this._committing=e},Object.defineProperties(J.prototype,Q);Y((function(t,e){var r={};return Z(e).forEach((function(e){var n=e.key,o=e.val;r[n]=function(){var e=this.$store.state,r=this.$store.getters;if(t){var n=tt(this.$store,"mapState",t);if(!n)return;e=n.context.state,r=n.context.getters}return"function"==typeof o?o.call(this,e,r):e[o]},r[n].vuex=!0})),r}));var K=Y((function(t,e){var r={};return Z(e).forEach((function(e){var n=e.key,o=e.val;r[n]=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];var n=this.$store.commit;if(t){var i=tt(this.$store,"mapMutations",t);if(!i)return;n=i.context.commit}return"function"==typeof o?o.apply(this,[n].concat(e)):n.apply(this.$store,[o].concat(e))}})),r})),X=Y((function(t,e){var r={};return Z(e).forEach((function(e){var n=e.key,o=e.val;o=t+o,r[n]=function(){if(!t||tt(this.$store,"mapGetters",t))return this.$store.getters[o]},r[n].vuex=!0})),r}));Y((function(t,e){var r={};return Z(e).forEach((function(e){var n=e.key,o=e.val;r[n]=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];var n=this.$store.dispatch;if(t){var i=tt(this.$store,"mapActions",t);if(!i)return;n=i.context.dispatch}return"function"==typeof o?o.apply(this,[n].concat(e)):n.apply(this.$store,[o].concat(e))}})),r}));function Z(t){return function(t){return Array.isArray(t)||x(t)}(t)?Array.isArray(t)?t.map((function(t){return{key:t,val:t}})):Object.keys(t).map((function(e){return{key:e,val:t[e]}})):[]}function Y(t){return function(e,r){return"string"!=typeof e?(r=e,e=""):"/"!==e.charAt(e.length-1)&&(e+="/"),t(e,r)}}function tt(t,e,r){return t._modulesNamespaceMap[r]}var et=r(6649);function rt(t){return rt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rt(t)}function nt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ot(t){for(var e=1;e>t/4).toString(16)}));if(this.field.withFiles){var e=document.head.querySelector('meta[name="csrf-token"]').content;this.field.options.uploadUrl="/nova-vendor/nova-ckeditor4/".concat(this.resourceName,"/upload/").concat(this.field.attribute,"?_token=").concat(e,"&draftId=").concat(t),this.field.options.filebrowserUploadUrl="/nova-vendor/nova-ckeditor4/".concat(this.resourceName,"/upload/").concat(this.field.attribute,"?_token=").concat(e,"&draftId=").concat(t)}return{config:this.field.options,draftId:t}},methods:{setInitialValue:function(){this.value=this.field.value||""},fill:function(t){this.fillIfVisible(t,this.field.attribute,this.value||""),this.fillIfVisible(t,"".concat(this.field.attribute,"DraftId"),this.draftId)},handleChange:function(t){this.value=t},cleanUp:function(){this.field.withFiles&&Nova.request().delete("/nova-vendor/nova-ckeditor/".concat(this.resourceName,"/attachments/").concat(this.field.attribute,"/").concat(this.draftId)).then((function(t){})).catch((function(t){}))}}};const Et=(0,a.Z)(_t,[["render",function(t,e,r,o,i,a){var s=(0,n.resolveComponent)("ckeditor"),u=(0,n.resolveComponent)("DefaultField");return(0,n.openBlock)(),(0,n.createBlock)(u,{field:r.field,errors:t.errors,"show-help-text":t.showHelpText},{field:(0,n.withCtx)((function(){return[(0,n.createVNode)(s,{id:r.field.attribute,modelValue:t.value,"onUpdate:modelValue":e[0]||(e[0]=function(e){return t.value=e}),config:i.config},null,8,["id","modelValue","config"])]})),_:1},8,["field","errors","show-help-text"])}]]);function Pt(t,e){t.onload=function(){this.onerror=this.onload=null,e(null,t)},t.onerror=function(){this.onerror=this.onload=null,e(new Error("Failed to load "+this.src),t)}}function At(t,e){t.onreadystatechange=function(){"complete"!=this.readyState&&"loaded"!=this.readyState||(this.onreadystatechange=null,e(null,t))}}var kt;function Tt(t,e){return"CKEDITOR"in window?Promise.resolve(CKEDITOR):"string"!=typeof t||t.length<1?Promise.reject(new TypeError("CKEditor URL must be a non-empty string.")):(kt||(kt=Tt.scriptLoader(t).then((function(t){return e&&e(t),t}))),kt)}Tt.scriptLoader=function(t){return new Promise((function(e,r){var n,o,i,a,s;n=t,o=function(t){return kt=void 0,t?r(t):window.CKEDITOR?void e(CKEDITOR):r(new Error("Script loaded from editorUrl doesn't provide CKEDITOR namespace."))},a=document.head||document.getElementsByTagName("head")[0],s=document.createElement("script"),"function"==typeof o&&(i=o,o={}),o=o||{},i=i||function(){},s.type=o.type||"text/javascript",s.charset=o.charset||"utf8",s.async=!("async"in o)||!!o.async,s.src=n,o.attrs&&function(t,e){for(var r in e)t.setAttribute(r,e[r])}(s,o.attrs),o.text&&(s.text=String(o.text)),("onload"in s?Pt:At)(s,i),s.onload||Pt(s,i),a.appendChild(s)}))};const It={name:"ckeditor",render:function(){return(0,n.h)("div",{},[(0,n.h)(this.tagName)])},props:{modelValue:{type:String,default:""},type:{type:String,default:"classic",validator:function(t){return["classic","inline"].includes(t)}},editorUrl:{type:String,default:"https://cdn.ckeditor.com/4.20.2/full-all/ckeditor.js"},config:{type:Object,default:function(){}},tagName:{type:String,default:"textarea"},readOnly:{type:Boolean,default:null},throttle:{type:Number,default:80}},mounted:function(){var t=this;Tt(this.editorUrl,(function(e){t.$emit("namespaceloaded",e)})).then((function(){if(!t.$_destroyed){var e=t.prepareConfig(),r="inline"===t.type?"inline":"replace",n=t.$el.firstElementChild;CKEDITOR[r](n,e)}}))},beforeDestroy:function(){this.instance&&this.instance.destroy(),this.$_destroyed=!0},watch:{modelValue:function(t){this.instance&&this.instance.getData()!==t&&this.instance.setData(t)},readOnly:function(t){this.instance&&this.instance.setReadOnly(t)}},methods:{prepareConfig:function(){var t=this,e=this.config||{};e.on=e.on||{},void 0===e.delayIfDetached&&(e.delayIfDetached=!0),null!==this.readOnly&&(e.readOnly=this.readOnly);var r=e.on.instanceReady;return e.on.instanceReady=function(e){t.instance=e.editor,t.$nextTick().then((function(){t.prepareComponentData(),r&&r(e)}))},e},prepareComponentData:function(){var t=this,e=this.modelValue;this.instance.fire("lockSnapshot"),this.instance.setData(e,{callback:function(){t.$_setUpEditorEvents();var r=t.instance.getData();e!==r?t.$emit("update:modelValue",r):t.$emit("ready",t.instance),t.instance.fire("unlockSnapshot")}})},$_setUpEditorEvents:function(){var t=this,e=this.instance,r=function(t,e){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(){clearTimeout(r);for(var o=arguments.length,i=new Array(o),a=0;a{},3744:(t,e)=>{"use strict";e.Z=(t,e)=>{const r=t.__vccOpts||t;for(const[t,n]of e)r[t]=n;return r}},6649:(t,e,r)=>{function n(t){return t&&"object"==typeof t&&"default"in t?t.default:t}var o=n(r(3950)),i=r(8009),a=n(r(6533));function s(){return(s=Object.assign||function(t){for(var e=1;e0&&"back_forward"===window.performance.getEntriesByType("navigation")[0].type},r.handleBackForwardVisit=function(t){var e=this;window.history.state.version=t.version,this.setPage(window.history.state,{preserveScroll:!0,preserveState:!0}).then((function(){e.restoreScrollPositions(),b(t)}))},r.locationVisit=function(t,e){try{window.sessionStorage.setItem("inertiaLocationVisit",JSON.stringify({preserveScroll:e})),window.location.href=t.href,v(window.location).href===v(t).href&&window.location.reload()}catch(t){return!1}},r.isLocationVisit=function(){try{return null!==window.sessionStorage.getItem("inertiaLocationVisit")}catch(t){return!1}},r.handleLocationVisit=function(t){var e,r,n,o,i=this,a=JSON.parse(window.sessionStorage.getItem("inertiaLocationVisit")||"");window.sessionStorage.removeItem("inertiaLocationVisit"),t.url+=window.location.hash,t.rememberedState=null!=(e=null==(r=window.history.state)?void 0:r.rememberedState)?e:{},t.scrollRegions=null!=(n=null==(o=window.history.state)?void 0:o.scrollRegions)?n:[],this.setPage(t,{preserveScroll:a.preserveScroll,preserveState:!0}).then((function(){a.preserveScroll&&i.restoreScrollPositions(),b(t)}))},r.isLocationVisitResponse=function(t){return t&&409===t.status&&t.headers["x-inertia-location"]},r.isInertiaResponse=function(t){return null==t?void 0:t.headers["x-inertia"]},r.createVisitId=function(){return this.visitId={},this.visitId},r.cancelVisit=function(t,e){var r=e.cancelled,n=void 0!==r&&r,o=e.interrupted,i=void 0!==o&&o;!t||t.completed||t.cancelled||t.interrupted||(t.cancelToken.cancel(),t.onCancel(),t.completed=!1,t.cancelled=n,t.interrupted=i,g(t),t.onFinish(t))},r.finishVisit=function(t){t.cancelled||t.interrupted||(t.completed=!0,t.cancelled=!1,t.interrupted=!1,g(t),t.onFinish(t))},r.resolvePreserveOption=function(t,e){return"function"==typeof t?t(e):"errors"===t?Object.keys(e.props.errors||{}).length>0:t},r.visit=function(t,r){var n=this,i=void 0===r?{}:r,a=i.method,u=void 0===a?e.n$.GET:a,l=i.data,p=void 0===l?{}:l,d=i.replace,g=void 0!==d&&d,b=i.preserveScroll,w=void 0!==b&&b,O=i.preserveState,S=void 0!==O&&O,j=i.only,x=void 0===j?[]:j,_=i.headers,E=void 0===_?{}:_,P=i.errorBag,A=void 0===P?"":P,k=i.forceFormData,T=void 0!==k&&k,I=i.onCancelToken,N=void 0===I?function(){}:I,C=i.onBefore,F=void 0===C?function(){}:C,R=i.onStart,D=void 0===R?function(){}:R,M=i.onProgress,L=void 0===M?function(){}:M,U=i.onFinish,V=void 0===U?function(){}:U,B=i.onCancel,$=void 0===B?function(){}:B,q=i.onSuccess,W=void 0===q?function(){}:q,z=i.onError,G=void 0===z?function(){}:z,H=i.queryStringArrayFormat,J=void 0===H?"brackets":H,Q="string"==typeof t?h(t):t;if(!function t(e){return e instanceof File||e instanceof Blob||e instanceof FileList&&e.length>0||e instanceof FormData&&Array.from(e.values()).some((function(e){return t(e)}))||"object"==typeof e&&null!==e&&Object.values(e).some((function(e){return t(e)}))}(p)&&!T||p instanceof FormData||(p=f(p)),!(p instanceof FormData)){var K=y(u,Q,p,J),X=K[1];Q=h(K[0]),p=X}var Z={url:Q,method:u,data:p,replace:g,preserveScroll:w,preserveState:S,only:x,headers:E,errorBag:A,forceFormData:T,queryStringArrayFormat:J,cancelled:!1,completed:!1,interrupted:!1};if(!1!==F(Z)&&function(t){return m("before",{cancelable:!0,detail:{visit:t}})}(Z)){this.activeVisit&&this.cancelVisit(this.activeVisit,{interrupted:!0}),this.saveScrollPositions();var Y=this.createVisitId();this.activeVisit=s({},Z,{onCancelToken:N,onBefore:F,onStart:D,onProgress:L,onFinish:V,onCancel:$,onSuccess:W,onError:G,queryStringArrayFormat:J,cancelToken:o.CancelToken.source()}),N({cancel:function(){n.activeVisit&&n.cancelVisit(n.activeVisit,{cancelled:!0})}}),function(t){m("start",{detail:{visit:t}})}(Z),D(Z),o({method:u,url:v(Q).href,data:u===e.n$.GET?{}:p,params:u===e.n$.GET?p:{},cancelToken:this.activeVisit.cancelToken.token,headers:s({},E,{Accept:"text/html, application/xhtml+xml","X-Requested-With":"XMLHttpRequest","X-Inertia":!0},x.length?{"X-Inertia-Partial-Component":this.page.component,"X-Inertia-Partial-Data":x.join(",")}:{},A&&A.length?{"X-Inertia-Error-Bag":A}:{},this.page.version?{"X-Inertia-Version":this.page.version}:{}),onUploadProgress:function(t){p instanceof FormData&&(t.percentage=Math.round(t.loaded/t.total*100),function(t){m("progress",{detail:{progress:t}})}(t),L(t))}}).then((function(t){var e;if(!n.isInertiaResponse(t))return Promise.reject({response:t});var r=t.data;x.length&&r.component===n.page.component&&(r.props=s({},n.page.props,r.props)),w=n.resolvePreserveOption(w,r),(S=n.resolvePreserveOption(S,r))&&null!=(e=window.history.state)&&e.rememberedState&&r.component===n.page.component&&(r.rememberedState=window.history.state.rememberedState);var o=Q,i=h(r.url);return o.hash&&!i.hash&&v(o).href===i.href&&(i.hash=o.hash,r.url=i.href),n.setPage(r,{visitId:Y,replace:g,preserveScroll:w,preserveState:S})})).then((function(){var t=n.page.props.errors||{};if(Object.keys(t).length>0){var e=A?t[A]?t[A]:{}:t;return function(t){m("error",{detail:{errors:t}})}(e),G(e)}return m("success",{detail:{page:n.page}}),W(n.page)})).catch((function(t){if(n.isInertiaResponse(t.response))return n.setPage(t.response.data,{visitId:Y});if(n.isLocationVisitResponse(t.response)){var e=h(t.response.headers["x-inertia-location"]),r=Q;r.hash&&!e.hash&&v(r).href===e.href&&(e.hash=r.hash),n.locationVisit(e,!0===w)}else{if(!t.response)return Promise.reject(t);m("invalid",{cancelable:!0,detail:{response:t.response}})&&c.show(t.response.data)}})).then((function(){n.activeVisit&&n.finishVisit(n.activeVisit)})).catch((function(t){if(!o.isCancel(t)){var e=m("exception",{cancelable:!0,detail:{exception:t}});if(n.activeVisit&&n.finishVisit(n.activeVisit),e)return Promise.reject(t)}}))}},r.setPage=function(t,e){var r=this,n=void 0===e?{}:e,o=n.visitId,i=void 0===o?this.createVisitId():o,a=n.replace,s=void 0!==a&&a,u=n.preserveScroll,c=void 0!==u&&u,l=n.preserveState,f=void 0!==l&&l;return Promise.resolve(this.resolveComponent(t.component)).then((function(e){i===r.visitId&&(t.scrollRegions=t.scrollRegions||[],t.rememberedState=t.rememberedState||{},(s=s||h(t.url).href===window.location.href)?r.replaceState(t):r.pushState(t),r.swapComponent({component:e,page:t,preserveState:f}).then((function(){c||r.resetScrollPositions(),s||b(t)})))}))},r.pushState=function(t){this.page=t,window.history.pushState(t,"",t.url)},r.replaceState=function(t){this.page=t,window.history.replaceState(t,"",t.url)},r.handlePopstateEvent=function(t){var e=this;if(null!==t.state){var r=t.state,n=this.createVisitId();Promise.resolve(this.resolveComponent(r.component)).then((function(t){n===e.visitId&&(e.page=r,e.swapComponent({component:t,page:r,preserveState:!1}).then((function(){e.restoreScrollPositions(),b(r)})))}))}else{var o=h(this.page.url);o.hash=window.location.hash,this.replaceState(s({},this.page,{url:o.href})),this.resetScrollPositions()}},r.get=function(t,r,n){return void 0===r&&(r={}),void 0===n&&(n={}),this.visit(t,s({},n,{method:e.n$.GET,data:r}))},r.reload=function(t){return void 0===t&&(t={}),this.visit(window.location.href,s({},t,{preserveScroll:!0,preserveState:!0}))},r.replace=function(t,e){var r;return void 0===e&&(e={}),console.warn("Inertia.replace() has been deprecated and will be removed in a future release. Please use Inertia."+(null!=(r=e.method)?r:"get")+"() instead."),this.visit(t,s({preserveState:!0},e,{replace:!0}))},r.post=function(t,r,n){return void 0===r&&(r={}),void 0===n&&(n={}),this.visit(t,s({preserveState:!0},n,{method:e.n$.POST,data:r}))},r.put=function(t,r,n){return void 0===r&&(r={}),void 0===n&&(n={}),this.visit(t,s({preserveState:!0},n,{method:e.n$.PUT,data:r}))},r.patch=function(t,r,n){return void 0===r&&(r={}),void 0===n&&(n={}),this.visit(t,s({preserveState:!0},n,{method:e.n$.PATCH,data:r}))},r.delete=function(t,r){return void 0===r&&(r={}),this.visit(t,s({preserveState:!0},r,{method:e.n$.DELETE}))},r.remember=function(t,e){var r,n;void 0===e&&(e="default"),w||this.replaceState(s({},this.page,{rememberedState:s({},null==(r=this.page)?void 0:r.rememberedState,(n={},n[e]=t,n))}))},r.restore=function(t){var e,r;if(void 0===t&&(t="default"),!w)return null==(e=window.history.state)||null==(r=e.rememberedState)?void 0:r[t]},r.on=function(t,e){var r=function(t){var r=e(t);t.cancelable&&!t.defaultPrevented&&!1===r&&t.preventDefault()};return document.addEventListener("inertia:"+t,r),function(){return document.removeEventListener("inertia:"+t,r)}},t}(),S={buildDOMElement:function(t){var e=document.createElement("template");e.innerHTML=t;var r=e.content.firstChild;if(!t.startsWith("