vue2-rich-editor
Version:
A rich text editor component for Vue 2
1 lines • 500 kB
JavaScript
(function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e():"function"===typeof define&&define.amd?define([],e):"object"===typeof exports?exports["vue2-rich-editor"]=e():t["vue2-rich-editor"]=e()})("undefined"!==typeof self?self:this,function(){return function(){var t={231:function(t,e,n){"use strict";var r=n(50181),i=n(56798),o=n(93056),a=n(58846).indexOf,s=n(38136),c=r([].push);t.exports=function(t,e){var n,r=o(t),u=0,l=[];for(n in r)!i(s,n)&&i(r,n)&&c(l,n);while(e.length>u)i(r,n=e[u++])&&(~a(l,n)||c(l,n));return l}},479:function(t,e,n){"use strict";var r=n(50716);t.exports=r},655:function(t,e,n){"use strict";var r=n(36955),i=String;t.exports=function(t){if("Symbol"===r(t))throw new TypeError("Cannot convert a Symbol value to a string");return i(t)}},1103:function(t){"use strict";t.exports=function(t){try{return{error:!1,value:t()}}catch(e){return{error:!0,value:e}}}},1469:function(t,e,n){"use strict";var r=n(87433);t.exports=function(t,e){return new(r(t))(0===e?0:e)}},1625:function(t,e,n){"use strict";var r=n(79504);t.exports=r({}.isPrototypeOf)},1669:function(t,e,n){"use strict";var r=n(15254);n(31070),t.exports=r},1693:function(t,e,n){"use strict";var r=n(27417),i=n(1860),o=n(48230),a=n(36026),s=n(63854),c=n(87481),u=n(61174),l=n(71786),d=n(48854),p=n(97360),f=TypeError,h=function(t,e){this.stopped=t,this.result=e},v=h.prototype;t.exports=function(t,e,n){var g,m,y,b,w,C,x,k=n&&n.that,E=!(!n||!n.AS_ENTRIES),A=!(!n||!n.IS_RECORD),S=!(!n||!n.IS_ITERATOR),T=!(!n||!n.INTERRUPTED),I=r(e,k),L=function(t){return g&&p(g,"normal"),new h(!0,t)},N=function(t){return E?(o(t),T?I(t[0],t[1],L):I(t[0],t[1])):T?I(t,L):I(t)};if(A)g=t.iterator;else if(S)g=t;else{if(m=d(t),!m)throw new f(a(t)+" is not iterable");if(s(m)){for(y=0,b=c(t);b>y;y++)if(w=N(t[y]),w&&u(v,w))return w;return new h(!1)}g=l(t,m)}C=A?t.next:g.next;while(!(x=i(C,g)).done){try{w=N(x.value)}catch(j){p(g,"throw",j)}if("object"==typeof w&&w&&u(v,w))return w}return new h(!1)}},1767:function(t){"use strict";t.exports=function(t){return{iterator:t,next:t.next,done:!1}}},1860:function(t,e,n){"use strict";var r=n(54651),i=Function.prototype.call;t.exports=r?i.bind(i):function(){return i.apply(i,arguments)}},1925:function(t,e,n){"use strict";var r=n(85366),i=n(67656),o=/#|\.prototype\./,a=function(t,e){var n=c[s(t)];return n===l||n!==u&&(i(e)?r(e):!!e)},s=a.normalize=function(t){return String(t).replace(o,".").toLowerCase()},c=a.data={},u=a.NATIVE="N",l=a.POLYFILL="P";t.exports=a},1930:function(t,e,n){"use strict";var r=n(86337),i=n(1860),o=n(27925),a=n(8256),s=n(74302),c=n(1693),u=n(68112);r({target:"Promise",stat:!0,forced:u},{race:function(t){var e=this,n=a.f(e),r=n.reject,u=s(function(){var a=o(e.resolve);c(t,function(t){i(a,e,t).then(n.resolve,r)})});return u.error&&r(u.value),n.promise}})},2008:function(t,e,n){"use strict";var r=n(46518),i=n(59213).filter,o=n(70597),a=o("filter");r({target:"Array",proto:!0,forced:!a},{filter:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}})},2264:function(t,e,n){"use strict";n(75772);var r=n(72020);t.exports=r.Object.setPrototypeOf},2273:function(t,e,n){"use strict";var r=n(86337),i=n(68591);r({target:"Function",proto:!0,forced:Function.bind!==i},{bind:i})},2293:function(t,e,n){"use strict";var r=n(28551),i=n(35548),o=n(64117),a=n(78227),s=a("species");t.exports=function(t,e){var n,a=r(t).constructor;return void 0===a||o(n=r(a)[s])?e:i(n)}},2349:function(t,e,n){"use strict";var r=n(67558),i=n(36026),o=TypeError;t.exports=function(t){if(r(t))return t;throw new o(i(t)+" is not a constructor")}},2360:function(t,e,n){"use strict";var r,i=n(28551),o=n(96801),a=n(88727),s=n(30421),c=n(20397),u=n(4055),l=n(66119),d=">",p="<",f="prototype",h="script",v=l("IE_PROTO"),g=function(){},m=function(t){return p+h+d+t+p+"/"+h+d},y=function(t){t.write(m("")),t.close();var e=t.parentWindow.Object;return t=null,e},b=function(){var t,e=u("iframe"),n="java"+h+":";return e.style.display="none",c.appendChild(e),e.src=String(n),t=e.contentWindow.document,t.open(),t.write(m("document.F=Object")),t.close(),t.F},w=function(){try{r=new ActiveXObject("htmlfile")}catch(e){}w="undefined"!=typeof document?document.domain&&r?y(r):b():y(r);var t=a.length;while(t--)delete w[f][a[t]];return w()};s[v]=!0,t.exports=Object.create||function(t,e){var n;return null!==t?(g[f]=i(t),n=new g,g[f]=null,n[v]=t):n=w(),void 0===e?n:o.f(n,e)}},2478:function(t,e,n){"use strict";var r=n(79504),i=n(48981),o=Math.floor,a=r("".charAt),s=r("".replace),c=r("".slice),u=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,l=/\$([$&'`]|\d{1,2})/g;t.exports=function(t,e,n,r,d,p){var f=n+t.length,h=r.length,v=l;return void 0!==d&&(d=i(d),v=u),s(p,v,function(i,s){var u;switch(a(s,0)){case"$":return"$";case"&":return t;case"`":return c(e,0,n);case"'":return c(e,f);case"<":u=d[c(s,1,-1)];break;default:var l=+s;if(0===l)return i;if(l>h){var p=o(l/10);return 0===p?i:p<=h?void 0===r[p-1]?a(s,1):r[p-1]+a(s,1):i}u=r[l-1]}return void 0===u?"":u})}},2892:function(t,e,n){"use strict";var r=n(46518),i=n(96395),o=n(43724),a=n(44576),s=n(19167),c=n(79504),u=n(92796),l=n(39297),d=n(23167),p=n(1625),f=n(10757),h=n(72777),v=n(79039),g=n(38480).f,m=n(77347).f,y=n(24913).f,b=n(31240),w=n(43802).trim,C="Number",x=a[C],k=s[C],E=x.prototype,A=a.TypeError,S=c("".slice),T=c("".charCodeAt),I=function(t){var e=h(t,"number");return"bigint"==typeof e?e:L(e)},L=function(t){var e,n,r,i,o,a,s,c,u=h(t,"number");if(f(u))throw new A("Cannot convert a Symbol value to a number");if("string"==typeof u&&u.length>2)if(u=w(u),e=T(u,0),43===e||45===e){if(n=T(u,2),88===n||120===n)return NaN}else if(48===e){switch(T(u,1)){case 66:case 98:r=2,i=49;break;case 79:case 111:r=8,i=55;break;default:return+u}for(o=S(u,2),a=o.length,s=0;s<a;s++)if(c=T(o,s),c<48||c>i)return NaN;return parseInt(o,r)}return+u},N=u(C,!x(" 0o1")||!x("0b1")||x("+0x1")),j=function(t){return p(E,t)&&v(function(){b(t)})},H=function(t){var e=arguments.length<1?0:x(I(t));return j(this)?d(Object(e),this,H):e};H.prototype=E,N&&!i&&(E.constructor=H),r({global:!0,constructor:!0,wrap:!0,forced:N},{Number:H});var O=function(t,e){for(var n,r=o?g(e):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),i=0;r.length>i;i++)l(e,n=r[i])&&!l(t,n)&&y(t,n,m(e,n))};i&&k&&O(s[C],k),(N||i)&&O(s[C],x)},3296:function(t,e,n){"use strict";n(45806)},3362:function(t,e,n){"use strict";n(10436),n(16499),n(82003),n(7743),n(51481),n(40280)},3451:function(t,e,n){"use strict";var r=n(46518),i=n(79504),o=n(30421),a=n(20034),s=n(39297),c=n(24913).f,u=n(38480),l=n(10298),d=n(34124),p=n(33392),f=n(92744),h=!1,v=p("meta"),g=0,m=function(t){c(t,v,{value:{objectID:"O"+g++,weakData:{}}})},y=function(t,e){if(!a(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!s(t,v)){if(!d(t))return"F";if(!e)return"E";m(t)}return t[v].objectID},b=function(t,e){if(!s(t,v)){if(!d(t))return!0;if(!e)return!1;m(t)}return t[v].weakData},w=function(t){return f&&h&&d(t)&&!s(t,v)&&m(t),t},C=function(){x.enable=function(){},h=!0;var t=u.f,e=i([].splice),n={};n[v]=1,t(n).length&&(u.f=function(n){for(var r=t(n),i=0,o=r.length;i<o;i++)if(r[i]===v){e(r,i,1);break}return r},r({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:l.f}))},x=t.exports={enable:C,fastKey:y,getWeakData:b,onFreeze:w};o[v]=!0},3487:function(t,e,n){"use strict";var r,i,o,a,s=n(86337),c=n(43826),u=n(87680),l=n(33329),d=n(72020),p=n(1860),f=n(18625),h=n(77754),v=n(48478),g=n(39976),m=n(27925),y=n(67656),b=n(40259),w=n(97890),C=n(12616),x=n(81542).set,k=n(62618),E=n(37278),A=n(74302),S=n(20748),T=n(88898),I=n(5081),L=n(17513),N=n(8256),j="Promise",H=L.CONSTRUCTOR,O=L.REJECTION_EVENT,P=L.SUBCLASSING,R=T.getterFor(j),B=T.set,z=I&&I.prototype,M=I,V=z,F=l.TypeError,D=l.document,_=l.process,U=N.f,W=U,q=!!(D&&D.createEvent&&l.dispatchEvent),Z="unhandledrejection",G="rejectionhandled",X=0,Y=1,K=2,$=1,Q=2,J=function(t){var e;return!(!b(t)||!y(e=t.then))&&e},tt=function(t,e){var n,r,i,o=e.value,a=e.state===Y,s=a?t.ok:t.fail,c=t.resolve,u=t.reject,l=t.domain;try{s?(a||(e.rejection===Q&&ot(e),e.rejection=$),!0===s?n=o:(l&&l.enter(),n=s(o),l&&(l.exit(),i=!0)),n===t.promise?u(new F("Promise-chain cycle")):(r=J(n))?p(r,n,c,u):c(n)):u(o)}catch(d){l&&!i&&l.exit(),u(d)}},et=function(t,e){t.notified||(t.notified=!0,k(function(){var n,r=t.reactions;while(n=r.get())tt(n,t);t.notified=!1,e&&!t.rejection&&rt(t)}))},nt=function(t,e,n){var r,i;q?(r=D.createEvent("Event"),r.promise=e,r.reason=n,r.initEvent(t,!1,!0),l.dispatchEvent(r)):r={promise:e,reason:n},!O&&(i=l["on"+t])?i(r):t===Z&&E("Unhandled promise rejection",n)},rt=function(t){p(x,l,function(){var e,n=t.facade,r=t.value,i=it(t);if(i&&(e=A(function(){u?_.emit("unhandledRejection",r,n):nt(Z,n,r)}),t.rejection=u||it(t)?Q:$,e.error))throw e.value})},it=function(t){return t.rejection!==$&&!t.parent},ot=function(t){p(x,l,function(){var e=t.facade;u?_.emit("rejectionHandled",e):nt(G,e,t.value)})},at=function(t,e,n){return function(r){t(e,r,n)}},st=function(t,e,n){t.done||(t.done=!0,n&&(t=n),t.value=e,t.state=K,et(t,!0))},ct=function(t,e,n){if(!t.done){t.done=!0,n&&(t=n);try{if(t.facade===e)throw new F("Promise can't be resolved itself");var r=J(e);r?k(function(){var n={done:!1};try{p(r,e,at(ct,n,t),at(st,n,t))}catch(i){st(n,i,t)}}):(t.value=e,t.state=Y,et(t,!1))}catch(i){st({done:!1},i,t)}}};if(H&&(M=function(t){w(this,V),m(t),p(r,this);var e=R(this);try{t(at(ct,e),at(st,e))}catch(n){st(e,n)}},V=M.prototype,r=function(t){B(this,{type:j,done:!1,notified:!1,parent:!1,reactions:new S,rejection:!1,state:X,value:null})},r.prototype=f(V,"then",function(t,e){var n=R(this),r=U(C(this,M));return n.parent=!0,r.ok=!y(t)||t,r.fail=y(e)&&e,r.domain=u?_.domain:void 0,n.state===X?n.reactions.add(r):k(function(){tt(r,n)}),r.promise}),i=function(){var t=new r,e=R(t);this.promise=t,this.resolve=at(ct,e),this.reject=at(st,e)},N.f=U=function(t){return t===M||t===o?new i(t):W(t)},!c&&y(I)&&z!==Object.prototype)){a=z.then,P||f(z,"then",function(t,e){var n=this;return new M(function(t,e){p(a,n,t,e)}).then(t,e)},{unsafe:!0});try{delete z.constructor}catch(ut){}h&&h(z,V)}s({global:!0,constructor:!0,wrap:!0,forced:H},{Promise:M}),o=d.Promise,v(M,j,!1,!0),g(j)},3596:function(t,e,n){"use strict";var r=n(34320);t.exports=/ipad|iphone|ipod/i.test(r)&&"undefined"!=typeof Pebble},3717:function(t,e,n){"use strict";var r=n(79504),i=2147483647,o=36,a=1,s=26,c=38,u=700,l=72,d=128,p="-",f=/[^\0-\u007E]/,h=/[.\u3002\uFF0E\uFF61]/g,v="Overflow: input needs wider integers to process",g=o-a,m=RangeError,y=r(h.exec),b=Math.floor,w=String.fromCharCode,C=r("".charCodeAt),x=r([].join),k=r([].push),E=r("".replace),A=r("".split),S=r("".toLowerCase),T=function(t){var e=[],n=0,r=t.length;while(n<r){var i=C(t,n++);if(i>=55296&&i<=56319&&n<r){var o=C(t,n++);56320===(64512&o)?k(e,((1023&i)<<10)+(1023&o)+65536):(k(e,i),n--)}else k(e,i)}return e},I=function(t){return t+22+75*(t<26)},L=function(t,e,n){var r=0;t=n?b(t/u):t>>1,t+=b(t/e);while(t>g*s>>1)t=b(t/g),r+=o;return b(r+(g+1)*t/(t+c))},N=function(t){var e=[];t=T(t);var n,r,c=t.length,u=d,f=0,h=l;for(n=0;n<t.length;n++)r=t[n],r<128&&k(e,w(r));var g=e.length,y=g;g&&k(e,p);while(y<c){var C=i;for(n=0;n<t.length;n++)r=t[n],r>=u&&r<C&&(C=r);var E=y+1;if(C-u>b((i-f)/E))throw new m(v);for(f+=(C-u)*E,u=C,n=0;n<t.length;n++){if(r=t[n],r<u&&++f>i)throw new m(v);if(r===u){var A=f,S=o;while(1){var N=S<=h?a:S>=h+s?s:S-h;if(A<N)break;var j=A-N,H=o-N;k(e,w(I(N+j%H))),A=b(j/H),S+=o}k(e,w(I(A))),h=L(f,E,y===g),f=0,y++}}f++,u++}return x(e,"")};t.exports=function(t){var e,n,r=[],i=A(E(S(t),h,"."),".");for(e=0;e<i.length;e++)n=i[e],k(r,y(f,n)?"xn--"+N(n):n);return x(r,".")}},3844:function(t,e,n){"use strict";var r=n(44815);t.exports=r},3910:function(t,e,n){"use strict";var r=n(16879);t.exports=r},3926:function(t,e,n){"use strict";var r=n(65557);t.exports=r},4055:function(t,e,n){"use strict";var r=n(44576),i=n(20034),o=r.document,a=i(o)&&i(o.createElement);t.exports=function(t){return a?o.createElement(t):{}}},4160:function(t,e,n){"use strict";var r=n(55651),i=n(67558),o=n(40259),a=n(42230),s=a("species"),c=Array;t.exports=function(t){var e;return r(t)&&(e=t.constructor,i(e)&&(e===c||r(e.prototype))?e=void 0:o(e)&&(e=e[s],null===e&&(e=void 0))),void 0===e?c:e}},4350:function(t,e,n){"use strict";n.d(e,{A:function(){return o}});var r=n(57332);function i(t,e,n,i,o,a,s){try{var c=t[a](s),u=c.value}catch(t){return void n(t)}c.done?e(u):r.resolve(u).then(i,o)}function o(t){return function(){var e=this,n=arguments;return new r(function(r,o){var a=t.apply(e,n);function s(t){i(a,r,o,s,c,"next",t)}function c(t){i(a,r,o,s,c,"throw",t)}s(void 0)})}}},4353:function(t,e,n){"use strict";var r=n(85366);t.exports=!r(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})},4417:function(t){"use strict";t.exports=function(t,e){return e||(e={}),t?(t=String(t.__esModule?t.default:t),/^['"].*['"]$/.test(t)&&(t=t.slice(1,-1)),e.hash&&(t+=e.hash),/["'() \t\n]|(%20)/.test(t)||e.needQuotes?'"'.concat(t.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):t):t}},4495:function(t,e,n){"use strict";var r=n(39519),i=n(79039),o=n(44576),a=o.String;t.exports=!!Object.getOwnPropertySymbols&&!i(function(){var t=Symbol("symbol detection");return!a(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&r&&r<41})},4873:function(t,e,n){"use strict";n.d(e,{A:function(){return o}});var r=n(73243),i=n(67117);function o(t,e,n){return(e=(0,i.A)(e))in t?r(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},5081:function(t,e,n){"use strict";var r=n(33329);t.exports=r.Promise},5108:function(t,e,n){"use strict";var r=n(4353),i=n(55651),o=TypeError,a=Object.getOwnPropertyDescriptor,s=r&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}();t.exports=s?function(t,e){if(i(t)&&!a(t,"length").writable)throw new o("Cannot set read only .length");return t.length=e}:function(t,e){return t.length=e}},5314:function(t,e,n){"use strict";var r=n(50181),i=n(55651),o=n(67656),a=n(65213),s=n(89742),c=r([].push);t.exports=function(t){if(o(t))return t;if(i(t)){for(var e=t.length,n=[],r=0;r<e;r++){var u=t[r];"string"==typeof u?c(n,u):"number"!=typeof u&&"Number"!==a(u)&&"String"!==a(u)||c(n,s(u))}var l=n.length,d=!0;return function(t,e){if(d)return d=!1,e;if(i(this))return e;for(var r=0;r<l;r++)if(n[r]===t)return e}}}},5383:function(t,e,n){"use strict";var r=n(65213),i=n(50181);t.exports=function(t){if("Function"===r(t))return i(t)}},5506:function(t,e,n){"use strict";var r=n(46518),i=n(32357).entries;r({target:"Object",stat:!0},{entries:function(t){return i(t)}})},6232:function(t,e,n){"use strict";var r=n(50181),i=Error,o=r("".replace),a=function(t){return String(new i(t).stack)}("zxcasd"),s=/\n\s*at [^:]*:[^\n]*/,c=s.test(a);t.exports=function(t,e){if(c&&"string"==typeof t&&!i.prepareStackTrace)while(e--)t=o(t,s,"");return t}},6469:function(t,e,n){"use strict";var r=n(78227),i=n(2360),o=n(24913).f,a=r("unscopables"),s=Array.prototype;void 0===s[a]&&o(s,a,{configurable:!0,value:i(null)}),t.exports=function(t){s[a][t]=!0}},6495:function(t,e,n){"use strict";var r=n(86337),i=n(73544),o=n(56798),a=n(89742),s=n(28454),c=n(10365),u=s("string-to-symbol-registry"),l=s("symbol-to-string-registry");r({target:"Symbol",stat:!0,forced:!c},{for:function(t){var e=a(t);if(o(u,e))return u[e];var n=i("Symbol")(e);return u[e]=n,l[n]=e,n}})},6980:function(t){"use strict";t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},7040:function(t,e,n){"use strict";var r=n(4495);t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},7271:function(t,e,n){"use strict";var r=n(10704);n(31070),t.exports=r},7528:function(t,e){"use strict";e.f=Object.getOwnPropertySymbols},7588:function(t,e,n){"use strict";var r=n(46518),i=n(69565),o=n(72652),a=n(79306),s=n(28551),c=n(1767),u=n(9539),l=n(84549),d=l("forEach",TypeError);r({target:"Iterator",proto:!0,real:!0,forced:d},{forEach:function(t){s(this);try{a(t)}catch(r){u(this,"throw",r)}if(d)return i(d,this,t);var e=c(this),n=0;o(e,function(e){t(e,n++)},{IS_RECORD:!0})}})},7743:function(t,e,n){"use strict";var r=n(46518),i=n(69565),o=n(79306),a=n(36043),s=n(1103),c=n(72652),u=n(90537);r({target:"Promise",stat:!0,forced:u},{race:function(t){var e=this,n=a.f(e),r=n.reject,u=s(function(){var a=o(e.resolve);c(t,function(t){i(a,e,t).then(n.resolve,r)})});return u.error&&r(u.value),n.promise}})},7756:function(t,e,n){"use strict";n(94808);var r=n(72020),i=r.Object,o=t.exports=function(t,e,n){return i.defineProperty(t,e,n)};i.defineProperty.sham&&(o.sham=!0)},7821:function(t,e,n){"use strict";var r=n(4353),i=n(55542),o=n(80575);t.exports=function(t,e,n){r?i.f(t,e,o(0,n)):t[e]=n}},7860:function(t,e,n){"use strict";var r=n(82839);t.exports=/web0s(?!.*chrome)/i.test(r)},8009:function(t){"use strict";t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},8023:function(t,e,n){"use strict";n.d(e,{A:function(){return a}});var r=n(73243),i=n(67117);function o(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),r(t,(0,i.A)(o.key),o)}}function a(t,e,n){return e&&o(t.prototype,e),n&&o(t,n),r(t,"prototype",{writable:!1}),t}},8037:function(t,e,n){"use strict";var r=n(64882);t.exports=r},8256:function(t,e,n){"use strict";var r=n(27925),i=TypeError,o=function(t){var e,n;this.promise=new t(function(t,r){if(void 0!==e||void 0!==n)throw new i("Bad Promise constructor");e=t,n=r}),this.resolve=r(e),this.reject=r(n)};t.exports.f=function(t){return new o(t)}},8433:function(t,e,n){"use strict";var r=n(81924);n(31070),t.exports=r},9395:function(t,e,n){"use strict";n.r(e);var r=n(79033),i=n(4350),o=n(60515),a=n(8023),s=n(72628),c=n(98035),u=n(51203),l=n(4873),d=(n(16280),n(74423),n(26099),n(3362),n(27495),n(90906),n(21699),n(71761),n(11392),n(39424)),p=n(20350),f=n(12906),h=function(t){function e(){var t;(0,o.A)(this,e),t=(0,c.A)(this,e);var n=f.A.getCurrentInstance();if(!n)return console.warn("No editor instance found for Video format"),(0,s.A)(t);t.editorId=n.instanceId;var r=n.getPopupInstance("video");return r||(r=new p.A({onVideoInsert:function(n){e.insertVideoAtCurrentPosition(n,t.editorId)},editor:n,editorId:t.editorId}),n.setPopupInstance("video",r)),t.videoPopup=r,t}return(0,u.A)(e,t),(0,a.A)(e,[{key:"apply",value:function(t){t?e.insertVideoAtCurrentPosition(t,this.editorId):this.showVideoPopup()}},{key:"remove",value:function(){var t=window.getSelection();if(t&&t.rangeCount){var e=t.getRangeAt(0),n=this.getVideoElement(e);n&&n.remove()}}},{key:"toggle",value:function(){this.videoPopup.isVisible?this.videoPopup.hide():this.showVideoPopup()}},{key:"showVideoPopup",value:function(){var t=f.A.getInstanceById(this.editorId);if(t){var e=t.getModule("toolbar"),n=null;if(e&&(n=e.getButton("video")),!n){var r=null===e||void 0===e?void 0:e.getContainer();r&&(n=r.querySelector(".rich-editor-toolbar-btn.video-btn"))}n||(n=t.wrapper.querySelector(".rich-editor-toolbar-btn.video-btn")),n?this.videoPopup.show(n):console.warn("Video button not found for editor:",this.editorId)}}},{key:"isActive",value:function(){var t=window.getSelection();if(!t||!t.rangeCount)return!1;var e=t.getRangeAt(0),n=this.getVideoElement(e);return null!==n}},{key:"getVideoElement",value:function(t){var e=t.commonAncestorContainer;if(e.nodeType===Node.TEXT_NODE&&(e=e.parentNode),("VIDEO"===e.tagName||"IFRAME"===e.tagName)&&e.classList&&e.classList.contains("inserted-video"))return e;var n=t.cloneContents().querySelector(".inserted-video");return n||null}}],[{key:"createForEditor",value:function(t){var n=f.A.getInstanceById(t);if(!n)return console.warn("No editor instance found for ID:",t),null;var r=f.A.currentInstance;f.A.currentInstance=n;var i=new e;return f.A.currentInstance=r,i}},{key:"create",value:function(t){if(e.isYouTubeUrl(t))return e.createYouTubeEmbed(t);var n=document.createElement("VIDEO");return n.src=t,n.className="inserted-video",n.controls=!0,n.style.maxWidth="100%",n.style.height="auto",n.setAttribute("contenteditable","false"),n}},{key:"createYouTubeEmbed",value:function(t){var n=e.getYouTubeVideoId(t);if(!n)throw new Error("Invalid YouTube URL");var r=document.createElement("IFRAME");return r.src="https://www.youtube.com/embed/".concat(n),r.className="inserted-video youtube-video",r.width="560",r.height="315",r.style.maxWidth="100%",r.style.width="560px",r.style.height="315px",r.style.position="relative",r.style.display="block",r.setAttribute("frameborder","0"),r.setAttribute("allowfullscreen",""),r.setAttribute("contenteditable","false"),r}},{key:"insertVideoAtCurrentPosition",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=null;if(r=n?f.A.getInstanceById(n):f.A.getCurrentInstance(),r){var i=window.getSelection();if(i&&i.rangeCount)try{var o=i.getRangeAt(0),a=e.create(t);o.deleteContents(),o.insertNode(a);var s=document.createTextNode(" ");o.setStartAfter(a),o.insertNode(s),o.setStartAfter(s),o.collapse(!0),i.removeAllRanges(),i.addRange(o),r&&"function"===typeof r.onContentChange&&r.onContentChange()}catch(c){console.error("Error inserting video:",c)}}else console.warn("No editor instance found for video insertion")}},{key:"handleFileUpload",value:function(){var t=(0,i.A)((0,r.A)().m(function t(e){return(0,r.A)().w(function(t){while(1)switch(t.n){case 0:return t.a(2,new Promise(function(t,n){if(e&&e.type.startsWith("video/")){var r=new FileReader;r.onload=function(e){t(e.target.result)},r.onerror=function(){n(new Error("Failed to read file"))},r.readAsDataURL(e)}else n(new Error("Please select a valid video file"))}))}},t)}));function e(e){return t.apply(this,arguments)}return e}()},{key:"validateVideoUrl",value:function(t){return new Promise(function(n){if(e.isYouTubeUrl(t))n(!0);else{var r=["mp4","webm","ogg","mov","avi","mkv"],i=r.some(function(e){return t.toLowerCase().includes(".".concat(e))});if(i)n(!0);else{var o=document.createElement("video");o.onloadedmetadata=function(){n(!0)},o.onerror=function(){n(!1)},setTimeout(function(){n(!1)},5e3),o.src=t}}})}},{key:"isYouTubeUrl",value:function(t){var e=/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/watch\?v=|youtu\.be\/|youtube\.com\/embed\/)([a-zA-Z0-9_-]{11})/;return e.test(t)}},{key:"getYouTubeVideoId",value:function(t){var e=/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/watch\?v=|youtu\.be\/|youtube\.com\/embed\/)([a-zA-Z0-9_-]{11})/,n=t.match(e);return n?n[1]:null}}])}(d.Ly);(0,l.A)(h,"formatName","video"),(0,l.A)(h,"tagName","VIDEO"),(0,l.A)(h,"className","inserted-video"),e["default"]=h},9425:function(t,e,n){"use strict";var r=n(61174),i=n(21231),o=Array.prototype;t.exports=function(t){var e=t.filter;return t===o||r(o,t)&&e===o.filter?i:e}},9539:function(t,e,n){"use strict";var r=n(69565),i=n(28551),o=n(55966);t.exports=function(t,e,n){var a,s;i(t);try{if(a=o(t,"return"),!a){if("throw"===e)throw n;return n}a=r(a,t)}catch(c){s=!0,a=c}if("throw"===e)throw n;if(s)throw a;return i(a),n}},9548:function(t,e,n){"use strict";n.d(e,{A:function(){return a}});var r=n(40225),i=n(95069),o=n(41325);function a(t){var e;return a=r?i(e=o).call(e):function(t){return t.__proto__||o(t)},a(t)}},9679:function(t,e,n){"use strict";var r=n(17424);r("matchAll")},9868:function(t,e,n){"use strict";var r=n(46518),i=n(79504),o=n(91291),a=n(31240),s=n(72333),c=n(79039),u=RangeError,l=String,d=Math.floor,p=i(s),f=i("".slice),h=i(1.1.toFixed),v=function(t,e,n){return 0===e?n:e%2===1?v(t,e-1,n*t):v(t*t,e/2,n)},g=function(t){var e=0,n=t;while(n>=4096)e+=12,n/=4096;while(n>=2)e+=1,n/=2;return e},m=function(t,e,n){var r=-1,i=n;while(++r<6)i+=e*t[r],t[r]=i%1e7,i=d(i/1e7)},y=function(t,e){var n=6,r=0;while(--n>=0)r+=t[n],t[n]=d(r/e),r=r%e*1e7},b=function(t){var e=6,n="";while(--e>=0)if(""!==n||0===e||0!==t[e]){var r=l(t[e]);n=""===n?r:n+p("0",7-r.length)+r}return n},w=c(function(){return"0.000"!==h(8e-5,3)||"1"!==h(.9,0)||"1.25"!==h(1.255,2)||"1000000000000000128"!==h(0xde0b6b3a7640080,0)})||!c(function(){h({})});r({target:"Number",proto:!0,forced:w},{toFixed:function(t){var e,n,r,i,s=a(this),c=o(t),d=[0,0,0,0,0,0],h="",w="0";if(c<0||c>20)throw new u("Incorrect fraction digits");if(s!==s)return"NaN";if(s<=-1e21||s>=1e21)return l(s);if(s<0&&(h="-",s=-s),s>1e-21)if(e=g(s*v(2,69,1))-69,n=e<0?s*v(2,-e,1):s/v(2,e,1),n*=4503599627370496,e=52-e,e>0){m(d,0,n),r=c;while(r>=7)m(d,1e7,0),r-=7;m(d,v(10,r,1),0),r=e-1;while(r>=23)y(d,1<<23),r-=23;y(d,1<<r),m(d,1,1),y(d,2),w=b(d)}else m(d,0,n),m(d,1<<-e,0),w=b(d)+p("0",c);return c>0?(i=w.length,w=h+(i<=c?"0."+p("0",c-i)+w:f(w,0,i-c)+"."+f(w,i-c))):w=h+w,w}})},10298:function(t,e,n){"use strict";var r=n(22195),i=n(25397),o=n(38480).f,a=n(67680),s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],c=function(t){try{return o(t)}catch(e){return a(s)}};t.exports.f=function(t){return s&&"Window"===r(t)?c(t):o(i(t))}},10350:function(t,e,n){"use strict";var r=n(43724),i=n(39297),o=Function.prototype,a=r&&Object.getOwnPropertyDescriptor,s=i(o,"name"),c=s&&"something"===function(){}.name,u=s&&(!r||r&&a(o,"name").configurable);t.exports={EXISTS:s,PROPER:c,CONFIGURABLE:u}},10365:function(t,e,n){"use strict";var r=n(74524);t.exports=r&&!!Symbol["for"]&&!!Symbol.keyFor},10436:function(t,e,n){"use strict";var r,i,o,a,s=n(46518),c=n(96395),u=n(38574),l=n(44576),d=n(19167),p=n(69565),f=n(36840),h=n(52967),v=n(10687),g=n(87633),m=n(79306),y=n(94901),b=n(20034),w=n(90679),C=n(2293),x=n(59225).set,k=n(91955),E=n(90757),A=n(1103),S=n(18265),T=n(91181),I=n(80550),L=n(10916),N=n(36043),j="Promise",H=L.CONSTRUCTOR,O=L.REJECTION_EVENT,P=L.SUBCLASSING,R=T.getterFor(j),B=T.set,z=I&&I.prototype,M=I,V=z,F=l.TypeError,D=l.document,_=l.process,U=N.f,W=U,q=!!(D&&D.createEvent&&l.dispatchEvent),Z="unhandledrejection",G="rejectionhandled",X=0,Y=1,K=2,$=1,Q=2,J=function(t){var e;return!(!b(t)||!y(e=t.then))&&e},tt=function(t,e){var n,r,i,o=e.value,a=e.state===Y,s=a?t.ok:t.fail,c=t.resolve,u=t.reject,l=t.domain;try{s?(a||(e.rejection===Q&&ot(e),e.rejection=$),!0===s?n=o:(l&&l.enter(),n=s(o),l&&(l.exit(),i=!0)),n===t.promise?u(new F("Promise-chain cycle")):(r=J(n))?p(r,n,c,u):c(n)):u(o)}catch(d){l&&!i&&l.exit(),u(d)}},et=function(t,e){t.notified||(t.notified=!0,k(function(){var n,r=t.reactions;while(n=r.get())tt(n,t);t.notified=!1,e&&!t.rejection&&rt(t)}))},nt=function(t,e,n){var r,i;q?(r=D.createEvent("Event"),r.promise=e,r.reason=n,r.initEvent(t,!1,!0),l.dispatchEvent(r)):r={promise:e,reason:n},!O&&(i=l["on"+t])?i(r):t===Z&&E("Unhandled promise rejection",n)},rt=function(t){p(x,l,function(){var e,n=t.facade,r=t.value,i=it(t);if(i&&(e=A(function(){u?_.emit("unhandledRejection",r,n):nt(Z,n,r)}),t.rejection=u||it(t)?Q:$,e.error))throw e.value})},it=function(t){return t.rejection!==$&&!t.parent},ot=function(t){p(x,l,function(){var e=t.facade;u?_.emit("rejectionHandled",e):nt(G,e,t.value)})},at=function(t,e,n){return function(r){t(e,r,n)}},st=function(t,e,n){t.done||(t.done=!0,n&&(t=n),t.value=e,t.state=K,et(t,!0))},ct=function(t,e,n){if(!t.done){t.done=!0,n&&(t=n);try{if(t.facade===e)throw new F("Promise can't be resolved itself");var r=J(e);r?k(function(){var n={done:!1};try{p(r,e,at(ct,n,t),at(st,n,t))}catch(i){st(n,i,t)}}):(t.value=e,t.state=Y,et(t,!1))}catch(i){st({done:!1},i,t)}}};if(H&&(M=function(t){w(this,V),m(t),p(r,this);var e=R(this);try{t(at(ct,e),at(st,e))}catch(n){st(e,n)}},V=M.prototype,r=function(t){B(this,{type:j,done:!1,notified:!1,parent:!1,reactions:new S,rejection:!1,state:X,value:null})},r.prototype=f(V,"then",function(t,e){var n=R(this),r=U(C(this,M));return n.parent=!0,r.ok=!y(t)||t,r.fail=y(e)&&e,r.domain=u?_.domain:void 0,n.state===X?n.reactions.add(r):k(function(){tt(r,n)}),r.promise}),i=function(){var t=new r,e=R(t);this.promise=t,this.resolve=at(ct,e),this.reject=at(st,e)},N.f=U=function(t){return t===M||t===o?new i(t):W(t)},!c&&y(I)&&z!==Object.prototype)){a=z.then,P||f(z,"then",function(t,e){var n=this;return new M(function(t,e){p(a,n,t,e)}).then(t,e)},{unsafe:!0});try{delete z.constructor}catch(ut){}h&&h(z,V)}s({global:!0,constructor:!0,wrap:!0,forced:H},{Promise:M}),o=d.Promise,v(M,j,!1,!0),g(j)},10687:function(t,e,n){"use strict";var r=n(24913).f,i=n(39297),o=n(78227),a=o("toStringTag");t.exports=function(t,e,n){t&&!n&&(t=t.prototype),t&&!i(t,a)&&r(t,a,{configurable:!0,value:e})}},10704:function(t,e,n){"use strict";n(91301),n(78306),n(87335),n(55108);var r=n(69910);t.exports=r.f("iterator")},10757:function(t,e,n){"use strict";var r=n(97751),i=n(94901),o=n(1625),a=n(7040),s=Object;t.exports=a?function(t){return"symbol"==typeof t}:function(t){var e=r("Symbol");return i(e)&&o(e.prototype,s(t))}},10762:function(){},10825:function(t,e,n){"use strict";var r=n(50181),i=n(67656),o=n(59010),a=r(Function.toString);i(o.inspectSource)||(o.inspectSource=function(t){return a(t)}),t.exports=o.inspectSource},10916:function(t,e,n){"use strict";var r=n(44576),i=n(80550),o=n(94901),a=n(92796),s=n(33706),c=n(78227),u=n(84215),l=n(96395),d=n(39519),p=i&&i.prototype,f=c("species"),h=!1,v=o(r.PromiseRejectionEvent),g=a("Promise",function(){var t=s(i),e=t!==String(i);if(!e&&66===d)return!0;if(l&&(!p["catch"]||!p["finally"]))return!0;if(!d||d<51||!/native code/.test(t)){var n=new i(function(t){t(1)}),r=function(t){t(function(){},function(){})},o=n.constructor={};if(o[f]=r,h=n.then(function(){})instanceof r,!h)return!0}return!e&&("BROWSER"===u||"DENO"===u)&&!v});t.exports={CONSTRUCTOR:g,REJECTION_EVENT:v,SUBCLASSING:h}},11056:function(t,e,n){"use strict";var r=n(24913).f;t.exports=function(t,e,n){n in t||r(t,n,{configurable:!0,get:function(){return e[n]},set:function(t){e[n]=t}})}},11145:function(t,e,n){"use strict";var r=n(17424);r("dispose")},11173:function(t,e,n){"use strict";var r=n(91676),i=String,o=TypeError;t.exports=function(t){if(r(t))return t;throw new o("Can't set "+i(t)+" as a prototype")}},11392:function(t,e,n){"use strict";var r=n(46518),i=n(27476),o=n(77347).f,a=n(18014),s=n(655),c=n(60511),u=n(67750),l=n(41436),d=n(96395),p=i("".slice),f=Math.min,h=l("startsWith"),v=!d&&!h&&!!function(){var t=o(String.prototype,"startsWith");return t&&!t.writable}();r({target:"String",proto:!0,forced:!v&&!h},{startsWith:function(t){var e=s(u(this));c(t);var n=a(f(arguments.length>1?arguments[1]:void 0,e.length)),r=s(t);return p(e,n,n+r.length)===r}})},11436:function(t,e,n){"use strict";var r=n(27417),i=n(50181),o=n(63764),a=n(64832),s=n(87481),c=n(77938),u=i([].push),l=function(t){var e=1===t,n=2===t,i=3===t,l=4===t,d=6===t,p=7===t,f=5===t||d;return function(h,v,g,m){for(var y,b,w=a(h),C=o(w),x=s(C),k=r(v,g),E=0,A=m||c,S=e?A(h,x):n||p?A(h,0):void 0;x>E;E++)if((f||E in C)&&(y=C[E],b=k(y,E,w),t))if(e)S[E]=b;else if(b)switch(t){case 3:return!0;case 5:return y;case 6:return E;case 2:u(S,y)}else switch(t){case 4:return!1;case 7:u(S,y)}return d?-1:i||l?l:S}};t.exports={forEach:l(0),map:l(1),filter:l(2),some:l(3),every:l(4),find:l(5),findIndex:l(6),filterReject:l(7)}},11557:function(t,e,n){"use strict";var r=n(86337),i=n(59833);r({target:"Symbol",stat:!0},{isRegisteredSymbol:i})},11933:function(t,e,n){"use strict";var r=n(50181);t.exports=r([].slice)},12187:function(t,e,n){"use strict";n(77935);var r=n(72020);t.exports=r.Object.keys},12211:function(t,e,n){"use strict";var r=n(79039);t.exports=!r(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})},12616:function(t,e,n){"use strict";var r=n(48230),i=n(2349),o=n(39066),a=n(42230),s=a("species");t.exports=function(t,e){var n,a=r(t).constructor;return void 0===a||o(n=r(a)[s])?e:i(n)}},12650:function(t,e,n){"use strict";var r=n(84573);t.exports=r},12906:function(t,e,n){"use strict";n.d(e,{A:function(){return c}});var r=n(57229),i=n(60515),o=n(8023),a=n(4873),s=(n(28706),n(74423),n(23792),n(48598),n(44114),n(54554),n(18111),n(7588),n(36033),n(26099),n(27495),n(90906),n(38781),n(47764),n(25440),n(90744),n(42762),n(23500),n(62953),n(93012)),c=(n(94367),function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,i.A)(this,t),this.options=(0,r.A)((0,r.A)({},t.DEFAULTS),n),this.root="string"===typeof e?document.querySelector(e):e,this.modules=new Map,this.formats=new Map,this.registry=s.A,this.events=new Map,this.toolbarBtns={},this.statusbarEls={},this.dropdownMenus={},this.popupInstances=new Map,t.currentInstance=this;var o=this.generateInstanceId();this.instanceId=o,t.instances.set(o,this),this.init()}return(0,o.A)(t,[{key:"generateInstanceId",value:function(){return"editor_"+Date.now()+"_"+Math.random().toString(36).substr(2,9)}},{key:"init",value:function(){this.createStructure(),this.loadModules(),this.loadFormats(),this.setupEventListeners(),this.updateStatusbar()}},{key:"createStructure",value:function(){this.wrapper=document.createElement("div"),this.wrapper.className="yjd-rich-editor",this.wrapper.style.width=this.options.width+"px",this.wrapper.style.maxWidth=this.options.maxWidth+"px",this.wrapper.style.minHeight=this.options.height+"px",this.wrapper.style.maxHeight=this.options.maxHeight+"px",this.wrapper.style.position="relative",this.editor=document.createElement("div"),this.editor.className="rich-editor-area",this.editor.contentEditable=!0,this.editor.setAttribute("placeholder",this.options.placeholder);try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch(t){console.warn("Could not set defaultParagraphSeparator:",t)}this.editor.innerHTML=this.getDefaultContent(),this.wrapper.appendChild(this.editor),this.popupContainer=document.createElement("div"),this.popupContainer.className="rich-editor-popup-container",this.popupContainer.style.position="absolute",this.popupContainer.style.top="0",this.popupContainer.style.left="0",this.popupContainer.style.width="100%",this.popupContainer.style.height="100%",this.popupContainer.style.pointerEvents="none",this.popupContainer.style.zIndex="1000",this.wrapper.appendChild(this.popupContainer),(this.options.features.wordCount||this.options.features.breadcrumb)&&this.createStatusbar(),this.root.appendChild(this.wrapper)}},{key:"isHtmlContent",value:function(t){if(!t||"string"!==typeof t)return!1;var e=t.trim(),n=[/<[^>]+>/,/&[a-zA-Z]+;/,/&#\d+;/];return n.some(function(t){return t.test(e)})}},{key:"wrapTextInParagraph",value:function(t){if(!t||"string"!==typeof t)return"<p><br></p>";var e=t.trim();return this.isHtmlContent(e)?e:""===e?"<p><br></p>":"<p>".concat(e,"</p>")}},{key:"getDefaultContent",value:function(){return this.options.content?this.wrapTextInParagraph(this.options.content):'\n <h1 style=" line-height: 1.5; text-align: center;">\n Welcome to yjd.io\n </h1>\n <p style="text-align: center; line-height: 1.5;">\n yjd.io is a free, open-source WYSIWYG editor designed for the contemporary web\n </p>\n <p><br></p>\n '}},{key:"createStatusbar",value:function(){this.statusbar=document.createElement("div"),this.statusbar.className="rich-editor-statusbar",this.statusbarEls.breadcrumb=document.createElement("span"),this.statusbarEls.breadcrumb.className="rich-editor-breadcrumb",this.statusbarEls.wordcount=document.createElement("span"),this.statusbarEls.wordcount.className="wordcount",this.statusbar.appendChild(this.statusbarEls.breadcrumb),this.statusbar.appendChild(this.statusbarEls.wordcount),this.wrapper.appendChild(this.statusbar)}},{key:"loadModules",value:function(){var t,e=this,n=this.options.toolbar||this.options.toolbar1||this.options.toolbar2;t=n?this.options.modules||["toolbar","history"]:this.options.modules||["toolbar","history","block-toolbar","table-toolbar","code-view","theme-switcher","resize-handles"],t.forEach(function(t){var n=e.registry.get("modules/".concat(t));if(n){var r="toolbar"===t?e.options:e.options[t]||e.options,i=new n(e,r);if(e.modules.set(t,i),"toolbar"===t&&i.getContainer){var o=i.getContainer();e.wrapper.insertBefore(o,e.editor),i.on("toolbar-click",function(t){e.handleToolbarClick(t)})}}})}},{key:"loadFormats",value:function(){var t,e=this,n=this.options.toolbar||this.options.toolbar1||this.options.toolbar2;t=n?this.options.formats||["bold","italic","underline","strike"]:this.options.formats||["bold","italic","underline","strike","subscript","superscript","color","background","text-align","text-size","link","code","h1","h2","h3","h4","h5","h6","paragraph","pre"],t.forEach(function(t){var n=e.registry.get("formats/".concat(t));n&&e.formats.set(t,n)})}},{key:"setupEventListeners",value:function(){var t=this;this.editor.addEventListener("input",function(){t.ensureEditorHasContent(),t.updateStatusbar(),t.onContentChange()}),document.addEventListener("selectionchange",function(){(document.activeElement===t.editor||t.editor.contains(document.activeElement))&&t.onSelectionChange()}),this.editor.addEventListener("mouseup",function(){setTimeout(function(){t.onSelectionChange()},10)}),this.editor.addEventListener("click",function(e){setTimeout(function(){t.ensureEditorHasContent()},0)}),this.editor.addEventListener("contextmenu",function(t){}),this.editor.addEventListener("keydown",function(e){"Delete"!==e.key&&"Backspace"!==e.key||setTimeout(function(){t.ensureEditorHasContent()},0)}),this.editor.addEventListener("paste",function(){setTimeout(function(){t.ensureEditorHasContent()},0)}),this.editor.addEventListener("drop",function(){setTimeout(function(){t.ensureEditorHasContent()},0)}),this.editor.addEventListener("cut",function(){setTimeout(function(){t.ensureEditorHasContent()},0)}),setTimeout(function(){t.ensureEditorHasContent(),t.focus()},100),this.editor.addEventListener("focus",function(){setTimeout(function(){t.ensureEditorHasContent()},0)})}},{key:"onContentChange",value:function(){this.ensureEditorHasContent(),this.modules.forEach(function(t){"function"===typeof t.onContentChange&&t.onContentChange()});var t=this.getContent();this.options.onChange&&"function"===typeof this.options.onChange&&this.options.onChange(t),this.emit("text-change",t)}},{key:"ensureEditorHasContent",value:function(){var t=this.isEditorEmpty();if(t){var e=document.createElement("p");e.innerHTML="<br>",this.editor.innerHTML="",this.editor.appendChild(e),this.setCursorToElement(e),this.editor.focus()}}},{key:"ensureParagraphForEditing",value:function(){var t=this.editor.children;if(0===t.length){var e=document.createElement("p");return e.innerHTML="<br>",this.editor.appendChild(e),void this.setCursorToElement(e)}var n=t[t.length-1],r=["P","DIV","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","PRE","ARTICLE","SECTION","MAIN","ASIDE"];if(!r.includes(n.tagName)){var i=document.createElement("p");i.innerHTML="<br>",this.editor.appendChild(i)}}},{key:"isEditorEmpty",value:function(){var t=this.editor.innerHTML.trim();if(""===t)return!0;var e=["<br>","<div><br></div>","<p><br></p>","<p></p>","<div></div>","<p> </p>","<div> </div>"];if(e.includes(t))return!0;var n=this.editor.children;if(0===n.length)return!0;for(var r=0;r<n.length;r++){var i=n[r],o=i.innerHTML.trim();if(""!==o&&"<br>"!==o&&" "!==o&&"<br> "!==o&&" <br>"!==o)return!1}return!0}},{key:"setCursorToElement",value:function(t){var e=document.createRange(),n=window.getSelection();t.firstChild&&t.firstChild.nodeType===Node.TEXT_NODE?e.setStart(t.firstChild,0):e.setStart(t,0),e.collapse(!0),n.removeAllRanges(),n.addRange(e)}},{key:"onSelectionChange",value:function(){var t=window.getSelection(),e=t.rangeCount>0?t.getRangeAt(0):null,n=this.isSelectionInEditableArea(t);this.modules.forEach(function(t){"function"===typeof t.onSelectionChange&&t.onSelectionChange(e,n)}),this.updateToolbarButtonStates(),this.updateToolbarAccessibility(n),this.updateStatusbar()}},{key:"isSelectionInEditableArea",value:function(t){if(!t||0===t.rangeCount)return!1;var e=t.getRangeAt(0),n=e.startContainer,r=e.endContainer,i=this.isNodeInEditableArea(n),o=this.isNodeInEditableArea(r);return i&&o}},{key:"isNodeInEditableArea",value:function(t){if(!t)return!1;var e=t.nodeType===Node.TEXT_NODE?t.parentNode:t;while(e&&e!==document.body){if(e===this.editor||e.classList&&e.classList.contains("rich-editor-area"))return!0;e=e.parentNode}return!1}},{key:"updateToolbarAccessibility",value:function(t){var e=this.getModule("toolbar");if(e){var n=["bold","italic","underline","strike","subscript","superscript","color","background","link","table","heading","font-family","line-height","capitalization","text-align","list","indent-increase","indent-decrease","text-size"];n.forEach(function(n){e.setButtonDisabled(n,!t)});var r=["more","undo","redo","code-view","theme"];r.forEach(function(t){e.setButtonDisabled(t,!1)})}}},{key:"updateStatusbar",value:function(){if(this.statusbar){var t=window.getSelection();if(t){if(this.statusbarEls.breadcrumb&&this.options.features.breadcrumb){var e=t.anchorNode,n=[],r=3===(null===e||void 0===e?void 0:e.nodeType)?e.parentElement:e;while(r&&r!==this.editor&&r!==document.body){if(r.tagName){var i=r.tagName.toLowerCase();if(r.className&&"string"===typeof r.className){var o=r.className.trim();o&&(i+="."+o.split(" ").join("."))}r.id&&(i+="#"+r.id),n.unshift(i)}r=r.parentElement}this.statusbarEls.breadcrumb.textContent=n.length>0?n.join(" > "):"editor"}if(this.statusbarEls.wordcount&&this.options.features.wordCount){var a=this.editor.textContent||"",s=a.trim()?a.trim().split(/\s+/).length:0,c=a.length,u=a.replace(/\s/g,"").length;this.statusbarEls.wordcount.textContent="".concat(s," words, ").concat(c," chars (").concat(u," no spaces)")}}}}},{key:"focus",value:function(){this.editor&&this.editor.focus()}},{key:"getContent",value:function(){return this.editor.innerHTML}},{key:"setContent",value:function(t){var e=this.wrapTextInParagraph(t);this.editor.innerHTML=e,this.onContentChange()}},{key:"getModule",value:function(t){return this.modules.get(t)}},{key:"getFormat",value:function(t){return this.formats.get(t)}},{key:"register",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.registry.register(t,e,n)}},{key:"handleToolbarClick",value:function(e){var n=e.command;e.button,e.value,t.currentInstance;t.currentInstance=this,this.emit("toolbar-click",e);var r=["more","undo","redo","code-view","theme"];if(r.includes(n))switch(n){case"more":return;case"undo":return void this.undo();case"redo":return void this.redo();case"code-view":return}var i=window.getSelection(),o=this.isSelectionInEditableArea(i);if(o)switch(n){case"bold":case"italic":case"underline":case"strike":case"subscript":case"superscript":case"color":case"background":case"link":case"table":case"heading":case"font-family":case"line-height":case"capitalization":case"text-align":case"text-size":case"list":case"indent-increase":case"indent-decrease":case"emoji":case"image":case"video":case"tag":case"import":this.toggleFormat(n);break;default:console.warn("Unknown command: ".concat(n))}else console.warn("Command '".concat(n,"' blocked: Selection outside editable area"))}},{key:"toggleFormat",value:function(t){var e=this,n=this.getModule("history");n&&"function"===typeof n.saveBeforeFormat&&n.saveBeforeFormat();var r={bold:"bold",italic:"italic",underline:"underline",strike:"strike",subscript:"subscript",superscript:"superscript",color:"color",background:"background",link:"link",table:"table",heading:"heading","font-family":"font-family","line-height":"line-height",capitalization:"capitalization","text-align":"text-align","text-size":"text-size",list:"list","indent-increase":"indent-increase","indent-decrease":"indent-decrease",emoji:"emoji",image:"image",video:"video",tag:"tag",import:"import"},i=r[t];if(i){var o=this.registry.get("formats/".concat(i));if(o){var a=new o;a.toggle(),this.updateToolbarButtonStates();var s=["bold","italic","underline","strike","subscript","superscript"];s.includes(t)&&setTimeout(function(){e.onContentChange()},0)}}else console.warn("Unknown format: ".concat(t))}},{key:"updateToolbarButtonStates",value:function(){var e=this,n=this.getModule("toolbar");if(n){var r=window.getSelection();if(r&&r.rangeCount){var i=this.isSelectionInEditableArea(r),o=["heading","font-family","line-height","capitalization","text-align","list","indent-increase","indent-decrease","bold","italic","underline","strike","subscript","superscript","color","background","link","table","text-size"];if(o.forEach(function(r){if(i){var o=e.registry.get("formats/".concat(r));if(o){var a;if(o.createForEditor)a=o.createForEditor(e.instanceId);else{var s=t.currentInstance;t.currentInstance=e,a=new o,t.currentInstance=s}if(a){var c=a.isActive();n.setButtonActive(r,c),"line-height"===r&&"function"===typeof a.updateButtonText&&a.updateButtonText()}}}else n.setButtonActive(r,!1)}),i){var a=this.registry.get("formats/text-size");a&&"function"===typeof a.updateButtonTextStatic&&a.updateButtonTextStatic(this.instanceId)}}}}},{key:"undo",value:function(){var t=this.getModule("history");t&&"function"===typeof t.undo?t.undo():document.execCommand("undo")}},{key:"redo",value:function(){var t=this.getModule("history");t&&"function"===typeof t.redo?t.redo():document.execCommand("redo")}},{key:"on",value:function(t,e){this.events.has(t)||this.events.set(t,[]),this.events.get(t).push(e)}},{key:"off",value:function(t,e){if(this.events.has(t)){var n=this.events.get(t),r=n.indexOf(e);r>-1&&n.splice(r,1)}}},{key:"emit",value:function(t,e){this.events.has(t)&&this.events.get(t).forEach(function(n){try{n(e)}catch(r){console.error("Error in event handler for ".concat(t,":"),r)}})}},{key:"preventFocusLoss",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"button, input, select, textarea, [contenteditable]";t&&t.addEventListener("mousedown",function(t){t.target.closest(n)||(t.preventDefault(),setTimeout(function(){e.focus()},0))})}},{key:"getPopupContainer",value:function(){return this.popupContainer}},{key:"getPopupInstance",value:function(t){return this.popupInstances.get(t)}},{key:"setPopupInstance",value:function(t,e){this.popupInstances.set(t,e)}},{key:"destroyPopupInstances",value:function(){this.popupInstances.forEach(function(t,e){t&&"function"===typeof t.destroy&&t.destroy()}),this.popupInstances.clear()}},{key:"destroy",value:function(){this.modules.forEach(function(t){"function"===typeof t.destroy&&t.destroy()}),this.destroyPopupInstances(),this.wrapper&&this.wrapper.parentNode&&this.wrapper.parentNode.removeChild(this.wrapper),this.modules.clear(),this.formats.clear(),this.events.clear(),t.instances.delete(this.instanceId),t.currentInstance===this&&(t.currentInstance=null)}}],[{key:"getCurrentInstance",value:function(){return t.currentInstance}},{key:"maintainFocus",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;"function"===typeof e&&e();var r=n||t.getCurrentInstance();r&&setTimeout(function(){return r.focus()},0)}},{key:"getPopupContainer",value:function(){var e=t.getCurrentInstance();return e?e.getPopupContainer():null}},{key:"getPopupInstanceById",value:function(e,n){var r=t.instances.get(e);return r?r.getPopupInstance(n):null}},{key:"getInstanceById",value:function(e){return t.instances.get(e)}},{key:"getAllInstances",value:function(){return t.instances}}])}());(0,a.A)(c,"DEFAULTS",{placeholder:"Type here...",theme:"light",height:400,width:800,maxWidth:1200,maxHeight:800,content:null,features:{emoji:!0,image:!0,table:!0,wordCount:!0,breadcrumb:!0}}),(0,a.A)(c,"currentInstance",null),(0,a.A)(c,"instances",new Map)},13058:function(t,e,n){"use strict";var r=n(85366),i=n(80575);t.exports=!r(function(){var t=new Error("a");return!("stack"in t)||(Object.defineProperty(t,"stack",i(1,7)),7!==t.stack)})},13268:function(t,e,n){"use strict";n(43162)},13330:function(t,e,n){"use strict";var r=n(17424);r("species")},13834:function(t,e,n){"use strict";n(99852),n(6495),n(81969),n(96075),n(83350)},13925:function(t,e,n){"use strict";var r=n(20034);t.exports=function(t){return r(t)||null===t}},14165:function(t,e,n){"use strict";var r=n(27925),i=n(39066);t.exports=function(t,e){var n=t[e];return i(n)?void 0:r(n)}},14601:function(t,e,n){"use strict";var r=n(97751),i=n(39297),o=n(66699),a=n(1625),s=n(52967),c=n(77740),u=n(11056),l=n(23167),d=n(32603),p=n(77584),f=n(80747),h=n(43724),v=n(96395);t.exports=function(t,e,n,g){var m="stackTraceLimit",y=g?2:1,b=t.split("."),w=b[b.length-1],C=r.apply(null,b);if(C){var x=C.prototype;if(!v&&i(x,"cause")&&delete x.cause,!n)return C;var k=r("Error"),E=e(function(t,e){var n=d(g?e:t,void 0),r=g?new C(t):new C;return void 0!==n&&o(r,"message",n),f(r,E,r.stack,2),this&&a(x,this)&&l(r,this,E),arguments.length>y&&p(r,arguments[y]),r});if(E.prototype=x,"Error"!==w?s?s(E,k):c(E,k,{name:!0}):h&&m in C&&(u(E,C,m),u(E,C,"prepareStackTrace")),c(E,C),!v)try{x.name!==w&&o(x,"name",w),x.constructor=E}catch(A){}return E}}},14603:function(t,e,n){"use strict";var r=n(36840),i=n(79504),o=n(655),a=n(22812),s=URLSearchParams,c=s.prototype,u=i(c.append),l=i(c["delete"]),d=i(c.forEach),p=i([].push),f=new s("a=1&a=2&b=3");f["delete"]("a",1),f["delete"]("b",void 0),f+""!=="a=2"&&r(c,"delete",function(t){var e=arguments.length,n=e<2?void 0:arguments[1];if(e&&void 0===n)return l(this,t);var r=[];d(this,function(t,e){p(r,{key:e,value:t})}),a(e,1);var i,s=o(t),c=o(n),f=0,h=0,v=!1,g=r.length;while(f<g)i=r[f++],v||i.key===s?(v=!0,l(this,i.key)):h++;while(h<g)i=r[h++],i.key===s&&i.value===c||u(this,i.key,i.value)},{enumerable:!0,unsafe:!0})},14891:function(t,e,n){"use strict";var r=n(86337),i=n(64832),o=n(87481),a=n(5108),s=n(62310),c=n(85366),u=c(function(){return 4294967297!==[].push.call({length: