@wangeditor-next/core 1.7.32 → 1.7.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/src/upload/interface.d.ts +2 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
6
6
|
* Released under the MIT License.
|
|
7
7
|
*/
|
|
8
|
-
function t(t){return"[object Object]"===Object.prototype.toString.call(t)}return eo=1,Object.defineProperty(oo,"__esModule",{value:!0}),oo.isPlainObject=function(e){var n,r;return!1!==t(e)&&(void 0===(n=e.constructor)||!1!==t(r=n.prototype)&&!1!==r.hasOwnProperty("isPrototypeOf"))},oo}function ao(){if(no)return ro;no=1;var t=io(),n=e,r={isHistory:function(e){return t.isPlainObject(e)&&Array.isArray(e.redos)&&Array.isArray(e.undos)&&(0===e.redos.length||n.Operation.isOperationList(e.redos[0].operations))&&(0===e.undos.length||n.Operation.isOperationList(e.undos[0].operations))}},o=new WeakMap,i=new WeakMap,a=new WeakMap,s={isHistoryEditor:function(t){return r.isHistory(t.history)&&n.Editor.isEditor(t)},isMerging:function(t){return a.get(t)},isSaving:function(t){return i.get(t)},redo:function(t){t.redo()},undo:function(t){t.undo()},withMerging:function(t,e){var n=s.isMerging(t);a.set(t,!0),e(),a.set(t,n)},withoutMerging:function(t,e){var n=s.isMerging(t);a.set(t,!1),e(),a.set(t,n)},withoutSaving:function(t,e){var n=s.isSaving(t);i.set(t,!1),e(),i.set(t,n)}};function u(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return l(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(t,e)}(t))||e){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var c=function(t,e){return!(!e||"insert_text"!==t.type||"insert_text"!==e.type||t.offset!==e.offset+e.text.length||!n.Path.equals(t.path,e.path))||!(!e||"remove_text"!==t.type||"remove_text"!==e.type||t.offset+t.text.length!==e.offset||!n.Path.equals(t.path,e.path))},f=function(t,e){return"set_selection"!==t.type};return ro.HISTORY=o,ro.History=r,ro.HistoryEditor=s,ro.MERGING=a,ro.SAVING=i,ro.withHistory=function(t){var e=t,r=e.apply;return e.history={undos:[],redos:[]},e.redo=function(){var t=e.history,r=t.redos;if(r.length>0){var o=r[r.length-1];o.selectionBefore&&n.Transforms.setSelection(e,o.selectionBefore),s.withoutSaving(e,(function(){n.Editor.withoutNormalizing(e,(function(){var t,n=u(o.operations);try{for(n.s();!(t=n.n()).done;){var r=t.value;e.apply(r)}}catch(t){n.e(t)}finally{n.f()}}))})),t.redos.pop(),e.writeHistory("undos",o)}},e.undo=function(){var t=e.history,r=t.undos;if(r.length>0){var o=r[r.length-1];s.withoutSaving(e,(function(){n.Editor.withoutNormalizing(e,(function(){var t,r=u(o.operations.map(n.Operation.inverse).reverse());try{for(r.s();!(t=r.n()).done;){var i=t.value;e.apply(i)}}catch(t){r.e(t)}finally{r.f()}o.selectionBefore&&n.Transforms.setSelection(e,o.selectionBefore)}))})),e.writeHistory("redos",o),t.undos.pop()}},e.apply=function(t){var n=e.operations,o=e.history,i=o.undos,a=i[i.length-1],u=a&&a.operations[a.operations.length-1],l=s.isSaving(e),d=s.isMerging(e);if(null==l&&(l=f(t)),l){if(null==d&&(d=null!=a&&(0!==n.length||c(t,u))),a&&d)a.operations.push(t);else{var h={operations:[t],selectionBefore:e.selection};e.writeHistory("undos",h)}for(;i.length>100;)i.shift();o.redos=[]}r(t)},e.writeHistory=function(t,n){e.history[t].push(n)},e},ro}var so=ao(),uo=function(t,e){return uo=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},uo(t,e)};function lo(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}uo(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var co=function(){return co=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},co.apply(this,arguments)};function fo(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function ho(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function po(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var go={};var vo={CREATED:"created",DESTROYED:"destroyed",CHANGE:"change",SCROLL:"scroll",FULLSCREEN:"fullscreen",UNFULLSCREEN:"unFullScreen"},mo={};var yo,bo,wo,xo,Eo,So,Oo,Co,ko,To,No,Ro,Lo,Mo,Po,Do,Ao,jo,Io,$o,Fo,_o,Bo,Ho,Wo,Uo,Vo,zo,Ko,qo,Go,Jo,Yo,Xo={};function Qo(){if(wo)return bo;wo=1;var t=Mt();return bo=t("document","documentElement")}function Zo(){if(Eo)return xo;Eo=1;var t,e=je(),n=function(){if(yo)return Xo;yo=1;var t=L(),e=Ae(),n=Ie(),r=je(),o=Nt(),i=Nr();return Xo.f=t&&!e?Object.defineProperties:function(t,e){r(t);for(var a,s=o(e),u=i(e),l=u.length,c=0;l>c;)n.f(t,a=u[c++],s[a]);return t},Xo}(),r=Dn(),o=on(),i=Qo(),a=Se(),s=rn(),u="prototype",l="script",c=s("IE_PROTO"),f=function(){},d=function(t){return"<"+l+">"+t+"</"+l+">"},h=function(t){t.write(d("")),t.close();var e=t.parentWindow.Object;return t=null,e},p=function(){try{t=new ActiveXObject("htmlfile")}catch(t){}var e,n,o;p="undefined"!=typeof document?document.domain&&t?h(t):(n=a("iframe"),o="java"+l+":",n.style.display="none",i.appendChild(n),n.src=String(o),(e=n.contentWindow.document).open(),e.write(d("document.F=Object")),e.close(),e.F):h(t);for(var s=r.length;s--;)delete p[u][r[s]];return p()};return o[c]=!0,xo=Object.create||function(t,r){var o;return null!==t?(f[u]=e(t),o=new f,f[u]=null,o[c]=t):o=p(),void 0===r?o:n.f(o,r)}}function ti(){if(Oo)return So;Oo=1;var t=we(),e=Zo(),n=Ie().f,r=t("unscopables"),o=Array.prototype;return void 0===o[r]&&n(o,r,{configurable:!0,value:e(null)}),So=function(t){o[r][t]=!0}}function ei(){return ko?Co:(ko=1,Co={})}function ni(){if(Lo)return Ro;Lo=1;var t=ye(),e=Rt(),n=me(),r=rn(),o=function(){if(No)return To;No=1;var t=R();return To=!t((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))}(),i=r("IE_PROTO"),a=Object,s=a.prototype;return Ro=o?a.getPrototypeOf:function(r){var o=n(r);if(t(o,i))return o[i];var u=o.constructor;return e(u)&&o instanceof u?u.prototype:o instanceof a?s:null}}function ri(){if(Po)return Mo;Po=1;var t,e,n,r=R(),o=Rt(),i=Lt(),a=Zo(),s=ni(),u=un(),l=we(),c=he(),f=l("iterator"),d=!1;return[].keys&&("next"in(n=[].keys())?(e=s(s(n)))!==Object.prototype&&(t=e):d=!0),!i(t)||r((function(){var e={};return t[f].call(e)!==e}))?t={}:c&&(t=a(t)),o(t[f])||u(t,f,(function(){return this})),Mo={IteratorPrototype:t,BUGGY_SAFARI_ITERATORS:d}}function oi(){if(Ao)return Do;Ao=1;var t=Ie().f,e=ye(),n=we()("toStringTag");return Do=function(r,o,i){r&&!i&&(r=r.prototype),r&&!e(r,n)&&t(r,n,{configurable:!0,value:o})}}function ii(){if(Bo)return _o;Bo=1;var t=Lt();return _o=function(e){return t(e)||null===e}}function ai(){if(Wo)return Ho;Wo=1;var t=ii(),e=String,n=TypeError;return Ho=function(r){if(t(r))return r;throw new n("Can't set "+e(r)+" as a prototype")}}function si(){if(Vo)return Uo;Vo=1;var t=function(){if(Fo)return $o;Fo=1;var t=St(),e=_t();return $o=function(n,r,o){try{return t(e(Object.getOwnPropertyDescriptor(n,r)[o]))}catch(t){}}}(),e=Lt(),n=Tt(),r=ai();return Uo=Object.setPrototypeOf||("__proto__"in{}?function(){var o,i=!1,a={};try{(o=t(Object.prototype,"__proto__","set"))(a,[]),i=a instanceof Array}catch(t){}return function(t,a){return n(t),r(a),e(t)?(i?o(t,a):t.__proto__=a,t):t}}():void 0)}function ui(){if(Ko)return zo;Ko=1;var t=pr(),e=P(),n=he(),r=tn(),o=Rt(),i=function(){if(Io)return jo;Io=1;var t=ri().IteratorPrototype,e=Zo(),n=Et(),r=oi(),o=ei(),i=function(){return this};return jo=function(a,s,u,l){var c=s+" Iterator";return a.prototype=e(t,{next:n(+!l,u)}),r(a,c,!1,!0),o[c]=i,a}}(),a=ni(),s=si(),u=oi(),l=$e(),c=un(),f=we(),d=ei(),h=ri(),p=r.PROPER,g=r.CONFIGURABLE,v=h.IteratorPrototype,m=h.BUGGY_SAFARI_ITERATORS,y=f("iterator"),b="keys",w="values",x="entries",E=function(){return this};return zo=function(r,f,h,S,O,C,k){i(h,f,S);var T,N,R,L=function(t){if(t===O&&j)return j;if(!m&&t&&t in D)return D[t];switch(t){case b:case w:case x:return function(){return new h(this,t)}}return function(){return new h(this)}},M=f+" Iterator",P=!1,D=r.prototype,A=D[y]||D["@@iterator"]||O&&D[O],j=!m&&A||L(O),I="Array"===f&&D.entries||A;if(I&&(T=a(I.call(new r)))!==Object.prototype&&T.next&&(n||a(T)===v||(s?s(T,v):o(T[y])||c(T,y,E)),u(T,M,!0,!0),n&&(d[M]=E)),p&&O===w&&A&&A.name!==w&&(!n&&g?l(D,"name",w):(P=!0,j=function(){return e(A,this)})),O)if(N={values:L(w),keys:C?j:L(b),entries:L(x)},k)for(R in N)(m||P||!(R in D))&&c(D,R,N[R]);else t({target:f,proto:!0,forced:m||P},N);return n&&!k||D[y]===j||c(D,y,j,{name:O}),d[f]=j,N}}function li(){return Go?qo:(Go=1,qo=function(t,e){return{value:t,done:e}})}function ci(){if(Yo)return Jo;Yo=1;var t=Nt(),e=ti(),n=ei(),r=an(),o=Ie().f,i=ui(),a=li(),s=he(),u=L(),l="Array Iterator",c=r.set,f=r.getterFor(l);Jo=i(Array,"Array",(function(e,n){c(this,{type:l,target:t(e),index:0,kind:n})}),(function(){var t=f(this),e=t.target,n=t.index++;if(!e||n>=e.length)return t.target=null,a(void 0,!0);switch(t.kind){case"keys":return a(n,!1);case"values":return a(e[n],!1)}return a([n,e[n]],!1)}),"values");var d=n.Arguments=n.Array;if(e("keys"),e("values"),e("entries"),!s&&u&&"values"!==d.name)try{o(d,"name",{value:"values"})}catch(t){}return Jo}ci();var fi,di,hi,pi,gi,vi={};function mi(){if(di)return fi;di=1;var t=br(),e=String;return fi=function(n){if("Symbol"===t(n))throw new TypeError("Cannot convert a Symbol value to a string");return e(n)}}function yi(){if(pi)return hi;pi=1;var t=St(),e=Tn(),n=mi(),r=Tt(),o=t("".charAt),i=t("".charCodeAt),a=t("".slice),s=function(t){return function(s,u){var l,c,f=n(r(s)),d=e(u),h=f.length;return d<0||d>=h?t?"":void 0:(l=i(f,d))<55296||l>56319||d+1===h||(c=i(f,d+1))<56320||c>57343?t?o(f,d):l:t?a(f,d,d+2):c-56320+(l-55296<<10)+65536}};return hi={codeAt:s(!1),charAt:s(!0)}}!function(){if(gi)return vi;gi=1;var t=yi().charAt,e=mi(),n=an(),r=ui(),o=li(),i="String Iterator",a=n.set,s=n.getterFor(i);r(String,"String",(function(t){a(this,{type:i,string:e(t),index:0})}),(function(){var e,n=s(this),r=n.string,i=n.index;return i>=r.length?o(void 0,!0):(e=t(r,i),n.index+=e.length,o(e,!1))}))}();var bi,wi,xi,Ei,Si={};function Oi(){if(wi)return bi;wi=1;var t=R();return bi=!t((function(){return Object.isExtensible(Object.preventExtensions({}))}))}function Ci(){if(Ei)return xi;Ei=1;var t=un();return xi=function(e,n,r){for(var o in n)t(e,o,n[o],r);return e}}var ki,Ti,Ni,Ri,Li,Mi,Pi,Di,Ai,ji,Ii,$i,Fi,_i,Bi,Hi,Wi,Ui,Vi,zi,Ki,qi,Gi,Ji,Yi,Xi,Qi,Zi,ta,ea,na={exports:{}},ra={};function oa(){if(Ti)return ki;Ti=1;var t=St();return ki=t([].slice)}function ia(){if(Ni)return ra;Ni=1;var t=Ot(),e=Nt(),n=An().f,r=oa(),o="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];return ra.f=function(i){return o&&"Window"===t(i)?function(t){try{return n(t)}catch(t){return r(o)}}(i):n(e(i))},ra}function aa(){if(Pi)return Mi;Pi=1;var t=R(),e=Lt(),n=Ot(),r=function(){if(Li)return Ri;Li=1;var t=R();return Ri=t((function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}}))}(),o=Object.isExtensible,i=t((function(){}));return Mi=i||r?function(t){return!!e(t)&&((!r||"ArrayBuffer"!==n(t))&&(!o||o(t)))}:o}function sa(){if(Di)return na.exports;Di=1;var t=pr(),e=St(),n=on(),r=Lt(),o=ye(),i=Ie().f,a=An(),s=ia(),u=aa(),l=be(),c=Oi(),f=!1,d=l("meta"),h=0,p=function(t){i(t,d,{value:{objectID:"O"+h++,weakData:{}}})},g=na.exports={enable:function(){g.enable=function(){},f=!0;var n=a.f,r=e([].splice),o={};o[d]=1,n(o).length&&(a.f=function(t){for(var e=n(t),o=0,i=e.length;o<i;o++)if(e[o]===d){r(e,o,1);break}return e},t({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:s.f}))},fastKey:function(t,e){if(!r(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,d)){if(!u(t))return"F";if(!e)return"E";p(t)}return t[d].objectID},getWeakData:function(t,e){if(!o(t,d)){if(!u(t))return!0;if(!e)return!1;p(t)}return t[d].weakData},onFreeze:function(t){return c&&f&&u(t)&&!o(t,d)&&p(t),t}};return n[d]=!0,na.exports}function ua(){if(ji)return Ai;ji=1;var t=we(),e=ei(),n=t("iterator"),r=Array.prototype;return Ai=function(t){return void 0!==t&&(e.Array===t||r[n]===t)}}function la(){if($i)return Ii;$i=1;var t=br(),e=Bt(),n=kt(),r=ei(),o=we()("iterator");return Ii=function(i){if(!n(i))return e(i,o)||e(i,"@@iterator")||r[t(i)]}}function ca(){if(_i)return Fi;_i=1;var t=P(),e=_t(),n=je(),r=Ft(),o=la(),i=TypeError;return Fi=function(a,s){var u=arguments.length<2?o(a):s;if(e(u))return n(t(u,a));throw new i(r(a)+" is not iterable")},Fi}function fa(){if(Hi)return Bi;Hi=1;var t=P(),e=je(),n=Bt();return Bi=function(r,o,i){var a,s;e(r);try{if(!(a=n(r,"return"))){if("throw"===o)throw i;return i}a=t(a,r)}catch(t){s=!0,a=t}if("throw"===o)throw i;if(s)throw a;return e(a),i}}function da(){if(Ui)return Wi;Ui=1;var t=Qr(),e=P(),n=je(),r=Ft(),o=ua(),i=Ln(),a=Pt(),s=ca(),u=la(),l=fa(),c=TypeError,f=function(t,e){this.stopped=t,this.result=e},d=f.prototype;return Wi=function(h,p,g){var v,m,y,b,w,x,E,S=g&&g.that,O=!(!g||!g.AS_ENTRIES),C=!(!g||!g.IS_RECORD),k=!(!g||!g.IS_ITERATOR),T=!(!g||!g.INTERRUPTED),N=t(p,S),R=function(t){return v&&l(v,"normal",t),new f(!0,t)},L=function(t){return O?(n(t),T?N(t[0],t[1],R):N(t[0],t[1])):T?N(t,R):N(t)};if(C)v=h.iterator;else if(k)v=h;else{if(!(m=u(h)))throw new c(r(h)+" is not iterable");if(o(m)){for(y=0,b=i(h);b>y;y++)if((w=L(h[y]))&&a(d,w))return w;return new f(!1)}v=s(h,m)}for(x=C?h.next:v.next;!(E=e(x,v)).done;){try{w=L(E.value)}catch(t){l(v,"throw",t)}if("object"==typeof w&&w&&a(d,w))return w}return new f(!1)}}function ha(){if(zi)return Vi;zi=1;var t=Pt(),e=TypeError;return Vi=function(n,r){if(t(r,n))return n;throw new e("Incorrect invocation")}}function pa(){if(qi)return Ki;qi=1;var t=we()("iterator"),e=!1;try{var n=0,r={next:function(){return{done:!!n++}},return:function(){e=!0}};r[t]=function(){return this},Array.from(r,(function(){throw 2}))}catch(t){}return Ki=function(n,r){try{if(!r&&!e)return!1}catch(t){return!1}var o=!1;try{var i={};i[t]=function(){return{next:function(){return{done:o=!0}}}},n(i)}catch(t){}return o}}function ga(){if(Ji)return Gi;Ji=1;var t=Rt(),e=Lt(),n=si();return Gi=function(r,o,i){var a,s;return n&&t(a=o.constructor)&&a!==i&&e(s=a.prototype)&&s!==i.prototype&&n(r,s),r}}function va(){if(Xi)return Yi;Xi=1;var t=pr(),e=b(),n=St(),r=hr(),o=un(),i=sa(),a=da(),s=ha(),u=Rt(),l=kt(),c=Lt(),f=R(),d=pa(),h=oi(),p=ga();return Yi=function(g,v,m){var y=-1!==g.indexOf("Map"),b=-1!==g.indexOf("Weak"),w=y?"set":"add",x=e[g],E=x&&x.prototype,S=x,O={},C=function(t){var e=n(E[t]);o(E,t,"add"===t?function(t){return e(this,0===t?0:t),this}:"delete"===t?function(t){return!(b&&!c(t))&&e(this,0===t?0:t)}:"get"===t?function(t){return b&&!c(t)?void 0:e(this,0===t?0:t)}:"has"===t?function(t){return!(b&&!c(t))&&e(this,0===t?0:t)}:function(t,n){return e(this,0===t?0:t,n),this})};if(r(g,!u(x)||!(b||E.forEach&&!f((function(){(new x).entries().next()})))))S=m.getConstructor(v,g,y,w),i.enable();else if(r(g,!0)){var k=new S,T=k[w](b?{}:-0,1)!==k,N=f((function(){k.has(1)})),R=d((function(t){new x(t)})),L=!b&&f((function(){for(var t=new x,e=5;e--;)t[w](e,e);return!t.has(-0)}));R||((S=v((function(t,e){s(t,E);var n=p(new x,t,S);return l(e)||a(e,n[w],{that:n,AS_ENTRIES:y}),n}))).prototype=E,E.constructor=S),(N||L)&&(C("delete"),C("has"),y&&C("get")),(L||T)&&C(w),b&&E.clear&&delete E.clear}return O[g]=S,t({global:!0,constructor:!0,forced:S!==x},O),h(S,g),b||m.setStrong(S,g,y),S},Yi}function ma(){if(Zi)return Qi;Zi=1;var t=St(),e=Ci(),n=sa().getWeakData,r=ha(),o=je(),i=kt(),a=Lt(),s=da(),u=Zr(),l=ye(),c=an(),f=c.set,d=c.getterFor,h=u.find,p=u.findIndex,g=t([].splice),v=0,m=function(t){return t.frozen||(t.frozen=new y)},y=function(){this.entries=[]},b=function(t,e){return h(t.entries,(function(t){return t[0]===e}))};return y.prototype={get:function(t){var e=b(this,t);if(e)return e[1]},has:function(t){return!!b(this,t)},set:function(t,e){var n=b(this,t);n?n[1]=e:this.entries.push([t,e])},delete:function(t){var e=p(this.entries,(function(e){return e[0]===t}));return~e&&g(this.entries,e,1),!!~e}},Qi={getConstructor:function(t,u,c,h){var p=t((function(t,e){r(t,g),f(t,{type:u,id:v++,frozen:null}),i(e)||s(e,t[h],{that:t,AS_ENTRIES:c})})),g=p.prototype,y=d(u),b=function(t,e,r){var i=y(t),a=n(o(e),!0);return!0===a?m(i).set(e,r):a[i.id]=r,t};return e(g,{delete:function(t){var e=y(this);if(!a(t))return!1;var r=n(t);return!0===r?m(e).delete(t):r&&l(r,e.id)&&delete r[e.id]},has:function(t){var e=y(this);if(!a(t))return!1;var r=n(t);return!0===r?m(e).has(t):r&&l(r,e.id)}}),e(g,c?{get:function(t){var e=y(this);if(a(t)){var r=n(t);if(!0===r)return m(e).get(t);if(r)return r[e.id]}},set:function(t,e){return b(this,t,e)}}:{add:function(t){return b(this,t,!0)}}),p}}}ea||(ea=1,function(){if(ta)return Si;ta=1;var t,e=Oi(),n=b(),r=St(),o=Ci(),i=sa(),a=va(),s=ma(),u=Lt(),l=an().enforce,c=R(),f=nn(),d=Object,h=Array.isArray,p=d.isExtensible,g=d.isFrozen,v=d.isSealed,m=d.freeze,y=d.seal,w=!n.ActiveXObject&&"ActiveXObject"in n,x=function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},E=a("WeakMap",x,s),S=E.prototype,O=r(S.set);if(f)if(w){t=s.getConstructor(x,"WeakMap",!0),i.enable();var C=r(S.delete),k=r(S.has),T=r(S.get);o(S,{delete:function(e){if(u(e)&&!p(e)){var n=l(this);return n.frozen||(n.frozen=new t),C(this,e)||n.frozen.delete(e)}return C(this,e)},has:function(e){if(u(e)&&!p(e)){var n=l(this);return n.frozen||(n.frozen=new t),k(this,e)||n.frozen.has(e)}return k(this,e)},get:function(e){if(u(e)&&!p(e)){var n=l(this);return n.frozen||(n.frozen=new t),k(this,e)?T(this,e):n.frozen.get(e)}return T(this,e)},set:function(e,n){if(u(e)&&!p(e)){var r=l(this);r.frozen||(r.frozen=new t),k(this,e)?O(this,e,n):r.frozen.set(e,n)}else O(this,e,n);return this}})}else e&&c((function(){var t=m([]);return O(new E,t,1),!g(t)}))&&o(S,{set:function(t,e){var n;return h(t)&&(g(t)?n=m:v(t)&&(n=y)),O(this,t,e),n&&n(t),this}})}());var ya,ba={};!function(){if(ya)return ba;ya=1;var t=b(),e=Jr(),n=Yr(),r=ci(),o=$e(),i=oi(),a=we()("iterator"),s=r.values,u=function(t,n){if(t){if(t[a]!==s)try{o(t,a,s)}catch(e){t[a]=s}if(i(t,n,!0),e[n])for(var u in r)if(t[u]!==r[u])try{o(t,u,r[u])}catch(e){t[u]=r[u]}}};for(var l in e)u(t[l]&&t[l].prototype,l);u(n,"DOMTokenList")}();var wa,xa=new WeakMap,Ea=new WeakMap,Sa=new WeakMap,Oa=new WeakMap,Ca=new WeakMap,ka=new WeakMap,Ta=new WeakMap,Na=new WeakMap,Ra=new WeakMap,La=new WeakMap,Ma=new WeakMap,Pa=new WeakMap,Da=new WeakMap,Aa=new WeakMap,ja=new WeakMap,Ia=new WeakMap,$a=new WeakMap,Fa=new WeakMap,_a=new WeakMap,Ba=new WeakMap,Ha=new WeakMap,Wa=new WeakMap,Ua=new WeakMap,Va=new WeakMap,za=new WeakMap,Ka=function(t){var e=t;return e.getAllMenuKeys=function(){var t=[];for(var e in mo)t.push(e);return t},e.getConfig=function(){var t=La.get(e);if(null==t)throw new Error("Can not get editor config");return t},e.getMenuConfig=function(t){var n=e.getConfig().MENU_CONF;return(void 0===n?{}:n)[t]||{}},e.alert=function(t,n){void 0===n&&(n="info");var r=e.getConfig().customAlert;r&&r(t,n)},e},qa={};!function(){if(wa)return qa;wa=1;var t=pr(),e=Zr().filter;t({target:"Array",proto:!0,forced:!Sr()("filter")},{filter:function(t){return e(this,t,arguments.length>1?arguments[1]:void 0)}})}();var Ga,Ja,Ya,Xa,Qa,Za={};function ts(){if(Ja)return Ga;Ja=1;var t=je(),e=fa();return Ga=function(n,r,o,i){try{return i?r(t(o)[0],o[1]):r(o)}catch(t){e(n,"throw",t)}}}!function(){if(Qa)return Za;Qa=1;var t=pr(),e=function(){if(Xa)return Ya;Xa=1;var t=Qr(),e=P(),n=me(),r=ts(),o=ua(),i=wr(),a=Ln(),s=mr(),u=ca(),l=la(),c=Array;return Ya=function(f){var d=n(f),h=i(this),p=arguments.length,g=p>1?arguments[1]:void 0,v=void 0!==g;v&&(g=t(g,p>2?arguments[2]:void 0));var m,y,b,w,x,E,S=l(d),O=0;if(!S||this===c&&o(S))for(m=a(d),y=h?new this(m):c(m);m>O;O++)E=v?g(d[O],O):d[O],s(y,O,E);else for(y=h?new this:[],x=(w=u(d,S)).next;!(b=e(x,w)).done;O++)E=v?r(w,g,[b.value,O],!0):b.value,s(y,O,E);return y.length=O,y},Ya}();t({target:"Array",stat:!0,forced:!pa()((function(t){Array.from(t)}))},{from:e})}();var es,ns={};!function(){if(es)return ns;es=1;var t=pr(),e=Mn().includes,n=R(),r=ti();t({target:"Array",proto:!0,forced:n((function(){return!Array(1).includes()}))},{includes:function(t){return e(this,t,arguments.length>1?arguments[1]:void 0)}}),r("includes")}();var rs,os={};!function(){if(rs)return os;rs=1;var t=pr(),e=St(),n=Ct(),r=Nt(),o=to(),i=e([].join);t({target:"Array",proto:!0,forced:n!==Object||!o("join",",")},{join:function(t){return i(r(this),void 0===t?",":t)}})}();var is,as={};!function(){if(is)return as;is=1;var t=pr(),e=Zr().map;t({target:"Array",proto:!0,forced:!Sr()("map")},{map:function(t){return e(this,t,arguments.length>1?arguments[1]:void 0)}})}();var ss,us,ls,cs,fs,ds,hs,ps={};function gs(){if(us)return ss;us=1;var t=Lt(),e=Ot(),n=we()("match");return ss=function(r){var o;return t(r)&&(void 0!==(o=r[n])?!!o:"RegExp"===e(r))}}function vs(){if(cs)return ls;cs=1;var t=gs(),e=TypeError;return ls=function(n){if(t(n))throw new e("The method doesn't accept regular expressions");return n}}function ms(){if(ds)return fs;ds=1;var t=we()("match");return fs=function(e){var n=/./;try{"/./"[e](n)}catch(r){try{return n[t]=!1,"/./"[e](n)}catch(t){}}return!1}}!function(){if(hs)return ps;hs=1;var t=pr(),e=St(),n=vs(),r=Tt(),o=mi(),i=ms(),a=e("".indexOf);t({target:"String",proto:!0,forced:!i("includes")},{includes:function(t){return!!~a(o(r(this)),o(n(t)),arguments.length>1?arguments[1]:void 0)}})}();var ys,bs,ws,xs,Es,Ss,Os,Cs={};function ks(){return bs?ys:(bs=1,ys="\t\n\v\f\r \u2028\u2029\ufeff")}!function(){if(Os)return Cs;Os=1;var t=pr(),e=function(){if(xs)return ws;xs=1;var t=St(),e=Tt(),n=mi(),r=ks(),o=t("".replace),i=RegExp("^["+r+"]+"),a=RegExp("(^|[^"+r+"])["+r+"]+$"),s=function(t){return function(r){var s=n(e(r));return 1&t&&(s=o(s,i,"")),2&t&&(s=o(s,a,"$1")),s}};return ws={start:s(1),end:s(2),trim:s(3)}}().trim,n=function(){if(Ss)return Es;Ss=1;var t=tn().PROPER,e=R(),n=ks();return Es=function(r){return e((function(){return!!n[r]()||"
"!=="
"[r]()||t&&n[r].name!==r}))}}();t({target:"String",proto:!0,forced:n("trim")},{trim:function(){return e(this)}})}();var Ts,Ns,Rs,Ls,Ms,Ps={};!function(){if(Ms)return Ps;Ms=1;var t=pr(),e=function(){if(Ns)return Ts;Ns=1;var t=St(),e=Tt(),n=mi(),r=/"/g,o=t("".replace);return Ts=function(t,i,a,s){var u=n(e(t)),l="<"+i;return""!==a&&(l+=" "+a+'="'+o(n(s),r,""")+'"'),l+">"+u+"</"+i+">"}}(),n=function(){if(Ls)return Rs;Ls=1;var t=R();return Rs=function(e){return t((function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}))}}();t({target:"String",proto:!0,forced:n("anchor")},{anchor:function(t){return e(this,"a","name",t)}})}();var Ds,As,js,Is,$s,Fs,_s,Bs;function Hs(){if(As)return Ds;As=1;var t=sn(),e=Ie();return Ds=function(n,r,o){return o.get&&t(o.get,r,{getter:!0}),o.set&&t(o.set,r,{setter:!0}),e.f(n,r,o)}}function Ws(){if(Is)return js;Is=1;var t=Mt(),e=Hs(),n=we(),r=L(),o=n("species");return js=function(n){var i=t(n);r&&i&&!i[o]&&e(i,o,{configurable:!0,get:function(){return this}})}}Bs||(Bs=1,_s||(_s=1,va()("Set",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),function(){if(Fs)return $s;Fs=1;var t=Zo(),e=Hs(),n=Ci(),r=Qr(),o=ha(),i=kt(),a=da(),s=ui(),u=li(),l=Ws(),c=L(),f=sa().fastKey,d=an(),h=d.set,p=d.getterFor;return $s={getConstructor:function(s,u,l,d){var g=s((function(e,n){o(e,v),h(e,{type:u,index:t(null),first:null,last:null,size:0}),c||(e.size=0),i(n)||a(n,e[d],{that:e,AS_ENTRIES:l})})),v=g.prototype,m=p(u),y=function(t,e,n){var r,o,i=m(t),a=b(t,e);return a?a.value=n:(i.last=a={index:o=f(e,!0),key:e,value:n,previous:r=i.last,next:null,removed:!1},i.first||(i.first=a),r&&(r.next=a),c?i.size++:t.size++,"F"!==o&&(i.index[o]=a)),t},b=function(t,e){var n,r=m(t),o=f(e);if("F"!==o)return r.index[o];for(n=r.first;n;n=n.next)if(n.key===e)return n};return n(v,{clear:function(){for(var e=m(this),n=e.first;n;)n.removed=!0,n.previous&&(n.previous=n.previous.next=null),n=n.next;e.first=e.last=null,e.index=t(null),c?e.size=0:this.size=0},delete:function(t){var e=this,n=m(e),r=b(e,t);if(r){var o=r.next,i=r.previous;delete n.index[r.index],r.removed=!0,i&&(i.next=o),o&&(o.previous=i),n.first===r&&(n.first=o),n.last===r&&(n.last=i),c?n.size--:e.size--}return!!r},forEach:function(t){for(var e,n=m(this),o=r(t,arguments.length>1?arguments[1]:void 0);e=e?e.next:n.first;)for(o(e.value,e.key,this);e&&e.removed;)e=e.previous},has:function(t){return!!b(this,t)}}),n(v,l?{get:function(t){var e=b(this,t);return e&&e.value},set:function(t,e){return y(this,0===t?0:t,e)}}:{add:function(t){return y(this,t=0===t?0:t,t)}}),c&&e(v,"size",{configurable:!0,get:function(){return m(this).size}}),g},setStrong:function(t,e,n){var r=e+" Iterator",o=p(e),i=p(r);s(t,e,(function(t,e){h(this,{type:r,target:t,state:o(t),kind:e,last:null})}),(function(){for(var t=i(this),e=t.kind,n=t.last;n&&n.removed;)n=n.previous;return t.target&&(t.last=n=n?n.next:t.state.first)?u("keys"===e?n.key:"values"===e?n.value:[n.key,n.value],!1):(t.target=null,u(void 0,!0))}),n?"entries":"values",!n,!0),l(e)}},$s}())));var Us,Vs,zs,Ks,qs,Gs,Js,Ys,Xs,Qs,Zs,tu=new Set(["doctype","!doctype","meta","script","style","link","frame","iframe","title","svg"]),eu={};function nu(){if(Vs)return Us;Vs=1;var t=je();return Us=function(){var e=t(this),n="";return e.hasIndices&&(n+="d"),e.global&&(n+="g"),e.ignoreCase&&(n+="i"),e.multiline&&(n+="m"),e.dotAll&&(n+="s"),e.unicode&&(n+="u"),e.unicodeSets&&(n+="v"),e.sticky&&(n+="y"),n}}function ru(){if(Ks)return zs;Ks=1;var t=R(),e=b().RegExp,n=t((function(){var t=e("a","y");return t.lastIndex=2,null!==t.exec("abcd")})),r=n||t((function(){return!e("a","y").sticky})),o=n||t((function(){var t=e("^r","gy");return t.lastIndex=2,null!==t.exec("str")}));return zs={BROKEN_CARET:o,MISSED_STICKY:r,UNSUPPORTED_Y:n}}function ou(){if(Gs)return qs;Gs=1;var t=R(),e=b().RegExp;return qs=t((function(){var t=e(".","s");return!(t.dotAll&&t.test("\n")&&"s"===t.flags)}))}function iu(){if(Ys)return Js;Ys=1;var t=R(),e=b().RegExp;return Js=t((function(){var t=e("(?<a>b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")}))}function au(){if(Qs)return Xs;Qs=1;var t,e,n=P(),r=St(),o=mi(),i=nu(),a=ru(),s=ve(),u=Zo(),l=an().get,c=ou(),f=iu(),d=s("native-string-replace",String.prototype.replace),h=RegExp.prototype.exec,p=h,g=r("".charAt),v=r("".indexOf),m=r("".replace),y=r("".slice),b=(e=/b*/g,n(h,t=/a/,"a"),n(h,e,"a"),0!==t.lastIndex||0!==e.lastIndex),w=a.BROKEN_CARET,x=void 0!==/()??/.exec("")[1];return(b||x||w||c||f)&&(p=function(t){var e,r,a,s,c,f,E,S=this,O=l(S),C=o(t),k=O.raw;if(k)return k.lastIndex=S.lastIndex,e=n(p,k,C),S.lastIndex=k.lastIndex,e;var T=O.groups,N=w&&S.sticky,R=n(i,S),L=S.source,M=0,P=C;if(N&&(R=m(R,"y",""),-1===v(R,"g")&&(R+="g"),P=y(C,S.lastIndex),S.lastIndex>0&&(!S.multiline||S.multiline&&"\n"!==g(C,S.lastIndex-1))&&(L="(?: "+L+")",P=" "+P,M++),r=new RegExp("^(?:"+L+")",R)),x&&(r=new RegExp("^"+L+"$(?!\\s)",R)),b&&(a=S.lastIndex),s=n(h,N?r:S,P),N?s?(s.input=y(s.input,M),s[0]=y(s[0],M),s.index=S.lastIndex,S.lastIndex+=s[0].length):S.lastIndex=0:b&&s&&(S.lastIndex=S.global?s.index+s[0].length:a),x&&s&&s.length>1&&n(d,s[0],r,(function(){for(c=1;c<arguments.length-2;c++)void 0===arguments[c]&&(s[c]=void 0)})),s&&T)for(s.groups=f=u(null),c=0;c<T.length;c++)f[(E=T[c])[0]]=s[E[1]];return s}),Xs=p}function su(){if(Zs)return eu;Zs=1;var t=pr(),e=au();return t({target:"RegExp",proto:!0,forced:/./.exec!==e},{exec:e}),eu}su();var uu,lu,cu,fu,du,hu,pu,gu,vu,mu,yu,bu={};function wu(){if(lu)return uu;lu=1,su();var t=P(),e=un(),n=au(),r=R(),o=we(),i=$e(),a=o("species"),s=RegExp.prototype;return uu=function(u,l,c,f){var d=o(u),h=!r((function(){var t={};return t[d]=function(){return 7},7!==""[u](t)})),p=h&&!r((function(){var t=!1,e=/a/;return"split"===u&&((e={}).constructor={},e.constructor[a]=function(){return e},e.flags="",e[d]=/./[d]),e.exec=function(){return t=!0,null},e[d](""),!t}));if(!h||!p||c){var g=/./[d],v=l(d,""[u],(function(e,r,o,i,a){var u=r.exec;return u===n||u===s.exec?h&&!a?{done:!0,value:t(g,r,o,i)}:{done:!0,value:t(e,o,r,i)}:{done:!1}}));e(String.prototype,u,v[0]),e(s,d,v[1])}f&&i(s[d],"sham",!0)},uu}function xu(){if(fu)return cu;fu=1;var t=wr(),e=Ft(),n=TypeError;return cu=function(r){if(t(r))return r;throw new n(e(r)+" is not a constructor")}}function Eu(){if(hu)return du;hu=1;var t=je(),e=xu(),n=kt(),r=we()("species");return du=function(o,i){var a,s=t(o).constructor;return void 0===s||n(a=t(s)[r])?i:e(a)}}function Su(){if(gu)return pu;gu=1;var t=yi().charAt;return pu=function(e,n,r){return n+(r?t(e,n).length:1)}}function Ou(){if(mu)return vu;mu=1;var t=P(),e=je(),n=Rt(),r=Ot(),o=au(),i=TypeError;return vu=function(a,s){var u=a.exec;if(n(u)){var l=t(u,a,s);return null!==l&&e(l),l}if("RegExp"===r(a))return t(o,a,s);throw new i("RegExp#exec called on incompatible receiver")}}!function(){if(yu)return bu;yu=1;var t=P(),e=St(),n=wu(),r=je(),o=kt(),i=Tt(),a=Eu(),s=Su(),u=Rn(),l=mi(),c=Bt(),f=Ou(),d=ru(),h=R(),p=d.UNSUPPORTED_Y,g=Math.min,v=e([].push),m=e("".slice),y=!h((function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var n="ab".split(t);return 2!==n.length||"a"!==n[0]||"b"!==n[1]})),b="c"==="abbc".split(/(b)*/)[1]||4!=="test".split(/(?:)/,-1).length||2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length;n("split",(function(e,n,d){var h="0".split(void 0,0).length?function(e,r){return void 0===e&&0===r?[]:t(n,this,e,r)}:n;return[function(n,r){var a=i(this),s=o(n)?void 0:c(n,e);return s?t(s,n,a,r):t(h,l(a),n,r)},function(t,e){var o=r(this),i=l(t);if(!b){var c=d(h,o,i,e,h!==n);if(c.done)return c.value}var y=a(o,RegExp),w=o.unicode,x=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(p?"g":"y"),E=new y(p?"^(?:"+o.source+")":o,x),S=void 0===e?4294967295:e>>>0;if(0===S)return[];if(0===i.length)return null===f(E,i)?[i]:[];for(var O=0,C=0,k=[];C<i.length;){E.lastIndex=p?0:C;var T,N=f(E,p?m(i,C):i);if(null===N||(T=g(u(E.lastIndex+(p?C:0)),i.length))===O)C=s(i,C,w);else{if(v(k,m(i,O,C)),k.length===S)return k;for(var R=1;R<=N.length-1;R++)if(v(k,N[R]),k.length===S)return k;C=O=T}}return v(k,m(i,O)),k}]}),b||!y,p)}();var Cu,ku,Tu,Nu={};!function(){if(Tu)return Nu;Tu=1;var t=pr(),e=function(){if(ku)return Cu;ku=1;var t=gr(),e=Ln(),n=vr(),r=Qr(),o=function(i,a,s,u,l,c,f,d){for(var h,p,g=l,v=0,m=!!f&&r(f,d);v<u;)v in s&&(h=m?m(s[v],v,a):s[v],c>0&&t(h)?(p=e(h),g=o(i,a,h,p,g,c-1)-1):(n(g+1),i[g]=h),g++),v++;return g};return Cu=o}(),n=_t(),r=me(),o=Ln(),i=Er();t({target:"Array",proto:!0},{flatMap:function(t){var a,s=r(this),u=o(s);return n(t),(a=i(s,0)).length=e(a,s,s,u,0,1,t,arguments.length>1?arguments[1]:void 0),a}})}();var Ru;Ru||(Ru=1,ti()("flatMap"));var Lu,Mu={};!function(){if(Lu)return Mu;Lu=1;var t=pr(),e=Zr().find,n=ti(),r="find",o=!0;r in[]&&Array(1)[r]((function(){o=!1})),t({target:"Array",proto:!0,forced:o},{find:function(t){return e(this,t,arguments.length>1?arguments[1]:void 0)}}),n(r)}();var Pu,Du,Au={};Du||(Du=1,function(){if(Pu)return Au;Pu=1;var t=pr(),e=b();t({global:!0,forced:e.globalThis!==e},{globalThis:e})}());const ju=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];var Iu,$u,Fu,_u,Bu,Hu,Wu,Uu,Vu,zu,Ku,qu,Gu,Ju,Yu,Xu,Qu,Zu,tl,el,nl,rl,ol,il,al,sl,ul,ll,cl,fl,dl={};function hl(){if($u)return Iu;$u=1;var t=b(),e=Dt(),n=Ot(),r=function(t){return e.slice(0,t.length)===t};return Iu=r("Bun/")?"BUN":r("Cloudflare-Workers")?"CLOUDFLARE":r("Deno/")?"DENO":r("Node.js/")?"NODE":t.Bun&&"string"==typeof Bun.version?"BUN":t.Deno&&"object"==typeof Deno.version?"DENO":"process"===n(t.process)?"NODE":t.window&&t.document?"BROWSER":"REST"}function pl(){if(_u)return Fu;_u=1;var t=hl();return Fu="NODE"===t}function gl(){if(Hu)return Bu;Hu=1;var t=M(),e=Function.prototype,n=e.apply,r=e.call;return Bu="object"==typeof Reflect&&Reflect.apply||(t?r.bind(n):function(){return r.apply(n,arguments)}),Bu}function vl(){if(Uu)return Wu;Uu=1;var t=TypeError;return Wu=function(e,n){if(e<n)throw new t("Not enough arguments");return e}}function ml(){if(zu)return Vu;zu=1;var t=Dt();return Vu=/(?:ipad|iphone|ipod).*applewebkit/i.test(t)}function yl(){if(qu)return Ku;qu=1;var t,e,n,r,o=b(),i=gl(),a=Qr(),s=Rt(),u=ye(),l=R(),c=Qo(),f=oa(),d=Se(),h=vl(),p=ml(),g=pl(),v=o.setImmediate,m=o.clearImmediate,y=o.process,w=o.Dispatch,x=o.Function,E=o.MessageChannel,S=o.String,O=0,C={},k="onreadystatechange";l((function(){t=o.location}));var T=function(t){if(u(C,t)){var e=C[t];delete C[t],e()}},N=function(t){return function(){T(t)}},L=function(t){T(t.data)},M=function(e){o.postMessage(S(e),t.protocol+"//"+t.host)};return v&&m||(v=function(t){h(arguments.length,1);var n=s(t)?t:x(t),r=f(arguments,1);return C[++O]=function(){i(n,void 0,r)},e(O),O},m=function(t){delete C[t]},g?e=function(t){y.nextTick(N(t))}:w&&w.now?e=function(t){w.now(N(t))}:E&&!p?(r=(n=new E).port2,n.port1.onmessage=L,e=a(r.postMessage,r)):o.addEventListener&&s(o.postMessage)&&!o.importScripts&&t&&"file:"!==t.protocol&&!l(M)?(e=M,o.addEventListener("message",L,!1)):e=k in d("script")?function(t){c.appendChild(d("script"))[k]=function(){c.removeChild(this),T(t)}}:function(t){setTimeout(N(t),0)}),Ku={set:v,clear:m}}function bl(){if(Ju)return Gu;Ju=1;var t=b(),e=L(),n=Object.getOwnPropertyDescriptor;return Gu=function(r){if(!e)return t[r];var o=n(t,r);return o&&o.value}}function wl(){if(Xu)return Yu;Xu=1;var t=function(){this.head=null,this.tail=null};return t.prototype={add:function(t){var e={item:t,next:null},n=this.tail;n?n.next=e:this.head=e,this.tail=e},get:function(){var t=this.head;if(t)return null===(this.head=t.next)&&(this.tail=null),t.item}},Yu=t}function xl(){if(rl)return nl;rl=1;var t,e,n,r,o,i=b(),a=bl(),s=Qr(),u=yl().set,l=wl(),c=ml(),f=function(){if(Zu)return Qu;Zu=1;var t=Dt();return Qu=/ipad|iphone|ipod/i.test(t)&&"undefined"!=typeof Pebble}(),d=function(){if(el)return tl;el=1;var t=Dt();return tl=/web0s(?!.*chrome)/i.test(t)}(),h=pl(),p=i.MutationObserver||i.WebKitMutationObserver,g=i.document,v=i.process,m=i.Promise,y=a("queueMicrotask");if(!y){var w=new l,x=function(){var e,n;for(h&&(e=v.domain)&&e.exit();n=w.get();)try{n()}catch(e){throw w.head&&t(),e}e&&e.enter()};c||h||d||!p||!g?!f&&m&&m.resolve?((r=m.resolve(void 0)).constructor=m,o=s(r.then,r),t=function(){o(x)}):h?t=function(){v.nextTick(x)}:(u=s(u,i),t=function(){u(x)}):(e=!0,n=g.createTextNode(""),new p(x).observe(n,{characterData:!0}),t=function(){n.data=e=!e}),y=function(e){w.head||t(),w.add(e)}}return nl=y}function El(){return il||(il=1,ol=function(t,e){try{1===arguments.length?console.error(t):console.error(t,e)}catch(t){}}),ol}function Sl(){return sl?al:(sl=1,al=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}})}function Ol(){if(ll)return ul;ll=1;var t=b();return ul=t.Promise}function Cl(){if(fl)return cl;fl=1;var t=b(),e=Ol(),n=Rt(),r=hr(),o=en(),i=we(),a=hl(),s=he(),u=At(),l=e&&e.prototype,c=i("species"),f=!1,d=n(t.PromiseRejectionEvent),h=r("Promise",(function(){var t=o(e),n=t!==String(e);if(!n&&66===u)return!0;if(s&&(!l.catch||!l.finally))return!0;if(!u||u<51||!/native code/.test(t)){var r=new e((function(t){t(1)})),i=function(t){t((function(){}),(function(){}))};if((r.constructor={})[c]=i,!(f=r.then((function(){}))instanceof i))return!0}return!(n||"BROWSER"!==a&&"DENO"!==a||d)}));return cl={CONSTRUCTOR:h,REJECTION_EVENT:d,SUBCLASSING:f}}var kl,Tl,Nl={};function Rl(){if(kl)return Nl;kl=1;var t=_t(),e=TypeError,n=function(n){var r,o;this.promise=new n((function(t,n){if(void 0!==r||void 0!==o)throw new e("Bad Promise constructor");r=t,o=n})),this.resolve=t(r),this.reject=t(o)};return Nl.f=function(t){return new n(t)},Nl}var Ll,Ml,Pl,Dl={};function Al(){if(Ml)return Ll;Ml=1;var t=Ol(),e=pa(),n=Cl().CONSTRUCTOR;return Ll=n||!e((function(e){t.all(e).then(void 0,(function(){}))}))}var jl,Il={};var $l,Fl={};var _l,Bl={};var Hl,Wl,Ul,Vl,zl={};function Kl(){if(Wl)return Hl;Wl=1;var t=je(),e=Lt(),n=Rl();return Hl=function(r,o){if(t(r),e(o)&&o.constructor===r)return o;var i=n.f(r);return(0,i.resolve)(o),i.promise}}Vl||(Vl=1,function(){if(Tl)return dl;Tl=1;var t,e,n,r=pr(),o=he(),i=pl(),a=b(),s=P(),u=un(),l=si(),c=oi(),f=Ws(),d=_t(),h=Rt(),p=Lt(),g=ha(),v=Eu(),m=yl().set,y=xl(),w=El(),x=Sl(),E=wl(),S=an(),O=Ol(),C=Cl(),k=Rl(),T="Promise",N=C.CONSTRUCTOR,R=C.REJECTION_EVENT,L=C.SUBCLASSING,M=S.getterFor(T),D=S.set,A=O&&O.prototype,j=O,I=A,$=a.TypeError,F=a.document,_=a.process,B=k.f,H=B,W=!!(F&&F.createEvent&&a.dispatchEvent),U="unhandledrejection",V=function(t){var e;return!(!p(t)||!h(e=t.then))&&e},z=function(t,e){var n,r,o,i=e.value,a=1===e.state,u=a?t.ok:t.fail,l=t.resolve,c=t.reject,f=t.domain;try{u?(a||(2===e.rejection&&Y(e),e.rejection=1),!0===u?n=i:(f&&f.enter(),n=u(i),f&&(f.exit(),o=!0)),n===t.promise?c(new $("Promise-chain cycle")):(r=V(n))?s(r,n,l,c):l(n)):c(i)}catch(t){f&&!o&&f.exit(),c(t)}},K=function(t,e){t.notified||(t.notified=!0,y((function(){for(var n,r=t.reactions;n=r.get();)z(n,t);t.notified=!1,e&&!t.rejection&&G(t)})))},q=function(t,e,n){var r,o;W?((r=F.createEvent("Event")).promise=e,r.reason=n,r.initEvent(t,!1,!0),a.dispatchEvent(r)):r={promise:e,reason:n},!R&&(o=a["on"+t])?o(r):t===U&&w("Unhandled promise rejection",n)},G=function(t){s(m,a,(function(){var e,n=t.facade,r=t.value;if(J(t)&&(e=x((function(){i?_.emit("unhandledRejection",r,n):q(U,n,r)})),t.rejection=i||J(t)?2:1,e.error))throw e.value}))},J=function(t){return 1!==t.rejection&&!t.parent},Y=function(t){s(m,a,(function(){var e=t.facade;i?_.emit("rejectionHandled",e):q("rejectionhandled",e,t.value)}))},X=function(t,e,n){return function(r){t(e,r,n)}},Q=function(t,e,n){t.done||(t.done=!0,n&&(t=n),t.value=e,t.state=2,K(t,!0))},Z=function(t,e,n){if(!t.done){t.done=!0,n&&(t=n);try{if(t.facade===e)throw new $("Promise can't be resolved itself");var r=V(e);r?y((function(){var n={done:!1};try{s(r,e,X(Z,n,t),X(Q,n,t))}catch(e){Q(n,e,t)}})):(t.value=e,t.state=1,K(t,!1))}catch(e){Q({done:!1},e,t)}}};if(N&&(I=(j=function(e){g(this,I),d(e),s(t,this);var n=M(this);try{e(X(Z,n),X(Q,n))}catch(t){Q(n,t)}}).prototype,(t=function(t){D(this,{type:T,done:!1,notified:!1,parent:!1,reactions:new E,rejection:!1,state:0,value:null})}).prototype=u(I,"then",(function(t,e){var n=M(this),r=B(v(this,j));return n.parent=!0,r.ok=!h(t)||t,r.fail=h(e)&&e,r.domain=i?_.domain:void 0,0===n.state?n.reactions.add(r):y((function(){z(r,n)})),r.promise})),e=function(){var e=new t,n=M(e);this.promise=e,this.resolve=X(Z,n),this.reject=X(Q,n)},k.f=B=function(t){return t===j||void 0===t?new e(t):H(t)},!o&&h(O)&&A!==Object.prototype)){n=A.then,L||u(A,"then",(function(t,e){var r=this;return new j((function(t,e){s(n,r,t,e)})).then(t,e)}),{unsafe:!0});try{delete A.constructor}catch(t){}l&&l(A,I)}r({global:!0,constructor:!0,wrap:!0,forced:N},{Promise:j}),c(j,T,!1,!0),f(T)}(),function(){if(Pl)return Dl;Pl=1;var t=pr(),e=P(),n=_t(),r=Rl(),o=Sl(),i=da();t({target:"Promise",stat:!0,forced:Al()},{all:function(t){var a=this,s=r.f(a),u=s.resolve,l=s.reject,c=o((function(){var r=n(a.resolve),o=[],s=0,c=1;i(t,(function(t){var n=s++,i=!1;c++,e(r,a,t).then((function(t){i||(i=!0,o[n]=t,--c||u(o))}),l)})),--c||u(o)}));return c.error&&l(c.value),s.promise}})}(),function(){if(jl)return Il;jl=1;var t=pr(),e=he(),n=Cl().CONSTRUCTOR,r=Ol(),o=Mt(),i=Rt(),a=un(),s=r&&r.prototype;if(t({target:"Promise",proto:!0,forced:n,real:!0},{catch:function(t){return this.then(void 0,t)}}),!e&&i(r)){var u=o("Promise").prototype.catch;s.catch!==u&&a(s,"catch",u,{unsafe:!0})}}(),function(){if($l)return Fl;$l=1;var t=pr(),e=P(),n=_t(),r=Rl(),o=Sl(),i=da();t({target:"Promise",stat:!0,forced:Al()},{race:function(t){var a=this,s=r.f(a),u=s.reject,l=o((function(){var r=n(a.resolve);i(t,(function(t){e(r,a,t).then(s.resolve,u)}))}));return l.error&&u(l.value),s.promise}})}(),function(){if(_l)return Bl;_l=1;var t=pr(),e=Rl();t({target:"Promise",stat:!0,forced:Cl().CONSTRUCTOR},{reject:function(t){var n=e.f(this);return(0,n.reject)(t),n.promise}})}(),function(){if(Ul)return zl;Ul=1;var t=pr(),e=Mt(),n=he(),r=Ol(),o=Cl().CONSTRUCTOR,i=Kl(),a=e("Promise"),s=n&&!o;t({target:"Promise",stat:!0,forced:n||o},{resolve:function(t){return i(s&&this===a?r:this,t)}})}());var ql,Gl,Jl,Yl={};function Xl(){if(Gl)return ql;Gl=1;var t=P(),e=ye(),n=Pt(),r=nu(),o=RegExp.prototype;return ql=function(i){var a=i.flags;return void 0!==a||"flags"in o||e(i,"flags")||!n(o,i)?a:t(r,i)}}!function(){if(Jl)return Yl;Jl=1;var t=tn().PROPER,e=un(),n=je(),r=mi(),o=R(),i=Xl(),a="toString",s=RegExp.prototype,u=s[a],l=o((function(){return"/a/b"!==u.call({source:"a",flags:"b"})})),c=t&&u.name!==a;(l||c)&&e(s,a,(function(){var t=n(this);return"/"+r(t.source)+"/"+r(i(t))}),{unsafe:!0})}();var Ql,Zl,tc,ec={};function nc(){if(Zl)return Ql;Zl=1;var t=St(),e=me(),n=Math.floor,r=t("".charAt),o=t("".replace),i=t("".slice),a=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,s=/\$([$&'`]|\d{1,2})/g;return Ql=function(t,u,l,c,f,d){var h=l+t.length,p=c.length,g=s;return void 0!==f&&(f=e(f),g=a),o(d,g,(function(e,o){var a;switch(r(o,0)){case"$":return"$";case"&":return t;case"`":return i(u,0,l);case"'":return i(u,h);case"<":a=f[i(o,1,-1)];break;default:var s=+o;if(0===s)return e;if(s>p){var d=n(s/10);return 0===d?e:d<=p?void 0===c[d-1]?r(o,1):c[d-1]+r(o,1):e}a=c[s-1]}return void 0===a?"":a}))},Ql}function rc(t){Promise.resolve().then(t)}!function(){if(tc)return ec;tc=1;var t=gl(),e=P(),n=St(),r=wu(),o=R(),i=je(),a=Rt(),s=kt(),u=Tn(),l=Rn(),c=mi(),f=Tt(),d=Su(),h=Bt(),p=nc(),g=Ou(),v=we()("replace"),m=Math.max,y=Math.min,b=n([].concat),w=n([].push),x=n("".indexOf),E=n("".slice),S="$0"==="a".replace(/./,"$0"),O=!!/./[v]&&""===/./[v]("a","$0");r("replace",(function(n,r,o){var S=O?"$":"$0";return[function(t,n){var o=f(this),i=s(t)?void 0:h(t,v);return i?e(i,t,o,n):e(r,c(o),t,n)},function(e,n){var s=i(this),f=c(e);if("string"==typeof n&&-1===x(n,S)&&-1===x(n,"$<")){var h=o(r,s,f,n);if(h.done)return h.value}var v=a(n);v||(n=c(n));var O,C=s.global;C&&(O=s.unicode,s.lastIndex=0);for(var k,T=[];null!==(k=g(s,f))&&(w(T,k),C);){""===c(k[0])&&(s.lastIndex=d(f,l(s.lastIndex),O))}for(var N,R="",L=0,M=0;M<T.length;M++){for(var P,D=c((k=T[M])[0]),A=m(y(u(k.index),f.length),0),j=[],I=1;I<k.length;I++)w(j,void 0===(N=k[I])?N:String(N));var $=k.groups;if(v){var F=b([D],j,A,f);void 0!==$&&w(F,$),P=c(t(n,void 0,F))}else P=p(D,f,A,j,$,n);A>=L&&(R+=E(f,L,A)+P,L=A+D.length)}return R+E(f,L)}]}),!!o((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")}))||!S||O)}();var oc,ic=function(t){return Object.prototype.toString.call(t)},ac=globalThis.Node,sc=globalThis.Comment,uc=globalThis.Element,lc=globalThis.Text,cc=globalThis.Range,fc=globalThis.Selection,dc=globalThis.StaticRange;o.css&&(o.fn.css=o.css),o.append&&(o.fn.append=o.append),o.addClass&&(o.fn.addClass=o.addClass),o.removeClass&&(o.fn.removeClass=o.removeClass),o.hasClass&&(o.fn.hasClass=o.hasClass),o.on&&(o.fn.on=o.on),o.focus&&(o.fn.focus=o.focus),o.attr&&(o.fn.attr=o.attr),o.removeAttr&&(o.fn.removeAttr=o.removeAttr),o.hide&&(o.fn.hide=o.hide),o.show&&(o.fn.show=o.show),o.offset&&(o.fn.offset=o.offset),o.width&&(o.fn.width=o.width),o.height&&(o.fn.height=o.height),o.parent&&(o.fn.parent=o.parent),o.parents&&(o.fn.parents=o.parents),o.is&&(o.fn.is=o.is),o.dataset&&(o.fn.dataset=o.dataset),o.val&&(o.fn.val=o.val),o.text&&(o.fn.text=o.text),o.html&&(o.fn.html=o.html),o.children&&(o.fn.children=o.children),o.remove&&(o.fn.remove=o.remove),o.find&&(o.fn.find=o.find),o.each&&(o.fn.each=o.each),o.empty&&(o.fn.empty=o.empty),t.NodeType=void 0,(oc=t.NodeType||(t.NodeType={}))[oc.ELEMENT_NODE=1]="ELEMENT_NODE",oc[oc.TEXT_NODE=3]="TEXT_NODE",oc[oc.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",oc[oc.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",oc[oc.COMMENT_NODE=8]="COMMENT_NODE",oc[oc.DOCUMENT_NODE=9]="DOCUMENT_NODE",oc[oc.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",oc[oc.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE";var hc=function(t){return"[object HTMLDocument]"===ic(t)},pc=function(t){return"[object ShadowRoot]"===ic(t)},gc=function(t){return"[object DataTransfer]"===ic(t)},vc=/\[object HTML([A-Z][a-z]*)*Element\]/,mc=function(t){return"matches"in t&&/^[ou]l$/i.test(t.tagName)&&!t.hasAttribute("data-w-e-type")},yc=function(t){return vc.test(ic(t))},bc=function(t){return t&&t.ownerDocument&&t.ownerDocument.defaultView||null},wc=function(t){return null!=t&&"number"==typeof t.nodeType},xc=function(e){return wc(e)&&e.nodeType===t.NodeType.COMMENT_NODE},Ec=function(e){return wc(e)&&e.nodeType===t.NodeType.ELEMENT_NODE},Sc=function(t){return"[object Selection]"===ic(t)},Oc=function(e){return wc(e)&&e.nodeType===t.NodeType.TEXT_NODE},Cc=function(t){return t.clipboardData&&""!==t.clipboardData.getData("text/plain")&&1===t.clipboardData.types.length},kc=function(t){var e,n=ho(t,2),r=n[0],o=n[1];if(Ec(r)&&r.childNodes.length){var i=o===r.childNodes.length,a=i?o-1:o;for(r=(e=ho(Rc(r,a,i?"backward":"forward"),2))[0],i=(a=e[1])<o;Ec(r)&&r.childNodes.length;){var s=i?r.childNodes.length-1:0;r=Lc(r,s,i?"backward":"forward")}o=i&&null!=r.textContent?r.textContent.length:0}return[r,o]},Tc=function(){return!(!window.document.activeElement||!window.document.activeElement.shadowRoot)},Nc=function(t){var e,n,r;return null!==(e=window&&window.document.getElementById(t))&&void 0!==e?e:window&&(null===(r=null===(n=window.document.activeElement)||void 0===n?void 0:n.shadowRoot)||void 0===r?void 0:r.getElementById(t))||null},Rc=function(t,e,n){for(var r=t.childNodes,o=r[e],i=e,a=!1,s=!1;(xc(o)||Ec(o)&&0===o.childNodes.length||Ec(o)&&"false"===o.getAttribute("contenteditable"))&&(!a||!s);)i>=r.length?(a=!0,i=e-1,n="backward"):i<0?(s=!0,i=e+1,n="forward"):(o=r[i],e=i,i+="forward"===n?1:-1);return[o,e]},Lc=function(t,e,n){return ho(Rc(t,e,n),1)[0]},Mc=function(t){var e,n,r="";if(Oc(t)&&t.nodeValue)return t.nodeValue;if(Ec(t)){try{for(var o=fo(Array.from(t.childNodes)),i=o.next();!i.done;i=o.next()){var a=i.value;r+=Mc(a)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}var s=getComputedStyle(t).getPropertyValue("display");"block"!==s&&"list"!==s&&"table-row"!==s&&"BR"!==t.tagName||(r+="\n")}return r};function Pc(e){var n=[];n.push(e);for(var r=0;n.length>0;){var o=n.pop();if(null==o)break;if((r+=1)>1e4)break;var i=o.nodeName;if(o.nodeType===t.NodeType.ELEMENT_NODE){var a=i.toLowerCase();if(ju.includes(a)||"iframe"===a||"video"===a)return o;var s=o.children||[],u=s.length;if(u)for(var l=u-1;l>=0;l-=1)n.push(s[l])}}return null}function Dc(e,n){if(!yc(e)||"true"!==e.dataset.slateVoid)for(var r=e.childNodes,o=r.length;o-=1;){var i=r[o],a=i.nodeType;Oc(i)?n(i,e):[t.NodeType.ELEMENT_NODE,t.NodeType.DOCUMENT_NODE,t.NodeType.DOCUMENT_FRAGMENT_NODE].includes(a)&&Dc(i,n)}}function Ac(e){if(0===e.length)return"";var n=e[0];return n.nodeType!==t.NodeType.ELEMENT_NODE?"":n.tagName.toLowerCase()}var jc,Ic,$c,Fc={};function _c(){if(Ic)return jc;Ic=1;var t=Ie().f;return jc=function(e,n,r){r in e||t(e,r,{configurable:!0,get:function(){return n[r]},set:function(t){n[r]=t}})}}!function(){if($c)return Fc;$c=1;var t=L(),e=b(),n=St(),r=hr(),o=ga(),i=$e(),a=Zo(),s=An().f,u=Pt(),l=gs(),c=mi(),f=Xl(),d=ru(),h=_c(),p=un(),g=R(),v=ye(),m=an().enforce,y=Ws(),w=we(),x=ou(),E=iu(),S=w("match"),O=e.RegExp,C=O.prototype,k=e.SyntaxError,T=n(C.exec),N=n("".charAt),M=n("".replace),P=n("".indexOf),D=n("".slice),A=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,j=/a/g,I=/a/g,$=new O(j)!==j,F=d.MISSED_STICKY,_=d.UNSUPPORTED_Y,B=t&&(!$||F||x||E||g((function(){return I[S]=!1,O(j)!==j||O(I)===I||"/a/i"!==String(O(j,"i"))})));if(r("RegExp",B)){for(var H=function(t,e){var n,r,s,d,h,p,g=u(C,this),y=l(t),b=void 0===e,w=[],S=t;if(!g&&y&&b&&t.constructor===H)return t;if((y||u(C,t))&&(t=t.source,b&&(e=f(S))),t=void 0===t?"":c(t),e=void 0===e?"":c(e),S=t,x&&"dotAll"in j&&(r=!!e&&P(e,"s")>-1)&&(e=M(e,/s/g,"")),n=e,F&&"sticky"in j&&(s=!!e&&P(e,"y")>-1)&&_&&(e=M(e,/y/g,"")),E&&(d=function(t){for(var e,n=t.length,r=0,o="",i=[],s=a(null),u=!1,l=!1,c=0,f="";r<=n;r++){if("\\"===(e=N(t,r)))e+=N(t,++r);else if("]"===e)u=!1;else if(!u)switch(!0){case"["===e:u=!0;break;case"("===e:if(o+=e,"?:"===D(t,r+1,r+3))continue;T(A,D(t,r+1))&&(r+=2,l=!0),c++;continue;case">"===e&&l:if(""===f||v(s,f))throw new k("Invalid capture group name");s[f]=!0,i[i.length]=[f,c],l=!1,f="";continue}l?f+=e:o+=e}return[o,i]}(t),t=d[0],w=d[1]),h=o(O(t,e),g?this:C,H),(r||s||w.length)&&(p=m(h),r&&(p.dotAll=!0,p.raw=H(function(t){for(var e,n=t.length,r=0,o="",i=!1;r<=n;r++)"\\"!==(e=N(t,r))?i||"."!==e?("["===e?i=!0:"]"===e&&(i=!1),o+=e):o+="[\\s\\S]":o+=e+N(t,++r);return o}(t),n)),s&&(p.sticky=!0),w.length&&(p.groups=w)),t!==S)try{i(h,"source",""===S?"(?:)":S)}catch(t){}return h},W=s(O),U=0;W.length>U;)h(H,O,W[U++]);C.constructor=H,H.prototype=C,p(e,"RegExp",H,{constructor:!0})}y("RegExp")}();var Bc=new RegExp(String.fromCharCode(160),"g");function Hc(t){return t.replace(Bc," ")}var Wc=["span","b","strong","i","em","s","strike","u","font","sub","sup"],Uc=[];var Vc=[];var zc={};function Kc(t,n){var r=t.length;if(r){var o=t[r-1];if(e.Text.isText(o)){var i=Object.keys(o);if(1===i.length&&"text"===i[0])return o.text+=n,!0}}return!1}function qc(t,e,n){return{type:"paragraph",children:[{text:o(t).text().replace(/\s+/gm," ")}]}}function Gc(t,n){var r=function(t,e){var n=[];if(null!=t.attr("data-w-e-is-void"))return n;var r=t[0].childNodes;return 1===r.length&&"BR"===r[0].nodeName?(n.push({text:""}),n):(r.forEach((function(t){if(Ec(t)){if("BR"===t.nodeName)return void(Kc(n,"\n")||n.push({text:"\n"}));var r=Yc(o(t),e);Array.isArray(r)?r.forEach((function(t){return n.push(t)})):n.push(r)}else if(Oc(t)){var i=t.textContent||"";if(""===i.trim()&&i.indexOf("\n")>=0)return;i&&(i=Hc(i),Kc(n,i)||n.push({text:i}))}})),n)}(t,n),i=function(t){for(var e in zc)if(t[0].matches(e))return zc[e];return qc}(t),a=i(t[0],r,n);return Array.isArray(a)||(a=[a]),a.forEach((function(o){e.Editor.isVoid(n,o)||(0===r.length&&(o.children=[{text:t.text().replace(/\s+/gm," ")}]),Vc.forEach((function(e){o=e(t[0],o,n)})))})),a}function Jc(t,e){0===t.parents("pre").length&&(t[0].innerHTML=t[0].innerHTML.replace(/\s+/gm," ").replace(/<br>/g,"\n"));var n=t[0].textContent||"";n=function(t){return t.replace(/ /g," ").replace(/</g,"<").replace(/>/g,">").replace(/®/g,"®").replace(/©/g,"©").replace(/™/g,"™").replace(/"/g,'"')}(n);var r={text:n=Hc(n)};return Vc.forEach((function(n){r=n(t[0],r,e)})),r}function Yc(t,e){Uc.forEach((function(e){var n=e.selector,r=e.preParseHtml;t[0].matches(n)&&(t=o(r(t[0])))}));var n=Ac(t);if("span"===n){if(t.attr("data-w-e-type"))return Gc(t,e);if(t[0].childNodes.length>1){var r=t[0].childNodes,i=function(t,e){var n={text:""};return Vc.forEach((function(r){n=r(t[0],n,e)})),n}(o(t[0]),e);return Array.from(r).flatMap((function(t){var n=function(t,e,n){var r=t[0];if(Ec(r)){var o=Yc(t,n);return Array.isArray(o)?o.map((function(t){return co(co({},e),t)})):[co(co({},e),o)]}if(xc(r))return null;var i=Oc(r)?{text:r.textContent||""}:Jc(t,n);return[co(co({},e),i)]}(o(t),i,e);return n||[]}))}return Jc(t,e)}if("code"===n)return"pre"===Ac(t.parent())?Gc(t,e):Jc(t,e);if(Wc.includes(n)){if(t[0].childNodes.length>0&&3!==t[0].childNodes[0].nodeType){r=t[0].childNodes;return co(co({},Yc(o(r[0]),e)),Jc(t,e))}return Jc(t,e)}return Gc(t,e)}function Xc(t,e,n){var r=o(n);return!!r.attr(e)||(r.attr(e,"true"),t.on(vo.DESTROYED,(function(){r.removeAttr(e)})),!1)}function Qc(t,e){void 0===e&&(e="");var n=[];""===e&&(e="<p><br></p>"),0!==e.indexOf("<")&&(e=e.split(/\n/).map((function(t){return"<p>".concat(t,"</p>")})).join(""));var r=o("<div>".concat(e,"</div>"));return Array.from(r.children()).forEach((function(e){var r=Yc(o(e),t);Array.isArray(r)?r.forEach((function(t){return n.push(t)})):n.push(r)})),n}function Zc(t,e){return"w-e-element-".concat(t,"-").concat(e)}var tf=[];var ef={};function nf(t,e,n){var r=n.isInline(t)?"span":"div";return"<".concat(r,">").concat(e,"</").concat(r,">")}function rf(t,n){var r=t.type,o=void 0===r?"":r,i=t.children,a=void 0===i?[]:i,s=e.Editor.isVoid(n,t),u="";s||(u=a.map((function(t){return Ef(t,n)})).join(""));var l=function(t){return ef[t]||nf}(o),c=l(t,u,n),f="";if(f="string"==typeof c?c:c.html||"",s||tf.forEach((function(e){return f=e(t,f)})),"string"==typeof c)return f;var d=c.prefix,h=void 0===d?"":d,p=c.suffix,g=void 0===p?"":p;return h&&(f=h+f),g&&(f+=g),f}var of,af,sf,uf={};function lf(){if(af)return of;af=1;var t=ye();return of=function(e){return void 0!==e&&(t(e,"value")||t(e,"writable"))}}!function(){if(sf)return uf;sf=1;var t=pr(),e=P(),n=Lt(),r=je(),o=lf(),i=Ce(),a=ni();t({target:"Reflect",stat:!0},{get:function t(s,u){var l,c,f=arguments.length<3?s:arguments[2];return r(s)===f?s[u]:(l=i.f(s,u))?o(l)?l.value:void 0===l.get?void 0:e(l.get,f):n(c=a(s))?t(c,u,f):void 0}})}();var cf,ff={};!function(){if(cf)return ff;cf=1;var t,e=pr(),n=Xr(),r=Ce().f,o=Rn(),i=mi(),a=vs(),s=Tt(),u=ms(),l=he(),c=n("".slice),f=Math.min,d=u("endsWith");e({target:"String",proto:!0,forced:!!(l||d||(t=r(String.prototype,"endsWith"),!t||t.writable))&&!d},{endsWith:function(t){var e=i(s(this));a(t);var n=arguments.length>1?arguments[1]:void 0,r=e.length,u=void 0===n?r:f(o(n),r),l=i(t);return c(e,u-l.length,u)===l}})}();var df=0,hf=function(){this.id="".concat(df++)},pf="undefined"!=typeof navigator&&/Mac OS X/.test(navigator.userAgent),gf="undefined"!=typeof navigator&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),vf="undefined"!=typeof navigator&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent),mf="undefined"!=typeof navigator&&/Edge?\/(?:[0-6][0-9]|[0-7][0-8])(?:\.)/i.test(navigator.userAgent),yf="undefined"!=typeof navigator&&/Chrome?\/(?:[0-7][0-5]|[0-6][0-9])(?:\.)/i.test(navigator.userAgent),bf="undefined"!=typeof navigator&&/Chrome/i.test(navigator.userAgent),wf=!yf&&!mf&&"undefined"!=typeof globalThis&&globalThis.InputEvent&&"function"==typeof globalThis.InputEvent.prototype.getTargetRanges,xf={getWindow:function(t){var e=Ha.get(t);if(!e)throw new Error("Unable to find a host window element for this editor");return e},findKey:function(t,e){var n=Ba.get(e);return n||(n=new hf,Ba.set(e,n)),n},setNewKey:function(t){var e=new hf;Ba.set(t,e)},findPath:function(t,n){for(var r=[],o=n;;){var i=ja.get(o);if(null==i){if(e.Editor.isEditor(o))return r;break}var a=Aa.get(o);if(null==a)break;r.unshift(a),o=i}throw new Error("Unable to find the path for Slate node: ".concat(JSON.stringify(n)))},findDocumentOrShadowRoot:function(t){if(t.isDestroyed)return window.document;var e=xf.toDOMNode(t,t),n=e.getRootNode();return(hc(n)||pc(n))&&null!=Reflect.get(n,"getSelection")?n:e.ownerDocument},getParentNode:function(t,e){return ja.get(e)||null},getParentsNodes:function(t,e){for(var n=[],r=e;r!==t&&null!=r;){var o=xf.getParentNode(t,r);if(null==o)break;n.push(o),r=o}return n},getTopNode:function(t,n){var r=[xf.findPath(t,n)[0]];return e.Node.get(t,r)},toDOMNode:function(t,n){var r;if(e.Editor.isEditor(n))r=Ia.get(t);else{var o=xf.findKey(t,n);r=Fa.get(o)}if(!r)throw new Error("Cannot resolve a DOM node from Slate node: ".concat(JSON.stringify(n)));return r},hasDOMNode:function(t,e,n){void 0===n&&(n={});var r,o=n.editable,i=void 0!==o&&o,a=xf.toDOMNode(t,t);try{r=Ec(e)?e:e.parentElement}catch(t){if(t instanceof Error&&!t.message.includes('Permission denied to access property "nodeType"'))throw t}return!!r&&(r.closest("[data-slate-editor]")===a&&(!i||r.isContentEditable||!!r.getAttribute("data-slate-zero-width"))||!!r.getAttribute("data-slate-string"))},toDOMRange:function(t,n){var r=n.anchor,o=n.focus,i=e.Range.isBackward(n),a=xf.toDOMPoint(t,r),s=e.Range.isCollapsed(n)?a:xf.toDOMPoint(t,o),u=xf.getWindow(t).document.createRange(),l=ho(i?s:a,2),c=l[0],f=l[1],d=ho(i?a:s,2),h=d[0],p=d[1],g=!!(Ec(c)?c:c.parentElement).getAttribute("data-slate-zero-width"),v=!!(Ec(h)?h:h.parentElement).getAttribute("data-slate-zero-width");return u.setStart(c,g?1:f),u.setEnd(h,v?1:p),u},toDOMPoint:function(t,n){var r,o,i,a=ho(e.Editor.node(t,n.path),1)[0],s=xf.toDOMNode(t,a);e.Editor.void(t,{at:n})&&(n={path:n.path,offset:0});var u=Array.from(s.querySelectorAll("[data-slate-string], [data-slate-zero-width]")),l=0;try{for(var c=fo(u),f=c.next();!f.done;f=c.next()){var d=f.value,h=d.childNodes[0];if(null!=h&&null!=h.textContent){var p=h.textContent.length,g=d.getAttribute("data-slate-length"),v=l+(null==g?p:parseInt(g,10));if(n.offset<=v){i=[h,Math.min(p,Math.max(0,n.offset-l))];break}l=v}}}catch(t){r={error:t}}finally{try{f&&!f.done&&(o=c.return)&&o.call(c)}finally{if(r)throw r.error}}if(!i)throw new Error("Cannot resolve a DOM point from Slate point: ".concat(JSON.stringify(n)));return i},toSlateNode:function(t,e){var n=Ec(e)?e:e.parentElement;n&&!n.hasAttribute("data-slate-node")&&(n=n.closest("[data-slate-node]"));var r=n?$a.get(n):null;if(!r)throw new Error("Cannot resolve a Slate node from DOM node: ".concat(n));return r},findEventRange:function(t,n){"nativeEvent"in n&&(n=n.nativeEvent);var r=n.clientX,o=n.clientY,i=n.target;if(null==r||null==o)throw new Error("Cannot resolve a Slate range from a DOM event: ".concat(n));var a,s=xf.toSlateNode(t,n.target),u=xf.findPath(t,s);if(e.Editor.isVoid(t,s)){var l=i.getBoundingClientRect(),c=t.isInline(s)?r-l.left<l.left+l.width-r:o-l.top<l.top+l.height-o,f=e.Editor.point(t,u,{edge:c?"start":"end"}),d=c?e.Editor.before(t,f):e.Editor.after(t,f);if(d)return e.Editor.range(t,d)}var h=this.getWindow(t).document;if(h.caretRangeFromPoint)a=h.caretRangeFromPoint(r,o);else{var p=h.caretPositionFromPoint(r,o);p&&((a=h.createRange()).setStart(p.offsetNode,p.offset),a.setEnd(p.offsetNode,p.offset))}if(!a)throw new Error("Cannot resolve a Slate range from a DOM event: ".concat(n));return xf.toSlateRange(t,a,{exactMatch:!1,suppressThrow:!1})},toSlateRange:function(t,n,r){var o,i,a,s,u,l=r.exactMatch,c=r.suppressThrow;if((Sc(n)?n.anchorNode:n.startContainer)&&(Sc(n)?(o=n.anchorNode,i=n.anchorOffset,a=n.focusNode,s=n.focusOffset,u=bf&&Tc()?n.anchorNode===n.focusNode&&n.anchorOffset===n.focusOffset:n.isCollapsed):(o=n.startContainer,i=n.startOffset,a=n.endContainer,s=n.endOffset,u=n.collapsed)),null==o||null==a||null==i||null==s)throw new Error("Cannot resolve a Slate range from DOM range: ".concat(n));var f=xf.toSlatePoint(t,[o,i],{exactMatch:l,suppressThrow:c});if(!f)return null;var d=u?f:xf.toSlatePoint(t,[a,s],{exactMatch:l,suppressThrow:c});if(!d)return null;var h={anchor:f,focus:d};return e.Range.isExpanded(h)&&e.Range.isForward(h)&&Ec(a)&&e.Editor.void(t,{at:h.focus,mode:"highest"})&&(h=e.Editor.unhangRange(t,h,{voids:!0})),h},toSlatePoint:function(t,e,n){var r,o=n.exactMatch,i=n.suppressThrow,s=ho(o?e:kc(e),2),u=s[0],l=s[1],c=u.parentNode,f=null,d=0;if(c){var h=c.closest('[data-slate-void="true"]'),p=c.closest("[data-slate-leaf]"),g=null,v=xf.getWindow(t);if(p&&v.document.createRange){f=p.closest('[data-slate-node="text"]');var m=v.document.createRange();m.setStart(f,0),m.setEnd(u,l);var y=m.cloneContents();po(po([],ho(a(y.querySelectorAll("[data-slate-zero-width]"))),!1),ho(a(y.querySelectorAll("[contenteditable=false]"))),!1).forEach((function(t){t.parentNode.removeChild(t)})),d=y.textContent.length,g=f}else h&&((p=h.querySelector("[data-slate-leaf]"))?(f=p.closest('[data-slate-node="text"]'),d=(g=p).textContent.length,g.querySelectorAll("[data-slate-zero-width]").forEach((function(t){d-=t.textContent.length}))):d=1);g&&d===g.textContent.length&&(c.hasAttribute("data-slate-zero-width")||gf&&(null===(r=g.textContent)||void 0===r?void 0:r.endsWith("\n")))&&(d-=1)}if(!f){if(i)return null;throw new Error("Cannot resolve a Slate point from DOM point: ".concat(e))}var b=xf.toSlateNode(t,f);return{path:xf.findPath(t,b),offset:d}},hasRange:function(t,n){var r=n.anchor,o=n.focus;return e.Editor.hasPath(t,r.path)&&e.Editor.hasPath(t,o.path)},getNodeType:function(t){return e.Element.isElement(t)?t.type:""},checkNodeType:function(t,e){return this.getNodeType(t)===e},getNodesStr:function(t){return t.map((function(t){return e.Node.string(t)})).join("")},getSelectedElems:function(t){var n,r,o=[],i=e.Editor.nodes(t,{universal:!0});try{for(var a=fo(i),s=a.next();!s.done;s=a.next()){var u=ho(s.value,1)[0];e.Element.isElement(u)&&o.push(u)}}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return o},getSelectedNodeByType:function(t,n){var r=this,o=ho(e.Editor.nodes(t,{match:function(t){return r.checkNodeType(t,n)},universal:!0}),1),i=o[0];return null==i?null:i[0]},getSelectedTextNode:function(t){var n=ho(e.Editor.nodes(t,{match:function(t){return e.Text.isText(t)},universal:!0}),1),r=n[0];return null==r?null:r[0]},isNodeSelected:function(t,n){var r=ho(e.Editor.nodes(t,{match:function(t){return t===n},universal:!0}),1),o=r[0];return null!=o&&ho(o,1)[0]===n},isSelectionAtLineEnd:function(t,n){var r=t.selection;return!!r&&(e.Editor.isEnd(t,r.anchor,n)||e.Editor.isEnd(t,r.focus,n))},getTextarea:function(t){var e=xa.get(t);if(null==e)throw new Error("Cannot find textarea instance by editor");return e},getToolbar:function(t){return Oa.get(t)||null},getHoverbar:function(t){return ka.get(t)||null},normalizeContent:function(t){t.children.forEach((function(e,n){t.normalizeNode([e,[n]])}))},getLeftLengthOfMaxLength:function(t){var e=t.getConfig(),n=e.maxLength,r=e.onMaxLength;if("number"!=typeof n||n<=0)return 1/0;var o=n-t.getText().replace(/\r|\n|(\r\n)|(\n\r)/g,"").length;return o<=0&&r&&r(t),o},cleanExposedTexNodeInSelectionBlock:function(t){var n,r,i,a,s=xf.getTextarea(t).$textArea,u=null==s?void 0:s[0].childNodes;if(u)try{for(var l=fo(Array.from(u)),c=l.next();!c.done;c=l.next()){var f=c.value;if(!Oc(f))break;f.remove()}}catch(t){n={error:t}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}var d=e.Editor.nodes(t,{match:function(n){return!(!e.Element.isElement(n)||t.isInline(n))},universal:!0});try{for(var h=fo(d),p=h.next();!p.done;p=h.next()){var g=p.value;if(null!=g){var v=g[0];Dc(xf.toDOMNode(t,v),(function(t,e){var n=o(e);n.attr("data-slate-string")||n.attr("data-slate-zero-width")||n.attr("data-w-e-reserve")||e.removeChild(t)}))}}}catch(t){i={error:t}}finally{try{p&&!p.done&&(a=h.return)&&a.call(h)}finally{if(i)throw i.error}}},isLastNode:function(t,e){var n=t.children||[];return n[n.length-1]===e},genEmptyParagraph:function(){return{type:"paragraph",children:[{text:""}]}},isSelectedVoidNode:function(t){var n,r,o=e.Editor.nodes(t,{match:function(e){return t.isVoid(e)}}),i=0;try{for(var a=fo(o),s=a.next();!s.done;s=a.next()){s.value&&(i+=1)}}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i>0},isSelectedEmptyParagraph:function(t){var n=t.selection;if(null==n)return!1;if(e.Range.isExpanded(n))return!1;var r=xf.getSelectedNodeByType(t,"paragraph");if(null===r)return!1;var o=r.children;return 1===o.length&&(""===o[0].text||void 0)},isEmptyPath:function(t,n){var r=e.Editor.node(t,n);if(null==r)return!1;var o=ho(r,1)[0].children;if(1===o.length&&""===o[0].text)return!0;return!1}};function Ef(t,n){return e.Element.isElement(t)?rf(t,n):function(t,e){var n=t.text;if(null==n)throw new Error("Current node is not slate Text ".concat(JSON.stringify(t)));var r=n;r=function(t){return t.replace(/ {2}/g," ").replace(/</g,"<").replace(/>/g,">").replace(/®/g,"®").replace(/©/g,"©").replace(/™/g,"™")}(r);var o=xf.getParentsNodes(e,t).some((function(t){return"pre"===xf.getNodeType(t)}));if(o||(r=r.replace(/\n\r|\r\n|\r|\n/g,"<br>")),o&&(r=r.replace(/ /g," ")),""===r){var i=xf.getParentNode(null,t);if(!i||0!==i.children.length)return r;r="<br>"}return tf.forEach((function(e){return r=e(t,r)})),r}(t,n)}var Sf=function(t,e){var n=(e.top+e.bottom)/2;return t.top<=n&&t.bottom>=n},Of=function(t,e,n){var r=xf.toDOMRange(t,e).getBoundingClientRect(),o=xf.toDOMRange(t,n).getBoundingClientRect();return Sf(r,o)&&Sf(o,r)};function Cf(t,n){t.isInline(n)?(t.insertNode(n),"link"===n.type&&t.insertFragment([{text:""}])):e.Transforms.insertNodes(t,n,{mode:"highest"})}var kf,Tf,Nf,Rf,Lf,Mf,Pf,Df,Af,jf,If,$f,Ff,_f,Bf,Hf,Wf,Uf,Vf,zf,Kf,qf,Gf,Jf,Yf,Xf,Qf,Zf,td,ed,nd,rd,od,id,ad,sd,ud,ld,cd,fd,dd=function(t){var n=t,r=n.onChange,i=n.insertText,a=n.apply,s=n.deleteBackward;return n.insertText=function(t){n.getConfig().readOnly||i(t)},n.apply=function(t){var r,o,i,s,u,l,c,f,d=[];switch(t.type){case"insert_text":case"remove_text":case"set_node":try{for(var h=fo(e.Editor.levels(n,{at:t.path})),p=h.next();!p.done;p=h.next()){var g=ho(p.value,2),v=g[0],m=g[1],y=xf.findKey(n,v);d.push([m,y])}}catch(t){r={error:t}}finally{try{p&&!p.done&&(o=h.return)&&o.call(h)}finally{if(r)throw r.error}}break;case"insert_node":case"remove_node":case"merge_node":case"split_node":try{for(var b=fo(e.Editor.levels(n,{at:e.Path.parent(t.path)})),w=b.next();!w.done;w=b.next()){var x=ho(w.value,2);v=x[0],m=x[1],y=xf.findKey(n,v);d.push([m,y])}}catch(t){i={error:t}}finally{try{w&&!w.done&&(s=b.return)&&s.call(b)}finally{if(i)throw i.error}}break;case"move_node":try{for(var E=fo(e.Editor.levels(n,{at:e.Path.common(e.Path.parent(t.path),e.Path.parent(t.newPath))})),S=E.next();!S.done;S=E.next()){var O=ho(S.value,2);v=O[0],m=O[1],y=xf.findKey(n,v);d.push([m,y])}}catch(t){u={error:t}}finally{try{S&&!S.done&&(l=E.return)&&l.call(E)}finally{if(u)throw u.error}}}a(t);try{for(var C=fo(d),k=C.next();!k.done;k=C.next()){var T=ho(k.value,2);m=T[0],y=T[1],v=ho(e.Editor.node(n,m),1)[0];Ba.set(v,y)}}catch(t){c={error:t}}finally{try{k&&!k.done&&(f=C.return)&&f.call(C)}finally{if(c)throw c.error}}},n.deleteBackward=function(r){if("line"!==r)return s(r);if(t.selection&&e.Range.isCollapsed(t.selection)){var o=e.Editor.above(t,{match:function(n){return e.Editor.isBlock(t,n)},at:t.selection});if(o){var i=ho(o,2)[1],a=e.Editor.range(t,i,t.selection.anchor),u=function(t,n){var r=e.Editor.range(t,e.Range.end(n)),o=Array.from(e.Editor.positions(t,{at:n})),i=0,a=o.length,s=Math.floor(a/2);if(Of(t,e.Editor.range(t,o[i]),r))return e.Editor.range(t,o[i],r);if(o.length<2)return e.Editor.range(t,o[o.length-1],r);for(;s!==o.length&&s!==i;)Of(t,e.Editor.range(t,o[s]),r)?a=s:i=s,s=Math.floor((i+a)/2);return e.Editor.range(t,o[a],r)}(n,a);e.Range.isCollapsed(u)||e.Transforms.delete(t,{at:u})}}},n.onChange=function(){var t=n.selection;null!=t&&Ua.set(n,t),n.emit("change"),r()},n.handleTab=function(){n.insertText(" ")},n.getHtml=function(){var t=n.children;return(void 0===t?[]:t).map((function(t){return Ef(t,n)})).join("")},n.getText=function(){var t=n.children;return(void 0===t?[]:t).map((function(t){return e.Node.string(t)})).join("\n")},n.getSelectionText=function(){var r=n.selection;return null==r?"":e.Editor.string(t,r)},n.getElemsByType=function(t,r){var o,i;void 0===r&&(r=!1);var a=[],s=e.Editor.nodes(n,{at:[],universal:!0});try{for(var u=fo(s),l=u.next();!l.done;l=u.next()){var c=ho(l.value,1)[0];if(e.Element.isElement(c))if(r?c.type.indexOf(t)>=0:c.type===t){var f=xf.findKey(n,c),d=Zc(c.type,f.id);a.push(co(co({},c),{id:d}))}}}catch(t){o={error:t}}finally{try{l&&!l.done&&(i=u.return)&&i.call(u)}finally{if(o)throw o.error}}return a},n.getElemsByTypePrefix=function(t){return n.getElemsByType(t,!0)},n.isEmpty=function(){var t=n.children,r=void 0===t?[]:t;if(r.length>1)return!1;var o=r[0];if(null==o)return!0;if(!e.Element.isElement(o)||"paragraph"!==o.type)return!1;var i=o.children,a=void 0===i?[]:i;if(a.length>1)return!1;var s=a[0];return null==s||e.Text.isText(s)&&""===s.text},n.clear=function(){e.Transforms.delete(n,{at:{anchor:e.Editor.start(n,[]),focus:e.Editor.end(n,[])}}),0===n.children.length&&e.Transforms.insertNodes(n,[{type:"paragraph",children:[{text:""}]}])},n.getParentNode=function(t){return xf.getParentNode(n,t)},n.dangerouslyInsertHtml=function(t,r){if(void 0===t&&(t=""),void 0===r&&(r=!1),t){var i=document.createElement("div");i.innerHTML=t;var a=Array.from(i.childNodes);if(a=a.filter((function(t){var e=t.nodeName;return!!Oc(t)||!!Ec(t)&&!tu.has(e.toLowerCase())})),0!==a.length){var s=n.selection;if(null!=s){var u=null;if(xf.isSelectedEmptyParagraph(n)&&!r)u=[s.focus.path[0]];i.setAttribute("hidden","true"),document.body.appendChild(i);var l=0;a.forEach((function(t,e){var r=t.nodeName,i=t.textContent,s=void 0===i?"":i;if(Oc(t)){if(!s||!s.trim())return;n.insertNode({text:s})}else if("BR"!==r){var u=t,c=!1;if(Wc.includes(r.toLowerCase()))c=!0;else for(var f in zc)if(u.matches(f)){c=!0;break}if(c){var d=Yc(o(u),n);return Array.isArray(d)?(d.forEach((function(t){return Cf(n,t)})),l+=1):(Cf(n,d),l+=1),void(xf.isSelectedVoidNode(n)&&n.move(1))}var h=window.getComputedStyle(u).display;if(!xf.isSelectedEmptyParagraph(n)&&h.indexOf("inline")<0){if(e>=1){var p=a[e-1];mc(p)&&n.insertBreak()}n.insertBreak()}n.dangerouslyInsertHtml(u.innerHTML,!0)}else n.insertText("\n")})),l&&u&&xf.isEmptyPath(n,u)&&e.Transforms.removeNodes(n,{at:u}),i.remove()}}}},n.setHtml=function(t){void 0===t&&(t="");var r=n.isDisabled(),o=n.isFocused(),i=JSON.stringify(n.selection);n.enable(),n.focus(),n.clear();var a=Qc(n,null==t?"":t);if(e.Transforms.insertFragment(n,a),o||(n.deselect(),n.blur()),r&&(n.deselect(),n.disable()),n.isFocused())try{n.select(JSON.parse(i))}catch(t){n.select(e.Editor.start(n,[]))}},n},hd=1,pd=function(t){var n=t;return n.id="wangEditor-".concat(hd++),n.isDestroyed=!1,n.isFullScreen=!1,n.focus=function(t){if(xf.toDOMNode(n,n).focus({preventScroll:!0}),Wa.set(n,!0),t){var r=e.Editor.end(n,[]);e.Transforms.select(n,r)}else{var o=Ua.get(n);o?e.Transforms.select(n,o):e.Transforms.select(n,e.Editor.start(n,[]))}},n.isFocused=function(){return!!Wa.get(n)},n.blur=function(){xf.toDOMNode(n,n).blur(),e.Transforms.deselect(n),Wa.set(n,!1)},n.updateView=function(){xf.getTextarea(n).changeViewState();var t=xf.getToolbar(n);t&&t.changeToolbarState();var e=xf.getHoverbar(n);e&&e.changeHoverbarState()},n.destroy=function(){if(!n.isDestroyed){var t=xf.getTextarea(n);t.destroy(),xa.delete(n),Ea.delete(t);var e=xf.getToolbar(n);e&&(e.destroy(),Oa.delete(n),Sa.delete(e));var r=xf.getHoverbar(n);r&&(r.destroy(),ka.delete(n),Ca.delete(r)),n.isDestroyed=!0,n.emit("destroyed")}},n.scrollToElem=function(t){if(!n.getConfig().scroll){var e="编辑器禁用了 scroll ,编辑器内容无法滚动,请自行实现该功能";return e+="\nYou has disabled editor scroll, please do this yourself",void console.warn(e)}var r=o("#".concat(t));if(0!==r.length){var i=r[0];if(!xf.hasDOMNode(n,i)){e="Element (found by id is '".concat(t,"') is not in editor DOM");return e+="\n 通过 id '".concat(t,"' 找到的 element 不在 editor DOM 之内"),void console.error(e,i)}var a=xf.getTextarea(n),s=a.$textAreaContainer,u=a.$scroll,l=r.offset().top,c=s.offset().top;u[0].scrollBy({top:l-c,behavior:"smooth"})}},n.showProgressBar=function(t){t<1||xf.getTextarea(n).changeProgress(t)},n.hidePanelOrModal=function(){var t=Na.get(n);null!=t&&t.forEach((function(t){return t.hide()}))},n.enable=function(){n.getConfig().readOnly=!1,n.updateView()},n.disable=function(){n.getConfig().readOnly=!0,n.updateView()},n.isDisabled=function(){return n.getConfig().readOnly},n.toDOMNode=function(t){return xf.toDOMNode(n,t)},n.fullScreen=function(){if(!n.isFullScreen){var t=null,e=xf.getToolbar(n);e&&(t=e.$box);var r=xf.getTextarea(n).$box.parent();if(t&&t.parent()[0]!==r[0]){throw new Error("Can not set full screen, cause toolbar DOM parent is not equal to textarea DOM parent\n不能设置全屏,因为 toolbar DOM 父节点和 textarea DOM 父节点不一致")}r.addClass("w-e-full-screen-container");var o=r.css("z-index");r.attr("data-z-index",o.toString()),n.isFullScreen=!0,n.emit("fullScreen")}},n.unFullScreen=function(){if(n.isFullScreen){var t=xf.getTextarea(n).$box.parent();setTimeout((function(){t.removeClass("w-e-full-screen-container"),n.isFullScreen=!1,n.emit("unFullScreen")}),200)}},n.getEditableContainer=function(){return xf.getTextarea(n).$textAreaContainer[0]},n},gd={exports:{}},vd={exports:{}};function md(){if(Tf)return kf;Tf=1;return kf=function(t){return null!=t}}function yd(){if(Mf)return Lf;Mf=1;var t=function(){if(Rf)return Nf;Rf=1;var t=md(),e={object:!0,function:!0,undefined:!0};return Nf=function(n){return!!t(n)&&hasOwnProperty.call(e,typeof n)}}();return Lf=function(e){if(!t(e))return!1;try{return!!e.constructor&&e.constructor.prototype===e}catch(t){return!1}}}function bd(){if(jf)return Af;jf=1;var t=function(){if(Df)return Pf;Df=1;var t=yd();return Pf=function(e){if("function"!=typeof e)return!1;if(!hasOwnProperty.call(e,"length"))return!1;try{if("number"!=typeof e.length)return!1;if("function"!=typeof e.call)return!1;if("function"!=typeof e.apply)return!1}catch(t){return!1}return!t(e)}}(),e=/^\s*class[\s{/}]/,n=Function.prototype.toString;return Af=function(r){return!!t(r)&&!e.test(n.call(r))}}function wd(){if(Uf)return Wf;Uf=1;var t=(Hf?Bf:(Hf=1,Bf=function(){}))();return Wf=function(e){return e!==t&&null!==e}}function xd(){return qf||(qf=1,Kf=(_f?Ff:(_f=1,Ff=function(){try{return Object.keys("primitive"),!0}catch(t){return!1}}))()?Object.keys:function(){if(zf)return Vf;zf=1;var t=wd(),e=Object.keys;return Vf=function(n){return e(t(n)?Object(n):n)}}()),Kf}function Ed(){if(Xf)return Yf;Xf=1;var t=xd(),e=function(){if(Jf)return Gf;Jf=1;var t=wd();return Gf=function(e){if(!t(e))throw new TypeError("Cannot use null or undefined");return e}}(),n=Math.max;return Yf=function(r,o){var i,a,s,u=n(arguments.length,2);for(r=Object(e(r)),s=function(t){try{r[t]=o[t]}catch(t){i||(i=t)}},a=1;a<u;++a)t(o=arguments[a]).forEach(s);if(void 0!==i)throw i;return r},Yf}function Sd(){return Zf?Qf:(Zf=1,Qf=($f||($f=1,If=function(){var t,e=Object.assign;return"function"==typeof e&&(e(t={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),t.foo+t.bar+t.trzy==="razdwatrzy")}),If)()?Object.assign:Ed())}function Od(){return sd||(sd=1,ad=function(){if(rd)return nd;rd=1;var t="razdwatrzy";return nd=function(){return"function"==typeof t.contains&&!0===t.contains("dwa")&&!1===t.contains("foo")}}()()?String.prototype.contains:function(){if(id)return od;id=1;var t=String.prototype.indexOf;return od=function(e){return t.call(this,e,arguments[1])>-1},od}()),ad}function Cd(){if(ud)return vd.exports;ud=1;var t=md(),e=bd(),n=Sd(),r=function(){if(ed)return td;ed=1;var t=wd(),e=Array.prototype.forEach,n=Object.create;return td=function(r){var o=n(null);return e.call(arguments,(function(e){t(e)&&function(t,e){var n;for(n in t)e[n]=t[n]}(Object(e),o)})),o},td}(),o=Od(),i=vd.exports=function(e,i){var a,s,u,l,c;return arguments.length<2||"string"!=typeof e?(l=i,i=e,e=null):l=arguments[2],t(e)?(a=o.call(e,"c"),s=o.call(e,"e"),u=o.call(e,"w")):(a=u=!0,s=!1),c={value:i,configurable:a,enumerable:s,writable:u},l?n(r(l),c):c};return i.gs=function(i,a,s){var u,l,c,f;return"string"!=typeof i?(c=s,s=a,a=i,i=null):c=arguments[3],t(a)?e(a)?t(s)?e(s)||(c=s,s=void 0):s=void 0:(c=a,a=s=void 0):a=void 0,t(i)?(u=o.call(i,"c"),l=o.call(i,"e")):(u=!0,l=!1),f={get:a,set:s,configurable:u,enumerable:l},c?n(r(c),f):f},vd.exports}var kd=(fd||(fd=1,function(t,e){var n,r,o,i,a,s,u,l=Cd(),c=cd?ld:(cd=1,ld=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");return t}),f=Function.prototype.apply,d=Function.prototype.call,h=Object.create,p=Object.defineProperty,g=Object.defineProperties,v=Object.prototype.hasOwnProperty,m={configurable:!0,enumerable:!1,writable:!0};r=function(t,e){var r,i;return c(e),i=this,n.call(this,t,r=function(){o.call(i,t,r),f.call(e,this,arguments)}),r.__eeOnceListener__=e,this},i=function(t){var e,n,r,o,i;if(v.call(this,"__ee__")&&(o=this.__ee__[t]))if("object"==typeof o){for(n=arguments.length,i=new Array(n-1),e=1;e<n;++e)i[e-1]=arguments[e];for(o=o.slice(),e=0;r=o[e];++e)f.call(r,this,i)}else switch(arguments.length){case 1:d.call(o,this);break;case 2:d.call(o,this,arguments[1]);break;case 3:d.call(o,this,arguments[1],arguments[2]);break;default:for(n=arguments.length,i=new Array(n-1),e=1;e<n;++e)i[e-1]=arguments[e];f.call(o,this,i)}},a={on:n=function(t,e){var n;return c(e),v.call(this,"__ee__")?n=this.__ee__:(n=m.value=h(null),p(this,"__ee__",m),m.value=null),n[t]?"object"==typeof n[t]?n[t].push(e):n[t]=[n[t],e]:n[t]=e,this},once:r,off:o=function(t,e){var n,r,o,i;if(c(e),!v.call(this,"__ee__"))return this;if(!(n=this.__ee__)[t])return this;if("object"==typeof(r=n[t]))for(i=0;o=r[i];++i)o!==e&&o.__eeOnceListener__!==e||(2===r.length?n[t]=r[i?0:1]:r.splice(i,1));else r!==e&&r.__eeOnceListener__!==e||delete n[t];return this},emit:i},s={on:l(n),once:l(r),off:l(o),emit:l(i)},u=g({},s),t.exports=e=function(t){return null==t?h(u):g(Object(t),s)},e.methods=a}(gd,gd.exports)),gd.exports),Td=g(kd);function Nd(t){var e=Va.get(t);return null==e&&(e=Td(),Va.set(t,e)),e}var Rd=new WeakMap;function Ld(t,e){var n=Rd.get(t);null==n&&(n=new Set,Rd.set(t,n)),n.add(e)}var Md,Pd=function(t){var e=t;return e.on=function(t,n){var r=Nd(e);if(r.on(t,n),"destroyed"===t&&Ld(e,n),"destroyed"!==t){var o=function(){return r.off(t,n)};r.on("destroyed",o),Ld(e,o)}},e.once=function(t,n){Nd(e).once(t,n)},e.off=function(t,n){Nd(e).off(t,n)},e.emit=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=Nd(e);if(o.emit.apply(o,po([t],ho(n),!1)),"destroyed"===t){var i=function(t){return Rd.get(t)||new Set}(e);i.forEach((function(t){return o.off("destroyed",t)})),function(t){Rd.set(t,new Set)}(e)}},e},Dd=function(t){var n=t;return n.setFragmentData=function(t){var r=n.selection;if(r){var o=ho(e.Range.edges(r),2),i=o[0],a=o[1],s=e.Editor.void(n,{at:i.path}),u=e.Editor.void(n,{at:a.path});if(!e.Range.isCollapsed(r)||s){var l=xf.toDOMRange(n,r),c=l.cloneContents(),f=c.childNodes[0];if(c.childNodes.forEach((function(t){t.textContent&&""!==t.textContent.trim()&&(f=t)})),u){var d=ho(u,1)[0],h=l.cloneRange(),p=xf.toDOMNode(n,d);h.setEndAfter(p),c=h.cloneContents()}if(s&&(f=c.querySelector("[data-slate-spacer]")),Array.from(c.querySelectorAll("[data-slate-zero-width]")).forEach((function(t){var e="n"===t.getAttribute("data-slate-zero-width");t.textContent=e?"\n":""})),Oc(f)){var g=f.ownerDocument.createElement("span");g.style.whiteSpace="pre",g.appendChild(f),c.appendChild(g),f=g}var v=n.getFragment(),m=JSON.stringify(v),y=window.btoa(encodeURIComponent(m));f.setAttribute("data-slate-fragment",y),t.setData("application/x-slate-fragment",y);var b=c.ownerDocument.createElement("div");return b.appendChild(c),b.setAttribute("hidden","true"),c.ownerDocument.body.appendChild(b),t.setData("text/html",b.innerHTML),t.setData("text/plain",Mc(b)),c.ownerDocument.body.removeChild(b),t}}},n.insertData=function(t){var r,o,i=t.getData("application/x-slate-fragment");if(i){var a=decodeURIComponent(window.atob(i)),s=JSON.parse(a);n.insertFragment(s)}else{var u=t.getData("text/plain"),l=t.getData("text/html");if(l)n.dangerouslyInsertHtml(l);else if(u){var c=u.split(/\n\r|\r\n|\r|\n/),f=!1;try{for(var d=fo(c),h=d.next();!h.done;h=d.next()){var p=h.value,g=xf.getLeftLengthOfMaxLength(n);f&&g>0&&e.Transforms.splitNodes(n,{always:!0}),n.insertText(p),f=!0}}catch(t){r={error:t}}finally{try{h&&!h.done&&(o=d.return)&&o.call(d)}finally{if(r)throw r.error}}}}},n},Ad={};!function(){if(Md)return Ad;Md=1;var t=pr(),e=gr(),n=wr(),r=Lt(),o=Nn(),i=Ln(),a=Nt(),s=mr(),u=we(),l=Sr(),c=oa(),f=l("slice"),d=u("species"),h=Array,p=Math.max;t({target:"Array",proto:!0,forced:!f},{slice:function(t,u){var l,f,g,v=a(this),m=i(v),y=o(t,m),b=o(void 0===u?m:u,m);if(e(v)&&(l=v.constructor,(n(l)&&(l===h||e(l.prototype))||r(l)&&null===(l=l[d]))&&(l=void 0),l===h||void 0===l))return c(v,y,b);for(f=new(void 0===l?h:l)(p(b-y,0)),g=0;y<b;y++,g++)y in v&&s(f,g,v[y]);return f.length=g,f}})}();var jd=function(t){var n=t,r=n.insertText,o=n.insertNode,i=n.insertFragment,a=n.dangerouslyInsertHtml;return n.insertText=function(t){if(n.getConfig().maxLength){var e=xf.getLeftLengthOfMaxLength(n);e<=0||(e<t.length?r(t.slice(0,e)):r(t))}else r(t)},n.insertNode=function(t){if(n.getConfig().maxLength){var r=xf.getLeftLengthOfMaxLength(n);if(!(r<=0))r<e.Node.string(t).length||o(t)}else o(t)},n.insertFragment=function(t){if(n.getConfig().maxLength){if(t.length>0){var r=t[0];if(xf.getLeftLengthOfMaxLength(n)<e.Node.string(r).length)return;i([r]);for(var o=1;o<t.length;o+=1)n.insertNode(t[o])}}else i(t)},n.dangerouslyInsertHtml=function(t,e){if(void 0===t&&(t=""),void 0===e&&(e=!1),t)if(n.getConfig().maxLength){var r=xf.getLeftLengthOfMaxLength(n);if(!(r<=0)){var o=document.createElement("div");o.innerHTML=t,r<Array.from(o.childNodes).reduce((function(t,e){var n=e.nodeName;return e?Oc(e)?t+(e.textContent||""):Ec(e)?tu.has(n.toLowerCase())?t:t+(e.textContent||""):t:t}),"").length||a(t,e)}}else a(t,e)},n};function Id(t){var e=xf.getTextarea(t).$textAreaContainer,n=e.width(),r=e.height(),o=e.offset();return{top:o.top,left:o.left,width:n,height:r}}function $d(t){var e={top:"0",left:"0"},n=t.selection;if(null==n)return e;var r=Id(t);if(null==r)return e;var o=r.top,i=r.left,a=r.width,s=r.height,u=xf.toDOMRange(t,n).getClientRects(),l=u?u[0]:null;if(null==l)return e;var c={},f=l.top-o,d=l.left-i;if(d>a/2){var h=a-d;c.right="".concat(h+5,"px")}else c.left="".concat(d+5,"px");if(f>s/2){var p=s-f;c.bottom="".concat(p+5,"px")}else{var g=u[u.length-1],v=g.top-o+g.height;v<0&&(v=0),c.top="".concat(v+5,"px")}return c}function Fd(t,n,r){void 0===r&&(r="modal");var o={top:"0",left:"0"};if(null==t.selection)return o;var i=e.Element.isElement(n)&&t.isVoid(n),a=e.Element.isElement(n)&&t.isInline(n),s=_a.get(n);if(null==s)return o;var u=s.getBoundingClientRect(),l=u.top,c=u.left,f=u.height,d=u.width;if(i){var h=Pc(s);if(null!=h){var p=h.getBoundingClientRect();l=p.top,f=p.height}}var g=Id(t);if(null==g)return o;var v=g.top,m=g.left,y=g.width,b=g.height,w={},x=l-v,E=c-m;if("bar"===r)return w.left="".concat(E,"px"),x>40?w.bottom="".concat(b-x+5,"px"):w.top="".concat(x+f+5,"px"),w;if("modal"===r){if(i?a?E>(y-d)/2?w.right="".concat(y-E+5,"px"):w.left="".concat(E+d+5,"px"):w.left="20px":w.left="".concat(E,"px"),i)(S=x)<0&&(S=0),w.top="".concat(S,"px");else if(x>(b-f)/2)w.bottom="".concat(b-x+5,"px");else{var S;(S=x+f)<0&&(S=0),w.top="".concat(S+5,"px")}return w}throw new Error("type '".concat(r,"' is invalid"))}function _d(t,e){rc((function(){var n=Id(t);if(null!=n){var r,o=n.top,i=n.left,a=n.width,s=n.height,u=e.offset(),l=u.top,c=u.left,f=e.width(),d=e.height(),h=l-o,p=c-i,g=e.attr("style");if(g.indexOf("top")>=0)if((r=h+d-s)>0){var v=e.css("top"),m=parseInt(v.toString(),10)-r;m<0&&(m=0),e.css("top","".concat(m,"px"))}if(g.indexOf("bottom")>=0&&l<0){var y=e.css("bottom"),b=parseInt(y.toString(),10)-Math.abs(l);e.css("bottom","".concat(b,"px"))}if(g.indexOf("left")>=0)if((r=p+f-a)>0){var w=e.css("left"),x=parseInt(w.toString(),10)-r;x<0&&(x=0),e.css("left","".concat(x,"px"))}if(g.indexOf("right")>=0&&c<0){var E=e.css("right"),S=parseInt(E.toString(),10)-Math.abs(c);e.css("right","".concat(S,"px"))}}}))}var Bd,Hd=function(t){var n=t;return n.select=function(t){e.Transforms.select(n,t)},n.deselect=function(){var r=n.selection,o=xf.findDocumentOrShadowRoot(n).getSelection();o&&o.rangeCount>0&&o.removeAllRanges(),r&&e.Transforms.deselect(t)},n.move=function(n,r){void 0===r&&(r=!1),n&&(n<0||e.Transforms.move(t,{distance:n,unit:"character",reverse:r}))},n.moveReverse=function(t){n.move(t,!0)},n.restoreSelection=function(){var t=Ua.get(n);null!=t&&(n.focus(),e.Transforms.select(n,t))},n.getSelectionPosition=function(){return $d(n)},n.getNodePosition=function(t){return Fd(n,t)},n.isSelectedAll=function(){var t=n.selection;if(null==t)return!1;var r=ho(e.Range.edges(t),2),o=r[0],i=r[1],a=ho(e.Editor.edges(n,[]),2),s=a[0],u=a[1];return!(!e.Point.equals(o,s)||!e.Point.equals(i,u))},n.selectAll=function(){var t=e.Editor.start(n,[]),r=e.Editor.end(n,[]);e.Transforms.select(n,{anchor:t,focus:r})},n},Wd={};!function(){if(Bd)return Wd;Bd=1;var t=P(),e=wu(),n=je(),r=kt(),o=Rn(),i=mi(),a=Tt(),s=Bt(),u=Su(),l=Ou();e("match",(function(e,c,f){return[function(n){var o=a(this),u=r(n)?void 0:s(n,e);return u?t(u,n,o):new RegExp(n)[e](i(o))},function(t){var e=n(this),r=i(t),a=f(c,e,r);if(a.done)return a.value;if(!e.global)return l(e,r);var s=e.unicode;e.lastIndex=0;for(var d,h=[],p=0;null!==(d=l(e,r));){var g=i(d[0]);h[p]=g,""===g&&(e.lastIndex=u(r,o(e.lastIndex),s)),p++}return 0===p?null:h}]}))}();const Ud={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){console&&console[t]&&console[t].apply(console,e)}};class Vd{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.init(t,e)}init(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=e.prefix||"i18next:",this.logger=t||Ud,this.options=e,this.debug=e.debug}log(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.forward(e,"log","",!0)}warn(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.forward(e,"warn","",!0)}error(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.forward(e,"error","")}deprecate(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(t,e,n,r){return r&&!this.debug?null:("string"==typeof t[0]&&(t[0]=`${n}${this.prefix} ${t[0]}`),this.logger[e](t))}create(t){return new Vd(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return(t=t||this.options).prefix=t.prefix||this.prefix,new Vd(this.logger,t)}}var zd=new Vd;class Kd{constructor(){this.observers={}}on(t,e){return t.split(" ").forEach((t=>{this.observers[t]||(this.observers[t]=new Map);const n=this.observers[t].get(e)||0;this.observers[t].set(e,n+1)})),this}off(t,e){this.observers[t]&&(e?this.observers[t].delete(e):delete this.observers[t])}emit(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];if(this.observers[t]){Array.from(this.observers[t].entries()).forEach((t=>{let[e,r]=t;for(let t=0;t<r;t++)e(...n)}))}if(this.observers["*"]){Array.from(this.observers["*"].entries()).forEach((e=>{let[r,o]=e;for(let e=0;e<o;e++)r.apply(r,[t,...n])}))}}}const qd=()=>{let t,e;const n=new Promise(((n,r)=>{t=n,e=r}));return n.resolve=t,n.reject=e,n},Gd=t=>null==t?"":""+t,Jd=/###/g,Yd=t=>t&&t.indexOf("###")>-1?t.replace(Jd,"."):t,Xd=t=>!t||"string"==typeof t,Qd=(t,e,n)=>{const r="string"!=typeof e?e:e.split(".");let o=0;for(;o<r.length-1;){if(Xd(t))return{};const e=Yd(r[o]);!t[e]&&n&&(t[e]=new n),t=Object.prototype.hasOwnProperty.call(t,e)?t[e]:{},++o}return Xd(t)?{}:{obj:t,k:Yd(r[o])}},Zd=(t,e,n)=>{const{obj:r,k:o}=Qd(t,e,Object);if(void 0!==r||1===e.length)return void(r[o]=n);let i=e[e.length-1],a=e.slice(0,e.length-1),s=Qd(t,a,Object);for(;void 0===s.obj&&a.length;)i=`${a[a.length-1]}.${i}`,a=a.slice(0,a.length-1),s=Qd(t,a,Object),s&&s.obj&&void 0!==s.obj[`${s.k}.${i}`]&&(s.obj=void 0);s.obj[`${s.k}.${i}`]=n},th=(t,e)=>{const{obj:n,k:r}=Qd(t,e);if(n)return n[r]},eh=(t,e,n)=>{for(const r in e)"__proto__"!==r&&"constructor"!==r&&(r in t?"string"==typeof t[r]||t[r]instanceof String||"string"==typeof e[r]||e[r]instanceof String?n&&(t[r]=e[r]):eh(t[r],e[r],n):t[r]=e[r]);return t},nh=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var rh={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const oh=t=>"string"==typeof t?t.replace(/[&<>"'\/]/g,(t=>rh[t])):t;const ih=[" ",",","?","!",";"],ah=new class{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const e=this.regExpMap.get(t);if(void 0!==e)return e;const n=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,n),this.regExpQueue.push(t),n}}(20),sh=function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(!t)return;if(t[e])return t[e];const r=e.split(n);let o=t;for(let t=0;t<r.length;){if(!o||"object"!=typeof o)return;let e,i="";for(let a=t;a<r.length;++a)if(a!==t&&(i+=n),i+=r[a],e=o[i],void 0!==e){if(["string","number","boolean"].indexOf(typeof e)>-1&&a<r.length-1)continue;t+=a-t+1;break}o=e}return o},uh=t=>t&&t.indexOf("_")>0?t.replace("_","-"):t;class lh extends Kd{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=e,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const e=this.options.ns.indexOf(t);e>-1&&this.options.ns.splice(e,1)}getResource(t,e,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,i=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;t.indexOf(".")>-1?a=t.split("."):(a=[t,e],n&&(Array.isArray(n)?a.push(...n):"string"==typeof n&&o?a.push(...n.split(o)):a.push(n)));const s=th(this.data,a);return!s&&!e&&!n&&t.indexOf(".")>-1&&(t=a[0],e=a[1],n=a.slice(2).join(".")),s||!i||"string"!=typeof n?s:sh(this.data&&this.data[t]&&this.data[t][e],n,o)}addResource(t,e,n,r){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1};const i=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator;let a=[t,e];n&&(a=a.concat(i?n.split(i):n)),t.indexOf(".")>-1&&(a=t.split("."),r=e,e=a[1]),this.addNamespaces(e),Zd(this.data,a,r),o.silent||this.emit("added",t,e,n,r)}addResources(t,e,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(const r in n)("string"==typeof n[r]||Array.isArray(n[r]))&&this.addResource(t,e,r,n[r],{silent:!0});r.silent||this.emit("added",t,e,n)}addResourceBundle(t,e,n,r,o){let i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1,skipCopy:!1},a=[t,e];t.indexOf(".")>-1&&(a=t.split("."),r=n,n=e,e=a[1]),this.addNamespaces(e);let s=th(this.data,a)||{};i.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?eh(s,n,o):s={...s,...n},Zd(this.data,a,s),i.silent||this.emit("added",t,e,n)}removeResourceBundle(t,e){this.hasResourceBundle(t,e)&&delete this.data[t][e],this.removeNamespaces(e),this.emit("removed",t,e)}hasResourceBundle(t,e){return void 0!==this.getResource(t,e)}getResourceBundle(t,e){return e||(e=this.options.defaultNS),"v1"===this.options.compatibilityAPI?{...this.getResource(t,e)}:this.getResource(t,e)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const e=this.getDataByLanguage(t);return!!(e&&Object.keys(e)||[]).find((t=>e[t]&&Object.keys(e[t]).length>0))}toJSON(){return this.data}}var ch={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,n,r,o){return t.forEach((t=>{this.processors[t]&&(e=this.processors[t].process(e,n,r,o))})),e}};const fh={};class dh extends Kd{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),((t,e,n)=>{t.forEach((t=>{e[t]&&(n[t]=e[t])}))})(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=e,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=zd.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==t)return!1;const n=this.resolve(t,e);return n&&void 0!==n.res}extractFromKey(t,e){let n=void 0!==e.nsSeparator?e.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");const r=void 0!==e.keySeparator?e.keySeparator:this.options.keySeparator;let o=e.ns||this.options.defaultNS||[];const i=n&&t.indexOf(n)>-1,a=!(this.options.userDefinedKeySeparator||e.keySeparator||this.options.userDefinedNsSeparator||e.nsSeparator||((t,e,n)=>{e=e||"",n=n||"";const r=ih.filter((t=>e.indexOf(t)<0&&n.indexOf(t)<0));if(0===r.length)return!0;const o=ah.getRegExp(`(${r.map((t=>"?"===t?"\\?":t)).join("|")})`);let i=!o.test(t);if(!i){const e=t.indexOf(n);e>0&&!o.test(t.substring(0,e))&&(i=!0)}return i})(t,n,r));if(i&&!a){const e=t.match(this.interpolator.nestingRegexp);if(e&&e.length>0)return{key:t,namespaces:o};const i=t.split(n);(n!==r||n===r&&this.options.ns.indexOf(i[0])>-1)&&(o=i.shift()),t=i.join(r)}return"string"==typeof o&&(o=[o]),{key:t,namespaces:o}}translate(t,e,n){if("object"!=typeof e&&this.options.overloadTranslationOptionHandler&&(e=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof e&&(e={...e}),e||(e={}),null==t)return"";Array.isArray(t)||(t=[String(t)]);const r=void 0!==e.returnDetails?e.returnDetails:this.options.returnDetails,o=void 0!==e.keySeparator?e.keySeparator:this.options.keySeparator,{key:i,namespaces:a}=this.extractFromKey(t[t.length-1],e),s=a[a.length-1],u=e.lng||this.language,l=e.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&"cimode"===u.toLowerCase()){if(l){const t=e.nsSeparator||this.options.nsSeparator;return r?{res:`${s}${t}${i}`,usedKey:i,exactUsedKey:i,usedLng:u,usedNS:s,usedParams:this.getUsedParamsDetails(e)}:`${s}${t}${i}`}return r?{res:i,usedKey:i,exactUsedKey:i,usedLng:u,usedNS:s,usedParams:this.getUsedParamsDetails(e)}:i}const c=this.resolve(t,e);let f=c&&c.res;const d=c&&c.usedKey||i,h=c&&c.exactUsedKey||i,p=Object.prototype.toString.apply(f),g=void 0!==e.joinArrays?e.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject;if(v&&f&&("string"!=typeof f&&"boolean"!=typeof f&&"number"!=typeof f)&&["[object Number]","[object Function]","[object RegExp]"].indexOf(p)<0&&("string"!=typeof g||!Array.isArray(f))){if(!e.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const t=this.options.returnedObjectHandler?this.options.returnedObjectHandler(d,f,{...e,ns:a}):`key '${i} (${this.language})' returned an object instead of string.`;return r?(c.res=t,c.usedParams=this.getUsedParamsDetails(e),c):t}if(o){const t=Array.isArray(f),n=t?[]:{},r=t?h:d;for(const t in f)if(Object.prototype.hasOwnProperty.call(f,t)){const i=`${r}${o}${t}`;n[t]=this.translate(i,{...e,joinArrays:!1,ns:a}),n[t]===i&&(n[t]=f[t])}f=n}}else if(v&&"string"==typeof g&&Array.isArray(f))f=f.join(g),f&&(f=this.extendTranslation(f,t,e,n));else{let r=!1,a=!1;const l=void 0!==e.count&&"string"!=typeof e.count,d=dh.hasDefaultValue(e),h=l?this.pluralResolver.getSuffix(u,e.count,e):"",p=e.ordinal&&l?this.pluralResolver.getSuffix(u,e.count,{ordinal:!1}):"",g=l&&!e.ordinal&&0===e.count&&this.pluralResolver.shouldUseIntlApi(),v=g&&e[`defaultValue${this.options.pluralSeparator}zero`]||e[`defaultValue${h}`]||e[`defaultValue${p}`]||e.defaultValue;!this.isValidLookup(f)&&d&&(r=!0,f=v),this.isValidLookup(f)||(a=!0,f=i);const m=(e.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&a?void 0:f,y=d&&v!==f&&this.options.updateMissing;if(a||r||y){if(this.logger.log(y?"updateKey":"missingKey",u,s,i,y?v:f),o){const t=this.resolve(i,{...e,keySeparator:!1});t&&t.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let t=[];const n=this.languageUtils.getFallbackCodes(this.options.fallbackLng,e.lng||this.language);if("fallback"===this.options.saveMissingTo&&n&&n[0])for(let e=0;e<n.length;e++)t.push(n[e]);else"all"===this.options.saveMissingTo?t=this.languageUtils.toResolveHierarchy(e.lng||this.language):t.push(e.lng||this.language);const r=(t,n,r)=>{const o=d&&r!==f?r:m;this.options.missingKeyHandler?this.options.missingKeyHandler(t,s,n,o,y,e):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(t,s,n,o,y,e),this.emit("missingKey",t,s,n,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&l?t.forEach((t=>{const n=this.pluralResolver.getSuffixes(t,e);g&&e[`defaultValue${this.options.pluralSeparator}zero`]&&n.indexOf(`${this.options.pluralSeparator}zero`)<0&&n.push(`${this.options.pluralSeparator}zero`),n.forEach((n=>{r([t],i+n,e[`defaultValue${n}`]||v)}))})):r(t,i,v))}f=this.extendTranslation(f,t,e,c,n),a&&f===i&&this.options.appendNamespaceToMissingKey&&(f=`${s}:${i}`),(a||r)&&this.options.parseMissingKeyHandler&&(f="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${s}:${i}`:i,r?f:void 0):this.options.parseMissingKeyHandler(f))}return r?(c.res=f,c.usedParams=this.getUsedParamsDetails(e),c):f}extendTranslation(t,e,n,r,o){var i=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const a="string"==typeof t&&(n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let s;if(a){const e=t.match(this.interpolator.nestingRegexp);s=e&&e.length}let u=n.replace&&"string"!=typeof n.replace?n.replace:n;if(this.options.interpolation.defaultVariables&&(u={...this.options.interpolation.defaultVariables,...u}),t=this.interpolator.interpolate(t,u,n.lng||this.language||r.usedLng,n),a){const e=t.match(this.interpolator.nestingRegexp);s<(e&&e.length)&&(n.nest=!1)}!n.lng&&"v1"!==this.options.compatibilityAPI&&r&&r.res&&(n.lng=this.language||r.usedLng),!1!==n.nest&&(t=this.interpolator.nest(t,(function(){for(var t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];return o&&o[0]===r[0]&&!n.context?(i.logger.warn(`It seems you are nesting recursively key: ${r[0]} in key: ${e[0]}`),null):i.translate(...r,e)}),n)),n.interpolation&&this.interpolator.reset()}const a=n.postProcess||this.options.postProcess,s="string"==typeof a?[a]:a;return null!=t&&s&&s.length&&!1!==n.applyPostProcessor&&(t=ch.handle(s,t,e,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),t}resolve(t){let e,n,r,o,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof t&&(t=[t]),t.forEach((t=>{if(this.isValidLookup(e))return;const s=this.extractFromKey(t,a),u=s.key;n=u;let l=s.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));const c=void 0!==a.count&&"string"!=typeof a.count,f=c&&!a.ordinal&&0===a.count&&this.pluralResolver.shouldUseIntlApi(),d=void 0!==a.context&&("string"==typeof a.context||"number"==typeof a.context)&&""!==a.context,h=a.lngs?a.lngs:this.languageUtils.toResolveHierarchy(a.lng||this.language,a.fallbackLng);l.forEach((t=>{this.isValidLookup(e)||(i=t,!fh[`${h[0]}-${t}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(i)&&(fh[`${h[0]}-${t}`]=!0,this.logger.warn(`key "${n}" for languages "${h.join(", ")}" won't get resolved as namespace "${i}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),h.forEach((n=>{if(this.isValidLookup(e))return;o=n;const i=[u];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(i,u,n,t,a);else{let t;c&&(t=this.pluralResolver.getSuffix(n,a.count,a));const e=`${this.options.pluralSeparator}zero`,r=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(c&&(i.push(u+t),a.ordinal&&0===t.indexOf(r)&&i.push(u+t.replace(r,this.options.pluralSeparator)),f&&i.push(u+e)),d){const n=`${u}${this.options.contextSeparator}${a.context}`;i.push(n),c&&(i.push(n+t),a.ordinal&&0===t.indexOf(r)&&i.push(n+t.replace(r,this.options.pluralSeparator)),f&&i.push(n+e))}}let s;for(;s=i.pop();)this.isValidLookup(e)||(r=s,e=this.getResource(n,t,s,a))})))}))})),{res:e,usedKey:n,exactUsedKey:r,usedLng:o,usedNS:i}}isValidLookup(t){return!(void 0===t||!this.options.returnNull&&null===t||!this.options.returnEmptyString&&""===t)}getResource(t,e,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,e,n,r):this.resourceStore.getResource(t,e,n,r)}getUsedParamsDetails(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=t.replace&&"string"!=typeof t.replace;let r=n?t.replace:t;if(n&&void 0!==t.count&&(r.count=t.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(const t of e)delete r[t]}return r}static hasDefaultValue(t){const e="defaultValue";for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e===n.substring(0,12)&&void 0!==t[n])return!0;return!1}}const hh=t=>t.charAt(0).toUpperCase()+t.slice(1);class ph{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=zd.create("languageUtils")}getScriptPartFromCode(t){if(!(t=uh(t))||t.indexOf("-")<0)return null;const e=t.split("-");return 2===e.length?null:(e.pop(),"x"===e[e.length-1].toLowerCase()?null:this.formatLanguageCode(e.join("-")))}getLanguagePartFromCode(t){if(!(t=uh(t))||t.indexOf("-")<0)return t;const e=t.split("-");return this.formatLanguageCode(e[0])}formatLanguageCode(t){if("string"==typeof t&&t.indexOf("-")>-1){const e=["hans","hant","latn","cyrl","cans","mong","arab"];let n=t.split("-");return this.options.lowerCaseLng?n=n.map((t=>t.toLowerCase())):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),e.indexOf(n[1].toLowerCase())>-1&&(n[1]=hh(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),e.indexOf(n[1].toLowerCase())>-1&&(n[1]=hh(n[1].toLowerCase())),e.indexOf(n[2].toLowerCase())>-1&&(n[2]=hh(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let e;return t.forEach((t=>{if(e)return;const n=this.formatLanguageCode(t);this.options.supportedLngs&&!this.isSupportedCode(n)||(e=n)})),!e&&this.options.supportedLngs&&t.forEach((t=>{if(e)return;const n=this.getLanguagePartFromCode(t);if(this.isSupportedCode(n))return e=n;e=this.options.supportedLngs.find((t=>t===n?t:t.indexOf("-")<0&&n.indexOf("-")<0?void 0:t.indexOf("-")>0&&n.indexOf("-")<0&&t.substring(0,t.indexOf("-"))===n||0===t.indexOf(n)&&n.length>1?t:void 0))})),e||(e=this.getFallbackCodes(this.options.fallbackLng)[0]),e}getFallbackCodes(t,e){if(!t)return[];if("function"==typeof t&&(t=t(e)),"string"==typeof t&&(t=[t]),Array.isArray(t))return t;if(!e)return t.default||[];let n=t[e];return n||(n=t[this.getScriptPartFromCode(e)]),n||(n=t[this.formatLanguageCode(e)]),n||(n=t[this.getLanguagePartFromCode(e)]),n||(n=t.default),n||[]}toResolveHierarchy(t,e){const n=this.getFallbackCodes(e||this.options.fallbackLng||[],t),r=[],o=t=>{t&&(this.isSupportedCode(t)?r.push(t):this.logger.warn(`rejecting language code not found in supportedLngs: ${t}`))};return"string"==typeof t&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(t)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(t)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(t))):"string"==typeof t&&o(this.formatLanguageCode(t)),n.forEach((t=>{r.indexOf(t)<0&&o(this.formatLanguageCode(t))})),r}}let gh=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],vh={1:t=>Number(t>1),2:t=>Number(1!=t),3:t=>0,4:t=>Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2),5:t=>Number(0==t?0:1==t?1:2==t?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5),6:t=>Number(1==t?0:t>=2&&t<=4?1:2),7:t=>Number(1==t?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2),8:t=>Number(1==t?0:2==t?1:8!=t&&11!=t?2:3),9:t=>Number(t>=2),10:t=>Number(1==t?0:2==t?1:t<7?2:t<11?3:4),11:t=>Number(1==t||11==t?0:2==t||12==t?1:t>2&&t<20?2:3),12:t=>Number(t%10!=1||t%100==11),13:t=>Number(0!==t),14:t=>Number(1==t?0:2==t?1:3==t?2:3),15:t=>Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2),16:t=>Number(t%10==1&&t%100!=11?0:0!==t?1:2),17:t=>Number(1==t||t%10==1&&t%100!=11?0:1),18:t=>Number(0==t?0:1==t?1:2),19:t=>Number(1==t?0:0==t||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3),20:t=>Number(1==t?0:0==t||t%100>0&&t%100<20?1:2),21:t=>Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0),22:t=>Number(1==t?0:2==t?1:(t<0||t>10)&&t%10==0?2:3)};const mh=["v1","v2","v3"],yh=["v4"],bh={zero:0,one:1,two:2,few:3,many:4,other:5};class wh{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.languageUtils=t,this.options=e,this.logger=zd.create("pluralResolver"),this.options.compatibilityJSON&&!yh.includes(this.options.compatibilityJSON)||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=(()=>{const t={};return gh.forEach((e=>{e.lngs.forEach((n=>{t[n]={numbers:e.nr,plurals:vh[e.fc]}}))})),t})(),this.pluralRulesCache={}}addRule(t,e){this.rules[t]=e}clearCache(){this.pluralRulesCache={}}getRule(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{const n=uh("dev"===t?"en":t),r=e.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:n,type:r});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];const i=new Intl.PluralRules(n,{type:r});return this.pluralRulesCache[o]=i,i}catch(t){return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=this.getRule(t,e);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}getPluralFormsOfKey(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(t,n).map((t=>`${e}${t}`))}getSuffixes(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=this.getRule(t,e);return n?this.shouldUseIntlApi()?n.resolvedOptions().pluralCategories.sort(((t,e)=>bh[t]-bh[e])).map((t=>`${this.options.prepend}${e.ordinal?`ordinal${this.options.prepend}`:""}${t}`)):n.numbers.map((n=>this.getSuffix(t,n,e))):[]}getSuffix(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=this.getRule(t,n);return r?this.shouldUseIntlApi()?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r.select(e)}`:this.getSuffixRetroCompatible(r,e):(this.logger.warn(`no plural rule found for: ${t}`),"")}getSuffixRetroCompatible(t,e){const n=t.noAbs?t.plurals(e):t.plurals(Math.abs(e));let r=t.numbers[n];this.options.simplifyPluralSuffix&&2===t.numbers.length&&1===t.numbers[0]&&(2===r?r="plural":1===r&&(r=""));const o=()=>this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString();return"v1"===this.options.compatibilityJSON?1===r?"":"number"==typeof r?`_plural_${r.toString()}`:o():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===t.numbers.length&&1===t.numbers[0]?o():this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString()}shouldUseIntlApi(){return!mh.includes(this.options.compatibilityJSON)}}const xh=function(t,e,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".",o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=((t,e,n)=>{const r=th(t,n);return void 0!==r?r:th(e,n)})(t,e,n);return!i&&o&&"string"==typeof n&&(i=sh(t,n,r),void 0===i&&(i=sh(e,n,r))),i},Eh=t=>t.replace(/\$/g,"$$$$");class Sh{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=zd.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||(t=>t),this.init(t)}init(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const{escape:e,escapeValue:n,useRawValueToEscape:r,prefix:o,prefixEscaped:i,suffix:a,suffixEscaped:s,formatSeparator:u,unescapeSuffix:l,unescapePrefix:c,nestingPrefix:f,nestingPrefixEscaped:d,nestingSuffix:h,nestingSuffixEscaped:p,nestingOptionsSeparator:g,maxReplaces:v,alwaysFormat:m}=t.interpolation;this.escape=void 0!==e?e:oh,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==r&&r,this.prefix=o?nh(o):i||"{{",this.suffix=a?nh(a):s||"}}",this.formatSeparator=u||",",this.unescapePrefix=l?"":c||"-",this.unescapeSuffix=this.unescapePrefix?"":l||"",this.nestingPrefix=f?nh(f):d||nh("$t("),this.nestingSuffix=h?nh(h):p||nh(")"),this.nestingOptionsSeparator=g||",",this.maxReplaces=v||1e3,this.alwaysFormat=void 0!==m&&m,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(t,e)=>t&&t.source===e?(t.lastIndex=0,t):new RegExp(e,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(t,e,n,r){let o,i,a;const s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=t=>{if(t.indexOf(this.formatSeparator)<0){const o=xh(e,s,t,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(o,void 0,n,{...r,...e,interpolationkey:t}):o}const o=t.split(this.formatSeparator),i=o.shift().trim(),a=o.join(this.formatSeparator).trim();return this.format(xh(e,s,i,this.options.keySeparator,this.options.ignoreJSONStructure),a,n,{...r,...e,interpolationkey:i})};this.resetRegExp();const l=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,c=r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:t=>Eh(t)},{regex:this.regexp,safeValue:t=>this.escapeValue?Eh(this.escape(t)):Eh(t)}].forEach((e=>{for(a=0;o=e.regex.exec(t);){const n=o[1].trim();if(i=u(n),void 0===i)if("function"==typeof l){const e=l(t,o,r);i="string"==typeof e?e:""}else if(r&&Object.prototype.hasOwnProperty.call(r,n))i="";else{if(c){i=o[0];continue}this.logger.warn(`missed to pass in variable ${n} for interpolating ${t}`),i=""}else"string"==typeof i||this.useRawValueToEscape||(i=Gd(i));const s=e.safeValue(i);if(t=t.replace(o[0],s),c?(e.regex.lastIndex+=i.length,e.regex.lastIndex-=o[0].length):e.regex.lastIndex=0,a++,a>=this.maxReplaces)break}})),t}nest(t,e){let n,r,o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const a=(t,e)=>{const n=this.nestingOptionsSeparator;if(t.indexOf(n)<0)return t;const r=t.split(new RegExp(`${n}[ ]*{`));let i=`{${r[1]}`;t=r[0],i=this.interpolate(i,o);const a=i.match(/'/g),s=i.match(/"/g);(a&&a.length%2==0&&!s||s.length%2!=0)&&(i=i.replace(/'/g,'"'));try{o=JSON.parse(i),e&&(o={...e,...o})}catch(e){return this.logger.warn(`failed parsing options string in nesting for key ${t}`,e),`${t}${n}${i}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,t};for(;n=this.nestingRegexp.exec(t);){let s=[];o={...i},o=o.replace&&"string"!=typeof o.replace?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;let u=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){const t=n[1].split(this.formatSeparator).map((t=>t.trim()));n[1]=t.shift(),s=t,u=!0}if(r=e(a.call(this,n[1].trim(),o),o),r&&n[0]===t&&"string"!=typeof r)return r;"string"!=typeof r&&(r=Gd(r)),r||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${t}`),r=""),u&&(r=s.reduce(((t,e)=>this.format(t,e,i.lng,{...i,interpolationkey:n[1].trim()})),r.trim())),t=t.replace(n[0],r),this.regexp.lastIndex=0}return t}}const Oh=t=>{const e={};return(n,r,o)=>{let i=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(i={...i,[o.interpolationkey]:void 0});const a=r+JSON.stringify(i);let s=e[a];return s||(s=t(uh(r),o),e[a]=s),s(n)}};class Ch{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=zd.create("formatter"),this.options=t,this.formats={number:Oh(((t,e)=>{const n=new Intl.NumberFormat(t,{...e});return t=>n.format(t)})),currency:Oh(((t,e)=>{const n=new Intl.NumberFormat(t,{...e,style:"currency"});return t=>n.format(t)})),datetime:Oh(((t,e)=>{const n=new Intl.DateTimeFormat(t,{...e});return t=>n.format(t)})),relativetime:Oh(((t,e)=>{const n=new Intl.RelativeTimeFormat(t,{...e});return t=>n.format(t,e.range||"day")})),list:Oh(((t,e)=>{const n=new Intl.ListFormat(t,{...e});return t=>n.format(t)}))},this.init(t)}init(t){const e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=e.formatSeparator?e.formatSeparator:e.formatSeparator||","}add(t,e){this.formats[t.toLowerCase().trim()]=e}addCached(t,e){this.formats[t.toLowerCase().trim()]=Oh(e)}format(t,e,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const o=e.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find((t=>t.indexOf(")")>-1))){const t=o.findIndex((t=>t.indexOf(")")>-1));o[0]=[o[0],...o.splice(1,t)].join(this.formatSeparator)}const i=o.reduce(((t,e)=>{const{formatName:o,formatOptions:i}=(t=>{let e=t.toLowerCase().trim();const n={};if(t.indexOf("(")>-1){const r=t.split("(");e=r[0].toLowerCase().trim();const o=r[1].substring(0,r[1].length-1);"currency"===e&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):"relativetime"===e&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach((t=>{if(t){const[e,...r]=t.split(":"),o=r.join(":").trim().replace(/^'+|'+$/g,""),i=e.trim();n[i]||(n[i]=o),"false"===o&&(n[i]=!1),"true"===o&&(n[i]=!0),isNaN(o)||(n[i]=parseInt(o,10))}}))}return{formatName:e,formatOptions:n}})(e);if(this.formats[o]){let e=t;try{const a=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},s=a.locale||a.lng||r.locale||r.lng||n;e=this.formats[o](t,s,{...i,...r,...a})}catch(t){this.logger.warn(t)}return e}return this.logger.warn(`there was no format function for ${o}`),t}),t);return i}}class kh extends Kd{constructor(t,e,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};super(),this.backend=t,this.store=e,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=zd.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(n,r.backend,r)}queueLoad(t,e,n,r){const o={},i={},a={},s={};return t.forEach((t=>{let r=!0;e.forEach((e=>{const a=`${t}|${e}`;!n.reload&&this.store.hasResourceBundle(t,e)?this.state[a]=2:this.state[a]<0||(1===this.state[a]?void 0===i[a]&&(i[a]=!0):(this.state[a]=1,r=!1,void 0===i[a]&&(i[a]=!0),void 0===o[a]&&(o[a]=!0),void 0===s[e]&&(s[e]=!0)))})),r||(a[t]=!0)})),(Object.keys(o).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(o),pending:Object.keys(i),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(s)}}loaded(t,e,n){const r=t.split("|"),o=r[0],i=r[1];e&&this.emit("failedLoading",o,i,e),!e&&n&&this.store.addResourceBundle(o,i,n,void 0,void 0,{skipCopy:!0}),this.state[t]=e?-1:2,e&&n&&(this.state[t]=0);const a={};this.queue.forEach((n=>{((t,e,n)=>{const{obj:r,k:o}=Qd(t,e,Object);r[o]=r[o]||[],r[o].push(n)})(n.loaded,[o],i),((t,e)=>{void 0!==t.pending[e]&&(delete t.pending[e],t.pendingCount--)})(n,t),e&&n.errors.push(e),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach((t=>{a[t]||(a[t]={});const e=n.loaded[t];e.length&&e.forEach((e=>{void 0===a[t][e]&&(a[t][e]=!0)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",a),this.queue=this.queue.filter((t=>!t.done))}read(t,e,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,i=arguments.length>5?arguments[5]:void 0;if(!t.length)return i(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:t,ns:e,fcName:n,tried:r,wait:o,callback:i});this.readingCalls++;const a=(a,s)=>{if(this.readingCalls--,this.waitingReads.length>0){const t=this.waitingReads.shift();this.read(t.lng,t.ns,t.fcName,t.tried,t.wait,t.callback)}a&&s&&r<this.maxRetries?setTimeout((()=>{this.read.call(this,t,e,n,r+1,2*o,i)}),o):i(a,s)},s=this.backend[n].bind(this.backend);if(2!==s.length)return s(t,e,a);try{const n=s(t,e);n&&"function"==typeof n.then?n.then((t=>a(null,t))).catch(a):a(null,n)}catch(t){a(t)}}prepareLoading(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();"string"==typeof t&&(t=this.languageUtils.toResolveHierarchy(t)),"string"==typeof e&&(e=[e]);const o=this.queueLoad(t,e,n,r);if(!o.toLoad.length)return o.pending.length||r(),null;o.toLoad.forEach((t=>{this.loadOne(t)}))}load(t,e,n){this.prepareLoading(t,e,{},n)}reload(t,e,n){this.prepareLoading(t,e,{reload:!0},n)}loadOne(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=t.split("|"),r=n[0],o=n[1];this.read(r,o,"read",void 0,void 0,((n,i)=>{n&&this.logger.warn(`${e}loading namespace ${o} for language ${r} failed`,n),!n&&i&&this.logger.log(`${e}loaded namespace ${o} for language ${r}`,i),this.loaded(t,n,i)}))}saveMissing(t,e,n,r,o){let i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(e))this.logger.warn(`did not save key "${n}" as the namespace "${e}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");else if(null!=n&&""!==n){if(this.backend&&this.backend.create){const s={...i,isUpdate:o},u=this.backend.create.bind(this.backend);if(u.length<6)try{let o;o=5===u.length?u(t,e,n,r,s):u(t,e,n,r),o&&"function"==typeof o.then?o.then((t=>a(null,t))).catch(a):a(null,o)}catch(t){a(t)}else u(t,e,n,r,a,s)}t&&t[0]&&this.store.addResource(t[0],e,n,r)}}}const Th=()=>({debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let e={};if("object"==typeof t[1]&&(e=t[1]),"string"==typeof t[1]&&(e.defaultValue=t[1]),"string"==typeof t[2]&&(e.tDescription=t[2]),"object"==typeof t[2]||"object"==typeof t[3]){const n=t[3]||t[2];Object.keys(n).forEach((t=>{e[t]=n[t]}))}return e},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),Nh=t=>("string"==typeof t.ns&&(t.ns=[t.ns]),"string"==typeof t.fallbackLng&&(t.fallbackLng=[t.fallbackLng]),"string"==typeof t.fallbackNS&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&t.supportedLngs.indexOf("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t),Rh=()=>{};class Lh extends Kd{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;var n;if(super(),this.options=Nh(t),this.services={},this.logger=zd,this.modules={external:[]},n=this,Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach((t=>{"function"==typeof n[t]&&(n[t]=n[t].bind(n))})),e&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,e),this;setTimeout((()=>{this.init(t,e)}),0)}}init(){var t=this;let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,"function"==typeof e&&(n=e,e={}),!e.defaultNS&&!1!==e.defaultNS&&e.ns&&("string"==typeof e.ns?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const r=Th();this.options={...r,...this.options,...Nh(e)},"v1"!==this.options.compatibilityAPI&&(this.options.interpolation={...r.interpolation,...this.options.interpolation}),void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator);const o=t=>t?"function"==typeof t?new t:t:null;if(!this.options.isClone){let e;this.modules.logger?zd.init(o(this.modules.logger),this.options):zd.init(null,this.options),this.modules.formatter?e=this.modules.formatter:"undefined"!=typeof Intl&&(e=Ch);const n=new ph(this.options);this.store=new lh(this.options.resources,this.options);const i=this.services;i.logger=zd,i.resourceStore=this.store,i.languageUtils=n,i.pluralResolver=new wh(n,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!e||this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format||(i.formatter=o(e),i.formatter.init(i,this.options),this.options.interpolation.format=i.formatter.format.bind(i.formatter)),i.interpolator=new Sh(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new kh(o(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on("*",(function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];t.emit(e,...r)})),this.modules.languageDetector&&(i.languageDetector=o(this.modules.languageDetector),i.languageDetector.init&&i.languageDetector.init(i,this.options.detection,this.options)),this.modules.i18nFormat&&(i.i18nFormat=o(this.modules.i18nFormat),i.i18nFormat.init&&i.i18nFormat.init(this)),this.translator=new dh(this.services,this.options),this.translator.on("*",(function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];t.emit(e,...r)})),this.modules.external.forEach((t=>{t.init&&t.init(this)}))}if(this.format=this.options.interpolation.format,n||(n=Rh),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const t=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);t.length>0&&"dev"!==t[0]&&(this.options.lng=t[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((e=>{this[e]=function(){return t.store[e](...arguments)}}));["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((e=>{this[e]=function(){return t.store[e](...arguments),t}}));const i=qd(),a=()=>{const t=(t,e)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),i.resolve(e),n(t,e)};if(this.languages&&"v1"!==this.options.compatibilityAPI&&!this.isInitialized)return t(null,this.t.bind(this));this.changeLanguage(this.options.lng,t)};return this.options.resources||!this.options.initImmediate?a():setTimeout(a,0),i}loadResources(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Rh;const n="string"==typeof t?t:this.language;if("function"==typeof t&&(e=t),!this.options.resources||this.options.partialBundledLanguages){if(n&&"cimode"===n.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return e();const t=[],r=e=>{if(!e)return;if("cimode"===e)return;this.services.languageUtils.toResolveHierarchy(e).forEach((e=>{"cimode"!==e&&t.indexOf(e)<0&&t.push(e)}))};if(n)r(n);else{this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((t=>r(t)))}this.options.preload&&this.options.preload.forEach((t=>r(t))),this.services.backendConnector.load(t,this.options.ns,(t=>{t||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),e(t)}))}else e(null)}reloadResources(t,e,n){const r=qd();return"function"==typeof t&&(n=t,t=void 0),"function"==typeof e&&(n=e,e=void 0),t||(t=this.languages),e||(e=this.options.ns),n||(n=Rh),this.services.backendConnector.reload(t,e,(t=>{r.resolve(),n(t)})),r}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===t.type&&(this.modules.backend=t),("logger"===t.type||t.log&&t.warn&&t.error)&&(this.modules.logger=t),"languageDetector"===t.type&&(this.modules.languageDetector=t),"i18nFormat"===t.type&&(this.modules.i18nFormat=t),"postProcessor"===t.type&&ch.addPostProcessor(t),"formatter"===t.type&&(this.modules.formatter=t),"3rdParty"===t.type&&this.modules.external.push(t),this}setResolvedLanguage(t){if(t&&this.languages&&!(["cimode","dev"].indexOf(t)>-1))for(let t=0;t<this.languages.length;t++){const e=this.languages[t];if(!(["cimode","dev"].indexOf(e)>-1)&&this.store.hasLanguageSomeTranslations(e)){this.resolvedLanguage=e;break}}}changeLanguage(t,e){var n=this;this.isLanguageChangingTo=t;const r=qd();this.emit("languageChanging",t);const o=t=>{this.language=t,this.languages=this.services.languageUtils.toResolveHierarchy(t),this.resolvedLanguage=void 0,this.setResolvedLanguage(t)},i=(t,i)=>{i?(o(i),this.translator.changeLanguage(i),this.isLanguageChangingTo=void 0,this.emit("languageChanged",i),this.logger.log("languageChanged",i)):this.isLanguageChangingTo=void 0,r.resolve((function(){return n.t(...arguments)})),e&&e(t,(function(){return n.t(...arguments)}))},a=e=>{t||e||!this.services.languageDetector||(e=[]);const n="string"==typeof e?e:this.services.languageUtils.getBestMatchFromCodes(e);n&&(this.language||o(n),this.translator.language||this.translator.changeLanguage(n),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(n)),this.loadResources(n,(t=>{i(t,n)}))};return t||!this.services.languageDetector||this.services.languageDetector.async?!t&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(t):a(this.services.languageDetector.detect()),r}getFixedT(t,e,n){var r=this;const o=function(t,e){let i;if("object"!=typeof e){for(var a=arguments.length,s=new Array(a>2?a-2:0),u=2;u<a;u++)s[u-2]=arguments[u];i=r.options.overloadTranslationOptionHandler([t,e].concat(s))}else i={...e};i.lng=i.lng||o.lng,i.lngs=i.lngs||o.lngs,i.ns=i.ns||o.ns,""!==i.keyPrefix&&(i.keyPrefix=i.keyPrefix||n||o.keyPrefix);const l=r.options.keySeparator||".";let c;return c=i.keyPrefix&&Array.isArray(t)?t.map((t=>`${i.keyPrefix}${l}${t}`)):i.keyPrefix?`${i.keyPrefix}${l}${t}`:t,r.t(c,i)};return"string"==typeof t?o.lng=t:o.lngs=t,o.ns=e,o.keyPrefix=n,o}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=e.lng||this.resolvedLanguage||this.languages[0],r=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;const i=(t,e)=>{const n=this.services.backendConnector.state[`${t}|${e}`];return-1===n||0===n||2===n};if(e.precheck){const t=e.precheck(this,i);if(void 0!==t)return t}return!!this.hasResourceBundle(n,t)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!i(n,t)||r&&!i(o,t)))}loadNamespaces(t,e){const n=qd();return this.options.ns?("string"==typeof t&&(t=[t]),t.forEach((t=>{this.options.ns.indexOf(t)<0&&this.options.ns.push(t)})),this.loadResources((t=>{n.resolve(),e&&e(t)})),n):(e&&e(),Promise.resolve())}loadLanguages(t,e){const n=qd();"string"==typeof t&&(t=[t]);const r=this.options.preload||[],o=t.filter((t=>r.indexOf(t)<0&&this.services.languageUtils.isSupportedCode(t)));return o.length?(this.options.preload=r.concat(o),this.loadResources((t=>{n.resolve(),e&&e(t)})),n):(e&&e(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";const e=this.services&&this.services.languageUtils||new ph(Th());return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(e.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){return new Lh(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}cloneInstance(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Rh;const n=t.forkResourceStore;n&&delete t.forkResourceStore;const r={...this.options,...t,isClone:!0},o=new Lh(r);void 0===t.debug&&void 0===t.prefix||(o.logger=o.logger.clone(t));return["store","services","language"].forEach((t=>{o[t]=this[t]})),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},n&&(o.store=new lh(this.store.data,r),o.services.resourceStore=o.store),o.translator=new dh(o.services,r),o.translator.on("*",(function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];o.emit(t,...n)})),o.init(r,e),o.translator.options=r,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Mh=Lh.createInstance();Mh.createInstance=Lh.createInstance,Mh.createInstance,Mh.dir,Mh.init,Mh.loadResources,Mh.reloadResources,Mh.use,Mh.changeLanguage,Mh.getFixedT,Mh.t,Mh.exists,Mh.setDefaultNamespace,Mh.hasLoadedNamespace,Mh.loadNamespaces,Mh.loadLanguages;var Ph="translation";function Dh(t){return Mh.on("languageChanged",t),function(){return Mh.off("languageChanged",t)}}Mh.init({lng:"zh-CN",resources:{}});var Ah=Mh.t.bind(Mh);function jh(t){if(t.removeAttr){t.removeAttr("width"),t.removeAttr("height"),t.removeAttr("fill"),t.removeAttr("class"),t.removeAttr("t"),t.removeAttr("p-id");var e=t.children();e.length&&jh(e)}}function Ih(){return o('<svg viewBox="0 0 1024 1024"><path d="M498.7 655.8l-197.6-268c-8.1-10.9-0.3-26.4 13.3-26.4h395.2c13.6 0 21.4 15.4 13.3 26.4l-197.6 268c-6.6 9-20 9-26.6 0z"></path></svg>')}function $h(){return o('<div class="w-e-bar-divider"></div>')}function Fh(t,e,n,r,o){if(void 0===r&&(r=""),void 0===o&&(o=!1),e){if(r){var i=pf?"cmd":"ctrl";r=r.replace("mod",i)}if(o)r&&(t.attr("data-tooltip",r),t.addClass("w-e-menu-tooltip-v5"),t.addClass("tooltip-right"));else{var a=r?"".concat(n,"\n").concat(r):n;t.attr("data-tooltip",a),t.addClass("w-e-menu-tooltip-v5")}}}var _h=function(){function t(t,e,n){void 0===n&&(n=!1);var r=this;this.$elem=o('<div class="w-e-bar-item"></div>'),this.$button=o('<button type="button"></button>'),this.disabled=!1,this.menu=e;var i=e.tag,a=e.width;if("button"!==i)throw new Error("Invalid tag '".concat(i,"', expected 'button'"));var s=e.title,u=e.hotkey,l=void 0===u?"":u,c=e.iconSvg,f=void 0===c?"":c,d=this.$button;if(f){var h=o(f);jh(h),d.append(h)}else d.text(s);Fh(d,f,s,l,n),n&&f&&d.append(o('<span class="title">'.concat(s,"</span>"))),a&&d.css("width","".concat(a,"px")),d.attr("data-menu-key",t),this.$elem.append(d),rc((function(){return r.init()}))}return t.prototype.init=function(){var t=this;this.setActive(),this.setDisabled(),this.$button.on("click",(function(e){e.preventDefault(),Yh(t).hidePanelOrModal(),t.disabled||(t.exec(),t.onButtonClick())}))},t.prototype.exec=function(){var t=Yh(this),e=this.menu,n=e.getValue(t);this.setIcon(),this.setTooltip(),e.exec(t,n)},t.prototype.setActive=function(){var t=Yh(this),e=this.$button,n="active";this.menu.isActive(t)?e.addClass(n):e.removeClass(n)},t.prototype.setDisabled=function(){var t=Yh(this),e=this.$button,n=this.menu.isDisabled(t);(null==t.selection||t.isDisabled())&&(n=!0),this.menu.alwaysEnable&&(n=!1);var r="disabled";n?e.addClass(r):e.removeClass(r),this.disabled=n},t.prototype.setIcon=function(){var t=Yh(this),e=this.$button;if(this.menu.getIcon){var n=this.menu.getIcon(t);if(n){e.find("svg").remove();var r=o(n);jh(r),e.append(r)}}},t.prototype.setTooltip=function(){var t=Yh(this),e=this.$button;if(this.menu.getTitle){var n=this.menu.getTitle(t),r=this.menu.iconSvg;n&&r&&Fh(e,r,n)}},t.prototype.changeMenuState=function(){this.setActive(),this.setDisabled()},t}(),Bh=function(t){function e(e,n,r){return void 0===r&&(r=!1),t.call(this,e,n,r)||this}return lo(e,t),e.prototype.onButtonClick=function(){},e}(_h),Hh=function(){function t(t){this.isShow=!1,this.showTime=0,this.record(t)}return t.prototype.record=function(t){var e=Na.get(t);null==e&&(e=new Set,Na.set(t,e)),e.add(this),Ra.set(this,t)},t.prototype.renderContent=function(t){var e=this.$elem;e.empty(),e.append(t);var n=this.genSelfElem();n&&e.append(n)},t.prototype.appendTo=function(t){var e=this.$elem;t.append(e)},t.prototype.show=function(){if(!this.isShow){this.showTime=Date.now(),this.$elem.show(),this.isShow=!0;var t=Ra.get(this);t&&t.emit("modalOrPanelShow",this)}},t.prototype.hide=function(){if(this.isShow&&!(Date.now()-this.showTime<200)){this.$elem.hide(),this.isShow=!1;var t=Ra.get(this);t&&t.emit("modalOrPanelHide")}},t}(),Wh=function(t){function e(e){var n=t.call(this,e)||this;return n.type="dropPanel",n.$elem=o('<div class="w-e-drop-panel"></div>'),n}return lo(e,t),e.prototype.genSelfElem=function(){return null},e}(Hh),Uh=function(t){function e(e,n,r){void 0===r&&(r=!1);var o=t.call(this,e,n,r)||this;if(o.dropPanel=null,o.menu=n,n.showDropPanel){var i=Ih();o.$button.append(i)}return o}return lo(e,t),e.prototype.onButtonClick=function(){this.menu.showDropPanel&&this.handleDropPanel()},e.prototype.handleDropPanel=function(){var t=this.menu;if(null!=t.getPanelContentElem){var e=Yh(this);if(null==this.dropPanel){var n=new Wh(e),r=t.getPanelContentElem(e);n.renderContent(r),n.appendTo(this.$elem),n.show(),this.dropPanel=n}else{var o=this.dropPanel;if(o.isShow)o.hide();else{r=t.getPanelContentElem(e);o.renderContent(r),o.show()}}var i=this.dropPanel;if(i.isShow){var a=this.$elem,s=a.offset().left,u=a.parents(".w-e-bar");s-u.offset().left>=u.width()/2?i.$elem.css({left:"none",right:"0"}):i.$elem.css({left:"0",right:"none"})}}},e}(_h),Vh=function(t){function e(e,n){void 0===n&&(n=0);var r=t.call(this,e)||this;r.type="modal",r.$elem=o('<div class="w-e-modal"></div>'),r.width=0,n&&(r.width=n);var i=r.$elem;return i.on("click",(function(t){return t.stopPropagation()})),i.on("keyup",(function(t){"Escape"===t.code&&(r.hide(),e.restoreSelection())})),r}return lo(e,t),e.prototype.genSelfElem=function(){var t=this,e=o('<span class="btn-close">'.concat('<svg viewBox="0 0 1024 1024"><path d="M1024 896.1024l-128 128L512 640 128 1024 0 896 384 512 0 128 128 0 512 384 896.1024 0l128 128L640 512z"></path></svg>',"</span>")),n=Ra.get(this);return e.on("click",(function(){t.hide(),null==n||n.restoreSelection()})),e},e.prototype.setStyle=function(t){var e=this.width,n=this.$elem;n.attr("style",""),e&&n.css("width","".concat(e,"px")),n.css(t)},e}(Hh);var zh=function(t){function n(e,n,r){void 0===r&&(r=!1);var i=t.call(this,e,n,r)||this;return i.$body=o("body"),i.modal=null,i.menu=n,i}return lo(n,t),n.prototype.onButtonClick=function(){this.menu.showModal&&this.handleModal()},n.prototype.getPosition=function(){var t=Yh(this),n=this.menu.getModalPositionNode(t);return e.Element.isElement(n)?Fd(t,n,"modal"):$d(t)},n.prototype.handleModal=function(){var t=Yh(this),e=this.menu;if(null==this.modal){var n=new Vh(t,e.modalWidth);this.renderAndShowModal(n,!0),this.modal=n}else{(n=this.modal).isShow?n.hide():this.renderAndShowModal(n,!1)}},n.prototype.renderAndShowModal=function(t,e){void 0===e&&(e=!1);var n=Yh(this),r=this.menu;if(null!=r.getModalContentElem){var o=xf.getTextarea(n),i=xf.getToolbar(n),a=((null==i?void 0:i.getConfig())||{}).modalAppendToBody,s=r.getModalContentElem(n);if(t.renderContent(s),a)t.setStyle({left:"0",right:"0"});else{var u=this.getPosition();t.setStyle(u)}e&&(a?t.appendTo(this.$body):t.appendTo(o.$textAreaContainer)),t.show(),a||_d(n,t.$elem),setTimeout((function(){n.blur()}))}},n}(_h);var Kh=function(t){function e(e,n){var r=t.call(this,e)||this;return r.type="selectList",r.$elem=o('<div class="w-e-select-list"></div>'),n&&r.$elem.css("width","".concat(n,"px")),r.$elem.on("click",(function(t){t.stopPropagation()})),r}return lo(e,t),e.prototype.renderList=function(t){var e=this.$elem;e.empty();var n=o("<ul></ul>");t.forEach((function(t){var e=t.value,r=t.text,i=t.selected,a=t.styleForRenderMenuList,s=o('<li data-value="'.concat(e,'"></li>'));if(a&&s.css(a),i){var u=o('<svg viewBox="0 0 1446 1024"><path d="M574.116299 786.736392 1238.811249 48.517862C1272.390222 11.224635 1329.414799 7.827718 1366.75664 41.450462 1403.840015 74.840484 1406.731043 132.084741 1373.10189 169.433699L655.118888 966.834607C653.072421 969.716875 650.835807 972.514337 648.407938 975.210759 615.017957 1012.29409 558.292155 1015.652019 521.195664 982.250188L72.778218 578.493306C35.910826 545.297758 32.859041 488.584019 66.481825 451.242134 99.871807 414.158803 156.597563 410.800834 193.694055 444.202665L574.116299 786.736392Z"></path></svg>');s.append(u),s.addClass("selected")}s.append(o('<span data-value="'.concat(e,'">').concat(r,"</span>"))),s.attr("title",r),n.append(s)})),e.append(n)},e.prototype.genSelfElem=function(){return null},e}(Hh);var qh=function(){function t(t,e,n){void 0===n&&(n=!1);var r=this;this.$elem=o('<div class="w-e-bar-item"></div>'),this.$button=o('<button type="button" class="select-button"></button>'),this.disabled=!1,this.selectList=null;var i=e.tag,a=e.title,s=e.width,u=e.iconSvg,l=void 0===u?"":u,c=e.hotkey,f=void 0===c?"":c;if("select"!==i)throw new Error("Invalid tag '".concat(i,"', expected 'select'"));var d=this.$button;s&&d.css("width","".concat(s,"px")),d.attr("data-menu-key",t),Fh(d,l,a,f,n),this.$elem.append(d),this.menu=e,rc((function(){return r.init()}))}return t.prototype.init=function(){var t=this;this.setSelectedValue(),this.$button.on("click",(function(e){e.preventDefault(),Yh(t).hidePanelOrModal(),t.trigger()}))},t.prototype.trigger=function(){var t=this,e=Yh(this);if(!e.isDisabled()&&!this.disabled){var n=this.menu;if(null==this.selectList){this.selectList=new Kh(e,n.selectPanelWidth);var r=this.selectList,i=n.getOptions(e);r.renderList(i),r.appendTo(this.$elem),r.show(),r.$elem.on("click","li",(function(e){var n=e.target;if(null!=n){e.preventDefault();var r=o(n).attr("data-value");t.onChange(r)}}))}else{if((r=this.selectList).isShow)r.hide();else{i=n.getOptions(e);r.renderList(i),r.show()}}}},t.prototype.onChange=function(t){var e=Yh(this),n=this.menu;n.exec&&n.exec(e,t)},t.prototype.setSelectedValue=function(){var t=Yh(this),e=this.menu,n=e.getValue(t),r=function(t,e){for(var n=t.length,r="",o=0;o<n;o++){var i=t[o];if(i.value===e){r=i.text;break}}return r}(e.getOptions(t),n.toString()),o=this.$button,i=Ih();o.empty(),o.text(r),o.append(i)},t.prototype.setDisabled=function(){var t=Yh(this),e=this.menu.isDisabled(t),n=this.$button;(null==t.selection||t.isDisabled())&&(e=!0);var r="disabled";e?n.addClass(r):n.removeClass(r),this.disabled=e},t.prototype.changeMenuState=function(){this.setSelectedValue(),this.setDisabled()},t}(),Gh=function(){function t(t){this.$elem=o('<div class="w-e-bar-item w-e-bar-item-group"></div>'),this.$container=o('<div class="w-e-bar-item-menus-container"></div>'),this.$button=o('<button type="button"></button>');var e=t.key,n=t.iconSvg,r=t.title,i=this.$elem,a=this.$button;if(n){var s=o(n);jh(s),a.append(s)}else a.text(r);a.attr("data-menu-key",e);var u=Ih();a.append(u),i.append(a);var l=this.$container;i.append(l);var c=this.createObserver();this.observe(c)}return t.prototype.appendBarItem=function(t){var e=t.$elem;this.$container.append(e)},t.prototype.observe=function(t){var e=this.$container;t.observe(e[0],{childList:!0,subtree:!0,attributes:!0})},t.prototype.createObserver=function(){var t=this,e=this.$container,n=this.$button,r=new MutationObserver((function(){var i=e.find("button"),a=i.length;if(0!==a){var s=0;i.each((function(t){o(t).hasClass("disabled")&&s++})),r.disconnect(),s===a?n.addClass("disabled"):n.removeClass("disabled"),t.observe(r)}}));return r},t}(),Jh=new WeakMap;function Yh(t){var e=Ta.get(t);if(null==e)throw new Error("Can not get editor instance");return e}function Xh(t,e,n){void 0===n&&(n=!1);var r=Jh.get(e);if(r)return r;var o=e.tag;if("button"===o){var i=e.showDropPanel,a=e.showModal;r=i?new Uh(t,e,n):a?new zh(t,e,n):new Bh(t,e,n)}if("select"===o&&(r=new qh(t,e,n)),null==r)throw new Error("Invalid tag in menu ".concat(JSON.stringify(e)));return Jh.set(e,r),r}function Qh(t,n){var r=t.selection;return null!=r&&(!e.Range.isCollapsed(r)&&(!xf.getSelectedElems(t).some((function(e){if(t.isVoid(e))return!0;var n=e.type;return!!["pre","code","table"].includes(n)}))&&!!e.Text.isText(n)))}var Zh,tp=function(){function t(){var t=this;this.$elem=o('<div class="w-e-bar w-e-bar-hidden w-e-hover-bar"></div>'),this.menus={},this.hoverbarItems=[],this.prevSelectedNode=null,this.isShow=!1,this.lngListen=function(){},this.changeHoverbarState=s((function(){var n=t.isShow,r=t.getSelectedNodeAndMenuKeys()||{},o=r.node,i=void 0===o?null:o,a=r.menuKeys,s=void 0===a?[]:a,u=t.getEditorInstance();if(null!=i&&t.changeItemsState(),i&&e.Element.isElement(i)&&n){var l=t.isSamePath(i,t.prevSelectedNode);if(!e.Editor.isBlock(u,i)&&l)return}t.hideAndClean(),null!=i&&(t.registerItems(s),t.setPosition(i),t.show()),t.prevSelectedNode=i}),200),rc((function(){var e=t.getEditorInstance(),n=t.$elem;n.on("mousedown",(function(t){return t.preventDefault()}),{passive:!1}),xf.getTextarea(e).$textAreaContainer.append(n),e.on(vo.CHANGE,t.changeHoverbarState);var r=t.hideAndClean.bind(t);e.on(vo.SCROLL,r),e.on(vo.FULLSCREEN,r),e.on(vo.UNFULLSCREEN,r)})),this.lngListen=Dh((function(){t.menus={},t.hideAndClean(),t.getEditorInstance().deselect()}))}return t.prototype.getMenus=function(){return this.menus},t.prototype.hideAndClean=function(){var t=this.$elem;t.removeClass("w-e-bar-show").addClass("w-e-bar-hidden"),this.hoverbarItems=[],t.empty(),this.isShow=!1},t.prototype.checkPositionBottom=function(){var t=this.$elem,e=!1,n="undefined"!=typeof window?window.innerHeight:null;n&&n>=360&&(n-t[0].getBoundingClientRect().bottom<360&&(e=!0));e?t.addClass("w-e-bar-bottom"):t.removeClass("w-e-bar-bottom")},t.prototype.show=function(){this.$elem.removeClass("w-e-bar-hidden").addClass("w-e-bar-show"),this.isShow=!0,this.checkPositionBottom()},t.prototype.changeItemsState=function(){var t=this;rc((function(){t.hoverbarItems.forEach((function(t){t.changeMenuState()}))}))},t.prototype.registerItems=function(t){var e=this,n=this.$elem;t.forEach((function(t){if("|"!==t)e.registerSingleItem(t);else{var r=$h();n.append(r)}}))},t.prototype.registerSingleItem=function(t){var e=this.getEditorInstance(),n=this.menus,r=n[t];if(null==r){var o=mo[t];if(null==o)throw new Error("Not found menu item factory by key '".concat(t,"'"));if("function"!=typeof o)throw new Error("Menu item factory (key='".concat(t,"') is not a function"));r=o(),n[t]=r}var i=e.getMenuConfig(t);i&&void 0!==i.iconSvg&&(r.iconSvg=i.iconSvg);var a=Xh(t,r);this.hoverbarItems.push(a),Ta.set(a,e),this.$elem.append(a.$elem)},t.prototype.setPosition=function(t){var n=this.getEditorInstance(),r=this.$elem;if(r.attr("style",""),e.Element.isElement(t)){var o=Fd(n,t,"bar");return r.css(o),void _d(n,r)}if(e.Text.isText(t)){o=$d(n);return r.css(o),void _d(n,r)}throw new Error("hoverbar.setPosition error, current selected node is not elem nor text")},t.prototype.getSelectedNodeAndMenuKeys=function(){var t=this.getEditorInstance();if(null==t.selection)return null;var n=this.getHoverbarKeysConf(),r=null,o=[],i=function(i){var a=n[i],s=a.match,u=a.menuKeys,l=void 0===u?[]:u,c=s||function(t,e){return xf.checkNodeType(e,i)},f=ho(e.Editor.nodes(t,{match:function(e){return c(t,e)},universal:!0}),1),d=f[0];if(null!=d)return r=d[0],o=l,"break"};for(var a in n){if("break"===i(a))break}return null==r||0===o.length?null:{node:r,menuKeys:o}},t.prototype.getEditorInstance=function(){var t=Ca.get(this);if(null==t)throw new Error("Can not get editor instance");return t},t.prototype.getHoverbarKeysConf=function(){var t=this.getEditorInstance().getConfig().hoverbarKeys,e=void 0===t?{}:t,n=e.text;return n&&null==n.match&&(n.match=Qh),e},t.prototype.isSamePath=function(t,n){if(null==t||null==n)return!1;var r=xf.findPath(null,t),o=xf.findPath(null,n);return e.Path.equals(r,o)},t.prototype.destroy=function(){var t;this.changeHoverbarState.cancel(),this.$elem.remove(),null===(t=this.lngListen)||void 0===t||t.call(this),this.menus={},this.hoverbarItems=[],this.prevSelectedNode=null},t}(),ep={};function np(t,e){return wc(e)&&xf.hasDOMNode(t,e,{editable:!0})}function rp(t,n){if(t.getConfig().readOnly)return!1;var r=op(t,n)&&xf.toSlateNode(t,n);return e.Editor.isVoid(t,r)}function op(t,e){return wc(e)&&xf.hasDOMNode(t,e)}!function(){if(Zh)return ep;Zh=1;var t,e=pr(),n=Xr(),r=Ce().f,o=Rn(),i=mi(),a=vs(),s=Tt(),u=ms(),l=he(),c=n("".slice),f=Math.min,d=u("startsWith");e({target:"String",proto:!0,forced:!!(l||d||(t=r(String.prototype,"startsWith"),!t||t.writable))&&!d},{startsWith:function(t){var e=i(s(this));a(t);var n=o(f(arguments.length>1?arguments[1]:void 0,e.length)),r=i(t);return c(e,n,n+r.length)===r}})}();const ip=t=>"object"==typeof t&&null!=t&&1===t.nodeType,ap=(t,e)=>(!e||"hidden"!==t)&&"visible"!==t&&"clip"!==t,sp=(t,e)=>{if(t.clientHeight<t.scrollHeight||t.clientWidth<t.scrollWidth){const n=getComputedStyle(t,null);return ap(n.overflowY,e)||ap(n.overflowX,e)||(t=>{const e=(t=>{if(!t.ownerDocument||!t.ownerDocument.defaultView)return null;try{return t.ownerDocument.defaultView.frameElement}catch(t){return null}})(t);return!!e&&(e.clientHeight<t.scrollHeight||e.clientWidth<t.scrollWidth)})(t)}return!1},up=(t,e,n,r,o,i,a,s)=>i<t&&a>e||i>t&&a<e?0:i<=t&&s<=n||a>=e&&s>=n?i-t-r:a>e&&s<n||i<t&&s>n?a-e+o:0,lp=t=>{const e=t.parentElement;return null==e?t.getRootNode().host||null:e},cp=(t,e)=>{var n,r,o,i;if("undefined"==typeof document)return[];const{scrollMode:a,block:s,inline:u,boundary:l,skipOverflowHiddenElements:c}=e,f="function"==typeof l?l:t=>t!==l;if(!ip(t))throw new TypeError("Invalid target");const d=document.scrollingElement||document.documentElement,h=[];let p=t;for(;ip(p)&&f(p);){if(p=lp(p),p===d){h.push(p);break}null!=p&&p===document.body&&sp(p)&&!sp(document.documentElement)||null!=p&&sp(p,c)&&h.push(p)}const g=null!=(r=null==(n=window.visualViewport)?void 0:n.width)?r:innerWidth,v=null!=(i=null==(o=window.visualViewport)?void 0:o.height)?i:innerHeight,{scrollX:m,scrollY:y}=window,{height:b,width:w,top:x,right:E,bottom:S,left:O}=t.getBoundingClientRect(),{top:C,right:k,bottom:T,left:N}=(t=>{const e=window.getComputedStyle(t);return{top:parseFloat(e.scrollMarginTop)||0,right:parseFloat(e.scrollMarginRight)||0,bottom:parseFloat(e.scrollMarginBottom)||0,left:parseFloat(e.scrollMarginLeft)||0}})(t);let R="start"===s||"nearest"===s?x-C:"end"===s?S+T:x+b/2-C+T,L="center"===u?O+w/2-N+k:"end"===u?E+k:O-N;const M=[];for(let t=0;t<h.length;t++){const e=h[t],{height:n,width:r,top:o,right:i,bottom:l,left:c}=e.getBoundingClientRect();if("if-needed"===a&&x>=0&&O>=0&&S<=v&&E<=g&&x>=o&&S<=l&&O>=c&&E<=i)return M;const f=getComputedStyle(e),p=parseInt(f.borderLeftWidth,10),C=parseInt(f.borderTopWidth,10),k=parseInt(f.borderRightWidth,10),T=parseInt(f.borderBottomWidth,10);let N=0,P=0;const D="offsetWidth"in e?e.offsetWidth-e.clientWidth-p-k:0,A="offsetHeight"in e?e.offsetHeight-e.clientHeight-C-T:0,j="offsetWidth"in e?0===e.offsetWidth?0:r/e.offsetWidth:0,I="offsetHeight"in e?0===e.offsetHeight?0:n/e.offsetHeight:0;if(d===e)N="start"===s?R:"end"===s?R-v:"nearest"===s?up(y,y+v,v,C,T,y+R,y+R+b,b):R-v/2,P="start"===u?L:"center"===u?L-g/2:"end"===u?L-g:up(m,m+g,g,p,k,m+L,m+L+w,w),N=Math.max(0,N+y),P=Math.max(0,P+m);else{N="start"===s?R-o-C:"end"===s?R-l+T+A:"nearest"===s?up(o,l,n,C,T+A,R,R+b,b):R-(o+n/2)+A/2,P="start"===u?L-c-p:"center"===u?L-(c+r/2)+D/2:"end"===u?L-i+k+D:up(c,i,r,p,k+D,L,L+w,w);const{scrollLeft:t,scrollTop:a}=e;N=0===I?0:Math.max(0,Math.min(a+N/I,e.scrollHeight-n/I+A)),P=0===j?0:Math.max(0,Math.min(t+P/j,e.scrollWidth-r/j+D)),R+=a-N,L+=t-P}M.push({el:e,top:N,left:P})}return M},fp=t=>!1===t?{block:"end",inline:"nearest"}:(t=>t===Object(t)&&0!==Object.keys(t).length)(t)?t:{block:"start",inline:"nearest"};function dp(t,n,r){void 0===r&&(r=!1);var o=n.selection,i=n.getConfig(),a=xf.findDocumentOrShadowRoot(n).getSelection();if(a&&(!t.isComposing||r)&&n.isFocused()){var s="None"!==a.type;if(o||s){var u=Ia.get(n),l=!1;if(u.contains(a.anchorNode)&&u.contains(a.focusNode)&&(l=!0),s&&l&&o){var c=xf.toSlateRange(n,a,{exactMatch:!0,suppressThrow:!0});if(c&&e.Range.equals(c,o)){var f=!0;if(e.Range.isCollapsed(o)){var d=a.anchorNode,h=a.anchorOffset;if(d===u){var p=u.childNodes,g=void 0;(g=p[h])&&g.matches("table")&&(f=!1),(g=p[h-1])&&g.matches("table")&&(f=!1)}}if(f)return}}if(!o||xf.hasRange(n,o)){t.isUpdatingSelection=!0;var v=o&&xf.toDOMRange(n,o);if(v){e.Range.isBackward(o)?a.setBaseAndExtent(v.endContainer,v.endOffset,v.startContainer,v.startOffset):a.setBaseAndExtent(v.startContainer,v.startOffset,v.endContainer,v.endOffset);var m=v.startContainer.parentElement;if(!m.closest("[data-slate-spacer]")&&v.getBoundingClientRect){m.getBoundingClientRect=v.getBoundingClientRect.bind(v);var y=document.body;!function(t,e){if(!t.isConnected||!(t=>{let e=t;for(;e&&e.parentNode;){if(e.parentNode===document)return!0;e=e.parentNode instanceof ShadowRoot?e.parentNode.host:e.parentNode}return!1})(t))return;const n=(t=>{const e=window.getComputedStyle(t);return{top:parseFloat(e.scrollMarginTop)||0,right:parseFloat(e.scrollMarginRight)||0,bottom:parseFloat(e.scrollMarginBottom)||0,left:parseFloat(e.scrollMarginLeft)||0}})(t);if((t=>"object"==typeof t&&"function"==typeof t.behavior)(e))return e.behavior(cp(t,e));const r="boolean"==typeof e||null==e?void 0:e.behavior;for(const{el:o,top:i,left:a}of cp(t,fp(e))){const t=i-n.top+n.bottom,e=a-n.left+n.right;o.scroll({top:t,left:e,behavior:r})}}(m,{scrollMode:"if-needed",boundary:i.scroll?u.parentElement:y,block:"end",behavior:"smooth"}),delete m.getBoundingClientRect}}else a.removeAllRanges();setTimeout((function(){v&&gf&&u.focus(),t.isUpdatingSelection=!1}))}else n.selection=xf.toSlateRange(n,a,{exactMatch:!1,suppressThrow:!1})}}}var hp=new WeakMap,pp=new WeakMap;var gp={bold:"mod+b",compose:["down","left","right","up","backspace","enter"],moveBackward:"left",moveForward:"right",moveWordBackward:"ctrl+left",moveWordForward:"ctrl+right",deleteBackward:"shift?+backspace",deleteForward:"shift?+delete",extendBackward:"shift+left",extendForward:"shift+right",italic:"mod+i",splitBlock:"shift?+enter",undo:"mod+z",tab:"tab",selectAll:"mod+a"},vp={moveLineBackward:"opt+up",moveLineForward:"opt+down",moveWordBackward:"opt+left",moveWordForward:"opt+right",deleteBackward:["ctrl+backspace","ctrl+h"],deleteForward:["ctrl+delete","ctrl+d"],deleteLineBackward:"cmd+shift?+backspace",deleteLineForward:["cmd+shift?+delete","ctrl+k"],deleteWordBackward:"opt+shift?+backspace",deleteWordForward:"opt+shift?+delete",extendLineBackward:"opt+shift+up",extendLineForward:"opt+shift+down",redo:"cmd+shift+z",transposeCharacter:"ctrl+t"},mp={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:["ctrl+y","ctrl+shift+z"]},yp=function(t){var e=gp[t],n=vp[t],r=mp[t],o=e&&l.isKeyHotkey(e),i=n&&l.isKeyHotkey(n),a=r&&l.isKeyHotkey(r);return function(t){return!(!o||!o(t))||(!!(pf&&i&&i(t))||!(pf||!a||!a(t)))}},bp={isBold:yp("bold"),isCompose:yp("compose"),isMoveBackward:yp("moveBackward"),isMoveForward:yp("moveForward"),isDeleteBackward:yp("deleteBackward"),isDeleteForward:yp("deleteForward"),isDeleteLineBackward:yp("deleteLineBackward"),isDeleteLineForward:yp("deleteLineForward"),isDeleteWordBackward:yp("deleteWordBackward"),isDeleteWordForward:yp("deleteWordForward"),isExtendBackward:yp("extendBackward"),isExtendForward:yp("extendForward"),isExtendLineBackward:yp("extendLineBackward"),isExtendLineForward:yp("extendLineForward"),isItalic:yp("italic"),isMoveLineBackward:yp("moveLineBackward"),isMoveLineForward:yp("moveLineForward"),isMoveWordBackward:yp("moveWordBackward"),isMoveWordForward:yp("moveWordForward"),isRedo:yp("redo"),isSplitBlock:yp("splitBlock"),isTransposeCharacter:yp("transposeCharacter"),isUndo:yp("undo"),isTab:yp("tab"),isSelectAll:yp("selectAll")};function wp(t){t.preventDefault()}var xp,Ep,Sp,Op={beforeinput:function(t,n,r){var o=t,i=r.getConfig().readOnly;if(wf&&!i&&np(r,o.target)){var a=r.selection,s=o.inputType,u=o.dataTransfer||o.data||void 0;if("insertCompositionText"!==s&&"deleteCompositionText"!==s){if(o.preventDefault(),!s.startsWith("delete")||s.startsWith("deleteBy")){var l=ho(o.getTargetRanges(),1)[0];if(l){var c=xf.toSlateRange(r,l,{exactMatch:!1,suppressThrow:!1});a&&e.Range.equals(a,c)||e.Transforms.select(r,c)}}if(a&&e.Range.isExpanded(a)){var f=xf.getSelectedElems(r),d="table"===f[0].type,h="table-cell"!==f[f.length-1].type;if(d&&h)return;if(s.startsWith("delete")){var p=s.endsWith("Backward")?"backward":"forward";return void e.Editor.deleteFragment(r,{direction:p})}}switch(s){case"deleteByComposition":case"deleteByCut":case"deleteByDrag":e.Editor.deleteFragment(r);break;case"deleteContent":case"deleteContentForward":e.Editor.deleteForward(r);break;case"deleteContentBackward":e.Editor.deleteBackward(r);break;case"deleteEntireSoftLine":e.Editor.deleteBackward(r,{unit:"line"}),e.Editor.deleteForward(r,{unit:"line"});break;case"deleteHardLineBackward":e.Editor.deleteBackward(r,{unit:"block"});break;case"deleteSoftLineBackward":e.Editor.deleteBackward(r,{unit:"line"});break;case"deleteHardLineForward":e.Editor.deleteForward(r,{unit:"block"});break;case"deleteSoftLineForward":e.Editor.deleteForward(r,{unit:"line"});break;case"deleteWordBackward":e.Editor.deleteBackward(r,{unit:"word"});break;case"deleteWordForward":e.Editor.deleteForward(r,{unit:"word"});break;case"insertLineBreak":case"insertParagraph":e.Editor.insertBreak(r);break;case"insertFromDrop":case"insertFromPaste":case"insertFromYank":case"insertReplacementText":case"insertText":if("insertFromPaste"===s&&!za.get(r))break;gc(u)?r.insertData(u):"string"==typeof u&&e.Editor.insertText(r,u)}}}},blur:function(t,n,r){var o=t,i=n.isUpdatingSelection,a=n.latestElement;if(!r.getConfig().readOnly&&!i&&np(r,o.target)){var s=xf.findDocumentOrShadowRoot(r);if(a!==s.activeElement){var u=o.relatedTarget;if(!(u===xf.toDOMNode(r,r)||Ec(u)&&u.hasAttribute("data-slate-spacer"))){if(null!=u&&wc(u)&&xf.hasDOMNode(r,u)){var l=xf.toSlateNode(r,u);if(e.Element.isElement(l)&&!r.isVoid(l))return}if(vf){var c=s.getSelection();null==c||c.removeAllRanges()}Wa.delete(r)}}}},focus:function(t,e,n){var r=xf.toDOMNode(n,n),o=xf.findDocumentOrShadowRoot(n);e.latestElement=o.activeElement,gf&&t.target!==r?r.focus():Wa.set(n,!0)},click:function(t,n,r){if(!r.getConfig().readOnly&&op(r,t.target)&&wc(t.target)){var o=xf.toSlateNode(r,t.target),i=xf.findPath(r,o);if(e.Editor.hasPath(r,i))if(e.Node.get(r,i)===o){var a=e.Editor.start(r,i),s=e.Editor.end(r,i),u=e.Editor.void(r,{at:a}),l=e.Editor.void(r,{at:s});if(u&&l&&e.Path.equals(u[1],l[1])){var c=e.Editor.range(r,a);e.Transforms.select(r,c)}}}},compositionstart:function(t,n,r){if(np(r,t.target)){var o=r.selection;if(o&&e.Range.isExpanded(o)&&(e.Editor.deleteFragment(r),Promise.resolve().then((function(){dp(n,r,!0)}))),r.selection){var i=xf.toDOMRange(r,r.selection).startContainer,a=i.textContent||"";hp.set(r,a),pp.set(r,i)}n.isComposing=!0,function(t,e){var n;e.getConfig().placeholder&&e.isEmpty()&&t.showPlaceholder&&(null===(n=t.$placeholder)||void 0===n||n.hide(),t.showPlaceholder=!1)}(n,r)}},compositionend:function(t,n,r){var o=t;if(np(r,o.target)){n.isComposing=!1;var i=r.selection;if(null!=i){(bf||gf)&&xf.cleanExposedTexNodeInSelectionBlock(r);for(var a=e.Range.isBackward(i)?i.focus:i.anchor,s=ho(e.Editor.node(r,[a.path[0]]),1)[0],u=0;u<a.path.length;u+=1){var l=ho(e.Editor.node(r,a.path.slice(0,u+1)),1)[0];if(e.Element.isElement(l)&&((vf||gf)&&"link"===l.type||"code"===l.type)){xf.setNewKey(s);break}}var c=o.data;if(c){if(r.getConfig().maxLength){var f=xf.getLeftLengthOfMaxLength(r);if(f<c.length){var d=xf.toDOMRange(r,i);d.startContainer.nodeType===Node.TEXT_NODE&&(d.startContainer.textContent=hp.get(r)||""),f>0&&e.Editor.insertText(r,c.slice(0,f)),n.changeViewState()}else e.Editor.insertText(r,c)}else{var h=xf.findDocumentOrShadowRoot(r).getSelection();h&&function(t,n){if(e.Range.isCollapsed(n)){var r=n.anchor,o=n.focus;if([2,3].includes(r.path.length)&&[2,3].includes(o.path.length)&&(0===r.offset||0===o.offset)){var i=e.Editor.node(t,r.path),a=0===r.offset?r.path:o.path,s=[a[0],a[1]-1];if(0===a[1])return!1;var u=e.Editor.node(t,s);if(e.Text.isText(u[0])&&e.Text.isText(i[0]))return!0}}}(r,i)&&(r.selection=xf.toSlateRange(r,h,{exactMatch:!1,suppressThrow:!1})),e.Editor.insertText(r,c)}vf||setTimeout((function(){var t=r.selection;if(null!=t){var e=pp.get(r);if(null!=e)xf.toDOMRange(r,t).startContainer!==e&&(e.textContent=hp.get(r)||"")}}))}}}},compositionupdate:function(t,e,n){np(n,t.target)&&(e.isComposing=!0)},keydown:function(t,n,r){var o=t,i=r.selection;if(!r.getConfig().readOnly&&!n.isComposing&&np(r,o.target)){if(function(t,e){var n=Oa.get(t),r=n&&n.getMenus(),o=ka.get(t),i=o&&o.getMenus(),a=co(co({},r),i);for(var s in a){var u=a[s],c=u.hotkey;if(c&&l.isHotkey(c,e)&&!u.isDisabled(t)){var f=u.getValue(t);u.exec(t,f)}}}(r,o),bp.isTab(o))return wp(o),void r.handleTab();if(bp.isRedo(o))return wp(o),void("function"==typeof r.redo&&r.redo());if(bp.isUndo(o))return wp(o),void("function"==typeof r.undo&&r.undo());if(bp.isMoveLineBackward(o))return wp(o),void e.Transforms.move(r,{unit:"line",reverse:!0});if(bp.isMoveLineForward(o))return wp(o),void e.Transforms.move(r,{unit:"line"});if(bp.isExtendLineBackward(o))return wp(o),void e.Transforms.move(r,{unit:"line",edge:"focus",reverse:!0});if(bp.isExtendLineForward(o))return wp(o),void e.Transforms.move(r,{unit:"line",edge:"focus"});if(bp.isMoveBackward(o))return wp(o),void(i&&e.Range.isCollapsed(i)?e.Transforms.move(r,{reverse:!0}):e.Transforms.collapse(r,{edge:"start"}));if(bp.isMoveForward(o))return wp(o),void(i&&e.Range.isCollapsed(i)?e.Transforms.move(r):e.Transforms.collapse(r,{edge:"end"}));if(bp.isMoveWordBackward(o))return wp(o),i&&e.Range.isExpanded(i)&&e.Transforms.collapse(r,{edge:"focus"}),void e.Transforms.move(r,{unit:"word",reverse:!0});if(bp.isMoveWordForward(o))return wp(o),i&&e.Range.isExpanded(i)&&e.Transforms.collapse(r,{edge:"focus"}),void e.Transforms.move(r,{unit:"word"});if(bp.isSelectAll(o))return wp(o),void r.selectAll();if(wf){if((bf||vf)&&i&&(bp.isDeleteBackward(o)||bp.isDeleteForward(o))&&e.Range.isCollapsed(i)){var a=e.Node.parent(r,i.anchor.path);if(e.Element.isElement(a)&&e.Editor.isVoid(r,a)&&e.Editor.isInline(r,a))return o.preventDefault(),void e.Transforms.delete(r,{unit:"block"})}}else{if(bp.isBold(o)||bp.isItalic(o)||bp.isTransposeCharacter(o))return void wp(o);if(bp.isSplitBlock(o))return wp(o),void e.Editor.insertBreak(r);if(bp.isDeleteBackward(o))return wp(o),void(i&&e.Range.isExpanded(i)?e.Editor.deleteFragment(r,{direction:"backward"}):e.Editor.deleteBackward(r));if(bp.isDeleteForward(o))return wp(o),void(i&&e.Range.isExpanded(i)?e.Editor.deleteFragment(r,{direction:"forward"}):e.Editor.deleteForward(r));if(bp.isDeleteLineBackward(o))return wp(o),void(i&&e.Range.isExpanded(i)?e.Editor.deleteFragment(r,{direction:"backward"}):e.Editor.deleteBackward(r,{unit:"line"}));if(bp.isDeleteLineForward(o))return wp(o),void(i&&e.Range.isExpanded(i)?e.Editor.deleteFragment(r,{direction:"forward"}):e.Editor.deleteForward(r,{unit:"line"}));if(bp.isDeleteWordBackward(o))return wp(o),void(i&&e.Range.isExpanded(i)?e.Editor.deleteFragment(r,{direction:"backward"}):e.Editor.deleteBackward(r,{unit:"word"}));if(bp.isDeleteWordForward(o))return wp(o),void(i&&e.Range.isExpanded(i)?e.Editor.deleteFragment(r,{direction:"forward"}):e.Editor.deleteForward(r,{unit:"word"}))}}},keypress:function(t,n,r){if(!wf&&!r.getConfig().readOnly&&np(r,t.target)){t.preventDefault();var o=t.key;e.Editor.insertText(r,o)}},copy:function(t,e,n){var r=t;if(np(n,r.target)){n.getConfig().readOnly||r.preventDefault();var o=r.clipboardData;if(null!=o){n.setFragmentData(o);var i=n.getConfig().customCopy;i&&i(n,r)}}},cut:function(t,n,r){var o=t,i=r.selection;if(!r.getConfig().readOnly&&(o.preventDefault(),np(r,o.target))){var a=o.clipboardData;if(null!=a&&(r.setFragmentData(a),i))if(e.Range.isExpanded(i))e.Editor.deleteFragment(r);else{var s=e.Node.parent(r,i.anchor.path);e.Editor.isVoid(r,s)&&e.Transforms.delete(r)}}},paste:function(t,e,n){za.set(n,!0);var r=t;if(!n.getConfig().readOnly&&np(n,r.target)){var o=n.getConfig().customPaste;if(o)if(!1===o(n,r))return void za.set(n,!1);if(vf||!wf||Cc(r)){r.preventDefault();var i=r.clipboardData;null!=i&&n.insertData(i)}}},dragover:function(t,n,r){if(op(r,t.target)){var o=xf.toSlateNode(r,t.target);e.Editor.isVoid(r,o)&&t.preventDefault()}},dragstart:function(t,n,r){var o=t;if(op(r,o.target)&&!r.getConfig().readOnly){var i=xf.toSlateNode(r,o.target),a=xf.findPath(r,i);if(e.Editor.isVoid(r,i)||e.Editor.void(r,{at:a,voids:!0})){var s=e.Editor.range(r,a);e.Transforms.select(r,s)}var u=o.dataTransfer;if(null!=u)xf.getSelectedNodeByType(r,"table")||(n.isDraggingInternally=!0,r.setFragmentData(u))}},dragend:function(t,e,n){var r=t;n.getConfig().readOnly||e.isDraggingInternally&&op(n,r.target)&&(e.isDraggingInternally=!1)},drop:function(t,n,r){var o=t,i=o.dataTransfer;if(!r.getConfig().readOnly&&op(r,o.target)&&null!=i&&!(wf&&vf&&i.files.length>0)){o.preventDefault();var a=r.selection,s=xf.findEventRange(r,o);e.Transforms.select(r,s),n.isDraggingInternally&&(a&&e.Transforms.delete(r,{at:a}),n.isDraggingInternally=!1),r.insertData(i),r.isFocused()||r.focus()}}},Cp={};!function(){if(Sp)return Cp;Sp=1;var t=pr(),e=function(){if(Ep)return xp;Ep=1;var t=L(),e=St(),n=P(),r=R(),o=Nr(),i=cr(),a=xt(),s=me(),u=Ct(),l=Object.assign,c=Object.defineProperty,f=e([].concat);return xp=!l||r((function(){if(t&&1!==l({b:1},l(c({},"a",{enumerable:!0,get:function(){c(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},n={},r=Symbol("assign detection"),i="abcdefghijklmnopqrst";return e[r]=7,i.split("").forEach((function(t){n[t]=t})),7!==l({},e)[r]||o(l({},n)).join("")!==i}))?function(e,r){for(var l=s(e),c=arguments.length,d=1,h=i.f,p=a.f;c>d;)for(var g,v=u(arguments[d++]),m=h?f(o(v),h(v)):o(v),y=m.length,b=0;y>b;)g=m[b++],t&&!n(p,v,g)||(l[g]=v[g]);return l}:l,xp}();t({target:"Object",stat:!0,arity:2,forced:Object.assign!==e},{assign:e})}();var kp=["props","attrs","style","dataset","on","hook"];function Tp(t){var e=t.data,n=void 0===e?{}:e,r=t.children,o=void 0===r?[]:r;Object.keys(n).forEach((function(e){var r,o,i=n[e];if("key"!==e){if(!kp.includes(e)){if(e.startsWith("data-")){var a=e.slice(5);return a=f(a),function(t,e){null==t.data&&(t.data={});var n=t.data;null==n.dataset&&(n.dataset={});Object.assign(n.dataset,e)}(t,((r={})[a]=i,r)),void delete n[e]}!function(t,e){null==t.data&&(t.data={});var n=t.data;null==n.props&&(n.props={});Object.assign(n.props,e)}(t,(o={},o[e]=i,o)),delete n[e]}}else t.key=i})),o.length>0&&o.forEach((function(t){"string"!=typeof t&&Tp(t)}))}var Np=[];var Rp={};function Lp(t,e,n){var r=n.isInline(t)?"span":"div";return c.jsx(r,null,e)}function Mp(t,n){var r,o=xf.findKey(n,t),i=n.isInline(t),a=e.Editor.isVoid(n,t),s=Zc(t.type,o.id),u={id:s,key:o.id,"data-slate-node":"element","data-slate-inline":i},l=t.type,f=t.children,d=void 0===f?[]:f,h=function(t){return Rp[t]||Lp}(l);r=a?null:d.map((function(e,r){return jp(e,r,t,n)}));var p=h(t,r,n);if(a){u["data-slate-void"]=!0;var g=i?"span":"div",v=ho(e.Node.texts(t),1),m=ho(v[0],1)[0],y=jp(m,0,t,n),b=c.jsx(g,{"data-slate-spacer":!0,style:{height:"0",color:"transparent",outline:"none",position:"absolute"}},y);p=c.jsx(g,{style:{position:"relative"}},p,b),Aa.set(m,0),ja.set(m,t)}return null==p.data&&(p.data={}),Object.assign(p.data,u),a||i||(p=function(t,e){var n=e;return Np.forEach((function(r){n=r(t,e)})),n}(t,p)),rc((function(){var e=Nc(s);null!=e&&(Fa.set(o,e),_a.set(t,e),$a.set(e,t))})),p}function Pp(t,e){return void 0===e&&(e=!1),c.jsx("span",{"data-slate-string":!0},e?t+"\n":t)}function Dp(t,e){return void 0===t&&(t=0),void 0===e&&(e=!1),c.jsx("span",{"data-slate-zero-width":e?"n":"z","data-slate-length":t},"\ufeff",e?c.jsx("br",null):null)}function Ap(t,n,r){if(null==t.text)throw new Error("Current node is not slate Text ".concat(JSON.stringify(t)));var o=xf.findKey(r,t),i=r.getConfig().decorate;if(null==i)throw new Error("Can not get config.decorate");var a,s=xf.findPath(r,t),u=i([t,s]),l=e.Text.decorations(t,u),f=l.map((function(o,i){var a=function(t,n,r,o,i){void 0===n&&(n=!1);var a=t.text,s=xf.findPath(i,r),u=e.Path.parent(s);if(e.Editor.isEditor(o))throw new Error("Text node ".concat(JSON.stringify(r)," parent is Editor"));return i.isVoid(o)?Dp(e.Node.string(o).length):""!==a||o.children[o.children.length-1]!==r||i.isInline(o)||""!==e.Editor.string(i,u)?""===a?Dp():n&&"\n"===a.slice(-1)?Pp(a,!0):Pp(a):Dp(0,!0)}(o,i===l.length-1,t,n,r);return a=function(t,e){var n=e;return Np.forEach((function(e){n=e(t,n)})),n}(o,a),c.jsx("span",{"data-slate-leaf":!0},a)})),d=(a=o.id,"w-e-text-".concat(a)),h=c.jsx("span",{"data-slate-node":"text",id:d,key:o.id},f);return rc((function(){var e=Nc(d);null!=e&&(Fa.set(o,e),_a.set(t,e),$a.set(e,t))})),h}function jp(t,n,r,o){return Aa.set(t,n),ja.set(t,r),e.Element.isElement(t)?Mp(t,o):Ap(t,r,o)}function Ip(t,e){var n,r,i=t.$scroll,a=(n=t.id,"w-e-textarea-".concat(n)),s=e.getConfig(),u=s.readOnly,l=s.autoFocus,f=function(t,e){return void 0===e&&(e=!1),c.h("div#".concat(t),{props:{contentEditable:!e}})}(a,u),d=e.children||[];f.children=d.map((function(t,n){var r=jp(t,n,e,e);return Tp(r),r}));var h=Ma.get(t);if(null==h&&(h=!0),h){var p=function(t){return o('<div\n id="'.concat(t,'"\n data-slate-editor\n data-slate-node="value"\n suppressContentEditableWarning\n role="textarea"\n spellCheck="true"\n autoCorrect="true"\n autoCapitalize="true"\n ></div>'))}(a);i.append(p),t.$textArea=p,r=p[0],(v=c.init([c.classModule,c.propsModule,c.styleModule,c.datasetModule,c.eventListenersModule,c.attributesModule]))(r,f),Ma.set(t,!1),Pa.set(t,v)}else{var g=Da.get(t),v=Pa.get(t);if(null==g||null==v)return;r=g.elm,v(g,f)}if(null!=r||null!=(r=Nc(a))){if((h?l:e.isFocused())&&r.focus({preventScroll:!0}),h){var m=bc(r);m&&Ha.set(e,m)}Ia.set(e,r),_a.set(e,r),$a.set(r,e),Da.set(t,f)}}var $p=1,Fp=function(){function t(t){var n=this;this.id=$p++,this.$textArea=null,this.$progressBar=o('<div class="w-e-progress-bar"></div>'),this.$maxLengthInfo=o('<div class="w-e-max-length-info"></div>'),this.isComposing=!1,this.isUpdatingSelection=!1,this.isDraggingInternally=!1,this.latestElement=null,this.showPlaceholder=!1,this.$placeholder=null,this.latestEditorSelection=null,this.onDOMSelectionChange=u((function(){var t=n.editorInstance;!function(t,n){var r=t.isComposing,o=t.isUpdatingSelection,i=t.isDraggingInternally;if(!(n.getConfig().readOnly||r||o||i)){var a=xf.findDocumentOrShadowRoot(n),s=a.activeElement,u=xf.toDOMNode(n,n),l=a.getSelection();if(s!==u)return Wa.delete(n),void e.Transforms.deselect(n);if(t.latestElement=s,Wa.set(n,!0),!l)return e.Transforms.deselect(n);var c=l.anchorNode,f=l.focusNode,d=np(n,c)||rp(n,c),h=np(n,f)||rp(n,f);if(d&&h){var p=xf.toSlateRange(n,l,{exactMatch:!1,suppressThrow:!1});e.Transforms.select(n,p)}}}(n,t)}),100);var r=o(t);if(0===r.length)throw new Error("Cannot find textarea DOM by selector '".concat(t,"'"));this.$box=r;var i=o('<div class="w-e-text-container"></div>');i.append(this.$progressBar),i.append(this.$maxLengthInfo),r.append(i);var a=o('<div class="w-e-scroll"></div>');i.append(a),this.$scroll=a,this.$textAreaContainer=i,rc((function(){var t=n.editorInstance,e=xf.getWindow(t);e.document.addEventListener("selectionchange",n.onDOMSelectionChange),t.on(vo.DESTROYED,(function(){e.document.removeEventListener("selectionchange",n.onDOMSelectionChange)})),i.on("click",(function(){return t.hidePanelOrModal()})),t.on(vo.CHANGE,n.changeViewState.bind(n));var o=t.getConfig(),a=o.onChange,s=o.scroll;a&&t.on(vo.CHANGE,(function(){return a(t)})),s||(r.css("position","relative"),i.addClass("no-scroll")),n.onFocusAndOnBlur(),t.on(vo.CHANGE,n.changeMaxLengthInfo.bind(n)),n.bindEvent()}))}return Object.defineProperty(t.prototype,"editorInstance",{get:function(){var t=Ea.get(this);if(null==t)throw new Error("Can not get editor instance");return t},enumerable:!1,configurable:!0}),t.prototype.bindEvent=function(){var t=this,e=this.$textArea,n=this.$scroll,o=this.editorInstance;null!=e&&(r(Op,(function(n,r){e.on(r,(function(e){n(e,t,o)}))})),o.getConfig().scroll&&(n.css("overflow-y","auto"),n.on("scroll",u((function(){o.emit("scroll")}),100))))},t.prototype.onFocusAndOnBlur=function(){var t=this,e=this.editorInstance,n=e.getConfig(),r=n.onBlur,o=n.onFocus;this.latestEditorSelection=e.selection,e.on(vo.CHANGE,(function(){null==t.latestEditorSelection&&null!=e.selection?setTimeout((function(){return o&&o(e)})):null!=t.latestEditorSelection&&null==e.selection&&setTimeout((function(){return r&&r(e)})),t.latestEditorSelection=e.selection}))},t.prototype.changeMaxLengthInfo=function(){var t=this.editorInstance,e=t.getConfig().maxLength;if(e){var n=e-xf.getLeftLengthOfMaxLength(t);this.$maxLengthInfo[0].innerHTML="".concat(n,"/").concat(e)}},t.prototype.changeProgress=function(t){var e=this.$progressBar;e.css("width","".concat(t,"%")),t>=100&&setTimeout((function(){e.hide(),e.css("width","0"),e.show()}),1e3)},t.prototype.changeViewState=function(){var t=this,e=this.editorInstance;Ip(this,e),function(t,e){var n,r=e.getConfig().placeholder;if(r){var i=e.isEmpty();if(i&&!t.showPlaceholder&&!t.isComposing){if(null==t.$placeholder){var a=o('<div class="w-e-text-placeholder">'.concat(r,"</div>"));t.$textAreaContainer.append(a),t.$placeholder=a}return t.$placeholder.show(),void(t.showPlaceholder=!0)}!i&&t.showPlaceholder&&(null===(n=t.$placeholder)||void 0===n||n.hide(),t.showPlaceholder=!1)}}(this,e),rc((function(){dp(t,e)}))},t.prototype.destroy=function(){this.$textAreaContainer.remove()},t}();function _p(t,n,r,o){if(Aa.set(t,n),ja.set(t,r),e.Element.isElement(t)){var i=t.children;if((void 0===i?[]:i).forEach((function(e,n){return _p(e,n,t,o)})),e.Editor.isVoid(o,t)){var a=ho(e.Node.texts(t),1),s=ho(a[0],1)[0];Aa.set(s,0),ja.set(s,t)}}}var Bp={en:"Textarea height < 300px. This may cause modal and hoverbar position error",zh:"编辑区域高度 < 300px 这可能会导致 modal hoverbar 定位异常"};var Hp,Wp,Up,Vp,zp,Kp={};function qp(){if(Vp)return Up;Vp=1;var t=Ft(),e=TypeError;return Up=function(n,r){if(!delete n[r])throw new e("Cannot delete property "+t(r)+" of "+t(n))}}!function(){if(zp)return Kp;zp=1;var t=pr(),e=me(),n=Nn(),r=Tn(),o=Ln(),i=function(){if(Wp)return Hp;Wp=1;var t=L(),e=gr(),n=TypeError,r=Object.getOwnPropertyDescriptor,o=t&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}();return Hp=o?function(t,o){if(e(t)&&!r(t,"length").writable)throw new n("Cannot set read only .length");return t.length=o}:function(t,e){return t.length=e}}(),a=vr(),s=Er(),u=mr(),l=qp(),c=Sr()("splice"),f=Math.max,d=Math.min;t({target:"Array",proto:!0,forced:!c},{splice:function(t,c){var h,p,g,v,m,y,b=e(this),w=o(b),x=n(t,w),E=arguments.length;for(0===E?h=p=0:1===E?(h=0,p=w-x):(h=E-2,p=d(f(r(c),0),w-x)),a(w+h-p),g=s(b,p),v=0;v<p;v++)(m=x+v)in b&&u(g,v,b[m]);if(g.length=p,h<p){for(v=x;v<w-p;v++)y=v+h,(m=v+p)in b?b[y]=b[m]:l(b,y);for(v=w;v>w-p+h;v--)l(b,v-1)}else if(h>p)for(v=w-p;v>x;v--)y=v+h-1,(m=v+p-1)in b?b[y]=b[m]:l(b,y);for(v=0;v<h;v++)b[v+x]=arguments[v+2];return i(b,w-p+h),g}})}();var Gp=function(){function t(t,e){var n=this;this.$toolbar=o('<div class="w-e-bar w-e-bar-show w-e-toolbar"></div>'),this.menus={},this.toolbarItems=[],this.config={},this.lngListen=function(){},this.changeToolbarState=s((function(){n.toolbarItems.forEach((function(t){t.changeMenuState()}))}),200),this.config=e;var r=o(t);if(0===r.length)throw new Error("Cannot find toolbar DOM by selector '".concat(t,"'"));this.$box=r;var i=this.$toolbar;i.on("mousedown",(function(t){return t.preventDefault()}),{passive:!1}),r.append(i),rc((function(){n.initToolbar(),n.lngListen=Dh((function(){return n.initToolbar()})),n.getEditorInstance().on(vo.CHANGE,n.changeToolbarState)}))}return t.prototype.getMenus=function(){return this.menus},t.prototype.getConfig=function(){return this.config},t.prototype.initToolbar=function(){this.menus={};var t=this.$toolbar;null==t||t.empty(),this.registerItems(),this.changeToolbarState()},t.prototype.registerItems=function(){var t=this,e="",r=this.$toolbar,o=this.config,i=o.toolbarKeys,a=void 0===i?[]:i,s=o.insertKeys,u=void 0===s?{index:0,keys:[]}:s,l=o.excludeKeys,c=void 0===l?[]:l,f=n(a);u.keys.length>0&&("string"==typeof u.keys&&(u.keys=[u.keys]),u.keys.forEach((function(t,e){f.splice(u.index+e,0,t)})));var d=f.filter((function(t){var e="string"==typeof t?t:t.key;return!c.includes(e)})),h=d.length;d.forEach((function(n,o){if("|"===n){if(0===o)return;if(o+1===h)return;if("|"===e)return;var i=$h();return r.append(i),void(e=n)}if("string"==typeof n)return t.registerSingleItem(n,t),void(e=n);t.registerGroup(n),e="group"}))},t.prototype.registerGroup=function(t){var e=this,n=this.$toolbar,r=function(t){return new Gh(t)}(t),o=t.menuKeys,i=void 0===o?[]:o,a=this.config.excludeKeys,s=void 0===a?[]:a;i.forEach((function(t){s.includes(t)||e.registerSingleItem(t,r)})),n.append(r.$elem)},t.prototype.registerSingleItem=function(t,e){var n=this.getEditorInstance(),r=e instanceof Gh,o=this.menus,i=o[t];if(null==i){var a=mo[t];if(null==a)throw new Error("Not found menu item factory by key '".concat(t,"'"));if("function"!=typeof a)throw new Error("Menu item factory (key='".concat(t,"') is not a function"));i=a(),o[t]=i}else console.warn("Duplicated toolbar menu key '".concat(t,"'\n重复注册了菜单栏 menu '").concat(t,"'"));var s=n.getMenuConfig(t);s&&void 0!==s.iconSvg&&(i.iconSvg=s.iconSvg);var u=Xh(t,i,r);(this.toolbarItems.push(u),Ta.set(u,n),r)?e.appendBarItem(u):e.$toolbar.append(u.$elem)},t.prototype.getEditorInstance=function(){var t=Sa.get(this);if(null==t)throw new Error("Can not get editor instance");return t},t.prototype.destroy=function(){var t;this.$toolbar.remove(),null===(t=this.lngListen)||void 0===t||t.call(this),this.menus={},this.toolbarItems=[]},t}();var Jp,Yp={};!function(){if(Jp)return Yp;Jp=1;var t=L(),e=tn().EXISTS,n=St(),r=Hs(),o=Function.prototype,i=n(o.toString),a=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,s=n(a.exec);t&&!e&&r(o,"name",{configurable:!0,get:function(){try{return s(a,i(this))[1]}catch(t){return""}}})}(),t.DOMComment=sc,t.DOMElement=uc,t.DOMNode=ac,t.DOMRange=cc,t.DOMSelection=fc,t.DOMStaticRange=dc,t.DOMText=lc,t.DomEditor=xf,t.ELEM_TO_HTML_CONF=ef,t.PARSE_ELEM_HTML_CONF=zc,t.PARSE_STYLE_HTML_FN_LIST=Vc,t.PRE_PARSE_HTML_CONF_LIST=Uc,t.RENDER_ELEM_CONF=Rp,t.RENDER_STYLE_HANDLER_LIST=Np,t.STYLE_TO_HTML_FN_LIST=tf,t.TEXT_TAGS=Wc,t.Toolbar=Gp,t.coreCreateEditor=function(t){var o=t.selector,i=void 0===o?"":o,a=t.config,s=void 0===a?{}:a,u=t.content,l=t.html,c=t.plugins,f=void 0===c?[]:c,d=function(t){return[Dd,pd,Ka,dd,Hd,Pd,jd,so.withHistory].reduce((function(t,e){return e(t)}),t)}(e.createEditor());if(i&&function(t,e){return Xc(t,"data-w-e-textarea",e)}(d,i))throw new Error("Repeated create editor by selector '".concat(i,"'"));var h=function(t){void 0===t&&(t={});var e=n(go),o={},i=t.MENU_CONF,a=void 0===i?{}:i;return r(e,(function(t,e){o[e]=co(co({},t),a[e]||{})})),delete t.MENU_CONF,co({scroll:!0,readOnly:!1,autoFocus:!0,decorate:function(){return[]},maxLength:0,MENU_CONF:o,hoverbarKeys:{},customAlert:function(t,e){window.alert("".concat(e,":\n").concat(t))}},t)}(s);La.set(d,h);var p=h.hoverbarKeys,g=void 0===p?{}:p;if(f.forEach((function(t){d=t(d)})),function(t,e){var n=e.html,r=e.content;null!=n&&(t.children=Qc(t,n)),r&&r.length&&(t.children=r),0===t.children.length&&(t.children=[{type:"paragraph",children:[{text:""}]}])}(d,{html:l,content:u}),i){var v=new Fp(i);xa.set(d,v),Ea.set(v,d),v.changeViewState(),rc((function(){var t=v.$scroll;null!=t&&t.height()<300&&console.warn("".concat(Bp.zh,"\n").concat(Bp.en),{element:t,height:t.height()})}));var m=void 0;Object.keys(g).length>0&&(m=new tp,Ca.set(m,d),ka.set(d,m)),d.on(vo.CHANGE,(function(){d.hidePanelOrModal()})),d.on(vo.SCROLL,(function(){d.hidePanelOrModal()}))}else d.children.forEach((function(t,e){return _p(t,e,d,d)}));var y=h.onCreated,b=h.onDestroyed;return y&&d.on(vo.CREATED,(function(){return y(d)})),b&&d.on(vo.DESTROYED,(function(){return b(d)})),rc((function(){return d.emit("created")})),d},t.coreCreateToolbar=function(t,e){if(null==t)throw new Error("Cannot create toolbar, because editor is null");var n=e.selector,r=e.config,o=void 0===r?{}:r;if(function(t,e){return Xc(t,"data-w-e-toolbar",e)}(t,n))throw new Error("Repeated create toolbar by selector '".concat(n,"'"));var i=co({toolbarKeys:[],excludeKeys:[],insertKeys:{index:0,keys:[]},modalAppendToBody:!1},o||{}),a=new Gp(n,i);return Sa.set(a,t),Oa.set(t,a),a},t.createUploader=function(t){var e=t.server,n=void 0===e?"":e,o=t.fieldName,i=void 0===o?"":o,a=t.maxFileSize,s=void 0===a?10485760:a,u=t.maxNumberOfFiles,l=void 0===u?100:u,c=t.meta,f=void 0===c?{}:c,p=t.metaWithUrl,g=void 0!==p&&p,v=t.headers,m=void 0===v?{}:v,y=t.withCredentials,b=void 0!==y&&y,w=t.timeout,x=void 0===w?1e4:w,E=t.onBeforeUpload,S=void 0===E?function(t){return t}:E,O=t.onSuccess,C=void 0===O?function(t,e){}:O,k=t.onError,T=void 0===k?function(t,e,n){console.error("".concat(t.name," upload error"),e,n)}:k,N=t.onProgress,R=void 0===N?function(t){}:N;if(!n)throw new Error("Cannot get upload server address\n没有配置上传地址");if(!i)throw new Error("Cannot get fieldName\n没有配置 fieldName");var L=n;g&&(L=function(t,e){var n=ho(t.split("#"),2),o=n[0],i=n[1],a=[];r(e,(function(t,e){a.push("".concat(e,"=").concat(t))}));var s=a.join("&");return o=o.indexOf("?")>0?"".concat(o,"&").concat(s):"".concat(o,"?").concat(s),i?"".concat(o,"#").concat(i):o}(L,f));var M=new d({onBeforeUpload:S,restrictions:{maxFileSize:s,maxNumberOfFiles:l},meta:f}).use(h,{endpoint:L,headers:m,formData:!0,fieldName:i,bundle:!0,withCredentials:b,timeout:x});return M.on("complete",(function(t){var e=t.successful[0],n=e.response,r=(null!=n?n:{}).body,o=void 0===r?{}:r;try{C(e,o)}catch(t){console.error("wangEditor upload file - onSuccess error",t)}})),M.on("progress",(function(t){t<1||R(t)})),M.on("upload-error",(function(t,e,n){try{T(t,e,n)}catch(t){console.error("wangEditor upload file - onError error",t)}})),M.on("restriction-failed",(function(t,e){try{T(t,e)}catch(t){console.error("wangEditor upload file - onError error",t)}})),M},t.genModalButtonElems=function(t,e){var n=o('<div class="button-container"></div>'),r=o('<button type="button" id="'.concat(t,'">').concat(e,"</button>"));return n.append(r),[n[0],r[0]]},t.genModalInputElems=function(t,e,n){var r=o('<label class="babel-container"></label>');r.append("<span>".concat(t,"</span>"));var i=o('<input type="text" id="'.concat(e,'" placeholder="').concat(n||"",'">'));return r.append(i),[r[0],i[0]]},t.genModalTextareaElems=function(t,e,n){var r=o('<label class="babel-container"></label>');r.append("<span>".concat(t,"</span>"));var i=o('<textarea type="text" id="'.concat(e,'" placeholder="').concat(n||"",'"></textarea>'));return r.append(i),[r[0],i[0]]},t.getDefaultView=bc,t.getEditableChild=Lc,t.getEditableChildAndIndex=Rc,t.getElementById=Nc,t.getFirstVoidChild=Pc,t.getPlainText=Mc,t.getTagName=Ac,t.hasShadowRoot=Tc,t.i18nAddResources=function(t,e){Mh.addResourceBundle(t,Ph,e,!0,!0)},t.i18nChangeLanguage=function(t){Mh.changeLanguage(t)},t.i18nGetResources=function(t){return Mh.getResourceBundle(t,Ph)},t.i18nListenLanguage=Dh,t.isDOMComment=xc,t.isDOMElement=Ec,t.isDOMNode=wc,t.isDOMSelection=Sc,t.isDOMText=Oc,t.isDataTransfer=gc,t.isDocument=hc,t.isHTMLElememt=yc,t.isPlainTextOnlyPaste=Cc,t.isShadowRoot=pc,t.isUnprocessedListElement=mc,t.normalizeDOMPoint=kc,t.registerElemToHtmlConf=function(t){var e=t.type,n=t.elemToHtml;ef[e||""]=n},t.registerMenu=function(t,e){var n=t.key,r=t.factory,o=t.config,i=co(co({},o),e||{});if(null!=mo[n])throw new Error("Duplicated key '".concat(n,"' in menu items"));mo[n]=r,function(t,e){null!=e&&(go[t]=e)}(n,i)},t.registerParseElemHtmlConf=function(t){var e=t.selector,n=t.parseElemHtml;zc[e]=n},t.registerParseStyleHtmlHandler=function(t){Vc.push(t)},t.registerPreParseHtmlConf=function(t){Uc.push(t)},t.registerRenderElemConf=function(t){var e=t.type,n=t.renderElem;Rp[e||""]=n},t.registerStyleHandler=function(t){Np.push(t)},t.registerStyleToHtmlHandler=function(t){tf.push(t)},t.t=Ah,t.walkTextNodes=Dc}));
|
|
8
|
+
function t(t){return"[object Object]"===Object.prototype.toString.call(t)}return eo=1,Object.defineProperty(oo,"__esModule",{value:!0}),oo.isPlainObject=function(e){var n,r;return!1!==t(e)&&(void 0===(n=e.constructor)||!1!==t(r=n.prototype)&&!1!==r.hasOwnProperty("isPrototypeOf"))},oo}function ao(){if(no)return ro;no=1;var t=io(),n=e,r={isHistory:function(e){return t.isPlainObject(e)&&Array.isArray(e.redos)&&Array.isArray(e.undos)&&(0===e.redos.length||n.Operation.isOperationList(e.redos[0].operations))&&(0===e.undos.length||n.Operation.isOperationList(e.undos[0].operations))}},o=new WeakMap,i=new WeakMap,a=new WeakMap,s={isHistoryEditor:function(t){return r.isHistory(t.history)&&n.Editor.isEditor(t)},isMerging:function(t){return a.get(t)},isSaving:function(t){return i.get(t)},redo:function(t){t.redo()},undo:function(t){t.undo()},withMerging:function(t,e){var n=s.isMerging(t);a.set(t,!0),e(),a.set(t,n)},withoutMerging:function(t,e){var n=s.isMerging(t);a.set(t,!1),e(),a.set(t,n)},withoutSaving:function(t,e){var n=s.isSaving(t);i.set(t,!1),e(),i.set(t,n)}};function u(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return l(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(t,e)}(t))||e){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var c=function(t,e){return!(!e||"insert_text"!==t.type||"insert_text"!==e.type||t.offset!==e.offset+e.text.length||!n.Path.equals(t.path,e.path))||!(!e||"remove_text"!==t.type||"remove_text"!==e.type||t.offset+t.text.length!==e.offset||!n.Path.equals(t.path,e.path))},f=function(t,e){return"set_selection"!==t.type};return ro.HISTORY=o,ro.History=r,ro.HistoryEditor=s,ro.MERGING=a,ro.SAVING=i,ro.withHistory=function(t){var e=t,r=e.apply;return e.history={undos:[],redos:[]},e.redo=function(){var t=e.history,r=t.redos;if(r.length>0){var o=r[r.length-1];o.selectionBefore&&n.Transforms.setSelection(e,o.selectionBefore),s.withoutSaving(e,(function(){n.Editor.withoutNormalizing(e,(function(){var t,n=u(o.operations);try{for(n.s();!(t=n.n()).done;){var r=t.value;e.apply(r)}}catch(t){n.e(t)}finally{n.f()}}))})),t.redos.pop(),e.writeHistory("undos",o)}},e.undo=function(){var t=e.history,r=t.undos;if(r.length>0){var o=r[r.length-1];s.withoutSaving(e,(function(){n.Editor.withoutNormalizing(e,(function(){var t,r=u(o.operations.map(n.Operation.inverse).reverse());try{for(r.s();!(t=r.n()).done;){var i=t.value;e.apply(i)}}catch(t){r.e(t)}finally{r.f()}o.selectionBefore&&n.Transforms.setSelection(e,o.selectionBefore)}))})),e.writeHistory("redos",o),t.undos.pop()}},e.apply=function(t){var n=e.operations,o=e.history,i=o.undos,a=i[i.length-1],u=a&&a.operations[a.operations.length-1],l=s.isSaving(e),d=s.isMerging(e);if(null==l&&(l=f(t)),l){if(null==d&&(d=null!=a&&(0!==n.length||c(t,u))),a&&d)a.operations.push(t);else{var h={operations:[t],selectionBefore:e.selection};e.writeHistory("undos",h)}for(;i.length>100;)i.shift();o.redos=[]}r(t)},e.writeHistory=function(t,n){e.history[t].push(n)},e},ro}var so=ao(),uo=function(t,e){return uo=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},uo(t,e)};function lo(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}uo(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var co=function(){return co=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},co.apply(this,arguments)};function fo(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function ho(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function po(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var go={};var vo={CREATED:"created",DESTROYED:"destroyed",CHANGE:"change",SCROLL:"scroll",FULLSCREEN:"fullscreen",UNFULLSCREEN:"unFullScreen"},mo={};var yo,bo,wo,xo,Eo,So,Oo,Co,ko,To,No,Ro,Lo,Mo,Po,Do,Ao,jo,Io,$o,Fo,_o,Bo,Ho,Wo,Uo,Vo,zo,Ko,qo,Go,Jo,Yo,Xo={};function Qo(){if(wo)return bo;wo=1;var t=Mt();return bo=t("document","documentElement")}function Zo(){if(Eo)return xo;Eo=1;var t,e=je(),n=function(){if(yo)return Xo;yo=1;var t=L(),e=Ae(),n=Ie(),r=je(),o=Nt(),i=Nr();return Xo.f=t&&!e?Object.defineProperties:function(t,e){r(t);for(var a,s=o(e),u=i(e),l=u.length,c=0;l>c;)n.f(t,a=u[c++],s[a]);return t},Xo}(),r=Dn(),o=on(),i=Qo(),a=Se(),s=rn(),u="prototype",l="script",c=s("IE_PROTO"),f=function(){},d=function(t){return"<"+l+">"+t+"</"+l+">"},h=function(t){t.write(d("")),t.close();var e=t.parentWindow.Object;return t=null,e},p=function(){try{t=new ActiveXObject("htmlfile")}catch(t){}var e,n,o;p="undefined"!=typeof document?document.domain&&t?h(t):(n=a("iframe"),o="java"+l+":",n.style.display="none",i.appendChild(n),n.src=String(o),(e=n.contentWindow.document).open(),e.write(d("document.F=Object")),e.close(),e.F):h(t);for(var s=r.length;s--;)delete p[u][r[s]];return p()};return o[c]=!0,xo=Object.create||function(t,r){var o;return null!==t?(f[u]=e(t),o=new f,f[u]=null,o[c]=t):o=p(),void 0===r?o:n.f(o,r)}}function ti(){if(Oo)return So;Oo=1;var t=we(),e=Zo(),n=Ie().f,r=t("unscopables"),o=Array.prototype;return void 0===o[r]&&n(o,r,{configurable:!0,value:e(null)}),So=function(t){o[r][t]=!0}}function ei(){return ko?Co:(ko=1,Co={})}function ni(){if(Lo)return Ro;Lo=1;var t=ye(),e=Rt(),n=me(),r=rn(),o=function(){if(No)return To;No=1;var t=R();return To=!t((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))}(),i=r("IE_PROTO"),a=Object,s=a.prototype;return Ro=o?a.getPrototypeOf:function(r){var o=n(r);if(t(o,i))return o[i];var u=o.constructor;return e(u)&&o instanceof u?u.prototype:o instanceof a?s:null}}function ri(){if(Po)return Mo;Po=1;var t,e,n,r=R(),o=Rt(),i=Lt(),a=Zo(),s=ni(),u=un(),l=we(),c=he(),f=l("iterator"),d=!1;return[].keys&&("next"in(n=[].keys())?(e=s(s(n)))!==Object.prototype&&(t=e):d=!0),!i(t)||r((function(){var e={};return t[f].call(e)!==e}))?t={}:c&&(t=a(t)),o(t[f])||u(t,f,(function(){return this})),Mo={IteratorPrototype:t,BUGGY_SAFARI_ITERATORS:d}}function oi(){if(Ao)return Do;Ao=1;var t=Ie().f,e=ye(),n=we()("toStringTag");return Do=function(r,o,i){r&&!i&&(r=r.prototype),r&&!e(r,n)&&t(r,n,{configurable:!0,value:o})}}function ii(){if(Bo)return _o;Bo=1;var t=Lt();return _o=function(e){return t(e)||null===e}}function ai(){if(Wo)return Ho;Wo=1;var t=ii(),e=String,n=TypeError;return Ho=function(r){if(t(r))return r;throw new n("Can't set "+e(r)+" as a prototype")}}function si(){if(Vo)return Uo;Vo=1;var t=function(){if(Fo)return $o;Fo=1;var t=St(),e=_t();return $o=function(n,r,o){try{return t(e(Object.getOwnPropertyDescriptor(n,r)[o]))}catch(t){}}}(),e=Lt(),n=Tt(),r=ai();return Uo=Object.setPrototypeOf||("__proto__"in{}?function(){var o,i=!1,a={};try{(o=t(Object.prototype,"__proto__","set"))(a,[]),i=a instanceof Array}catch(t){}return function(t,a){return n(t),r(a),e(t)?(i?o(t,a):t.__proto__=a,t):t}}():void 0)}function ui(){if(Ko)return zo;Ko=1;var t=pr(),e=P(),n=he(),r=tn(),o=Rt(),i=function(){if(Io)return jo;Io=1;var t=ri().IteratorPrototype,e=Zo(),n=Et(),r=oi(),o=ei(),i=function(){return this};return jo=function(a,s,u,l){var c=s+" Iterator";return a.prototype=e(t,{next:n(+!l,u)}),r(a,c,!1,!0),o[c]=i,a}}(),a=ni(),s=si(),u=oi(),l=$e(),c=un(),f=we(),d=ei(),h=ri(),p=r.PROPER,g=r.CONFIGURABLE,v=h.IteratorPrototype,m=h.BUGGY_SAFARI_ITERATORS,y=f("iterator"),b="keys",w="values",x="entries",E=function(){return this};return zo=function(r,f,h,S,O,C,k){i(h,f,S);var T,N,R,L=function(t){if(t===O&&j)return j;if(!m&&t&&t in D)return D[t];switch(t){case b:case w:case x:return function(){return new h(this,t)}}return function(){return new h(this)}},M=f+" Iterator",P=!1,D=r.prototype,A=D[y]||D["@@iterator"]||O&&D[O],j=!m&&A||L(O),I="Array"===f&&D.entries||A;if(I&&(T=a(I.call(new r)))!==Object.prototype&&T.next&&(n||a(T)===v||(s?s(T,v):o(T[y])||c(T,y,E)),u(T,M,!0,!0),n&&(d[M]=E)),p&&O===w&&A&&A.name!==w&&(!n&&g?l(D,"name",w):(P=!0,j=function(){return e(A,this)})),O)if(N={values:L(w),keys:C?j:L(b),entries:L(x)},k)for(R in N)(m||P||!(R in D))&&c(D,R,N[R]);else t({target:f,proto:!0,forced:m||P},N);return n&&!k||D[y]===j||c(D,y,j,{name:O}),d[f]=j,N}}function li(){return Go?qo:(Go=1,qo=function(t,e){return{value:t,done:e}})}function ci(){if(Yo)return Jo;Yo=1;var t=Nt(),e=ti(),n=ei(),r=an(),o=Ie().f,i=ui(),a=li(),s=he(),u=L(),l="Array Iterator",c=r.set,f=r.getterFor(l);Jo=i(Array,"Array",(function(e,n){c(this,{type:l,target:t(e),index:0,kind:n})}),(function(){var t=f(this),e=t.target,n=t.index++;if(!e||n>=e.length)return t.target=null,a(void 0,!0);switch(t.kind){case"keys":return a(n,!1);case"values":return a(e[n],!1)}return a([n,e[n]],!1)}),"values");var d=n.Arguments=n.Array;if(e("keys"),e("values"),e("entries"),!s&&u&&"values"!==d.name)try{o(d,"name",{value:"values"})}catch(t){}return Jo}ci();var fi,di,hi,pi,gi,vi={};function mi(){if(di)return fi;di=1;var t=br(),e=String;return fi=function(n){if("Symbol"===t(n))throw new TypeError("Cannot convert a Symbol value to a string");return e(n)}}function yi(){if(pi)return hi;pi=1;var t=St(),e=Tn(),n=mi(),r=Tt(),o=t("".charAt),i=t("".charCodeAt),a=t("".slice),s=function(t){return function(s,u){var l,c,f=n(r(s)),d=e(u),h=f.length;return d<0||d>=h?t?"":void 0:(l=i(f,d))<55296||l>56319||d+1===h||(c=i(f,d+1))<56320||c>57343?t?o(f,d):l:t?a(f,d,d+2):c-56320+(l-55296<<10)+65536}};return hi={codeAt:s(!1),charAt:s(!0)}}!function(){if(gi)return vi;gi=1;var t=yi().charAt,e=mi(),n=an(),r=ui(),o=li(),i="String Iterator",a=n.set,s=n.getterFor(i);r(String,"String",(function(t){a(this,{type:i,string:e(t),index:0})}),(function(){var e,n=s(this),r=n.string,i=n.index;return i>=r.length?o(void 0,!0):(e=t(r,i),n.index+=e.length,o(e,!1))}))}();var bi,wi,xi,Ei,Si={};function Oi(){if(wi)return bi;wi=1;var t=R();return bi=!t((function(){return Object.isExtensible(Object.preventExtensions({}))}))}function Ci(){if(Ei)return xi;Ei=1;var t=un();return xi=function(e,n,r){for(var o in n)t(e,o,n[o],r);return e}}var ki,Ti,Ni,Ri,Li,Mi,Pi,Di,Ai,ji,Ii,$i,Fi,_i,Bi,Hi,Wi,Ui,Vi,zi,Ki,qi,Gi,Ji,Yi,Xi,Qi,Zi,ta,ea,na={exports:{}},ra={};function oa(){if(Ti)return ki;Ti=1;var t=St();return ki=t([].slice)}function ia(){if(Ni)return ra;Ni=1;var t=Ot(),e=Nt(),n=An().f,r=oa(),o="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];return ra.f=function(i){return o&&"Window"===t(i)?function(t){try{return n(t)}catch(t){return r(o)}}(i):n(e(i))},ra}function aa(){if(Pi)return Mi;Pi=1;var t=R(),e=Lt(),n=Ot(),r=function(){if(Li)return Ri;Li=1;var t=R();return Ri=t((function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}}))}(),o=Object.isExtensible,i=t((function(){}));return Mi=i||r?function(t){return!!e(t)&&((!r||"ArrayBuffer"!==n(t))&&(!o||o(t)))}:o}function sa(){if(Di)return na.exports;Di=1;var t=pr(),e=St(),n=on(),r=Lt(),o=ye(),i=Ie().f,a=An(),s=ia(),u=aa(),l=be(),c=Oi(),f=!1,d=l("meta"),h=0,p=function(t){i(t,d,{value:{objectID:"O"+h++,weakData:{}}})},g=na.exports={enable:function(){g.enable=function(){},f=!0;var n=a.f,r=e([].splice),o={};o[d]=1,n(o).length&&(a.f=function(t){for(var e=n(t),o=0,i=e.length;o<i;o++)if(e[o]===d){r(e,o,1);break}return e},t({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:s.f}))},fastKey:function(t,e){if(!r(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,d)){if(!u(t))return"F";if(!e)return"E";p(t)}return t[d].objectID},getWeakData:function(t,e){if(!o(t,d)){if(!u(t))return!0;if(!e)return!1;p(t)}return t[d].weakData},onFreeze:function(t){return c&&f&&u(t)&&!o(t,d)&&p(t),t}};return n[d]=!0,na.exports}function ua(){if(ji)return Ai;ji=1;var t=we(),e=ei(),n=t("iterator"),r=Array.prototype;return Ai=function(t){return void 0!==t&&(e.Array===t||r[n]===t)}}function la(){if($i)return Ii;$i=1;var t=br(),e=Bt(),n=kt(),r=ei(),o=we()("iterator");return Ii=function(i){if(!n(i))return e(i,o)||e(i,"@@iterator")||r[t(i)]}}function ca(){if(_i)return Fi;_i=1;var t=P(),e=_t(),n=je(),r=Ft(),o=la(),i=TypeError;return Fi=function(a,s){var u=arguments.length<2?o(a):s;if(e(u))return n(t(u,a));throw new i(r(a)+" is not iterable")},Fi}function fa(){if(Hi)return Bi;Hi=1;var t=P(),e=je(),n=Bt();return Bi=function(r,o,i){var a,s;e(r);try{if(!(a=n(r,"return"))){if("throw"===o)throw i;return i}a=t(a,r)}catch(t){s=!0,a=t}if("throw"===o)throw i;if(s)throw a;return e(a),i}}function da(){if(Ui)return Wi;Ui=1;var t=Qr(),e=P(),n=je(),r=Ft(),o=ua(),i=Ln(),a=Pt(),s=ca(),u=la(),l=fa(),c=TypeError,f=function(t,e){this.stopped=t,this.result=e},d=f.prototype;return Wi=function(h,p,g){var v,m,y,b,w,x,E,S=g&&g.that,O=!(!g||!g.AS_ENTRIES),C=!(!g||!g.IS_RECORD),k=!(!g||!g.IS_ITERATOR),T=!(!g||!g.INTERRUPTED),N=t(p,S),R=function(t){return v&&l(v,"normal",t),new f(!0,t)},L=function(t){return O?(n(t),T?N(t[0],t[1],R):N(t[0],t[1])):T?N(t,R):N(t)};if(C)v=h.iterator;else if(k)v=h;else{if(!(m=u(h)))throw new c(r(h)+" is not iterable");if(o(m)){for(y=0,b=i(h);b>y;y++)if((w=L(h[y]))&&a(d,w))return w;return new f(!1)}v=s(h,m)}for(x=C?h.next:v.next;!(E=e(x,v)).done;){try{w=L(E.value)}catch(t){l(v,"throw",t)}if("object"==typeof w&&w&&a(d,w))return w}return new f(!1)}}function ha(){if(zi)return Vi;zi=1;var t=Pt(),e=TypeError;return Vi=function(n,r){if(t(r,n))return n;throw new e("Incorrect invocation")}}function pa(){if(qi)return Ki;qi=1;var t=we()("iterator"),e=!1;try{var n=0,r={next:function(){return{done:!!n++}},return:function(){e=!0}};r[t]=function(){return this},Array.from(r,(function(){throw 2}))}catch(t){}return Ki=function(n,r){try{if(!r&&!e)return!1}catch(t){return!1}var o=!1;try{var i={};i[t]=function(){return{next:function(){return{done:o=!0}}}},n(i)}catch(t){}return o}}function ga(){if(Ji)return Gi;Ji=1;var t=Rt(),e=Lt(),n=si();return Gi=function(r,o,i){var a,s;return n&&t(a=o.constructor)&&a!==i&&e(s=a.prototype)&&s!==i.prototype&&n(r,s),r}}function va(){if(Xi)return Yi;Xi=1;var t=pr(),e=b(),n=St(),r=hr(),o=un(),i=sa(),a=da(),s=ha(),u=Rt(),l=kt(),c=Lt(),f=R(),d=pa(),h=oi(),p=ga();return Yi=function(g,v,m){var y=-1!==g.indexOf("Map"),b=-1!==g.indexOf("Weak"),w=y?"set":"add",x=e[g],E=x&&x.prototype,S=x,O={},C=function(t){var e=n(E[t]);o(E,t,"add"===t?function(t){return e(this,0===t?0:t),this}:"delete"===t?function(t){return!(b&&!c(t))&&e(this,0===t?0:t)}:"get"===t?function(t){return b&&!c(t)?void 0:e(this,0===t?0:t)}:"has"===t?function(t){return!(b&&!c(t))&&e(this,0===t?0:t)}:function(t,n){return e(this,0===t?0:t,n),this})};if(r(g,!u(x)||!(b||E.forEach&&!f((function(){(new x).entries().next()})))))S=m.getConstructor(v,g,y,w),i.enable();else if(r(g,!0)){var k=new S,T=k[w](b?{}:-0,1)!==k,N=f((function(){k.has(1)})),R=d((function(t){new x(t)})),L=!b&&f((function(){for(var t=new x,e=5;e--;)t[w](e,e);return!t.has(-0)}));R||((S=v((function(t,e){s(t,E);var n=p(new x,t,S);return l(e)||a(e,n[w],{that:n,AS_ENTRIES:y}),n}))).prototype=E,E.constructor=S),(N||L)&&(C("delete"),C("has"),y&&C("get")),(L||T)&&C(w),b&&E.clear&&delete E.clear}return O[g]=S,t({global:!0,constructor:!0,forced:S!==x},O),h(S,g),b||m.setStrong(S,g,y),S},Yi}function ma(){if(Zi)return Qi;Zi=1;var t=St(),e=Ci(),n=sa().getWeakData,r=ha(),o=je(),i=kt(),a=Lt(),s=da(),u=Zr(),l=ye(),c=an(),f=c.set,d=c.getterFor,h=u.find,p=u.findIndex,g=t([].splice),v=0,m=function(t){return t.frozen||(t.frozen=new y)},y=function(){this.entries=[]},b=function(t,e){return h(t.entries,(function(t){return t[0]===e}))};return y.prototype={get:function(t){var e=b(this,t);if(e)return e[1]},has:function(t){return!!b(this,t)},set:function(t,e){var n=b(this,t);n?n[1]=e:this.entries.push([t,e])},delete:function(t){var e=p(this.entries,(function(e){return e[0]===t}));return~e&&g(this.entries,e,1),!!~e}},Qi={getConstructor:function(t,u,c,h){var p=t((function(t,e){r(t,g),f(t,{type:u,id:v++,frozen:null}),i(e)||s(e,t[h],{that:t,AS_ENTRIES:c})})),g=p.prototype,y=d(u),b=function(t,e,r){var i=y(t),a=n(o(e),!0);return!0===a?m(i).set(e,r):a[i.id]=r,t};return e(g,{delete:function(t){var e=y(this);if(!a(t))return!1;var r=n(t);return!0===r?m(e).delete(t):r&&l(r,e.id)&&delete r[e.id]},has:function(t){var e=y(this);if(!a(t))return!1;var r=n(t);return!0===r?m(e).has(t):r&&l(r,e.id)}}),e(g,c?{get:function(t){var e=y(this);if(a(t)){var r=n(t);if(!0===r)return m(e).get(t);if(r)return r[e.id]}},set:function(t,e){return b(this,t,e)}}:{add:function(t){return b(this,t,!0)}}),p}}}ea||(ea=1,function(){if(ta)return Si;ta=1;var t,e=Oi(),n=b(),r=St(),o=Ci(),i=sa(),a=va(),s=ma(),u=Lt(),l=an().enforce,c=R(),f=nn(),d=Object,h=Array.isArray,p=d.isExtensible,g=d.isFrozen,v=d.isSealed,m=d.freeze,y=d.seal,w=!n.ActiveXObject&&"ActiveXObject"in n,x=function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},E=a("WeakMap",x,s),S=E.prototype,O=r(S.set);if(f)if(w){t=s.getConstructor(x,"WeakMap",!0),i.enable();var C=r(S.delete),k=r(S.has),T=r(S.get);o(S,{delete:function(e){if(u(e)&&!p(e)){var n=l(this);return n.frozen||(n.frozen=new t),C(this,e)||n.frozen.delete(e)}return C(this,e)},has:function(e){if(u(e)&&!p(e)){var n=l(this);return n.frozen||(n.frozen=new t),k(this,e)||n.frozen.has(e)}return k(this,e)},get:function(e){if(u(e)&&!p(e)){var n=l(this);return n.frozen||(n.frozen=new t),k(this,e)?T(this,e):n.frozen.get(e)}return T(this,e)},set:function(e,n){if(u(e)&&!p(e)){var r=l(this);r.frozen||(r.frozen=new t),k(this,e)?O(this,e,n):r.frozen.set(e,n)}else O(this,e,n);return this}})}else e&&c((function(){var t=m([]);return O(new E,t,1),!g(t)}))&&o(S,{set:function(t,e){var n;return h(t)&&(g(t)?n=m:v(t)&&(n=y)),O(this,t,e),n&&n(t),this}})}());var ya,ba={};!function(){if(ya)return ba;ya=1;var t=b(),e=Jr(),n=Yr(),r=ci(),o=$e(),i=oi(),a=we()("iterator"),s=r.values,u=function(t,n){if(t){if(t[a]!==s)try{o(t,a,s)}catch(e){t[a]=s}if(i(t,n,!0),e[n])for(var u in r)if(t[u]!==r[u])try{o(t,u,r[u])}catch(e){t[u]=r[u]}}};for(var l in e)u(t[l]&&t[l].prototype,l);u(n,"DOMTokenList")}();var wa,xa=new WeakMap,Ea=new WeakMap,Sa=new WeakMap,Oa=new WeakMap,Ca=new WeakMap,ka=new WeakMap,Ta=new WeakMap,Na=new WeakMap,Ra=new WeakMap,La=new WeakMap,Ma=new WeakMap,Pa=new WeakMap,Da=new WeakMap,Aa=new WeakMap,ja=new WeakMap,Ia=new WeakMap,$a=new WeakMap,Fa=new WeakMap,_a=new WeakMap,Ba=new WeakMap,Ha=new WeakMap,Wa=new WeakMap,Ua=new WeakMap,Va=new WeakMap,za=new WeakMap,Ka=function(t){var e=t;return e.getAllMenuKeys=function(){var t=[];for(var e in mo)t.push(e);return t},e.getConfig=function(){var t=La.get(e);if(null==t)throw new Error("Can not get editor config");return t},e.getMenuConfig=function(t){var n=e.getConfig().MENU_CONF;return(void 0===n?{}:n)[t]||{}},e.alert=function(t,n){void 0===n&&(n="info");var r=e.getConfig().customAlert;r&&r(t,n)},e},qa={};!function(){if(wa)return qa;wa=1;var t=pr(),e=Zr().filter;t({target:"Array",proto:!0,forced:!Sr()("filter")},{filter:function(t){return e(this,t,arguments.length>1?arguments[1]:void 0)}})}();var Ga,Ja,Ya,Xa,Qa,Za={};function ts(){if(Ja)return Ga;Ja=1;var t=je(),e=fa();return Ga=function(n,r,o,i){try{return i?r(t(o)[0],o[1]):r(o)}catch(t){e(n,"throw",t)}}}!function(){if(Qa)return Za;Qa=1;var t=pr(),e=function(){if(Xa)return Ya;Xa=1;var t=Qr(),e=P(),n=me(),r=ts(),o=ua(),i=wr(),a=Ln(),s=mr(),u=ca(),l=la(),c=Array;return Ya=function(f){var d=n(f),h=i(this),p=arguments.length,g=p>1?arguments[1]:void 0,v=void 0!==g;v&&(g=t(g,p>2?arguments[2]:void 0));var m,y,b,w,x,E,S=l(d),O=0;if(!S||this===c&&o(S))for(m=a(d),y=h?new this(m):c(m);m>O;O++)E=v?g(d[O],O):d[O],s(y,O,E);else for(y=h?new this:[],x=(w=u(d,S)).next;!(b=e(x,w)).done;O++)E=v?r(w,g,[b.value,O],!0):b.value,s(y,O,E);return y.length=O,y},Ya}();t({target:"Array",stat:!0,forced:!pa()((function(t){Array.from(t)}))},{from:e})}();var es,ns={};!function(){if(es)return ns;es=1;var t=pr(),e=Mn().includes,n=R(),r=ti();t({target:"Array",proto:!0,forced:n((function(){return!Array(1).includes()}))},{includes:function(t){return e(this,t,arguments.length>1?arguments[1]:void 0)}}),r("includes")}();var rs,os={};!function(){if(rs)return os;rs=1;var t=pr(),e=St(),n=Ct(),r=Nt(),o=to(),i=e([].join);t({target:"Array",proto:!0,forced:n!==Object||!o("join",",")},{join:function(t){return i(r(this),void 0===t?",":t)}})}();var is,as={};!function(){if(is)return as;is=1;var t=pr(),e=Zr().map;t({target:"Array",proto:!0,forced:!Sr()("map")},{map:function(t){return e(this,t,arguments.length>1?arguments[1]:void 0)}})}();var ss,us,ls,cs,fs,ds,hs,ps={};function gs(){if(us)return ss;us=1;var t=Lt(),e=Ot(),n=we()("match");return ss=function(r){var o;return t(r)&&(void 0!==(o=r[n])?!!o:"RegExp"===e(r))}}function vs(){if(cs)return ls;cs=1;var t=gs(),e=TypeError;return ls=function(n){if(t(n))throw new e("The method doesn't accept regular expressions");return n}}function ms(){if(ds)return fs;ds=1;var t=we()("match");return fs=function(e){var n=/./;try{"/./"[e](n)}catch(r){try{return n[t]=!1,"/./"[e](n)}catch(t){}}return!1}}!function(){if(hs)return ps;hs=1;var t=pr(),e=St(),n=vs(),r=Tt(),o=mi(),i=ms(),a=e("".indexOf);t({target:"String",proto:!0,forced:!i("includes")},{includes:function(t){return!!~a(o(r(this)),o(n(t)),arguments.length>1?arguments[1]:void 0)}})}();var ys,bs,ws,xs,Es,Ss,Os,Cs={};function ks(){return bs?ys:(bs=1,ys="\t\n\v\f\r \u2028\u2029\ufeff")}!function(){if(Os)return Cs;Os=1;var t=pr(),e=function(){if(xs)return ws;xs=1;var t=St(),e=Tt(),n=mi(),r=ks(),o=t("".replace),i=RegExp("^["+r+"]+"),a=RegExp("(^|[^"+r+"])["+r+"]+$"),s=function(t){return function(r){var s=n(e(r));return 1&t&&(s=o(s,i,"")),2&t&&(s=o(s,a,"$1")),s}};return ws={start:s(1),end:s(2),trim:s(3)}}().trim,n=function(){if(Ss)return Es;Ss=1;var t=tn().PROPER,e=R(),n=ks();return Es=function(r){return e((function(){return!!n[r]()||"
"!=="
"[r]()||t&&n[r].name!==r}))}}();t({target:"String",proto:!0,forced:n("trim")},{trim:function(){return e(this)}})}();var Ts,Ns,Rs,Ls,Ms,Ps={};!function(){if(Ms)return Ps;Ms=1;var t=pr(),e=function(){if(Ns)return Ts;Ns=1;var t=St(),e=Tt(),n=mi(),r=/"/g,o=t("".replace);return Ts=function(t,i,a,s){var u=n(e(t)),l="<"+i;return""!==a&&(l+=" "+a+'="'+o(n(s),r,""")+'"'),l+">"+u+"</"+i+">"}}(),n=function(){if(Ls)return Rs;Ls=1;var t=R();return Rs=function(e){return t((function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}))}}();t({target:"String",proto:!0,forced:n("anchor")},{anchor:function(t){return e(this,"a","name",t)}})}();var Ds,As,js,Is,$s,Fs,_s,Bs;function Hs(){if(As)return Ds;As=1;var t=sn(),e=Ie();return Ds=function(n,r,o){return o.get&&t(o.get,r,{getter:!0}),o.set&&t(o.set,r,{setter:!0}),e.f(n,r,o)}}function Ws(){if(Is)return js;Is=1;var t=Mt(),e=Hs(),n=we(),r=L(),o=n("species");return js=function(n){var i=t(n);r&&i&&!i[o]&&e(i,o,{configurable:!0,get:function(){return this}})}}Bs||(Bs=1,_s||(_s=1,va()("Set",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),function(){if(Fs)return $s;Fs=1;var t=Zo(),e=Hs(),n=Ci(),r=Qr(),o=ha(),i=kt(),a=da(),s=ui(),u=li(),l=Ws(),c=L(),f=sa().fastKey,d=an(),h=d.set,p=d.getterFor;return $s={getConstructor:function(s,u,l,d){var g=s((function(e,n){o(e,v),h(e,{type:u,index:t(null),first:null,last:null,size:0}),c||(e.size=0),i(n)||a(n,e[d],{that:e,AS_ENTRIES:l})})),v=g.prototype,m=p(u),y=function(t,e,n){var r,o,i=m(t),a=b(t,e);return a?a.value=n:(i.last=a={index:o=f(e,!0),key:e,value:n,previous:r=i.last,next:null,removed:!1},i.first||(i.first=a),r&&(r.next=a),c?i.size++:t.size++,"F"!==o&&(i.index[o]=a)),t},b=function(t,e){var n,r=m(t),o=f(e);if("F"!==o)return r.index[o];for(n=r.first;n;n=n.next)if(n.key===e)return n};return n(v,{clear:function(){for(var e=m(this),n=e.first;n;)n.removed=!0,n.previous&&(n.previous=n.previous.next=null),n=n.next;e.first=e.last=null,e.index=t(null),c?e.size=0:this.size=0},delete:function(t){var e=this,n=m(e),r=b(e,t);if(r){var o=r.next,i=r.previous;delete n.index[r.index],r.removed=!0,i&&(i.next=o),o&&(o.previous=i),n.first===r&&(n.first=o),n.last===r&&(n.last=i),c?n.size--:e.size--}return!!r},forEach:function(t){for(var e,n=m(this),o=r(t,arguments.length>1?arguments[1]:void 0);e=e?e.next:n.first;)for(o(e.value,e.key,this);e&&e.removed;)e=e.previous},has:function(t){return!!b(this,t)}}),n(v,l?{get:function(t){var e=b(this,t);return e&&e.value},set:function(t,e){return y(this,0===t?0:t,e)}}:{add:function(t){return y(this,t=0===t?0:t,t)}}),c&&e(v,"size",{configurable:!0,get:function(){return m(this).size}}),g},setStrong:function(t,e,n){var r=e+" Iterator",o=p(e),i=p(r);s(t,e,(function(t,e){h(this,{type:r,target:t,state:o(t),kind:e,last:null})}),(function(){for(var t=i(this),e=t.kind,n=t.last;n&&n.removed;)n=n.previous;return t.target&&(t.last=n=n?n.next:t.state.first)?u("keys"===e?n.key:"values"===e?n.value:[n.key,n.value],!1):(t.target=null,u(void 0,!0))}),n?"entries":"values",!n,!0),l(e)}},$s}())));var Us,Vs,zs,Ks,qs,Gs,Js,Ys,Xs,Qs,Zs,tu=new Set(["doctype","!doctype","meta","script","style","link","frame","iframe","title","svg"]),eu={};function nu(){if(Vs)return Us;Vs=1;var t=je();return Us=function(){var e=t(this),n="";return e.hasIndices&&(n+="d"),e.global&&(n+="g"),e.ignoreCase&&(n+="i"),e.multiline&&(n+="m"),e.dotAll&&(n+="s"),e.unicode&&(n+="u"),e.unicodeSets&&(n+="v"),e.sticky&&(n+="y"),n}}function ru(){if(Ks)return zs;Ks=1;var t=R(),e=b().RegExp,n=t((function(){var t=e("a","y");return t.lastIndex=2,null!==t.exec("abcd")})),r=n||t((function(){return!e("a","y").sticky})),o=n||t((function(){var t=e("^r","gy");return t.lastIndex=2,null!==t.exec("str")}));return zs={BROKEN_CARET:o,MISSED_STICKY:r,UNSUPPORTED_Y:n}}function ou(){if(Gs)return qs;Gs=1;var t=R(),e=b().RegExp;return qs=t((function(){var t=e(".","s");return!(t.dotAll&&t.test("\n")&&"s"===t.flags)}))}function iu(){if(Ys)return Js;Ys=1;var t=R(),e=b().RegExp;return Js=t((function(){var t=e("(?<a>b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")}))}function au(){if(Qs)return Xs;Qs=1;var t,e,n=P(),r=St(),o=mi(),i=nu(),a=ru(),s=ve(),u=Zo(),l=an().get,c=ou(),f=iu(),d=s("native-string-replace",String.prototype.replace),h=RegExp.prototype.exec,p=h,g=r("".charAt),v=r("".indexOf),m=r("".replace),y=r("".slice),b=(e=/b*/g,n(h,t=/a/,"a"),n(h,e,"a"),0!==t.lastIndex||0!==e.lastIndex),w=a.BROKEN_CARET,x=void 0!==/()??/.exec("")[1];return(b||x||w||c||f)&&(p=function(t){var e,r,a,s,c,f,E,S=this,O=l(S),C=o(t),k=O.raw;if(k)return k.lastIndex=S.lastIndex,e=n(p,k,C),S.lastIndex=k.lastIndex,e;var T=O.groups,N=w&&S.sticky,R=n(i,S),L=S.source,M=0,P=C;if(N&&(R=m(R,"y",""),-1===v(R,"g")&&(R+="g"),P=y(C,S.lastIndex),S.lastIndex>0&&(!S.multiline||S.multiline&&"\n"!==g(C,S.lastIndex-1))&&(L="(?: "+L+")",P=" "+P,M++),r=new RegExp("^(?:"+L+")",R)),x&&(r=new RegExp("^"+L+"$(?!\\s)",R)),b&&(a=S.lastIndex),s=n(h,N?r:S,P),N?s?(s.input=y(s.input,M),s[0]=y(s[0],M),s.index=S.lastIndex,S.lastIndex+=s[0].length):S.lastIndex=0:b&&s&&(S.lastIndex=S.global?s.index+s[0].length:a),x&&s&&s.length>1&&n(d,s[0],r,(function(){for(c=1;c<arguments.length-2;c++)void 0===arguments[c]&&(s[c]=void 0)})),s&&T)for(s.groups=f=u(null),c=0;c<T.length;c++)f[(E=T[c])[0]]=s[E[1]];return s}),Xs=p}function su(){if(Zs)return eu;Zs=1;var t=pr(),e=au();return t({target:"RegExp",proto:!0,forced:/./.exec!==e},{exec:e}),eu}su();var uu,lu,cu,fu,du,hu,pu,gu,vu,mu,yu,bu={};function wu(){if(lu)return uu;lu=1,su();var t=P(),e=un(),n=au(),r=R(),o=we(),i=$e(),a=o("species"),s=RegExp.prototype;return uu=function(u,l,c,f){var d=o(u),h=!r((function(){var t={};return t[d]=function(){return 7},7!==""[u](t)})),p=h&&!r((function(){var t=!1,e=/a/;return"split"===u&&((e={}).constructor={},e.constructor[a]=function(){return e},e.flags="",e[d]=/./[d]),e.exec=function(){return t=!0,null},e[d](""),!t}));if(!h||!p||c){var g=/./[d],v=l(d,""[u],(function(e,r,o,i,a){var u=r.exec;return u===n||u===s.exec?h&&!a?{done:!0,value:t(g,r,o,i)}:{done:!0,value:t(e,o,r,i)}:{done:!1}}));e(String.prototype,u,v[0]),e(s,d,v[1])}f&&i(s[d],"sham",!0)},uu}function xu(){if(fu)return cu;fu=1;var t=wr(),e=Ft(),n=TypeError;return cu=function(r){if(t(r))return r;throw new n(e(r)+" is not a constructor")}}function Eu(){if(hu)return du;hu=1;var t=je(),e=xu(),n=kt(),r=we()("species");return du=function(o,i){var a,s=t(o).constructor;return void 0===s||n(a=t(s)[r])?i:e(a)}}function Su(){if(gu)return pu;gu=1;var t=yi().charAt;return pu=function(e,n,r){return n+(r?t(e,n).length:1)}}function Ou(){if(mu)return vu;mu=1;var t=P(),e=je(),n=Rt(),r=Ot(),o=au(),i=TypeError;return vu=function(a,s){var u=a.exec;if(n(u)){var l=t(u,a,s);return null!==l&&e(l),l}if("RegExp"===r(a))return t(o,a,s);throw new i("RegExp#exec called on incompatible receiver")}}!function(){if(yu)return bu;yu=1;var t=P(),e=St(),n=wu(),r=je(),o=kt(),i=Tt(),a=Eu(),s=Su(),u=Rn(),l=mi(),c=Bt(),f=Ou(),d=ru(),h=R(),p=d.UNSUPPORTED_Y,g=Math.min,v=e([].push),m=e("".slice),y=!h((function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var n="ab".split(t);return 2!==n.length||"a"!==n[0]||"b"!==n[1]})),b="c"==="abbc".split(/(b)*/)[1]||4!=="test".split(/(?:)/,-1).length||2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length;n("split",(function(e,n,d){var h="0".split(void 0,0).length?function(e,r){return void 0===e&&0===r?[]:t(n,this,e,r)}:n;return[function(n,r){var a=i(this),s=o(n)?void 0:c(n,e);return s?t(s,n,a,r):t(h,l(a),n,r)},function(t,e){var o=r(this),i=l(t);if(!b){var c=d(h,o,i,e,h!==n);if(c.done)return c.value}var y=a(o,RegExp),w=o.unicode,x=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(p?"g":"y"),E=new y(p?"^(?:"+o.source+")":o,x),S=void 0===e?4294967295:e>>>0;if(0===S)return[];if(0===i.length)return null===f(E,i)?[i]:[];for(var O=0,C=0,k=[];C<i.length;){E.lastIndex=p?0:C;var T,N=f(E,p?m(i,C):i);if(null===N||(T=g(u(E.lastIndex+(p?C:0)),i.length))===O)C=s(i,C,w);else{if(v(k,m(i,O,C)),k.length===S)return k;for(var R=1;R<=N.length-1;R++)if(v(k,N[R]),k.length===S)return k;C=O=T}}return v(k,m(i,O)),k}]}),b||!y,p)}();var Cu,ku,Tu,Nu={};!function(){if(Tu)return Nu;Tu=1;var t=pr(),e=function(){if(ku)return Cu;ku=1;var t=gr(),e=Ln(),n=vr(),r=Qr(),o=function(i,a,s,u,l,c,f,d){for(var h,p,g=l,v=0,m=!!f&&r(f,d);v<u;)v in s&&(h=m?m(s[v],v,a):s[v],c>0&&t(h)?(p=e(h),g=o(i,a,h,p,g,c-1)-1):(n(g+1),i[g]=h),g++),v++;return g};return Cu=o}(),n=_t(),r=me(),o=Ln(),i=Er();t({target:"Array",proto:!0},{flatMap:function(t){var a,s=r(this),u=o(s);return n(t),(a=i(s,0)).length=e(a,s,s,u,0,1,t,arguments.length>1?arguments[1]:void 0),a}})}();var Ru;Ru||(Ru=1,ti()("flatMap"));var Lu,Mu={};!function(){if(Lu)return Mu;Lu=1;var t=pr(),e=Zr().find,n=ti(),r="find",o=!0;r in[]&&Array(1)[r]((function(){o=!1})),t({target:"Array",proto:!0,forced:o},{find:function(t){return e(this,t,arguments.length>1?arguments[1]:void 0)}}),n(r)}();var Pu,Du,Au={};Du||(Du=1,function(){if(Pu)return Au;Pu=1;var t=pr(),e=b();t({global:!0,forced:e.globalThis!==e},{globalThis:e})}());const ju=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];var Iu,$u,Fu,_u,Bu,Hu,Wu,Uu,Vu,zu,Ku,qu,Gu,Ju,Yu,Xu,Qu,Zu,tl,el,nl,rl,ol,il,al,sl,ul,ll,cl,fl,dl={};function hl(){if($u)return Iu;$u=1;var t=b(),e=Dt(),n=Ot(),r=function(t){return e.slice(0,t.length)===t};return Iu=r("Bun/")?"BUN":r("Cloudflare-Workers")?"CLOUDFLARE":r("Deno/")?"DENO":r("Node.js/")?"NODE":t.Bun&&"string"==typeof Bun.version?"BUN":t.Deno&&"object"==typeof Deno.version?"DENO":"process"===n(t.process)?"NODE":t.window&&t.document?"BROWSER":"REST"}function pl(){if(_u)return Fu;_u=1;var t=hl();return Fu="NODE"===t}function gl(){if(Hu)return Bu;Hu=1;var t=M(),e=Function.prototype,n=e.apply,r=e.call;return Bu="object"==typeof Reflect&&Reflect.apply||(t?r.bind(n):function(){return r.apply(n,arguments)}),Bu}function vl(){if(Uu)return Wu;Uu=1;var t=TypeError;return Wu=function(e,n){if(e<n)throw new t("Not enough arguments");return e}}function ml(){if(zu)return Vu;zu=1;var t=Dt();return Vu=/(?:ipad|iphone|ipod).*applewebkit/i.test(t)}function yl(){if(qu)return Ku;qu=1;var t,e,n,r,o=b(),i=gl(),a=Qr(),s=Rt(),u=ye(),l=R(),c=Qo(),f=oa(),d=Se(),h=vl(),p=ml(),g=pl(),v=o.setImmediate,m=o.clearImmediate,y=o.process,w=o.Dispatch,x=o.Function,E=o.MessageChannel,S=o.String,O=0,C={},k="onreadystatechange";l((function(){t=o.location}));var T=function(t){if(u(C,t)){var e=C[t];delete C[t],e()}},N=function(t){return function(){T(t)}},L=function(t){T(t.data)},M=function(e){o.postMessage(S(e),t.protocol+"//"+t.host)};return v&&m||(v=function(t){h(arguments.length,1);var n=s(t)?t:x(t),r=f(arguments,1);return C[++O]=function(){i(n,void 0,r)},e(O),O},m=function(t){delete C[t]},g?e=function(t){y.nextTick(N(t))}:w&&w.now?e=function(t){w.now(N(t))}:E&&!p?(r=(n=new E).port2,n.port1.onmessage=L,e=a(r.postMessage,r)):o.addEventListener&&s(o.postMessage)&&!o.importScripts&&t&&"file:"!==t.protocol&&!l(M)?(e=M,o.addEventListener("message",L,!1)):e=k in d("script")?function(t){c.appendChild(d("script"))[k]=function(){c.removeChild(this),T(t)}}:function(t){setTimeout(N(t),0)}),Ku={set:v,clear:m}}function bl(){if(Ju)return Gu;Ju=1;var t=b(),e=L(),n=Object.getOwnPropertyDescriptor;return Gu=function(r){if(!e)return t[r];var o=n(t,r);return o&&o.value}}function wl(){if(Xu)return Yu;Xu=1;var t=function(){this.head=null,this.tail=null};return t.prototype={add:function(t){var e={item:t,next:null},n=this.tail;n?n.next=e:this.head=e,this.tail=e},get:function(){var t=this.head;if(t)return null===(this.head=t.next)&&(this.tail=null),t.item}},Yu=t}function xl(){if(rl)return nl;rl=1;var t,e,n,r,o,i=b(),a=bl(),s=Qr(),u=yl().set,l=wl(),c=ml(),f=function(){if(Zu)return Qu;Zu=1;var t=Dt();return Qu=/ipad|iphone|ipod/i.test(t)&&"undefined"!=typeof Pebble}(),d=function(){if(el)return tl;el=1;var t=Dt();return tl=/web0s(?!.*chrome)/i.test(t)}(),h=pl(),p=i.MutationObserver||i.WebKitMutationObserver,g=i.document,v=i.process,m=i.Promise,y=a("queueMicrotask");if(!y){var w=new l,x=function(){var e,n;for(h&&(e=v.domain)&&e.exit();n=w.get();)try{n()}catch(e){throw w.head&&t(),e}e&&e.enter()};c||h||d||!p||!g?!f&&m&&m.resolve?((r=m.resolve(void 0)).constructor=m,o=s(r.then,r),t=function(){o(x)}):h?t=function(){v.nextTick(x)}:(u=s(u,i),t=function(){u(x)}):(e=!0,n=g.createTextNode(""),new p(x).observe(n,{characterData:!0}),t=function(){n.data=e=!e}),y=function(e){w.head||t(),w.add(e)}}return nl=y}function El(){return il||(il=1,ol=function(t,e){try{1===arguments.length?console.error(t):console.error(t,e)}catch(t){}}),ol}function Sl(){return sl?al:(sl=1,al=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}})}function Ol(){if(ll)return ul;ll=1;var t=b();return ul=t.Promise}function Cl(){if(fl)return cl;fl=1;var t=b(),e=Ol(),n=Rt(),r=hr(),o=en(),i=we(),a=hl(),s=he(),u=At(),l=e&&e.prototype,c=i("species"),f=!1,d=n(t.PromiseRejectionEvent),h=r("Promise",(function(){var t=o(e),n=t!==String(e);if(!n&&66===u)return!0;if(s&&(!l.catch||!l.finally))return!0;if(!u||u<51||!/native code/.test(t)){var r=new e((function(t){t(1)})),i=function(t){t((function(){}),(function(){}))};if((r.constructor={})[c]=i,!(f=r.then((function(){}))instanceof i))return!0}return!(n||"BROWSER"!==a&&"DENO"!==a||d)}));return cl={CONSTRUCTOR:h,REJECTION_EVENT:d,SUBCLASSING:f}}var kl,Tl,Nl={};function Rl(){if(kl)return Nl;kl=1;var t=_t(),e=TypeError,n=function(n){var r,o;this.promise=new n((function(t,n){if(void 0!==r||void 0!==o)throw new e("Bad Promise constructor");r=t,o=n})),this.resolve=t(r),this.reject=t(o)};return Nl.f=function(t){return new n(t)},Nl}var Ll,Ml,Pl,Dl={};function Al(){if(Ml)return Ll;Ml=1;var t=Ol(),e=pa(),n=Cl().CONSTRUCTOR;return Ll=n||!e((function(e){t.all(e).then(void 0,(function(){}))}))}var jl,Il={};var $l,Fl={};var _l,Bl={};var Hl,Wl,Ul,Vl,zl={};function Kl(){if(Wl)return Hl;Wl=1;var t=je(),e=Lt(),n=Rl();return Hl=function(r,o){if(t(r),e(o)&&o.constructor===r)return o;var i=n.f(r);return(0,i.resolve)(o),i.promise}}Vl||(Vl=1,function(){if(Tl)return dl;Tl=1;var t,e,n,r=pr(),o=he(),i=pl(),a=b(),s=P(),u=un(),l=si(),c=oi(),f=Ws(),d=_t(),h=Rt(),p=Lt(),g=ha(),v=Eu(),m=yl().set,y=xl(),w=El(),x=Sl(),E=wl(),S=an(),O=Ol(),C=Cl(),k=Rl(),T="Promise",N=C.CONSTRUCTOR,R=C.REJECTION_EVENT,L=C.SUBCLASSING,M=S.getterFor(T),D=S.set,A=O&&O.prototype,j=O,I=A,$=a.TypeError,F=a.document,_=a.process,B=k.f,H=B,W=!!(F&&F.createEvent&&a.dispatchEvent),U="unhandledrejection",V=function(t){var e;return!(!p(t)||!h(e=t.then))&&e},z=function(t,e){var n,r,o,i=e.value,a=1===e.state,u=a?t.ok:t.fail,l=t.resolve,c=t.reject,f=t.domain;try{u?(a||(2===e.rejection&&Y(e),e.rejection=1),!0===u?n=i:(f&&f.enter(),n=u(i),f&&(f.exit(),o=!0)),n===t.promise?c(new $("Promise-chain cycle")):(r=V(n))?s(r,n,l,c):l(n)):c(i)}catch(t){f&&!o&&f.exit(),c(t)}},K=function(t,e){t.notified||(t.notified=!0,y((function(){for(var n,r=t.reactions;n=r.get();)z(n,t);t.notified=!1,e&&!t.rejection&&G(t)})))},q=function(t,e,n){var r,o;W?((r=F.createEvent("Event")).promise=e,r.reason=n,r.initEvent(t,!1,!0),a.dispatchEvent(r)):r={promise:e,reason:n},!R&&(o=a["on"+t])?o(r):t===U&&w("Unhandled promise rejection",n)},G=function(t){s(m,a,(function(){var e,n=t.facade,r=t.value;if(J(t)&&(e=x((function(){i?_.emit("unhandledRejection",r,n):q(U,n,r)})),t.rejection=i||J(t)?2:1,e.error))throw e.value}))},J=function(t){return 1!==t.rejection&&!t.parent},Y=function(t){s(m,a,(function(){var e=t.facade;i?_.emit("rejectionHandled",e):q("rejectionhandled",e,t.value)}))},X=function(t,e,n){return function(r){t(e,r,n)}},Q=function(t,e,n){t.done||(t.done=!0,n&&(t=n),t.value=e,t.state=2,K(t,!0))},Z=function(t,e,n){if(!t.done){t.done=!0,n&&(t=n);try{if(t.facade===e)throw new $("Promise can't be resolved itself");var r=V(e);r?y((function(){var n={done:!1};try{s(r,e,X(Z,n,t),X(Q,n,t))}catch(e){Q(n,e,t)}})):(t.value=e,t.state=1,K(t,!1))}catch(e){Q({done:!1},e,t)}}};if(N&&(I=(j=function(e){g(this,I),d(e),s(t,this);var n=M(this);try{e(X(Z,n),X(Q,n))}catch(t){Q(n,t)}}).prototype,(t=function(t){D(this,{type:T,done:!1,notified:!1,parent:!1,reactions:new E,rejection:!1,state:0,value:null})}).prototype=u(I,"then",(function(t,e){var n=M(this),r=B(v(this,j));return n.parent=!0,r.ok=!h(t)||t,r.fail=h(e)&&e,r.domain=i?_.domain:void 0,0===n.state?n.reactions.add(r):y((function(){z(r,n)})),r.promise})),e=function(){var e=new t,n=M(e);this.promise=e,this.resolve=X(Z,n),this.reject=X(Q,n)},k.f=B=function(t){return t===j||void 0===t?new e(t):H(t)},!o&&h(O)&&A!==Object.prototype)){n=A.then,L||u(A,"then",(function(t,e){var r=this;return new j((function(t,e){s(n,r,t,e)})).then(t,e)}),{unsafe:!0});try{delete A.constructor}catch(t){}l&&l(A,I)}r({global:!0,constructor:!0,wrap:!0,forced:N},{Promise:j}),c(j,T,!1,!0),f(T)}(),function(){if(Pl)return Dl;Pl=1;var t=pr(),e=P(),n=_t(),r=Rl(),o=Sl(),i=da();t({target:"Promise",stat:!0,forced:Al()},{all:function(t){var a=this,s=r.f(a),u=s.resolve,l=s.reject,c=o((function(){var r=n(a.resolve),o=[],s=0,c=1;i(t,(function(t){var n=s++,i=!1;c++,e(r,a,t).then((function(t){i||(i=!0,o[n]=t,--c||u(o))}),l)})),--c||u(o)}));return c.error&&l(c.value),s.promise}})}(),function(){if(jl)return Il;jl=1;var t=pr(),e=he(),n=Cl().CONSTRUCTOR,r=Ol(),o=Mt(),i=Rt(),a=un(),s=r&&r.prototype;if(t({target:"Promise",proto:!0,forced:n,real:!0},{catch:function(t){return this.then(void 0,t)}}),!e&&i(r)){var u=o("Promise").prototype.catch;s.catch!==u&&a(s,"catch",u,{unsafe:!0})}}(),function(){if($l)return Fl;$l=1;var t=pr(),e=P(),n=_t(),r=Rl(),o=Sl(),i=da();t({target:"Promise",stat:!0,forced:Al()},{race:function(t){var a=this,s=r.f(a),u=s.reject,l=o((function(){var r=n(a.resolve);i(t,(function(t){e(r,a,t).then(s.resolve,u)}))}));return l.error&&u(l.value),s.promise}})}(),function(){if(_l)return Bl;_l=1;var t=pr(),e=Rl();t({target:"Promise",stat:!0,forced:Cl().CONSTRUCTOR},{reject:function(t){var n=e.f(this);return(0,n.reject)(t),n.promise}})}(),function(){if(Ul)return zl;Ul=1;var t=pr(),e=Mt(),n=he(),r=Ol(),o=Cl().CONSTRUCTOR,i=Kl(),a=e("Promise"),s=n&&!o;t({target:"Promise",stat:!0,forced:n||o},{resolve:function(t){return i(s&&this===a?r:this,t)}})}());var ql,Gl,Jl,Yl={};function Xl(){if(Gl)return ql;Gl=1;var t=P(),e=ye(),n=Pt(),r=nu(),o=RegExp.prototype;return ql=function(i){var a=i.flags;return void 0!==a||"flags"in o||e(i,"flags")||!n(o,i)?a:t(r,i)}}!function(){if(Jl)return Yl;Jl=1;var t=tn().PROPER,e=un(),n=je(),r=mi(),o=R(),i=Xl(),a="toString",s=RegExp.prototype,u=s[a],l=o((function(){return"/a/b"!==u.call({source:"a",flags:"b"})})),c=t&&u.name!==a;(l||c)&&e(s,a,(function(){var t=n(this);return"/"+r(t.source)+"/"+r(i(t))}),{unsafe:!0})}();var Ql,Zl,tc,ec={};function nc(){if(Zl)return Ql;Zl=1;var t=St(),e=me(),n=Math.floor,r=t("".charAt),o=t("".replace),i=t("".slice),a=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,s=/\$([$&'`]|\d{1,2})/g;return Ql=function(t,u,l,c,f,d){var h=l+t.length,p=c.length,g=s;return void 0!==f&&(f=e(f),g=a),o(d,g,(function(e,o){var a;switch(r(o,0)){case"$":return"$";case"&":return t;case"`":return i(u,0,l);case"'":return i(u,h);case"<":a=f[i(o,1,-1)];break;default:var s=+o;if(0===s)return e;if(s>p){var d=n(s/10);return 0===d?e:d<=p?void 0===c[d-1]?r(o,1):c[d-1]+r(o,1):e}a=c[s-1]}return void 0===a?"":a}))},Ql}function rc(t){Promise.resolve().then(t)}!function(){if(tc)return ec;tc=1;var t=gl(),e=P(),n=St(),r=wu(),o=R(),i=je(),a=Rt(),s=kt(),u=Tn(),l=Rn(),c=mi(),f=Tt(),d=Su(),h=Bt(),p=nc(),g=Ou(),v=we()("replace"),m=Math.max,y=Math.min,b=n([].concat),w=n([].push),x=n("".indexOf),E=n("".slice),S="$0"==="a".replace(/./,"$0"),O=!!/./[v]&&""===/./[v]("a","$0");r("replace",(function(n,r,o){var S=O?"$":"$0";return[function(t,n){var o=f(this),i=s(t)?void 0:h(t,v);return i?e(i,t,o,n):e(r,c(o),t,n)},function(e,n){var s=i(this),f=c(e);if("string"==typeof n&&-1===x(n,S)&&-1===x(n,"$<")){var h=o(r,s,f,n);if(h.done)return h.value}var v=a(n);v||(n=c(n));var O,C=s.global;C&&(O=s.unicode,s.lastIndex=0);for(var k,T=[];null!==(k=g(s,f))&&(w(T,k),C);){""===c(k[0])&&(s.lastIndex=d(f,l(s.lastIndex),O))}for(var N,R="",L=0,M=0;M<T.length;M++){for(var P,D=c((k=T[M])[0]),A=m(y(u(k.index),f.length),0),j=[],I=1;I<k.length;I++)w(j,void 0===(N=k[I])?N:String(N));var $=k.groups;if(v){var F=b([D],j,A,f);void 0!==$&&w(F,$),P=c(t(n,void 0,F))}else P=p(D,f,A,j,$,n);A>=L&&(R+=E(f,L,A)+P,L=A+D.length)}return R+E(f,L)}]}),!!o((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")}))||!S||O)}();var oc,ic=function(t){return Object.prototype.toString.call(t)},ac=globalThis.Node,sc=globalThis.Comment,uc=globalThis.Element,lc=globalThis.Text,cc=globalThis.Range,fc=globalThis.Selection,dc=globalThis.StaticRange;o.css&&(o.fn.css=o.css),o.append&&(o.fn.append=o.append),o.addClass&&(o.fn.addClass=o.addClass),o.removeClass&&(o.fn.removeClass=o.removeClass),o.hasClass&&(o.fn.hasClass=o.hasClass),o.on&&(o.fn.on=o.on),o.focus&&(o.fn.focus=o.focus),o.attr&&(o.fn.attr=o.attr),o.removeAttr&&(o.fn.removeAttr=o.removeAttr),o.hide&&(o.fn.hide=o.hide),o.show&&(o.fn.show=o.show),o.offset&&(o.fn.offset=o.offset),o.width&&(o.fn.width=o.width),o.height&&(o.fn.height=o.height),o.parent&&(o.fn.parent=o.parent),o.parents&&(o.fn.parents=o.parents),o.is&&(o.fn.is=o.is),o.dataset&&(o.fn.dataset=o.dataset),o.val&&(o.fn.val=o.val),o.text&&(o.fn.text=o.text),o.html&&(o.fn.html=o.html),o.children&&(o.fn.children=o.children),o.remove&&(o.fn.remove=o.remove),o.find&&(o.fn.find=o.find),o.each&&(o.fn.each=o.each),o.empty&&(o.fn.empty=o.empty),t.NodeType=void 0,(oc=t.NodeType||(t.NodeType={}))[oc.ELEMENT_NODE=1]="ELEMENT_NODE",oc[oc.TEXT_NODE=3]="TEXT_NODE",oc[oc.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",oc[oc.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",oc[oc.COMMENT_NODE=8]="COMMENT_NODE",oc[oc.DOCUMENT_NODE=9]="DOCUMENT_NODE",oc[oc.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",oc[oc.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE";var hc=function(t){return"[object HTMLDocument]"===ic(t)},pc=function(t){return"[object ShadowRoot]"===ic(t)},gc=function(t){return"[object DataTransfer]"===ic(t)},vc=/\[object HTML([A-Z][a-z]*)*Element\]/,mc=function(t){return"matches"in t&&/^[ou]l$/i.test(t.tagName)&&!t.hasAttribute("data-w-e-type")},yc=function(t){return vc.test(ic(t))},bc=function(t){return t&&t.ownerDocument&&t.ownerDocument.defaultView||null},wc=function(t){return null!=t&&"number"==typeof t.nodeType},xc=function(e){return wc(e)&&e.nodeType===t.NodeType.COMMENT_NODE},Ec=function(e){return wc(e)&&e.nodeType===t.NodeType.ELEMENT_NODE},Sc=function(t){return"[object Selection]"===ic(t)},Oc=function(e){return wc(e)&&e.nodeType===t.NodeType.TEXT_NODE},Cc=function(t){return t.clipboardData&&""!==t.clipboardData.getData("text/plain")&&1===t.clipboardData.types.length},kc=function(t){var e,n=ho(t,2),r=n[0],o=n[1];if(Ec(r)&&r.childNodes.length){var i=o===r.childNodes.length,a=i?o-1:o;for(r=(e=ho(Rc(r,a,i?"backward":"forward"),2))[0],i=(a=e[1])<o;Ec(r)&&r.childNodes.length;){var s=i?r.childNodes.length-1:0;r=Lc(r,s,i?"backward":"forward")}o=i&&null!=r.textContent?r.textContent.length:0}return[r,o]},Tc=function(){return!(!window.document.activeElement||!window.document.activeElement.shadowRoot)},Nc=function(t){var e,n,r;return null!==(e=window&&window.document.getElementById(t))&&void 0!==e?e:window&&(null===(r=null===(n=window.document.activeElement)||void 0===n?void 0:n.shadowRoot)||void 0===r?void 0:r.getElementById(t))||null},Rc=function(t,e,n){for(var r=t.childNodes,o=r[e],i=e,a=!1,s=!1;(xc(o)||Ec(o)&&0===o.childNodes.length||Ec(o)&&"false"===o.getAttribute("contenteditable"))&&(!a||!s);)i>=r.length?(a=!0,i=e-1,n="backward"):i<0?(s=!0,i=e+1,n="forward"):(o=r[i],e=i,i+="forward"===n?1:-1);return[o,e]},Lc=function(t,e,n){return ho(Rc(t,e,n),1)[0]},Mc=function(t){var e,n,r="";if(Oc(t)&&t.nodeValue)return t.nodeValue;if(Ec(t)){try{for(var o=fo(Array.from(t.childNodes)),i=o.next();!i.done;i=o.next()){var a=i.value;r+=Mc(a)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}var s=getComputedStyle(t).getPropertyValue("display");"block"!==s&&"list"!==s&&"table-row"!==s&&"BR"!==t.tagName||(r+="\n")}return r};function Pc(e){var n=[];n.push(e);for(var r=0;n.length>0;){var o=n.pop();if(null==o)break;if((r+=1)>1e4)break;var i=o.nodeName;if(o.nodeType===t.NodeType.ELEMENT_NODE){var a=i.toLowerCase();if(ju.includes(a)||"iframe"===a||"video"===a)return o;var s=o.children||[],u=s.length;if(u)for(var l=u-1;l>=0;l-=1)n.push(s[l])}}return null}function Dc(e,n){if(!yc(e)||"true"!==e.dataset.slateVoid)for(var r=e.childNodes,o=r.length;o-=1;){var i=r[o],a=i.nodeType;Oc(i)?n(i,e):[t.NodeType.ELEMENT_NODE,t.NodeType.DOCUMENT_NODE,t.NodeType.DOCUMENT_FRAGMENT_NODE].includes(a)&&Dc(i,n)}}function Ac(e){if(0===e.length)return"";var n=e[0];return n.nodeType!==t.NodeType.ELEMENT_NODE?"":n.tagName.toLowerCase()}var jc,Ic,$c,Fc={};function _c(){if(Ic)return jc;Ic=1;var t=Ie().f;return jc=function(e,n,r){r in e||t(e,r,{configurable:!0,get:function(){return n[r]},set:function(t){n[r]=t}})}}!function(){if($c)return Fc;$c=1;var t=L(),e=b(),n=St(),r=hr(),o=ga(),i=$e(),a=Zo(),s=An().f,u=Pt(),l=gs(),c=mi(),f=Xl(),d=ru(),h=_c(),p=un(),g=R(),v=ye(),m=an().enforce,y=Ws(),w=we(),x=ou(),E=iu(),S=w("match"),O=e.RegExp,C=O.prototype,k=e.SyntaxError,T=n(C.exec),N=n("".charAt),M=n("".replace),P=n("".indexOf),D=n("".slice),A=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,j=/a/g,I=/a/g,$=new O(j)!==j,F=d.MISSED_STICKY,_=d.UNSUPPORTED_Y,B=t&&(!$||F||x||E||g((function(){return I[S]=!1,O(j)!==j||O(I)===I||"/a/i"!==String(O(j,"i"))})));if(r("RegExp",B)){for(var H=function(t,e){var n,r,s,d,h,p,g=u(C,this),y=l(t),b=void 0===e,w=[],S=t;if(!g&&y&&b&&t.constructor===H)return t;if((y||u(C,t))&&(t=t.source,b&&(e=f(S))),t=void 0===t?"":c(t),e=void 0===e?"":c(e),S=t,x&&"dotAll"in j&&(r=!!e&&P(e,"s")>-1)&&(e=M(e,/s/g,"")),n=e,F&&"sticky"in j&&(s=!!e&&P(e,"y")>-1)&&_&&(e=M(e,/y/g,"")),E&&(d=function(t){for(var e,n=t.length,r=0,o="",i=[],s=a(null),u=!1,l=!1,c=0,f="";r<=n;r++){if("\\"===(e=N(t,r)))e+=N(t,++r);else if("]"===e)u=!1;else if(!u)switch(!0){case"["===e:u=!0;break;case"("===e:if(o+=e,"?:"===D(t,r+1,r+3))continue;T(A,D(t,r+1))&&(r+=2,l=!0),c++;continue;case">"===e&&l:if(""===f||v(s,f))throw new k("Invalid capture group name");s[f]=!0,i[i.length]=[f,c],l=!1,f="";continue}l?f+=e:o+=e}return[o,i]}(t),t=d[0],w=d[1]),h=o(O(t,e),g?this:C,H),(r||s||w.length)&&(p=m(h),r&&(p.dotAll=!0,p.raw=H(function(t){for(var e,n=t.length,r=0,o="",i=!1;r<=n;r++)"\\"!==(e=N(t,r))?i||"."!==e?("["===e?i=!0:"]"===e&&(i=!1),o+=e):o+="[\\s\\S]":o+=e+N(t,++r);return o}(t),n)),s&&(p.sticky=!0),w.length&&(p.groups=w)),t!==S)try{i(h,"source",""===S?"(?:)":S)}catch(t){}return h},W=s(O),U=0;W.length>U;)h(H,O,W[U++]);C.constructor=H,H.prototype=C,p(e,"RegExp",H,{constructor:!0})}y("RegExp")}();var Bc=new RegExp(String.fromCharCode(160),"g");function Hc(t){return t.replace(Bc," ")}var Wc=["span","b","strong","i","em","s","strike","u","font","sub","sup"],Uc=[];var Vc=[];var zc={};function Kc(t,n){var r=t.length;if(r){var o=t[r-1];if(e.Text.isText(o)){var i=Object.keys(o);if(1===i.length&&"text"===i[0])return o.text+=n,!0}}return!1}function qc(t,e,n){return{type:"paragraph",children:[{text:o(t).text().replace(/\s+/gm," ")}]}}function Gc(t,n){var r=function(t,e){var n=[];if(null!=t.attr("data-w-e-is-void"))return n;var r=t[0].childNodes;return 1===r.length&&"BR"===r[0].nodeName?(n.push({text:""}),n):(r.forEach((function(t){if(Ec(t)){if("BR"===t.nodeName)return void(Kc(n,"\n")||n.push({text:"\n"}));var r=Yc(o(t),e);Array.isArray(r)?r.forEach((function(t){return n.push(t)})):n.push(r)}else if(Oc(t)){var i=t.textContent||"";if(""===i.trim()&&i.indexOf("\n")>=0)return;i&&(i=Hc(i),Kc(n,i)||n.push({text:i}))}})),n)}(t,n),i=function(t){for(var e in zc)if(t[0].matches(e))return zc[e];return qc}(t),a=i(t[0],r,n);return Array.isArray(a)||(a=[a]),a.forEach((function(o){e.Editor.isVoid(n,o)||(0===r.length&&(o.children=[{text:t.text().replace(/\s+/gm," ")}]),Vc.forEach((function(e){o=e(t[0],o,n)})))})),a}function Jc(t,e){0===t.parents("pre").length&&(t[0].innerHTML=t[0].innerHTML.replace(/\s+/gm," ").replace(/<br>/g,"\n"));var n=t[0].textContent||"";n=function(t){return t.replace(/ /g," ").replace(/</g,"<").replace(/>/g,">").replace(/®/g,"®").replace(/©/g,"©").replace(/™/g,"™").replace(/"/g,'"')}(n);var r={text:n=Hc(n)};return Vc.forEach((function(n){r=n(t[0],r,e)})),r}function Yc(t,e){Uc.forEach((function(e){var n=e.selector,r=e.preParseHtml;t[0].matches(n)&&(t=o(r(t[0])))}));var n=Ac(t);if("span"===n){if(t.attr("data-w-e-type"))return Gc(t,e);if(t[0].childNodes.length>1){var r=t[0].childNodes,i=function(t,e){var n={text:""};return Vc.forEach((function(r){n=r(t[0],n,e)})),n}(o(t[0]),e);return Array.from(r).flatMap((function(t){var n=function(t,e,n){var r=t[0];if(Ec(r)){var o=Yc(t,n);return Array.isArray(o)?o.map((function(t){return co(co({},e),t)})):[co(co({},e),o)]}if(xc(r))return null;var i=Oc(r)?{text:r.textContent||""}:Jc(t,n);return[co(co({},e),i)]}(o(t),i,e);return n||[]}))}return Jc(t,e)}if("code"===n)return"pre"===Ac(t.parent())?Gc(t,e):Jc(t,e);if(Wc.includes(n)){if(t[0].childNodes.length>0&&3!==t[0].childNodes[0].nodeType){r=t[0].childNodes;return co(co({},Yc(o(r[0]),e)),Jc(t,e))}return Jc(t,e)}return Gc(t,e)}function Xc(t,e,n){var r=o(n);return!!r.attr(e)||(r.attr(e,"true"),t.on(vo.DESTROYED,(function(){r.removeAttr(e)})),!1)}function Qc(t,e){void 0===e&&(e="");var n=[];""===e&&(e="<p><br></p>"),0!==e.indexOf("<")&&(e=e.split(/\n/).map((function(t){return"<p>".concat(t,"</p>")})).join(""));var r=o("<div>".concat(e,"</div>"));return Array.from(r.children()).forEach((function(e){var r=Yc(o(e),t);Array.isArray(r)?r.forEach((function(t){return n.push(t)})):n.push(r)})),n}function Zc(t,e){return"w-e-element-".concat(t,"-").concat(e)}var tf=[];var ef={};function nf(t,e,n){var r=n.isInline(t)?"span":"div";return"<".concat(r,">").concat(e,"</").concat(r,">")}function rf(t,n){var r=t.type,o=void 0===r?"":r,i=t.children,a=void 0===i?[]:i,s=e.Editor.isVoid(n,t),u="";s||(u=a.map((function(t){return Ef(t,n)})).join(""));var l=function(t){return ef[t]||nf}(o),c=l(t,u,n),f="";if(f="string"==typeof c?c:c.html||"",s||tf.forEach((function(e){return f=e(t,f)})),"string"==typeof c)return f;var d=c.prefix,h=void 0===d?"":d,p=c.suffix,g=void 0===p?"":p;return h&&(f=h+f),g&&(f+=g),f}var of,af,sf,uf={};function lf(){if(af)return of;af=1;var t=ye();return of=function(e){return void 0!==e&&(t(e,"value")||t(e,"writable"))}}!function(){if(sf)return uf;sf=1;var t=pr(),e=P(),n=Lt(),r=je(),o=lf(),i=Ce(),a=ni();t({target:"Reflect",stat:!0},{get:function t(s,u){var l,c,f=arguments.length<3?s:arguments[2];return r(s)===f?s[u]:(l=i.f(s,u))?o(l)?l.value:void 0===l.get?void 0:e(l.get,f):n(c=a(s))?t(c,u,f):void 0}})}();var cf,ff={};!function(){if(cf)return ff;cf=1;var t,e=pr(),n=Xr(),r=Ce().f,o=Rn(),i=mi(),a=vs(),s=Tt(),u=ms(),l=he(),c=n("".slice),f=Math.min,d=u("endsWith");e({target:"String",proto:!0,forced:!!(l||d||(t=r(String.prototype,"endsWith"),!t||t.writable))&&!d},{endsWith:function(t){var e=i(s(this));a(t);var n=arguments.length>1?arguments[1]:void 0,r=e.length,u=void 0===n?r:f(o(n),r),l=i(t);return c(e,u-l.length,u)===l}})}();var df=0,hf=function(){this.id="".concat(df++)},pf="undefined"!=typeof navigator&&/Mac OS X/.test(navigator.userAgent),gf="undefined"!=typeof navigator&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),vf="undefined"!=typeof navigator&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent),mf="undefined"!=typeof navigator&&/Edge?\/(?:[0-6][0-9]|[0-7][0-8])(?:\.)/i.test(navigator.userAgent),yf="undefined"!=typeof navigator&&/Chrome?\/(?:[0-7][0-5]|[0-6][0-9])(?:\.)/i.test(navigator.userAgent),bf="undefined"!=typeof navigator&&/Chrome/i.test(navigator.userAgent),wf=!yf&&!mf&&"undefined"!=typeof globalThis&&globalThis.InputEvent&&"function"==typeof globalThis.InputEvent.prototype.getTargetRanges,xf={getWindow:function(t){var e=Ha.get(t);if(!e)throw new Error("Unable to find a host window element for this editor");return e},findKey:function(t,e){var n=Ba.get(e);return n||(n=new hf,Ba.set(e,n)),n},setNewKey:function(t){var e=new hf;Ba.set(t,e)},findPath:function(t,n){for(var r=[],o=n;;){var i=ja.get(o);if(null==i){if(e.Editor.isEditor(o))return r;break}var a=Aa.get(o);if(null==a)break;r.unshift(a),o=i}throw new Error("Unable to find the path for Slate node: ".concat(JSON.stringify(n)))},findDocumentOrShadowRoot:function(t){if(t.isDestroyed)return window.document;var e=xf.toDOMNode(t,t),n=e.getRootNode();return(hc(n)||pc(n))&&null!=Reflect.get(n,"getSelection")?n:e.ownerDocument},getParentNode:function(t,e){return ja.get(e)||null},getParentsNodes:function(t,e){for(var n=[],r=e;r!==t&&null!=r;){var o=xf.getParentNode(t,r);if(null==o)break;n.push(o),r=o}return n},getTopNode:function(t,n){var r=[xf.findPath(t,n)[0]];return e.Node.get(t,r)},toDOMNode:function(t,n){var r;if(e.Editor.isEditor(n))r=Ia.get(t);else{var o=xf.findKey(t,n);r=Fa.get(o)}if(!r)throw new Error("Cannot resolve a DOM node from Slate node: ".concat(JSON.stringify(n)));return r},hasDOMNode:function(t,e,n){void 0===n&&(n={});var r,o=n.editable,i=void 0!==o&&o,a=xf.toDOMNode(t,t);try{r=Ec(e)?e:e.parentElement}catch(t){if(t instanceof Error&&!t.message.includes('Permission denied to access property "nodeType"'))throw t}return!!r&&(r.closest("[data-slate-editor]")===a&&(!i||r.isContentEditable||!!r.getAttribute("data-slate-zero-width"))||!!r.getAttribute("data-slate-string"))},toDOMRange:function(t,n){var r=n.anchor,o=n.focus,i=e.Range.isBackward(n),a=xf.toDOMPoint(t,r),s=e.Range.isCollapsed(n)?a:xf.toDOMPoint(t,o),u=xf.getWindow(t).document.createRange(),l=ho(i?s:a,2),c=l[0],f=l[1],d=ho(i?a:s,2),h=d[0],p=d[1],g=!!(Ec(c)?c:c.parentElement).getAttribute("data-slate-zero-width"),v=!!(Ec(h)?h:h.parentElement).getAttribute("data-slate-zero-width");return u.setStart(c,g?1:f),u.setEnd(h,v?1:p),u},toDOMPoint:function(t,n){var r,o,i,a=ho(e.Editor.node(t,n.path),1)[0],s=xf.toDOMNode(t,a);e.Editor.void(t,{at:n})&&(n={path:n.path,offset:0});var u=Array.from(s.querySelectorAll("[data-slate-string], [data-slate-zero-width]")),l=0;try{for(var c=fo(u),f=c.next();!f.done;f=c.next()){var d=f.value,h=d.childNodes[0];if(null!=h&&null!=h.textContent){var p=h.textContent.length,g=d.getAttribute("data-slate-length"),v=l+(null==g?p:parseInt(g,10));if(n.offset<=v){i=[h,Math.min(p,Math.max(0,n.offset-l))];break}l=v}}}catch(t){r={error:t}}finally{try{f&&!f.done&&(o=c.return)&&o.call(c)}finally{if(r)throw r.error}}if(!i)throw new Error("Cannot resolve a DOM point from Slate point: ".concat(JSON.stringify(n)));return i},toSlateNode:function(t,e){var n=Ec(e)?e:e.parentElement;n&&!n.hasAttribute("data-slate-node")&&(n=n.closest("[data-slate-node]"));var r=n?$a.get(n):null;if(!r)throw new Error("Cannot resolve a Slate node from DOM node: ".concat(n));return r},findEventRange:function(t,n){"nativeEvent"in n&&(n=n.nativeEvent);var r=n.clientX,o=n.clientY,i=n.target;if(null==r||null==o)throw new Error("Cannot resolve a Slate range from a DOM event: ".concat(n));var a,s=xf.toSlateNode(t,n.target),u=xf.findPath(t,s);if(e.Editor.isVoid(t,s)){var l=i.getBoundingClientRect(),c=t.isInline(s)?r-l.left<l.left+l.width-r:o-l.top<l.top+l.height-o,f=e.Editor.point(t,u,{edge:c?"start":"end"}),d=c?e.Editor.before(t,f):e.Editor.after(t,f);if(d)return e.Editor.range(t,d)}var h=this.getWindow(t).document;if(h.caretRangeFromPoint)a=h.caretRangeFromPoint(r,o);else{var p=h.caretPositionFromPoint(r,o);p&&((a=h.createRange()).setStart(p.offsetNode,p.offset),a.setEnd(p.offsetNode,p.offset))}if(!a)throw new Error("Cannot resolve a Slate range from a DOM event: ".concat(n));return xf.toSlateRange(t,a,{exactMatch:!1,suppressThrow:!1})},toSlateRange:function(t,n,r){var o,i,a,s,u,l=r.exactMatch,c=r.suppressThrow;if((Sc(n)?n.anchorNode:n.startContainer)&&(Sc(n)?(o=n.anchorNode,i=n.anchorOffset,a=n.focusNode,s=n.focusOffset,u=bf&&Tc()?n.anchorNode===n.focusNode&&n.anchorOffset===n.focusOffset:n.isCollapsed):(o=n.startContainer,i=n.startOffset,a=n.endContainer,s=n.endOffset,u=n.collapsed)),null==o||null==a||null==i||null==s)throw new Error("Cannot resolve a Slate range from DOM range: ".concat(n));var f=xf.toSlatePoint(t,[o,i],{exactMatch:l,suppressThrow:c});if(!f)return null;var d=u?f:xf.toSlatePoint(t,[a,s],{exactMatch:l,suppressThrow:c});if(!d)return null;var h={anchor:f,focus:d};return e.Range.isExpanded(h)&&e.Range.isForward(h)&&Ec(a)&&e.Editor.void(t,{at:h.focus,mode:"highest"})&&(h=e.Editor.unhangRange(t,h,{voids:!0})),h},toSlatePoint:function(t,e,n){var r,o=n.exactMatch,i=n.suppressThrow,s=ho(o?e:kc(e),2),u=s[0],l=s[1],c=u.parentNode,f=null,d=0;if(c){var h=c.closest('[data-slate-void="true"]'),p=c.closest("[data-slate-leaf]"),g=null,v=xf.getWindow(t);if(p&&v.document.createRange){f=p.closest('[data-slate-node="text"]');var m=v.document.createRange();m.setStart(f,0),m.setEnd(u,l);var y=m.cloneContents();po(po([],ho(a(y.querySelectorAll("[data-slate-zero-width]"))),!1),ho(a(y.querySelectorAll("[contenteditable=false]"))),!1).forEach((function(t){t.parentNode.removeChild(t)})),d=y.textContent.length,g=f}else h&&((p=h.querySelector("[data-slate-leaf]"))?(f=p.closest('[data-slate-node="text"]'),d=(g=p).textContent.length,g.querySelectorAll("[data-slate-zero-width]").forEach((function(t){d-=t.textContent.length}))):d=1);g&&d===g.textContent.length&&(c.hasAttribute("data-slate-zero-width")||gf&&(null===(r=g.textContent)||void 0===r?void 0:r.endsWith("\n")))&&(d-=1)}if(!f){if(i)return null;throw new Error("Cannot resolve a Slate point from DOM point: ".concat(e))}var b=xf.toSlateNode(t,f);return{path:xf.findPath(t,b),offset:d}},hasRange:function(t,n){var r=n.anchor,o=n.focus;return e.Editor.hasPath(t,r.path)&&e.Editor.hasPath(t,o.path)},getNodeType:function(t){return e.Element.isElement(t)?t.type:""},checkNodeType:function(t,e){return this.getNodeType(t)===e},getNodesStr:function(t){return t.map((function(t){return e.Node.string(t)})).join("")},getSelectedElems:function(t){var n,r,o=[],i=e.Editor.nodes(t,{universal:!0});try{for(var a=fo(i),s=a.next();!s.done;s=a.next()){var u=ho(s.value,1)[0];e.Element.isElement(u)&&o.push(u)}}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return o},getSelectedNodeByType:function(t,n){var r=this,o=ho(e.Editor.nodes(t,{match:function(t){return r.checkNodeType(t,n)},universal:!0}),1),i=o[0];return null==i?null:i[0]},getSelectedTextNode:function(t){var n=ho(e.Editor.nodes(t,{match:function(t){return e.Text.isText(t)},universal:!0}),1),r=n[0];return null==r?null:r[0]},isNodeSelected:function(t,n){var r=ho(e.Editor.nodes(t,{match:function(t){return t===n},universal:!0}),1),o=r[0];return null!=o&&ho(o,1)[0]===n},isSelectionAtLineEnd:function(t,n){var r=t.selection;return!!r&&(e.Editor.isEnd(t,r.anchor,n)||e.Editor.isEnd(t,r.focus,n))},getTextarea:function(t){var e=xa.get(t);if(null==e)throw new Error("Cannot find textarea instance by editor");return e},getToolbar:function(t){return Oa.get(t)||null},getHoverbar:function(t){return ka.get(t)||null},normalizeContent:function(t){t.children.forEach((function(e,n){t.normalizeNode([e,[n]])}))},getLeftLengthOfMaxLength:function(t){var e=t.getConfig(),n=e.maxLength,r=e.onMaxLength;if("number"!=typeof n||n<=0)return 1/0;var o=n-t.getText().replace(/\r|\n|(\r\n)|(\n\r)/g,"").length;return o<=0&&r&&r(t),o},cleanExposedTexNodeInSelectionBlock:function(t){var n,r,i,a,s=xf.getTextarea(t).$textArea,u=null==s?void 0:s[0].childNodes;if(u)try{for(var l=fo(Array.from(u)),c=l.next();!c.done;c=l.next()){var f=c.value;if(!Oc(f))break;f.remove()}}catch(t){n={error:t}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}var d=e.Editor.nodes(t,{match:function(n){return!(!e.Element.isElement(n)||t.isInline(n))},universal:!0});try{for(var h=fo(d),p=h.next();!p.done;p=h.next()){var g=p.value;if(null!=g){var v=g[0];Dc(xf.toDOMNode(t,v),(function(t,e){var n=o(e);n.attr("data-slate-string")||n.attr("data-slate-zero-width")||n.attr("data-w-e-reserve")||e.removeChild(t)}))}}}catch(t){i={error:t}}finally{try{p&&!p.done&&(a=h.return)&&a.call(h)}finally{if(i)throw i.error}}},isLastNode:function(t,e){var n=t.children||[];return n[n.length-1]===e},genEmptyParagraph:function(){return{type:"paragraph",children:[{text:""}]}},isSelectedVoidNode:function(t){var n,r,o=e.Editor.nodes(t,{match:function(e){return t.isVoid(e)}}),i=0;try{for(var a=fo(o),s=a.next();!s.done;s=a.next()){s.value&&(i+=1)}}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i>0},isSelectedEmptyParagraph:function(t){var n=t.selection;if(null==n)return!1;if(e.Range.isExpanded(n))return!1;var r=xf.getSelectedNodeByType(t,"paragraph");if(null===r)return!1;var o=r.children;return 1===o.length&&(""===o[0].text||void 0)},isEmptyPath:function(t,n){var r=e.Editor.node(t,n);if(null==r)return!1;var o=ho(r,1)[0].children;if(1===o.length&&""===o[0].text)return!0;return!1}};function Ef(t,n){return e.Element.isElement(t)?rf(t,n):function(t,e){var n=t.text;if(null==n)throw new Error("Current node is not slate Text ".concat(JSON.stringify(t)));var r=n;r=function(t){return t.replace(/ {2}/g," ").replace(/</g,"<").replace(/>/g,">").replace(/®/g,"®").replace(/©/g,"©").replace(/™/g,"™")}(r);var o=xf.getParentsNodes(e,t).some((function(t){return"pre"===xf.getNodeType(t)}));if(o||(r=r.replace(/\n\r|\r\n|\r|\n/g,"<br>")),o&&(r=r.replace(/ /g," ")),""===r){var i=xf.getParentNode(null,t);if(!i||0!==i.children.length)return r;r="<br>"}return tf.forEach((function(e){return r=e(t,r)})),r}(t,n)}var Sf=function(t,e){var n=(e.top+e.bottom)/2;return t.top<=n&&t.bottom>=n},Of=function(t,e,n){var r=xf.toDOMRange(t,e).getBoundingClientRect(),o=xf.toDOMRange(t,n).getBoundingClientRect();return Sf(r,o)&&Sf(o,r)};function Cf(t,n){t.isInline(n)?(t.insertNode(n),"link"===n.type&&t.insertFragment([{text:""}])):e.Transforms.insertNodes(t,n,{mode:"highest"})}var kf,Tf,Nf,Rf,Lf,Mf,Pf,Df,Af,jf,If,$f,Ff,_f,Bf,Hf,Wf,Uf,Vf,zf,Kf,qf,Gf,Jf,Yf,Xf,Qf,Zf,td,ed,nd,rd,od,id,ad,sd,ud,ld,cd,fd,dd=function(t){var n=t,r=n.onChange,i=n.insertText,a=n.apply,s=n.deleteBackward;return n.insertText=function(t){n.getConfig().readOnly||i(t)},n.apply=function(t){var r,o,i,s,u,l,c,f,d=[];switch(t.type){case"insert_text":case"remove_text":case"set_node":try{for(var h=fo(e.Editor.levels(n,{at:t.path})),p=h.next();!p.done;p=h.next()){var g=ho(p.value,2),v=g[0],m=g[1],y=xf.findKey(n,v);d.push([m,y])}}catch(t){r={error:t}}finally{try{p&&!p.done&&(o=h.return)&&o.call(h)}finally{if(r)throw r.error}}break;case"insert_node":case"remove_node":case"merge_node":case"split_node":try{for(var b=fo(e.Editor.levels(n,{at:e.Path.parent(t.path)})),w=b.next();!w.done;w=b.next()){var x=ho(w.value,2);v=x[0],m=x[1],y=xf.findKey(n,v);d.push([m,y])}}catch(t){i={error:t}}finally{try{w&&!w.done&&(s=b.return)&&s.call(b)}finally{if(i)throw i.error}}break;case"move_node":try{for(var E=fo(e.Editor.levels(n,{at:e.Path.common(e.Path.parent(t.path),e.Path.parent(t.newPath))})),S=E.next();!S.done;S=E.next()){var O=ho(S.value,2);v=O[0],m=O[1],y=xf.findKey(n,v);d.push([m,y])}}catch(t){u={error:t}}finally{try{S&&!S.done&&(l=E.return)&&l.call(E)}finally{if(u)throw u.error}}}a(t);try{for(var C=fo(d),k=C.next();!k.done;k=C.next()){var T=ho(k.value,2);m=T[0],y=T[1],v=ho(e.Editor.node(n,m),1)[0];Ba.set(v,y)}}catch(t){c={error:t}}finally{try{k&&!k.done&&(f=C.return)&&f.call(C)}finally{if(c)throw c.error}}},n.deleteBackward=function(r){if("line"!==r)return s(r);if(t.selection&&e.Range.isCollapsed(t.selection)){var o=e.Editor.above(t,{match:function(n){return e.Editor.isBlock(t,n)},at:t.selection});if(o){var i=ho(o,2)[1],a=e.Editor.range(t,i,t.selection.anchor),u=function(t,n){var r=e.Editor.range(t,e.Range.end(n)),o=Array.from(e.Editor.positions(t,{at:n})),i=0,a=o.length,s=Math.floor(a/2);if(Of(t,e.Editor.range(t,o[i]),r))return e.Editor.range(t,o[i],r);if(o.length<2)return e.Editor.range(t,o[o.length-1],r);for(;s!==o.length&&s!==i;)Of(t,e.Editor.range(t,o[s]),r)?a=s:i=s,s=Math.floor((i+a)/2);return e.Editor.range(t,o[a],r)}(n,a);e.Range.isCollapsed(u)||e.Transforms.delete(t,{at:u})}}},n.onChange=function(){var t=n.selection;null!=t&&Ua.set(n,t),n.emit("change"),r()},n.handleTab=function(){n.insertText(" ")},n.getHtml=function(){var t=n.children;return(void 0===t?[]:t).map((function(t){return Ef(t,n)})).join("")},n.getText=function(){var t=n.children;return(void 0===t?[]:t).map((function(t){return e.Node.string(t)})).join("\n")},n.getSelectionText=function(){var r=n.selection;return null==r?"":e.Editor.string(t,r)},n.getElemsByType=function(t,r){var o,i;void 0===r&&(r=!1);var a=[],s=e.Editor.nodes(n,{at:[],universal:!0});try{for(var u=fo(s),l=u.next();!l.done;l=u.next()){var c=ho(l.value,1)[0];if(e.Element.isElement(c))if(r?c.type.indexOf(t)>=0:c.type===t){var f=xf.findKey(n,c),d=Zc(c.type,f.id);a.push(co(co({},c),{id:d}))}}}catch(t){o={error:t}}finally{try{l&&!l.done&&(i=u.return)&&i.call(u)}finally{if(o)throw o.error}}return a},n.getElemsByTypePrefix=function(t){return n.getElemsByType(t,!0)},n.isEmpty=function(){var t=n.children,r=void 0===t?[]:t;if(r.length>1)return!1;var o=r[0];if(null==o)return!0;if(!e.Element.isElement(o)||"paragraph"!==o.type)return!1;var i=o.children,a=void 0===i?[]:i;if(a.length>1)return!1;var s=a[0];return null==s||e.Text.isText(s)&&""===s.text},n.clear=function(){e.Transforms.delete(n,{at:{anchor:e.Editor.start(n,[]),focus:e.Editor.end(n,[])}}),0===n.children.length&&e.Transforms.insertNodes(n,[{type:"paragraph",children:[{text:""}]}])},n.getParentNode=function(t){return xf.getParentNode(n,t)},n.dangerouslyInsertHtml=function(t,r){if(void 0===t&&(t=""),void 0===r&&(r=!1),t){var i=document.createElement("div");i.innerHTML=t;var a=Array.from(i.childNodes);if(a=a.filter((function(t){var e=t.nodeName;return!!Oc(t)||!!Ec(t)&&!tu.has(e.toLowerCase())})),0!==a.length){var s=n.selection;if(null!=s){var u=null;if(xf.isSelectedEmptyParagraph(n)&&!r)u=[s.focus.path[0]];i.setAttribute("hidden","true"),document.body.appendChild(i);var l=0;a.forEach((function(t,e){var r=t.nodeName,i=t.textContent,s=void 0===i?"":i;if(Oc(t)){if(!s||!s.trim())return;n.insertNode({text:s})}else if("BR"!==r){var u=t,c=!1;if(Wc.includes(r.toLowerCase()))c=!0;else for(var f in zc)if(u.matches(f)){c=!0;break}if(c){var d=Yc(o(u),n);return Array.isArray(d)?(d.forEach((function(t){return Cf(n,t)})),l+=1):(Cf(n,d),l+=1),void(xf.isSelectedVoidNode(n)&&n.move(1))}var h=window.getComputedStyle(u).display;if(!xf.isSelectedEmptyParagraph(n)&&h.indexOf("inline")<0){if(e>=1){var p=a[e-1];mc(p)&&n.insertBreak()}n.insertBreak()}n.dangerouslyInsertHtml(u.innerHTML,!0)}else n.insertText("\n")})),l&&u&&xf.isEmptyPath(n,u)&&e.Transforms.removeNodes(n,{at:u}),i.remove()}}}},n.setHtml=function(t){void 0===t&&(t="");var r=n.isDisabled(),o=n.isFocused(),i=JSON.stringify(n.selection);n.enable(),n.focus(),n.clear();var a=Qc(n,null==t?"":t);if(e.Transforms.insertFragment(n,a),o||(n.deselect(),n.blur()),r&&(n.deselect(),n.disable()),n.isFocused())try{n.select(JSON.parse(i))}catch(t){n.select(e.Editor.start(n,[]))}},n},hd=1,pd=function(t){var n=t;return n.id="wangEditor-".concat(hd++),n.isDestroyed=!1,n.isFullScreen=!1,n.focus=function(t){if(xf.toDOMNode(n,n).focus({preventScroll:!0}),Wa.set(n,!0),t){var r=e.Editor.end(n,[]);e.Transforms.select(n,r)}else{var o=Ua.get(n);o?e.Transforms.select(n,o):e.Transforms.select(n,e.Editor.start(n,[]))}},n.isFocused=function(){return!!Wa.get(n)},n.blur=function(){xf.toDOMNode(n,n).blur(),e.Transforms.deselect(n),Wa.set(n,!1)},n.updateView=function(){xf.getTextarea(n).changeViewState();var t=xf.getToolbar(n);t&&t.changeToolbarState();var e=xf.getHoverbar(n);e&&e.changeHoverbarState()},n.destroy=function(){if(!n.isDestroyed){var t=xf.getTextarea(n);t.destroy(),xa.delete(n),Ea.delete(t);var e=xf.getToolbar(n);e&&(e.destroy(),Oa.delete(n),Sa.delete(e));var r=xf.getHoverbar(n);r&&(r.destroy(),ka.delete(n),Ca.delete(r)),n.isDestroyed=!0,n.emit("destroyed")}},n.scrollToElem=function(t){if(!n.getConfig().scroll){var e="编辑器禁用了 scroll ,编辑器内容无法滚动,请自行实现该功能";return e+="\nYou has disabled editor scroll, please do this yourself",void console.warn(e)}var r=o("#".concat(t));if(0!==r.length){var i=r[0];if(!xf.hasDOMNode(n,i)){e="Element (found by id is '".concat(t,"') is not in editor DOM");return e+="\n 通过 id '".concat(t,"' 找到的 element 不在 editor DOM 之内"),void console.error(e,i)}var a=xf.getTextarea(n),s=a.$textAreaContainer,u=a.$scroll,l=r.offset().top,c=s.offset().top;u[0].scrollBy({top:l-c,behavior:"smooth"})}},n.showProgressBar=function(t){t<1||xf.getTextarea(n).changeProgress(t)},n.hidePanelOrModal=function(){var t=Na.get(n);null!=t&&t.forEach((function(t){return t.hide()}))},n.enable=function(){n.getConfig().readOnly=!1,n.updateView()},n.disable=function(){n.getConfig().readOnly=!0,n.updateView()},n.isDisabled=function(){return n.getConfig().readOnly},n.toDOMNode=function(t){return xf.toDOMNode(n,t)},n.fullScreen=function(){if(!n.isFullScreen){var t=null,e=xf.getToolbar(n);e&&(t=e.$box);var r=xf.getTextarea(n).$box.parent();if(t&&t.parent()[0]!==r[0]){throw new Error("Can not set full screen, cause toolbar DOM parent is not equal to textarea DOM parent\n不能设置全屏,因为 toolbar DOM 父节点和 textarea DOM 父节点不一致")}r.addClass("w-e-full-screen-container");var o=r.css("z-index");r.attr("data-z-index",o.toString()),n.isFullScreen=!0,n.emit("fullScreen")}},n.unFullScreen=function(){if(n.isFullScreen){var t=xf.getTextarea(n).$box.parent();setTimeout((function(){t.removeClass("w-e-full-screen-container"),n.isFullScreen=!1,n.emit("unFullScreen")}),200)}},n.getEditableContainer=function(){return xf.getTextarea(n).$textAreaContainer[0]},n},gd={exports:{}},vd={exports:{}};function md(){if(Tf)return kf;Tf=1;return kf=function(t){return null!=t}}function yd(){if(Mf)return Lf;Mf=1;var t=function(){if(Rf)return Nf;Rf=1;var t=md(),e={object:!0,function:!0,undefined:!0};return Nf=function(n){return!!t(n)&&hasOwnProperty.call(e,typeof n)}}();return Lf=function(e){if(!t(e))return!1;try{return!!e.constructor&&e.constructor.prototype===e}catch(t){return!1}}}function bd(){if(jf)return Af;jf=1;var t=function(){if(Df)return Pf;Df=1;var t=yd();return Pf=function(e){if("function"!=typeof e)return!1;if(!hasOwnProperty.call(e,"length"))return!1;try{if("number"!=typeof e.length)return!1;if("function"!=typeof e.call)return!1;if("function"!=typeof e.apply)return!1}catch(t){return!1}return!t(e)}}(),e=/^\s*class[\s{/}]/,n=Function.prototype.toString;return Af=function(r){return!!t(r)&&!e.test(n.call(r))}}function wd(){if(Uf)return Wf;Uf=1;var t=(Hf?Bf:(Hf=1,Bf=function(){}))();return Wf=function(e){return e!==t&&null!==e}}function xd(){return qf||(qf=1,Kf=(_f?Ff:(_f=1,Ff=function(){try{return Object.keys("primitive"),!0}catch(t){return!1}}))()?Object.keys:function(){if(zf)return Vf;zf=1;var t=wd(),e=Object.keys;return Vf=function(n){return e(t(n)?Object(n):n)}}()),Kf}function Ed(){if(Xf)return Yf;Xf=1;var t=xd(),e=function(){if(Jf)return Gf;Jf=1;var t=wd();return Gf=function(e){if(!t(e))throw new TypeError("Cannot use null or undefined");return e}}(),n=Math.max;return Yf=function(r,o){var i,a,s,u=n(arguments.length,2);for(r=Object(e(r)),s=function(t){try{r[t]=o[t]}catch(t){i||(i=t)}},a=1;a<u;++a)t(o=arguments[a]).forEach(s);if(void 0!==i)throw i;return r},Yf}function Sd(){return Zf?Qf:(Zf=1,Qf=($f||($f=1,If=function(){var t,e=Object.assign;return"function"==typeof e&&(e(t={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),t.foo+t.bar+t.trzy==="razdwatrzy")}),If)()?Object.assign:Ed())}function Od(){return sd||(sd=1,ad=function(){if(rd)return nd;rd=1;var t="razdwatrzy";return nd=function(){return"function"==typeof t.contains&&!0===t.contains("dwa")&&!1===t.contains("foo")}}()()?String.prototype.contains:function(){if(id)return od;id=1;var t=String.prototype.indexOf;return od=function(e){return t.call(this,e,arguments[1])>-1},od}()),ad}function Cd(){if(ud)return vd.exports;ud=1;var t=md(),e=bd(),n=Sd(),r=function(){if(ed)return td;ed=1;var t=wd(),e=Array.prototype.forEach,n=Object.create;return td=function(r){var o=n(null);return e.call(arguments,(function(e){t(e)&&function(t,e){var n;for(n in t)e[n]=t[n]}(Object(e),o)})),o},td}(),o=Od(),i=vd.exports=function(e,i){var a,s,u,l,c;return arguments.length<2||"string"!=typeof e?(l=i,i=e,e=null):l=arguments[2],t(e)?(a=o.call(e,"c"),s=o.call(e,"e"),u=o.call(e,"w")):(a=u=!0,s=!1),c={value:i,configurable:a,enumerable:s,writable:u},l?n(r(l),c):c};return i.gs=function(i,a,s){var u,l,c,f;return"string"!=typeof i?(c=s,s=a,a=i,i=null):c=arguments[3],t(a)?e(a)?t(s)?e(s)||(c=s,s=void 0):s=void 0:(c=a,a=s=void 0):a=void 0,t(i)?(u=o.call(i,"c"),l=o.call(i,"e")):(u=!0,l=!1),f={get:a,set:s,configurable:u,enumerable:l},c?n(r(c),f):f},vd.exports}var kd=(fd||(fd=1,function(t,e){var n,r,o,i,a,s,u,l=Cd(),c=cd?ld:(cd=1,ld=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");return t}),f=Function.prototype.apply,d=Function.prototype.call,h=Object.create,p=Object.defineProperty,g=Object.defineProperties,v=Object.prototype.hasOwnProperty,m={configurable:!0,enumerable:!1,writable:!0};r=function(t,e){var r,i;return c(e),i=this,n.call(this,t,r=function(){o.call(i,t,r),f.call(e,this,arguments)}),r.__eeOnceListener__=e,this},i=function(t){var e,n,r,o,i;if(v.call(this,"__ee__")&&(o=this.__ee__[t]))if("object"==typeof o){for(n=arguments.length,i=new Array(n-1),e=1;e<n;++e)i[e-1]=arguments[e];for(o=o.slice(),e=0;r=o[e];++e)f.call(r,this,i)}else switch(arguments.length){case 1:d.call(o,this);break;case 2:d.call(o,this,arguments[1]);break;case 3:d.call(o,this,arguments[1],arguments[2]);break;default:for(n=arguments.length,i=new Array(n-1),e=1;e<n;++e)i[e-1]=arguments[e];f.call(o,this,i)}},a={on:n=function(t,e){var n;return c(e),v.call(this,"__ee__")?n=this.__ee__:(n=m.value=h(null),p(this,"__ee__",m),m.value=null),n[t]?"object"==typeof n[t]?n[t].push(e):n[t]=[n[t],e]:n[t]=e,this},once:r,off:o=function(t,e){var n,r,o,i;if(c(e),!v.call(this,"__ee__"))return this;if(!(n=this.__ee__)[t])return this;if("object"==typeof(r=n[t]))for(i=0;o=r[i];++i)o!==e&&o.__eeOnceListener__!==e||(2===r.length?n[t]=r[i?0:1]:r.splice(i,1));else r!==e&&r.__eeOnceListener__!==e||delete n[t];return this},emit:i},s={on:l(n),once:l(r),off:l(o),emit:l(i)},u=g({},s),t.exports=e=function(t){return null==t?h(u):g(Object(t),s)},e.methods=a}(gd,gd.exports)),gd.exports),Td=g(kd);function Nd(t){var e=Va.get(t);return null==e&&(e=Td(),Va.set(t,e)),e}var Rd=new WeakMap;function Ld(t,e){var n=Rd.get(t);null==n&&(n=new Set,Rd.set(t,n)),n.add(e)}var Md,Pd=function(t){var e=t;return e.on=function(t,n){var r=Nd(e);if(r.on(t,n),"destroyed"===t&&Ld(e,n),"destroyed"!==t){var o=function(){return r.off(t,n)};r.on("destroyed",o),Ld(e,o)}},e.once=function(t,n){Nd(e).once(t,n)},e.off=function(t,n){Nd(e).off(t,n)},e.emit=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=Nd(e);if(o.emit.apply(o,po([t],ho(n),!1)),"destroyed"===t){var i=function(t){return Rd.get(t)||new Set}(e);i.forEach((function(t){return o.off("destroyed",t)})),function(t){Rd.set(t,new Set)}(e)}},e},Dd=function(t){var n=t;return n.setFragmentData=function(t){var r=n.selection;if(r){var o=ho(e.Range.edges(r),2),i=o[0],a=o[1],s=e.Editor.void(n,{at:i.path}),u=e.Editor.void(n,{at:a.path});if(!e.Range.isCollapsed(r)||s){var l=xf.toDOMRange(n,r),c=l.cloneContents(),f=c.childNodes[0];if(c.childNodes.forEach((function(t){t.textContent&&""!==t.textContent.trim()&&(f=t)})),u){var d=ho(u,1)[0],h=l.cloneRange(),p=xf.toDOMNode(n,d);h.setEndAfter(p),c=h.cloneContents()}if(s&&(f=c.querySelector("[data-slate-spacer]")),Array.from(c.querySelectorAll("[data-slate-zero-width]")).forEach((function(t){var e="n"===t.getAttribute("data-slate-zero-width");t.textContent=e?"\n":""})),Oc(f)){var g=f.ownerDocument.createElement("span");g.style.whiteSpace="pre",g.appendChild(f),c.appendChild(g),f=g}var v=n.getFragment(),m=JSON.stringify(v),y=window.btoa(encodeURIComponent(m));f.setAttribute("data-slate-fragment",y),t.setData("application/x-slate-fragment",y);var b=c.ownerDocument.createElement("div");return b.appendChild(c),b.setAttribute("hidden","true"),c.ownerDocument.body.appendChild(b),t.setData("text/html",b.innerHTML),t.setData("text/plain",Mc(b)),c.ownerDocument.body.removeChild(b),t}}},n.insertData=function(t){var r,o,i=t.getData("application/x-slate-fragment");if(i){var a=decodeURIComponent(window.atob(i)),s=JSON.parse(a);n.insertFragment(s)}else{var u=t.getData("text/plain"),l=t.getData("text/html");if(l)n.dangerouslyInsertHtml(l);else if(u){var c=u.split(/\n\r|\r\n|\r|\n/),f=!1;try{for(var d=fo(c),h=d.next();!h.done;h=d.next()){var p=h.value,g=xf.getLeftLengthOfMaxLength(n);f&&g>0&&e.Transforms.splitNodes(n,{always:!0}),n.insertText(p),f=!0}}catch(t){r={error:t}}finally{try{h&&!h.done&&(o=d.return)&&o.call(d)}finally{if(r)throw r.error}}}}},n},Ad={};!function(){if(Md)return Ad;Md=1;var t=pr(),e=gr(),n=wr(),r=Lt(),o=Nn(),i=Ln(),a=Nt(),s=mr(),u=we(),l=Sr(),c=oa(),f=l("slice"),d=u("species"),h=Array,p=Math.max;t({target:"Array",proto:!0,forced:!f},{slice:function(t,u){var l,f,g,v=a(this),m=i(v),y=o(t,m),b=o(void 0===u?m:u,m);if(e(v)&&(l=v.constructor,(n(l)&&(l===h||e(l.prototype))||r(l)&&null===(l=l[d]))&&(l=void 0),l===h||void 0===l))return c(v,y,b);for(f=new(void 0===l?h:l)(p(b-y,0)),g=0;y<b;y++,g++)y in v&&s(f,g,v[y]);return f.length=g,f}})}();var jd=function(t){var n=t,r=n.insertText,o=n.insertNode,i=n.insertFragment,a=n.dangerouslyInsertHtml;return n.insertText=function(t){if(n.getConfig().maxLength){var e=xf.getLeftLengthOfMaxLength(n);e<=0||(e<t.length?r(t.slice(0,e)):r(t))}else r(t)},n.insertNode=function(t){if(n.getConfig().maxLength){var r=xf.getLeftLengthOfMaxLength(n);if(!(r<=0))r<e.Node.string(t).length||o(t)}else o(t)},n.insertFragment=function(t){if(n.getConfig().maxLength){if(t.length>0){var r=t[0];if(xf.getLeftLengthOfMaxLength(n)<e.Node.string(r).length)return;i([r]);for(var o=1;o<t.length;o+=1)n.insertNode(t[o])}}else i(t)},n.dangerouslyInsertHtml=function(t,e){if(void 0===t&&(t=""),void 0===e&&(e=!1),t)if(n.getConfig().maxLength){var r=xf.getLeftLengthOfMaxLength(n);if(!(r<=0)){var o=document.createElement("div");o.innerHTML=t,r<Array.from(o.childNodes).reduce((function(t,e){var n=e.nodeName;return e?Oc(e)?t+(e.textContent||""):Ec(e)?tu.has(n.toLowerCase())?t:t+(e.textContent||""):t:t}),"").length||a(t,e)}}else a(t,e)},n};function Id(t){var e=xf.getTextarea(t).$textAreaContainer,n=e.width(),r=e.height(),o=e.offset();return{top:o.top,left:o.left,width:n,height:r}}function $d(t){var e={top:"0",left:"0"},n=t.selection;if(null==n)return e;var r=Id(t);if(null==r)return e;var o=r.top,i=r.left,a=r.width,s=r.height,u=xf.toDOMRange(t,n).getClientRects(),l=u?u[0]:null;if(null==l)return e;var c={},f=l.top-o,d=l.left-i;if(d>a/2){var h=a-d;c.right="".concat(h+5,"px")}else c.left="".concat(d+5,"px");if(f>s/2){var p=s-f;c.bottom="".concat(p+5,"px")}else{var g=u[u.length-1],v=g.top-o+g.height;v<0&&(v=0),c.top="".concat(v+5,"px")}return c}function Fd(t,n,r){void 0===r&&(r="modal");var o={top:"0",left:"0"};if(null==t.selection)return o;var i=e.Element.isElement(n)&&t.isVoid(n),a=e.Element.isElement(n)&&t.isInline(n),s=_a.get(n);if(null==s)return o;var u=s.getBoundingClientRect(),l=u.top,c=u.left,f=u.height,d=u.width;if(i){var h=Pc(s);if(null!=h){var p=h.getBoundingClientRect();l=p.top,f=p.height}}var g=Id(t);if(null==g)return o;var v=g.top,m=g.left,y=g.width,b=g.height,w={},x=l-v,E=c-m;if("bar"===r)return w.left="".concat(E,"px"),x>40?w.bottom="".concat(b-x+5,"px"):w.top="".concat(x+f+5,"px"),w;if("modal"===r){if(i?a?E>(y-d)/2?w.right="".concat(y-E+5,"px"):w.left="".concat(E+d+5,"px"):w.left="20px":w.left="".concat(E,"px"),i)(S=x)<0&&(S=0),w.top="".concat(S,"px");else if(x>(b-f)/2)w.bottom="".concat(b-x+5,"px");else{var S;(S=x+f)<0&&(S=0),w.top="".concat(S+5,"px")}return w}throw new Error("type '".concat(r,"' is invalid"))}function _d(t,e){rc((function(){var n=Id(t);if(null!=n){var r,o=n.top,i=n.left,a=n.width,s=n.height,u=e.offset(),l=u.top,c=u.left,f=e.width(),d=e.height(),h=l-o,p=c-i,g=e.attr("style");if(g.indexOf("top")>=0)if((r=h+d-s)>0){var v=e.css("top"),m=parseInt(v.toString(),10)-r;m<0&&(m=0),e.css("top","".concat(m,"px"))}if(g.indexOf("bottom")>=0&&l<0){var y=e.css("bottom"),b=parseInt(y.toString(),10)-Math.abs(l);e.css("bottom","".concat(b,"px"))}if(g.indexOf("left")>=0)if((r=p+f-a)>0){var w=e.css("left"),x=parseInt(w.toString(),10)-r;x<0&&(x=0),e.css("left","".concat(x,"px"))}if(g.indexOf("right")>=0&&c<0){var E=e.css("right"),S=parseInt(E.toString(),10)-Math.abs(c);e.css("right","".concat(S,"px"))}}}))}var Bd,Hd=function(t){var n=t;return n.select=function(t){e.Transforms.select(n,t)},n.deselect=function(){var r=n.selection,o=xf.findDocumentOrShadowRoot(n).getSelection();o&&o.rangeCount>0&&o.removeAllRanges(),r&&e.Transforms.deselect(t)},n.move=function(n,r){void 0===r&&(r=!1),n&&(n<0||e.Transforms.move(t,{distance:n,unit:"character",reverse:r}))},n.moveReverse=function(t){n.move(t,!0)},n.restoreSelection=function(){var t=Ua.get(n);null!=t&&(n.focus(),e.Transforms.select(n,t))},n.getSelectionPosition=function(){return $d(n)},n.getNodePosition=function(t){return Fd(n,t)},n.isSelectedAll=function(){var t=n.selection;if(null==t)return!1;var r=ho(e.Range.edges(t),2),o=r[0],i=r[1],a=ho(e.Editor.edges(n,[]),2),s=a[0],u=a[1];return!(!e.Point.equals(o,s)||!e.Point.equals(i,u))},n.selectAll=function(){var t=e.Editor.start(n,[]),r=e.Editor.end(n,[]);e.Transforms.select(n,{anchor:t,focus:r})},n},Wd={};!function(){if(Bd)return Wd;Bd=1;var t=P(),e=wu(),n=je(),r=kt(),o=Rn(),i=mi(),a=Tt(),s=Bt(),u=Su(),l=Ou();e("match",(function(e,c,f){return[function(n){var o=a(this),u=r(n)?void 0:s(n,e);return u?t(u,n,o):new RegExp(n)[e](i(o))},function(t){var e=n(this),r=i(t),a=f(c,e,r);if(a.done)return a.value;if(!e.global)return l(e,r);var s=e.unicode;e.lastIndex=0;for(var d,h=[],p=0;null!==(d=l(e,r));){var g=i(d[0]);h[p]=g,""===g&&(e.lastIndex=u(r,o(e.lastIndex),s)),p++}return 0===p?null:h}]}))}();const Ud={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){console&&console[t]&&console[t].apply(console,e)}};class Vd{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.init(t,e)}init(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=e.prefix||"i18next:",this.logger=t||Ud,this.options=e,this.debug=e.debug}log(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.forward(e,"log","",!0)}warn(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.forward(e,"warn","",!0)}error(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.forward(e,"error","")}deprecate(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(t,e,n,r){return r&&!this.debug?null:("string"==typeof t[0]&&(t[0]=`${n}${this.prefix} ${t[0]}`),this.logger[e](t))}create(t){return new Vd(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return(t=t||this.options).prefix=t.prefix||this.prefix,new Vd(this.logger,t)}}var zd=new Vd;class Kd{constructor(){this.observers={}}on(t,e){return t.split(" ").forEach((t=>{this.observers[t]||(this.observers[t]=new Map);const n=this.observers[t].get(e)||0;this.observers[t].set(e,n+1)})),this}off(t,e){this.observers[t]&&(e?this.observers[t].delete(e):delete this.observers[t])}emit(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];if(this.observers[t]){Array.from(this.observers[t].entries()).forEach((t=>{let[e,r]=t;for(let t=0;t<r;t++)e(...n)}))}if(this.observers["*"]){Array.from(this.observers["*"].entries()).forEach((e=>{let[r,o]=e;for(let e=0;e<o;e++)r.apply(r,[t,...n])}))}}}const qd=()=>{let t,e;const n=new Promise(((n,r)=>{t=n,e=r}));return n.resolve=t,n.reject=e,n},Gd=t=>null==t?"":""+t,Jd=/###/g,Yd=t=>t&&t.indexOf("###")>-1?t.replace(Jd,"."):t,Xd=t=>!t||"string"==typeof t,Qd=(t,e,n)=>{const r="string"!=typeof e?e:e.split(".");let o=0;for(;o<r.length-1;){if(Xd(t))return{};const e=Yd(r[o]);!t[e]&&n&&(t[e]=new n),t=Object.prototype.hasOwnProperty.call(t,e)?t[e]:{},++o}return Xd(t)?{}:{obj:t,k:Yd(r[o])}},Zd=(t,e,n)=>{const{obj:r,k:o}=Qd(t,e,Object);if(void 0!==r||1===e.length)return void(r[o]=n);let i=e[e.length-1],a=e.slice(0,e.length-1),s=Qd(t,a,Object);for(;void 0===s.obj&&a.length;)i=`${a[a.length-1]}.${i}`,a=a.slice(0,a.length-1),s=Qd(t,a,Object),s&&s.obj&&void 0!==s.obj[`${s.k}.${i}`]&&(s.obj=void 0);s.obj[`${s.k}.${i}`]=n},th=(t,e)=>{const{obj:n,k:r}=Qd(t,e);if(n)return n[r]},eh=(t,e,n)=>{for(const r in e)"__proto__"!==r&&"constructor"!==r&&(r in t?"string"==typeof t[r]||t[r]instanceof String||"string"==typeof e[r]||e[r]instanceof String?n&&(t[r]=e[r]):eh(t[r],e[r],n):t[r]=e[r]);return t},nh=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var rh={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const oh=t=>"string"==typeof t?t.replace(/[&<>"'\/]/g,(t=>rh[t])):t;const ih=[" ",",","?","!",";"],ah=new class{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const e=this.regExpMap.get(t);if(void 0!==e)return e;const n=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,n),this.regExpQueue.push(t),n}}(20),sh=function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(!t)return;if(t[e])return t[e];const r=e.split(n);let o=t;for(let t=0;t<r.length;){if(!o||"object"!=typeof o)return;let e,i="";for(let a=t;a<r.length;++a)if(a!==t&&(i+=n),i+=r[a],e=o[i],void 0!==e){if(["string","number","boolean"].indexOf(typeof e)>-1&&a<r.length-1)continue;t+=a-t+1;break}o=e}return o},uh=t=>t&&t.indexOf("_")>0?t.replace("_","-"):t;class lh extends Kd{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=e,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const e=this.options.ns.indexOf(t);e>-1&&this.options.ns.splice(e,1)}getResource(t,e,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,i=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;t.indexOf(".")>-1?a=t.split("."):(a=[t,e],n&&(Array.isArray(n)?a.push(...n):"string"==typeof n&&o?a.push(...n.split(o)):a.push(n)));const s=th(this.data,a);return!s&&!e&&!n&&t.indexOf(".")>-1&&(t=a[0],e=a[1],n=a.slice(2).join(".")),s||!i||"string"!=typeof n?s:sh(this.data&&this.data[t]&&this.data[t][e],n,o)}addResource(t,e,n,r){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1};const i=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator;let a=[t,e];n&&(a=a.concat(i?n.split(i):n)),t.indexOf(".")>-1&&(a=t.split("."),r=e,e=a[1]),this.addNamespaces(e),Zd(this.data,a,r),o.silent||this.emit("added",t,e,n,r)}addResources(t,e,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(const r in n)("string"==typeof n[r]||Array.isArray(n[r]))&&this.addResource(t,e,r,n[r],{silent:!0});r.silent||this.emit("added",t,e,n)}addResourceBundle(t,e,n,r,o){let i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1,skipCopy:!1},a=[t,e];t.indexOf(".")>-1&&(a=t.split("."),r=n,n=e,e=a[1]),this.addNamespaces(e);let s=th(this.data,a)||{};i.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?eh(s,n,o):s={...s,...n},Zd(this.data,a,s),i.silent||this.emit("added",t,e,n)}removeResourceBundle(t,e){this.hasResourceBundle(t,e)&&delete this.data[t][e],this.removeNamespaces(e),this.emit("removed",t,e)}hasResourceBundle(t,e){return void 0!==this.getResource(t,e)}getResourceBundle(t,e){return e||(e=this.options.defaultNS),"v1"===this.options.compatibilityAPI?{...this.getResource(t,e)}:this.getResource(t,e)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const e=this.getDataByLanguage(t);return!!(e&&Object.keys(e)||[]).find((t=>e[t]&&Object.keys(e[t]).length>0))}toJSON(){return this.data}}var ch={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,n,r,o){return t.forEach((t=>{this.processors[t]&&(e=this.processors[t].process(e,n,r,o))})),e}};const fh={};class dh extends Kd{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),((t,e,n)=>{t.forEach((t=>{e[t]&&(n[t]=e[t])}))})(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=e,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=zd.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==t)return!1;const n=this.resolve(t,e);return n&&void 0!==n.res}extractFromKey(t,e){let n=void 0!==e.nsSeparator?e.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");const r=void 0!==e.keySeparator?e.keySeparator:this.options.keySeparator;let o=e.ns||this.options.defaultNS||[];const i=n&&t.indexOf(n)>-1,a=!(this.options.userDefinedKeySeparator||e.keySeparator||this.options.userDefinedNsSeparator||e.nsSeparator||((t,e,n)=>{e=e||"",n=n||"";const r=ih.filter((t=>e.indexOf(t)<0&&n.indexOf(t)<0));if(0===r.length)return!0;const o=ah.getRegExp(`(${r.map((t=>"?"===t?"\\?":t)).join("|")})`);let i=!o.test(t);if(!i){const e=t.indexOf(n);e>0&&!o.test(t.substring(0,e))&&(i=!0)}return i})(t,n,r));if(i&&!a){const e=t.match(this.interpolator.nestingRegexp);if(e&&e.length>0)return{key:t,namespaces:o};const i=t.split(n);(n!==r||n===r&&this.options.ns.indexOf(i[0])>-1)&&(o=i.shift()),t=i.join(r)}return"string"==typeof o&&(o=[o]),{key:t,namespaces:o}}translate(t,e,n){if("object"!=typeof e&&this.options.overloadTranslationOptionHandler&&(e=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof e&&(e={...e}),e||(e={}),null==t)return"";Array.isArray(t)||(t=[String(t)]);const r=void 0!==e.returnDetails?e.returnDetails:this.options.returnDetails,o=void 0!==e.keySeparator?e.keySeparator:this.options.keySeparator,{key:i,namespaces:a}=this.extractFromKey(t[t.length-1],e),s=a[a.length-1],u=e.lng||this.language,l=e.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&"cimode"===u.toLowerCase()){if(l){const t=e.nsSeparator||this.options.nsSeparator;return r?{res:`${s}${t}${i}`,usedKey:i,exactUsedKey:i,usedLng:u,usedNS:s,usedParams:this.getUsedParamsDetails(e)}:`${s}${t}${i}`}return r?{res:i,usedKey:i,exactUsedKey:i,usedLng:u,usedNS:s,usedParams:this.getUsedParamsDetails(e)}:i}const c=this.resolve(t,e);let f=c&&c.res;const d=c&&c.usedKey||i,h=c&&c.exactUsedKey||i,p=Object.prototype.toString.apply(f),g=void 0!==e.joinArrays?e.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject;if(v&&f&&("string"!=typeof f&&"boolean"!=typeof f&&"number"!=typeof f)&&["[object Number]","[object Function]","[object RegExp]"].indexOf(p)<0&&("string"!=typeof g||!Array.isArray(f))){if(!e.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const t=this.options.returnedObjectHandler?this.options.returnedObjectHandler(d,f,{...e,ns:a}):`key '${i} (${this.language})' returned an object instead of string.`;return r?(c.res=t,c.usedParams=this.getUsedParamsDetails(e),c):t}if(o){const t=Array.isArray(f),n=t?[]:{},r=t?h:d;for(const t in f)if(Object.prototype.hasOwnProperty.call(f,t)){const i=`${r}${o}${t}`;n[t]=this.translate(i,{...e,joinArrays:!1,ns:a}),n[t]===i&&(n[t]=f[t])}f=n}}else if(v&&"string"==typeof g&&Array.isArray(f))f=f.join(g),f&&(f=this.extendTranslation(f,t,e,n));else{let r=!1,a=!1;const l=void 0!==e.count&&"string"!=typeof e.count,d=dh.hasDefaultValue(e),h=l?this.pluralResolver.getSuffix(u,e.count,e):"",p=e.ordinal&&l?this.pluralResolver.getSuffix(u,e.count,{ordinal:!1}):"",g=l&&!e.ordinal&&0===e.count&&this.pluralResolver.shouldUseIntlApi(),v=g&&e[`defaultValue${this.options.pluralSeparator}zero`]||e[`defaultValue${h}`]||e[`defaultValue${p}`]||e.defaultValue;!this.isValidLookup(f)&&d&&(r=!0,f=v),this.isValidLookup(f)||(a=!0,f=i);const m=(e.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&a?void 0:f,y=d&&v!==f&&this.options.updateMissing;if(a||r||y){if(this.logger.log(y?"updateKey":"missingKey",u,s,i,y?v:f),o){const t=this.resolve(i,{...e,keySeparator:!1});t&&t.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let t=[];const n=this.languageUtils.getFallbackCodes(this.options.fallbackLng,e.lng||this.language);if("fallback"===this.options.saveMissingTo&&n&&n[0])for(let e=0;e<n.length;e++)t.push(n[e]);else"all"===this.options.saveMissingTo?t=this.languageUtils.toResolveHierarchy(e.lng||this.language):t.push(e.lng||this.language);const r=(t,n,r)=>{const o=d&&r!==f?r:m;this.options.missingKeyHandler?this.options.missingKeyHandler(t,s,n,o,y,e):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(t,s,n,o,y,e),this.emit("missingKey",t,s,n,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&l?t.forEach((t=>{const n=this.pluralResolver.getSuffixes(t,e);g&&e[`defaultValue${this.options.pluralSeparator}zero`]&&n.indexOf(`${this.options.pluralSeparator}zero`)<0&&n.push(`${this.options.pluralSeparator}zero`),n.forEach((n=>{r([t],i+n,e[`defaultValue${n}`]||v)}))})):r(t,i,v))}f=this.extendTranslation(f,t,e,c,n),a&&f===i&&this.options.appendNamespaceToMissingKey&&(f=`${s}:${i}`),(a||r)&&this.options.parseMissingKeyHandler&&(f="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${s}:${i}`:i,r?f:void 0):this.options.parseMissingKeyHandler(f))}return r?(c.res=f,c.usedParams=this.getUsedParamsDetails(e),c):f}extendTranslation(t,e,n,r,o){var i=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const a="string"==typeof t&&(n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let s;if(a){const e=t.match(this.interpolator.nestingRegexp);s=e&&e.length}let u=n.replace&&"string"!=typeof n.replace?n.replace:n;if(this.options.interpolation.defaultVariables&&(u={...this.options.interpolation.defaultVariables,...u}),t=this.interpolator.interpolate(t,u,n.lng||this.language||r.usedLng,n),a){const e=t.match(this.interpolator.nestingRegexp);s<(e&&e.length)&&(n.nest=!1)}!n.lng&&"v1"!==this.options.compatibilityAPI&&r&&r.res&&(n.lng=this.language||r.usedLng),!1!==n.nest&&(t=this.interpolator.nest(t,(function(){for(var t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];return o&&o[0]===r[0]&&!n.context?(i.logger.warn(`It seems you are nesting recursively key: ${r[0]} in key: ${e[0]}`),null):i.translate(...r,e)}),n)),n.interpolation&&this.interpolator.reset()}const a=n.postProcess||this.options.postProcess,s="string"==typeof a?[a]:a;return null!=t&&s&&s.length&&!1!==n.applyPostProcessor&&(t=ch.handle(s,t,e,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),t}resolve(t){let e,n,r,o,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof t&&(t=[t]),t.forEach((t=>{if(this.isValidLookup(e))return;const s=this.extractFromKey(t,a),u=s.key;n=u;let l=s.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));const c=void 0!==a.count&&"string"!=typeof a.count,f=c&&!a.ordinal&&0===a.count&&this.pluralResolver.shouldUseIntlApi(),d=void 0!==a.context&&("string"==typeof a.context||"number"==typeof a.context)&&""!==a.context,h=a.lngs?a.lngs:this.languageUtils.toResolveHierarchy(a.lng||this.language,a.fallbackLng);l.forEach((t=>{this.isValidLookup(e)||(i=t,!fh[`${h[0]}-${t}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(i)&&(fh[`${h[0]}-${t}`]=!0,this.logger.warn(`key "${n}" for languages "${h.join(", ")}" won't get resolved as namespace "${i}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),h.forEach((n=>{if(this.isValidLookup(e))return;o=n;const i=[u];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(i,u,n,t,a);else{let t;c&&(t=this.pluralResolver.getSuffix(n,a.count,a));const e=`${this.options.pluralSeparator}zero`,r=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(c&&(i.push(u+t),a.ordinal&&0===t.indexOf(r)&&i.push(u+t.replace(r,this.options.pluralSeparator)),f&&i.push(u+e)),d){const n=`${u}${this.options.contextSeparator}${a.context}`;i.push(n),c&&(i.push(n+t),a.ordinal&&0===t.indexOf(r)&&i.push(n+t.replace(r,this.options.pluralSeparator)),f&&i.push(n+e))}}let s;for(;s=i.pop();)this.isValidLookup(e)||(r=s,e=this.getResource(n,t,s,a))})))}))})),{res:e,usedKey:n,exactUsedKey:r,usedLng:o,usedNS:i}}isValidLookup(t){return!(void 0===t||!this.options.returnNull&&null===t||!this.options.returnEmptyString&&""===t)}getResource(t,e,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,e,n,r):this.resourceStore.getResource(t,e,n,r)}getUsedParamsDetails(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=t.replace&&"string"!=typeof t.replace;let r=n?t.replace:t;if(n&&void 0!==t.count&&(r.count=t.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(const t of e)delete r[t]}return r}static hasDefaultValue(t){const e="defaultValue";for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e===n.substring(0,12)&&void 0!==t[n])return!0;return!1}}const hh=t=>t.charAt(0).toUpperCase()+t.slice(1);class ph{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=zd.create("languageUtils")}getScriptPartFromCode(t){if(!(t=uh(t))||t.indexOf("-")<0)return null;const e=t.split("-");return 2===e.length?null:(e.pop(),"x"===e[e.length-1].toLowerCase()?null:this.formatLanguageCode(e.join("-")))}getLanguagePartFromCode(t){if(!(t=uh(t))||t.indexOf("-")<0)return t;const e=t.split("-");return this.formatLanguageCode(e[0])}formatLanguageCode(t){if("string"==typeof t&&t.indexOf("-")>-1){const e=["hans","hant","latn","cyrl","cans","mong","arab"];let n=t.split("-");return this.options.lowerCaseLng?n=n.map((t=>t.toLowerCase())):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),e.indexOf(n[1].toLowerCase())>-1&&(n[1]=hh(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),e.indexOf(n[1].toLowerCase())>-1&&(n[1]=hh(n[1].toLowerCase())),e.indexOf(n[2].toLowerCase())>-1&&(n[2]=hh(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let e;return t.forEach((t=>{if(e)return;const n=this.formatLanguageCode(t);this.options.supportedLngs&&!this.isSupportedCode(n)||(e=n)})),!e&&this.options.supportedLngs&&t.forEach((t=>{if(e)return;const n=this.getLanguagePartFromCode(t);if(this.isSupportedCode(n))return e=n;e=this.options.supportedLngs.find((t=>t===n?t:t.indexOf("-")<0&&n.indexOf("-")<0?void 0:t.indexOf("-")>0&&n.indexOf("-")<0&&t.substring(0,t.indexOf("-"))===n||0===t.indexOf(n)&&n.length>1?t:void 0))})),e||(e=this.getFallbackCodes(this.options.fallbackLng)[0]),e}getFallbackCodes(t,e){if(!t)return[];if("function"==typeof t&&(t=t(e)),"string"==typeof t&&(t=[t]),Array.isArray(t))return t;if(!e)return t.default||[];let n=t[e];return n||(n=t[this.getScriptPartFromCode(e)]),n||(n=t[this.formatLanguageCode(e)]),n||(n=t[this.getLanguagePartFromCode(e)]),n||(n=t.default),n||[]}toResolveHierarchy(t,e){const n=this.getFallbackCodes(e||this.options.fallbackLng||[],t),r=[],o=t=>{t&&(this.isSupportedCode(t)?r.push(t):this.logger.warn(`rejecting language code not found in supportedLngs: ${t}`))};return"string"==typeof t&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(t)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(t)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(t))):"string"==typeof t&&o(this.formatLanguageCode(t)),n.forEach((t=>{r.indexOf(t)<0&&o(this.formatLanguageCode(t))})),r}}let gh=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],vh={1:t=>Number(t>1),2:t=>Number(1!=t),3:t=>0,4:t=>Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2),5:t=>Number(0==t?0:1==t?1:2==t?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5),6:t=>Number(1==t?0:t>=2&&t<=4?1:2),7:t=>Number(1==t?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2),8:t=>Number(1==t?0:2==t?1:8!=t&&11!=t?2:3),9:t=>Number(t>=2),10:t=>Number(1==t?0:2==t?1:t<7?2:t<11?3:4),11:t=>Number(1==t||11==t?0:2==t||12==t?1:t>2&&t<20?2:3),12:t=>Number(t%10!=1||t%100==11),13:t=>Number(0!==t),14:t=>Number(1==t?0:2==t?1:3==t?2:3),15:t=>Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2),16:t=>Number(t%10==1&&t%100!=11?0:0!==t?1:2),17:t=>Number(1==t||t%10==1&&t%100!=11?0:1),18:t=>Number(0==t?0:1==t?1:2),19:t=>Number(1==t?0:0==t||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3),20:t=>Number(1==t?0:0==t||t%100>0&&t%100<20?1:2),21:t=>Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0),22:t=>Number(1==t?0:2==t?1:(t<0||t>10)&&t%10==0?2:3)};const mh=["v1","v2","v3"],yh=["v4"],bh={zero:0,one:1,two:2,few:3,many:4,other:5};class wh{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.languageUtils=t,this.options=e,this.logger=zd.create("pluralResolver"),this.options.compatibilityJSON&&!yh.includes(this.options.compatibilityJSON)||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=(()=>{const t={};return gh.forEach((e=>{e.lngs.forEach((n=>{t[n]={numbers:e.nr,plurals:vh[e.fc]}}))})),t})(),this.pluralRulesCache={}}addRule(t,e){this.rules[t]=e}clearCache(){this.pluralRulesCache={}}getRule(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{const n=uh("dev"===t?"en":t),r=e.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:n,type:r});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];const i=new Intl.PluralRules(n,{type:r});return this.pluralRulesCache[o]=i,i}catch(t){return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=this.getRule(t,e);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}getPluralFormsOfKey(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(t,n).map((t=>`${e}${t}`))}getSuffixes(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=this.getRule(t,e);return n?this.shouldUseIntlApi()?n.resolvedOptions().pluralCategories.sort(((t,e)=>bh[t]-bh[e])).map((t=>`${this.options.prepend}${e.ordinal?`ordinal${this.options.prepend}`:""}${t}`)):n.numbers.map((n=>this.getSuffix(t,n,e))):[]}getSuffix(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=this.getRule(t,n);return r?this.shouldUseIntlApi()?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r.select(e)}`:this.getSuffixRetroCompatible(r,e):(this.logger.warn(`no plural rule found for: ${t}`),"")}getSuffixRetroCompatible(t,e){const n=t.noAbs?t.plurals(e):t.plurals(Math.abs(e));let r=t.numbers[n];this.options.simplifyPluralSuffix&&2===t.numbers.length&&1===t.numbers[0]&&(2===r?r="plural":1===r&&(r=""));const o=()=>this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString();return"v1"===this.options.compatibilityJSON?1===r?"":"number"==typeof r?`_plural_${r.toString()}`:o():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===t.numbers.length&&1===t.numbers[0]?o():this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString()}shouldUseIntlApi(){return!mh.includes(this.options.compatibilityJSON)}}const xh=function(t,e,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".",o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=((t,e,n)=>{const r=th(t,n);return void 0!==r?r:th(e,n)})(t,e,n);return!i&&o&&"string"==typeof n&&(i=sh(t,n,r),void 0===i&&(i=sh(e,n,r))),i},Eh=t=>t.replace(/\$/g,"$$$$");class Sh{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=zd.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||(t=>t),this.init(t)}init(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const{escape:e,escapeValue:n,useRawValueToEscape:r,prefix:o,prefixEscaped:i,suffix:a,suffixEscaped:s,formatSeparator:u,unescapeSuffix:l,unescapePrefix:c,nestingPrefix:f,nestingPrefixEscaped:d,nestingSuffix:h,nestingSuffixEscaped:p,nestingOptionsSeparator:g,maxReplaces:v,alwaysFormat:m}=t.interpolation;this.escape=void 0!==e?e:oh,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==r&&r,this.prefix=o?nh(o):i||"{{",this.suffix=a?nh(a):s||"}}",this.formatSeparator=u||",",this.unescapePrefix=l?"":c||"-",this.unescapeSuffix=this.unescapePrefix?"":l||"",this.nestingPrefix=f?nh(f):d||nh("$t("),this.nestingSuffix=h?nh(h):p||nh(")"),this.nestingOptionsSeparator=g||",",this.maxReplaces=v||1e3,this.alwaysFormat=void 0!==m&&m,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(t,e)=>t&&t.source===e?(t.lastIndex=0,t):new RegExp(e,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(t,e,n,r){let o,i,a;const s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=t=>{if(t.indexOf(this.formatSeparator)<0){const o=xh(e,s,t,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(o,void 0,n,{...r,...e,interpolationkey:t}):o}const o=t.split(this.formatSeparator),i=o.shift().trim(),a=o.join(this.formatSeparator).trim();return this.format(xh(e,s,i,this.options.keySeparator,this.options.ignoreJSONStructure),a,n,{...r,...e,interpolationkey:i})};this.resetRegExp();const l=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,c=r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:t=>Eh(t)},{regex:this.regexp,safeValue:t=>this.escapeValue?Eh(this.escape(t)):Eh(t)}].forEach((e=>{for(a=0;o=e.regex.exec(t);){const n=o[1].trim();if(i=u(n),void 0===i)if("function"==typeof l){const e=l(t,o,r);i="string"==typeof e?e:""}else if(r&&Object.prototype.hasOwnProperty.call(r,n))i="";else{if(c){i=o[0];continue}this.logger.warn(`missed to pass in variable ${n} for interpolating ${t}`),i=""}else"string"==typeof i||this.useRawValueToEscape||(i=Gd(i));const s=e.safeValue(i);if(t=t.replace(o[0],s),c?(e.regex.lastIndex+=i.length,e.regex.lastIndex-=o[0].length):e.regex.lastIndex=0,a++,a>=this.maxReplaces)break}})),t}nest(t,e){let n,r,o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const a=(t,e)=>{const n=this.nestingOptionsSeparator;if(t.indexOf(n)<0)return t;const r=t.split(new RegExp(`${n}[ ]*{`));let i=`{${r[1]}`;t=r[0],i=this.interpolate(i,o);const a=i.match(/'/g),s=i.match(/"/g);(a&&a.length%2==0&&!s||s.length%2!=0)&&(i=i.replace(/'/g,'"'));try{o=JSON.parse(i),e&&(o={...e,...o})}catch(e){return this.logger.warn(`failed parsing options string in nesting for key ${t}`,e),`${t}${n}${i}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,t};for(;n=this.nestingRegexp.exec(t);){let s=[];o={...i},o=o.replace&&"string"!=typeof o.replace?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;let u=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){const t=n[1].split(this.formatSeparator).map((t=>t.trim()));n[1]=t.shift(),s=t,u=!0}if(r=e(a.call(this,n[1].trim(),o),o),r&&n[0]===t&&"string"!=typeof r)return r;"string"!=typeof r&&(r=Gd(r)),r||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${t}`),r=""),u&&(r=s.reduce(((t,e)=>this.format(t,e,i.lng,{...i,interpolationkey:n[1].trim()})),r.trim())),t=t.replace(n[0],r),this.regexp.lastIndex=0}return t}}const Oh=t=>{const e={};return(n,r,o)=>{let i=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(i={...i,[o.interpolationkey]:void 0});const a=r+JSON.stringify(i);let s=e[a];return s||(s=t(uh(r),o),e[a]=s),s(n)}};class Ch{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=zd.create("formatter"),this.options=t,this.formats={number:Oh(((t,e)=>{const n=new Intl.NumberFormat(t,{...e});return t=>n.format(t)})),currency:Oh(((t,e)=>{const n=new Intl.NumberFormat(t,{...e,style:"currency"});return t=>n.format(t)})),datetime:Oh(((t,e)=>{const n=new Intl.DateTimeFormat(t,{...e});return t=>n.format(t)})),relativetime:Oh(((t,e)=>{const n=new Intl.RelativeTimeFormat(t,{...e});return t=>n.format(t,e.range||"day")})),list:Oh(((t,e)=>{const n=new Intl.ListFormat(t,{...e});return t=>n.format(t)}))},this.init(t)}init(t){const e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=e.formatSeparator?e.formatSeparator:e.formatSeparator||","}add(t,e){this.formats[t.toLowerCase().trim()]=e}addCached(t,e){this.formats[t.toLowerCase().trim()]=Oh(e)}format(t,e,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const o=e.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find((t=>t.indexOf(")")>-1))){const t=o.findIndex((t=>t.indexOf(")")>-1));o[0]=[o[0],...o.splice(1,t)].join(this.formatSeparator)}const i=o.reduce(((t,e)=>{const{formatName:o,formatOptions:i}=(t=>{let e=t.toLowerCase().trim();const n={};if(t.indexOf("(")>-1){const r=t.split("(");e=r[0].toLowerCase().trim();const o=r[1].substring(0,r[1].length-1);"currency"===e&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):"relativetime"===e&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach((t=>{if(t){const[e,...r]=t.split(":"),o=r.join(":").trim().replace(/^'+|'+$/g,""),i=e.trim();n[i]||(n[i]=o),"false"===o&&(n[i]=!1),"true"===o&&(n[i]=!0),isNaN(o)||(n[i]=parseInt(o,10))}}))}return{formatName:e,formatOptions:n}})(e);if(this.formats[o]){let e=t;try{const a=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},s=a.locale||a.lng||r.locale||r.lng||n;e=this.formats[o](t,s,{...i,...r,...a})}catch(t){this.logger.warn(t)}return e}return this.logger.warn(`there was no format function for ${o}`),t}),t);return i}}class kh extends Kd{constructor(t,e,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};super(),this.backend=t,this.store=e,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=zd.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(n,r.backend,r)}queueLoad(t,e,n,r){const o={},i={},a={},s={};return t.forEach((t=>{let r=!0;e.forEach((e=>{const a=`${t}|${e}`;!n.reload&&this.store.hasResourceBundle(t,e)?this.state[a]=2:this.state[a]<0||(1===this.state[a]?void 0===i[a]&&(i[a]=!0):(this.state[a]=1,r=!1,void 0===i[a]&&(i[a]=!0),void 0===o[a]&&(o[a]=!0),void 0===s[e]&&(s[e]=!0)))})),r||(a[t]=!0)})),(Object.keys(o).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(o),pending:Object.keys(i),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(s)}}loaded(t,e,n){const r=t.split("|"),o=r[0],i=r[1];e&&this.emit("failedLoading",o,i,e),!e&&n&&this.store.addResourceBundle(o,i,n,void 0,void 0,{skipCopy:!0}),this.state[t]=e?-1:2,e&&n&&(this.state[t]=0);const a={};this.queue.forEach((n=>{((t,e,n)=>{const{obj:r,k:o}=Qd(t,e,Object);r[o]=r[o]||[],r[o].push(n)})(n.loaded,[o],i),((t,e)=>{void 0!==t.pending[e]&&(delete t.pending[e],t.pendingCount--)})(n,t),e&&n.errors.push(e),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach((t=>{a[t]||(a[t]={});const e=n.loaded[t];e.length&&e.forEach((e=>{void 0===a[t][e]&&(a[t][e]=!0)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",a),this.queue=this.queue.filter((t=>!t.done))}read(t,e,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,i=arguments.length>5?arguments[5]:void 0;if(!t.length)return i(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:t,ns:e,fcName:n,tried:r,wait:o,callback:i});this.readingCalls++;const a=(a,s)=>{if(this.readingCalls--,this.waitingReads.length>0){const t=this.waitingReads.shift();this.read(t.lng,t.ns,t.fcName,t.tried,t.wait,t.callback)}a&&s&&r<this.maxRetries?setTimeout((()=>{this.read.call(this,t,e,n,r+1,2*o,i)}),o):i(a,s)},s=this.backend[n].bind(this.backend);if(2!==s.length)return s(t,e,a);try{const n=s(t,e);n&&"function"==typeof n.then?n.then((t=>a(null,t))).catch(a):a(null,n)}catch(t){a(t)}}prepareLoading(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();"string"==typeof t&&(t=this.languageUtils.toResolveHierarchy(t)),"string"==typeof e&&(e=[e]);const o=this.queueLoad(t,e,n,r);if(!o.toLoad.length)return o.pending.length||r(),null;o.toLoad.forEach((t=>{this.loadOne(t)}))}load(t,e,n){this.prepareLoading(t,e,{},n)}reload(t,e,n){this.prepareLoading(t,e,{reload:!0},n)}loadOne(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=t.split("|"),r=n[0],o=n[1];this.read(r,o,"read",void 0,void 0,((n,i)=>{n&&this.logger.warn(`${e}loading namespace ${o} for language ${r} failed`,n),!n&&i&&this.logger.log(`${e}loaded namespace ${o} for language ${r}`,i),this.loaded(t,n,i)}))}saveMissing(t,e,n,r,o){let i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(e))this.logger.warn(`did not save key "${n}" as the namespace "${e}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");else if(null!=n&&""!==n){if(this.backend&&this.backend.create){const s={...i,isUpdate:o},u=this.backend.create.bind(this.backend);if(u.length<6)try{let o;o=5===u.length?u(t,e,n,r,s):u(t,e,n,r),o&&"function"==typeof o.then?o.then((t=>a(null,t))).catch(a):a(null,o)}catch(t){a(t)}else u(t,e,n,r,a,s)}t&&t[0]&&this.store.addResource(t[0],e,n,r)}}}const Th=()=>({debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let e={};if("object"==typeof t[1]&&(e=t[1]),"string"==typeof t[1]&&(e.defaultValue=t[1]),"string"==typeof t[2]&&(e.tDescription=t[2]),"object"==typeof t[2]||"object"==typeof t[3]){const n=t[3]||t[2];Object.keys(n).forEach((t=>{e[t]=n[t]}))}return e},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),Nh=t=>("string"==typeof t.ns&&(t.ns=[t.ns]),"string"==typeof t.fallbackLng&&(t.fallbackLng=[t.fallbackLng]),"string"==typeof t.fallbackNS&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&t.supportedLngs.indexOf("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t),Rh=()=>{};class Lh extends Kd{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;var n;if(super(),this.options=Nh(t),this.services={},this.logger=zd,this.modules={external:[]},n=this,Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach((t=>{"function"==typeof n[t]&&(n[t]=n[t].bind(n))})),e&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,e),this;setTimeout((()=>{this.init(t,e)}),0)}}init(){var t=this;let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,"function"==typeof e&&(n=e,e={}),!e.defaultNS&&!1!==e.defaultNS&&e.ns&&("string"==typeof e.ns?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const r=Th();this.options={...r,...this.options,...Nh(e)},"v1"!==this.options.compatibilityAPI&&(this.options.interpolation={...r.interpolation,...this.options.interpolation}),void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator);const o=t=>t?"function"==typeof t?new t:t:null;if(!this.options.isClone){let e;this.modules.logger?zd.init(o(this.modules.logger),this.options):zd.init(null,this.options),this.modules.formatter?e=this.modules.formatter:"undefined"!=typeof Intl&&(e=Ch);const n=new ph(this.options);this.store=new lh(this.options.resources,this.options);const i=this.services;i.logger=zd,i.resourceStore=this.store,i.languageUtils=n,i.pluralResolver=new wh(n,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!e||this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format||(i.formatter=o(e),i.formatter.init(i,this.options),this.options.interpolation.format=i.formatter.format.bind(i.formatter)),i.interpolator=new Sh(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new kh(o(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on("*",(function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];t.emit(e,...r)})),this.modules.languageDetector&&(i.languageDetector=o(this.modules.languageDetector),i.languageDetector.init&&i.languageDetector.init(i,this.options.detection,this.options)),this.modules.i18nFormat&&(i.i18nFormat=o(this.modules.i18nFormat),i.i18nFormat.init&&i.i18nFormat.init(this)),this.translator=new dh(this.services,this.options),this.translator.on("*",(function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];t.emit(e,...r)})),this.modules.external.forEach((t=>{t.init&&t.init(this)}))}if(this.format=this.options.interpolation.format,n||(n=Rh),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const t=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);t.length>0&&"dev"!==t[0]&&(this.options.lng=t[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((e=>{this[e]=function(){return t.store[e](...arguments)}}));["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((e=>{this[e]=function(){return t.store[e](...arguments),t}}));const i=qd(),a=()=>{const t=(t,e)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),i.resolve(e),n(t,e)};if(this.languages&&"v1"!==this.options.compatibilityAPI&&!this.isInitialized)return t(null,this.t.bind(this));this.changeLanguage(this.options.lng,t)};return this.options.resources||!this.options.initImmediate?a():setTimeout(a,0),i}loadResources(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Rh;const n="string"==typeof t?t:this.language;if("function"==typeof t&&(e=t),!this.options.resources||this.options.partialBundledLanguages){if(n&&"cimode"===n.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return e();const t=[],r=e=>{if(!e)return;if("cimode"===e)return;this.services.languageUtils.toResolveHierarchy(e).forEach((e=>{"cimode"!==e&&t.indexOf(e)<0&&t.push(e)}))};if(n)r(n);else{this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((t=>r(t)))}this.options.preload&&this.options.preload.forEach((t=>r(t))),this.services.backendConnector.load(t,this.options.ns,(t=>{t||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),e(t)}))}else e(null)}reloadResources(t,e,n){const r=qd();return"function"==typeof t&&(n=t,t=void 0),"function"==typeof e&&(n=e,e=void 0),t||(t=this.languages),e||(e=this.options.ns),n||(n=Rh),this.services.backendConnector.reload(t,e,(t=>{r.resolve(),n(t)})),r}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===t.type&&(this.modules.backend=t),("logger"===t.type||t.log&&t.warn&&t.error)&&(this.modules.logger=t),"languageDetector"===t.type&&(this.modules.languageDetector=t),"i18nFormat"===t.type&&(this.modules.i18nFormat=t),"postProcessor"===t.type&&ch.addPostProcessor(t),"formatter"===t.type&&(this.modules.formatter=t),"3rdParty"===t.type&&this.modules.external.push(t),this}setResolvedLanguage(t){if(t&&this.languages&&!(["cimode","dev"].indexOf(t)>-1))for(let t=0;t<this.languages.length;t++){const e=this.languages[t];if(!(["cimode","dev"].indexOf(e)>-1)&&this.store.hasLanguageSomeTranslations(e)){this.resolvedLanguage=e;break}}}changeLanguage(t,e){var n=this;this.isLanguageChangingTo=t;const r=qd();this.emit("languageChanging",t);const o=t=>{this.language=t,this.languages=this.services.languageUtils.toResolveHierarchy(t),this.resolvedLanguage=void 0,this.setResolvedLanguage(t)},i=(t,i)=>{i?(o(i),this.translator.changeLanguage(i),this.isLanguageChangingTo=void 0,this.emit("languageChanged",i),this.logger.log("languageChanged",i)):this.isLanguageChangingTo=void 0,r.resolve((function(){return n.t(...arguments)})),e&&e(t,(function(){return n.t(...arguments)}))},a=e=>{t||e||!this.services.languageDetector||(e=[]);const n="string"==typeof e?e:this.services.languageUtils.getBestMatchFromCodes(e);n&&(this.language||o(n),this.translator.language||this.translator.changeLanguage(n),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(n)),this.loadResources(n,(t=>{i(t,n)}))};return t||!this.services.languageDetector||this.services.languageDetector.async?!t&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(t):a(this.services.languageDetector.detect()),r}getFixedT(t,e,n){var r=this;const o=function(t,e){let i;if("object"!=typeof e){for(var a=arguments.length,s=new Array(a>2?a-2:0),u=2;u<a;u++)s[u-2]=arguments[u];i=r.options.overloadTranslationOptionHandler([t,e].concat(s))}else i={...e};i.lng=i.lng||o.lng,i.lngs=i.lngs||o.lngs,i.ns=i.ns||o.ns,""!==i.keyPrefix&&(i.keyPrefix=i.keyPrefix||n||o.keyPrefix);const l=r.options.keySeparator||".";let c;return c=i.keyPrefix&&Array.isArray(t)?t.map((t=>`${i.keyPrefix}${l}${t}`)):i.keyPrefix?`${i.keyPrefix}${l}${t}`:t,r.t(c,i)};return"string"==typeof t?o.lng=t:o.lngs=t,o.ns=e,o.keyPrefix=n,o}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=e.lng||this.resolvedLanguage||this.languages[0],r=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;const i=(t,e)=>{const n=this.services.backendConnector.state[`${t}|${e}`];return-1===n||0===n||2===n};if(e.precheck){const t=e.precheck(this,i);if(void 0!==t)return t}return!!this.hasResourceBundle(n,t)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!i(n,t)||r&&!i(o,t)))}loadNamespaces(t,e){const n=qd();return this.options.ns?("string"==typeof t&&(t=[t]),t.forEach((t=>{this.options.ns.indexOf(t)<0&&this.options.ns.push(t)})),this.loadResources((t=>{n.resolve(),e&&e(t)})),n):(e&&e(),Promise.resolve())}loadLanguages(t,e){const n=qd();"string"==typeof t&&(t=[t]);const r=this.options.preload||[],o=t.filter((t=>r.indexOf(t)<0&&this.services.languageUtils.isSupportedCode(t)));return o.length?(this.options.preload=r.concat(o),this.loadResources((t=>{n.resolve(),e&&e(t)})),n):(e&&e(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";const e=this.services&&this.services.languageUtils||new ph(Th());return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(e.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){return new Lh(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}cloneInstance(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Rh;const n=t.forkResourceStore;n&&delete t.forkResourceStore;const r={...this.options,...t,isClone:!0},o=new Lh(r);void 0===t.debug&&void 0===t.prefix||(o.logger=o.logger.clone(t));return["store","services","language"].forEach((t=>{o[t]=this[t]})),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},n&&(o.store=new lh(this.store.data,r),o.services.resourceStore=o.store),o.translator=new dh(o.services,r),o.translator.on("*",(function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];o.emit(t,...n)})),o.init(r,e),o.translator.options=r,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Mh=Lh.createInstance();Mh.createInstance=Lh.createInstance,Mh.createInstance,Mh.dir,Mh.init,Mh.loadResources,Mh.reloadResources,Mh.use,Mh.changeLanguage,Mh.getFixedT,Mh.t,Mh.exists,Mh.setDefaultNamespace,Mh.hasLoadedNamespace,Mh.loadNamespaces,Mh.loadLanguages;var Ph="translation";function Dh(t){return Mh.on("languageChanged",t),function(){return Mh.off("languageChanged",t)}}Mh.init({lng:"zh-CN",resources:{}});var Ah=Mh.t.bind(Mh);function jh(t){if(t.removeAttr){t.removeAttr("width"),t.removeAttr("height"),t.removeAttr("fill"),t.removeAttr("class"),t.removeAttr("t"),t.removeAttr("p-id");var e=t.children();e.length&&jh(e)}}function Ih(){return o('<svg viewBox="0 0 1024 1024"><path d="M498.7 655.8l-197.6-268c-8.1-10.9-0.3-26.4 13.3-26.4h395.2c13.6 0 21.4 15.4 13.3 26.4l-197.6 268c-6.6 9-20 9-26.6 0z"></path></svg>')}function $h(){return o('<div class="w-e-bar-divider"></div>')}function Fh(t,e,n,r,o){if(void 0===r&&(r=""),void 0===o&&(o=!1),e){if(r){var i=pf?"cmd":"ctrl";r=r.replace("mod",i)}if(o)r&&(t.attr("data-tooltip",r),t.addClass("w-e-menu-tooltip-v5"),t.addClass("tooltip-right"));else{var a=r?"".concat(n,"\n").concat(r):n;t.attr("data-tooltip",a),t.addClass("w-e-menu-tooltip-v5")}}}var _h=function(){function t(t,e,n){void 0===n&&(n=!1);var r=this;this.$elem=o('<div class="w-e-bar-item"></div>'),this.$button=o('<button type="button"></button>'),this.disabled=!1,this.menu=e;var i=e.tag,a=e.width;if("button"!==i)throw new Error("Invalid tag '".concat(i,"', expected 'button'"));var s=e.title,u=e.hotkey,l=void 0===u?"":u,c=e.iconSvg,f=void 0===c?"":c,d=this.$button;if(f){var h=o(f);jh(h),d.append(h)}else d.text(s);Fh(d,f,s,l,n),n&&f&&d.append(o('<span class="title">'.concat(s,"</span>"))),a&&d.css("width","".concat(a,"px")),d.attr("data-menu-key",t),this.$elem.append(d),rc((function(){return r.init()}))}return t.prototype.init=function(){var t=this;this.setActive(),this.setDisabled(),this.$button.on("click",(function(e){e.preventDefault(),Yh(t).hidePanelOrModal(),t.disabled||(t.exec(),t.onButtonClick())}))},t.prototype.exec=function(){var t=Yh(this),e=this.menu,n=e.getValue(t);this.setIcon(),this.setTooltip(),e.exec(t,n)},t.prototype.setActive=function(){var t=Yh(this),e=this.$button,n="active";this.menu.isActive(t)?e.addClass(n):e.removeClass(n)},t.prototype.setDisabled=function(){var t=Yh(this),e=this.$button,n=this.menu.isDisabled(t);(null==t.selection||t.isDisabled())&&(n=!0),this.menu.alwaysEnable&&(n=!1);var r="disabled";n?e.addClass(r):e.removeClass(r),this.disabled=n},t.prototype.setIcon=function(){var t=Yh(this),e=this.$button;if(this.menu.getIcon){var n=this.menu.getIcon(t);if(n){e.find("svg").remove();var r=o(n);jh(r),e.append(r)}}},t.prototype.setTooltip=function(){var t=Yh(this),e=this.$button;if(this.menu.getTitle){var n=this.menu.getTitle(t),r=this.menu.iconSvg;n&&r&&Fh(e,r,n)}},t.prototype.changeMenuState=function(){this.setActive(),this.setDisabled()},t}(),Bh=function(t){function e(e,n,r){return void 0===r&&(r=!1),t.call(this,e,n,r)||this}return lo(e,t),e.prototype.onButtonClick=function(){},e}(_h),Hh=function(){function t(t){this.isShow=!1,this.showTime=0,this.record(t)}return t.prototype.record=function(t){var e=Na.get(t);null==e&&(e=new Set,Na.set(t,e)),e.add(this),Ra.set(this,t)},t.prototype.renderContent=function(t){var e=this.$elem;e.empty(),e.append(t);var n=this.genSelfElem();n&&e.append(n)},t.prototype.appendTo=function(t){var e=this.$elem;t.append(e)},t.prototype.show=function(){if(!this.isShow){this.showTime=Date.now(),this.$elem.show(),this.isShow=!0;var t=Ra.get(this);t&&t.emit("modalOrPanelShow",this)}},t.prototype.hide=function(){if(this.isShow&&!(Date.now()-this.showTime<200)){this.$elem.hide(),this.isShow=!1;var t=Ra.get(this);t&&t.emit("modalOrPanelHide")}},t}(),Wh=function(t){function e(e){var n=t.call(this,e)||this;return n.type="dropPanel",n.$elem=o('<div class="w-e-drop-panel"></div>'),n}return lo(e,t),e.prototype.genSelfElem=function(){return null},e}(Hh),Uh=function(t){function e(e,n,r){void 0===r&&(r=!1);var o=t.call(this,e,n,r)||this;if(o.dropPanel=null,o.menu=n,n.showDropPanel){var i=Ih();o.$button.append(i)}return o}return lo(e,t),e.prototype.onButtonClick=function(){this.menu.showDropPanel&&this.handleDropPanel()},e.prototype.handleDropPanel=function(){var t=this.menu;if(null!=t.getPanelContentElem){var e=Yh(this);if(null==this.dropPanel){var n=new Wh(e),r=t.getPanelContentElem(e);n.renderContent(r),n.appendTo(this.$elem),n.show(),this.dropPanel=n}else{var o=this.dropPanel;if(o.isShow)o.hide();else{r=t.getPanelContentElem(e);o.renderContent(r),o.show()}}var i=this.dropPanel;if(i.isShow){var a=this.$elem,s=a.offset().left,u=a.parents(".w-e-bar");s-u.offset().left>=u.width()/2?i.$elem.css({left:"none",right:"0"}):i.$elem.css({left:"0",right:"none"})}}},e}(_h),Vh=function(t){function e(e,n){void 0===n&&(n=0);var r=t.call(this,e)||this;r.type="modal",r.$elem=o('<div class="w-e-modal"></div>'),r.width=0,n&&(r.width=n);var i=r.$elem;return i.on("click",(function(t){return t.stopPropagation()})),i.on("keyup",(function(t){"Escape"===t.code&&(r.hide(),e.restoreSelection())})),r}return lo(e,t),e.prototype.genSelfElem=function(){var t=this,e=o('<span class="btn-close">'.concat('<svg viewBox="0 0 1024 1024"><path d="M1024 896.1024l-128 128L512 640 128 1024 0 896 384 512 0 128 128 0 512 384 896.1024 0l128 128L640 512z"></path></svg>',"</span>")),n=Ra.get(this);return e.on("click",(function(){t.hide(),null==n||n.restoreSelection()})),e},e.prototype.setStyle=function(t){var e=this.width,n=this.$elem;n.attr("style",""),e&&n.css("width","".concat(e,"px")),n.css(t)},e}(Hh);var zh=function(t){function n(e,n,r){void 0===r&&(r=!1);var i=t.call(this,e,n,r)||this;return i.$body=o("body"),i.modal=null,i.menu=n,i}return lo(n,t),n.prototype.onButtonClick=function(){this.menu.showModal&&this.handleModal()},n.prototype.getPosition=function(){var t=Yh(this),n=this.menu.getModalPositionNode(t);return e.Element.isElement(n)?Fd(t,n,"modal"):$d(t)},n.prototype.handleModal=function(){var t=Yh(this),e=this.menu;if(null==this.modal){var n=new Vh(t,e.modalWidth);this.renderAndShowModal(n,!0),this.modal=n}else{(n=this.modal).isShow?n.hide():this.renderAndShowModal(n,!1)}},n.prototype.renderAndShowModal=function(t,e){void 0===e&&(e=!1);var n=Yh(this),r=this.menu;if(null!=r.getModalContentElem){var o=xf.getTextarea(n),i=xf.getToolbar(n),a=((null==i?void 0:i.getConfig())||{}).modalAppendToBody,s=r.getModalContentElem(n);if(t.renderContent(s),a)t.setStyle({left:"0",right:"0"});else{var u=this.getPosition();t.setStyle(u)}e&&(a?t.appendTo(this.$body):t.appendTo(o.$textAreaContainer)),t.show(),a||_d(n,t.$elem),setTimeout((function(){n.blur()}))}},n}(_h);var Kh=function(t){function e(e,n){var r=t.call(this,e)||this;return r.type="selectList",r.$elem=o('<div class="w-e-select-list"></div>'),n&&r.$elem.css("width","".concat(n,"px")),r.$elem.on("click",(function(t){t.stopPropagation()})),r}return lo(e,t),e.prototype.renderList=function(t){var e=this.$elem;e.empty();var n=o("<ul></ul>");t.forEach((function(t){var e=t.value,r=t.text,i=t.selected,a=t.styleForRenderMenuList,s=o('<li data-value="'.concat(e,'"></li>'));if(a&&s.css(a),i){var u=o('<svg viewBox="0 0 1446 1024"><path d="M574.116299 786.736392 1238.811249 48.517862C1272.390222 11.224635 1329.414799 7.827718 1366.75664 41.450462 1403.840015 74.840484 1406.731043 132.084741 1373.10189 169.433699L655.118888 966.834607C653.072421 969.716875 650.835807 972.514337 648.407938 975.210759 615.017957 1012.29409 558.292155 1015.652019 521.195664 982.250188L72.778218 578.493306C35.910826 545.297758 32.859041 488.584019 66.481825 451.242134 99.871807 414.158803 156.597563 410.800834 193.694055 444.202665L574.116299 786.736392Z"></path></svg>');s.append(u),s.addClass("selected")}s.append(o('<span data-value="'.concat(e,'">').concat(r,"</span>"))),s.attr("title",r),n.append(s)})),e.append(n)},e.prototype.genSelfElem=function(){return null},e}(Hh);var qh=function(){function t(t,e,n){void 0===n&&(n=!1);var r=this;this.$elem=o('<div class="w-e-bar-item"></div>'),this.$button=o('<button type="button" class="select-button"></button>'),this.disabled=!1,this.selectList=null;var i=e.tag,a=e.title,s=e.width,u=e.iconSvg,l=void 0===u?"":u,c=e.hotkey,f=void 0===c?"":c;if("select"!==i)throw new Error("Invalid tag '".concat(i,"', expected 'select'"));var d=this.$button;s&&d.css("width","".concat(s,"px")),d.attr("data-menu-key",t),Fh(d,l,a,f,n),this.$elem.append(d),this.menu=e,rc((function(){return r.init()}))}return t.prototype.init=function(){var t=this;this.setSelectedValue(),this.$button.on("click",(function(e){e.preventDefault(),Yh(t).hidePanelOrModal(),t.trigger()}))},t.prototype.trigger=function(){var t=this,e=Yh(this);if(!e.isDisabled()&&!this.disabled){var n=this.menu;if(null==this.selectList){this.selectList=new Kh(e,n.selectPanelWidth);var r=this.selectList,i=n.getOptions(e);r.renderList(i),r.appendTo(this.$elem),r.show(),r.$elem.on("click","li",(function(e){var n=e.target;if(null!=n){e.preventDefault();var r=o(n).attr("data-value");t.onChange(r)}}))}else{if((r=this.selectList).isShow)r.hide();else{i=n.getOptions(e);r.renderList(i),r.show()}}}},t.prototype.onChange=function(t){var e=Yh(this),n=this.menu;n.exec&&n.exec(e,t)},t.prototype.setSelectedValue=function(){var t=Yh(this),e=this.menu,n=e.getValue(t),r=function(t,e){for(var n=t.length,r="",o=0;o<n;o++){var i=t[o];if(i.value===e){r=i.text;break}}return r}(e.getOptions(t),n.toString()),o=this.$button,i=Ih();o.empty(),o.text(r),o.append(i)},t.prototype.setDisabled=function(){var t=Yh(this),e=this.menu.isDisabled(t),n=this.$button;(null==t.selection||t.isDisabled())&&(e=!0);var r="disabled";e?n.addClass(r):n.removeClass(r),this.disabled=e},t.prototype.changeMenuState=function(){this.setSelectedValue(),this.setDisabled()},t}(),Gh=function(){function t(t){this.$elem=o('<div class="w-e-bar-item w-e-bar-item-group"></div>'),this.$container=o('<div class="w-e-bar-item-menus-container"></div>'),this.$button=o('<button type="button"></button>');var e=t.key,n=t.iconSvg,r=t.title,i=this.$elem,a=this.$button;if(n){var s=o(n);jh(s),a.append(s)}else a.text(r);a.attr("data-menu-key",e);var u=Ih();a.append(u),i.append(a);var l=this.$container;i.append(l);var c=this.createObserver();this.observe(c)}return t.prototype.appendBarItem=function(t){var e=t.$elem;this.$container.append(e)},t.prototype.observe=function(t){var e=this.$container;t.observe(e[0],{childList:!0,subtree:!0,attributes:!0})},t.prototype.createObserver=function(){var t=this,e=this.$container,n=this.$button,r=new MutationObserver((function(){var i=e.find("button"),a=i.length;if(0!==a){var s=0;i.each((function(t){o(t).hasClass("disabled")&&s++})),r.disconnect(),s===a?n.addClass("disabled"):n.removeClass("disabled"),t.observe(r)}}));return r},t}(),Jh=new WeakMap;function Yh(t){var e=Ta.get(t);if(null==e)throw new Error("Can not get editor instance");return e}function Xh(t,e,n){void 0===n&&(n=!1);var r=Jh.get(e);if(r)return r;var o=e.tag;if("button"===o){var i=e.showDropPanel,a=e.showModal;r=i?new Uh(t,e,n):a?new zh(t,e,n):new Bh(t,e,n)}if("select"===o&&(r=new qh(t,e,n)),null==r)throw new Error("Invalid tag in menu ".concat(JSON.stringify(e)));return Jh.set(e,r),r}function Qh(t,n){var r=t.selection;return null!=r&&(!e.Range.isCollapsed(r)&&(!xf.getSelectedElems(t).some((function(e){if(t.isVoid(e))return!0;var n=e.type;return!!["pre","code","table"].includes(n)}))&&!!e.Text.isText(n)))}var Zh,tp=function(){function t(){var t=this;this.$elem=o('<div class="w-e-bar w-e-bar-hidden w-e-hover-bar"></div>'),this.menus={},this.hoverbarItems=[],this.prevSelectedNode=null,this.isShow=!1,this.lngListen=function(){},this.changeHoverbarState=s((function(){var n=t.isShow,r=t.getSelectedNodeAndMenuKeys()||{},o=r.node,i=void 0===o?null:o,a=r.menuKeys,s=void 0===a?[]:a,u=t.getEditorInstance();if(null!=i&&t.changeItemsState(),i&&e.Element.isElement(i)&&n){var l=t.isSamePath(i,t.prevSelectedNode);if(!e.Editor.isBlock(u,i)&&l)return}t.hideAndClean(),null!=i&&(t.registerItems(s),t.setPosition(i),t.show()),t.prevSelectedNode=i}),200),rc((function(){var e=t.getEditorInstance(),n=t.$elem;n.on("mousedown",(function(t){return t.preventDefault()}),{passive:!1}),xf.getTextarea(e).$textAreaContainer.append(n),e.on(vo.CHANGE,t.changeHoverbarState);var r=t.hideAndClean.bind(t);e.on(vo.SCROLL,r),e.on(vo.FULLSCREEN,r),e.on(vo.UNFULLSCREEN,r)})),this.lngListen=Dh((function(){t.menus={},t.hideAndClean(),t.getEditorInstance().deselect()}))}return t.prototype.getMenus=function(){return this.menus},t.prototype.hideAndClean=function(){var t=this.$elem;t.removeClass("w-e-bar-show").addClass("w-e-bar-hidden"),this.hoverbarItems=[],t.empty(),this.isShow=!1},t.prototype.checkPositionBottom=function(){var t=this.$elem,e=!1,n="undefined"!=typeof window?window.innerHeight:null;n&&n>=360&&(n-t[0].getBoundingClientRect().bottom<360&&(e=!0));e?t.addClass("w-e-bar-bottom"):t.removeClass("w-e-bar-bottom")},t.prototype.show=function(){this.$elem.removeClass("w-e-bar-hidden").addClass("w-e-bar-show"),this.isShow=!0,this.checkPositionBottom()},t.prototype.changeItemsState=function(){var t=this;rc((function(){t.hoverbarItems.forEach((function(t){t.changeMenuState()}))}))},t.prototype.registerItems=function(t){var e=this,n=this.$elem;t.forEach((function(t){if("|"!==t)e.registerSingleItem(t);else{var r=$h();n.append(r)}}))},t.prototype.registerSingleItem=function(t){var e=this.getEditorInstance(),n=this.menus,r=n[t];if(null==r){var o=mo[t];if(null==o)throw new Error("Not found menu item factory by key '".concat(t,"'"));if("function"!=typeof o)throw new Error("Menu item factory (key='".concat(t,"') is not a function"));r=o(),n[t]=r}var i=e.getMenuConfig(t);i&&void 0!==i.iconSvg&&(r.iconSvg=i.iconSvg);var a=Xh(t,r);this.hoverbarItems.push(a),Ta.set(a,e),this.$elem.append(a.$elem)},t.prototype.setPosition=function(t){var n=this.getEditorInstance(),r=this.$elem;if(r.attr("style",""),e.Element.isElement(t)){var o=Fd(n,t,"bar");return r.css(o),void _d(n,r)}if(e.Text.isText(t)){o=$d(n);return r.css(o),void _d(n,r)}throw new Error("hoverbar.setPosition error, current selected node is not elem nor text")},t.prototype.getSelectedNodeAndMenuKeys=function(){var t=this.getEditorInstance();if(null==t.selection)return null;var n=this.getHoverbarKeysConf(),r=null,o=[],i=function(i){var a=n[i],s=a.match,u=a.menuKeys,l=void 0===u?[]:u,c=s||function(t,e){return xf.checkNodeType(e,i)},f=ho(e.Editor.nodes(t,{match:function(e){return c(t,e)},universal:!0}),1),d=f[0];if(null!=d)return r=d[0],o=l,"break"};for(var a in n){if("break"===i(a))break}return null==r||0===o.length?null:{node:r,menuKeys:o}},t.prototype.getEditorInstance=function(){var t=Ca.get(this);if(null==t)throw new Error("Can not get editor instance");return t},t.prototype.getHoverbarKeysConf=function(){var t=this.getEditorInstance().getConfig().hoverbarKeys,e=void 0===t?{}:t,n=e.text;return n&&null==n.match&&(n.match=Qh),e},t.prototype.isSamePath=function(t,n){if(null==t||null==n)return!1;var r=xf.findPath(null,t),o=xf.findPath(null,n);return e.Path.equals(r,o)},t.prototype.destroy=function(){var t;this.changeHoverbarState.cancel(),this.$elem.remove(),null===(t=this.lngListen)||void 0===t||t.call(this),this.menus={},this.hoverbarItems=[],this.prevSelectedNode=null},t}(),ep={};function np(t,e){return wc(e)&&xf.hasDOMNode(t,e,{editable:!0})}function rp(t,n){if(t.getConfig().readOnly)return!1;var r=op(t,n)&&xf.toSlateNode(t,n);return e.Editor.isVoid(t,r)}function op(t,e){return wc(e)&&xf.hasDOMNode(t,e)}!function(){if(Zh)return ep;Zh=1;var t,e=pr(),n=Xr(),r=Ce().f,o=Rn(),i=mi(),a=vs(),s=Tt(),u=ms(),l=he(),c=n("".slice),f=Math.min,d=u("startsWith");e({target:"String",proto:!0,forced:!!(l||d||(t=r(String.prototype,"startsWith"),!t||t.writable))&&!d},{startsWith:function(t){var e=i(s(this));a(t);var n=o(f(arguments.length>1?arguments[1]:void 0,e.length)),r=i(t);return c(e,n,n+r.length)===r}})}();const ip=t=>"object"==typeof t&&null!=t&&1===t.nodeType,ap=(t,e)=>(!e||"hidden"!==t)&&"visible"!==t&&"clip"!==t,sp=(t,e)=>{if(t.clientHeight<t.scrollHeight||t.clientWidth<t.scrollWidth){const n=getComputedStyle(t,null);return ap(n.overflowY,e)||ap(n.overflowX,e)||(t=>{const e=(t=>{if(!t.ownerDocument||!t.ownerDocument.defaultView)return null;try{return t.ownerDocument.defaultView.frameElement}catch(t){return null}})(t);return!!e&&(e.clientHeight<t.scrollHeight||e.clientWidth<t.scrollWidth)})(t)}return!1},up=(t,e,n,r,o,i,a,s)=>i<t&&a>e||i>t&&a<e?0:i<=t&&s<=n||a>=e&&s>=n?i-t-r:a>e&&s<n||i<t&&s>n?a-e+o:0,lp=t=>{const e=t.parentElement;return null==e?t.getRootNode().host||null:e},cp=(t,e)=>{var n,r,o,i;if("undefined"==typeof document)return[];const{scrollMode:a,block:s,inline:u,boundary:l,skipOverflowHiddenElements:c}=e,f="function"==typeof l?l:t=>t!==l;if(!ip(t))throw new TypeError("Invalid target");const d=document.scrollingElement||document.documentElement,h=[];let p=t;for(;ip(p)&&f(p);){if(p=lp(p),p===d){h.push(p);break}null!=p&&p===document.body&&sp(p)&&!sp(document.documentElement)||null!=p&&sp(p,c)&&h.push(p)}const g=null!=(r=null==(n=window.visualViewport)?void 0:n.width)?r:innerWidth,v=null!=(i=null==(o=window.visualViewport)?void 0:o.height)?i:innerHeight,{scrollX:m,scrollY:y}=window,{height:b,width:w,top:x,right:E,bottom:S,left:O}=t.getBoundingClientRect(),{top:C,right:k,bottom:T,left:N}=(t=>{const e=window.getComputedStyle(t);return{top:parseFloat(e.scrollMarginTop)||0,right:parseFloat(e.scrollMarginRight)||0,bottom:parseFloat(e.scrollMarginBottom)||0,left:parseFloat(e.scrollMarginLeft)||0}})(t);let R="start"===s||"nearest"===s?x-C:"end"===s?S+T:x+b/2-C+T,L="center"===u?O+w/2-N+k:"end"===u?E+k:O-N;const M=[];for(let t=0;t<h.length;t++){const e=h[t],{height:n,width:r,top:o,right:i,bottom:l,left:c}=e.getBoundingClientRect();if("if-needed"===a&&x>=0&&O>=0&&S<=v&&E<=g&&x>=o&&S<=l&&O>=c&&E<=i)return M;const f=getComputedStyle(e),p=parseInt(f.borderLeftWidth,10),C=parseInt(f.borderTopWidth,10),k=parseInt(f.borderRightWidth,10),T=parseInt(f.borderBottomWidth,10);let N=0,P=0;const D="offsetWidth"in e?e.offsetWidth-e.clientWidth-p-k:0,A="offsetHeight"in e?e.offsetHeight-e.clientHeight-C-T:0,j="offsetWidth"in e?0===e.offsetWidth?0:r/e.offsetWidth:0,I="offsetHeight"in e?0===e.offsetHeight?0:n/e.offsetHeight:0;if(d===e)N="start"===s?R:"end"===s?R-v:"nearest"===s?up(y,y+v,v,C,T,y+R,y+R+b,b):R-v/2,P="start"===u?L:"center"===u?L-g/2:"end"===u?L-g:up(m,m+g,g,p,k,m+L,m+L+w,w),N=Math.max(0,N+y),P=Math.max(0,P+m);else{N="start"===s?R-o-C:"end"===s?R-l+T+A:"nearest"===s?up(o,l,n,C,T+A,R,R+b,b):R-(o+n/2)+A/2,P="start"===u?L-c-p:"center"===u?L-(c+r/2)+D/2:"end"===u?L-i+k+D:up(c,i,r,p,k+D,L,L+w,w);const{scrollLeft:t,scrollTop:a}=e;N=0===I?0:Math.max(0,Math.min(a+N/I,e.scrollHeight-n/I+A)),P=0===j?0:Math.max(0,Math.min(t+P/j,e.scrollWidth-r/j+D)),R+=a-N,L+=t-P}M.push({el:e,top:N,left:P})}return M},fp=t=>!1===t?{block:"end",inline:"nearest"}:(t=>t===Object(t)&&0!==Object.keys(t).length)(t)?t:{block:"start",inline:"nearest"};function dp(t,n,r){void 0===r&&(r=!1);var o=n.selection,i=n.getConfig(),a=xf.findDocumentOrShadowRoot(n).getSelection();if(a&&(!t.isComposing||r)&&n.isFocused()){var s="None"!==a.type;if(o||s){var u=Ia.get(n),l=!1;if(u.contains(a.anchorNode)&&u.contains(a.focusNode)&&(l=!0),s&&l&&o){var c=xf.toSlateRange(n,a,{exactMatch:!0,suppressThrow:!0});if(c&&e.Range.equals(c,o)){var f=!0;if(e.Range.isCollapsed(o)){var d=a.anchorNode,h=a.anchorOffset;if(d===u){var p=u.childNodes,g=void 0;(g=p[h])&&g.matches("table")&&(f=!1),(g=p[h-1])&&g.matches("table")&&(f=!1)}}if(f)return}}if(!o||xf.hasRange(n,o)){t.isUpdatingSelection=!0;var v=o&&xf.toDOMRange(n,o);if(v){e.Range.isBackward(o)?a.setBaseAndExtent(v.endContainer,v.endOffset,v.startContainer,v.startOffset):a.setBaseAndExtent(v.startContainer,v.startOffset,v.endContainer,v.endOffset);var m=v.startContainer.parentElement;if(!m.closest("[data-slate-spacer]")&&v.getBoundingClientRect){m.getBoundingClientRect=v.getBoundingClientRect.bind(v);var y=document.body;!function(t,e){if(!t.isConnected||!(t=>{let e=t;for(;e&&e.parentNode;){if(e.parentNode===document)return!0;e=e.parentNode instanceof ShadowRoot?e.parentNode.host:e.parentNode}return!1})(t))return;const n=(t=>{const e=window.getComputedStyle(t);return{top:parseFloat(e.scrollMarginTop)||0,right:parseFloat(e.scrollMarginRight)||0,bottom:parseFloat(e.scrollMarginBottom)||0,left:parseFloat(e.scrollMarginLeft)||0}})(t);if((t=>"object"==typeof t&&"function"==typeof t.behavior)(e))return e.behavior(cp(t,e));const r="boolean"==typeof e||null==e?void 0:e.behavior;for(const{el:o,top:i,left:a}of cp(t,fp(e))){const t=i-n.top+n.bottom,e=a-n.left+n.right;o.scroll({top:t,left:e,behavior:r})}}(m,{scrollMode:"if-needed",boundary:i.scroll?u.parentElement:y,block:"end",behavior:"smooth"}),delete m.getBoundingClientRect}}else a.removeAllRanges();setTimeout((function(){v&&gf&&u.focus(),t.isUpdatingSelection=!1}))}else n.selection=xf.toSlateRange(n,a,{exactMatch:!1,suppressThrow:!1})}}}var hp=new WeakMap,pp=new WeakMap;var gp={bold:"mod+b",compose:["down","left","right","up","backspace","enter"],moveBackward:"left",moveForward:"right",moveWordBackward:"ctrl+left",moveWordForward:"ctrl+right",deleteBackward:"shift?+backspace",deleteForward:"shift?+delete",extendBackward:"shift+left",extendForward:"shift+right",italic:"mod+i",splitBlock:"shift?+enter",undo:"mod+z",tab:"tab",selectAll:"mod+a"},vp={moveLineBackward:"opt+up",moveLineForward:"opt+down",moveWordBackward:"opt+left",moveWordForward:"opt+right",deleteBackward:["ctrl+backspace","ctrl+h"],deleteForward:["ctrl+delete","ctrl+d"],deleteLineBackward:"cmd+shift?+backspace",deleteLineForward:["cmd+shift?+delete","ctrl+k"],deleteWordBackward:"opt+shift?+backspace",deleteWordForward:"opt+shift?+delete",extendLineBackward:"opt+shift+up",extendLineForward:"opt+shift+down",redo:"cmd+shift+z",transposeCharacter:"ctrl+t"},mp={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:["ctrl+y","ctrl+shift+z"]},yp=function(t){var e=gp[t],n=vp[t],r=mp[t],o=e&&l.isKeyHotkey(e),i=n&&l.isKeyHotkey(n),a=r&&l.isKeyHotkey(r);return function(t){return!(!o||!o(t))||(!!(pf&&i&&i(t))||!(pf||!a||!a(t)))}},bp={isBold:yp("bold"),isCompose:yp("compose"),isMoveBackward:yp("moveBackward"),isMoveForward:yp("moveForward"),isDeleteBackward:yp("deleteBackward"),isDeleteForward:yp("deleteForward"),isDeleteLineBackward:yp("deleteLineBackward"),isDeleteLineForward:yp("deleteLineForward"),isDeleteWordBackward:yp("deleteWordBackward"),isDeleteWordForward:yp("deleteWordForward"),isExtendBackward:yp("extendBackward"),isExtendForward:yp("extendForward"),isExtendLineBackward:yp("extendLineBackward"),isExtendLineForward:yp("extendLineForward"),isItalic:yp("italic"),isMoveLineBackward:yp("moveLineBackward"),isMoveLineForward:yp("moveLineForward"),isMoveWordBackward:yp("moveWordBackward"),isMoveWordForward:yp("moveWordForward"),isRedo:yp("redo"),isSplitBlock:yp("splitBlock"),isTransposeCharacter:yp("transposeCharacter"),isUndo:yp("undo"),isTab:yp("tab"),isSelectAll:yp("selectAll")};function wp(t){t.preventDefault()}var xp,Ep,Sp,Op={beforeinput:function(t,n,r){var o=t,i=r.getConfig().readOnly;if(wf&&!i&&np(r,o.target)){var a=r.selection,s=o.inputType,u=o.dataTransfer||o.data||void 0;if("insertCompositionText"!==s&&"deleteCompositionText"!==s){if(o.preventDefault(),!s.startsWith("delete")||s.startsWith("deleteBy")){var l=ho(o.getTargetRanges(),1)[0];if(l){var c=xf.toSlateRange(r,l,{exactMatch:!1,suppressThrow:!1});a&&e.Range.equals(a,c)||e.Transforms.select(r,c)}}if(a&&e.Range.isExpanded(a)){var f=xf.getSelectedElems(r),d="table"===f[0].type,h="table-cell"!==f[f.length-1].type;if(d&&h)return;if(s.startsWith("delete")){var p=s.endsWith("Backward")?"backward":"forward";return void e.Editor.deleteFragment(r,{direction:p})}}switch(s){case"deleteByComposition":case"deleteByCut":case"deleteByDrag":e.Editor.deleteFragment(r);break;case"deleteContent":case"deleteContentForward":e.Editor.deleteForward(r);break;case"deleteContentBackward":e.Editor.deleteBackward(r);break;case"deleteEntireSoftLine":e.Editor.deleteBackward(r,{unit:"line"}),e.Editor.deleteForward(r,{unit:"line"});break;case"deleteHardLineBackward":e.Editor.deleteBackward(r,{unit:"block"});break;case"deleteSoftLineBackward":e.Editor.deleteBackward(r,{unit:"line"});break;case"deleteHardLineForward":e.Editor.deleteForward(r,{unit:"block"});break;case"deleteSoftLineForward":e.Editor.deleteForward(r,{unit:"line"});break;case"deleteWordBackward":e.Editor.deleteBackward(r,{unit:"word"});break;case"deleteWordForward":e.Editor.deleteForward(r,{unit:"word"});break;case"insertLineBreak":case"insertParagraph":e.Editor.insertBreak(r);break;case"insertFromDrop":case"insertFromPaste":case"insertFromYank":case"insertReplacementText":case"insertText":if("insertFromPaste"===s&&!za.get(r))break;gc(u)?r.insertData(u):"string"==typeof u&&e.Editor.insertText(r,u)}}}},blur:function(t,n,r){var o=t,i=n.isUpdatingSelection,a=n.latestElement;if(!r.getConfig().readOnly&&!i&&np(r,o.target)){var s=xf.findDocumentOrShadowRoot(r);if(a!==s.activeElement){var u=o.relatedTarget;if(!(u===xf.toDOMNode(r,r)||Ec(u)&&u.hasAttribute("data-slate-spacer"))){if(null!=u&&wc(u)&&xf.hasDOMNode(r,u)){var l=xf.toSlateNode(r,u);if(e.Element.isElement(l)&&!r.isVoid(l))return}if(vf){var c=s.getSelection();null==c||c.removeAllRanges()}Wa.delete(r)}}}},focus:function(t,e,n){var r=xf.toDOMNode(n,n),o=xf.findDocumentOrShadowRoot(n);e.latestElement=o.activeElement,gf&&t.target!==r?r.focus():Wa.set(n,!0)},click:function(t,n,r){if(!r.getConfig().readOnly&&op(r,t.target)&&wc(t.target)){var o=xf.toSlateNode(r,t.target),i=xf.findPath(r,o);if(e.Editor.hasPath(r,i))if(e.Node.get(r,i)===o){var a=e.Editor.start(r,i),s=e.Editor.end(r,i),u=e.Editor.void(r,{at:a}),l=e.Editor.void(r,{at:s});if(u&&l&&e.Path.equals(u[1],l[1])){var c=e.Editor.range(r,a);e.Transforms.select(r,c)}}}},compositionstart:function(t,n,r){if(np(r,t.target)){var o=r.selection;if(o&&e.Range.isExpanded(o)&&(e.Editor.deleteFragment(r),Promise.resolve().then((function(){dp(n,r,!0)}))),r.selection){var i=xf.toDOMRange(r,r.selection).startContainer,a=i.textContent||"";hp.set(r,a),pp.set(r,i)}n.isComposing=!0,function(t,e){var n;e.getConfig().placeholder&&e.isEmpty()&&t.showPlaceholder&&(null===(n=t.$placeholder)||void 0===n||n.hide(),t.showPlaceholder=!1)}(n,r)}},compositionend:function(t,n,r){var o=t;if(np(r,o.target)){n.isComposing=!1;var i=r.selection;if(null!=i){(bf||gf)&&xf.cleanExposedTexNodeInSelectionBlock(r);for(var a=e.Range.isBackward(i)?i.focus:i.anchor,s=ho(e.Editor.node(r,[a.path[0]]),1)[0],u=0;u<a.path.length;u+=1){var l=ho(e.Editor.node(r,a.path.slice(0,u+1)),1)[0];if(e.Element.isElement(l)&&((vf||gf)&&"link"===l.type||"code"===l.type)){xf.setNewKey(s);break}}var c=o.data;if(c){if(r.getConfig().maxLength){var f=xf.getLeftLengthOfMaxLength(r);if(f<c.length){var d=xf.toDOMRange(r,i);d.startContainer.nodeType===Node.TEXT_NODE&&(d.startContainer.textContent=hp.get(r)||""),f>0&&e.Editor.insertText(r,c.slice(0,f)),n.changeViewState()}else e.Editor.insertText(r,c)}else{var h=xf.findDocumentOrShadowRoot(r).getSelection();h&&function(t,n){if(e.Range.isCollapsed(n)){var r=n.anchor,o=n.focus;if([2,3].includes(r.path.length)&&[2,3].includes(o.path.length)&&(0===r.offset||0===o.offset)){var i=e.Editor.node(t,r.path),a=0===r.offset?r.path:o.path,s=[a[0],a[1]-1];if(0===a[1])return!1;var u=e.Editor.node(t,s);if(e.Text.isText(u[0])&&e.Text.isText(i[0]))return!0}}}(r,i)&&(r.selection=xf.toSlateRange(r,h,{exactMatch:!1,suppressThrow:!1})),e.Editor.insertText(r,c)}vf||setTimeout((function(){var t=r.selection;if(null!=t){var e=pp.get(r);if(null!=e)xf.toDOMRange(r,t).startContainer!==e&&(e.textContent=hp.get(r)||"")}}))}}}},compositionupdate:function(t,e,n){np(n,t.target)&&(e.isComposing=!0)},keydown:function(t,n,r){var o=t,i=r.selection;if(!r.getConfig().readOnly&&!n.isComposing&&np(r,o.target)){if(function(t,e){var n=Oa.get(t),r=n&&n.getMenus(),o=ka.get(t),i=o&&o.getMenus(),a=co(co({},r),i);for(var s in a){var u=a[s],c=u.hotkey;if(c&&l.isHotkey(c,e)&&!u.isDisabled(t)){var f=u.getValue(t);u.exec(t,f)}}}(r,o),bp.isTab(o))return wp(o),void r.handleTab();if(bp.isRedo(o))return wp(o),void("function"==typeof r.redo&&r.redo());if(bp.isUndo(o))return wp(o),void("function"==typeof r.undo&&r.undo());if(bp.isMoveLineBackward(o))return wp(o),void e.Transforms.move(r,{unit:"line",reverse:!0});if(bp.isMoveLineForward(o))return wp(o),void e.Transforms.move(r,{unit:"line"});if(bp.isExtendLineBackward(o))return wp(o),void e.Transforms.move(r,{unit:"line",edge:"focus",reverse:!0});if(bp.isExtendLineForward(o))return wp(o),void e.Transforms.move(r,{unit:"line",edge:"focus"});if(bp.isMoveBackward(o))return wp(o),void(i&&e.Range.isCollapsed(i)?e.Transforms.move(r,{reverse:!0}):e.Transforms.collapse(r,{edge:"start"}));if(bp.isMoveForward(o))return wp(o),void(i&&e.Range.isCollapsed(i)?e.Transforms.move(r):e.Transforms.collapse(r,{edge:"end"}));if(bp.isMoveWordBackward(o))return wp(o),i&&e.Range.isExpanded(i)&&e.Transforms.collapse(r,{edge:"focus"}),void e.Transforms.move(r,{unit:"word",reverse:!0});if(bp.isMoveWordForward(o))return wp(o),i&&e.Range.isExpanded(i)&&e.Transforms.collapse(r,{edge:"focus"}),void e.Transforms.move(r,{unit:"word"});if(bp.isSelectAll(o))return wp(o),void r.selectAll();if(wf){if((bf||vf)&&i&&(bp.isDeleteBackward(o)||bp.isDeleteForward(o))&&e.Range.isCollapsed(i)){var a=e.Node.parent(r,i.anchor.path);if(e.Element.isElement(a)&&e.Editor.isVoid(r,a)&&e.Editor.isInline(r,a))return o.preventDefault(),void e.Transforms.delete(r,{unit:"block"})}}else{if(bp.isBold(o)||bp.isItalic(o)||bp.isTransposeCharacter(o))return void wp(o);if(bp.isSplitBlock(o))return wp(o),void e.Editor.insertBreak(r);if(bp.isDeleteBackward(o))return wp(o),void(i&&e.Range.isExpanded(i)?e.Editor.deleteFragment(r,{direction:"backward"}):e.Editor.deleteBackward(r));if(bp.isDeleteForward(o))return wp(o),void(i&&e.Range.isExpanded(i)?e.Editor.deleteFragment(r,{direction:"forward"}):e.Editor.deleteForward(r));if(bp.isDeleteLineBackward(o))return wp(o),void(i&&e.Range.isExpanded(i)?e.Editor.deleteFragment(r,{direction:"backward"}):e.Editor.deleteBackward(r,{unit:"line"}));if(bp.isDeleteLineForward(o))return wp(o),void(i&&e.Range.isExpanded(i)?e.Editor.deleteFragment(r,{direction:"forward"}):e.Editor.deleteForward(r,{unit:"line"}));if(bp.isDeleteWordBackward(o))return wp(o),void(i&&e.Range.isExpanded(i)?e.Editor.deleteFragment(r,{direction:"backward"}):e.Editor.deleteBackward(r,{unit:"word"}));if(bp.isDeleteWordForward(o))return wp(o),void(i&&e.Range.isExpanded(i)?e.Editor.deleteFragment(r,{direction:"forward"}):e.Editor.deleteForward(r,{unit:"word"}))}}},keypress:function(t,n,r){if(!wf&&!r.getConfig().readOnly&&np(r,t.target)){t.preventDefault();var o=t.key;e.Editor.insertText(r,o)}},copy:function(t,e,n){var r=t;if(np(n,r.target)){n.getConfig().readOnly||r.preventDefault();var o=r.clipboardData;if(null!=o){n.setFragmentData(o);var i=n.getConfig().customCopy;i&&i(n,r)}}},cut:function(t,n,r){var o=t,i=r.selection;if(!r.getConfig().readOnly&&(o.preventDefault(),np(r,o.target))){var a=o.clipboardData;if(null!=a&&(r.setFragmentData(a),i))if(e.Range.isExpanded(i))e.Editor.deleteFragment(r);else{var s=e.Node.parent(r,i.anchor.path);e.Editor.isVoid(r,s)&&e.Transforms.delete(r)}}},paste:function(t,e,n){za.set(n,!0);var r=t;if(!n.getConfig().readOnly&&np(n,r.target)){var o=n.getConfig().customPaste;if(o)if(!1===o(n,r))return void za.set(n,!1);if(vf||!wf||Cc(r)){r.preventDefault();var i=r.clipboardData;null!=i&&n.insertData(i)}}},dragover:function(t,n,r){if(op(r,t.target)){var o=xf.toSlateNode(r,t.target);e.Editor.isVoid(r,o)&&t.preventDefault()}},dragstart:function(t,n,r){var o=t;if(op(r,o.target)&&!r.getConfig().readOnly){var i=xf.toSlateNode(r,o.target),a=xf.findPath(r,i);if(e.Editor.isVoid(r,i)||e.Editor.void(r,{at:a,voids:!0})){var s=e.Editor.range(r,a);e.Transforms.select(r,s)}var u=o.dataTransfer;if(null!=u)xf.getSelectedNodeByType(r,"table")||(n.isDraggingInternally=!0,r.setFragmentData(u))}},dragend:function(t,e,n){var r=t;n.getConfig().readOnly||e.isDraggingInternally&&op(n,r.target)&&(e.isDraggingInternally=!1)},drop:function(t,n,r){var o=t,i=o.dataTransfer;if(!r.getConfig().readOnly&&op(r,o.target)&&null!=i&&!(wf&&vf&&i.files.length>0)){o.preventDefault();var a=r.selection,s=xf.findEventRange(r,o);e.Transforms.select(r,s),n.isDraggingInternally&&(a&&e.Transforms.delete(r,{at:a}),n.isDraggingInternally=!1),r.insertData(i),r.isFocused()||r.focus()}}},Cp={};!function(){if(Sp)return Cp;Sp=1;var t=pr(),e=function(){if(Ep)return xp;Ep=1;var t=L(),e=St(),n=P(),r=R(),o=Nr(),i=cr(),a=xt(),s=me(),u=Ct(),l=Object.assign,c=Object.defineProperty,f=e([].concat);return xp=!l||r((function(){if(t&&1!==l({b:1},l(c({},"a",{enumerable:!0,get:function(){c(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},n={},r=Symbol("assign detection"),i="abcdefghijklmnopqrst";return e[r]=7,i.split("").forEach((function(t){n[t]=t})),7!==l({},e)[r]||o(l({},n)).join("")!==i}))?function(e,r){for(var l=s(e),c=arguments.length,d=1,h=i.f,p=a.f;c>d;)for(var g,v=u(arguments[d++]),m=h?f(o(v),h(v)):o(v),y=m.length,b=0;y>b;)g=m[b++],t&&!n(p,v,g)||(l[g]=v[g]);return l}:l,xp}();t({target:"Object",stat:!0,arity:2,forced:Object.assign!==e},{assign:e})}();var kp=["props","attrs","style","dataset","on","hook"];function Tp(t){var e=t.data,n=void 0===e?{}:e,r=t.children,o=void 0===r?[]:r;Object.keys(n).forEach((function(e){var r,o,i=n[e];if("key"!==e){if(!kp.includes(e)){if(e.startsWith("data-")){var a=e.slice(5);return a=f(a),function(t,e){null==t.data&&(t.data={});var n=t.data;null==n.dataset&&(n.dataset={});Object.assign(n.dataset,e)}(t,((r={})[a]=i,r)),void delete n[e]}!function(t,e){null==t.data&&(t.data={});var n=t.data;null==n.props&&(n.props={});Object.assign(n.props,e)}(t,(o={},o[e]=i,o)),delete n[e]}}else t.key=i})),o.length>0&&o.forEach((function(t){"string"!=typeof t&&Tp(t)}))}var Np=[];var Rp={};function Lp(t,e,n){var r=n.isInline(t)?"span":"div";return c.jsx(r,null,e)}function Mp(t,n){var r,o=xf.findKey(n,t),i=n.isInline(t),a=e.Editor.isVoid(n,t),s=Zc(t.type,o.id),u={id:s,key:o.id,"data-slate-node":"element","data-slate-inline":i},l=t.type,f=t.children,d=void 0===f?[]:f,h=function(t){return Rp[t]||Lp}(l);r=a?null:d.map((function(e,r){return jp(e,r,t,n)}));var p=h(t,r,n);if(a){u["data-slate-void"]=!0;var g=i?"span":"div",v=ho(e.Node.texts(t),1),m=ho(v[0],1)[0],y=jp(m,0,t,n),b=c.jsx(g,{"data-slate-spacer":!0,style:{height:"0",color:"transparent",outline:"none",position:"absolute"}},y);p=c.jsx(g,{style:{position:"relative"}},p,b),Aa.set(m,0),ja.set(m,t)}return null==p.data&&(p.data={}),Object.assign(p.data,u),a||i||(p=function(t,e){var n=e;return Np.forEach((function(r){n=r(t,e)})),n}(t,p)),rc((function(){var e=Nc(s);null!=e&&(Fa.set(o,e),_a.set(t,e),$a.set(e,t))})),p}function Pp(t,e){return void 0===e&&(e=!1),c.jsx("span",{"data-slate-string":!0},e?t+"\n":t)}function Dp(t,e){return void 0===t&&(t=0),void 0===e&&(e=!1),c.jsx("span",{"data-slate-zero-width":e?"n":"z","data-slate-length":t},"\ufeff",e?c.jsx("br",null):null)}function Ap(t,n,r){if(null==t.text)throw new Error("Current node is not slate Text ".concat(JSON.stringify(t)));var o=xf.findKey(r,t),i=r.getConfig().decorate;if(null==i)throw new Error("Can not get config.decorate");var a,s=xf.findPath(r,t),u=i([t,s]),l=e.Text.decorations(t,u),f=l.map((function(o,i){var a=function(t,n,r,o,i){void 0===n&&(n=!1);var a=t.text,s=xf.findPath(i,r),u=e.Path.parent(s);if(e.Editor.isEditor(o))throw new Error("Text node ".concat(JSON.stringify(r)," parent is Editor"));return i.isVoid(o)?Dp(e.Node.string(o).length):""!==a||o.children[o.children.length-1]!==r||i.isInline(o)||""!==e.Editor.string(i,u)?""===a?Dp():n&&"\n"===a.slice(-1)?Pp(a,!0):Pp(a):Dp(0,!0)}(o,i===l.length-1,t,n,r);return a=function(t,e){var n=e;return Np.forEach((function(e){n=e(t,n)})),n}(o,a),c.jsx("span",{"data-slate-leaf":!0},a)})),d=(a=o.id,"w-e-text-".concat(a)),h=c.jsx("span",{"data-slate-node":"text",id:d,key:o.id},f);return rc((function(){var e=Nc(d);null!=e&&(Fa.set(o,e),_a.set(t,e),$a.set(e,t))})),h}function jp(t,n,r,o){return Aa.set(t,n),ja.set(t,r),e.Element.isElement(t)?Mp(t,o):Ap(t,r,o)}function Ip(t,e){var n,r,i=t.$scroll,a=(n=t.id,"w-e-textarea-".concat(n)),s=e.getConfig(),u=s.readOnly,l=s.autoFocus,f=function(t,e){return void 0===e&&(e=!1),c.h("div#".concat(t),{props:{contentEditable:!e}})}(a,u),d=e.children||[];f.children=d.map((function(t,n){var r=jp(t,n,e,e);return Tp(r),r}));var h=Ma.get(t);if(null==h&&(h=!0),h){var p=function(t){return o('<div\n id="'.concat(t,'"\n data-slate-editor\n data-slate-node="value"\n suppressContentEditableWarning\n role="textarea"\n spellCheck="true"\n autoCorrect="true"\n autoCapitalize="true"\n ></div>'))}(a);i.append(p),t.$textArea=p,r=p[0],(v=c.init([c.classModule,c.propsModule,c.styleModule,c.datasetModule,c.eventListenersModule,c.attributesModule]))(r,f),Ma.set(t,!1),Pa.set(t,v)}else{var g=Da.get(t),v=Pa.get(t);if(null==g||null==v)return;r=g.elm,v(g,f)}if(null!=r||null!=(r=Nc(a))){if((h?l:e.isFocused())&&r.focus({preventScroll:!0}),h){var m=bc(r);m&&Ha.set(e,m)}Ia.set(e,r),_a.set(e,r),$a.set(r,e),Da.set(t,f)}}var $p=1,Fp=function(){function t(t){var n=this;this.id=$p++,this.$textArea=null,this.$progressBar=o('<div class="w-e-progress-bar"></div>'),this.$maxLengthInfo=o('<div class="w-e-max-length-info"></div>'),this.isComposing=!1,this.isUpdatingSelection=!1,this.isDraggingInternally=!1,this.latestElement=null,this.showPlaceholder=!1,this.$placeholder=null,this.latestEditorSelection=null,this.onDOMSelectionChange=u((function(){var t=n.editorInstance;!function(t,n){var r=t.isComposing,o=t.isUpdatingSelection,i=t.isDraggingInternally;if(!(n.getConfig().readOnly||r||o||i)){var a=xf.findDocumentOrShadowRoot(n),s=a.activeElement,u=xf.toDOMNode(n,n),l=a.getSelection();if(s!==u)return Wa.delete(n),void e.Transforms.deselect(n);if(t.latestElement=s,Wa.set(n,!0),!l)return e.Transforms.deselect(n);var c=l.anchorNode,f=l.focusNode,d=np(n,c)||rp(n,c),h=np(n,f)||rp(n,f);if(d&&h){var p=xf.toSlateRange(n,l,{exactMatch:!1,suppressThrow:!1});e.Transforms.select(n,p)}}}(n,t)}),100);var r=o(t);if(0===r.length)throw new Error("Cannot find textarea DOM by selector '".concat(t,"'"));this.$box=r;var i=o('<div class="w-e-text-container"></div>');i.append(this.$progressBar),i.append(this.$maxLengthInfo),r.append(i);var a=o('<div class="w-e-scroll"></div>');i.append(a),this.$scroll=a,this.$textAreaContainer=i,rc((function(){var t=n.editorInstance,e=xf.getWindow(t);e.document.addEventListener("selectionchange",n.onDOMSelectionChange),t.on(vo.DESTROYED,(function(){e.document.removeEventListener("selectionchange",n.onDOMSelectionChange)})),i.on("click",(function(){return t.hidePanelOrModal()})),t.on(vo.CHANGE,n.changeViewState.bind(n));var o=t.getConfig(),a=o.onChange,s=o.scroll;a&&t.on(vo.CHANGE,(function(){return a(t)})),s||(r.css("position","relative"),i.addClass("no-scroll")),n.onFocusAndOnBlur(),t.on(vo.CHANGE,n.changeMaxLengthInfo.bind(n)),n.bindEvent()}))}return Object.defineProperty(t.prototype,"editorInstance",{get:function(){var t=Ea.get(this);if(null==t)throw new Error("Can not get editor instance");return t},enumerable:!1,configurable:!0}),t.prototype.bindEvent=function(){var t=this,e=this.$textArea,n=this.$scroll,o=this.editorInstance;null!=e&&(r(Op,(function(n,r){e.on(r,(function(e){n(e,t,o)}))})),o.getConfig().scroll&&(n.css("overflow-y","auto"),n.on("scroll",u((function(){o.emit("scroll")}),100))))},t.prototype.onFocusAndOnBlur=function(){var t=this,e=this.editorInstance,n=e.getConfig(),r=n.onBlur,o=n.onFocus;this.latestEditorSelection=e.selection,e.on(vo.CHANGE,(function(){null==t.latestEditorSelection&&null!=e.selection?setTimeout((function(){return o&&o(e)})):null!=t.latestEditorSelection&&null==e.selection&&setTimeout((function(){return r&&r(e)})),t.latestEditorSelection=e.selection}))},t.prototype.changeMaxLengthInfo=function(){var t=this.editorInstance,e=t.getConfig().maxLength;if(e){var n=e-xf.getLeftLengthOfMaxLength(t);this.$maxLengthInfo[0].innerHTML="".concat(n,"/").concat(e)}},t.prototype.changeProgress=function(t){var e=this.$progressBar;e.css("width","".concat(t,"%")),t>=100&&setTimeout((function(){e.hide(),e.css("width","0"),e.show()}),1e3)},t.prototype.changeViewState=function(){var t=this,e=this.editorInstance;Ip(this,e),function(t,e){var n,r=e.getConfig().placeholder;if(r){var i=e.isEmpty();if(i&&!t.showPlaceholder&&!t.isComposing){if(null==t.$placeholder){var a=o('<div class="w-e-text-placeholder">'.concat(r,"</div>"));t.$textAreaContainer.append(a),t.$placeholder=a}return t.$placeholder.show(),void(t.showPlaceholder=!0)}!i&&t.showPlaceholder&&(null===(n=t.$placeholder)||void 0===n||n.hide(),t.showPlaceholder=!1)}}(this,e),rc((function(){dp(t,e)}))},t.prototype.destroy=function(){this.$textAreaContainer.remove()},t}();function _p(t,n,r,o){if(Aa.set(t,n),ja.set(t,r),e.Element.isElement(t)){var i=t.children;if((void 0===i?[]:i).forEach((function(e,n){return _p(e,n,t,o)})),e.Editor.isVoid(o,t)){var a=ho(e.Node.texts(t),1),s=ho(a[0],1)[0];Aa.set(s,0),ja.set(s,t)}}}var Bp={en:"Textarea height < 300px. This may cause modal and hoverbar position error",zh:"编辑区域高度 < 300px 这可能会导致 modal hoverbar 定位异常"};var Hp,Wp,Up,Vp,zp,Kp={};function qp(){if(Vp)return Up;Vp=1;var t=Ft(),e=TypeError;return Up=function(n,r){if(!delete n[r])throw new e("Cannot delete property "+t(r)+" of "+t(n))}}!function(){if(zp)return Kp;zp=1;var t=pr(),e=me(),n=Nn(),r=Tn(),o=Ln(),i=function(){if(Wp)return Hp;Wp=1;var t=L(),e=gr(),n=TypeError,r=Object.getOwnPropertyDescriptor,o=t&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}();return Hp=o?function(t,o){if(e(t)&&!r(t,"length").writable)throw new n("Cannot set read only .length");return t.length=o}:function(t,e){return t.length=e}}(),a=vr(),s=Er(),u=mr(),l=qp(),c=Sr()("splice"),f=Math.max,d=Math.min;t({target:"Array",proto:!0,forced:!c},{splice:function(t,c){var h,p,g,v,m,y,b=e(this),w=o(b),x=n(t,w),E=arguments.length;for(0===E?h=p=0:1===E?(h=0,p=w-x):(h=E-2,p=d(f(r(c),0),w-x)),a(w+h-p),g=s(b,p),v=0;v<p;v++)(m=x+v)in b&&u(g,v,b[m]);if(g.length=p,h<p){for(v=x;v<w-p;v++)y=v+h,(m=v+p)in b?b[y]=b[m]:l(b,y);for(v=w;v>w-p+h;v--)l(b,v-1)}else if(h>p)for(v=w-p;v>x;v--)y=v+h-1,(m=v+p-1)in b?b[y]=b[m]:l(b,y);for(v=0;v<h;v++)b[v+x]=arguments[v+2];return i(b,w-p+h),g}})}();var Gp=function(){function t(t,e){var n=this;this.$toolbar=o('<div class="w-e-bar w-e-bar-show w-e-toolbar"></div>'),this.menus={},this.toolbarItems=[],this.config={},this.lngListen=function(){},this.changeToolbarState=s((function(){n.toolbarItems.forEach((function(t){t.changeMenuState()}))}),200),this.config=e;var r=o(t);if(0===r.length)throw new Error("Cannot find toolbar DOM by selector '".concat(t,"'"));this.$box=r;var i=this.$toolbar;i.on("mousedown",(function(t){return t.preventDefault()}),{passive:!1}),r.append(i),rc((function(){n.initToolbar(),n.lngListen=Dh((function(){return n.initToolbar()})),n.getEditorInstance().on(vo.CHANGE,n.changeToolbarState)}))}return t.prototype.getMenus=function(){return this.menus},t.prototype.getConfig=function(){return this.config},t.prototype.initToolbar=function(){this.menus={};var t=this.$toolbar;null==t||t.empty(),this.registerItems(),this.changeToolbarState()},t.prototype.registerItems=function(){var t=this,e="",r=this.$toolbar,o=this.config,i=o.toolbarKeys,a=void 0===i?[]:i,s=o.insertKeys,u=void 0===s?{index:0,keys:[]}:s,l=o.excludeKeys,c=void 0===l?[]:l,f=n(a);u.keys.length>0&&("string"==typeof u.keys&&(u.keys=[u.keys]),u.keys.forEach((function(t,e){f.splice(u.index+e,0,t)})));var d=f.filter((function(t){var e="string"==typeof t?t:t.key;return!c.includes(e)})),h=d.length;d.forEach((function(n,o){if("|"===n){if(0===o)return;if(o+1===h)return;if("|"===e)return;var i=$h();return r.append(i),void(e=n)}if("string"==typeof n)return t.registerSingleItem(n,t),void(e=n);t.registerGroup(n),e="group"}))},t.prototype.registerGroup=function(t){var e=this,n=this.$toolbar,r=function(t){return new Gh(t)}(t),o=t.menuKeys,i=void 0===o?[]:o,a=this.config.excludeKeys,s=void 0===a?[]:a;i.forEach((function(t){s.includes(t)||e.registerSingleItem(t,r)})),n.append(r.$elem)},t.prototype.registerSingleItem=function(t,e){var n=this.getEditorInstance(),r=e instanceof Gh,o=this.menus,i=o[t];if(null==i){var a=mo[t];if(null==a)throw new Error("Not found menu item factory by key '".concat(t,"'"));if("function"!=typeof a)throw new Error("Menu item factory (key='".concat(t,"') is not a function"));i=a(),o[t]=i}else console.warn("Duplicated toolbar menu key '".concat(t,"'\n重复注册了菜单栏 menu '").concat(t,"'"));var s=n.getMenuConfig(t);s&&void 0!==s.iconSvg&&(i.iconSvg=s.iconSvg);var u=Xh(t,i,r);(this.toolbarItems.push(u),Ta.set(u,n),r)?e.appendBarItem(u):e.$toolbar.append(u.$elem)},t.prototype.getEditorInstance=function(){var t=Sa.get(this);if(null==t)throw new Error("Can not get editor instance");return t},t.prototype.destroy=function(){var t;this.$toolbar.remove(),null===(t=this.lngListen)||void 0===t||t.call(this),this.menus={},this.toolbarItems=[]},t}();var Jp,Yp={};!function(){if(Jp)return Yp;Jp=1;var t=L(),e=tn().EXISTS,n=St(),r=Hs(),o=Function.prototype,i=n(o.toString),a=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,s=n(a.exec);t&&!e&&r(o,"name",{configurable:!0,get:function(){try{return s(a,i(this))[1]}catch(t){return""}}})}(),t.DOMComment=sc,t.DOMElement=uc,t.DOMNode=ac,t.DOMRange=cc,t.DOMSelection=fc,t.DOMStaticRange=dc,t.DOMText=lc,t.DomEditor=xf,t.ELEM_TO_HTML_CONF=ef,t.PARSE_ELEM_HTML_CONF=zc,t.PARSE_STYLE_HTML_FN_LIST=Vc,t.PRE_PARSE_HTML_CONF_LIST=Uc,t.RENDER_ELEM_CONF=Rp,t.RENDER_STYLE_HANDLER_LIST=Np,t.STYLE_TO_HTML_FN_LIST=tf,t.TEXT_TAGS=Wc,t.Toolbar=Gp,t.coreCreateEditor=function(t){var o=t.selector,i=void 0===o?"":o,a=t.config,s=void 0===a?{}:a,u=t.content,l=t.html,c=t.plugins,f=void 0===c?[]:c,d=function(t){return[Dd,pd,Ka,dd,Hd,Pd,jd,so.withHistory].reduce((function(t,e){return e(t)}),t)}(e.createEditor());if(i&&function(t,e){return Xc(t,"data-w-e-textarea",e)}(d,i))throw new Error("Repeated create editor by selector '".concat(i,"'"));var h=function(t){void 0===t&&(t={});var e=n(go),o={},i=t.MENU_CONF,a=void 0===i?{}:i;return r(e,(function(t,e){o[e]=co(co({},t),a[e]||{})})),delete t.MENU_CONF,co({scroll:!0,readOnly:!1,autoFocus:!0,decorate:function(){return[]},maxLength:0,MENU_CONF:o,hoverbarKeys:{},customAlert:function(t,e){window.alert("".concat(e,":\n").concat(t))}},t)}(s);La.set(d,h);var p=h.hoverbarKeys,g=void 0===p?{}:p;if(f.forEach((function(t){d=t(d)})),function(t,e){var n=e.html,r=e.content;null!=n&&(t.children=Qc(t,n)),r&&r.length&&(t.children=r),0===t.children.length&&(t.children=[{type:"paragraph",children:[{text:""}]}])}(d,{html:l,content:u}),i){var v=new Fp(i);xa.set(d,v),Ea.set(v,d),v.changeViewState(),rc((function(){var t=v.$scroll;null!=t&&t.height()<300&&console.warn("".concat(Bp.zh,"\n").concat(Bp.en),{element:t,height:t.height()})}));var m=void 0;Object.keys(g).length>0&&(m=new tp,Ca.set(m,d),ka.set(d,m)),d.on(vo.CHANGE,(function(){d.hidePanelOrModal()})),d.on(vo.SCROLL,(function(){d.hidePanelOrModal()}))}else d.children.forEach((function(t,e){return _p(t,e,d,d)}));var y=h.onCreated,b=h.onDestroyed;return y&&d.on(vo.CREATED,(function(){return y(d)})),b&&d.on(vo.DESTROYED,(function(){return b(d)})),rc((function(){return d.emit("created")})),d},t.coreCreateToolbar=function(t,e){if(null==t)throw new Error("Cannot create toolbar, because editor is null");var n=e.selector,r=e.config,o=void 0===r?{}:r;if(function(t,e){return Xc(t,"data-w-e-toolbar",e)}(t,n))throw new Error("Repeated create toolbar by selector '".concat(n,"'"));var i=co({toolbarKeys:[],excludeKeys:[],insertKeys:{index:0,keys:[]},modalAppendToBody:!1},o||{}),a=new Gp(n,i);return Sa.set(a,t),Oa.set(t,a),a},t.createUploader=function(t){var e=t.server,n=void 0===e?"":e,o=t.fieldName,i=void 0===o?"":o,a=t.maxFileSize,s=void 0===a?10485760:a,u=t.maxNumberOfFiles,l=void 0===u?100:u,c=t.meta,f=void 0===c?{}:c,p=t.metaWithUrl,g=void 0!==p&&p,v=t.headers,m=void 0===v?{}:v,y=t.withCredentials,b=void 0!==y&&y,w=t.timeout,x=void 0===w?1e4:w,E=t.onBeforeUpload,S=void 0===E?function(t){return t}:E,O=t.onSuccess,C=void 0===O?function(t,e){}:O,k=t.onError,T=void 0===k?function(t,e,n){console.error("".concat(t.name," upload error"),e,n)}:k,N=t.onProgress,R=void 0===N?function(t){}:N;if(!n)throw new Error("Cannot get upload server address\n没有配置上传地址");if(!i)throw new Error("Cannot get fieldName\n没有配置 fieldName");var L=n;g&&(L=function(t,e){var n=ho(t.split("#"),2),o=n[0],i=n[1],a=[];r(e,(function(t,e){a.push("".concat(e,"=").concat(t))}));var s=a.join("&");return o=o.indexOf("?")>0?"".concat(o,"&").concat(s):"".concat(o,"?").concat(s),i?"".concat(o,"#").concat(i):o}(L,f));var M=new d(co({onBeforeUpload:S,restrictions:{maxFileSize:s,maxNumberOfFiles:l},meta:f},t.uppyConfig)).use(h,co({endpoint:L,headers:m,formData:!0,fieldName:i,bundle:!0,withCredentials:b,timeout:x},t.xhrConfig));return M.on("complete",(function(t){var e=t.successful[0],n=e.response,r=(null!=n?n:{}).body,o=void 0===r?{}:r;try{C(e,o)}catch(t){console.error("wangEditor upload file - onSuccess error",t)}})),M.on("progress",(function(t){t<1||R(t)})),M.on("upload-error",(function(t,e,n){try{T(t,e,n)}catch(t){console.error("wangEditor upload file - onError error",t)}})),M.on("restriction-failed",(function(t,e){try{T(t,e)}catch(t){console.error("wangEditor upload file - onError error",t)}})),M},t.genModalButtonElems=function(t,e){var n=o('<div class="button-container"></div>'),r=o('<button type="button" id="'.concat(t,'">').concat(e,"</button>"));return n.append(r),[n[0],r[0]]},t.genModalInputElems=function(t,e,n){var r=o('<label class="babel-container"></label>');r.append("<span>".concat(t,"</span>"));var i=o('<input type="text" id="'.concat(e,'" placeholder="').concat(n||"",'">'));return r.append(i),[r[0],i[0]]},t.genModalTextareaElems=function(t,e,n){var r=o('<label class="babel-container"></label>');r.append("<span>".concat(t,"</span>"));var i=o('<textarea type="text" id="'.concat(e,'" placeholder="').concat(n||"",'"></textarea>'));return r.append(i),[r[0],i[0]]},t.getDefaultView=bc,t.getEditableChild=Lc,t.getEditableChildAndIndex=Rc,t.getElementById=Nc,t.getFirstVoidChild=Pc,t.getPlainText=Mc,t.getTagName=Ac,t.hasShadowRoot=Tc,t.i18nAddResources=function(t,e){Mh.addResourceBundle(t,Ph,e,!0,!0)},t.i18nChangeLanguage=function(t){Mh.changeLanguage(t)},t.i18nGetResources=function(t){return Mh.getResourceBundle(t,Ph)},t.i18nListenLanguage=Dh,t.isDOMComment=xc,t.isDOMElement=Ec,t.isDOMNode=wc,t.isDOMSelection=Sc,t.isDOMText=Oc,t.isDataTransfer=gc,t.isDocument=hc,t.isHTMLElememt=yc,t.isPlainTextOnlyPaste=Cc,t.isShadowRoot=pc,t.isUnprocessedListElement=mc,t.normalizeDOMPoint=kc,t.registerElemToHtmlConf=function(t){var e=t.type,n=t.elemToHtml;ef[e||""]=n},t.registerMenu=function(t,e){var n=t.key,r=t.factory,o=t.config,i=co(co({},o),e||{});if(null!=mo[n])throw new Error("Duplicated key '".concat(n,"' in menu items"));mo[n]=r,function(t,e){null!=e&&(go[t]=e)}(n,i)},t.registerParseElemHtmlConf=function(t){var e=t.selector,n=t.parseElemHtml;zc[e]=n},t.registerParseStyleHtmlHandler=function(t){Vc.push(t)},t.registerPreParseHtmlConf=function(t){Uc.push(t)},t.registerRenderElemConf=function(t){var e=t.type,n=t.renderElem;Rp[e||""]=n},t.registerStyleHandler=function(t){Np.push(t)},t.registerStyleToHtmlHandler=function(t){tf.push(t)},t.t=Ah,t.walkTextNodes=Dc}));
|
|
9
9
|
//# sourceMappingURL=index.js.map
|