(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-4e73ede3"],{"030f":function(t,e,n){(function(t){(function(e){"use strict";var n=function(){},r=function(t){return function(){return t()}},o=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t(e.apply(null,n))}},i=function(t,e){return function(n){return t(e(n))}},u=function(t){return function(){return t}},a=function(t){return t};function c(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.concat(n);return t.apply(null,o)}}var s=function(t){return function(e){return!t(e)}},l=function(t){return function(){throw new Error(t)}},f=u(!1),d=u(!0),m=tinymce.util.Tools.resolve("tinymce.ThemeManager"),g=function(){return g=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n],e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},g.apply(this,arguments)};function h(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}function p(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],u=0,a=i.length;u<a;u++,o++)r[o]=i[u];return r}var v,b=function(){return y},y=function(){var t=function(t){return t.isNone()},e=function(t){return t()},r=function(t){return t},o={fold:function(t,e){return t()},is:f,isSome:f,isNone:d,getOr:r,getOrThunk:e,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:u(null),getOrUndefined:u(void 0),or:r,orThunk:e,map:b,each:n,bind:b,exists:f,forall:d,filter:b,equals:t,equals_:t,toArray:function(){return[]},toString:u("none()")};return o}(),w=function(t){var e=u(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:d,isNone:f,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return w(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:y},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(f,(function(e){return n(t,e)}))}};return o},x=function(t){return null===t||void 0===t?y:w(t)},C={some:w,none:b,from:x},S=function(t){var e=typeof t;return null===t?"null":"object"===e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e},k=function(t){return function(e){return S(e)===t}},O=function(t){return function(e){return typeof e===t}},T=function(t){return function(e){return t===e}},E=k("string"),_=k("object"),A=k("array"),D=O("boolean"),N=T(void 0),R=function(t){return null===t||void 0===t},M=function(t){return!R(t)},z=O("function"),B=O("number"),P=function(t,e){if(A(t)){for(var n=0,r=t.length;n<r;++n)if(!e(t[n]))return!1;return!0}return!1},H=Array.prototype.slice,I=Array.prototype.indexOf,L=Array.prototype.push,F=function(t,e){return I.call(t,e)},V=function(t,e){var n=F(t,e);return-1===n?C.none():C.some(n)},U=function(t,e){return F(t,e)>-1},j=function(t,e){for(var n=0,r=t.length;n<r;n++){var o=t[n];if(e(o,n))return!0}return!1},W=function(t,e){for(var n=[],r=0;r<t;r++)n.push(e(r));return n},q=function(t,e){for(var n=[],r=0;r<t.length;r+=e){var o=H.call(t,r,r+e);n.push(o)}return n},$=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},G=function(t,e){for(var n=0,r=t.length;n<r;n++){var o=t[n];e(o,n)}},K=function(t,e){for(var n=t.length-1;n>=0;n--){var r=t[n];e(r,n)}},X=function(t,e){for(var n=[],r=[],o=0,i=t.length;o<i;o++){var u=t[o],a=e(u,o)?n:r;a.push(u)}return{pass:n,fail:r}},Y=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},J=function(t,e,n){return K(t,(function(t){n=e(n,t)})),n},Q=function(t,e,n){return G(t,(function(t){n=e(n,t)})),n},Z=function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return C.some(i);if(n(i,r))break}return C.none()},tt=function(t,e){return Z(t,e,f)},et=function(t,e){for(var n=0,r=t.length;n<r;n++){var o=t[n];if(e(o,n))return C.some(n)}return C.none()},nt=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!A(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);L.apply(e,t[n])}return e},rt=function(t,e){return nt($(t,e))},ot=function(t,e){for(var n=0,r=t.length;n<r;++n){var o=t[n];if(!0!==e(o,n))return!1}return!0},it=function(t){var e=H.call(t,0);return e.reverse(),e},ut=function(t,e){return Y(t,(function(t){return!U(e,t)}))},at=function(t,e){for(var n={},r=0,o=t.length;r<o;r++){var i=t[r];n[String(i)]=e(i,r)}return n},ct=function(t,e){var n=H.call(t,0);return n.sort(e),n},st=function(t){return 0===t.length?C.none():C.some(t[0])},lt=function(t){return 0===t.length?C.none():C.some(t[t.length-1])},ft=z(Array.from)?Array.from:function(t){return H.call(t)},dt=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return C.none()},mt=function(t){var e=function(e){return t===e},n=function(e){return mt(t)},r=function(e){return mt(t)},o=function(e){return mt(e(t))},i=function(e){return mt(t)},a=function(e){e(t)},c=function(e){return e(t)},s=function(e,n){return n(t)},l=function(e){return e(t)},m=function(e){return e(t)},g=function(){return C.some(t)};return{is:e,isValue:d,isError:f,getOr:u(t),getOrThunk:u(t),getOrDie:u(t),or:n,orThunk:r,fold:s,map:o,mapError:i,each:a,bind:c,exists:l,forall:m,toOption:g}},gt=function(t){var e=function(t){return t()},r=function(){return l(String(t))()},o=function(t){return t},i=function(t){return t()},u=function(e){return gt(t)},c=function(e){return gt(e(t))},s=function(e){return gt(t)},m=function(e,n){return e(t)};return{is:f,isValue:f,isError:d,getOr:a,getOrThunk:e,getOrDie:r,or:o,orThunk:i,fold:m,map:u,mapError:c,each:n,bind:s,exists:f,forall:d,toOption:C.none}},ht=function(t,e){return t.fold((function(){return gt(e)}),mt)},pt={value:mt,error:gt,fromOption:ht};(function(t){t[t["Error"]=0]="Error",t[t["Value"]=1]="Value"})(v||(v={}));var vt=function(t,e,n){return t.stype===v.Error?e(t.serror):n(t.svalue)},bt=function(t){var e=[],n=[];return G(t,(function(t){vt(t,(function(t){return n.push(t)}),(function(t){return e.push(t)}))})),{values:e,errors:n}},yt=function(t,e){return t.stype===v.Error?{stype:v.Error,serror:e(t.serror)}:t},wt=function(t,e){return t.stype===v.Value?{stype:v.Value,svalue:e(t.svalue)}:t},xt=function(t,e){return t.stype===v.Value?e(t.svalue):t},Ct=function(t,e){return t.stype===v.Error?e(t.serror):t},St=function(t){return{stype:v.Value,svalue:t}},kt=function(t){return{stype:v.Error,serror:t}},Ot=function(t){return vt(t,pt.error,pt.value)},Tt=function(t){return t.fold(kt,St)},Et={fromResult:Tt,toResult:Ot,svalue:St,partition:bt,serror:kt,bind:xt,bindError:Ct,map:wt,mapError:yt,fold:vt},_t=Object.keys,At=Object.hasOwnProperty,Dt=function(t,e){for(var n=_t(t),r=0,o=n.length;r<o;r++){var i=n[r],u=t[i];e(u,i)}},Nt=function(t,e){return Rt(t,(function(t,n){return{k:n,v:e(t,n)}}))},Rt=function(t,e){var n={};return Dt(t,(function(t,r){var o=e(t,r);n[o.k]=o.v})),n},Mt=function(t){return function(e,n){t[n]=e}},zt=function(t,e,n,r){var o={};return Dt(t,(function(t,o){(e(t,o)?n:r)(t,o)})),o},Bt=function(t,e){var r={};return zt(t,e,Mt(r),n),r},Pt=function(t,e){var n=[];return Dt(t,(function(t,r){n.push(e(t,r))})),n},Ht=function(t,e){for(var n=_t(t),r=0,o=n.length;r<o;r++){var i=n[r],u=t[i];if(e(u,i,t))return C.some(u)}return C.none()},It=function(t){return Pt(t,(function(t){return t}))},Lt=function(t,e){return Ft(t,e)?C.from(t[e]):C.none()},Ft=function(t,e){return At.call(t,e)},Vt=function(t,e){return Ft(t,e)&&void 0!==t[e]&&null!==t[e]},Ut=function(t){if(!A(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var n=[],r={};return G(t,(function(o,i){var u=_t(o);if(1!==u.length)throw new Error("one and only one name per case");var a=u[0],c=o[a];if(void 0!==r[a])throw new Error("duplicate key detected:"+a);if("cata"===a)throw new Error("cannot have a case named cata (sorry)");if(!A(c))throw new Error("case arguments must be an array");n.push(a),r[a]=function(){var r=arguments.length;if(r!==c.length)throw new Error("Wrong number of arguments to case "+a+". Expected "+c.length+" ("+c+"), got "+r);for(var o=new Array(r),u=0;u<o.length;u++)o[u]=arguments[u];var s=function(t){var e=_t(t);if(n.length!==e.length)throw new Error("Wrong number of arguments to match. Expected: "+n.join(",")+"\nActual: "+e.join(","));var r=ot(n,(function(t){return U(e,t)}));if(!r)throw new Error("Not all branches were specified when using match. Specified: "+e.join(", ")+"\nRequired: "+n.join(", "));return t[a].apply(null,o)};return{fold:function(){if(arguments.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+arguments.length);var e=arguments[i];return e.apply(null,o)},match:s,log:function(t){e.console.log(t,{constructors:n,constructor:a,params:o})}}}})),r},jt={generate:Ut},Wt=Object.prototype.hasOwnProperty,qt=function(t,e){return e},$t=function(t,e){var n=_(t)&&_(e);return n?Kt(t,e):e},Gt=function(t){return function(){for(var e=new Array(arguments.length),n=0;n<e.length;n++)e[n]=arguments[n];if(0===e.length)throw new Error("Can't merge zero objects");for(var r={},o=0;o<e.length;o++){var i=e[o];for(var u in i)Wt.call(i,u)&&(r[u]=t(r[u],i[u]))}return r}},Kt=Gt($t),Xt=Gt(qt),Yt=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}},Jt=jt.generate([{strict:[]},{defaultedThunk:["fallbackThunk"]},{asOption:[]},{asDefaultedOptionThunk:["fallbackThunk"]},{mergeWithThunk:["baseThunk"]}]),Qt=function(t){return Jt.defaultedThunk(u(t))},Zt=function(t){return Jt.mergeWithThunk(u(t))},te=Jt.strict,ee=Jt.asOption,ne=Jt.defaultedThunk,re=(Jt.asDefaultedOptionThunk,Jt.mergeWithThunk),oe=function(t,e){var n={};return Dt(t,(function(t,r){U(e,r)||(n[r]=t)})),n},ie=function(t,e){var n;return n={},n[t]=e,n},ue=function(t){var e={};return G(t,(function(t){e[t.key]=t.value})),e},ae=(jt.generate([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),function(t){var e=[],n=[];return G(t,(function(t){t.fold((function(t){e.push(t)}),(function(t){n.push(t)}))})),{errors:e,values:n}}),ce=function(t,e){return oe(t,e)},se=function(t,e){return ie(t,e)},le=function(t){return ue(t)},fe=function(t,e){return 0===t.length?pt.value(e):pt.value(Kt(e,Xt.apply(void 0,t)))},de=function(t){return pt.error(nt(t))},me=function(t,e){var n=ae(t);return n.errors.length>0?de(n.errors):fe(n.values,e)},ge=function(t,e){return t.length>0?Et.svalue(Kt(e,Xt.apply(void 0,t))):Et.svalue(e)},he=function(t){return o(Et.serror,nt)(t)},pe=function(t,e){var n=Et.partition(t);return n.errors.length>0?he(n.errors):ge(n.values,e)},ve=function(t){var e=Et.partition(t);return e.errors.length>0?he(e.errors):Et.svalue(e.values)},be={consolidateObj:pe,consolidateArr:ve},ye=function(t){return _(t)&&_t(t).length>100?" removed due to size":JSON.stringify(t,null,2)},we=function(t){var e=t.length>10?t.slice(0,10).concat([{path:[],getErrorInfo:function(){return"... (only showing first ten failures)"}}]):t;return $(e,(function(t){return"Failed path: ("+t.path.join(" > ")+")\n"+t.getErrorInfo()}))},xe=function(t,e){return Et.serror([{path:t,getErrorInfo:e}])},Ce=function(t,e,n){return xe(t,(function(){return'Could not find valid *strict* value for "'+e+'" in '+ye(n)}))},Se=function(t,e){return xe(t,(function(){return'Choice schema did not contain choice key: "'+e+'"'}))},ke=function(t,e,n){return xe(t,(function(){return'The chosen schema: "'+n+'" did not exist in branches: '+ye(e)}))},Oe=function(t,e){return xe(t,(function(){return"There are unsupported fields: ["+e.join(", ")+"] specified"}))},Te=function(t,e){return xe(t,(function(){return e}))},Ee=jt.generate([{field:["key","okey","presence","prop"]},{state:["okey","instantiator"]}]),_e=function(t,e,n){return Lt(e,n).fold((function(){return Ce(t,n,e)}),Et.svalue)},Ae=function(t,e,n){var r=Lt(t,e).fold((function(){return n(t)}),a);return Et.svalue(r)},De=function(t,e){return Et.svalue(Lt(t,e))},Ne=function(t,e,n){var r=Lt(t,e).map((function(e){return!0===e?n(t):e}));return Et.svalue(r)},Re=function(t,e,n,r){return n.fold((function(n,o,i,a){var c=function(e){var i=a.extract(t.concat([n]),r,e);return Et.map(i,(function(t){return ie(o,r(t))}))},s=function(e){return e.fold((function(){var t=ie(o,r(C.none()));return Et.svalue(t)}),(function(e){var i=a.extract(t.concat([n]),r,e);return Et.map(i,(function(t){return ie(o,r(C.some(t)))}))}))};return function(){return i.fold((function(){return Et.bind(_e(t,e,n),c)}),(function(t){return Et.bind(Ae(e,n,t),c)}),(function(){return Et.bind(De(e,n),s)}),(function(t){return Et.bind(Ne(e,n,t),s)}),(function(t){var r=t(e),o=Et.map(Ae(e,n,u({})),(function(t){return Kt(r,t)}));return Et.bind(o,c)}))}()}),(function(t,n){var o=n(e);return Et.svalue(ie(t,r(o)))}))},Me=function(t,e,n,r){var o=$(n,(function(n){return Re(t,e,n,r)}));return be.consolidateObj(o,{})},ze=function(t){var e=function(e,n,r){return t().extract(e,n,r)},n=function(){return t().toString()};return{extract:e,toString:n}},Be=function(t){var e=function(e,n,r){return Et.bindError(t(r,n),(function(t){return Te(e,t)}))},n=function(){return"val"};return{extract:e,toString:n}},Pe=function(t){return _t(Bt(t,(function(t){return void 0!==t&&null!==t})))},He=function(t){var e=Ie(t),n=J(t,(function(t,e){return e.fold((function(e){return Kt(t,se(e,!0))}),u(t))}),{}),r=function(t,r,o){var i=D(o)?[]:Pe(o),u=Y(i,(function(t){return!Vt(n,t)}));return 0===u.length?e.extract(t,r,o):Oe(t,u)};return{extract:r,toString:e.toString}},Ie=function(t){var e=function(e,n,r){return Me(e,r,t,n)},n=function(){var e=$(t,(function(t){return t.fold((function(t,e,n,r){return t+" -> "+r.toString()}),(function(t,e){return"state("+t+")"}))}));return"obj{\n"+e.join("\n")+"}"};return{extract:e,toString:n}},Le=function(t){var e=function(e,n,r){var o=$(r,(function(r,o){return t.extract(e.concat(["["+o+"]"]),n,r)}));return be.consolidateArr(o)},n=function(){return"array("+t.toString()+")"};return{extract:e,toString:n}},Fe=function(t){var e=function(e,n,r){for(var o=[],i=0,u=t;i<u.length;i++){var a=u[i],c=a.extract(e,n,r);if(c.stype===v.Value)return c;o.push(c)}return be.consolidateArr(o)},n=function(){return"oneOf("+$(t,(function(t){return t.toString()})).join(", ")+")"};return{extract:e,toString:n}},Ve=function(t,e){var n=function(e,n){return Le(Be(t)).extract(e,a,n)},r=function(t,r,o){var i=_t(o),u=n(t,i);return Et.bind(u,(function(n){var i=$(n,(function(t){return Ee.field(t,t,te(),e)}));return Ie(i).extract(t,r,o)}))},o=function(){return"setOf("+e.toString()+")"};return{extract:r,toString:o}},Ue=u(Be(Et.svalue)),je=o(Le,Ie),We=Ee.state,qe=Ee.field,$e=function(t,e,n,r,o){var i=Lt(r,o);return i.fold((function(){return ke(t,r,o)}),(function(r){return r.extract(t.concat(["branch: "+o]),e,n)}))},Ge=function(t,e){var n=function(n,r,o){var i=Lt(o,t);return i.fold((function(){return Se(n,t)}),(function(t){return $e(n,r,o,e,t)}))},r=function(){return"chooseOn("+t+"). Possible values: "+_t(e)};return{extract:n,toString:r}},Ke=Be(Et.svalue),Xe=function(t){return je(t)},Ye=function(){return Le(Ke)},Je=ze,Qe=function(t){return Be((function(e){return t(e).fold(Et.serror,Et.svalue)}))},Ze=function(t,e){return Ve((function(e){return Et.fromResult(t(e))}),e)},tn=function(t,e,n,r){var o=e.extract([t],n,r);return Et.mapError(o,(function(t){return{input:r,errors:t}}))},en=function(t,e,n){return Et.toResult(tn(t,e,a,n))},nn=function(t){return t.fold((function(t){throw new Error(on(t))}),a)},rn=function(t,e,n){return nn(en(t,e,n))},on=function(t){return"Errors: \n"+we(t.errors).join("\n")+"\n\nInput object: "+ye(t.input)},un=function(t,e){return Ge(t,e)},an=function(t,e){return Ge(t,Nt(e,Ie))},cn=u(Ke),sn=function(t,e){return Be((function(n){var r=typeof n;return t(n)?Et.svalue(n):Et.serror("Expected type: "+e+" but got: "+r)}))},ln=sn(B,"number"),fn=sn(E,"string"),dn=sn(D,"boolean"),mn=sn(z,"function"),gn=function(t){var e=function(t,e){var n=t.next();while(!n.done){if(!e(n.value))return!1;n=t.next()}return!0};if(Object(t)!==t)return!0;switch({}.toString.call(t).slice(8,-1)){case"Boolean":case"Number":case"String":case"Date":case"RegExp":case"Blob":case"FileList":case"ImageData":case"ImageBitmap":case"ArrayBuffer":return!0;case"Array":case"Object":return Object.keys(t).every((function(e){return gn(t[e])}));case"Map":return e(t.keys(),gn)&&e(t.values(),gn);case"Set":return e(t.keys(),gn);default:return!1}},hn=Be((function(t){return gn(t)?Et.svalue(t):Et.serror("Expected value to be acceptable for sending via postMessage")})),pn=function(t){return Qe((function(e){return U(t,e)?pt.value(e):pt.error('Unsupported value: "'+e+'", choose one of "'+t.join(", ")+'".')}))},vn=function(t){return qe(t,t,te(),Ue())},bn=function(t,e){return qe(t,t,te(),e)},yn=function(t){return bn(t,ln)},wn=function(t){return bn(t,fn)},xn=function(t,e){return qe(t,t,te(),pn(e))},Cn=function(t){return bn(t,dn)},Sn=function(t){return bn(t,mn)},kn=function(t,e){return qe(t,t,ee(),Be((function(n){return Et.serror("The field: "+t+" is forbidden. "+e)})))},On=function(t,e){return qe(t,t,te(),Ie(e))},Tn=function(t,e){return qe(t,t,te(),je(e))},En=function(t,e){return qe(t,t,te(),Le(e))},_n=function(t){return qe(t,t,ee(),Ue())},An=function(t,e){return qe(t,t,ee(),e)},Dn=function(t){return An(t,ln)},Nn=function(t){return An(t,fn)},Rn=function(t){return An(t,mn)},Mn=function(t,e){return An(t,Le(e))},zn=function(t,e){return An(t,Ie(e))},Bn=function(t,e){return An(t,He(e))},Pn=function(t,e){return qe(t,t,Qt(e),Ue())},Hn=function(t,e,n){return qe(t,t,Qt(e),n)},In=function(t,e){return Hn(t,e,ln)},Ln=function(t,e){return Hn(t,e,fn)},Fn=function(t,e,n){return Hn(t,e,pn(n))},Vn=function(t,e){return Hn(t,e,dn)},Un=function(t,e){return Hn(t,e,mn)},jn=function(t,e){return Hn(t,e,hn)},Wn=function(t,e,n){return Hn(t,e,Le(n))},qn=function(t,e,n){return Hn(t,e,Ie(n))},$n=function(t,e){return We(t,e)},Gn=function(t){var e=t,n=function(){return e},r=function(t){e=t};return{get:n,set:r}},Kn=function(t,n){var r=n||e.document,o=r.createElement("div");if(o.innerHTML=t,!o.hasChildNodes()||o.childNodes.length>1)throw e.console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return Jn(o.childNodes[0])},Xn=function(t,n){var r=n||e.document,o=r.createElement(t);return Jn(o)},Yn=function(t,n){var r=n||e.document,o=r.createTextNode(t);return Jn(o)},Jn=function(t){if(null===t||void 0===t)throw new Error("Node cannot be null or undefined");return{dom:u(t)}},Qn=function(t,e,n){var r=t.dom();return C.from(r.elementFromPoint(e,n)).map(Jn)},Zn={fromHtml:Kn,fromTag:Xn,fromText:Yn,fromDom:Jn,fromPoint:Qn},tr=function(t,e,n){return 0!==(t.compareDocumentPosition(e)&n)},er=function(t,n){return tr(t,n,e.Node.DOCUMENT_POSITION_CONTAINED_BY)},nr=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}},rr=function(t,e){var n=nr(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return ur(r(1),r(2))},or=function(t,e){var n=String(e).toLowerCase();return 0===t.length?ir():rr(t,n)},ir=function(){return ur(0,0)},ur=function(t,e){return{major:t,minor:e}},ar={nu:ur,detect:or,unknown:ir},cr="Edge",sr="Chrome",lr="IE",fr="Opera",dr="Firefox",mr="Safari",gr=function(){return hr({current:void 0,version:ar.unknown()})},hr=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r(cr),isChrome:r(sr),isIE:r(lr),isOpera:r(fr),isFirefox:r(dr),isSafari:r(mr)}},pr={unknown:gr,nu:hr,edge:u(cr),chrome:u(sr),ie:u(lr),opera:u(fr),firefox:u(dr),safari:u(mr)},vr="Windows",br="iOS",yr="Android",wr="Linux",xr="OSX",Cr="Solaris",Sr="FreeBSD",kr="ChromeOS",Or=function(){return Tr({current:void 0,version:ar.unknown()})},Tr=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r(vr),isiOS:r(br),isAndroid:r(yr),isOSX:r(xr),isLinux:r(wr),isSolaris:r(Cr),isFreeBSD:r(Sr),isChromeOS:r(kr)}},Er={unknown:Or,nu:Tr,windows:u(vr),ios:u(br),android:u(yr),linux:u(wr),osx:u(xr),solaris:u(Cr),freebsd:u(Sr),chromeos:u(kr)},_r=function(t,e,n,r){var o=t.isiOS()&&!0===/ipad/i.test(n),i=t.isiOS()&&!o,a=t.isiOS()||t.isAndroid(),c=a||r("(pointer:coarse)"),s=o||!i&&a&&r("(min-device-width:768px)"),l=i||a&&!s,f=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),d=!l&&!s&&!f;return{isiPad:u(o),isiPhone:u(i),isTablet:u(s),isPhone:u(l),isTouch:u(c),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:u(f),isDesktop:u(d)}},Ar=function(t,e){var n=String(e).toLowerCase();return tt(t,(function(t){return t.search(n)}))},Dr=function(t,e){return Ar(t,e).map((function(t){var n=ar.detect(t.versionRegexes,e);return{current:t.name,version:n}}))},Nr=function(t,e){return Ar(t,e).map((function(t){var n=ar.detect(t.versionRegexes,e);return{current:t.name,version:n}}))},Rr={detectBrowser:Dr,detectOs:Nr},Mr=function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e},zr=function(t,e){return-1!==t.indexOf(e)},Br=function(t,e){return Mr(t,e,t.length-e.length)},Pr=function(t){return function(e){return e.replace(t,"")}},Hr=Pr(/^\s+|\s+$/g),Ir=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Lr=function(t){return function(e){return zr(e,t)}},Fr=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return zr(t,"edge/")&&zr(t,"chrome")&&zr(t,"safari")&&zr(t,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Ir],search:function(t){return zr(t,"chrome")&&!zr(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return zr(t,"msie")||zr(t,"trident")}},{name:"Opera",versionRegexes:[Ir,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Lr("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Lr("firefox")},{name:"Safari",versionRegexes:[Ir,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(zr(t,"safari")||zr(t,"mobile/"))&&zr(t,"applewebkit")}}],Vr=[{name:"Windows",search:Lr("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return zr(t,"iphone")||zr(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Lr("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Lr("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Lr("linux"),versionRegexes:[]},{name:"Solaris",search:Lr("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Lr("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:Lr("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Ur={browsers:u(Fr),oses:u(Vr)},jr=function(t,e){var n=Ur.browsers(),r=Ur.oses(),o=Rr.detectBrowser(n,t).fold(pr.unknown,pr.nu),i=Rr.detectOs(r,t).fold(Er.unknown,Er.nu),u=_r(i,o,t,e);return{browser:o,os:i,deviceType:u}},Wr={detect:jr},qr=function(t){return e.window.matchMedia(t).matches},$r=Yt((function(){return Wr.detect(e.navigator.userAgent,qr)})),Gr=function(){return $r()},Kr=9,Xr=11,Yr=1,Jr=3,Qr=function(t,e){var n=t.dom();if(n.nodeType!==Yr)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},Zr=function(t){return t.nodeType!==Yr&&t.nodeType!==Kr&&t.nodeType!==Xr||0===t.childElementCount},to=function(t,n){var r=void 0===n?e.document:n.dom();return Zr(r)?[]:$(r.querySelectorAll(t),Zn.fromDom)},eo=function(t,n){var r=void 0===n?e.document:n.dom();return Zr(r)?C.none():C.from(r.querySelector(t)).map(Zn.fromDom)},no=function(t,e){return t.dom()===e.dom()},ro=function(t,e){var n=t.dom(),r=e.dom();return n!==r&&n.contains(r)},oo=function(t,e){return er(t.dom(),e.dom())},io=function(t,e){return Gr().browser.isIE()?oo(t,e):ro(t,e)},uo=function(t){return z(t)?t:u(!1)},ao=function(t,e,n){var r=t.dom(),o=uo(n);while(r.parentNode){r=r.parentNode;var i=Zn.fromDom(r),u=e(i);if(u.isSome())return u;if(o(i))break}return C.none()},co=function(t,e,n){var r=e(t),o=uo(n);return r.orThunk((function(){return o(t)?C.none():ao(t,e,o)}))},so=function(t,e){return no(t.element(),e.event().target())},lo=function(t){if(!Vt(t,"can")&&!Vt(t,"abort")&&!Vt(t,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(t,null,2)+" does not have can, abort, or run!");return rn("Extracting event.handler",He([Pn("can",u(!0)),Pn("abort",u(!1)),Pn("run",n)]),t)},fo=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return Q(t,(function(t,r){return t&&e(r).apply(void 0,n)}),!0)}},mo=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return Q(t,(function(t,r){return t||e(r).apply(void 0,n)}),!1)}},go=function(t){return z(t)?{can:u(!0),abort:u(!1),run:t}:t},ho=function(t){var e=fo(t,(function(t){return t.can})),n=mo(t,(function(t){return t.abort})),r=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];G(t,(function(t){t.run.apply(void 0,e)}))};return lo({can:e,abort:n,run:r})},po=u("touchstart"),vo=u("touchmove"),bo=u("touchend"),yo=u("touchcancel"),wo=u("mousedown"),xo=u("mousemove"),Co=u("mouseout"),So=u("mouseup"),ko=u("mouseover"),Oo=u("focusin"),To=u("focusout"),Eo=u("keydown"),_o=u("keyup"),Ao=u("input"),Do=u("change"),No=u("click"),Ro=u("transitionend"),Mo=u("selectstart"),zo={tap:u("alloy.tap")},Bo=u("alloy.focus"),Po=u("alloy.blur.post"),Ho=u("alloy.paste.post"),Io=u("alloy.receive"),Lo=u("alloy.execute"),Fo=u("alloy.focus.item"),Vo=zo.tap,Uo=u("alloy.longpress"),jo=u("alloy.sandbox.close"),Wo=u("alloy.typeahead.cancel"),qo=u("alloy.system.init"),$o=u("alloy.system.touchmove"),Go=u("alloy.system.touchend"),Ko=u("alloy.system.scroll"),Xo=u("alloy.system.resize"),Yo=u("alloy.system.attached"),Jo=u("alloy.system.detached"),Qo=u("alloy.system.dismissRequested"),Zo=u("alloy.system.repositionRequested"),ti=u("alloy.focusmanager.shifted"),ei=u("alloy.slotcontainer.visibility"),ni=u("alloy.change.tab"),ri=u("alloy.dismiss.tab"),oi=u("alloy.highlight"),ii=u("alloy.dehighlight"),ui=function(t,e){li(t,t.element(),e,{})},ai=function(t,e,n){li(t,t.element(),e,n)},ci=function(t){ui(t,Lo())},si=function(t,e,n){li(t,e,n,{})},li=function(t,e,n,r){var o=g({target:e},r);t.getSystem().triggerEvent(n,e,Nt(o,u))},fi=function(t,e,n,r){t.getSystem().triggerEvent(n,e,r.event())},di=function(t){return le(t)},mi=function(t,e){return{key:t,value:lo({abort:e})}},gi=function(t,e){return{key:t,value:lo({can:e})}},hi=function(t){return{key:t,value:lo({run:function(t,e){e.event().prevent()}})}},pi=function(t,e){return{key:t,value:lo({run:e})}},vi=function(t,e,n){return{key:t,value:lo({run:function(t,r){e.apply(void 0,[t,r].concat(n))}})}},bi=function(t){return function(e){return pi(t,e)}},yi=function(t){return function(e){return{key:t,value:lo({run:function(t,n){so(t,n)&&e(t,n)}})}}},wi=function(t,e){return pi(t,(function(n,r){n.getSystem().getByUid(e).each((function(e){fi(e,e.element(),t,r)}))}))},xi=function(t,e,n){var r=e.partUids[n];return wi(t,r)},Ci=function(t,e){return pi(t,(function(t,n){var r=n.event(),o=t.getSystem().getByDom(r.target()).fold((function(){var e=co(r.target(),(function(e){return t.getSystem().getByDom(e).toOption()}),u(!1));return e.getOr(t)}),(function(t){return t}));e(t,o,n)}))},Si=function(t){return pi(t,(function(t,e){e.cut()}))},ki=function(t){return pi(t,(function(t,e){e.stop()}))},Oi=function(t,e){return yi(t)(e)},Ti=yi(Yo()),Ei=yi(Jo()),_i=yi(qo()),Ai=bi(Lo()),Di=("undefined"!==typeof e.window?e.window:Function("return this;")(),function(t){var e=t.dom().nodeName;return e.toLowerCase()}),Ni=function(t){return t.dom().nodeType},Ri=function(t){return function(e){return Ni(e)===t}},Mi=Ri(Yr),zi=Ri(Jr),Bi=Ri(Kr),Pi=Ri(Xr),Hi=function(t){return Zn.fromDom(t.dom().ownerDocument)},Ii=function(t){return Bi(t)?t:Hi(t)},Li=function(t){return Zn.fromDom(t.dom().ownerDocument.documentElement)},Fi=function(t){return Zn.fromDom(t.dom().ownerDocument.defaultView)},Vi=function(t){return C.from(t.dom().parentNode).map(Zn.fromDom)},Ui=function(t){return C.from(t.dom().offsetParent).map(Zn.fromDom)},ji=function(t){return C.from(t.dom().nextSibling).map(Zn.fromDom)},Wi=function(t){return $(t.dom().childNodes,Zn.fromDom)},qi=function(t,e){var n=t.dom().childNodes;return C.from(n[e]).map(Zn.fromDom)},$i=function(t){return qi(t,0)},Gi=function(t,e){var n=Vi(t);n.each((function(n){n.dom().insertBefore(e.dom(),t.dom())}))},Ki=function(t,e){var n=ji(t);n.fold((function(){var n=Vi(t);n.each((function(t){Yi(t,e)}))}),(function(t){Gi(t,e)}))},Xi=function(t,e){var n=$i(t);n.fold((function(){Yi(t,e)}),(function(n){t.dom().insertBefore(e.dom(),n.dom())}))},Yi=function(t,e){t.dom().appendChild(e.dom())},Ji=function(t,e,n){qi(t,n).fold((function(){Yi(t,e)}),(function(t){Gi(t,e)}))},Qi=function(t,e){G(e,(function(e){Gi(t,e)}))},Zi=function(t,e){G(e,(function(e){Yi(t,e)}))},tu=function(t){t.dom().textContent="",G(Wi(t),(function(t){eu(t)}))},eu=function(t){var e=t.dom();null!==e.parentNode&&e.parentNode.removeChild(e)},nu=function(t){var e=Wi(t);e.length>0&&Qi(t,e),eu(t)},ru=function(t,n){var r=n||e.document,o=r.createElement("div");return o.innerHTML=t,Wi(Zn.fromDom(o))},ou=function(t){return t.dom().innerHTML},iu=function(t,e){var n=Hi(t),r=n.dom(),o=Zn.fromDom(r.createDocumentFragment()),i=ru(e,r);Zi(o,i),tu(t),Yi(t,o)},uu=function(t){var e=Zn.fromTag("div"),n=Zn.fromDom(t.dom().cloneNode(!0));return Yi(e,n),ou(e)},au=function(t,n,r){if(!(E(r)||D(r)||B(r)))throw e.console.error("Invalid call to Attr.set. Key ",n,":: Value ",r,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(n,r+"")},cu=function(t,e,n){au(t.dom(),e,n)},su=function(t,e){var n=t.dom();Dt(e,(function(t,e){au(n,e,t)}))},lu=function(t,e){var n=t.dom().getAttribute(e);return null===n?void 0:n},fu=function(t,e){return C.from(lu(t,e))},du=function(t,e){var n=t.dom();return!(!n||!n.hasAttribute)&&n.hasAttribute(e)},mu=function(t,e){t.dom().removeAttribute(e)},gu=function(t,e){return Zn.fromDom(t.dom().cloneNode(e))},hu=function(t){return gu(t,!1)},pu=function(t){var e=hu(t);return uu(e)},vu=function(t){return pu(t)},bu=function(t,e,n){return no(e,t.element())&&!no(e,n)},yu=di([gi(Bo(),(function(t,n){var r=n.event().originator(),o=n.event().target();return!bu(t,r,o)||(e.console.warn(Bo()+" did not get interpreted by the desired target. \nOriginator: "+vu(r)+"\nTarget: "+vu(o)+"\nCheck the "+Bo()+" event handlers"),!1)}))]),wu=Object.freeze({__proto__:null,events:yu}),xu=0,Cu=function(t){var e=new Date,n=e.getTime(),r=Math.floor(1e9*Math.random());return xu++,t+"_"+r+xu+String(n)},Su=u("alloy-id-"),ku=u("data-alloy-id"),Ou=Su(),Tu=ku(),Eu=function(t,e){var n=Cu(Ou+t);return _u(e,n),n},_u=function(t,e){Object.defineProperty(t.dom(),Tu,{value:e,writable:!0})},Au=function(t){var e=Mi(t)?t.dom()[Tu]:null;return C.from(e)},Du=function(t){return Cu(t)},Nu=a,Ru=function(t){var e=function(e){return function(){throw new Error("The component must be in a context to send: "+e+(t?"\n"+vu(t().element())+" is not in context.":""))}};return{debugInfo:u("fake"),triggerEvent:e("triggerEvent"),triggerFocus:e("triggerFocus"),triggerEscape:e("triggerEscape"),build:e("build"),addToWorld:e("addToWorld"),removeFromWorld:e("removeFromWorld"),addToGui:e("addToGui"),removeFromGui:e("removeFromGui"),getByUid:e("getByUid"),getByDom:e("getByDom"),broadcast:e("broadcast"),broadcastOn:e("broadcastOn"),broadcastEvent:e("broadcastEvent"),isConnected:u(!1)}},Mu=Ru(),zu=function(t,e,n){var r=n.toString(),o=r.indexOf(")")+1,i=r.indexOf("("),u=r.substring(i+1,o-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:e,parameters:Bu(u.slice(0,1).concat(u.slice(3)))}},t},Bu=function(t){return $(t,(function(t){return Br(t,"/*")?t.substring(0,t.length-"/*".length):t}))},Pu=function(t,e){var n=t.toString(),r=n.indexOf(")")+1,o=n.indexOf("("),i=n.substring(o+1,r-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:e,parameters:Bu(i)}},t},Hu=function(t,e){var n=e.toString(),r=n.indexOf(")")+1,o=n.indexOf("("),i=n.substring(o+1,r-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:Bu(i.slice(1))}},t},Iu=Cu("alloy-premade"),Lu=function(t){return se(Iu,t)},Fu=function(t){return Lt(t,Iu)},Vu=function(t){return Hu((function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return t.apply(void 0,p([e.getApis(),e],n))}),t)},Uu={init:function(){return ju({readState:function(){return"No State required"}})}},ju=function(t){return t},Wu=function(t,e){var n=$(e,(function(t){return zn(t.name(),[vn("config"),Pn("state",Uu)])})),r=en("component.behaviours",Ie(n),t.behaviours).fold((function(e){throw new Error(on(e)+"\nComplete spec:\n"+JSON.stringify(t,null,2))}),(function(t){return t}));return{list:e,data:Nt(r,(function(t){var e=t.map((function(t){return{config:t.config,state:t.state.init(t.config)}}));return function(){return e}}))}},qu=function(t){return t.list},$u=function(t){return t.data},Gu=function(t,e){var n={};return Dt(t,(function(t,r){Dt(t,(function(t,o){var i=Lt(n,o).getOr([]);n[o]=i.concat([e(r,t)])}))})),n},Ku=function(t){return{classes:void 0!==t.classes?t.classes:[],attributes:void 0!==t.attributes?t.attributes:{},styles:void 0!==t.styles?t.styles:{}}},Xu=function(t,e){return g(g({},t),{attributes:g(g({},t.attributes),e.attributes),styles:g(g({},t.styles),e.styles),classes:t.classes.concat(e.classes)})},Yu=function(t,e,n,r){var o=g({},e);G(n,(function(e){o[e.name()]=e.exhibit(t,r)}));var i=Gu(o,(function(t,e){return{name:t,modification:e}})),u=function(t){return J(t,(function(t,e){return g(g({},e.modification),t)}),{})},a=J(i.classes,(function(t,e){return e.modification.concat(t)}),[]),c=u(i.attributes),s=u(i.styles);return Ku({classes:a,attributes:c,styles:s})},Ju=function(t,e,n,r){try{var o=ct(n,(function(n,o){var i=n[e](),u=o[e](),a=r.indexOf(i),c=r.indexOf(u);if(-1===a)throw new Error("The ordering for "+t+" does not have an entry for "+i+".\nOrder specified: "+JSON.stringify(r,null,2));if(-1===c)throw new Error("The ordering for "+t+" does not have an entry for "+u+".\nOrder specified: "+JSON.stringify(r,null,2));return a<c?-1:c<a?1:0}));return pt.value(o)}catch(i){return pt.error([i])}},Qu=function(t,e){return{handler:t,purpose:u(e)}},Zu=function(t,e){return{cHandler:t,purpose:u(e)}},ta=function(t,e){return Zu(c.apply(void 0,[t.handler].concat(e)),t.purpose())},ea=function(t){return t.cHandler},na=function(t,e){return{name:u(t),handler:u(e)}},ra=function(t,e){var n={};return G(t,(function(t){n[t.name()]=t.handlers(e)})),n},oa=function(t,e,n){var r=g(g({},n),ra(e,t));return Gu(r,na)},ia=function(t,e,n,r){var o=oa(t,n,r);return sa(o,e)},ua=function(t){var e=go(t);return function(t,n){for(var r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];var i=[t,n].concat(r);e.abort.apply(void 0,i)?n.stop():e.can.apply(void 0,i)&&e.run.apply(void 0,i)}},aa=function(t,e){return pt.error(["The event ("+t+') has more than one behaviour that listens to it.\nWhen this occurs, you must specify an event ordering for the behaviours in your spec (e.g. [ "listing", "toggling" ]).\nThe behaviours that can trigger it are: '+JSON.stringify($(e,(function(t){return t.name()})),null,2)])},ca=function(t,e,n){var r=e[n];return r?Ju("Event: "+n,"name",t,r).map((function(t){var e=$(t,(function(t){return t.handler()}));return ho(e)})):aa(n,t)},sa=function(t,e){var n=Pt(t,(function(t,n){var r=1===t.length?pt.value(t[0].handler()):ca(t,e,n);return r.map((function(r){var o=ua(r),i=t.length>1?Y(e[n],(function(e){return j(t,(function(t){return t.name()===e}))})).join(" > "):t[0].name();return se(n,Qu(o,i))}))}));return me(n,{})},la=function(t){return en("custom.definition",Ie([qe("dom","dom",te(),Ie([vn("tag"),Pn("styles",{}),Pn("classes",[]),Pn("attributes",{}),_n("value"),_n("innerHtml")])),vn("components"),vn("uid"),Pn("events",{}),Pn("apis",{}),qe("eventOrder","eventOrder",Zt({"alloy.execute":["disabling","alloy.base.behaviour","toggling","typeaheadevents"],"alloy.focus":["alloy.base.behaviour","focusing","keying"],"alloy.system.init":["alloy.base.behaviour","disabling","toggling","representing"],input:["alloy.base.behaviour","representing","streaming","invalidating"],"alloy.system.detached":["alloy.base.behaviour","representing","item-events","tooltipping"],mousedown:["focusing","alloy.base.behaviour","item-type-events"],touchstart:["focusing","alloy.base.behaviour","item-type-events"],mouseover:["item-type-events","tooltipping"],"alloy.receive":["receiving","reflecting","tooltipping"]}),cn()),_n("domModification")]),t)},fa=function(t){return g(g({},t.dom),{uid:t.uid,domChildren:$(t.components,(function(t){return t.element()}))})},da=function(t){return t.domModification.fold((function(){return Ku({})}),Ku)},ma=function(t){return t.events},ga=function(t,e){var n=lu(t,e);return void 0===n||""===n?[]:n.split(" ")},ha=function(t,e,n){var r=ga(t,e),o=r.concat([n]);return cu(t,e,o.join(" ")),!0},pa=function(t,e,n){var r=Y(ga(t,e),(function(t){return t!==n}));return r.length>0?cu(t,e,r.join(" ")):mu(t,e),!1},va=function(t){return void 0!==t.dom().classList},ba=function(t){return ga(t,"class")},ya=function(t,e){return ha(t,"class",e)},wa=function(t,e){return pa(t,"class",e)},xa=function(t,e){va(t)?t.dom().classList.add(e):ya(t,e)},Ca=function(t){var e=va(t)?t.dom().classList:ba(t);0===e.length&&mu(t,"class")},Sa=function(t,e){if(va(t)){var n=t.dom().classList;n.remove(e)}else wa(t,e);Ca(t)},ka=function(t,e){return va(t)&&t.dom().classList.contains(e)},Oa=function(t,e){G(e,(function(e){xa(t,e)}))},Ta=function(t,e){G(e,(function(e){Sa(t,e)}))},Ea=function(t){return void 0!==t.style&&z(t.style.getPropertyValue)},_a=function(t){return Pi(t)},Aa=z(e.Element.prototype.attachShadow)&&z(e.Node.prototype.getRootNode),Da=u(Aa),Na=Aa?function(t){return Zn.fromDom(t.dom().getRootNode())}:Ii,Ra=function(t){return _a(t)?t:Zn.fromDom(Ii(t).dom().body)},Ma=function(t){var e=Na(t);return _a(e)?C.some(e):C.none()},za=function(t){return Zn.fromDom(t.dom().host)},Ba=function(t){if(Da()&&M(t.target)){var e=Zn.fromDom(t.target);if(Mi(e)&&Pa(Zn.fromDom(t.target))){var n=t;if(n.composed&&n.composedPath){var r=n.composedPath();if(r)return st(r)}}}return C.from(t.target)},Pa=function(t){return M(t.dom().shadowRoot)},Ha=function(t){var e=zi(t)?t.dom().parentNode:t.dom();return void 0!==e&&null!==e&&null!==e.ownerDocument&&Ma(Zn.fromDom(e)).fold((function(){return e.ownerDocument.body.contains(e)}),i(Ha,za))},Ia=function(){return La(Zn.fromDom(e.document))},La=function(t){var e=t.dom().body;if(null===e||void 0===e)throw new Error("Body is not available yet");return Zn.fromDom(e)},Fa=function(t,n,r){if(!E(r))throw e.console.error("Invalid call to CSS.set. Property ",n,":: Value ",r,":: Element ",t),new Error("CSS value must be a string: "+r);Ea(t)&&t.style.setProperty(n,r)},Va=function(t,e){Ea(t)&&t.style.removeProperty(e)},Ua=function(t,e,n){var r=t.dom();Fa(r,e,n)},ja=function(t,e){var n=t.dom();Dt(e,(function(t,e){Fa(n,e,t)}))},Wa=function(t,e){var n=t.dom();Dt(e,(function(t,e){t.fold((function(){Va(n,e)}),(function(t){Fa(n,e,t)}))}))},qa=function(t,n){var r=t.dom(),o=e.window.getComputedStyle(r),i=o.getPropertyValue(n);return""!==i||Ha(t)?i:$a(r,n)},$a=function(t,e){return Ea(t)?t.style.getPropertyValue(e):""},Ga=function(t,e){var n=t.dom(),r=$a(n,e);return C.from(r).filter((function(t){return t.length>0}))},Ka=function(t){var e={},n=t.dom();if(Ea(n))for(var r=0;r<n.style.length;r++){var o=n.style.item(r);e[o]=n.style[o]}return e},Xa=function(t,e,n){var r=Zn.fromTag(t);Ua(r,e,n);var o=Ga(r,e);return o.isSome()},Ya=function(t,e){var n=t.dom();Va(n,e),fu(t,"style").map(Hr).is("")&&mu(t,"style")},Ja=function(t){return t.dom().offsetWidth},Qa=function(t){return t.dom().value},Za=function(t,e){if(void 0===e)throw new Error("Value.set was undefined");t.dom().value=e},tc=function(t){var e=Zn.fromTag(t.tag);su(e,t.attributes),Oa(e,t.classes),ja(e,t.styles),t.innerHtml.each((function(t){return iu(e,t)}));var n=t.domChildren;return Zi(e,n),t.value.each((function(t){Za(e,t)})),t.uid,_u(e,t.uid),e},ec=function(t){var e=Lt(t,"behaviours").getOr({}),n=Y(_t(e),(function(t){return void 0!==e[t]}));return $(n,(function(t){return e[t].me}))},nc=function(t,e){return Wu(t,e)},rc=function(t){var e=ec(t);return nc(t,e)},oc=function(t,e,n){var r=fa(t),o=da(t),i={"alloy.base.modification":o},u=e.length>0?Yu(n,i,e,r):o;return Xu(r,u)},ic=function(t,e,n){var r={"alloy.base.behaviour":ma(t)};return ia(n,t.eventOrder,e,r).getOrDie()},uc=function(t){var e=function(){return y},n=Gn(Mu),r=nn(la(t)),o=rc(t),i=qu(o),a=$u(o),c=oc(r,i,a),s=tc(c),l=ic(r,i,a),f=Gn(r.components),d=function(t){n.set(t)},m=function(){n.set(Ru(e))},g=function(){var t=Wi(s),e=rt(t,(function(t){return n.get().getByDom(t).fold((function(){return[]}),(function(t){return[t]}))}));f.set(e)},h=function(e){var n=a,r=z(n[e.name()])?n[e.name()]:function(){throw new Error("Could not find "+e.name()+" in "+JSON.stringify(t,null,2))};return r()},p=function(t){return z(a[t.name()])},v=function(){return r.apis},b=function(t){return a[t]().map((function(t){return t.state.readState()})).getOr("not enabled")},y={getSystem:n.get,config:h,hasConfigured:p,spec:u(t),readState:b,getApis:v,connect:d,disconnect:m,element:u(s),syncComponents:g,components:f.get,events:u(l)};return y},ac=function(t){var e=Lt(t,"components").getOr([]);return $(e,dc)},cc=function(t){var e=Nu(t),n=e.events,r=h(e,["events"]),o=ac(r),i=g(g({},r),{events:g(g({},wu),n),components:o});return pt.value(uc(i))},sc=function(t){var e=Zn.fromText(t);return lc({element:e})},lc=function(t){var e=rn("external.component",He([vn("element"),_n("uid")]),t),r=Gn(Ru()),o=function(t){r.set(t)},i=function(){r.set(Ru((function(){return a})))};e.uid.each((function(t){_u(e.element,t)}));var a={getSystem:r.get,config:C.none,hasConfigured:u(!1),connect:o,disconnect:i,getApis:function(){return{}},element:u(e.element),spec:u(t),readState:u("No state"),syncComponents:n,components:u([]),events:u({})};return Lu(a)},fc=Du,dc=function(t){return Fu(t).fold((function(){var e=t.hasOwnProperty("uid")?t:g({uid:fc("")},t);return cc(e).getOrDie()}),(function(t){return t}))},mc=Lu;function gc(t,e){var n=function(e,n){if(!B(n)&&!n.match(/^[0-9]+$/))throw new Error(t+".set accepts only positive integer values. Value was "+n);var r=e.dom();Ea(r)&&(r.style[t]=n+"px")},r=function(n){var r=e(n);if(r<=0||null===r){var o=qa(n,t);return parseFloat(o)||0}return r},o=r,i=function(t,e){return Q(e,(function(e,n){var r=qa(t,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?e:e+o}),0)},u=function(t,e,n){var r=i(t,n),o=e>r?e-r:0;return o};return{set:n,get:r,getOuter:o,aggregate:i,max:u}}var hc=gc("height",(function(t){var e=t.dom();return Ha(t)?e.getBoundingClientRect().height:e.offsetHeight})),pc=function(t){return hc.get(t)},vc=function(t){return hc.getOuter(t)},bc=function(t,e){var n=["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"],r=hc.max(t,e,n);Ua(t,"max-height",r+"px")},yc=function(t,e){var n=function(n,r){return yc(t+n,e+r)};return{left:u(t),top:u(e),translate:n}},wc=yc,xc=function(t){var e=t.getBoundingClientRect();return wc(e.left,e.top)},Cc=function(t,e){return void 0!==t?t:void 0!==e?e:0},Sc=function(t){var e=t.dom().ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom())return wc(n.offsetLeft,n.offsetTop);var i=Cc(r.pageYOffset,o.scrollTop),u=Cc(r.pageXOffset,o.scrollLeft),a=Cc(o.clientTop,n.clientTop),c=Cc(o.clientLeft,n.clientLeft);return kc(t).translate(u-c,i-a)},kc=function(t){var e=t.dom(),n=e.ownerDocument,r=n.body;return r===e?wc(r.offsetLeft,r.offsetTop):Ha(t)?xc(e):wc(0,0)},Oc=gc("width",(function(t){return t.dom().offsetWidth})),Tc=function(t,e){return Oc.set(t,e)},Ec=function(t){return Oc.get(t)},_c=function(t){return Oc.getOuter(t)},Ac=function(t,e){var n=["margin-left","border-left-width","padding-left","padding-right","border-right-width","margin-right"],r=Oc.max(t,e,n);Ua(t,"max-width",r+"px")},Dc=function(t,e,n,r,o,i,a){return{target:u(t),x:u(e),y:u(n),stop:r,prevent:o,kill:i,raw:u(a)}},Nc=function(t){var e=Zn.fromDom(Ba(t).getOr(t.target)),n=function(){return t.stopPropagation()},r=function(){return t.preventDefault()},i=o(r,n);return Dc(e,t.clientX,t.clientY,n,r,i,t)},Rc=function(t,e){return function(n){t(n)&&e(Nc(n))}},Mc=function(t,e,n,r,o){var i=Rc(n,r);return t.dom().addEventListener(e,i,o),{unbind:c(Pc,t,e,i,o)}},zc=function(t,e,n,r){return Mc(t,e,n,r,!1)},Bc=function(t,e,n,r){return Mc(t,e,n,r,!0)},Pc=function(t,e,n,r){t.dom().removeEventListener(e,n,r)},Hc=function(t){var n=void 0!==t?t.dom():e.document,r=n.body.scrollLeft||n.documentElement.scrollLeft,o=n.body.scrollTop||n.documentElement.scrollTop;return wc(r,o)},Ic=function(t,n,r){var o=void 0!==r?r.dom():e.document,i=o.defaultView;i.scrollTo(t,n)},Lc=function(t){var n=void 0===t?e.window:t;return C.from(n["visualViewport"])},Fc=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},Vc=function(t){var n=void 0===t?e.window:t,r=n.document,o=Hc(Zn.fromDom(r));return Lc(n).fold((function(){var t=n.document.documentElement,e=t.clientWidth,r=t.clientHeight;return Fc(o.left(),o.top(),e,r)}),(function(t){return Fc(Math.max(t.pageLeft,o.left()),Math.max(t.pageTop,o.top()),t.width,t.height)}))},Uc=function(t,e){var n=t.view(e);return n.fold(u([]),(function(e){var n=t.owner(e),r=Uc(t,n);return[e].concat(r)}))},jc=function(t,e){var n=e.owner(t),r=Uc(e,n);return C.some(r)},Wc=function(t){var n=t.dom()===e.document?C.none():C.from(t.dom().defaultView.frameElement);return n.map(Zn.fromDom)},qc=function(t){return Hi(t)},$c=Object.freeze({__proto__:null,view:Wc,owner:qc}),Gc=function(t){var n=Zn.fromDom(e.document),r=Hc(n),o=jc(t,$c);return o.fold(c(Sc,t),(function(e){var n=kc(t),o=J(e,(function(t,e){var n=kc(e);return{left:t.left+n.left(),top:t.top+n.top()}}),{left:0,top:0});return wc(o.left+n.left()+r.left(),o.top+n.top()+r.top())}))},Kc=function(t,e,n){return{point:t,width:e,height:n}},Xc=function(t,e,n,r){return{x:t,y:e,width:n,height:r}},Yc=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},Jc=function(t){var e=Sc(t),n=_c(t),r=vc(t);return Yc(e.left(),e.top(),n,r)},Qc=function(t){var e=Gc(t),n=_c(t),r=vc(t);return Yc(e.left(),e.top(),n,r)},Zc=function(){return Vc(e.window)};function ts(t,e,n,r,o){return t(n,r)?C.some(n):z(o)&&o(n)?C.none():e(n,r,o)}var es,ns=function(t,e,n){var r=t.dom(),o=z(n)?n:u(!1);while(r.parentNode){r=r.parentNode;var i=Zn.fromDom(r);if(e(i))return C.some(i);if(o(i))break}return C.none()},rs=function(t,e,n){var r=function(t,e){return e(t)};return ts(r,ns,t,e,n)},os=function(t,e){var n=function(t){for(var r=0;r<t.childNodes.length;r++){var o=Zn.fromDom(t.childNodes[r]);if(e(o))return C.some(o);var i=n(t.childNodes[r]);if(i.isSome())return i}return C.none()};return n(t.dom())},is=function(t,e,n){return rs(t,e,n).isSome()},us=function(t,e,n){return ns(t,(function(t){return Qr(t,e)}),n)},as=function(t,e){return eo(e,t)},cs=function(t,e,n){var r=function(t,e){return Qr(t,e)};return ts(r,us,t,e,n)},ss=function(t){var e=rs(t,(function(t){if(!Mi(t))return!1;var e=lu(t,"id");return void 0!==e&&e.indexOf("aria-owns")>-1}));return e.bind((function(t){var e=lu(t,"id"),n=Hi(t);return as(n,'[aria-owns="'+e+'"]')}))},ls=function(){var t=Cu("aria-owns"),e=function(e){cu(e,"aria-owns",t)},n=function(t){mu(t,"aria-owns")};return{id:t,link:e,unlink:n}},fs=function(t,e){return ss(e).exists((function(e){return ds(t,e)}))},ds=function(t,e){return is(e,(function(e){return no(e,t.element())}),u(!1))||fs(t,e)},ms="unknown";(function(t){t[t["STOP"]=0]="STOP",t[t["NORMAL"]=1]="NORMAL",t[t["LOGGING"]=2]="LOGGING"})(es||(es={}));var gs,hs=Gn({}),ps=function(t,n){var r=[],o=(new Date).getTime();return{logEventCut:function(t,e,n){r.push({outcome:"cut",target:e,purpose:n})},logEventStopped:function(t,e,n){r.push({outcome:"stopped",target:e,purpose:n})},logNoParent:function(t,e,n){r.push({outcome:"no-parent",target:e,purpose:n})},logEventNoHandlers:function(t,e){r.push({outcome:"no-handlers-left",target:e})},logEventResponse:function(t,e,n){r.push({outcome:"response",purpose:n,target:e})},write:function(){var i=(new Date).getTime();U(["mousemove","mouseover","mouseout",qo()],t)||e.console.log(t,{event:t,time:i-o,target:n.dom(),sequence:$(r,(function(t){return U(["cut","stopped","response"],t.outcome)?"{"+t.purpose+"} "+t.outcome+" at ("+vu(t.target)+")":t.outcome}))})}}},vs=function(t,e,n){var r=Lt(hs.get(),t).orThunk((function(){var e=_t(hs.get());return dt(e,(function(e){return t.indexOf(e)>-1?C.some(hs.get()[e]):C.none()}))})).getOr(es.NORMAL);switch(r){case es.NORMAL:return n(Cs());case es.LOGGING:var o=ps(t,e),i=n(o);return o.write(),i;case es.STOP:return!0}},bs=["alloy/data/Fields","alloy/debugging/Debugging"],ys=function(){var t=new Error;if(void 0!==t.stack){var e=t.stack.split("\n");return tt(e,(function(t){return t.indexOf("alloy")>0&&!j(bs,(function(e){return t.indexOf(e)>-1}))})).getOr(ms)}return ms},ws={logEventCut:n,logEventStopped:n,logNoParent:n,logEventNoHandlers:n,logEventResponse:n,write:n},xs=function(t,e,n){return vs(t,e,n)},Cs=u(ws),Ss=u([vn("menu"),vn("selectedMenu")]),ks=u([vn("item"),vn("selectedItem")]),Os=(u(Ie(ks().concat(Ss()))),u(Ie(ks()))),Ts=On("initSize",[vn("numColumns"),vn("numRows")]),Es=function(){return bn("markers",Os())},_s=function(){return On("markers",[vn("backgroundMenu")].concat(Ss()).concat(ks()))},As=function(t){return On("markers",$(t,vn))},Ds=function(t,e,n){ys();return qe(e,e,n,Qe((function(t){return pt.value((function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.apply(void 0,e)}))})))},Ns=function(t){return Ds("onHandler",t,Qt(n))},Rs=function(t){return Ds("onKeyboardHandler",t,Qt(C.none))},Ms=function(t){return Ds("onHandler",t,te())},zs=function(t){return Ds("onKeyboardHandler",t,te())},Bs=function(t,e){return $n(t,u(e))},Ps=function(t){return $n(t,a)},Hs=u(Ts),Is=function(t,e,n,r,o,i){return{x:u(t),y:u(e),bubble:u(n),direction:u(r),boundsRestriction:u(o),label:u(i)}},Ls=jt.generate([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),Fs=function(t,e,n,r,o,i,u,a,c){return t.fold(e,n,r,o,i,u,a,c)},Vs=function(t,e,n,r){return t.fold(e,e,r,r,e,r,n,n)},Us=function(t,e,n,r){return t.fold(e,r,e,r,n,n,e,r)},js=Ls.southeast,Ws=Ls.southwest,qs=Ls.northeast,$s=Ls.northwest,Gs=Ls.south,Ks=Ls.north,Xs=Ls.east,Ys=Ls.west,Js=function(t,e){switch(e){case 1:return t.x;case 0:return t.x+t.width;case 2:return t.y;case 3:return t.y+t.height}},Qs=function(t,e){return at(["left","right","top","bottom"],(function(n){return Lt(e,n).map((function(e){return Js(t,e)}))}))},Zs=function(t,e,n){var r=function(t,r){var o="top"===t||"bottom"===t?n.top():n.left();return Lt(e,t).bind(a).bind((function(e){return"left"===t||"top"===t?e>=r?C.some(e):C.none():e<=r?C.some(e):C.none()})).map((function(t){return t+o})).getOr(r)},o=r("left",t.x),i=r("top",t.y),u=r("right",t.right),c=r("bottom",t.bottom);return Yc(o,i,u-o,c-i)},tl=function(t){return t.x},el=function(t,e){return t.x+t.width/2-e.width/2},nl=function(t,e){return t.x+t.width-e.width},rl=function(t,e){return t.y-e.height},ol=function(t){return t.y+t.height},il=function(t,e){return t.y+t.height/2-e.height/2},ul=function(t){return t.x+t.width},al=function(t,e){return t.x-e.width},cl=function(t,e,n){return Is(tl(t),ol(t),n.southeast(),js(),Qs(t,{left:1,top:3}),"layout-se")},sl=function(t,e,n){return Is(nl(t,e),ol(t),n.southwest(),Ws(),Qs(t,{right:0,top:3}),"layout-sw")},ll=function(t,e,n){return Is(tl(t),rl(t,e),n.northeast(),qs(),Qs(t,{left:1,bottom:2}),"layout-ne")},fl=function(t,e,n){return Is(nl(t,e),rl(t,e),n.northwest(),$s(),Qs(t,{right:0,bottom:2}),"layout-nw")},dl=function(t,e,n){return Is(el(t,e),rl(t,e),n.north(),Ks(),Qs(t,{bottom:2}),"layout-n")},ml=function(t,e,n){return Is(el(t,e),ol(t),n.south(),Gs(),Qs(t,{top:3}),"layout-s")},gl=function(t,e,n){return Is(ul(t),il(t,e),n.east(),Xs(),Qs(t,{left:0}),"layout-e")},hl=function(t,e,n){return Is(al(t,e),il(t,e),n.west(),Ys(),Qs(t,{right:1}),"layout-w")},pl=function(){return[cl,sl,ll,fl,ml,dl,gl,hl]},vl=function(){return[sl,cl,fl,ll,ml,dl,gl,hl]},bl=function(){return[ll,fl,cl,sl,dl,ml]},yl=function(){return[fl,ll,sl,cl,dl,ml]},wl=function(){return[cl,sl,ll,fl,ml,dl]},xl=function(){return[sl,cl,fl,ll,ml,dl]},Cl=function(t,e,n){return Ai((function(r){n(r,t,e)}))},Sl=function(t,e,n){return _i((function(r,o){n(r,t,e)}))},kl=function(t,e,n,r,o,i){var u=He(t),a=zn(e,[Bn("config",t)]);return _l(u,a,e,n,r,o,i)},Ol=function(t,e,n,r,o,i){var u=t,a=zn(e,[An("config",t)]);return _l(u,a,e,n,r,o,i)},Tl=function(t,e,n){var r=function(r){for(var o=[],i=1;i<arguments.length;i++)o[i-1]=arguments[i];var a=[r].concat(o);return r.config({name:u(t)}).fold((function(){throw new Error("We could not find any behaviour configuration for: "+t+". Using API: "+n)}),(function(t){var n=Array.prototype.slice.call(a,1);return e.apply(void 0,[r,t.config,t.state].concat(n))}))};return zu(r,n,e)},El=function(t){return{key:t,value:void 0}},_l=function(t,e,n,r,o,i,u){var a=function(t){return Vt(t,n)?t[n]():C.none()},s=Nt(o,(function(t,e){return Tl(n,t,e)})),l=Nt(i,(function(t,e){return Pu(t,e)})),f=g(g(g({},l),s),{revoke:c(El,n),config:function(e){var r=rn(n+"-config",t,e);return{key:n,value:{config:r,me:f,configAsRaw:Yt((function(){return rn(n+"-config",t,e)})),initialConfig:e,state:u}}},schema:function(){return e},exhibit:function(t,e){return a(t).bind((function(t){return Lt(r,"exhibit").map((function(n){return n(e,t.config,t.state)}))})).getOr(Ku({}))},name:function(){return n},handlers:function(t){return a(t).map((function(t){var e=Lt(r,"events").getOr((function(){return{}}));return e(t.config,t.state)})).getOr({})}});return f},Al=function(t){return le(t)},Dl=He([vn("fields"),vn("name"),Pn("active",{}),Pn("apis",{}),Pn("state",Uu),Pn("extra",{})]),Nl=function(t){var e=rn("Creating behaviour: "+t.name,Dl,t);return kl(e.fields,e.name,e.active,e.apis,e.extra,e.state)},Rl=He([vn("branchKey"),vn("branches"),vn("name"),Pn("active",{}),Pn("apis",{}),Pn("state",Uu),Pn("extra",{})]),Ml=function(t){var e=rn("Creating behaviour: "+t.name,Rl,t);return Ol(an(e.branchKey,e.branches),e.name,e.active,e.apis,e.extra,e.state)},zl=u(void 0),Bl=function(t,e){return e.universal()?t:Y(t,(function(t){return U(e.channels(),t)}))},Pl=function(t){return di([pi(Io(),(function(e,n){var r=t.channels,o=_t(r),i=n,u=Bl(o,i);G(u,(function(t){var n=r[t],o=n.schema,u=rn("channel["+t+"] data\nReceiver: "+vu(e.element()),o,i.data());n.onReceive(e,u)}))}))])},Hl=Object.freeze({__proto__:null,events:Pl}),Il=[bn("channels",Ze(pt.value,He([Ms("onReceive"),Pn("schema",cn())])))],Ll=Nl({fields:Il,name:"receiving",active:Hl}),Fl=function(t,e){return Ku({classes:[],styles:e.useFixed()?{}:{position:"relative"}})},Vl=Object.freeze({__proto__:null,exhibit:Fl}),Ul=function(){return Zn.fromDom(e.document)},jl=function(t){return t.dom().focus()},Wl=function(t){return t.dom().blur()},ql=function(t){var e=Na(t).dom();return t.dom()===e.activeElement},$l=function(t){return void 0===t&&(t=Ul()),C.from(t.dom().activeElement).map(Zn.fromDom)},Gl=function(t){return $l(Na(t)).filter((function(e){return t.dom().contains(e.dom())}))},Kl=function(t,e){var r=Hi(e),o=$l(r).bind((function(t){var n=function(e){return no(t,e)};return n(e)?C.some(e):os(e,n)})),i=t(e);return o.each((function(t){$l(r).filter((function(e){return no(e,t)})).fold((function(){jl(t)}),n)})),i},Xl=function(t,e,n,r,o){return{position:u(t),left:u(e),top:u(n),right:u(r),bottom:u(o)}},Yl=function(t,e){var n=function(t){return t+"px"};Wa(t,{position:C.some(e.position()),left:e.left().map(n),top:e.top().map(n),right:e.right().map(n),bottom:e.bottom().map(n)})},Jl=jt.generate([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),Ql=function(t,e,n,r,o,i){var u=e.x-n,a=e.y-r,c=e.width,s=e.height,l=o-(u+c),f=i-(a+s),d=C.some(u),m=C.some(a),g=C.some(l),h=C.some(f),p=C.none();return Fs(e.direction,(function(){return Xl(t,d,m,p,p)}),(function(){return Xl(t,p,m,g,p)}),(function(){return Xl(t,d,p,p,h)}),(function(){return Xl(t,p,p,g,h)}),(function(){return Xl(t,d,m,p,p)}),(function(){return Xl(t,d,p,p,h)}),(function(){return Xl(t,d,m,p,p)}),(function(){return Xl(t,p,m,g,p)}))},Zl=function(t,e){return t.fold((function(){return Xl("absolute",C.some(e.x),C.some(e.y),C.none(),C.none())}),(function(t,n,r,o){return Ql("absolute",e,t,n,r,o)}),(function(t,n,r,o){return Ql("fixed",e,t,n,r,o)}))},tf=function(t,e){var n=c(Gc,e),r=t.fold(n,n,(function(){var t=Hc();return Gc(e).translate(-t.left(),-t.top())})),o=_c(e),i=vc(e);return Yc(r.left(),r.top(),o,i)},ef=function(t,e){return e.fold((function(){return t.fold(Zc,Zc,Yc)}),(function(e){return t.fold(e,e,(function(){var n=e(),r=nf(t,n.x,n.y);return Yc(r.left(),r.top(),n.width,n.height)}))}))},nf=function(t,e,n){var r=wc(e,n),o=function(){var t=Hc();return r.translate(-t.left(),-t.top())};return t.fold(u(r),u(r),o)},rf=function(t,e,n,r){return t.fold(e,n,r)},of=(Jl.none,Jl.relative),uf=Jl.fixed,af=function(t,e){return{anchorBox:u(t),origin:u(e)}},cf=function(t,e){return af(t,e)},sf=function(t,e,n,r){var o=t+e;return o>r?n:o<n?r:o},lf=function(t,e,n){return Math.min(Math.max(t,e),n)},ff=jt.generate([{fit:["reposition"]},{nofit:["reposition","deltaW","deltaH"]}]),df=function(t,e,n,r,o){var i=o.x,u=o.y,a=o.width,c=o.height,s=t>=i,l=e>=u,f=s&&l,d=t+n<=i+a,m=e+r<=u+c,g=d&&m,h=Math.abs(Math.min(n,s?i+a-t:i-(t+n))),p=Math.abs(Math.min(r,l?u+c-e:u-(e+r))),v=Math.max(o.x,o.right-n),b=Math.max(o.y,o.bottom-r),y=lf(t,o.x,v),w=lf(e,o.y,b);return{originInBounds:f,sizeInBounds:g,limitX:y,limitY:w,deltaW:h,deltaH:p}},mf=function(t,e,n,r){var o=t.x(),i=t.y(),a=t.bubble().offset(),c=a.left(),s=a.top(),l=Zs(r,t.boundsRestriction(),a),f=l.y,d=l.bottom,m=l.x,g=l.right,h=o+c,p=i+s,v=df(h,p,e,n,l),b=v.originInBounds,y=v.sizeInBounds,w=v.limitX,x=v.limitY,C=v.deltaW,S=v.deltaH,k=u(x+S-f),O=u(d-x),T=Vs(t.direction(),O,O,k),E=u(w+C-m),_=u(g-w),A=Us(t.direction(),_,_,E),D={x:w,y:x,width:C,height:S,maxHeight:T,maxWidth:A,direction:t.direction(),classes:{on:t.bubble().classesOn(),off:t.bubble().classesOff()},label:t.label(),candidateYforTest:p};return b&&y?ff.fit(D):ff.nofit(D,C,S)},gf=function(t,e,n,r,o){var i=n.width,u=n.height,s=function(t,a,c,s){var l=t(e,n,r),f=mf(l,i,u,o);return f.fold(ff.fit,(function(t,e,n){var r=n>s||e>c;return r?ff.nofit(t,e,n):ff.nofit(a,c,s)}))},l=Q(t,(function(t,e){var n=c(s,e);return t.fold(ff.fit,n)}),ff.nofit({x:e.x,y:e.y,width:n.width,height:n.height,maxHeight:n.height,maxWidth:n.width,direction:js(),classes:{on:[],off:[]},label:"none",candidateYforTest:e.y},-1,-1));return l.fold(a,a)},hf=function(t){return{width:_c(t),height:vc(t)}},pf=function(t,e,n,r){Ya(e,"max-height"),Ya(e,"max-width");var o=hf(e);return gf(r.preference,t,o,n,r.bounds)},vf=function(t,e){var n=e.classes;Ta(t,n.off),Oa(t,n.on)},bf=function(t,e,n){var r=n.maxHeightFunction;r(t,e.maxHeight)},yf=function(t,e,n){var r=n.maxWidthFunction;r(t,e.maxWidth)},wf=function(t,e,n){Yl(t,Zl(n.origin,e))},xf=function(t,e){bc(t,Math.floor(e))},Cf=u((function(t,e){xf(t,e),ja(t,{"overflow-x":"hidden","overflow-y":"auto"})})),Sf=u((function(t,e){xf(t,e)})),kf=function(t,e,n){return void 0===t[e]?n:t[e]},Of=function(t,e,r,o,i,u){var a=kf(u,"maxHeightFunction",Cf()),c=kf(u,"maxWidthFunction",n),s=t.anchorBox(),l=t.origin(),f={bounds:ef(l,i),origin:l,preference:o,maxHeightFunction:a,maxWidthFunction:c};Tf(s,e,r,f)},Tf=function(t,e,n,r){var o=pf(t,e,n,r);wf(e,o,r),vf(e,o),bf(e,o,r),yf(e,o,r)},Ef=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right"],_f=function(t,e,n){var r=function(t){return Lt(n,t).getOr([])},o=function(t,e,n){var o=ut(Ef,n);return{offset:function(){return wc(t,e)},classesOn:function(){return rt(n,r)},classesOff:function(){return rt(o,r)}}};return{southeast:function(){return o(-t,e,["top","alignLeft"])},southwest:function(){return o(t,e,["top","alignRight"])},south:function(){return o(-t/2,e,["top","alignCentre"])},northeast:function(){return o(-t,-e,["bottom","alignLeft"])},northwest:function(){return o(t,-e,["bottom","alignRight"])},north:function(){return o(-t/2,-e,["bottom","alignCentre"])},east:function(){return o(t,-e/2,["valignCentre","left"])},west:function(){return o(-t,-e/2,["valignCentre","right"])},innerNorthwest:function(){return o(-t,e,["top","alignRight"])},innerNortheast:function(){return o(t,e,["top","alignLeft"])},innerNorth:function(){return o(-t/2,e,["top","alignCentre"])},innerSouthwest:function(){return o(-t,-e,["bottom","alignRight"])},innerSoutheast:function(){return o(t,-e,["bottom","alignLeft"])},innerSouth:function(){return o(-t/2,-e,["bottom","alignCentre"])},innerWest:function(){return o(t,-e/2,["valignCentre","right"])},innerEast:function(){return o(-t,-e/2,["valignCentre","left"])}}},Af=function(){return _f(0,0,{})},Df=function(t){return t},Nf=function(t,e){return function(n){return"rtl"===Rf(n)?e:t}},Rf=function(t){return"rtl"===qa(t,"direction")?"rtl":"ltr"};(function(t){t["TopToBottom"]="toptobottom",t["BottomToTop"]="bottomtotop"})(gs||(gs={}));var Mf="data-alloy-vertical-dir",zf=function(t){return is(t,(function(t){return Mi(t)&&lu(t,Mf)===gs.BottomToTop}))},Bf=function(){return zn("layouts",[vn("onLtr"),vn("onRtl"),_n("onBottomLtr"),_n("onBottomRtl")])},Pf=function(t,e,n,r,o,i,u){var a=u.map(zf).getOr(!1),c=e.layouts.map((function(e){return e.onLtr(t)})),s=e.layouts.map((function(e){return e.onRtl(t)})),l=a?e.layouts.bind((function(e){return e.onBottomLtr.map((function(e){return e(t)}))})).or(c).getOr(o):c.getOr(n),f=a?e.layouts.bind((function(e){return e.onBottomRtl.map((function(e){return e(t)}))})).or(s).getOr(i):s.getOr(r),d=Nf(l,f);return d(t)},Hf=function(t,e,n){var r=e.hotspot,o=tf(n,r.element()),i=Pf(t.element(),e,wl(),xl(),bl(),yl(),C.some(e.hotspot.element()));return C.some(Df({anchorBox:o,bubble:e.bubble.getOr(Af()),overrides:e.overrides,layouts:i,placer:C.none()}))},If=[vn("hotspot"),_n("bubble"),Pn("overrides",{}),Bf(),Bs("placement",Hf)],Lf=function(t,e,n){var r=nf(n,e.x,e.y),o=Yc(r.left(),r.top(),e.width,e.height),i=Pf(t.element(),e,pl(),vl(),pl(),vl(),C.none());return C.some(Df({anchorBox:o,bubble:e.bubble,overrides:e.overrides,layouts:i,placer:C.none()}))},Ff=[vn("x"),vn("y"),Pn("height",0),Pn("width",0),Pn("bubble",Af()),Pn("overrides",{}),Bf(),Bs("placement",Lf)],Vf="\ufeff",Uf=" ",jf=function(t,e,n,r){return{start:u(t),soffset:u(e),finish:u(n),foffset:u(r)}},Wf={create:jf},qf=jt.generate([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),$f=function(t,e,n,r){return t.fold(e,n,r)},Gf=function(t){return t.fold(a,a,a)},Kf=qf.before,Xf=qf.on,Yf=qf.after,Jf={before:Kf,on:Xf,after:Yf,cata:$f,getStart:Gf},Qf=jt.generate([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Zf=function(t){return Qf.exact(t.start(),t.soffset(),t.finish(),t.foffset())},td=function(t){return t.match({domRange:function(t){return Zn.fromDom(t.startContainer)},relative:function(t,e){return Jf.getStart(t)},exact:function(t,e,n,r){return t}})},ed=Qf.domRange,nd=Qf.relative,rd=Qf.exact,od=function(t){var e=td(t);return Fi(e)},id=Wf.create,ud={domRange:ed,relative:nd,exact:rd,exactFromRange:Zf,getWin:od,range:id},ad=function(t,e){e.fold((function(e){t.setStartBefore(e.dom())}),(function(e,n){t.setStart(e.dom(),n)}),(function(e){t.setStartAfter(e.dom())}))},cd=function(t,e){e.fold((function(e){t.setEndBefore(e.dom())}),(function(e,n){t.setEnd(e.dom(),n)}),(function(e){t.setEndAfter(e.dom())}))},sd=function(t,e,n){var r=t.document.createRange();return ad(r,e),cd(r,n),r},ld=function(t,e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom(),n),i.setEnd(r.dom(),o),i},fd=function(t){return{left:u(t.left),top:u(t.top),right:u(t.right),bottom:u(t.bottom),width:u(t.width),height:u(t.height)}},dd=function(t){var e=t.getClientRects(),n=e.length>0?e[0]:t.getBoundingClientRect();return n.width>0||n.height>0?C.some(n).map(fd):C.none()},md=jt.generate([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),gd=function(t,e,n){return e(Zn.fromDom(n.startContainer),n.startOffset,Zn.fromDom(n.endContainer),n.endOffset)},hd=function(t,e){return e.match({domRange:function(t){return{ltr:u(t),rtl:C.none}},relative:function(e,n){return{ltr:Yt((function(){return sd(t,e,n)})),rtl:Yt((function(){return C.some(sd(t,n,e))}))}},exact:function(e,n,r,o){return{ltr:Yt((function(){return ld(t,e,n,r,o)})),rtl:Yt((function(){return C.some(ld(t,r,o,e,n))}))}}})},pd=function(t,e){var n=e.ltr();if(n.collapsed){var r=e.rtl().filter((function(t){return!1===t.collapsed}));return r.map((function(t){return md.rtl(Zn.fromDom(t.endContainer),t.endOffset,Zn.fromDom(t.startContainer),t.startOffset)})).getOrThunk((function(){return gd(t,md.ltr,n)}))}return gd(t,md.ltr,n)},vd=function(t,e){var n=hd(t,e);return pd(t,n)},bd=function(t,e){var n=vd(t,e);return n.match({ltr:function(e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom(),n),i.setEnd(r.dom(),o),i},rtl:function(e,n,r,o){var i=t.document.createRange();return i.setStart(r.dom(),o),i.setEnd(e.dom(),n),i}})};md.ltr,md.rtl;function yd(t,e){var n=function(n){if(!t(n))throw new Error("Can only get "+e+" value of a "+e+" node");return r(n).getOr("")},r=function(e){return t(e)?C.from(e.dom().nodeValue):C.none()},o=function(n,r){if(!t(n))throw new Error("Can only set raw "+e+" value of a "+e+" node");n.dom().nodeValue=r};return{get:n,getOption:r,set:o}}var wd=yd(zi,"text"),xd=function(t){return wd.get(t)},Cd=function(t){return wd.getOption(t)},Sd=function(t){return"img"===Di(t)?1:Cd(t).fold((function(){return Wi(t).length}),(function(t){return t.length}))},kd=function(t){return Cd(t).filter((function(t){return 0!==t.trim().length||t.indexOf(Uf)>-1})).isSome()},Od=["img","br"],Td=function(t){var e=kd(t);return e||U(Od,Di(t))},Ed=function(t){return _d(t,Td)},_d=function(t,e){var n=function(t){for(var r=Wi(t),o=r.length-1;o>=0;o--){var i=r[o];if(e(i))return C.some(i);var u=n(i);if(u.isSome())return u}return C.none()};return n(t)},Ad=function(t,e){return to(e,t)},Dd=function(t,e,n,r){var o=Hi(t),i=o.dom().createRange();return i.setStart(t.dom(),e),i.setEnd(n.dom(),r),i},Nd=function(t,e,n,r){var o=Dd(t,e,n,r),i=no(t,n)&&e===r;return o.collapsed&&!i},Rd=function(t){if(t.rangeCount>0){var e=t.getRangeAt(0),n=t.getRangeAt(t.rangeCount-1);return C.some(Wf.create(Zn.fromDom(e.startContainer),e.startOffset,Zn.fromDom(n.endContainer),n.endOffset))}return C.none()},Md=function(t){var e=Zn.fromDom(t.anchorNode),n=Zn.fromDom(t.focusNode);return Nd(e,t.anchorOffset,n,t.focusOffset)?C.some(Wf.create(e,t.anchorOffset,n,t.focusOffset)):Rd(t)},zd=function(t){return C.from(t.getSelection()).filter((function(t){return t.rangeCount>0})).bind(Md)},Bd=function(t,e){var n=bd(t,e);return dd(n)},Pd=function(t,e){return{element:t,offset:e}},Hd=function(t,e){var n=Wi(t);if(0===n.length)return Pd(t,e);if(e<n.length)return Pd(n[e],0);var r=n[n.length-1],o=zi(r)?xd(r).length:Wi(r).length;return Pd(r,o)},Id=jt.generate([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),Ld=function(t){return t.fold(a,(function(t,e,n){return t.translate(-e,-n)}))},Fd=function(t){return t.fold(a,a)},Vd=function(t){return Q(t,(function(t,e){return t.translate(e.left(),e.top())}),wc(0,0))},Ud=function(t){var e=$(t,Ld);return Vd(e)},jd=function(t){var e=$(t,Fd);return Vd(e)},Wd=Id.screen,qd=Id.absolute,$d=function(t,e,n){var r=Fi(n.root).dom(),o=function(e){var n=Hi(e),r=Hi(t.element());return no(n,r)};return C.from(r.frameElement).map(Zn.fromDom).filter(o).map(Sc)},Gd=function(t,e,n){var r=Hi(t.element()),o=Hc(r),i=$d(t,e,n).getOr(o);return qd(i,o.left(),o.top())},Kd=function(t,e,n,r){var o=t,i=e,u=n,a=r;t<0&&(o=0,u=n+t),e<0&&(i=0,a=r+e);var c=Wd(wc(o,i));return C.some(Kc(c,u,a))},Xd=function(t,e,n,r,o){return t.map((function(t){var i=[e,t.point],u=rf(r,(function(){return jd(i)}),(function(){return jd(i)}),(function(){return Ud(i)})),a=Xc(u.left(),u.top(),t.width,t.height),c=n.showAbove?bl():wl(),s=(n.showAbove,xl()),l=Pf(o,n,c,s,c,s,C.none());return Df({anchorBox:a,bubble:n.bubble.getOr(Af()),overrides:n.overrides,layouts:l,placer:C.none()})}))},Yd=function(t,e){return{element:t,offset:e}},Jd=function(t,e){return zi(t)?Yd(t,e):Hd(t,e)},Qd=function(t,e){var n=e.getSelection.getOrThunk((function(){return function(){return zd(t)}}));return n().map((function(t){var e=Jd(t.start(),t.soffset()),n=Jd(t.finish(),t.foffset());return ud.range(e.element,e.offset,n.element,n.offset)}))},Zd=function(t,e,n){var r=Fi(e.root).dom(),o=Gd(t,n,e),i=Qd(r,e).bind((function(t){var e=Bd(r,ud.exactFromRange(t)).orThunk((function(){var e=Zn.fromText(Vf);return Gi(t.start(),e),Bd(r,ud.exact(e,0,e,1)).map((function(t){return eu(e),t}))}));return e.bind((function(t){return Kd(t.left(),t.top(),t.width(),t.height())}))})),u=Qd(r,e).bind((function(t){return Mi(t.start())?C.some(t.start()):Vi(t.start())})),a=u.getOr(t.element());return Xd(i,o,e,n,a)},tm=[_n("getSelection"),vn("root"),_n("bubble"),Bf(),Pn("overrides",{}),Pn("showAbove",!1),Bs("placement",Zd)],em=function(t,e,n){var r=Gd(t,n,e);return e.node.bind((function(o){var i=o.dom().getBoundingClientRect(),u=Kd(i.left,i.top,i.width,i.height),a=e.node.getOr(t.element());return Xd(u,r,e,n,a)}))},nm=[vn("node"),vn("root"),_n("bubble"),Bf(),Pn("overrides",{}),Pn("showAbove",!1),Bs("placement",em)],rm=function(t){return t.x+t.width},om=function(t,e){return t.x-e.width},im=function(t,e){return t.y-e.height+t.height},um=function(t){return t.y},am=function(t,e,n){return Is(rm(t),um(t),n.southeast(),js(),Qs(t,{left:0,top:2}),"link-layout-se")},cm=function(t,e,n){return Is(om(t,e),um(t),n.southwest(),Ws(),Qs(t,{right:1,top:2}),"link-layout-sw")},sm=function(t,e,n){return Is(rm(t),im(t,e),n.northeast(),qs(),Qs(t,{left:0,bottom:3}),"link-layout-ne")},lm=function(t,e,n){return Is(om(t,e),im(t,e),n.northwest(),$s(),Qs(t,{right:1,bottom:3}),"link-layout-nw")},fm=function(){return[am,cm,sm,lm]},dm=function(){return[cm,am,lm,sm]},mm=function(t,e,n){var r=tf(n,e.item.element()),o=Pf(t.element(),e,fm(),dm(),fm(),dm(),C.none());return C.some(Df({anchorBox:r,bubble:Af(),overrides:e.overrides,layouts:o,placer:C.none()}))},gm=[vn("item"),Bf(),Pn("overrides",{}),Bs("placement",mm)],hm=an("anchor",{selection:tm,node:nm,hotspot:If,submenu:gm,makeshift:Ff}),pm=function(){var t=e.document.documentElement;return uf(0,0,t.clientWidth,t.clientHeight)},vm=function(t){var e=Sc(t.element()),n=t.element().dom().getBoundingClientRect();return of(e.left(),e.top(),n.width,n.height)},bm=function(t,e,n,r,o){var i=cf(n.anchorBox,e);Of(i,o.element(),n.bubble,n.layouts,r,n.overrides)},ym=function(t,e,n,r,o){wm(t,e,n,r,o,C.none())},wm=function(t,e,n,r,o,i){var u=i.map(Jc);return xm(t,e,n,r,o,u)},xm=function(t,e,n,r,o,i){var a=rn("positioning anchor.info",hm,r);Kl((function(){Ua(o.element(),"position","fixed");var n=Ga(o.element(),"visibility");Ua(o.element(),"visibility","hidden");var r=e.useFixed()?pm():vm(t),c=a.placement,s=i.map(u).or(e.getBounds);c(t,a,r).each((function(e){var n=e.placer.getOr(bm);n(t,r,e,s,o)})),n.fold((function(){Ya(o.element(),"visibility")}),(function(t){Ua(o.element(),"visibility",t)})),Ga(o.element(),"left").isNone()&&Ga(o.element(),"top").isNone()&&Ga(o.element(),"right").isNone()&&Ga(o.element(),"bottom").isNone()&&Ga(o.element(),"position").is("fixed")&&Ya(o.element(),"position")}),o.element())},Cm=function(t,e,n){return e.useFixed()?"fixed":"absolute"},Sm=Object.freeze({__proto__:null,position:ym,positionWithin:wm,positionWithinBounds:xm,getMode:Cm}),km=[Pn("useFixed",f),_n("getBounds")],Om=Nl({fields:km,name:"positioning",active:Vl,apis:Sm}),Tm=function(t){ui(t,Jo());var e=t.components();G(e,Tm)},Em=function(t){var e=t.components();G(e,Em),ui(t,Yo())},_m=function(t,e){Yi(t.element(),e.element())},Am=function(t){G(t.components(),(function(t){return eu(t.element())})),tu(t.element()),t.syncComponents()},Dm=function(t,e){var n=t.components();Am(t);var r=ut(n,e);G(r,(function(e){Tm(e),t.getSystem().removeFromWorld(e)})),G(e,(function(e){e.getSystem().isConnected()?_m(t,e):(t.getSystem().addToWorld(e),_m(t,e),Ha(t.element())&&Em(e)),t.syncComponents()}))},Nm=function(t,e){Rm(t,e,Yi)},Rm=function(t,e,n){t.getSystem().addToWorld(e),n(t.element(),e.element()),Ha(t.element())&&Em(e),t.syncComponents()},Mm=function(t){Tm(t),eu(t.element()),t.getSystem().removeFromWorld(t)},zm=function(t){var e=Vi(t.element()).bind((function(e){return t.getSystem().getByDom(e).toOption()}));Mm(t),e.each((function(t){t.syncComponents()}))},Bm=function(t){var e=t.components();G(e,Mm),tu(t.element()),t.syncComponents()},Pm=function(t,e){Im(t,e,Yi)},Hm=function(t,e){Im(t,e,Ki)},Im=function(t,e,n){n(t,e.element());var r=Wi(e.element());G(r,(function(t){e.getByDom(t).each(Em)}))},Lm=function(t){var e=Wi(t.element());G(e,(function(e){t.getByDom(e).each(Tm)})),eu(t.element())},Fm=function(t,e,n,r){n.get().each((function(e){Bm(t)}));var o=e.getAttachPoint(t);Nm(o,t);var i=t.getSystem().build(r);return Nm(t,i),n.set(i),i},Vm=function(t,e,n,r){var o=Fm(t,e,n,r);return e.onOpen(t,o),o},Um=function(t,e,n,r){return n.get().map((function(){return Fm(t,e,n,r)}))},jm=function(t,e,n,r,o){Ym(t,e),Vm(t,e,n,r),o(),Qm(t,e)},Wm=function(t,e,n){n.get().each((function(r){Bm(t),zm(t),e.onClose(t,r),n.clear()}))},qm=function(t,e,n){return n.isOpen()},$m=function(t,e,n,r){return qm(t,e,n)&&n.get().exists((function(n){return e.isPartOf(t,n,r)}))},Gm=function(t,e,n){return n.get()},Km=function(t,e,n,r){Ga(t.element(),e).fold((function(){mu(t.element(),n)}),(function(e){cu(t.element(),n,e)})),Ua(t.element(),e,r)},Xm=function(t,e,n){fu(t.element(),n).fold((function(){return Ya(t.element(),e)}),(function(n){return Ua(t.element(),e,n)}))},Ym=function(t,e,n){var r=e.getAttachPoint(t);Ua(t.element(),"position",Om.getMode(r)),Km(t,"visibility",e.cloakVisibilityAttr,"hidden")},Jm=function(t){return j(["top","left","right","bottom"],(function(e){return Ga(t,e).isSome()}))},Qm=function(t,e,n){Jm(t.element())||Ya(t.element(),"position"),Xm(t,"visibility",e.cloakVisibilityAttr)},Zm=Object.freeze({__proto__:null,cloak:Ym,decloak:Qm,open:Vm,openWhileCloaked:jm,close:Wm,isOpen:qm,isPartOf:$m,getState:Gm,setContent:Um}),tg=function(t,e){return di([pi(jo(),(function(n,r){Wm(n,t,e)}))])},eg=Object.freeze({__proto__:null,events:tg}),ng=[Ns("onOpen"),Ns("onClose"),vn("isPartOf"),vn("getAttachPoint"),Pn("cloakVisibilityAttr","data-precloak-visibility")],rg=function(){var t=Gn(C.none()),e=u("not-implemented"),n=function(){return t.get().isSome()},r=function(e){t.set(C.some(e))},o=function(){return t.get()},i=function(){t.set(C.none())};return ju({readState:e,isOpen:n,clear:i,set:r,get:o})},og=Object.freeze({__proto__:null,init:rg}),ig=Nl({fields:ng,name:"sandboxing",active:eg,apis:Zm,state:og}),ug=u("dismiss.popups"),ag=u("reposition.popups"),cg=u("mouse.released"),sg=He([Pn("isExtraPart",u(!1)),zn("fireEventInstead",[Pn("event",Qo())])]),lg=function(t){var e,n=rn("Dismissal",sg,t);return e={},e[ug()]={schema:He([vn("target")]),onReceive:function(t,e){if(ig.isOpen(t)){var r=ig.isPartOf(t,e.target)||n.isExtraPart(t,e.target);r||n.fireEventInstead.fold((function(){return ig.close(t)}),(function(e){return ui(t,e.event)}))}}},e},fg=He([zn("fireEventInstead",[Pn("event",Zo())]),Sn("doReposition")]),dg=function(t){var e,n=rn("Reposition",fg,t);return e={},e[ag()]={onReceive:function(t){ig.isOpen(t)&&n.fireEventInstead.fold((function(){return n.doReposition(t)}),(function(e){return ui(t,e.event)}))}},e},mg=function(t,e,n){e.store.manager.onLoad(t,e,n)},gg=function(t,e,n){e.store.manager.onUnload(t,e,n)},hg=function(t,e,n,r){e.store.manager.setValue(t,e,n,r)},pg=function(t,e,n){return e.store.manager.getValue(t,e,n)},vg=function(t,e,n){return n},bg=Object.freeze({__proto__:null,onLoad:mg,onUnload:gg,setValue:hg,getValue:pg,getState:vg}),yg=function(t,e){var n=t.resetOnDom?[Ti((function(n,r){mg(n,t,e)})),Ei((function(n,r){gg(n,t,e)}))]:[Sl(t,e,mg)];return di(n)},wg=Object.freeze({__proto__:null,events:yg}),xg=function(){var t=Gn(null),e=function(){return{mode:"memory",value:t.get()}},n=function(){return null===t.get()},r=function(){t.set(null)};return ju({set:t.set,get:t.get,isNotSet:n,clear:r,readState:e})},Cg=function(){var t=function(){};return ju({readState:t})},Sg=function(){var t=Gn({}),e=Gn({}),n=function(){return{mode:"dataset",dataByValue:t.get(),dataByText:e.get()}},r=function(){t.set({}),e.set({})},o=function(n){return Lt(t.get(),n).orThunk((function(){return Lt(e.get(),n)}))},i=function(n){var r=t.get(),o=e.get(),i={},u={};G(n,(function(t){i[t.value]=t,Lt(t,"meta").each((function(e){Lt(e,"text").each((function(e){u[e]=t}))}))})),t.set(g(g({},r),i)),e.set(g(g({},o),u))};return ju({readState:n,lookup:o,update:i,clear:r})},kg=function(t){return t.store.manager.state(t)},Og=Object.freeze({__proto__:null,memory:xg,dataset:Sg,manual:Cg,init:kg}),Tg=function(t,e,n,r){var o=e.store;n.update([r]),o.setValue(t,r),e.onSetValue(t,r)},Eg=function(t,e,n){var r=e.store,o=r.getDataKey(t);return n.lookup(o).fold((function(){return r.getFallbackEntry(o)}),(function(t){return t}))},_g=function(t,e,n){var r=e.store;r.initialValue.each((function(r){Tg(t,e,n,r)}))},Ag=function(t,e,n){n.clear()},Dg=[_n("initialValue"),vn("getFallbackEntry"),vn("getDataKey"),vn("setValue"),Bs("manager",{setValue:Tg,getValue:Eg,onLoad:_g,onUnload:Ag,state:Sg})],Ng=function(t,e,n){return e.store.getValue(t)},Rg=function(t,e,n,r){e.store.setValue(t,r),e.onSetValue(t,r)},Mg=function(t,e,n){e.store.initialValue.each((function(n){e.store.setValue(t,n)}))},zg=[vn("getValue"),Pn("setValue",n),_n("initialValue"),Bs("manager",{setValue:Rg,getValue:Ng,onLoad:Mg,onUnload:n,state:Uu.init})],Bg=function(t,e,n,r){n.set(r),e.onSetValue(t,r)},Pg=function(t,e,n){return n.get()},Hg=function(t,e,n){e.store.initialValue.each((function(t){n.isNotSet()&&n.set(t)}))},Ig=function(t,e,n){n.clear()},Lg=[_n("initialValue"),Bs("manager",{setValue:Bg,getValue:Pg,onLoad:Hg,onUnload:Ig,state:xg})],Fg=[Hn("store",{mode:"memory"},an("mode",{memory:Lg,manual:zg,dataset:Dg})),Ns("onSetValue"),Pn("resetOnDom",!1)],Vg=Nl({fields:Fg,name:"representing",active:wg,apis:bg,extra:{setValueFrom:function(t,e){var n=Vg.getValue(e);Vg.setValue(t,n)}},state:Og}),Ug=function(t,e){return qn(t,{},$(e,(function(e){return kn(e.name(),"Cannot configure "+e.name()+" for "+t)})).concat([$n("dump",a)]))},jg=function(t){return t.dump},Wg=function(t,e){return g(g({},t.dump),Al(e))},qg={field:Ug,augment:Wg,get:jg},$g="placeholder",Gg=jt.generate([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),Kg=function(t){return Ft(t,"uiType")},Xg=function(t,e,n,r){return t.exists((function(t){return t!==n.owner}))?Gg.single(!0,u(n)):Lt(r,n.name).fold((function(){throw new Error("Unknown placeholder component: "+n.name+"\nKnown: ["+_t(r)+"]\nNamespace: "+t.getOr("none")+"\nSpec: "+JSON.stringify(n,null,2))}),(function(t){return t.replace()}))},Yg=function(t,e,n,r){return Kg(n)&&n.uiType===$g?Xg(t,e,n,r):Gg.single(!1,u(n))},Jg=function(t,e,n,r){var o=Yg(t,e,n,r);return o.fold((function(o,i){var u=Kg(n)?i(e,n.config,n.validated):i(e),a=Lt(u,"components").getOr([]),c=rt(a,(function(n){return Jg(t,e,n,r)}));return[g(g({},u),{components:c})]}),(function(t,r){if(Kg(n)){var o=r(e,n.config,n.validated),i=n.validated.preprocess.getOr(a);return i(o)}return r(e)}))},Qg=function(t,e,n,r){return rt(n,(function(n){return Jg(t,e,n,r)}))},Zg=function(t,e){var n=!1,r=function(){return n},o=function(){if(n)throw new Error("Trying to use the same placeholder more than once: "+t);return n=!0,e},i=function(){return e.fold((function(t,e){return t}),(function(t,e){return t}))};return{name:u(t),required:i,used:r,replace:o}},th=function(t,e,n,r){var o=Nt(r,(function(t,e){return Zg(e,t)})),i=Qg(t,e,n,o);return Dt(o,(function(n){if(!1===n.used()&&n.required())throw new Error("Placeholder: "+n.name()+" was not found in components list\nNamespace: "+t.getOr("none")+"\nComponents: "+JSON.stringify(e.components,null,2))})),i},eh=Gg.single,nh=Gg.multiple,rh=u($g),oh=jt.generate([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),ih=Pn("factory",{sketch:a}),uh=Pn("schema",[]),ah=vn("name"),ch=qe("pname","pname",ne((function(t){return"<alloy."+Cu(t.name)+">"})),cn()),sh=$n("schema",(function(){return[_n("preprocess")]})),lh=Pn("defaults",u({})),fh=Pn("overrides",u({})),dh=Ie([ih,uh,ah,ch,lh,fh]),mh=Ie([ih,uh,ah,lh,fh]),gh=Ie([ih,uh,ah,ch,lh,fh]),hh=Ie([ih,sh,ah,vn("unit"),ch,lh,fh]),ph=function(t){return t.fold(C.some,C.none,C.some,C.some)},vh=function(t){var e=function(t){return t.name};return t.fold(e,e,e,e)},bh=function(t){return t.fold(a,a,a,a)},yh=function(t,e){return function(n){var r=rn("Converting part type",e,n);return t(r)}},wh=yh(oh.required,dh),xh=yh(oh.external,mh),Ch=yh(oh.optional,gh),Sh=yh(oh.group,hh),kh=u("entirety"),Oh=Object.freeze({__proto__:null,required:wh,external:xh,optional:Ch,group:Sh,asNamedPart:ph,name:vh,asCommon:bh,original:kh}),Th=function(t,e,n,r){return Kt(e.defaults(t,n,r),n,{uid:t.partUids[e.name]},e.overrides(t,n,r))},Eh=function(t,e,n){var r={},o={};return G(n,(function(t){t.fold((function(t){r[t.pname]=eh(!0,(function(e,n,r){return t.factory.sketch(Th(e,t,n,r))}))}),(function(t){var n=e.parts[t.name];o[t.name]=u(t.factory.sketch(Th(e,t,n[kh()]),n))}),(function(t){r[t.pname]=eh(!1,(function(e,n,r){return t.factory.sketch(Th(e,t,n,r))}))}),(function(t){r[t.pname]=nh(!0,(function(e,n,r){var o=e[t.name];return $(o,(function(n){return t.factory.sketch(Kt(t.defaults(e,n,r),n,t.overrides(e,n)))}))}))}))})),{internals:u(r),externals:u(o)}},_h=function(t,e){var n={};return G(e,(function(e){ph(e).each((function(e){var r=Ah(t,e.pname);n[e.name]=function(n){var o=rn("Part: "+e.name+" in "+t,Ie(e.schema),n);return g(g({},r),{config:n,validated:o})}}))})),n},Ah=function(t,e){return{uiType:rh(),owner:t,name:e}},Dh=function(t,e,n){return{uiType:rh(),owner:t,name:e,config:n,validated:{}}},Nh=function(t){return rt(t,(function(t){return t.fold(C.none,C.some,C.none,C.none).map((function(t){return On(t.name,t.schema.concat([Ps(kh())]))})).toArray()}))},Rh=function(t){return $(t,vh)},Mh=function(t,e,n){return Eh(t,e,n)},zh=function(t,e,n){return th(C.some(t),e,e.components,n)},Bh=function(t,e,n){var r=e.partUids[n];return t.getSystem().getByUid(r).toOption()},Ph=function(t,e,n){return Bh(t,e,n).getOrDie("Could not find part: "+n)},Hh=function(t,e,n){var r={},o=e.partUids,i=t.getSystem();return G(n,(function(t){r[t]=u(i.getByUid(o[t]))})),r},Ih=function(t,e){var n=t.getSystem();return Nt(e.partUids,(function(t,e){return u(n.getByUid(t))}))},Lh=function(t){return _t(t.partUids)},Fh=function(t,e,n){var r={},o=e.partUids,i=t.getSystem();return G(n,(function(t){r[t]=u(i.getByUid(o[t]).getOrDie())})),r},Vh=function(t,e){var n=Rh(e);return le($(n,(function(e){return{key:e,value:t+"-"+e}})))},Uh=function(t){return qe("partUids","partUids",re((function(e){return Vh(e.uid,t)})),cn())},jh=Object.freeze({__proto__:null,generate:_h,generateOne:Dh,schemas:Nh,names:Rh,substitutes:Mh,components:zh,defaultUids:Vh,defaultUidsSchema:Uh,getAllParts:Ih,getAllPartNames:Lh,getPart:Bh,getPartOrDie:Ph,getParts:Hh,getPartsOrDie:Fh}),Wh=function(t,e){var n=t.length>0?[On("parts",t)]:[];return n.concat([vn("uid"),Pn("dom",{}),Pn("components",[]),Ps("originalSpec"),Pn("debug.sketcher",{})]).concat(e)},qh=function(t,e,n,r,o){var i=Wh(r,o);return rn(t+" [SpecSchema]",He(i.concat(e)),n)},$h=function(t,e,n,r){var o=Xh(r),i=qh(t,e,o,[],[]);return n(i,o)},Gh=function(t,e,n,r,o){var i=Xh(o),u=Nh(n),a=Uh(n),c=qh(t,e,i,u,[a]),s=Mh(t,c,n),l=zh(t,c,s.internals());return r(c,l,i,s.externals())},Kh=function(t){return Ft(t,"uid")},Xh=function(t){return Kh(t)?t:g(g({},t),{uid:Du("uid")})};function Yh(t){return void 0!==t.uid}var Jh,Qh=He([vn("name"),vn("factory"),vn("configFields"),Pn("apis",{}),Pn("extraApis",{})]),Zh=He([vn("name"),vn("factory"),vn("configFields"),vn("partFields"),Pn("apis",{}),Pn("extraApis",{})]),tp=function(t){var e=rn("Sketcher for "+t.name,Qh,t),n=function(t){return $h(e.name,e.configFields,e.factory,t)},r=Nt(e.apis,Vu),o=Nt(e.extraApis,(function(t,e){return Pu(t,e)}));return g(g({name:u(e.name),configFields:u(e.configFields),sketch:n},r),o)},ep=function(t){var e=rn("Sketcher for "+t.name,Zh,t),n=function(t){return Gh(e.name,e.configFields,e.partFields,e.factory,t)},r=_h(e.name,e.partFields),o=Nt(e.apis,Vu),i=Nt(e.extraApis,(function(t,e){return Pu(t,e)}));return g(g({name:u(e.name),partFields:u(e.partFields),configFields:u(e.configFields),sketch:n,parts:u(r)},o),i)},np=function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e},rp=function(t){for(var e=[],n=0;n<t.length;n++){var r=t[n];if(!r.isSome())return C.none();e.push(r.getOrDie())}return C.some(e)},op=function(t,e,n){return t.isSome()&&e.isSome()?C.some(n(t.getOrDie(),e.getOrDie())):C.none()},ip=function(t,e,n,r){return t.isSome()&&e.isSome()&&n.isSome()?C.some(r(t.getOrDie(),e.getOrDie(),n.getOrDie())):C.none()},up=function(t){return"input"===Di(t)&&"radio"!==lu(t,"type")||"textarea"===Di(t)},ap=function(t,e,n){return e.find(t)},cp=Object.freeze({__proto__:null,getCurrent:ap}),sp=[vn("find")],lp=Nl({fields:sp,name:"composing",apis:cp}),fp=function(t,e,n,r){var o=Ad(t.element(),"."+e.highlightClass);G(o,(function(n){j(r,(function(t){return t.element()===n}))||(Sa(n,e.highlightClass),t.getSystem().getByDom(n).each((function(n){e.onDehighlight(t,n),ui(n,ii())})))}))},dp=function(t,e,n){return fp(t,e,n,[])},mp=function(t,e,n,r){yp(t,e,n,r)&&(Sa(r.element(),e.highlightClass),e.onDehighlight(t,r),ui(r,ii()))},gp=function(t,e,n,r){fp(t,e,n,[r]),yp(t,e,n,r)||(xa(r.element(),e.highlightClass),e.onHighlight(t,r),ui(r,oi()))},hp=function(t,e,n){Cp(t,e).each((function(r){gp(t,e,n,r)}))},pp=function(t,e,n){Sp(t,e).each((function(r){gp(t,e,n,r)}))},vp=function(t,e,n,r){xp(t,e,n,r).fold((function(t){throw new Error(t)}),(function(r){gp(t,e,n,r)}))},bp=function(t,e,n,r){var o=Ep(t,e),i=tt(o,r);i.each((function(r){gp(t,e,n,r)}))},yp=function(t,e,n,r){return ka(r.element(),e.highlightClass)},wp=function(t,e,n){return as(t.element(),"."+e.highlightClass).bind((function(e){return t.getSystem().getByDom(e).toOption()}))},xp=function(t,e,n,r){var o=Ad(t.element(),"."+e.itemClass);return C.from(o[r]).fold((function(){return pt.error("No element found with index "+r)}),t.getSystem().getByDom)},Cp=function(t,e,n){return as(t.element(),"."+e.itemClass).bind((function(e){return t.getSystem().getByDom(e).toOption()}))},Sp=function(t,e,n){var r=Ad(t.element(),"."+e.itemClass),o=r.length>0?C.some(r[r.length-1]):C.none();return o.bind((function(e){return t.getSystem().getByDom(e).toOption()}))},kp=function(t,e,n,r){var o=Ad(t.element(),"."+e.itemClass),i=et(o,(function(t){return ka(t,e.highlightClass)}));return i.bind((function(e){var n=sf(e,r,0,o.length-1);return t.getSystem().getByDom(o[n]).toOption()}))},Op=function(t,e,n){return kp(t,e,n,-1)},Tp=function(t,e,n){return kp(t,e,n,1)},Ep=function(t,e,n){var r=Ad(t.element(),"."+e.itemClass);return np($(r,(function(e){return t.getSystem().getByDom(e).toOption()})))},_p=Object.freeze({__proto__:null,dehighlightAll:dp,dehighlight:mp,highlight:gp,highlightFirst:hp,highlightLast:pp,highlightAt:vp,highlightBy:bp,isHighlighted:yp,getHighlighted:wp,getFirst:Cp,getLast:Sp,getPrevious:Op,getNext:Tp,getCandidates:Ep}),Ap=[vn("highlightClass"),vn("itemClass"),Ns("onHighlight"),Ns("onDehighlight")],Dp=Nl({fields:Ap,name:"highlighting",apis:_p}),Np=function(){return[8]},Rp=function(){return[9]},Mp=function(){return[13]},zp=function(){return[27]},Bp=function(){return[32]},Pp=function(){return[37]},Hp=function(){return[38]},Ip=function(){return[39]},Lp=function(){return[40]},Fp=function(t,e,n){var r=it(t.slice(0,e)),o=it(t.slice(e+1));return tt(r.concat(o),n)},Vp=function(t,e,n){var r=it(t.slice(0,e));return tt(r,n)},Up=function(t,e,n){var r=t.slice(0,e),o=t.slice(e+1);return tt(o.concat(r),n)},jp=function(t,e,n){var r=t.slice(e+1);return tt(r,n)},Wp=function(t){return function(e){var n=e.raw();return U(t,n.which)}},qp=function(t){return function(e){return ot(t,(function(t){return t(e)}))}},$p=function(t){var e=t.raw();return!0===e.shiftKey},Gp=function(t){var e=t.raw();return!0===e.ctrlKey},Kp=s($p),Xp=function(t,e){return{matches:t,classification:e}},Yp=function(t,e){var n=tt(t,(function(t){return t.matches(e)}));return n.map((function(t){return t.classification}))},Jp=function(t,e,n){var r=e.exists((function(t){return n.exists((function(e){return no(e,t)}))}));r||ai(t,ti(),{prevFocus:e,newFocus:n})},Qp=function(){var t=function(t){return Gl(t.element())},e=function(e,n){var r=t(e);e.getSystem().triggerFocus(n,e.element());var o=t(e);Jp(e,r,o)};return{get:t,set:e}},Zp=function(){var t=function(t){return Dp.getHighlighted(t).map((function(t){return t.element()}))},e=function(e,r){var o=t(e);e.getSystem().getByDom(r).fold(n,(function(t){Dp.highlight(e,t)}));var i=t(e);Jp(e,o,i)};return{get:t,set:e}};(function(t){t["OnFocusMode"]="onFocus",t["OnEnterOrSpaceMode"]="onEnterOrSpace",t["OnApiMode"]="onApi"})(Jh||(Jh={}));var tv=function(t,e,n,r,o){var i=function(){return t.concat([Pn("focusManager",Qp()),Hn("focusInside","onFocus",Qe((function(t){return U(["onFocus","onEnterOrSpace","onApi"],t)?pt.value(t):pt.error("Invalid value for focusInside")}))),Bs("handler",c),Bs("state",e),Bs("sendFocusIn",o)])},u=function(t,e,n,r,o){var i=n(t,e,r,o);return Yp(i,e.event()).bind((function(n){return n(t,e,r,o)}))},a=function(t,e){var i=t.focusInside!==Jh.OnFocusMode?C.none():o(t).map((function(n){return pi(Bo(),(function(r,o){n(r,t,e),o.stop()}))})),a=function(n,r){var i=Wp(Bp().concat(Mp()))(r.event());t.focusInside===Jh.OnEnterOrSpaceMode&&i&&so(n,r)&&o(t).each((function(o){o(n,t,e),r.stop()}))},c=[pi(Eo(),(function(r,o){u(r,o,n,t,e).fold((function(){a(r,o)}),(function(t){o.stop()}))})),pi(_o(),(function(n,o){u(n,o,r,t,e).each((function(t){o.stop()}))}))];return di(i.toArray().concat(c))},c={schema:i,processKey:u,toEvents:a};return c},ev=function(t){var e=[_n("onEscape"),_n("onEnter"),Pn("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),Pn("firstTabstop",0),Pn("useTabstopAt",u(!0)),_n("visibilitySelector")].concat([t]),n=function(t,e){var n=t.visibilitySelector.bind((function(t){return cs(e,t)})).getOr(e);return pc(n)>0},r=function(t,e){var r=Ad(t.element(),e.selector),o=Y(r,(function(t){return n(e,t)}));return C.from(o[e.firstTabstop])},o=function(t,e){return e.focusManager.get(t).bind((function(t){return cs(t,e.selector)}))},i=function(t,e){return n(t,e)&&t.useTabstopAt(e)},a=function(t,e,n){r(t,e).each((function(n){e.focusManager.set(t,n)}))},s=function(t,e,n,r,o){return o(e,n,(function(t){return i(r,t)})).fold((function(){return r.cyclic?C.some(!0):C.none()}),(function(e){return r.focusManager.set(t,e),C.some(!0)}))},l=function(t,e,n,r){var i=Ad(t.element(),n.selector);return o(t,n).bind((function(e){var o=et(i,c(no,e));return o.bind((function(e){return s(t,i,e,n,r)}))}))},f=function(t,e,n){var r=n.cyclic?Fp:Vp;return l(t,e,n,r)},d=function(t,e,n){var r=n.cyclic?Up:jp;return l(t,e,n,r)},m=function(t,e,n){return n.onEnter.bind((function(n){return n(t,e)}))},g=function(t,e,n){return n.onEscape.bind((function(n){return n(t,e)}))},h=u([Xp(qp([$p,Wp(Rp())]),f),Xp(Wp(Rp()),d),Xp(Wp(zp()),g),Xp(qp([Kp,Wp(Mp())]),m)]),p=u([]);return tv(e,Uu.init,h,p,(function(){return C.some(a)}))},nv=ev($n("cyclic",u(!1))),rv=ev($n("cyclic",u(!0))),ov=function(t,e,n){return si(t,n,Lo()),C.some(!0)},iv=function(t,e,n){var r=up(n)&&Wp(Bp())(e.event());return r?C.none():ov(t,e,n)},uv=function(t,e){return C.some(!0)},av=[Pn("execute",iv),Pn("useSpace",!1),Pn("useEnter",!0),Pn("useControlEnter",!1),Pn("useDown",!1)],cv=function(t,e,n){return n.execute(t,e,t.element())},sv=function(t,e,n,r){var o=n.useSpace&&!up(t.element())?Bp():[],i=n.useEnter?Mp():[],u=n.useDown?Lp():[],a=o.concat(i).concat(u);return[Xp(Wp(a),cv)].concat(n.useControlEnter?[Xp(qp([Gp,Wp(Mp())]),cv)]:[])},lv=function(t,e,n,r){return n.useSpace&&!up(t.element())?[Xp(Wp(Bp()),uv)]:[]},fv=tv(av,Uu.init,sv,lv,(function(){return C.none()})),dv=function(){var t=Gn(C.none()),e=function(e,n){t.set(C.some({numRows:e,numColumns:n}))},n=function(){return t.get().map((function(t){return t.numRows}))},r=function(){return t.get().map((function(t){return t.numColumns}))};return ju({readState:function(){return t.get().map((function(t){return{numRows:String(t.numRows),numColumns:String(t.numColumns)}})).getOr({numRows:"?",numColumns:"?"})},setGridSize:e,getNumRows:n,getNumColumns:r})},mv=function(t){return t.state(t)},gv=Object.freeze({__proto__:null,flatgrid:dv,init:mv}),hv=function(t){return function(e,n,r,o){var i=t(e.element());return yv(i,e,n,r,o)}},pv=function(t,e){var n=Nf(t,e);return hv(n)},vv=function(t,e){var n=Nf(e,t);return hv(n)},bv=function(t){return function(e,n,r,o){return yv(t,e,n,r,o)}},yv=function(t,e,n,r,o){var i=r.focusManager.get(e).bind((function(n){return t(e.element(),n,r,o)}));return i.map((function(t){return r.focusManager.set(e,t),!0}))},wv=bv,xv=bv,Cv=bv,Sv=function(t){return t.offsetWidth<=0&&t.offsetHeight<=0},kv=function(t){return!Sv(t.dom())},Ov=function(t,e){return et(t,e).map((function(e){return{index:u(e),candidates:u(t)}}))},Tv=function(t,e,n){var r=function(t){return no(t,e)},o=Ad(t,n),i=Y(o,kv);return Ov(i,r)},Ev=function(t,e){return et(t,(function(t){return no(e,t)}))},_v=function(t,e,n,r){var o=Math.floor(e/n),i=e%n;return r(o,i).bind((function(e){var r=e.row()*n+e.column();return r>=0&&r<t.length?C.some(t[r]):C.none()}))},Av=function(t,e,n,r,o){return _v(t,e,r,(function(e,i){var a=e===n-1,c=a?t.length-e*r:r,s=sf(i,o,0,c-1);return C.some({row:u(e),column:u(s)})}))},Dv=function(t,e,n,r,o){return _v(t,e,r,(function(e,i){var a=sf(e,o,0,n-1),c=a===n-1,s=c?t.length-a*r:r,l=lf(i,0,s-1);return C.some({row:u(a),column:u(l)})}))},Nv=function(t,e,n,r){return Av(t,e,n,r,1)},Rv=function(t,e,n,r){return Av(t,e,n,r,-1)},Mv=function(t,e,n,r){return Dv(t,e,n,r,-1)},zv=function(t,e,n,r){return Dv(t,e,n,r,1)},Bv=[vn("selector"),Pn("execute",iv),Rs("onEscape"),Pn("captureTab",!1),Hs()],Pv=function(t,e,n){as(t.element(),e.selector).each((function(n){e.focusManager.set(t,n)}))},Hv=function(t,e){return e.focusManager.get(t).bind((function(t){return cs(t,e.selector)}))},Iv=function(t,e,n,r){return Hv(t,n).bind((function(r){return n.execute(t,e,r)}))},Lv=function(t){return function(e,n,r,o){return Tv(e,n,r.selector).bind((function(e){return t(e.candidates(),e.index(),o.getNumRows().getOr(r.initSize.numRows),o.getNumColumns().getOr(r.initSize.numColumns))}))}},Fv=function(t,e,n){return n.captureTab?C.some(!0):C.none()},Vv=function(t,e,n){return n.onEscape(t,e)},Uv=Lv(Rv),jv=Lv(Nv),Wv=Lv(Mv),qv=Lv(zv),$v=u([Xp(Wp(Pp()),pv(Uv,jv)),Xp(Wp(Ip()),vv(Uv,jv)),Xp(Wp(Hp()),wv(Wv)),Xp(Wp(Lp()),xv(qv)),Xp(qp([$p,Wp(Rp())]),Fv),Xp(qp([Kp,Wp(Rp())]),Fv),Xp(Wp(zp()),Vv),Xp(Wp(Bp().concat(Mp())),Iv)]),Gv=u([Xp(Wp(Bp()),uv)]),Kv=tv(Bv,dv,$v,Gv,(function(){return C.some(Pv)})),Xv=function(t,e,n,r){var o=function(t){return"button"===Di(t)&&"disabled"===lu(t,"disabled")},i=function(t,e,n){var u=sf(e,r,0,n.length-1);return u===t?C.none():o(n[u])?i(t,u,n):C.from(n[u])};return Tv(t,n,e).bind((function(t){var e=t.index(),n=t.candidates();return i(e,e,n)}))},Yv=[vn("selector"),Pn("getInitial",C.none),Pn("execute",iv),Rs("onEscape"),Pn("executeOnMove",!1),Pn("allowVertical",!0)],Jv=function(t,e){return e.focusManager.get(t).bind((function(t){return cs(t,e.selector)}))},Qv=function(t,e,n){return Jv(t,n).bind((function(r){return n.execute(t,e,r)}))},Zv=function(t,e,n){e.getInitial(t).orThunk((function(){return as(t.element(),e.selector)})).each((function(n){e.focusManager.set(t,n)}))},tb=function(t,e,n){return Xv(t,n.selector,e,-1)},eb=function(t,e,n){return Xv(t,n.selector,e,1)},nb=function(t){return function(e,n,r,o){return t(e,n,r,o).bind((function(){return r.executeOnMove?Qv(e,n,r):C.some(!0)}))}},rb=function(t,e,n){return n.onEscape(t,e)},ob=function(t,e,n,r){var o=Pp().concat(n.allowVertical?Hp():[]),i=Ip().concat(n.allowVertical?Lp():[]);return[Xp(Wp(o),nb(pv(tb,eb))),Xp(Wp(i),nb(vv(tb,eb))),Xp(Wp(Mp()),Qv),Xp(Wp(Bp()),Qv),Xp(Wp(zp()),rb)]},ib=u([Xp(Wp(Bp()),uv)]),ub=tv(Yv,Uu.init,ob,ib,(function(){return C.some(Zv)})),ab=function(t,e,n){return C.from(t[e]).bind((function(t){return C.from(t[n]).map((function(t){return{rowIndex:e,columnIndex:n,cell:t}}))}))},cb=function(t,e,n,r){var o=t[e],i=o.length,u=sf(n,r,0,i-1);return ab(t,e,u)},sb=function(t,e,n,r){var o=sf(n,r,0,t.length-1),i=t[o].length,u=lf(e,0,i-1);return ab(t,o,u)},lb=function(t,e,n,r){var o=t[e],i=o.length,u=lf(n+r,0,i-1);return ab(t,e,u)},fb=function(t,e,n,r){var o=lf(n+r,0,t.length-1),i=t[o].length,u=lf(e,0,i-1);return ab(t,o,u)},db=function(t,e,n){return cb(t,e,n,1)},mb=function(t,e,n){return cb(t,e,n,-1)},gb=function(t,e,n){return sb(t,n,e,-1)},hb=function(t,e,n){return sb(t,n,e,1)},pb=function(t,e,n){return lb(t,e,n,-1)},vb=function(t,e,n){return lb(t,e,n,1)},bb=function(t,e,n){return fb(t,n,e,-1)},yb=function(t,e,n){return fb(t,n,e,1)},wb=[On("selectors",[vn("row"),vn("cell")]),Pn("cycles",!0),Pn("previousSelector",C.none),Pn("execute",iv)],xb=function(t,e,n){var r=e.previousSelector(t).orThunk((function(){var n=e.selectors;return as(t.element(),n.cell)}));r.each((function(n){e.focusManager.set(t,n)}))},Cb=function(t,e,n){return Gl(t.element()).bind((function(r){return n.execute(t,e,r)}))},Sb=function(t,e){return $(t,(function(t){return Ad(t,e.selectors.cell)}))},kb=function(t,e){return function(n,r,o){var i=o.cycles?t:e;return cs(r,o.selectors.row).bind((function(t){var e=Ad(t,o.selectors.cell);return Ev(e,r).bind((function(e){var r=Ad(n,o.selectors.row);return Ev(r,t).bind((function(t){var n=Sb(r,o);return i(n,t,e).map((function(t){return t.cell}))}))}))}))}},Ob=kb(mb,pb),Tb=kb(db,vb),Eb=kb(gb,bb),_b=kb(hb,yb),Ab=u([Xp(Wp(Pp()),pv(Ob,Tb)),Xp(Wp(Ip()),vv(Ob,Tb)),Xp(Wp(Hp()),wv(Eb)),Xp(Wp(Lp()),xv(_b)),Xp(Wp(Bp().concat(Mp())),Cb)]),Db=u([Xp(Wp(Bp()),uv)]),Nb=tv(wb,Uu.init,Ab,Db,(function(){return C.some(xb)})),Rb=[vn("selector"),Pn("execute",iv),Pn("moveOnTab",!1)],Mb=function(t,e,n){return n.focusManager.get(t).bind((function(r){return n.execute(t,e,r)}))},zb=function(t,e,n){as(t.element(),e.selector).each((function(n){e.focusManager.set(t,n)}))},Bb=function(t,e,n){return Xv(t,n.selector,e,-1)},Pb=function(t,e,n){return Xv(t,n.selector,e,1)},Hb=function(t,e,n,r){return n.moveOnTab?Cv(Bb)(t,e,n,r):C.none()},Ib=function(t,e,n,r){return n.moveOnTab?Cv(Pb)(t,e,n,r):C.none()},Lb=u([Xp(Wp(Hp()),Cv(Bb)),Xp(Wp(Lp()),Cv(Pb)),Xp(qp([$p,Wp(Rp())]),Hb),Xp(qp([Kp,Wp(Rp())]),Ib),Xp(Wp(Mp()),Mb),Xp(Wp(Bp()),Mb)]),Fb=u([Xp(Wp(Bp()),uv)]),Vb=tv(Rb,Uu.init,Lb,Fb,(function(){return C.some(zb)})),Ub=[Rs("onSpace"),Rs("onEnter"),Rs("onShiftEnter"),Rs("onLeft"),Rs("onRight"),Rs("onTab"),Rs("onShiftTab"),Rs("onUp"),Rs("onDown"),Rs("onEscape"),Pn("stopSpaceKeyup",!1),_n("focusIn")],jb=function(t,e,n){return[Xp(Wp(Bp()),n.onSpace),Xp(qp([Kp,Wp(Mp())]),n.onEnter),Xp(qp([$p,Wp(Mp())]),n.onShiftEnter),Xp(qp([$p,Wp(Rp())]),n.onShiftTab),Xp(qp([Kp,Wp(Rp())]),n.onTab),Xp(Wp(Hp()),n.onUp),Xp(Wp(Lp()),n.onDown),Xp(Wp(Pp()),n.onLeft),Xp(Wp(Ip()),n.onRight),Xp(Wp(Bp()),n.onSpace),Xp(Wp(zp()),n.onEscape)]},Wb=function(t,e,n){return n.stopSpaceKeyup?[Xp(Wp(Bp()),uv)]:[]},qb=tv(Ub,Uu.init,jb,Wb,(function(t){return t.focusIn})),$b=nv.schema(),Gb=rv.schema(),Kb=ub.schema(),Xb=Kv.schema(),Yb=Nb.schema(),Jb=fv.schema(),Qb=Vb.schema(),Zb=qb.schema(),ty=Object.freeze({__proto__:null,acyclic:$b,cyclic:Gb,flow:Kb,flatgrid:Xb,matrix:Yb,execution:Jb,menu:Qb,special:Zb}),ey=function(t){return Vt(t,"setGridSize")},ny=Ml({branchKey:"mode",branches:ty,name:"keying",active:{events:function(t,e){var n=t.handler;return n.toEvents(t,e)}},apis:{focusIn:function(t,e,n){e.sendFocusIn(e).fold((function(){t.getSystem().triggerFocus(t.element(),t.element())}),(function(r){r(t,e,n)}))},setGridSize:function(t,n,r,o,i){ey(r)?r.setGridSize(o,i):e.console.error("Layout does not support setGridSize")}},state:gv}),ry=function(t,e,n,r){Kl((function(){var e=$(r,t.getSystem().build);Dm(t,e)}),t.element())},oy=function(t,e,n,r){var o=t.getSystem().build(r);Rm(t,o,n)},iy=function(t,e,n,r){oy(t,e,Yi,r)},uy=function(t,e,n,r){oy(t,e,Xi,r)},ay=function(t,e,n,r){var o=cy(t),i=tt(o,(function(t){return no(r.element(),t.element())}));i.each(zm)},cy=function(t,e){return t.components()},sy=function(t,e,n,r,o){var i=cy(t);return C.from(i[r]).map((function(i){return ay(t,e,n,i),o.each((function(n){oy(t,e,(function(t,e){Ji(t,e,r)}),n)})),i}))},ly=function(t,e,n,r,o){var i=cy(t);return et(i,r).bind((function(r){return sy(t,e,n,r,o)}))},fy=Object.freeze({__proto__:null,append:iy,prepend:uy,remove:ay,replaceAt:sy,replaceBy:ly,set:ry,contents:cy}),dy=Nl({fields:[],name:"replacing",apis:fy}),my=function(t,e){var n=di(e);return Nl({fields:[vn("enabled")],name:t,active:{events:u(n)}})},gy=function(t,e){var n=my(t,e);return{key:t,value:{config:{},me:n,configAsRaw:u({}),initialConfig:{},state:Uu}}},hy=function(t,e){e.ignore||(jl(t.element()),e.onFocus(t))},py=function(t,e){e.ignore||Wl(t.element())},vy=function(t){return ql(t.element())},by=Object.freeze({__proto__:null,focus:hy,blur:py,isFocused:vy}),yy=function(t,e){var n=e.ignore?{}:{attributes:{tabindex:"-1"}};return Ku(n)},wy=function(t){return di([pi(Bo(),(function(e,n){hy(e,t),n.stop()}))].concat(t.stopMousedown?[pi(wo(),(function(t,e){e.event().prevent()}))]:[]))},xy=Object.freeze({__proto__:null,exhibit:yy,events:wy}),Cy=[Ns("onFocus"),Pn("stopMousedown",!1),Pn("ignore",!1)],Sy=Nl({fields:Cy,name:"focusing",active:xy,apis:by}),ky=function(t,e,n){var r=e.aria;r.update(t,r,n.get())},Oy=function(t,e,n){e.toggleClass.each((function(e){n.get()?xa(t.element(),e):Sa(t.element(),e)}))},Ty=function(t,e,n){Ay(t,e,n,!n.get())},Ey=function(t,e,n){n.set(!0),Oy(t,e,n),ky(t,e,n)},_y=function(t,e,n){n.set(!1),Oy(t,e,n),ky(t,e,n)},Ay=function(t,e,n,r){var o=r?Ey:_y;o(t,e,n)},Dy=function(t,e,n){return n.get()},Ny=function(t,e,n){Ay(t,e,n,e.selected)},Ry=Object.freeze({__proto__:null,onLoad:Ny,toggle:Ty,isOn:Dy,on:Ey,off:_y,set:Ay}),My=function(){return Ku({})},zy=function(t,e){var n=Cl(t,e,Ty),r=Sl(t,e,Ny);return di(nt([t.toggleOnExecute?[n]:[],[r]]))},By=Object.freeze({__proto__:null,exhibit:My,events:zy}),Py=function(t){var e=function(){var e=Gn(t),n=function(){return e.get()},r=function(t){return e.set(t)},o=function(){return e.set(t)},i=function(){return e.get()};return{get:n,set:r,clear:o,readState:i}};return{init:e}},Hy=function(t,e,n){cu(t.element(),"aria-pressed",n),e.syncWithExpanded&&Fy(t,e,n)},Iy=function(t,e,n){cu(t.element(),"aria-selected",n)},Ly=function(t,e,n){cu(t.element(),"aria-checked",n)},Fy=function(t,e,n){cu(t.element(),"aria-expanded",n)},Vy=[Pn("selected",!1),_n("toggleClass"),Pn("toggleOnExecute",!0),Hn("aria",{mode:"none"},an("mode",{pressed:[Pn("syncWithExpanded",!1),Bs("update",Hy)],checked:[Bs("update",Ly)],expanded:[Bs("update",Fy)],selected:[Bs("update",Iy)],none:[Bs("update",n)]}))],Uy=Nl({fields:Vy,name:"toggling",active:By,apis:Ry,state:Py(!1)}),jy=function(){var t=function(t,e){e.stop(),ci(t)};return[pi(No(),t),pi(Vo(),t),Si(po()),Si(wo())]},Wy=function(t){var e=function(t){return Ai((function(e,n){t(e),n.stop()}))};return di(nt([t.map(e).toArray(),jy()]))},qy="alloy.item-hover",$y="alloy.item-focus",Gy=function(t){(Gl(t.element()).isNone()||Sy.isFocused(t))&&(Sy.isFocused(t)||Sy.focus(t),ai(t,qy,{item:t}))},Ky=function(t){ai(t,$y,{item:t})},Xy=u(qy),Yy=u($y),Jy=function(t){return{dom:t.dom,domModification:g(g({},t.domModification),{attributes:g(g(g({role:t.toggling.isSome()?"menuitemcheckbox":"menuitem"},t.domModification.attributes),{"aria-haspopup":t.hasSubmenu}),t.hasSubmenu?{"aria-expanded":!1}:{})}),behaviours:qg.augment(t.itemBehaviours,[t.toggling.fold(Uy.revoke,(function(t){return Uy.config(g({aria:{mode:"checked"}},t))})),Sy.config({ignore:t.ignoreFocus,stopMousedown:t.ignoreFocus,onFocus:function(t){Ky(t)}}),ny.config({mode:"execution"}),Vg.config({store:{mode:"memory",initialValue:t.data}}),gy("item-type-events",p(jy(),[pi(ko(),Gy),pi(Fo(),Sy.focus)]))]),components:t.components,eventOrder:t.eventOrder}},Qy=[vn("data"),vn("components"),vn("dom"),Pn("hasSubmenu",!1),_n("toggling"),qg.field("itemBehaviours",[Uy,Sy,ny,Vg]),Pn("ignoreFocus",!1),Pn("domModification",{}),Bs("builder",Jy),Pn("eventOrder",{})],Zy=function(t){return{dom:t.dom,components:t.components,events:di([ki(Fo())])}},tw=[vn("dom"),vn("components"),Bs("builder",Zy)],ew=function(){return"item-widget"},nw=u([wh({name:"widget",overrides:function(t){return{behaviours:Al([Vg.config({store:{mode:"manual",getValue:function(e){return t.data},setValue:function(){}}})])}}})]),rw=function(t){var e=Mh(ew(),t,nw()),n=zh(ew(),t,e.internals()),r=function(e){return Bh(e,t,"widget").map((function(t){return ny.focusIn(t),t}))},o=function(e,n){return up(n.event().target())?C.none():function(){return t.autofocus?(n.setSource(e.element()),C.none()):C.none()}()};return{dom:t.dom,components:n,domModification:t.domModification,events:di([Ai((function(t,e){r(t).each((function(t){e.stop()}))})),pi(ko(),Gy),pi(Fo(),(function(e,n){t.autofocus?r(e):Sy.focus(e)}))]),behaviours:qg.augment(t.widgetBehaviours,[Vg.config({store:{mode:"memory",initialValue:t.data}}),Sy.config({ignore:t.ignoreFocus,onFocus:function(t){Ky(t)}}),ny.config({mode:"special",focusIn:t.autofocus?function(t){r(t)}:zl(),onLeft:o,onRight:o,onEscape:function(e,n){return Sy.isFocused(e)||t.autofocus?t.autofocus?(n.setSource(e.element()),C.none()):C.none():(Sy.focus(e),C.some(!0))}})])}},ow=[vn("uid"),vn("data"),vn("components"),vn("dom"),Pn("autofocus",!1),Pn("ignoreFocus",!1),qg.field("widgetBehaviours",[Vg,Sy,ny]),Pn("domModification",{}),Uh(nw()),Bs("builder",rw)],iw=an("type",{widget:ow,item:Qy,separator:tw}),uw=function(t,e){return{mode:"flatgrid",selector:"."+t.markers.item,initSize:{numColumns:e.initSize.numColumns,numRows:e.initSize.numRows},focusManager:t.focusManager}},aw=function(t,e){return{mode:"matrix",selectors:{row:e.rowSelector,cell:"."+t.markers.item},focusManager:t.focusManager}},cw=function(t,e){return{mode:"menu",selector:"."+t.markers.item,moveOnTab:e.moveOnTab,focusManager:t.focusManager}},sw=u([Sh({factory:{sketch:function(t){var e=rn("menu.spec item",iw,t);return e.builder(e)}},name:"items",unit:"item",defaults:function(t,e){return e.hasOwnProperty("uid")?e:g(g({},e),{uid:Du("item")})},overrides:function(t,e){return{type:e.type,ignoreFocus:t.fakeFocus,domModification:{classes:[t.markers.item]}}}})]),lw=u([vn("value"),vn("items"),vn("dom"),vn("components"),Pn("eventOrder",{}),Ug("menuBehaviours",[Dp,Vg,lp,ny]),Hn("movement",{mode:"menu",moveOnTab:!0},an("mode",{grid:[Hs(),Bs("config",uw)],matrix:[Bs("config",aw),vn("rowSelector")],menu:[Pn("moveOnTab",!0),Bs("config",cw)]})),Es(),Pn("fakeFocus",!1),Pn("focusManager",Qp()),Ns("onHighlight")]),fw=u("alloy.menu-focus"),dw=function(t,e,n,r){return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:Wg(t.menuBehaviours,[Dp.config({highlightClass:t.markers.selectedItem,itemClass:t.markers.item,onHighlight:t.onHighlight}),Vg.config({store:{mode:"memory",initialValue:t.value}}),lp.config({find:C.some}),ny.config(t.movement.config(t,t.movement))]),events:di([pi(Yy(),(function(t,e){var n=e.event();t.getSystem().getByDom(n.target()).each((function(n){Dp.highlight(t,n),e.stop(),ai(t,fw(),{menu:t,item:n})}))})),pi(Xy(),(function(t,e){var n=e.event().item();Dp.highlight(t,n)}))]),components:e,eventOrder:t.eventOrder,domModification:{attributes:{role:"menu"}}}},mw=ep({name:"Menu",configFields:lw(),partFields:sw(),factory:dw}),gw=function(t){return Rt(t,(function(t,e){return{k:t,v:e}}))},hw=function(t,e,n,r){return Lt(n,r).bind((function(r){return Lt(t,r).bind((function(r){var o=hw(t,e,n,r);return C.some([r].concat(o))}))})).getOr([])},pw=function(t,e){var n={};Dt(t,(function(t,e){G(t,(function(t){n[t]=e}))}));var r=e,o=gw(e),i=Nt(o,(function(t,e){return[e].concat(hw(n,r,o,e))}));return Nt(n,(function(t){return Lt(i,t).getOr([t])}))},vw=function(){var t=Gn({}),e=Gn({}),n=Gn({}),r=Gn(C.none()),o=Gn({}),i=function(){t.set({}),e.set({}),n.set({}),r.set(C.none())},u=function(){return r.get().isNone()},a=function(t,n){var r;e.set(g(g({},e.get()),(r={},r[t]={type:"prepared",menu:n},r)))},c=function(i,u,a,c){r.set(C.some(i)),t.set(a),e.set(u),o.set(c);var s=pw(c,a);n.set(s)},s=function(e){return Ht(t.get(),(function(t,n){return t===e}))},l=function(t,e,n){return p(t).bind((function(r){return s(t).bind((function(t){return e(t).map((function(t){return{triggeredMenu:r,triggeringItem:t,triggeringPath:n}}))}))}))},f=function(t,e){var o=Y(b(t).toArray(),(function(t){return p(t).isSome()}));return Lt(n.get(),t).bind((function(t){var n=it(o.concat(t)),i=rt(n,(function(t,o){return l(t,e,n.slice(0,o+1)).fold((function(){return r.get().is(t)?[]:[C.none()]}),(function(t){return[C.some(t)]}))}));return rp(i)}))},d=function(e){return Lt(t.get(),e).map((function(t){var r=Lt(n.get(),e).getOr([]);return[t].concat(r)}))},m=function(t){return Lt(n.get(),t).bind((function(t){return t.length>1?C.some(t.slice(1)):C.none()}))},h=function(t){return Lt(n.get(),t)},p=function(t){return v(t).bind(bw)},v=function(t){return Lt(e.get(),t)},b=function(e){return Lt(t.get(),e)},y=function(t){var e=o.get();return ut(_t(e),t)},w=function(){return r.get().bind(p)},x=function(){return e.get()};return{setMenuBuilt:a,setContents:c,expand:d,refresh:h,collapse:m,lookupMenu:v,lookupItem:b,otherMenus:y,getPrimary:w,getMenus:x,clear:i,isClear:u,getTriggeringPath:f}},bw=function(t){return"prepared"===t.type?C.some(t.menu):C.none()},yw={init:vw,extractPreparedMenu:bw},ww=function(t,e){var n,r=Gn(C.none()),o=function(e,n,r){return Nt(r,(function(r,o){var i=function(){return mw.sketch(g(g({},r),{value:o,markers:t.markers,fakeFocus:t.fakeFocus,onHighlight:t.onHighlight,focusManager:t.fakeFocus?Zp():Qp()}))};return o===n?{type:"prepared",menu:e.getSystem().build(i())}:{type:"notbuilt",nbMenu:i}}))},i=yw.init(),u=function(e){var n=o(e,t.data.primary,t.data.menus),r=s();return i.setContents(t.data.primary,n,t.data.expansions,r),i.getPrimary()},a=function(t){return Vg.getValue(t).value},c=function(t,e,n){return dt(e,(function(t){if(!t.getSystem().isConnected())return C.none();var e=Dp.getCandidates(t);return tt(e,(function(t){return a(t)===n}))}))},s=function(e){return Nt(t.data.menus,(function(t,e){return rt(t.items,(function(t){return"separator"===t.type?[]:[t.data.value]}))}))},l=function(t,e){Dp.highlight(t,e),Dp.getHighlighted(e).orThunk((function(){return Dp.getFirst(e)})).each((function(e){si(t,e.element(),Fo())}))},f=function(t,e){return np($(e,(function(e){return t.lookupMenu(e).bind((function(t){return"prepared"===t.type?C.some(t.menu):C.none()}))})))},d=function(e,n,r){var o=f(n,n.otherMenus(r));G(o,(function(n){Ta(n.element(),[t.markers.backgroundMenu]),t.stayInDom||dy.remove(e,n)}))},m=function(e){return r.get().getOrThunk((function(){var n={},o=Ad(e.element(),"."+t.markers.item),i=Y(o,(function(t){return"true"===lu(t,"aria-haspopup")}));return G(i,(function(t){e.getSystem().getByDom(t).each((function(t){var e=a(t);n[e]=t}))})),r.set(C.some(n)),n}))},h=function(t,e){var n=m(t);Dt(n,(function(t,n){var r=U(e,n);cu(t.element(),"aria-expanded",r)}))},p=function(e,n,r){return C.from(r[0]).bind((function(o){return n.lookupMenu(o).bind((function(o){if("notbuilt"===o.type)return C.none();var i=o.menu,u=f(n,r.slice(1));return G(u,(function(e){xa(e.element(),t.markers.backgroundMenu)})),Ha(i.element())||dy.append(e,mc(i)),Ta(i.element(),[t.markers.backgroundMenu]),l(e,i),d(e,n,r),C.some(i)}))}))};(function(t){t[t["HighlightSubmenu"]=0]="HighlightSubmenu",t[t["HighlightParent"]=1]="HighlightParent"})(n||(n={}));var v=function(t,e,n){if("notbuilt"===n.type){var r=t.getSystem().build(n.nbMenu());return i.setMenuBuilt(e,r),r}return n.menu},b=function(e,r,o){void 0===o&&(o=n.HighlightSubmenu);var u=a(r);return i.expand(u).bind((function(u){return h(e,u),C.from(u[0]).bind((function(a){return i.lookupMenu(a).bind((function(c){var s=v(e,a,c);return Ha(s.element())||dy.append(e,mc(s)),t.onOpenSubmenu(e,r,s,it(u)),o===n.HighlightSubmenu?(Dp.highlightFirst(s),p(e,i,u)):(Dp.dehighlightAll(s),C.some(r))}))}))}))},y=function(e,n){var r=a(n);return i.collapse(r).bind((function(r){return h(e,r),p(e,i,r).map((function(r){return t.onCollapseMenu(e,n,r),r}))}))},w=function(t,e){var n=a(e);return i.refresh(n).bind((function(e){return h(t,e),p(t,i,e)}))},x=function(t,e){return up(e.element())?C.none():b(t,e,n.HighlightSubmenu)},S=function(t,e){return up(e.element())?C.none():y(t,e)},k=function(e,n){return y(e,n).orThunk((function(){return t.onEscape(e,n).map((function(){return e}))}))},O=function(e){return function(n,r){return cs(r.getSource(),"."+t.markers.item).bind((function(t){return n.getSystem().getByDom(t).toOption().bind((function(t){return e(n,t).map((function(){return!0}))}))}))}},T=di([pi(fw(),(function(t,e){var n=e.event().item();i.lookupItem(a(n)).each((function(){var n=e.event().menu();Dp.highlight(t,n);var r=a(e.event().item());i.refresh(r).each((function(e){return d(t,i,e)}))}))})),Ai((function(e,r){var o=r.event().target();e.getSystem().getByDom(o).each((function(r){var o=a(r);0===o.indexOf("collapse-item")&&y(e,r),b(e,r,n.HighlightSubmenu).fold((function(){t.onExecute(e,r)}),(function(){}))}))})),Ti((function(e,n){u(e).each((function(n){dy.append(e,mc(n)),t.onOpenMenu(e,n),t.highlightImmediately&&l(e,n)}))}))].concat(t.navigateOnHover?[pi(Xy(),(function(e,r){var o=r.event().item();w(e,o),b(e,o,n.HighlightParent),t.onHover(e,o)}))]:[])),E=function(t){return Dp.getHighlighted(t).bind(Dp.getHighlighted)},_=function(t){E(t).each((function(e){y(t,e)}))},A=function(t){i.getPrimary().each((function(e){l(t,e)}))},D=function(t){return C.from(t.components()[0]).filter((function(t){return"menu"===lu(t.element(),"role")}))},N=function(e){var n=i.getPrimary().bind((function(t){return E(e).bind((function(t){var n=a(t),r=It(i.getMenus()),o=np($(r,yw.extractPreparedMenu));return i.getTriggeringPath(n,(function(t){return c(e,o,t)}))})).map((function(e){return{primary:t,triggeringPath:e}}))}));n.fold((function(){D(e).each((function(n){t.onRepositionMenu(e,n,[])}))}),(function(n){var r=n.primary,o=n.triggeringPath;t.onRepositionMenu(e,r,o)}))},R={collapseMenu:_,highlightPrimary:A,repositionMenus:N};return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:Wg(t.tmenuBehaviours,[ny.config({mode:"special",onRight:O(x),onLeft:O(S),onEscape:O(k),focusIn:function(t,e){i.getPrimary().each((function(e){si(t,e.element(),Fo())}))}}),Dp.config({highlightClass:t.markers.selectedMenu,itemClass:t.markers.menu}),lp.config({find:function(t){return Dp.getHighlighted(t)}}),dy.config({})]),eventOrder:t.eventOrder,apis:R,events:T}},xw=u("collapse-item"),Cw=function(t,e,n){return{primary:t,menus:e,expansions:n}},Sw=function(t,e){return{primary:t,menus:se(t,e),expansions:{}}},kw=function(t){return{value:Cu(xw()),meta:{text:t}}},Ow=tp({name:"TieredMenu",configFields:[zs("onExecute"),zs("onEscape"),Ms("onOpenMenu"),Ms("onOpenSubmenu"),Ns("onRepositionMenu"),Ns("onCollapseMenu"),Pn("highlightImmediately",!0),On("data",[vn("primary"),vn("menus"),vn("expansions")]),Pn("fakeFocus",!1),Ns("onHighlight"),Ns("onHover"),_s(),vn("dom"),Pn("navigateOnHover",!0),Pn("stayInDom",!1),Ug("tmenuBehaviours",[ny,Dp,lp,dy]),Pn("eventOrder",{})],apis:{collapseMenu:function(t,e){t.collapseMenu(e)},highlightPrimary:function(t,e){t.highlightPrimary(e)},repositionMenus:function(t,e){t.repositionMenus(e)}},factory:ww,extraApis:{tieredData:Cw,singleData:Sw,collapseItem:kw}}),Tw=function(t,e,n,r,o){var i=function(){return t.lazySink(e)},u="horizontal"===r.type?{layouts:{onLtr:function(){return wl()},onRtl:function(){return xl()}}}:{},a=function(t){return 2===t.length},c=function(t){return a(t)?u:{}};return Ow.sketch({dom:{tag:"div"},data:r.data,markers:r.menu.markers,highlightImmediately:r.menu.highlightImmediately,onEscape:function(){return ig.close(e),t.onEscape.map((function(t){return t(e)})),C.some(!0)},onExecute:function(){return C.some(!0)},onOpenMenu:function(t,e){Om.positionWithinBounds(i().getOrDie(),n,e,o())},onOpenSubmenu:function(t,e,n,r){var o=i().getOrDie();Om.position(o,g({anchor:"submenu",item:e},c(r)),n)},onRepositionMenu:function(t,e,r){var u=i().getOrDie();Om.positionWithinBounds(u,n,e,o()),G(r,(function(t){var e=c(t.triggeringPath);Om.position(u,g({anchor:"submenu",item:t.triggeringItem},e),t.triggeredMenu)}))}})},Ew=function(t,e){var n=function(e,n){var r=t.getRelated(e);return r.exists((function(t){return ds(t,n)}))},r=function(t,e){ig.setContent(t,e)},o=function(t,e,n){i(t,e,n,C.none())},i=function(t,e,n,r){u(t,e,n,(function(){return r.map((function(t){return Jc(t)}))}))},u=function(e,n,r,o){var i=t.lazySink(e).getOrDie();ig.openWhileCloaked(e,r,(function(){return Om.positionWithinBounds(i,n,e,o())})),Vg.setValue(e,C.some({mode:"position",anchor:n,getBounds:o}))},a=function(t,e,n){c(t,e,n,(function(){return C.none()}))},c=function(e,n,r,o){var i=Tw(t,e,n,r,o);ig.open(e,i),Vg.setValue(e,C.some({mode:"menu",menu:i}))},s=function(t){ig.isOpen(t)&&(Vg.setValue(t,C.none()),ig.close(t))},l=function(t){return ig.getState(t)},f=function(e){ig.isOpen(e)&&Vg.getValue(e).each((function(n){switch(n.mode){case"menu":ig.getState(e).each((function(t){Ow.repositionMenus(t)}));break;case"position":var r=t.lazySink(e).getOrDie();Om.positionWithinBounds(r,n.anchor,e,n.getBounds());break}}))},d={setContent:r,showAt:o,showWithin:i,showWithinBounds:u,showMenuAt:a,showMenuWithinBounds:c,hide:s,getContent:l,reposition:f,isOpen:ig.isOpen};return{uid:t.uid,dom:t.dom,behaviours:Wg(t.inlineBehaviours,[ig.config({isPartOf:function(t,e,r){return ds(e,r)||n(t,r)},getAttachPoint:function(e){return t.lazySink(e).getOrDie()},onOpen:function(e){t.onShow(e)},onClose:function(e){t.onHide(e)}}),Vg.config({store:{mode:"memory",initialValue:C.none()}}),Ll.config({channels:g(g({},lg(g({isExtraPart:e.isExtraPart},t.fireDismissalEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})))),dg(g(g({},t.fireRepositionEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})),{doReposition:f})))})]),eventOrder:t.eventOrder,apis:d}},_w=tp({name:"InlineView",configFields:[vn("lazySink"),Ns("onShow"),Ns("onHide"),Rn("onEscape"),Ug("inlineBehaviours",[ig,Vg,Ll]),zn("fireDismissalEventInstead",[Pn("event",Qo())]),zn("fireRepositionEventInstead",[Pn("event",Zo())]),Pn("getRelated",C.none),Pn("isExtraPart",f),Pn("eventOrder",C.none)],factory:Ew,apis:{showAt:function(t,e,n,r){t.showAt(e,n,r)},showWithin:function(t,e,n,r,o){t.showWithin(e,n,r,o)},showWithinBounds:function(t,e,n,r,o){t.showWithinBounds(e,n,r,o)},showMenuAt:function(t,e,n,r){t.showMenuAt(e,n,r)},showMenuWithinBounds:function(t,e,n,r,o){t.showMenuWithinBounds(e,n,r,o)},hide:function(t,e){t.hide(e)},isOpen:function(t,e){return t.isOpen(e)},getContent:function(t,e){return t.getContent(e)},setContent:function(t,e,n){t.setContent(e,n)},reposition:function(t,e){t.reposition(e)}}}),Aw=function(t){return t.x},Dw=function(t,e){return t.x+t.width/2-e.width/2},Nw=function(t,e){return t.x+t.width-e.width},Rw=function(t){return t.y},Mw=function(t,e){return t.y+t.height-e.height},zw=function(t,e,n){return Is(Nw(t,e),Mw(t,e),n.innerSoutheast(),$s(),Qs(t,{right:0,bottom:3}),"layout-inner-se")},Bw=function(t,e,n){return Is(Aw(t),Mw(t,e),n.innerSouthwest(),qs(),Qs(t,{left:1,bottom:3}),"layout-inner-sw")},Pw=function(t,e,n){return Is(Nw(t,e),Rw(t),n.innerNortheast(),Ws(),Qs(t,{right:0,top:2}),"layout-inner-ne")},Hw=function(t,e,n){return Is(Aw(t),Rw(t),n.innerNorthwest(),js(),Qs(t,{left:1,top:2}),"layout-inner-nw")},Iw=function(t,e,n){return Is(Dw(t,e),Rw(t),n.innerNorth(),Gs(),Qs(t,{top:2}),"layout-inner-n")},Lw=function(t,e,n){return Is(Dw(t,e),Mw(t,e),n.innerSouth(),Ks(),Qs(t,{bottom:3}),"layout-inner-s")},Fw=tinymce.util.Tools.resolve("tinymce.util.Delay"),Vw=function(t){var e=Wy(t.action),n=t.dom.tag,r=function(e){return Lt(t.dom,"attributes").bind((function(t){return Lt(t,e)}))},o=function(){if("button"===n){var t=r("type").getOr("button"),e=r("role").map((function(t){return{role:t}})).getOr({});return g({type:t},e)}var o=r("role").getOr("button");return{role:o}};return{uid:t.uid,dom:t.dom,components:t.components,events:e,behaviours:qg.augment(t.buttonBehaviours,[Sy.config({}),ny.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:o()},eventOrder:t.eventOrder}},Uw=tp({name:"Button",factory:Vw,configFields:[Pn("uid",void 0),vn("dom"),Pn("components",[]),qg.field("buttonBehaviours",[Sy,ny]),_n("action"),_n("role"),Pn("eventOrder",{})]}),jw=function(t){var e=Yh(t)&&Vt(t,"uid")?t.uid:Du("memento"),n=function(t){return t.getSystem().getByUid(e).getOrDie()},r=function(t){return t.getSystem().getByUid(e).toOption()},o=function(){return g(g({},t),{uid:e})};return{get:n,getOpt:r,asSpec:o}},Ww=function(t){return C.from(t()["temporary-placeholder"]).getOr("!not found!")},qw=function(t,e){return C.from(e()[t.toLowerCase()]).getOrThunk((function(){return Ww(e)}))},$w=function(t,e,n){return C.from(e()[t.toLowerCase()]).or(n).getOrThunk((function(){return Ww(e)}))},Gw=function(t,e){return dt(t,(function(t){return C.from(e()[t.toLowerCase()])})).getOrThunk((function(){return Ww(e)}))},Kw={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},Xw=function(t){var e=jw({dom:{tag:"p",innerHtml:t.translationProvider(t.text)},behaviours:Al([dy.config({})])}),n=function(t){return{dom:{tag:"div",classes:["tox-bar"],attributes:{style:"width: "+t+"%"}}}},r=function(t){return{dom:{tag:"div",classes:["tox-text"],innerHtml:t+"%"}}},o=jw({dom:{tag:"div",classes:t.progress?["tox-progress-bar","tox-progress-indicator"]:["tox-progress-bar"]},components:[{dom:{tag:"div",classes:["tox-bar-container"]},components:[n(0)]},r(0)],behaviours:Al([dy.config({})])}),i=function(t,e){t.getSystem().isConnected()&&o.getOpt(t).each((function(t){dy.set(t,[{dom:{tag:"div",classes:["tox-bar-container"]},components:[n(e)]},r(e)])}))},u=function(t,n){if(t.getSystem().isConnected()){var r=e.get(t);dy.set(r,[sc(n)])}},a={updateProgress:i,updateText:u},c=nt([t.icon.toArray(),t.level.toArray(),t.level.bind((function(t){return C.from(Kw[t])})).toArray()]);return{uid:t.uid,dom:{tag:"div",attributes:{role:"alert"},classes:t.level.map((function(t){return["tox-notification","tox-notification--in","tox-notification--"+t]})).getOr(["tox-notification","tox-notification--in"])},components:[{dom:{tag:"div",classes:["tox-notification__icon"],innerHtml:Gw(c,t.iconProvider)}},{dom:{tag:"div",classes:["tox-notification__body"]},components:[e.asSpec()],behaviours:Al([dy.config({})])}].concat(t.progress?[o.asSpec()]:[]).concat(t.closeButton?[Uw.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"]},components:[{dom:{tag:"div",classes:["tox-icon"],innerHtml:qw("close",t.iconProvider),attributes:{"aria-label":t.translationProvider("Close")}}}],action:function(e){t.onAction(e)}})]:[]),apis:a}},Yw=tp({name:"Notification",factory:Xw,configFields:[_n("level"),vn("progress"),vn("icon"),vn("onAction"),vn("text"),vn("iconProvider"),vn("translationProvider"),Vn("closeButton",!0)],apis:{updateProgress:function(t,e,n){t.updateProgress(e,n)},updateText:function(t,e,n){t.updateText(e,n)}}});function Jw(t,e,n){var r=e.backstage,o=function(t){switch(t){case"bc-bc":return Lw;case"tc-tc":return Iw;case"tc-bc":return dl;case"bc-tc":default:return ml}},i=function(t){G(t,(function(t){return t.moveTo(0,0)}))},u=function(t){t.length>0&&(st(t).each((function(t){return t.moveRel(null,"banner")})),G(t,(function(e,n){n>0&&e.moveRel(t[n-1].getEl(),"bc-tc")})))},a=function(t){i(t),u(t)},c=function(t,i){var u=!t.closeButton&&t.timeout&&(t.timeout>0||t.timeout<0),a=function(){i(),_w.hide(s)},c=dc(Yw.sketch({text:t.text,level:U(["success","error","warning","warn","info"],t.type)?t.type:void 0,progress:!0===t.progressBar,icon:C.from(t.icon),closeButton:!u,onAction:a,iconProvider:r.shared.providers.icons,translationProvider:r.shared.providers.translate})),s=dc(_w.sketch(g({dom:{tag:"div",classes:["tox-notifications-container"]},lazySink:e.backstage.shared.getSink,fireDismissalEventInstead:{}},r.shared.header.isPositionedAtTop()?{}:{fireRepositionEventInstead:{}})));return n.add(s),t.timeout>0&&Fw.setTimeout((function(){a()}),t.timeout),{close:a,moveTo:function(t,e){_w.showAt(s,{anchor:"makeshift",x:t,y:e},mc(c))},moveRel:function(t,n){if("banner"!==n){var r=o(n),i={anchor:"node",root:Ia(),node:C.some(Zn.fromDom(t)),layouts:{onRtl:function(){return[r]},onLtr:function(){return[r]}}};_w.showAt(s,i,mc(c))}else _w.showAt(s,e.backstage.shared.anchors.banner(),mc(c))},text:function(t){Yw.updateText(c,t)},settings:t,getEl:function(){return c.element().dom()},progressBar:{value:function(t){Yw.updateProgress(c,t)}}}},s=function(t){t.close()},l=function(t){return t.settings};return{open:c,close:s,reposition:a,getArgs:l}}var Qw,Zw=function(t,n){var r=null,o=function(){null!==r&&(e.clearTimeout(r),r=null)},i=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];null===r&&(r=e.setTimeout((function(){t.apply(null,o),r=null}),n))};return{cancel:o,throttle:i}},tx=function(t,n){var r=null,o=function(){null!==r&&(e.clearTimeout(r),r=null)},i=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];null!==r&&e.clearTimeout(r),r=e.setTimeout((function(){t.apply(null,o),r=null}),n)};return{cancel:o,throttle:i}},ex=tinymce.util.Tools.resolve("tinymce.dom.TextSeeker"),nx=function(t,e){return t.isBlock(e)||U(["BR","IMG","HR","INPUT"],e.nodeName)||"false"===t.getContentEditable(e)},rx=function(t,e,n,r,o){var i=ex(t,(function(e){return nx(t,e)}));return C.from(i.backwards(e,n,r,o))},ox="[data-mce-autocompleter]",ix=function(t,e){return ux(Zn.fromDom(t.selection.getNode())).getOrThunk((function(){var n=Zn.fromHtml('<span data-mce-autocompleter="1" data-mce-bogus="1"></span>',t.getDoc());return Yi(n,Zn.fromDom(e.extractContents())),e.insertNode(n.dom()),Vi(n).each((function(t){return t.dom().normalize()})),Ed(n).map((function(e){t.selection.setCursorLocation(e.dom(),Sd(e))})),n}))},ux=function(t){return cs(t,ox)},ax=function(t){return t.collapsed&&3===t.startContainer.nodeType},cx=function(t){return t.toString().replace(/\u00A0/g," ").replace(/\uFEFF/g,"")},sx=function(t){return""!==t&&-1!==" \f\n\r\t\v".indexOf(t)},lx=function(t,e){return t.substring(e.length)},fx=function(t,e,n){var r;for(r=e-1;r>=0;r--){var o=t.charAt(r);if(sx(o))return C.none();if(o===n)break}return C.some(r)},dx=function(t,e,n,r){if(void 0===r&&(r=0),!ax(e))return C.none();var o=function(t,e,r){return fx(r,e,n).getOr(e)},i=t.getParent(e.startContainer,t.isBlock)||t.getRoot();return rx(t,e.startContainer,e.startOffset,o,i).bind((function(t){var o=e.cloneRange();if(o.setStart(t.container,t.offset),o.setEnd(e.endContainer,e.endOffset),o.collapsed)return C.none();var i=cx(o),u=i.lastIndexOf(n);return 0!==u||lx(i,n).length<r?C.none():C.some({text:lx(i,n),range:o,triggerChar:n})}))},mx=function(t,e,n,r){return void 0===r&&(r=0),ux(Zn.fromDom(e.startContainer)).fold((function(){return dx(t,e,n,r)}),(function(e){var r=t.createRng();r.selectNode(e.dom());var o=cx(r);return C.some({range:r,text:lx(o,n),triggerChar:n})}))},gx=function(t,e){e.on("keypress compositionend",t.onKeypress.throttle),e.on("remove",t.onKeypress.cancel);var n=function(t,e){ai(t,Eo(),{raw:e})};e.on("keydown",(function(e){var r=function(){return t.getView().bind(Dp.getHighlighted)};8===e.which&&t.onKeypress.throttle(e),t.isActive()&&(27===e.which&&t.cancelIfNecessary(),t.isMenuOpen()?13===e.which?(r().each(ci),e.preventDefault()):40===e.which?(r().fold((function(){t.getView().each(Dp.highlightFirst)}),(function(t){n(t,e)})),e.preventDefault(),e.stopImmediatePropagation()):37!==e.which&&38!==e.which&&39!==e.which||r().each((function(t){n(t,e),e.preventDefault(),e.stopImmediatePropagation()})):13!==e.which&&38!==e.which&&40!==e.which||t.cancelIfNecessary())})),e.on("NodeChange",(function(e){t.isActive()&&!t.isProcessingAction()&&ux(Zn.fromDom(e.element)).isNone()&&t.cancelIfNecessary()}))},hx={setup:gx},px=tinymce.util.Tools.resolve("tinymce.util.Promise"),vx=function(t,e){return{container:t,offset:e}},bx=function(t){return t.nodeType===e.Node.TEXT_NODE},yx=function(t){return t.nodeType===e.Node.ELEMENT_NODE},wx=function(t){if(bx(t))return vx(t,t.data.length);var e=t.childNodes;return e.length>0?wx(e[e.length-1]):vx(t,e.length)},xx=function(t,e){var n=t.childNodes;return n.length>0&&e<n.length?xx(n[e],0):n.length>0&&yx(t)&&n.length===e?wx(n[n.length-1]):vx(t,e)},Cx=function(t,e){return rx(t,e.container,e.offset,(function(t,e){return 0===e?-1:e}),t.getRoot()).filter((function(t){var e=t.container.data.charAt(t.offset-1);return!sx(e)})).isSome()},Sx=function(t){return function(e){var n=xx(e.startContainer,e.startOffset);return!Cx(t,n)}},kx=function(t,e,n){return dt(n.triggerChars,(function(n){return mx(t,e,n)}))},Ox=function(t,e){var n=e(),r=t.selection.getRng();return kx(t.dom,r,n).bind((function(n){return Tx(t,e,n)}))},Tx=function(t,e,n,r){void 0===r&&(r={});var o=e(),i=t.selection.getRng(),u=i.startContainer.nodeValue,a=Y(o.lookupByChar(n.triggerChar),(function(e){return n.text.length>=e.minChars&&e.matches.getOrThunk((function(){return Sx(t.dom)}))(n.range,u,n.text)}));if(0===a.length)return C.none();var c=px.all($(a,(function(t){var e=t.fetch(n.text,t.maxResults,r);return e.then((function(e){return{matchText:n.text,items:e,columns:t.columns,onAction:t.onAction}}))})));return C.some({lookupData:c,context:n})},Ex=Ie([wn("type"),Nn("text")]),_x=function(t){return en("separatormenuitem",Ex,t)},Ax=Ie([$n("type",(function(){return"autocompleteitem"})),$n("active",(function(){return!1})),$n("disabled",(function(){return!1})),Pn("meta",{}),wn("value"),Nn("text"),Nn("icon")]),Dx=Ie([wn("type"),wn("ch"),In("minChars",1),Pn("columns",1),In("maxResults",10),Rn("matches"),Sn("fetch"),Sn("onAction")]),Nx=function(t){return en("Autocompleter.Separator",Ex,t)},Rx=function(t){return en("Autocompleter.Item",Ax,t)},Mx=function(t){return en("Autocompleter",Dx,t)},zx=function(t){var e={};return G(t,(function(t){e[t]={}})),_t(e)},Bx=function(t){var e=t.ui.registry.getAll().popups,n=Nt(e,(function(t){return Mx(t).fold((function(t){throw new Error(on(t))}),(function(t){return t}))})),r=zx(Pt(n,(function(t){return t.ch}))),o=It(n),i=function(t){return Y(o,(function(e){return e.ch===t}))};return{dataset:n,triggerChars:r,lookupByChar:i}};(function(t){t[t["CLOSE_ON_EXECUTE"]=0]="CLOSE_ON_EXECUTE",t[t["BUBBLE_TO_SANDBOX"]=1]="BUBBLE_TO_SANDBOX"})(Qw||(Qw={}));var Px,Hx=Qw,Ix="tox-menu-nav__js",Lx="tox-collection__item",Fx="tox-swatch",Vx={normal:Ix,color:Fx},Ux="tox-collection__item--enabled",jx="tox-collection__group-heading",Wx="tox-collection__item-icon",qx="tox-collection__item-label",$x="tox-collection__item-accessory",Gx="tox-collection__item-caret",Kx="tox-collection__item-checkmark",Xx="tox-collection__item--active",Yx="tox-collection__item-icon-rtl",Jx=function(t){return Lt(Vx,t).getOr(Ix)},Qx=function(t){return"color"===t?"tox-swatches":"tox-menu"},Zx=function(t){return{backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:Qx(t),tieredMenu:"tox-tiered-menu"}},tC=function(t){var e=Zx(t);return{backgroundMenu:e.backgroundMenu,selectedMenu:e.selectedMenu,menu:e.menu,selectedItem:e.selectedItem,item:Jx(t)}},eC=function(t,e,n){var r=Zx(n);return{tag:"div",classes:nt([[r.menu,"tox-menu-"+e+"-column"],t?[r.hasIcons]:[]])}},nC=[mw.parts().items({})],rC=function(t,e,n){var r=Zx(n),o={tag:"div",classes:nt([[r.tieredMenu]])};return{dom:o,markers:tC(n)}},oC=function(t,e){return function(n){var r=q(n,e);return $(r,(function(e){return{dom:t,components:e}}))}},iC=function(t){return{dom:{tag:"div",classes:["tox-menu","tox-swatches-menu"]},components:[{dom:{tag:"div",classes:["tox-swatches"]},components:[mw.parts().items({preprocess:"auto"!==t?oC({tag:"div",classes:["tox-swatches__row"]},t):a})]}]}},uC=function(t){return{dom:{tag:"div",classes:["tox-menu","tox-collection","tox-collection--toolbar","tox-collection--toolbar-lg"]},components:[mw.parts().items({preprocess:oC({tag:"div",classes:["tox-collection__group"]},t)})]}},aC=function(t,e){var n=[],r=[];return G(t,(function(t,o){e(t,o)?(r.length>0&&n.push(r),r=[],Ft(t.dom,"innerHtml")&&r.push(t)):r.push(t)})),r.length>0&&n.push(r),$(n,(function(t){return{dom:{tag:"div",classes:["tox-collection__group"]},components:t}}))},cC=function(t,e,n){return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===t?["tox-collection--list"]:["tox-collection--grid"])},components:[mw.parts().items({preprocess:function(n){return"auto"!==t&&t>1?oC({tag:"div",classes:["tox-collection__group"]},t)(n):aC(n,(function(t,n){return"separator"===e[n].type}))}})]}},sC=function(t,e){return{dom:{tag:"div",classes:["tox-collection","tox-collection--horizontal"]},components:[mw.parts().items({preprocess:function(e){return aC(e,(function(e,n){return"separator"===t[n].type}))}})]}},lC=function(t){return j(t,(function(t){return"icon"in t&&void 0!==t.icon}))},fC=function(t){return e.console.error(on(t)),e.console.log(t),C.none()},dC=function(t,e,n,r,o){var i=sC(n);return{value:t,dom:i.dom,components:i.components,items:n}},mC=function(t,e,n,r,o){if("color"===o){var i=iC(r);return{value:t,dom:i.dom,components:i.components,items:n}}if("normal"===o&&"auto"===r){i=cC(r,n);return{value:t,dom:i.dom,components:i.components,items:n}}if("normal"===o&&1===r){i=cC(1,n);return{value:t,dom:i.dom,components:i.components,items:n}}if("normal"===o){i=cC(r,n);return{value:t,dom:i.dom,components:i.components,items:n}}if("listpreview"===o&&"auto"!==r){i=uC(r);return{value:t,dom:i.dom,components:i.components,items:n}}return{value:t,dom:eC(e,r,o),components:nC,items:n}},gC=[Vn("disabled",!1),Nn("text"),Nn("shortcut"),qe("value","value",ne((function(){return Cu("menuitem-value")})),cn()),Pn("meta",{})],hC=Ie([wn("type"),Vn("active",!1),Nn("icon")].concat(gC)),pC=function(t){return en("choicemenuitem",hC,t)},vC=["inserttable","colorswatch"],bC=Ie([wn("type"),xn("fancytype",vC),Un("onAction",n)]),yC=function(t){return en("fancymenuitem",bC,t)},wC=Ie([wn("type"),Un("onSetup",(function(){return n})),Un("onAction",n),Nn("icon")].concat(gC)),xC=function(t){return en("menuitem",wC,t)},CC=Ie([wn("type"),Sn("getSubmenuItems"),Un("onSetup",(function(){return n})),Nn("icon")].concat(gC)),SC=function(t){return en("nestedmenuitem",CC,t)},kC=Ie([wn("type"),Nn("icon"),Vn("active",!1),Un("onSetup",(function(){return n})),Sn("onAction")].concat(gC)),OC=function(t){return en("togglemenuitem",kC,t)},TC=function(t,e,n){var r=Ad(t.element(),"."+n);if(r.length>0){var o=et(r,(function(t){var n=t.dom().getBoundingClientRect().top,o=r[0].dom().getBoundingClientRect().top;return Math.abs(n-o)>e})).getOr(r.length);return C.some({numColumns:o,numRows:Math.ceil(r.length/o)})}return C.none()},EC=function(t,e){return Al([gy(t,e)])},_C=function(t){return EC(Cu("unnamed-events"),t)},AC={namedEvents:EC,unnamedEvents:_C},DC=[vn("lazySink"),vn("tooltipDom"),Pn("exclusive",!0),Pn("tooltipComponents",[]),Pn("delay",300),Fn("mode","normal",["normal","follow-highlight"]),Pn("anchor",(function(t){return{anchor:"hotspot",hotspot:t,layouts:{onLtr:u([ml,dl,cl,ll,sl,fl]),onRtl:u([ml,dl,cl,ll,sl,fl])}}})),Ns("onHide"),Ns("onShow")],NC=function(){var t=Gn(C.none()),n=Gn(C.none()),r=function(){return n.get()},o=function(t){n.set(C.some(t))},i=function(){n.set(C.none())},a=function(){t.get().each((function(t){e.clearTimeout(t)}))},c=function(n,r){a(),t.set(C.some(e.setTimeout((function(){n()}),r)))},s=function(){return n.get().isSome()},l=u("not-implemented");return ju({getTooltip:r,isShowing:s,setTooltip:o,clearTooltip:i,clearTimer:a,resetTimer:c,readState:l})},RC=Object.freeze({__proto__:null,init:NC}),MC=Cu("tooltip.exclusive"),zC=Cu("tooltip.show"),BC=Cu("tooltip.hide"),PC=function(t,e,n){t.getSystem().broadcastOn([MC],{})},HC=function(t,e,n,r){n.getTooltip().each((function(t){t.getSystem().isConnected()&&dy.set(t,r)}))},IC=Object.freeze({__proto__:null,hideAllExclusive:PC,setComponents:HC}),LC=function(t,e){var n=function(n){e.getTooltip().each((function(r){zm(r),t.onHide(n,r),e.clearTooltip()})),e.clearTimer()},r=function(n){if(!e.isShowing()){PC(n);var r=t.lazySink(n).getOrDie(),o=n.getSystem().build({dom:t.tooltipDom,components:t.tooltipComponents,events:di("normal"===t.mode?[pi(ko(),(function(t){ui(n,zC)})),pi(Co(),(function(t){ui(n,BC)}))]:[]),behaviours:Al([dy.config({})])});e.setTooltip(o),Nm(r,o),t.onShow(n,o),Om.position(r,t.anchor(n),o)}};return di(nt([[pi(zC,(function(n){e.resetTimer((function(){r(n)}),t.delay)})),pi(BC,(function(r){e.resetTimer((function(){n(r)}),t.delay)})),pi(Io(),(function(t,e){var r=e;U(r.channels(),MC)&&n(t)})),Ei((function(t){n(t)}))],"normal"===t.mode?[pi(Oo(),(function(t){ui(t,zC)})),pi(Po(),(function(t){ui(t,BC)})),pi(ko(),(function(t){ui(t,zC)})),pi(Co(),(function(t){ui(t,BC)}))]:[pi(oi(),(function(t,e){ui(t,zC)})),pi(ii(),(function(t){ui(t,BC)}))]]))},FC=Object.freeze({__proto__:null,events:LC}),VC=Nl({fields:DC,name:"tooltipping",active:FC,state:RC,apis:IC}),UC=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),jC=tinymce.util.Tools.resolve("tinymce.util.I18n"),WC=["input","button","textarea","select"],qC=function(t,e,n){var r=e.disabled()?ZC:tS;r(t,e,n)},$C=function(t,e){return!0===e.useNative&&U(WC,Di(t.element()))},GC=function(t){return du(t.element(),"disabled")},KC=function(t){cu(t.element(),"disabled","disabled")},XC=function(t){mu(t.element(),"disabled")},YC=function(t){return"true"===lu(t.element(),"aria-disabled")},JC=function(t){cu(t.element(),"aria-disabled","true")},QC=function(t){cu(t.element(),"aria-disabled","false")},ZC=function(t,e,n){e.disableClass.each((function(e){xa(t.element(),e)}));var r=$C(t,e)?KC:JC;r(t),e.onDisabled(t)},tS=function(t,e,n){e.disableClass.each((function(e){Sa(t.element(),e)}));var r=$C(t,e)?XC:QC;r(t),e.onEnabled(t)},eS=function(t,e){return $C(t,e)?GC(t):YC(t)},nS=function(t,e,n,r){var o=r?ZC:tS;o(t,e,n)},rS=Object.freeze({__proto__:null,enable:tS,disable:ZC,isDisabled:eS,onLoad:qC,set:nS}),oS=function(t,e){return Ku({classes:e.disabled()?e.disableClass.toArray():[]})},iS=function(t,e){return di([mi(Lo(),(function(e,n){return eS(e,t)})),Sl(t,e,qC)])},uS=Object.freeze({__proto__:null,exhibit:oS,events:iS}),aS=[Un("disabled",f),Pn("useNative",!0),_n("disableClass"),Ns("onDisabled"),Ns("onEnabled")],cS=Nl({fields:aS,name:"disabling",active:uS,apis:rS}),sS=tinymce.util.Tools.resolve("tinymce.EditorManager"),lS=function(t){var e=t.getParam("skin"),n=t.getParam("skin_url");if(!1!==e){var r=e||"oxide";n=n?t.documentBaseURI.toAbsolute(n):sS.baseURL+"/skins/ui/"+r}return n},fS=function(t){return t.getParam("readonly",!1,"boolean")},dS=function(t){return!1===t.getParam("skin")},mS=function(t){return t.getParam("height",Math.max(t.getElement().offsetHeight,200))},gS=function(t){return t.getParam("width",UC.DOM.getStyle(t.getElement(),"width"))},hS=function(t){return C.from(t.getParam("min_width")).filter(B)},pS=function(t){return C.from(t.getParam("min_height")).filter(B)},vS=function(t){return C.from(t.getParam("max_width")).filter(B)},bS=function(t){return C.from(t.getParam("max_height")).filter(B)},yS=function(t){return C.from(t.getParam("style_formats")).filter(A)},wS=function(t){return t.getParam("style_formats_merge",!1,"boolean")},xS=function(t){return t.getParam("removed_menuitems","")},CS=function(t){return!1!==t.getParam("menubar",!0,"boolean")},SS=function(t){var e=t.getParam("toolbar",!0),n=!0===e,r=E(e),o=A(e)&&e.length>0;return!OS(t)&&(o||r||n)},kS=function(t){var e=W(9,(function(e){return t.getParam("toolbar"+(e+1),!1,"string")})),n=Y(e,(function(t){return"string"===typeof t}));return n.length>0?C.some(n):C.none()},OS=function(t){return kS(t).fold((function(){var e=t.getParam("toolbar",[],"string[]");return e.length>0}),(function(){return!0}))};(function(t){t["default"]="wrap",t["floating"]="floating",t["sliding"]="sliding",t["scrolling"]="scrolling"})(Px||(Px={}));var TS,ES=function(t){return t.getParam("toolbar_mode","","string")};(function(t){t["auto"]="auto",t["top"]="top",t["bottom"]="bottom"})(TS||(TS={}));var _S=function(t){return t.getParam("toolbar_groups",{},"object")},AS=function(t){return t.getParam("toolbar_location",TS.auto,"string")},DS=function(t){return AS(t)===TS.bottom},NS=function(t){return t.getParam("fixed_toolbar_container","","string")},RS=function(t){var e=NS(t);return e.length>0&&t.inline?as(Ia(),e):C.none()},MS=function(t){return t.inline&&RS(t).isSome()},zS=function(t){var e=RS(t);return e.getOr(Ia())},BS=function(t){return t.inline&&!CS(t)&&!SS(t)&&!OS(t)},PS=function(t){var e=t.getParam("toolbar_sticky",!1,"boolean");return(e||t.inline)&&!MS(t)&&!BS(t)},HS=function(t){return t.getParam("draggable_modal",!1,"boolean")},IS=function(t){var e=t.getParam("menu");return e?Nt(e,(function(t){return g(g({},t),{items:t.items})})):{}},LS=function(t){return t.getParam("menubar")},FS=function(t){return t.getParam("toolbar",!0)},VS=function(t){return t.getParam("file_picker_callback")},US=function(t){return t.getParam("file_picker_types")},jS=function(t){return t.getParam("file_browser_callback_types")},WS=function(t){return!1===t.getParam("typeahead_urls")},qS=function(t){return t.getParam("anchor_top","#top","string")},$S=function(t){return t.getParam("anchor_bottom","#bottom","string")},GS=function(t){var e=t.getParam("file_picker_validator_handler",void 0,"function");return void 0===e?t.getParam("filepicker_validator_handler",void 0,"function"):e},KS="silver.readonly",XS=Ie([Cn("readonly")]),YS=function(t,e){var n=t.outerContainer,r=n.element();e&&(t.mothership.broadcastOn([ug()],{target:r}),t.uiMothership.broadcastOn([ug()],{target:r})),t.mothership.broadcastOn([KS],{readonly:e}),t.uiMothership.broadcastOn([KS],{readonly:e})},JS=function(t,e){t.on("init",(function(){t.mode.isReadOnly()&&YS(e,!0)})),t.on("SwitchMode",(function(){return YS(e,t.mode.isReadOnly())})),fS(t)&&t.setMode("readonly")},QS=function(){var t;return Ll.config({channels:(t={},t[KS]={schema:XS,onReceive:function(t,e){cS.set(t,e.readonly)}},t)})},ZS=function(t){return cS.config({disabled:t,disableClass:"tox-collection__item--state-disabled"})},tk=function(t){return cS.config({disabled:t})},ek=function(t){return cS.config({disabled:t,disableClass:"tox-tbtn--disabled"})},nk=function(t){return cS.config({disabled:t,disableClass:"tox-tbtn--disabled",useNative:!1})},rk={item:ZS,button:tk,splitButton:ek,toolbarButton:nk},ok=function(t,e){var n=t.getApi(e);return function(t){t(n)}},ik=function(t,e){return Ti((function(n){var r=ok(t,n);r((function(n){var r=t.onSetup(n);null!==r&&void 0!==r&&e.set(r)}))}))},uk=function(t,e){return Ei((function(n){return ok(t,n)(e.get())}))},ak=function(t,e){return Ai((function(n,r){ok(t,n)(t.onAction),t.triggersSubmenu||e!==Hx.CLOSE_ON_EXECUTE||(ui(n,jo()),r.stop())}))},ck={"alloy.execute":["disabling","alloy.base.behaviour","toggling","item-events"]},sk=function(t){return rt(t,(function(t){return t.toArray()}))},lk=function(t,e,r,o){var i=Gn(n);return{type:"item",dom:e.dom,components:sk(e.optComponents),data:t.data,eventOrder:ck,hasSubmenu:t.triggersSubmenu,itemBehaviours:Al([gy("item-events",[ak(t,r),ik(t,i),uk(t,i)]),rk.item((function(){return t.disabled||o.isReadOnly()})),QS(),dy.config({})].concat(t.itemBehaviours))}},fk=function(t){return{value:t.value,meta:g({text:t.text.getOr("")},t.meta)}},dk=tinymce.util.Tools.resolve("tinymce.Env"),mk=function(t){var e={alt:"⌥",ctrl:"⌃",shift:"⇧",meta:"⌘",access:"⌃⌥"},n={meta:"Ctrl",access:"Shift+Alt"},r=dk.mac?e:n,o=t.split("+"),i=$(o,(function(t){var e=t.toLowerCase().trim();return Ft(r,e)?r[e]:t}));return dk.mac?i.join(""):i.join("+")},gk=function(t){return{dom:{tag:"div",classes:[Wx],innerHtml:t}}},hk=function(t){return{dom:{tag:"div",classes:[qx]},components:[sc(jC.translate(t))]}},pk=function(t){return{dom:{tag:"div",classes:[qx],innerHtml:t}}},vk=function(t,e){return{dom:{tag:"div",classes:[qx]},components:[{dom:{tag:t.tag,styles:t.styles},components:[sc(jC.translate(e))]}]}},bk=function(t){return{dom:{tag:"div",classes:[$x],innerHtml:mk(t)}}},yk=function(t){return{dom:{tag:"div",classes:[Kx],innerHtml:qw("checkmark",t)}}},wk=function(t){return{dom:{tag:"div",classes:[Gx],innerHtml:qw("chevron-right",t)}}},xk=function(t){return{dom:{tag:"div",classes:[Gx],innerHtml:qw("chevron-down",t)}}},Ck=function(t,e,n,r){var o="custom",i="remove",u=function(){var u=Fx,a=n.getOr(""),c=t.map((function(t){return{title:r.translate(t)}})).getOr({}),s={tag:"div",attributes:c,classes:[u]};return g(g({},s),e===o?{tag:"button",classes:p(s.classes,["tox-swatches__picker-btn"]),innerHtml:a}:e===i?{classes:p(s.classes,["tox-swatch--remove"]),innerHtml:a}:{attributes:g(g({},s.attributes),{"data-mce-color":e}),styles:{"background-color":e}})};return{dom:u(),optComponents:[]}},Sk=function(t,e,n,r,o){var i=n?e.or(C.some("")).map(gk):C.none(),u=t.checkMark,a=t.ariaLabel.map((function(t){return{attributes:{title:jC.translate(t)}}})).getOr({}),c=g({tag:"div",classes:[Ix,Lx].concat(o?[Yx]:[])},a),s=t.htmlContent.fold((function(){return t.textContent.map(r)}),(function(t){return C.some(pk(t))})),l={dom:c,optComponents:[i,s,t.shortcutContent.map(bk),u,t.caret]};return l},kk=["list-num-default","list-num-lower-alpha","list-num-lower-greek","list-num-lower-roman","list-num-upper-alpha","list-num-upper-roman"],Ok=["list-bull-circle","list-bull-default","list-bull-square"],Tk=function(t,e,n,r){void 0===r&&(r=C.none());var o=function(t){return t.map((function(t){return jC.isRtl()&&U(kk,t)?t+"-rtl":t}))},i=jC.isRtl()&&t.iconContent.exists((function(t){return U(Ok,t)})),u=o(t.iconContent).map((function(t){return $w(t,e.icons,r)})),a=C.from(t.meta).fold((function(){return hk}),(function(t){return Ft(t,"style")?c(vk,t.style):hk}));return"color"===t.presets?Ck(t.ariaLabel,t.value,u,e):Sk(t,u,n,a,i)},Ek=function(t,e){return Lt(t,"tooltipWorker").map((function(t){return[VC.config({lazySink:e.getSink,tooltipDom:{tag:"div",classes:["tox-tooltip-worker-container"]},tooltipComponents:[],anchor:function(t){return{anchor:"submenu",item:t,overrides:{maxHeightFunction:Sf}}},mode:"follow-highlight",onShow:function(e,n){t((function(t){VC.setComponents(e,[lc({element:Zn.fromDom(t)})])}))}})]})).getOr([])},_k=function(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")},Ak=function(t){return UC.DOM.encode(t)},Dk=function(t,e){var n=jC.translate(t),r=Ak(n);if(e.length>0){var o=new RegExp(_k(e),"gi");return r.replace(o,(function(t){return'<span class="tox-autocompleter-highlight">'+t+"</span>"}))}return r},Nk=function(t,e,n,r,o,i,u,a){void 0===a&&(a=!0);var c=Tk({presets:r,textContent:C.none(),htmlContent:n?t.text.map((function(t){return Dk(t,e)})):C.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:C.none(),checkMark:C.none(),caret:C.none(),value:t.value},u.providers,a,t.icon);return lk({data:fk(t),disabled:t.disabled,getApi:function(){return{}},onAction:function(e){return o(t.value,t.meta)},onSetup:function(){return function(){}},triggersSubmenu:!1,itemBehaviours:Ek(t.meta,u)},c,i,u.providers)},Rk=function(t,e,n,r,o,i,u,a){void 0===a&&(a=!0);var c=function(t){return{setActive:function(e){Uy.set(t,e)},isActive:function(){return Uy.isOn(t)},isDisabled:function(){return cS.isDisabled(t)},setDisabled:function(e){return cS.set(t,e)}}},s=Tk({presets:n,textContent:e?t.text:C.none(),htmlContent:C.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:e?t.shortcut:C.none(),checkMark:e?C.some(yk(u.icons)):C.none(),caret:C.none(),value:t.value},u,a);return Kt(lk({data:fk(t),disabled:t.disabled,getApi:c,onAction:function(e){return r(t.value)},onSetup:function(t){return t.setActive(o),function(){}},triggersSubmenu:!1,itemBehaviours:[]},s,i,u),{toggling:{toggleClass:Ux,toggleOnExecute:!1,selected:t.active}})},Mk=u(_h(ew(),nw())),zk=Cu("cell-over"),Bk=Cu("cell-execute"),Pk=function(t,e,n){var r,o=function(n){return ai(n,zk,{row:t,col:e})},i=function(n){return ai(n,Bk,{row:t,col:e})},u=function(t,e){e.stop(),i(t)};return dc({dom:{tag:"div",attributes:(r={role:"button"},r["aria-labelledby"]=n,r)},behaviours:Al([gy("insert-table-picker-cell",[pi(ko(),Sy.focus),pi(Lo(),i),pi(No(),u),pi(Vo(),u)]),Uy.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),Sy.config({onFocus:o})])})},Hk=function(t,e,n){for(var r=[],o=0;o<e;o++){for(var i=[],u=0;u<n;u++)i.push(Pk(o,u,t));r.push(i)}return r},Ik=function(t,e,n,r,o){for(var i=0;i<r;i++)for(var u=0;u<o;u++)Uy.set(t[i][u],i<=e&&u<=n)},Lk=function(t){return rt(t,(function(t){return $(t,mc)}))},Fk=function(t,e){return sc(e+1+"x"+(t+1))},Vk=function(t){var e=10,n=10,r=Cu("size-label"),o=Hk(r,e,n),i=jw({dom:{tag:"span",classes:["tox-insert-table-picker__label"],attributes:{id:r}},components:[sc("0x0")],behaviours:Al([dy.config({})])});return{type:"widget",data:{value:Cu("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[Mk().widget({dom:{tag:"div",classes:["tox-insert-table-picker"]},components:Lk(o).concat(i.asSpec()),behaviours:Al([gy("insert-table-picker",[Ci(zk,(function(t,r,u){var a=u.event().row(),c=u.event().col();Ik(o,a,c,e,n),dy.set(i.get(t),[Fk(a,c)])})),Ci(Bk,(function(e,n,r){t.onAction({numRows:r.event().row()+1,numColumns:r.event().col()+1}),ui(e,jo())}))]),ny.config({initSize:{numRows:e,numColumns:n},mode:"flatgrid",selector:'[role="button"]'})])})]}},Uk=function(t){return{value:t}},jk=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,Wk=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,qk=function(t){return jk.test(t)||Wk.test(t)},$k=function(t){var e=t.value.replace(jk,(function(t,e,n,r){return e+e+n+n+r+r}));return{value:e}},Gk=function(t){var e=$k(t),n=Wk.exec(e.value);return null===n?["FFFFFF","FF","FF","FF"]:n},Kk=function(t){var e=t.toString(16);return 1===e.length?"0"+e:e},Xk=function(t){var e=Kk(t.red)+Kk(t.green)+Kk(t.blue);return Uk(e)},Yk=Math.min,Jk=Math.max,Qk=Math.round,Zk=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,tO=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,eO=function(t,e,n,r){return{red:t,green:e,blue:n,alpha:r}},nO=function(t){var e=parseInt(t,10);return e.toString()===t&&e>=0&&e<=255},rO=function(t){var e,n,r,o=(t.hue||0)%360,i=t.saturation/100,u=t.value/100;if(i=Jk(0,Yk(i,1)),u=Jk(0,Yk(u,1)),0===i)return e=n=r=Qk(255*u),eO(e,n,r,1);var a=o/60,c=u*i,s=c*(1-Math.abs(a%2-1)),l=u-c;switch(Math.floor(a)){case 0:e=c,n=s,r=0;break;case 1:e=s,n=c,r=0;break;case 2:e=0,n=c,r=s;break;case 3:e=0,n=s,r=c;break;case 4:e=s,n=0,r=c;break;case 5:e=c,n=0,r=s;break;default:e=n=r=0}return e=Qk(255*(e+l)),n=Qk(255*(n+l)),r=Qk(255*(r+l)),eO(e,n,r,1)},oO=function(t){var e=Gk(t),n=parseInt(e[1],16),r=parseInt(e[2],16),o=parseInt(e[3],16);return eO(n,r,o,1)},iO=function(t,e,n,r){var o=parseInt(t,10),i=parseInt(e,10),u=parseInt(n,10),a=parseFloat(r);return eO(o,i,u,a)},uO=function(t){if("transparent"===t)return C.some(eO(0,0,0,0));var e=Zk.exec(t);if(null!==e)return C.some(iO(e[1],e[2],e[3],"1"));var n=tO.exec(t);return null!==n?C.some(iO(n[1],n[2],n[3],n[4])):C.none()},aO=function(t){return"rgba("+t.red+","+t.green+","+t.blue+","+t.alpha+")"},cO=eO(255,0,0,1),sO=function(t){return t.fire("SkinLoaded")},lO=function(t,e){return t.fire("SkinLoadError",e)},fO=function(t){return t.fire("ResizeEditor")},dO=function(t,e){return t.fire("ResizeContent",e)},mO=function(t,e){return t.fire("ScrollContent",e)},gO=function(t,e){return t.fire("TextColorChange",e)},hO=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),pO="tinymce-custom-colors";function vO(t){void 0===t&&(t=10);var e=hO.getItem(pO),n=E(e)?JSON.parse(e):[],r=function(e){var n=t-e.length;return n<0?e.slice(0,t):e},o=r(n),i=function(e){V(o,e).each(u),o.unshift(e),o.length>t&&o.pop(),hO.setItem(pO,JSON.stringify(o))},u=function(t){o.splice(t,1)},a=function(){return o.slice(0)};return{add:i,state:a}}var bO="choiceitem",yO=[{type:bO,text:"Light Green",value:"#BFEDD2"},{type:bO,text:"Light Yellow",value:"#FBEEB8"},{type:bO,text:"Light Red",value:"#F8CAC6"},{type:bO,text:"Light Purple",value:"#ECCAFA"},{type:bO,text:"Light Blue",value:"#C2E0F4"},{type:bO,text:"Green",value:"#2DC26B"},{type:bO,text:"Yellow",value:"#F1C40F"},{type:bO,text:"Red",value:"#E03E2D"},{type:bO,text:"Purple",value:"#B96AD9"},{type:bO,text:"Blue",value:"#3598DB"},{type:bO,text:"Dark Turquoise",value:"#169179"},{type:bO,text:"Orange",value:"#E67E23"},{type:bO,text:"Dark Red",value:"#BA372A"},{type:bO,text:"Dark Purple",value:"#843FA1"},{type:bO,text:"Dark Blue",value:"#236FA1"},{type:bO,text:"Light Gray",value:"#ECF0F1"},{type:bO,text:"Medium Gray",value:"#CED4D9"},{type:bO,text:"Gray",value:"#95A5A6"},{type:bO,text:"Dark Gray",value:"#7E8C8D"},{type:bO,text:"Navy Blue",value:"#34495E"},{type:bO,text:"Black",value:"#000000"},{type:bO,text:"White",value:"#ffffff"}],wO=vO(10),xO=function(t){var n=[],r=e.document.createElement("canvas");r.height=1,r.width=1;for(var o=r.getContext("2d"),i=function(t,e){var n=255,r=e/255,o=Math.round(t*r+n*(1-r));return("0"+o.toString(16)).slice(-2).toUpperCase()},u=function(t){if(/^[0-9A-Fa-f]{6}$/.test(t))return"#"+t.toUpperCase();o.clearRect(0,0,r.width,r.height),o.fillStyle="#FFFFFF",o.fillStyle=t,o.fillRect(0,0,1,1);var e=o.getImageData(0,0,1,1).data,n=e[0],u=e[1],a=e[2],c=e[3];return"#"+i(n,c)+i(u,c)+i(a,c)},a=0;a<t.length;a+=2)n.push({text:t[a+1],value:u(t[a]),type:"choiceitem"});return n},CO=function(t,e){return t.getParam("color_cols",e,"number")},SO=function(t){return!1!==t.getParam("custom_colors")},kO=function(t){return t.getParam("color_map")},OO=function(t){var e=kO(t);return void 0!==e?xO(e):yO},TO=function(){return $(wO.state(),(function(t){return{type:bO,text:t,value:t}}))},EO=function(t){wO.add(t)},_O=function(t,e){var n;return t.dom.getParents(t.selection.getStart(),(function(t){var r;(r=t.style["forecolor"===e?"color":"background-color"])&&(n=n||r)})),n},AO=function(t,e,n){t.undoManager.transact((function(){t.focus(),t.formatter.apply(e,{value:n}),t.nodeChanged()}))},DO=function(t,e){t.undoManager.transact((function(){t.focus(),t.formatter.remove(e,{value:null},null,!0),t.nodeChanged()}))},NO=function(t){t.addCommand("mceApplyTextcolor",(function(e,n){AO(t,e,n)})),t.addCommand("mceRemoveTextcolor",(function(e){DO(t,e)}))},RO=function(t){return Math.max(5,Math.ceil(Math.sqrt(t)))},MO=function(t){var e=OO(t),n=RO(e.length);return CO(t,n)},zO=function(t){var e="choiceitem",n={type:e,text:"Remove color",icon:"color-swatch-remove-color",value:"remove"},r={type:e,text:"Custom color",icon:"color-picker",value:"custom"};return t?[n,r]:[n]},BO=function(t,e,n,r){if("custom"===n){var o=VO(t);o((function(n){n.each((function(n){EO(n),t.execCommand("mceApplyTextcolor",e,n),r(n)}))}),"#000000")}else"remove"===n?(r(""),t.execCommand("mceRemoveTextcolor",e)):(r(n),t.execCommand("mceApplyTextcolor",e,n))},PO=function(t,e){return t.concat(TO().concat(zO(e)))},HO=function(t,e){return function(n){n(PO(t,e))}},IO=function(t,e,n){var r=function(e,n){t.setIconFill(e,n),t.setIconStroke(e,n)},o="forecolor"===e?"tox-icon-text-color__color":"tox-icon-highlight-bg-color__color";r(o,n)},LO=function(t,e,n,r,o){t.ui.registry.addSplitButton(e,{tooltip:r,presets:"color",icon:"forecolor"===e?"text-color":"highlight-bg-color",select:function(e){var r=C.from(_O(t,n));return r.bind((function(t){return uO(t).map((function(t){var n=Xk(t).value;return zr(e.toLowerCase(),n)}))})).getOr(!1)},columns:MO(t),fetch:HO(OO(t),SO(t)),onAction:function(e){null!==o.get()&&BO(t,n,o.get(),(function(){}))},onItemAction:function(r,i){BO(t,n,i,(function(n){o.set(n),gO(t,{name:e,color:n})}))},onSetup:function(n){null!==o.get()&&IO(n,e,o.get());var r=function(t){t.name===e&&IO(n,t.name,t.color)};return t.on("TextColorChange",r),function(){t.off("TextColorChange",r)}}})},FO=function(t,e,r,o){t.ui.registry.addNestedMenuItem(e,{text:o,icon:"forecolor"===e?"text-color":"highlight-bg-color",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"colorswatch",onAction:function(e){BO(t,r,e.value,n)}}]}})},VO=function(t){return function(e,n){var r=function(t){return function(e){var n=e.getData();t(C.from(n.colorpicker)),e.close()}},o=function(t,e){"hex-valid"===e.name&&(e.value?t.enable("ok"):t.disable("ok"))},i={colorpicker:n},u=r(e);t.windowManager.open({title:"Color Picker",size:"normal",body:{type:"panel",items:[{type:"colorpicker",name:"colorpicker",label:"Color"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:i,onAction:o,onSubmit:u,onClose:function(){},onCancel:function(){e(C.none())}})}},UO=function(t){NO(t);var e=Gn(null),n=Gn(null);LO(t,"forecolor","forecolor","Text color",e),LO(t,"backcolor","hilitecolor","Background color",n),FO(t,"forecolor","forecolor","Text color"),FO(t,"backcolor","hilitecolor","Background color")},jO=function(t,e,n,r,o,i,u,a){var c=lC(e),s="color"!==o?"normal":"color",l=WO(e,n,r,s,i,u,a);return mC(t,c,l,r,o)},WO=function(t,e,n,r,o,i,u){return np($(t,(function(a){return"choiceitem"===a.type?pC(a).fold(fC,(function(c){return C.some(Rk(c,1===n,r,e,i(a.value),o,u,lC(t)))})):C.none()})))},qO=function(t,e){var n=tC(e);if(1===t)return{mode:"menu",moveOnTab:!0};if("auto"===t)return{mode:"grid",selector:"."+n.item,initSize:{numColumns:1,numRows:1}};var r="color"===e?"tox-swatches__row":"tox-collection__group";return{mode:"matrix",rowSelector:"."+r}},$O=function(t,e){return 1===t?{mode:"menu",moveOnTab:!1,selector:".tox-collection__item"}:"auto"===t?{mode:"flatgrid",selector:".tox-collection__item",initSize:{numColumns:1,numRows:1}}:{mode:"matrix",selectors:{row:"color"===e?".tox-swatches__row":".tox-collection__group",cell:"color"===e?"."+Fx:"."+Lx}}};function GO(t,e){var n=PO(e.colorinput.getColors(),e.colorinput.hasCustomColors()),r=e.colorinput.getColorCols(),o="color",i=jO(Cu("menu-value"),n,(function(e){t.onAction({value:e})}),r,o,Hx.CLOSE_ON_EXECUTE,(function(){return!1}),e.shared.providers),u=g(g({},i),{markers:tC(o),movement:qO(r,o)});return{type:"widget",data:{value:Cu("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[Mk().widget(mw.sketch(u))]}}var KO,XO={inserttable:Vk,colorswatch:GO},YO=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)?C.some(t[e]):C.none()},JO=function(t,e){return YO(XO,t.fancytype).map((function(n){return n(t,e)}))},QO=function(t,e,n,r){void 0===r&&(r=!0);var o=function(t){return{isDisabled:function(){return cS.isDisabled(t)},setDisabled:function(e){return cS.set(t,e)}}},i=Tk({presets:"normal",iconContent:t.icon,textContent:t.text,htmlContent:C.none(),ariaLabel:t.text,caret:C.none(),checkMark:C.none(),shortcutContent:t.shortcut},n,r);return lk({data:fk(t),getApi:o,disabled:t.disabled,onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},i,e,n)},ZO=function(t,e,r,o,i){void 0===o&&(o=!0),void 0===i&&(i=!1);var u=i?xk(r.icons):wk(r.icons),a=function(t){return{isDisabled:function(){return cS.isDisabled(t)},setDisabled:function(e){return cS.set(t,e)}}},c=Tk({presets:"normal",iconContent:t.icon,textContent:t.text,htmlContent:C.none(),ariaLabel:t.text,caret:C.some(u),checkMark:C.none(),shortcutContent:t.shortcut},r,o);return lk({data:fk(t),getApi:a,disabled:t.disabled,onAction:n,onSetup:t.onSetup,triggersSubmenu:!0,itemBehaviours:[]},c,e,r)},tT=function(t){var e=t.text.fold((function(){return{}}),(function(t){return{innerHtml:t}}));return{type:"separator",dom:g({tag:"div",classes:[Lx,jx]},e),components:[]}},eT=function(t,e,n,r){void 0===r&&(r=!0);var o=function(t){return{setActive:function(e){Uy.set(t,e)},isActive:function(){return Uy.isOn(t)},isDisabled:function(){return cS.isDisabled(t)},setDisabled:function(e){return cS.set(t,e)}}},i=Tk({iconContent:t.icon,textContent:t.text,htmlContent:C.none(),ariaLabel:t.text,checkMark:C.some(yk(n.icons)),caret:C.none(),shortcutContent:t.shortcut,presets:"normal",meta:t.meta},n,r);return Kt(lk({data:fk(t),disabled:t.disabled,getApi:o,onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},i,e,n),{toggling:{toggleClass:Ux,toggleOnExecute:!1,selected:t.active}})},nT=Nk,rT=tT,oT=QO,iT=ZO,uT=eT,aT=JO;(function(t){t[t["ContentFocus"]=0]="ContentFocus",t[t["UiFocus"]=1]="UiFocus"})(KO||(KO={}));var cT=function(t,n,r,o,i){var u=r.shared.providers,a=function(t){return i?g(g({},t),{shortcut:C.none(),icon:t.text.isSome()?C.none():t.icon}):t};switch(t.type){case"menuitem":return xC(t).fold(fC,(function(t){return C.some(oT(a(t),n,u,o))}));case"nestedmenuitem":return SC(t).fold(fC,(function(t){return C.some(iT(a(t),n,u,o,i))}));case"togglemenuitem":return OC(t).fold(fC,(function(t){return C.some(uT(a(t),n,u,o))}));case"separator":return _x(t).fold(fC,(function(t){return C.some(rT(t))}));case"fancymenuitem":return yC(t).fold(fC,(function(t){return aT(a(t),r)}));default:return e.console.error("Unknown item in general menu",t),C.none()}},sT=function(t,e,n,r,o,i){var u=1===r,a=!u||lC(t);return np($(t,(function(t){return"separator"===t.type?Nx(t).fold(fC,(function(t){return C.some(rT(t))})):Rx(t).fold(fC,(function(t){return C.some(nT(t,e,u,"normal",n,o,i,a))}))})))},lT=function(t,e,n,r,o){var i=lC(e),u=np($(e,(function(t){var e=function(t){return o?!t.hasOwnProperty("text"):i},u=function(t){return cT(t,n,r,e(t),o)};return"nestedmenuitem"===t.type&&t.getSubmenuItems().length<=0?u(g(g({},t),{disabled:!0})):u(t)}))),a=o?dC:mC;return a(t,i,u,1,"normal")},fT=function(t){return Ow.singleData(t.value,t)},dT=function(t,e,n,r){var o=n===KO.ContentFocus?Zp():Qp(),i=qO(e,r),u=tC(r);return{dom:t.dom,components:t.components,items:t.items,value:t.value,markers:{selectedItem:u.selectedItem,item:u.item},movement:i,fakeFocus:n===KO.ContentFocus,focusManager:o,menuBehaviours:AC.unnamedEvents("auto"!==e?[]:[Ti((function(t,e){TC(t,4,u.item).each((function(e){var n=e.numColumns,r=e.numRows;ny.setGridSize(t,r,n)}))}))])}},mT=function(t,n){var r=Gn(C.none()),o=Gn(!1),i=dc(_w.sketch({dom:{tag:"div",classes:["tox-autocompleter"]},components:[],fireDismissalEventInstead:{},inlineBehaviours:Al([gy("dismissAutocompleter",[pi(Qo(),(function(){return s()}))])]),lazySink:n.getSink})),u=function(){return _w.isOpen(i)},a=function(){return r.get().isSome()},c=function(){a()&&_w.hide(i)},s=function(){if(a()){var e=r.get().map((function(t){return t.element}));ux(e.getOr(Zn.fromDom(t.selection.getNode()))).each(nu),c(),r.set(C.none()),o.set(!1)}},l=Yt((function(){return Bx(t)})),f=function(r,i){var u=dt(i,(function(t){return C.from(t.columns)})).getOr(1);return rt(i,(function(i){var a=i.items;return sT(a,i.matchText,(function(n,u){var a=t.selection.getRng();mx(t.dom,a,r).fold((function(){return e.console.error("Lost context. Cursor probably moved")}),(function(t){var e=t.range,r={hide:function(){s()},reload:function(t){c(),h(t)}};o.set(!0),i.onAction(r,e,n,u),o.set(!1)}))}),u,Hx.BUBBLE_TO_SANDBOX,n)}))},d=function(e){if(!a()){var n=ix(t,e.range);r.set(C.some({triggerChar:e.triggerChar,element:n,matchLength:e.text.length})),o.set(!1)}},m=function(e,n,r,o){e.matchLength=n.text.length;var u=dt(r,(function(t){return C.from(t.columns)})).getOr(1);_w.showAt(i,{anchor:"node",root:Zn.fromDom(t.getBody()),node:C.from(e.element)},mw.sketch(dT(mC("autocompleter-value",!0,o,u,"normal"),u,KO.ContentFocus,"normal"))),_w.getContent(i).each(Dp.highlightFirst)},g=function(e){return r.get().map((function(n){return mx(t.dom,t.selection.getRng(),n.triggerChar).bind((function(n){return Tx(t,l,n,e)}))})).getOrThunk((function(){return Ox(t,l)}))},h=function(t){g(t).fold(s,(function(t){d(t.context),t.lookupData.then((function(e){r.get().map((function(n){var r=t.context;if(n.triggerChar===r.triggerChar){var o=f(r.triggerChar,e);o.length>0?m(n,r,e,o):r.text.length-n.matchLength>=10?s():c()}}))}))}))},p=tx((function(t){27!==t.which&&h()}),50),v={onKeypress:p,cancelIfNecessary:s,isMenuOpen:u,isActive:a,isProcessingAction:o.get,getView:function(){return _w.getContent(i)}};hx.setup(v,t)},gT={register:mT},hT=u(!0),pT=function(t,e,n){return zc(t,e,hT,n)},vT=function(t,e,n){return Bc(t,e,hT,n)},bT=Nc,yT=function(t,e,n){return cs(t,e,n).isSome()};function wT(t,n){var r=null,o=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];r=e.setTimeout((function(){t.apply(null,o),r=null}),n)},i=function(){null!==r&&(e.clearTimeout(r),r=null)};return{cancel:i,schedule:o}}var xT=5,CT=400,ST=function(t){var e=t.raw();return void 0===e.touches||1!==e.touches.length?C.none():C.some(e.touches[0])},kT=function(t,e){var n=Math.abs(t.clientX-e.x),r=Math.abs(t.clientY-e.y);return n>xT||r>xT},OT=function(t){var e=Gn(C.none()),n=Gn(!1),r=wT((function(e){t.triggerEvent(Uo(),e),n.set(!0)}),CT),o=function(t){return ST(t).each((function(o){r.cancel();var i={x:o.clientX,y:o.clientY,target:t.target()};r.schedule(t),n.set(!1),e.set(C.some(i))})),C.none()},i=function(t){return r.cancel(),ST(t).each((function(t){e.get().each((function(n){kT(t,n)&&e.set(C.none())}))})),C.none()},u=function(o){r.cancel();var i=function(t){return no(t.target,o.target())};return e.get().filter(i).map((function(e){return n.get()?(o.prevent(),!1):t.triggerEvent(Vo(),o)}))},a=le([{key:po(),value:o},{key:vo(),value:i},{key:bo(),value:u}]),c=function(t,e){return Lt(a,e).bind((function(e){return e(t)}))};return{fireIfReady:c}},TT=function(t){var e=t.raw();return e.which===Np()[0]&&!U(["input","textarea"],Di(t.target()))&&!yT(t.target(),'[contenteditable="true"]')},ET=function(){return Gr().browser.isFirefox()},_T=He([Sn("triggerEvent"),Pn("stopBackspace",!0)]),AT=function(t,e){return ET()?vT(t,"focus",e):pT(t,"focusin",e)},DT=function(t,e){return ET()?vT(t,"blur",e):pT(t,"focusout",e)},NT=function(t,n){var r=rn("Getting GUI events settings",_T,n),o=["touchstart","touchmove","touchend","touchcancel","gesturestart","mousedown","mouseup","mouseover","mousemove","mouseout","click"],i=OT(r),u=$(o.concat(["selectstart","input","contextmenu","change","transitionend","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),(function(e){return pT(t,e,(function(t){i.fireIfReady(t,e).each((function(e){e&&t.kill()}));var n=r.triggerEvent(e,t);n&&t.kill()}))})),a=Gn(C.none()),c=pT(t,"paste",(function(t){i.fireIfReady(t,"paste").each((function(e){e&&t.kill()}));var n=r.triggerEvent("paste",t);n&&t.kill(),a.set(C.some(e.setTimeout((function(){r.triggerEvent(Ho(),t)}),0)))})),s=pT(t,"keydown",(function(t){var e=r.triggerEvent("keydown",t);e?t.kill():!0===r.stopBackspace&&TT(t)&&t.prevent()})),l=AT(t,(function(t){var e=r.triggerEvent("focusin",t);e&&t.kill()})),f=Gn(C.none()),d=DT(t,(function(t){var n=r.triggerEvent("focusout",t);n&&t.kill(),f.set(C.some(e.setTimeout((function(){r.triggerEvent(Po(),t)}),0)))})),m=function(){G(u,(function(t){t.unbind()})),s.unbind(),l.unbind(),d.unbind(),c.unbind(),a.get().each(e.clearTimeout),f.get().each(e.clearTimeout)};return{unbind:m}},RT=function(t,e){var n=Lt(t,"target").map((function(t){return t()})).getOr(e);return Gn(n)},MT=function(t,e){var n=Gn(!1),r=Gn(!1),o=function(){n.set(!0)},i=function(){r.set(!0)};return{stop:o,cut:i,isStopped:n.get,isCut:r.get,event:u(t),setSource:e.set,getSource:e.get}},zT=function(t){var e=Gn(!1),r=function(){e.set(!0)};return{stop:r,cut:n,isStopped:e.get,isCut:u(!1),event:u(t),setSource:l("Cannot set source of a broadcasted event"),getSource:l("Cannot get source of a broadcasted event")}},BT=jt.generate([{stopped:[]},{resume:["element"]},{complete:[]}]),PT=function(t,e,n,r,o,i){var u=t(e,r),a=MT(n,o);return u.fold((function(){return i.logEventNoHandlers(e,r),BT.complete()}),(function(t){var n=t.descHandler,r=ea(n);return r(a),a.isStopped()?(i.logEventStopped(e,t.element,n.purpose()),BT.stopped()):a.isCut()?(i.logEventCut(e,t.element,n.purpose()),BT.complete()):Vi(t.element).fold((function(){return i.logNoParent(e,t.element,n.purpose()),BT.complete()}),(function(r){return i.logEventResponse(e,t.element,n.purpose()),BT.resume(r)}))}))},HT=function(t,e,n,r,o,i){return PT(t,e,n,r,o,i).fold((function(){return!0}),(function(r){return HT(t,e,n,r,o,i)}),(function(){return!1}))},IT=function(t,e,n,r,o){var i=RT(n,r);return PT(t,e,n,r,i,o)},LT=function(t,e,n){var r=zT(e);return G(t,(function(t){var e=t.descHandler(),n=ea(e);n(r)})),r.isStopped()},FT=function(t,e,n,r){var o=n.target();return VT(t,e,n,o,r)},VT=function(t,e,n,r,o){var i=RT(n,r);return HT(t,e,n,r,i,o)},UT=function(t,e){return{element:t,descHandler:e}},jT=function(t,e){return{id:u(t),descHandler:u(e)}};function WT(){var t={},e=function(e,n,r){Dt(r,(function(r,o){var i=void 0!==t[o]?t[o]:{};i[n]=ta(r,e),t[o]=i}))},n=function(t,e){return Au(e).fold((function(){return C.none()}),(function(n){return t.bind((function(t){return Lt(t,n)})).map((function(t){return UT(e,t)}))}))},r=function(e){return Lt(t,e).map((function(t){return Pt(t,(function(t,e){return jT(e,t)}))})).getOr([])},o=function(e,r,o){var i=Lt(t,r);return co(o,(function(t){return n(i,t)}),e)},i=function(e){Dt(t,(function(t,n){t.hasOwnProperty(e)&&delete t[e]}))};return{registerId:e,unregisterId:i,filterByType:r,find:o}}function qT(){var t=WT(),e={},n=function(t){var e=t.element();return Au(e).fold((function(){return Eu("uid-",t.element())}),(function(t){return t}))},r=function(t,n){var r=e[n];if(r!==t)throw new Error('The tagId "'+n+'" is already used by: '+vu(r.element())+"\nCannot use it for: "+vu(t.element())+"\nThe conflicting element is"+(Ha(r.element())?" ":" not ")+"already in the DOM");i(t)},o=function(o){var i=n(o);Vt(e,i)&&r(o,i);var u=[o];t.registerId(u,i,o.events()),e[i]=o},i=function(n){Au(n.element()).each((function(n){delete e[n],t.unregisterId(n)}))},u=function(e){return t.filterByType(e)},a=function(e,n,r){return t.find(e,n,r)},c=function(t){return Lt(e,t)};return{find:a,filter:u,register:o,unregister:i,getById:c}}var $T=function(t){var e=t.dom,n=e.attributes,r=h(e,["attributes"]);return{uid:t.uid,dom:g({tag:"div",attributes:g({role:"presentation"},n)},r),components:t.components,behaviours:jg(t.containerBehaviours),events:t.events,domModification:t.domModification,eventOrder:t.eventOrder}},GT=tp({name:"Container",factory:$T,configFields:[Pn("components",[]),Ug("containerBehaviours",[]),Pn("events",{}),Pn("domModification",{}),Pn("eventOrder",{})]}),KT=function(t){var e=function(e){return Vi(t.element()).fold((function(){return!0}),(function(t){return no(e,t)}))},r=qT(),o=function(t,n){return r.find(e,t,n)},i=NT(t.element(),{triggerEvent:function(t,e){return xs(t,e.target(),(function(n){return FT(o,t,e,n)}))}}),a={debugInfo:u("real"),triggerEvent:function(t,e,n){xs(t,e,(function(r){return VT(o,t,n,e,r)}))},triggerFocus:function(t,e){Au(t).fold((function(){jl(t)}),(function(r){xs(Bo(),t,(function(r){return IT(o,Bo(),{originator:u(e),kill:n,prevent:n,target:u(t)},t,r),!1}))}))},triggerEscape:function(t,e){a.triggerEvent("keydown",t.element(),e.event())},getByUid:function(t){return v(t)},getByDom:function(t){return b(t)},build:dc,addToGui:function(t){l(t)},removeFromGui:function(t){f(t)},addToWorld:function(t){c(t)},removeFromWorld:function(t){s(t)},broadcast:function(t){g(t)},broadcastOn:function(t,e){h(t,e)},broadcastEvent:function(t,e){p(t,e)},isConnected:u(!0)},c=function(t){t.connect(a),zi(t.element())||(r.register(t),G(t.components(),c),a.triggerEvent(qo(),t.element(),{target:u(t.element())}))},s=function(t){zi(t.element())||(G(t.components(),s),r.unregister(t)),t.disconnect()},l=function(e){Nm(t,e)},f=function(t){zm(t)},d=function(){i.unbind(),eu(t.element())},m=function(t){var e=r.filter(Io());G(e,(function(e){var n=e.descHandler(),r=ea(n);r(t)}))},g=function(t){m({universal:u(!0),data:u(t)})},h=function(t,e){m({universal:u(!1),channels:u(t),data:u(e)})},p=function(t,e){var n=r.filter(t);return LT(n,e)},v=function(t){return r.getById(t).fold((function(){return pt.error(new Error('Could not find component with uid: "'+t+'" in system.'))}),pt.value)},b=function(t){var e=Au(t).getOr("not found");return v(e)};return c(t),{root:u(t),element:t.element,destroy:d,add:l,remove:f,getByUid:v,getByDom:b,addToWorld:c,removeFromWorld:s,broadcast:g,broadcastOn:h,broadcastEvent:p}},XT=function(t,e){return{dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:$(t.items,e.interpreter)}},YT=u([Pn("prefix","form-field"),Ug("fieldBehaviours",[lp,Vg])]),JT=u([Ch({schema:[vn("dom")],name:"label"}),Ch({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[vn("text")],name:"aria-descriptor"}),wh({factory:{sketch:function(t){var e=ce(t,["factory"]);return t.factory.sketch(e)}},schema:[vn("factory")],name:"field"})]),QT=function(t,e,n,r){var o=Wg(t.fieldBehaviours,[lp.config({find:function(e){return Bh(e,t,"field")}}),Vg.config({store:{mode:"manual",getValue:function(t){return lp.getCurrent(t).bind(Vg.getValue)},setValue:function(t,e){lp.getCurrent(t).each((function(t){Vg.setValue(t,e)}))}}})]),i=di([Ti((function(e,n){var r=Hh(e,t,["label","field","aria-descriptor"]);r.field().each((function(e){var n=Cu(t.prefix);r.label().each((function(t){cu(t.element(),"for",n),cu(e.element(),"id",n)})),r["aria-descriptor"]().each((function(n){var r=Cu(t.prefix);cu(n.element(),"id",r),cu(e.element(),"aria-describedby",r)}))}))}))]),u={getField:function(e){return Bh(e,t,"field")},getLabel:function(e){return Bh(e,t,"label")}};return{uid:t.uid,dom:t.dom,components:e,behaviours:o,events:i,apis:u}},ZT=ep({name:"FormField",configFields:YT(),partFields:JT(),factory:QT,apis:{getField:function(t,e){return t.getField(e)},getLabel:function(t,e){return t.getLabel(e)}}}),tE=function(t,e){return Ku({attributes:le([{key:e.tabAttr,value:"true"}])})},eE=Object.freeze({__proto__:null,exhibit:tE}),nE=[Pn("tabAttr","data-alloy-tabstop")],rE=Nl({fields:nE,name:"tabstopping",active:eE}),oE=function(t,e,n,r){var o=uE(t,e,n,r);return ZT.sketch(o)},iE=function(t,e){return oE(t,e,[],[])},uE=function(t,e,n,r){return{dom:cE(n),components:t.toArray().concat([e]),fieldBehaviours:Al(r)}},aE=function(){return cE([])},cE=function(t){return{tag:"div",classes:["tox-form__group"].concat(t)}},sE=function(t,e){return ZT.parts().label({dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}})},lE=Cu("form-component-change"),fE=Cu("form-close"),dE=Cu("form-cancel"),mE=Cu("form-action"),gE=Cu("form-submit"),hE=Cu("form-block"),pE=Cu("form-unblock"),vE=Cu("form-tabchange"),bE=Cu("form-resize"),yE=function(t,e){var n=t.label.map((function(t){return sE(t,e)})),r=function(t){return function(e,n){cs(n.event().target(),"[data-collection-item-value]").each((function(r){t(e,n,r,lu(r,"data-collection-item-value"))}))}},o=function(t){return'"'===t?""":t},i=function(n,r){var i=$(r,(function(n){var r=jC.translate(n.text),i=1===t.columns?'<div class="tox-collection__item-label">'+r+"</div>":"",u='<div class="tox-collection__item-icon">'+n.icon+"</div>",a={_:" "," - ":" ","-":" "},c=r.replace(/\_| \- |\-/g,(function(t){return a[t]})),s=e.isReadOnly()?" tox-collection__item--state-disabled":"";return'<div class="tox-collection__item'+s+'" tabindex="-1" data-collection-item-value="'+o(n.value)+'" title="'+c+'" aria-label="'+c+'">'+u+i+"</div>"})),u=t.columns>1&&"auto"!==t.columns?q(i,t.columns):[i],a=$(u,(function(t){return'<div class="tox-collection__group">'+t.join("")+"</div>"}));iu(n.element(),a.join(""))},u=r((function(n,r,o,i){r.stop(),e.isReadOnly()||ai(n,mE,{name:t.name,value:i})})),c=[pi(ko(),r((function(t,e,n){jl(n)}))),pi(No(),u),pi(Vo(),u),pi(Oo(),r((function(t,e,n){as(t.element(),"."+Xx).each((function(t){Sa(t,Xx)})),xa(n,Xx)}))),pi(To(),r((function(t){as(t.element(),"."+Xx).each((function(t){Sa(t,Xx)}))}))),Ai(r((function(e,n,r,o){ai(e,mE,{name:t.name,value:o})})))],s=function(t,e){return $(Ad(t.element(),".tox-collection__item"),e)},l=ZT.parts().field({dom:{tag:"div",classes:["tox-collection"].concat(1!==t.columns?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:a},behaviours:Al([cS.config({disabled:e.isReadOnly,onDisabled:function(t){s(t,(function(t){xa(t,"tox-collection__item--state-disabled"),cu(t,"aria-disabled",!0)}))},onEnabled:function(t){s(t,(function(t){Sa(t,"tox-collection__item--state-disabled"),mu(t,"aria-disabled")}))}}),QS(),dy.config({}),Vg.config({store:{mode:"memory",initialValue:[]},onSetValue:function(e,n){i(e,n),"auto"===t.columns&&TC(e,5,"tox-collection__item").each((function(t){var n=t.numRows,r=t.numColumns;ny.setGridSize(e,n,r)})),ui(e,bE)}}),rE.config({}),ny.config($O(t.columns,"normal")),gy("collection-events",c)]),eventOrder:{"alloy.execute":["disabling","alloy.base.behaviour","collection-events"]}}),f=["tox-form__group--collection"];return oE(n,l,f,[])},wE=u([_n("data"),Pn("inputAttributes",{}),Pn("inputStyles",{}),Pn("tag","input"),Pn("inputClasses",[]),Ns("onSetValue"),Pn("styles",{}),Pn("eventOrder",{}),Ug("inputBehaviours",[Vg,Sy]),Pn("selectOnFocus",!0)]),xE=function(t){return Al([Sy.config({onFocus:t.selectOnFocus?function(t){var e=t.element(),n=Qa(e);e.dom().setSelectionRange(0,n.length)}:n})])},CE=function(t){return g(g({},xE(t)),Wg(t.inputBehaviours,[Vg.config({store:g(g({mode:"manual"},t.data.map((function(t){return{initialValue:t}})).getOr({})),{getValue:function(t){return Qa(t.element())},setValue:function(t,e){var n=Qa(t.element());n!==e&&Za(t.element(),e)}}),onSetValue:t.onSetValue})]))},SE=function(t){return{tag:t.tag,attributes:g({type:"text"},t.inputAttributes),styles:t.inputStyles,classes:t.inputClasses}},kE=function(t,e){return{uid:t.uid,dom:SE(t),components:[],behaviours:CE(t),eventOrder:t.eventOrder}},OE=tp({name:"Input",configFields:wE(),factory:kE}),TE={},EE={exports:TE};(function(e,n,r,o){(function(o){if("object"===typeof n&&"undefined"!==typeof r)r.exports=o();else if("function"===typeof e&&e.amd)e([],o);else{var i;i="undefined"!==typeof window?window:"undefined"!==typeof t?t:"undefined"!==typeof self?self:this,i.EphoxContactWrapper=o()}})((function(){return function(){function t(e,n,r){function i(a,c){if(!n[a]){if(!e[a]){var s="function"==typeof o&&o;if(!c&&s)return s(a,!0);if(u)return u(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var f=n[a]={exports:{}};e[a][0].call(f.exports,(function(t){var n=e[a][1][t];return i(n||t)}),f,f.exports,t,e,n,r)}return n[a].exports}for(var u="function"==typeof o&&o,a=0;a<r.length;a++)i(r[a]);return i}return t}()({1:[function(t,e,n){var r,o,i=e.exports={};function u(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function c(t){if(r===setTimeout)return setTimeout(t,0);if((r===u||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}function s(t){if(o===clearTimeout)return clearTimeout(t);if((o===a||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{return o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(function(){try{r="function"===typeof setTimeout?setTimeout:u}catch(t){r=u}try{o="function"===typeof clearTimeout?clearTimeout:a}catch(t){o=a}})();var l,f=[],d=!1,m=-1;function g(){d&&l&&(d=!1,l.length?f=l.concat(f):m=-1,f.length&&h())}function h(){if(!d){var t=c(g);d=!0;var e=f.length;while(e){l=f,f=[];while(++m<e)l&&l[m].run();m=-1,e=f.length}l=null,d=!1,s(t)}}function p(t,e){this.fun=t,this.array=e}function v(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];f.push(new p(t,e)),1!==f.length||d||c(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=v,i.addListener=v,i.once=v,i.off=v,i.removeListener=v,i.removeAllListeners=v,i.emit=v,i.prependListener=v,i.prependOnceListener=v,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],2:[function(t,e,n){(function(t){(function(n){var r=setTimeout;function o(){}function i(t,e){return function(){t.apply(e,arguments)}}function u(t){if("object"!==typeof this)throw new TypeError("Promises must be constructed via new");if("function"!==typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],d(t,this)}function a(t,e){while(3===t._state)t=t._value;0!==t._state?(t._handled=!0,u._immediateFn((function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(o){return void s(e.promise,o)}c(e.promise,r)}else(1===t._state?c:s)(e.promise,t._value)}))):t._deferreds.push(e)}function c(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"===typeof e||"function"===typeof e)){var n=e.then;if(e instanceof u)return t._state=3,t._value=e,void l(t);if("function"===typeof n)return void d(i(n,e),t)}t._state=1,t._value=e,l(t)}catch(r){s(t,r)}}function s(t,e){t._state=2,t._value=e,l(t)}function l(t){2===t._state&&0===t._deferreds.length&&u._immediateFn((function(){t._handled||u._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)a(t,t._deferreds[e]);t._deferreds=null}function f(t,e,n){this.onFulfilled="function"===typeof t?t:null,this.onRejected="function"===typeof e?e:null,this.promise=n}function d(t,e){var n=!1;try{t((function(t){n||(n=!0,c(e,t))}),(function(t){n||(n=!0,s(e,t))}))}catch(r){if(n)return;n=!0,s(e,r)}}u.prototype["catch"]=function(t){return this.then(null,t)},u.prototype.then=function(t,e){var n=new this.constructor(o);return a(this,new f(t,e,n)),n},u.all=function(t){var e=Array.prototype.slice.call(t);return new u((function(t,n){if(0===e.length)return t([]);var r=e.length;function o(i,u){try{if(u&&("object"===typeof u||"function"===typeof u)){var a=u.then;if("function"===typeof a)return void a.call(u,(function(t){o(i,t)}),n)}e[i]=u,0===--r&&t(e)}catch(c){n(c)}}for(var i=0;i<e.length;i++)o(i,e[i])}))},u.resolve=function(t){return t&&"object"===typeof t&&t.constructor===u?t:new u((function(e){e(t)}))},u.reject=function(t){return new u((function(e,n){n(t)}))},u.race=function(t){return new u((function(e,n){for(var r=0,o=t.length;r<o;r++)t[r].then(e,n)}))},u._immediateFn="function"===typeof t?function(e){t(e)}:function(t){r(t,0)},u._unhandledRejectionFn=function(t){"undefined"!==typeof console&&console},u._setImmediateFn=function(t){u._immediateFn=t},u._setUnhandledRejectionFn=function(t){u._unhandledRejectionFn=t},"undefined"!==typeof e&&e.exports?e.exports=u:n.Promise||(n.Promise=u)})(this)}).call(this,t("timers").setImmediate)},{timers:3}],3:[function(t,e,n){(function(e,r){var o=t("process/browser.js").nextTick,i=Function.prototype.apply,u=Array.prototype.slice,a={},c=0;function s(t,e){this._id=t,this._clearFn=e}n.setTimeout=function(){return new s(i.call(setTimeout,window,arguments),clearTimeout)},n.setInterval=function(){return new s(i.call(setInterval,window,arguments),clearInterval)},n.clearTimeout=n.clearInterval=function(t){t.close()},s.prototype.unref=s.prototype.ref=function(){},s.prototype.close=function(){this._clearFn.call(window,this._id)},n.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},n.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},n._unrefActive=n.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},n.setImmediate="function"===typeof e?e:function(t){var e=c++,r=!(arguments.length<2)&&u.call(arguments,1);return a[e]=!0,o((function(){a[e]&&(r?t.apply(null,r):t.call(null),n.clearImmediate(e))})),e},n.clearImmediate="function"===typeof r?r:function(t){delete a[t]}}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(t,e,n){var r=t("promise-polyfill"),o=function(){return"undefined"!==typeof window?window:Function("return this;")()}();e.exports={boltExport:o.Promise||r}},{"promise-polyfill":2}]},{},[4])(4)}))})(void 0,TE,EE,void 0);var _E,AE=EE.exports.boltExport,DE=function(t){var n=C.none(),r=[],o=function(t){return DE((function(e){i((function(n){e(t(n))}))}))},i=function(t){a()?s(t):r.push(t)},u=function(t){a()||(n=C.some(t),c(r),r=[])},a=function(){return n.isSome()},c=function(t){G(t,s)},s=function(t){n.each((function(n){e.setTimeout((function(){t(n)}),0)}))};return t(u),{get:i,map:o,isReady:a}},NE=function(t){return DE((function(e){e(t)}))},RE={nu:DE,pure:NE},ME=function(t){e.setTimeout((function(){throw t}),0)},zE=function(t){var e=function(e){t().then(e,ME)},n=function(e){return zE((function(){return t().then(e)}))},r=function(e){return zE((function(){return t().then((function(t){return e(t).toPromise()}))}))},o=function(e){return zE((function(){return t().then((function(){return e.toPromise()}))}))},i=function(){return RE.nu(e)},u=function(){var e=null;return zE((function(){return null===e&&(e=t()),e}))},a=t;return{map:n,bind:r,anonBind:o,toLazy:i,toCached:u,toPromise:a,get:e}},BE=function(t){return zE((function(){return new AE(t)}))},PE=function(t){return zE((function(){return AE.resolve(t)}))},HE={nu:BE,pure:PE},IE=["input","textarea"],LE=function(t){var e=Di(t);return U(IE,e)},FE=function(t,e){var n=e.getRoot(t).getOr(t.element());Sa(n,e.invalidClass),e.notify.each((function(e){LE(t.element())&&cu(t.element(),"aria-invalid",!1),e.getContainer(t).each((function(t){iu(t,e.validHtml)})),e.onValid(t)}))},VE=function(t,e,n,r){var o=e.getRoot(t).getOr(t.element());xa(o,e.invalidClass),e.notify.each((function(e){LE(t.element())&&cu(t.element(),"aria-invalid",!0),e.getContainer(t).each((function(t){iu(t,r)})),e.onInvalid(t,r)}))},UE=function(t,e,n){return e.validator.fold((function(){return HE.pure(pt.value(!0))}),(function(e){return e.validate(t)}))},jE=function(t,e,n){return e.notify.each((function(e){e.onValidate(t)})),UE(t,e).map((function(r){return t.getSystem().isConnected()?r.fold((function(r){return VE(t,e,n,r),pt.error(r)}),(function(n){return FE(t,e),pt.value(n)})):pt.error("No longer in system")}))},WE=function(t,e){var n=e.getRoot(t).getOr(t.element());return ka(n,e.invalidClass)},qE=Object.freeze({__proto__:null,markValid:FE,markInvalid:VE,query:UE,run:jE,isInvalid:WE}),$E=function(t,e){return t.validator.map((function(r){return di([pi(r.onEvent,(function(n){jE(n,t,e).get(a)}))].concat(r.validateOnLoad?[Ti((function(r){jE(r,t,e).get(n)}))]:[]))})).getOr({})},GE=Object.freeze({__proto__:null,events:$E}),KE=[vn("invalidClass"),Pn("getRoot",C.none),zn("notify",[Pn("aria","alert"),Pn("getContainer",C.none),Pn("validHtml",""),Ns("onValid"),Ns("onInvalid"),Ns("onValidate")]),zn("validator",[vn("validate"),Pn("onEvent","input"),Pn("validateOnLoad",!0)])],XE=Nl({fields:KE,name:"invalidating",active:GE,apis:qE,extra:{validation:function(t){return function(e){var n=Vg.getValue(e);return HE.pure(t(n))}}}}),YE=function(t,e,n,r){return n.getOrCreate(t,e,r)},JE=Object.freeze({__proto__:null,getCoupled:YE}),QE=[bn("others",Ze(pt.value,cn()))],ZE=function(){var t={},e=function(e,n,r){var o=_t(n.others);if(o)return Lt(t,r).getOrThunk((function(){var o=Lt(n.others,r).getOrDie("No information found for coupled component: "+r),i=o(e),u=e.getSystem().build(i);return t[r]=u,u}));throw new Error("Cannot find coupled component: "+r+". Known coupled components: "+JSON.stringify(o,null,2))},n=u({});return ju({readState:n,getOrCreate:e})},t_=Object.freeze({__proto__:null,init:ZE}),e_=Nl({fields:QE,name:"coupling",apis:JE,state:t_}),n_=u("sink"),r_=u(Ch({name:n_(),overrides:u({dom:{tag:"div"},behaviours:Al([Om.config({useFixed:d})]),events:di([Si(Eo()),Si(wo()),Si(No())])})}));(function(t){t[t["HighlightFirst"]=0]="HighlightFirst",t[t["HighlightNone"]=1]="HighlightNone"})(_E||(_E={}));var o_=function(t,e){var n=t.getHotspot(e).getOr(e),r="hotspot",o=t.getAnchorOverrides();return t.layouts.fold((function(){return{anchor:r,hotspot:n,overrides:o}}),(function(t){return{anchor:r,hotspot:n,overrides:o,layouts:t}}))},i_=function(t,e,n){var r=t.fetch;return r(n).map(e)},u_=function(t,e,n,r,o,i,u){var a=i_(t,e,r),c=f_(r,t);return a.map((function(t){return t.bind((function(t){return C.from(Ow.sketch(g(g({},i.menu()),{uid:Du(""),data:t,highlightImmediately:u===_E.HighlightFirst,onOpenMenu:function(t,e){var r=c().getOrDie();Om.position(r,n,e),ig.decloak(o)},onOpenSubmenu:function(t,e,n){var r=c().getOrDie();Om.position(r,{anchor:"submenu",item:e},n),ig.decloak(o)},onRepositionMenu:function(t,e,r){var o=c().getOrDie();Om.position(o,n,e),G(r,(function(t){Om.position(o,{anchor:"submenu",item:t.triggeringItem},t.triggeredMenu)}))},onEscape:function(){return Sy.focus(r),ig.close(o),C.some(!0)}})))}))}))},a_=function(t,e,n,r,o,i,u){var a=o_(t,n),c=u_(t,e,a,n,r,o,u);return c.map((function(t){return t.fold((function(){ig.isOpen(r)&&ig.close(r)}),(function(t){ig.cloak(r),ig.open(r,t),i(r)})),r}))},c_=function(t,e,n,r,o,i,u){return ig.close(r),HE.pure(r)},s_=function(t,e,n,r,o,i){var u=e_.getCoupled(n,"sandbox"),a=ig.isOpen(u),c=a?c_:a_;return c(t,e,n,u,r,o,i)},l_=function(t,e,n){var r=lp.getCurrent(e).getOr(e),o=Ec(t.element());n?Ua(r.element(),"min-width",o+"px"):Tc(r.element(),o)},f_=function(t,e){return t.getSystem().getByUid(e.uid+"-"+n_()).map((function(t){return function(){return pt.value(t)}})).getOrThunk((function(){return e.lazySink.fold((function(){return function(){return pt.error(new Error("No internal sink is specified, nor could an external sink be found"))}}),(function(e){return function(){return e(t)}}))}))},d_=function(t){ig.getState(t).each((function(t){Ow.repositionMenus(t)}))},m_=function(t,e,n){var r=ls(),o=function(o,i){var u=o_(t,e);r.link(e.element()),t.matchWidth&&l_(u.hotspot,i,t.useMinWidth),t.onOpen(u,o,i),void 0!==n&&void 0!==n.onOpen&&n.onOpen(o,i)},i=function(t,o){r.unlink(e.element()),void 0!==n&&void 0!==n.onClose&&n.onClose(t,o)},u=f_(e,t);return{dom:{tag:"div",classes:t.sandboxClasses,attributes:{id:r.id,role:"listbox"}},behaviours:qg.augment(t.sandboxBehaviours,[Vg.config({store:{mode:"memory",initialValue:e}}),ig.config({onOpen:o,onClose:i,isPartOf:function(t,n,r){return ds(n,r)||ds(e,r)},getAttachPoint:function(){return u().getOrDie()}}),lp.config({find:function(t){return ig.getState(t).bind((function(t){return lp.getCurrent(t)}))}}),Ll.config({channels:g(g({},lg({isExtraPart:f})),dg({doReposition:d_}))})])}},g_=function(t){var e=e_.getCoupled(t,"sandbox");d_(e)},h_=function(){return[Pn("sandboxClasses",[]),qg.field("sandboxBehaviours",[lp,Ll,ig,Vg])]},p_=u([vn("dom"),vn("fetch"),Ns("onOpen"),Rs("onExecute"),Pn("getHotspot",C.some),Pn("getAnchorOverrides",u({})),Bf(),Ug("dropdownBehaviours",[Uy,e_,ny,Sy]),vn("toggleClass"),Pn("eventOrder",{}),_n("lazySink"),Pn("matchWidth",!1),Pn("useMinWidth",!1),_n("role")].concat(h_())),v_=u([xh({schema:[_s()],name:"menu",defaults:function(t){return{onExecute:t.onExecute}}}),r_()]),b_=function(t,e,r,o){var i,u=function(e){return Lt(t.dom,"attributes").bind((function(t){return Lt(t,e)}))},a=function(t){ig.getState(t).each((function(t){Ow.highlightPrimary(t)}))},c=function(e){var r=a;s_(t,(function(t){return t}),e,o,r,_E.HighlightFirst).get(n)},s={expand:function(e){Uy.isOn(e)||s_(t,(function(t){return t}),e,o,n,_E.HighlightNone).get(n)},open:function(e){Uy.isOn(e)||s_(t,(function(t){return t}),e,o,n,_E.HighlightFirst).get(n)},isOpen:Uy.isOn,close:function(e){Uy.isOn(e)&&s_(t,(function(t){return t}),e,o,n,_E.HighlightFirst).get(n)},repositionMenus:function(t){Uy.isOn(t)&&g_(t)}},l=function(t,e){return ci(t),C.some(!0)};return{uid:t.uid,dom:t.dom,components:e,behaviours:Wg(t.dropdownBehaviours,[Uy.config({toggleClass:t.toggleClass,aria:{mode:"expanded"}}),e_.config({others:{sandbox:function(e){return m_(t,e,{onOpen:function(){Uy.on(e)},onClose:function(){Uy.off(e)}})}}}),ny.config({mode:"special",onSpace:l,onEnter:l,onDown:function(t,e){if(y_.isOpen(t)){var n=e_.getCoupled(t,"sandbox");a(n)}else y_.open(t);return C.some(!0)},onEscape:function(t,e){return y_.isOpen(t)?(y_.close(t),C.some(!0)):C.none()}}),Sy.config({})]),events:Wy(C.some(c)),eventOrder:g(g({},t.eventOrder),(i={},i[Lo()]=["disabling","toggling","alloy.base.behaviour"],i)),apis:s,domModification:{attributes:g(g({"aria-haspopup":"true"},t.role.fold((function(){return{}}),(function(t){return{role:t}}))),"button"===t.dom.tag?{type:u("type").getOr("button")}:{})}}},y_=ep({name:"Dropdown",configFields:p_(),partFields:v_(),factory:b_,apis:{open:function(t,e){return t.open(e)},expand:function(t,e){return t.expand(e)},close:function(t,e){return t.close(e)},isOpen:function(t,e){return t.isOpen(e)},repositionMenus:function(t,e){return t.repositionMenus(e)}}}),w_=function(){return Ku({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})},x_=function(){return di([mi(Mo(),u(!0))])},C_=Object.freeze({__proto__:null,events:x_,exhibit:w_}),S_=Nl({fields:[],name:"unselecting",active:C_}),k_=function(t,e){return y_.sketch({dom:t.dom,components:t.components,toggleClass:"mce-active",dropdownBehaviours:Al([rk.button(e.providers.isReadOnly),QS(),S_.config({}),rE.config({})]),layouts:t.layouts,sandboxClasses:["tox-dialog__popups"],lazySink:e.getSink,fetch:function(n){return HE.nu((function(e){return t.fetch(e)})).map((function(r){return C.from(fT(Kt(jO(Cu("menu-value"),r,(function(e){t.onItemAction(n,e)}),t.columns,t.presets,Hx.CLOSE_ON_EXECUTE,(function(){return!1}),e.providers),{movement:qO(t.columns,t.presets)})))}))},parts:{menu:rC(!1,1,t.presets)}})},O_=Cu("color-input-change"),T_=Cu("color-swatch-change"),E_=Cu("color-picker-cancel"),__=function(t,e,n){var r=ZT.parts().field({factory:OE,inputClasses:["tox-textfield"],onSetValue:function(t){return XE.run(t).get((function(){}))},inputBehaviours:Al([cS.config({disabled:e.providers.isReadOnly}),QS(),rE.config({}),XE.config({invalidClass:"tox-textbox-field-invalid",getRoot:function(t){return Vi(t.element())},notify:{onValid:function(t){var e=Vg.getValue(t);ai(t,O_,{color:e})}},validator:{validateOnLoad:!1,validate:function(t){var e=Vg.getValue(t);if(0===e.length)return HE.pure(pt.value(!0));var n=Zn.fromTag("span");Ua(n,"background-color",e);var r=Ga(n,"background-color").fold((function(){return pt.error("blah")}),(function(t){return pt.value(e)}));return HE.pure(r)}}})]),selectOnFocus:!1}),o=t.label.map((function(t){return sE(t,e.providers)})),i=function(t,e){ai(t,T_,{value:e})},u=function(t,e){a.getOpt(t).each((function(t){"custom"===e?n.colorPicker((function(e){e.fold((function(){return ui(t,E_)}),(function(e){i(t,e),EO(e)}))}),"#ffffff"):i(t,"remove"===e?"":e)}))},a=jw(k_({dom:{tag:"span",attributes:{"aria-label":e.providers.translate("Color swatch")}},layouts:{onRtl:function(){return[sl,cl,ml]},onLtr:function(){return[cl,sl,ml]}},components:[],fetch:HO(n.getColors(),n.hasCustomColors()),columns:n.getColorCols(),presets:"color",onItemAction:u},e));return ZT.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:o.toArray().concat([{dom:{tag:"div",classes:["tox-color-input"]},components:[r,a.asSpec()]}]),fieldBehaviours:Al([gy("form-field-events",[pi(O_,(function(e,n){a.getOpt(e).each((function(t){Ua(t.element(),"background-color",n.event().color())})),ai(e,lE,{name:t.name})})),pi(T_,(function(t,e){ZT.getField(t).each((function(n){Vg.setValue(n,e.event().value()),lp.getCurrent(t).each(Sy.focus)}))})),pi(E_,(function(t,e){ZT.getField(t).each((function(e){lp.getCurrent(t).each(Sy.focus)}))}))])])})},A_=function(t,e,n){return{hue:t,saturation:e,value:n}},D_=function(t){var e=0,n=0,r=0,o=t.red/255,i=t.green/255,u=t.blue/255,a=Math.min(o,Math.min(i,u)),c=Math.max(o,Math.max(i,u));if(a===c)return r=a,A_(0,0,100*r);var s=o===a?i-u:u===a?o-i:u-o;return e=o===a?3:u===a?1:5,e=60*(e-s/(c-a)),n=(c-a)/c,r=c,A_(Math.round(e),Math.round(100*n),Math.round(100*r))},N_=function(t){var e=(100-t)/100*360,n=A_(e,100,100),r=rO(n);return Xk(r)},R_=Cu("rgb-hex-update"),M_=Cu("slider-update"),z_=Cu("palette-update"),B_=Ch({schema:[vn("dom")],name:"label"}),P_=function(t){return Ch({name:t+"-edge",overrides:function(e){var n=e.model.manager.edgeActions[t];return n.fold((function(){return{}}),(function(t){return{events:di([vi(po(),(function(e,n,r){return t(e,r)}),[e]),vi(wo(),(function(e,n,r){return t(e,r)}),[e]),vi(xo(),(function(e,n,r){r.mouseIsDown.get()&&t(e,r)}),[e])])}}))}})},H_=P_("top-left"),I_=P_("top"),L_=P_("top-right"),F_=P_("right"),V_=P_("bottom-right"),U_=P_("bottom"),j_=P_("bottom-left"),W_=P_("left"),q_=wh({name:"thumb",defaults:u({dom:{styles:{position:"absolute"}}}),overrides:function(t){return{events:di([xi(po(),t,"spectrum"),xi(vo(),t,"spectrum"),xi(bo(),t,"spectrum"),xi(wo(),t,"spectrum"),xi(xo(),t,"spectrum"),xi(So(),t,"spectrum")])}}}),$_=wh({schema:[$n("mouseIsDown",(function(){return Gn(!1)}))],name:"spectrum",overrides:function(t){var e=t.model,n=e.manager,r=function(e,r){return n.getValueFromEvent(r).map((function(r){return n.setValueFrom(e,t,r)}))};return{behaviours:Al([ny.config({mode:"special",onLeft:function(e){return n.onLeft(e,t)},onRight:function(e){return n.onRight(e,t)},onUp:function(e){return n.onUp(e,t)},onDown:function(e){return n.onDown(e,t)}}),Sy.config({})]),events:di([pi(po(),r),pi(vo(),r),pi(wo(),r),pi(xo(),(function(e,n){t.mouseIsDown.get()&&r(e,n)}))])}}}),G_=[B_,W_,F_,I_,U_,H_,L_,j_,V_,q_,$_],K_="slider.change.value",X_=u(K_),Y_=function(t){return-1!==t.type.indexOf("touch")},J_=function(t){var e=t.event().raw();if(Y_(e)){var n=e;return void 0!==n.touches&&1===n.touches.length?C.some(n.touches[0]).map((function(t){return wc(t.clientX,t.clientY)})):C.none()}var r=e;return void 0!==r.clientX?C.some(r).map((function(t){return wc(t.clientX,t.clientY)})):C.none()},Q_="top",Z_="right",tA="bottom",eA="left",nA=function(t){return t.model.minX},rA=function(t){return t.model.minY},oA=function(t){return t.model.minX-1},iA=function(t){return t.model.minY-1},uA=function(t){return t.model.maxX},aA=function(t){return t.model.maxY},cA=function(t){return t.model.maxX+1},sA=function(t){return t.model.maxY+1},lA=function(t,e,n){return e(t)-n(t)},fA=function(t){return lA(t,uA,nA)},dA=function(t){return lA(t,aA,rA)},mA=function(t){return fA(t)/2},gA=function(t){return dA(t)/2},hA=function(t){return t.stepSize},pA=function(t){return t.snapToGrid},vA=function(t){return t.snapStart},bA=function(t){return t.rounded},yA=function(t,e){return void 0!==t[e+"-edge"]},wA=function(t){return yA(t,eA)},xA=function(t){return yA(t,Z_)},CA=function(t){return yA(t,Q_)},SA=function(t){return yA(t,tA)},kA=function(t){return t.model.value.get()},OA=function(t){return{x:u(t)}},TA=function(t){return{y:u(t)}},EA=function(t,e){return{x:u(t),y:u(e)}},_A=function(t,e){ai(t,X_(),{value:e})},AA=function(t,e){_A(t,EA(oA(e),iA(e)))},DA=function(t,e){_A(t,TA(iA(e)))},NA=function(t,e){_A(t,EA(mA(e),iA(e)))},RA=function(t,e){_A(t,EA(cA(e),iA(e)))},MA=function(t,e){_A(t,OA(cA(e)))},zA=function(t,e){_A(t,EA(cA(e),gA(e)))},BA=function(t,e){_A(t,EA(cA(e),sA(e)))},PA=function(t,e){_A(t,TA(sA(e)))},HA=function(t,e){_A(t,EA(mA(e),sA(e)))},IA=function(t,e){_A(t,EA(oA(e),sA(e)))},LA=function(t,e){_A(t,OA(oA(e)))},FA=function(t,e){_A(t,EA(oA(e),gA(e)))},VA=function(t,e,n,r){return t<e?t:t>n?n:t===e?e-1:Math.max(e,t-r)},UA=function(t,e,n,r){return t>n?t:t<e?e:t===n?n+1:Math.min(n,t+r)},jA=function(t,e,n){return Math.max(e,Math.min(n,t))},WA=function(t,e,n,r,o){return o.fold((function(){var o=t-e,i=Math.round(o/r)*r;return jA(e+i,e-1,n+1)}),(function(e){var o=(t-e)%r,i=Math.round(o/r),u=Math.floor((t-e)/r),a=Math.floor((n-e)/r),c=Math.min(a,u+i),s=e+c*r;return Math.max(e,s)}))},qA=function(t,e,n){return Math.min(n,Math.max(t,e))-e},$A=function(t){var e=t.min,n=t.max,r=t.range,o=t.value,i=t.step,u=t.snap,a=t.snapStart,c=t.rounded,s=t.hasMinEdge,l=t.hasMaxEdge,f=t.minBound,d=t.maxBound,m=t.screenRange,g=s?e-1:e,h=l?n+1:n;if(o<f)return g;if(o>d)return h;var p=qA(o,f,d),v=jA(p/m*r+e,g,h);return u&&v>=e&&v<=n?WA(v,e,n,i,a):c?Math.round(v):v},GA=function(t){var e=t.min,n=t.max,r=t.range,o=t.value,i=t.hasMinEdge,u=t.hasMaxEdge,a=t.maxBound,c=t.maxOffset,s=t.centerMinEdge,l=t.centerMaxEdge;return o<e?i?0:s:o>n?u?a:l:(o-e)/r*c},KA="top",XA="right",YA="bottom",JA="left",QA="width",ZA="height",tD=function(t){return t.element().dom().getBoundingClientRect()},eD=function(t,e){return t[e]},nD=function(t){var e=tD(t);return eD(e,JA)},rD=function(t){var e=tD(t);return eD(e,XA)},oD=function(t){var e=tD(t);return eD(e,KA)},iD=function(t){var e=tD(t);return eD(e,YA)},uD=function(t){var e=tD(t);return eD(e,QA)},aD=function(t){var e=tD(t);return eD(e,ZA)},cD=function(t,e,n){return(t+e)/2-n},sD=function(t,e){var n=tD(t),r=tD(e),o=eD(n,JA),i=eD(n,XA),u=eD(r,JA);return cD(o,i,u)},lD=function(t,e){var n=tD(t),r=tD(e),o=eD(n,KA),i=eD(n,YA),u=eD(r,KA);return cD(o,i,u)},fD=function(t,e){ai(t,X_(),{value:e})},dD=function(t){return{x:u(t)}},mD=function(t,e,n){var r={min:nA(e),max:uA(e),range:fA(e),value:n,step:hA(e),snap:pA(e),snapStart:vA(e),rounded:bA(e),hasMinEdge:wA(e),hasMaxEdge:xA(e),minBound:nD(t),maxBound:rD(t),screenRange:uD(t)};return $A(r)},gD=function(t,e,n){var r=mD(t,e,n),o=dD(r);return fD(t,o),r},hD=function(t,e){var n=nA(e);fD(t,dD(n))},pD=function(t,e){var n=uA(e);fD(t,dD(n))},vD=function(t,e,n){var r=t>0?UA:VA,o=r(kA(n).x(),nA(n),uA(n),hA(n));return fD(e,dD(o)),C.some(o)},bD=function(t){return function(e,n){return vD(t,e,n).map((function(){return!0}))}},yD=function(t){var e=J_(t);return e.map((function(t){return t.left()}))},wD=function(t,e,n,r,o){var i=0,u=uD(t),a=r.bind((function(e){return C.some(sD(e,t))})).getOr(i),c=o.bind((function(e){return C.some(sD(e,t))})).getOr(u),s={min:nA(e),max:uA(e),range:fA(e),value:n,hasMinEdge:wA(e),hasMaxEdge:xA(e),minBound:nD(t),minOffset:i,maxBound:rD(t),maxOffset:u,centerMinEdge:a,centerMaxEdge:c};return GA(s)},xD=function(t,e,n,r,o,i){var u=wD(e,i,n,r,o);return nD(e)-nD(t)+u},CD=function(t,e,n,r){var o=kA(n),i=xD(t,r.getSpectrum(t),o.x(),r.getLeftEdge(t),r.getRightEdge(t),n),u=Ec(e.element())/2;Ua(e.element(),"left",i-u+"px")},SD=bD(-1),kD=bD(1),OD=C.none,TD=C.none,ED={"top-left":C.none(),top:C.none(),"top-right":C.none(),right:C.some(MA),"bottom-right":C.none(),bottom:C.none(),"bottom-left":C.none(),left:C.some(LA)},_D=Object.freeze({__proto__:null,setValueFrom:gD,setToMin:hD,setToMax:pD,findValueOfOffset:mD,getValueFromEvent:yD,findPositionOfValue:xD,setPositionFromValue:CD,onLeft:SD,onRight:kD,onUp:OD,onDown:TD,edgeActions:ED}),AD=function(t,e){ai(t,X_(),{value:e})},DD=function(t){return{y:u(t)}},ND=function(t,e,n){var r={min:rA(e),max:aA(e),range:dA(e),value:n,step:hA(e),snap:pA(e),snapStart:vA(e),rounded:bA(e),hasMinEdge:CA(e),hasMaxEdge:SA(e),minBound:oD(t),maxBound:iD(t),screenRange:aD(t)};return $A(r)},RD=function(t,e,n){var r=ND(t,e,n),o=DD(r);return AD(t,o),r},MD=function(t,e){var n=rA(e);AD(t,DD(n))},zD=function(t,e){var n=aA(e);AD(t,DD(n))},BD=function(t,e,n){var r=t>0?UA:VA,o=r(kA(n).y(),rA(n),aA(n),hA(n));return AD(e,DD(o)),C.some(o)},PD=function(t){return function(e,n){return BD(t,e,n).map((function(){return!0}))}},HD=function(t){var e=J_(t);return e.map((function(t){return t.top()}))},ID=function(t,e,n,r,o){var i=0,u=aD(t),a=r.bind((function(e){return C.some(lD(e,t))})).getOr(i),c=o.bind((function(e){return C.some(lD(e,t))})).getOr(u),s={min:rA(e),max:aA(e),range:dA(e),value:n,hasMinEdge:CA(e),hasMaxEdge:SA(e),minBound:oD(t),minOffset:i,maxBound:iD(t),maxOffset:u,centerMinEdge:a,centerMaxEdge:c};return GA(s)},LD=function(t,e,n,r,o,i){var u=ID(e,i,n,r,o);return oD(e)-oD(t)+u},FD=function(t,e,n,r){var o=kA(n),i=LD(t,r.getSpectrum(t),o.y(),r.getTopEdge(t),r.getBottomEdge(t),n),u=pc(e.element())/2;Ua(e.element(),"top",i-u+"px")},VD=C.none,UD=C.none,jD=PD(-1),WD=PD(1),qD={"top-left":C.none(),top:C.some(DA),"top-right":C.none(),right:C.none(),"bottom-right":C.none(),bottom:C.some(PA),"bottom-left":C.none(),left:C.none()},$D=Object.freeze({__proto__:null,setValueFrom:RD,setToMin:MD,setToMax:zD,findValueOfOffset:ND,getValueFromEvent:HD,findPositionOfValue:LD,setPositionFromValue:FD,onLeft:VD,onRight:UD,onUp:jD,onDown:WD,edgeActions:qD}),GD=function(t,e){ai(t,X_(),{value:e})},KD=function(t,e){return{x:u(t),y:u(e)}},XD=function(t,e,n){var r=mD(t,e,n.left()),o=ND(t,e,n.top()),i=KD(r,o);return GD(t,i),i},YD=function(t,e,n,r){var o=t>0?UA:VA,i=e?kA(r).x():o(kA(r).x(),nA(r),uA(r),hA(r)),u=e?o(kA(r).y(),rA(r),aA(r),hA(r)):kA(r).y();return GD(n,KD(i,u)),C.some(i)},JD=function(t,e){return function(n,r){return YD(t,e,n,r).map((function(){return!0}))}},QD=function(t,e){var n=nA(e),r=rA(e);GD(t,KD(n,r))},ZD=function(t,e){var n=uA(e),r=aA(e);GD(t,KD(n,r))},tN=function(t){return J_(t)},eN=function(t,e,n,r){var o=kA(n),i=xD(t,r.getSpectrum(t),o.x(),r.getLeftEdge(t),r.getRightEdge(t),n),u=LD(t,r.getSpectrum(t),o.y(),r.getTopEdge(t),r.getBottomEdge(t),n),a=Ec(e.element())/2,c=pc(e.element())/2;Ua(e.element(),"left",i-a+"px"),Ua(e.element(),"top",u-c+"px")},nN=JD(-1,!1),rN=JD(1,!1),oN=JD(-1,!0),iN=JD(1,!0),uN={"top-left":C.some(AA),top:C.some(NA),"top-right":C.some(RA),right:C.some(zA),"bottom-right":C.some(BA),bottom:C.some(HA),"bottom-left":C.some(IA),left:C.some(FA)},aN=Object.freeze({__proto__:null,setValueFrom:XD,setToMin:QD,setToMax:ZD,getValueFromEvent:tN,setPositionFromValue:eN,onLeft:nN,onRight:rN,onUp:oN,onDown:iN,edgeActions:uN}),cN=[Pn("stepSize",1),Pn("onChange",n),Pn("onChoose",n),Pn("onInit",n),Pn("onDragStart",n),Pn("onDragEnd",n),Pn("snapToGrid",!1),Pn("rounded",!0),_n("snapStart"),bn("model",an("mode",{x:[Pn("minX",0),Pn("maxX",100),$n("value",(function(t){return Gn(t.mode.minX)})),vn("getInitialValue"),Bs("manager",_D)],y:[Pn("minY",0),Pn("maxY",100),$n("value",(function(t){return Gn(t.mode.minY)})),vn("getInitialValue"),Bs("manager",$D)],xy:[Pn("minX",0),Pn("maxX",100),Pn("minY",0),Pn("maxY",100),$n("value",(function(t){return Gn({x:u(t.mode.minX),y:u(t.mode.minY)})})),vn("getInitialValue"),Bs("manager",aN)]})),Ug("sliderBehaviours",[ny,Vg]),$n("mouseIsDown",(function(){return Gn(!1)}))],sN=function(t,e,n,r){var o,i=function(e){return Ph(e,t,"thumb")},a=function(e){return Ph(e,t,"spectrum")},c=function(e){return Bh(e,t,"left-edge")},s=function(e){return Bh(e,t,"right-edge")},l=function(e){return Bh(e,t,"top-edge")},f=function(e){return Bh(e,t,"bottom-edge")},d=t.model,m=d.manager,g=function(e,n){m.setPositionFromValue(e,n,t,{getLeftEdge:c,getRightEdge:s,getTopEdge:l,getBottomEdge:f,getSpectrum:a})},h=function(e,n){d.value.set(n);var r=i(e);return g(e,r),t.onChange(e,r,n),C.some(!0)},p=function(e){m.setToMin(e,t)},v=function(e){m.setToMax(e,t)},b=function(e){var n=function(){Bh(e,t,"thumb").each((function(n){var r=d.value.get();t.onChoose(e,n,r)}))},r=t.mouseIsDown.get();t.mouseIsDown.set(!1),r&&n()},y=function(e,n){n.stop(),t.mouseIsDown.set(!0),t.onDragStart(e,i(e))},w=function(e,n){n.stop(),t.onDragEnd(e,i(e)),b(e)};return{uid:t.uid,dom:t.dom,components:e,behaviours:Wg(t.sliderBehaviours,[ny.config({mode:"special",focusIn:function(e){return Bh(e,t,"spectrum").map(ny.focusIn).map(u(!0))}}),Vg.config({store:{mode:"manual",getValue:function(t){return d.value.get()}}}),Ll.config({channels:(o={},o[cg()]={onReceive:b},o)})]),events:di([pi(X_(),(function(t,e){h(t,e.event().value())})),Ti((function(e,n){var r=d.getInitialValue();d.value.set(r);var o=i(e);g(e,o);var u=a(e);t.onInit(e,o,u,d.value.get())})),pi(po(),y),pi(bo(),w),pi(wo(),y),pi(So(),w)]),apis:{resetToMin:p,resetToMax:v,changeValue:h,refresh:g},domModification:{styles:{position:"relative"}}}},lN=ep({name:"Slider",configFields:cN,partFields:G_,factory:sN,apis:{resetToMin:function(t,e){t.resetToMin(e)},resetToMax:function(t,e){t.resetToMax(e)},refresh:function(t,e){t.refresh(e)}}}),fN=function(t,e){var n=lN.parts().spectrum({dom:{tag:"div",classes:[e("hue-slider-spectrum")],attributes:{role:"presentation"}}}),r=lN.parts().thumb({dom:{tag:"div",classes:[e("hue-slider-thumb")],attributes:{role:"presentation"}}});return lN.sketch({dom:{tag:"div",classes:[e("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:u({y:u(0)})},components:[n,r],sliderBehaviours:Al([Sy.config({})]),onChange:function(t,e,n){ai(t,M_,{value:n})}})},dN="form",mN=[Ug("formBehaviours",[Vg])],gN=function(t){return"<alloy.field."+t+">"},hN=function(t){var e=function(){var t=[],e=function(e,n){return t.push(e),Dh(dN,gN(e),n)};return{field:e,record:function(){return t}}}(),n=t(e),r=e.record(),o=$(r,(function(t){return wh({name:t,pname:gN(t)})}));return Gh(dN,mN,o,vN,n)},pN=function(t,e){return t.fold((function(){return pt.error(e)}),pt.value)},vN=function(t,e){return{uid:t.uid,dom:t.dom,components:e,behaviours:Wg(t.formBehaviours,[Vg.config({store:{mode:"manual",getValue:function(e){var n=Ih(e,t);return Nt(n,(function(t,e){return t().bind((function(t){var n=lp.getCurrent(t);return pN(n,new Error("Cannot find a current component to extract the value from for form part '"+e+"': "+vu(t.element())))})).map(Vg.getValue)}))},setValue:function(e,n){Dt(n,(function(n,r){Bh(e,t,r).each((function(t){lp.getCurrent(t).each((function(t){Vg.setValue(t,n)}))}))}))}}})]),apis:{getField:function(e,n){return Bh(e,t,n).bind(lp.getCurrent)}}}},bN={getField:Vu((function(t,e,n){return t.getField(e,n)})),sketch:hN},yN=Cu("valid-input"),wN=Cu("invalid-input"),xN=Cu("validating-input"),CN="colorcustom.rgb.",SN=function(t,e,r,o){var i=function(n,r){return XE.config({invalidClass:e("invalid"),notify:{onValidate:function(t){ai(t,xN,{type:n})},onValid:function(t){ai(t,yN,{type:n,value:Vg.getValue(t)})},onInvalid:function(t){ai(t,wN,{type:n,value:Vg.getValue(t)})}},validator:{validate:function(e){var n=Vg.getValue(e),o=r(n)?pt.value(!0):pt.error(t("aria.input.invalid"));return HE.pure(o)},validateOnLoad:!1}})},u=function(r,o,u,a,c){var s=t(CN+"range"),l=ZT.parts().label({dom:{tag:"label",innerHtml:u,attributes:{"aria-label":a}}}),f=ZT.parts().field({data:c,factory:OE,inputAttributes:g({type:"text"},"hex"===o?{"aria-live":"polite"}:{}),inputClasses:[e("textfield")],inputBehaviours:Al([i(o,r),rE.config({})]),onSetValue:function(t){if(XE.isInvalid(t)){var e=XE.run(t);e.get(n)}}}),d=[l,f],m="hex"!==o?[ZT.parts()["aria-descriptor"]({text:s})]:[],h=d.concat(m);return{dom:{tag:"div",attributes:{role:"presentation"}},components:h}},a=function(t,e){var n=Xk(e);return bN.getField(t,"hex").each((function(e){Sy.isFocused(e)||Vg.setValue(t,{hex:n.value})})),n},c=function(t,e){var n=e.red,r=e.green,o=e.blue;Vg.setValue(t,{red:n,green:r,blue:o})},s=jw({dom:{tag:"div",classes:[e("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),l=function(t,e){s.getOpt(t).each((function(t){Ua(t.element(),"background-color","#"+e.value)}))},f=function(){var n={red:Gn(C.some(255)),green:Gn(C.some(255)),blue:Gn(C.some(255)),hex:Gn(C.some("ffffff"))},i=function(t,e){var n=oO(e);c(t,n),g(n)},f=function(t){return n[t].get()},d=function(t,e){n[t].set(e)},m=function(){return f("red").bind((function(t){return f("green").bind((function(e){return f("blue").map((function(n){return eO(t,e,n,1)}))}))}))},g=function(t){var e=t.red,n=t.green,r=t.blue;d("red",C.some(e)),d("green",C.some(n)),d("blue",C.some(r))},h=function(t,e){var n=e.event();"hex"!==n.type()?d(n.type(),C.none()):o(t)},p=function(t,e){r(t);var n=Uk(e);d("hex",C.some(e));var o=oO(n);c(t,o),g(o),ai(t,R_,{hex:n}),l(t,n)},v=function(t,e,n){var r=parseInt(n,10);d(e,C.some(r)),m().each((function(e){var n=a(t,e);l(t,n)}))},b=function(t){return"hex"===t.type()},y=function(t,e){var n=e.event();b(n)?p(t,n.value()):v(t,n.type(),n.value())},w=function(e){return{label:t(CN+e+".label"),description:t(CN+e+".description")}},x=w("red"),S=w("green"),k=w("blue"),O=w("hex");return Kt(bN.sketch((function(n){return{dom:{tag:"form",classes:[e("rgb-form")],attributes:{"aria-label":t("aria.color.picker")}},components:[n.field("red",ZT.sketch(u(nO,"red",x.label,x.description,255))),n.field("green",ZT.sketch(u(nO,"green",S.label,S.description,255))),n.field("blue",ZT.sketch(u(nO,"blue",k.label,k.description,255))),n.field("hex",ZT.sketch(u(qk,"hex",O.label,O.description,"ffffff"))),s.asSpec()],formBehaviours:Al([XE.config({invalidClass:e("form-invalid")}),gy("rgb-form-events",[pi(yN,y),pi(wN,h),pi(xN,h)])])}})),{apis:{updateHex:function(t,e){Vg.setValue(t,{hex:e.value}),i(t,e),l(t,e)}}})},d=tp({factory:f,name:"RgbForm",configFields:[],apis:{updateHex:function(t,e,n){t.updateHex(e,n)}},extraApis:{}});return d},kN=function(t,e){var n=lN.parts().spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[e("sv-palette-spectrum")]}}),r=lN.parts().thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[e("sv-palette-thumb")],innerHtml:"<div class="+e("sv-palette-inner-thumb")+' role="presentation"></div>'}}),o=function(t,e){var n=t.width,r=t.height,o=t.getContext("2d");if(null!==o){o.fillStyle=e,o.fillRect(0,0,n,r);var i=o.createLinearGradient(0,0,n,0);i.addColorStop(0,"rgba(255,255,255,1)"),i.addColorStop(1,"rgba(255,255,255,0)"),o.fillStyle=i,o.fillRect(0,0,n,r);var u=o.createLinearGradient(0,0,0,r);u.addColorStop(0,"rgba(0,0,0,0)"),u.addColorStop(1,"rgba(0,0,0,1)"),o.fillStyle=u,o.fillRect(0,0,n,r)}},i=function(t,e){var n=t.components()[0].element().dom();o(n,aO(e))},a=function(t){var i=u({x:u(0),y:u(0)}),a=function(t,e,n){ai(t,z_,{value:n})},c=function(t,e,n,r){o(n.element().dom(),aO(cO))},s=Al([lp.config({find:C.some}),Sy.config({})]);return lN.sketch({dom:{tag:"div",attributes:{role:"presentation"},classes:[e("sv-palette")]},model:{mode:"xy",getInitialValue:i},rounded:!1,components:[n,r],onChange:a,onInit:c,sliderBehaviours:s})},c=tp({factory:a,name:"SaturationBrightnessPalette",configFields:[],apis:{setRgba:function(t,e,n){i(e,n)}},extraApis:{}});return c},ON=function(t,e){var r=function(n){var r=SN(t,e,n.onValidHex,n.onInvalidHex),o=kN(t,e),i={paletteRgba:Gn(cO)},u=jw(o.sketch({})),a=jw(r.sketch({})),c=function(t,e){u.getOpt(t).each((function(t){var n=oO(e);i.paletteRgba.set(n),o.setRgba(t,n)}))},s=function(t,e){a.getOpt(t).each((function(t){r.updateHex(t,e)}))},l=function(t,e,n){G(n,(function(n){n(t,e)}))},f=function(){var t=[s];return function(e,n){var r=n.event().value(),o=i.paletteRgba.get(),u=D_(o),a=A_(u.hue,r.x(),100-r.y()),c=rO(a),s=Xk(c);l(e,s,t)}},d=function(){var t=[c,s];return function(e,n){var r=n.event().value(),o=N_(r.y());l(e,o,t)}};return{uid:n.uid,dom:n.dom,components:[u.asSpec(),fN(t,e),a.asSpec()],behaviours:Al([gy("colour-picker-events",[pi(z_,f()),pi(M_,d())]),lp.config({find:function(t){return a.getOpt(t)}}),ny.config({mode:"acyclic"})])}},o=tp({name:"ColourPicker",configFields:[vn("dom"),Pn("onValidHex",n),Pn("onInvalidHex",n)],factory:r});return o},TN=function(){return lp.config({find:C.some})},EN=function(t){return lp.config({find:t.getOpt})},_N=function(t){return lp.config({find:function(e){return qi(e.element(),t).bind((function(t){return e.getSystem().getByDom(t).toOption()}))}})},AN={self:TN,memento:EN,childAt:_N},DN={"colorcustom.rgb.red.label":"R","colorcustom.rgb.red.description":"Red component","colorcustom.rgb.green.label":"G","colorcustom.rgb.green.description":"Green component","colorcustom.rgb.blue.label":"B","colorcustom.rgb.blue.description":"Blue component","colorcustom.rgb.hex.label":"#","colorcustom.rgb.hex.description":"Hex color code","colorcustom.rgb.range":"Range 0 to 255","colorcustom.sb.saturation":"Saturation","colorcustom.sb.brightness":"Brightness","colorcustom.sb.picker":"Saturation and Brightness Picker","colorcustom.sb.palette":"Saturation and Brightness Palette","colorcustom.sb.instructions":"Use arrow keys to select saturation and brightness, on x and y axes","colorcustom.hue.hue":"Hue","colorcustom.hue.slider":"Hue Slider","colorcustom.hue.palette":"Hue Palette","colorcustom.hue.instructions":"Use arrow keys to select a hue","aria.color.picker":"Color Picker","aria.input.invalid":"Invalid input"},NN=function(t){return DN[t]},RN=function(t){return NN(t)},MN=function(t){var n=function(t){return"tox-"+t},r=ON(RN,n),o=function(t){ai(t,mE,{name:"hex-valid",value:!0})},i=function(t){ai(t,mE,{name:"hex-valid",value:!1})},u=jw(r.sketch({dom:{tag:"div",classes:[n("color-picker-container")],attributes:{role:"presentation"}},onValidHex:o,onInvalidHex:i}));return{dom:{tag:"div"},components:[u.asSpec()],behaviours:Al([Vg.config({store:{mode:"manual",getValue:function(t){var e=u.get(t),n=lp.getCurrent(e),r=n.bind((function(t){var e=Vg.getValue(t);return e.hex}));return r.map((function(t){return"#"+t})).getOr("")},setValue:function(t,n){var r=/^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/,o=r.exec(n),i=u.get(t),a=lp.getCurrent(i);a.fold((function(){e.console.log("Can not find form")}),(function(t){Vg.setValue(t,{hex:C.from(o[1]).getOr("")}),bN.getField(t,"hex").each((function(t){ui(t,Ao())}))}))}}}),AN.self()])}},zN=tinymce.util.Tools.resolve("tinymce.Resource"),BN=function(t){return Object.prototype.hasOwnProperty.call(t,"init")},PN=function(t){var e=Gn(C.none()),n=jw({dom:{tag:t.tag}}),r=Gn(C.none());return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:Al([gy("editor-foo-events",[Ti((function(o){n.getOpt(o).each((function(n){(BN(t)?t.init(n.element().dom()):zN.load(t.scriptId,t.scriptUrl).then((function(e){return e(n.element().dom(),t.settings)}))).then((function(t){r.get().each((function(e){t.setValue(e)})),r.set(C.none()),e.set(C.some(t))}))}))}))]),Vg.config({store:{mode:"manual",getValue:function(){return e.get().fold((function(){return r.get().getOr("")}),(function(t){return t.getValue()}))},setValue:function(t,n){e.get().fold((function(){r.set(C.some(n))}),(function(t){return t.setValue(n)}))}}}),AN.self()]),components:[n.asSpec()]}},HN=Ie([Pn("preprocess",a),Pn("postprocess",a)]),IN=function(t,e){var n=rn("RepresentingConfigs.memento processors",HN,e);return Vg.config({store:{mode:"manual",getValue:function(e){var r=t.get(e),o=Vg.getValue(r);return n.postprocess(o)},setValue:function(e,r){var o=n.preprocess(r),i=t.get(e);Vg.setValue(i,o)}}})},LN=function(t,e,n){return Vg.config(Kt({store:{mode:"manual",getValue:e,setValue:n}},t.map((function(t){return{store:{initialValue:t}}})).getOr({})))},FN=function(t,e,n){return LN(t,(function(t){return e(t.element())}),(function(t,e){return n(t.element(),e)}))},VN=function(t){return FN(t,Qa,Za)},UN=function(t){return FN(t,ou,iu)},jN=function(t){return Vg.config({store:{mode:"memory",initialValue:t}})},WN={memento:IN,withElement:FN,withComp:LN,domValue:VN,domHtml:UN,memory:jN},qN=".jpg,.jpeg,.png,.gif",$N=function(t){var e=new RegExp("("+qN.split(/\s*,\s*/).join("|")+")$","i");return Y(ft(t),(function(t){return e.test(t.name)}))},GN=function(t,e){var n=function(t,e){e.stop()},r=function(t){return function(e,n){G(t,(function(t){t(e,n)}))}},o=function(t,e){if(!cS.isDisabled(t)){var n=e.event().raw();u(t,n.dataTransfer.files)}},i=function(t,e){var n=e.event().raw().target.files;u(t,n)},u=function(e,n){Vg.setValue(e,$N(n)),ai(e,lE,{name:t.name})},a=jw({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:Al([gy("input-file-events",[Si(No()),Si(Vo())])])}),c=function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:Al([WN.memory([]),AN.self(),cS.config({}),Uy.config({toggleClass:"dragenter",toggleOnExecute:!1}),gy("dropzone-events",[pi("dragenter",r([n,Uy.toggle])),pi("dragleave",r([n,Uy.toggle])),pi("dragover",n),pi("drop",r([n,o])),pi(Do(),i)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:e.translate("Drop an image here")}},Uw.sketch({dom:{tag:"button",innerHtml:e.translate("Browse for an image"),styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[a.asSpec()],action:function(t){var e=a.get(t);e.element().dom().click()},buttonBehaviours:Al([rE.config({}),rk.button(e.isReadOnly),QS()])})]}]}},s=t.label.map((function(t){return sE(t,e)})),l=ZT.parts().field({factory:{sketch:c}});return oE(s,l,["tox-form__group--stretched"],[])},KN=function(t,e){return{dom:{tag:"div",classes:["tox-form__grid","tox-form__grid--"+t.columns+"col"]},components:$(t.items,e.interpreter)}},XN=Cu("alloy-fake-before-tabstop"),YN=Cu("alloy-fake-after-tabstop"),JN=function(t){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:t},behaviours:Al([Sy.config({ignore:!0}),rE.config({})])}},QN=function(t){return{dom:{tag:"div",classes:["tox-navobj"]},components:[JN([XN]),t,JN([YN])],behaviours:Al([AN.childAt(1)])}},ZN=function(t,e){ai(t,Eo(),{raw:{which:9,shiftKey:e}})},tR=function(t,e){var n=e.element();ka(n,XN)?ZN(t,!0):ka(n,YN)&&ZN(t,!1)},eR=function(t){return yT(t,["."+XN,"."+YN].join(","),u(!1))},nR=!(Gr().browser.isIE()||Gr().browser.isEdge()),rR=function(t){var e=Gn("");return{getValue:function(t){return e.get()},setValue:function(n,r){if(t)cu(n.element(),"srcdoc",r);else{cu(n.element(),"src","javascript:''");var o=n.element().dom().contentWindow.document;o.open(),o.write(r),o.close()}e.set(r)}}},oR=function(t,e){var n=nR&&t.sandboxed,r=g(g({},t.label.map((function(t){return{title:t}})).getOr({})),n?{sandbox:"allow-scripts allow-same-origin"}:{}),o=rR(n),i=t.label.map((function(t){return sE(t,e)})),u=function(t){return QN({uid:t.uid,dom:{tag:"iframe",attributes:r},behaviours:Al([rE.config({}),Sy.config({}),WN.withComp(C.none(),o.getValue,o.setValue)])})},a=ZT.parts().field({factory:{sketch:u}});return oE(i,a,["tox-form__group--stretched"],[])};function iR(t,n){return cR(e.document.createElement("canvas"),t,n)}function uR(t){var e=iR(t.width,t.height),n=aR(e);return n.drawImage(t,0,0),e}function aR(t){return t.getContext("2d")}function cR(t,e,n){return t.width=e,t.height=n,t}function sR(t){return t.naturalWidth||t.width}function lR(t){return t.naturalHeight||t.height}var fR=function(){var t=function(t){if("object"!==typeof this)throw new TypeError("Promises must be constructed via new");if("function"!==typeof t)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],l(t,r(u,this),r(a,this))},n=t.immediateFn||"function"===typeof window.setImmediate&&window.setImmediate||function(t){e.setTimeout(t,1)};function r(t,e){return function(){return t.apply(e,arguments)}}var o=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function i(t){var e=this;null!==this._state?n((function(){var n=e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(o){return void t.reject(o)}t.resolve(r)}else(e._state?t.resolve:t.reject)(e._value)})):this._deferreds.push(t)}function u(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"===typeof t||"function"===typeof t)){var e=t.then;if("function"===typeof e)return void l(r(e,t),r(u,this),r(a,this))}this._state=!0,this._value=t,c.call(this)}catch(n){a.call(this,n)}}function a(t){this._state=!1,this._value=t,c.call(this)}function c(){for(var t=0,e=this._deferreds;t<e.length;t++){var n=e[t];i.call(this,n)}this._deferreds=[]}function s(t,e,n,r){this.onFulfilled="function"===typeof t?t:null,this.onRejected="function"===typeof e?e:null,this.resolve=n,this.reject=r}function l(t,e,n){var r=!1;try{t((function(t){r||(r=!0,e(t))}),(function(t){r||(r=!0,n(t))}))}catch(o){if(r)return;r=!0,n(o)}}return t.prototype.catch=function(t){return this.then(null,t)},t.prototype.then=function(e,n){var r=this;return new t((function(t,o){i.call(r,new s(e,n,t,o))}))},t.all=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=Array.prototype.slice.call(1===e.length&&o(e[0])?e[0]:e);return new t((function(t,e){if(0===r.length)return t([]);var n=r.length;function o(i,u){try{if(u&&("object"===typeof u||"function"===typeof u)){var a=u.then;if("function"===typeof a)return void a.call(u,(function(t){o(i,t)}),e)}r[i]=u,0===--n&&t(r)}catch(c){e(c)}}for(var i=0;i<r.length;i++)o(i,r[i])}))},t.resolve=function(e){return e&&"object"===typeof e&&e.constructor===t?e:new t((function(t){t(e)}))},t.reject=function(e){return new t((function(t,n){n(e)}))},t.race=function(e){return new t((function(t,n){for(var r=0,o=e;r<o.length;r++){var i=o[r];i.then(t,n)}}))},t},dR=window.Promise?window.Promise:fR();function mR(t){return new dR((function(n,r){var o=e.URL.createObjectURL(t),i=new e.Image,u=function(){i.removeEventListener("load",a),i.removeEventListener("error",c)};function a(){u(),n(i)}function c(){u(),r("Unable to load data of type "+t.type+": "+o)}i.addEventListener("load",a),i.addEventListener("error",c),i.src=o,i.complete&&a()}))}function gR(t){var n=t.split(","),r=/data:([^;]+)/.exec(n[0]);if(!r)return C.none();for(var o=r[1],i=n[1],u=1024,a=e.atob(i),c=a.length,s=Math.ceil(c/u),l=new Array(s),f=0;f<s;++f){for(var d=f*u,m=Math.min(d+u,c),g=new Array(m-d),h=d,p=0;h<m;++p,++h)g[p]=a[h].charCodeAt(0);l[f]=new Uint8Array(g)}return C.some(new e.Blob(l,{type:o}))}function hR(t){return new dR((function(e,n){gR(t).fold((function(){n("uri is not base64: "+t)}),e)}))}function pR(t,n,r){return n=n||"image/png",e.HTMLCanvasElement.prototype.toBlob?new dR((function(e,o){t.toBlob((function(t){t?e(t):o()}),n,r)})):hR(t.toDataURL(n,r))}function vR(t,e,n){return e=e||"image/png",t.toDataURL(e,n)}function bR(t){return mR(t).then((function(t){wR(t);var e=iR(sR(t),lR(t)),n=aR(e);return n.drawImage(t,0,0),e}))}function yR(t){return new dR((function(n){var r=new e.FileReader;r.onloadend=function(){n(r.result)},r.readAsDataURL(t)}))}function wR(t){e.URL.revokeObjectURL(t.src)}function xR(t,e,n){var r=e.type,o=u(r);function i(){return dR.resolve(e)}var a=u(n);function c(){return n.split(",")[1]}function s(e,n){return t.then((function(t){return pR(t,e,n)}))}function l(e,n){return t.then((function(t){return vR(t,e,n)}))}function f(t,e){return l(t,e).then((function(t){return t.split(",")[1]}))}function d(){return t.then(uR)}return{getType:o,toBlob:i,toDataURL:a,toBase64:c,toAdjustedBlob:s,toAdjustedDataURL:l,toAdjustedBase64:f,toCanvas:d}}function CR(t){return yR(t).then((function(e){return xR(bR(t),t,e)}))}function SR(t,e){return pR(t,e).then((function(e){return xR(dR.resolve(t),e,t.toDataURL())}))}var kR=function(t){return CR(t)};function OR(t,e,n){var r="string"===typeof t?parseFloat(t):t;return r>n?r=n:r<e&&(r=e),r}function TR(){return[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1]}var ER=[0,.01,.02,.04,.05,.06,.07,.08,.1,.11,.12,.14,.15,.16,.17,.18,.2,.21,.22,.24,.25,.27,.28,.3,.32,.34,.36,.38,.4,.42,.44,.46,.48,.5,.53,.56,.59,.62,.65,.68,.71,.74,.77,.8,.83,.86,.89,.92,.95,.98,1,1.06,1.12,1.18,1.24,1.3,1.36,1.42,1.48,1.54,1.6,1.66,1.72,1.78,1.84,1.9,1.96,2,2.12,2.25,2.37,2.5,2.62,2.75,2.87,3,3.2,3.4,3.6,3.8,4,4.3,4.7,4.9,5,5.5,6,6.5,6.8,7,7.3,7.5,7.8,8,8.4,8.7,9,9.4,9.6,9.8,10];function _R(t,e){for(var n,r=[],o=new Array(25),i=0;i<5;i++){for(var u=0;u<5;u++)r[u]=e[u+5*i];for(u=0;u<5;u++){n=0;for(var a=0;a<5;a++)n+=t[u+5*a]*r[a];o[u+5*i]=n}}return o}function AR(t,e){var n;return e=OR(e,-1,1),e*=100,e<0?n=127+e/100*127:(n=e%1,n=0===n?ER[e]:ER[Math.floor(e)]*(1-n)+ER[Math.floor(e)+1]*n,n=127*n+127),_R(t,[n/127,0,0,0,.5*(127-n),0,n/127,0,0,.5*(127-n),0,0,n/127,0,.5*(127-n),0,0,0,1,0,0,0,0,0,1])}function DR(t,e){return e=OR(255*e,-255,255),_R(t,[1,0,0,0,e,0,1,0,0,e,0,0,1,0,e,0,0,0,1,0,0,0,0,0,1])}function NR(t,e,n,r){return e=OR(e,0,2),n=OR(n,0,2),r=OR(r,0,2),_R(t,[e,0,0,0,0,0,n,0,0,0,0,0,r,0,0,0,0,0,1,0,0,0,0,0,1])}function RR(t,e){return t.toCanvas().then((function(n){return MR(n,t.getType(),e)}))}function MR(t,e,n){var r=aR(t);function o(t,e){for(var n,r,o,i,u=t.data,a=e[0],c=e[1],s=e[2],l=e[3],f=e[4],d=e[5],m=e[6],g=e[7],h=e[8],p=e[9],v=e[10],b=e[11],y=e[12],w=e[13],x=e[14],C=e[15],S=e[16],k=e[17],O=e[18],T=e[19],E=0;E<u.length;E+=4)n=u[E],r=u[E+1],o=u[E+2],i=u[E+3],u[E]=n*a+r*c+o*s+i*l+f,u[E+1]=n*d+r*m+o*g+i*h+p,u[E+2]=n*v+r*b+o*y+i*w+x,u[E+3]=n*C+r*S+o*k+i*O+T;return t}var i=o(r.getImageData(0,0,t.width,t.height),n);return r.putImageData(i,0,0),SR(t,e)}function zR(t,e){return t.toCanvas().then((function(n){return BR(n,t.getType(),e)}))}function BR(t,e,n){var r=aR(t);function o(t,e,n){function r(t,e,n){return t>n?t=n:t<e&&(t=e),t}for(var o=Math.round(Math.sqrt(n.length)),i=Math.floor(o/2),u=t.data,a=e.data,c=t.width,s=t.height,l=0;l<s;l++)for(var f=0;f<c;f++){for(var d=0,m=0,g=0,h=0;h<o;h++)for(var p=0;p<o;p++){var v=r(f+p-i,0,c-1),b=r(l+h-i,0,s-1),y=4*(b*c+v),w=n[h*o+p];d+=u[y]*w,m+=u[y+1]*w,g+=u[y+2]*w}var x=4*(l*c+f);a[x]=r(d,0,255),a[x+1]=r(m,0,255),a[x+2]=r(g,0,255)}return e}var i=r.getImageData(0,0,t.width,t.height),u=r.getImageData(0,0,t.width,t.height);return u=o(i,u,n),r.putImageData(u,0,0),SR(t,e)}function PR(t){var e=function(e,n,r){var o=aR(e),i=new Array(256);function u(t,e){for(var n=t.data,r=0;r<n.length;r+=4)n[r]=e[n[r]],n[r+1]=e[n[r+1]],n[r+2]=e[n[r+2]];return t}for(var a=0;a<i.length;a++)i[a]=t(a,r);var c=u(o.getImageData(0,0,e.width,e.height),i);return o.putImageData(c,0,0),SR(e,n)};return function(t,n){return t.toCanvas().then((function(r){return e(r,t.getType(),n)}))}}function HR(t){return function(e,n){return RR(e,t(TR(),n))}}function IR(t){return function(e){return RR(e,t)}}function LR(t){return function(e){return zR(e,t)}}var FR=IR([-1,0,0,0,255,0,-1,0,0,255,0,0,-1,0,255,0,0,0,1,0,0,0,0,0,1]),VR=HR(DR),UR=HR(AR),jR=function(t,e,n,r){return RR(t,NR(TR(),e,n,r))},WR=LR([0,-1,0,-1,5,-1,0,-1,0]),qR=PR((function(t,e){return 255*Math.pow(t/255,1-e)}));function $R(t,e,n){var r=sR(t),o=lR(t),i=e/r,u=n/o,a=!1;(i<.5||i>2)&&(i=i<.5?.5:2,a=!0),(u<.5||u>2)&&(u=u<.5?.5:2,a=!0);var c=GR(t,i,u);return a?c.then((function(t){return $R(t,e,n)})):c}function GR(t,e,n){return new dR((function(r){var o=sR(t),i=lR(t),u=Math.floor(o*e),a=Math.floor(i*n),c=iR(u,a),s=aR(c);s.drawImage(t,0,0,o,i,0,0,u,a),r(c)}))}function KR(t,e){return t.toCanvas().then((function(n){return XR(n,t.getType(),e)}))}function XR(t,e,n){var r=iR(t.width,t.height),o=aR(r),i=0,u=0;return n=n<0?360+n:n,90!==n&&270!==n||cR(r,r.height,r.width),90!==n&&180!==n||(i=r.width),270!==n&&180!==n||(u=r.height),o.translate(i,u),o.rotate(n*Math.PI/180),o.drawImage(t,0,0),SR(r,e)}function YR(t,e){return t.toCanvas().then((function(n){return JR(n,t.getType(),e)}))}function JR(t,e,n){var r=iR(t.width,t.height),o=aR(r);return"v"===n?(o.scale(1,-1),o.drawImage(t,0,-r.height)):(o.scale(-1,1),o.drawImage(t,-r.width,0)),SR(r,e)}function QR(t,e,n,r,o){return t.toCanvas().then((function(i){return ZR(i,t.getType(),e,n,r,o)}))}function ZR(t,e,n,r,o,i){var u=iR(o,i),a=aR(u);return a.drawImage(t,-n,-r),SR(u,e)}function tM(t,e,n){return t.toCanvas().then((function(r){return $R(r,e,n).then((function(e){return SR(e,t.getType())}))}))}var eM=function(t){return FR(t)},nM=function(t){return WR(t)},rM=function(t,e){return qR(t,e)},oM=function(t,e,n,r){return jR(t,e,n,r)},iM=function(t,e){return VR(t,e)},uM=function(t,e){return UR(t,e)},aM=function(t,e){return YR(t,e)},cM=function(t,e,n,r,o){return QR(t,e,n,r,o)},sM=function(t,e,n){return tM(t,e,n)},lM=function(t,e){return KR(t,e)},fM=function(t,e){return g({dom:{tag:"span",innerHtml:t,classes:["tox-icon","tox-tbtn__icon-wrap"]}},e)},dM=function(t,e){return fM(qw(t,e),{})},mM=function(t,e){return fM(qw(t,e),{behaviours:Al([dy.config({})])})},gM=function(t,e,n){return{dom:{tag:"span",innerHtml:n.translate(t),classes:[e+"__select-label"]},behaviours:Al([dy.config({})])}},hM=Cu("toolbar.button.execute"),pM=function(t){return Ai((function(e,n){ok(t,e)((function(n){ai(e,hM,{buttonApi:n}),t.onAction(n)}))}))},vM={"alloy.execute":["disabling","alloy.base.behaviour","toggling","toolbar-button-events"]},bM=Cu("update-menu-text"),yM=Cu("update-menu-icon"),wM=function(t,e,r){var o=Gn(n),i=t.text.map((function(t){return jw(gM(t,e,r.providers))})),u=t.icon.map((function(t){return jw(mM(t,r.providers.icons))})),a=function(t,e){var n=Vg.getValue(t);return Sy.focus(n),ai(n,"keydown",{raw:e.event().raw()}),y_.close(n),C.some(!0)},c=t.role.fold((function(){return{}}),(function(t){return{role:t}})),s=t.tooltip.fold((function(){return{}}),(function(t){var e=r.providers.translate(t);return{title:e,"aria-label":e}})),l=jw(y_.sketch(g(g({},c),{dom:{tag:"button",classes:[e,e+"--select"].concat($(t.classes,(function(t){return e+"--"+t}))),attributes:g({},s)},components:sk([u.map((function(t){return t.asSpec()})),i.map((function(t){return t.asSpec()})),C.some({dom:{tag:"div",classes:[e+"__select-chevron"],innerHtml:qw("chevron-down",r.providers.icons)}})]),matchWidth:!0,useMinWidth:!0,dropdownBehaviours:Al(p(t.dropdownBehaviours,[rk.button((function(){return t.disabled||r.providers.isReadOnly()})),QS(),S_.config({}),dy.config({}),gy("dropdown-events",[ik(t,o),uk(t,o)]),gy("menubutton-update-display-text",[pi(bM,(function(t,e){i.bind((function(e){return e.getOpt(t)})).each((function(t){dy.set(t,[sc(r.providers.translate(e.event().text()))])}))})),pi(yM,(function(t,e){u.bind((function(e){return e.getOpt(t)})).each((function(t){dy.set(t,[mM(e.event().icon(),r.providers.icons)])}))}))])])),eventOrder:Kt(vM,{mousedown:["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"]}),sandboxBehaviours:Al([ny.config({mode:"special",onLeft:a,onRight:a})]),lazySink:r.getSink,toggleClass:e+"--active",parts:{menu:rC(!1,t.columns,t.presets)},fetch:function(){return HE.nu(t.fetch)}})));return l.asSpec()},xM=function(t){return E(t)},CM=function(t){return"separator"===t.type},SM=function(t){return Ft(t,"getSubmenuItems")},kM={type:"separator"},OM=function(t,e){var n=Q(t,(function(t,n){return xM(n)?""===n?t:"|"===n?t.length>0&&!CM(t[t.length-1])?t.concat([kM]):t:Ft(e,n.toLowerCase())?t.concat([e[n.toLowerCase()]]):t:t.concat([n])}),[]);return n.length>0&&CM(n[n.length-1])&&n.pop(),n},TM=function(t,e){var n=t.getSubmenuItems(),r=AM(n,e),o=Kt(r.menus,se(t.value,r.items)),i=Kt(r.expansions,se(t.value,t.value));return{item:t,menus:o,expansions:i}},EM=function(t,e){return SM(t)?TM(t,e):{item:t,menus:{},expansions:{}}},_M=function(t){if(CM(t))return t;var e=Lt(t,"value").getOrThunk((function(){return Cu("generated-menu-item")}));return Kt({value:e},t)},AM=function(t,e){var n=OM(E(t)?t.split(" "):t,e);return J(n,(function(t,n){var r=_M(n),o=EM(r,e);return{menus:Kt(t.menus,o.menus),items:[o.item].concat(t.items),expansions:Kt(t.expansions,o.expansions)}}),{menus:{},expansions:{},items:[]})},DM=function(t,e,n,r){var o=Cu("primary-menu"),i=AM(t,n.shared.providers.menuItems());if(0===i.items.length)return C.none();var u=lT(o,i.items,e,n,r),a=Nt(i.menus,(function(t,r){return lT(r,t,e,n,!1)})),c=Kt(a,se(o,u));return C.from(Ow.tieredData(o,c,i.expansions))},NM=function(t){return{isDisabled:function(){return cS.isDisabled(t)},setDisabled:function(e){return cS.set(t,e)},setActive:function(e){var n=t.element();e?(xa(n,"tox-tbtn--enabled"),cu(n,"aria-pressed",!0)):(Sa(n,"tox-tbtn--enabled"),mu(n,"aria-pressed"))},isActive:function(){return ka(t.element(),"tox-tbtn--enabled")}}},RM=function(t,e,n,r){return wM({text:t.text,icon:t.icon,tooltip:t.tooltip,role:r,fetch:function(e){t.fetch((function(t){e(DM(t,Hx.CLOSE_ON_EXECUTE,n,!1))}))},onSetup:t.onSetup,getApi:NM,columns:1,presets:"normal",classes:[],dropdownBehaviours:[rE.config({})]},e,n.shared)},MM=function(t,e,n){var r=function(t){return function(r){var o=!r.isActive();r.setActive(o),t.storage.set(o),n.shared.getSink().each((function(n){e().getOpt(n).each((function(e){jl(e.element()),ai(e,mE,{name:t.name,value:t.storage.get()})}))}))}},o=function(t){return function(e){e.setActive(t.storage.get())}};return function(e){e($(t,(function(t){var e=t.text.fold((function(){return{}}),(function(t){return{text:t}}));return g(g({type:t.type,active:!1},e),{onAction:r(t),onSetup:o(t)})})))}},zM=function(t,e,n,r,o,i){void 0===n&&(n=[]);var u=e.fold((function(){return{}}),(function(t){return{action:t}})),a=g({buttonBehaviours:Al([rk.button((function(){return t.disabled||i.isReadOnly()})),QS(),rE.config({}),gy("button press",[hi("click"),hi("mousedown")])].concat(n)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]}},u),c=Kt(a,{dom:r});return Kt(c,{components:o})},BM=function(t,e,n,r){void 0===r&&(r=[]);var o=t.tooltip.map((function(t){return{"aria-label":n.translate(t),title:n.translate(t)}})).getOr({}),i={tag:"button",classes:["tox-tbtn"],attributes:o},u=t.icon.map((function(t){return dM(t,n.icons)})),a=sk([u]);return zM(t,e,r,i,a,n)},PM=function(t,e,n,r){void 0===r&&(r=[]);var o=BM(t,C.some(e),n,r);return Uw.sketch(o)},HM=function(t,e,n,r,o){void 0===r&&(r=[]),void 0===o&&(o=[]);var i=n.translate(t.text),u=t.icon?t.icon.map((function(t){return dM(t,n.icons)})):C.none(),a=u.isSome()?sk([u]):[],c=u.isSome()?{}:{innerHtml:i},s=p(t.primary||t.borderless?["tox-button"]:["tox-button","tox-button--secondary"],u.isSome()?["tox-button--icon"]:[],t.borderless?["tox-button--naked"]:[],o),l=g(g({tag:"button",classes:s},c),{attributes:{title:i}});return zM(t,e,r,l,a,n)},IM=function(t,e,n,r,o){void 0===r&&(r=[]),void 0===o&&(o=[]);var i=HM(t,C.some(e),n,r,o);return Uw.sketch(i)},LM=function(t,n){return function(r){"custom"===n?ai(r,mE,{name:t,value:{}}):"submit"===n?ui(r,gE):"cancel"===n?ui(r,dE):e.console.error("Unknown button type: ",n)}},FM=function(t,e){return"menu"===e},VM=function(t,e){return"custom"===e||"cancel"===e||"submit"===e},UM=function(t,r,o){if(FM(t,r)){var i=function(){return c},u=t,a=g(g({},t),{onSetup:function(e){return e.setDisabled(t.disabled),n},fetch:MM(u.items,i,o)}),c=jw(RM(a,"tox-tbtn",o,C.none()));return c.asSpec()}if(VM(t,r)){var s=LM(t.name,r),l=g(g({},t),{borderless:!1});return IM(l,s,o.shared.providers,[])}e.console.error("Unknown footer button type: ",r)},jM=function(t,e){var n=LM(t.name,"custom");return iE(C.none(),ZT.parts().field(g({factory:Uw},HM(t,C.some(n),e,[WN.memory(""),AN.self()]))))},WM=u([Pn("field1Name","field1"),Pn("field2Name","field2"),Ms("onLockedChange"),As(["lockClass"]),Pn("locked",!1),qg.field("coupledFieldBehaviours",[lp,Vg])]),qM=function(t,e,n){return Bh(t,e,n).bind(lp.getCurrent)},$M=function(t,e){return wh({factory:ZT,name:t,overrides:function(t){return{fieldBehaviours:Al([gy("coupled-input-behaviour",[pi(Ao(),(function(n){qM(n,t,e).each((function(e){Bh(n,t,"lock").each((function(r){Uy.isOn(r)&&t.onLockedChange(n,e,r)}))}))}))])])}}})},GM=u([$M("field1","field2"),$M("field2","field1"),wh({factory:Uw,schema:[vn("dom")],name:"lock",overrides:function(t){return{buttonBehaviours:Al([Uy.config({selected:t.locked,toggleClass:t.markers.lockClass,aria:{mode:"pressed"}})])}}})]),KM=function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,behaviours:qg.augment(t.coupledFieldBehaviours,[lp.config({find:C.some}),Vg.config({store:{mode:"manual",getValue:function(e){var n,r=Fh(e,t,["field1","field2"]);return n={},n[t.field1Name]=Vg.getValue(r.field1()),n[t.field2Name]=Vg.getValue(r.field2()),n},setValue:function(e,n){var r=Fh(e,t,["field1","field2"]);Vt(n,t.field1Name)&&Vg.setValue(r.field1(),n[t.field1Name]),Vt(n,t.field2Name)&&Vg.setValue(r.field2(),n[t.field2Name])}}})]),apis:{getField1:function(e){return Bh(e,t,"field1")},getField2:function(e){return Bh(e,t,"field2")},getLock:function(e){return Bh(e,t,"lock")}}}},XM=ep({name:"FormCoupledInputs",configFields:WM(),partFields:GM(),factory:KM,apis:{getField1:function(t,e){return t.getField1(e)},getField2:function(t,e){return t.getField2(e)},getLock:function(t,e){return t.getLock(e)}}}),YM=function(t){var e={"":0,px:0,pt:1,mm:1,pc:2,ex:2,em:2,ch:2,rem:2,cm:3,in:4,"%":4},n=function(t){return t in e?e[t]:1},r=t.value.toFixed(n(t.unit));return-1!==r.indexOf(".")&&(r=r.replace(/\.?0*$/,"")),r+t.unit},JM=function(t){var e=/^\s*(\d+(?:\.\d+)?)\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\s*$/,n=e.exec(t);if(null!==n){var r=parseFloat(n[1]),o=n[2];return pt.value({value:r,unit:o})}return pt.error(t)},QM=function(t,e){var n={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,in:1},r=function(t){return Object.prototype.hasOwnProperty.call(n,t)};return t.unit===e?C.some(t.value):r(t.unit)&&r(e)?n[t.unit]===n[e]?C.some(t.value):C.some(t.value/n[t.unit]*n[e]):C.none()},ZM=function(t){return C.none()},tz=function(t,e){return function(n){return QM(n,e).map((function(n){return{value:n*t,unit:e}}))}},ez=function(t,e){var n=JM(t).toOption(),r=JM(e).toOption();return op(n,r,(function(t,e){return QM(t,e.unit).map((function(t){return e.value/t})).map((function(t){return tz(t,e.unit)})).getOr(ZM)})).getOr(ZM)},nz=function(t,e){var n=ZM,r=Cu("ratio-event"),o=XM.parts().lock({dom:{tag:"button",classes:["tox-lock","tox-button","tox-button--naked","tox-button--icon"],attributes:{title:e.translate(t.label.getOr("Constrain proportions"))}},components:[{dom:{tag:"span",classes:["tox-icon","tox-lock-icon__lock"],innerHtml:qw("lock",e.icons)}},{dom:{tag:"span",classes:["tox-icon","tox-lock-icon__unlock"],innerHtml:qw("unlock",e.icons)}}],buttonBehaviours:Al([cS.config({disabled:function(){return t.disabled||e.isReadOnly()}}),QS(),rE.config({})])}),i=function(t){return{dom:{tag:"div",classes:["tox-form__group"]},components:t}},u=function(n){return ZT.parts().field({factory:OE,inputClasses:["tox-textfield"],inputBehaviours:Al([cS.config({disabled:function(){return t.disabled||e.isReadOnly()}}),QS(),rE.config({}),gy("size-input-events",[pi(Oo(),(function(t,e){ai(t,r,{isField1:n})})),pi(Do(),(function(e,n){ai(e,lE,{name:t.name})}))])]),selectOnFocus:!1})},a=function(t){return{dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}}},c=XM.parts().field1(i([ZT.parts().label(a("Width")),u(!0)])),s=XM.parts().field2(i([ZT.parts().label(a("Height")),u(!1)]));return XM.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:[c,s,i([a(" "),o])]}],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:function(t,e,r){JM(Vg.getValue(t)).each((function(t){n(t).each((function(t){Vg.setValue(e,YM(t))}))}))},coupledFieldBehaviours:Al([cS.config({disabled:function(){return t.disabled||e.isReadOnly()},onDisabled:function(t){XM.getField1(t).bind(ZT.getField).each(cS.disable),XM.getField2(t).bind(ZT.getField).each(cS.disable),XM.getLock(t).each(cS.disable)},onEnabled:function(t){XM.getField1(t).bind(ZT.getField).each(cS.enable),XM.getField2(t).bind(ZT.getField).each(cS.enable),XM.getLock(t).each(cS.enable)}}),QS(),gy("size-input-events2",[pi(r,(function(t,e){var r=e.event().isField1(),o=r?XM.getField1(t):XM.getField2(t),i=r?XM.getField2(t):XM.getField1(t),u=o.map(Vg.getValue).getOr(""),a=i.map(Vg.getValue).getOr("");n=ez(u,a)}))])])})},rz=u(Cu("undo")),oz=u(Cu("redo")),iz=u(Cu("zoom")),uz=u(Cu("back")),az=u(Cu("apply")),cz=u(Cu("swap")),sz=u(Cu("transform")),lz=u(Cu("temp-transform")),fz=u(Cu("transform-apply")),dz={undo:rz,redo:oz,zoom:iz,back:uz,apply:az,swap:cz,transform:sz,tempTransform:lz,transformApply:fz},mz=u("save-state"),gz=u("disable"),hz=u("enable"),pz={formActionEvent:mE,saveState:mz,disable:gz,enable:hz},vz=function(t,e){var r=function(t,n,r,o){return jw(IM({name:t,text:t,disabled:r,primary:o,icon:C.none(),borderless:!1},n,e))},o=function(t,n,r,o){return jw(PM({name:t,icon:C.some(t),tooltip:C.some(n),disabled:o,primary:!1,borderless:!1},r,e))},i=function(t,e){t.map((function(t){var n=t.get(e);n.hasConfigured(cS)&&cS.disable(n)}))},a=function(t,e){t.map((function(t){var n=t.get(e);n.hasConfigured(cS)&&cS.enable(n)}))},c={tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools-edit-panel"]},s=n,l=function(t,e,n){ai(t,e,n)},f=function(t){return ui(t,pz.disable())},d=function(t){return ui(t,pz.enable())},m=function(t,e){f(t),l(t,dz.transform(),{transform:e}),d(t)},g=function(t,e){f(t),l(t,dz.tempTransform(),{transform:e}),d(t)},h=function(t){return function(){ut.getOpt(t).each((function(t){dy.set(t,[ot])}))}},p=function(t,e){f(t),l(t,dz.transformApply(),{transform:e,swap:h(t)}),d(t)},v=function(){return r("Back",(function(t){return l(t,dz.back(),{swap:h(t)})}),!1,!1)},b=function(){return jw({dom:{tag:"div",classes:["tox-spacer"]},behaviours:Al([cS.config({})])})},y=function(){return r("Apply",(function(t){return l(t,dz.apply(),{swap:h(t)})}),!0,!0)},w=function(){return function(e){var n=t.getRect();return cM(e,n.x,n.y,n.w,n.h)}},x=[v(),b(),r("Apply",(function(e){var n=w();p(e,n),t.hideCrop()}),!1,!0)],S=GT.sketch({dom:c,components:x.map((function(t){return t.asSpec()})),containerBehaviours:Al([gy("image-tools-crop-buttons-events",[pi(pz.disable(),(function(t,e){i(x,t)})),pi(pz.enable(),(function(t,e){a(x,t)}))])])}),k=jw(nz({name:"size",label:C.none(),constrain:!0,disabled:!1},e)),O=function(t,e){return function(n){return sM(n,t,e)}},T=[v(),b(),k,b(),r("Apply",(function(t){k.getOpt(t).each((function(e){var n=Vg.getValue(e),r=parseInt(n.width,10),o=parseInt(n.height,10),i=O(r,o);p(t,i)}))}),!1,!0)],E=GT.sketch({dom:c,components:T.map((function(t){return t.asSpec()})),containerBehaviours:Al([gy("image-tools-resize-buttons-events",[pi(pz.disable(),(function(t,e){i(T,t)})),pi(pz.enable(),(function(t,e){a(T,t)}))])])}),_=function(t,e){return function(n){return t(n,e)}},A=_(aM,"h"),D=_(aM,"v"),N=_(lM,-90),R=_(lM,90),M=function(t,e){g(t,e)},z=[v(),b(),o("flip-horizontally","Flip horizontally",(function(t){M(t,A)}),!1),o("flip-vertically","Flip vertically",(function(t){M(t,D)}),!1),o("rotate-left","Rotate counterclockwise",(function(t){M(t,N)}),!1),o("rotate-right","Rotate clockwise",(function(t){M(t,R)}),!1),b(),y()],B=GT.sketch({dom:c,components:z.map((function(t){return t.asSpec()})),containerBehaviours:Al([gy("image-tools-fliprotate-buttons-events",[pi(pz.disable(),(function(t,e){i(z,t)})),pi(pz.enable(),(function(t,e){a(z,t)}))])])}),P=function(t,n,r,o,i){var a=lN.parts().label({dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}}),c=lN.parts().spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}}),s=lN.parts().thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});return jw(lN.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:r,maxX:i,getInitialValue:u({x:u(o)})},components:[a,c,s],sliderBehaviours:Al([Sy.config({})]),onChoose:n}))},H=function(t,e,n,r,o){var i=function(t,n,r){var o=_(e,r.x()/100);m(t,o)};return P(t,i,n,r,o)},I=function(t,e,n,r,o){return[v(),H(t,e,n,r,o),y()]},L=function(t,e,n,r,o){var u=I(t,e,n,r,o);return GT.sketch({dom:c,components:u.map((function(t){return t.asSpec()})),containerBehaviours:Al([gy("image-tools-filter-panel-buttons-events",[pi(pz.disable(),(function(t,e){i(u,t)})),pi(pz.enable(),(function(t,e){a(u,t)}))])])})},F=[v(),b(),y()],V=GT.sketch({dom:c,components:F.map((function(t){return t.asSpec()}))}),U=L("Brightness",iM,-100,0,100),j=L("Contrast",uM,-100,0,100),W=L("Gamma",rM,-100,0,100),q=function(t,e,n){return function(r){return oM(r,t,e,n)}},$=function(t){var e=function(t,e,n){var r=G.getOpt(t),o=X.getOpt(t),i=K.getOpt(t);r.each((function(e){o.each((function(n){i.each((function(r){var o=Vg.getValue(e).x()/100,i=Vg.getValue(r).x()/100,u=Vg.getValue(n).x()/100,a=q(o,i,u);m(t,a)}))}))}))};return P(t,e,0,100,200)},G=$("R"),K=$("G"),X=$("B"),Y=[v(),G,K,X,y()],J=GT.sketch({dom:c,components:Y.map((function(t){return t.asSpec()}))}),Q=function(t,e,n){return function(r){var o=function(){ut.getOpt(r).each((function(e){dy.set(e,[t]),n(e)}))};l(r,dz.swap(),{transform:e,swap:o})}},Z=function(e){t.showCrop()},tt=function(e){k.getOpt(e).each((function(e){var n=t.getMeasurements(),r=n.width,o=n.height;Vg.setValue(e,{width:r,height:o})}))},et=C.some(nM),nt=C.some(eM),rt=[o("crop","Crop",Q(S,C.none(),Z),!1),o("resize","Resize",Q(E,C.none(),tt),!1),o("orientation","Orientation",Q(B,C.none(),s),!1),o("brightness","Brightness",Q(U,C.none(),s),!1),o("sharpen","Sharpen",Q(V,et,s),!1),o("contrast","Contrast",Q(j,C.none(),s),!1),o("color-levels","Color levels",Q(J,C.none(),s),!1),o("gamma","Gamma",Q(W,C.none(),s),!1),o("invert","Invert",Q(V,nt,s),!1)],ot=GT.sketch({dom:c,components:rt.map((function(t){return t.asSpec()}))}),it=GT.sketch({dom:{tag:"div"},components:[ot],containerBehaviours:Al([dy.config({})])}),ut=jw(it),at=function(t){return ut.getOpt(t).map((function(t){var e=t.components()[0];return e.components()[e.components().length-1]}))};return{memContainer:ut,getApplyButton:at}},bz=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),yz=tinymce.util.Tools.resolve("tinymce.geom.Rect"),wz=tinymce.util.Tools.resolve("tinymce.util.Observable"),xz=tinymce.util.Tools.resolve("tinymce.util.Tools"),Cz=tinymce.util.Tools.resolve("tinymce.util.VK");function Sz(t){var e=Math.max,n=t.documentElement,r=t.body,o=e(n.scrollWidth,r.scrollWidth),i=e(n.clientWidth,r.clientWidth),u=e(n.offsetWidth,r.offsetWidth),a=e(n.scrollHeight,r.scrollHeight),c=e(n.clientHeight,r.clientHeight),s=e(n.offsetHeight,r.offsetHeight);return{width:o<u?i:o,height:a<s?c:a}}function kz(t){var e,n;if(t.changedTouches)for(e="screenX screenY pageX pageY clientX clientY".split(" "),n=0;n<e.length;n++)t[e[n]]=t.changedTouches[0][e[n]]}function Oz(t,n){var r,o,i,u,a=n.document||e.document;n=n||{};var c=a.getElementById(n.handle||t),s=function(t){var s,d=Sz(a);kz(t),t.preventDefault(),o=t.button;var m=c;i=t.screenX,u=t.screenY,s=e.window.getComputedStyle?e.window.getComputedStyle(m,null).getPropertyValue("cursor"):m.runtimeStyle.cursor,r=bz("<div></div>").css({position:"absolute",top:0,left:0,width:d.width,height:d.height,zIndex:2147483647,opacity:1e-4,cursor:s}).appendTo(a.body),bz(a).on("mousemove touchmove",l).on("mouseup touchend",f),n.start(t)},l=function(t){if(kz(t),t.button!==o)return f(t);t.deltaX=t.screenX-i,t.deltaY=t.screenY-u,t.preventDefault(),n.drag(t)},f=function(t){kz(t),bz(a).off("mousemove touchmove",l).off("mouseup touchend",f),r.remove(),n.stop&&n.stop(t)};this.destroy=function(){bz(c).off()},bz(c).on("mousedown touchstart",s)}var Tz=0,Ez=function(t,e,n,r,o){var i,u="tox-",a=u+"crid-"+Tz++,c=[{name:"move",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:0,deltaH:0,label:"Crop Mask"},{name:"nw",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:-1,deltaH:-1,label:"Top Left Crop Handle"},{name:"ne",xMul:1,yMul:0,deltaX:0,deltaY:1,deltaW:1,deltaH:-1,label:"Top Right Crop Handle"},{name:"sw",xMul:0,yMul:1,deltaX:1,deltaY:0,deltaW:-1,deltaH:1,label:"Bottom Left Crop Handle"},{name:"se",xMul:1,yMul:1,deltaX:0,deltaY:0,deltaW:1,deltaH:1,label:"Bottom Right Crop Handle"}],s=["top","right","bottom","left"],l=function(t,e){return{x:e.x+t.x,y:e.y+t.y,w:e.w,h:e.h}},f=function(t,e){return{x:e.x-t.x,y:e.y-t.y,w:e.w,h:e.h}},d=function(){return f(n,t)};function m(e,r,o,i){var u,a,c,s,l;u=r.x,a=r.y,c=r.w,s=r.h,u+=o*e.deltaX,a+=i*e.deltaY,c+=o*e.deltaW,s+=i*e.deltaH,c<20&&(c=20),s<20&&(s=20),l=t=yz.clamp({x:u,y:a,w:c,h:s},n,"move"===e.name),l=f(n,l),C.fire("updateRect",{rect:l}),y(l)}function g(){function e(e){var n;return new Oz(a,{document:r.ownerDocument,handle:a+"-"+e.name,start:function(){n=t},drag:function(t){m(e,n,t.deltaX,t.deltaY)}})}bz('<div id="'+a+'" class="'+u+'croprect-container" role="grid" aria-dropeffect="execute">').appendTo(r),xz.each(s,(function(t){bz("#"+a,r).append('<div id="'+a+"-"+t+'"class="'+u+'croprect-block" style="display: none" data-mce-bogus="all">')})),xz.each(c,(function(t){bz("#"+a,r).append('<div id="'+a+"-"+t.name+'" class="'+u+"croprect-handle "+u+"croprect-handle-"+t.name+'"style="display: none" data-mce-bogus="all" role="gridcell" tabindex="-1" aria-label="'+t.label+'" aria-grabbed="false" title="'+t.label+'">')})),i=xz.map(c,e),p(t),bz(r).on("focusin focusout",(function(t){bz(t.target).attr("aria-grabbed","focus"===t.type?"true":"false")})),bz(r).on("keydown",(function(e){var n;function r(t,e,r,o,i){t.stopPropagation(),t.preventDefault(),m(n,r,o,i)}switch(xz.each(c,(function(t){if(e.target.id===a+"-"+t.name)return n=t,!1})),e.keyCode){case Cz.LEFT:r(e,n,t,-10,0);break;case Cz.RIGHT:r(e,n,t,10,0);break;case Cz.UP:r(e,n,t,0,-10);break;case Cz.DOWN:r(e,n,t,0,10);break;case Cz.ENTER:case Cz.SPACEBAR:e.preventDefault(),o();break}}))}function h(t){var e=xz.map(c,(function(t){return"#"+a+"-"+t.name})).concat(xz.map(s,(function(t){return"#"+a+"-"+t}))).join(",");t?bz(e,r).show():bz(e,r).hide()}function p(t){function n(t,e){e.h<0&&(e.h=0),e.w<0&&(e.w=0),bz("#"+a+"-"+t,r).css({left:e.x,top:e.y,width:e.w,height:e.h})}xz.each(c,(function(e){bz("#"+a+"-"+e.name,r).css({left:t.w*e.xMul+t.x,top:t.h*e.yMul+t.y})})),n("top",{x:e.x,y:e.y,w:e.w,h:t.y-e.y}),n("right",{x:t.x+t.w,y:t.y,w:e.w-t.x-t.w+e.x,h:t.h}),n("bottom",{x:e.x,y:t.y+t.h,w:e.w,h:e.h-t.y-t.h+e.y}),n("left",{x:e.x,y:t.y,w:t.x-e.x,h:t.h}),n("move",t)}function v(e){t=e,p(t)}function b(n){e=n,p(t)}function y(t){v(l(n,t))}function w(e){n=e,p(t)}function x(){xz.each(i,(function(t){t.destroy()})),i=[]}g();var C=xz.extend({toggleVisibility:h,setClampRect:w,setRect:v,getInnerRect:d,setInnerRect:y,setViewPortRect:b,destroy:x},wz);return C},_z={create:Ez},Az=function(t){return new px((function(e){var n=function(){t.removeEventListener("load",n),e(t)};t.complete?e(t):t.addEventListener("load",n)}))},Dz=function(t){var e=jw({dom:{tag:"div",classes:["tox-image-tools__image-bg"],attributes:{role:"presentation"}}}),n=Gn(1),r=Gn(C.none()),o=Gn({x:0,y:0,w:1,h:1}),i=Gn({x:0,y:0,w:1,h:1}),u=function(t,i){g.getOpt(t).each((function(t){var u=n.get(),a=Ec(t.element()),c=pc(t.element()),s=i.dom().naturalWidth*u,l=i.dom().naturalHeight*u,f=Math.max(0,a/2-s/2),d=Math.max(0,c/2-l/2),m={left:f.toString()+"px",top:d.toString()+"px",width:s.toString()+"px",height:l.toString()+"px",position:"absolute"};ja(i,m),e.getOpt(t).each((function(t){ja(t.element(),m)})),r.get().each((function(t){var e=o.get();t.setRect({x:e.x*u+f,y:e.y*u+d,w:e.w*u,h:e.h*u}),t.setClampRect({x:f,y:d,w:s,h:l}),t.setViewPortRect({x:0,y:0,w:a,h:c})}))}))},a=function(t,e){g.getOpt(t).each((function(t){var r=Ec(t.element()),o=pc(t.element()),i=e.dom().naturalWidth,u=e.dom().naturalHeight,a=Math.min(r/i,o/u);a>=1?n.set(1):n.set(a)}))},c=function(t,e){var n=Zn.fromTag("img");return cu(n,"src",e),Az(n.dom()).then((function(){return g.getOpt(t).map((function(t){var e=lc({element:n});dy.replaceAt(t,1,C.some(e));var r=i.get(),c={x:0,y:0,w:n.dom().naturalWidth,h:n.dom().naturalHeight};i.set(c);var s=yz.inflate(c,-20,-20);return o.set(s),r.w===c.w&&r.h===c.h||a(t,n),u(t,n),n}))}))},s=function(t,e){var r=n.get(),o=e>0?Math.min(2,r+.1):Math.max(.1,r-.1);n.set(o),g.getOpt(t).each((function(t){var e=t.components()[1].element();u(t,e)}))},l=function(){r.get().each((function(t){t.toggleVisibility(!0)}))},f=function(){r.get().each((function(t){t.toggleVisibility(!1)}))},d=function(){return o.get()},m=GT.sketch({dom:{tag:"div",classes:["tox-image-tools__image"]},components:[e.asSpec(),{dom:{tag:"img",attributes:{src:t}}},{dom:{tag:"div"},behaviours:Al([gy("image-panel-crop-events",[Ti((function(t){g.getOpt(t).each((function(t){var e=t.element().dom(),i=_z.create({x:10,y:10,w:100,h:100},{x:0,y:0,w:200,h:200},{x:0,y:0,w:200,h:200},e,(function(){}));i.toggleVisibility(!1),i.on("updateRect",(function(t){var e=t.rect,r=n.get(),i={x:Math.round(e.x/r),y:Math.round(e.y/r),w:Math.round(e.w/r),h:Math.round(e.h/r)};o.set(i)})),r.set(C.some(i))}))}))])])}],containerBehaviours:Al([dy.config({}),gy("image-panel-events",[Ti((function(e){c(e,t)}))])])}),g=jw(m),h=function(){var t=i.get();return{width:t.w,height:t.h}};return{memContainer:g,updateSrc:c,zoom:s,showCrop:l,hideCrop:f,getRect:d,getMeasurements:h}},Nz=function(t,e,n,r,o){return PM({name:t,icon:C.some(e),disabled:n,tooltip:C.some(t),primary:!1,borderless:!1},r,o)},Rz=function(t,e){e?cS.enable(t):cS.disable(t)},Mz=function(t){var e=function(t,e,o){n.getOpt(t).each((function(t){Rz(t,e)})),r.getOpt(t).each((function(t){Rz(t,o)}))},n=jw(Nz("Undo","undo",!0,(function(t){ai(t,dz.undo(),{direction:1})}),t)),r=jw(Nz("Redo","redo",!0,(function(t){ai(t,dz.redo(),{direction:1})}),t)),o=GT.sketch({dom:{tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools__sidebar"]},components:[n.asSpec(),r.asSpec(),Nz("Zoom in","zoom-in",!1,(function(t){ai(t,dz.zoom(),{direction:1})}),t),Nz("Zoom out","zoom-out",!1,(function(t){ai(t,dz.zoom(),{direction:-1})}),t)]});return{container:o,updateButtonUndoStates:e}};function zz(){var t=[],e=-1;function n(n){var r=t.splice(++e);return t.push(n),{state:n,removed:r}}function r(){if(i())return t[--e]}function o(){if(u())return t[++e]}function i(){return e>0}function u(){return-1!==e&&e<t.length-1}return{data:t,add:n,undo:r,redo:o,canUndo:i,canRedo:u}}var Bz,Pz=function(t){var n=Gn(t),r=Gn(C.none()),o=zz();o.add(t);var i=function(){return n.get()},u=function(t){n.set(t)},a=function(){return r.get().fold((function(){return n.get()}),(function(t){return t}))},c=function(t){var e=s(t);return d(),r.set(C.some(e)),e.url},s=function(t){return{blob:t,url:e.URL.createObjectURL(t)}},l=function(t){e.URL.revokeObjectURL(t.url)},f=function(t){xz.each(t,l)},d=function(){r.get().each(l),r.set(C.none())},m=function(t){var e=s(t);u(e);var n=o.add(e).removed;return f(n),e.url},g=function(t){var e=s(t);return r.set(C.some(e)),e.url},h=function(t){return r.get().fold((function(){}),(function(e){m(e.blob),t()}))},p=function(){var t=o.undo();return u(t),t.url},v=function(){var t=o.redo();return u(t),t.url},b=function(){var t=o.canUndo(),e=o.canRedo();return{undoEnabled:t,redoEnabled:e}};return{getBlobState:i,setBlobState:u,addBlobState:m,getTempState:a,updateTempState:c,addTempState:g,applyTempState:h,destroyTempState:d,undo:p,redo:v,getHistoryStates:b}},Hz=function(t,r){var o=Pz(t.currentState),i=function(t,e){var n=e.event().direction();O.zoom(t,n)},u=function(t){var e=o.getHistoryStates();T.updateButtonUndoStates(t,e.undoEnabled,e.redoEnabled),ai(t,pz.formActionEvent,{name:pz.saveState(),value:e.undoEnabled})},a=function(t){T.updateButtonUndoStates(t,!1,!1)},c=function(t,e){var n=o.undo();m(t,n).then((function(e){d(t),u(t)}))},s=function(t,e){var n=o.redo();m(t,n).then((function(e){d(t),u(t)}))},l=function(t){return t.toBlob()},f=function(t){ai(t,pz.formActionEvent,{name:pz.disable(),value:{}})},d=function(t){E.getApplyButton(t).each((function(t){cS.enable(t)})),ai(t,pz.formActionEvent,{name:pz.enable(),value:{}})},m=function(t,e){return f(t),O.updateSrc(t,e)},g=function(t,n,r,o,i){return f(t),kR(n).then(r).then(l).then(o).then((function(e){return m(t,e).then((function(e){return u(t),i(),d(t),e}))})).catch((function(n){return e.console.log(n),d(t),n}))},h=function(t,e,n){var r=o.getBlobState().blob,i=function(t){return o.updateTempState(t)};g(t,r,e,i,n)},p=function(t,e){var r=o.getTempState().blob,i=function(t){return o.addTempState(t)};g(t,r,e,i,n)},v=function(t,e,n){var r=o.getBlobState().blob,i=function(e){var n=o.addBlobState(e);return y(t),n};g(t,r,e,i,n)},b=function(t,e){var n=function(){y(t);var n=e.event().swap();n()};o.applyTempState(n)},y=function(t){var e=o.getBlobState().url;return o.destroyTempState(),u(t),e},w=function(t){var e=y(t);m(t,e).then((function(e){d(t)}))},x=function(t,e){w(t);var n=e.event().swap();n(),O.hideCrop()},C=function(t,e){return h(t,e.event().transform(),n)},S=function(t,e){return p(t,e.event().transform())},k=function(t,e){return v(t,e.event().transform(),e.event().swap())},O=Dz(t.currentState.url),T=Mz(r),E=vz(O,r),_=function(t,e){a(t);var n=e.event().transform(),r=e.event().swap();n.fold((function(){r()}),(function(e){h(t,e,r)}))};return{dom:{tag:"div",attributes:{role:"presentation"}},components:[E.memContainer.asSpec(),O.memContainer.asSpec(),T.container],behaviours:Al([Vg.config({store:{mode:"manual",getValue:function(){return o.getBlobState()}}}),gy("image-tools-events",[pi(dz.undo(),c),pi(dz.redo(),s),pi(dz.zoom(),i),pi(dz.back(),x),pi(dz.apply(),b),pi(dz.transform(),C),pi(dz.tempTransform(),S),pi(dz.transformApply(),k),pi(dz.swap(),_)]),AN.self()])}},Iz=function(t,e){var n={dom:{tag:"label",innerHtml:e.providers.translate(t.label),classes:["tox-label"]}},r=$(t.items,e.interpreter);return{dom:{tag:"div",classes:["tox-form__group"]},components:[n].concat(r),behaviours:Al([AN.self(),dy.config({}),WN.domHtml(C.none()),ny.config({mode:"acyclic"})])}},Lz=function(t,e){return{dom:{tag:"div",classes:t.classes},components:$(t.items,e.shared.interpreter)}},Fz=function(t,e){var n=$(t.options,(function(t){return{dom:{tag:"option",value:t.value,innerHtml:t.text}}})),r=t.data.map((function(t){return se("initialValue",t)})).getOr({});return{uid:t.uid,dom:{tag:"select",classes:t.selectClasses,attributes:t.selectAttributes},components:n,behaviours:Wg(t.selectBehaviours,[Sy.config({}),Vg.config({store:g({mode:"manual",getValue:function(t){return Qa(t.element())},setValue:function(e,n){var r=tt(t.options,(function(t){return t.value===n}));r.isSome()&&Za(e.element(),n)}},r)})])}},Vz=tp({name:"HtmlSelect",configFields:[vn("options"),Ug("selectBehaviours",[Sy,Vg]),Pn("selectClasses",[]),Pn("selectAttributes",{}),_n("data")],factory:Fz}),Uz=function(t,e){var n=$(t.items,(function(t){return{text:e.translate(t.text),value:t.value}})),r=t.label.map((function(t){return sE(t,e)})),o=ZT.parts().field({dom:{},selectAttributes:{size:t.size},options:n,factory:Vz,selectBehaviours:Al([cS.config({disabled:function(){return t.disabled||e.isReadOnly()}}),rE.config({}),gy("selectbox-change",[pi(Do(),(function(e,n){ai(e,lE,{name:t.name})}))])])}),i=t.size>1?C.none():C.some({dom:{tag:"div",classes:["tox-selectfield__icon-js"],innerHtml:qw("chevron-down",e.icons)}}),u={dom:{tag:"div",classes:["tox-selectfield"]},components:nt([[o],i.toArray()])};return ZT.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:nt([r.toArray(),[u]]),fieldBehaviours:Al([cS.config({disabled:function(){return t.disabled||e.isReadOnly()},onDisabled:function(t){ZT.getField(t).each(cS.disable)},onEnabled:function(t){ZT.getField(t).each(cS.enable)}}),QS()])})},jz=function(t,e){var n=function(t){return{dom:{tag:"th",innerHtml:e.translate(t)}}},r=function(t){return{dom:{tag:"thead"},components:[{dom:{tag:"tr"},components:$(t,n)}]}},o=function(t){return{dom:{tag:"td",innerHtml:e.translate(t)}}},i=function(t){return{dom:{tag:"tr"},components:$(t,o)}},u=function(t){return{dom:{tag:"tbody"},components:$(t,i)}};return{dom:{tag:"table",classes:["tox-dialog__table"]},components:[r(t.header),u(t.cells)],behaviours:Al([rE.config({}),Sy.config({})])}},Wz=function(t,e){var n=t.label.map((function(t){return sE(t,e)})),r=[cS.config({disabled:function(){return t.disabled||e.isReadOnly()}}),QS(),ny.config({mode:"execution",useEnter:!0!==t.multiline,useControlEnter:!0===t.multiline,execute:function(t){return ui(t,gE),C.some(!0)}}),gy("textfield-change",[pi(Ao(),(function(e,n){ai(e,lE,{name:t.name})})),pi(Ho(),(function(e,n){ai(e,lE,{name:t.name})}))]),rE.config({})],o=t.validation.map((function(t){return XE.config({getRoot:function(t){return Vi(t.element())},invalidClass:"tox-invalid",validator:{validate:function(e){var n=Vg.getValue(e),r=t.validator(n);return HE.pure(!0===r?pt.value(n):pt.error(r))},validateOnLoad:t.validateOnLoad}})})).toArray(),i=t.placeholder.fold(u({}),(function(t){return{placeholder:e.translate(t)}})),a=t.inputMode.fold(u({}),(function(t){return{inputmode:t}})),c=g(g({},i),a),s=ZT.parts().field({tag:!0===t.multiline?"textarea":"input",inputAttributes:c,inputClasses:[t.classname],inputBehaviours:Al(nt([r,o])),selectOnFocus:!1,factory:OE}),l=t.flex?["tox-form__group--stretched"]:[],f=l.concat(t.maximized?["tox-form-group--maximize"]:[]),d=[cS.config({disabled:function(){return t.disabled||e.isReadOnly()},onDisabled:function(t){ZT.getField(t).each(cS.disable)},onEnabled:function(t){ZT.getField(t).each(cS.enable)}}),QS()];return oE(n,s,f,d)},qz=function(t,e){return Wz({name:t.name,multiline:!1,label:t.label,inputMode:t.inputMode,placeholder:t.placeholder,flex:!1,disabled:t.disabled,classname:"tox-textfield",validation:C.none(),maximized:t.maximized},e)},$z=function(t,e){return Wz({name:t.name,multiline:!0,label:t.label,inputMode:C.none(),placeholder:t.placeholder,flex:!0,disabled:t.disabled,classname:"tox-textarea",validation:C.none(),maximized:t.maximized},e)},Gz=function(t,e){var n=t.stream.streams,r=n.setup(t,e);return di([pi(t.event,r),Ei((function(){return e.cancel()}))].concat(t.cancelEvent.map((function(t){return[pi(t,(function(){return e.cancel()}))]})).getOr([])))},Kz=Object.freeze({__proto__:null,events:Gz}),Xz=function(t){var e=Gn(null),n=function(){return{timer:null!==e.get()?"set":"unset"}},r=function(t){e.set(t)},o=function(){var t=e.get();null!==t&&t.cancel()};return ju({readState:n,setTimer:r,cancel:o})},Yz=function(t){return t.stream.streams.state(t)},Jz=Object.freeze({__proto__:null,throttle:Xz,init:Yz}),Qz=function(t,e){var n=t.stream,r=tx(t.onStream,n.delay);return e.setTimer(r),function(t,e){r.throttle(t,e),n.stopEvent&&e.stop()}},Zz=[bn("stream",an("mode",{throttle:[vn("delay"),Pn("stopEvent",!0),Bs("streams",{setup:Qz,state:Xz})]})),Pn("event","input"),_n("cancelEvent"),Ms("onStream")],tB=Nl({fields:Zz,name:"streaming",active:Kz,state:Jz}),eB=function(t,e,n){var r=Vg.getValue(n);Vg.setValue(e,r),rB(e)},nB=function(t,e){var n=t.element(),r=Qa(n),o=n.dom();"number"!==lu(n,"type")&&e(o,r)},rB=function(t){nB(t,(function(t,e){return t.setSelectionRange(e.length,e.length)}))},oB=function(t,e){nB(t,(function(t,n){return t.setSelectionRange(e,n.length)}))},iB=function(t,e,n){if(t.selectsOver){var r=Vg.getValue(e),o=t.getDisplayText(r),i=Vg.getValue(n),u=t.getDisplayText(i);return 0===u.indexOf(o)?C.some((function(){eB(t,e,n),oB(e,o.length)})):C.none()}return C.none()},uB=u("alloy.typeahead.itemexecute"),aB=function(t,e,r,o){var i=function(e,r,i){t.previewing.set(!1);var u=e_.getCoupled(e,"sandbox");if(ig.isOpen(u))lp.getCurrent(u).each((function(t){Dp.getHighlighted(t).fold((function(){i(t)}),(function(){fi(u,t.element(),"keydown",r)}))}));else{var c=function(t){lp.getCurrent(t).each(i)};a_(t,a(e),e,u,o,c,_E.HighlightFirst).get(n)}},u=xE(t),a=function(t){return function(e){return e.map((function(e){var n=It(e.menus),r=rt(n,(function(t){return Y(t.items,(function(t){return"item"===t.type}))})),o=Vg.getState(t);return o.update($(r,(function(t){return t.data}))),e}))}},c=[Sy.config({}),Vg.config({onSetValue:t.onSetValue,store:g({mode:"dataset",getDataKey:function(t){return Qa(t.element())},getFallbackEntry:function(t){return{value:t,meta:{}}},setValue:function(e,n){Za(e.element(),t.model.getDisplayText(n))}},t.initialData.map((function(t){return se("initialValue",t)})).getOr({}))}),tB.config({stream:{mode:"throttle",delay:t.responseTime,stopEvent:!1},onStream:function(e,r){var i=e_.getCoupled(e,"sandbox"),u=Sy.isFocused(e);if(u&&Qa(e.element()).length>=t.minChars){var c=lp.getCurrent(i).bind((function(t){return Dp.getHighlighted(t).map(Vg.getValue)}));t.previewing.set(!0);var s=function(e){lp.getCurrent(i).each((function(e){c.fold((function(){t.model.selectsOver&&Dp.highlightFirst(e)}),(function(t){Dp.highlightBy(e,(function(e){var n=Vg.getValue(e);return n.value===t.value})),Dp.getHighlighted(e).orThunk((function(){return Dp.highlightFirst(e),C.none()}))}))}))};a_(t,a(e),e,i,o,s,_E.HighlightFirst).get(n)}},cancelEvent:Wo()}),ny.config({mode:"special",onDown:function(t,e){return i(t,e,Dp.highlightFirst),C.some(!0)},onEscape:function(t){var e=e_.getCoupled(t,"sandbox");return ig.isOpen(e)?(ig.close(e),C.some(!0)):C.none()},onUp:function(t,e){return i(t,e,Dp.highlightLast),C.some(!0)},onEnter:function(e){var n=e_.getCoupled(e,"sandbox"),r=ig.isOpen(n);if(r&&!t.previewing.get())return lp.getCurrent(n).bind((function(t){return Dp.getHighlighted(t)})).map((function(t){return ai(e,uB(),{item:t}),!0}));var o=Vg.getValue(e);return ui(e,Wo()),t.onExecute(n,e,o),r&&ig.close(n),C.some(!0)}}),Uy.config({toggleClass:t.markers.openClass,aria:{mode:"expanded"}}),e_.config({others:{sandbox:function(e){return m_(t,e,{onOpen:function(){return Uy.on(e)},onClose:function(){return Uy.off(e)}})}}}),gy("typeaheadevents",[Ai((function(e){var r=n;s_(t,a(e),e,o,r,_E.HighlightFirst).get(n)})),pi(uB(),(function(e,n){var r=e_.getCoupled(e,"sandbox");eB(t.model,e,n.event().item()),ui(e,Wo()),t.onItemExecute(e,r,n.event().item(),Vg.getValue(e)),ig.close(r),rB(e)}))].concat(t.dismissOnBlur?[pi(Po(),(function(t){var e=e_.getCoupled(t,"sandbox");Gl(e.element()).isNone()&&ig.close(e)}))]:[]))];return{uid:t.uid,dom:SE(Kt(t,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:g(g({},u),Wg(t.typeaheadBehaviours,c)),eventOrder:t.eventOrder}},cB=u([_n("lazySink"),vn("fetch"),Pn("minChars",5),Pn("responseTime",1e3),Ns("onOpen"),Pn("getHotspot",C.some),Pn("getAnchorOverrides",u({})),Pn("layouts",C.none()),Pn("eventOrder",{}),qn("model",{},[Pn("getDisplayText",(function(t){return void 0!==t.meta&&void 0!==t.meta.text?t.meta.text:t.value})),Pn("selectsOver",!0),Pn("populateFromBrowse",!0)]),Ns("onSetValue"),Rs("onExecute"),Ns("onItemExecute"),Pn("inputClasses",[]),Pn("inputAttributes",{}),Pn("inputStyles",{}),Pn("matchWidth",!0),Pn("useMinWidth",!1),Pn("dismissOnBlur",!0),As(["openClass"]),_n("initialData"),Ug("typeaheadBehaviours",[Sy,Vg,tB,ny,Uy,e_]),$n("previewing",(function(){return Gn(!0)}))].concat(wE()).concat(h_())),sB=u([xh({schema:[_s()],name:"menu",overrides:function(t){return{fakeFocus:!0,onHighlight:function(e,n){t.previewing.get()?e.getSystem().getByUid(t.uid).each((function(r){iB(t.model,r,n).fold((function(){return Dp.dehighlight(e,n)}),(function(t){return t()}))})):e.getSystem().getByUid(t.uid).each((function(e){t.model.populateFromBrowse&&eB(t.model,e,n)})),t.previewing.set(!1)},onExecute:function(e,n){return e.getSystem().getByUid(t.uid).toOption().map((function(t){return ai(t,uB(),{item:n}),!0}))},onHover:function(e,n){t.previewing.set(!1),e.getSystem().getByUid(t.uid).each((function(e){t.model.populateFromBrowse&&eB(t.model,e,n)}))}}}})]),lB=ep({name:"Typeahead",configFields:cB(),partFields:sB(),factory:aB}),fB=function(t){var n=function(){return fB(t.toCached())},r=function(e){return fB(t.bind((function(t){return t.fold((function(t){return HE.pure(pt.error(t))}),(function(t){return e(t)}))})))},o=function(e){return fB(t.map((function(t){return t.bind(e)})))},i=function(e){return fB(t.map((function(t){return t.map(e)})))},u=function(e){return fB(t.map((function(t){return t.mapError(e)})))},a=function(e,n){return t.map((function(t){return t.fold(e,n)}))},c=function(n,r){return fB(HE.nu((function(o){var i=!1,u=e.setTimeout((function(){i=!0,o(pt.error(r()))}),n);t.get((function(t){i||(e.clearTimeout(u),o(t))}))})))};return g(g({},t),{toCached:n,bindFuture:r,bindResult:o,mapResult:i,mapError:u,foldResult:a,withTimeout:c})},dB=function(t){return fB(HE.nu(t))},mB=function(t){return fB(HE.pure(pt.value(t)))},gB=function(t){return fB(HE.pure(pt.error(t)))},hB=function(t){return fB(HE.pure(t))},pB=function(t){return fB(t.map(pt.value))},vB=function(t){return dB((function(e){t.then((function(t){e(pt.value(t))}),(function(t){e(pt.error(t))}))}))},bB={nu:dB,wrap:fB,pure:mB,value:mB,error:gB,fromResult:hB,fromFuture:pB,fromPromise:vB},yB={type:"separator"},wB=function(t){return{type:"menuitem",value:t.url,text:t.title,meta:{attach:t.attach},onAction:function(){}}},xB=function(t,e){return{type:"menuitem",value:e,text:t,meta:{attach:void 0},onAction:function(){}}},CB=function(t){return $(t,wB)},SB=function(t,e){return Y(e,(function(e){return e.type===t}))},kB=function(t,e){return CB(SB(t,e))},OB=function(t){return kB("header",t.targets)},TB=function(t){return kB("anchor",t.targets)},EB=function(t){return C.from(t.anchorTop).map((function(t){return xB("<top>",t)})).toArray()},_B=function(t){return C.from(t.anchorBottom).map((function(t){return xB("<bottom>",t)})).toArray()},AB=function(t){return $(t,(function(t){return xB(t,t)}))},DB=function(t){return Q(t,(function(t,e){var n=0===t.length||0===e.length;return n?t.concat(e):t.concat(yB,e)}),[])},NB=function(t,e){var n=t.toLowerCase();return Y(e,(function(t){var e=void 0!==t.meta&&void 0!==t.meta.text?t.meta.text:t.text;return zr(e.toLowerCase(),n)||zr(t.value.toLowerCase(),n)}))},RB=function(t,e,n){var r=Vg.getValue(e),o=void 0!==r.meta.text?r.meta.text:r.value,i=n.getLinkInformation();return i.fold((function(){return[]}),(function(e){var r=NB(o,AB(n.getHistory(t)));return"file"===t?DB([r,NB(o,OB(e)),NB(o,nt([EB(e),TB(e),_B(e)]))]):r}))},MB=Cu("aria-invalid"),zB=function(t,e,r){var o,i=e.shared.providers,u=function(e){var n=Vg.getValue(e);r.addToHistory(n.value,t.filetype)},a=ZT.parts().field({factory:lB,dismissOnBlur:!0,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],inputAttributes:{"aria-errormessage":MB,type:"url"},minChars:0,responseTime:0,fetch:function(n){var o=RB(t.filetype,n,r),i=DM(o,Hx.BUBBLE_TO_SANDBOX,e,!1);return HE.pure(i)},getHotspot:function(t){return h.getOpt(t)},onSetValue:function(t,e){t.hasConfigured(XE)&&XE.run(t).get(n)},typeaheadBehaviours:Al(nt([r.getValidationHandler().map((function(e){return XE.config({getRoot:function(t){return Vi(t.element())},invalidClass:"tox-control-wrap--status-invalid",notify:{onInvalid:function(t,e){l.getOpt(t).each((function(t){cu(t.element(),"title",i.translate(e))}))}},validator:{validate:function(n){var r=Vg.getValue(n);return bB.nu((function(n){e({type:t.filetype,url:r.value},(function(t){if("invalid"===t.status){var e=pt.error(t.message);n(e)}else{var r=pt.value(t.message);n(r)}}))}))},validateOnLoad:!1}})})).toArray(),[cS.config({disabled:function(){return t.disabled||i.isReadOnly()}}),rE.config({}),gy("urlinput-events",nt(["file"===t.filetype?[pi(Ao(),(function(e){ai(e,lE,{name:t.name})}))]:[],[pi(Do(),(function(e){ai(e,lE,{name:t.name}),u(e)})),pi(Ho(),(function(e){ai(e,lE,{name:t.name}),u(e)}))]]))]])),eventOrder:(o={},o[Ao()]=["streaming","urlinput-events","invalidating"],o),model:{getDisplayText:function(t){return t.value},selectsOver:!1,populateFromBrowse:!1},markers:{openClass:"tox-textfield--popup-open"},lazySink:e.shared.getSink,parts:{menu:rC(!1,1,"normal")},onExecute:function(t,e,n){ai(e,gE,{})},onItemExecute:function(e,n,r,o){u(e),ai(e,lE,{name:t.name})}}),c=t.label.map((function(t){return sE(t,i)})),s=function(t,e,n,r){return void 0===n&&(n=t),void 0===r&&(r=t),{dom:{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+t],innerHtml:qw(n,i.icons),attributes:g({title:i.translate(r),"aria-live":"polite"},e.fold((function(){return{}}),(function(t){return{id:t}})))}}},l=jw(s("invalid",C.some(MB),"warning")),f=jw({dom:{tag:"div",classes:["tox-control-wrap__status-icon-wrap"]},components:[l.asSpec()]}),d=r.getUrlPicker(t.filetype),m=Cu("browser.url.event"),h=jw({dom:{tag:"div",classes:["tox-control-wrap"]},components:[a,f.asSpec()],behaviours:Al([cS.config({disabled:function(){return t.disabled||i.isReadOnly()}})])}),p=jw(IM({name:t.name,icon:C.some("browse"),text:t.label.getOr(""),disabled:t.disabled,primary:!1,borderless:!0},(function(t){return ui(t,m)}),i,[],["tox-browse-url"])),v=function(){return{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:nt([[h.asSpec()],d.map((function(){return p.asSpec()})).toArray()])}},b=function(e){lp.getCurrent(e).each((function(n){var r=Vg.getValue(n),o=g({fieldname:t.name},r);d.each((function(r){r(o).get((function(r){Vg.setValue(n,r),ai(e,lE,{name:t.name})}))}))}))};return ZT.sketch({dom:aE(),components:c.toArray().concat([v()]),fieldBehaviours:Al([cS.config({disabled:function(){return t.disabled||i.isReadOnly()},onDisabled:function(t){ZT.getField(t).each(cS.disable),p.getOpt(t).each(cS.disable)},onEnabled:function(t){ZT.getField(t).each(cS.enable),p.getOpt(t).each(cS.enable)}}),QS(),gy("url-input-events",[pi(m,b)])])})},BB=function(t,e){return GT.sketch({dom:{tag:"div",attributes:{role:"alert"},classes:["tox-notification","tox-notification--in","tox-notification--"+t.level]},components:[{dom:{tag:"div",classes:["tox-notification__icon"]},components:[Uw.sketch({dom:{tag:"button",classes:["tox-button","tox-button--naked","tox-button--icon"],innerHtml:qw(t.icon,e.icons),attributes:{title:e.translate(t.iconTooltip)}},action:function(e){ai(e,mE,{name:"alert-banner",value:t.url})}})]},{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:e.translate(t.text)}}]})},PB=function(t,e){var n=Vg.config({store:{mode:"manual",getValue:function(t){var e=t.element().dom();return e.checked},setValue:function(t,e){var n=t.element().dom();n.checked=e}}}),r=function(t){return t.element().dom().click(),C.some(!0)},o=ZT.parts().field({factory:{sketch:a},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:Al([AN.self(),cS.config({disabled:function(){return t.disabled||e.isReadOnly()}}),rE.config({}),Sy.config({}),n,ny.config({mode:"special",onEnter:r,onSpace:r,stopSpaceKeyup:!0}),gy("checkbox-events",[pi(Do(),(function(e,n){ai(e,lE,{name:t.name})}))])])}),i=ZT.parts().label({dom:{tag:"span",classes:["tox-checkbox__label"],innerHtml:e.translate(t.label)},behaviours:Al([S_.config({})])}),u=function(t){var n="checked"===t?"selected":"unselected";return{dom:{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+t],innerHtml:qw(n,e.icons)}}},c=jw({dom:{tag:"div",classes:["tox-checkbox__icons"]},components:[u("checked"),u("unchecked")]});return ZT.sketch({dom:{tag:"label",classes:["tox-checkbox"]},components:[o,c.asSpec(),i],fieldBehaviours:Al([cS.config({disabled:function(){return t.disabled||e.isReadOnly()},disableClass:"tox-checkbox--disabled",onDisabled:function(t){ZT.getField(t).each(cS.disable)},onEnabled:function(t){ZT.getField(t).each(cS.enable)}}),QS()])})},HB=function(t){return"presentation"===t.presets?GT.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html}}):GT.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html,attributes:{role:"document"}},containerBehaviours:Al([rE.config({}),Sy.config({})])})},IB=function(t){return function(e,n,r){return Lt(n,"name").fold((function(){return t(n,r)}),(function(o){return e.field(o,t(n,r))}))}},LB=function(t){return function(e,n,r){var o=Kt(n,{source:"dynamic"});return IB(t)(e,o,r)}},FB={bar:IB((function(t,e){return XT(t,e.shared)})),collection:IB((function(t,e){return yE(t,e.shared.providers)})),alertbanner:IB((function(t,e){return BB(t,e.shared.providers)})),input:IB((function(t,e){return qz(t,e.shared.providers)})),textarea:IB((function(t,e){return $z(t,e.shared.providers)})),label:IB((function(t,e){return Iz(t,e.shared)})),iframe:LB((function(t,e){return oR(t,e.shared.providers)})),button:IB((function(t,e){return jM(t,e.shared.providers)})),checkbox:IB((function(t,e){return PB(t,e.shared.providers)})),colorinput:IB((function(t,e){return __(t,e.shared,e.colorinput)})),colorpicker:IB(MN),dropzone:IB((function(t,e){return GN(t,e.shared.providers)})),grid:IB((function(t,e){return KN(t,e.shared)})),selectbox:IB((function(t,e){return Uz(t,e.shared.providers)})),sizeinput:IB((function(t,e){return nz(t,e.shared.providers)})),urlinput:IB((function(t,e){return zB(t,e,e.urlinput)})),customeditor:IB(PN),htmlpanel:IB(HB),imagetools:IB((function(t,e){return Hz(t,e.shared.providers)})),table:IB((function(t,e){return jz(t,e.shared.providers)})),panel:IB((function(t,e){return Lz(t,e)}))},VB={field:function(t,e){return e}},UB=function(t,e,n){var r=Kt(n,{shared:{interpreter:function(e){return jB(t,e,r)}}});return jB(t,e,r)},jB=function(t,n,r){return Lt(FB,n.type).fold((function(){return e.console.error('Unknown factory type "'+n.type+'", defaulting to container: ',n),n}),(function(e){return e(t,n,r)}))},WB=function(t,e){var n=VB;return jB(n,t,e)},qB={valignCentre:[],alignCentre:[],alignLeft:[],alignRight:[],right:[],left:[],bottom:[],top:[]},$B=function(t,e,n){var r=_f(-12,12,qB),o={maxHeightFunction:Sf()},i=function(){return{anchor:"node",root:La(Hi(t())),node:C.from(t()),bubble:r,layouts:{onRtl:function(){return[Hw]},onLtr:function(){return[Pw]}},overrides:o}},u=function(){return{anchor:"hotspot",hotspot:e(),bubble:r,layouts:{onRtl:function(){return[cl]},onLtr:function(){return[sl]}},overrides:o}};return function(){return n()?i():u()}},GB=function(t,e,n){var r=function(){return{anchor:"node",root:La(Hi(t())),node:C.from(t()),layouts:{onRtl:function(){return[Iw]},onLtr:function(){return[Iw]}}}},o=function(){return{anchor:"hotspot",hotspot:e(),layouts:{onRtl:function(){return[ml]},onLtr:function(){return[ml]}}}};return function(){return n()?r():o()}},KB=function(t,e){return function(){return{anchor:"selection",root:e(),getSelection:function(){var e=t.selection.getRng();return C.some(ud.range(Zn.fromDom(e.startContainer),e.startOffset,Zn.fromDom(e.endContainer),e.endOffset))}}}},XB=function(t){return function(e){return{anchor:"node",root:t(),node:e}}},YB=function(t,e,n){var r=MS(t),o=function(){return Zn.fromDom(t.getBody())},i=function(){return Zn.fromDom(t.getContentAreaContainer())},u=function(){return r||!n()};return{inlineDialog:$B(i,e,u),banner:GB(i,e,u),cursor:KB(t,o),node:XB(o)}},JB=function(t){return function(e,n){var r=VO(t);r(e,n)}},QB=function(t){return function(){return SO(t)}},ZB=function(t){return function(){return OO(t)}},tP=function(t){return function(){return MO(t)}},eP=function(t){return{colorPicker:JB(t),hasCustomColors:QB(t),getColors:ZB(t),getColorCols:tP(t)}},nP=function(t){return function(){return HS(t)}},rP=function(t){return{isDraggableModal:nP(t)}},oP=function(t){var e=Gn(DS(t)?"bottom":"top");return{isPositionedAtTop:function(){return"top"===e.get()},getDockingMode:e.get,setDockingMode:e.set}},iP=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",format:"bold"},{title:"Italic",format:"italic"},{title:"Underline",format:"underline"},{title:"Strikethrough",format:"strikethrough"},{title:"Superscript",format:"superscript"},{title:"Subscript",format:"subscript"},{title:"Code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Align",items:[{title:"Left",format:"alignleft"},{title:"Center",format:"aligncenter"},{title:"Right",format:"alignright"},{title:"Justify",format:"alignjustify"}]}],uP=function(t){return Ft(t,"items")},aP=function(t){return Ft(t,"block")},cP=function(t){return Ft(t,"inline")},sP=function(t){return Ft(t,"selector")},lP=function(t){return Q(t,(function(t,e){if(uP(e)){var n=lP(e.items);return{customFormats:t.customFormats.concat(n.customFormats),formats:t.formats.concat([{title:e.title,items:n.formats}])}}if(cP(e)||aP(e)||sP(e)){var r="custom-"+e.title.toLowerCase();return{customFormats:t.customFormats.concat([{name:r,format:e}]),formats:t.formats.concat([{title:e.title,format:r,icon:e.icon}])}}return g(g({},t),{formats:t.formats.concat(e)})}),{customFormats:[],formats:[]})},fP=function(t,e){var n=lP(e),r=function(e){G(e,(function(e){t.formatter.has(e.name)||t.formatter.register(e.name,e.format)}))};return t.formatter?r(n.customFormats):t.on("init",(function(){r(n.customFormats)})),n.formats},dP=function(t){return yS(t).map((function(e){var n=fP(t,e);return wS(t)?iP.concat(n):n})).getOr(iP)},mP=function(t,e,n){var r={type:"formatter",isSelected:e(t.format),getStylePreview:n(t.format)};return Kt(t,r)},gP=function(t,e,n,r){var o=function(t){return mP(t,n,r)},i=function(t){var e={type:"submenu"};return Kt(t,e)},u=function(e){var o=Cu(e.title),i={type:"formatter",format:o,isSelected:n(o),getStylePreview:r(o)},u=Kt(e,i);return t.formatter.register(o,u),u},a=function(t){return $(t,(function(t){var e=_t(t);if(Vt(t,"items")){var n=a(t.items);return Kt(i(t),{getStyleItems:function(){return n}})}return Vt(t,"format")?o(t):1===e.length&&U(e,"title")?Kt(t,{type:"separator"}):u(t)}))};return a(e)},hP=function(t){var e=function(e){return function(){return t.formatter.match(e)}},n=function(e){return function(){var n=t.formatter.get(e);return void 0!==n?C.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))}):C.none()}},r=function(t){var e=t.items;return void 0!==e&&e.length>0?rt(e,r):[t.format]},o=Gn([]),i=Gn([]),u=Gn([]),a=Gn([]),c=Gn(!1);t.on("PreInit",(function(u){var a=dP(t),c=gP(t,a,e,n);o.set(c),i.set(rt(c,r))})),t.on("addStyleModifications",(function(o){var i=gP(t,o.items,e,n);u.set(i),c.set(o.replace),a.set(rt(i,r))}));var s=function(){var t=c.get()?[]:o.get(),e=u.get();return t.concat(e)},l=function(){var t=c.get()?[]:i.get(),e=a.get();return t.concat(e)};return{getData:s,getFlattenedKeys:l}},pP=xz.trim,vP=function(t){return function(e){if(e&&1===e.nodeType){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},bP=vP("true"),yP=vP("false"),wP=function(t,e,n,r,o){return{type:t,title:e,url:n,level:r,attach:o}},xP=function(t){while(t=t.parentNode){var e=t.contentEditable;if(e&&"inherit"!==e)return bP(t)}return!1},CP=function(t,e){return $(Ad(Zn.fromDom(e),t),(function(t){return t.dom()}))},SP=function(t){return t.innerText||t.textContent},kP=function(t){return t.id?t.id:Cu("h")},OP=function(t){return t&&"A"===t.nodeName&&void 0!==(t.id||t.name)},TP=function(t){return OP(t)&&_P(t)},EP=function(t){return t&&/^(H[1-6])$/.test(t.nodeName)},_P=function(t){return xP(t)&&!yP(t)},AP=function(t){return EP(t)&&_P(t)},DP=function(t){return EP(t)?parseInt(t.nodeName.substr(1),10):0},NP=function(t){var e=kP(t),n=function(){t.id=e};return wP("header",SP(t),"#"+e,DP(t),n)},RP=function(t){var e=t.id||t.name,r=SP(t);return wP("anchor",r||"#"+e,"#"+e,0,n)},MP=function(t){return $(Y(t,AP),NP)},zP=function(t){return $(Y(t,TP),RP)},BP=function(t){var e=CP("h1,h2,h3,h4,h5,h6,a:not([href])",t);return e},PP=function(t){return pP(t.title).length>0},HP=function(t){var e=BP(t);return Y(MP(e).concat(zP(e)),PP)},IP={find:HP},LP="tinymce-url-history",FP=5,VP=function(t){return E(t)&&/^https?/.test(t)},UP=function(t){return A(t)&&t.length<=FP&&ot(t,VP)},jP=function(t){return _(t)&&Ht(t,(function(t){return!UP(t)})).isNone()},WP=function(){var t,n=hO.getItem(LP);if(null===n)return{};try{t=JSON.parse(n)}catch(r){if(r instanceof SyntaxError)return e.console.log("Local storage "+LP+" was not valid JSON",r),{};throw r}return jP(t)?t:(e.console.log("Local storage "+LP+" was not valid format",t),{})},qP=function(t){if(!jP(t))throw new Error("Bad format for history:\n"+JSON.stringify(t));hO.setItem(LP,JSON.stringify(t))},$P=function(t){var e=WP();return Object.prototype.hasOwnProperty.call(e,t)?e[t]:[]},GP=function(t,e){if(VP(t)){var n=WP(),r=Object.prototype.hasOwnProperty.call(n,e)?n[e]:[],o=Y(r,(function(e){return e!==t}));n[e]=[t].concat(o).slice(0,FP),qP(n)}},KP=function(t){return!!t},XP=function(t){return Nt(xz.makeMap(t,/[, ]/),KP)},YP=function(t){return C.from(VS(t)).filter(z)},JP=function(t){var e=C.some(US(t)).filter(KP),n=C.some(jS(t)).filter(KP),r=e.or(n).map(XP);return YP(t).fold((function(){return!1}),(function(t){return r.fold((function(){return!0}),(function(t){return _t(t).length>0&&t}))}))},QP=function(t,e){var n=JP(t);return D(n)?n?YP(t):C.none():n[e]?YP(t):C.none()},ZP=function(t,e){return QP(t,e).map((function(n){return function(r){return HE.nu((function(o){var i=function(t,e){if(!E(t))throw new Error("Expected value to be string");if(void 0!==e&&!_(e))throw new Error("Expected meta to be a object");var n={value:t,meta:e};o(n)},u=g({filetype:e,fieldname:r.fieldname},C.from(r.meta).getOr({}));n.call(t,i,r.value,u)}))}}))},tH=function(t){return WS(t)?C.none():C.some({targets:IP.find(t.getBody()),anchorTop:qS(t),anchorBottom:$S(t)})},eH=function(t){return C.from(GS(t))},nH=function(t){return{getHistory:$P,addToHistory:GP,getLinkInformation:function(){return tH(t)},getValidationHandler:function(){return eH(t)},getUrlPicker:function(e){return ZP(t,e)}}},rH=function(t,e,n){var r=Gn(!1),o=oP(e),i={shared:{providers:{icons:function(){return e.ui.registry.getAll().icons},menuItems:function(){return e.ui.registry.getAll().menuItems},translate:jC.translate,isReadOnly:function(){return e.mode.isReadOnly()}},interpreter:function(t){return WB(t,i)},anchors:YB(e,n,o.isPositionedAtTop),header:o,getSink:function(){return pt.value(t)}},urlinput:nH(e),styleselect:hP(e),colorinput:eP(e),dialog:rP(e),isContextMenuOpen:function(){return r.get()},setContextMenuState:function(t){return r.set(t)}};return i},oH=u((function(t,e){Ac(t,Math.floor(e))})),iH="contexttoolbar-show",uH="contexttoolbar-hide",aH=u([vn("items"),As(["itemSelector"]),Ug("tgroupBehaviours",[ny])]),cH=u([Sh({name:"items",unit:"item"})]),sH=function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,behaviours:Wg(t.tgroupBehaviours,[ny.config({mode:"flow",selector:t.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}},lH=ep({name:"ToolbarGroup",configFields:aH(),partFields:cH(),factory:sH}),fH=u([vn("dom"),Pn("shell",!0),Ug("toolbarBehaviours",[dy])]),dH=function(){return{behaviours:Al([dy.config({})])}},mH=u([Ch({name:"groups",overrides:dH})]),gH=function(t,n,r,o){var i=function(t,n){u(t).fold((function(){throw e.console.error("Toolbar was defined to not be a shell, but no groups container was specified in components"),new Error("Toolbar was defined to not be a shell, but no groups container was specified in components")}),(function(t){dy.set(t,n)}))},u=function(e){return t.shell?C.some(e):Bh(e,t,"groups")},a=t.shell?{behaviours:[dy.config({})],components:[]}:{behaviours:[],components:n};return{uid:t.uid,dom:t.dom,components:a.components,behaviours:Wg(t.toolbarBehaviours,a.behaviours),apis:{setGroups:i},domModification:{attributes:{role:"group"}}}},hH=ep({name:"Toolbar",configFields:fH(),partFields:mH(),factory:gH,apis:{setGroups:function(t,e,n){t.setGroups(e,n)}}}),pH=function(t,e){var n={len:0,list:[]},r=Q(t,(function(t,n){var r=e(n,t.len);return r.fold(u(t),(function(e){return{len:e.finish(),list:t.list.concat([e])}}))}),n);return r.list},vH=function(t,e,n){return{within:u(t),extra:u(e),withinWidth:u(n)}},bH=function(t,e,n){var r=pH(t,(function(t,e){var r=n(t);return C.some({element:u(t),start:u(e),finish:u(e+r),width:u(r)})})),o=Y(r,(function(t){return t.finish()<=e})),i=J(o,(function(t,e){return t+e.width()}),0),a=r.slice(o.length);return{within:u(o),extra:u(a),withinWidth:u(i)}},yH=function(t){return $(t,(function(t){return t.element()}))},wH=function(t,e,n){var r=yH(t.concat(e));return vH(r,[],n)},xH=function(t,e,n,r){var o=yH(t).concat([n]);return vH(o,yH(e),r)},CH=function(t,e,n){return vH(yH(t),[],n)},SH=function(t,e,n){var r=bH(e,t,n);return 0===r.extra().length?C.some(r):C.none()},kH=function(t,e,n,r){var o=SH(t,e,n).getOrThunk((function(){return bH(e,t-n(r),n)})),i=o.within(),u=o.extra(),a=o.withinWidth();return 1===u.length&&u[0].width()<=n(r)?wH(i,u,a):u.length>=1?xH(i,u,r,a):CH(i,u,a)},OH=function(t,e){var n=$(e,(function(t){return mc(t)}));hH.setGroups(t,n)},TH=function(t){return dt(t,(function(t){return Gl(t.element()).bind((function(e){return t.getSystem().getByDom(e).toOption()}))}))},EH=function(t,e,n){var r=Ph(t,e,"primary"),o=e_.getCoupled(t,"overflowGroup");Ua(r.element(),"visibility","hidden");var i=e.builtGroups.get().concat([o]),u=TH(i);n([]),OH(r,i);var a=Ec(r.element()),c=kH(a,e.builtGroups.get(),(function(t){return Ec(t.element())}),o);0===c.extra().length?(dy.remove(r,o),n([])):(OH(r,c.within()),n(c.extra())),Ya(r.element(),"visibility"),Ja(r.element()),u.each(Sy.focus)},_H=u([Ug("splitToolbarBehaviours",[e_]),$n("builtGroups",(function(){return Gn([])}))]),AH=u([As(["overflowToggledClass"]),Rn("getOverflowBounds"),vn("lazySink"),$n("overflowGroups",(function(){return Gn([])}))].concat(_H())),DH=u([wh({factory:hH,schema:fH(),name:"primary"}),xh({schema:fH(),name:"overflow"}),xh({name:"overflow-button"}),xh({name:"overflow-group"})]),NH=u([As(["toggledClass"]),vn("lazySink"),Sn("fetch"),Rn("getBounds"),zn("fireDismissalEventInstead",[Pn("event",Qo())]),Bf()]),RH=u([xh({name:"button",overrides:function(t){return{dom:{attributes:{"aria-haspopup":"true"}},buttonBehaviours:Al([Uy.config({toggleClass:t.markers.toggledClass,aria:{mode:"expanded"},toggleOnExecute:!1})])}}}),xh({factory:hH,schema:fH(),name:"toolbar",overrides:function(t){return{toolbarBehaviours:Al([ny.config({mode:"cyclic",onEscape:function(e){return Bh(e,t,"button").each(Sy.focus),C.none()}})])}}})]),MH=function(t,e){var n=e_.getCoupled(t,"toolbarSandbox");ig.isOpen(n)?ig.close(n):ig.open(n,e.toolbar())},zH=function(t,e,n,r){var o=n.getBounds.map((function(t){return t()})),i=n.lazySink(t).getOrDie();Om.positionWithinBounds(i,{anchor:"hotspot",hotspot:t,layouts:r,overrides:{maxWidthFunction:oH()}},e,o)},BH=function(t,e,n,r,o){hH.setGroups(e,o),zH(t,e,n,r),Uy.on(t)},PH=function(t,e,n){var r=ls(),o=function(o,i){n.fetch().get((function(o){BH(t,i,n,e.layouts,o),r.link(t.element()),ny.focusIn(i)}))},i=function(){Uy.off(t),Sy.focus(t),r.unlink(t.element())};return{dom:{tag:"div",attributes:{id:r.id}},behaviours:Al([ny.config({mode:"special",onEscape:function(t){return ig.close(t),C.some(!0)}}),ig.config({onOpen:o,onClose:i,isPartOf:function(e,n,r){return ds(n,r)||ds(t,r)},getAttachPoint:function(){return n.lazySink(t).getOrDie()}}),Ll.config({channels:g(g({},lg(g({isExtraPart:f},n.fireDismissalEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})))),dg({doReposition:function(){ig.getState(e_.getCoupled(t,"toolbarSandbox")).each((function(r){zH(t,r,n,e.layouts)}))}}))})])}},HH=function(t,e,n,r){return g(g({},Uw.sketch(g(g({},r.button()),{action:function(t){MH(t,r)},buttonBehaviours:qg.augment({dump:r.button().buttonBehaviours},[e_.config({others:{toolbarSandbox:function(e){return PH(e,n,t)}}})])}))),{apis:{setGroups:function(e,r){ig.getState(e_.getCoupled(e,"toolbarSandbox")).each((function(o){BH(e,o,t,n.layouts,r)}))},reposition:function(e){ig.getState(e_.getCoupled(e,"toolbarSandbox")).each((function(r){zH(e,r,t,n.layouts)}))},toggle:function(t){MH(t,r)},getToolbar:function(t){return ig.getState(e_.getCoupled(t,"toolbarSandbox"))}}})},IH=ep({name:"FloatingToolbarButton",factory:HH,configFields:NH(),partFields:RH(),apis:{setGroups:function(t,e,n){t.setGroups(e,n)},reposition:function(t,e){t.reposition(e)},toggle:function(t,e){t.toggle(e)},getToolbar:function(t,e){return t.getToolbar(e)}}}),LH=function(t){return $(t,(function(t){return mc(t)}))},FH=function(t,e,n){EH(t,n,(function(r){n.overflowGroups.set(r),e.getOpt(t).each((function(t){IH.setGroups(t,LH(r))}))}))},VH=function(t,e,n,r){var o=jw(IH.sketch({fetch:function(){return HE.nu((function(e){e(LH(t.overflowGroups.get()))}))},layouts:{onLtr:function(){return[sl,cl]},onRtl:function(){return[cl,sl]},onBottomLtr:function(){return[fl,ll]},onBottomRtl:function(){return[ll,fl]}},getBounds:n.getOverflowBounds,lazySink:t.lazySink,fireDismissalEventInstead:{},markers:{toggledClass:t.markers.overflowToggledClass},parts:{button:r["overflow-button"](),toolbar:r.overflow()}}));return{uid:t.uid,dom:t.dom,components:e,behaviours:Wg(t.splitToolbarBehaviours,[e_.config({others:{overflowGroup:function(){return lH.sketch(g(g({},r["overflow-group"]()),{items:[o.asSpec()]}))}}})]),apis:{setGroups:function(e,n){t.builtGroups.set($(n,e.getSystem().build)),FH(e,o,t)},refresh:function(e){return FH(e,o,t)},toggle:function(t){o.getOpt(t).each((function(t){IH.toggle(t)}))},reposition:function(t){o.getOpt(t).each((function(t){IH.reposition(t)}))},getOverflow:function(t){return o.getOpt(t).bind((function(t){return IH.getToolbar(t)}))}},domModification:{attributes:{role:"group"}}}},UH=ep({name:"SplitFloatingToolbar",configFields:AH(),partFields:DH(),factory:VH,apis:{setGroups:function(t,e,n){t.setGroups(e,n)},refresh:function(t,e){t.refresh(e)},reposition:function(t,e){t.reposition(e)},toggle:function(t,e){t.toggle(e)},getOverflow:function(t,e){return t.getOverflow(e)}}}),jH=function(t,e){return e.getAnimationRoot.fold((function(){return t.element()}),(function(e){return e(t)}))},WH=function(t){return t.dimension.property},qH=function(t,e){return t.dimension.getDimension(e)},$H=function(t,e){var n=jH(t,e);Ta(n,[e.shrinkingClass,e.growingClass])},GH=function(t,e){Sa(t.element(),e.openClass),xa(t.element(),e.closedClass),Ua(t.element(),WH(e),"0px"),Ja(t.element())},KH=function(t,e){Sa(t.element(),e.closedClass),xa(t.element(),e.openClass),Ya(t.element(),WH(e))},XH=function(t,e,n,r){n.setCollapsed(),Ua(t.element(),WH(e),qH(e,t.element())),Ja(t.element()),$H(t,e),GH(t,e),e.onStartShrink(t),e.onShrunk(t)},YH=function(t,e,n,r){var o=r.getOrThunk((function(){return qH(e,t.element())}));n.setCollapsed(),Ua(t.element(),WH(e),o),Ja(t.element());var i=jH(t,e);Sa(i,e.growingClass),xa(i,e.shrinkingClass),GH(t,e),e.onStartShrink(t)},JH=function(t,e,n){var r=qH(e,t.element()),o="0px"===r?XH:YH;o(t,e,n,C.some(r))},QH=function(t,e,n){var r=jH(t,e),o=ka(r,e.shrinkingClass),i=qH(e,t.element());KH(t,e);var u=qH(e,t.element()),a=function(){Ua(t.element(),WH(e),i),Ja(t.element())},c=function(){GH(t,e)},s=o?a:c;s(),Sa(r,e.shrinkingClass),xa(r,e.growingClass),KH(t,e),Ua(t.element(),WH(e),u),n.setExpanded(),e.onStartGrow(t)},ZH=function(t,e,n){if(n.isExpanded()){Ya(t.element(),WH(e));var r=qH(e,t.element());Ua(t.element(),WH(e),r)}},tI=function(t,e,n){n.isExpanded()||QH(t,e,n)},eI=function(t,e,n){n.isExpanded()&&JH(t,e,n)},nI=function(t,e,n){n.isExpanded()&&XH(t,e,n,C.none())},rI=function(t,e,n){return n.isExpanded()},oI=function(t,e,n){return n.isCollapsed()},iI=function(t,e,n){var r=jH(t,e);return!0===ka(r,e.growingClass)},uI=function(t,e,n){var r=jH(t,e);return!0===ka(r,e.shrinkingClass)},aI=function(t,e,n){return!0===iI(t,e)||!0===uI(t,e)},cI=function(t,e,n){var r=n.isExpanded()?JH:QH;r(t,e,n)},sI=Object.freeze({__proto__:null,refresh:ZH,grow:tI,shrink:eI,immediateShrink:nI,hasGrown:rI,hasShrunk:oI,isGrowing:iI,isShrinking:uI,isTransitioning:aI,toggleGrow:cI,disableTransitions:$H}),lI=function(t,e,n){var r=e.expanded;return Ku(r?{classes:[e.openClass],styles:{}}:{classes:[e.closedClass],styles:se(e.dimension.property,"0px")})},fI=function(t,e){return di([Oi(Ro(),(function(n,r){var o=r.event().raw();if(o.propertyName===t.dimension.property){$H(n,t),e.isExpanded()&&Ya(n.element(),t.dimension.property);var i=e.isExpanded()?t.onGrown:t.onShrunk;i(n)}}))])},dI=Object.freeze({__proto__:null,exhibit:lI,events:fI}),mI=[vn("closedClass"),vn("openClass"),vn("shrinkingClass"),vn("growingClass"),_n("getAnimationRoot"),Ns("onShrunk"),Ns("onStartShrink"),Ns("onGrown"),Ns("onStartGrow"),Pn("expanded",!1),bn("dimension",an("property",{width:[Bs("property","width"),Bs("getDimension",(function(t){return Ec(t)+"px"}))],height:[Bs("property","height"),Bs("getDimension",(function(t){return pc(t)+"px"}))]}))],gI=function(t){var e=Gn(t.expanded),n=function(){return"expanded: "+e.get()};return ju({isExpanded:function(){return!0===e.get()},isCollapsed:function(){return!1===e.get()},setCollapsed:c(e.set,!1),setExpanded:c(e.set,!0),readState:n})},hI=Object.freeze({__proto__:null,init:gI}),pI=Nl({fields:mI,name:"sliding",active:dI,apis:sI,state:hI}),vI=u([As(["closedClass","openClass","shrinkingClass","growingClass","overflowToggledClass"]),Ns("onOpened"),Ns("onClosed")].concat(_H())),bI=u([wh({factory:hH,schema:fH(),name:"primary"}),wh({factory:hH,schema:fH(),name:"overflow",overrides:function(t){return{toolbarBehaviours:Al([pI.config({dimension:{property:"height"},closedClass:t.markers.closedClass,openClass:t.markers.openClass,shrinkingClass:t.markers.shrinkingClass,growingClass:t.markers.growingClass,onShrunk:function(e){Bh(e,t,"overflow-button").each((function(t){Uy.off(t),Sy.focus(t)})),t.onClosed(e)},onGrown:function(e){ny.focusIn(e),t.onOpened(e)},onStartGrow:function(e){Bh(e,t,"overflow-button").each(Uy.on)}}),ny.config({mode:"acyclic",onEscape:function(e){return Bh(e,t,"overflow-button").each(Sy.focus),C.some(!0)}})])}}}),xh({name:"overflow-button",overrides:function(t){return{buttonBehaviours:Al([Uy.config({toggleClass:t.markers.overflowToggledClass,aria:{mode:"pressed"},toggleOnExecute:!1})])}}}),xh({name:"overflow-group"})]),yI=function(t,e){Bh(t,e,"overflow").each((function(n){wI(t,e),pI.toggleGrow(n)}))},wI=function(t,e){Bh(t,e,"overflow").each((function(n){EH(t,e,(function(t){var e=$(t,(function(t){return mc(t)}));hH.setGroups(n,e)})),Bh(t,e,"overflow-button").each((function(t){pI.hasGrown(n)&&Uy.on(t)})),pI.refresh(n)}))},xI=function(t,e,n,r){var o="alloy.toolbar.toggle",i=function(e,n){var r=$(n,e.getSystem().build);t.builtGroups.set(r)};return{uid:t.uid,dom:t.dom,components:e,behaviours:Wg(t.splitToolbarBehaviours,[e_.config({others:{overflowGroup:function(t){return lH.sketch(g(g({},r["overflow-group"]()),{items:[Uw.sketch(g(g({},r["overflow-button"]()),{action:function(e){ui(t,o)}}))]}))}}}),gy("toolbar-toggle-events",[pi(o,(function(e){Bh(e,t,"overflow").each((function(n){wI(e,t),pI.toggleGrow(n)}))}))])]),apis:{setGroups:function(e,n){i(e,n),wI(e,t)},refresh:function(e){return wI(e,t)},toggle:function(e){return yI(e,t)}},domModification:{attributes:{role:"group"}}}},CI=ep({name:"SplitSlidingToolbar",configFields:vI(),partFields:bI(),factory:xI,apis:{setGroups:function(t,e,n){t.setGroups(e,n)},refresh:function(t,e){t.refresh(e)},toggle:function(t,e){t.toggle(e)}}}),SI=u(Cu("toolbar-height-change")),kI=function(t){var e=t.title.fold((function(){return{}}),(function(t){return{attributes:{title:t}}}));return{dom:g({tag:"div",classes:["tox-toolbar__group"]},e),components:[lH.parts().items({})],items:t.items,markers:{itemSelector:"*:not(.tox-split-button) > .tox-tbtn:not([disabled]), .tox-split-button:not([disabled]), .tox-toolbar-nav-js:not([disabled])"},tgroupBehaviours:Al([rE.config({}),Sy.config({})])}},OI=function(t){return lH.sketch(kI(t))},TI=function(t,e){var n=Ti((function(e){var n=$(t.initGroups,OI);hH.setGroups(e,n)}));return Al([rk.toolbarButton(t.providers.isReadOnly),QS(),ny.config({mode:e,onEscape:t.onEscape,selector:".tox-toolbar__group"}),gy("toolbar-events",[n])])},EI=function(t){var e=t.cyclicKeying?"cyclic":"acyclic";return{uid:t.uid,dom:{tag:"div",classes:["tox-toolbar-overlord"]},parts:{"overflow-group":kI({title:C.none(),items:[]}),"overflow-button":BM({name:"more",icon:C.some("more-drawer"),disabled:!1,tooltip:C.some("More..."),primary:!1,borderless:!1},C.none(),t.providers)},splitToolbarBehaviours:TI(t,e)}},_I=function(t){var e=EI(t),n=4,r=UH.parts().primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}});return UH.sketch(g(g({},e),{lazySink:t.getSink,getOverflowBounds:function(){var e=t.moreDrawerData.lazyHeader().element(),r=Qc(e),o=Li(e),i=Qc(o),u=Math.max(o.dom().scrollHeight,i.height);return Yc(r.x+n,i.y,r.width-2*n,u)},parts:g(g({},e.parts),{overflow:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:t.attributes}}}),components:[r],markers:{overflowToggledClass:"tox-tbtn--enabled"}}))},AI=function(t){var e=CI.parts().primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}}),n=CI.parts().overflow({dom:{tag:"div",classes:["tox-toolbar__overflow"]}}),r=EI(t);return CI.sketch(g(g({},r),{components:[e,n],markers:{openClass:"tox-toolbar__overflow--open",closedClass:"tox-toolbar__overflow--closed",growingClass:"tox-toolbar__overflow--growing",shrinkingClass:"tox-toolbar__overflow--shrinking",overflowToggledClass:"tox-tbtn--enabled"},onOpened:function(t){t.getSystem().broadcastOn([SI()],{type:"opened"})},onClosed:function(t){t.getSystem().broadcastOn([SI()],{type:"closed"})}}))},DI=function(t){var e=t.cyclicKeying?"cyclic":"acyclic";return hH.sketch({uid:t.uid,dom:{tag:"div",classes:["tox-toolbar"].concat(t.type===Px.scrolling?["tox-toolbar--scrolling"]:[])},components:[hH.parts().groups({})],toolbarBehaviours:TI(t,e)})},NI=[Vn("disabled",!1),Nn("tooltip"),Nn("icon"),Nn("text"),Un("onSetup",(function(){return n}))],RI=Ie([wn("type"),Sn("onAction")].concat(NI)),MI=function(t){return en("toolbarbutton",RI,t)},zI=[Nn("text"),Nn("tooltip"),Nn("icon"),Sn("fetch"),Un("onSetup",(function(){return n}))],BI=Ie(p([wn("type")],zI)),PI=function(t){return en("menubutton",BI,t)},HI=Ie([wn("type"),Nn("tooltip"),Nn("icon"),Nn("text"),Rn("select"),Sn("fetch"),Un("onSetup",(function(){return n})),Fn("presets","normal",["normal","color","listpreview"]),Pn("columns",1),Sn("onAction"),Sn("onItemAction")]),II=function(t){return en("SplitButton",HI,t)},LI=[Vn("active",!1)].concat(NI),FI=Ie(LI.concat([wn("type"),Sn("onAction")])),VI=function(t){return en("ToggleButton",FI,t)},UI=Ie([wn("type"),bn("items",Fe([Xe([wn("name"),En("items",fn)]),fn]))].concat(NI)),jI=function(t){return en("GroupToolbarButton",UI,t)},WI=[Un("predicate",(function(){return!1})),Fn("scope","node",["node","editor"]),Fn("position","selection",["node","selection","line"])],qI=NI.concat([Pn("type","contextformbutton"),Pn("primary",!1),Sn("onAction"),$n("original",a)]),$I=LI.concat([Pn("type","contextformbutton"),Pn("primary",!1),Sn("onAction"),$n("original",a)]),GI=NI.concat([Pn("type","contextformbutton")]),KI=LI.concat([Pn("type","contextformtogglebutton")]),XI=an("type",{contextformbutton:qI,contextformtogglebutton:$I}),YI=Ie([Pn("type","contextform"),Un("initValue",(function(){return""})),Nn("label"),En("commands",XI),An("launch",an("type",{contextformbutton:GI,contextformtogglebutton:KI}))].concat(WI)),JI=Ie([Pn("type","contexttoolbar"),wn("items")].concat(WI)),QI=function(t){return en("ContextToolbar",JI,t)},ZI=function(t){return en("ContextForm",YI,t)},tL=function(t,e,n){return n},eL=Object.freeze({__proto__:null,getState:tL}),nL=function(t,e){var n=function(n,r){t.updateState.each((function(t){var o=t(n,r);e.set(o)})),t.renderComponents.each((function(t){var o=t(r,e.get()),i=$(o,n.getSystem().build);Dm(n,i)}))};return di([pi(Io(),(function(e,r){var o=r,i=t.channel;U(o.channels(),i)&&n(e,o.data())})),Ti((function(e,r){t.initialData.each((function(t){n(e,t)}))}))])},rL=Object.freeze({__proto__:null,events:nL}),oL=function(){var t=Gn(C.none()),e=function(e){return t.set(e)},n=function(){return t.set(C.none())},r=function(){return t.get()},o=function(){return t.get().fold((function(){return"none"}),(function(t){return t}))};return{readState:o,get:r,set:e,clear:n}},iL=Object.freeze({__proto__:null,init:oL}),uL=[vn("channel"),_n("renderComponents"),_n("updateState"),_n("initialData")],aL=Nl({fields:uL,name:"reflecting",active:rL,apis:eL,state:iL}),cL=u([vn("toggleClass"),vn("fetch"),Ms("onExecute"),Pn("getHotspot",C.some),Pn("getAnchorOverrides",u({})),Bf(),Ms("onItemExecute"),_n("lazySink"),vn("dom"),Ns("onOpen"),Ug("splitDropdownBehaviours",[e_,ny,Sy]),Pn("matchWidth",!1),Pn("useMinWidth",!1),Pn("eventOrder",{}),_n("role")].concat(h_())),sL=wh({factory:Uw,schema:[vn("dom")],name:"arrow",defaults:function(){return{buttonBehaviours:Al([Sy.revoke()])}},overrides:function(t){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(e){e.getSystem().getByUid(t.uid).each(ci)},buttonBehaviours:Al([Uy.config({toggleOnExecute:!1,toggleClass:t.toggleClass})])}}}),lL=wh({factory:Uw,schema:[vn("dom")],name:"button",defaults:function(){return{buttonBehaviours:Al([Sy.revoke()])}},overrides:function(t){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(e){e.getSystem().getByUid(t.uid).each((function(n){t.onExecute(n,e)}))}}}}),fL=u([sL,lL,Ch({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[vn("text")],name:"aria-descriptor"}),xh({schema:[_s()],name:"menu",defaults:function(t){return{onExecute:function(e,n){e.getSystem().getByUid(t.uid).each((function(r){t.onItemExecute(r,e,n)}))}}}}),r_()]),dL=function(t,e,r,o){var i=function(t){lp.getCurrent(t).each((function(t){Dp.highlightFirst(t),ny.focusIn(t)}))},u=function(e){var r=i;s_(t,(function(t){return t}),e,o,r,_E.HighlightFirst).get(n)},a=function(t){return u(t),C.some(!0)},c=function(e){var n=Ph(e,t,"button");return ci(n),C.some(!0)},s=g(g({},di([Ti((function(e,n){var r=Bh(e,t,"aria-descriptor");r.each((function(t){var n=Cu("aria");cu(t.element(),"id",n),cu(e.element(),"aria-describedby",n)}))}))])),Wy(C.some(u))),l={repositionMenus:function(t){Uy.isOn(t)&&g_(t)}};return{uid:t.uid,dom:t.dom,components:e,apis:l,eventOrder:g(g({},t.eventOrder),{"alloy.execute":["disabling","toggling","alloy.base.behaviour"]}),events:s,behaviours:Wg(t.splitDropdownBehaviours,[e_.config({others:{sandbox:function(e){var n=Ph(e,t,"arrow"),r={onOpen:function(){Uy.on(n),Uy.on(e)},onClose:function(){Uy.off(n),Uy.off(e)}};return m_(t,e,r)}}}),ny.config({mode:"special",onSpace:c,onEnter:c,onDown:a}),Sy.config({}),Uy.config({toggleOnExecute:!1,aria:{mode:"expanded"}})]),domModification:{attributes:{role:t.role.getOr("button"),"aria-haspopup":!0}}}},mL=ep({name:"SplitDropdown",configFields:cL(),partFields:fL(),factory:dL,apis:{repositionMenus:function(t,e){return t.repositionMenus(e)}}}),gL=function(t){return{isDisabled:function(){return cS.isDisabled(t)},setDisabled:function(e){return cS.set(t,e)}}},hL=function(t){return{setActive:function(e){Uy.set(t,e)},isActive:function(){return Uy.isOn(t)},isDisabled:function(){return cS.isDisabled(t)},setDisabled:function(e){return cS.set(t,e)}}},pL=function(t,e){return t.map((function(t){return{"aria-label":e.translate(t),title:e.translate(t)}})).getOr({})},vL=Cu("focus-button"),bL=["checklist","ordered-list"],yL=["indent","outdent","table-insert-column-after","table-insert-column-before","unordered-list"],wL=function(t,e,n,r,o,i){var u,a=function(t){return jC.isRtl()&&U(bL,t)?t+"-rtl":t},c=jC.isRtl()&&t.exists((function(t){return U(yL,t)}));return{dom:{tag:"button",classes:["tox-tbtn"].concat(e.isSome()?["tox-tbtn--select"]:[]).concat(c?["tox-tbtn__icon-rtl"]:[]),attributes:pL(n,i)},components:sk([t.map((function(t){return dM(a(t),i.icons)})),e.map((function(t){return gM(t,"tox-tbtn",i)}))]),eventOrder:(u={},u[wo()]=["focusing","alloy.base.behaviour","common-button-display-events"],u),buttonBehaviours:Al([rk.toolbarButton(i.isReadOnly),QS(),gy("common-button-display-events",[pi(wo(),(function(t,e){e.event().prevent(),ui(t,vL)}))])].concat(r.map((function(n){return aL.config({channel:n,initialData:{icon:t,text:e},renderComponents:function(t,e){return sk([t.icon.map((function(t){return dM(a(t),i.icons)})),t.text.map((function(t){return gM(t,"tox-tbtn",i)}))])}})})).toArray()).concat(o.getOr([])))}},xL=function(t,e,n,r){var o=e.shared;return IH.sketch({lazySink:o.getSink,fetch:function(){return HE.nu((function(e){e($(n(t.items),OI))}))},markers:{toggledClass:"tox-tbtn--enabled"},parts:{button:wL(t.icon,t.text,t.tooltip,C.none(),C.none(),o.providers),toolbar:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:r}}}})},CL=function(t,e,r){var o=Gn(n),i=wL(t.icon,t.text,t.tooltip,C.none(),C.none(),r);return Uw.sketch({dom:i.dom,components:i.components,eventOrder:vM,buttonBehaviours:Al([gy("toolbar-button-events",[pM({onAction:t.onAction,getApi:e.getApi}),ik(e,o),uk(e,o)]),rk.toolbarButton((function(){return t.disabled||r.isReadOnly()})),QS()].concat(e.toolbarButtonBehaviours))})},SL=function(t,e){return kL(t,e,[])},kL=function(t,e,n){return CL(t,{toolbarButtonBehaviours:[].concat(n.length>0?[gy("toolbarButtonWith",n)]:[]),getApi:gL,onSetup:t.onSetup},e)},OL=function(t,e){return TL(t,e,[])},TL=function(t,e,n){return Kt(CL(t,{toolbarButtonBehaviours:[dy.config({}),Uy.config({toggleClass:"tox-tbtn--enabled",aria:{mode:"pressed"},toggleOnExecute:!1})].concat(n.length>0?[gy("toolbarToggleButtonWith",n)]:[]),getApi:hL,onSetup:t.onSetup},e))},EL=function(t,e,n){return function(r){return HE.nu((function(t){return e.fetch(t)})).map((function(o){return C.from(fT(Kt(jO(Cu("menu-value"),o,(function(n){e.onItemAction(t(r),n)}),e.columns,e.presets,Hx.CLOSE_ON_EXECUTE,e.select.getOr((function(){return!1})),n),{movement:qO(e.columns,e.presets),menuBehaviours:AC.unnamedEvents("auto"!==e.columns?[]:[Ti((function(t,n){TC(t,4,Jx(e.presets)).each((function(e){var n=e.numRows,r=e.numColumns;ny.setGridSize(t,n,r)}))}))])})))}))}},_L=function(t,e){var r,o=Cu("channel-update-split-dropdown-display"),i=function(t){return{isDisabled:function(){return cS.isDisabled(t)},setDisabled:function(e){return cS.set(t,e)},setIconFill:function(e,n){as(t.element(),'svg path[id="'+e+'"], rect[id="'+e+'"]').each((function(t){cu(t,"fill",n)}))},setIconStroke:function(e,n){as(t.element(),'svg path[id="'+e+'"], rect[id="'+e+'"]').each((function(t){cu(t,"stroke",n)}))},setActive:function(e){cu(t.element(),"aria-pressed",e),as(t.element(),"span").each((function(n){t.getSystem().getByDom(n).each((function(t){return Uy.set(t,e)}))}))},isActive:function(){return as(t.element(),"span").exists((function(e){return t.getSystem().getByDom(e).exists(Uy.isOn)}))}}},u=Gn(n),a={getApi:i,onSetup:t.onSetup};return mL.sketch({dom:{tag:"div",classes:["tox-split-button"],attributes:g({"aria-pressed":!1},pL(t.tooltip,e.providers))},onExecute:function(e){t.onAction(i(e))},onItemExecute:function(t,e,n){},splitDropdownBehaviours:Al([rk.splitButton(e.providers.isReadOnly),QS(),gy("split-dropdown-events",[pi(vL,Sy.focus),ik(a,u),uk(a,u)]),S_.config({})]),eventOrder:(r={},r[Yo()]=["alloy.base.behaviour","split-dropdown-events"],r),toggleClass:"tox-tbtn--enabled",lazySink:e.getSink,fetch:EL(i,t,e.providers),parts:{menu:rC(!1,t.columns,t.presets)},components:[mL.parts().button(wL(t.icon,t.text,C.none(),C.some(o),C.some([Uy.config({toggleClass:"tox-tbtn--enabled",toggleOnExecute:!1})]),e.providers)),mL.parts().arrow({dom:{tag:"button",classes:["tox-tbtn","tox-split-button__chevron"],innerHtml:qw("chevron-down",e.providers.icons)},buttonBehaviours:Al([rk.splitButton(e.providers.isReadOnly),QS()])}),mL.parts()["aria-descriptor"]({text:e.providers.translate("To open the popup, press Shift+Enter")})]})},AL=function(t){return{hide:function(){return ui(t,jo())},getValue:function(){return Vg.getValue(t)}}},DL=function(t,e){return pi(hM,(function(n,r){var o=t.get(n),i=AL(o);e.onAction(i,r.event().buttonApi())}))},NL=function(t,e,n){var r=e.original,o=(r.primary,h(r,["primary"])),i=nn(MI(g(g({},o),{type:"button",onAction:function(){}})));return kL(i,n.backstage.shared.providers,[DL(t,e)])},RL=function(t,e,n){var r=e.original,o=(r.primary,h(r,["primary"])),i=nn(VI(g(g({},o),{type:"togglebutton",onAction:function(){}})));return TL(i,n.backstage.shared.providers,[DL(t,e)])},ML=function(t,e,n){var r={backstage:{shared:{providers:n}}};return"contextformtogglebutton"===e.type?RL(t,e,r):NL(t,e,r)},zL=function(t,e,n){var r=$(e,(function(e){return jw(ML(t,e,n))})),o=function(){return $(r,(function(t){return t.asSpec()}))},i=function(t){return dt(e,(function(e,n){return e.primary?C.from(r[n]).bind((function(e){return e.getOpt(t)})).filter(s(cS.isDisabled)):C.none()}))};return{asSpecs:o,findPrimary:i}},BL=function(t,e){var n=t.label.fold((function(){return{}}),(function(t){return{"aria-label":t}})),r=jw(OE.sketch({inputClasses:["tox-toolbar-textfield","tox-toolbar-nav-js"],data:t.initValue(),inputAttributes:n,selectOnFocus:!0,inputBehaviours:Al([ny.config({mode:"special",onEnter:function(t){return o.findPrimary(t).map((function(t){return ci(t),!0}))},onLeft:function(t,e){return e.cut(),C.none()},onRight:function(t,e){return e.cut(),C.none()}})])})),o=zL(r,t.commands,e);return[{title:C.none(),items:[r.asSpec()]},{title:C.none(),items:o.asSpecs()}]},PL=function(t,e,n){return DI({type:t,uid:Cu("context-toolbar"),initGroups:BL(e,n),onEscape:C.none,cyclicKeying:!0,providers:n})},HL={renderContextForm:PL,buildInitGroups:BL},IL=function(t,e){var n=Math.max(e.x,t.x),r=t.right-n,o=e.width-(n-e.x),i=Math.min(r,o);return{x:n,width:i}},LL=function(t,e,n,r){var o=Zn.fromDom(t.getContainer()),i=as(o,".tox-editor-header").getOr(o),u=Jc(i),a=u.y>=e.bottom,c=r&&!a;if(t.inline&&c)return{y:Math.max(u.bottom,n.y),bottom:n.bottom};if(t.inline&&!c)return{y:n.y,bottom:Math.min(u.y,n.bottom)};var s=Jc(o);return c?{y:Math.max(u.bottom,n.y),bottom:Math.min(s.bottom,n.bottom)}:{y:Math.max(s.y,n.y),bottom:Math.min(u.y,n.bottom)}},FL=function(t,n){var r=Vc(e.window),o=Jc(Zn.fromDom(t.getContentAreaContainer())),i=CS(t)||SS(t)||OS(t),u=IL(o,r),a=u.x,c=u.width;if(t.inline&&!i)return Yc(a,r.y,c,r.height);var s=n.header.isPositionedAtTop(),l=LL(t,o,r,s),f=l.y,d=l.bottom;return Yc(a,f,c,d-f)},VL=function(t,e){var n=Y(e,(function(e){return e.predicate(t.dom())})),r=X(n,(function(t){return"contexttoolbar"===t.type})),o=r.pass,i=r.fail;return{contextToolbars:o,contextForms:i}},UL=function(t){if(t.length<=1)return t;var e=function(e){return j(t,(function(t){return t.position===e}))},n=function(e){return Y(t,(function(t){return t.position===e}))},r=e("selection"),o=e("node");if(r||o){if(o&&r){var i=n("node"),u=$(n("selection"),(function(t){return g(g({},t),{position:"node"})}));return i.concat(u)}return n(r?"selection":"node")}return n("line")},jL=function(t){if(t.length<=1)return t;var e=function(e){return tt(t,(function(t){return t.position===e}))},n=e("selection").orThunk((function(){return e("node")})).orThunk((function(){return e("line")})).map((function(t){return t.position}));return n.fold((function(){return[]}),(function(e){return Y(t,(function(t){return t.position===e}))}))},WL=function(t,e,n){var r=VL(t,e);if(r.contextForms.length>0)return C.some({elem:t,toolbars:[r.contextForms[0]]});var o=VL(t,n);if(o.contextForms.length>0)return C.some({elem:t,toolbars:[o.contextForms[0]]});if(r.contextToolbars.length>0||o.contextToolbars.length>0){var i=UL(r.contextToolbars.concat(o.contextToolbars));return C.some({elem:t,toolbars:i})}return C.none()},qL=function(t,e,n){return t(e)?C.none():ao(e,(function(t){var e=VL(t,n.inNodeScope),r=e.contextToolbars,o=e.contextForms,i=o.length>0?o:jL(r);return i.length>0?C.some({elem:t,toolbars:i}):C.none()}),t)},$L=function(t,e){var n=Zn.fromDom(e.getBody()),r=function(t){return no(t,n)},o=function(t){return!r(t)&&!io(n,t)},i=Zn.fromDom(e.selection.getNode());return o(i)?C.none():WL(i,t.inNodeScope,t.inEditorScope).orThunk((function(){return qL(r,i,t)}))},GL=function(t,e){var n={},r=[],o=[],i={},u={},a=function(t,a){var c=nn(ZI(a));n[t]=c,c.launch.map((function(n){i["form:"+t]=g(g({},a.launch),{type:"contextformtogglebutton"===n.type?"togglebutton":"button",onAction:function(){e(c)}})})),"editor"===c.scope?o.push(c):r.push(c),u[t]=c},c=function(t,e){QI(e).each((function(n){"editor"===e.scope?o.push(n):r.push(n),u[t]=n}))},s=_t(t);return G(s,(function(e){var n=t[e];"contextform"===n.type?a(e,n):"contexttoolbar"===n.type&&c(e,n)})),{forms:n,inNodeScope:r,inEditorScope:o,lookupTable:u,formNavigators:i}},KL=Cu("forward-slide"),XL=Cu("backward-slide"),YL=Cu("change-slide-event"),JL="tox-pop--resizing",QL=function(t){var e=Gn([]);return _w.sketch({dom:{tag:"div",classes:["tox-pop"]},fireDismissalEventInstead:{event:"doNotDismissYet"},onShow:function(t){e.set([]),_w.getContent(t).each((function(t){Ya(t.element(),"visibility")})),Sa(t.element(),JL),Ya(t.element(),"width")},inlineBehaviours:Al([gy("context-toolbar-events",[Oi(Ro(),(function(t,e){Sa(t.element(),JL),Ya(t.element(),"width")})),pi(YL,(function(t,e){Ya(t.element(),"width");var n=Ec(t.element());_w.setContent(t,e.event().contents()),xa(t.element(),JL);var r=Ec(t.element());Ua(t.element(),"width",n+"px"),_w.getContent(t).each((function(n){e.event().focus().bind((function(e){return jl(e),Gl(t.element())})).orThunk((function(){return ny.focusIn(n),$l()}))})),Fw.setTimeout((function(){Ua(t.element(),"width",r+"px")}),0)})),pi(KL,(function(t,n){_w.getContent(t).each((function(t){e.set(e.get().concat([{bar:t,focus:$l()}]))})),ai(t,YL,{contents:n.event().forwardContents(),focus:C.none()})})),pi(XL,(function(t,n){lt(e.get()).each((function(n){e.set(e.get().slice(0,e.get().length-1)),ai(t,YL,{contents:mc(n.bar),focus:n.focus})}))}))]),ny.config({mode:"special",onEscape:function(n){return lt(e.get()).fold((function(){return t.onEscape()}),(function(t){return ui(n,XL),C.some(!0)}))}})]),lazySink:function(){return pt.value(t.sink)}})},ZL=function(t,e,n){var r=function(t,r,i,u){var a=e.shared.providers.translate(t.title);if("separator"===t.type)return C.some({type:"separator",text:a});if("submenu"===t.type){var c=rt(t.getStyleItems(),(function(t){return o(t,r,u)}));return 0===r&&c.length<=0?C.none():C.some({type:"nestedmenuitem",text:a,disabled:c.length<=0,getSubmenuItems:function(){return rt(t.getStyleItems(),(function(t){return o(t,r,u)}))}})}return C.some(g({type:"togglemenuitem",text:a,icon:t.icon,active:t.isSelected(u),disabled:i,onAction:n.onAction(t)},t.getStylePreview().fold((function(){return{}}),(function(t){return{meta:{style:t}}}))))},o=function(t,e,o){var i="formatter"===t.type&&n.isInvalid(t);return 0===e?i?[]:r(t,e,!1,o).toArray():r(t,e,i,o).toArray()},i=function(t){var e=n.getCurrentValue(),r=n.shouldHide?0:1;return rt(t,(function(t){return o(t,r,e)}))},u=function(t,e){return function(n){var r=e(),o=i(r),u=DM(o,Hx.CLOSE_ON_EXECUTE,t,!1);n(u)}};return{validateItems:i,getFetch:u}},tF=function(t,e,n){var r=n.dataset,o="basic"===r.type?function(){return $(r.data,(function(t){return mP(t,n.isSelectedFor,n.getPreviewFor)}))}:r.getData;return{items:ZL(t,e,n),getStyleItems:o}},eF=function(t,e,r){var o=tF(t,e,r),i=o.items,u=o.getStyleItems,a=function(t){return{getComponent:function(){return t}}},c=function(e){return r.setInitialValue.each((function(t){return t(e.getComponent())})),r.nodeChangeHandler.map((function(n){var r=n(e.getComponent());return t.on("NodeChange",r),function(){t.off("NodeChange",r)}})).getOr(n)};return wM({text:r.icon.isSome()?C.none():C.some(""),icon:r.icon,tooltip:C.from(r.tooltip),role:C.none(),fetch:i.getFetch(e,u),onSetup:c,getApi:a,columns:1,presets:"normal",classes:r.icon.isSome()?[]:["bespoke"],dropdownBehaviours:[]},"tox-tbtn",e.shared)},nF=function(t){return $(t,(function(t){var e=t,n=t,r=t.split("=");return r.length>1&&(e=r[0],n=r[1]),{title:e,format:n}}))},rF=function(t){return{type:"basic",data:t}};(function(t){t[t["SemiColon"]=0]="SemiColon",t[t["Space"]=1]="Space"})(Bz||(Bz={}));var oF,iF=function(t,e){return e===Bz.SemiColon?t.replace(/;$/,"").split(";"):t.split(" ")},uF=function(t,e,n,r){var o=t.getParam(e,n,"string"),i=nF(iF(o,r));return{type:"basic",data:i}},aF=[{title:"Left",icon:"align-left",format:"alignleft",command:"JustifyLeft"},{title:"Center",icon:"align-center",format:"aligncenter",command:"JustifyCenter"},{title:"Right",icon:"align-right",format:"alignright",command:"JustifyRight"},{title:"Justify",icon:"align-justify",format:"alignjustify",command:"JustifyFull"}],cF=function(t){var e=function(){return tt(aF,(function(e){return t.formatter.match(e.format)}))},n=function(e){return function(){return t.formatter.match(e)}},r=function(t){return function(){return C.none()}},o=function(t){var n=e(),r=n.fold((function(){return"left"}),(function(t){return t.title.toLowerCase()}));ai(t,yM,{icon:"align-"+r})},i=C.some((function(t){return function(){return o(t)}})),a=C.some((function(t){return o(t)})),c=rF(aF),s=function(e){return function(){return tt(aF,(function(t){return t.format===e.format})).each((function(e){return t.execCommand(e.command)}))}};return{tooltip:"Align",icon:C.some("align-left"),isSelectedFor:n,getCurrentValue:u(C.none()),getPreviewFor:r,onAction:s,setInitialValue:a,nodeChangeHandler:i,dataset:c,shouldHide:!1,isInvalid:function(e){return!t.formatter.canApply(e.format)}}},sF=function(t,e){return eF(t,e,cF(t))},lF=function(t,e){var n=tF(t,e,cF(t));t.ui.registry.addNestedMenuItem("align",{text:e.shared.providers.translate("Align"),getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})},fF="Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats",dF=["-apple-system","Segoe UI","Roboto","Helvetica Neue","sans-serif"],mF=function(t){var e=t.split(/\s*,\s*/);return $(e,(function(t){return t.replace(/^['"]+|['"]+$/g,"")}))},gF=function(t){var e=function(){var e=mF(t.toLowerCase());return ot(dF,(function(t){return e.indexOf(t.toLowerCase())>-1}))};return 0===t.indexOf("-apple-system")&&e()},hF=function(t){var e=function(){var e=function(t){return t?mF(t)[0]:""},n=t.queryCommandValue("FontName"),r=s.data,o=n?n.toLowerCase():"",i=tt(r,(function(t){var n=t.format;return n.toLowerCase()===o||e(n).toLowerCase()===e(o).toLowerCase()})).orThunk((function(){return gF(o)?C.from({title:"System Font",format:o}):C.none()}));return{matchOpt:i,font:n}},n=function(t){return function(e){return e.exists((function(e){return e.format===t}))}},r=function(){var t=e().matchOpt;return t},o=function(t){return function(){return C.some({tag:"div",styles:-1===t.indexOf("dings")?{"font-family":t}:{}})}},i=function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("FontName",!1,e.format)}))}},u=function(t){var n=e(),r=n.matchOpt,o=n.font,i=r.fold((function(){return o}),(function(t){return t.title}));ai(t,bM,{text:i})},a=C.some((function(t){return function(){return u(t)}})),c=C.some((function(t){return u(t)})),s=uF(t,"font_formats",fF,Bz.SemiColon);return{tooltip:"Fonts",icon:C.none(),isSelectedFor:n,getCurrentValue:r,getPreviewFor:o,onAction:i,setInitialValue:c,nodeChangeHandler:a,dataset:s,shouldHide:!1,isInvalid:function(){return!1}}},pF=function(t,e){return eF(t,e,hF(t))},vF=function(t,e){var n=tF(t,e,hF(t));t.ui.registry.addNestedMenuItem("fontformats",{text:e.shared.providers.translate("Fonts"),getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})},bF="8pt 10pt 12pt 14pt 18pt 24pt 36pt",yF={"8pt":"1","10pt":"2","12pt":"3","14pt":"4","18pt":"5","24pt":"6","36pt":"7"},wF=function(t,e){var n=Math.pow(10,e);return Math.round(t*n)/n},xF=function(t,e){return/[0-9.]+px$/.test(t)?wF(72*parseInt(t,10)/96,e||0)+"pt":t},CF=function(t){return Lt(yF,t).getOr("")},SF=function(t){var e=function(){var e=C.none(),n=l.data,r=t.queryCommandValue("FontSize");if(r)for(var o=function(t){var o=xF(r,t),i=CF(o);e=tt(n,(function(t){return t.format===r||t.format===o||t.format===i}))},i=3;e.isNone()&&i>=0;i--)o(i);return{matchOpt:e,size:r}},n=function(t){return function(e){return e.exists((function(e){return e.format===t}))}},r=function(){var t=e().matchOpt;return t},o=u(u(C.none())),i=function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("FontSize",!1,e.format)}))}},a=function(t){var n=e(),r=n.matchOpt,o=n.size,i=r.fold((function(){return o}),(function(t){return t.title}));ai(t,bM,{text:i})},c=C.some((function(t){return function(){return a(t)}})),s=C.some((function(t){return a(t)})),l=uF(t,"fontsize_formats",bF,Bz.Space);return{tooltip:"Font sizes",icon:C.none(),isSelectedFor:n,getPreviewFor:o,getCurrentValue:r,onAction:i,setInitialValue:s,nodeChangeHandler:c,dataset:l,shouldHide:!1,isInvalid:function(){return!1}}},kF=function(t,e){return eF(t,e,SF(t))},OF=function(t,e){var n=tF(t,e,SF(t));t.ui.registry.addNestedMenuItem("fontsizes",{text:"Font sizes",getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})},TF=function(t,e,n){var r=e();return dt(n,(function(e){return tt(r,(function(n){return t.formatter.matchNode(e,n.format)}))})).orThunk((function(){return t.formatter.match("p")?C.some({title:"Paragraph",format:"p"}):C.none()}))},EF=function(t){var e=t.selection.getStart(!0)||t.getBody();return t.dom.getParents(e,(function(){return!0}),t.getBody())},_F=function(t,e){return function(n){var r=Gn(C.none()),o=function(){n.setActive(t.formatter.match(e));var o=t.formatter.formatChanged(e,n.setActive).unbind;r.set(C.some(o))};return t.initialized?o():t.on("init",o),function(){return r.get().each((function(t){return t()}))}}},AF=function(t){return function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("mceToggleFormat",!1,e.format)}))}}},DF="Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre",NF=function(t){var e=function(e){return TF(t,(function(){return c.data}),e)},n=function(e){return function(){return t.formatter.match(e)}},r=function(e){return function(){var n=t.formatter.get(e);return C.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))})}},o=function(t,n){var r=e(t),o=r.fold((function(){return"Paragraph"}),(function(t){return t.title}));ai(n,bM,{text:o})},i=C.some((function(t){return function(e){return o(e.parents,t)}})),a=C.some((function(e){var n=EF(t);o(n,e)})),c=uF(t,"block_formats",DF,Bz.SemiColon);return{tooltip:"Blocks",icon:C.none(),isSelectedFor:n,getCurrentValue:u(C.none()),getPreviewFor:r,onAction:AF(t),setInitialValue:a,nodeChangeHandler:i,dataset:c,shouldHide:!1,isInvalid:function(e){return!t.formatter.canApply(e.format)}}},RF=function(t,e){return eF(t,e,NF(t))},MF=function(t,e){var n=tF(t,e,NF(t));t.ui.registry.addNestedMenuItem("blockformats",{text:"Blocks",getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})},zF=function(t,e){var n=function(e){return function(){return t.formatter.match(e)}},r=function(e){return function(){var n=t.formatter.get(e);return void 0!==n?C.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))}):C.none()}},o=function(e,n){var r=function(t){var e=t.items;return void 0!==e&&e.length>0?rt(e,r):[{title:t.title,format:t.format}]},o=rt(dP(t),r),i=TF(t,(function(){return o}),e),u=i.fold((function(){return"Paragraph"}),(function(t){return t.title}));ai(n,bM,{text:u})},i=C.some((function(t){return function(e){return o(e.parents,t)}})),a=C.some((function(e){var n=EF(t);o(n,e)}));return{tooltip:"Formats",icon:C.none(),isSelectedFor:n,getCurrentValue:u(C.none()),getPreviewFor:r,onAction:AF(t),setInitialValue:a,nodeChangeHandler:i,shouldHide:t.getParam("style_formats_autohide",!1,"boolean"),isInvalid:function(e){return!t.formatter.canApply(e.format)},dataset:e}},BF=function(t,e){var n=g({type:"advanced"},e.styleselect);return eF(t,e,zF(t,n))},PF=function(t,e){var n=g({type:"advanced"},e.styleselect),r=tF(t,e,zF(t,n));t.ui.registry.addNestedMenuItem("formats",{text:"Formats",getSubmenuItems:function(){return r.items.validateItems(r.getStyleItems())}})},HF=[{name:"history",items:["undo","redo"]},{name:"styles",items:["styleselect"]},{name:"formatting",items:["bold","italic"]},{name:"alignment",items:["alignleft","aligncenter","alignright","alignjustify"]},{name:"indentation",items:["outdent","indent"]},{name:"permanent pen",items:["permanentpen"]},{name:"comments",items:["addcomment"]}],IF=function(t,e){return function(n,r,o){var i=t(n).mapError((function(t){return on(t)})).getOrDie();return e(i,r,o)}},LF={button:IF(MI,(function(t,e){return SL(t,e.backstage.shared.providers)})),togglebutton:IF(VI,(function(t,e){return OL(t,e.backstage.shared.providers)})),menubutton:IF(PI,(function(t,e){return RM(t,"tox-tbtn",e.backstage,C.none())})),splitbutton:IF(II,(function(t,e){return _L(t,e.backstage.shared)})),grouptoolbarbutton:IF(jI,(function(t,e,n){var r,o=n.ui.registry.getAll().buttons,i=function(t){return GF(n,{buttons:o,toolbar:t,allowToolbarGroups:!1},e,C.none())},u=(r={},r[Mf]=e.backstage.shared.header.isPositionedAtTop()?gs.TopToBottom:gs.BottomToTop,r);switch(ES(n)){case Px.floating:return xL(t,e.backstage,i,u);default:throw new Error("Toolbar groups are only supported when using floating toolbar mode")}})),styleSelectButton:function(t,e){return BF(t,e.backstage)},fontsizeSelectButton:function(t,e){return kF(t,e.backstage)},fontSelectButton:function(t,e){return pF(t,e.backstage)},formatButton:function(t,e){return RF(t,e.backstage)},alignMenuButton:function(t,e){return sF(t,e.backstage)}},FF=function(t,n,r){return Lt(LF,t.type).fold((function(){return e.console.error("skipping button defined by",t),C.none()}),(function(e){return C.some(e(t,n,r))}))},VF={styleselect:LF.styleSelectButton,fontsizeselect:LF.fontsizeSelectButton,fontselect:LF.fontSelectButton,formatselect:LF.formatButton,align:LF.alignMenuButton},UF=function(t){var e=$(HF,(function(e){var n=Y(e.items,(function(e){return Ft(t,e)||Ft(VF,e)}));return{name:e.name,items:n}}));return Y(e,(function(t){return t.items.length>0}))},jF=function(t){var e=t.split("|");return $(e,(function(t){return{items:t.trim().split(" ")}}))},WF=function(t){return P(t,(function(t){return Ft(t,"name")&&Ft(t,"items")}))},qF=function(t){var n=t.toolbar,r=t.buttons;return!1===n?[]:void 0===n||!0===n?UF(r):E(n)?jF(n):WF(n)?n:(e.console.error("Toolbar type should be string, string[], boolean or ToolbarGroup[]"),[])},$F=function(t,n,r,o,i,u){return Lt(n,r.toLowerCase()).orThunk((function(){return u.bind((function(t){return dt(t,(function(t){return Lt(n,t+r.toLowerCase())}))}))})).fold((function(){return Lt(VF,r.toLowerCase()).map((function(e){return e(t,i)})).orThunk((function(){return C.none()}))}),(function(n){return"grouptoolbarbutton"!==n.type||o?FF(n,i,t):(e.console.warn("Ignoring the '"+r+"' toolbar button. Group toolbar buttons are only supported when using floating toolbar mode and cannot be nested."),C.none())}))},GF=function(t,e,n,r){var o=qF(e),i=$(o,(function(o){var i=rt(o.items,(function(o){return 0===o.trim().length?[]:$F(t,e.buttons,o,e.allowToolbarGroups,n,r).toArray()}));return{title:C.from(t.translate(o.name)),items:i}}));return Y(i,(function(t){return t.items.length>0}))},KF=12,XF={valignCentre:[],alignCentre:[],alignLeft:["tox-pop--align-left"],alignRight:["tox-pop--align-right"],right:["tox-pop--right"],left:["tox-pop--left"],bottom:["tox-pop--bottom"],top:["tox-pop--top"]},YF={maxHeightFunction:Sf(),maxWidthFunction:oH()},JF={onLtr:function(){return[dl,ml,ll,cl,fl,sl,Iw,Lw,Pw,zw,Hw,Bw]},onRtl:function(){return[dl,ml,fl,sl,ll,cl,Iw,Lw,Hw,Bw,Pw,zw]}},QF={onLtr:function(){return[ml,cl,sl,ll,fl,dl,Iw,Lw,Pw,zw,Hw,Bw]},onRtl:function(){return[ml,sl,cl,fl,ll,dl,Iw,Lw,Hw,Bw,Pw,zw]}},ZF=function(t,e){return"line"===t?{bubble:_f(KF,0,XF),layouts:{onLtr:function(){return[gl]},onRtl:function(){return[hl]}},overrides:YF}:{bubble:_f(0,KF,XF),layouts:e?QF:JF,overrides:YF}},tV=function(t,e,n,r){var o=Gr().deviceType.isTouch,i=dc(QL({sink:n,onEscape:function(){return t.focus(),C.some(!0)}})),u=function(){return FL(t,r.backstage.shared)},a=function(t,e,n,r){return Math.max(t,n)<=Math.min(e,r)},c=function(){var e=m.get().map((function(t){return t.getBoundingClientRect()})).getOrThunk((function(){return t.selection.getRng().getBoundingClientRect()})),n=t.inline?Hc().top():Qc(Zn.fromDom(t.getBody())).y;return{y:e.top+n,bottom:e.bottom+n}},s=function(){if(o()&&r.backstage.isContextMenuOpen())return!0;var t=c(),e=u();return!a(t.y,t.bottom,e.y,e.bottom)},l=function(){_w.hide(i)},f=function(){d.get().each((function(t){var e=i.element();Ya(e,"display"),s()?Ua(e,"display","none"):Om.positionWithinBounds(n,t,i,C.some(u()))}))},d=Gn(C.none()),m=Gn(C.none()),h=Gn(null),p=function(e){return{dom:{tag:"div",classes:["tox-pop__dialog"]},components:[e],behaviours:Al([ny.config({mode:"acyclic"}),gy("pop-dialog-wrap-events",[Ti((function(e){t.shortcuts.add("ctrl+F9","focus statusbar",(function(){return ny.focusIn(e)}))})),Ei((function(e){t.shortcuts.remove("ctrl+F9")}))])])}},v=Yt((function(){return GL(e,(function(t){var e=w([t]);ai(i,KL,{forwardContents:p(e)})}))})),b=function(e,n){return GF(t,{buttons:e,toolbar:n.items,allowToolbarGroups:!1},r,C.some(["form:"]))},y=function(t,e){return HL.buildInitGroups(t,e)},w=function(e){var n=t.ui.registry.getAll().buttons,o=v(),i=g(g({},n),o.formNavigators),u=ES(t)===Px.scrolling?Px.scrolling:Px.default,a=nt($(e,(function(t){return"contexttoolbar"===t.type?b(i,t):y(t,r.backstage.shared.providers)})));return DI({type:u,uid:Cu("context-toolbar"),initGroups:a,onEscape:C.none,cyclicKeying:!0,providers:r.backstage.shared.providers})};t.on(iH,(function(e){var n=v();Lt(n.lookupTable,e.toolbarKey).each((function(n){S([n],e.target===t?C.none():C.some(e)),_w.getContent(i).each(ny.focusIn)}))}));var x=function(t,e){var n="node"===t?r.backstage.shared.anchors.node(e):r.backstage.shared.anchors.cursor();return Kt(n,ZF(t,o()))},S=function(t,e){if(O(),!o()||!r.backstage.isContextMenuOpen()){var n=w(t),a=e.map(Zn.fromDom),c=x(t[0].position,a);d.set(C.some(c)),m.set(e);var l=i.element();Ya(l,"display"),_w.showWithinBounds(i,c,p(n),(function(){return C.some(u())})),s()&&Ua(l,"display","none")}},k=function(){if(t.hasFocus()){var e=v();$L(e,t).fold((function(){d.set(C.none()),_w.hide(i)}),(function(t){S(t.toolbars,C.some(t.elem.dom()))}))}},O=function(){var t=h.get();null!==t&&(Fw.clearTimeout(t),h.set(null))},T=function(t){O(),h.set(t)};t.on("init",(function(){t.on(uH,l),t.on("ScrollContent ScrollWindow longpress",f),t.on("click keyup focus SetContent ObjectResized ResizeEditor",(function(){T(Fw.setEditorTimeout(t,k,0))})),t.on("focusout",(function(e){Fw.setEditorTimeout(t,(function(){Gl(n.element()).isNone()&&Gl(i.element()).isNone()&&(d.set(C.none()),_w.hide(i))}),0)})),t.on("SwitchMode",(function(){t.mode.isReadOnly()&&(d.set(C.none()),_w.hide(i))})),t.on("NodeChange",(function(e){Gl(i.element()).fold((function(){T(Fw.setEditorTimeout(t,k,0))}),(function(t){}))}))}))},eV=function(t,n,r){var o=function(t,e){G([n,r],(function(n){n.broadcastEvent(t,e)}))},i=function(t,e){G([n,r],(function(n){n.broadcastOn([t],e)}))},u=function(t){return i(ug(),{target:t.target()})},a=pT(Zn.fromDom(e.document),"touchstart",u),c=pT(Zn.fromDom(e.document),"touchmove",(function(t){return o($o(),t)})),s=pT(Zn.fromDom(e.document),"touchend",(function(t){return o(Go(),t)})),l=pT(Zn.fromDom(e.document),"mousedown",u),f=pT(Zn.fromDom(e.document),"mouseup",(function(t){0===t.raw().button&&i(cg(),{target:t.target()})})),d=function(t){return i(ug(),{target:Zn.fromDom(t.target)})},m=function(t){0===t.button&&i(cg(),{target:Zn.fromDom(t.target)})},g=function(t){return o(Ko(),bT(t))},h=function(t){i(ag(),{}),o(Xo(),bT(t))},p=function(){return i(ag(),{})};t.on("PostRender",(function(){t.on("click",d),t.on("tap",d),t.on("mouseup",m),t.on("ScrollWindow",g),t.on("ResizeWindow",h),t.on("ResizeEditor",p)})),t.on("remove",(function(){t.off("click",d),t.off("tap",d),t.off("mouseup",m),t.off("ScrollWindow",g),t.off("ResizeWindow",h),t.off("ResizeEditor",p),l.unbind(),a.unbind(),c.unbind(),s.unbind(),f.unbind()})),t.on("detach",(function(){Lm(n),Lm(r),n.destroy(),r.destroy()}))},nV=jh,rV=Oh,oV=u([Pn("shell",!1),vn("makeItem"),Pn("setupItem",n),qg.field("listBehaviours",[dy])]),iV=function(){return{behaviours:Al([dy.config({})])}},uV=Ch({name:"items",overrides:iV}),aV=u([uV]),cV=u("CustomList"),sV=function(t,n,r,o){var i=function(n,r){a(n).fold((function(){throw e.console.error("Custom List was defined to not be a shell, but no item container was specified in components"),new Error("Custom List was defined to not be a shell, but no item container was specified in components")}),(function(e){var o=dy.contents(e),i=r.length,u=i-o.length,a=u>0?W(u,(function(){return t.makeItem()})):[],c=o.slice(i);G(c,(function(t){return dy.remove(e,t)})),G(a,(function(t){return dy.append(e,t)}));var s=dy.contents(e);G(s,(function(e,o){t.setupItem(n,e,r[o],o)}))}))},u=t.shell?{behaviours:[dy.config({})],components:[]}:{behaviours:[],components:n},a=function(e){return t.shell?C.some(e):Bh(e,t,"items")};return{uid:t.uid,dom:t.dom,components:u.components,behaviours:Wg(t.listBehaviours,u.behaviours),apis:{setItems:i}}},lV=ep({name:cV(),configFields:oV(),partFields:aV(),factory:sV,apis:{setItems:function(t,e,n){t.setItems(e,n)}}}),fV=function(t){var e=Ga(t,"position").is("fixed"),n=e?C.none():Ui(t);return n.orThunk((function(){var e=Zn.fromTag("span");return Vi(t).bind((function(t){Yi(t,e);var n=Ui(e);return eu(e),n}))}))},dV=function(t){return fV(t).map(Sc).getOrThunk((function(){return wc(0,0)}))},mV=jt.generate([{static:[]},{absolute:["positionCss"]},{fixed:["positionCss"]}]),gV=function(t,e){var n=t.element();xa(n,e.transitionClass),Sa(n,e.fadeOutClass),xa(n,e.fadeInClass),e.onShow(t)},hV=function(t,e){var n=t.element();xa(n,e.transitionClass),Sa(n,e.fadeInClass),xa(n,e.fadeOutClass),e.onHide(t)},pV=function(t,e){return t.y<e.bottom&&t.bottom>e.y},vV=function(t,e){return t.y>=e.y},bV=function(t,e){return t.bottom<=e.bottom},yV=function(t,e,n){return ot(t,(function(t){switch(t){case"bottom":return bV(e,n);case"top":return vV(e,n)}}))},wV=function(t,e){return e.getInitialPosition().map((function(e){return Yc(e.bounds.x,e.bounds.y,Ec(t),pc(t))}))},xV=function(t,e,n){n.setInitialPosition(C.some({style:Ka(t),position:qa(t,"position")||"static",bounds:e}))},CV=function(t,e,n){return n.getInitialPosition().bind((function(r){switch(n.setInitialPosition(C.none()),r.position){case"static":return C.some(mV.static());case"absolute":var o=fV(t).map(Jc).getOrThunk((function(){return Jc(Ia())}));return C.some(mV.absolute(Xl("absolute",Lt(r.style,"left").map((function(t){return e.x-o.x})),Lt(r.style,"top").map((function(t){return e.y-o.y})),Lt(r.style,"right").map((function(t){return o.right-e.right})),Lt(r.style,"bottom").map((function(t){return o.bottom-e.bottom})))));default:return C.none()}}))},SV=function(t,e,n){return wV(t,n).filter((function(t){return yV(n.getModes(),t,e)})).bind((function(e){return CV(t,e,n)}))},kV=function(t,e,n){var r=Jc(t);if(yV(n.getModes(),r,e))return C.none();xV(t,r,n);var o=Zc(),i=r.x-o.x,u=e.y-o.y,a=o.bottom-e.bottom,c=r.y<=e.y;return C.some(mV.fixed(Xl("fixed",C.some(i),c?C.some(u):C.none(),C.none(),c?C.none():C.some(a))))},OV=function(t,e,n){var r=t.element(),o=Ga(r,"position").is("fixed");return o?SV(r,e,n):kV(r,e,n)},TV=function(t,e){var n=t.element();return wV(n,e).bind((function(t){return CV(n,t,e)}))},EV=function(t,e){G(["left","right","top","bottom","position"],(function(e){return Ya(t.element(),e)})),e.onUndocked(t)},_V=function(t,e,n){Yl(t.element(),n);var r="fixed"===n.position()?e.onDocked:e.onUndocked;r(t)},AV=function(t,e,n,r,o){void 0===o&&(o=!1),e.contextual.each((function(e){e.lazyContext(t).each((function(i){var u=pV(i,r);if(u!==n.isVisible())if(n.setVisible(u),o&&!u)Oa(t.element(),[e.fadeOutClass]),e.onHide(t);else{var a=u?gV:hV;a(t,e)}}))}))},DV=function(t,e,n){var r=e.lazyViewport(t),o=n.isDocked();o&&AV(t,e,n,r),OV(t,r,n).each((function(i){n.setDocked(!o),i.fold((function(){return EV(t,e)}),(function(n){return _V(t,e,n)}),(function(o){AV(t,e,n,r,!0),_V(t,e,o)}))}))},NV=function(t,e,r){var o=t.element();r.setDocked(!1),TV(t,r).each((function(r){r.fold((function(){return EV(t,e)}),(function(n){return _V(t,e,n)}),n)})),r.setVisible(!0),e.contextual.each((function(e){Ta(o,[e.fadeInClass,e.fadeOutClass,e.transitionClass]),e.onShow(t)})),RV(t,e,r)},RV=function(t,e,n){t.getSystem().isConnected()&&DV(t,e,n)},MV=function(t,e,n){n.isDocked()&&NV(t,e,n)},zV=function(t,e,n){return n.isDocked()},BV=function(t,e,n,r){return n.setModes(r)},PV=function(t,e,n){return n.getModes()},HV=Object.freeze({__proto__:null,refresh:RV,reset:MV,isDocked:zV,getModes:PV,setModes:BV}),IV=function(t,e){return di([Oi(Ro(),(function(n,r){t.contextual.each((function(t){if(ka(n.element(),t.transitionClass)){Ta(n.element(),[t.transitionClass,t.fadeInClass]);var o=e.isVisible()?t.onShown:t.onHidden;o(n)}r.stop()}))})),pi(Ko(),(function(n,r){RV(n,t,e)})),pi(Xo(),(function(n,r){MV(n,t,e)}))])},LV=Object.freeze({__proto__:null,events:IV}),FV=[zn("contextual",[wn("fadeInClass"),wn("fadeOutClass"),wn("transitionClass"),Sn("lazyContext"),Ns("onShow"),Ns("onShown"),Ns("onHide"),Ns("onHidden")]),Un("lazyViewport",Zc),Wn("modes",["top","bottom"],fn),Ns("onDocked"),Ns("onUndocked")],VV=function(t){var e=Gn(!1),n=Gn(!0),r=Gn(C.none()),o=Gn(t.modes),i=function(){return"docked: "+e.get()+", visible: "+n.get()+", modes: "+o.get().join(",")};return ju({isDocked:e.get,setDocked:e.set,getInitialPosition:r.get,setInitialPosition:r.set,isVisible:n.get,setVisible:n.set,getModes:o.get,setModes:o.set,readState:i})},UV=Object.freeze({__proto__:null,init:VV}),jV=Nl({fields:FV,name:"docking",active:LV,apis:HV,state:UV}),WV={fadeInClass:"tox-editor-dock-fadein",fadeOutClass:"tox-editor-dock-fadeout",transitionClass:"tox-editor-dock-transition"},qV="tox-tinymce--toolbar-sticky-on",$V="tox-tinymce--toolbar-sticky-off",GV=function(t,e){var n=Hi(e),r=n.dom().defaultView.innerHeight,o=Hc(n),i=Zn.fromDom(t.elm),u=Qc(i),a=pc(i),c=u.y,s=c+a,l=Sc(e),f=pc(e),d=l.top(),m=d+f,g=Math.abs(d-o.top())<2,h=Math.abs(m-(o.top()+r))<2;if(g&&c<m)Ic(o.left(),c-f,n);else if(h&&s>d){var p=c-r+a+f;Ic(o.left(),p,n)}},KV=function(t,e){return U(jV.getModes(t),e)},XV=function(t){var e=function(t){return vc(t)+(parseInt(qa(t,"margin-top"),10)||0)+(parseInt(qa(t,"margin-bottom"),10)||0)},n=t.element();Vi(n).each((function(r){var o="padding-"+jV.getModes(t)[0];if(jV.isDocked(t)){var i=Ec(r);Ua(n,"width",i+"px"),Ua(r,o,e(n)+"px")}else Ya(n,"width"),Ya(r,o)}))},YV=function(t,e){e?(Sa(t,WV.fadeOutClass),Oa(t,[WV.transitionClass,WV.fadeInClass])):(Sa(t,WV.fadeInClass),Oa(t,[WV.fadeOutClass,WV.transitionClass]))},JV=function(t,e){var n=Zn.fromDom(t.getContainer());e?(xa(n,qV),Sa(n,$V)):(xa(n,$V),Sa(n,qV))},QV=function(t,e){var n=Hi(e);$l(n).filter((function(t){return!no(e,t)})).filter((function(e){return no(e,Zn.fromDom(n.dom().body))||io(t,e)})).each((function(){return jl(e)}))},ZV=function(t,e){return Gl(t).orThunk((function(){return e().toOption().bind((function(t){return Gl(t.element())}))}))},tU=function(t,e,n){t.inline||(e.header.isPositionedAtTop()||t.on("ResizeEditor",(function(){n().each(jV.reset)})),t.on("ResizeWindow ResizeEditor",(function(){n().each(XV)})),t.on("SkinLoaded",(function(){n().each((function(t){jV.isDocked(t)?jV.reset(t):jV.refresh(t)}))})),t.on("FullscreenStateChanged",(function(){n().each(jV.reset)}))),t.on("AfterScrollIntoView",(function(t){n().each((function(e){jV.refresh(e);var n=e.element();kv(n)&&GV(t,n)}))})),t.on("PostRender",(function(){JV(t,!1)}))},eU=function(t){return t().map(jV.isDocked).getOr(!1)},nU=function(){var t;return[Ll.config({channels:(t={},t[SI()]={onReceive:XV},t)})]},rU=function(t,e){var n=Gn(C.none()),r=e.getSink,o=function(t){r().each((function(e){return t(e.element())}))},i=function(e){t.inline||XV(e),JV(t,jV.isDocked(e)),e.getSystem().broadcastOn([ag()],{}),r().each((function(t){return t.getSystem().broadcastOn([ag()],{})}))},u=t.inline?[]:nU();return p([Sy.config({}),jV.config({contextual:g({lazyContext:function(e){var n=vc(e.element()),r=t.inline?t.getContentAreaContainer():t.getContainer(),o=Jc(Zn.fromDom(r)),i=o.height-n,u=o.y+(KV(e,"top")?0:n);return C.some(Yc(o.x,u,o.width,i))},onShow:function(){o((function(t){return YV(t,!0)}))},onShown:function(t){o((function(t){return Ta(t,[WV.transitionClass,WV.fadeInClass])})),n.get().each((function(e){QV(t.element(),e),n.set(C.none())}))},onHide:function(t){n.set(ZV(t.element(),r)),o((function(t){return YV(t,!1)}))},onHidden:function(){o((function(t){return Ta(t,[WV.transitionClass])}))}},WV),modes:[e.header.getDockingMode()],onDocked:i,onUndocked:i})],u)},oU=Object.freeze({__proto__:null,setup:tU,isDocked:eU,getBehaviours:rU}),iU=n,uU=f,aU=u([]),cU=Object.freeze({__proto__:null,setup:iU,isDocked:uU,getBehaviours:aU}),sU=function(t){var e=t.editor,n=t.sticky?rU:aU;return{uid:t.uid,dom:t.dom,components:t.components,behaviours:Al(n(e,t.sharedBackstage))}},lU=function(t,e){var n=function(t,n){var r=$(n,(function(t){var n={type:"menubutton",text:t.text,fetch:function(e){e(t.getItems())}},r=PI(n).mapError((function(t){return on(t)})).getOrDie();return RM(r,"tox-mbtn",e.backstage,C.some("menuitem"))}));dy.set(t,r)},r={focus:ny.focusIn,setMenus:n};return{uid:t.uid,dom:t.dom,components:[],behaviours:Al([dy.config({}),gy("menubar-events",[Ti((function(e){t.onSetup(e)})),pi(ko(),(function(t,e){as(t.element(),".tox-mbtn--active").each((function(n){cs(e.event().target(),".tox-mbtn").each((function(e){no(n,e)||t.getSystem().getByDom(n).each((function(n){t.getSystem().getByDom(e).each((function(t){y_.expand(t),y_.close(n),Sy.focus(t)}))}))}))}))})),pi(ti(),(function(t,e){e.event().prevFocus().bind((function(e){return t.getSystem().getByDom(e).toOption()})).each((function(n){e.event().newFocus().bind((function(e){return t.getSystem().getByDom(e).toOption()})).each((function(t){y_.isOpen(n)&&(y_.expand(t),y_.close(n))}))}))}))]),ny.config({mode:"flow",selector:".tox-mbtn",onEscape:function(e){return t.onEscape(e),C.some(!0)}}),rE.config({})]),apis:r,domModification:{attributes:{role:"menubar"}}}},fU=tp({factory:lU,name:"silver.Menubar",configFields:[vn("dom"),vn("uid"),vn("onEscape"),vn("backstage"),Pn("onSetup",n)],apis:{focus:function(t,e){t.focus(e)},setMenus:function(t,e,n){t.setMenus(e,n)}}}),dU="container",mU=[Ug("slotBehaviours",[])],gU=function(t){return"<alloy.field."+t+">"},hU=function(t){var e=function(){var t=[],e=function(e,n){return t.push(e),Dh(dU,gU(e),n)};return{slot:e,record:function(){return t}}}(),n=t(e),r=e.record(),o=$(r,(function(t){return wh({name:t,pname:gU(t)})}));return Gh(dU,mU,o,pU,n)},pU=function(t,e){var n=function(e){return Lh(t)},r=function(e,n){return Bh(e,t,n)},o=function(e,n){return function(r,o){return Bh(r,t,o).map((function(t){return e(t,o)})).getOr(n)}},i=function(t){return function(e,n){G(n,(function(n){return t(e,n)}))}},u=function(t,e){return"true"!==lu(t.element(),"aria-hidden")},a=function(t,e){if(!u(t)){var n=t.element();Ya(n,"display"),mu(n,"aria-hidden"),ai(t,ei(),{name:e,visible:!0})}},c=function(t,e){if(u(t)){var n=t.element();Ua(n,"display","none"),cu(n,"aria-hidden","true"),ai(t,ei(),{name:e,visible:!1})}},s=o(u,!1),l=o(c),f=i(l),d=function(t){return f(t,n())},m=o(a),g={getSlotNames:n,getSlot:r,isShowing:s,hideSlot:l,hideAllSlots:d,showSlot:m};return{uid:t.uid,dom:t.dom,components:e,behaviours:jg(t.slotBehaviours),apis:g}},vU=Nt({getSlotNames:function(t,e){return t.getSlotNames(e)},getSlot:function(t,e,n){return t.getSlot(e,n)},isShowing:function(t,e,n){return t.isShowing(e,n)},hideSlot:function(t,e,n){return t.hideSlot(e,n)},hideAllSlots:function(t,e){return t.hideAllSlots(e)},showSlot:function(t,e,n){return t.showSlot(e,n)}},(function(t){return Vu(t)})),bU=g(g({},vU),{sketch:hU}),yU=Ie([Nn("icon"),Nn("tooltip"),Un("onShow",n),Un("onHide",n),Un("onSetup",(function(){return n}))]),wU=function(t){return en("sidebar",yU,t)},xU=function(t){var e=t.ui.registry.getAll().sidebars;G(_t(e),(function(n){var r=e[n],o=function(){return C.from(t.queryCommandValue("ToggleSidebar")).is(n)};t.ui.registry.addToggleButton(n,{icon:r.icon,tooltip:r.tooltip,onAction:function(e){t.execCommand("ToggleSidebar",!1,n),e.setActive(o())},onSetup:function(e){var n=function(){return e.setActive(o())};return t.on("ToggleSidebar",n),function(){t.off("ToggleSidebar",n)}}})}))},CU=function(t){return{element:function(){return t.element().dom()}}},SU=function(t,e){var r=$(_t(e),(function(t){var n=e[t],r=nn(wU(n));return{name:t,getApi:CU,onSetup:r.onSetup,onShow:r.onShow,onHide:r.onHide}}));return $(r,(function(e){var o=Gn(n);return t.slot(e.name,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:AC.unnamedEvents([ik(e,o),uk(e,o),pi(ei(),(function(t,e){var n=e.event(),o=tt(r,(function(t){return t.name===n.name()}));o.each((function(e){var r=n.visible()?e.onShow:e.onHide;r(e.getApi(t))}))}))])})}))},kU=function(t){return bU.sketch((function(e){return{dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:SU(e,t),slotBehaviours:AC.unnamedEvents([Ti((function(t){return bU.hideAllSlots(t)}))])}}))},OU=function(t,e){var n=lp.getCurrent(t);n.each((function(t){return dy.set(t,[kU(e)])}))},TU=function(t,e){var n=lp.getCurrent(t);n.each((function(t){var n=lp.getCurrent(t);n.each((function(n){pI.hasGrown(t)?bU.isShowing(n,e)?pI.shrink(t):(bU.hideAllSlots(n),bU.showSlot(n,e)):(bU.hideAllSlots(n),bU.showSlot(n,e),pI.grow(t))}))}))},EU=function(t){var e=lp.getCurrent(t);return e.bind((function(t){var e=pI.isGrowing(t)||pI.hasGrown(t);if(e){var n=lp.getCurrent(t);return n.bind((function(t){return tt(bU.getSlotNames(t),(function(e){return bU.isShowing(t,e)}))}))}return C.none()}))},_U=Cu("FixSizeEvent"),AU=Cu("AutoSizeEvent"),DU=function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-sidebar"],attributes:{role:"complementary"}},components:[{dom:{tag:"div",classes:["tox-sidebar__slider"]},components:[],behaviours:Al([rE.config({}),Sy.config({}),pI.config({dimension:{property:"width"},closedClass:"tox-sidebar--sliding-closed",openClass:"tox-sidebar--sliding-open",shrinkingClass:"tox-sidebar--sliding-shrinking",growingClass:"tox-sidebar--sliding-growing",onShrunk:function(t){var e=lp.getCurrent(t);e.each(bU.hideAllSlots),ui(t,AU)},onGrown:function(t){ui(t,AU)},onStartGrow:function(t){ai(t,_U,{width:Ga(t.element(),"width").getOr("")})},onStartShrink:function(t){ai(t,_U,{width:Ec(t.element())+"px"})}}),dy.config({}),lp.config({find:function(t){var e=dy.contents(t);return st(e)}})])}],behaviours:Al([AN.childAt(0),gy("sidebar-sliding-events",[pi(_U,(function(t,e){Ua(t.element(),"width",e.event().width())})),pi(AU,(function(t,e){Ya(t.element(),"width")}))])])}},NU=function(t){var e=void 0!==t.dom().attributes?t.dom().attributes:[];return Q(e,(function(t,e){var n;return"class"===e.name?t:g(g({},t),(n={},n[e.name]=e.value,n))}),{})},RU=function(t){return Array.prototype.slice.call(t.dom().classList,0)},MU=function(t){var e=Zn.fromHtml(t),n=Wi(e),r=NU(e),o=RU(e),i=0===n.length?{}:{innerHtml:ou(e)};return g({tag:Di(e),classes:o,attributes:r},i)},zU=function(t){return{dom:{tag:"div",attributes:{"aria-label":t.translate("Loading...")},classes:["tox-throbber__busy-spinner"]},components:[{dom:MU('<div class="tox-spinner"><div></div><div></div><div></div></div>')}],behaviours:Al([ny.config({mode:"special",onTab:function(){return C.some(!0)},onShiftTab:function(){return C.some(!0)}}),Sy.config({})])}},BU=function(t,e,n){var r=t.element();!0===e?(dy.set(t,[zU(n)]),Ya(r,"display"),mu(r,"aria-hidden")):(dy.set(t,[]),Ua(r,"display","none"),cu(r,"aria-hidden","true"))},PU=function(t){return{uid:t.uid,dom:{tag:"div",attributes:{"aria-hidden":"true"},classes:["tox-throbber"],styles:{display:"none"}},behaviours:Al([dy.config({})]),components:[]}},HU=function(t,e,n){var r=Gn(!1),o=Gn(C.none()),i=function(t){t!==r.get()&&(BU(e(),t,n.providers),r.set(t))};t.on("ProgressState",(function(e){if(o.get().each(Fw.clearTimeout),B(e.time)){var n=Fw.setEditorTimeout(t,(function(){return i(e.state)}),e.time);o.set(C.some(n))}else i(e.state),o.set(C.none())}))},IU=function(t,e,n){var r={getSocket:function(e){return nV.getPart(e,t,"socket")},setSidebar:function(e,n){nV.getPart(e,t,"sidebar").each((function(t){return OU(t,n)}))},toggleSidebar:function(e,n){nV.getPart(e,t,"sidebar").each((function(t){return TU(t,n)}))},whichSidebar:function(e){return nV.getPart(e,t,"sidebar").bind(EU).getOrNull()},getHeader:function(e){return nV.getPart(e,t,"header")},getToolbar:function(e){return nV.getPart(e,t,"toolbar")},setToolbar:function(e,n){nV.getPart(e,t,"toolbar").each((function(t){t.getApis().setGroups(t,n)}))},setToolbars:function(e,n){nV.getPart(e,t,"multiple-toolbar").each((function(t){lV.setItems(t,n)}))},refreshToolbar:function(e){var n=nV.getPart(e,t,"toolbar");n.each((function(t){return t.getApis().refresh(t)}))},getThrobber:function(e){return nV.getPart(e,t,"throbber")},focusToolbar:function(e){var n=nV.getPart(e,t,"toolbar").orThunk((function(){return nV.getPart(e,t,"multiple-toolbar")}));n.each((function(t){ny.focusIn(t)}))},setMenubar:function(e,n){nV.getPart(e,t,"menubar").each((function(t){fU.setMenus(t,n)}))},focusMenubar:function(e){nV.getPart(e,t,"menubar").each((function(t){fU.focus(t)}))}};return{uid:t.uid,dom:t.dom,components:e,apis:r,behaviours:t.behaviours}},LU=rV.optional({factory:fU,name:"menubar",schema:[vn("backstage")]}),FU=function(t){return t.type===Px.sliding?AI:t.type===Px.floating?_I:DI},VU=rV.optional({factory:{sketch:function(t){return lV.sketch({uid:t.uid,dom:t.dom,listBehaviours:Al([ny.config({mode:"acyclic",selector:".tox-toolbar"})]),makeItem:function(){return DI({type:t.type,uid:Cu("multiple-toolbar-item"),cyclicKeying:!1,initGroups:[],providers:t.providers,onEscape:function(){return C.none()}})},setupItem:function(t,e,n,r){hH.setGroups(e,n)},shell:!0})}},name:"multiple-toolbar",schema:[vn("dom"),vn("onEscape")]}),UU=rV.optional({factory:{sketch:function(t){var e=FU(t),n={type:t.type,uid:t.uid,onEscape:function(){return t.onEscape(),C.some(!0)},cyclicKeying:!1,initGroups:[],getSink:t.getSink,providers:t.providers,moreDrawerData:{lazyToolbar:t.lazyToolbar,lazyMoreButton:t.lazyMoreButton,lazyHeader:t.lazyHeader},attributes:t.attributes};return e(n)}},name:"toolbar",schema:[vn("dom"),vn("onEscape"),vn("getSink")]}),jU=rV.optional({factory:{sketch:sU},name:"header",schema:[vn("dom")]}),WU=rV.optional({name:"socket",schema:[vn("dom")]}),qU=rV.optional({factory:{sketch:DU},name:"sidebar",schema:[vn("dom")]}),$U=rV.optional({factory:{sketch:PU},name:"throbber",schema:[vn("dom")]}),GU=ep({name:"OuterContainer",factory:IU,configFields:[vn("dom"),vn("behaviours")],partFields:[jU,LU,UU,VU,WU,qU,$U],apis:{getSocket:function(t,e){return t.getSocket(e)},setSidebar:function(t,e,n){t.setSidebar(e,n)},toggleSidebar:function(t,e,n){t.toggleSidebar(e,n)},whichSidebar:function(t,e){return t.whichSidebar(e)},getHeader:function(t,e){return t.getHeader(e)},getToolbar:function(t,e){return t.getToolbar(e)},setToolbar:function(t,e,n){var r=$(n,(function(t){return OI(t)}));t.setToolbar(e,r)},setToolbars:function(t,e,n){var r=$(n,(function(t){return $(t,OI)}));t.setToolbars(e,r)},refreshToolbar:function(t,e){return t.refreshToolbar(e)},getThrobber:function(t,e){return t.getThrobber(e)},setMenubar:function(t,e,n){t.setMenubar(e,n)},focusMenubar:function(t,e){t.focusMenubar(e)},focusToolbar:function(t,e){t.focusToolbar(e)}}}),KU="file edit view insert format tools table help",XU={file:{title:"File",items:"newdocument restoredraft | preview | print | deleteallconversations"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall | searchreplace"},view:{title:"View",items:"code | visualaid visualchars visualblocks | spellchecker | preview fullscreen | showcomments"},insert:{title:"Insert",items:"image link media addcomment pageembed template codesample inserttable | charmap emoticons hr | pagebreak nonbreaking anchor toc | insertdatetime"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript codeformat | formats blockformats fontformats fontsizes align | forecolor backcolor | removeformat"},tools:{title:"Tools",items:"spellchecker spellcheckerlanguage | a11ycheck code wordcount"},table:{title:"Table",items:"inserttable | cell row column | advtablesort | tableprops deletetable"},help:{title:"Help",items:"help"}},YU=function(t,e,n){var r=xS(n).split(/[ ,]/);return{text:t.title,getItems:function(){return rt(t.items,(function(t){var n=t.toLowerCase();return 0===n.trim().length||j(r,(function(t){return t===n}))?[]:"separator"===n||"|"===n?[{type:"separator"}]:e.menuItems[n]?[e.menuItems[n]]:[]}))}}},JU=function(t){return"string"===typeof t?t.split(" "):t},QU=function(t,e){var n=g(g({},XU),e.menus),r=_t(e.menus).length>0,o=void 0===e.menubar||!0===e.menubar?JU(KU):JU(!1===e.menubar?"":e.menubar),i=Y(o,(function(t){return r&&e.menus.hasOwnProperty(t)&&e.menus[t].hasOwnProperty("items")||XU.hasOwnProperty(t)})),u=$(i,(function(r){var o=n[r];return YU({title:o.title,items:JU(o.items)},e,t)}));return Y(u,(function(t){var e=function(t){return"separator"!==t.type};return t.getItems().length>0&&j(t.getItems(),e)}))},ZU=function(t){var e=function(){t._skinLoaded=!0,sO(t)};return function(){t.initialized?e():t.on("init",e)}},tj=function(t,e){return function(){return lO(t,{message:e})}},ej=function(t,e){var n,r=lS(e);r&&(n=r+"/skin.min.css",e.contentCSS.push(r+(t?"/content.inline":"/content")+".min.css")),!1===dS(e)&&n?e.ui.styleSheetLoader.load(n,ZU(e),tj(e,"Skin could not be loaded")):ZU(e)()},nj=c(ej,!1),rj=c(ej,!0),oj=function(t,e,n,r){var o=e.outerContainer,i=n.toolbar,u=n.buttons;if(P(i,E)){var a=i.map((function(e){var o={toolbar:e,buttons:u,allowToolbarGroups:n.allowToolbarGroups};return GF(t,o,{backstage:r},C.none())}));GU.setToolbars(o,a)}else GU.setToolbar(o,GF(t,n,{backstage:r},C.none()))},ij=UC.DOM,uj=Gr(),aj=uj.os.isiOS()&&uj.os.version.major<=12,cj=function(t){var e=t.getWin(),n=t.getDoc().documentElement,r=Gn(wc(e.innerWidth,e.innerHeight)),o=Gn(wc(n.offsetWidth,n.offsetHeight)),i=function(n){var o=r.get();o.left()===e.innerWidth&&o.top()===e.innerHeight||(r.set(wc(e.innerWidth,e.innerHeight)),dO(t,n))},u=function(e){var n=t.getDoc().documentElement,r=o.get();r.left()===n.offsetWidth&&r.top()===n.offsetHeight||(o.set(wc(n.offsetWidth,n.offsetHeight)),dO(t,e))},a=function(e){return mO(t,e)};ij.bind(e,"resize",i),ij.bind(e,"scroll",a);var c=vT(Zn.fromDom(t.getBody()),"load",u);t.on("NodeChange",u),t.on("remove",(function(){c.unbind(),ij.unbind(e,"resize",i),ij.unbind(e,"scroll",a)}))},sj=function(t,e,n,r,o){var i=Gn(0);nj(t);var u=Zn.fromDom(o.targetNode),a=Ra(Na(u));Hm(u,e.mothership),Pm(a,e.uiMothership),t.on("PostRender",(function(){oj(t,e,n,r),i.set(t.getWin().innerWidth),GU.setMenubar(e.outerContainer,QU(t,n)),GU.setSidebar(e.outerContainer,n.sidebar),cj(t)}));var c=GU.getSocket(e.outerContainer).getOrDie("Could not find expected socket element");if(!0===aj){ja(c.element(),{overflow:"scroll","-webkit-overflow-scrolling":"touch"});var s=Zw((function(){t.fire("ScrollContent")}),20);pT(c.element(),"scroll",s.throttle)}JS(t,e),t.addCommand("ToggleSidebar",(function(n,r){GU.toggleSidebar(e.outerContainer,r),t.fire("ToggleSidebar")})),t.addQueryValueHandler("ToggleSidebar",(function(){return GU.whichSidebar(e.outerContainer)}));var l=ES(t),f=function(){GU.refreshToolbar(e.outerContainer)};return l!==Px.sliding&&l!==Px.floating||t.on("ResizeWindow ResizeEditor ResizeContent",(function(){var e=t.getWin().innerWidth;e!==i.get()&&(f(),i.set(e))})),{iframeContainer:c.element().dom(),editorContainer:e.outerContainer.element().dom()}},lj=Object.freeze({__proto__:null,render:sj}),fj=function(t){var e=Gn(C.none()),n=function(){e.get().each(t)},r=function(){n(),e.set(C.none())},o=function(t){n(),e.set(C.some(t))},i=function(){return e.get().isSome()};return{clear:r,isSet:i,set:o}},dj=function(){return fj((function(t){t.unbind()}))},mj=function(){var t=Gn(C.none()),e=function(){t.set(C.none())},n=function(e){t.set(C.some(e))},r=function(e){t.get().each(e)},o=function(){return t.get().isSome()};return{clear:e,set:n,isSet:o,on:r}},gj=function(t){var e=/^[0-9\.]+(|px)$/i;return e.test(""+t)?C.some(parseInt(""+t,10)):C.none()},hj=function(t){return B(t)?t+"px":t},pj=function(t,e,n){var r=e.filter((function(e){return t<e})),o=n.filter((function(e){return t>e}));return r.or(o).getOr(t)},vj=function(t){var e=mS(t),n=pS(t),r=bS(t);return gj(e).map((function(t){return pj(t,n,r)}))},bj=function(t){var e=vj(t);return e.getOr(mS(t))},yj=function(t){var e=gS(t),n=hS(t),r=vS(t);return gj(e).map((function(t){return pj(t,n,r)}))},wj=function(t){var e=yj(t);return e.getOr(gS(t))},xj=function(t,e,n,r,o){var i=n.uiMothership,u=n.outerContainer,a=UC.DOM,c=MS(t),s=PS(t),l=vS(t).or(yj(t)),f=r.shared.header,d=f.isPositionedAtTop,m=ES(t),g=m===Px.sliding||m===Px.floating,h=Gn(!1),p=function(){return h.get()&&!t.removed},v=function(t){return g?t.fold((function(){return 0}),(function(t){return t.components().length>1?pc(t.components()[1].element()):0})):0},b=function(n){switch(AS(t)){case TS.auto:var r=GU.getToolbar(u),o=v(r),i=pc(n.element())-o,a=Jc(e),c=a.y>i;if(c)return"top";var s=Li(e),l=Math.max(s.dom().scrollHeight,pc(s)),f=a.bottom<l-i;if(f)return"bottom";var d=Zc(),m=d.bottom<a.bottom-i;return m?"bottom":"top";case TS.bottom:return"bottom";case TS.top:default:return"top"}},y=function(t){var e=o.get();jV.setModes(e,[t]),f.setDockingMode(t);var n=d()?gs.TopToBottom:gs.BottomToTop;cu(e.element(),Mf,n)},w=function(){var t=l.getOrThunk((function(){var t=gj(qa(Ia(),"margin-left")).getOr(0);return Ec(Ia())-Sc(e).left()+t}));Ua(o.get().element(),"max-width",t+"px")},x=function(){var t=GU.getToolbar(u),n=v(t),r=Jc(e),i=d()?Math.max(r.y-pc(o.get().element())+n,0):r.bottom;ja(u.element(),{position:"absolute",top:Math.round(i)+"px",left:Math.round(r.x)+"px"})},C=function(){i.broadcastOn([ag()],{})},S=function(t){if(void 0===t&&(t=!1),p()){if(c||w(),g&&GU.refreshToolbar(u),c||x(),s){var e=o.get();t?jV.reset(e):jV.refresh(e)}C()}},k=function(t){if(void 0===t&&(t=!0),!c&&s&&p()){var e=f.getDockingMode(),n=b(o.get());n!==e&&(y(n),t&&S(!0))}},O=function(){h.set(!0),Ua(u.element(),"display","flex"),a.addClass(t.getBody(),"mce-edit-focus"),Ya(i.element(),"display"),k(!1),S()},T=function(){h.set(!1),n.outerContainer&&(Ua(u.element(),"display","none"),a.removeClass(t.getBody(),"mce-edit-focus")),Ua(i.element(),"display","none")};return{isVisible:p,isPositionedAtTop:d,show:O,hide:T,update:S,updateMode:k,repositionPopups:C}},Cj=function(t,e){var n=Jc(t);return{pos:e?n.y:n.bottom,bounds:n}},Sj=function(t,e,n){var r=Gn(Cj(e,n.isPositionedAtTop())),o=function(o){var i=Cj(e,n.isPositionedAtTop()),u=i.pos,a=i.bounds,c=r.get(),s=c.pos,l=c.bounds,f=a.height!==l.height||a.width!==l.width;r.set({pos:u,bounds:a}),f&&dO(t,o),n.isVisible()&&(s!==u?n.update(!0):f&&(n.updateMode(),n.repositionPopups()))};t.on("activate",n.show),t.on("deactivate",n.hide),t.on("SkinLoaded ResizeWindow",(function(){return n.update(!0)})),t.on("NodeChange keydown",(function(t){Fw.requestAnimationFrame((function(){return o(t)}))})),t.on("ScrollWindow",(function(){return n.updateMode()}));var i=dj();i.set(vT(Zn.fromDom(t.getBody()),"load",o)),t.on("remove",(function(){i.clear()}))},kj=function(t,e,n,r,o){var i=e.mothership,u=e.uiMothership,a=e.outerContainer,c=Gn(null),s=Zn.fromDom(o.targetNode),l=xj(t,s,e,r,c);rj(t);var f=function(){if(c.get())l.show();else{c.set(GU.getHeader(a).getOrDie());var o=zS(t);Pm(o,i),Pm(o,u),oj(t,e,n,r),GU.setMenubar(a,QU(t,n)),l.show(),Sj(t,s,l),t.nodeChanged()}};return t.on("focus",f),t.on("blur hide",l.hide),t.on("init",(function(){t.hasFocus()&&f()})),JS(t,e),{editorContainer:a.element().dom()}},Oj=Object.freeze({__proto__:null,render:kj}),Tj=function(t){var e=[{name:"alignleft",text:"Align left",cmd:"JustifyLeft",icon:"align-left"},{name:"aligncenter",text:"Align center",cmd:"JustifyCenter",icon:"align-center"},{name:"alignright",text:"Align right",cmd:"JustifyRight",icon:"align-right"},{name:"alignjustify",text:"Justify",cmd:"JustifyFull",icon:"align-justify"}];xz.each(e,(function(e){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,onAction:function(){return t.execCommand(e.cmd)},icon:e.icon,onSetup:_F(t,e.name)})}));var n={name:"alignnone",text:"No alignment",cmd:"JustifyNone",icon:"align-none"};t.ui.registry.addButton(n.name,{tooltip:n.text,onAction:function(){return t.execCommand(n.cmd)},icon:n.icon})},Ej=function(t,e){return function(){t.execCommand("mceToggleFormat",!1,e)}},_j=function(t){xz.each([{name:"bold",text:"Bold",icon:"bold"},{name:"italic",text:"Italic",icon:"italic"},{name:"underline",text:"Underline",icon:"underline"},{name:"strikethrough",text:"Strikethrough",icon:"strike-through"},{name:"subscript",text:"Subscript",icon:"subscript"},{name:"superscript",text:"Superscript",icon:"superscript"}],(function(e,n){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onSetup:_F(t,e.name),onAction:Ej(t,e.name)})}));for(var e=1;e<=6;e++){var n="h"+e;t.ui.registry.addToggleButton(n,{text:n.toUpperCase(),tooltip:"Heading "+e,onSetup:_F(t,n),onAction:Ej(t,n)})}},Aj=function(t){xz.each([{name:"cut",text:"Cut",action:"Cut",icon:"cut"},{name:"copy",text:"Copy",action:"Copy",icon:"copy"},{name:"paste",text:"Paste",action:"Paste",icon:"paste"},{name:"help",text:"Help",action:"mceHelp",icon:"help"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all"},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document"},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting"},{name:"remove",text:"Remove",action:"Delete",icon:"remove"}],(function(e){t.ui.registry.addButton(e.name,{tooltip:e.text,icon:e.icon,onAction:function(){return t.execCommand(e.action)}})}))},Dj=function(t){xz.each([{name:"blockquote",text:"Blockquote",action:"mceBlockQuote",icon:"quote"}],(function(e){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onAction:function(){return t.execCommand(e.action)},onSetup:_F(t,e.name)})}))},Nj=function(t){_j(t),Aj(t),Dj(t)},Rj=function(t){xz.each([{name:"bold",text:"Bold",action:"Bold",icon:"bold",shortcut:"Meta+B"},{name:"italic",text:"Italic",action:"Italic",icon:"italic",shortcut:"Meta+I"},{name:"underline",text:"Underline",action:"Underline",icon:"underline",shortcut:"Meta+U"},{name:"strikethrough",text:"Strikethrough",action:"Strikethrough",icon:"strike-through",shortcut:""},{name:"subscript",text:"Subscript",action:"Subscript",icon:"subscript",shortcut:""},{name:"superscript",text:"Superscript",action:"Superscript",icon:"superscript",shortcut:""},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting",shortcut:""},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document",shortcut:""},{name:"cut",text:"Cut",action:"Cut",icon:"cut",shortcut:"Meta+X"},{name:"copy",text:"Copy",action:"Copy",icon:"copy",shortcut:"Meta+C"},{name:"paste",text:"Paste",action:"Paste",icon:"paste",shortcut:"Meta+V"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all",shortcut:"Meta+A"}],(function(e){t.ui.registry.addMenuItem(e.name,{text:e.text,icon:e.icon,shortcut:e.shortcut,onAction:function(){return t.execCommand(e.action)}})})),t.ui.registry.addMenuItem("codeformat",{text:"Code",icon:"sourcecode",onAction:Ej(t,"code")})},Mj=function(t){Nj(t),Rj(t)},zj=function(t,e,n){var r=function(){return!!e.undoManager&&e.undoManager[n]()},o=function(){t.setDisabled(e.mode.isReadOnly()||!r())};return t.setDisabled(!r()),e.on("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",o),function(){return e.off("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",o)}},Bj=function(t){t.ui.registry.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onSetup:function(e){return zj(e,t,"hasUndo")},onAction:function(){return t.execCommand("undo")}}),t.ui.registry.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onSetup:function(e){return zj(e,t,"hasRedo")},onAction:function(){return t.execCommand("redo")}})},Pj=function(t){t.ui.registry.addButton("undo",{tooltip:"Undo",icon:"undo",onSetup:function(e){return zj(e,t,"hasUndo")},onAction:function(){return t.execCommand("undo")}}),t.ui.registry.addButton("redo",{tooltip:"Redo",icon:"redo",onSetup:function(e){return zj(e,t,"hasRedo")},onAction:function(){return t.execCommand("redo")}})},Hj=function(t){Bj(t),Pj(t)},Ij=function(t,e){t.setActive(e.hasVisual);var n=function(e){t.setActive(e.hasVisual)};return e.on("VisualAid",n),function(){return e.off("VisualAid",n)}},Lj=function(t){t.ui.registry.addToggleMenuItem("visualaid",{text:"Visual aids",onSetup:function(e){return Ij(e,t)},onAction:function(){t.execCommand("mceToggleVisualAid")}})},Fj=function(t){t.ui.registry.addButton("visualaid",{tooltip:"Visual aids",text:"Visual aids",onAction:function(){return t.execCommand("mceToggleVisualAid")}})},Vj=function(t){Fj(t),Lj(t)},Uj=function(t,e){t.setDisabled(!e.queryCommandState("outdent"));var n=function(){t.setDisabled(!e.queryCommandState("outdent"))};return e.on("NodeChange",n),function(){return e.off("NodeChange",n)}},jj=function(t){t.ui.registry.addButton("outdent",{tooltip:"Decrease indent",icon:"outdent",onSetup:function(e){return Uj(e,t)},onAction:function(){return t.execCommand("outdent")}}),t.ui.registry.addButton("indent",{tooltip:"Increase indent",icon:"indent",onAction:function(){return t.execCommand("indent")}})},Wj=function(t){jj(t)},qj=function(t,e){lF(t,e),vF(t,e),PF(t,e),MF(t,e),OF(t,e)},$j=function(t,e){Tj(t),Mj(t),qj(t,e),Hj(t),UO(t),Vj(t),Wj(t)},Gj=function(t,e){return{anchor:"makeshift",x:t,y:e}},Kj=function(t,e,n){return Gj(t.x+e,t.y+n)},Xj=function(t){return"longpress"===t.type||0===t.type.indexOf("touch")},Yj=function(t){if(Xj(t)){var e=t.touches[0];return Gj(e.pageX,e.pageY)}return Gj(t.pageX,t.pageY)},Jj=function(t){if(Xj(t)){var e=t.touches[0];return Gj(e.clientX,e.clientY)}return Gj(t.clientX,t.clientY)},Qj=function(t,e){var n=UC.DOM.getPos(t);return Kj(e,n.x,n.y)},Zj=function(t,e){return"contextmenu"===e.type||"longpress"===e.type?t.inline?Yj(e):Qj(t.getContentAreaContainer(),Jj(e)):tW(t)},tW=function(t){return{anchor:"selection",root:Zn.fromDom(t.selection.getNode())}},eW=function(t){return{anchor:"node",node:C.some(Zn.fromDom(t.selection.getNode())),root:Zn.fromDom(t.getBody())}},nW=function(t,e,n){return n?eW(t):Zj(t,e)},rW=function(t,e,n,r,o,i){var u=n(),a=nW(t,e,i);DM(u,Hx.CLOSE_ON_EXECUTE,r,!1).map((function(t){e.preventDefault(),_w.showMenuAt(o,a,{menu:{markers:tC("normal")},data:t})}))},oW={onLtr:function(){return[ml,cl,sl,ll,fl,dl,Iw,Lw,Pw,zw,Hw,Bw]},onRtl:function(){return[ml,sl,cl,fl,ll,dl,Iw,Lw,Hw,Bw,Pw,zw]}},iW=12,uW={valignCentre:[],alignCentre:[],alignLeft:["tox-pop--align-left"],alignRight:["tox-pop--align-right"],right:["tox-pop--right"],left:["tox-pop--left"],bottom:["tox-pop--bottom"],top:["tox-pop--top"]},aW=function(t,e){var n=t.selection;if(n.isCollapsed()||e.touches.length<1)return!1;var r=e.touches[0],o=n.getRng(),i=Bd(t.getWin(),ud.domRange(o));return i.exists((function(t){return t.left()<=r.clientX&&t.right()>=r.clientX&&t.top()<=r.clientY&&t.bottom()>=r.clientY}))},cW=function(t,e,n){var r=e?eW(t):Zj(t,n);return g({bubble:_f(0,iW,uW),layouts:oW,overrides:{maxWidthFunction:oH(),maxHeightFunction:Sf()}},r)},sW=function(t){var e=t.selection.getRng(),n=function(){Fw.setEditorTimeout(t,(function(){t.selection.setRng(e)}),10),i()};t.once("touchend",n);var r=function(t){t.preventDefault(),t.stopImmediatePropagation()};t.on("mousedown",r,!0);var o=function(){return i()};t.once("longpresscancel",o);var i=function(){t.off("touchend",n),t.off("longpresscancel",o),t.off("mousedown",r)}},lW=function(t,e,n,r,o,i,u){var a=cW(t,i,e);DM(n,Hx.CLOSE_ON_EXECUTE,r,!0).map((function(n){e.preventDefault(),_w.showMenuWithinBounds(o,a,{menu:{markers:tC("normal"),highlightImmediately:u},data:n,type:"horizontal"},(function(){return C.some(FL(t,r.shared))})),t.fire(uH)}))},fW=function(t,e,n,r,o,i){var u=Gr(),a=u.os.isiOS(),c=u.os.isOSX(),s=u.os.isAndroid(),l=u.deviceType.isTouch(),f=function(){return!(s||a||c&&l)},d=function(){var u=n();lW(t,e,u,r,o,i,f())};if(!c&&!a||i)s&&!i&&t.selection.setCursorLocation(e.target,0),d();else{var m=function(){sW(t),d()};aW(t,e)?m():(t.once("selectionchange",m),t.once("touchend",(function(){return t.off("selectionchange",m)})))}},dW=function(t){return"string"===typeof t?t.split(/[ ,]/):t},mW=function(t){return t.getParam("contextmenu_never_use_native",!1,"boolean")},gW=function(t,e,n){var r=t.ui.registry.getAll().contextMenus;return C.from(t.getParam(e)).map(dW).getOrThunk((function(){return Y(dW(n),(function(t){return Ft(r,t)}))}))},hW=function(t){return!1===t.getParam("contextmenu")},pW=function(t){return gW(t,"contextmenu","link linkchecker image imagetools table spellchecker configurepermanentpen")},vW=function(t){return E(t)?"|"===t:"separator"===t.type},bW={type:"separator"},yW=function(t){if(E(t))return t;switch(t.type){case"separator":return bW;case"submenu":return{type:"nestedmenuitem",text:t.text,icon:t.icon,getSubmenuItems:function(){var e=t.getSubmenuItems();return E(e)?e:$(e,yW)}};default:return{type:"menuitem",text:t.text,icon:t.icon,onAction:r(t.onAction)}}},wW=function(t,e){if(0===e.length)return t;var n=lt(t).filter((function(t){return!vW(t)})),r=n.fold((function(){return[]}),(function(t){return[bW]}));return t.concat(r).concat(e).concat([bW])},xW=function(t,e,n){var r=Q(e,(function(e,r){if(Ft(t,r)){var o=t[r].update(n);if(E(o))return wW(e,o.split(" "));if(o.length>0){var i=$(o,yW);return wW(e,i)}return e}return e.concat([r])}),[]);return r.length>0&&vW(r[r.length-1])&&r.pop(),r},CW=function(t,e){return e.ctrlKey&&!mW(t)},SW=function(t,e){return"longpress"!==e.type&&(2!==e.button||e.target===t.getBody()&&""===e.pointerType)},kW=function(t,e,n){var r=Gr(),o=r.deviceType.isTouch,i=dc(_w.sketch({dom:{tag:"div"},lazySink:e,onEscape:function(){return t.focus()},onShow:function(){return n.setContextMenuState(!0)},onHide:function(){return n.setContextMenuState(!1)},fireDismissalEventInstead:{},inlineBehaviours:Al([gy("dismissContextMenu",[pi(Qo(),(function(e,n){ig.close(e),t.focus()}))])])})),u=function(t){return _w.hide(i)},a=function(e){if(mW(t)&&e.preventDefault(),!CW(t,e)&&!hW(t)){var r=SW(t,e),u=function(){var n=r?t.selection.getStart(!0):e.target,o=t.ui.registry.getAll(),i=pW(t);return xW(o.contextMenus,i,n)},a=o()?fW:rW;a(t,e,u,n,i,r)}};t.on("init",(function(){var e="ResizeEditor ScrollContent ScrollWindow longpresscancel"+(o()?"":" ResizeWindow");t.on(e,u),t.on("longpress contextmenu",a)}))},OW=jt.generate([{offset:["x","y"]},{absolute:["x","y"]},{fixed:["x","y"]}]),TW=function(t){return function(e){return e.translate(-t.left(),-t.top())}},EW=function(t){return function(e){return e.translate(t.left(),t.top())}},_W=function(t){return function(e,n){return Q(t,(function(t,e){return e(t)}),wc(e,n))}},AW=function(t,e,n){return t.fold(_W([EW(n),TW(e)]),_W([TW(e)]),_W([]))},DW=function(t,e,n){return t.fold(_W([EW(n)]),_W([]),_W([EW(e)]))},NW=function(t,e,n){return t.fold(_W([]),_W([TW(n)]),_W([EW(e),TW(n)]))},RW=function(t,e,n,r,o,i){var u=DW(t,o,i),a=DW(e,o,i);return Math.abs(u.left()-a.left())<=n&&Math.abs(u.top()-a.top())<=r},MW=function(t,e,n,r,o,i){var u=DW(t,o,i),a=DW(e,o,i),c=Math.abs(u.left()-a.left()),s=Math.abs(u.top()-a.top());return wc(c,s)},zW=function(t,e,n){var r=t.fold((function(t,e){return{position:C.some("absolute"),left:C.some(t+"px"),top:C.some(e+"px")}}),(function(t,e){return{position:C.some("absolute"),left:C.some(t-n.left()+"px"),top:C.some(e-n.top()+"px")}}),(function(t,e){return{position:C.some("fixed"),left:C.some(t+"px"),top:C.some(e+"px")}}));return g({right:C.none(),bottom:C.none()},r)},BW=function(t,e,n){return t.fold((function(t,r){return HW(t+e,r+n)}),(function(t,r){return IW(t+e,r+n)}),(function(t,r){return LW(t+e,r+n)}))},PW=function(t,e,n,r){var o=function(t,o){return function(i,u){var a=t(e,n,r);return o(i.getOr(a.left()),u.getOr(a.top()))}};return t.fold(o(NW,HW),o(DW,IW),o(AW,LW))},HW=OW.offset,IW=OW.absolute,LW=OW.fixed,FW=function(t,e){var n=lu(t,e);return N(n)?NaN:parseInt(n,10)},VW=function(t,e){var n=t.element(),r=FW(n,e.leftAttr),o=FW(n,e.topAttr);return isNaN(r)||isNaN(o)?C.none():C.some(wc(r,o))},UW=function(t,e,n){var r=t.element();cu(r,e.leftAttr,n.left()+"px"),cu(r,e.topAttr,n.top()+"px")},jW=function(t,e){var n=t.element();mu(n,e.leftAttr),mu(n,e.topAttr)},WW=function(t,e,n,r){return VW(t,e).fold((function(){return n}),(function(t){return LW(t.left()+r.left(),t.top()+r.top())}))},qW=function(t,e,n,r,o,i){var u=WW(t,e,n,r),a=e.mustSnap?KW(t,e,u,o,i):XW(t,e,u,o,i),c=AW(u,o,i);return UW(t,e,c),a.fold((function(){return{coord:LW(c.left(),c.top()),extra:C.none()}}),(function(t){return{coord:t.output,extra:t.extra}}))},$W=function(t,e){jW(t,e)},GW=function(t,e,n,r){return dt(t,(function(t){var o=t.sensor,i=RW(e,o,t.range.left(),t.range.top(),n,r);return i?C.some({output:PW(t.output,e,n,r),extra:t.extra}):C.none()}))},KW=function(t,e,n,r,o){var i=e.getSnapPoints(t),u=GW(i,n,r,o);return u.orThunk((function(){var t=Q(i,(function(t,e){var i=e.sensor,u=MW(n,i,e.range.left(),e.range.top(),r,o);return t.deltas.fold((function(){return{deltas:C.some(u),snap:C.some(e)}}),(function(n){var r=(u.left()+u.top())/2,o=(n.left()+n.top())/2;return r<=o?{deltas:C.some(u),snap:C.some(e)}:t}))}),{deltas:C.none(),snap:C.none()});return t.snap.map((function(t){return{output:PW(t.output,n,r,o),extra:t.extra}}))}))},XW=function(t,e,n,r,o){var i=e.getSnapPoints(t);return GW(i,n,r,o)},YW=function(t,e,n){return{coord:PW(t.output,t.output,e,n),extra:t.extra}},JW=function(t,e,n,r){var o=e.getTarget(t.element());if(e.repositionTarget){var i=Hi(t.element()),u=Hc(i),a=dV(o),c=YW(r,u,a),s=zW(c.coord,u,a);Wa(o,s)}},QW=Object.freeze({__proto__:null,snapTo:JW}),ZW="data-initial-z-index",tq=function(t){Vi(t.element()).filter(Mi).each((function(t){fu(t,ZW).fold((function(){return Ya(t,"z-index")}),(function(e){return Ua(t,"z-index",e)})),mu(t,ZW)}))},eq=function(t){Vi(t.element()).filter(Mi).each((function(e){Ga(e,"z-index").each((function(t){cu(e,ZW,t)})),Ua(e,"z-index",qa(t.element(),"z-index"))}))},nq=function(t,e){t.getSystem().addToGui(e),eq(e)},rq=function(t){tq(t),t.getSystem().removeFromGui(t)},oq=function(t,e,n){return t.getSystem().build(GT.sketch({dom:{styles:{left:"0px",top:"0px",width:"100%",height:"100%",position:"fixed","z-index":"1000000000000000"},classes:[e]},events:n}))},iq=zn("snaps",[vn("getSnapPoints"),Ns("onSensor"),vn("leftAttr"),vn("topAttr"),Pn("lazyViewport",Zc),Pn("mustSnap",!1)]),uq=[Pn("useFixed",f),vn("blockerClass"),Pn("getTarget",a),Pn("onDrag",n),Pn("repositionTarget",!0),Pn("onDrop",n),Un("getBounds",Zc),iq],aq=function(t){return ip(Ga(t,"left"),Ga(t,"top"),Ga(t,"position"),(function(t,e,n){var r="fixed"===n?LW:HW;return r(parseInt(t,10),parseInt(e,10))})).getOrThunk((function(){var e=Sc(t);return IW(e.left(),e.top())}))},cq=function(t,e,n,r,o){var i=o.bounds,u=DW(e,n,r),a=lf(u.left(),i.x,i.x+i.width-o.width),c=lf(u.top(),i.y,i.y+i.height-o.height),s=IW(a,c);return e.fold((function(){var t=NW(s,n,r);return HW(t.left(),t.top())}),(function(){return s}),(function(){var t=AW(s,n,r);return LW(t.left(),t.top())}))},sq=function(t,e,n,r,o,i,u){var a=e.fold((function(){var t=BW(n,i.left(),i.top()),e=AW(t,r,o);return LW(e.left(),e.top())}),(function(e){var u=qW(t,e,n,i,r,o);return u.extra.each((function(n){e.onSensor(t,n)})),u.coord}));return cq(t,a,r,o,u)},lq=function(t,e,n,r){var o=e.getTarget(t.element());if(e.repositionTarget){var i=Hi(t.element()),u=Hc(i),a=dV(o),c=aq(o),s=sq(t,e.snaps,c,u,a,r,n),l=zW(s,u,a);Wa(o,l)}e.onDrag(t,o,r)},fq=function(t,e){return{bounds:t.getBounds(),height:vc(e.element()),width:_c(e.element())}},dq=function(t,e,n,r,o){var i=n.update(r,o),u=n.getStartData().getOrThunk((function(){return fq(e,t)}));i.each((function(n){lq(t,e,u,n)}))},mq=function(t,e,n,r){e.each(rq),n.snaps.each((function(e){$W(t,e)}));var o=n.getTarget(t.element());r.reset(),n.onDrop(t,o)},gq=function(t){return function(e,n){var r=function(t){n.setStartData(fq(e,t))};return di(p([pi(Ko(),(function(t){n.getStartData().each((function(){return r(t)}))}))],t(e,n,r)))}},hq=function(t){return di([pi(wo(),t.forceDrop),pi(So(),t.drop),pi(xo(),(function(e,n){t.move(n.event())})),pi(Co(),t.delayDrop)])},pq=function(t){return C.from(wc(t.x(),t.y()))},vq=function(t,e){return wc(e.left()-t.left(),e.top()-t.top())},bq=Object.freeze({__proto__:null,getData:pq,getDelta:vq}),yq=function(t,e,n){return[pi(wo(),(function(r,o){var i=o.event().raw();if(0===i.button){o.stop();var u=function(){return mq(r,C.some(s),t,e)},a=wT(u,200),c={drop:u,delayDrop:a.schedule,forceDrop:u,move:function(n){a.cancel(),dq(r,t,e,bq,n)}},s=oq(r,t.blockerClass,hq(c)),l=function(){n(r),nq(r,s)};l()}}))]},wq=p(uq,[Bs("dragger",{handlers:gq(yq)})]),xq=function(t){return di([pi(po(),t.forceDrop),pi(bo(),t.drop),pi(yo(),t.drop),pi(vo(),(function(e,n){t.move(n.event())}))])},Cq=function(t){var e=t[0];return C.some(wc(e.clientX,e.clientY))},Sq=function(t){var e=t.raw(),n=e.touches;return 1===n.length?Cq(n):C.none()},kq=function(t,e){return wc(e.left()-t.left(),e.top()-t.top())},Oq=Object.freeze({__proto__:null,getData:Sq,getDelta:kq}),Tq=function(t,e,n){var r=Gn(C.none());return[pi(po(),(function(o,i){i.stop();var u=function(){mq(o,r.get(),t,e),r.set(C.none())},a={drop:u,delayDrop:function(){},forceDrop:u,move:function(n){dq(o,t,e,Oq,n)}},c=oq(o,t.blockerClass,xq(a));r.set(C.some(c));var s=function(){n(o),nq(o,c)};s()})),pi(vo(),(function(n,r){r.stop(),dq(n,t,e,Oq,r.event())})),pi(bo(),(function(n,o){o.stop(),mq(n,r.get(),t,e),r.set(C.none())})),pi(yo(),(function(n){mq(n,r.get(),t,e),r.set(C.none())}))]},Eq=p(uq,[Bs("dragger",{handlers:gq(Tq)})]),_q=function(t,e,n){return p(yq(t,e,n),Tq(t,e,n))},Aq=p(uq,[Bs("dragger",{handlers:gq(_q)})]),Dq=wq,Nq=Eq,Rq=Aq,Mq=Object.freeze({__proto__:null,mouse:Dq,touch:Nq,mouseOrTouch:Rq}),zq=function(){var t=C.none(),e=C.none(),n=function(){t=C.none(),e=C.none()},r=function(e,n){var r=t.map((function(t){return e.getDelta(t,n)}));return t=C.some(n),r},o=function(t,e){return t.getData(e).bind((function(e){return r(t,e)}))},i=function(t){e=C.some(t)},a=function(){return e},c=u({});return ju({readState:c,reset:n,update:o,getStartData:a,setStartData:i})},Bq=Object.freeze({__proto__:null,init:zq}),Pq=Ml({branchKey:"mode",branches:Mq,name:"dragging",active:{events:function(t,e){var n=t.dragger;return n.handlers(t,e)}},extra:{snap:function(t){return{sensor:t.sensor,range:t.range,output:t.output,extra:C.from(t.extra)}}},state:Bq,apis:QW}),Hq=40,Iq=Hq/2,Lq=function(t,e,n,r,o,i){return t.fold((function(){return Pq.snap({sensor:IW(n-Iq,r-Iq),range:wc(o,i),output:IW(C.some(n),C.some(r)),extra:{td:e}})}),(function(t){var o=n-Iq,i=r-Iq,u=Hq,a=Hq,c=t.element().dom().getBoundingClientRect();return Pq.snap({sensor:IW(o,i),range:wc(u,a),output:IW(C.some(n-c.width/2),C.some(r-c.height/2)),extra:{td:e}})}))},Fq=function(t,e,n){var r=function(t,e){return t.exists((function(t){return no(t,e)}))};return{getSnapPoints:t,leftAttr:"data-drag-left",topAttr:"data-drag-top",onSensor:function(t,o){var i=o.td;r(e.get(),i)||(e.set(C.some(i)),n(i))},mustSnap:!0}},Vq=function(t){return jw(Uw.sketch({dom:{tag:"div",classes:["tox-selector"]},buttonBehaviours:Al([Pq.config({mode:"mouseOrTouch",blockerClass:"blocker",snaps:t}),S_.config({})]),eventOrder:{mousedown:["dragging","alloy.base.behaviour"],touchstart:["dragging","alloy.base.behaviour"]}}))},Uq=function(t,e){var n=Gn([]),r=Gn([]),o=Gn(!1),i=Gn(C.none()),u=Gn(C.none()),a=function(t){var n=Qc(t);return Lq(m.getOpt(e),t,n.x,n.y,n.width,n.height)},c=function(){return $(n.get(),(function(t){return a(t)}))},s=function(t){var n=Qc(t);return Lq(g.getOpt(e),t,n.right,n.bottom,n.width,n.height)},l=function(){return $(r.get(),(function(t){return s(t)}))},f=Fq(c,i,(function(e){u.get().each((function(n){t.fire("TableSelectorChange",{start:e,finish:n})}))})),d=Fq(l,u,(function(e){i.get().each((function(n){t.fire("TableSelectorChange",{start:n,finish:e})}))})),m=Vq(f),g=Vq(d),h=dc(m.asSpec()),p=dc(g.asSpec()),v=function(e,n,r,o){var i=n.dom().getBoundingClientRect();Ya(e.element(),"display");var u=Fi(Zn.fromDom(t.getBody())).dom().innerHeight,a=r(i),c=o(i,u);(a||c)&&Ua(e.element(),"display","none")},b=function(t,e,n,r){var o=n(e);Pq.snapTo(t,o);var i=function(t){return t[r]<0},u=function(t,e){return t[r]>e};v(t,e,i,u)},y=function(t){return b(h,t,a,"top")},w=function(){return i.get().each(y)},x=function(t){return b(p,t,s,"bottom")},S=function(){return u.get().each(x)};Gr().deviceType.isTouch()&&(t.on("TableSelectionChange",(function(t){o.get()||(Nm(e,h),Nm(e,p),o.set(!0)),i.set(C.some(t.start)),u.set(C.some(t.finish)),t.otherCells.each((function(e){n.set(e.upOrLeftCells),r.set(e.downOrRightCells),y(t.start),x(t.finish)}))})),t.on("ResizeEditor ResizeWindow ScrollContent",(function(){w(),S()})),t.on("TableSelectionClear",(function(){o.get()&&(zm(h),zm(p),o.set(!1)),i.set(C.none()),u.set(C.none())})))};(function(t){t[t["None"]=0]="None",t[t["Both"]=1]="Both",t[t["Vertical"]=2]="Vertical"})(oF||(oF={}));var jq=function(t,e,n,r,o){var i={};return i.height=pj(r+e.top(),pS(t),bS(t)),n===oF.Both&&(i.width=pj(o+e.left(),hS(t),vS(t))),i},Wq=function(t,e,n){var r=Zn.fromDom(t.getContainer()),o=jq(t,e,n,pc(r),Ec(r));Dt(o,(function(t,e){return Ua(r,e,hj(t))})),fO(t)},qq=function(t){if(1===t.nodeType){if("BR"===t.nodeName||t.getAttribute("data-mce-bogus"))return!0;if("bookmark"===t.getAttribute("data-mce-type"))return!0}return!1},$q=function(t,e,n){e.delimiter||(e.delimiter="»");var r=function(r){var o=r||[],i=$(o,(function(e,r){return Uw.sketch({dom:{tag:"div",classes:["tox-statusbar__path-item"],attributes:{role:"button","data-index":r,"tab-index":-1,"aria-level":r+1},innerHtml:e.name},action:function(n){t.focus(),t.selection.select(e.element),t.nodeChanged()},buttonBehaviours:Al([rk.button(n.isReadOnly),QS()])})})),u={dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":!0},innerHtml:" "+e.delimiter+" "}};return Q(i.slice(1),(function(t,e){var n=t;return n.push(u),n.push(e),n}),[i[0]])},o=function(e){var n=[],r=e.length;while(r-- >0){var o=e[r];if(1===o.nodeType&&!qq(o)){var i=t.fire("ResolveName",{name:o.nodeName.toLowerCase(),target:o});if(i.isDefaultPrevented()||n.push({name:i.name,element:o}),i.isPropagationStopped())break}}return n};return{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:Al([ny.config({mode:"flow",selector:"div[role=button]"}),cS.config({disabled:n.isReadOnly}),QS(),rE.config({}),dy.config({}),gy("elementPathEvents",[Ti((function(e,n){t.shortcuts.add("alt+F11","focus statusbar elementpath",(function(){return ny.focusIn(e)})),t.on("NodeChange",(function(t){var n=o(t.parents);n.length>0?dy.set(e,r(n)):dy.set(e,[])}))}))])]),components:[]}},Gq=function(t,e){var n=function(t,n,r){return dy.set(t,[sc(e.translate(["{0} "+r,n[r]]))])};return Uw.sketch({dom:{tag:"button",classes:["tox-statusbar__wordcount"]},components:[],buttonBehaviours:Al([rk.button(e.isReadOnly),QS(),rE.config({}),dy.config({}),Vg.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),gy("wordcount-events",[Ai((function(t){var e=Vg.getValue(t),r="words"===e.mode?"characters":"words";Vg.setValue(t,{mode:r,count:e.count}),n(t,e.count,r)})),Ti((function(e){t.on("wordCountUpdate",(function(t){var r=Vg.getValue(e).mode;Vg.setValue(e,{mode:r,count:t.wordCount}),n(e,t.wordCount,r)}))}))])]),eventOrder:{"alloy.execute":["disabling","alloy.base.behaviour","wordcount-events"]}})},Kq=function(t,e){var n=function(n){return{dom:{tag:"div",classes:["tox-statusbar__resize-handle"],attributes:{title:e.translate("Resize"),"aria-hidden":"true"},innerHtml:qw("resize-handle",e.icons)},behaviours:Al([Pq.config({mode:"mouse",repositionTarget:!1,onDrag:function(e,r,o){Wq(t,o,n)},blockerClass:"tox-blocker"})])}},r=function(){var t=jC.translate(["Powered by {0}","Tiny"]),e='<a href="https://www.tiny.cloud/?utm_campaign=editor_referral&utm_medium=poweredby&utm_source=tinymce&utm_content=v5" rel="noopener" target="_blank" tabindex="-1" aria-label="'+t+'">'+t+"</a>";return{dom:{tag:"span",classes:["tox-statusbar__branding"],innerHtml:e}}},o=function(t){var e=!zr(t.getParam("plugins","","string"),"autoresize"),n=t.getParam("resize",e);return!1===n?oF.None:"both"===n?oF.Both:oF.Vertical},i=function(){var n=[];return t.getParam("elementpath",!0,"boolean")&&n.push($q(t,{},e)),zr(t.getParam("plugins","","string"),"wordcount")&&n.push(Gq(t,e)),t.getParam("branding",!0,"boolean")&&n.push(r()),n.length>0?[{dom:{tag:"div",classes:["tox-statusbar__text-container"]},components:n}]:[]},u=function(){var e=i(),r=o(t);return r!==oF.None&&e.push(n(r)),e};return{dom:{tag:"div",classes:["tox-statusbar"]},components:u()}},Xq=function(t){var e,n=t.inline,r=n?Oj:lj,o=PS(t)?oU:cU,i=C.none(),u=Gr(),a=u.browser.isIE(),c=a?["tox-platform-ie"]:[],s=u.deviceType.isTouch(),l="tox-platform-touch",f=s?[l]:[],d=DS(t),m=jC.isRtl()?{attributes:{dir:"rtl"}}:{},h={attributes:(e={},e[Mf]=d?gs.BottomToTop:gs.TopToBottom,e)},p=function(){return i.bind(GU.getHeader)},v=function(){return o.isDocked(p)},b=dc({dom:g({tag:"div",classes:["tox","tox-silver-sink","tox-tinymce-aux"].concat(c).concat(f)},m),behaviours:Al([Om.config({useFixed:function(){return v()}})])}),y=function(){return pt.value(b)},w=jw({dom:{tag:"div",classes:["tox-anchorbar"]}}),x=function(){return i.bind((function(t){return w.getOpt(t)})).getOrDie("Could not find a anchor bar element")},S=function(){return i.bind((function(t){return GU.getToolbar(t)})).getOrDie("Could not find more toolbar element")},k=function(){return i.bind((function(t){return GU.getThrobber(t)})).getOrDie("Could not find throbber element")},O=rH(b,t,x),T=GU.parts().menubar({dom:{tag:"div",classes:["tox-menubar"]},backstage:O,onEscape:function(){t.focus()}}),E=ES(t),_=GU.parts().toolbar(g({dom:{tag:"div",classes:["tox-toolbar"]},getSink:y,providers:O.shared.providers,onEscape:function(){t.focus()},type:E,lazyToolbar:S,lazyHeader:function(){return p().getOrDie("Could not find header element")}},h)),A=GU.parts()["multiple-toolbar"]({dom:{tag:"div",classes:["tox-toolbar-overlord"]},providers:O.shared.providers,onEscape:function(){},type:E}),D=GU.parts().socket({dom:{tag:"div",classes:["tox-edit-area"]}}),N=GU.parts().sidebar({dom:{tag:"div",classes:["tox-sidebar"]}}),R=GU.parts().throbber({dom:{tag:"div",classes:["tox-throbber"]},backstage:O}),M=t.getParam("statusbar",!0,"boolean"),z=M&&!n?C.some(Kq(t,O.shared.providers)):C.none(),B={dom:{tag:"div",classes:["tox-sidebar-wrap"]},components:[D,N]},P=OS(t),H=SS(t),I=CS(t),L=function(){return P?[A]:H?[_]:[]},F=GU.parts().header({dom:g({tag:"div",classes:["tox-editor-header"]},h),components:nt([I?[T]:[],L(),MS(t)?[]:[w.asSpec()]]),sticky:PS(t),editor:t,sharedBackstage:O.shared}),V=nt([d?[]:[F],n?[]:[B],d?[F]:[]]),U={dom:{tag:"div",classes:["tox-editor-container"]},components:V},j=nt([[U],n?[]:z.toArray(),[R]]),W=BS(t),q=g(g({role:"application"},jC.isRtl()?{dir:"rtl"}:{}),W?{"aria-hidden":"true"}:{}),$=dc(GU.sketch({dom:{tag:"div",classes:["tox","tox-tinymce"].concat(n?["tox-tinymce-inline"]:[]).concat(d?["tox-tinymce--toolbar-bottom"]:[]).concat(f).concat(c),styles:g({visibility:"hidden"},W?{opacity:"0",border:"0"}:{}),attributes:q},components:j,behaviours:Al([ny.config({mode:"cyclic",selector:".tox-menubar, .tox-toolbar, .tox-toolbar__primary, .tox-toolbar__overflow--open, .tox-sidebar__overflow--open, .tox-statusbar__path, .tox-statusbar__wordcount, .tox-statusbar__branding a"})])}));i=C.some($),t.shortcuts.add("alt+F9","focus menubar",(function(){GU.focusMenubar($)})),t.shortcuts.add("alt+F10","focus toolbar",(function(){GU.focusToolbar($)}));var G=KT($),K=KT(b);eV(t,G,K);var X=function(){var t={broadcastAll:K.broadcast,broadcastOn:K.broadcastOn,register:function(){}};return{channels:t}},Y=function(){var e=hj(bj(t)),n=hj(wj(t));return t.inline||(Xa("div","width",n)&&Ua($.element(),"width",n),Xa("div","height",e)?Ua($.element(),"height",e):Ua($.element(),"height","200px")),e},J=function(){o.setup(t,O.shared,p),$j(t,O),kW(t,y,O),xU(t),HU(t,k,O.shared),Nt(_S(t),(function(e,n){t.ui.registry.addGroupToolbarButton(n,e)}));var e=t.ui.registry.getAll(),n=e.buttons,i=e.menuItems,u=e.contextToolbars,a=e.sidebars,c=kS(t),s={menuItems:i,menus:IS(t),menubar:LS(t),toolbar:c.getOrThunk((function(){return FS(t)})),allowToolbarGroups:E===Px.floating,buttons:n,sidebar:a};tV(t,u,b,{backstage:O}),Uq(t,b);var l=t.getElement(),f=Y(),d={mothership:G,uiMothership:K,outerContainer:$},m={targetNode:l,height:f};return r.render(t,d,s,O,m)};return{mothership:G,uiMothership:K,backstage:O,renderUI:J,getUi:X}},Yq=function(t,e){var n=C.from(lu(t,"id")).fold((function(){var t=Cu("dialog-describe");return cu(e,"id",t),t}),a);cu(t,"aria-describedby",n)},Jq=function(t,e){var n=C.from(lu(t,"id")).fold((function(){var t=Cu("dialog-label");return cu(e,"id",t),t}),a);cu(t,"aria-labelledby",n)},Qq=u([vn("lazySink"),_n("dragBlockClass"),Un("getBounds",Zc),Pn("useTabstopAt",u(!0)),Pn("eventOrder",{}),Ug("modalBehaviours",[ny]),Rs("onExecute"),zs("onEscape")]),Zq={sketch:a},t$=u([Ch({name:"draghandle",overrides:function(t,e){return{behaviours:Al([Pq.config({mode:"mouse",getTarget:function(t){return us(t,'[role="dialog"]').getOr(t)},blockerClass:t.dragBlockClass.getOrDie(new Error("The drag blocker class was not specified for a dialog with a drag handle: \n"+JSON.stringify(e,null,2)).message),getBounds:t.getDragBounds})])}}}),wh({schema:[vn("dom")],name:"title"}),wh({factory:Zq,schema:[vn("dom")],name:"close"}),wh({factory:Zq,schema:[vn("dom")],name:"body"}),Ch({factory:Zq,schema:[vn("dom")],name:"footer"}),xh({factory:{sketch:function(t,e){return g(g({},t),{dom:e.dom,components:e.components})}},schema:[Pn("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),Pn("components",[])],name:"blocker"})]),e$=function(t,e,n,r){var o=Cu("alloy.dialog.busy"),i=Cu("alloy.dialog.idle"),u=Al([ny.config({mode:"special",onTab:function(){return C.some(!0)},onShiftTab:function(){return C.some(!0)}}),Sy.config({})]),a=function(e){var n=t.lazySink(e).getOrDie(),a=Gn(C.none()),c=r.blocker(),s=n.getSystem().build(g(g({},c),{components:c.components.concat([mc(e)]),behaviours:Al([Sy.config({}),gy("dialog-blocker-events",[Oi(Oo(),(function(){ny.focusIn(e)})),pi(i,(function(t,n){du(e.element(),"aria-busy")&&(mu(e.element(),"aria-busy"),a.get().each((function(t){return dy.remove(e,t)})))})),pi(o,(function(t,n){cu(e.element(),"aria-busy","true");var r=n.event().getBusySpec();a.get().each((function(t){dy.remove(e,t)}));var o=r(e,u),i=t.getSystem().build(o);a.set(C.some(i)),dy.append(e,mc(i)),i.hasConfigured(ny)&&ny.focusIn(i)}))])])}));Nm(n,s),ny.focusIn(e)},c=function(t){Vi(t.element()).each((function(e){t.getSystem().getByDom(e).each((function(t){zm(t)}))}))},s=function(e){return Ph(e,t,"body")},l=function(e){return Ph(e,t,"footer")},f=function(t,e){ai(t,o,{getBusySpec:e})},d=function(t){ui(t,i)},m=Cu("modal-events"),h=g(g({},t.eventOrder),{"alloy.system.attached":[m].concat(t.eventOrder["alloy.system.attached"]||[])});return{uid:t.uid,dom:t.dom,components:e,apis:{show:a,hide:c,getBody:s,getFooter:l,setIdle:d,setBusy:f},eventOrder:h,domModification:{attributes:{role:"dialog","aria-modal":"true"}},behaviours:Wg(t.modalBehaviours,[dy.config({}),ny.config({mode:"cyclic",onEnter:t.onExecute,onEscape:t.onEscape,useTabstopAt:t.useTabstopAt}),gy(m,[Ti((function(e){Jq(e.element(),Ph(e,t,"title").element()),Yq(e.element(),Ph(e,t,"body").element())}))])])}},n$=ep({name:"ModalDialog",configFields:Qq(),partFields:t$(),factory:e$,apis:{show:function(t,e){t.show(e)},hide:function(t,e){t.hide(e)},getBody:function(t,e){return t.getBody(e)},getFooter:function(t,e){return t.getFooter(e)},setBusy:function(t,e,n){t.setBusy(e,n)},setIdle:function(t,e){t.setIdle(e)}}}),r$=Ie([wn("type"),wn("name")].concat(gC)),o$=dn,i$=[qe("name","name",ne((function(){return Cu("button-name")})),fn),Nn("icon"),Fn("align","end",["start","end"]),Vn("primary",!1),Vn("disabled",!1)],u$=p(i$,[wn("text")]),a$=p([xn("type",["submit","cancel","custom"])],u$),c$=p([xn("type",["menu"]),Nn("text"),Nn("tooltip"),Nn("icon"),En("items",r$)],i$),s$=an("type",{submit:a$,cancel:a$,custom:a$,menu:c$}),l$=[wn("type"),wn("text"),xn("level",["info","warn","error","success"]),wn("icon"),Pn("url","")],f$=Ie(l$),d$=function(t){return[wn("type"),t]},m$=[wn("type"),wn("text"),Vn("disabled",!1),Vn("primary",!1),qe("name","name",ne((function(){return Cu("button-name")})),fn),Nn("icon"),Vn("borderless",!1)],g$=Ie(m$),h$=[wn("type"),wn("name"),wn("label"),Vn("disabled",!1)],p$=Ie(h$),v$=dn,b$=[wn("type"),wn("name")],y$=b$.concat([Nn("label")]),w$=y$,x$=Ie(w$),C$=fn,S$=y$,k$=Ie(S$),O$=fn,T$=y$,E$=Ie(T$),_$=Ye(),A$=function(t){return[wn("type"),yn("columns"),t]},D$=y$.concat([Vn("sandboxed",!0)]),N$=Ie(D$),R$=fn,M$=y$.concat([Nn("inputMode"),Nn("placeholder"),Vn("maximized",!1),Vn("disabled",!1)]),z$=Ie(M$),B$=fn,P$=y$.concat([Tn("items",[wn("text"),wn("value")]),In("size",1),Vn("disabled",!1)]),H$=Ie(P$),I$=fn,L$=y$.concat([Vn("constrain",!0),Vn("disabled",!1)]),F$=Ie(L$),V$=Ie([wn("width"),wn("height")]),U$=y$.concat([Nn("placeholder"),Vn("maximized",!1),Vn("disabled",!1)]),j$=Ie(U$),W$=fn,q$=y$.concat([Fn("filetype","file",["image","media","file"]),Pn("disabled",!1)]),$$=Ie(q$),G$=Ie([wn("value"),Pn("meta",{})]),K$=b$.concat([Ln("tag","textarea"),wn("scriptId"),wn("scriptUrl"),jn("settings",void 0)]),X$=b$.concat([Ln("tag","textarea"),Sn("init")]),Y$=Qe((function(t){return en("customeditor.old",He(X$),t).orThunk((function(){return en("customeditor.new",He(K$),t)}))})),J$=fn,Q$=[wn("type"),wn("html"),Fn("presets","presentation",["presentation","document"])],Z$=Ie(Q$),tG=y$.concat([bn("currentState",Ie([vn("blob"),wn("url")]))]),eG=Ie(tG),nG=y$.concat([Pn("columns","auto")]),rG=Ie(nG),oG=Xe([wn("value"),wn("text"),wn("icon")]),iG=function(t){return[wn("type"),wn("label"),t]},uG=[wn("type"),En("header",fn),En("cells",Le(fn))],aG=Ie(uG),cG=function(t){return qe("items","items",te(),Le(Qe((function(e){return en("Checking item of "+t,sG,e).fold((function(t){return pt.error(on(t))}),(function(t){return pt.value(t)}))}))))},sG=Je((function(){return un("type",{alertbanner:f$,bar:Ie(d$(cG("bar"))),button:g$,checkbox:p$,colorinput:x$,colorpicker:k$,dropzone:E$,grid:Ie(A$(cG("grid"))),iframe:N$,input:z$,selectbox:H$,sizeinput:F$,textarea:j$,urlinput:$$,customeditor:Y$,htmlpanel:Z$,imagetools:eG,collection:rG,label:Ie(iG(cG("label"))),table:aG,panel:fG})})),lG=[wn("type"),Pn("classes",[]),En("items",sG)],fG=Ie(lG),dG=[qe("name","name",ne((function(){return Cu("tab-name")})),fn),wn("title"),En("items",sG)],mG=[wn("type"),Tn("tabs",dG)],gG=Ie(mG),hG=u$,pG=s$,vG=Ie([wn("title"),bn("body",un("type",{panel:fG,tabpanel:gG})),Ln("size","normal"),En("buttons",pG),Pn("initialData",{}),Un("onAction",n),Un("onChange",n),Un("onSubmit",n),Un("onClose",n),Un("onCancel",n),Pn("onTabChange",n)]),bG=function(t){return en("dialog",vG,t)},yG=function(t){return _(t)?[t].concat(rt(It(t),yG)):A(t)?rt(t,yG):[]},wG=function(t){return E(t.type)&&E(t.name)},xG={checkbox:v$,colorinput:C$,colorpicker:O$,dropzone:_$,input:B$,iframe:R$,sizeinput:V$,selectbox:I$,size:V$,textarea:W$,urlinput:G$,customeditor:J$,collection:oG,togglemenuitem:o$},CG=function(t){return C.from(xG[t.type])},SG=function(t){return Y(yG(t),wG)},kG=function(t){var e=SG(t),n=rt(e,(function(t){return CG(t).fold((function(){return[]}),(function(e){return[bn(t.name,e)]}))}));return Ie(n)},OG=Ie(p([xn("type",["cancel","custom"])],hG)),TG=Ie([wn("title"),wn("url"),Dn("height"),Dn("width"),Mn("buttons",OG),Un("onAction",n),Un("onCancel",n),Un("onClose",n),Un("onMessage",n)]),EG=function(t){return en("dialog",TG,t)},_G=function(t){var e=nn(bG(t)),n=kG(t),r=t.initialData;return{internalDialog:e,dataValidator:n,initialData:r}},AG={open:function(t,e){var n=_G(e);return t(n.internalDialog,n.initialData,n.dataValidator)},openUrl:function(t,e){var n=nn(EG(e));return t(n)},redial:function(t){return _G(t)}},DG=function(t){var e=[],n={};return Dt(t,(function(t,r){t.fold((function(){e.push(r)}),(function(t){n[r]=t}))})),e.length>0?pt.error(e):pt.value(n)},NG=function(t,n){var r=jw(bN.sketch((function(e){return{dom:{tag:"div",classes:["tox-form"].concat(t.classes)},components:$(t.items,(function(t){return UB(e,t,n)}))}})));return{dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[r.asSpec()]}],behaviours:Al([ny.config({mode:"acyclic",useTabstopAt:s(eR)}),AN.memento(r),WN.memento(r,{postprocess:function(t){return DG(t).fold((function(t){return e.console.error(t),{}}),(function(t){return t}))}})])}},RG=function(t,e){return{uid:t.uid,dom:t.dom,components:t.components,events:Wy(t.action),behaviours:Wg(t.tabButtonBehaviours,[Sy.config({}),ny.config({mode:"execution",useSpace:!0,useEnter:!0}),Vg.config({store:{mode:"memory",initialValue:t.value}})]),domModification:t.domModification}},MG=tp({name:"TabButton",configFields:[Pn("uid",void 0),vn("value"),qe("dom","dom",re((function(){return{attributes:{role:"tab",id:Cu("aria"),"aria-selected":"false"}}})),cn()),_n("action"),Pn("domModification",{}),Ug("tabButtonBehaviours",[Sy,ny,Vg]),vn("view")],factory:RG}),zG=u([vn("tabs"),vn("dom"),Pn("clickToDismiss",!1),Ug("tabbarBehaviours",[Dp,ny]),As(["tabClass","selectedClass"])]),BG=Sh({factory:MG,name:"tabs",unit:"tab",overrides:function(t){var e=function(t,e){Dp.dehighlight(t,e),ai(t,ri(),{tabbar:t,button:e})},r=function(t,e){Dp.highlight(t,e),ai(t,ni(),{tabbar:t,button:e})};return{action:function(o){var i=o.getSystem().getByUid(t.uid).getOrDie(),u=Dp.isHighlighted(i,o),a=function(){return u&&t.clickToDismiss?e:u?n:r}();a(i,o)},domModification:{classes:[t.markers.tabClass]}}}}),PG=u([BG]),HG=function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,"debug.sketcher":"Tabbar",domModification:{attributes:{role:"tablist"}},behaviours:Wg(t.tabbarBehaviours,[Dp.config({highlightClass:t.markers.selectedClass,itemClass:t.markers.tabClass,onHighlight:function(t,e){cu(e.element(),"aria-selected","true")},onDehighlight:function(t,e){cu(e.element(),"aria-selected","false")}}),ny.config({mode:"flow",getInitial:function(t){return Dp.getHighlighted(t).map((function(t){return t.element()}))},selector:"."+t.markers.tabClass,executeOnMove:!0})])}},IG=ep({name:"Tabbar",configFields:zG(),partFields:PG(),factory:HG}),LG=function(t,e){return{uid:t.uid,dom:t.dom,behaviours:Wg(t.tabviewBehaviours,[dy.config({})]),domModification:{attributes:{role:"tabpanel"}}}},FG=tp({name:"Tabview",configFields:[Ug("tabviewBehaviours",[dy])],factory:LG}),VG=u([Pn("selectFirst",!0),Ns("onChangeTab"),Ns("onDismissTab"),Pn("tabs",[]),Ug("tabSectionBehaviours",[])]),UG=wh({factory:IG,schema:[vn("dom"),On("markers",[vn("tabClass"),vn("selectedClass")])],name:"tabbar",defaults:function(t){return{tabs:t.tabs}}}),jG=wh({factory:FG,name:"tabview"}),WG=u([UG,jG]),qG=function(t,e,n,r){var o=function(e){var n=Vg.getValue(e);Bh(e,t,"tabview").each((function(r){var o=tt(t.tabs,(function(t){return t.value===n}));o.each((function(n){var o=n.view();fu(e.element(),"id").each((function(t){cu(r.element(),"aria-labelledby",t)})),dy.set(r,o),t.onChangeTab(r,e,o)}))}))},i=function(e,n){Bh(e,t,"tabbar").each((function(t){n(t).each(ci)}))};return{uid:t.uid,dom:t.dom,components:e,behaviours:jg(t.tabSectionBehaviours),events:di(nt([t.selectFirst?[Ti((function(t,e){i(t,Dp.getFirst)}))]:[],[pi(ni(),(function(t,e){var n=e.event().button();o(n)})),pi(ri(),(function(e,n){var r=n.event().button();t.onDismissTab(e,r)}))]])),apis:{getViewItems:function(e){return Bh(e,t,"tabview").map((function(t){return dy.contents(t)})).getOr([])},showTab:function(t,e){var n=function(t){var n=Dp.getCandidates(t),r=tt(n,(function(t){return Vg.getValue(t)===e}));return r.filter((function(e){return!Dp.isHighlighted(t,e)}))};i(t,n)}}}},$G=ep({name:"TabSection",configFields:VG(),partFields:WG(),factory:qG,apis:{getViewItems:function(t,e){return t.getViewItems(e)},showTab:function(t,e,n){t.showTab(e,n)}}}),GG=function(t,e,n){return $(t,(function(r,o){dy.set(n,t[o].view());var i=e.dom().getBoundingClientRect();return dy.set(n,[]),i.height}))},KG=function(t){return st(ct(t,(function(t,e){return t>e?-1:t<e?1:0})))},XG=function(t,n,r){var o,i=Li(t).dom(),u=us(t,".tox-dialog-wrap").getOr(t),a="fixed"===qa(u,"position");o=a?Math.max(i.clientHeight,e.window.innerHeight):Math.max(i.offsetHeight,i.scrollHeight);var c=pc(n),s=n.dom().offsetLeft>=r.dom().offsetLeft+Ec(r),l=s?Math.max(pc(r),c):c,f=parseInt(qa(t,"margin-top"),10)||0,d=parseInt(qa(t,"margin-bottom"),10)||0,m=pc(t)+f+d,g=m-l;return o-g},YG=function(t,e){st(t).each((function(t){return $G.showTab(e,t.value)}))},JG=function(t,e){Ua(t,"height",e+"px"),Gr().browser.isIE()?Ya(t,"flex-basis"):Ua(t,"flex-basis",e+"px")},QG=function(t,e,n){us(t,'[role="dialog"]').each((function(t){as(t,'[role="tablist"]').each((function(r){n.get().map((function(n){return Ua(e,"height","0"),Ua(e,"flex-basis","0"),Math.min(n,XG(t,e,r))})).each((function(t){JG(e,t)}))}))}))},ZG=function(t){return as(t,'[role="tabpanel"]')},tK=function(t){var e=function(){var e=Gn(C.none()),n=[Ti((function(n){var r=n.element();ZG(r).each((function(o){Ua(o,"visibility","hidden"),n.getSystem().getByDom(o).toOption().each((function(n){var r=GG(t,o,n),i=KG(r);e.set(i)})),QG(r,o,e),Ya(o,"visibility"),YG(t,n),Fw.requestAnimationFrame((function(){QG(r,o,e)}))}))})),pi(Xo(),(function(t){var n=t.element();ZG(n).each((function(t){QG(n,t,e)}))})),pi(bE,(function(t,n){var r=t.element();ZG(r).each((function(t){var n=$l();Ua(t,"visibility","hidden");var o=Ga(t,"height").map((function(t){return parseInt(t,10)}));Ya(t,"height"),Ya(t,"flex-basis");var i=t.dom().getBoundingClientRect().height,u=o.forall((function(t){return i>t}));u?(e.set(C.from(i)),QG(r,t,e)):o.each((function(e){JG(t,e)})),Ya(t,"visibility"),n.each(jl)}))}))],r=!1;return{extraEvents:n,selectFirst:r}}(),n=function(){var t=[],e=!0;return{extraEvents:t,selectFirst:e}}();return{smartTabHeight:e,naiveTabHeight:n}},eK="send-data-to-section",nK="send-data-to-view",rK=function(t,e){var n=Gn({}),r=function(t){var e=Vg.getValue(t),r=DG(e).getOr({}),o=n.get(),i=Kt(o,r);n.set(i)},o=function(t){var e=n.get();Vg.setValue(t,e)},i=Gn(null),u=$(t.tabs,(function(t){return{value:t.name,dom:{tag:"div",classes:["tox-dialog__body-nav-item"],innerHtml:e.shared.providers.translate(t.title)},view:function(){return[bN.sketch((function(n){return{dom:{tag:"div",classes:["tox-form"]},components:$(t.items,(function(t){return UB(n,t,e)})),formBehaviours:Al([ny.config({mode:"acyclic",useTabstopAt:s(eR)}),gy("TabView.form.events",[Ti(o),Ei(r)]),Ll.config({channels:le([{key:eK,value:{onReceive:r}},{key:nK,value:{onReceive:o}}])})])}}))]}}})),a=tK(u).smartTabHeight;return $G.sketch({dom:{tag:"div",classes:["tox-dialog__body"]},onChangeTab:function(t,e,n){var r=Vg.getValue(e);ai(t,vE,{name:r,oldName:i.get()}),i.set(r)},tabs:u,components:[$G.parts().tabbar({dom:{tag:"div",classes:["tox-dialog__body-nav"]},components:[IG.parts().tabs({})],markers:{tabClass:"tox-tab",selectedClass:"tox-dialog__body-nav-item--active"},tabbarBehaviours:Al([rE.config({})])}),$G.parts().tabview({dom:{tag:"div",classes:["tox-dialog__body-content"]}})],selectFirst:a.selectFirst,tabSectionBehaviours:Al([gy("tabpanel",a.extraEvents),ny.config({mode:"acyclic"}),lp.config({find:function(t){return st($G.getViewItems(t))}}),Vg.config({store:{mode:"manual",getValue:function(t){return t.getSystem().broadcastOn([eK],{}),n.get()},setValue:function(t,e){n.set(e),t.getSystem().broadcastOn([nK],{})}}})])})},oK=Cu("update-dialog"),iK=Cu("update-title"),uK=Cu("update-body"),aK=Cu("update-footer"),cK=Cu("body-send-message"),sK=function(t,e,n,r){var o=function(t){switch(t.body.type){case"tabpanel":return[rK(t.body,n)];default:return[NG(t.body,n)]}},i=function(t,e){return C.some({isTabPanel:function(){return"tabpanel"===e.body.type}})},u={"aria-live":"polite"};return{dom:{tag:"div",classes:["tox-dialog__content-js"],attributes:g(g({},e.map((function(t){return{id:t}})).getOr({})),r?u:{})},components:[],behaviours:Al([AN.childAt(0),aL.config({channel:uK,updateState:i,renderComponents:o,initialData:t})])}},lK=function(t,e,n,r){return sK(t,C.some(e),n,r)},fK=function(t,e){var n=sK(t,C.none(),e,!1);return n$.parts().body(n)},dK=function(t){var e={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[QN({dom:{tag:"iframe",attributes:{src:t.url}},behaviours:Al([rE.config({}),Sy.config({})])})]}],behaviours:Al([ny.config({mode:"acyclic",useTabstopAt:s(eR)})])};return n$.parts().body(e)},mK=dk.deviceType.isTouch(),gK=function(t,e){return{dom:{tag:"div",styles:{display:"none"},classes:["tox-dialog__header"]},components:[t,e]}},hK=function(t,e){return n$.parts().close(Uw.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":e.translate("Close")}},action:t,buttonBehaviours:Al([rE.config({})])}))},pK=function(){return n$.parts().title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}})},vK=function(t,e){return n$.parts().body({dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[{dom:MU("<p>"+e.translate(t)+"</p>")}]}]})},bK=function(t){return n$.parts().footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:t})},yK=function(t,e){return[GT.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:t}),GT.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:e})]},wK=function(t){var e,n="tox-dialog",r=n+"-wrap",o=r+"__backdrop",i=n+"__disable-scroll";return n$.sketch({lazySink:t.lazySink,onEscape:function(e){return t.onEscape(e),C.some(!0)},useTabstopAt:function(t){return!eR(t)},dom:{tag:"div",classes:[n].concat(t.extraClasses),styles:g({position:"relative"},t.extraStyles)},components:p([t.header,t.body],t.footer.toArray()),parts:{blocker:{dom:MU('<div class="'+r+'"></div>'),components:[{dom:{tag:"div",classes:mK?[o,o+"--opaque"]:[o]}}]}},dragBlockClass:r,modalBehaviours:Al(p([Sy.config({}),gy("dialog-events",t.dialogEvents.concat([Oi(Oo(),(function(t,e){ny.focusIn(t)}))])),gy("scroll-lock",[Ti((function(){xa(Ia(),i)})),Ei((function(){Sa(Ia(),i)}))])],t.extraBehaviours)),eventOrder:g((e={},e[Lo()]=["dialog-events"],e[Yo()]=["scroll-lock","dialog-events","alloy.base.behaviour"],e[Jo()]=["alloy.base.behaviour","dialog-events","scroll-lock"],e),t.eventOrder)})},xK=function(t){return Uw.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":t.translate("Close"),title:t.translate("Close")}},components:[{dom:{tag:"div",classes:["tox-icon"],innerHtml:'<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg"><path d="M17.953 7.453L13.422 12l4.531 4.547-1.406 1.406L12 13.422l-4.547 4.531-1.406-1.406L10.578 12 6.047 7.453l1.406-1.406L12 10.578l4.547-4.531z" fill-rule="evenodd"></path></svg>'}}],action:function(t){ui(t,dE)}})},CK=function(t,e,n){var r=function(t){return[sc(n.translate(t.title))]};return{dom:{tag:"div",classes:["tox-dialog__title"],attributes:g({},e.map((function(t){return{id:t}})).getOr({}))},components:r(t),behaviours:Al([aL.config({channel:iK,renderComponents:r})])}},SK=function(){return{dom:MU('<div class="tox-dialog__draghandle"></div>')}},kK=function(t,e,n){return GT.sketch({dom:MU('<div class="tox-dialog__header"></div>'),components:[CK(t,C.some(e),n),SK(),xK(n)],containerBehaviours:Al([Pq.config({mode:"mouse",blockerClass:"blocker",getTarget:function(t){return cs(t,'[role="dialog"]').getOrDie()},snaps:{getSnapPoints:function(){return[]},leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])})},OK=function(t,e){var n=n$.parts().title(CK(t,C.none(),e)),r=n$.parts().draghandle(SK()),o=n$.parts().close(xK(e)),i=[n].concat(t.draggable?[r]:[]).concat([o]);return GT.sketch({dom:MU('<div class="tox-dialog__header"></div>'),components:i})},TK=function(t,e){return OK({title:e.shared.providers.translate(t),draggable:e.dialog.isDraggableModal()},e.shared.providers)},EK=function(t,e){return{onClose:function(){return e.closeWindow()},onBlock:function(e){n$.setBusy(t(),(function(t,n){return{dom:{tag:"div",classes:["tox-dialog__busy-spinner"],attributes:{"aria-label":e.message()},styles:{left:"0px",right:"0px",bottom:"0px",top:"0px",position:"absolute"}},behaviours:n,components:[{dom:MU('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}}))},onUnblock:function(){n$.setIdle(t())}}},_K=function(t,e,n,r){var o,i=function(t,e){return C.some(e)};return dc(wK(g(g({},t),{lazySink:r.shared.getSink,extraBehaviours:p([aL.config({channel:oK,updateState:i,initialData:e}),WN.memory({})],t.extraBehaviours),onEscape:function(t){ui(t,dE)},dialogEvents:n,eventOrder:(o={},o[Io()]=["reflecting","receiving"],o[Yo()]=["scroll-lock","reflecting","messages","dialog-events","alloy.base.behaviour"],o[Jo()]=["alloy.base.behaviour","dialog-events","messages","reflecting","scroll-lock"],o)})))},AK=function(t){var e=function(t){var e=$(t.items,(function(t){var e=Gn(!1);return g(g({},t),{storage:e})}));return g(g({},t),{items:e})};return $(t,(function(t){return"menu"===t.type?e(t):t}))},DK=function(t){return Q(t,(function(t,e){if("menu"===e.type){var n=e;return Q(n.items,(function(t,e){return t[e.name]=e.storage,t}),t)}return t}),{})},NK=function(t,e){return[Ci(Oo(),tR),t(fE,(function(t,n){e.onClose(),n.onClose()})),t(dE,(function(t,e,n,r){e.onCancel(t),ui(r,fE)})),pi(pE,(function(t,n){return e.onUnblock()})),pi(hE,(function(t,n){return e.onBlock(n.event())}))]},RK=function(t,e){var n=function(e,n){return pi(e,(function(e,o){r(e,(function(r,i){n(t(),r,o.event(),e)}))}))},r=function(t,e){aL.getState(t).get().each((function(n){e(n,t)}))};return p(NK(n,e),[n(mE,(function(t,e,n){e.onAction(t,{name:n.name()})}))])},MK=function(t,e,n){var r=function(e,n){return pi(e,(function(e,r){o(e,(function(o,i){n(t(),o,r.event(),e)}))}))},o=function(t,e){aL.getState(t).get().each((function(n){e(n.internalDialog,t)}))};return p(NK(r,e),[r(gE,(function(t,e){return e.onSubmit(t)})),r(lE,(function(t,e,n){e.onChange(t,{name:n.name()})})),r(mE,(function(t,e,r,o){var i=function(){return ny.focusIn(o)},u=function(t){return du(t,"disabled")||fu(t,"aria-disabled").exists((function(t){return"true"===t}))},a=$l();e.onAction(t,{name:r.name(),value:r.value()}),$l().fold(i,(function(t){u(t)||a.exists((function(e){return io(t,e)&&u(e)}))?i():n().toOption().filter((function(e){return!io(e.element(),t)})).each(i)}))})),r(vE,(function(t,e,n){e.onTabChange(t,{newTabName:n.name(),oldTabName:n.oldName()})})),Ei((function(e){var n=t();Vg.setValue(e,n.getData())}))])},zK={initUrlDialog:RK,initDialog:MK},BK=function(t,e){return UM(t,t.type,e)},PK=function(t,e,n){return tt(e,(function(t){return t.name===n})).bind((function(e){return e.memento.getOpt(t)}))},HK=function(t,e){var n=e.map((function(t){return t.footerButtons})).getOr([]),r=X(n,(function(t){return"start"===t.align})),o=function(t,e){return GT.sketch({dom:{tag:"div",classes:["tox-dialog__footer-"+t]},components:$(e,(function(t){return t.memento.asSpec()}))})},i=o("start",r.pass),u=o("end",r.fail);return[i,u]},IK=function(t,e){var n=function(t,n){var r=$(n.buttons,(function(t){var n=jw(BK(t,e));return{name:t.name,align:t.align,memento:n}})),o=function(t,e){return PK(t,r,e)};return C.some({lookupByName:o,footerButtons:r})};return{dom:MU('<div class="tox-dialog__footer"></div>'),components:[],behaviours:Al([aL.config({channel:aK,initialData:t,updateState:n,renderComponents:HK})])}},LK=function(t,e){return IK(t,e)},FK=function(t,e){return n$.parts().footer(IK(t,e))},VK=function(t,e){var n=t.getRoot();if(n.getSystem().isConnected()){var r=lp.getCurrent(t.getFormWrapper()).getOr(t.getFormWrapper());return bN.getField(r,e).fold((function(){var n=t.getFooter(),o=aL.getState(n);return o.get().bind((function(t){return t.lookupByName(r,e)}))}),(function(t){return C.some(t)}))}return C.none()},UK=function(t,e){var n=t.getRoot();return aL.getState(n).get().map((function(t){return nn(en("data",t.dataValidator,e))})).getOr(e)},jK=function(t,e,n){var r=function(e){var n=t.getRoot();n.getSystem().isConnected()&&e(n)},o=function(){var e=t.getRoot(),r=e.getSystem().isConnected()?t.getFormWrapper():e,o=Vg.getValue(r),i=Nt(n,(function(t){return t.get()}));return g(g({},o),i)},i=function(e){r((function(r){var o=h.getData(),i=g(g({},o),e),u=UK(t,i),a=t.getFormWrapper();Vg.setValue(a,u),Dt(n,(function(t,e){Ft(i,e)&&t.set(i[e])}))}))},u=function(e){VK(t,e).each(cS.disable)},a=function(e){VK(t,e).each(cS.enable)},c=function(e){VK(t,e).each(Sy.focus)},s=function(t){if(!E(t))throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");r((function(e){ai(e,hE,{message:t})}))},l=function(){r((function(t){ui(t,pE)}))},f=function(e){r((function(n){var r=t.getBody(),o=aL.getState(r);o.get().exists((function(t){return t.isTabPanel()}))&&lp.getCurrent(r).each((function(t){$G.showTab(t,e)}))}))},d=function(t){r((function(n){var r=e(t);n.getSystem().broadcastOn([oK],r),n.getSystem().broadcastOn([iK],r.internalDialog),n.getSystem().broadcastOn([uK],r.internalDialog),n.getSystem().broadcastOn([aK],r.internalDialog),h.setData(r.initialData)}))},m=function(){r((function(t){ui(t,fE)}))},h={getData:o,setData:i,disable:u,enable:a,focus:c,block:s,unblock:l,showTab:f,redial:d,close:m};return h},WK=function(t,e,n){var r=TK(t.internalDialog.title,n),o=fK({body:t.internalDialog.body},n),i=AK(t.internalDialog.buttons),u=DK(i),a=FK({buttons:i},n),c=zK.initDialog((function(){return m}),EK((function(){return f}),e),n.shared.getSink),s="normal"!==t.internalDialog.size?"large"===t.internalDialog.size?["tox-dialog--width-lg"]:["tox-dialog--width-md"]:[],l={header:r,body:o,footer:C.some(a),extraClasses:s,extraBehaviours:[],extraStyles:{}},f=_K(l,t,c,n),d=function(){var t=function(){var t=n$.getBody(f);return lp.getCurrent(t).getOr(t)};return{getRoot:function(){return f},getBody:function(){return n$.getBody(f)},getFooter:function(){return n$.getFooter(f)},getFormWrapper:t}}(),m=jK(d,e.redial,u);return{dialog:f,instanceApi:m}},qK=function(t,e,n,r){var o,i,u=Cu("dialog-label"),a=Cu("dialog-content"),c=function(t,e){return C.some(e)},s=jw(kK({title:t.internalDialog.title,draggable:!0},u,n.shared.providers)),l=jw(lK({body:t.internalDialog.body},a,n,r)),f=AK(t.internalDialog.buttons),d=DK(f),m=jw(LK({buttons:f},n)),g=zK.initDialog((function(){return p}),{onBlock:function(){},onUnblock:function(){},onClose:function(){return e.closeWindow()}},n.shared.getSink),h=dc({dom:{tag:"div",classes:["tox-dialog","tox-dialog-inline"],attributes:(o={role:"dialog"},o["aria-labelledby"]=u,o["aria-describedby"]=""+a,o)},eventOrder:(i={},i[Io()]=[aL.name(),Ll.name()],i[Lo()]=["execute-on-form"],i[Yo()]=["reflecting","execute-on-form"],i),behaviours:Al([ny.config({mode:"cyclic",onEscape:function(t){return ui(t,fE),C.some(!0)},useTabstopAt:function(t){return!eR(t)&&("button"!==Di(t)||"disabled"!==lu(t,"disabled"))}}),aL.config({channel:oK,updateState:c,initialData:t}),Sy.config({}),gy("execute-on-form",g.concat([Oi(Oo(),(function(t,e){ny.focusIn(t)}))])),WN.memory({})]),components:[s.asSpec(),l.asSpec(),m.asSpec()]}),p=jK({getRoot:function(){return h},getFooter:function(){return m.get(h)},getBody:function(){return l.get(h)},getFormWrapper:function(){var t=l.get(h);return lp.getCurrent(t).getOr(t)}},e.redial,d);return{dialog:h,instanceApi:p}},$K=tinymce.util.Tools.resolve("tinymce.util.URI"),GK=function(t){var e=function(e){t.getSystem().isConnected()&&e(t)},n=function(t){if(!E(t))throw new Error("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument");e((function(e){ai(e,hE,{message:t})}))},r=function(){e((function(t){ui(t,pE)}))},o=function(){e((function(t){ui(t,fE)}))},i=function(t){e((function(e){e.getSystem().broadcastOn([cK],t)}))};return{block:n,unblock:r,close:o,sendMessage:i}},KK=["insertContent","setContent","execCommand","close","block","unblock"],XK=function(t){return _(t)&&-1!==KK.indexOf(t.mceAction)},YK=function(t){return!XK(t)&&_(t)&&Ft(t,"mceAction")},JK=function(t,e,n){switch(n.mceAction){case"insertContent":t.insertContent(n.content);break;case"setContent":t.setContent(n.content);break;case"execCommand":var r=!!D(n.ui)&&n.ui;t.execCommand(n.cmd,r,n.value);break;case"close":e.close();break;case"block":e.block(n.message);break;case"unblock":e.unblock();break}},QK=function(t,n,r,o){var i,u=TK(t.title,o),a=dK(t),c=t.buttons.bind((function(t){return 0===t.length?C.none():C.some(FK({buttons:t},o))})),s=zK.initUrlDialog((function(){return y}),EK((function(){return b}),n)),l=g(g({},t.height.fold((function(){return{}}),(function(t){return{height:t+"px","max-height":t+"px"}}))),t.width.fold((function(){return{}}),(function(t){return{width:t+"px","max-width":t+"px"}}))),f=t.width.isNone()&&t.height.isNone()?["tox-dialog--width-lg"]:[],d=new $K(t.url,{base_uri:new $K(e.window.location.href)}),m=d.protocol+"://"+d.host+(d.port?":"+d.port:""),h=Gn(C.none()),p=[gy("messages",[Ti((function(){var n=pT(Zn.fromDom(e.window),"message",(function(e){if(d.isSameOrigin(new $K(e.raw().origin))){var n=e.raw().data;XK(n)?JK(r,y,n):YK(n)&&t.onMessage(y,n)}}));h.set(C.some(n))})),Ei((function(){h.get().each((function(t){return t.unbind()}))}))]),Ll.config({channels:(i={},i[cK]={onReceive:function(t,e){as(t.element(),"iframe").each((function(t){var n=t.dom().contentWindow;n.postMessage(e,m)}))}},i)})],v={header:u,body:a,footer:c,extraClasses:f,extraBehaviours:p,extraStyles:l},b=_K(v,t,s,o),y=GK(b);return{dialog:b,instanceApi:y}},ZK=function(t){var e=t.backstage.shared,n=function(n,r){var o=function(){n$.hide(c),r()},i=jw(UM({name:"close-alert",text:"OK",primary:!0,align:"end",disabled:!1,icon:C.none()},"cancel",t.backstage)),u=pK(),a=hK(o,e.providers),c=dc(wK({lazySink:function(){return e.getSink()},header:gK(u,a),body:vK(n,e.providers),footer:C.some(bK(yK([],[i.asSpec()]))),onEscape:o,extraClasses:["tox-alert-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[pi(dE,o)],eventOrder:{}}));n$.show(c);var s=i.get(c);Sy.focus(s)};return{open:n}},tX=function(t){var e=t.backstage.shared,n=function(n,r){var o=function(t){n$.hide(s),r(t)},i=jw(UM({name:"yes",text:"Yes",primary:!0,align:"end",disabled:!1,icon:C.none()},"submit",t.backstage)),u=UM({name:"no",text:"No",primary:!1,align:"end",disabled:!1,icon:C.none()},"cancel",t.backstage),a=pK(),c=hK((function(){return o(!1)}),e.providers),s=dc(wK({lazySink:function(){return e.getSink()},header:gK(a,c),body:vK(n,e.providers),footer:C.some(bK(yK([],[u,i.asSpec()]))),onEscape:function(){return o(!1)},extraClasses:["tox-confirm-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[pi(dE,(function(){return o(!1)})),pi(gE,(function(){return o(!0)}))],eventOrder:{}}));n$.show(s);var l=i.get(s);Sy.focus(l)};return{open:n}},eX=function(t,e){return nn(en("data",e,t))},nX=function(t){return yT(t,".tox-alert-dialog")||yT(t,".tox-confirm-dialog")},rX=function(t,e,n){return e&&n?[]:[jV.config({contextual:{lazyContext:function(){return C.some(Jc(Zn.fromDom(t.getContentAreaContainer())))},fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},modes:["top"]})]},oX=function(t){var e=t.backstage,n=t.editor,r=PS(n),o=ZK(t),i=tX(t),u=function(t,n,r){return void 0!==n&&"toolbar"===n.inline?l(t,e.shared.anchors.inlineDialog(),r,n.ariaAttrs):void 0!==n&&"cursor"===n.inline?l(t,e.shared.anchors.cursor(),r,n.ariaAttrs):s(t,r)},a=function(t,e){return c(t,e)},c=function(t,r){var o=function(t){var o=QK(t,{closeWindow:function(){n$.hide(o.dialog),r(o.instanceApi)}},n,e);return n$.show(o.dialog),o.instanceApi};return AG.openUrl(o,t)},s=function(t,n){var r=function(t,r,o){var i=r,u={dataValidator:o,initialData:i,internalDialog:t},a=WK(u,{redial:AG.redial,closeWindow:function(){n$.hide(a.dialog),n(a.instanceApi)}},e);return n$.show(a.dialog),a.instanceApi.setData(i),a.instanceApi};return AG.open(r,t)},l=function(t,o,i,u){var a=function(t,a,c){var s=eX(a,c),l=mj(),f=e.shared.header.isPositionedAtTop(),d={dataValidator:c,initialData:s,internalDialog:t},m=function(){return l.on((function(t){_w.reposition(t),jV.refresh(t)}))},h=qK(d,{redial:AG.redial,closeWindow:function(){l.on(_w.hide),n.off("ResizeEditor",m),l.clear(),i(h.instanceApi)}},e,u),v=dc(_w.sketch(g(g({lazySink:e.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:{}},f?{}:{fireRepositionEventInstead:{}}),{inlineBehaviours:Al(p([gy("window-manager-inline-events",[pi(Qo(),(function(t,e){ui(h.dialog,dE)}))])],rX(n,r,f))),isExtraPart:function(t,e){return nX(e)}})));return l.set(v),_w.showWithin(v,o,mc(h.dialog),C.some(Ia())),r&&f||(jV.refresh(v),n.on("ResizeEditor",m)),h.instanceApi.setData(s),ny.focusIn(h.dialog),h.instanceApi};return AG.open(a,t)},f=function(t,e){i.open(t,(function(t){e(t)}))},d=function(t,e){o.open(t,(function(){e()}))},m=function(t){t.close()};return{open:u,openUrl:a,alert:d,close:m,confirm:f}};function iX(){m.add("silver",(function(t){var e=Xq(t),n=e.uiMothership,r=e.backstage,o=e.renderUI,i=e.getUi;gT.register(t,r.shared);var a=oX({editor:t,backstage:r});return{renderUI:o,getWindowManagerImpl:u(a),getNotificationManagerImpl:function(){return Jw(t,{backstage:r},n)},ui:i()}}))}iX()})(window)}).call(this,n("c8ba"))},"07d1":function(t,e,n){n("94ce")},"09cf":function(t,e){(function(t){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");function n(){e.add("textcolor",(function(){t.console.warn("Text color plugin is now built in to the core editor, please remove it from your editor configuration")}))}n()})(window)},"1f38":function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return o}));var r=function(){return"undefined"!==typeof window?window:t},o=function(){var t=r();return t&&t.tinymce?t.tinymce:null}}).call(this,n("c8ba"))},2401:function(t,e){(function(t){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(){},r=function(t){return function(){return t}},o=function(t){return function(e){return!t(e)}},i=r(!1),u=r(!0),a=function(){return c},c=function(){var t=function(t){return t.isNone()},e=function(t){return t()},o=function(t){return t},c={fold:function(t,e){return t()},is:i,isSome:i,isNone:u,getOr:o,getOrThunk:e,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:r(null),getOrUndefined:r(void 0),or:o,orThunk:e,map:a,each:n,bind:a,exists:i,forall:u,filter:a,equals:t,equals_:t,toArray:function(){return[]},toString:r("none()")};return c}(),s=function(t){var e=r(t),n=function(){return a},o=function(e){return e(t)},a={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:u,isNone:i,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return s(e(t))},each:function(e){e(t)},bind:o,exists:o,forall:o,filter:function(e){return e(t)?a:c},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(i,(function(e){return n(t,e)}))}};return a},l=function(t){return null===t||void 0===t?c:s(t)},f={some:s,none:a,from:l},d=function(t){var e=typeof t;return null===t?"null":"object"===e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e},m=function(t){return function(e){return d(e)===t}},g=function(t){return function(e){return typeof e===t}},h=m("string"),p=m("array"),v=g("boolean"),b=g("function"),y=g("number"),w=Array.prototype.slice,x=Array.prototype.push,C=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},S=function(t,e){for(var n=0,r=t.length;n<r;n++){var o=t[n];e(o,n)}},k=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},O=function(t,e){if(0===t.length)return[];for(var n=e(t[0]),r=[],o=[],i=0,u=t.length;i<u;i++){var a=t[i],c=e(a);c!==n&&(r.push(o),o=[]),n=c,o.push(a)}return 0!==o.length&&r.push(o),r},T=function(t,e,n){return S(t,(function(t){n=e(n,t)})),n},E=function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return f.some(i);if(n(i,r))break}return f.none()},_=function(t,e){return E(t,e,i)},A=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!p(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);x.apply(e,t[n])}return e},D=function(t,e){return A(C(t,e))},N=function(t){var e=w.call(t,0);return e.reverse(),e},R=function(t){return 0===t.length?f.none():f.some(t[0])},M=function(t){return 0===t.length?f.none():f.some(t[t.length-1])},z=function(t,e,n){return 0!==(t.compareDocumentPosition(e)&n)},B=function(e,n){return z(e,n,t.Node.DOCUMENT_POSITION_CONTAINED_BY)},P=function(){return P=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n],e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},P.apply(this,arguments)},H=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}},I=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}},L=function(t,e){var n=I(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return U(r(1),r(2))},F=function(t,e){var n=String(e).toLowerCase();return 0===t.length?V():L(t,n)},V=function(){return U(0,0)},U=function(t,e){return{major:t,minor:e}},j={nu:U,detect:F,unknown:V},W="Edge",q="Chrome",$="IE",G="Opera",K="Firefox",X="Safari",Y=function(){return J({current:void 0,version:j.unknown()})},J=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r(W),isChrome:r(q),isIE:r($),isOpera:r(G),isFirefox:r(K),isSafari:r(X)}},Q={unknown:Y,nu:J,edge:r(W),chrome:r(q),ie:r($),opera:r(G),firefox:r(K),safari:r(X)},Z="Windows",tt="iOS",et="Android",nt="Linux",rt="OSX",ot="Solaris",it="FreeBSD",ut="ChromeOS",at=function(){return ct({current:void 0,version:j.unknown()})},ct=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r(Z),isiOS:r(tt),isAndroid:r(et),isOSX:r(rt),isLinux:r(nt),isSolaris:r(ot),isFreeBSD:r(it),isChromeOS:r(ut)}},st={unknown:at,nu:ct,windows:r(Z),ios:r(tt),android:r(et),linux:r(nt),osx:r(rt),solaris:r(ot),freebsd:r(it),chromeos:r(ut)},lt=function(t,e,n,o){var i=t.isiOS()&&!0===/ipad/i.test(n),u=t.isiOS()&&!i,a=t.isiOS()||t.isAndroid(),c=a||o("(pointer:coarse)"),s=i||!u&&a&&o("(min-device-width:768px)"),l=u||a&&!s,f=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),d=!l&&!s&&!f;return{isiPad:r(i),isiPhone:r(u),isTablet:r(s),isPhone:r(l),isTouch:r(c),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:r(f),isDesktop:r(d)}},ft=function(t,e){var n=String(e).toLowerCase();return _(t,(function(t){return t.search(n)}))},dt=function(t,e){return ft(t,e).map((function(t){var n=j.detect(t.versionRegexes,e);return{current:t.name,version:n}}))},mt=function(t,e){return ft(t,e).map((function(t){var n=j.detect(t.versionRegexes,e);return{current:t.name,version:n}}))},gt={detectBrowser:dt,detectOs:mt},ht=function(t,e){return-1!==t.indexOf(e)},pt=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,vt=function(t){return function(e){return ht(e,t)}},bt=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return ht(t,"edge/")&&ht(t,"chrome")&&ht(t,"safari")&&ht(t,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,pt],search:function(t){return ht(t,"chrome")&&!ht(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return ht(t,"msie")||ht(t,"trident")}},{name:"Opera",versionRegexes:[pt,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:vt("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:vt("firefox")},{name:"Safari",versionRegexes:[pt,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(ht(t,"safari")||ht(t,"mobile/"))&&ht(t,"applewebkit")}}],yt=[{name:"Windows",search:vt("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return ht(t,"iphone")||ht(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:vt("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:vt("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:vt("linux"),versionRegexes:[]},{name:"Solaris",search:vt("sunos"),versionRegexes:[]},{name:"FreeBSD",search:vt("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:vt("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],wt={browsers:r(bt),oses:r(yt)},xt=function(t,e){var n=wt.browsers(),r=wt.oses(),o=gt.detectBrowser(n,t).fold(Q.unknown,Q.nu),i=gt.detectOs(r,t).fold(st.unknown,st.nu),u=lt(i,o,t,e);return{browser:o,os:i,deviceType:u}},Ct={detect:xt},St=function(e){return t.window.matchMedia(e).matches},kt=H((function(){return Ct.detect(t.navigator.userAgent,St)})),Ot=function(){return kt()},Tt=function(e,n){var r=n||t.document,o=r.createElement("div");if(o.innerHTML=e,!o.hasChildNodes()||o.childNodes.length>1)throw t.console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return At(o.childNodes[0])},Et=function(e,n){var r=n||t.document,o=r.createElement(e);return At(o)},_t=function(e,n){var r=n||t.document,o=r.createTextNode(e);return At(o)},At=function(t){if(null===t||void 0===t)throw new Error("Node cannot be null or undefined");return{dom:r(t)}},Dt=function(t,e,n){var r=t.dom();return f.from(r.elementFromPoint(e,n)).map(At)},Nt={fromHtml:Tt,fromTag:Et,fromText:_t,fromDom:At,fromPoint:Dt},Rt=1,Mt=function(t,e){var n=t.dom();if(n.nodeType!==Rt)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},zt=function(t,e){return t.dom()===e.dom()},Bt=function(t,e){var n=t.dom(),r=e.dom();return n!==r&&n.contains(r)},Pt=function(t,e){return B(t.dom(),e.dom())},Ht=function(t,e){return Ot().browser.isIE()?Pt(t,e):Bt(t,e)},It=Mt,Lt=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),Ft=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),Vt=tinymce.util.Tools.resolve("tinymce.util.VK"),Ut=function(t,e,n){return t.isSome()&&e.isSome()?f.some(n(t.getOrDie(),e.getOrDie())):f.none()},jt=function(e,n){var r=n||t.document,o=r.createDocumentFragment();return S(e,(function(t){o.appendChild(t.dom())})),Nt.fromDom(o)},Wt=("undefined"!==typeof t.window?t.window:Function("return this;")(),function(t){var e=t.dom().nodeName;return e.toLowerCase()}),qt=function(t){return t.dom().nodeType},$t=function(t){return function(e){return qt(e)===t}},Gt=$t(Rt),Kt=function(t){return f.from(t.dom().parentNode).map(Nt.fromDom)},Xt=function(t){return C(t.dom().childNodes,Nt.fromDom)},Yt=function(t,e){var n=t.dom().childNodes;return f.from(n[e]).map(Nt.fromDom)},Jt=function(t){return Yt(t,0)},Qt=function(t){return Yt(t,t.dom().childNodes.length-1)},Zt=function(t,e){var n=Kt(t);n.each((function(n){n.dom().insertBefore(e.dom(),t.dom())}))},te=function(t,e){t.dom().appendChild(e.dom())},ee=function(t,e){S(e,(function(e){Zt(t,e)}))},ne=function(t,e){S(e,(function(e){te(t,e)}))},re=function(t){var e=t.dom();null!==e.parentNode&&e.parentNode.removeChild(e)},oe=function(t,e,n){return t.fire("ListMutation",{action:e,element:n})},ie=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),ue=tinymce.util.Tools.resolve("tinymce.util.Tools"),ae=function(t){return function(e){return e&&e.nodeName.toLowerCase()===t}},ce=function(t){return function(e){return e&&t.test(e.nodeName)}},se=function(t){return t&&3===t.nodeType},le=ce(/^(OL|UL|DL)$/),fe=ce(/^(OL|UL)$/),de=ae("ol"),me=ce(/^(LI|DT|DD)$/),ge=ce(/^(DT|DD)$/),he=ce(/^(TH|TD)$/),pe=ae("br"),ve=function(t){return t.parentNode.firstChild===t},be=function(t,e){return e&&!!t.schema.getTextBlockElements()[e.nodeName]},ye=function(t,e){return t&&t.nodeName in e},we=function(t,e){return!!pe(e)&&!(!t.isBlock(e.nextSibling)||pe(e.previousSibling))},xe=function(t,e,n){var r=t.isEmpty(e);return!(n&&t.select("span[data-mce-type=bookmark]",e).length>0)&&r},Ce=function(t,e){return t.isChildOf(e,t.getRoot())},Se=function(t,e){var n=e||t.selection.getStart(!0);return t.dom.getParent(n,"OL,UL,DL",De(t,n))},ke=function(t,e){return t&&1===e.length&&e[0]===t},Oe=function(t){return ue.grep(t.querySelectorAll("ol,ul,dl"),(function(t){return le(t)}))},Te=function(t){var e=Se(t),n=t.selection.getSelectedBlocks();return ke(e,n)?Oe(e):ue.grep(n,(function(t){return le(t)&&e!==t}))},Ee=function(t,e){var n=ue.map(e,(function(e){var n=t.dom.getParent(e,"li,dd,dt",De(t,e));return n||e}));return ie.unique(n)},_e=function(t){var e=t.selection.getSelectedBlocks();return ue.grep(Ee(t,e),(function(t){return me(t)}))},Ae=function(t){return k(_e(t),ge)},De=function(t,e){var n=t.dom.getParents(e,"TD,TH"),r=n.length>0?n[0]:t.getBody();return r},Ne=function(t,e){var n=t.dom.getParents(e,"ol,ul",De(t,e));return M(n)},Re=function(t){var e=Ne(t,t.selection.getStart()),n=k(t.selection.getSelectedBlocks(),fe);return e.toArray().concat(n)},Me=function(t){var e=Re(t);return ze(t,e)},ze=function(t,e){var n=C(e,(function(e){return Ne(t,e).getOr(e)}));return ie.unique(n)},Be=function(t){return t.getParam("lists_indent_on_tab",!0)},Pe=function(t){var e=t.getParam("forced_root_block","p");return!1===e?"":!0===e?"p":e},He=function(t){return t.getParam("forced_root_block_attrs",{})},Ie=function(t,e){var n,r,o,i=t.dom,u=t.schema.getBlockElements(),a=i.createFragment(),c=Pe(t);if(c&&(r=i.create(c),r.tagName===c.toUpperCase()&&i.setAttribs(r,He(t)),ye(e.firstChild,u)||a.appendChild(r)),e)while(n=e.firstChild){var s=n.nodeName;o||"SPAN"===s&&"bookmark"===n.getAttribute("data-mce-type")||(o=!0),ye(n,u)?(a.appendChild(n),r=null):c?(r||(r=i.create(c),a.appendChild(r)),r.appendChild(n)):a.appendChild(n)}return c?o||r.appendChild(i.create("br",{"data-mce-bogus":"1"})):a.appendChild(i.create("br")),a},Le=Object.keys,Fe=function(t,e){for(var n=Le(t),r=0,o=n.length;r<o;r++){var i=n[r],u=t[i];e(u,i)}},Ve=function(t){return function(e,n){t[n]=e}},Ue=function(t,e,n,r){var o={};return Fe(t,(function(t,o){(e(t,o)?n:r)(t,o)})),o},je=function(t,e){var r={};return Ue(t,e,Ve(r),n),r},We=function(e,n,r){if(!(h(r)||v(r)||y(r)))throw t.console.error("Invalid call to Attr.set. Key ",n,":: Value ",r,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(n,r+"")},qe=function(t,e){var n=t.dom();Fe(e,(function(t,e){We(n,e,t)}))},$e=function(t){return T(t.dom().attributes,(function(t,e){return t[e.name]=e.value,t}),{})},Ge=function(t){return void 0!==t.style&&b(t.style.getPropertyValue)},Ke=(b(t.Element.prototype.attachShadow)&&b(t.Node.prototype.getRootNode),function(e,n,r){if(!h(r))throw t.console.error("Invalid call to CSS.set. Property ",n,":: Value ",r,":: Element ",e),new Error("CSS value must be a string: "+r);Ge(e)&&e.style.setProperty(n,r)}),Xe=function(t,e,n){var r=t.dom();Ke(r,e,n)},Ye=function(t,e){return Nt.fromDom(t.dom().cloneNode(e))},Je=function(t){return Ye(t,!0)},Qe=function(t,e){var n=Nt.fromTag(e),r=$e(t);return qe(n,r),n},Ze=function(t,e){var n=Qe(t,e);Zt(t,n);var r=Xt(t);return ne(n,r),re(t),n},tn=function(t,e){te(t.item,e.list)},en=function(t){for(var e=1;e<t.length;e++)tn(t[e-1],t[e])},nn=function(t,e){Ut(M(t),R(e),tn)},rn=function(t,e){var n={list:Nt.fromTag(e,t),item:Nt.fromTag("li",t)};return te(n.list,n.item),n},on=function(t,e,n){for(var r=[],o=0;o<n;o++)r.push(rn(t,e.listType));return r},un=function(t,e){for(var n=0;n<t.length-1;n++)Xe(t[n].item,"list-style-type","none");M(t).each((function(t){qe(t.list,e.listAttributes),qe(t.item,e.itemAttributes),ne(t.item,e.content)}))},an=function(t,e){Wt(t.list)!==e.listType&&(t.list=Ze(t.list,e.listType)),qe(t.list,e.listAttributes)},cn=function(t,e,n){var r=Nt.fromTag("li",t);return qe(r,e),ne(r,n),r},sn=function(t,e){te(t.list,e),t.item=e},ln=function(t,e,n){var r=e.slice(0,n.depth);return M(r).each((function(e){var r=cn(t,n.itemAttributes,n.content);sn(e,r),an(e,n)})),r},fn=function(t,e,n){var r=on(t,n,n.depth-e.length);return en(r),un(r,n),nn(e,r),e.concat(r)},dn=function(t,e){var n=T(e,(function(e,n){return n.depth>e.length?fn(t,e,n):ln(t,e,n)}),[]);return R(n).map((function(t){return t.list}))},mn=function(t){return It(t,"OL,UL")},gn=function(t){return Jt(t).map(mn).getOr(!1)},hn=function(t){return Qt(t).map(mn).getOr(!1)},pn=function(t){return t.depth>0},vn=function(t){return t.isSelected},bn=function(t){var e=Xt(t),n=hn(t)?e.slice(0,-1):e;return C(n,Je)},yn=function(t,e,n){return Kt(t).filter(Gt).map((function(r){return{depth:e,dirty:!1,isSelected:n,content:bn(t),itemAttributes:$e(t),listAttributes:$e(r),listType:Wt(r)}}))},wn=function(t,e){switch(t){case"Indent":e.depth++;break;case"Outdent":e.depth--;break;case"Flatten":e.depth=0}e.dirty=!0},xn=function(t,e){t.listType=e.listType,t.listAttributes=P({},e.listAttributes)},Cn=function(t){t.listAttributes=je(t.listAttributes,(function(t,e){return"start"!==e}))},Sn=function(t,e){var n=t[e].depth,r=function(t){return t.depth===n&&!t.dirty},o=function(t){return t.depth<n};return E(N(t.slice(0,e)),r,o).orThunk((function(){return E(t.slice(e+1),r,o)}))},kn=function(t){return S(t,(function(e,n){Sn(t,n).fold((function(){e.dirty&&Cn(e)}),(function(t){return xn(e,t)}))})),t},On=function(t){var e=t,n=function(){return e},r=function(t){e=t};return{get:n,set:r}},Tn=function(t,e,n,r){return Jt(r).filter(mn).fold((function(){e.each((function(t){zt(t.start,r)&&n.set(!0)}));var o=yn(r,t,n.get());e.each((function(t){zt(t.end,r)&&n.set(!1)}));var i=Qt(r).filter(mn).map((function(r){return En(t,e,n,r)})).getOr([]);return o.toArray().concat(i)}),(function(r){return En(t,e,n,r)}))},En=function(t,e,n,r){return D(Xt(r),(function(r){var o=mn(r)?En:Tn,i=t+1;return o(i,e,n,r)}))},_n=function(t,e){var n=On(!1),r=0;return C(t,(function(t){return{sourceList:t,entries:En(r,e,n,t)}}))},An=function(t,e){var n=kn(e);return C(n,(function(e){var n=jt(e.content);return Nt.fromDom(Ie(t,n.dom()))}))},Dn=function(t,e){var n=kn(e);return dn(t.contentDocument,n).toArray()},Nn=function(t,e){return D(O(e,pn),(function(e){var n=R(e).map(pn).getOr(!1);return n?Dn(t,e):An(t,e)}))},Rn=function(t,e){S(k(t,vn),(function(t){return wn(e,t)}))},Mn=function(t){var e=C(_e(t),Nt.fromDom);return Ut(_(e,o(gn)),_(N(e),o(gn)),(function(t,e){return{start:t,end:e}}))},zn=function(t,e,n){var r=_n(e,Mn(t));S(r,(function(e){Rn(e.entries,n);var r=Nn(t,e.entries);S(r,(function(e){oe(t,"Indent"===n?"IndentList":"OutdentList",e.dom())})),ee(e.sourceList,r),re(e.sourceList)}))},Bn=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Pn=Bn.DOM,Hn=function(t,e,n){var r=function(t){ue.each(o,(function(e){t.parentNode.insertBefore(e,n.parentNode)})),Pn.remove(t)},o=Pn.select('span[data-mce-type="bookmark"]',e),i=Ie(t,n),u=Pn.createRng();u.setStartAfter(n),u.setEndAfter(e);for(var a=u.extractContents(),c=a.firstChild;c;c=c.firstChild)if("LI"===c.nodeName&&t.dom.isEmpty(c)){Pn.remove(c);break}t.dom.isEmpty(a)||Pn.insertAfter(a,e),Pn.insertAfter(i,e),xe(t.dom,n.parentNode)&&r(n.parentNode),Pn.remove(n),xe(t.dom,e)&&Pn.remove(e)},In=function(t,e){It(e,"dd")?Ze(e,"dt"):It(e,"dt")&&Kt(e).each((function(n){return Hn(t,n.dom(),e.dom())}))},Ln=function(t){It(t,"dt")&&Ze(t,"dd")},Fn=function(t,e,n){S(n,"Indent"===e?Ln:function(e){return In(t,e)})},Vn=function(t,e){if(se(t))return{container:t,offset:e};var n=Lt.getNode(t,e);return se(n)?{container:n,offset:e>=t.childNodes.length?n.data.length:0}:n.previousSibling&&se(n.previousSibling)?{container:n.previousSibling,offset:n.previousSibling.data.length}:n.nextSibling&&se(n.nextSibling)?{container:n.nextSibling,offset:0}:{container:t,offset:e}},Un=function(t){var e=t.cloneRange(),n=Vn(t.startContainer,t.startOffset);e.setStart(n.container,n.offset);var r=Vn(t.endContainer,t.endOffset);return e.setEnd(r.container,r.offset),e},jn=function(t,e){var n=C(Me(t),Nt.fromDom),r=C(Ae(t),Nt.fromDom),o=!1;if(n.length||r.length){var i=t.selection.getBookmark();zn(t,n,e),Fn(t,e,r),t.selection.moveToBookmark(i),t.selection.setRng(Un(t.selection.getRng())),t.nodeChanged(),o=!0}return o},Wn=function(t){return jn(t,"Indent")},qn=function(t){return jn(t,"Outdent")},$n=function(t){return jn(t,"Flatten")},Gn=tinymce.util.Tools.resolve("tinymce.dom.BookmarkManager"),Kn=Bn.DOM,Xn=function(t){var e={},n=function(n){var r,o,i;o=t[n?"startContainer":"endContainer"],i=t[n?"startOffset":"endOffset"],1===o.nodeType&&(r=Kn.create("span",{"data-mce-type":"bookmark"}),o.hasChildNodes()?(i=Math.min(i,o.childNodes.length-1),n?o.insertBefore(r,o.childNodes[i]):Kn.insertAfter(r,o.childNodes[i])):o.appendChild(r),o=r,i=0),e[n?"startContainer":"endContainer"]=o,e[n?"startOffset":"endOffset"]=i};return n(!0),t.collapsed||n(),e},Yn=function(t){function e(e){var n,r,o,i=function(t){var e=t.parentNode.firstChild,n=0;while(e){if(e===t)return n;1===e.nodeType&&"bookmark"===e.getAttribute("data-mce-type")||n++,e=e.nextSibling}return-1};n=o=t[e?"startContainer":"endContainer"],r=t[e?"startOffset":"endOffset"],n&&(1===n.nodeType&&(r=i(n),n=n.parentNode,Kn.remove(o),!n.hasChildNodes()&&Kn.isBlock(n)&&n.appendChild(Kn.create("br"))),t[e?"startContainer":"endContainer"]=n,t[e?"startOffset":"endOffset"]=r)}e(!0),e();var n=Kn.createRng();return n.setStart(t.startContainer,t.startOffset),t.endContainer&&n.setEnd(t.endContainer,t.endOffset),Un(n)},Jn=function(t){switch(t){case"UL":return"ToggleUlList";case"OL":return"ToggleOlList";case"DL":return"ToggleDLList"}},Qn=function(t){return/\btox\-/.test(t.className)},Zn=function(t,e,n){return function(){var r=function(t){var r=E(t.parents,le,he).filter((function(t){return t.nodeName===e&&!Qn(t)})).isSome();n(r)};return t.on("NodeChange",r),function(){return t.off("NodeChange",r)}}},tr=function(t,e,n){var r=n["list-style-type"]?n["list-style-type"]:null;t.setStyle(e,"list-style-type",r)},er=function(t,e){ue.each(e,(function(e,n){t.setAttribute(n,e)}))},nr=function(t,e,n){er(e,n["list-attributes"]),ue.each(t.select("li",e),(function(t){er(t,n["list-item-attributes"])}))},rr=function(t,e,n){tr(t,e,n),nr(t,e,n)},or=function(t,e,n){ue.each(n,(function(n){var r;return t.setStyle(e,(r={},r[n]="",r))}))},ir=function(t,e,n,r){var o=e[n?"startContainer":"endContainer"],i=e[n?"startOffset":"endOffset"];1===o.nodeType&&(o=o.childNodes[Math.min(i,o.childNodes.length-1)]||o),!n&&pe(o.nextSibling)&&(o=o.nextSibling);while(o.parentNode!==r){if(be(t,o))return o;if(/^(TD|TH)$/.test(o.parentNode.nodeName))return o;o=o.parentNode}return o},ur=function(t,e,n){for(var r,o=[],i=t.dom,u=ir(t,e,!0,n),a=ir(t,e,!1,n),c=[],s=u;s;s=s.nextSibling)if(c.push(s),s===a)break;return ue.each(c,(function(e){if(be(t,e))return o.push(e),void(r=null);if(i.isBlock(e)||pe(e))return pe(e)&&i.remove(e),void(r=null);var u=e.nextSibling;Gn.isBookmarkNode(e)&&(be(t,u)||!u&&e.parentNode===n)?r=null:(r||(r=i.create("p"),e.parentNode.insertBefore(r,e),o.push(r)),r.appendChild(e))})),o},ar=function(t,e,n){var r=t.getStyle(e,"list-style-type"),o=n?n["list-style-type"]:"";return o=null===o?"":o,r===o},cr=function(t,e,n){void 0===n&&(n={});var r=t.selection.getRng(),o="LI",i=De(t,t.selection.getStart(!0)),u=t.dom;if("false"!==u.getContentEditable(t.selection.getNode())){e=e.toUpperCase(),"DL"===e&&(o="DT");var a=Xn(r);ue.each(ur(t,r,i),(function(r){var i,a=r.previousSibling;a&&le(a)&&a.nodeName===e&&ar(u,a,n)?(i=a,r=u.rename(r,o),a.appendChild(r)):(i=u.create(e),r.parentNode.insertBefore(i,r),i.appendChild(r),r=u.rename(r,o)),or(u,r,["margin","margin-right","margin-bottom","margin-left","margin-top","padding","padding-right","padding-bottom","padding-left","padding-top"]),rr(u,i,n),mr(t.dom,i)})),t.selection.setRng(Yn(a))}},sr=function(t,e){return t&&e&&le(t)&&t.nodeName===e.nodeName},lr=function(t,e,n){var r=t.getStyle(e,"list-style-type",!0),o=t.getStyle(n,"list-style-type",!0);return r===o},fr=function(t,e){return t.className===e.className},dr=function(t,e,n){return sr(e,n)&&lr(t,e,n)&&fr(e,n)},mr=function(t,e){var n,r;if(n=e.nextSibling,dr(t,e,n)){while(r=n.firstChild)e.appendChild(r);t.remove(n)}if(n=e.previousSibling,dr(t,e,n)){while(r=n.lastChild)e.insertBefore(r,e.firstChild);t.remove(n)}},gr=function(t,e,n,r){if(e.nodeName!==n){var o=t.dom.rename(e,n);rr(t.dom,o,r),oe(t,Jn(n),o)}else rr(t.dom,e,r),oe(t,Jn(n),e)},hr=function(t,e,n,r,o){if(e.nodeName!==r||pr(o)){var i=Xn(t.selection.getRng(!0));ue.each([e].concat(n),(function(e){gr(t,e,r,o)})),t.selection.setRng(Yn(i))}else $n(t)},pr=function(t){return"list-style-type"in t},vr=function(t,e,n,r){if(e!==t.getBody())if(e)if(e.nodeName!==n||pr(r)||Qn(e)){var o=Xn(t.selection.getRng(!0));rr(t.dom,e,r);var i=t.dom.rename(e,n);mr(t.dom,i),t.selection.setRng(Yn(o)),oe(t,Jn(n),i)}else $n(t);else cr(t,n,r),oe(t,Jn(n),e)},br=function(t,e,n){var r=Se(t),o=Te(t);n=n||{},r&&o.length>0?hr(t,r,o,e,n):vr(t,r,e,n)},yr=Bn.DOM,wr=function(t,e){var n,r=e.parentNode;"LI"===r.nodeName&&r.firstChild===e&&(n=r.previousSibling,n&&"LI"===n.nodeName?(n.appendChild(e),xe(t,r)&&yr.remove(r)):yr.setStyle(r,"listStyleType","none")),le(r)&&(n=r.previousSibling,n&&"LI"===n.nodeName&&n.appendChild(e))},xr=function(t,e){ue.each(ue.grep(t.select("ol,ul",e)),(function(e){wr(t,e)}))},Cr=function(t,e,n,r){var o=e.startContainer,i=e.startOffset;if(se(o)&&(n?i<o.data.length:i>0))return o;var u=t.schema.getNonEmptyElements();1===o.nodeType&&(o=Lt.getNode(o,i));var a=new Ft(o,r);n&&we(t.dom,o)&&a.next();while(o=a[n?"next":"prev2"]()){if("LI"===o.nodeName&&!o.hasChildNodes())return o;if(u[o.nodeName])return o;if(se(o)&&o.data.length>0)return o}},Sr=function(t,e){var n=e.childNodes;return 1===n.length&&!le(n[0])&&t.isBlock(n[0])},kr=function(t,e){Sr(t,e)&&t.remove(e.firstChild,!0)},Or=function(t,e,n){var r,o=Sr(t,n)?n.firstChild:n;if(kr(t,e),!xe(t,e,!0))while(r=e.firstChild)o.appendChild(r)},Tr=function(t,e,n){var r,o=e.parentNode;if(Ce(t,e)&&Ce(t,n)){le(n.lastChild)&&(r=n.lastChild),o===n.lastChild&&pe(o.previousSibling)&&t.remove(o.previousSibling);var i=n.lastChild;i&&pe(i)&&e.hasChildNodes()&&t.remove(i),xe(t,n,!0)&&t.$(n).empty(),Or(t,e,n),r&&n.appendChild(r);var u=Ht(Nt.fromDom(n),Nt.fromDom(e)),a=u?t.getParents(e,le,n):[];t.remove(e),S(a,(function(e){xe(t,e)&&e!==t.getRoot()&&t.remove(e)}))}},Er=function(t,e,n){t.dom.$(n).empty(),Tr(t.dom,e,n),t.selection.setCursorLocation(n)},_r=function(t,e,n,r){var o=t.dom;if(o.isEmpty(r))Er(t,n,r);else{var i=Xn(e);Tr(o,n,r),t.selection.setRng(Yn(i))}},Ar=function(t,e,n,r){var o=Xn(e);Tr(t.dom,n,r);var i=Yn(o);t.selection.setRng(i)},Dr=function(t,e){var n=t.dom,r=t.selection,o=r.getStart(),i=De(t,o),u=n.getParent(r.getStart(),"LI",i);if(u){var a=u.parentNode;if(a===t.getBody()&&xe(n,a))return!0;var c=Un(r.getRng()),s=n.getParent(Cr(t,c,e,i),"LI",i);if(s&&s!==u)return t.undoManager.transact((function(){e?_r(t,c,s,u):ve(u)?qn(t):Ar(t,c,u,s)})),!0;if(!s&&!e&&0===c.startOffset&&0===c.endOffset)return t.undoManager.transact((function(){$n(t)})),!0}return!1},Nr=function(t,e,n){var r=t.getParent(e.parentNode,t.isBlock,n);t.remove(e),r&&t.isEmpty(r)&&t.remove(r)},Rr=function(t,e){var n=t.dom,r=t.selection.getStart(),o=De(t,r),i=n.getParent(r,n.isBlock,o);if(i&&n.isEmpty(i)){var u=Un(t.selection.getRng()),a=n.getParent(Cr(t,u,e,o),"LI",o);if(a)return t.undoManager.transact((function(){Nr(n,i,o),mr(n,a.parentNode),t.selection.select(a,!0),t.selection.collapse(e)})),!0}return!1},Mr=function(t,e){return Dr(t,e)||Rr(t,e)},zr=function(t){var e=t.selection.getStart(),n=De(t,e),r=t.dom.getParent(e,"LI,DT,DD",n);return!!(r||_e(t).length>0)&&(t.undoManager.transact((function(){t.execCommand("Delete"),xr(t.dom,t.getBody())})),!0)},Br=function(t,e){return t.selection.isCollapsed()?Mr(t,e):zr(t)},Pr=function(t){t.on("keydown",(function(e){e.keyCode===Vt.BACKSPACE?Br(t,!1)&&e.preventDefault():e.keyCode===Vt.DELETE&&Br(t,!0)&&e.preventDefault()}))},Hr=function(t){return{backspaceDelete:function(e){Br(t,e)}}},Ir=function(t){var e=t.dom,n=Se(t);de(n)&&t.windowManager.open({title:"List Properties",body:{type:"panel",items:[{type:"input",name:"start",label:"Start list at number",inputMode:"numeric"}]},initialData:{start:e.getAttrib(n,"start")||"1"},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:function(n){var r=n.getData();t.undoManager.transact((function(){e.setAttrib(Se(t),"start","1"===r.start?"":r.start)})),n.close()}})},Lr=function(t,e){return function(){var n=t.dom.getParent(t.selection.getStart(),"UL,OL,DL");return n&&n.nodeName===e}},Fr=function(t){t.on("BeforeExecCommand",(function(e){var n=e.command.toLowerCase();"indent"===n?Wn(t):"outdent"===n&&qn(t)})),t.addCommand("InsertUnorderedList",(function(e,n){br(t,"UL",n)})),t.addCommand("InsertOrderedList",(function(e,n){br(t,"OL",n)})),t.addCommand("InsertDefinitionList",(function(e,n){br(t,"DL",n)})),t.addCommand("RemoveList",(function(){$n(t)})),t.addCommand("mceListProps",(function(){Ir(t)})),t.addQueryStateHandler("InsertUnorderedList",Lr(t,"UL")),t.addQueryStateHandler("InsertOrderedList",Lr(t,"OL")),t.addQueryStateHandler("InsertDefinitionList",Lr(t,"DL"))},Vr=function(t){return!(!/(^|[ ,])rtc([, ]|$)/.test(t.getParam("plugins","","string"))||!e.get("rtc"))},Ur=function(t){t.on("keydown",(function(e){e.keyCode!==Vt.TAB||Vt.metaKeyPressed(e)||t.undoManager.transact((function(){(e.shiftKey?qn(t):Wn(t))&&e.preventDefault()}))}))},jr=function(t){Be(t)&&Ur(t),Pr(t)},Wr=function(t){var e=function(t,e){var n=t.getParam("plugins","","string");return-1!==ue.inArray(n.split(/[ ,]/),e)},n=function(e){return function(){return t.execCommand(e)}};e(t,"advlist")||(t.ui.registry.addToggleButton("numlist",{icon:"ordered-list",active:!1,tooltip:"Numbered list",onAction:n("InsertOrderedList"),onSetup:function(e){return Zn(t,"OL",e.setActive)}}),t.ui.registry.addToggleButton("bullist",{icon:"unordered-list",active:!1,tooltip:"Bullet list",onAction:n("InsertUnorderedList"),onSetup:function(e){return Zn(t,"UL",e.setActive)}}))},qr=function(t){var e={text:"List properties...",icon:"ordered-list",onAction:function(){return Ir(t)},onSetup:function(e){return Zn(t,"OL",(function(t){return e.setDisabled(!t)}))}};t.ui.registry.addMenuItem("listprops",e),t.ui.registry.addContextMenu("lists",{update:function(e){var n=Se(t,e);return de(n)?["listprops"]:[]}})};function $r(){e.add("lists",(function(t){return!1===Vr(t)&&(jr(t),Fr(t)),Wr(t),qr(t),Hr(t)}))}$r()})(window)},"2d33":function(t,e,n){n("303c")},"303c":function(t,e){(function(t){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");function n(){e.add("colorpicker",(function(){t.console.warn("Color picker plugin is now built in to the core editor, please remove it from your editor configuration")}))}n()})(window)},3154:function(t,e,n){n("f034")},"34de":function(t,e,n){n("09cf")},3699:function(t,e){(function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=function(){return e=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n],e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},e.apply(this,arguments)},n=function(){},r=function(t){return function(){return t}},o=r(!1),i=r(!0),u=function(){return a},a=function(){var t=function(t){return t.isNone()},e=function(t){return t()},a=function(t){return t},c={fold:function(t,e){return t()},is:o,isSome:o,isNone:i,getOr:a,getOrThunk:e,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:r(null),getOrUndefined:r(void 0),or:a,orThunk:e,map:u,each:n,bind:u,exists:o,forall:i,filter:u,equals:t,equals_:t,toArray:function(){return[]},toString:r("none()")};return c}(),c=function(t){var e=r(t),n=function(){return s},u=function(e){return e(t)},s={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:i,isNone:o,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return c(e(t))},each:function(e){e(t)},bind:u,exists:u,forall:u,filter:function(e){return e(t)?s:a},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(o,(function(e){return n(t,e)}))}};return s},s=function(t){return null===t||void 0===t?a:c(t)},l={some:c,none:u,from:s},f=function(t){var e=typeof t;return null===t?"null":"object"===e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e},d=function(t){return function(e){return f(e)===t}},m=d("string"),g=d("object"),h=d("array"),p=Array.prototype.push,v=function(t,e){for(var n=0,r=t.length;n<r;n++){var o=t[n];e(o,n)}},b=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!h(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);p.apply(e,t[n])}return e},y=function(t){var e=t,n=function(){return e},r=function(t){e=t};return{get:n,set:r}},w=Object.keys,x=Object.hasOwnProperty,C=function(t,e){for(var n=w(t),r=0,o=n.length;r<o;r++){var i=n[r],u=t[i];e(u,i)}},S=function(t,e){return k(t,e)?l.from(t[e]):l.none()},k=function(t,e){return x.call(t,e)},O=function(t){return t.getParam("media_scripts")},T=function(t){return t.getParam("audio_template_callback")},E=function(t){return t.getParam("video_template_callback")},_=function(t){return t.getParam("media_live_embeds",!0)},A=function(t){return t.getParam("media_filter_html",!0)},D=function(t){return t.getParam("media_url_resolver")},N=function(t){return t.getParam("media_alt_source",!0)},R=function(t){return t.getParam("media_poster",!0)},M=function(t){return t.getParam("media_dimensions",!0)},z=tinymce.util.Tools.resolve("tinymce.util.Tools"),B=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),P=tinymce.util.Tools.resolve("tinymce.html.SaxParser"),H=function(t,e){if(t)for(var n=0;n<t.length;n++)if(-1!==e.indexOf(t[n].filter))return t[n]},I=B.DOM,L=function(t){return t.replace(/px$/,"")},F=function(t){var e=t.map.style,n=e?I.parseStyle(e):{};return{type:"ephox-embed-iri",source:t.map["data-ephox-embed-iri"],altsource:"",poster:"",width:S(n,"max-width").map(L).getOr(""),height:S(n,"max-height").map(L).getOr("")}},V=function(t,e){var n=y(!1),r={};return P({validate:!1,allow_conditional_comments:!0,start:function(e,o){if(n.get());else if(k(o.map,"data-ephox-embed-iri"))n.set(!0),r=F(o);else{if(r.source||"param"!==e||(r.source=o.map.movie),"iframe"!==e&&"object"!==e&&"embed"!==e&&"video"!==e&&"audio"!==e||(r.type||(r.type=e),r=z.extend(o.map,r)),"script"===e){var i=H(t,o.map.src);if(!i)return;r={type:"script",source:o.map.src,width:String(i.width),height:String(i.height)}}"source"===e&&(r.source?r.altsource||(r.altsource=o.map.src):r.source=o.map.src),"img"!==e||r.poster||(r.poster=o.map.src)}}}).parse(e),r.source=r.source||r.src||r.data,r.altsource=r.altsource||"",r.poster=r.poster||"",r},U=function(t){var e={mp3:"audio/mpeg",m4a:"audio/x-m4a",wav:"audio/wav",mp4:"video/mp4",webm:"video/webm",ogg:"video/ogg",swf:"application/x-shockwave-flash"},n=t.toLowerCase().split(".").pop(),r=e[n];return r||""},j=tinymce.util.Tools.resolve("tinymce.html.Schema"),W=tinymce.util.Tools.resolve("tinymce.html.Writer"),q=B.DOM,$=function(t){return/^[0-9.]+$/.test(t)?t+"px":t},G=function(t,e){C(e,(function(e,n){var r=""+e;if(t.map[n]){var o=t.length;while(o--){var i=t[o];i.name===n&&(r?(t.map[n]=r,i.value=r):(delete t.map[n],t.splice(o,1)))}}else r&&(t.push({name:n,value:r}),t.map[n]=r)}))},K=function(t,e){var n=e.map.style,r=n?q.parseStyle(n):{};r["max-width"]=$(t.width),r["max-height"]=$(t.height),G(e,{style:q.serializeStyle(r)})},X=["source","altsource"],Y=function(t,e,n){var r,o=W(),i=y(!1),u=0;return P({validate:!1,allow_conditional_comments:!0,comment:function(t){o.comment(t)},cdata:function(t){o.cdata(t)},text:function(t,e){o.text(t,e)},start:function(t,a,c){if(i.get());else if(k(a.map,"data-ephox-embed-iri"))i.set(!0),K(e,a);else{switch(t){case"video":case"object":case"embed":case"img":case"iframe":void 0!==e.height&&void 0!==e.width&&G(a,{width:e.width,height:e.height});break}if(n)switch(t){case"video":G(a,{poster:e.poster,src:""}),e.altsource&&G(a,{src:""});break;case"iframe":G(a,{src:e.source});break;case"source":if(u<2&&(G(a,{src:e[X[u]],type:e[X[u]+"mime"]}),!e[X[u]]))return;u++;break;case"img":if(!e.poster)return;r=!0;break}}o.start(t,a,c)},end:function(t){if(!i.get()){if("video"===t&&n)for(var a=0;a<2;a++)if(e[X[a]]){var c=[];c.map={},u<a&&(G(c,{src:e[X[a]],type:e[X[a]+"mime"]}),o.start("source",c,!0))}if(e.poster&&"object"===t&&n&&!r){var s=[];s.map={},G(s,{src:e.poster,width:e.width,height:e.height}),o.start("img",s,!0)}}o.end(t)}},j({})).parse(t),o.getContent()},J=[{regex:/youtu\.be\/([\w\-_\?&=.]+)/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/youtube\.com(.+)v=([^&]+)(&([a-z0-9&=\-_]+))?/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$2?$4",allowFullscreen:!0},{regex:/youtube.com\/embed\/([a-z0-9\?&=\-_]+)/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/vimeo\.com\/([0-9]+)/,type:"iframe",w:425,h:350,url:"player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc",allowFullscreen:!0},{regex:/vimeo\.com\/(.*)\/([0-9]+)/,type:"iframe",w:425,h:350,url:"player.vimeo.com/video/$2?title=0&byline=0",allowFullscreen:!0},{regex:/maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/,type:"iframe",w:425,h:350,url:'maps.google.com/maps/ms?msid=$2&output=embed"',allowFullscreen:!1},{regex:/dailymotion\.com\/video\/([^_]+)/,type:"iframe",w:480,h:270,url:"www.dailymotion.com/embed/video/$1",allowFullscreen:!0},{regex:/dai\.ly\/([^_]+)/,type:"iframe",w:480,h:270,url:"www.dailymotion.com/embed/video/$1",allowFullscreen:!0}],Q=function(t){var e=t.match(/^(https?:\/\/|www\.)(.+)$/i);return e&&e.length>1?"www."===e[1]?"https://":e[1]:"https://"},Z=function(t,e){for(var n=Q(e),r=t.regex.exec(e),o=n+t.url,i=function(t){o=o.replace("$"+t,(function(){return r[t]?r[t]:""}))},u=0;u<r.length;u++)i(u);return o.replace(/\?$/,"")},tt=function(t){var e=J.filter((function(e){return e.regex.test(t)}));return e.length>0?z.extend({},e[0],{url:Z(e[0],t)}):null},et=function(t){var e=t.allowFullscreen?' allowFullscreen="1"':"";return'<iframe src="'+t.source+'" width="'+t.width+'" height="'+t.height+'"'+e+"></iframe>"},nt=function(t){var e='<object data="'+t.source+'" width="'+t.width+'" height="'+t.height+'" type="application/x-shockwave-flash">';return t.poster&&(e+='<img src="'+t.poster+'" width="'+t.width+'" height="'+t.height+'" />'),e+="</object>",e},rt=function(t,e){return e?e(t):'<audio controls="controls" src="'+t.source+'">'+(t.altsource?'\n<source src="'+t.altsource+'"'+(t.altsourcemime?' type="'+t.altsourcemime+'"':"")+" />\n":"")+"</audio>"},ot=function(t,e){return e?e(t):'<video width="'+t.width+'" height="'+t.height+'"'+(t.poster?' poster="'+t.poster+'"':"")+' controls="controls">\n<source src="'+t.source+'"'+(t.sourcemime?' type="'+t.sourcemime+'"':"")+" />\n"+(t.altsource?'<source src="'+t.altsource+'"'+(t.altsourcemime?' type="'+t.altsourcemime+'"':"")+" />\n":"")+"</video>"},it=function(t){return'<script src="'+t.source+'"><\/script>'},ut=function(t,e){var n=z.extend({},e);if(!n.source&&(z.extend(n,V(O(t),n.embed)),!n.source))return"";n.altsource||(n.altsource=""),n.poster||(n.poster=""),n.source=t.convertURL(n.source,"source"),n.altsource=t.convertURL(n.altsource,"source"),n.sourcemime=U(n.source),n.altsourcemime=U(n.altsource),n.poster=t.convertURL(n.poster,"poster");var r=tt(n.source);if(r&&(n.source=r.url,n.type=r.type,n.allowFullscreen=r.allowFullscreen,n.width=n.width||String(r.w),n.height=n.height||String(r.h)),n.embed)return Y(n.embed,n,!0);var o=H(O(t),n.source);o&&(n.type="script",n.width=String(o.width),n.height=String(o.height));var i=T(t),u=E(t);return n.width=n.width||"300",n.height=n.height||"150",z.each(n,(function(e,r){n[r]=t.dom.encode(""+e)})),"iframe"===n.type?et(n):"application/x-shockwave-flash"===n.sourcemime?nt(n):-1!==n.sourcemime.indexOf("audio")?rt(n,i):"script"===n.type?it(n):ot(n,u)},at=tinymce.util.Tools.resolve("tinymce.util.Promise"),ct={},st=function(t,e,n){return new at((function(r,o){var i=function(n){return n.html&&(ct[t.source]=n),r({url:t.source,html:n.html?n.html:e(t)})};ct[t.source]?i(ct[t.source]):n({url:t.source},i,o)}))},lt=function(t,e){return new at((function(n){n({html:e(t),url:t.source})}))},ft=function(t){return function(e){return ut(t,e)}},dt=function(t,e){var n=D(t);return n?st(e,ft(t),n):lt(e,ft(t))},mt=function(t){return ct.hasOwnProperty(t)},gt=function(t,e){return S(e,t).bind((function(t){return S(t,"meta")}))},ht=function(t,e,n){return function(r){var o,i=function(){return S(t,r)},u=function(){return S(e,r)},a=function(t){return S(t,"value").bind((function(t){return t.length>0?l.some(t):l.none()}))},c=function(){return i().bind((function(t){return g(t)?a(t).orThunk(u):u().orThunk((function(){return l.from(t)}))}))},s=function(){return u().orThunk((function(){return i().bind((function(t){return g(t)?a(t):l.from(t)}))}))};return o={},o[r]=(r===n?c():s()).getOr(""),o}},pt=function(t,e){var n={};return S(t,"dimensions").each((function(t){v(["width","height"],(function(r){S(e,r).orThunk((function(){return S(t,r)})).each((function(t){return n[r]=t}))}))})),n},vt=function(t,n){var r=n?gt(n,t).getOr({}):{},o=ht(t,r,n);return e(e(e(e(e({},o("source")),o("altsource")),o("poster")),o("embed")),pt(t,r))},bt=function(t){var n=e(e({},t),{source:{value:S(t,"source").getOr("")},altsource:{value:S(t,"altsource").getOr("")},poster:{value:S(t,"poster").getOr("")}});return v(["width","height"],(function(e){S(t,e).each((function(t){var r=n.dimensions||{};r[e]=t,n.dimensions=r}))})),n},yt=function(t){return function(e){var n=e&&e.msg?"Media embed handler error: "+e.msg:"Media embed handler threw unknown error.";t.notificationManager.open({type:"error",text:n})}},wt=function(t,e){return V(O(t),e)},xt=function(t){return t.getAttribute("data-mce-object")||t.getAttribute("data-ephox-embed-iri")},Ct=function(t){var n=t.selection.getNode(),r=xt(n)?t.serializer.serialize(n,{selection:!0}):"";return e({embed:r},V(O(t),r))},St=function(t,n){return function(r){if(m(r.url)&&r.url.trim().length>0){var o=r.html,i=wt(n,o),u=e(e({},i),{source:r.url,embed:o});t.setData(bt(u))}}},kt=function(t,e){for(var n=t.dom.select("img[data-mce-object]"),r=0;r<e.length;r++)for(var o=n.length-1;o>=0;o--)e[r]===n[o]&&n.splice(o,1);t.selection.select(n[0])},Ot=function(t,e){var n=t.dom.select("img[data-mce-object]");t.insertContent(e),kt(t,n),t.nodeChanged()},Tt=function(t,e,n){e.embed=Y(e.embed,e),e.embed&&(t.source===e.source||mt(e.source))?Ot(n,e.embed):dt(n,e).then((function(t){Ot(n,t.html)})).catch(yt(n))},Et=function(t){var n=Ct(t),r=y(n),o=bt(n),i=function(e,n){var r=vt(n.getData(),"source");e.source!==r.source&&(St(v,t)({url:r.source,html:""}),dt(t,r).then(St(v,t)).catch(yt(t)))},u=function(e){var n=vt(e.getData()),r=wt(t,n.embed);e.setData(bt(r))},a=function(n,r){var o=vt(n.getData(),r),i=ut(t,o);n.setData(bt(e(e({},o),{embed:i})))},c=[{name:"source",type:"urlinput",filetype:"media",label:"Source"}],s=M(t)?[{type:"sizeinput",name:"dimensions",label:"Constrain proportions",constrain:!0}]:[],l={title:"General",name:"general",items:b([c,s])},f={type:"textarea",name:"embed",label:"Paste your embed code below:"},d={title:"Embed",items:[f]},m=[];N(t)&&m.push({name:"altsource",type:"urlinput",filetype:"media",label:"Alternative source URL"}),R(t)&&m.push({name:"poster",type:"urlinput",filetype:"image",label:"Media poster (Image URL)"});var g={title:"Advanced",name:"advanced",items:m},h=[l,d];m.length>0&&h.push(g);var p={type:"tabpanel",tabs:h},v=t.windowManager.open({title:"Insert/Edit Media",size:"normal",body:p,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:function(e){var n=vt(e.getData());Tt(r.get(),n,t),e.close()},onChange:function(t,e){switch(e.name){case"source":i(r.get(),t);break;case"embed":u(t);break;case"dimensions":case"altsource":case"poster":a(t,e.name);break}r.set(vt(t.getData()))},initialData:o})},_t=function(t){var e=function(){Et(t)};return{showDialog:e}},At=function(t){var e=function(){Et(t)};t.addCommand("mceMedia",e)},Dt=tinymce.util.Tools.resolve("tinymce.html.Node"),Nt=tinymce.util.Tools.resolve("tinymce.Env"),Rt=function(t,e){if(!1===A(t))return e;var n,r=W();return P({validate:!1,allow_conditional_comments:!1,comment:function(t){r.comment(t)},cdata:function(t){r.cdata(t)},text:function(t,e){r.text(t,e)},start:function(e,o,i){if(n=!0,"script"!==e&&"noscript"!==e&&"svg"!==e){for(var u=o.length-1;u>=0;u--){var a=o[u].name;0===a.indexOf("on")&&(delete o.map[a],o.splice(u,1)),"style"===a&&(o[u].value=t.dom.serializeStyle(t.dom.parseStyle(o[u].value),e))}r.start(e,o,i),n=!1}},end:function(t){n||r.end(t)}},j({})).parse(e),r.getContent()},Mt=function(t,e){var n=e.name,r=new Dt("img",1);return r.shortEnded=!0,Bt(t,e,r),r.attr({width:e.attr("width")||"300",height:e.attr("height")||("audio"===n?"30":"150"),style:e.attr("style"),src:Nt.transparentSrc,"data-mce-object":n,class:"mce-object mce-object-"+n}),r},zt=function(t,e){var n=e.name,r=new Dt("span",1);r.attr({contentEditable:"false",style:e.attr("style"),"data-mce-object":n,class:"mce-preview-object mce-object-"+n}),Bt(t,e,r);var o=new Dt(n,1);o.attr({src:e.attr("src"),allowfullscreen:e.attr("allowfullscreen"),style:e.attr("style"),class:e.attr("class"),width:e.attr("width"),height:e.attr("height"),frameborder:"0"});var i=new Dt("span",1);return i.attr("class","mce-shim"),r.append(o),r.append(i),r},Bt=function(t,e,n){var r,o,i,u=e.attributes;i=u.length;while(i--)r=u[i].name,o=u[i].value,"width"!==r&&"height"!==r&&"style"!==r&&("data"!==r&&"src"!==r||(o=t.convertURL(o,r)),n.attr("data-mce-p-"+r,o));var a=e.firstChild&&e.firstChild.value;a&&(n.attr("data-mce-html",escape(Rt(t,a))),n.firstChild=null)},Pt=function(t){var e=t.attr("class");return e&&/\btiny-pageembed\b/.test(e)},Ht=function(t){while(t=t.parent)if(t.attr("data-ephox-embed-iri")||Pt(t))return!0;return!1},It=function(t){return function(e){var n,r,o=e.length;while(o--)n=e[o],n.parent&&(n.parent.attr("data-mce-object")||("script"!==n.name||(r=H(O(t),n.attr("src")),r))&&(r&&(r.width&&n.attr("width",r.width.toString()),r.height&&n.attr("height",r.height.toString())),"iframe"===n.name&&_(t)&&Nt.ceFalse?Ht(n)||n.replace(zt(t,n)):Ht(n)||n.replace(Mt(t,n))))}},Lt=function(t){t.on("preInit",(function(){var e=t.schema.getSpecialElements();z.each("video audio iframe object".split(" "),(function(t){e[t]=new RegExp("</"+t+"[^>]*>","gi")}));var n=t.schema.getBoolAttrs();z.each("webkitallowfullscreen mozallowfullscreen allowfullscreen".split(" "),(function(t){n[t]={}})),t.parser.addNodeFilter("iframe,video,audio,object,embed,script",It(t)),t.serializer.addAttributeFilter("data-mce-object",(function(e,n){var r,o,i,u,a,c,s,l,f=e.length;while(f--)if(r=e[f],r.parent){s=r.attr(n),o=new Dt(s,1),"audio"!==s&&"script"!==s&&(l=r.attr("class"),l&&-1!==l.indexOf("mce-preview-object")?o.attr({width:r.firstChild.attr("width"),height:r.firstChild.attr("height")}):o.attr({width:r.attr("width"),height:r.attr("height")})),o.attr({style:r.attr("style")}),u=r.attributes,i=u.length;while(i--){var d=u[i].name;0===d.indexOf("data-mce-p-")&&o.attr(d.substr(11),u[i].value)}"script"===s&&o.attr("type","text/javascript"),a=r.attr("data-mce-html"),a&&(c=new Dt("#text",3),c.raw=!0,c.value=Rt(t,unescape(a)),o.append(c)),r.replace(o)}}))})),t.on("SetContent",(function(){t.$("span.mce-preview-object").each((function(e,n){var r=t.$(n);0===r.find("span.mce-shim").length&&r.append('<span class="mce-shim"></span>')}))}))},Ft=function(t){t.on("ResolveName",(function(t){var e;1===t.target.nodeType&&(e=t.target.getAttribute("data-mce-object"))&&(t.name=e)}))},Vt=function(t){t.on("click keyup touchend",(function(){var e=t.selection.getNode();e&&t.dom.hasClass(e,"mce-preview-object")&&t.dom.getAttrib(e,"data-mce-selected")&&e.setAttribute("data-mce-selected","2")})),t.on("ObjectSelected",(function(t){var e=t.target.getAttribute("data-mce-object");"audio"!==e&&"script"!==e||t.preventDefault()})),t.on("ObjectResized",(function(t){var e,n=t.target;n.getAttribute("data-mce-object")&&(e=n.getAttribute("data-mce-html"),e&&(e=unescape(e),n.setAttribute("data-mce-html",escape(Y(e,{width:String(t.width),height:String(t.height)})))))}))},Ut=function(t,e){return function(n){return t.selection.selectorChangedWithUnbind(e.join(","),n.setActive).unbind}},jt=function(t){t.ui.registry.addToggleButton("media",{tooltip:"Insert/edit media",icon:"embed",onAction:function(){t.execCommand("mceMedia")},onSetup:Ut(t,["img[data-mce-object]","span[data-mce-object]","div[data-ephox-embed-iri]"])}),t.ui.registry.addMenuItem("media",{icon:"embed",text:"Media...",onAction:function(){t.execCommand("mceMedia")}})};function Wt(){t.add("media",(function(t){return At(t),jt(t),Ft(t),Lt(t),Vt(t),_t(t)}))}Wt()})()},"3aea":function(t,e,n){n("3699")},4237:function(t,e,n){n("be7f")},"4ea8":function(t,e,n){n("cdd9")},"5e4c":function(t,e){(function(t){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");function n(){e.add("contextmenu",(function(){t.console.warn("Context menu plugin is now built in to the core editor, please remove it from your editor configuration")}))}n()})(window)},"84ec":function(t,e,n){n("2401")},9434:function(t,e,n){n("e8b0")},"94ce":function(t,e){(function(t){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(){},r=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t(e.apply(null,n))}},o=function(t,e){return function(n){return t(e(n))}},i=function(t){return function(){return t}},u=function(t){return t};function a(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.concat(n);return t.apply(null,o)}}var c=function(t){return function(e){return!t(e)}},s=function(t){return function(){throw new Error(t)}},l=i(!1),f=i(!0),d=function(){return m},m=function(){var t=function(t){return t.isNone()},e=function(t){return t()},r=function(t){return t},o={fold:function(t,e){return t()},is:l,isSome:l,isNone:f,getOr:r,getOrThunk:e,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(void 0),or:r,orThunk:e,map:d,each:n,bind:d,exists:l,forall:f,filter:d,equals:t,equals_:t,toArray:function(){return[]},toString:i("none()")};return o}(),g=function(t){var e=i(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:f,isNone:l,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return g(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:m},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(l,(function(e){return n(t,e)}))}};return o},h=function(t){return null===t||void 0===t?m:g(t)},p={some:g,none:d,from:h},v=function(t){var e=typeof t;return null===t?"null":"object"===e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e},b=function(t){return function(e){return v(e)===t}},y=function(t){return function(e){return typeof e===t}},w=b("string"),x=b("object"),C=b("array"),S=y("boolean"),k=function(t){return null===t||void 0===t},O=function(t){return!k(t)},T=y("function"),E=y("number"),_=Array.prototype.slice,A=Array.prototype.indexOf,D=Array.prototype.push,N=function(t,e){return A.call(t,e)},R=function(t,e){return N(t,e)>-1},M=function(t,e){for(var n=0,r=t.length;n<r;n++){var o=t[n];if(e(o,n))return!0}return!1},z=function(t,e){for(var n=[],r=0;r<t;r++)n.push(e(r));return n},B=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},P=function(t,e){for(var n=0,r=t.length;n<r;n++){var o=t[n];e(o,n)}},H=function(t,e){for(var n=t.length-1;n>=0;n--){var r=t[n];e(r,n)}},I=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},L=function(t,e,n){return H(t,(function(t){n=e(n,t)})),n},F=function(t,e,n){return P(t,(function(t){n=e(n,t)})),n},V=function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return p.some(i);if(n(i,r))break}return p.none()},U=function(t,e){return V(t,e,l)},j=function(t,e){for(var n=0,r=t.length;n<r;n++){var o=t[n];if(e(o,n))return p.some(n)}return p.none()},W=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!C(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);D.apply(e,t[n])}return e},q=function(t,e){return W(B(t,e))},$=function(t,e){for(var n=0,r=t.length;n<r;++n){var o=t[n];if(!0!==e(o,n))return!1}return!0},G=function(t){var e=_.call(t,0);return e.reverse(),e},K=function(t){return 0===t.length?p.none():p.some(t[0])},X=function(t){return 0===t.length?p.none():p.some(t[t.length-1])},Y=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return p.none()},J=Object.keys,Q=Object.hasOwnProperty,Z=function(t,e){for(var n=J(t),r=0,o=n.length;r<o;r++){var i=n[r],u=t[i];e(u,i)}},tt=function(t,e){return et(t,(function(t,n){return{k:n,v:e(t,n)}}))},et=function(t,e){var n={};return Z(t,(function(t,r){var o=e(t,r);n[o.k]=o.v})),n},nt=function(t){return function(e,n){t[n]=e}},rt=function(t,e,n,r){var o={};return Z(t,(function(t,o){(e(t,o)?n:r)(t,o)})),o},ot=function(t,e){var r={};return rt(t,e,nt(r),n),r},it=function(t,e){return ut(t,e)?p.from(t[e]):p.none()},ut=function(t,e){return Q.call(t,e)},at=("undefined"!==typeof t.window?t.window:Function("return this;")(),8),ct=9,st=11,lt=1,ft=3,dt=function(t){var e=t.dom().nodeName;return e.toLowerCase()},mt=function(t){return t.dom().nodeType},gt=function(t){return function(e){return mt(e)===t}},ht=function(t){return mt(t)===at||"#comment"===dt(t)},pt=gt(lt),vt=gt(ft),bt=gt(ct),yt=gt(st),wt=function(e,n,r){if(!(w(r)||S(r)||E(r)))throw t.console.error("Invalid call to Attr.set. Key ",n,":: Value ",r,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(n,r+"")},xt=function(t,e,n){wt(t.dom(),e,n)},Ct=function(t,e){var n=t.dom();Z(e,(function(t,e){wt(n,e,t)}))},St=function(t,e){var n=t.dom().getAttribute(e);return null===n?void 0:n},kt=function(t,e){return p.from(St(t,e))},Ot=function(t,e){var n=t.dom();return!(!n||!n.hasAttribute)&&n.hasAttribute(e)},Tt=function(t,e){t.dom().removeAttribute(e)},Et=function(t){return F(t.dom().attributes,(function(t,e){return t[e.name]=e.value,t}),{})},_t=function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e},At=function(t,e){return-1!==t.indexOf(e)},Dt=function(t,e){return _t(t,e,0)},Nt=function(t,e){return _t(t,e,t.length-e.length)},Rt=function(t){return function(e){return e.replace(t,"")}},Mt=Rt(/^\s+|\s+$/g),zt=function(t){return t.length>0},Bt=function(t){return void 0!==t.style&&T(t.style.getPropertyValue)},Pt=function(e,n){var r=n||t.document,o=r.createElement("div");if(o.innerHTML=e,!o.hasChildNodes()||o.childNodes.length>1)throw t.console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return Lt(o.childNodes[0])},Ht=function(e,n){var r=n||t.document,o=r.createElement(e);return Lt(o)},It=function(e,n){var r=n||t.document,o=r.createTextNode(e);return Lt(o)},Lt=function(t){if(null===t||void 0===t)throw new Error("Node cannot be null or undefined");return{dom:i(t)}},Ft=function(t,e,n){var r=t.dom();return p.from(r.elementFromPoint(e,n)).map(Lt)},Vt={fromHtml:Pt,fromTag:Ht,fromText:It,fromDom:Lt,fromPoint:Ft},Ut=function(t,e,n){return 0!==(t.compareDocumentPosition(e)&n)},jt=function(e,n){return Ut(e,n,t.Node.DOCUMENT_POSITION_CONTAINED_BY)},Wt=function(){return Wt=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n],e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Wt.apply(this,arguments)},qt=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}},$t=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}},Gt=function(t,e){var n=$t(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return Yt(r(1),r(2))},Kt=function(t,e){var n=String(e).toLowerCase();return 0===t.length?Xt():Gt(t,n)},Xt=function(){return Yt(0,0)},Yt=function(t,e){return{major:t,minor:e}},Jt={nu:Yt,detect:Kt,unknown:Xt},Qt="Edge",Zt="Chrome",te="IE",ee="Opera",ne="Firefox",re="Safari",oe=function(){return ie({current:void 0,version:Jt.unknown()})},ie=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r(Qt),isChrome:r(Zt),isIE:r(te),isOpera:r(ee),isFirefox:r(ne),isSafari:r(re)}},ue={unknown:oe,nu:ie,edge:i(Qt),chrome:i(Zt),ie:i(te),opera:i(ee),firefox:i(ne),safari:i(re)},ae="Windows",ce="iOS",se="Android",le="Linux",fe="OSX",de="Solaris",me="FreeBSD",ge="ChromeOS",he=function(){return pe({current:void 0,version:Jt.unknown()})},pe=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r(ae),isiOS:r(ce),isAndroid:r(se),isOSX:r(fe),isLinux:r(le),isSolaris:r(de),isFreeBSD:r(me),isChromeOS:r(ge)}},ve={unknown:he,nu:pe,windows:i(ae),ios:i(ce),android:i(se),linux:i(le),osx:i(fe),solaris:i(de),freebsd:i(me),chromeos:i(ge)},be=function(t,e,n,r){var o=t.isiOS()&&!0===/ipad/i.test(n),u=t.isiOS()&&!o,a=t.isiOS()||t.isAndroid(),c=a||r("(pointer:coarse)"),s=o||!u&&a&&r("(min-device-width:768px)"),l=u||a&&!s,f=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),d=!l&&!s&&!f;return{isiPad:i(o),isiPhone:i(u),isTablet:i(s),isPhone:i(l),isTouch:i(c),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:i(f),isDesktop:i(d)}},ye=function(t,e){var n=String(e).toLowerCase();return U(t,(function(t){return t.search(n)}))},we=function(t,e){return ye(t,e).map((function(t){var n=Jt.detect(t.versionRegexes,e);return{current:t.name,version:n}}))},xe=function(t,e){return ye(t,e).map((function(t){var n=Jt.detect(t.versionRegexes,e);return{current:t.name,version:n}}))},Ce={detectBrowser:we,detectOs:xe},Se=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,ke=function(t){return function(e){return At(e,t)}},Oe=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return At(t,"edge/")&&At(t,"chrome")&&At(t,"safari")&&At(t,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Se],search:function(t){return At(t,"chrome")&&!At(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return At(t,"msie")||At(t,"trident")}},{name:"Opera",versionRegexes:[Se,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:ke("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:ke("firefox")},{name:"Safari",versionRegexes:[Se,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(At(t,"safari")||At(t,"mobile/"))&&At(t,"applewebkit")}}],Te=[{name:"Windows",search:ke("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return At(t,"iphone")||At(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:ke("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:ke("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:ke("linux"),versionRegexes:[]},{name:"Solaris",search:ke("sunos"),versionRegexes:[]},{name:"FreeBSD",search:ke("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:ke("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Ee={browsers:i(Oe),oses:i(Te)},_e=function(t,e){var n=Ee.browsers(),r=Ee.oses(),o=Ce.detectBrowser(n,t).fold(ue.unknown,ue.nu),i=Ce.detectOs(r,t).fold(ve.unknown,ve.nu),u=be(i,o,t,e);return{browser:o,os:i,deviceType:u}},Ae={detect:_e},De=function(e){return t.window.matchMedia(e).matches},Ne=qt((function(){return Ae.detect(t.navigator.userAgent,De)})),Re=function(){return Ne()},Me=function(t,e){var n=t.dom();if(n.nodeType!==lt)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},ze=function(t){return t.nodeType!==lt&&t.nodeType!==ct&&t.nodeType!==st||0===t.childElementCount},Be=function(e,n){var r=void 0===n?t.document:n.dom();return ze(r)?[]:B(r.querySelectorAll(e),Vt.fromDom)},Pe=function(e,n){var r=void 0===n?t.document:n.dom();return ze(r)?p.none():p.from(r.querySelector(e)).map(Vt.fromDom)},He=function(t,e){return t.dom()===e.dom()},Ie=function(t,e){var n=t.dom(),r=e.dom();return n!==r&&n.contains(r)},Le=function(t,e){return jt(t.dom(),e.dom())},Fe=function(t,e){return Re().browser.isIE()?Le(t,e):Ie(t,e)},Ve=Me,Ue=function(t){return Vt.fromDom(t.dom().ownerDocument)},je=function(t){return bt(t)?t:Ue(t)},We=function(t){return Vt.fromDom(t.dom().ownerDocument.defaultView)},qe=function(t){return p.from(t.dom().parentNode).map(Vt.fromDom)},$e=function(t,e){var n=T(e)?e:l,r=t.dom(),o=[];while(null!==r.parentNode&&void 0!==r.parentNode){var i=r.parentNode,u=Vt.fromDom(i);if(o.push(u),!0===n(u))break;r=i}return o},Ge=function(t){return p.from(t.dom().offsetParent).map(Vt.fromDom)},Ke=function(t){return p.from(t.dom().previousSibling).map(Vt.fromDom)},Xe=function(t){return p.from(t.dom().nextSibling).map(Vt.fromDom)},Ye=function(t){return B(t.dom().childNodes,Vt.fromDom)},Je=function(t,e){var n=t.dom().childNodes;return p.from(n[e]).map(Vt.fromDom)},Qe=function(t){return Je(t,0)},Ze=function(t){return yt(t)},tn=T(t.Element.prototype.attachShadow)&&T(t.Node.prototype.getRootNode),en=i(tn),nn=tn?function(t){return Vt.fromDom(t.dom().getRootNode())}:je,rn=function(t){var e=nn(t);return Ze(e)?p.some(e):p.none()},on=function(t){return Vt.fromDom(t.dom().host)},un=function(t){if(en()&&O(t.target)){var e=Vt.fromDom(t.target);if(pt(e)&&an(Vt.fromDom(t.target))){var n=t;if(n.composed&&n.composedPath){var r=n.composedPath();if(r)return K(r)}}}return p.from(t.target)},an=function(t){return O(t.dom().shadowRoot)},cn=function(t){var e=vt(t)?t.dom().parentNode:t.dom();return void 0!==e&&null!==e&&null!==e.ownerDocument&&rn(Vt.fromDom(e)).fold((function(){return e.ownerDocument.body.contains(e)}),o(cn,on))},sn=function(){return ln(Vt.fromDom(t.document))},ln=function(t){var e=t.dom().body;if(null===e||void 0===e)throw new Error("Body is not available yet");return Vt.fromDom(e)},fn=function(e,n,r){if(!w(r))throw t.console.error("Invalid call to CSS.set. Property ",n,":: Value ",r,":: Element ",e),new Error("CSS value must be a string: "+r);Bt(e)&&e.style.setProperty(n,r)},dn=function(t,e){Bt(t)&&t.style.removeProperty(e)},mn=function(t,e,n){var r=t.dom();fn(r,e,n)},gn=function(t,e){var n=t.dom();Z(e,(function(t,e){fn(n,e,t)}))},hn=function(e,n){var r=e.dom(),o=t.window.getComputedStyle(r),i=o.getPropertyValue(n);return""!==i||cn(e)?i:pn(r,n)},pn=function(t,e){return Bt(t)?t.style.getPropertyValue(e):""},vn=function(t,e){var n=t.dom(),r=pn(n,e);return p.from(r).filter((function(t){return t.length>0}))},bn=function(t,e){var n=t.dom();dn(n,e),kt(t,"style").map(Mt).is("")&&Tt(t,"style")},yn=function(t,e){var n=t.dom(),r=e.dom();Bt(n)&&Bt(r)&&(r.style.cssText=n.style.cssText)},wn=function(t,e){var n=qe(t);n.each((function(n){n.dom().insertBefore(e.dom(),t.dom())}))},xn=function(t,e){var n=Xe(t);n.fold((function(){var n=qe(t);n.each((function(t){Sn(t,e)}))}),(function(t){wn(t,e)}))},Cn=function(t,e){var n=Qe(t);n.fold((function(){Sn(t,e)}),(function(n){t.dom().insertBefore(e.dom(),n.dom())}))},Sn=function(t,e){t.dom().appendChild(e.dom())},kn=function(t,e){wn(t,e),Sn(e,t)},On=function(t,e){P(e,(function(e){wn(t,e)}))},Tn=function(t,e){P(e,(function(n,r){var o=0===r?t:e[r-1];xn(o,n)}))},En=function(t,e){P(e,(function(e){Sn(t,e)}))},_n=function(t){t.dom().textContent="",P(Ye(t),(function(t){An(t)}))},An=function(t){var e=t.dom();null!==e.parentNode&&e.parentNode.removeChild(e)},Dn=function(t){var e=Ye(t);e.length>0&&On(t,e),An(t)},Nn=function(t,e){return{rows:i(t),columns:i(e)}},Rn=function(t,e){return{row:i(t),column:i(e)}},Mn=function(t,e,n){return{element:i(t),rowspan:i(e),colspan:i(n)}},zn=function(t,e,n,r){return{element:i(t),rowspan:i(e),colspan:i(n),isNew:i(r)}},Bn=function(t,e,n,r,o){return{element:i(t),rowspan:i(e),colspan:i(n),row:i(r),column:i(o)}},Pn=function(t,e,n){return{element:i(t),cells:i(e),section:i(n)}},Hn=function(t,e){return{element:i(t),isNew:i(e)}},In=function(t,e,n,r){return{element:i(t),cells:i(e),section:i(n),isNew:i(r)}},Ln=function(t,e){return{cells:i(t),section:i(e)}},Fn=function(t,e){return{details:i(t),section:i(e)}},Vn=function(t,e,n,r){return{startRow:i(t),startCol:i(e),finishRow:i(n),finishCol:i(r)}},Un=function(t,e,n){return I($e(t,n),e)},jn=function(t,e){return I(Ye(t),e)},Wn=function(t,e){var n=[];return P(Ye(t),(function(t){e(t)&&(n=n.concat([t])),n=n.concat(Wn(t,e))})),n},qn=function(t,e,n){return Un(t,(function(t){return Me(t,e)}),n)},$n=function(t,e){return jn(t,(function(t){return Me(t,e)}))},Gn=function(t,e){return Be(e,t)};function Kn(t,e,n,r,o){return t(n,r)?p.some(n):T(o)&&o(n)?p.none():e(n,r,o)}var Xn=function(t,e,n){var r=t.dom(),o=T(n)?n:i(!1);while(r.parentNode){r=r.parentNode;var u=Vt.fromDom(r);if(e(u))return p.some(u);if(o(u))break}return p.none()},Yn=function(t,e,n){var r=function(t,e){return e(t)};return Kn(r,Xn,t,e,n)},Jn=function(t,e){var n=function(t){return e(Vt.fromDom(t))},r=U(t.dom().childNodes,n);return r.map(Vt.fromDom)},Qn=function(t,e){var n=function(t){for(var r=0;r<t.childNodes.length;r++){var o=Vt.fromDom(t.childNodes[r]);if(e(o))return p.some(o);var i=n(t.childNodes[r]);if(i.isSome())return i}return p.none()};return n(t.dom())},Zn=function(t,e,n){return Xn(t,(function(t){return Me(t,e)}),n)},tr=function(t,e){return Jn(t,(function(t){return Me(t,e)}))},er=function(t,e){return Pe(e,t)},nr=function(t,e,n){var r=function(t,e){return Me(t,e)};return Kn(r,Zn,t,e,n)},rr=function(t,e,n){return void 0===n&&(n=0),kt(t,e).map((function(t){return parseInt(t,10)})).getOr(n)},or=function(t,e){return rr(t,e,1)},ir=function(t){return or(t,"colspan")>1},ur=function(t){return or(t,"rowspan")>1},ar=function(t,e){return parseInt(hn(t,e),10)},cr=i(10),sr=i(10),lr=function(t,e){return fr(t,e,i(!0))},fr=function(t,e,n){return q(Ye(t),(function(t){return Me(t,e)?n(t)?[t]:[]:fr(t,e,n)}))},dr=function(t,e,n){if(void 0===n&&(n=l),n(e))return p.none();if(R(t,dt(e)))return p.some(e);var r=function(t){return Me(t,"table")||n(t)};return Zn(e,t.join(","),r)},mr=function(t,e){return dr(["td","th"],t,e)},gr=function(t){return lr(t,"th,td")},hr=function(t,e){return nr(t,"table",e)},pr=function(t){return lr(t,"tr")},vr=function(t){var e=pr(t);return B(e,(function(t){var e=t,n=qe(e),r=n.map((function(t){var e=dt(t);return"tfoot"===e||"thead"===e||"tbody"===e?e:"tbody"})).getOr("tbody"),o=B(gr(t),(function(t){var e=rr(t,"rowspan",1),n=rr(t,"colspan",1);return Mn(t,e,n)}));return Pn(e,o,r)}))},br=function(t,e){return B(t,(function(t){var n=B(gr(t),(function(t){var e=rr(t,"rowspan",1),n=rr(t,"colspan",1);return Mn(t,e,n)}));return Pn(t,n,e.section())}))},yr=function(t,e){return t+","+e},wr=function(t,e,n){var r=t.access[yr(e,n)];return void 0!==r?p.some(r):p.none()},xr=function(t,e,n){var r=Cr(t,(function(t){return n(e,t.element())}));return r.length>0?p.some(r[0]):p.none()},Cr=function(t,e){var n=q(t.all,(function(t){return t.cells()}));return I(n,e)},Sr=function(t){var e={},n=[],r=t.length,o=0;P(t,(function(t,r){var i=[];P(t.cells(),(function(t){var n=0;while(void 0!==e[yr(r,n)])n++;for(var u=Bn(t.element(),t.rowspan(),t.colspan(),r,n),a=0;a<t.colspan();a++)for(var c=0;c<t.rowspan();c++){var s=r+c,l=n+a,f=yr(s,l);e[f]=u,o=Math.max(o,l+1)}i.push(u)})),n.push(Pn(t.element(),i,t.section()))}));var i=Nn(r,o);return{grid:i,access:e,all:n}},kr=function(t){var e=vr(t);return Sr(e)},Or=function(t){var e=B(t.all,(function(t){return t.cells()}));return W(e)},Tr={fromTable:kr,generate:Sr,getAt:wr,findItem:xr,filterItems:Cr,justCells:Or},Er=function(t,e,n,r){return{minRow:t,minCol:e,maxRow:n,maxCol:r}},_r=function(t,e){var n=t.grid.columns(),r=t.grid.rows(),o=r,i=n,u=0,a=0;return Z(t.access,(function(t){if(e(t)){var n=t.row(),r=n+t.rowspan()-1,c=t.column(),s=c+t.colspan()-1;n<o?o=n:r>u&&(u=r),c<i?i=c:s>a&&(a=s)}})),Er(o,i,u,a)},Ar=function(t,e,n){var r=t[n].element(),o=Vt.fromTag("td");Sn(o,Vt.fromTag("br"));var i=e?Sn:Cn;i(r,o)},Dr=function(t,e,n,r){for(var o=e.grid.columns(),i=e.grid.rows(),u=0;u<i;u++)for(var a=!1,c=0;c<o;c++)if(!(u<n.minRow||u>n.maxRow||c<n.minCol||c>n.maxCol)){var s=Tr.getAt(e,u,c).filter(r).isNone();s?Ar(t,a,u):a=!0}},Nr=function(t,e){var n=I(lr(t,"tr"),(function(t){return 0===t.dom().childElementCount}));P(n,An),e.minCol!==e.maxCol&&e.minRow!==e.maxRow||P(lr(t,"th,td"),(function(t){Tt(t,"rowspan"),Tt(t,"colspan")})),Tt(t,"width"),Tt(t,"height"),bn(t,"width"),bn(t,"height")},Rr=function(t,e){var n=function(t){return Me(t.element(),e)},r=vr(t),o=Tr.generate(r),i=_r(o,n),u="th:not("+e+"),td:not("+e+")",a=fr(t,"th,td",(function(t){return Me(t,u)}));return P(a,An),Dr(r,o,i,n),Nr(t,i),t},Mr=" ";function zr(t,e){var n=function(n){if(!t(n))throw new Error("Can only get "+e+" value of a "+e+" node");return r(n).getOr("")},r=function(e){return t(e)?p.from(e.dom().nodeValue):p.none()},o=function(n,r){if(!t(n))throw new Error("Can only set raw "+e+" value of a "+e+" node");n.dom().nodeValue=r};return{get:n,getOption:r,set:o}}var Br=zr(vt,"text"),Pr=function(t){return Br.get(t)},Hr=function(t){return Br.getOption(t)},Ir=function(t,e){return Br.set(t,e)},Lr=function(t){return"img"===dt(t)?1:Hr(t).fold((function(){return Ye(t).length}),(function(t){return t.length}))},Fr=function(t){return Hr(t).filter((function(t){return 0!==t.trim().length||t.indexOf(Mr)>-1})).isSome()},Vr=["img","br"],Ur=function(t){var e=Fr(t);return e||R(Vr,dt(t))},jr=function(t){return Qn(t,Ur)},Wr=function(t){return qr(t,Ur)},qr=function(t,e){var n=function(t){for(var r=Ye(t),o=r.length-1;o>=0;o--){var i=r[o];if(e(i))return p.some(i);var u=n(i);if(u.isSome())return u}return p.none()};return n(t)},$r=function(t,e){return Vt.fromDom(t.dom().cloneNode(e))},Gr=function(t){return $r(t,!1)},Kr=function(t){return $r(t,!0)},Xr=function(t,e){var n=Vt.fromTag(e),r=Et(t);return Ct(n,r),n},Yr=function(t,e){var n=Xr(t,e),r=Ye(Kr(t));return En(n,r),n},Jr=function(){var t=Vt.fromTag("td");return Sn(t,Vt.fromTag("br")),t},Qr=function(t,e,n){var r=Yr(t,e);return Z(n,(function(t,e){null===t?Tt(r,e):xt(r,e,t)})),r},Zr=function(t){return t},to=function(t){return function(){return Vt.fromTag("tr",t.dom())}},eo=function(t,e,n){var r=jr(t);return r.map((function(r){var o=n.join(","),i=qn(r,o,(function(e){return He(e,t)}));return L(i,(function(t,e){var n=Gr(e);return Tt(n,"contenteditable"),Sn(t,n),n}),e)})).getOr(e)},no=function(t,e,n){var r=function(e){var r=Ue(e.element()),o=Vt.fromTag(dt(e.element()),r.dom()),i=n.getOr(["strong","em","b","i","span","font","h1","h2","h3","h4","h5","h6","p","div"]),u=i.length>0?eo(e.element(),o,i):o;return Sn(u,Vt.fromTag("br")),yn(e.element(),o),bn(o,"height"),1!==e.colspan()&&bn(e.element(),"width"),t(e.element(),o),o};return{row:to(e),cell:r,replace:Qr,gap:Jr}},ro=function(t){return{row:to(t),cell:Jr,replace:Zr,gap:Jr}},oo=function(e,n){var r=n||t.document,o=r.createElement("div");return o.innerHTML=e,Ye(Vt.fromDom(o))},io=function(t){return B(t,Vt.fromDom)},uo=function(t,e){var n=e.column(),r=e.column()+e.colspan()-1,o=e.row(),i=e.row()+e.rowspan()-1;return n<=t.finishCol()&&r>=t.startCol()&&o<=t.finishRow()&&i>=t.startRow()},ao=function(t,e){return e.column()>=t.startCol()&&e.column()+e.colspan()-1<=t.finishCol()&&e.row()>=t.startRow()&&e.row()+e.rowspan()-1<=t.finishRow()},co=function(t,e){for(var n=!0,r=a(ao,e),o=e.startRow();o<=e.finishRow();o++)for(var i=e.startCol();i<=e.finishCol();i++)n=n&&Tr.getAt(t,o,i).exists(r);return n?p.some(e):p.none()},so=function(t,e){return Vn(Math.min(t.row(),e.row()),Math.min(t.column(),e.column()),Math.max(t.row()+t.rowspan()-1,e.row()+e.rowspan()-1),Math.max(t.column()+t.colspan()-1,e.column()+e.colspan()-1))},lo=function(t,e,n){var r=Tr.findItem(t,e,He),o=Tr.findItem(t,n,He);return r.bind((function(t){return o.map((function(e){return so(t,e)}))}))},fo=function(t,e,n){return lo(t,e,n).bind((function(e){return co(t,e)}))},mo=function(t,e,n,r){return Tr.findItem(t,e,He).bind((function(e){var o=n>0?e.row()+e.rowspan()-1:e.row(),i=r>0?e.column()+e.colspan()-1:e.column(),u=Tr.getAt(t,o+n,i+r);return u.map((function(t){return t.element()}))}))},go=function(t,e,n){return lo(t,e,n).map((function(e){var n=Tr.filterItems(t,a(uo,e));return B(n,(function(t){return t.element()}))}))},ho=function(t,e){var n=function(t,e){return Fe(e,t)};return Tr.findItem(t,e,n).map((function(t){return t.element()}))},po=function(t,e,n){return hr(t).bind((function(r){var o=wo(r);return mo(o,t,e,n)}))},vo=function(t,e,n){var r=wo(t);return go(r,e,n)},bo=function(t,e,n,r,o){var i=wo(t),u=He(t,n)?p.some(e):ho(i,e),a=He(t,o)?p.some(r):ho(i,r);return u.bind((function(t){return a.bind((function(e){return go(i,t,e)}))}))},yo=function(t,e,n){var r=wo(t);return fo(r,e,n)},wo=Tr.fromTable,xo=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","li","table","thead","tbody","tfoot","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"];function Co(){var t=function(t){return Vt.fromDom(t.dom().cloneNode(!1))},e=function(t){return t.dom().ownerDocument},n=function(t){return!!pt(t)&&("body"===dt(t)||R(xo,dt(t)))},r=function(t){return!!pt(t)&&R(["br","img","hr","input"],dt(t))},o=function(t){return pt(t)&&"false"===St(t,"contenteditable")},u=function(t,e){return t.dom().compareDocumentPosition(e.dom())},a=function(t,e){var n=Et(t);Ct(e,n)};return{up:i({selector:Zn,closest:nr,predicate:Xn,all:$e}),down:i({selector:Gn,predicate:Wn}),styles:i({get:hn,getRaw:vn,set:mn,remove:bn}),attrs:i({get:St,set:xt,remove:Tt,copyTo:a}),insert:i({before:wn,after:xn,afterAll:Tn,append:Sn,appendAll:En,prepend:Cn,wrap:kn}),remove:i({unwrap:Dn,remove:An}),create:i({nu:Vt.fromTag,clone:t,text:Vt.fromText}),query:i({comparePosition:u,prevSibling:Ke,nextSibling:Xe}),property:i({children:Ye,name:dt,parent:qe,document:e,isText:vt,isComment:ht,isElement:pt,getText:Pr,setText:Ir,isBoundary:n,isEmptyTag:r,isNonEditable:o}),eq:He,is:Ve}}var So=function(t,e,n,r){var o=n[0],i=n.slice(1);return r(t,e,o,i)},ko=function(t,e,n){return n.length>0?So(t,e,n,Oo):p.none()},Oo=function(t,e,n,r){var o=e(t,n);return L(r,(function(n,r){var o=e(t,r);return To(t,n,o)}),o)},To=function(t,e,n){return e.bind((function(e){return n.filter(a(t.eq,e))}))},Eo=function(t,e){return a(t.eq,e)},_o=function(t,e,n,r){void 0===r&&(r=l);var o=[e].concat(t.up().all(e)),u=[n].concat(t.up().all(n)),a=function(t){var e=j(t,r);return e.fold((function(){return t}),(function(e){return t.slice(0,e+1)}))},c=a(o),s=a(u),f=U(c,(function(e){return M(s,Eo(t,e))}));return{firstpath:i(c),secondpath:i(s),shared:i(f)}},Ao=ko,Do=_o,No=Co(),Ro=function(t,e){return Ao(No,(function(e,n){return t(n)}),e)},Mo=function(t,e,n){return Do(No,t,e,n)},zo=function(t){return Zn(t,"table")},Bo=function(t,e,n){var r=function(t){return function(e){return void 0!==n&&n(e)||He(e,t)}};return He(t,e)?p.some({boxes:p.some([t]),start:t,finish:e}):zo(t).bind((function(o){return zo(e).bind((function(i){if(He(o,i))return p.some({boxes:vo(o,t,e),start:t,finish:e});if(Fe(o,i)){var u=qn(e,"td,th",r(o)),a=u.length>0?u[u.length-1]:e;return p.some({boxes:bo(o,t,o,e,i),start:t,finish:a})}if(Fe(i,o)){u=qn(t,"td,th",r(i));var c=u.length>0?u[u.length-1]:t;return p.some({boxes:bo(i,t,o,e,i),start:t,finish:c})}return Mo(t,e).shared().bind((function(u){return nr(u,"table",n).bind((function(n){var u=qn(e,"td,th",r(n)),a=u.length>0?u[u.length-1]:e,c=qn(t,"td,th",r(n)),s=c.length>0?c[c.length-1]:t;return p.some({boxes:bo(n,t,o,e,i),start:s,finish:a})}))}))}))}))},Po=function(t,e){var n=Gn(t,e);return n.length>0?p.some(n):p.none()},Ho=function(t,e){return U(t,(function(t){return Me(t,e)}))},Io=function(t,e,n){return er(t,e).bind((function(e){return er(t,n).bind((function(t){return Ro(zo,[e,t]).map((function(n){return{first:i(e),last:i(t),table:i(n)}}))}))}))},Lo=function(t,e){return Zn(t,"table").bind((function(n){return er(n,e).bind((function(e){return Bo(e,t).bind((function(t){return t.boxes.map((function(e){return{boxes:e,start:t.start,finish:t.finish}}))}))}))}))},Fo=function(t,e,n,r,o){return Ho(t,o).bind((function(t){return po(t,e,n).bind((function(t){return Lo(t,r)}))}))},Vo=function(t,e){return Po(t,e)},Uo=function(t,e,n){return Io(t,e,n).bind((function(e){var n=function(e){return He(t,e)},r=Zn(e.first(),"thead,tfoot,tbody,table",n),o=Zn(e.last(),"thead,tfoot,tbody,table",n);return r.bind((function(t){return o.bind((function(n){return He(t,n)?yo(e.table(),e.first(),e.last()):p.none()}))}))}))},jo="data-mce-selected",Wo="td["+jo+"],th["+jo+"]",qo="["+jo+"]",$o="data-mce-first-selected",Go="td["+$o+"],th["+$o+"]",Ko="data-mce-last-selected",Xo="td["+Ko+"],th["+Ko+"]",Yo=jo,Jo=Wo,Qo=qo,Zo=$o,ti=Go,ei=Ko,ni=Xo,ri=Object.freeze({__proto__:null,selected:Yo,selectedSelector:Jo,attributeSelector:Qo,firstSelected:Zo,firstSelectedSelector:ti,lastSelected:ei,lastSelectedSelector:ni}),oi=function(e){if(!C(e))throw new Error("cases must be an array");if(0===e.length)throw new Error("there must be at least one case");var n=[],r={};return P(e,(function(o,i){var u=J(o);if(1!==u.length)throw new Error("one and only one name per case");var a=u[0],c=o[a];if(void 0!==r[a])throw new Error("duplicate key detected:"+a);if("cata"===a)throw new Error("cannot have a case named cata (sorry)");if(!C(c))throw new Error("case arguments must be an array");n.push(a),r[a]=function(){var r=arguments.length;if(r!==c.length)throw new Error("Wrong number of arguments to case "+a+". Expected "+c.length+" ("+c+"), got "+r);for(var o=new Array(r),u=0;u<o.length;u++)o[u]=arguments[u];var s=function(t){var e=J(t);if(n.length!==e.length)throw new Error("Wrong number of arguments to match. Expected: "+n.join(",")+"\nActual: "+e.join(","));var r=$(n,(function(t){return R(e,t)}));if(!r)throw new Error("Not all branches were specified when using match. Specified: "+e.join(", ")+"\nRequired: "+n.join(", "));return t[a].apply(null,o)};return{fold:function(){if(arguments.length!==e.length)throw new Error("Wrong number of arguments to fold. Expected "+e.length+", got "+arguments.length);var t=arguments[i];return t.apply(null,o)},match:s,log:function(e){t.console.log(e,{constructors:n,constructor:a,params:o})}}}})),r},ii={generate:oi},ui=ii.generate([{none:[]},{multiple:["elements"]},{single:["selection"]}]),ai=function(t,e,n,r){return t.fold(e,n,r)},ci=ui.none,si=ui.multiple,li=ui.single,fi=function(t,e){return ai(e.get(),i([]),u,i([t]))},di=function(t,e){var n=function(t){return Ot(t,"rowspan")&&parseInt(St(t,"rowspan"),10)>1||Ot(t,"colspan")&&parseInt(St(t,"colspan"),10)>1},r=fi(t,e);return r.length>0&&$(r,n)?p.some(r):p.none()},mi=function(t,e){return ai(e.get(),p.none,(function(e,n){return 0===e.length?p.none():Uo(t,ti,ni).bind((function(t){return e.length>1?p.some({bounds:i(t),cells:i(e)}):p.none()}))}),p.none)},gi=function(t){return{element:i(t),mergable:p.none,unmergable:p.none,selection:i([t])}},hi=function(t,e,n){return{element:i(n),mergable:i(mi(e,t)),unmergable:i(di(n,t)),selection:i(fi(n,t))}},pi=function(t,e,n){return{element:i(t),clipboard:i(e),generators:i(n)}},vi=function(t,e,n,r){return{selection:i(fi(e,t)),clipboard:i(n),generators:i(r)}},bi=function(t){return hr(t[0]).map(Kr).map((function(t){return[Rr(t,Qo)]}))},yi=function(t,e){return B(e,(function(e){return t.selection.serializer.serialize(e.dom(),{})})).join("")},wi=function(t){return B(t,(function(t){return t.dom().innerText})).join("")},xi=function(t,e,r,o){t.on("BeforeGetContent",(function(r){var o=function(e){r.preventDefault(),bi(e).each((function(e){r.content="text"===r.format?wi(e):yi(t,e)}))};!0===r.selection&&ai(e.get(),n,o,n)})),t.on("BeforeSetContent",(function(e){if(!0===e.selection&&!0===e.paste){var n=p.from(t.dom.getParent(t.selection.getStart(),"th,td"));n.each((function(n){var i=Vt.fromDom(n);hr(i).each((function(n){var u=I(oo(e.content),(function(t){return"meta"!==dt(t)})),a=function(t){return"table"===dt(t)};if(1===u.length&&a(u[0])){e.preventDefault();var c=Vt.fromDom(t.getDoc()),s=ro(c),l=pi(i,u[0],s);r.pasteCells(n,l).each((function(e){t.selection.setRng(e),t.focus(),o.clear(n)}))}}))}))}}))},Ci=function(t,e){var n=function(n,r){return Ci(t+n,e+r)};return{left:i(t),top:i(e),translate:n}},Si=Ci,ki=function(t){var e=t.getBoundingClientRect();return Si(e.left,e.top)},Oi=function(t,e){return void 0!==t?t:void 0!==e?e:0},Ti=function(t){var e=t.dom().ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom())return Si(n.offsetLeft,n.offsetTop);var i=Oi(r.pageYOffset,o.scrollTop),u=Oi(r.pageXOffset,o.scrollLeft),a=Oi(o.clientTop,n.clientTop),c=Oi(o.clientLeft,n.clientLeft);return Ei(t).translate(u-c,i-a)},Ei=function(t){var e=t.dom(),n=e.ownerDocument,r=n.body;return r===e?Si(r.offsetLeft,r.offsetTop):cn(t)?ki(e):Si(0,0)},_i=function(t){var e=p.from(t.dom().documentElement).map(Vt.fromDom).getOr(t);return{parent:i(e),view:i(t),origin:i(Si(0,0))}},Ai=function(t,e){var n=function(){return Ti(e)};return{parent:i(e),view:i(t),origin:n}},Di=function(t,e){return{parent:i(e),view:i(t),origin:i(Si(0,0))}},Ni={only:_i,detached:Ai,body:Di};function Ri(t,e){var n=function(e,n){if(!E(n)&&!n.match(/^[0-9]+$/))throw new Error(t+".set accepts only positive integer values. Value was "+n);var r=e.dom();Bt(r)&&(r.style[t]=n+"px")},r=function(n){var r=e(n);if(r<=0||null===r){var o=hn(n,t);return parseFloat(o)||0}return r},o=r,i=function(t,e){return F(e,(function(e,n){var r=hn(t,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?e:e+o}),0)},u=function(t,e,n){var r=i(t,n),o=e>r?e-r:0;return o};return{set:n,get:r,getOuter:o,aggregate:i,max:u}}var Mi=Ri("height",(function(t){var e=t.dom();return cn(t)?e.getBoundingClientRect().height:e.offsetHeight})),zi=function(t){return Mi.get(t)},Bi=function(t){return Mi.getOuter(t)},Pi=Ri("width",(function(t){return t.dom().offsetWidth})),Hi=function(t){return Pi.get(t)},Ii=function(t){return Pi.getOuter(t)},Li=function(t,e){return{row:t,y:e}},Fi=function(t,e){return{col:t,x:e}},Vi=function(t){var e=Ti(t);return e.left()+Ii(t)},Ui=function(t){return Ti(t).left()},ji=function(t,e){return Fi(t,Ui(e))},Wi=function(t,e){return Fi(t,Vi(e))},qi=function(t){return Ti(t).top()},$i=function(t,e){return Li(t,qi(e))},Gi=function(t,e){return Li(t,qi(e)+Bi(e))},Ki=function(t,e,n){if(0===n.length)return[];var r=B(n.slice(1),(function(e,n){return e.map((function(e){return t(n,e)}))})),o=n[n.length-1].map((function(t){return e(n.length-1,t)}));return r.concat([o])},Xi=function(t){return-t},Yi={delta:u,positions:function(t){return Ki($i,Gi,t)},edge:qi},Ji={delta:u,edge:Ui,positions:function(t){return Ki(ji,Wi,t)}},Qi={delta:Xi,edge:Vi,positions:function(t){return Ki(Wi,ji,t)}},Zi=function(t){var e=t.grid,n=z(e.columns(),u),r=z(e.rows(),u);return B(n,(function(e){var n=function(){return q(r,(function(n){return Tr.getAt(t,n,e).filter((function(t){return t.column()===e})).fold(i([]),(function(t){return[t]}))}))},o=function(t){return 1===t.colspan()},u=function(){return Tr.getAt(t,0,e)};return tu(n,o,u)}))},tu=function(t,e,n){var r=t(),o=U(r,e),i=o.orThunk((function(){return p.from(r[0]).orThunk(n)}));return i.map((function(t){return t.element()}))},eu=function(t){var e=t.grid,n=z(e.rows(),u),r=z(e.columns(),u);return B(n,(function(e){var n=function(){return q(r,(function(n){return Tr.getAt(t,e,n).filter((function(t){return t.row()===e})).fold(i([]),(function(t){return[t]}))}))},o=function(t){return 1===t.rowspan()},u=function(){return Tr.getAt(t,e,0)};return tu(n,o,u)}))},nu=function(t,e){if(e<0||e>=t.length-1)return p.none();var n=t[e].fold((function(){var n=G(t.slice(0,e));return Y(n,(function(t,e){return t.map((function(t){return{value:t,delta:e+1}}))}))}),(function(t){return p.some({value:t,delta:0})})),r=t[e+1].fold((function(){var n=t.slice(e+1);return Y(n,(function(t,e){return t.map((function(t){return{value:t,delta:e+1}}))}))}),(function(t){return p.some({value:t,delta:1})}));return n.bind((function(t){return r.map((function(e){var n=e.delta+t.delta;return Math.abs(e.value-t.value)/n}))}))},ru=function(){var t=Re().browser;return t.isIE()||t.isEdge()},ou=function(t,e){var n=parseFloat(t);return isNaN(n)?e:n},iu=function(t,e,n){return ou(hn(t,e),n)},uu=function(t){var e=t.dom().getBoundingClientRect().height,n=hn(t,"box-sizing");if("border-box"===n)return e;var r=iu(t,"padding-top",0),o=iu(t,"padding-bottom",0),i=iu(t,"border-top-width",0),u=iu(t,"border-bottom-width",0),a=i+u;return e-r-o-a},au=function(t){var e=t.dom().getBoundingClientRect().width,n=hn(t,"box-sizing");if("border-box"===n)return e;var r=iu(t,"padding-left",0),o=iu(t,"padding-right",0),i=iu(t,"border-left-width",0),u=iu(t,"border-right-width",0),a=i+u;return e-r-o-a},cu=function(t){return ru()?uu(t):iu(t,"height",zi(t))},su=function(t){return ru()?au(t):iu(t,"width",Hi(t))},lu=/(\d+(\.\d+)?)(\w|%)*/,fu=/(\d+(\.\d+)?)%/,du=/(\d+(\.\d+)?)px|em/,mu=function(t,e){var n=Ge(t).getOr(ln(Ue(t)));return e(t)/e(n)*100},gu=function(t,e){mn(t,"width",e+"px")},hu=function(t,e){mn(t,"width",e+"%")},pu=function(t,e){mn(t,"height",e+"px")},vu=function(t){return vn(t,"height").getOrThunk((function(){return cu(t)+"px"}))},bu=function(t,e,n,r){var o=hr(t).map((function(t){var r=n(t);return Math.floor(e/100*r)})).getOr(e);return r(t,o),o},yu=function(t,e,n,r){var o=parseInt(t,10);return Nt(t,"%")&&"table"!==dt(e)?bu(e,o,n,r):o},wu=function(t){var e=vu(t);return e?yu(e,t,zi,pu):zi(t)},xu=function(t,e,n){var r=n(t),o=or(t,e);return r/o},Cu=function(t){var e=vn(t,"width");return e.fold((function(){return p.from(St(t,"width"))}),(function(t){return p.some(t)}))},Su=function(t,e){return t/e.pixelWidth()*100},ku=function(t,e,n){var r=fu.exec(e);if(null!==r)return parseFloat(r[1]);var o=su(t);return Su(o,n)},Ou=function(t,e){var n=Cu(t);return n.fold((function(){var n=Hi(t);return Su(n,e)}),(function(n){return ku(t,n,e)}))},Tu=function(t,e){return t/100*e.pixelWidth()},Eu=function(t,e,n){var r=du.exec(e);if(null!==r)return parseInt(r[1],10);var o=fu.exec(e);if(null!==o){var i=parseFloat(o[1]);return Tu(i,n)}return su(t)},_u=function(t,e){var n=Cu(t);return n.fold((function(){return su(t)}),(function(n){return Eu(t,n,e)}))},Au=function(t){return xu(t,"rowspan",wu)},Du=function(t){var e=Cu(t);return e.bind((function(t){var e=lu.exec(t);return null!==e?p.some({width:i(parseFloat(e[1])),unit:i(e[3])}):p.none()}))},Nu=function(t,e,n){mn(t,"width",e+n)},Ru=function(t){return Hi(t)+"px"},Mu=function(t){return mu(t,Hi)+"%"},zu=function(t){return Cu(t).exists((function(t){return fu.test(t)}))},Bu=function(t){return Cu(t).exists((function(t){return du.test(t)}))},Pu=function(t){return Cu(t).isNone()},Hu=i(fu),Iu=i(du),Lu=function(t,e,n){return vn(t,e).fold((function(){return n(t)+"px"}),(function(t){return t}))},Fu=function(t,e){return Lu(t,"width",(function(t){return _u(t,e)}))},Vu=function(t){return Lu(t,"height",Au)},Uu=function(t,e,n,r,o){var i=Zi(t),u=B(i,(function(t){return t.map(e.edge)}));return B(i,(function(t,e){var i=t.filter(c(ir));return i.fold((function(){var t=nu(u,e);return r(t)}),(function(t){return n(t,o)}))}))},ju=function(t){return t.map((function(t){return t+"px"})).getOr("")},Wu=function(t,e,n){return Uu(t,e,Fu,ju,n)},qu=function(t,e,n){return Uu(t,e,Ou,(function(t){return t.fold((function(){return n.minCellWidth()}),(function(t){return t/n.pixelWidth()*100}))}),n)},$u=function(t,e,n){return Uu(t,e,_u,(function(t){return t.getOrThunk(n.minCellWidth)}),n)},Gu=function(t,e,n,r){var o=eu(t),i=B(o,(function(t){return t.map(e.edge)}));return B(o,(function(t,e){var o=t.filter(c(ur));return o.fold((function(){var t=nu(i,e);return r(t)}),(function(t){return n(t)}))}))},Ku=function(t,e){return Gu(t,e,Au,(function(t){return t.getOrThunk(sr)}))},Xu=function(t,e){return Gu(t,e,Vu,ju)},Yu=ii.generate([{invalid:["raw"]},{pixels:["value"]},{percent:["value"]}]),Ju=function(t,e,n){var r=n.substring(0,n.length-t.length),o=parseFloat(r);return r===o.toString()?e(o):Yu.invalid(n)},Qu=function(t){return Nt(t,"%")?Ju("%",Yu.percent,t):Nt(t,"px")?Ju("px",Yu.pixels,t):Yu.invalid(t)},Zu=Wt(Wt({},Yu),{from:Qu}),ta=function(t,e){return B(t,(function(t){var n=Zu.from(t);return n.fold((function(){return t}),(function(t){var n=t/e*100;return n+"%"}),(function(t){return t+"%"}))}))},ea=function(t,e,n){var r=n/e;return B(t,(function(t){var e=Zu.from(t);return e.fold((function(){return t}),(function(t){return t*r+"px"}),(function(t){return t/100*n+"px"}))}))},na=function(t,e){var n=t.fold((function(){return i("")}),(function(t){var n=t/e;return i(n+"px")}),(function(t){var n=t/e;return i(n+"px")}));return z(e,n)},ra=function(t,e,n){return t.fold((function(){return e}),(function(t){return ea(e,n,t)}),(function(t){return ta(e,n)}))},oa=function(t,e,n){var r=Zu.from(n),o=$(t,(function(t){return"0px"===t}))?na(r,t.length):ra(r,t,e);return ca(o)},ia=function(t,e){return 0===t.length?e:L(t,(function(t,e){return Zu.from(e).fold(i(0),u,u)+t}),0)},ua=function(t,e){var n=Math.floor(t);return{value:n+e,remainder:t-n}},aa=function(t,e){return Zu.from(t).fold(i(t),(function(t){return t+e+"px"}),(function(t){return t+e+"%"}))},ca=function(t){if(0===t.length)return t;var e=L(t,(function(t,e){var n=Zu.from(e).fold((function(){return{value:e,remainder:0}}),(function(t){return ua(t,"px")}),(function(t){return{value:t+"%",remainder:0}}));return{output:[n.value].concat(t.output),remainder:t.remainder+n.remainder}}),{output:[],remainder:0}),n=e.output;return n.slice(0,n.length-1).concat([aa(n[n.length-1],Math.round(e.remainder))])},sa=Zu.from,la=function(t,e,n){P(e,(function(e){var r=t.slice(e.column(),e.colspan()+e.column()),o=ia(r,cr());mn(e.element(),"width",o+n)}))},fa=function(t,e,n,r){P(n,(function(e){var n=t.slice(e.row(),e.rowspan()+e.row()),o=ia(n,sr());mn(e.element(),"height",o+r)})),P(e,(function(e,n){mn(e.element(),"height",t[n])}))},da=function(t){return sa(t).fold(i("px"),i("px"),i("%"))},ma=function(t,e,n,r,o){var i=Tr.fromTable(t),u=i.all,a=Tr.justCells(i);e.each((function(e){var n=da(e),u=Hi(t),c=Wu(i,r,o),s=oa(c,u,e);la(s,a,n),mn(t,"width",e)})),n.each((function(e){var n=da(e),r=zi(t),o=Xu(i,Yi),c=oa(o,r,e);fa(c,u,a,n),mn(t,"height",e)}))},ga=zu,ha=Bu,pa=Pu,va=Mu,ba={ltr:Ji,rtl:Qi},ya=function(t){var e=function(e){return t(e).isRtl()?ba.rtl:ba.ltr},n=function(t,n){return e(n).delta(t,n)},r=function(t,n){return e(n).positions(t,n)},o=function(t){return e(t).edge(t)};return{delta:n,edge:o,positions:r}},wa=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(t.length!==e.length)throw new Error('Wrong number of arguments to struct. Expected "['+t.length+']", got '+e.length+" arguments");var r={};return P(t,(function(t,n){r[t]=i(e[n])})),r}},xa=function(t){var e=wa.apply(null,t),n=[],r=function(t){if(void 0===t)throw new Error("Event bind error: undefined handler");n.push(t)},o=function(t){n=I(n,(function(e){return e!==t}))},i=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var o=e.apply(null,t);P(n,(function(t){t(o)}))};return{bind:r,unbind:o,trigger:i}},Ca=function(t){var e=tt(t,(function(t){return{bind:t.bind,unbind:t.unbind}})),n=tt(t,(function(t){return t.trigger}));return{registry:e,trigger:n}},Sa=ii.generate([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}]),ka=Wt({},Sa),Oa=function(t,e){return 0===t.length?ka.none():1===t.length?ka.only(0):0===e?ka.left(0,1):e===t.length-1?ka.right(e-1,e):e>0&&e<t.length-1?ka.middle(e-1,e,e+1):ka.none()},Ta=function(t,e,n,r){var o=t.slice(0),u=Oa(t,e),a=function(t){return B(t,i(0))},c=i(a(o)),s=function(t){return r.singleColumnWidth(o[t],n)},l=function(t,e){if(n>=0){var i=Math.max(r.minCellWidth(),o[e]-n);return a(o.slice(0,t)).concat([n,i-o[e]]).concat(a(o.slice(e+1)))}var u=Math.max(r.minCellWidth(),o[t]+n),c=o[t]-u;return a(o.slice(0,t)).concat([u-o[t],c]).concat(a(o.slice(e+1)))},f=l,d=function(t,e,n){return l(e,n)},m=function(t,e){if(n>=0)return a(o.slice(0,e)).concat([n]);var i=Math.max(r.minCellWidth(),o[e]+n);return a(o.slice(0,e)).concat([i-o[e]])};return u.fold(c,s,f,d,m)},Ea=function(t,e,n){for(var r=0,o=t;o<e;o++)r+=void 0!==n[o]?n[o]:0;return r},_a=function(t,e){var n=Tr.justCells(t);return B(n,(function(t){var n=Ea(t.column(),t.column()+t.colspan(),e);return{element:t.element(),width:n,colspan:t.colspan()}}))},Aa=function(t,e){var n=Tr.justCells(t);return B(n,(function(t){var n=Ea(t.row(),t.row()+t.rowspan(),e);return{element:t.element,height:i(n),rowspan:t.rowspan}}))},Da=function(t,e){return B(t.all,(function(t,n){return{element:t.element,height:i(e[n])}}))},Na=function(t){return L(t,(function(t,e){return t+e}),0)},Ra=function(t,e,n,r,o){var i=o.getCellDelta(e),u=Tr.fromTable(t),a=o.getWidths(u,r,o),c=Ta(a,n,i,o),s=B(c,(function(t,e){return t+a[e]})),l=_a(u,s);P(l,(function(t){o.setElementWidth(t.element,t.width)})),n===u.grid.columns()-1&&o.adjustTableWidth(i)},Ma=function(t,e,n,r){var o=Tr.fromTable(t),i=Ku(o,r),u=B(i,(function(t,r){return n===r?Math.max(e+t,sr()):t})),a=Aa(o,u),c=Da(o,u);P(c,(function(t){pu(t.element(),t.height())})),P(a,(function(t){pu(t.element(),t.height())}));var s=Na(u);pu(t,s)},za=function(t,e,n,r){var o=Tr.generate(e),i=r.getWidths(o,n,r),u=_a(o,i);P(u,(function(t){r.setElementWidth(t.element,t.width)}))},Ba=function(t,e,n,r,o,u,a){return{target:i(t),x:i(e),y:i(n),stop:r,prevent:o,kill:u,raw:i(a)}},Pa=function(t){var e=Vt.fromDom(un(t).getOr(t.target)),n=function(){return t.stopPropagation()},o=function(){return t.preventDefault()},i=r(o,n);return Ba(e,t.clientX,t.clientY,n,o,i,t)},Ha=function(t,e){return function(n){t(n)&&e(Pa(n))}},Ia=function(t,e,n,r,o){var i=Ha(n,r);return t.dom().addEventListener(e,i,o),{unbind:a(Fa,t,e,i,o)}},La=function(t,e,n,r){return Ia(t,e,n,r,!1)},Fa=function(t,e,n,r){t.dom().removeEventListener(e,n,r)},Va=i(!0),Ua=function(t,e,n){return La(t,e,Va,n)},ja=Pa,Wa=function(t,e){var n=St(t,e);return void 0===n||""===n?[]:n.split(" ")},qa=function(t,e,n){var r=Wa(t,e),o=r.concat([n]);return xt(t,e,o.join(" ")),!0},$a=function(t,e,n){var r=I(Wa(t,e),(function(t){return t!==n}));return r.length>0?xt(t,e,r.join(" ")):Tt(t,e),!1},Ga=function(t){return void 0!==t.dom().classList},Ka=function(t){return Wa(t,"class")},Xa=function(t,e){return qa(t,"class",e)},Ya=function(t,e){return $a(t,"class",e)},Ja=function(t,e){Ga(t)?t.dom().classList.add(e):Xa(t,e)},Qa=function(t){var e=Ga(t)?t.dom().classList:Ka(t);0===e.length&&Tt(t,"class")},Za=function(t,e){if(Ga(t)){var n=t.dom().classList;n.remove(e)}else Ya(t,e);Qa(t)},tc=function(t,e){return Ga(t)&&t.dom().classList.contains(e)},ec=function(t){var e=t.replace(/\./g,"-"),n=function(t){return e+"-"+t};return{resolve:n}},nc=ec("ephox-dragster"),rc=nc.resolve,oc=function(t){var e=Wt({layerClass:rc("blocker")},t),n=Vt.fromTag("div");xt(n,"role","presentation"),gn(n,{position:"fixed",left:"0px",top:"0px",width:"100%",height:"100%"}),Ja(n,rc("blocker")),Ja(n,e.layerClass);var r=function(){return n},o=function(){An(n)};return{element:r,destroy:o}},ic=function(t){return t.slice(0).sort()},uc=function(t,e){throw new Error("All required keys ("+ic(t).join(", ")+") were not specified. Specified keys were: "+ic(e).join(", ")+".")},ac=function(t){throw new Error("Unsupported keys for object: "+ic(t).join(", "))},cc=function(t,e){if(!C(e))throw new Error("The "+t+" fields must be an array. Was: "+e+".");P(e,(function(e){if(!w(e))throw new Error("The value "+e+" in the "+t+" fields was not a string.")}))},sc=function(t,e){throw new Error("All values need to be of type: "+e+". Keys ("+ic(t).join(", ")+") were not.")},lc=function(t){var e=ic(t),n=U(e,(function(t,n){return n<e.length-1&&t===e[n+1]}));n.each((function(t){throw new Error("The field: "+t+" occurs more than once in the combined fields: ["+e.join(", ")+"].")}))},fc=function(t,e){return dc(t,e,{validate:T,label:"function"})},dc=function(t,e,n){if(0===e.length)throw new Error("You must specify at least one required field.");return cc("required",e),lc(e),function(r){var o=J(r),i=$(e,(function(t){return R(o,t)}));i||uc(e,o),t(e,o);var u=I(e,(function(t){return!n.validate(r[t],t)}));return u.length>0&&sc(u,n.label),r}},mc=function(t,e){var n=I(e,(function(e){return!R(t,e)}));n.length>0&&ac(n)},gc=function(t){return fc(mc,t)},hc=gc(["compare","extract","mutate","sink"]),pc=gc(["element","start","stop","destroy"]),vc=gc(["forceDrop","drop","move","delayDrop"]),bc=function(t,e){return Si(e.left()-t.left(),e.top()-t.top())},yc=function(t){return p.some(Si(t.x(),t.y()))},wc=function(t,e){t.mutate(e.left(),e.top())},xc=function(t,e){var n=oc(e),r=Ua(n.element(),"mousedown",t.forceDrop),o=Ua(n.element(),"mouseup",t.drop),i=Ua(n.element(),"mousemove",t.move),u=Ua(n.element(),"mouseout",t.delayDrop),a=function(){n.destroy(),o.unbind(),i.unbind(),u.unbind(),r.unbind()},c=function(t){Sn(t,n.element())},s=function(){An(n.element())};return pc({element:n.element,start:c,stop:s,destroy:a})},Cc=hc({compare:bc,extract:yc,sink:xc,mutate:wc}),Sc=function(e,n){var r=null,o=function(){null!==r&&(t.clearTimeout(r),r=null)},i=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];null!==r&&t.clearTimeout(r),r=t.setTimeout((function(){e.apply(null,o),r=null}),n)};return{cancel:o,throttle:i}};function kc(){var t=p.none(),e=function(){t=p.none()},n=function(e,n){var r=t.map((function(t){return e.compare(t,n)}));return t=p.some(n),r},r=function(t,e){var r=e.extract(t);r.each((function(t){var r=n(e,t);r.each((function(t){o.trigger.move(t)}))}))},o=Ca({move:xa(["info"])});return{onEvent:r,reset:e,events:o.registry}}function Oc(){return{onEvent:n,reset:n}}function Tc(){var t=Oc(),e=kc(),n=t,r=function(){n.reset(),n=e},o=function(){n.reset(),n=t},i=function(t,e){n.onEvent(t,e)},u=function(){return n===e};return{on:r,off:o,isOn:u,onEvent:i,events:e.events}}var Ec=function(t,e,n){var r=!1,o=Ca({start:xa([]),stop:xa([])}),i=Tc(),u=function(){m.stop(),i.isOn()&&(i.off(),o.trigger.stop())},a=Sc(u,200),c=function(t){m.start(t),i.on(),o.trigger.start()},s=function(t){a.cancel(),i.onEvent(t,e)};i.events.move.bind((function(n){e.mutate(t,n.info())}));var l=function(){r=!0},f=function(){r=!1},d=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];r&&t.apply(null,e)}},m=e.sink(vc({forceDrop:u,drop:d(u),move:d(s),delayDrop:d(a.throttle)}),n),g=function(){m.destroy()};return{element:m.element,go:c,on:l,off:f,destroy:g,events:o.registry}},_c=function(t,e){void 0===e&&(e={});var n=void 0!==e.mode?e.mode:Cc;return Ec(t,n,e)},Ac=function(t){return"true"===St(t,"contenteditable")},Dc=function(t,e){return nr(t,"[contenteditable]",e)},Nc=ec("ephox-snooker"),Rc=Nc.resolve,Mc=function(){var t=Ca({drag:xa(["xDelta","yDelta"])}),e=function(e,n){t.trigger.drag(e,n)};return{mutate:e,events:t.registry}},zc=function(){var t=Ca({drag:xa(["xDelta","yDelta","target"])}),e=p.none(),n=Mc();n.events.drag.bind((function(n){e.each((function(e){t.trigger.drag(n.xDelta(),n.yDelta(),e)}))}));var r=function(t){e=p.some(t)},o=function(){return e};return{assign:r,get:o,mutate:n.mutate,events:t.registry}},Bc=function(t,e,n,r,o){var i=Vt.fromTag("div");return gn(i,{position:"absolute",left:e-r/2+"px",top:n+"px",height:o+"px",width:r+"px"}),Ct(i,{"data-column":t,role:"presentation"}),i},Pc=function(t,e,n,r,o){var i=Vt.fromTag("div");return gn(i,{position:"absolute",left:e+"px",top:n-o/2+"px",height:o+"px",width:r+"px"}),Ct(i,{"data-row":t,role:"presentation"}),i},Hc=Rc("resizer-bar"),Ic=Rc("resizer-rows"),Lc=Rc("resizer-cols"),Fc=7,Vc=function(t){var e=Gn(t.parent(),"."+Hc);P(e,An)},Uc=function(t,e,n){var r=t.origin();P(e,(function(e){e.each((function(e){var o=n(r,e);Ja(o,Hc),Sn(t.parent(),o)}))}))},jc=function(t,e,n,r){Uc(t,e,(function(t,e){var o=Bc(e.col,e.x-t.left(),n.top()-t.top(),Fc,r);return Ja(o,Lc),o}))},Wc=function(t,e,n,r){Uc(t,e,(function(t,e){var o=Pc(e.row,n.left()-t.left(),e.y-t.top(),r,Fc);return Ja(o,Ic),o}))},qc=function(t,e,n,r,o,i){var u=Ti(e),a=n.length>0?o.positions(n,e):[];Wc(t,a,u,Ii(e));var c=r.length>0?i.positions(r,e):[];jc(t,c,u,Bi(e))},$c=function(t,e,n,r){Vc(t);var o=Tr.fromTable(e),i=eu(o),u=Zi(o);qc(t,e,i,u,n,r)},Gc=function(t,e){var n=Gn(t.parent(),"."+Hc);P(n,e)},Kc=function(t){Gc(t,(function(t){mn(t,"display","none")}))},Xc=function(t){Gc(t,(function(t){mn(t,"display","block")}))},Yc=function(t){return tc(t,Ic)},Jc=function(t){return tc(t,Lc)},Qc=Rc("resizer-bar-dragging"),Zc=function(t,e,n){var r=zc(),o=_c(r,{}),i=p.none(),u=function(t,e){return p.from(St(t,e))};r.events.drag.bind((function(t){u(t.target(),"data-row").each((function(e){var n=ar(t.target(),"top");mn(t.target(),"top",n+t.yDelta()+"px")})),u(t.target(),"data-column").each((function(e){var n=ar(t.target(),"left");mn(t.target(),"left",n+t.xDelta()+"px")}))}));var c=function(t,e){var n=ar(t,e),r=rr(t,"data-initial-"+e,0);return n-r};o.events.stop.bind((function(){r.get().each((function(r){i.each((function(o){u(r,"data-row").each((function(t){var e=c(r,"top");Tt(r,"data-initial-top"),v.trigger.adjustHeight(o,e,parseInt(t,10))})),u(r,"data-column").each((function(t){var e=c(r,"left");Tt(r,"data-initial-left"),v.trigger.adjustWidth(o,e,parseInt(t,10))})),$c(t,o,n,e)}))}))}));var s=function(e,n){v.trigger.startAdjust(),r.assign(e),xt(e,"data-initial-"+n,ar(e,n)),Ja(e,Qc),mn(e,"opacity","0.2"),o.go(t.parent())},l=Ua(t.parent(),"mousedown",(function(t){Yc(t.target())&&s(t.target(),"top"),Jc(t.target())&&s(t.target(),"left")})),f=function(e){return He(e,t.view())},d=function(t){return nr(t,"table",f).filter((function(t){return Dc(t,f).exists(Ac)}))},m=Ua(t.view(),"mouseover",(function(r){d(r.target()).fold((function(){cn(r.target())&&Vc(t)}),(function(r){i=p.some(r),$c(t,r,n,e)}))})),g=function(){l.unbind(),m.unbind(),o.destroy(),Vc(t)},h=function(r){$c(t,r,n,e)},v=Ca({adjustHeight:xa(["table","delta","row"]),adjustWidth:xa(["table","delta","column"]),startAdjust:xa([])});return{destroy:g,refresh:h,on:o.on,off:o.off,hideBars:a(Kc,t),showBars:a(Xc,t),events:v.registry}},ts=function(t,e,n){var r=Yi,o=Zc(t,e,r),i=Ca({beforeResize:xa(["table"]),afterResize:xa(["table"]),startDrag:xa([])});return o.events.adjustHeight.bind((function(t){var e=t.table();i.trigger.beforeResize(e);var n=r.delta(t.delta(),e);Ma(e,n,t.row(),r),i.trigger.afterResize(e)})),o.events.startAdjust.bind((function(t){i.trigger.startDrag()})),o.events.adjustWidth.bind((function(t){var r=t.table();i.trigger.beforeResize(r);var o=e.delta(t.delta(),r),u=n(r);Ra(r,o,t.column(),e,u),i.trigger.afterResize(r)})),{on:o.on,off:o.off,hideBars:o.hideBars,showBars:o.showBars,destroy:o.destroy,events:i.registry}},es={create:ts},ns=function(t,e){return t.fire("newrow",{node:e})},rs=function(t,e){return t.fire("newcell",{node:e})},os=function(t,e,n,r){t.fire("ObjectResizeStart",{target:e,width:n,height:r})},is=function(t,e,n,r){t.fire("ObjectResized",{target:e,width:n,height:r})},us=function(t,e,n,r,o){t.fire("TableSelectionChange",{cells:e,start:n,finish:r,otherCells:o})},as=function(t){t.fire("TableSelectionClear")},cs="tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol",ss={"border-collapse":"collapse",width:"100%"},ls=function(t){if(_s(t)){var e=t.getBody().offsetWidth;return Wt(Wt({},ss),{width:e+"px"})}return As(t)?ot(ss,(function(t,e){return"width"!==e})):ss},fs={border:"1"},ds=function(t){return t.getParam("table_sizing_mode","auto")},ms=function(t){return t.getParam("table_responsive_width")},gs=function(t){return t.getParam("table_default_attributes",fs,"object")},hs=function(t){return t.getParam("table_default_styles",ls(t),"object")},ps=function(t){return t.getParam("table_resize_bars",!0,"boolean")},vs=function(t){return t.getParam("table_tab_navigation",!0,"boolean")},bs=function(t){return t.getParam("table_cell_advtab",!0,"boolean")},ys=function(t){return t.getParam("table_row_advtab",!0,"boolean")},ws=function(t){return t.getParam("table_advtab",!0,"boolean")},xs=function(t){return t.getParam("table_appearance_options",!0,"boolean")},Cs=function(t){return t.getParam("table_grid",!0,"boolean")},Ss=function(t){return t.getParam("table_style_by_css",!1,"boolean")},ks=function(t){return t.getParam("table_cell_class_list",[],"array")},Os=function(t){return t.getParam("table_row_class_list",[],"array")},Ts=function(t){return t.getParam("table_class_list",[],"array")},Es=function(t){return"relative"===ds(t)||!0===ms(t)},_s=function(t){return"fixed"===ds(t)||!1===ms(t)},As=function(t){return"responsive"===ds(t)},Ds=function(t){return t.getParam("table_toolbar",cs)},Ns=function(t){var e="section",n=t.getParam("table_header_type",e,"string"),r=["section","cells","sectionCells","auto"];return R(r,n)?n:e},Rs=function(t){var e=t.getParam("table_clone_elements");return w(e)?p.some(e.split(/[ ,]/)):Array.isArray(e)?p.some(e):p.none()},Ms=function(t){var e=t.getParam("object_resizing",!0);return w(e)?"table"===e:e},zs=function(t){return t.nodeName.toLowerCase()},Bs=function(t){return Vt.fromDom(t.getBody())},Ps=function(t){return t.getBoundingClientRect().width},Hs=function(t){return t.getBoundingClientRect().height},Is=function(t){return function(e){return He(e,Bs(t))}},Ls=function(t){return t?t.replace(/px$/,""):""},Fs=function(t){return/^\d+(\.\d+)?$/.test(t)?t+"px":t},Vs=function(t){Tt(t,"data-mce-style"),P(gr(t),(function(t){return Tt(t,"data-mce-style")}))},Us=function(t,e){var n=t.dom.getStyle(e,"width")||t.dom.getAttrib(e,"width");return p.from(n).filter(zt)},js=function(t){return/^(\d+(\.\d+)?)%$/.test(t)},Ws=function(t){return"rtl"===hn(t,"direction")?"rtl":"ltr"},qs={isRtl:i(!1)},$s={isRtl:i(!0)},Gs=function(t){var e=Ws(t);return"rtl"===e?$s:qs},Ks=function(t){var e=t,n=function(){return e},r=function(t){e=t};return{get:n,set:r}},Xs=function(t){var e=function(){return Hi(t)},r=i(0);return{width:e,pixelWidth:e,getWidths:$u,getCellDelta:r,singleColumnWidth:i([0]),minCellWidth:r,setElementWidth:n,adjustTableWidth:n,label:"none"}},Ys=function(t,e){var n=Ks(parseFloat(t)),r=Ks(Hi(e)),o=function(t){return t/r.get()*100},i=function(t,e){return[100-t]},u=function(){return cr()/r.get()*100},a=function(t){var o=n.get(),i=t/100*o,u=o+i;hu(e,u),n.set(u),r.set(Hi(e))};return{width:n.get,pixelWidth:r.get,getWidths:qu,getCellDelta:o,singleColumnWidth:i,minCellWidth:u,setElementWidth:hu,adjustTableWidth:a,label:"percent"}},Js=function(t,e){var n=Ks(t),r=n.get,o=u,i=function(t,e){var n=Math.max(cr(),t+e);return[n-t]},a=function(t){var o=r()+t;gu(e,o),n.set(o)};return{width:r,pixelWidth:r,getWidths:$u,getCellDelta:o,singleColumnWidth:i,minCellWidth:cr,setElementWidth:gu,adjustTableWidth:a,label:"pixel"}},Qs=function(t,e){var n=Hu().exec(e);if(null!==n)return Ys(n[1],t);var r=Iu().exec(e);if(null!==r){var o=parseInt(r[1],10);return Js(o,t)}var i=Hi(t);return Js(i,t)},Zs=function(t){var e=Cu(t);return e.fold((function(){return Xs(t)}),(function(e){return Qs(t,e)}))},tl={getTableSize:Zs,pixelSize:Js,percentageSize:Ys,noneSize:Xs},el=function(t,e){if(Es(t)){var n=Us(t,e.dom()).filter(js).getOrThunk((function(){return va(e)}));return tl.percentageSize(n,e)}return _s(t)?tl.pixelSize(Hi(e),e):tl.getTableSize(e)},nl=function(t){Tt(t,"width")},rl=function(t,e,n){var r=Mu(t);ma(t,p.some(r),p.none(),e,n),nl(t)},ol=function(t,e,n){var r=Ru(t);ma(t,p.some(r),p.none(),e,n),nl(t)},il=function(t){bn(t,"width"),P(gr(t),(function(t){bn(t,"width"),nl(t)})),nl(t)},ul=function(t,e){var n=ya(Gs),r=el(t,e);rl(e,n,r)},al=function(t,e){var n=ya(Gs),r=el(t,e);ol(e,n,r)},cl=il,sl=function(t){P(gr(t),(function(t){var e=hn(t,"width");mn(t,"width",e),Tt(t,"width")}))},ll=function(){var t=Vt.fromTag("div");return gn(t,{position:"static",height:"0",width:"0",padding:"0",margin:"0",border:"0"}),Sn(sn(),t),t},fl=function(t,e){return t.inline?Ni.body(Bs(t),ll()):Ni.only(Vt.fromDom(t.getDoc()))},dl=function(t,e){t.inline&&An(e.parent())},ml=function(t){var e,n,r=p.none(),o=p.none(),i=p.none(),u=function(t){return"TABLE"===t.nodeName},a=function(){return o},c=function(){return i.getOr(Ni.only(Vt.fromDom(t.getBody())))},s=function(){o.each((function(t){t.destroy()})),i.each((function(e){dl(t,e)}))};return t.on("init",(function(){var e=ya(Gs),n=fl(t);if(i=p.some(n),Ms(t)&&ps(t)){var u=function(e){return el(t,e)},a=es.create(n,e,u);a.on(),a.events.startDrag.bind((function(e){r=p.some(t.selection.getRng())})),a.events.beforeResize.bind((function(e){var n=e.table().dom();os(t,n,Ps(n),Hs(n))})),a.events.afterResize.bind((function(e){var n=e.table(),o=n.dom();Vs(n),r.each((function(e){t.selection.setRng(e),t.focus()})),is(t,o,Ps(o),Hs(o)),t.undoManager.add()})),o=p.some(a)}})),t.on("ObjectResizeStart",(function(r){var o=r.target;if(u(o)){var i=Vt.fromDom(o);!ha(i)&&_s(t)?al(t,i):!ga(i)&&Es(t)&&ul(t,i),e=r.width,n=Us(t,o).getOr("")}})),t.on("ObjectResized",(function(r){var o=r.target;if(u(o)){var i=Vt.fromDom(o);if(""===n||!js(n)&&As(t))ul(t,i);else if(js(n)){var a=parseFloat(n.replace("%","")),c=r.width*a/e;mn(i,"width",c+"%")}else sl(i);Vs(i)}})),t.on("SwitchMode",(function(){a().each((function(e){t.mode.isReadOnly()?e.hideBars():e.showBars()}))})),{lazyResize:a,lazyWire:c,destroy:s}},gl=function(t,e){return{element:i(t),offset:i(e)}},hl=function(t,e,n){return t.property().isText(e)&&0===t.property().getText(e).trim().length||t.property().isComment(e)?n(e).bind((function(e){return hl(t,e,n).orThunk((function(){return p.some(e)}))})):p.none()},pl=function(t,e){if(t.property().isText(e))return t.property().getText(e).length;var n=t.property().children(e);return n.length},vl=function(t,e){var n=hl(t,e,t.query().prevSibling).getOr(e);if(t.property().isText(n))return gl(n,pl(t,n));var r=t.property().children(n);return r.length>0?vl(t,r[r.length-1]):gl(n,pl(t,n))},bl=vl,yl=Co(),wl=function(t){return bl(yl,t)},xl=function(t,e){var n=Du(t);n.each((function(n){var r=n.width()/2;Nu(t,r,n.unit()),Nu(e,r,n.unit())}))},Cl=function(t){var e=Tr.fromTable(t);return e.grid},Sl=function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e},kl=function(t,e,n){return t.isSome()&&e.isSome()?p.some(n(t.getOrDie(),e.getOrDie())):p.none()},Ol=function(t,e,n,r){n===r?Tt(t,e):xt(t,e,n)},Tl=function(t,e){var n=[],r=[],o=X($n(t,"caption,colgroup")).fold((function(){return a(Cn,t)}),(function(t){return a(xn,t)})),i=function(e,i){var u=tr(t,i).getOrThunk((function(){var e=Vt.fromTag(i,Ue(t).dom());return"thead"===i?o(e):Sn(t,e),e}));_n(u);var a=B(e,(function(t){t.isNew()&&n.push(t.element());var e=t.element();return _n(e),P(t.cells(),(function(t){t.isNew()&&r.push(t.element()),Ol(t.element(),"colspan",t.colspan(),1),Ol(t.element(),"rowspan",t.rowspan(),1),Sn(e,t.element())})),e}));En(u,a)},u=function(e){tr(t,e).each(An)},c=function(t,e){t.length>0?i(t,e):u(e)},s=[],l=[],f=[];return P(e,(function(t){switch(t.section()){case"thead":s.push(t);break;case"tbody":l.push(t);break;case"tfoot":f.push(t);break}})),c(s,"thead"),c(l,"tbody"),c(f,"tfoot"),{newRows:n,newCells:r}},El=function(t){return B(t,(function(t){var e=Gr(t.element());return P(t.cells(),(function(t){var n=Kr(t.element());Ol(n,"colspan",t.colspan(),1),Ol(n,"rowspan",t.rowspan(),1),Sn(e,n)})),e}))},_l=function(t,e,n){var r=t.cells(),o=r.slice(0,e),i=r.slice(e),u=o.concat([n]).concat(i);return Dl(t,u)},Al=function(t,e,n){var r=t.cells();r[e]=n},Dl=function(t,e){return Ln(e,t.section())},Nl=function(t,e){var n=t.cells(),r=B(n,e);return Ln(r,t.section())},Rl=function(t,e){return t.cells()[e]},Ml=function(t,e){return Rl(t,e).element()},zl=function(t){return t.cells().length},Bl=function(t,e){return B(t,(function(t){return Rl(t,e)}))},Pl=function(t,e){return t[e]},Hl=function(t,e){if(0===t.length)return 0;var n=t[0],r=j(t,(function(t){return!e(n.element(),t.element())}));return r.fold((function(){return t.length}),(function(t){return t}))},Il=function(t,e,n,r){var o=Pl(t,e).cells().slice(n),i=Hl(o,r),u=Bl(t,n).slice(e),a=Hl(u,r);return{colspan:i,rowspan:a}},Ll=function(t,e){var n=B(t,(function(t){return B(t.cells(),(function(){return!1}))})),r=function(t,e,r,o){for(var i=t;i<t+r;i++)for(var u=e;u<e+o;u++)n[i][u]=!0};return B(t,(function(o,i){var u=q(o.cells(),(function(o,u){if(!1===n[i][u]){var a=Il(t,i,u,e);return r(i,u,a.rowspan,a.colspan),[zn(o.element(),a.rowspan,a.colspan,o.isNew())]}return[]}));return Fn(u,o.section())}))},Fl=function(t,e,n){for(var r=[],o=0;o<t.grid.rows();o++){for(var i=[],u=0;u<t.grid.columns();u++){var a=Tr.getAt(t,o,u).map((function(t){return Hn(t.element(),n)})).getOrThunk((function(){return Hn(e.gap(),!0)}));i.push(a)}var c=Ln(i,t.all[o].section());r.push(c)}return r},Vl=function(t,e){return Fl(t,e,!1)},Ul=function(t,e){var n=function(t){var n=Y(t,(function(t){return qe(t.element()).map((function(t){var e=qe(t).isNone();return Hn(t,e)}))}));return n.getOrThunk((function(){return Hn(e.row(),!0)}))};return B(t,(function(t){var e=n(t.details());return In(e.element(),t.details(),t.section(),e.isNew())}))},jl=function(t,e){var n=Ll(t,He);return Ul(n,e)},Wl=function(t,e){return Y(t.all,(function(t){return U(t.cells(),(function(t){return He(e,t.element())}))}))},ql=function(t,e,n,r,o){return function(u,a,c,s,l,f){var d=Tr.fromTable(a),m=e(d,c).map((function(e){var n=Vl(d,s),r=t(n,e,He,o(s)),u=jl(r.grid(),s);return{grid:i(u),cursor:r.cursor}}));return m.fold((function(){return p.none()}),(function(t){var e=Tl(a,t.grid()),o=p.from(f).getOrThunk((function(){return tl.getTableSize(a)}));return n(a,t.grid(),l,o),r(a),$c(u,a,Yi,l),p.some({cursor:t.cursor,newRows:i(e.newRows),newCells:i(e.newCells)})}))}},$l=function(t,e){return mr(e.element()).bind((function(e){return Wl(t,e)}))},Gl=function(t,e){return mr(e.element()).bind((function(n){return Wl(t,n).map((function(t){var n=Wt(Wt({},t),{generators:e.generators,clipboard:e.clipboard});return n}))}))},Kl=function(t,e){var n=B(e.selection(),(function(e){return mr(e).bind((function(e){return Wl(t,e)}))})),r=Sl(n);return r.length>0?p.some({cells:r,generators:e.generators,clipboard:e.clipboard}):p.none()},Xl=function(t,e){return e.mergable()},Yl=function(t,e){return e.unmergable()},Jl=function(t,e){var n=B(e.selection(),(function(e){return mr(e).bind((function(e){return Wl(t,e)}))})),r=Sl(n);return r.length>0?p.some(r):p.none()},Ql=function(t,e,n,r){if(0===t.length)return t;for(var o=e.startRow();o<=e.finishRow();o++)for(var i=e.startCol();i<=e.finishCol();i++)Al(t[o],i,Hn(r(),!1));return t},Zl=function(t,e,n,r){for(var o=!0,i=0;i<t.length;i++)for(var u=0;u<zl(t[0]);u++){var a=Ml(t[i],u),c=n(a,e);!0===c&&!1===o?Al(t[i],u,Hn(r(),!0)):!0===c&&(o=!1)}return t},tf=function(t,e){return F(t,(function(t,n){return M(t,(function(t){return e(t.element(),n.element())}))?t:t.concat([n])}),[])},ef=function(t,e,n,r){return e>0&&e<t[0].cells().length&&P(t,(function(t){var o=t.cells()[e-1],i=t.cells()[e],u=n(i.element(),o.element());u&&Al(t,e,Hn(r(),!0))})),t},nf=function(t,e,n,r){if(e>0&&e<t.length){var o=t[e-1].cells(),i=tf(o,n);P(i,(function(o){for(var i=p.none(),u=function(e){for(var u=function(u){var a=t[e].cells()[u],c=n(a.element(),o.element());c&&(i.isNone()&&(i=p.some(r())),i.each((function(n){Al(t[e],u,Hn(n,!0))})))},a=0;a<zl(t[0]);a++)u(a)},a=e;a<t.length;a++)u(a)}))}return t},rf=function(t){var e=function(e){return t===e},n=function(e){return rf(t)},r=function(e){return rf(t)},o=function(e){return rf(e(t))},u=function(e){return rf(t)},a=function(e){e(t)},c=function(e){return e(t)},s=function(e,n){return n(t)},d=function(e){return e(t)},m=function(e){return e(t)},g=function(){return p.some(t)};return{is:e,isValue:f,isError:l,getOr:i(t),getOrThunk:i(t),getOrDie:i(t),or:n,orThunk:r,fold:s,map:o,mapError:u,each:a,bind:c,exists:d,forall:m,toOption:g}},of=function(t){var e=function(t){return t()},r=function(){return s(String(t))()},o=function(t){return t},i=function(t){return t()},a=function(e){return of(t)},c=function(e){return of(e(t))},d=function(e){return of(t)},m=function(e,n){return e(t)};return{is:l,isValue:l,isError:f,getOr:u,getOrThunk:e,getOrDie:r,or:o,orThunk:i,fold:m,map:a,mapError:c,each:n,bind:d,exists:l,forall:f,toOption:p.none}},uf=function(t,e){return t.fold((function(){return of(e)}),rf)},af={value:rf,error:of,fromOption:uf},cf=function(t,e,n){if(t.row()>=e.length||t.column()>zl(e[0]))return af.error("invalid start address out of table bounds, row: "+t.row()+", column: "+t.column());var r=e.slice(t.row()),o=r[0].cells().slice(t.column()),i=zl(n[0]),u=n.length;return af.value({rowDelta:r.length-u,colDelta:o.length-i})},sf=function(t,e){var n=zl(t[0]),r=zl(e[0]);return{rowDelta:0,colDelta:n-r}},lf=function(t,e){var n=t.length,r=e.length;return{rowDelta:n-r,colDelta:0}},ff=function(t,e){return B(t,(function(){return Hn(e.cell(),!0)}))},df=function(t,e,n){return t.concat(z(e,(function(){return Dl(t[t.length-1],ff(t[t.length-1].cells(),n))})))},mf=function(t,e,n){return B(t,(function(t){return Dl(t,t.cells().concat(ff(z(e,u),n)))}))},gf=function(t,e,n){var r=e.colDelta<0?mf:u,o=e.rowDelta<0?df:u,i=r(t,Math.abs(e.colDelta),n);return o(i,Math.abs(e.rowDelta),n)},hf=function(t,e,n,r){var o=Rl(t[e],n),i=a(r,o.element()),u=t[e];return t.length>1&&zl(u)>1&&(n>0&&i(Ml(u,n-1))||n<u.cells().length-1&&i(Ml(u,n+1))||e>0&&i(Ml(t[e-1],n))||e<t.length-1&&i(Ml(t[e+1],n)))},pf=function(t,e,n,r,o){for(var i=t.row(),u=t.column(),a=n.length,c=zl(n[0]),s=i+a,l=u+c,f=i;f<s;f++)for(var d=u;d<l;d++){hf(e,f,d,o)&&Zl(e,Ml(e[f],d),o,r.cell);var m=Ml(n[f-i],d-u),g=r.replace(m);Al(e[f],d,Hn(g,!0))}return e},vf=function(t,e,n,r,o){var i=cf(t,e,n);return i.map((function(i){var u=gf(e,i,r);return pf(t,u,n,r,o)}))},bf=function(t,e,n,r,o){ef(e,t,o,r.cell);var i=lf(n,e),u=gf(n,i,r),a=lf(e,u),c=gf(e,a,r);return B(c,(function(e,n){var r=e.cells().slice(0,t).concat(u[n].cells()).concat(e.cells().slice(t,e.cells().length));return Dl(e,r)}))},yf=function(t,e,n,r,o){nf(e,t,o,r.cell);var i=sf(n,e),u=gf(n,i,r),a=sf(e,u),c=gf(e,a,r);return c.slice(0,t).concat(u).concat(c.slice(t,c.length))},wf=function(t,e,n,r,o){var i=t.slice(0,e),u=t.slice(e),a=Nl(t[n],(function(n,i){var u=e>0&&e<t.length&&r(Ml(t[e-1],i),Ml(t[e],i)),a=u?Rl(t[e],i):Hn(o(n.element(),r),!0);return a}));return i.concat([a]).concat(u)},xf=function(t,e,n,r,o){return B(t,(function(t){var i=e>0&&e<zl(t)&&r(Ml(t,e-1),Ml(t,e)),u=i?Rl(t,e):Hn(o(Ml(t,n),r),!0);return _l(t,e,u)}))},Cf=function(t,e,n){var r=B(t,(function(t){var r=t.cells().slice(0,e).concat(t.cells().slice(n+1));return Ln(r,t.section())}));return I(r,(function(t){return t.cells().length>0}))},Sf=function(t,e,n){return t.slice(0,e).concat(t.slice(n+1))},kf=function(t,e,n,r){var o=function(t){return M(e,(function(e){return n(t.element(),e.element())}))};return B(t,(function(t){return Nl(t,(function(t){return o(t)?Hn(r(t.element(),n),!0):t}))}))},Of=function(t,e,n,r){return void 0!==Ml(t[e],n)&&e>0&&r(Ml(t[e-1],n),Ml(t[e],n))},Tf=function(t,e,n){return e>0&&n(Ml(t,e-1),Ml(t,e))},Ef=function(t,e,n,r){var o=q(t,(function(r,o){var i=Of(t,o,e,n)||Tf(r,e,n);return i?[]:[Rl(r,e)]}));return kf(t,o,n,r)},_f=function(t,e,n,r){var o=t[e],i=q(o.cells(),(function(r,i){var u=Of(t,e,i,n)||Tf(o,i,n);return u?[]:[r]}));return kf(t,i,n,r)},Af=gc(["cell","row","replace","gap"]),Df=function(t){var e=rr(t,"colspan",1),n=rr(t,"rowspan",1);return{element:i(t),colspan:i(e),rowspan:i(n)}},Nf=function(t,e){void 0===e&&(e=Df),Af(t);var n=Ks(p.none()),r=function(e){return t.cell(e)},o=function(t){var n=e(t);return r(n)},i=function(t){var e=o(t);return n.get().isNone()&&n.set(p.some(e)),u=p.some({item:t,replacement:e}),e},u=p.none(),a=function(t,e){return u.fold((function(){return i(t)}),(function(n){return e(t,n.item)?n.replacement:i(t)}))};return{getOrInit:a,cursor:n.get}},Rf=function(t,e){return function(n){var r=Ks(p.none());Af(n);var o=[],i=function(t,e){return U(o,(function(n){return e(n.item,t)}))},u=function(i){var u={scope:t},a=n.replace(i,e,u);return o.push({item:i,sub:a}),r.get().isNone()&&r.set(p.some(a)),a},a=function(t,e){return i(t,e).fold((function(){return u(t)}),(function(n){return e(t,n.item)?n.sub:u(t)}))};return{replaceOrInit:a,cursor:r.get}}},Mf=function(t){Af(t);var e=Ks(p.none()),n=function(n){return e.get().isNone()&&e.set(p.some(n)),function(){var e=t.cell({element:i(n),colspan:i(1),rowspan:i(1)});return bn(e,"width"),bn(n,"width"),e}};return{combine:n,cursor:e.get}},zf={modification:Nf,transform:Rf,merging:Mf},Bf=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","table","thead","tfoot","tbody","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],Pf=function(t,e){var n=t.property().name(e);return R(["ol","ul"],n)},Hf=function(t,e){var n=t.property().name(e);return R(Bf,n)},If=function(t,e){return R(["br","img","hr","input"],t.property().name(e))},Lf=Co(),Ff=function(t){return Hf(Lf,t)},Vf=function(t){return Pf(Lf,t)},Uf=function(t){return If(Lf,t)},jf=function(t){var e=function(t){return"br"===dt(t)},n=function(t){return $(t,(function(t){return e(t)||vt(t)&&0===Pr(t).trim().length}))},r=function(t){return"li"===dt(t)||Xn(t,Vf).isSome()},o=function(t){return Xe(t).map((function(t){return!!Ff(t)||!!Uf(t)&&"img"!==dt(t)})).getOr(!1)},i=function(t){return Wr(t).bind((function(n){var i=o(n);return qe(n).map((function(o){return!0===i||r(o)||e(n)||Ff(o)&&!He(t,o)?[]:[Vt.fromTag("br")]}))})).getOr([])},u=function(){var e=q(t,(function(t){var e=Ye(t);return n(e)?[]:e.concat(i(t))}));return 0===e.length?[Vt.fromTag("br")]:e},a=u();_n(t[0]),En(t[0],a)},Wf=function(t){var e=gr(t);0===e.length&&An(t)},qf=function(t,e){return{grid:i(t),cursor:i(e)}},$f=function(t,e,n){return Gf(t,e,n).orThunk((function(){return Gf(t,0,0)}))},Gf=function(t,e,n){return p.from(t[e]).bind((function(t){return p.from(t.cells()[n]).bind((function(t){return p.from(t.element())}))}))},Kf=function(t,e,n){return qf(t,Gf(t,e,n))},Xf=function(t){return F(t,(function(t,e){return M(t,(function(t){return t.row()===e.row()}))?t:t.concat([e])}),[]).sort((function(t,e){return t.row()-e.row()}))},Yf=function(t){return F(t,(function(t,e){return M(t,(function(t){return t.column()===e.column()}))?t:t.concat([e])}),[]).sort((function(t,e){return t.column()-e.column()}))},Jf=function(t,e,n,r){var o=e[0].row(),i=e[0].row(),u=Xf(e),a=F(u,(function(t,e){return wf(t,i,o,n,r.getOrInit)}),t);return Kf(a,i,e[0].column())},Qf=function(t,e,n,r){var o=Xf(e),i=o[o.length-1].row(),u=o[o.length-1].row()+o[o.length-1].rowspan(),a=F(o,(function(t,e){return wf(t,u,i,n,r.getOrInit)}),t);return Kf(a,u,e[0].column())},Zf=function(t,e,n,r){var o=Yf(e),i=o[0].column(),u=o[0].column(),a=F(o,(function(t,e){return xf(t,u,i,n,r.getOrInit)}),t);return Kf(a,e[0].row(),u)},td=function(t,e,n,r){var o=e[e.length-1].column(),i=e[e.length-1].column()+e[e.length-1].colspan(),u=Yf(e),a=F(u,(function(t,e){return xf(t,i,o,n,r.getOrInit)}),t);return Kf(a,e[0].row(),i)},ed=function(t,e,n,r){var o=_f(t,e.row(),n,r.replaceOrInit);return Kf(o,e.row(),e.column())},nd=function(t,e,n,r){var o=Ef(t,e.column(),n,r.replaceOrInit);return Kf(o,e.row(),e.column())},rd=function(t,e,n,r){var o=_f(t,e.row(),n,r.replaceOrInit);return Kf(o,e.row(),e.column())},od=function(t,e,n,r){var o=Ef(t,e.column(),n,r.replaceOrInit);return Kf(o,e.row(),e.column())},id=function(t,e,n,r){var o=Yf(e),i=Cf(t,o[0].column(),o[o.length-1].column()),u=$f(i,e[0].row(),e[0].column());return qf(i,u)},ud=function(t,e,n,r){var o=Xf(e),i=Sf(t,o[0].row(),o[o.length-1].row()),u=$f(i,e[0].row(),e[0].column());return qf(i,u)},ad=function(t,e,n,r){var o=e.cells();jf(o);var u=Ql(t,e.bounds(),n,i(o[0]));return qf(u,p.from(o[0]))},cd=function(t,e,n,r){var o=L(e,(function(t,e){return Zl(t,e,n,r.combine(e))}),t);return qf(o,p.from(e[0]))},sd=function(t,e,n,r){var o=function(t,e){var n=Tr.fromTable(t);return Fl(n,e,!0)},i=o(e.clipboard(),e.generators()),u=Rn(e.row(),e.column()),a=vf(u,t,i,e.generators(),n);return a.fold((function(){return qf(t,p.some(e.element()))}),(function(t){var n=$f(t,e.row(),e.column());return qf(t,n)}))},ld=function(t,e,n){var r=br(t,n),o=Tr.generate(r);return Fl(o,e,!0)},fd=function(t,e,n,r){var o=t[e.cells[0].row()],i=e.cells[0].column(),u=ld(e.clipboard(),e.generators(),o),a=bf(i,t,u,e.generators(),n),c=$f(a,e.cells[0].row(),e.cells[0].column());return qf(a,c)},dd=function(t,e,n,r){var o=t[e.cells[0].row()],i=e.cells[e.cells.length-1].column()+e.cells[e.cells.length-1].colspan(),u=ld(e.clipboard(),e.generators(),o),a=bf(i,t,u,e.generators(),n),c=$f(a,e.cells[0].row(),e.cells[0].column());return qf(a,c)},md=function(t,e,n,r){var o=t[e.cells[0].row()],i=e.cells[0].row(),u=ld(e.clipboard(),e.generators(),o),a=yf(i,t,u,e.generators(),n),c=$f(a,e.cells[0].row(),e.cells[0].column());return qf(a,c)},gd=function(t,e,n,r){var o=t[e.cells[0].row()],i=e.cells[e.cells.length-1].row()+e.cells[e.cells.length-1].rowspan(),u=ld(e.clipboard(),e.generators(),o),a=yf(i,t,u,e.generators(),n),c=$f(a,e.cells[0].row(),e.cells[0].column());return qf(a,c)},hd=function(t,e){var n=Tr.fromTable(t),r=Jl(n,e);return r.bind((function(t){var e=t[t.length-1],r=t[0].column(),o=e.column()+e.colspan(),i=W(B(n.all,(function(t){return I(t.cells(),(function(t){return t.column()>=r&&t.column()<o}))})));return pd(i,(function(t){return"th"===dt(t.element())}))})).getOr("")},pd=function(t,e){var n=I(t,e);return 0===n.length?p.some("td"):n.length===t.length?p.some("th"):p.none()},vd=za,bd=ql(Jf,Jl,n,n,zf.modification),yd=ql(Qf,Jl,n,n,zf.modification),wd=ql(Zf,Jl,vd,n,zf.modification),xd=ql(td,Jl,vd,n,zf.modification),Cd=ql(id,Jl,vd,Wf,zf.modification),Sd=ql(ud,Jl,n,Wf,zf.modification),kd=ql(nd,$l,n,n,zf.transform("row","th")),Od=ql(od,$l,n,n,zf.transform(null,"td")),Td=(ql(ed,$l,n,n,zf.transform("col","th")),ql(rd,$l,n,n,zf.transform(null,"td")),ql(ad,Xl,n,n,zf.merging)),Ed=ql(cd,Yl,vd,n,zf.merging),_d=ql(sd,Gl,vd,n,zf.modification),Ad=ql(fd,Kl,n,n,zf.modification),Dd=ql(dd,Kl,n,n,zf.modification),Nd=ql(md,Kl,n,n,zf.modification),Rd=ql(gd,Kl,n,n,zf.modification),Md=hd,zd=function(t){return zs(t.parentNode)},Bd=function(t){return"thead"===t?"header":"tfoot"===t?"footer":"body"},Pd=function(t,e){var n="thead"===zd(e),r=!M(e.cells,(function(t){return"th"!==zs(t)}));return n||r?p.some({thead:n,ths:r}):p.none()},Hd=function(t,e){return Bd(Pd(t,e).fold((function(){return zd(e)}),(function(t){return"thead"})))},Id=function(t,e,n){var r=t.getParent(e,"table"),o=e.parentNode,i=zs(o);if(n!==i){var u=t.select(n,r)[0];if(!u){u=t.create(n);var a=r.firstChild;"thead"===n?X($n(Vt.fromDom(r),"caption,colgroup")).fold((function(){return r.insertBefore(u,a)}),(function(e){return t.insertAfter(u,e.dom())})):r.appendChild(u)}"tbody"===n&&"thead"===i&&u.firstChild?u.insertBefore(e,u.firstChild):u.appendChild(e),o.hasChildNodes()||t.remove(o)}},Ld=function(t,e,n,r){return P(e,(function(e){var o=zs(e)!==n?t.rename(e,n):e;t.setAttrib(o,"scope",r)}))},Fd=function(t,e,n){var r=function(){var n=hr(Vt.fromDom(e.cells[0])).map((function(t){return pr(t)})).getOr([]);return Y(n,(function(e){return Pd(t,e.dom())})).map((function(t){return t.thead&&t.ths?"sectionCells":t.thead?"section":"cells"})).getOr("section")},o=t.dom;if("header"===n){var i=Ns(t),u="auto"===i?r():i;Ld(o,e.cells,"section"===u?"td":"th","col"),Id(o,e,"cells"===u?"tbody":"thead")}else Ld(o,e.cells,"td",null),Id(o,e,"footer"===n?"tfoot":"tbody")},Vd=function(t){var e=function(){var e=Bs(t);return Vo(e,Jo).fold((function(){return void 0===t.selection.getStart()?ci():li(t.selection)}),(function(t){return si(t)}))};return{get:e}},Ud=function(t){return function(e){return p.from(e.dom.getParent(e.selection.getStart(),t)).map((function(t){return Vt.fromDom(t)}))}},jd=Ud("th,td"),Wd=Ud("th,td,caption"),qd=function(t){return jd(t).map((function(e){return fi(e,Vd(t))})).map((function(t){return B(t,(function(t){return t.dom()}))})).getOr([])},$d=function(t){var e=jd(t),n=e.bind((function(t){return hr(t)})).map((function(t){return pr(t)})).map((function(t){return B(t,(function(t){return t.dom()}))}));return kl(e,n,(function(e,n){return I(n,(function(n){return M(n.cells,(function(n){return"1"===t.dom.getAttrib(n,Yo)||n===e.dom()}))}))})).getOr([])},Gd=function(t,e){var r=function(t){return"table"===dt(Bs(t))},o=function(e){return!1===r(t)||Cl(e).rows()>1},i=function(e){return!1===r(t)||Cl(e).columns()>1},u=Rs(t),a=function(e,n,r,o){return function(i,a){Vs(i);var c=o(),s=Vt.fromDom(t.getDoc()),l=ya(Gs),f=no(r,s,u),d=el(t,i);return n(i)?e(c,i,a,f,l,d).bind((function(e){return P(e.newRows(),(function(e){ns(t,e.dom())})),P(e.newCells(),(function(e){rs(t,e.dom())})),e.cursor().map((function(e){var n=wl(e),r=t.dom.createRng();return r.setStart(n.element().dom(),n.offset()),r.setEnd(n.element().dom(),n.offset()),r}))})):p.none()}},c=a(Sd,o,n,e),s=a(Cd,i,n,e),l=a(bd,f,n,e),d=a(yd,f,n,e),m=a(wd,f,xl,e),g=a(xd,f,xl,e),h=a(Td,f,n,e),v=a(Ed,f,n,e),b=a(Ad,f,n,e),y=a(Dd,f,n,e),w=a(Nd,f,n,e),x=a(Rd,f,n,e),C=a(_d,f,n,e),S=function(t,e){return it(t,"type").filter((function(t){return R(e,t)}))},k=function(t,e){return S(e,["td","th"]).each((function(e){Ld(t.dom,qd(t),e,null)}))},O=function(t,e){return S(e,["header","body","footer"]).each((function(e){B($d(t),(function(n){return Fd(t,n,e)}))}))},T=a(kd,f,n,e),E=a(Od,f,n,e),_=function(t){var e=$d(t);if(e.length>0){var n=B(e,(function(e){return Hd(t,e)})),r=R(n,"header"),o=R(n,"footer");if(r||o){var i=R(n,"body");return!r||i||o?r||i||!o?"":"footer":"header"}return"body"}},A=function(t){return pd(qd(t),(function(t){return"th"===zs(t)})).getOr("")},D=Md;return{deleteRow:c,deleteColumn:s,insertRowsBefore:l,insertRowsAfter:d,insertColumnsBefore:m,insertColumnsAfter:g,mergeCells:h,unmergeCells:v,pasteColsBefore:b,pasteColsAfter:y,pasteRowsBefore:w,pasteRowsAfter:x,pasteCells:C,setTableCellType:k,setTableRowType:O,makeColumnHeader:T,unmakeColumnHeader:E,getTableRowType:_,getTableCellType:A,getTableColType:D}},Kd={styles:{"border-collapse":"collapse",width:"100%"},attributes:{border:"1"}},Xd=function(){return Vt.fromTag("th")},Yd=function(){return Vt.fromTag("td")},Jd=function(t,e,n,r){for(var o=Vt.fromTag("tr"),i=0;i<t;i++){var u=r<e||i<n?Xd():Yd();i<n&&xt(u,"scope","row"),r<e&&xt(u,"scope","col"),Sn(u,Vt.fromTag("br")),Sn(o,u)}return o},Qd=function(t,e,n,r){return z(t,(function(t){return Jd(e,n,r,t)}))},Zd=function(t,e,n,r,o,i){void 0===i&&(i=Kd);var u=Vt.fromTag("table"),a="cells"!==o;gn(u,i.styles),Ct(u,i.attributes);var c=Math.min(t,n);if(a&&n>0){var s=Vt.fromTag("thead");Sn(u,s);var l="sectionCells"===o?c:0,f=Qd(n,e,l,r);En(s,f)}var d=Vt.fromTag("tbody");Sn(u,d);var m=a?t-c:t,g=a?0:n,h=Qd(m,e,g,r);return En(d,h),u},tm=function(t){return t.dom().innerHTML},em=function(t){var e=Vt.fromTag("div"),n=Vt.fromDom(t.dom().cloneNode(!0));return Sn(e,n),tm(e)},nm=function(t,e){t.selection.select(e.dom(),!0),t.selection.collapse(!0)},rm=function(t,e){er(e,"td,th").each(a(nm,t))},om=function(t,e){P(Gn(e,"tr"),(function(e){ns(t,e.dom()),P(Gn(e,"th,td"),(function(e){rs(t,e.dom())}))}))},im=function(t){return w(t)&&-1!==t.indexOf("%")},um=function(t,e,n,r,o){var i=hs(t),u={styles:i,attributes:gs(t)},a=Zd(n,e,o,r,Ns(t),u);xt(a,"data-mce-id","__mce");var c=em(a);return t.insertContent(c),er(Bs(t),'table[data-mce-id="__mce"]').map((function(e){return _s(t)?al(t,e):As(t)?cl(e):(Es(t)||im(i.width))&&ul(t,e),Vs(e),Tt(e,"data-mce-id"),om(t,e),rm(t,e),e.dom()})).getOr(null)},am=function(t,e,n,r,o){void 0===r&&(r={});var i=function(t){return E(t)&&t>0};if(i(e)&&i(n)){var u=r.headerRows||0,a=r.headerColumns||0;return um(t,n,e,a,u)}return null},cm=function(t){return function(){return t().fold((function(){return[]}),(function(t){return B(t,(function(t){return t.dom()}))}))}},sm=function(t){return function(e){var n=e.length>0?p.some(io(e)):p.none();t(n)}},lm=function(t,e,n,r){return{insertTable:function(e,n,r){return void 0===r&&(r={}),am(t,n,e,r,"Invalid values for insertTable - rows and columns values are required to insert a table.")},setClipboardRows:sm(e.setRows),getClipboardRows:cm(e.getRows),setClipboardCols:sm(e.setColumns),getClipboardCols:cm(e.getColumns),resizeHandler:n,selectionTargets:r}},fm=function(t,e,n){var r=or(t,e);1===n||r<=1?Tt(t,e):xt(t,e,Math.min(n,r))},dm=function(t,e){var n=Tr.fromTable(t),r=Jl(n,e);return r.map((function(t){var e=t[t.length-1],r=t[0].column(),o=e.column()+e.colspan();return B(n.all,(function(t){var e=I(t.cells(),(function(t){return t.column()>=r&&t.column()<o})),n=B(e,(function(t){var e=Kr(t.element());return fm(e,"colspan",o-r),e})),i=Vt.fromTag("tr");return En(i,n),i}))}))},mm=function(t,e,n){var r=Tr.fromTable(t),o=Jl(r,e);return o.map((function(t){var e=Fl(r,n,!1),o=e.slice(t[0].row(),t[t.length-1].row()+t[t.length-1].rowspan()),i=jl(o,n);return El(i)}))},gm=tinymce.util.Tools.resolve("tinymce.util.Tools"),hm=function(t,e,n){var r,o=t.select("td,th",e),i=function(e,r){for(var o=0;o<r.length;o++){var i=t.getStyle(r[o],n);if("undefined"===typeof e&&(e=i),e!==i)return""}return e};return i(r,o)},pm=function(t,e,n){n&&t.formatter.apply("align"+n,{},e)},vm=function(t,e,n){n&&t.formatter.apply("valign"+n,{},e)},bm=function(t,e){gm.each("left center right".split(" "),(function(n){t.formatter.remove("align"+n,{},e)}))},ym=function(t,e){gm.each("top middle bottom".split(" "),(function(n){t.formatter.remove("valign"+n,{},e)}))},wm=function(t,e){var n=function(t,e){return e.concat(B(t,(function(t){return{text:t.text||t.title,value:t.value}})))};return n(t,e||[])},xm=function(t){return function(e){return Dt(e,"rgb")?t.toHex(e):e}},Cm=function(t,e){var n=Vt.fromDom(e);return{borderwidth:vn(n,"border-width").getOr(""),borderstyle:vn(n,"border-style").getOr(""),bordercolor:vn(n,"border-color").map(xm(t)).getOr(""),backgroundcolor:vn(n,"background-color").map(xm(t)).getOr("")}},Sm=function(t){var e=t[0],n=t.slice(1);return P(n,(function(t){P(J(e),(function(n){Z(t,(function(t,r){var o=e[n];""!==o&&n===r&&o!==t&&(e[n]="")}))}))})),e},km=function(t){var e=[{name:"borderstyle",type:"selectbox",label:"Border style",items:[{text:"Select...",value:""},{text:"Solid",value:"solid"},{text:"Dotted",value:"dotted"},{text:"Dashed",value:"dashed"},{text:"Double",value:"double"},{text:"Groove",value:"groove"},{text:"Ridge",value:"ridge"},{text:"Inset",value:"inset"},{text:"Outset",value:"outset"},{text:"None",value:"none"},{text:"Hidden",value:"hidden"}]},{name:"bordercolor",type:"colorinput",label:"Border color"},{name:"backgroundcolor",type:"colorinput",label:"Background color"}],n={name:"borderwidth",type:"input",label:"Border width"},r="cell"===t?[n].concat(e):e;return{title:"Advanced",name:"advanced",items:r}},Om=function(t,e,n,r){return U(t,(function(t){return n.formatter.matchNode(r,e+t)})).getOr("")},Tm=a(Om,["left","center","right"],"align"),Em=a(Om,["top","middle","bottom"],"valign"),_m=function(t,e){var n=hs(t),r=gs(t),o=function(t){return{borderstyle:it(n,"border-style").getOr(""),bordercolor:xm(t)(it(n,"border-color").getOr("")),backgroundcolor:xm(t)(it(n,"background-color").getOr(""))}},i={height:"",width:"100%",cellspacing:"",cellpadding:"",caption:!1,class:"",align:"",border:""},u=function(){var e=n["border-width"];return Ss(t)&&e?{border:e}:it(r,"border").fold((function(){return{}}),(function(t){return{border:t}}))},a=e?o(t.dom):{},c=function(){var t=it(n,"border-spacing").or(it(r,"cellspacing")).fold((function(){return{}}),(function(t){return{cellspacing:t}})),e=it(n,"border-padding").or(it(r,"cellpadding")).fold((function(){return{}}),(function(t){return{cellpadding:t}}));return Wt(Wt({},t),e)},s=Wt(Wt(Wt(Wt(Wt(Wt({},i),n),r),a),u()),c());return s},Am=function(t,e,n){var r=function(e,n){var r=vn(Vt.fromDom(n),"border-width");return Ss(t)&&r.isSome()?r.getOr(""):e.getAttrib(n,"border")||hm(t.dom,n,"border-width")||hm(t.dom,n,"border")},o=t.dom;return Wt({width:o.getStyle(e,"width")||o.getAttrib(e,"width"),height:o.getStyle(e,"height")||o.getAttrib(e,"height"),cellspacing:o.getStyle(e,"border-spacing")||o.getAttrib(e,"cellspacing"),cellpadding:o.getAttrib(e,"cellpadding")||hm(t.dom,e,"padding"),border:r(o,e),caption:!!o.select("caption",e)[0],class:o.getAttrib(e,"class",""),align:Tm(t,e)},n?Cm(o,e):{})},Dm=function(t,e,n){var r=t.dom;return Wt({height:r.getStyle(e,"height")||r.getAttrib(e,"height"),scope:r.getAttrib(e,"scope"),class:r.getAttrib(e,"class",""),type:Hd(t,e),align:Tm(t,e)},n?Cm(r,e):{})},Nm=function(t,e,n){var r=t.dom;return Wt({width:r.getStyle(e,"width")||r.getAttrib(e,"width"),height:r.getStyle(e,"height")||r.getAttrib(e,"height"),scope:r.getAttrib(e,"scope"),celltype:zs(e),class:r.getAttrib(e,"class",""),halign:Tm(t,e),valign:Em(t,e)},n?Cm(r,e):{})},Rm=function(t){var e=wm(ks(t));return e.length>0?p.some({name:"class",type:"selectbox",label:"Class",items:e}):p.none()},Mm=[{name:"width",type:"input",label:"Width"},{name:"height",type:"input",label:"Height"},{name:"celltype",type:"selectbox",label:"Cell type",items:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{name:"scope",type:"selectbox",label:"Scope",items:[{text:"None",value:""},{text:"Row",value:"row"},{text:"Column",value:"col"},{text:"Row group",value:"rowgroup"},{text:"Column group",value:"colgroup"}]},{name:"halign",type:"selectbox",label:"H Align",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{name:"valign",type:"selectbox",label:"V Align",items:[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}]}],zm=function(t){return Rm(t).fold((function(){return Mm}),(function(t){return Mm.concat(t)}))},Bm=function(t){return function(e,n){var r=e.dom,o=function(e,o){t&&!o||r.setAttrib(n,e,o)},i=function(e,o){t&&!o||r.setStyle(n,e,o)},u=function(r,o){t&&!o||(""===o?e.formatter.remove(r,{value:null},n,!0):e.formatter.apply(r,{value:o},n))};return{setAttrib:o,setStyle:i,setFormat:u}}},Pm={normal:Bm(!1),ifTruthy:Bm(!0)},Hm=function(t,e){t.setAttrib("scope",e.scope),t.setAttrib("class",e.class),t.setStyle("width",Fs(e.width)),t.setStyle("height",Fs(e.height))},Im=function(t,e){t.setFormat("tablecellbackgroundcolor",e.backgroundcolor),t.setFormat("tablecellbordercolor",e.bordercolor),t.setFormat("tablecellborderstyle",e.borderstyle),t.setFormat("tablecellborderwidth",Fs(e.borderwidth))},Lm=function(t,e,n){var r=t.dom,o=1===e.length;P(e,(function(e){var i=n.celltype&&zs(e)!==n.celltype?r.rename(e,n.celltype):e,u=o?Pm.normal(t,i):Pm.ifTruthy(t,i);Hm(u,n),bs(t)&&Im(u,n),o&&(bm(t,i),ym(t,i)),n.halign&&pm(t,i,n.halign),n.valign&&vm(t,i,n.valign)}))},Fm=function(t,e,n){var r=n.getData();n.close(),t.undoManager.transact((function(){Lm(t,e,r),t.focus()}))},Vm=function(t){var e=qd(t);if(0!==e.length){var n=B(e,(function(e){return Nm(t,e,bs(t))})),r=Sm(n),o={type:"tabpanel",tabs:[{title:"General",name:"general",items:zm(t)},km("cell")]},i={type:"panel",items:[{type:"grid",columns:2,items:zm(t)}]};t.windowManager.open({title:"Cell Properties",size:"normal",body:bs(t)?o:i,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:r,onSubmit:a(Fm,t,e)})}},Um=function(t){var e=wm(Os(t));return e.length>0?p.some({name:"class",type:"selectbox",label:"Class",items:e}):p.none()},jm=[{type:"selectbox",name:"type",label:"Row type",items:[{text:"Header",value:"header"},{text:"Body",value:"body"},{text:"Footer",value:"footer"}]},{type:"selectbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height",type:"input"}],Wm=function(t){return Um(t).fold((function(){return jm}),(function(t){return jm.concat(t)}))},qm=function(t,e){t.setAttrib("scope",e.scope),t.setAttrib("class",e.class),t.setStyle("height",Fs(e.height))},$m=function(t,e){t.setStyle("background-color",e.backgroundcolor),t.setStyle("border-color",e.bordercolor),t.setStyle("border-style",e.borderstyle)},Gm=function(t,e,n,r){var o=1===e.length;P(e,(function(e){r.type!==zs(e.parentNode)&&Fd(t,e,r.type);var i=o?Pm.normal(t,e):Pm.ifTruthy(t,e);qm(i,r),ys(t)&&$m(i,r),r.align!==n.align&&(bm(t,e),pm(t,e,r.align))}))},Km=function(t,e,n,r){var o=r.getData();r.close(),t.undoManager.transact((function(){Gm(t,e,n,o),t.focus()}))},Xm=function(t){var e=$d(t);if(0!==e.length){var n=B(e,(function(e){return Dm(t,e,ys(t))})),r=Sm(n),o={type:"tabpanel",tabs:[{title:"General",name:"general",items:Wm(t)},km("row")]},i={type:"panel",items:[{type:"grid",columns:2,items:Wm(t)}]};t.windowManager.open({title:"Row Properties",size:"normal",body:ys(t)?o:i,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:r,onSubmit:a(Km,t,e,r)})}},Ym=tinymce.util.Tools.resolve("tinymce.Env"),Jm=function(t,e,n){var r=n?[{type:"input",name:"cols",label:"Cols",inputMode:"numeric"},{type:"input",name:"rows",label:"Rows",inputMode:"numeric"}]:[],o=[{type:"input",name:"width",label:"Width"},{type:"input",name:"height",label:"Height"}],i=xs(t)?[{type:"input",name:"cellspacing",label:"Cell spacing",inputMode:"numeric"},{type:"input",name:"cellpadding",label:"Cell padding",inputMode:"numeric"},{type:"input",name:"border",label:"Border width"},{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[],u=[{type:"selectbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]}],a=e.length>0?[{type:"selectbox",name:"class",label:"Class",items:e}]:[];return r.concat(o).concat(i).concat(u).concat(a)},Qm=function(t,e,n,r){if("TD"===e.tagName||"TH"===e.tagName)w(n)?t.setStyle(e,n,r):t.setStyle(e,n);else if(e.children)for(var o=0;o<e.children.length;o++)Qm(t,e.children[o],n,r)},Zm=function(t,e,n){var r=t.dom,o={},i={};if(o.class=n.class,i.height=Fs(n.height),r.getAttrib(e,"width")&&!Ss(t)?o.width=Ls(n.width):i.width=Fs(n.width),Ss(t)?(i["border-width"]=Fs(n.border),i["border-spacing"]=Fs(n.cellspacing)):(o.border=n.border,o.cellpadding=n.cellpadding,o.cellspacing=n.cellspacing),Ss(t)&&e.children)for(var u=0;u<e.children.length;u++)Qm(r,e.children[u],{"border-width":Fs(n.border),padding:Fs(n.cellpadding)}),ws(t)&&Qm(r,e.children[u],{"border-color":n.bordercolor});ws(t)&&(i["background-color"]=n.backgroundcolor,i["border-color"]=n.bordercolor,i["border-style"]=n.borderstyle),o.style=r.serializeStyle(Wt(Wt({},hs(t)),i)),r.setAttribs(e,Wt(Wt({},gs(t)),o))},tg=function(t,e,n){var r,o=t.dom,i=n.getData();n.close(),""===i.class&&delete i.class,t.undoManager.transact((function(){if(!e){var n=parseInt(i.cols,10)||1,u=parseInt(i.rows,10)||1;e=um(t,n,u,0,0)}Zm(t,e,i),r=o.select("caption",e)[0],r&&!i.caption&&o.remove(r),!r&&i.caption&&(r=o.create("caption"),r.innerHTML=Ym.ie?Mr:'<br data-mce-bogus="1"/>',e.insertBefore(r,e.firstChild)),""===i.align?bm(t,e):pm(t,e,i.align),t.focus(),t.addVisual()}))},eg=function(t,e){var n,r=t.dom,o=_m(t,ws(t));!1===e?(n=r.getParent(t.selection.getStart(),"table"),n?o=Am(t,n,ws(t)):ws(t)&&(o.borderstyle="",o.bordercolor="",o.backgroundcolor="")):(o.cols="1",o.rows="1",ws(t)&&(o.borderstyle="",o.bordercolor="",o.backgroundcolor=""));var i=wm(Ts(t));i.length>0&&o.class&&(o.class=o.class.replace(/\s*mce\-item\-table\s*/g,""));var u={type:"grid",columns:2,items:Jm(t,i,e)},c=function(){return{type:"panel",items:[u]}},s=function(){return{type:"tabpanel",tabs:[{title:"General",name:"general",items:[u]},km("table")]}},l=ws(t)?s():c();t.windowManager.open({title:"Table Properties",size:"normal",body:l,onSubmit:a(tg,t,n),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:o})},ng=function(t,e,r,o,i){var u=Is(t),s=function(){return Wd(t).each((function(e){hr(e,u).filter(c(u)).each((function(e){var n=Vt.fromText("");if(xn(e,n),An(e),t.dom.isEmpty(t.getBody()))t.setContent(""),t.selection.setCursorLocation();else{var r=t.dom.createRng();r.setStart(n.dom(),0),r.setEnd(n.dom(),0),t.selection.setRng(r),t.nodeChanged()}}))}))},l=function(e){return Wd(t).each((function(n){var r=As(t)||_s(t)||Es(t);r||hr(n,u).each((function(n){"relative"!==e||ga(n)?"fixed"!==e||ha(n)?"responsive"!==e||pa(n)||cl(n):al(t,n):ul(t,n),Vs(n)}))}))},f=function(t){return hr(t,u)},d=function(e){return jd(t).each((function(n){f(n).each((function(i){var u=hi(o,i,n);e(i,u).each((function(e){t.selection.setRng(e),t.focus(),r.clear(i),Vs(i)}))}))}))},m=function(){return jd(t).map((function(e){return f(e).bind((function(r){var i=hi(o,r,e),u=no(n,Vt.fromDom(t.getDoc()),p.none());return mm(r,i,u)}))}))},g=function(){return jd(t).map((function(t){return f(t).bind((function(e){var n=hi(o,e,t);return dm(e,n)}))}))},h=function(e,n){return n().each((function(n){var i=B(n,(function(t){return Kr(t)}));jd(t).each((function(n){return f(n).each((function(u){var a=ro(Vt.fromDom(t.getDoc())),c=vi(o,n,i,a);e(u,c).each((function(e){t.selection.setRng(e),t.focus(),r.clear(u)}))}))}))}))};Z({mceTableSplitCells:function(){return d(e.unmergeCells)},mceTableMergeCells:function(){return d(e.mergeCells)},mceTableInsertRowBefore:function(){return d(e.insertRowsBefore)},mceTableInsertRowAfter:function(){return d(e.insertRowsAfter)},mceTableInsertColBefore:function(){return d(e.insertColumnsBefore)},mceTableInsertColAfter:function(){return d(e.insertColumnsAfter)},mceTableDeleteCol:function(){return d(e.deleteColumn)},mceTableDeleteRow:function(){return d(e.deleteRow)},mceTableCutCol:function(t){return g().each((function(t){i.setColumns(t),d(e.deleteColumn)}))},mceTableCutRow:function(t){return m().each((function(t){i.setRows(t),d(e.deleteRow)}))},mceTableCopyCol:function(t){return g().each((function(t){return i.setColumns(t)}))},mceTableCopyRow:function(t){return m().each((function(t){return i.setRows(t)}))},mceTablePasteColBefore:function(t){return h(e.pasteColsBefore,i.getColumns)},mceTablePasteColAfter:function(t){return h(e.pasteColsAfter,i.getColumns)},mceTablePasteRowBefore:function(t){return h(e.pasteRowsBefore,i.getRows)},mceTablePasteRowAfter:function(t){return h(e.pasteRowsAfter,i.getRows)},mceTableDelete:s,mceTableSizingMode:function(t,e){return l(e)}},(function(e,n){return t.addCommand(n,e)})),Z({mceTableCellType:function(n,r){return e.setTableCellType(t,r)},mceTableRowType:function(n,r){return e.setTableRowType(t,r)}},(function(e,n){return t.addCommand(n,e)})),t.addCommand("mceTableColType",(function(t,n){return it(n,"type").each((function(t){return d("th"===t?e.makeColumnHeader:e.unmakeColumnHeader)}))})),Z({mceTableProps:a(eg,t,!1),mceTableRowProps:a(Xm,t),mceTableCellProps:a(Vm,t)},(function(e,n){return t.addCommand(n,(function(){return e()}))})),t.addCommand("mceInsertTable",(function(e,n){x(n)&&J(n).length>0?am(t,n.rows,n.columns,n.options,"Invalid values for mceInsertTable - rows and columns values are required to insert a table."):eg(t,!0)})),t.addCommand("mceTableApplyCellStyle",(function(e,n){if(x(n)){var r=qd(t);0!==r.length&&Z(n,(function(e,n){var o="tablecell"+n.toLowerCase().replace("-","");t.formatter.has(o)&&w(e)&&P(r,(function(n){Pm.normal(t,n).setFormat(o,e)}))}))}}))},rg=function(t,e,n){var r=Is(t),o=function(t){return hr(t,r)};Z({mceTableRowType:function(){return e.getTableRowType(t)},mceTableCellType:function(){return e.getTableCellType(t)},mceTableColType:function(){return jd(t).bind((function(t){return o(t).map((function(r){var o=hi(n,r,t);return e.getTableColType(r,o)}))})).getOr("")}},(function(e,n){return t.addQueryValueHandler(n,e)}))},og=function(){var t=Ks(p.none()),e=Ks(p.none()),n=function(t){t.set(p.none())};return{getRows:t.get,setRows:function(r){t.set(r),n(e)},clearRows:function(){return n(t)},getColumns:e.get,setColumns:function(r){e.set(r),n(t)},clearColumns:function(){return n(e)}}},ig=ii.generate([{none:["current"]},{first:["current"]},{middle:["current","target"]},{last:["current"]}]),ug=function(t){return void 0===t&&(t=void 0),ig.none(t)},ag=Wt(Wt({},ig),{none:ug}),cg=function(t,e){return hr(t,e).bind((function(e){var n=gr(e),r=j(n,(function(e){return He(t,e)}));return r.map((function(t){return{index:t,all:n}}))}))},sg=function(t,e){var n=cg(t,e);return n.fold((function(){return ag.none(t)}),(function(e){return e.index+1<e.all.length?ag.middle(t,e.all[e.index+1]):ag.last(t)}))},lg=function(t,e){var n=cg(t,e);return n.fold((function(){return ag.none()}),(function(e){return e.index-1>=0?ag.middle(t,e.all[e.index-1]):ag.first(t)}))},fg=function(t,e,n,r){return{start:i(t),soffset:i(e),finish:i(n),foffset:i(r)}},dg={create:fg},mg=ii.generate([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),gg=function(t,e,n,r){return t.fold(e,n,r)},hg=function(t){return t.fold(u,u,u)},pg=mg.before,vg=mg.on,bg=mg.after,yg={before:pg,on:vg,after:bg,cata:gg,getStart:hg},wg=ii.generate([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),xg=function(t){return wg.exact(t.start(),t.soffset(),t.finish(),t.foffset())},Cg=function(t){return t.match({domRange:function(t){return Vt.fromDom(t.startContainer)},relative:function(t,e){return yg.getStart(t)},exact:function(t,e,n,r){return t}})},Sg=wg.domRange,kg=wg.relative,Og=wg.exact,Tg=function(t){var e=Cg(t);return We(e)},Eg=dg.create,_g={domRange:Sg,relative:kg,exact:Og,exactFromRange:xg,getWin:Tg,range:Eg},Ag=function(t,e){var n=t.document.createRange();return Dg(n,e),n},Dg=function(t,e){return t.selectNodeContents(e.dom())},Ng=function(t,e){e.fold((function(e){t.setStartBefore(e.dom())}),(function(e,n){t.setStart(e.dom(),n)}),(function(e){t.setStartAfter(e.dom())}))},Rg=function(t,e){e.fold((function(e){t.setEndBefore(e.dom())}),(function(e,n){t.setEnd(e.dom(),n)}),(function(e){t.setEndAfter(e.dom())}))},Mg=function(t,e,n){var r=t.document.createRange();return Ng(r,e),Rg(r,n),r},zg=function(t,e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom(),n),i.setEnd(r.dom(),o),i},Bg=function(t){return{left:i(t.left),top:i(t.top),right:i(t.right),bottom:i(t.bottom),width:i(t.width),height:i(t.height)}},Pg=function(t){var e=t.getClientRects(),n=e.length>0?e[0]:t.getBoundingClientRect();return n.width>0||n.height>0?p.some(n).map(Bg):p.none()},Hg=ii.generate([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Ig=function(t,e,n){return e(Vt.fromDom(n.startContainer),n.startOffset,Vt.fromDom(n.endContainer),n.endOffset)},Lg=function(t,e){return e.match({domRange:function(t){return{ltr:i(t),rtl:p.none}},relative:function(e,n){return{ltr:qt((function(){return Mg(t,e,n)})),rtl:qt((function(){return p.some(Mg(t,n,e))}))}},exact:function(e,n,r,o){return{ltr:qt((function(){return zg(t,e,n,r,o)})),rtl:qt((function(){return p.some(zg(t,r,o,e,n))}))}}})},Fg=function(t,e){var n=e.ltr();if(n.collapsed){var r=e.rtl().filter((function(t){return!1===t.collapsed}));return r.map((function(t){return Hg.rtl(Vt.fromDom(t.endContainer),t.endOffset,Vt.fromDom(t.startContainer),t.startOffset)})).getOrThunk((function(){return Ig(t,Hg.ltr,n)}))}return Ig(t,Hg.ltr,n)},Vg=function(t,e){var n=Lg(t,e);return Fg(t,n)},Ug=function(t,e){var n=Vg(t,e);return n.match({ltr:function(e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom(),n),i.setEnd(r.dom(),o),i},rtl:function(e,n,r,o){var i=t.document.createRange();return i.setStart(r.dom(),o),i.setEnd(e.dom(),n),i}})},jg=(Hg.ltr,Hg.rtl,function(t,e,n,r,o){if(0===o)return 0;if(e===r)return o-1;for(var i=r,u=1;u<o;u++){var a=t(u),c=Math.abs(e-a.left);if(n<=a.bottom){if(n<a.top||c>i)return u-1;i=c}}return 0}),Wg=function(t,e,n){return e>=t.left&&e<=t.right&&n>=t.top&&n<=t.bottom},qg=function(t,e,n,r,o){var i=function(n){var r=t.dom().createRange();return r.setStart(e.dom(),n),r.collapse(!0),r},u=function(t){var e=i(t);return e.getBoundingClientRect()},a=Pr(e).length,c=jg(u,n,r,o.right,a);return i(c)},$g=function(t,e,n,r){var o=t.dom().createRange();o.selectNode(e.dom());var i=o.getClientRects(),u=Y(i,(function(t){return Wg(t,n,r)?p.some(t):p.none()}));return u.map((function(o){return qg(t,e,n,r,o)}))},Gg=function(t,e,n,r){var o=t.dom().createRange(),i=Ye(e);return Y(i,(function(e){return o.selectNode(e.dom()),Wg(o.getBoundingClientRect(),n,r)?Kg(t,e,n,r):p.none()}))},Kg=function(t,e,n,r){return vt(e)?$g(t,e,n,r):Gg(t,e,n,r)},Xg=function(t,e,n,r){var o=t.dom().createRange();o.selectNode(e.dom());var i=o.getBoundingClientRect(),u=Math.max(i.left,Math.min(i.right,n)),a=Math.max(i.top,Math.min(i.bottom,r));return Kg(t,e,u,a)},Yg=!0,Jg=!1,Qg=function(t,e){return e-t.left<t.right-e?Yg:Jg},Zg=function(t,e,n){var r=t.dom().createRange();return r.selectNode(e.dom()),r.collapse(n),r},th=function(t,e,n){var r=t.dom().createRange();r.selectNode(e.dom());var o=r.getBoundingClientRect(),i=Qg(o,n),u=i===Yg?jr:Wr;return u(e).map((function(e){return Zg(t,e,i)}))},eh=function(t,e,n){var r=e.dom().getBoundingClientRect(),o=Qg(r,n);return p.some(Zg(t,e,o))},nh=function(t,e,n){var r=0===Ye(e).length?eh:th;return r(t,e,n)},rh=function(t,e,n){return p.from(t.dom().caretPositionFromPoint(e,n)).bind((function(e){if(null===e.offsetNode)return p.none();var n=t.dom().createRange();return n.setStart(e.offsetNode,e.offset),n.collapse(),p.some(n)}))},oh=function(t,e,n){return p.from(t.dom().caretRangeFromPoint(e,n))},ih=function(t,e,n,r){var o=t.dom().createRange();o.selectNode(e.dom());var i=o.getBoundingClientRect(),u=Math.max(i.left,Math.min(i.right,n)),a=Math.max(i.top,Math.min(i.bottom,r));return Xg(t,e,u,a)},uh=function(t,e,n){return Vt.fromPoint(t,e,n).bind((function(r){var o=function(){return nh(t,r,e)};return 0===Ye(r).length?o():ih(t,r,e,n).orThunk(o)}))},ah=document.caretPositionFromPoint?rh:document.caretRangeFromPoint?oh:uh,ch=function(t,e,n){var r=Vt.fromDom(t.document);return ah(r,e,n).map((function(t){return dg.create(Vt.fromDom(t.startContainer),t.startOffset,Vt.fromDom(t.endContainer),t.endOffset)}))},sh=function(t,e){var n=dt(t);return"input"===n?yg.after(t):R(["br","img"],n)?0===e?yg.before(t):yg.after(t):yg.on(t,e)},lh=function(t,e){var n=t.fold(yg.before,sh,yg.after),r=e.fold(yg.before,sh,yg.after);return _g.relative(n,r)},fh=function(t,e,n,r){var o=sh(t,e),i=sh(n,r);return _g.relative(o,i)},dh=function(t){return t.match({domRange:function(t){var e=Vt.fromDom(t.startContainer),n=Vt.fromDom(t.endContainer);return fh(e,t.startOffset,n,t.endOffset)},relative:lh,exact:fh})},mh=function(t,e,n,r){var o=Ue(t),i=o.dom().createRange();return i.setStart(t.dom(),e),i.setEnd(n.dom(),r),i},gh=function(t,e,n,r){var o=mh(t,e,n,r),i=He(t,n)&&e===r;return o.collapsed&&!i},hh=function(t,e){p.from(t.getSelection()).each((function(t){t.removeAllRanges(),t.addRange(e)}))},ph=function(t,e,n,r,o){var i=zg(t,e,n,r,o);hh(t,i)},vh=function(t,e,n,r,o,i){e.collapse(n.dom(),r),e.extend(o.dom(),i)},bh=function(t,e){return Vg(t,e).match({ltr:function(e,n,r,o){ph(t,e,n,r,o)},rtl:function(e,n,r,o){var i=t.getSelection();if(i.setBaseAndExtent)i.setBaseAndExtent(e.dom(),n,r.dom(),o);else if(i.extend)try{vh(t,i,e,n,r,o)}catch(u){ph(t,r,o,e,n)}else ph(t,r,o,e,n)}})},yh=function(t,e,n,r,o){var i=fh(e,n,r,o);bh(t,i)},wh=function(t,e,n){var r=lh(e,n);bh(t,r)},xh=function(t){var e=_g.getWin(t).dom(),n=function(t,n,r,o){return zg(e,t,n,r,o)},r=dh(t);return Vg(e,r).match({ltr:n,rtl:n})},Ch=function(t){if(t.rangeCount>0){var e=t.getRangeAt(0),n=t.getRangeAt(t.rangeCount-1);return p.some(dg.create(Vt.fromDom(e.startContainer),e.startOffset,Vt.fromDom(n.endContainer),n.endOffset))}return p.none()},Sh=function(t){var e=Vt.fromDom(t.anchorNode),n=Vt.fromDom(t.focusNode);return gh(e,t.anchorOffset,n,t.focusOffset)?p.some(dg.create(e,t.anchorOffset,n,t.focusOffset)):Ch(t)},kh=function(t,e){var n=Ag(t,e);hh(t,n)},Oh=function(t){return p.from(t.getSelection()).filter((function(t){return t.rangeCount>0})).bind(Sh)},Th=function(t){return Oh(t).map((function(t){return _g.exact(t.start(),t.soffset(),t.finish(),t.foffset())}))},Eh=function(t,e){var n=Ug(t,e);return Pg(n)},_h=function(t,e,n){return ch(t,e,n)},Ah=function(t){var e=t.getSelection();e.removeAllRanges()},Dh=tinymce.util.Tools.resolve("tinymce.util.VK"),Nh=function(t,e,n,r){return Bh(t,e,sg(n),r)},Rh=function(t,e,n,r){return Bh(t,e,lg(n),r)},Mh=function(t,e){var n=_g.exact(e,0,e,0);return xh(n)},zh=function(t,e){var n=Gn(e,"tr");return X(n).bind((function(e){return er(e,"td,th").map((function(e){return Mh(t,e)}))}))},Bh=function(t,e,n,r,o){return n.fold(p.none,p.none,(function(e,n){return jr(n).map((function(e){return Mh(t,e)}))}),(function(n){return hr(n,e).bind((function(e){var o=gi(n);return t.undoManager.transact((function(){r.insertRowsAfter(e,o)})),zh(t,e)}))}))},Ph=["table","li","dl"],Hh=function(t,e,n,r){if(t.keyCode===Dh.TAB){var o=Bs(e),i=function(t){var e=dt(t);return He(t,o)||R(Ph,e)},u=e.selection.getRng();if(u.collapsed){var a=Vt.fromDom(u.startContainer);mr(a,i).each((function(o){t.preventDefault();var u=t.shiftKey?Rh:Nh,a=u(e,i,o,n,r);a.each((function(t){e.selection.setRng(t)}))}))}}},Ih=function(t,e){return{selection:i(t),kill:i(e)}},Lh={create:Ih},Fh=function(t,e,n,r){return{start:i(yg.on(t,e)),finish:i(yg.on(n,r))}},Vh={create:Fh},Uh=function(t,e){var n=Ug(t,e);return dg.create(Vt.fromDom(n.startContainer),n.startOffset,Vt.fromDom(n.endContainer),n.endOffset)},jh=Vh.create,Wh=function(t,e,n,r,o,i,u){return He(n,o)&&r===i?p.none():nr(n,"td,th",e).bind((function(n){return nr(o,"td,th",e).bind((function(r){return qh(t,e,n,r,u)}))}))},qh=function(t,e,n,r,o){return He(n,r)?p.none():Bo(n,r,e).bind((function(e){var r=e.boxes.getOr([]);return r.length>0?(o(t,r,e.start,e.finish),p.some(Lh.create(p.some(jh(n,0,n,Lr(n))),!0))):p.none()}))},$h=function(t,e,n,r,o){var i=function(t){return o.clearBeforeUpdate(n),o.selectRange(n,t.boxes,t.start,t.finish),t.boxes};return Fo(r,t,e,o.firstSelectedSelector,o.lastSelectedSelector).map(i)},Gh=function(t,e){return{item:i(t),mode:i(e)}},Kh=function(t,e,n,r){return void 0===r&&(r=Xh),t.property().parent(e).map((function(t){return Gh(t,r)}))},Xh=function(t,e,n,r){return void 0===r&&(r=Yh),n.sibling(t,e).map((function(t){return Gh(t,r)}))},Yh=function(t,e,n,r){void 0===r&&(r=Yh);var o=t.property().children(e),i=n.first(o);return i.map((function(t){return Gh(t,r)}))},Jh=[{current:Kh,next:Xh,fallback:p.none()},{current:Xh,next:Yh,fallback:p.some(Kh)},{current:Yh,next:Yh,fallback:p.some(Xh)}],Qh=function(t,e,n,r,o){void 0===o&&(o=Jh);var i=U(o,(function(t){return t.current===n}));return i.bind((function(n){return n.current(t,e,r,n.next).orThunk((function(){return n.fallback.bind((function(n){return Qh(t,e,n,r)}))}))}))},Zh=function(){var t=function(t,e){return t.query().prevSibling(e)},e=function(t){return t.length>0?p.some(t[t.length-1]):p.none()};return{sibling:t,first:e}},tp=function(){var t=function(t,e){return t.query().nextSibling(e)},e=function(t){return t.length>0?p.some(t[0]):p.none()};return{sibling:t,first:e}},ep={left:Zh,right:tp},np=function(t,e,n,r,o,i){var u=Qh(t,e,r,o);return u.bind((function(e){return i(e.item())?p.none():n(e.item())?p.some(e.item()):np(t,e.item(),n,e.mode(),o,i)}))},rp=function(t,e,n,r){return np(t,e,n,Xh,ep.left(),r)},op=function(t,e,n,r){return np(t,e,n,Xh,ep.right(),r)},ip=function(t){return function(e){return 0===t.property().children(e).length}},up=function(t,e,n){return cp(t,e,ip(t),n)},ap=function(t,e,n){return sp(t,e,ip(t),n)},cp=rp,sp=op,lp=Co(),fp=function(t,e){return up(lp,t,e)},dp=function(t,e){return ap(lp,t,e)},mp=function(t,e,n){return cp(lp,t,e,n)},gp=function(t,e,n){return sp(lp,t,e,n)},hp=function(t,e,n){return Xn(t,e,n).isSome()},pp=ii.generate([{none:["message"]},{success:[]},{failedUp:["cell"]},{failedDown:["cell"]}]),vp=function(t,e,n){var r=t.getRect(e),o=t.getRect(n);return o.right>r.left&&o.left<r.right},bp=function(t){return nr(t,"tr")},yp=function(t,e,n,r,o,i,u){return nr(r,"td,th",u).bind((function(n){return nr(e,"td,th",u).map((function(e){return He(n,e)?He(r,n)&&Lr(n)===o?i(e):pp.none("in same cell"):Ro(bp,[n,e]).fold((function(){return vp(t,e,n)?pp.success():i(e)}),(function(t){return i(e)}))}))})).getOr(pp.none("default"))},wp=function(t,e,n,r,o){return t.fold(e,n,r,o)},xp=Wt(Wt({},pp),{verify:yp,cata:wp}),Cp=function(t,e,n,r){return{parent:i(t),children:i(e),element:i(n),index:i(r)}},Sp=function(t){return qe(t).bind((function(e){var n=Ye(e);return kp(n,t).map((function(r){return Cp(e,n,t,r)}))}))},kp=function(t,e){return j(t,a(He,e))},Op=function(t){return"br"===dt(t)},Tp=function(t,e,n){return e(t,n).bind((function(t){return vt(t)&&0===Pr(t).trim().length?Tp(t,e,n):p.some(t)}))},Ep=function(t,e,n){return n.traverse(e).orThunk((function(){return Tp(e,n.gather,t)})).map(n.relative)},_p=function(t,e){return Je(t,e).filter(Op).orThunk((function(){return Je(t,e-1).filter(Op)}))},Ap=function(t,e,n,r){return _p(e,n).bind((function(e){return r.traverse(e).fold((function(){return Tp(e,r.gather,t).map(r.relative)}),(function(t){return Sp(t).map((function(t){return yg.on(t.parent(),t.index())}))}))}))},Dp=function(t,e,n,r){var o=Op(e)?Ep(t,e,r):Ap(t,e,n,r);return o.map((function(t){return{start:i(t),finish:i(t)}}))},Np=function(t){return xp.cata(t,(function(t){return p.none()}),(function(){return p.none()}),(function(t){return p.some(gl(t,0))}),(function(t){return p.some(gl(t,Lr(t)))}))},Rp=function(t,e){return{left:t.left,top:t.top+e,right:t.right,bottom:t.bottom+e}},Mp=function(t,e){return{left:t.left,top:t.top-e,right:t.right,bottom:t.bottom-e}},zp=function(t,e,n){return{left:t.left+e,top:t.top+n,right:t.right+e,bottom:t.bottom+n}},Bp=function(t){return t.top},Pp=function(t){return t.bottom},Hp=function(t,e,n){return n>=0&&n<Lr(e)?t.getRangedRect(e,n,e,n+1):n>0?t.getRangedRect(e,n-1,e,n):p.none()},Ip=function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom}},Lp=function(t,e){return p.some(t.getRect(e))},Fp=function(t,e,n){return pt(e)?Lp(t,e).map(Ip):vt(e)?Hp(t,e,n).map(Ip):p.none()},Vp=function(t,e){return pt(e)?Lp(t,e).map(Ip):vt(e)?t.getRangedRect(e,0,e,Lr(e)).map(Ip):p.none()},Up=5,jp=100,Wp=ii.generate([{none:[]},{retry:["caret"]}]),qp=function(t,e){return t.left<e.left||Math.abs(e.right-t.left)<1||t.left>e.right},$p=function(t,e,n){return Yn(e,Ff).fold(i(!1),(function(e){return Vp(t,e).exists((function(t){return qp(n,t)}))}))},Gp=function(t,e,n,r,o){var i=Rp(o,Up);return Math.abs(n.bottom-r.bottom)<1||n.top>o.bottom?Wp.retry(i):n.top===o.bottom?Wp.retry(Rp(o,1)):$p(t,e,o)?Wp.retry(zp(i,Up,0)):Wp.none()},Kp=function(t,e,n,r,o){var i=Mp(o,Up);return Math.abs(n.top-r.top)<1||n.bottom<o.top?Wp.retry(i):n.bottom===o.top?Wp.retry(Mp(o,1)):$p(t,e,o)?Wp.retry(zp(i,Up,0)):Wp.none()},Xp={point:Bp,adjuster:Kp,move:Mp,gather:fp},Yp={point:Pp,adjuster:Gp,move:Rp,gather:dp},Jp=function(t,e,n){return t.elementFromPoint(e,n).filter((function(t){return"table"===dt(t)})).isSome()},Qp=function(t,e,n,r,o){return Zp(t,e,n,e.move(r,Up),o)},Zp=function(t,e,n,r,o){return 0===o?p.some(r):Jp(t,r.left,e.point(r))?Qp(t,e,n,r,o-1):t.situsFromPoint(r.left,e.point(r)).bind((function(i){return i.start().fold(p.none,(function(i){return Vp(t,i).bind((function(u){return e.adjuster(t,i,u,n,r).fold(p.none,(function(r){return Zp(t,e,n,r,o-1)}))})).orThunk((function(){return p.some(r)}))}),p.none)}))},tv=function(t,e){return t.situsFromPoint(e.left,e.bottom+Up)},ev=function(t,e){return t.situsFromPoint(e.left,e.top-Up)},nv=function(t,e,n){return t.point(e)>n.getInnerHeight()?p.some(t.point(e)-n.getInnerHeight()):t.point(e)<0?p.some(-t.point(e)):p.none()},rv=function(t,e,n){var r=t.move(n,Up),o=Zp(e,t,n,r,jp).getOr(r);return nv(t,o,e).fold((function(){return e.situsFromPoint(o.left,t.point(o))}),(function(n){return e.scrollBy(0,n),e.situsFromPoint(o.left,t.point(o)-n)}))},ov={tryUp:a(rv,Xp),tryDown:a(rv,Yp),ieTryUp:ev,ieTryDown:tv,getJumpSize:i(Up)},iv=20,uv=function(t,e,n){return t.getSelection().bind((function(r){return Dp(e,r.finish(),r.foffset(),n).fold((function(){return p.some(gl(r.finish(),r.foffset()))}),(function(o){var i=t.fromSitus(o),u=xp.verify(t,r.finish(),r.foffset(),i.finish(),i.foffset(),n.failure,e);return Np(u)}))}))},av=function(t,e,n,r,o,i){return 0===i?p.none():lv(t,e,n,r,o).bind((function(u){var a=t.fromSitus(u),c=xp.verify(t,n,r,a.finish(),a.foffset(),o.failure,e);return xp.cata(c,(function(){return p.none()}),(function(){return p.some(u)}),(function(u){return He(n,u)&&0===r?cv(t,n,r,Mp,o):av(t,e,u,0,o,i-1)}),(function(u){return He(n,u)&&r===Lr(u)?cv(t,n,r,Rp,o):av(t,e,u,Lr(u),o,i-1)}))}))},cv=function(t,e,n,r,o){return Fp(t,e,n).bind((function(e){return sv(t,o,r(e,ov.getJumpSize()))}))},sv=function(t,e,n){var r=Re().browser;return r.isChrome()||r.isSafari()||r.isFirefox()||r.isEdge()?e.otherRetry(t,n):r.isIE()?e.ieRetry(t,n):p.none()},lv=function(t,e,n,r,o){return Fp(t,n,r).bind((function(e){return sv(t,o,e)}))},fv=function(t,e,n){return uv(t,e,n).bind((function(r){return av(t,e,r.element(),r.offset(),n,iv).map(t.fromSitus)}))},dv=function(t,e){return hp(t,(function(t){return qe(t).exists((function(t){return He(t,e)}))}))},mv=function(t,e,n,r,o){return nr(r,"td,th",e).bind((function(r){return nr(r,"table",e).bind((function(u){return dv(o,u)?fv(t,e,n).bind((function(t){return nr(t.finish(),"td,th",e).map((function(e){return{start:i(r),finish:i(e),range:i(t)}}))})):p.none()}))}))},gv=function(t,e,n,r,o,i){return Re().browser.isIE()?p.none():i(r,e).orThunk((function(){return mv(t,e,n,r,o).map((function(t){var e=t.range();return Lh.create(p.some(jh(e.start(),e.soffset(),e.finish(),e.foffset())),!0)}))}))},hv=function(t,e){return nr(t,"tr",e).bind((function(t){return nr(t,"table",e).bind((function(n){var r=Gn(n,"tr");return He(t,r[0])?mp(n,(function(t){return Wr(t).isSome()}),e).map((function(t){var e=Lr(t);return Lh.create(p.some(jh(t,e,t,e)),!0)})):p.none()}))}))},pv=function(t,e){return nr(t,"tr",e).bind((function(t){return nr(t,"table",e).bind((function(n){var r=Gn(n,"tr");return He(t,r[r.length-1])?gp(n,(function(t){return jr(t).isSome()}),e).map((function(t){return Lh.create(p.some(jh(t,0,t,0)),!0)})):p.none()}))}))},vv=function(t,e,n,r,o,i,u){return mv(t,n,r,o,i).bind((function(t){return qh(e,n,t.start(),t.finish(),u)}))},bv=function(t,e){return nr(t,"td,th",e)};function yv(t,e,n,r){var o=p.none(),i=function(){o=p.none()},u=function(t){r.clear(e),o=bv(t.target(),n)},a=function(i){o.each((function(o){r.clearBeforeUpdate(e),bv(i.target(),n).each((function(i){Bo(o,i,n).each((function(n){var u=n.boxes.getOr([]);(u.length>1||1===u.length&&!He(o,i))&&(r.selectRange(e,u,n.start,n.finish),t.selectContents(i))}))}))}))},c=function(t){o.each(i)};return{mousedown:u,mouseover:a,mouseup:c}}var wv={traverse:Xe,gather:dp,relative:yg.before,otherRetry:ov.tryDown,ieRetry:ov.ieTryDown,failure:xp.failedDown},xv={traverse:Ke,gather:fp,relative:yg.before,otherRetry:ov.tryUp,ieRetry:ov.ieTryUp,failure:xp.failedUp},Cv=function(t){return function(e){return e===t}},Sv=Cv(38),kv=Cv(40),Ov=function(t){return t>=37&&t<=40},Tv={isBackward:Cv(37),isForward:Cv(39)},Ev={isBackward:Cv(39),isForward:Cv(37)},_v=function(t){return{left:t.left(),top:t.top(),right:t.right(),bottom:t.bottom(),width:t.width(),height:t.height()}},Av={toRaw:_v},Dv=function(e){var n=void 0!==e?e.dom():t.document,r=n.body.scrollLeft||n.documentElement.scrollLeft,o=n.body.scrollTop||n.documentElement.scrollTop;return Si(r,o)},Nv=function(e,n,r){var o=void 0!==r?r.dom():t.document,i=o.defaultView;i.scrollBy(e,n)},Rv=function(t){var e=function(e,n){return Vt.fromPoint(Vt.fromDom(t.document),e,n)},n=function(t){return t.dom().getBoundingClientRect()},r=function(e,n,r,o){var i=_g.exact(e,n,r,o);return Eh(t,i).map(Av.toRaw)},o=function(){return Th(t).map((function(e){return Uh(t,e)}))},i=function(e){var n=_g.relative(e.start(),e.finish());return Uh(t,n)},u=function(e,n){return _h(t,e,n).map((function(t){return Vh.create(t.start(),t.soffset(),t.finish(),t.foffset())}))},a=function(){Ah(t)},c=function(e){void 0===e&&(e=!1),Th(t).each((function(n){return n.fold((function(t){return t.collapse(e)}),(function(n,r){var o=e?n:r;wh(t,o,o)}),(function(n,r,o,i){var u=e?n:o,a=e?r:i;yh(t,u,a,u,a)}))}))},s=function(e){kh(t,e)},l=function(e){yh(t,e.start(),e.soffset(),e.finish(),e.foffset())},f=function(e,n){wh(t,e,n)},d=function(){return t.innerHeight},m=function(){var e=Dv(Vt.fromDom(t.document));return e.top()},g=function(e,n){Nv(e,n,Vt.fromDom(t.document))};return{elementFromPoint:e,getRect:n,getRangedRect:r,getSelection:o,fromSitus:i,situsFromPoint:u,clearSelection:a,collapseSelection:c,setSelection:l,setRelativeSelection:f,selectContents:s,getInnerHeight:d,getScrollY:m,scrollBy:g}},Mv=function(t,e){return{rows:t,cols:e}},zv=function(t,e,n,r){var o=Rv(t),i=yv(o,e,n,r);return{mousedown:i.mousedown,mouseover:i.mouseover,mouseup:i.mouseup}},Bv=function(t,e,n,r){var o=Rv(t),i=function(){return r.clear(e),p.none()},u=function(t,u,c,s,l,f){var d=t.raw(),m=d.which,g=!0===d.shiftKey,h=Po(e,r.selectedSelector).fold((function(){return kv(m)&&g?a(vv,o,e,n,wv,s,u,r.selectRange):Sv(m)&&g?a(vv,o,e,n,xv,s,u,r.selectRange):kv(m)?a(gv,o,n,wv,s,u,pv):Sv(m)?a(gv,o,n,xv,s,u,hv):p.none}),(function(t){var n=function(n){return function(){var i=Y(n,(function(n){return $h(n.rows,n.cols,e,t,r)}));return i.fold((function(){return Io(e,r.firstSelectedSelector,r.lastSelectedSelector).map((function(t){var n=kv(m)||f.isForward(m)?yg.after:yg.before;return o.setRelativeSelection(yg.on(t.first(),0),n(t.table())),r.clear(e),Lh.create(p.none(),!0)}))}),(function(t){return p.some(Lh.create(p.none(),!0))}))}};return kv(m)&&g?n([Mv(1,0)]):Sv(m)&&g?n([Mv(-1,0)]):f.isBackward(m)&&g?n([Mv(0,-1),Mv(-1,0)]):f.isForward(m)&&g?n([Mv(0,1),Mv(1,0)]):Ov(m)&&!1===g?i:p.none}));return h()},c=function(t,o,i,u,a){return Po(e,r.selectedSelector).fold((function(){var c=t.raw(),s=c.which,l=!0===c.shiftKey;return!1===l?p.none():Ov(s)?Wh(e,n,o,i,u,a,r.selectRange):p.none()}),p.none)};return{keydown:u,keyup:c}},Pv=function(t,e,n,r){var o=Rv(t);return function(t,i){r.clearBeforeUpdate(e),Bo(t,i,n).each((function(t){var n=t.boxes.getOr([]);r.selectRange(e,n,t.start,t.finish),o.selectContents(i),o.collapseSelection()}))}},Hv=function(t,e){P(e,(function(e){Za(t,e)}))},Iv=function(t){return function(e){Ja(e,t)}},Lv=function(t){return function(e){Hv(e,t)}},Fv=function(t){var e=Iv(t.selected),n=Lv([t.selected,t.lastSelected,t.firstSelected]),r=function(e){var r=Gn(e,t.selectedSelector);P(r,n)},o=function(n,o,i,u){r(n),P(o,e),Ja(i,t.firstSelected),Ja(u,t.lastSelected)};return{clearBeforeUpdate:r,clear:r,selectRange:o,selectedSelector:t.selectedSelector,firstSelectedSelector:t.firstSelectedSelector,lastSelectedSelector:t.lastSelectedSelector}},Vv=function(t,e,n){var r=function(e){Tt(e,t.selected),Tt(e,t.firstSelected),Tt(e,t.lastSelected)},o=function(e){xt(e,t.selected,"1")},i=function(t){u(t),n()},u=function(e){var n=Gn(e,t.selectedSelector);P(n,r)},a=function(n,r,u,a){i(n),P(r,o),xt(u,t.firstSelected,"1"),xt(a,t.lastSelected,"1"),e(r,u,a)};return{clearBeforeUpdate:u,clear:i,selectRange:a,selectedSelector:t.selectedSelector,firstSelectedSelector:t.firstSelectedSelector,lastSelectedSelector:t.lastSelectedSelector}},Uv={byClass:Fv,byAttr:Vv},jv=function(t,e,n){var r=t.slice(0,e[e.length-1].row()+1),o=jl(r,n);return q(o,(function(t){var n=t.cells().slice(0,e[e.length-1].column()+1);return B(n,(function(t){return t.element()}))}))},Wv=function(t,e,n){var r=t.slice(e[0].row()+e[0].rowspan()-1,t.length),o=jl(r,n);return q(o,(function(t){var n=t.cells().slice(e[0].column()+e[0].colspan()-1,+t.cells().length);return B(n,(function(t){return t.element()}))}))},qv=function(t,e,n){var r=Tr.fromTable(t),o=Jl(r,e);return o.map((function(t){var e=Fl(r,n,!1),o=jv(e,t,n),i=Wv(e,t,n);return{upOrLeftCells:o,downOrRightCells:i}}))},$v=function(t){return!1===tc(Vt.fromDom(t.target),"ephox-snooker-resizer-bar")};function Gv(t,e,r){var o=function(e,o,i){r.targets().each((function(r){var u=hr(o);u.each((function(u){var a=Rs(t),c=no(n,Vt.fromDom(t.getDoc()),a),s=qv(u,r,c);us(t,e,o,i,s)}))}))},i=function(){return as(t)},u=Uv.byAttr(ri,o,i);return t.on("init",(function(r){var o=t.getWin(),i=Bs(t),a=Is(t),c=function(){var e=t.selection,r=Vt.fromDom(e.getStart()),o=Vt.fromDom(e.getEnd()),a=Ro(hr,[r,o]);a.fold((function(){return u.clear(i)}),n)},s=zv(o,i,a,u),l=Bv(o,i,a,u),f=Pv(o,i,a,u),d=function(t){return!0===t.raw().shiftKey};t.on("TableSelectorChange",(function(t){return f(t.start,t.finish)}));var m=function(e,n){d(e)&&(n.kill()&&e.kill(),n.selection().each((function(e){var n=_g.relative(e.start(),e.finish()),r=Ug(o,n);t.selection.setRng(r)})))},g=function(e){var n=ja(e);if(n.raw().shiftKey&&Ov(n.raw().which)){var r=t.selection.getRng(),o=Vt.fromDom(r.startContainer),i=Vt.fromDom(r.endContainer);l.keyup(n,o,r.startOffset,i,r.endOffset).each((function(t){m(n,t)}))}},h=function(n){var r=ja(n);e().each((function(t){return t.hideBars()}));var o=t.selection.getRng(),i=Vt.fromDom(t.selection.getStart()),u=Vt.fromDom(o.startContainer),a=Vt.fromDom(o.endContainer),c=Gs(i).isRtl()?Ev:Tv;l.keydown(r,u,o.startOffset,a,o.endOffset,c).each((function(t){m(r,t)})),e().each((function(t){return t.showBars()}))},p=function(t){return 0===t.button},v=function(t){return void 0===t.buttons||(!(!Ym.browser.isEdge()||0!==t.buttons)||0!==(1&t.buttons))},b=function(t){p(t)&&$v(t)&&s.mousedown(ja(t))},y=function(t){v(t)&&$v(t)&&s.mouseover(ja(t))},w=function(t){p(t)&&$v(t)&&s.mouseup(ja(t))},x=function(){var t=Ks(Vt.fromDom(i)),e=Ks(0),n=function(n){var r=Vt.fromDom(n.target);if("td"===dt(r)||"th"===dt(r)){var o=t.get(),i=e.get();He(o,r)&&n.timeStamp-i<300&&(n.preventDefault(),f(r,r))}t.set(r),e.set(n.timeStamp)};return{touchEnd:n}},C=x();t.on("mousedown",b),t.on("mouseover",y),t.on("mouseup",w),t.on("touchend",C.touchEnd),t.on("keyup",g),t.on("keydown",h),t.on("NodeChange",c)})),{clear:u.clear}}var Kv=function(t,e){var n=Ks(p.none()),r=Ks([]),o=function(){return Wd(t).bind((function(t){var n=hr(t),r=function(t){return"caption"===dt(t)};return n.map((function(n){return r(t)?gi(t):hi(e,n,t)}))}))},i=function(){n.set(qt(o)()),P(r.get(),(function(t){return t()}))},u=function(t,e){var o=function(){return n.get().fold((function(){t.setDisabled(!0)}),(function(n){t.setDisabled(e(n))}))};return o(),r.set(r.get().concat([o])),function(){r.set(I(r.get(),(function(t){return t!==o})))}},a=function(t){return u(t,(function(t){return!1}))},c=function(t){return u(t,(function(t){return"caption"===dt(t.element())}))},s=function(t){return function(e){return u(e,(function(e){return"caption"===dt(e.element())||t().isNone()}))}},l=function(t){return u(t,(function(t){return t.mergable().isNone()}))},f=function(t){return u(t,(function(t){return t.unmergable().isNone()}))};return t.on("NodeChange ExecCommand TableSelectorChange",i),{onSetupTable:a,onSetupCellOrRow:c,onSetupPasteable:s,onSetupMergeable:l,onSetupUnmergeable:f,resetTargets:i,targets:function(){return n.get()}}},Xv=function(t,e,n){t.ui.registry.addMenuButton("table",{tooltip:"Table",icon:"table",fetch:function(t){return t("inserttable | cell row column | advtablesort | tableprops deletetable")}});var r=function(e){return function(){return t.execCommand(e)}};t.ui.registry.addButton("tableprops",{tooltip:"Table properties",onAction:r("mceTableProps"),icon:"table",onSetup:e.onSetupTable}),t.ui.registry.addButton("tabledelete",{tooltip:"Delete table",onAction:r("mceTableDelete"),icon:"table-delete-table",onSetup:e.onSetupTable}),t.ui.registry.addButton("tablecellprops",{tooltip:"Cell properties",onAction:r("mceTableCellProps"),icon:"table-cell-properties",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tablemergecells",{tooltip:"Merge cells",onAction:r("mceTableMergeCells"),icon:"table-merge-cells",onSetup:e.onSetupMergeable}),t.ui.registry.addButton("tablesplitcells",{tooltip:"Split cell",onAction:r("mceTableSplitCells"),icon:"table-split-cells",onSetup:e.onSetupUnmergeable}),t.ui.registry.addButton("tableinsertrowbefore",{tooltip:"Insert row before",onAction:r("mceTableInsertRowBefore"),icon:"table-insert-row-above",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tableinsertrowafter",{tooltip:"Insert row after",onAction:r("mceTableInsertRowAfter"),icon:"table-insert-row-after",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tabledeleterow",{tooltip:"Delete row",onAction:r("mceTableDeleteRow"),icon:"table-delete-row",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tablerowprops",{tooltip:"Row properties",onAction:r("mceTableRowProps"),icon:"table-row-properties",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tableinsertcolbefore",{tooltip:"Insert column before",onAction:r("mceTableInsertColBefore"),icon:"table-insert-column-before",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tableinsertcolafter",{tooltip:"Insert column after",onAction:r("mceTableInsertColAfter"),icon:"table-insert-column-after",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tabledeletecol",{tooltip:"Delete column",onAction:r("mceTableDeleteCol"),icon:"table-delete-column",onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tablecutrow",{tooltip:"Cut row",icon:"cut-row",onAction:r("mceTableCutRow"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tablecopyrow",{tooltip:"Copy row",icon:"duplicate-row",onAction:r("mceTableCopyRow"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tablepasterowbefore",{tooltip:"Paste row before",icon:"paste-row-before",onAction:r("mceTablePasteRowBefore"),onSetup:e.onSetupPasteable(n.getRows)}),t.ui.registry.addButton("tablepasterowafter",{tooltip:"Paste row after",icon:"paste-row-after",onAction:r("mceTablePasteRowAfter"),onSetup:e.onSetupPasteable(n.getRows)}),t.ui.registry.addButton("tablecutcol",{tooltip:"Cut column",icon:"cut-column",onAction:r("mceTableCutCol"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tablecopycol",{tooltip:"Copy column",icon:"duplicate-column",onAction:r("mceTableCopyCol"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addButton("tablepastecolbefore",{tooltip:"Paste column before",icon:"paste-column-before",onAction:r("mceTablePasteColBefore"),onSetup:e.onSetupPasteable(n.getColumns)}),t.ui.registry.addButton("tablepastecolafter",{tooltip:"Paste column after",icon:"paste-column-after",onAction:r("mceTablePasteColAfter"),onSetup:e.onSetupPasteable(n.getColumns)}),t.ui.registry.addButton("tableinsertdialog",{tooltip:"Insert table",onAction:r("mceInsertTable"),icon:"table"})},Yv=function(t){var e=function(e){return t.dom.is(e,"table")&&t.getBody().contains(e)},n=Ds(t);n.length>0&&t.ui.registry.addContextToolbar("table",{predicate:e,items:n,scope:"node",position:"node"})},Jv=function(t,e,n){var r=function(e){return function(){return t.execCommand(e)}},o=function(e){var n=e.numRows,r=e.numColumns;t.undoManager.transact((function(){um(t,r,n,0,0)})),t.addVisual()},i={text:"Table properties",onSetup:e.onSetupTable,onAction:r("mceTableProps")},u={text:"Delete table",icon:"table-delete-table",onSetup:e.onSetupTable,onAction:r("mceTableDelete")};t.ui.registry.addMenuItem("tableinsertrowbefore",{text:"Insert row before",icon:"table-insert-row-above",onAction:r("mceTableInsertRowBefore"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tableinsertrowafter",{text:"Insert row after",icon:"table-insert-row-after",onAction:r("mceTableInsertRowAfter"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tabledeleterow",{text:"Delete row",icon:"table-delete-row",onAction:r("mceTableDeleteRow"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablerowprops",{text:"Row properties",icon:"table-row-properties",onAction:r("mceTableRowProps"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablecutrow",{text:"Cut row",icon:"cut-row",onAction:r("mceTableCutRow"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablecopyrow",{text:"Copy row",icon:"duplicate-row",onAction:r("mceTableCopyRow"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablepasterowbefore",{text:"Paste row before",icon:"paste-row-before",onAction:r("mceTablePasteRowBefore"),onSetup:e.onSetupPasteable(n.getRows)}),t.ui.registry.addMenuItem("tablepasterowafter",{text:"Paste row after",icon:"paste-row-after",onAction:r("mceTablePasteRowAfter"),onSetup:e.onSetupPasteable(n.getRows)});var a={type:"nestedmenuitem",text:"Row",getSubmenuItems:function(){return"tableinsertrowbefore tableinsertrowafter tabledeleterow tablerowprops | tablecutrow tablecopyrow tablepasterowbefore tablepasterowafter"}};t.ui.registry.addMenuItem("tableinsertcolumnbefore",{text:"Insert column before",icon:"table-insert-column-before",onAction:r("mceTableInsertColBefore"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tableinsertcolumnafter",{text:"Insert column after",icon:"table-insert-column-after",onAction:r("mceTableInsertColAfter"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tabledeletecolumn",{text:"Delete column",icon:"table-delete-column",onAction:r("mceTableDeleteCol"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablecutcolumn",{text:"Cut column",icon:"cut-column",onAction:r("mceTableCutCol"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablecopycolumn",{text:"Copy column",icon:"duplicate-column",onAction:r("mceTableCopyCol"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablepastecolumnbefore",{text:"Paste column before",icon:"paste-column-before",onAction:r("mceTablePasteColBefore"),onSetup:e.onSetupPasteable(n.getColumns)}),t.ui.registry.addMenuItem("tablepastecolumnafter",{text:"Paste column after",icon:"paste-column-after",onAction:r("mceTablePasteColAfter"),onSetup:e.onSetupPasteable(n.getColumns)});var c={type:"nestedmenuitem",text:"Column",getSubmenuItems:function(){return"tableinsertcolumnbefore tableinsertcolumnafter tabledeletecolumn"}};t.ui.registry.addMenuItem("tablecellprops",{text:"Cell properties",icon:"table-cell-properties",onAction:r("mceTableCellProps"),onSetup:e.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablemergecells",{text:"Merge cells",icon:"table-merge-cells",onAction:r("mceTableMergeCells"),onSetup:e.onSetupMergeable}),t.ui.registry.addMenuItem("tablesplitcells",{text:"Split cell",icon:"table-split-cells",onAction:r("mceTableSplitCells"),onSetup:e.onSetupUnmergeable});var s={type:"nestedmenuitem",text:"Cell",getSubmenuItems:function(){return"tablecellprops tablemergecells tablesplitcells"}};!1===Cs(t)?t.ui.registry.addMenuItem("inserttable",{text:"Table",icon:"table",onAction:r("mceInsertTable")}):t.ui.registry.addNestedMenuItem("inserttable",{text:"Table",icon:"table",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"inserttable",onAction:o}]}}),t.ui.registry.addMenuItem("inserttabledialog",{text:"Insert table",icon:"table",onAction:r("mceInsertTable")}),t.ui.registry.addMenuItem("tableprops",i),t.ui.registry.addMenuItem("deletetable",u),t.ui.registry.addNestedMenuItem("row",a),t.ui.registry.addNestedMenuItem("column",c),t.ui.registry.addNestedMenuItem("cell",s),t.ui.registry.addContextMenu("table",{update:function(){return e.resetTargets(),e.targets().fold((function(){return""}),(function(t){return"caption"===dt(t.element())?"tableprops deletetable":"cell row column | advtablesort | tableprops deletetable"}))}})},Qv={tablecellbackgroundcolor:{selector:"td,th",styles:{backgroundColor:"%value"},remove_similar:!0},tablecellbordercolor:{selector:"td,th",styles:{borderColor:"%value"},remove_similar:!0},tablecellborderstyle:{selector:"td,th",styles:{borderStyle:"%value"},remove_similar:!0},tablecellborderwidth:{selector:"td,th",styles:{borderWidth:"%value"},remove_similar:!0}},Zv=function(t){t.formatter.register(Qv)};function tb(t){var e=Vd(t),n=Kv(t,e),r=ml(t),o=Gv(t,r.lazyResize,n),i=Gd(t,r.lazyWire),u=og();return ng(t,i,o,e,u),rg(t,i,e),xi(t,e,i,o),Jv(t,n,u),Xv(t,n,u),Yv(t),t.on("PreInit",(function(){t.serializer.addTempAttr(Zo),t.serializer.addTempAttr(ei),Zv(t)})),vs(t)&&t.on("keydown",(function(e){Hh(e,t,i,r.lazyWire)})),t.on("remove",(function(){r.destroy()})),lm(t,u,r,n)}function eb(){e.add("table",tb)}eb()})(window)},a061:function(t,e,n){"use strict";n.r(e);var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"tinymce-editor"},[t.reloading?t._e():n("editor",{attrs:{init:t.init,disabled:t.disabled},on:{onClick:t.onClick},model:{value:t.myValue,callback:function(e){t.myValue=e},expression:"myValue"}})],1)},o=[],i=n("e562"),u=n.n(i),a=["onActivate","onAddUndo","onBeforeAddUndo","onBeforeExecCommand","onBeforeGetContent","onBeforeRenderUI","onBeforeSetContent","onBeforePaste","onBlur","onChange","onClearUndos","onClick","onContextMenu","onCopy","onCut","onDblclick","onDeactivate","onDirty","onDrag","onDragDrop","onDragEnd","onDragGesture","onDragOver","onDrop","onExecCommand","onFocus","onFocusIn","onFocusOut","onGetContent","onHide","onInit","onKeyDown","onKeyPress","onKeyUp","onLoadContent","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onNodeChange","onObjectResizeStart","onObjectResized","onObjectSelected","onPaste","onPostProcess","onPostRender","onPreProcess","onProgressState","onRedo","onRemove","onReset","onSaveContent","onSelectionChange","onSetAttrib","onSetContent","onShow","onSubmit","onUndo","onVisualAid"],c=function(t){return-1!==a.indexOf(t)},s=function(t,e,n){Object.keys(e).filter(c).forEach((function(r){var o=e[r];"function"===typeof o&&("onInit"===r?o(t,n):n.on(r.substring(2),(function(t){return o(t,n)})))}))},l=function(t,e){var n,r=t.$props.modelEvents?t.$props.modelEvents:null,o=Array.isArray(r)?r.join(" "):r;t.$watch("value",(function(t,r){e&&"string"===typeof t&&t!==n&&t!==r&&(e.setContent(t),n=t)})),e.on(o||"change keyup undo redo",(function(){n=e.getContent(),t.$emit("input",n)}))},f=function(t,e,n){var r=e.$props.value?e.$props.value:"",o=e.$props.initialValue?e.$props.initialValue:"";n.setContent(r||o),e.$listeners.input&&l(e,n),s(t,e.$listeners,n)},d=0,m=function(t){var e=Date.now(),n=Math.floor(1e9*Math.random());return d++,t+"_"+n+d+String(e)},g=function(t){return null!==t&&"textarea"===t.tagName.toLowerCase()},h=function(t){return"undefined"===typeof t||""===t?[]:Array.isArray(t)?t:t.split(" ")},p=function(t,e){return h(t).concat(h(e))},v=function(t,e,n,r){var o=e.createElement("script");o.type="application/javascript",o.id=t,o.addEventListener("load",r),o.src=n,e.head&&e.head.appendChild(o)},b=function(){return{listeners:[],scriptId:m("tiny-script"),scriptLoaded:!1}},y=function(t,e,n,r){t.scriptLoaded?r():(t.listeners.push(r),e.getElementById(t.scriptId)||v(t.scriptId,e,n,(function(){t.listeners.forEach((function(t){return t()})),t.scriptLoaded=!0})))},w=n("1f38"),x={apiKey:String,cloudChannel:String,id:String,init:Object,initialValue:String,inline:Boolean,modelEvents:[String,Array],plugins:[String,Array],tagName:String,toolbar:[String,Array],value:String,disabled:Boolean},C=function(){return C=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n],e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},C.apply(this,arguments)},S=b(),k=function(t,e,n){return t(n||"div",{attrs:{id:e}})},O=function(t,e){return t("textarea",{attrs:{id:e},style:{visibility:"hidden"}})},T=function(t){return function(){var e=C({},t.$props.init,{readonly:t.$props.disabled,selector:"#"+t.elementId,plugins:p(t.$props.init&&t.$props.init.plugins,t.$props.plugins),toolbar:t.$props.toolbar||t.$props.init&&t.$props.init.toolbar,inline:t.inlineEditor,setup:function(e){t.editor=e,e.on("init",(function(n){return f(n,t,e)})),t.$props.init&&"function"===typeof t.$props.init.setup&&t.$props.init.setup(e)}});g(t.element)&&(t.element.style.visibility=""),Object(w["a"])().init(e)}},E={props:x,created:function(){this.elementId=this.$props.id||m("tiny-vue"),this.inlineEditor=this.$props.init&&this.$props.init.inline||this.$props.inline},watch:{disabled:function(){this.editor.setMode(this.disabled?"readonly":"design")}},mounted:function(){if(this.element=this.$el,null!==Object(w["a"])())T(this)();else if(this.element&&this.element.ownerDocument){var t=this.element.ownerDocument,e=this.$props.cloudChannel?this.$props.cloudChannel:"5",n=this.$props.apiKey?this.$props.apiKey:"no-api-key";y(S,t,"https://cdn.tiny.cloud/1/"+n+"/tinymce/"+e+"/tinymce.min.js",T(this))}},beforeDestroy:function(){null!==Object(w["a"])()&&Object(w["a"])().remove(this.editor)},render:function(t){return this.inlineEditor?k(t,this.elementId,this.$props.tagName):O(t,this.elementId)}},_=E,A=(n("030f"),n("4ea8"),n("4237"),n("3aea"),n("07d1"),n("84ec"),n("f557"),n("9434"),n("2d33"),n("34de"),n("3154"),n("ec27"),n("0fea")),D=n("ca00"),N={components:{Editor:_},props:{value:{type:String,required:!1},triggerChange:{type:Boolean,default:!1,required:!1},disabled:{type:Boolean,default:!1},plugins:{type:[String,Array],default:"lists image link media table textcolor wordcount contextmenu fullscreen"},toolbar:{type:[String,Array],default:"undo redo | formatselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | lists link unlink image media table | removeformat | fullscreen",branding:!1}},data:function(){return{init:{language_url:"/tinymce/langs/zh_CN.js",language:"zh_CN",skin_url:"/tinymce/skins/lightgray",height:300,plugins:this.plugins,toolbar:this.toolbar,branding:!1,menubar:!1,toolbar_drawer:!1,images_upload_handler:function(t,e){var n=new FormData;n.append("file",t.blob(),t.filename()),n.append("biz","jeditor"),n.append("jeditor","1"),Object(A["k"])(window._CONFIG["domianURL"]+"/sys/common/upload",n).then((function(n){if(n.success)if("local"==n.message){var r="data:image/jpeg;base64,"+t.base64();e(r)}else{var o=Object(A["d"])(n.message);e(o)}}))}},myValue:this.value,reloading:!1}},mounted:function(){this.initATabsChangeAutoReload()},methods:{reload:function(){var t=this;this.reloading=!0,this.$nextTick((function(){return t.reloading=!1}))},onClick:function(t){this.$emit("onClick",t,u.a)},clear:function(){this.myValue=""},initATabsChangeAutoReload:function(){var t=this,e=Object(D["g"])(this,"ATabs"),n=Object(D["g"])(this,"ATabPane");if(e&&n){var r=n.$vnode.key;e.$on("change",(function(e){r===e&&t.reload()}))}}},watch:{value:function(t){this.myValue=null==t?"":t},myValue:function(t){this.triggerChange?this.$emit("change",t):this.$emit("input",t)}}},R=N,M=n("2877"),z=Object(M["a"])(R,r,o,!1,null,"02627f50",null);e["default"]=z.exports},be7f:function(t,e){(function(t){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=tinymce.util.Tools.resolve("tinymce.util.VK"),r=function(t){var e=typeof t;return null===t?"null":"object"===e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e},o=function(t){return function(e){return r(e)===t}},i=function(t){return function(e){return typeof e===t}},u=function(t){return function(e){return t===e}},a=o("string"),c=o("array"),s=u(null),l=i("boolean"),f=i("function"),d=function(t){var e=t.getParam("link_assume_external_targets",!1);return l(e)&&e?1:!a(e)||"http"!==e&&"https"!==e?0:e},m=function(t){return t.getParam("link_context_toolbar",!1,"boolean")},g=function(t){return t.getParam("link_list")},h=function(t){return t.getParam("default_link_target")},p=function(t){return t.getParam("target_list",!0)},v=function(t){return t.getParam("rel_list",[],"array")},b=function(t){return t.getParam("link_class_list",[],"array")},y=function(t){return t.getParam("link_title",!0,"boolean")},w=function(t){return t.getParam("allow_unsafe_link_target",!1,"boolean")},x=function(t){return t.getParam("link_quicklink",!1,"boolean")},C=function(t){return t.getParam("link_default_protocol","http","string")},S=function(){},k=function(t){return function(){return t}},O=k(!1),T=k(!0),E=function(){return _},_=function(){var t=function(t){return t.isNone()},e=function(t){return t()},n=function(t){return t},r={fold:function(t,e){return t()},is:O,isSome:O,isNone:T,getOr:n,getOrThunk:e,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:k(null),getOrUndefined:k(void 0),or:n,orThunk:e,map:E,each:S,bind:E,exists:O,forall:T,filter:E,equals:t,equals_:t,toArray:function(){return[]},toString:k("none()")};return r}(),A=function(t){var e=k(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:T,isNone:O,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return A(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:_},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(O,(function(e){return n(t,e)}))}};return o},D=function(t){return null===t||void 0===t?_:A(t)},N={some:A,none:E,from:D},R=Array.prototype.indexOf,M=Array.prototype.push,z=function(t,e){return R.call(t,e)},B=function(t,e){return z(t,e)>-1},P=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},H=function(t,e){for(var n=0,r=t.length;n<r;n++){var o=t[n];e(o,n)}},I=function(t,e,n){return H(t,(function(t){n=e(n,t)})),n},L=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!c(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);M.apply(e,t[n])}return e},F=function(t,e){return L(P(t,e))},V=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return N.none()},U=function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e},j=tinymce.util.Tools.resolve("tinymce.util.Tools"),W=function(t){return a(t.value)?t.value:""},q=function(t,e){var n=[];return j.each(t,(function(t){var r=a(t.text)?t.text:a(t.title)?t.title:"";if(void 0!==t.menu);else{var o=e(t);n.push({text:r,value:o})}})),n},$=function(t){return void 0===t&&(t=W),function(e){return N.from(e).map((function(e){return q(e,t)}))}},G=function(t){return $(W)(t)},K=function(t,e){return function(n){return{name:t,type:"selectbox",label:e,items:n}}},X={sanitize:G,sanitizeWith:$,createUi:K,getValue:W},Y=function(){return Y=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n],e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Y.apply(this,arguments)},J=Object.keys,Q=function(t,e){for(var n=J(t),r=0,o=n.length;r<o;r++){var i=n[r],u=t[i];e(u,i)}},Z=function(t){return function(e,n){t[n]=e}},tt=function(t,e,n,r){var o={};return Q(t,(function(t,o){(e(t,o)?n:r)(t,o)})),o},et=function(t,e){var n={};return tt(t,e,Z(n),S),n},nt=function(t){return!(!/(^|[ ,])rtc([, ]|$)/.test(t.getParam("plugins","","string"))||!e.get("rtc"))},rt=function(t){return/^\w+:/i.test(t)},ot=function(t){var e=t.getAttribute("data-mce-href");return e||t.getAttribute("href")},it=function(t,e){var n=["noopener"],r=t?t.split(/\s+/):[],o=function(t){return j.trim(t.sort().join(" "))},i=function(t){return t=u(t),t.length>0?t.concat(n):n},u=function(t){return t.filter((function(t){return-1===j.inArray(n,t)}))},a=e?i(r):u(r);return a.length>0?o(a):""},ut=function(t){return t.replace(/\uFEFF/g,"")},at=function(t,e){return e=e||t.selection.getNode(),dt(e)?t.dom.select("a[href]",e)[0]:t.dom.getParent(e,"a[href]")},ct=function(t,e){var n=e?e.innerText||e.textContent:t.getContent({format:"text"});return ut(n)},st=function(t){return t&&"A"===t.nodeName&&!!ot(t)},lt=function(t){return j.grep(t,st).length>0},ft=function(t){return!(/</.test(t)&&(!/^<a [^>]+>[^<]+<\/a>$/.test(t)||-1===t.indexOf("href=")))},dt=function(t){return t&&"FIGURE"===t.nodeName&&/\bimage\b/i.test(t.className)},mt=function(t){return I(["title","rel","class","target"],(function(e,n){return t[n].each((function(t){e[n]=t.length>0?t:null})),e}),{href:t.href})},gt=function(t,e){return"http"!==e&&"https"!==e||rt(t)?t:e+"://"+t},ht=function(t,e){var n=Y({},e);if(!(v(t).length>0)&&!1===w(t)){var r=it(n.rel,"_blank"===n.target);n.rel=r||null}return N.from(n.target).isNone()&&!1===p(t)&&(n.target=h(t)),n.href=gt(n.href,d(t)),n},pt=function(t,e,n,r){n.each((function(t){e.hasOwnProperty("innerText")?e.innerText=t:e.textContent=t})),t.dom.setAttribs(e,r),t.selection.select(e)},vt=function(t,e,n,r){dt(e)?kt(t,e,r):n.fold((function(){t.execCommand("mceInsertLink",!1,r)}),(function(e){t.insertContent(t.dom.createHTML("a",r,t.dom.encode(e)))}))},bt=function(t,e,n){var r=t.selection.getNode(),o=at(t,r),i=ht(t,mt(n));t.undoManager.transact((function(){n.href===e.href&&e.attach(),o?(t.focus(),pt(t,o,n.text,i)):vt(t,r,n.text,i)}))},yt=function(t){t.undoManager.transact((function(){var e=t.selection.getNode();if(dt(e))St(t,e);else{var n=t.dom.getParent(e,"a[href]",t.getBody());n&&t.dom.remove(n,!0)}t.focus()}))},wt=function(t){var e=t.class,n=t.href,r=t.rel,o=t.target,i=t.text,u=t.title;return et({class:e.getOrNull(),href:n,rel:r.getOrNull(),target:o.getOrNull(),text:i.getOrNull(),title:u.getOrNull()},(function(t,e){return!1===s(t)}))},xt=function(t,e,n){nt(t)?t.execCommand("createlink",!1,wt(n)):bt(t,e,n)},Ct=function(t){nt(t)?t.execCommand("unlink"):yt(t)},St=function(t,e){var n=t.dom.select("img",e)[0];if(n){var r=t.dom.getParents(n,"a[href]",e)[0];r&&(r.parentNode.insertBefore(n,r),t.dom.remove(r))}},kt=function(t,e,n){var r=t.dom.select("img",e)[0];if(r){var o=t.dom.create("a",n);r.parentNode.insertBefore(o,r),o.appendChild(r)}},Ot=function(t){var e=t,n=function(){return e},r=function(t){e=t};return{get:n,set:r}},Tt=function(t,e){return V(e,(function(e){return N.some(e).filter((function(e){return e.value===t}))}))},Et=function(t,e,n,r){var o=r[e],i=t.length>0;return void 0!==o?Tt(o,n).map((function(e){return{url:{value:e.value,meta:{text:i?t:e.text,attach:S}},text:i?t:e.text}})):N.none()},_t=function(t,e){return"link"===e?t.catalogs.link:"anchor"===e?t.catalogs.anchor:N.none()},At=function(t,e){var n=Ot(t.text),r=function(t){if(n.get().length<=0){var e=void 0!==t.url.meta.text?t.url.meta.text:t.url.value,r=void 0!==t.url.meta.title?t.url.meta.title:"";return N.some({text:e,title:r})}return N.none()},o=function(t,r){var o=_t(e,r.name).getOr([]);return Et(n.get(),r.name,o,t)},i=function(t,e){return"url"===e.name?r(t()):B(["anchor","link"],e.name)?o(t(),e):"text"===e.name?(n.set(t().text),N.none()):N.none()};return{onChange:i}},Dt={init:At,getDelta:Et},Nt=tinymce.util.Tools.resolve("tinymce.util.Delay"),Rt=tinymce.util.Tools.resolve("tinymce.util.Promise"),Mt=function(t,e,n){var r=t.selection.getRng();Nt.setEditorTimeout(t,(function(){t.windowManager.confirm(e,(function(e){t.selection.setRng(r),n(e)}))}))},zt=function(t){var e=t.href,n=e.indexOf("@")>0&&-1===e.indexOf("/")&&-1===e.indexOf("mailto:");return n?N.some({message:"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",preprocess:function(t){return Y(Y({},t),{href:"mailto:"+e})}}):N.none()},Bt=function(t,e){return function(n){var r=n.href,o=1===t&&!rt(r)||0===t&&/^\s*www[\.|\d\.]/i.test(r);return o?N.some({message:"The URL you entered seems to be an external link. Do you want to add the required "+e+":// prefix?",preprocess:function(t){return Y(Y({},t),{href:e+"://"+r})}}):N.none()}},Pt=function(t,e){return V([zt,Bt(d(t),C(t))],(function(t){return t(e)})).fold((function(){return Rt.resolve(e)}),(function(n){return new Rt((function(r){Mt(t,n.message,(function(t){r(t?n.preprocess(e):e)}))}))}))},Ht={preprocess:Pt},It=function(t){var e=t.dom.select("a:not([href])"),n=F(e,(function(t){var e=t.name||t.id;return e?[{text:e,value:"#"+e}]:[]}));return n.length>0?N.some([{text:"None",value:""}].concat(n)):N.none()},Lt={getAnchors:It},Ft=function(t){var e=b(t);return e.length>0?X.sanitize(e):N.none()},Vt={getClasses:Ft},Ut=tinymce.util.Tools.resolve("tinymce.util.XHR"),jt=function(t){try{return N.some(JSON.parse(t))}catch(e){return N.none()}},Wt=function(t){var e=function(e){return t.convertURL(e.value||e.url,"href")},n=g(t);return new Rt((function(t){a(n)?Ut.send({url:n,success:function(e){return t(jt(e))},error:function(e){return t(N.none())}}):f(n)?n((function(e){return t(N.some(e))})):t(N.from(n))})).then((function(t){return t.bind(X.sanitizeWith(e)).map((function(t){return t.length>0?[{text:"None",value:""}].concat(t):t}))}))},qt={getLinks:Wt},$t=function(t,e){var n=v(t);if(n.length>0){var r=e.is("_blank"),o=!1===w(t),i=function(t){return it(X.getValue(t),r)},u=o?X.sanitizeWith(i):X.sanitize;return u(n)}return N.none()},Gt={getRels:$t},Kt=[{text:"Current window",value:""},{text:"New window",value:"_blank"}],Xt=function(t){var e=p(t);return c(e)?X.sanitize(e).orThunk((function(){return N.some(Kt)})):!1===e?N.none():N.some(Kt)},Yt={getTargets:Xt},Jt=function(t,e,n){var r=t.getAttrib(e,n);return null!==r&&r.length>0?N.some(r):N.none()},Qt=function(t,e){var n=t.dom,r=ft(t.selection.getContent()),o=r?N.some(ct(t.selection,e)):N.none(),i=e?N.some(n.getAttrib(e,"href")):N.none(),u=e?N.from(n.getAttrib(e,"target")):N.none(),a=Jt(n,e,"rel"),c=Jt(n,e,"class"),s=Jt(n,e,"title");return{url:i,text:o,title:s,target:u,rel:a,linkClass:c}},Zt=function(t,e){return qt.getLinks(t).then((function(n){var r=Qt(t,e);return{anchor:r,catalogs:{targets:Yt.getTargets(t),rels:Gt.getRels(t,r.target),classes:Vt.getClasses(t),anchor:Lt.getAnchors(t),link:n},optNode:N.from(e),flags:{titleEnabled:y(t)}}}))},te={collect:Zt},ee=function(t,e){return function(n){var r=n.getData();if(!r.url.value)return Ct(t),void n.close();var o=function(t){return N.from(r[t]).filter((function(n){return!e.anchor[t].is(n)}))},i={href:r.url.value,text:o("text"),target:o("target"),rel:o("rel"),class:o("linkClass"),title:o("title")},u={href:r.url.value,attach:void 0!==r.url.meta&&r.url.meta.attach?r.url.meta.attach:function(){}};Ht.preprocess(t,i).then((function(e){xt(t,u,e)})),n.close()}},ne=function(t){var e=at(t);return te.collect(t,e)},re=function(t,e){return{url:{value:t.anchor.url.getOr(""),meta:{attach:function(){},text:t.anchor.url.fold((function(){return""}),(function(){return t.anchor.text.getOr("")})),original:{value:t.anchor.url.getOr("")}}},text:t.anchor.text.getOr(""),title:t.anchor.title.getOr(""),anchor:t.anchor.url.getOr(""),link:t.anchor.url.getOr(""),rel:t.anchor.rel.getOr(""),target:t.anchor.target.or(e).getOr(""),linkClass:t.anchor.linkClass.getOr("")}},oe=function(t,e,n){var r=[{name:"url",type:"urlinput",filetype:"file",label:"URL"}],o=t.anchor.text.map((function(){return{name:"text",type:"input",label:"Text to display"}})).toArray(),i=t.flags.titleEnabled?[{name:"title",type:"input",label:"Title"}]:[],u=N.from(h(n)),a=re(t,u),c=Dt.init(a,t),s=t.catalogs,l={type:"panel",items:L([r,o,i,U([s.anchor.map(X.createUi("anchor","Anchors")),s.rels.map(X.createUi("rel","Rel")),s.targets.map(X.createUi("target","Open link in...")),s.link.map(X.createUi("link","Link list")),s.classes.map(X.createUi("linkClass","Class"))])])};return{title:"Insert/Edit Link",size:"normal",body:l,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:a,onChange:function(t,e){var n=e.name;c.onChange(t.getData,{name:n}).each((function(e){t.setData(e)}))},onSubmit:e}},ie=function(t){var e=ne(t);e.then((function(e){var n=ee(t,e);return oe(e,n,t)})).then((function(e){t.windowManager.open(e)}))},ue=function(e,n){t.document.body.appendChild(e),e.dispatchEvent(n),t.document.body.removeChild(e)},ae=function(e){var n=t.document.createElement("a");n.target="_blank",n.href=e,n.rel="noreferrer noopener";var r=t.document.createEvent("MouseEvents");r.initMouseEvent("click",!0,!0,t.window,0,0,0,0,0,!1,!1,!1,!1,0,null),ue(n,r)},ce=function(t,e){return t.dom.getParent(e,"a[href]")},se=function(t){return ce(t,t.selection.getStart())},le=function(t){return!0===t.altKey&&!1===t.shiftKey&&!1===t.ctrlKey&&!1===t.metaKey},fe=function(t,e){if(e){var n=ot(e);if(/^#/.test(n)){var r=t.$(n);r.length&&t.selection.scrollIntoView(r[0],!0)}else ae(e.href)}},de=function(t){return function(){ie(t)}},me=function(t){return function(){fe(t,se(t))}},ge=function(t){t.on("click",(function(e){var r=ce(t,e.target);r&&n.metaKeyPressed(e)&&(e.preventDefault(),fe(t,r))})),t.on("keydown",(function(e){var n=se(t);n&&13===e.keyCode&&le(e)&&(e.preventDefault(),fe(t,n))}))},he=function(t){return function(e){var n=function(n){return e.setActive(!t.mode.isReadOnly()&&!!at(t,n.element))};return t.on("NodeChange",n),function(){return t.off("NodeChange",n)}}},pe=function(t){return function(e){var n=t.dom.getParents(t.selection.getStart());e.setDisabled(!lt(n));var r=function(t){return e.setDisabled(!lt(t.parents))};return t.on("NodeChange",r),function(){return t.off("NodeChange",r)}}},ve=function(t){t.addCommand("mceLink",(function(){x(t)?t.fire("contexttoolbar-show",{toolbarKey:"quicklink"}):de(t)()}))},be=function(t){t.addShortcut("Meta+K","",(function(){t.execCommand("mceLink")}))},ye=function(t){t.ui.registry.addToggleButton("link",{icon:"link",tooltip:"Insert/edit link",onAction:de(t),onSetup:he(t)}),t.ui.registry.addButton("openlink",{icon:"new-tab",tooltip:"Open link",onAction:me(t),onSetup:pe(t)}),t.ui.registry.addButton("unlink",{icon:"unlink",tooltip:"Remove link",onAction:function(){return Ct(t)},onSetup:pe(t)})},we=function(t){t.ui.registry.addMenuItem("openlink",{text:"Open link",icon:"new-tab",onAction:me(t),onSetup:pe(t)}),t.ui.registry.addMenuItem("link",{icon:"link",text:"Link...",shortcut:"Meta+K",onAction:de(t)}),t.ui.registry.addMenuItem("unlink",{icon:"unlink",text:"Remove link",onAction:function(){return Ct(t)},onSetup:pe(t)})},xe=function(t){var e="link unlink openlink",n="link";t.ui.registry.addContextMenu("link",{update:function(r){return lt(t.dom.getParents(r,"a"))?e:n}})},Ce=function(t){var e=function(t){t.selection.collapse(!1)},n=function(e){var n=t.selection.getNode();return e.setDisabled(!at(t,n)),function(){}};t.ui.registry.addContextForm("quicklink",{launch:{type:"contextformtogglebutton",icon:"link",tooltip:"Link",onSetup:he(t)},label:"Link",predicate:function(e){return!!at(t,e)&&m(t)},initValue:function(){var e=at(t);return e?ot(e):""},commands:[{type:"contextformtogglebutton",icon:"link",tooltip:"Link",primary:!0,onSetup:function(e){var n=t.selection.getNode();return e.setActive(!!at(t,n)),he(t)(e)},onAction:function(n){var r=at(t),o=n.getValue();if(r)t.undoManager.transact((function(){t.dom.setAttrib(r,"href",o),e(t),n.hide()}));else{var i={href:o,attach:function(){}},u=ft(t.selection.getContent()),a=u?N.some(ct(t.selection,r)).filter((function(t){return t.length>0})).or(N.from(o)):N.none();xt(t,i,{href:o,text:a,title:N.none(),rel:N.none(),target:N.none(),class:N.none()}),n.hide()}}},{type:"contextformbutton",icon:"unlink",tooltip:"Remove link",onSetup:n,onAction:function(e){Ct(t),e.hide()}},{type:"contextformbutton",icon:"new-tab",tooltip:"Open link",onSetup:n,onAction:function(e){me(t)(),e.hide()}}]})};function Se(){e.add("link",(function(t){ye(t),we(t),xe(t),Ce(t),ge(t),ve(t),be(t)}))}Se()})(window)},cdd9:function(t,e){(function(t){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(){},r=function(t){return function(){return t}},o=r(!1),i=r(!0),u=function(){return a},a=function(){var t=function(t){return t.isNone()},e=function(t){return t()},a=function(t){return t},c={fold:function(t,e){return t()},is:o,isSome:o,isNone:i,getOr:a,getOrThunk:e,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:r(null),getOrUndefined:r(void 0),or:a,orThunk:e,map:u,each:n,bind:u,exists:o,forall:i,filter:u,equals:t,equals_:t,toArray:function(){return[]},toString:r("none()")};return c}(),c=function(t){var e=r(t),n=function(){return s},u=function(e){return e(t)},s={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:i,isNone:o,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return c(e(t))},each:function(e){e(t)},bind:u,exists:u,forall:u,filter:function(e){return e(t)?s:a},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(o,(function(e){return n(t,e)}))}};return s},s=function(t){return null===t||void 0===t?a:c(t)},l={some:c,none:u,from:s},f=function(t){var e=typeof t;return null===t?"null":"object"===e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e},d=function(t){return function(e){return f(e)===t}},m=function(t){return function(e){return typeof e===t}},g=function(t){return function(e){return t===e}},h=d("string"),p=d("object"),v=d("array"),b=g(null),y=m("boolean"),w=m("number"),x=Array.prototype.push,C=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!v(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);x.apply(e,t[n])}return e},S=function(t){return 0===t.length?l.none():l.some(t[0])},k=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return l.none()},O=Object.prototype.hasOwnProperty,T=function(t,e){var n=p(t)&&p(e);return n?_(t,e):e},E=function(t){return function(){for(var e=new Array(arguments.length),n=0;n<e.length;n++)e[n]=arguments[n];if(0===e.length)throw new Error("Can't merge zero objects");for(var r={},o=0;o<e.length;o++){var i=e[o];for(var u in i)O.call(i,u)&&(r[u]=t(r[u],i[u]))}return r}},_=E(T),A=function(){return A=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n],e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},A.apply(this,arguments)},D=("undefined"!==typeof t.window?t.window:Function("return this;")(),function(e,n,r){if(!(h(r)||y(r)||w(r)))throw t.console.error("Invalid call to Attr.set. Key ",n,":: Value ",r,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(n,r+"")}),N=function(t,e,n){D(t.dom(),e,n)},R=function(t,e){t.dom().removeAttribute(e)},M=function(e,n){var r=n||t.document,o=r.createElement("div");if(o.innerHTML=e,!o.hasChildNodes()||o.childNodes.length>1)throw t.console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return P(o.childNodes[0])},z=function(e,n){var r=n||t.document,o=r.createElement(e);return P(o)},B=function(e,n){var r=n||t.document,o=r.createTextNode(e);return P(o)},P=function(t){if(null===t||void 0===t)throw new Error("Node cannot be null or undefined");return{dom:r(t)}},H=function(t,e,n){var r=t.dom();return l.from(r.elementFromPoint(e,n)).map(P)},I={fromHtml:M,fromTag:z,fromText:B,fromDom:P,fromPoint:H},L=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),F=tinymce.util.Tools.resolve("tinymce.util.Promise"),V=tinymce.util.Tools.resolve("tinymce.util.XHR"),U=function(t){return t.getParam("image_dimensions",!0,"boolean")},j=function(t){return t.getParam("image_advtab",!1,"boolean")},W=function(t){return t.getParam("image_uploadtab",!0,"boolean")},q=function(t){return t.getParam("image_prepend_url","","string")},$=function(t){return t.getParam("image_class_list")},G=function(t){return t.getParam("image_description",!0,"boolean")},K=function(t){return t.getParam("image_title",!1,"boolean")},X=function(t){return t.getParam("image_caption",!1,"boolean")},Y=function(t){return t.getParam("image_list",!1)},J=function(t){return!!Z(t)},Q=function(t){return!!tt(t)},Z=function(t){return t.getParam("images_upload_url","","string")},tt=function(t){return t.getParam("images_upload_handler",void 0,"function")},et=function(t){return t.getParam("images_upload_base_path",void 0,"string")},nt=function(t){return t.getParam("images_upload_credentials",!1,"boolean")},rt=function(t){return t.getParam("a11y_advanced_options",!1,"boolean")},ot=function(t){return t.getParam("automatic_uploads",!0,"boolean")},it=function(t,e){return Math.max(parseInt(t,10),parseInt(e,10))},ut=function(e){return new F((function(n){var r=t.document.createElement("img"),o=function(t){r.parentNode&&r.parentNode.removeChild(r),n(t)};r.onload=function(){var t=it(r.width,r.clientWidth),e=it(r.height,r.clientHeight),n={width:t,height:e};o(F.resolve(n))},r.onerror=function(){o(F.reject("Failed to get image dimensions for: "+e))};var i=r.style;i.visibility="hidden",i.position="fixed",i.bottom=i.left="0px",i.width=i.height="auto",t.document.body.appendChild(r),r.src=e}))},at=function(t){return t&&(t=t.replace(/px$/,"")),t},ct=function(t){return t.length>0&&/^[0-9]+$/.test(t)&&(t+="px"),t},st=function(t){if(t.margin){var e=String(t.margin).split(" ");switch(e.length){case 1:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[0],t["margin-bottom"]=t["margin-bottom"]||e[0],t["margin-left"]=t["margin-left"]||e[0];break;case 2:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[1],t["margin-bottom"]=t["margin-bottom"]||e[0],t["margin-left"]=t["margin-left"]||e[1];break;case 3:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[1],t["margin-bottom"]=t["margin-bottom"]||e[2],t["margin-left"]=t["margin-left"]||e[1];break;case 4:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[1],t["margin-bottom"]=t["margin-bottom"]||e[2],t["margin-left"]=t["margin-left"]||e[3]}delete t.margin}return t},lt=function(t,e){var n=Y(t);"string"===typeof n?V.send({url:n,success:function(t){e(JSON.parse(t))}}):"function"===typeof n?n(e):e(n)},ft=function(t,e,n){var r=function(){n.onload=n.onerror=null,t.selection&&(t.selection.select(n),t.nodeChanged())};n.onload=function(){e.width||e.height||!U(t)||t.dom.setAttribs(n,{width:String(n.clientWidth),height:String(n.clientHeight)}),r()},n.onerror=r},dt=function(e){return new F((function(n,r){var o=new t.FileReader;o.onload=function(){n(o.result)},o.onerror=function(){r(o.error.message)},o.readAsDataURL(e)}))},mt=function(t){return"IMG"===t.nodeName&&(t.hasAttribute("data-mce-object")||t.hasAttribute("data-mce-placeholder"))},gt=L.DOM,ht=function(t){return t.style.marginLeft&&t.style.marginRight&&t.style.marginLeft===t.style.marginRight?at(t.style.marginLeft):""},pt=function(t){return t.style.marginTop&&t.style.marginBottom&&t.style.marginTop===t.style.marginBottom?at(t.style.marginTop):""},vt=function(t){return t.style.borderWidth?at(t.style.borderWidth):""},bt=function(t,e){return t.hasAttribute(e)?t.getAttribute(e):""},yt=function(t,e){return t.style[e]?t.style[e]:""},wt=function(t){return null!==t.parentNode&&"FIGURE"===t.parentNode.nodeName},xt=function(t,e,n){""===n?t.removeAttribute(e):t.setAttribute(e,n)},Ct=function(t){var e=gt.create("figure",{class:"image"});gt.insertAfter(e,t),e.appendChild(t),e.appendChild(gt.create("figcaption",{contentEditable:"true"},"Caption")),e.contentEditable="false"},St=function(t){var e=t.parentNode;gt.insertAfter(t,e),gt.remove(e)},kt=function(t){wt(t)?St(t):Ct(t)},Ot=function(t,e){var n=t.getAttribute("style"),r=e(null!==n?n:"");r.length>0?(t.setAttribute("style",r),t.setAttribute("data-mce-style",r)):t.removeAttribute("style")},Tt=function(t,e){return function(t,n,r){t.style[n]?(t.style[n]=ct(r),Ot(t,e)):xt(t,n,r)}},Et=function(t,e){return t.style[e]?at(t.style[e]):bt(t,e)},_t=function(t,e){var n=ct(e);t.style.marginLeft=n,t.style.marginRight=n},At=function(t,e){var n=ct(e);t.style.marginTop=n,t.style.marginBottom=n},Dt=function(t,e){var n=ct(e);t.style.borderWidth=n},Nt=function(t,e){t.style.borderStyle=e},Rt=function(t){return yt(t,"borderStyle")},Mt=function(t){return"FIGURE"===t.nodeName},zt=function(t){return"IMG"===t.nodeName},Bt=function(t){return 0===gt.getAttrib(t,"alt").length&&"presentation"===gt.getAttrib(t,"role")},Pt=function(t){return Bt(t)?"":bt(t,"alt")},Ht=function(){return{src:"",alt:"",title:"",width:"",height:"",class:"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:"",isDecorative:!1}},It=function(e,n){var r=t.document.createElement("img");return xt(r,"style",n.style),(ht(r)||""!==n.hspace)&&_t(r,n.hspace),(pt(r)||""!==n.vspace)&&At(r,n.vspace),(vt(r)||""!==n.border)&&Dt(r,n.border),(Rt(r)||""!==n.borderStyle)&&Nt(r,n.borderStyle),e(r.getAttribute("style"))},Lt=function(e,n){var r=t.document.createElement("img");if(qt(e,A(A({},n),{caption:!1}),r),Ut(r,n.alt,n.isDecorative),n.caption){var o=gt.create("figure",{class:"image"});return o.appendChild(r),o.appendChild(gt.create("figcaption",{contentEditable:"true"},"Caption")),o.contentEditable="false",o}return r},Ft=function(t,e){return{src:bt(e,"src"),alt:Pt(e),title:bt(e,"title"),width:Et(e,"width"),height:Et(e,"height"),class:bt(e,"class"),style:t(bt(e,"style")),caption:wt(e),hspace:ht(e),vspace:pt(e),border:vt(e),borderStyle:yt(e,"borderStyle"),isDecorative:Bt(e)}},Vt=function(t,e,n,r,o){n[r]!==e[r]&&o(t,r,n[r])},Ut=function(t,e,n){if(n){gt.setAttrib(t,"role","presentation");var r=I.fromDom(t);N(r,"alt","")}else{if(b(e)){r=I.fromDom(t);R(r,"alt")}else{r=I.fromDom(t);N(r,"alt",e)}"presentation"===gt.getAttrib(t,"role")&>.setAttrib(t,"role","")}},jt=function(t,e,n){n.alt===e.alt&&n.isDecorative===e.isDecorative||Ut(t,n.alt,n.isDecorative)},Wt=function(t,e){return function(n,r,o){t(n,o),Ot(n,e)}},qt=function(t,e,n){var r=Ft(t,n);Vt(n,r,e,"caption",(function(t,e,n){return kt(t)})),Vt(n,r,e,"src",xt),Vt(n,r,e,"title",xt),Vt(n,r,e,"width",Tt("width",t)),Vt(n,r,e,"height",Tt("height",t)),Vt(n,r,e,"class",xt),Vt(n,r,e,"style",Wt((function(t,e){return xt(t,"style",e)}),t)),Vt(n,r,e,"hspace",Wt(_t,t)),Vt(n,r,e,"vspace",Wt(At,t)),Vt(n,r,e,"border",Wt(Dt,t)),Vt(n,r,e,"borderStyle",Wt(Nt,t)),jt(n,r,e)},$t=function(t,e){var n=t.dom.styles.parse(e),r=st(n),o=t.dom.styles.parse(t.dom.styles.serialize(r));return t.dom.styles.serialize(o)},Gt=function(t){var e=t.selection.getNode(),n=t.dom.getParent(e,"figure.image");return n?t.dom.select("img",n)[0]:e&&("IMG"!==e.nodeName||mt(e))?null:e},Kt=function(t,e){var n=t.dom,r=n.getParent(e.parentNode,(function(e){return!!t.schema.getTextBlockElements()[e.nodeName]}),t.getBody());return r?n.split(r,e):e},Xt=function(t){var e=Gt(t);return e?Ft((function(e){return $t(t,e)}),e):Ht()},Yt=function(t,e){var n=Lt((function(e){return $t(t,e)}),e);t.dom.setAttrib(n,"data-mce-id","__mcenew"),t.focus(),t.selection.setContent(n.outerHTML);var r=t.dom.select('*[data-mce-id="__mcenew"]')[0];if(t.dom.setAttrib(r,"data-mce-id",null),Mt(r)){var o=Kt(t,r);t.selection.select(o)}else t.selection.select(r)},Jt=function(t,e){t.dom.setAttrib(e,"src",e.getAttribute("src"))},Qt=function(t,e){if(e){var n=t.dom.is(e.parentNode,"figure.image")?e.parentNode:e;t.dom.remove(n),t.focus(),t.nodeChanged(),t.dom.isEmpty(t.getBody())&&(t.setContent(""),t.selection.setCursorLocation())}},Zt=function(t,e){var n=Gt(t);if(qt((function(e){return $t(t,e)}),e,n),Jt(t,n),Mt(n.parentNode)){var r=n.parentNode;Kt(t,r),t.selection.select(n.parentNode)}else t.selection.select(n),ft(t,e,n)},te=function(t,e){var n=Gt(t);if(n){var r=Ft((function(e){return $t(t,e)}),n),o=A(A({},r),e);o.src?Zt(t,o):Qt(t,n)}else e.src&&Yt(t,A(A({},Ht()),e))},ee=tinymce.util.Tools.resolve("tinymce.util.Tools"),ne=function(t){return h(t.value)?t.value:""},re=function(t,e){var n=[];return ee.each(t,(function(t){var r=h(t.text)?t.text:h(t.title)?t.title:"";if(void 0!==t.menu){var o=re(t.menu,e);n.push({text:r,items:o})}else{var i=e(t);n.push({text:r,value:i})}})),n},oe=function(t){return void 0===t&&(t=ne),function(e){return e?l.from(e).map((function(e){return re(e,t)})):l.none()}},ie=function(t){return oe(ne)(t)},ue=function(t){return Object.prototype.hasOwnProperty.call(t,"items")},ae=function(t,e){return k(t,(function(t){return ue(t)?ae(t.items,e):t.value===e?l.some(t):l.none()}))},ce=function(t,e){return t.bind((function(t){return ae(t,e)}))},se={sanitizer:oe,sanitize:ie,findEntry:ce},le=function(t,e){return t?t.replace(/\/$/,"")+"/"+e.replace(/^\//,""):e};function fe(e){var r=function(n,r,o,i){var u=new t.XMLHttpRequest;u.open("POST",e.url),u.withCredentials=e.credentials,u.upload.onprogress=function(t){i(t.loaded/t.total*100)},u.onerror=function(){o("Image upload failed due to a XHR Transport error. Code: "+u.status)},u.onload=function(){if(u.status<200||u.status>=300)o("HTTP Error: "+u.status);else{var t=JSON.parse(u.responseText);t&&"string"===typeof t.location?r(le(e.basePath,t.location)):o("Invalid JSON: "+u.responseText)}};var a=new t.FormData;a.append("file",n.blob(),n.filename()),u.send(a)},o=function(t,e){return new F((function(r,o){try{e(t,r,o,n)}catch(i){o(i.message)}}))},i=function(t){return t===r},u=function(t){return!e.url&&i(e.handler)?F.reject("Upload url missing from the settings."):o(t,e.handler)};return e=ee.extend({credentials:!1,handler:r},e),{upload:u}}var de=function(t){return{title:"Advanced",name:"advanced",items:[{type:"input",label:"Style",name:"style"},{type:"grid",columns:2,items:[{type:"input",label:"Vertical space",name:"vspace",inputMode:"numeric"},{type:"input",label:"Horizontal space",name:"hspace",inputMode:"numeric"},{type:"input",label:"Border width",name:"border",inputMode:"numeric"},{type:"selectbox",name:"borderstyle",label:"Border style",items:[{text:"Select...",value:""},{text:"Solid",value:"solid"},{text:"Dotted",value:"dotted"},{text:"Dashed",value:"dashed"},{text:"Double",value:"double"},{text:"Groove",value:"groove"},{text:"Ridge",value:"ridge"},{text:"Inset",value:"inset"},{text:"Outset",value:"outset"},{text:"None",value:"none"},{text:"Hidden",value:"hidden"}]}]}]}},me={makeTab:de},ge=function(t){var e=se.sanitizer((function(e){return t.convertURL(e.value||e.url,"src")})),n=new F((function(n){lt(t,(function(t){n(e(t).map((function(t){return C([[{text:"None",value:""}],t])})))}))})),r=se.sanitize($(t)),o=j(t),i=W(t),u=J(t),a=Q(t),c=Xt(t),s=G(t),f=K(t),d=U(t),m=X(t),g=rt(t),p=Z(t),v=et(t),b=nt(t),y=tt(t),w=ot(t),x=l.some(q(t)).filter((function(t){return h(t)&&t.length>0}));return n.then((function(t){return{image:c,imageList:t,classList:r,hasAdvTab:o,hasUploadTab:i,hasUploadUrl:u,hasUploadHandler:a,hasDescription:s,hasImageTitle:f,hasDimensions:d,hasImageCaption:m,url:p,basePath:v,credentials:b,handler:y,prependURL:x,hasAccessibilityOptions:g,automaticUploads:w}}))},he=function(t){var e={name:"src",type:"urlinput",filetype:"image",label:"Source"},n=t.imageList.map((function(t){return{name:"images",type:"selectbox",label:"Image list",items:t}})),r={name:"alt",type:"input",label:"Alternative description",disabled:t.hasAccessibilityOptions&&t.image.isDecorative},o={name:"title",type:"input",label:"Image title"},i={name:"dimensions",type:"sizeinput"},u={type:"label",label:"Accessibility",items:[{name:"isDecorative",type:"checkbox",label:"Image is decorative"}]},a=t.classList.map((function(t){return{name:"classes",type:"selectbox",label:"Class",items:t}})),c={type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]};return C([[e],n.toArray(),t.hasAccessibilityOptions&&t.hasDescription?[u]:[],t.hasDescription?[r]:[],t.hasImageTitle?[o]:[],t.hasDimensions?[i]:[],[{type:"grid",columns:2,items:C([a.toArray(),t.hasImageCaption?[c]:[]])}]])},pe=function(t){return{title:"General",name:"general",items:he(t)}},ve={makeTab:pe,makeItems:he},be=function(t){var e=[{type:"dropzone",name:"fileinput"}];return{title:"Upload",name:"upload",items:e}},ye={makeTab:be},we=function(t){return{prevImage:se.findEntry(t.imageList,t.image.src),prevAlt:t.image.alt,open:!0}},xe=function(t){return{src:{value:t.src,meta:{}},images:t.src,alt:t.alt,title:t.title,dimensions:{width:t.width,height:t.height},classes:t.class,caption:t.caption,style:t.style,vspace:t.vspace,border:t.border,hspace:t.hspace,borderstyle:t.borderStyle,fileinput:[],isDecorative:t.isDecorative}},Ce=function(t,e){return{src:t.src.value,alt:0===t.alt.length&&e?null:t.alt,title:t.title,width:t.dimensions.width,height:t.dimensions.height,class:t.classes,style:t.style,caption:t.caption,hspace:t.hspace,vspace:t.vspace,border:t.border,borderStyle:t.borderstyle,isDecorative:t.isDecorative}},Se=function(t,e){return/^(?:[a-zA-Z]+:)?\/\//.test(e)?l.none():t.prependURL.bind((function(t){return e.substring(0,t.length)!==t?l.some(t+e):l.none()}))},ke=function(t,e){var n=e.getData();Se(t,n.src.value).each((function(t){e.setData({src:{value:t,meta:n.src.meta}})}))},Oe=function(t,e,n){t.hasDescription&&h(n.alt)&&(e.alt=n.alt),t.hasAccessibilityOptions&&(e.isDecorative=n.isDecorative||e.isDecorative||!1),t.hasImageTitle&&h(n.title)&&(e.title=n.title),t.hasDimensions&&(h(n.width)&&(e.dimensions.width=n.width),h(n.height)&&(e.dimensions.height=n.height)),h(n.class)&&se.findEntry(t.classList,n.class).each((function(t){e.classes=t.value})),t.hasImageCaption&&y(n.caption)&&(e.caption=n.caption),t.hasAdvTab&&(h(n.style)&&(e.style=n.style),h(n.vspace)&&(e.vspace=n.vspace),h(n.border)&&(e.border=n.border),h(n.hspace)&&(e.hspace=n.hspace),h(n.borderstyle)&&(e.borderstyle=n.borderstyle))},Te=function(t,e){var n=e.getData(),r=n.src.meta;if(void 0!==r){var o=_({},n);Oe(t,o,r),e.setData(o)}},Ee=function(t,e,n,r){var o=r.getData(),i=o.src.value,u=o.src.meta||{};u.width||u.height||!e.hasDimensions||t.imageSize(i).then((function(t){n.open&&r.setData({dimensions:t})}))},_e=function(t,e,n){var r=n.getData(),o=se.findEntry(t.imageList,r.src.value);e.prevImage=o,n.setData({images:o.map((function(t){return t.value})).getOr("")})},Ae=function(t,e,n,r){ke(e,r),Te(e,r),Ee(t,e,n,r),_e(e,n,r)},De=function(t,e,n,r){var o=r.getData(),i=se.findEntry(e.imageList,o.images);i.each((function(t){var e=""===o.alt||n.prevImage.map((function(t){return t.text===o.alt})).getOr(!1);e?""===t.value?r.setData({src:t,alt:n.prevAlt}):r.setData({src:t,alt:t.text}):r.setData({src:t})})),n.prevImage=i,Ae(t,e,n,r)},Ne=function(t){var e=t["margin-top"]&&t["margin-bottom"]&&t["margin-top"]===t["margin-bottom"];return e?at(String(t["margin-top"])):""},Re=function(t){var e=t["margin-right"]&&t["margin-left"]&&t["margin-right"]===t["margin-left"];return e?at(String(t["margin-right"])):""},Me=function(t){return t["border-width"]?at(String(t["border-width"])):""},ze=function(t){return t["border-style"]?String(t["border-style"]):""},Be=function(t,e,n){return e(t(e(n)))},Pe=function(t,e,n){var r=st(t(n.style)),o=_({},n);return o.vspace=Ne(r),o.hspace=Re(r),o.border=Me(r),o.borderstyle=ze(r),o.style=Be(t,e,r),o},He=function(t,e){var n=e.getData(),r=Pe(t.parseStyle,t.serializeStyle,n);e.setData(r)},Ie=function(t,e,n){var r=_(xe(e.image),n.getData()),o=It(t.normalizeCss,Ce(r,!1));n.setData({style:o})},Le=function(e,n,r,o){var i=o.getData();o.block("Uploading image"),S(i.fileinput).fold((function(){o.unblock()}),(function(i){var u=t.URL.createObjectURL(i),a=fe({url:n.url,basePath:n.basePath,credentials:n.credentials,handler:n.handler}),c=function(){o.unblock(),t.URL.revokeObjectURL(u)},s=function(t){o.setData({src:{value:t,meta:{}}}),o.showTab("general"),Ae(e,n,r,o)};dt(i).then((function(t){var r=e.createBlobCache(i,u,t);n.automaticUploads?a.upload(r).then((function(t){s(t),c()})).catch((function(t){c(),e.alertErr(t)})):(e.addToBlobCache(r),s(r.blobUri()),o.unblock())}))}))},Fe=function(t,e,n){return function(r,o){"src"===o.name?Ae(t,e,n,r):"images"===o.name?De(t,e,n,r):"alt"===o.name?n.prevAlt=r.getData().alt:"style"===o.name?He(t,r):"vspace"===o.name||"hspace"===o.name||"border"===o.name||"borderstyle"===o.name?Ie(t,e,r):"fileinput"===o.name?Le(t,e,n,r):"isDecorative"===o.name&&(r.getData().isDecorative?r.disable("alt"):r.enable("alt"))}},Ve=function(t){return function(){t.open=!1}},Ue=function(t){if(t.hasAdvTab||t.hasUploadUrl||t.hasUploadHandler){var e={type:"tabpanel",tabs:C([[ve.makeTab(t)],t.hasAdvTab?[me.makeTab(t)]:[],t.hasUploadTab&&(t.hasUploadUrl||t.hasUploadHandler)?[ye.makeTab(t)]:[]])};return e}var n={type:"panel",items:ve.makeItems(t)};return n},je=function(t){return function(e){var n=we(e);return{title:"Insert/Edit Image",size:"normal",body:Ue(e),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:xe(e.image),onSubmit:t.onSubmit(e),onChange:Fe(t,e,n),onClose:Ve(n)}}},We=function(t){return function(e){return function(n){var r=_(xe(e.image),n.getData());t.execCommand("mceUpdateImage",!1,Ce(r,e.hasAccessibilityOptions)),t.editorUpload.uploadImagesAuto(),n.close()}}},qe=function(t){return function(e){return ut(t.documentBaseURI.toAbsolute(e)).then((function(t){return{width:String(t.width),height:String(t.height)}}))}},$e=function(t){return function(e,n,r){return t.editorUpload.blobCache.create({blob:e,blobUri:n,name:e.name?e.name.replace(/\.[^\.]+$/,""):null,base64:r.split(",")[1]})}},Ge=function(t){return function(e){t.editorUpload.blobCache.add(e)}},Ke=function(t){return function(e){t.windowManager.alert(e)}},Xe=function(t){return function(e){return $t(t,e)}},Ye=function(t){return function(e){return t.dom.parseStyle(e)}},Je=function(t){return function(e,n){return t.dom.serializeStyle(e,n)}},Qe=function(t){var e={onSubmit:We(t),imageSize:qe(t),addToBlobCache:Ge(t),createBlobCache:$e(t),alertErr:Ke(t),normalizeCss:Xe(t),parseStyle:Ye(t),serializeStyle:Je(t)},n=function(){return ge(t).then(je(e)).then((function(e){return t.windowManager.open(e)}))},r=function(){n()};return{open:n,openLater:r}},Ze=function(t){t.addCommand("mceImage",Qe(t).openLater),t.addCommand("mceUpdateImage",(function(e,n){t.undoManager.transact((function(){return te(t,n)}))}))},tn=function(t){var e=t.attr("class");return e&&/\bimage\b/.test(e)},en=function(t){return function(e){var n=e.length,r=function(e){e.attr("contenteditable",t?"true":null)};while(n--){var o=e[n];tn(o)&&(o.attr("contenteditable",t?"false":null),ee.each(o.getAll("figcaption"),r))}}},nn=function(t){t.on("PreInit",(function(){t.parser.addNodeFilter("figure",en(!0)),t.serializer.addNodeFilter("figure",en(!1))}))},rn=function(t){t.ui.registry.addToggleButton("image",{icon:"image",tooltip:"Insert/edit image",onAction:Qe(t).openLater,onSetup:function(e){return t.selection.selectorChangedWithUnbind("img:not([data-mce-object],[data-mce-placeholder]),figure.image",e.setActive).unbind}}),t.ui.registry.addMenuItem("image",{icon:"image",text:"Image...",onAction:Qe(t).openLater}),t.ui.registry.addContextMenu("image",{update:function(t){return Mt(t)||zt(t)&&!mt(t)?["image"]:[]}})};function on(){e.add("image",(function(t){nn(t),rn(t),Ze(t)}))}on()})(window)},e562:function(t,e,n){(function(e){(function(n){"use strict";var r=function(t){if(null===t)return"null";if(void 0===t)return"undefined";var e=typeof t;return"object"===e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e},o=function(t){return-1!==["undefined","boolean","number","string","function","xml","null"].indexOf(t)},i=function(t,e){var n=Array.prototype.slice.call(t);return n.sort(e)},u=function(t,e){return a((function(n,r){return t.eq(e(n),e(r))}))},a=function(t){return{eq:t}},c=a((function(t,e){return t===e})),s=c,l=function(t){return a((function(e,n){if(e.length!==n.length)return!1;for(var r=e.length,o=0;o<r;o++)if(!t.eq(e[o],n[o]))return!1;return!0}))},f=function(t,e){return u(l(t),(function(t){return i(t,e)}))},d=function(t){return a((function(e,n){var r=Object.keys(e),o=Object.keys(n);if(!f(s).eq(r,o))return!1;for(var i=r.length,u=0;u<i;u++){var a=r[u];if(!t.eq(e[a],n[a]))return!1}return!0}))},m=a((function(t,e){if(t===e)return!0;var n=r(t),i=r(e);return n===i&&(o(n)?t===e:"array"===n?l(m).eq(t,e):"object"===n&&d(m).eq(t,e))})),g=function(){},h=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t(e.apply(null,n))}},p=function(t,e){return function(n){return t(e(n))}},v=function(t){return function(){return t}},b=function(t){return t};function y(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.concat(n);return t.apply(null,o)}}var w=function(t){return function(e){return!t(e)}},x=function(t){return function(){throw new Error(t)}},C=v(!1),S=v(!0),k=function(){return O},O=function(){var t=function(t){return t.isNone()},e=function(t){return t()},n=function(t){return t},r={fold:function(t,e){return t()},is:C,isSome:C,isNone:S,getOr:n,getOrThunk:e,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:v(null),getOrUndefined:v(void 0),or:n,orThunk:e,map:k,each:g,bind:k,exists:C,forall:S,filter:k,equals:t,equals_:t,toArray:function(){return[]},toString:v("none()")};return r}(),T=function(t){var e=v(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:S,isNone:C,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return T(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:O},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(C,(function(e){return n(t,e)}))}};return o},E=function(t){return null===t||void 0===t?O:T(t)},_={some:T,none:k,from:E},A=function(t){var e=typeof t;return null===t?"null":"object"===e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e},D=function(t){return function(e){return A(e)===t}},N=function(t){return function(e){return typeof e===t}},R=function(t){return function(e){return t===e}},M=D("string"),z=D("object"),B=D("array"),P=R(null),H=N("boolean"),I=R(void 0),L=N("function"),F=N("number"),V=Array.prototype.slice,U=Array.prototype.indexOf,j=Array.prototype.push,W=function(t,e){return U.call(t,e)},q=function(t,e){var n=W(t,e);return-1===n?_.none():_.some(n)},$=function(t,e){return W(t,e)>-1},G=function(t,e){for(var n=0,r=t.length;n<r;n++){var o=t[n];if(e(o,n))return!0}return!1},K=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},X=function(t,e){for(var n=0,r=t.length;n<r;n++){var o=t[n];e(o,n)}},Y=function(t,e){for(var n=t.length-1;n>=0;n--){var r=t[n];e(r,n)}},J=function(t,e){for(var n=[],r=[],o=0,i=t.length;o<i;o++){var u=t[o],a=e(u,o)?n:r;a.push(u)}return{pass:n,fail:r}},Q=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},Z=function(t,e,n){return Y(t,(function(t){n=e(n,t)})),n},tt=function(t,e,n){return X(t,(function(t){n=e(n,t)})),n},et=function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return _.some(i);if(n(i,r))break}return _.none()},nt=function(t,e){return et(t,e,C)},rt=function(t,e){for(var n=0,r=t.length;n<r;n++){var o=t[n];if(e(o,n))return _.some(n)}return _.none()},ot=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!B(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);j.apply(e,t[n])}return e},it=function(t,e){return ot(K(t,e))},ut=function(t,e){for(var n=0,r=t.length;n<r;++n){var o=t[n];if(!0!==e(o,n))return!1}return!0},at=function(t){var e=V.call(t,0);return e.reverse(),e},ct=function(t,e){return Q(t,(function(t){return!$(e,t)}))},st=function(t,e){for(var n={},r=0,o=t.length;r<o;r++){var i=t[r];n[String(i)]=e(i,r)}return n},lt=function(t,e){var n=V.call(t,0);return n.sort(e),n},ft=function(t){return 0===t.length?_.none():_.some(t[0])},dt=function(t){return 0===t.length?_.none():_.some(t[t.length-1])},mt=L(Array.from)?Array.from:function(t){return V.call(t)},gt=Object.keys,ht=Object.hasOwnProperty,pt=function(t,e){for(var n=gt(t),r=0,o=n.length;r<o;r++){var i=n[r],u=t[i];e(u,i)}},vt=function(t,e){return bt(t,(function(t,n){return{k:n,v:e(t,n)}}))},bt=function(t,e){var n={};return pt(t,(function(t,r){var o=e(t,r);n[o.k]=o.v})),n},yt=function(t){return function(e,n){t[n]=e}},wt=function(t,e,n,r){var o={};return pt(t,(function(t,o){(e(t,o)?n:r)(t,o)})),o},xt=function(t,e){var n={},r={};return wt(t,e,yt(n),yt(r)),{t:n,f:r}},Ct=function(t,e){var n={};return wt(t,e,yt(n),g),n},St=function(t,e){var n=[];return pt(t,(function(t,r){n.push(e(t,r))})),n},kt=function(t){return St(t,(function(t){return t}))},Ot=function(t,e){return Tt(t,e)?_.from(t[e]):_.none()},Tt=function(t,e){return ht.call(t,e)},Et=function(t,e,n){return void 0===n&&(n=m),d(n).eq(t,e)},_t=Array.isArray,At=function(t){var e,n,r=t;if(!_t(t))for(r=[],e=0,n=t.length;e<n;e++)r[e]=t[e];return r},Dt=function(t,e,n){var r,o;if(!t)return 0;if(n=n||t,void 0!==t.length){for(r=0,o=t.length;r<o;r++)if(!1===e.call(n,t[r],r,t))return 0}else for(r in t)if(t.hasOwnProperty(r)&&!1===e.call(n,t[r],r,t))return 0;return 1},Nt=function(t,e){var n=[];return Dt(t,(function(r,o){n.push(e(r,o,t))})),n},Rt=function(t,e){var n=[];return Dt(t,(function(r,o){e&&!e(r,o,t)||n.push(r)})),n},Mt=function(t,e){var n,r;if(t)for(n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1},zt=function(t,e,n,r){var o=0;for(arguments.length<3&&(n=t[0]);o<t.length;o++)n=e.call(r,n,t[o],o);return n},Bt=function(t,e,n){var r,o;for(r=0,o=t.length;r<o;r++)if(e.call(n,t[r],r,t))return r;return-1},Pt=function(t){return t[t.length-1]},Ht=function(){return Ht=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n],e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Ht.apply(this,arguments)};function It(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}function Lt(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],u=0,a=i.length;u<a;u++,o++)r[o]=i[u];return r}var Ft=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}},Vt=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}},Ut=function(t,e){var n=Vt(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return qt(r(1),r(2))},jt=function(t,e){var n=String(e).toLowerCase();return 0===t.length?Wt():Ut(t,n)},Wt=function(){return qt(0,0)},qt=function(t,e){return{major:t,minor:e}},$t={nu:qt,detect:jt,unknown:Wt},Gt="Edge",Kt="Chrome",Xt="IE",Yt="Opera",Jt="Firefox",Qt="Safari",Zt=function(){return te({current:void 0,version:$t.unknown()})},te=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r(Gt),isChrome:r(Kt),isIE:r(Xt),isOpera:r(Yt),isFirefox:r(Jt),isSafari:r(Qt)}},ee={unknown:Zt,nu:te,edge:v(Gt),chrome:v(Kt),ie:v(Xt),opera:v(Yt),firefox:v(Jt),safari:v(Qt)},ne="Windows",re="iOS",oe="Android",ie="Linux",ue="OSX",ae="Solaris",ce="FreeBSD",se="ChromeOS",le=function(){return fe({current:void 0,version:$t.unknown()})},fe=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r(ne),isiOS:r(re),isAndroid:r(oe),isOSX:r(ue),isLinux:r(ie),isSolaris:r(ae),isFreeBSD:r(ce),isChromeOS:r(se)}},de={unknown:le,nu:fe,windows:v(ne),ios:v(re),android:v(oe),linux:v(ie),osx:v(ue),solaris:v(ae),freebsd:v(ce),chromeos:v(se)},me=function(t,e,n,r){var o=t.isiOS()&&!0===/ipad/i.test(n),i=t.isiOS()&&!o,u=t.isiOS()||t.isAndroid(),a=u||r("(pointer:coarse)"),c=o||!i&&u&&r("(min-device-width:768px)"),s=i||u&&!c,l=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),f=!s&&!c&&!l;return{isiPad:v(o),isiPhone:v(i),isTablet:v(c),isPhone:v(s),isTouch:v(a),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:v(l),isDesktop:v(f)}},ge=function(t,e){var n=String(e).toLowerCase();return nt(t,(function(t){return t.search(n)}))},he=function(t,e){return ge(t,e).map((function(t){var n=$t.detect(t.versionRegexes,e);return{current:t.name,version:n}}))},pe=function(t,e){return ge(t,e).map((function(t){var n=$t.detect(t.versionRegexes,e);return{current:t.name,version:n}}))},ve={detectBrowser:he,detectOs:pe},be=function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e},ye=function(t,e){return-1!==t.indexOf(e)},we=function(t,e){return be(t,e,0)},xe=function(t){return function(e){return e.replace(t,"")}},Ce=xe(/^\s+|\s+$/g),Se=xe(/^\s+/g),ke=xe(/\s+$/g),Oe=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Te=function(t){return function(e){return ye(e,t)}},Ee=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return ye(t,"edge/")&&ye(t,"chrome")&&ye(t,"safari")&&ye(t,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Oe],search:function(t){return ye(t,"chrome")&&!ye(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return ye(t,"msie")||ye(t,"trident")}},{name:"Opera",versionRegexes:[Oe,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Te("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Te("firefox")},{name:"Safari",versionRegexes:[Oe,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(ye(t,"safari")||ye(t,"mobile/"))&&ye(t,"applewebkit")}}],_e=[{name:"Windows",search:Te("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return ye(t,"iphone")||ye(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Te("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Te("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Te("linux"),versionRegexes:[]},{name:"Solaris",search:Te("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Te("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:Te("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Ae={browsers:v(Ee),oses:v(_e)},De=function(t,e){var n=Ae.browsers(),r=Ae.oses(),o=ve.detectBrowser(n,t).fold(ee.unknown,ee.nu),i=ve.detectOs(r,t).fold(de.unknown,de.nu),u=me(i,o,t,e);return{browser:o,os:i,deviceType:u}},Ne={detect:De},Re=function(t){return n.window.matchMedia(t).matches},Me=Ft((function(){return Ne.detect(n.navigator.userAgent,Re)})),ze=function(){return Me()},Be=n.navigator.userAgent,Pe=ze(),He=Pe.browser,Ie=Pe.os,Le=Pe.deviceType,Fe=/WebKit/.test(Be)&&!He.isEdge(),Ve="FormData"in n.window&&"FileReader"in n.window&&"URL"in n.window&&!!n.URL.createObjectURL,Ue=-1!==Be.indexOf("Windows Phone"),je={opera:He.isOpera(),webkit:Fe,ie:!(!He.isIE()&&!He.isEdge())&&He.version.major,gecko:He.isFirefox(),mac:Ie.isOSX()||Ie.isiOS(),iOS:Le.isiPad()||Le.isiPhone(),android:Ie.isAndroid(),contentEditable:!0,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:!0,range:n.window.getSelection&&"Range"in n.window,documentMode:He.isIE()?n.document.documentMode||7:10,fileApi:Ve,ceFalse:!0,cacheSuffix:null,container:null,experimentalShadowDom:!1,canHaveCSP:!He.isIE(),desktop:Le.isDesktop(),windowsPhone:Ue,browser:{current:He.current,version:He.version,isChrome:He.isChrome,isEdge:He.isEdge,isFirefox:He.isFirefox,isIE:He.isIE,isOpera:He.isOpera,isSafari:He.isSafari},os:{current:Ie.current,version:Ie.version,isAndroid:Ie.isAndroid,isChromeOS:Ie.isChromeOS,isFreeBSD:Ie.isFreeBSD,isiOS:Ie.isiOS,isLinux:Ie.isLinux,isOSX:Ie.isOSX,isSolaris:Ie.isSolaris,isWindows:Ie.isWindows},deviceType:{isDesktop:Le.isDesktop,isiPad:Le.isiPad,isiPhone:Le.isiPhone,isPhone:Le.isPhone,isTablet:Le.isTablet,isTouch:Le.isTouch,isWebView:Le.isWebView}},We=/^\s*|\s*$/g,qe=function(t){return null===t||void 0===t?"":(""+t).replace(We,"")},$e=function(t,e){return e?!("array"!==e||!_t(t))||typeof t===e:void 0!==t},Ge=function(t,e,n){var r;t=t||[],e=e||",","string"===typeof t&&(t=t.split(e)),n=n||{},r=t.length;while(r--)n[t[r]]={};return n},Ke=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},Xe=function(t,e,n){var r,o,i,u=this,a=0;t=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(t);var c=t[3].match(/(^|\.)(\w+)$/i)[2],s=u.createNS(t[3].replace(/\.\w+$/,""),n);if(!s[c]){if("static"===t[2])return s[c]=e,void(this.onCreate&&this.onCreate(t[2],t[3],s[c]));e[c]||(e[c]=function(){},a=1),s[c]=e[c],u.extend(s[c].prototype,e),t[5]&&(r=u.resolve(t[5]).prototype,o=t[5].match(/\.(\w+)$/i)[1],i=s[c],s[c]=a?function(){return r[o].apply(this,arguments)}:function(){return this.parent=r[o],i.apply(this,arguments)},s[c].prototype[c]=s[c],u.each(r,(function(t,e){s[c].prototype[e]=r[e]})),u.each(e,(function(t,e){r[e]?s[c].prototype[e]=function(){return this.parent=r[e],t.apply(this,arguments)}:e!==c&&(s[c].prototype[e]=t)}))),u.each(e.static,(function(t,e){s[c][e]=t}))}},Ye=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r++){var o=e[r];for(var i in o)if(o.hasOwnProperty(i)){var u=o[i];void 0!==u&&(t[i]=u)}}return t},Je=function(t,e,n,r){r=r||this,t&&(n&&(t=t[n]),Dt(t,(function(t,o){if(!1===e.call(r,t,o,n))return!1;Je(t,e,n,r)})))},Qe=function(t,e){var r,o;for(e=e||n.window,t=t.split("."),r=0;r<t.length;r++)o=t[r],e[o]||(e[o]={}),e=e[o];return e},Ze=function(t,e){var r,o;for(e=e||n.window,t=t.split("."),r=0,o=t.length;r<o;r++)if(e=e[t[r]],!e)break;return e},tn=function(t,e){return!t||$e(t,"array")?t:Nt(t.split(e||","),qe)},en=function(t){var e=je.cacheSuffix;return e&&(t+=(-1===t.indexOf("?")?"?":"&")+e),t},nn={trim:qe,isArray:_t,is:$e,toArray:At,makeMap:Ge,each:Dt,map:Nt,grep:Rt,inArray:Mt,hasOwn:Ke,extend:Ye,create:Xe,walk:Je,createNS:Qe,resolve:Ze,explode:tn,_addCacheSuffix:en},rn=function(t,e){var r=e||n.document,o=r.createElement("div");if(o.innerHTML=t,!o.hasChildNodes()||o.childNodes.length>1)throw n.console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return an(o.childNodes[0])},on=function(t,e){var r=e||n.document,o=r.createElement(t);return an(o)},un=function(t,e){var r=e||n.document,o=r.createTextNode(t);return an(o)},an=function(t){if(null===t||void 0===t)throw new Error("Node cannot be null or undefined");return{dom:v(t)}},cn=function(t,e,n){var r=t.dom();return _.from(r.elementFromPoint(e,n)).map(an)},sn={fromHtml:rn,fromTag:on,fromText:un,fromDom:an,fromPoint:cn},ln=("undefined"!==typeof n.window?n.window:Function("return this;")(),8),fn=9,dn=11,mn=1,gn=3,hn=function(t){var e=t.dom().nodeName;return e.toLowerCase()},pn=function(t){return t.dom().nodeType},vn=function(t){return function(e){return pn(e)===t}},bn=function(t){return pn(t)===ln||"#comment"===hn(t)},yn=vn(mn),wn=vn(gn),xn=vn(fn),Cn=vn(dn),Sn=function(t){var e=t.dom().head;if(null===e||void 0===e)throw new Error("Head is not available yet");return sn.fromDom(e)},kn=function(t,e){var n=[],r=function(t){return n.push(t),e(t)},o=e(t);do{o=o.bind(r)}while(o.isSome());return n},On=function(t,e,n){return 0!==(t.compareDocumentPosition(e)&n)},Tn=function(t,e){return On(t,e,n.Node.DOCUMENT_POSITION_CONTAINED_BY)},En=function(t,e){var n=t.dom();if(n.nodeType!==mn)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},_n=function(t){return t.nodeType!==mn&&t.nodeType!==fn&&t.nodeType!==dn||0===t.childElementCount},An=function(t,e){var r=void 0===e?n.document:e.dom();return _n(r)?[]:K(r.querySelectorAll(t),sn.fromDom)},Dn=function(t,e){var r=void 0===e?n.document:e.dom();return _n(r)?_.none():_.from(r.querySelector(t)).map(sn.fromDom)},Nn=function(t,e){return t.dom()===e.dom()},Rn=function(t,e){var n=t.dom(),r=e.dom();return n!==r&&n.contains(r)},Mn=function(t,e){return Tn(t.dom(),e.dom())},zn=function(t,e){return ze().browser.isIE()?Mn(t,e):Rn(t,e)},Bn=function(t){return sn.fromDom(t.dom().ownerDocument)},Pn=function(t){return xn(t)?t:Bn(t)},Hn=function(t){return sn.fromDom(t.dom().ownerDocument.documentElement)},In=function(t){return sn.fromDom(t.dom().ownerDocument.defaultView)},Ln=function(t){return _.from(t.dom().parentNode).map(sn.fromDom)},Fn=function(t,e){var n=L(e)?e:C,r=t.dom(),o=[];while(null!==r.parentNode&&void 0!==r.parentNode){var i=r.parentNode,u=sn.fromDom(i);if(o.push(u),!0===n(u))break;r=i}return o},Vn=function(t){var e=function(e){return Q(e,(function(e){return!Nn(t,e)}))};return Ln(t).map($n).map(e).getOr([])},Un=function(t){return _.from(t.dom().previousSibling).map(sn.fromDom)},jn=function(t){return _.from(t.dom().nextSibling).map(sn.fromDom)},Wn=function(t){return at(kn(t,Un))},qn=function(t){return kn(t,jn)},$n=function(t){return K(t.dom().childNodes,sn.fromDom)},Gn=function(t,e){var n=t.dom().childNodes;return _.from(n[e]).map(sn.fromDom)},Kn=function(t){return Gn(t,0)},Xn=function(t){return Gn(t,t.dom().childNodes.length-1)},Yn=function(t){return t.dom().childNodes.length},Jn=function(t){return Cn(t)},Qn=L(n.Element.prototype.attachShadow)&&L(n.Node.prototype.getRootNode),Zn=Qn?function(t){return sn.fromDom(t.dom().getRootNode())}:Pn,tr=function(t){return Jn(t)?t:Sn(Pn(t))},er=function(t){var e=Zn(t);return Jn(e)?_.some(e):_.none()},nr=function(t){return sn.fromDom(t.dom().host)},rr=function(t,e){var n=Ln(t);n.each((function(n){n.dom().insertBefore(e.dom(),t.dom())}))},or=function(t,e){var n=jn(t);n.fold((function(){var n=Ln(t);n.each((function(t){ur(t,e)}))}),(function(t){rr(t,e)}))},ir=function(t,e){var n=Kn(t);n.fold((function(){ur(t,e)}),(function(n){t.dom().insertBefore(e.dom(),n.dom())}))},ur=function(t,e){t.dom().appendChild(e.dom())},ar=function(t,e){rr(t,e),ur(e,t)},cr=function(t,e){X(e,(function(e){rr(t,e)}))},sr=function(t,e){X(e,(function(e){ur(t,e)}))},lr=function(t){t.dom().textContent="",X($n(t),(function(t){fr(t)}))},fr=function(t){var e=t.dom();null!==e.parentNode&&e.parentNode.removeChild(e)},dr=function(t){var e=$n(t);e.length>0&&cr(t,e),fr(t)},mr=function(t){var e=wn(t)?t.dom().parentNode:t.dom();return void 0!==e&&null!==e&&null!==e.ownerDocument&&er(sn.fromDom(e)).fold((function(){return e.ownerDocument.body.contains(e)}),p(mr,nr))},gr=function(t,e){var n=function(n,r){return gr(t+n,e+r)};return{left:v(t),top:v(e),translate:n}},hr=gr,pr=function(t){var e=t.getBoundingClientRect();return hr(e.left,e.top)},vr=function(t,e){return void 0!==t?t:void 0!==e?e:0},br=function(t){var e=t.dom().ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom())return hr(n.offsetLeft,n.offsetTop);var i=vr(r.pageYOffset,o.scrollTop),u=vr(r.pageXOffset,o.scrollLeft),a=vr(o.clientTop,n.clientTop),c=vr(o.clientLeft,n.clientLeft);return yr(t).translate(u-c,i-a)},yr=function(t){var e=t.dom(),n=e.ownerDocument,r=n.body;return r===e?hr(r.offsetLeft,r.offsetTop):mr(t)?pr(e):hr(0,0)},wr=function(t){var e=void 0!==t?t.dom():n.document,r=e.body.scrollLeft||e.documentElement.scrollLeft,o=e.body.scrollTop||e.documentElement.scrollTop;return hr(r,o)},xr=function(t,e,r){var o=void 0!==r?r.dom():n.document,i=o.defaultView;i.scrollTo(t,e)},Cr=function(t,e){var n=ze().browser.isSafari();n&&L(t.dom().scrollIntoViewIfNeeded)?t.dom().scrollIntoViewIfNeeded(!1):t.dom().scrollIntoView(e)},Sr=function(t){var e=void 0===t?n.window:t;return _.from(e["visualViewport"])},kr=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},Or=function(t){var e=void 0===t?n.window:t,r=e.document,o=wr(sn.fromDom(r));return Sr(e).fold((function(){var t=e.document.documentElement,n=t.clientWidth,r=t.clientHeight;return kr(o.left(),o.top(),n,r)}),(function(t){return kr(Math.max(t.pageLeft,o.left()),Math.max(t.pageTop,o.top()),t.width,t.height)}))},Tr=function(t){return function(e){return!!e&&e.nodeType===t}},Er=function(t){return!!t&&!Object.getPrototypeOf(t)},_r=Tr(1),Ar=function(t){var e=t.map((function(t){return t.toLowerCase()}));return function(t){if(t&&t.nodeName){var n=t.nodeName.toLowerCase();return $(e,n)}return!1}},Dr=function(t,e){var n=e.toLowerCase().split(" ");return function(e){var r,o;if(_r(e))for(r=0;r<n.length;r++){var i=e.ownerDocument.defaultView.getComputedStyle(e,null);if(o=i?i.getPropertyValue(t):null,o===n[r])return!0}return!1}},Nr=function(t){return function(e){return _r(e)&&e.hasAttribute(t)}},Rr=function(t,e){return function(n){return _r(n)&&n.getAttribute(t)===e}},Mr=function(t){return _r(t)&&t.hasAttribute("data-mce-bogus")},zr=function(t){return _r(t)&&"all"===t.getAttribute("data-mce-bogus")},Br=function(t){return _r(t)&&"TABLE"===t.tagName},Pr=function(t){return function(e){if(_r(e)){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},Hr=Ar(["textarea","input"]),Ir=Tr(3),Lr=Tr(8),Fr=Tr(9),Vr=Tr(11),Ur=Ar(["br"]),jr=Pr("true"),Wr=Pr("false"),qr=function(t){return void 0!==t.style&&L(t.style.getPropertyValue)},$r=function(t,e,r){if(!(M(r)||H(r)||F(r)))throw n.console.error("Invalid call to Attr.set. Key ",e,":: Value ",r,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,r+"")},Gr=function(t,e,n){$r(t.dom(),e,n)},Kr=function(t,e){var n=t.dom();pt(e,(function(t,e){$r(n,e,t)}))},Xr=function(t,e){var n=t.dom().getAttribute(e);return null===n?void 0:n},Yr=function(t,e){return _.from(Xr(t,e))},Jr=function(t,e){var n=t.dom();return!(!n||!n.hasAttribute)&&n.hasAttribute(e)},Qr=function(t,e){t.dom().removeAttribute(e)},Zr=function(t){return tt(t.dom().attributes,(function(t,e){return t[e.name]=e.value,t}),{})},to=function(t,e){var r=t.dom(),o=n.window.getComputedStyle(r),i=o.getPropertyValue(e);return""!==i||mr(t)?i:eo(r,e)},eo=function(t,e){return qr(t)?t.style.getPropertyValue(e):""},no=function(t,e){var n=t.dom(),r=eo(n,e);return _.from(r).filter((function(t){return t.length>0}))},ro=function(t){var e={},n=t.dom();if(qr(n))for(var r=0;r<n.style.length;r++){var o=n.style.item(r);e[o]=n.style[o]}return e},oo=function(t){return t.dom().offsetWidth},io=ze().browser,uo=function(t){return nt(t,yn)},ao=function(t){return io.isFirefox()&&"table"===hn(t)?uo($n(t)).filter((function(t){return"caption"===hn(t)})).bind((function(t){return uo(qn(t)).map((function(e){var n=e.dom().offsetTop,r=t.dom().offsetTop,o=t.dom().offsetHeight;return n<=r?-o:0}))})).getOr(0):0},co=function(t,e){return t.children&&$(t.children,e)},so=function(t,e,n){var r,o,i=0,u=0,a=t.ownerDocument;if(n=n||t,e){if(n===t&&e.getBoundingClientRect&&"static"===to(sn.fromDom(t),"position"))return o=e.getBoundingClientRect(),i=o.left+(a.documentElement.scrollLeft||t.scrollLeft)-a.documentElement.clientLeft,u=o.top+(a.documentElement.scrollTop||t.scrollTop)-a.documentElement.clientTop,{x:i,y:u};r=e;while(r&&r!==n&&r.nodeType&&!co(r,n))i+=r.offsetLeft||0,u+=r.offsetTop||0,r=r.offsetParent;r=e.parentNode;while(r&&r!==n&&r.nodeType&&!co(r,n))i-=r.scrollLeft||0,u-=r.scrollTop||0,r=r.parentNode;u+=ao(sn.fromDom(e))}return{x:i,y:u}},lo=["article","aside","details","div","dt","figcaption","footer","form","fieldset","header","hgroup","html","main","nav","section","summary","body","p","dl","multicol","dd","figure","address","center","blockquote","h1","h2","h3","h4","h5","h6","listing","xmp","pre","plaintext","menu","dir","ul","ol","li","hr","table","tbody","thead","tfoot","th","tr","td","caption"],fo=["area","base","basefont","br","col","frame","hr","img","input","isindex","link","meta","param","embed","source","wbr","track"],mo=["td","th"],go=["thead","tbody","tfoot"],ho=["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"],po=["h1","h2","h3","h4","h5","h6"],vo=["li","dd","dt"],bo=["ul","ol","dl"],yo=["pre","script","textarea","style"],wo=function(t){var e;return function(n){return e=e||st(t,v(!0)),e.hasOwnProperty(hn(n))}},xo=wo(po),Co=wo(lo),So=function(t){return"table"===hn(t)},ko=function(t){return yn(t)&&!Co(t)},Oo=function(t){return yn(t)&&"br"===hn(t)},To=wo(ho),Eo=wo(bo),_o=wo(vo),Ao=wo(fo),Do=wo(go),No=wo(mo),Ro=wo(yo),Mo=function(t){var e=t.previousSibling&&"SPAN"===t.previousSibling.nodeName,n=t.nextSibling&&"SPAN"===t.nextSibling.nodeName;return e&&n},zo=function(t){return t&&"SPAN"===t.tagName&&"bookmark"===t.getAttribute("data-mce-type")},Bo=function(t,e){var n,r=e.childNodes;if(!_r(e)||!zo(e)){for(n=r.length-1;n>=0;n--)Bo(t,r[n]);if(!1===Fr(e)){if(Ir(e)&&e.nodeValue.length>0){var o=nn.trim(e.nodeValue).length;if(t.isBlock(e.parentNode)||o>0)return;if(0===o&&Mo(e))return}else if(_r(e)&&(r=e.childNodes,1===r.length&&zo(r[0])&&e.parentNode.insertBefore(r[0],e),r.length||Ao(sn.fromDom(e))))return;t.remove(e)}return e}},Po=nn.makeMap,Ho=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Io=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Lo=/[<>&\"\']/g,Fo=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,Vo={128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"},Uo={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},jo={"<":"<",">":">","&":"&",""":'"',"'":"'"},Wo=function(t){var e=sn.fromTag("div").dom();return e.innerHTML=t,e.textContent||e.innerText||t},qo=function(t,e){var n,r,o,i={};if(t){for(t=t.split(","),e=e||10,n=0;n<t.length;n+=2)r=String.fromCharCode(parseInt(t[n],e)),Uo[r]||(o="&"+t[n+1]+";",i[r]=o,i[o]=r);return i}},$o=qo("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32),Go=function(t,e){return t.replace(e?Ho:Io,(function(t){return Uo[t]||t}))},Ko=function(t){return(""+t).replace(Lo,(function(t){return Uo[t]||t}))},Xo=function(t,e){return t.replace(e?Ho:Io,(function(t){return t.length>1?"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";":Uo[t]||"&#"+t.charCodeAt(0)+";"}))},Yo=function(t,e,n){return n=n||$o,t.replace(e?Ho:Io,(function(t){return Uo[t]||n[t]||t}))},Jo=function(t,e){var n=qo(e)||$o,r=function(t,e){return t.replace(e?Ho:Io,(function(t){return void 0!==Uo[t]?Uo[t]:void 0!==n[t]?n[t]:t.length>1?"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";":"&#"+t.charCodeAt(0)+";"}))},o=function(t,e){return Yo(t,e,n)},i=Po(t.replace(/\+/g,","));return i.named&&i.numeric?r:i.named?e?o:Yo:i.numeric?Xo:Go},Qo=function(t){return t.replace(Fo,(function(t,e){return e?(e="x"===e.charAt(0).toLowerCase()?parseInt(e.substr(1),16):parseInt(e,10),e>65535?(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e))):Vo[e]||String.fromCharCode(e)):jo[t]||$o[t]||Wo(t)}))},Zo={encodeRaw:Go,encodeAllRaw:Ko,encodeNumeric:Xo,encodeNamed:Yo,getEncodeFunc:Jo,decode:Qo},ti={},ei={},ni=nn.makeMap,ri=nn.each,oi=nn.extend,ii=nn.explode,ui=nn.inArray,ai=function(t,e){return t=nn.trim(t),t?t.split(e||" "):[]},ci=function(t){var e,n,r,o,i,u,a={},c=function(t,n,r){var o,i,u,c=function(t,e){var n,r,o={};for(n=0,r=t.length;n<r;n++)o[t[n]]=e||{};return o};r=r||[],n=n||"","string"===typeof r&&(r=ai(r)),t=ai(t),o=t.length;while(o--)i=ai([e,n].join(" ")),u={attributes:c(i),attributesOrder:i,children:c(r,ei)},a[t[o]]=u},s=function(t,e){var n,r,o,i;t=ai(t),n=t.length,e=ai(e);while(n--)for(r=a[t[n]],o=0,i=e.length;o<i;o++)r.attributes[e[o]]={},r.attributesOrder.push(e[o])};return ti[t]?ti[t]:(e="id accesskey class dir lang style tabindex title role",n="address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul",r="a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment","html4"!==t&&(e+=" contenteditable contextmenu draggable dropzone hidden spellcheck translate",n+=" article aside details dialog figure main header footer hgroup section nav",r+=" audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen"),"html5-strict"!==t&&(e+=" xml:lang",u="acronym applet basefont big font strike tt",r=[r,u].join(" "),ri(ai(u),(function(t){c(t,"",r)})),i="center dir isindex noframes",n=[n,i].join(" "),o=[n,r].join(" "),ri(ai(i),(function(t){c(t,"",o)}))),o=o||[n,r].join(" "),c("html","manifest","head body"),c("head","","base command link meta noscript script style title"),c("title hr noscript br"),c("base","href target"),c("link","href rel media hreflang type sizes hreflang"),c("meta","name http-equiv content charset"),c("style","media type scoped"),c("script","src async defer type charset"),c("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",o),c("address dt dd div caption","",o),c("h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn","",r),c("blockquote","cite",o),c("ol","reversed start type","li"),c("ul","","li"),c("li","value",o),c("dl","","dt dd"),c("a","href target rel media hreflang type",r),c("q","cite",r),c("ins del","cite datetime",o),c("img","src sizes srcset alt usemap ismap width height"),c("iframe","src name width height",o),c("embed","src type width height"),c("object","data type typemustmatch name usemap form width height",[o,"param"].join(" ")),c("param","name value"),c("map","name",[o,"area"].join(" ")),c("area","alt coords shape href target rel media hreflang type"),c("table","border","caption colgroup thead tfoot tbody tr"+("html4"===t?" col":"")),c("colgroup","span","col"),c("col","span"),c("tbody thead tfoot","","tr"),c("tr","","td th"),c("td","colspan rowspan headers",o),c("th","colspan rowspan headers scope abbr",o),c("form","accept-charset action autocomplete enctype method name novalidate target",o),c("fieldset","disabled form name",[o,"legend"].join(" ")),c("label","form for",r),c("input","accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate formtarget height list max maxlength min multiple name pattern readonly required size src step type value width"),c("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"===t?o:r),c("select","disabled form multiple name required size","option optgroup"),c("optgroup","disabled label","option"),c("option","disabled label selected value"),c("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),c("menu","type label",[o,"li"].join(" ")),c("noscript","",o),"html4"!==t&&(c("wbr"),c("ruby","",[r,"rt rp"].join(" ")),c("figcaption","",o),c("mark rt rp summary bdi","",r),c("canvas","width height",o),c("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",[o,"track source"].join(" ")),c("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",[o,"track source"].join(" ")),c("picture","","img source"),c("source","src srcset type media sizes"),c("track","kind src srclang label default"),c("datalist","",[r,"option"].join(" ")),c("article section nav aside main header footer","",o),c("hgroup","","h1 h2 h3 h4 h5 h6"),c("figure","",[o,"figcaption"].join(" ")),c("time","datetime",r),c("dialog","open",o),c("command","type label icon disabled checked radiogroup command"),c("output","for form name",r),c("progress","value max",r),c("meter","value min max low high optimum",r),c("details","open",[o,"summary"].join(" ")),c("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!==t&&(s("script","language xml:space"),s("style","xml:space"),s("object","declare classid code codebase codetype archive standby align border hspace vspace"),s("embed","align name hspace vspace"),s("param","valuetype type"),s("a","charset name rev shape coords"),s("br","clear"),s("applet","codebase archive code object alt name width height align hspace vspace"),s("img","name longdesc align border hspace vspace"),s("iframe","longdesc frameborder marginwidth marginheight scrolling align"),s("font basefont","size color face"),s("input","usemap align"),s("select"),s("textarea"),s("h1 h2 h3 h4 h5 h6 div p legend caption","align"),s("ul","type compact"),s("li","type"),s("ol dl menu dir","compact"),s("pre","width xml:space"),s("hr","align noshade size width"),s("isindex","prompt"),s("table","summary width frame rules cellspacing cellpadding align bgcolor"),s("col","width align char charoff valign"),s("colgroup","width align char charoff valign"),s("thead","align char charoff valign"),s("tr","align char charoff valign bgcolor"),s("th","axis align char charoff valign nowrap bgcolor width height"),s("form","accept"),s("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),s("tfoot","align char charoff valign"),s("tbody","align char charoff valign"),s("area","nohref"),s("body","background bgcolor text link vlink alink")),"html4"!==t&&(s("input button select textarea","autofocus"),s("input textarea","placeholder"),s("a","download"),s("link script img","crossorigin"),s("img","loading"),s("iframe","sandbox seamless allowfullscreen loading")),ri(ai("a form meter progress dfn"),(function(t){a[t]&&delete a[t].children[t]})),delete a.caption.children.table,delete a.script,ti[t]=a,a)},si=function(t,e){var n;return t&&(n={},"string"===typeof t&&(t={"*":t}),ri(t,(function(t,r){n[r]=n[r.toUpperCase()]="map"===e?ni(t,/[, ]/):ii(t,/[, ]/)}))),n};function li(t){var e={},n={},r=[],o={},i={},u=function(e,n,r){var o=t[e];return o?o=ni(o,/[, ]/,ni(o.toUpperCase(),/[, ]/)):(o=ti[e],o||(o=ni(n," ",ni(n.toUpperCase()," ")),o=oi(o,r),ti[e]=o)),o};t=t||{};var a=ci(t.schema);!1===t.verify_html&&(t.valid_elements="*[*]");var c=si(t.valid_styles),s=si(t.invalid_styles,"map"),l=si(t.valid_classes,"map"),f=u("whitespace_elements","pre script noscript style textarea video audio iframe object code"),d=u("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),m=u("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),g=u("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),h=u("non_empty_elements","td th iframe video audio object script pre code",m),p=u("move_caret_before_on_enter_elements","table",h),v=u("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside main nav figure"),b=u("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup figcaption details summary",v),y=u("text_inline_elements","span strong b em i font strike u var cite dfn code mark q sup sub samp");ri((t.special||"script noscript iframe noframes noembed title style textarea xmp").split(" "),(function(t){i[t]=new RegExp("</"+t+"[^>]*>","gi")}));var w=function(t){return new RegExp("^"+t.replace(/([?+*])/g,".$1")+"$")},x=function(t){var n,o,i,u,a,c,s,l,f,d,m,g,h,p,v,b,y,x,C=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)\])?$/,S=/^([!\-])?(\w+[\\:]:\w+|[^=:<]+)?(?:([=:<])(.*))?$/,k=/[*?+]/;if(t)for(t=ai(t,","),e["@"]&&(b=e["@"].attributes,y=e["@"].attributesOrder),n=0,o=t.length;n<o;n++)if(a=C.exec(t[n]),a){if(p=a[1],f=a[2],v=a[3],l=a[5],g={},h=[],c={attributes:g,attributesOrder:h},"#"===p&&(c.paddEmpty=!0),"-"===p&&(c.removeEmpty=!0),"!"===a[4]&&(c.removeEmptyAttrs=!0),b&&(pt(b,(function(t,e){g[e]=t})),h.push.apply(h,y)),l)for(l=ai(l,"|"),i=0,u=l.length;i<u;i++)if(a=S.exec(l[i]),a){if(s={},m=a[1],d=a[2].replace(/[\\:]:/g,":"),p=a[3],x=a[4],"!"===m&&(c.attributesRequired=c.attributesRequired||[],c.attributesRequired.push(d),s.required=!0),"-"===m){delete g[d],h.splice(ui(h,d),1);continue}p&&("="===p&&(c.attributesDefault=c.attributesDefault||[],c.attributesDefault.push({name:d,value:x}),s.defaultValue=x),":"===p&&(c.attributesForced=c.attributesForced||[],c.attributesForced.push({name:d,value:x}),s.forcedValue=x),"<"===p&&(s.validValues=ni(x,"?"))),k.test(d)?(c.attributePatterns=c.attributePatterns||[],s.pattern=w(d),c.attributePatterns.push(s)):(g[d]||h.push(d),g[d]=s)}b||"@"!==f||(b=g,y=h),v&&(c.outputName=f,e[v]=c),k.test(f)?(c.pattern=w(f),r.push(c)):e[f]=c}},C=function(t){e={},r=[],x(t),ri(a,(function(t,e){n[e]=t.children}))},S=function(t){var r=/^(~)?(.+)$/;t&&(ti.text_block_elements=ti.block_elements=null,ri(ai(t,","),(function(t){var i=r.exec(t),u="~"===i[1],a=u?"span":"div",c=i[2];if(n[c]=n[a],o[c]=a,u||(b[c.toUpperCase()]={},b[c]={}),!e[c]){var s=e[a];s=oi({},s),delete s.removeEmptyAttrs,delete s.removeEmpty,e[c]=s}ri(n,(function(t,e){t[a]&&(n[e]=t=oi({},n[e]),t[c]=t[a])}))})))},k=function(e){var r=/^([+\-]?)([A-Za-z0-9_\-\.\u00b7\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u037d\u037f-\u1fff\u200c-\u200d\u203f-\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]+)\[([^\]]+)\]$/;ti[t.schema]=null,e&&ri(ai(e,","),(function(t){var e,o,i=r.exec(t);i&&(o=i[1],e=o?n[i[2]]:n[i[2]]={"#comment":{}},e=n[i[2]],ri(ai(i[3],"|"),(function(t){"-"===o?delete e[t]:e[t]={}})))}))},O=function(t){var n,o=e[t];if(o)return o;n=r.length;while(n--)if(o=r[n],o.pattern.test(t))return o};t.valid_elements?C(t.valid_elements):(ri(a,(function(t,r){e[r]={attributes:t.attributes,attributesOrder:t.attributesOrder},n[r]=t.children})),"html5"!==t.schema&&ri(ai("strong/b em/i"),(function(t){t=ai(t,"/"),e[t[1]].outputName=t[0]})),ri(ai("ol ul sub sup blockquote span font a table tbody tr strong em b i"),(function(t){e[t]&&(e[t].removeEmpty=!0)})),ri(ai("p h1 h2 h3 h4 h5 h6 th td pre div address caption li"),(function(t){e[t].paddEmpty=!0})),ri(ai("span"),(function(t){e[t].removeEmptyAttrs=!0}))),S(t.custom_elements),k(t.valid_children),x(t.extended_valid_elements),k("+ol[ul|ol],+ul[ul|ol]"),ri({dd:"dl",dt:"dl",li:"ul ol",td:"tr",th:"tr",tr:"tbody thead tfoot",tbody:"table",thead:"table",tfoot:"table",legend:"fieldset",area:"map",param:"video audio object"},(function(t,n){e[n]&&(e[n].parentsRequired=ai(t))})),t.invalid_elements&&ri(ii(t.invalid_elements),(function(t){e[t]&&delete e[t]})),O("span")||x("span[!data-mce-type|*]");var T=function(){return c},E=function(){return s},_=function(){return l},A=function(){return g},D=function(){return b},N=function(){return v},R=function(){return y},M=function(){return m},z=function(){return d},B=function(){return h},P=function(){return p},H=function(){return f},I=function(){return i},L=function(t,e){var r=n[t.toLowerCase()];return!(!r||!r[e.toLowerCase()])},F=function(t,e){var n,r,o=O(t);if(o){if(!e)return!0;if(o.attributes[e])return!0;if(n=o.attributePatterns,n){r=n.length;while(r--)if(n[r].pattern.test(t))return!0}}return!1},V=function(){return o};return{children:n,elements:e,getValidStyles:T,getValidClasses:_,getBlockElements:D,getInvalidStyles:E,getShortEndedElements:M,getTextBlockElements:N,getTextInlineElements:R,getBoolAttrs:A,getElementRule:O,getSelfClosingElements:z,getNonEmptyElements:B,getMoveCaretBeforeOnEnterElements:P,getWhiteSpaceElements:H,getSpecialElements:I,isValidChild:L,isValid:F,getCustomElements:V,addValidElements:x,setValidElements:C,addCustomElements:S,addValidChildren:k}}var fi,di,mi,gi,hi,pi,vi,bi,yi,wi,xi,Ci,Si,ki,Oi,Ti,Ei,_i,Ai="\ufeff",Di=" ",Ni=function(t){return t===Ai},Ri=function(t){return t.replace(/\uFEFF/g,"")},Mi=function(t,e,n,r){var o=function(t){return t=parseInt(t,10).toString(16),t.length>1?t:"0"+t};return"#"+o(e)+o(n)+o(r)},zi=function(t,e){var n,r,o,i=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,u=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,a=/\s*([^:]+):\s*([^;]+);?/g,c=/\s+$/,s={},l=Ai;t=t||{},e&&(r=e.getValidStyles(),o=e.getInvalidStyles());var f=("\\\" \\' \\; \\: ; : "+l).split(" ");for(n=0;n<f.length;n++)s[f[n]]=l+n,s[l+n]=f[n];return{toHex:function(t){return t.replace(i,Mi)},parse:function(e){var r,o,f,d,m={},g=t.url_converter,h=t.url_converter_scope||this,p=function(t,e,r){var o=m[t+"-top"+e];if(o){var i=m[t+"-right"+e];if(i){var u=m[t+"-bottom"+e];if(u){var a=m[t+"-left"+e];if(a){var c=[o,i,u,a];n=c.length-1;while(n--)if(c[n]!==c[n+1])break;n>-1&&r||(m[t+e]=-1===n?c[0]:c.join(" "),delete m[t+"-top"+e],delete m[t+"-right"+e],delete m[t+"-bottom"+e],delete m[t+"-left"+e])}}}}},v=function(t){var e,n=m[t];if(n){n=n.split(" "),e=n.length;while(e--)if(n[e]!==n[0])return!1;return m[t]=n[0],!0}},b=function(t,e,n,r){v(e)&&v(n)&&v(r)&&(m[t]=m[e]+" "+m[n]+" "+m[r],delete m[e],delete m[n],delete m[r])},y=function(t){return d=!0,s[t]},w=function(t,e){return d&&(t=t.replace(/\uFEFF[0-9]/g,(function(t){return s[t]}))),e||(t=t.replace(/\\([\'\";:])/g,"$1")),t},x=function(t){return String.fromCharCode(parseInt(t.slice(1),16))},C=function(t){return t.replace(/\\[0-9a-f]+/gi,x)},S=function(e,n,r,o,i,u){if(i=i||u,i)return i=w(i),"'"+i.replace(/\'/g,"\\'")+"'";if(n=w(n||r||o),!t.allow_script_urls){var a=n.replace(/[\s\r\n]+/g,"");if(/(java|vb)script:/i.test(a))return"";if(!t.allow_svg_data_urls&&/^data:image\/svg/i.test(a))return""}return g&&(n=g.call(h,n,"style")),"url('"+n.replace(/\'/g,"\\'")+"')"};if(e){e=e.replace(/[\u0000-\u001F]/g,""),e=e.replace(/\\[\"\';:\uFEFF]/g,y).replace(/\"[^\"]+\"|\'[^\']+\'/g,(function(t){return t.replace(/[;:]/g,y)}));while(r=a.exec(e))if(a.lastIndex=r.index+r[0].length,o=r[1].replace(c,"").toLowerCase(),f=r[2].replace(c,""),o&&f){if(o=C(o),f=C(f),-1!==o.indexOf(l)||-1!==o.indexOf('"'))continue;if(!t.allow_script_urls&&("behavior"===o||/expression\s*\(|\/\*|\*\//.test(f)))continue;"font-weight"===o&&"700"===f?f="bold":"color"!==o&&"background-color"!==o||(f=f.toLowerCase()),f=f.replace(i,Mi),f=f.replace(u,S),m[o]=d?w(f,!0):f}p("border","",!0),p("border","-width"),p("border","-color"),p("border","-style"),p("padding",""),p("margin",""),b("border","border-width","border-style","border-color"),"medium none"===m.border&&delete m.border,"none"===m["border-image"]&&delete m["border-image"]}return m},serialize:function(t,e){var n="",i=function(e){var o,i=r[e];if(i)for(var u=0,a=i.length;u<a;u++)e=i[u],o=t[e],o&&(n+=(n.length>0?" ":"")+e+": "+o+";")},u=function(t,e){var n=o["*"];return(!n||!n[t])&&(n=o[e],!(n&&n[t]))};return e&&r?(i("*"),i(e)):pt(t,(function(t,r){!t||o&&!u(r,e)||(n+=(n.length>0?" ":"")+r+": "+t+";")})),n}}},Bi="mce-data-",Pi=/^(?:mouse|contextmenu)|click/,Hi={keyLocation:1,layerX:1,layerY:1,returnValue:1,webkitMovementX:1,webkitMovementY:1,keyIdentifier:1,mozPressure:1},Ii=function(t){return t.isDefaultPrevented===Fi||t.isDefaultPrevented===Li},Li=function(){return!1},Fi=function(){return!0},Vi=function(t,e,n,r){t.addEventListener?t.addEventListener(e,n,r||!1):t.attachEvent&&t.attachEvent("on"+e,n)},Ui=function(t,e,n,r){t.removeEventListener?t.removeEventListener(e,n,r||!1):t.detachEvent&&t.detachEvent("on"+e,n)},ji=function(t,e){if(t.composedPath){var n=t.composedPath();if(n&&n.length>0)return n[0]}return e},Wi=function(t,e){var r,o=e||{};for(r in t)Hi[r]||(o[r]=t[r]);if(o.target||(o.target=o.srcElement||n.document),je.experimentalShadowDom&&(o.target=ji(t,o.target)),t&&Pi.test(t.type)&&void 0===t.pageX&&void 0!==t.clientX){var i=o.target.ownerDocument||n.document,u=i.documentElement,a=i.body;o.pageX=t.clientX+(u&&u.scrollLeft||a&&a.scrollLeft||0)-(u&&u.clientLeft||a&&a.clientLeft||0),o.pageY=t.clientY+(u&&u.scrollTop||a&&a.scrollTop||0)-(u&&u.clientTop||a&&a.clientTop||0)}return o.preventDefault=function(){o.isDefaultPrevented=Fi,t&&(t.preventDefault?t.preventDefault():t.returnValue=!1)},o.stopPropagation=function(){o.isPropagationStopped=Fi,t&&(t.stopPropagation?t.stopPropagation():t.cancelBubble=!0)},o.stopImmediatePropagation=function(){o.isImmediatePropagationStopped=Fi,o.stopPropagation()},!1===Ii(o)&&(o.isDefaultPrevented=Li,o.isPropagationStopped=Li,o.isImmediatePropagationStopped=Li),"undefined"===typeof o.metaKey&&(o.metaKey=!1),o},qi=function(t,e,n){var r=t.document,o={type:"ready"};if(n.domLoaded)e(o);else{var i=function(){return"complete"===r.readyState||"interactive"===r.readyState&&r.body},u=function(){Ui(t,"DOMContentLoaded",u),Ui(t,"load",u),n.domLoaded||(n.domLoaded=!0,e(o))};i()?u():Vi(t,"DOMContentLoaded",u),Vi(t,"load",u)}},$i=function(){function t(){this.domLoaded=!1,this.events={},this.count=1,this.expando=Bi+(+new Date).toString(32),this.hasMouseEnterLeave="onmouseenter"in n.document.documentElement,this.hasFocusIn="onfocusin"in n.document.documentElement,this.count=1}return t.prototype.bind=function(t,e,r,o){var i,u,a,c,s,l,f,d=this,m=n.window,g=function(t){d.executeHandlers(Wi(t||m.event),i)};if(t&&3!==t.nodeType&&8!==t.nodeType){t[d.expando]?i=t[d.expando]:(i=d.count++,t[d.expando]=i,d.events[i]={}),o=o||t;var h=e.split(" ");a=h.length;while(a--)c=h[a],l=g,s=f=!1,"DOMContentLoaded"===c&&(c="ready"),d.domLoaded&&"ready"===c&&"complete"===t.readyState?r.call(o,Wi({type:c})):(d.hasMouseEnterLeave||(s=d.mouseEnterLeave[c],s&&(l=function(t){var e=t.currentTarget,n=t.relatedTarget;if(n&&e.contains)n=e.contains(n);else while(n&&n!==e)n=n.parentNode;n||(t=Wi(t||m.event),t.type="mouseout"===t.type?"mouseleave":"mouseenter",t.target=e,d.executeHandlers(t,i))})),d.hasFocusIn||"focusin"!==c&&"focusout"!==c||(f=!0,s="focusin"===c?"focus":"blur",l=function(t){t=Wi(t||m.event),t.type="focus"===t.type?"focusin":"focusout",d.executeHandlers(t,i)}),u=d.events[i][c],u?"ready"===c&&d.domLoaded?r(Wi({type:c})):u.push({func:r,scope:o}):(d.events[i][c]=u=[{func:r,scope:o}],u.fakeName=s,u.capture=f,u.nativeHandler=l,"ready"===c?qi(t,l,d):Vi(t,s||c,l,f)));return t=u=0,r}},t.prototype.unbind=function(t,e,n){var r,o,i,u,a;if(!t||3===t.nodeType||8===t.nodeType)return this;var c=t[this.expando];if(c){if(a=this.events[c],e){var s=e.split(" ");o=s.length;while(o--)if(u=s[o],r=a[u],r){if(n){i=r.length;while(i--)if(r[i].func===n){var l=r.nativeHandler,f=r.fakeName,d=r.capture;r=r.slice(0,i).concat(r.slice(i+1)),r.nativeHandler=l,r.fakeName=f,r.capture=d,a[u]=r}}n&&0!==r.length||(delete a[u],Ui(t,r.fakeName||u,r.nativeHandler,r.capture))}}else pt(a,(function(e,n){Ui(t,e.fakeName||n,e.nativeHandler,e.capture)})),a={};for(u in a)if(Tt(a,u))return this;delete this.events[c];try{delete t[this.expando]}catch(m){t[this.expando]=null}}return this},t.prototype.fire=function(t,e,n){var r;if(!t||3===t.nodeType||8===t.nodeType)return this;var o=Wi(null,n);o.type=e,o.target=t;do{r=t[this.expando],r&&this.executeHandlers(o,r),t=t.parentNode||t.ownerDocument||t.defaultView||t.parentWindow}while(t&&!o.isPropagationStopped());return this},t.prototype.clean=function(t){var e,n;if(!t||3===t.nodeType||8===t.nodeType)return this;if(t[this.expando]&&this.unbind(t),t.getElementsByTagName||(t=t.document),t&&t.getElementsByTagName){this.unbind(t),n=t.getElementsByTagName("*"),e=n.length;while(e--)t=n[e],t[this.expando]&&this.unbind(t)}return this},t.prototype.destroy=function(){this.events={}},t.prototype.cancel=function(t){return t&&(t.preventDefault(),t.stopImmediatePropagation()),!1},t.prototype.executeHandlers=function(t,e){var n=this.events[e],r=n&&n[t.type];if(r)for(var o=0,i=r.length;o<i;o++){var u=r[o];if(u&&!1===u.func.call(u.scope,t)&&t.preventDefault(),t.isImmediatePropagationStopped())return}},t.Event=new t,t}(),Gi="sizzle"+-new Date,Ki=n.window.document,Xi=0,Yi=0,Ji=Nu(),Qi=Nu(),Zi=Nu(),tu=function(t,e){return t===e&&(wi=!0),0},eu="undefined",nu=1<<31,ru={}.hasOwnProperty,ou=[],iu=ou.pop,uu=ou.push,au=ou.push,cu=ou.slice,su=ou.indexOf||function(t){for(var e=0,n=this.length;e<n;e++)if(this[e]===t)return e;return-1},lu="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",fu="[\\x20\\t\\r\\n\\f]",du="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",mu="\\["+fu+"*("+du+")(?:"+fu+"*([*^$|!~]?=)"+fu+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+du+"))|)"+fu+"*\\]",gu=":("+du+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+mu+")*)|.*)\\)|)",hu=new RegExp("^"+fu+"+|((?:^|[^\\\\])(?:\\\\.)*)"+fu+"+$","g"),pu=new RegExp("^"+fu+"*,"+fu+"*"),vu=new RegExp("^"+fu+"*([>+~]|"+fu+")"+fu+"*"),bu=new RegExp("="+fu+"*([^\\]'\"]*?)"+fu+"*\\]","g"),yu=new RegExp(gu),wu=new RegExp("^"+du+"$"),xu={ID:new RegExp("^#("+du+")"),CLASS:new RegExp("^\\.("+du+")"),TAG:new RegExp("^("+du+"|[*])"),ATTR:new RegExp("^"+mu),PSEUDO:new RegExp("^"+gu),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+fu+"*(even|odd|(([+-]|)(\\d*)n|)"+fu+"*(?:([+-]|)"+fu+"*(\\d+)|))"+fu+"*\\)|)","i"),bool:new RegExp("^(?:"+lu+")$","i"),needsContext:new RegExp("^"+fu+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+fu+"*((?:-\\d)?\\d*)"+fu+"*\\)|)(?=[^-]|$)","i")},Cu=/^(?:input|select|textarea|button)$/i,Su=/^h\d$/i,ku=/^[^{]+\{\s*\[native \w/,Ou=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,Tu=/[+~]/,Eu=/'|\\/g,_u=new RegExp("\\\\([\\da-f]{1,6}"+fu+"?|("+fu+")|.)","ig"),Au=function(t,e,n){var r="0x"+e-65536;return r!==r||n?e:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{au.apply(ou=cu.call(Ki.childNodes),Ki.childNodes),ou[Ki.childNodes.length].nodeType}catch(XI){au={apply:ou.length?function(t,e){uu.apply(t,cu.call(e))}:function(t,e){var n=t.length,r=0;while(t[n++]=e[r++]);t.length=n-1}}}var Du=function(t,e,n,r){var o,i,u,a,c,s,l,f,d,m;if((e?e.ownerDocument||e:Ki)!==Ci&&xi(e),e=e||Ci,n=n||[],!t||"string"!==typeof t)return n;if(1!==(a=e.nodeType)&&9!==a)return[];if(ki&&!r){if(o=Ou.exec(t))if(u=o[1]){if(9===a){if(i=e.getElementById(u),!i||!i.parentNode)return n;if(i.id===u)return n.push(i),n}else if(e.ownerDocument&&(i=e.ownerDocument.getElementById(u))&&_i(e,i)&&i.id===u)return n.push(i),n}else{if(o[2])return au.apply(n,e.getElementsByTagName(t)),n;if((u=o[3])&&fi.getElementsByClassName)return au.apply(n,e.getElementsByClassName(u)),n}if(fi.qsa&&(!Oi||!Oi.test(t))){if(f=l=Gi,d=e,m=9===a&&t,1===a&&"object"!==e.nodeName.toLowerCase()){s=hi(t),(l=e.getAttribute("id"))?f=l.replace(Eu,"\\$&"):e.setAttribute("id",f),f="[id='"+f+"'] ",c=s.length;while(c--)s[c]=f+Lu(s[c]);d=Tu.test(t)&&Hu(e.parentNode)||e,m=s.join(",")}if(m)try{return au.apply(n,d.querySelectorAll(m)),n}catch(g){}finally{l||e.removeAttribute("id")}}}return vi(t.replace(hu,"$1"),e,n,r)};function Nu(){var t=[];function e(n,r){return t.push(n+" ")>di.cacheLength&&delete e[t.shift()],e[n+" "]=r}return e}function Ru(t){return t[Gi]=!0,t}function Mu(t,e){var n=e&&t,r=n&&1===t.nodeType&&1===e.nodeType&&(~e.sourceIndex||nu)-(~t.sourceIndex||nu);if(r)return r;if(n)while(n=n.nextSibling)if(n===e)return-1;return t?1:-1}function zu(t){return function(e){var n=e.nodeName.toLowerCase();return"input"===n&&e.type===t}}function Bu(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function Pu(t){return Ru((function(e){return e=+e,Ru((function(n,r){var o,i=t([],n.length,e),u=i.length;while(u--)n[o=i[u]]&&(n[o]=!(r[o]=n[o]))}))}))}function Hu(t){return t&&typeof t.getElementsByTagName!==eu&&t}function Iu(){}function Lu(t){for(var e=0,n=t.length,r="";e<n;e++)r+=t[e].value;return r}function Fu(t,e,n){var r=e.dir,o=n&&"parentNode"===r,i=Yi++;return e.first?function(e,n,i){while(e=e[r])if(1===e.nodeType||o)return t(e,n,i)}:function(e,n,u){var a,c,s=[Xi,i];if(u){while(e=e[r])if((1===e.nodeType||o)&&t(e,n,u))return!0}else while(e=e[r])if(1===e.nodeType||o){if(c=e[Gi]||(e[Gi]={}),(a=c[r])&&a[0]===Xi&&a[1]===i)return s[2]=a[2];if(c[r]=s,s[2]=t(e,n,u))return!0}}}function Vu(t){return t.length>1?function(e,n,r){var o=t.length;while(o--)if(!t[o](e,n,r))return!1;return!0}:t[0]}function Uu(t,e,n){for(var r=0,o=e.length;r<o;r++)Du(t,e[r],n);return n}function ju(t,e,n,r,o){for(var i,u=[],a=0,c=t.length,s=null!=e;a<c;a++)(i=t[a])&&(n&&!n(i,r,o)||(u.push(i),s&&e.push(a)));return u}function Wu(t,e,n,r,o,i){return r&&!r[Gi]&&(r=Wu(r)),o&&!o[Gi]&&(o=Wu(o,i)),Ru((function(i,u,a,c){var s,l,f,d=[],m=[],g=u.length,h=i||Uu(e||"*",a.nodeType?[a]:a,[]),p=!t||!i&&e?h:ju(h,d,t,a,c),v=n?o||(i?t:g||r)?[]:u:p;if(n&&n(p,v,a,c),r){s=ju(v,m),r(s,[],a,c),l=s.length;while(l--)(f=s[l])&&(v[m[l]]=!(p[m[l]]=f))}if(i){if(o||t){if(o){s=[],l=v.length;while(l--)(f=v[l])&&s.push(p[l]=f);o(null,v=[],s,c)}l=v.length;while(l--)(f=v[l])&&(s=o?su.call(i,f):d[l])>-1&&(i[s]=!(u[s]=f))}}else v=ju(v===u?v.splice(g,v.length):v),o?o(null,u,v,c):au.apply(u,v)}))}function qu(t){for(var e,n,r,o=t.length,i=di.relative[t[0].type],u=i||di.relative[" "],a=i?1:0,c=Fu((function(t){return t===e}),u,!0),s=Fu((function(t){return su.call(e,t)>-1}),u,!0),l=[function(t,n,r){return!i&&(r||n!==bi)||((e=n).nodeType?c(t,n,r):s(t,n,r))}];a<o;a++)if(n=di.relative[t[a].type])l=[Fu(Vu(l),n)];else{if(n=di.filter[t[a].type].apply(null,t[a].matches),n[Gi]){for(r=++a;r<o;r++)if(di.relative[t[r].type])break;return Wu(a>1&&Vu(l),a>1&&Lu(t.slice(0,a-1).concat({value:" "===t[a-2].type?"*":""})).replace(hu,"$1"),n,a<r&&qu(t.slice(a,r)),r<o&&qu(t=t.slice(r)),r<o&&Lu(t))}l.push(n)}return Vu(l)}function $u(t,e){var n=e.length>0,r=t.length>0,o=function(o,i,u,a,c){var s,l,f,d=0,m="0",g=o&&[],h=[],p=bi,v=o||r&&di.find.TAG("*",c),b=Xi+=null==p?1:Math.random()||.1,y=v.length;for(c&&(bi=i!==Ci&&i);m!==y&&null!=(s=v[m]);m++){if(r&&s){l=0;while(f=t[l++])if(f(s,i,u)){a.push(s);break}c&&(Xi=b)}n&&((s=!f&&s)&&d--,o&&g.push(s))}if(d+=m,n&&m!==d){l=0;while(f=e[l++])f(g,h,i,u);if(o){if(d>0)while(m--)g[m]||h[m]||(h[m]=iu.call(a));h=ju(h)}au.apply(a,h),c&&!o&&h.length>0&&d+e.length>1&&Du.uniqueSort(a)}return c&&(Xi=b,bi=p),g};return n?Ru(o):o}fi=Du.support={},gi=Du.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return!!e&&"HTML"!==e.nodeName},xi=Du.setDocument=function(t){var e,n=t?t.ownerDocument||t:Ki,r=n.defaultView;function o(t){try{return t.top}catch(e){}return null}return n!==Ci&&9===n.nodeType&&n.documentElement?(Ci=n,Si=n.documentElement,ki=!gi(n),r&&r!==o(r)&&(r.addEventListener?r.addEventListener("unload",(function(){xi()}),!1):r.attachEvent&&r.attachEvent("onunload",(function(){xi()}))),fi.attributes=!0,fi.getElementsByTagName=!0,fi.getElementsByClassName=ku.test(n.getElementsByClassName),fi.getById=!0,di.find.ID=function(t,e){if(typeof e.getElementById!==eu&&ki){var n=e.getElementById(t);return n&&n.parentNode?[n]:[]}},di.filter.ID=function(t){var e=t.replace(_u,Au);return function(t){return t.getAttribute("id")===e}},di.find.TAG=fi.getElementsByTagName?function(t,e){if(typeof e.getElementsByTagName!==eu)return e.getElementsByTagName(t)}:function(t,e){var n,r=[],o=0,i=e.getElementsByTagName(t);if("*"===t){while(n=i[o++])1===n.nodeType&&r.push(n);return r}return i},di.find.CLASS=fi.getElementsByClassName&&function(t,e){if(ki)return e.getElementsByClassName(t)},Ti=[],Oi=[],fi.disconnectedMatch=!0,Oi=Oi.length&&new RegExp(Oi.join("|")),Ti=Ti.length&&new RegExp(Ti.join("|")),e=ku.test(Si.compareDocumentPosition),_i=e||ku.test(Si.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,r=e&&e.parentNode;return t===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):t.compareDocumentPosition&&16&t.compareDocumentPosition(r)))}:function(t,e){if(e)while(e=e.parentNode)if(e===t)return!0;return!1},tu=e?function(t,e){if(t===e)return wi=!0,0;var r=!t.compareDocumentPosition-!e.compareDocumentPosition;return r||(r=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1,1&r||!fi.sortDetached&&e.compareDocumentPosition(t)===r?t===n||t.ownerDocument===Ki&&_i(Ki,t)?-1:e===n||e.ownerDocument===Ki&&_i(Ki,e)?1:yi?su.call(yi,t)-su.call(yi,e):0:4&r?-1:1)}:function(t,e){if(t===e)return wi=!0,0;var r,o=0,i=t.parentNode,u=e.parentNode,a=[t],c=[e];if(!i||!u)return t===n?-1:e===n?1:i?-1:u?1:yi?su.call(yi,t)-su.call(yi,e):0;if(i===u)return Mu(t,e);r=t;while(r=r.parentNode)a.unshift(r);r=e;while(r=r.parentNode)c.unshift(r);while(a[o]===c[o])o++;return o?Mu(a[o],c[o]):a[o]===Ki?-1:c[o]===Ki?1:0},n):Ci},Du.matches=function(t,e){return Du(t,null,null,e)},Du.matchesSelector=function(t,e){if((t.ownerDocument||t)!==Ci&&xi(t),e=e.replace(bu,"='$1']"),fi.matchesSelector&&ki&&(!Ti||!Ti.test(e))&&(!Oi||!Oi.test(e)))try{var n=Ei.call(t,e);if(n||fi.disconnectedMatch||t.document&&11!==t.document.nodeType)return n}catch(XI){}return Du(e,Ci,null,[t]).length>0},Du.contains=function(t,e){return(t.ownerDocument||t)!==Ci&&xi(t),_i(t,e)},Du.attr=function(t,e){(t.ownerDocument||t)!==Ci&&xi(t);var n=di.attrHandle[e.toLowerCase()],r=n&&ru.call(di.attrHandle,e.toLowerCase())?n(t,e,!ki):void 0;return void 0!==r?r:fi.attributes||!ki?t.getAttribute(e):(r=t.getAttributeNode(e))&&r.specified?r.value:null},Du.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},Du.uniqueSort=function(t){var e,n=[],r=0,o=0;if(wi=!fi.detectDuplicates,yi=!fi.sortStable&&t.slice(0),t.sort(tu),wi){while(e=t[o++])e===t[o]&&(r=n.push(o));while(r--)t.splice(n[r],1)}return yi=null,t},mi=Du.getText=function(t){var e,n="",r=0,o=t.nodeType;if(o){if(1===o||9===o||11===o){if("string"===typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=mi(t)}else if(3===o||4===o)return t.nodeValue}else while(e=t[r++])n+=mi(e);return n},di=Du.selectors={cacheLength:50,createPseudo:Ru,match:xu,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(_u,Au),t[3]=(t[3]||t[4]||t[5]||"").replace(_u,Au),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||Du.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&Du.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return xu.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&yu.test(n)&&(e=hi(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(_u,Au).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=Ji[t+" "];return e||(e=new RegExp("(^|"+fu+")"+t+"("+fu+"|$)"))&&Ji(t,(function(t){return e.test("string"===typeof t.className&&t.className||typeof t.getAttribute!==eu&&t.getAttribute("class")||"")}))},ATTR:function(t,e,n){return function(r){var o=Du.attr(r,t);return null==o?"!="===e:!e||(o+="","="===e?o===n:"!="===e?o!==n:"^="===e?n&&0===o.indexOf(n):"*="===e?n&&o.indexOf(n)>-1:"$="===e?n&&o.slice(-n.length)===n:"~="===e?(" "+o+" ").indexOf(n)>-1:"|="===e&&(o===n||o.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,r,o){var i="nth"!==t.slice(0,3),u="last"!==t.slice(-4),a="of-type"===e;return 1===r&&0===o?function(t){return!!t.parentNode}:function(e,n,c){var s,l,f,d,m,g,h=i!==u?"nextSibling":"previousSibling",p=e.parentNode,v=a&&e.nodeName.toLowerCase(),b=!c&&!a;if(p){if(i){while(h){f=e;while(f=f[h])if(a?f.nodeName.toLowerCase()===v:1===f.nodeType)return!1;g=h="only"===t&&!g&&"nextSibling"}return!0}if(g=[u?p.firstChild:p.lastChild],u&&b){l=p[Gi]||(p[Gi]={}),s=l[t]||[],m=s[0]===Xi&&s[1],d=s[0]===Xi&&s[2],f=m&&p.childNodes[m];while(f=++m&&f&&f[h]||(d=m=0)||g.pop())if(1===f.nodeType&&++d&&f===e){l[t]=[Xi,m,d];break}}else if(b&&(s=(e[Gi]||(e[Gi]={}))[t])&&s[0]===Xi)d=s[1];else while(f=++m&&f&&f[h]||(d=m=0)||g.pop())if((a?f.nodeName.toLowerCase()===v:1===f.nodeType)&&++d&&(b&&((f[Gi]||(f[Gi]={}))[t]=[Xi,d]),f===e))break;return d-=o,d===r||d%r===0&&d/r>=0}}},PSEUDO:function(t,e){var n,r=di.pseudos[t]||di.setFilters[t.toLowerCase()]||Du.error("unsupported pseudo: "+t);return r[Gi]?r(e):r.length>1?(n=[t,t,"",e],di.setFilters.hasOwnProperty(t.toLowerCase())?Ru((function(t,n){var o,i=r(t,e),u=i.length;while(u--)o=su.call(t,i[u]),t[o]=!(n[o]=i[u])})):function(t){return r(t,0,n)}):r}},pseudos:{not:Ru((function(t){var e=[],n=[],r=pi(t.replace(hu,"$1"));return r[Gi]?Ru((function(t,e,n,o){var i,u=r(t,null,o,[]),a=t.length;while(a--)(i=u[a])&&(t[a]=!(e[a]=i))})):function(t,o,i){return e[0]=t,r(e,null,i,n),!n.pop()}})),has:Ru((function(t){return function(e){return Du(t,e).length>0}})),contains:Ru((function(t){return t=t.replace(_u,Au),function(e){return(e.textContent||e.innerText||mi(e)).indexOf(t)>-1}})),lang:Ru((function(t){return wu.test(t||"")||Du.error("unsupported lang: "+t),t=t.replace(_u,Au).toLowerCase(),function(e){var n;do{if(n=ki?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return n=n.toLowerCase(),n===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(t){var e=n.window.location&&n.window.location.hash;return e&&e.slice(1)===t.id},root:function(t){return t===Si},focus:function(t){return t===Ci.activeElement&&(!Ci.hasFocus||Ci.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:function(t){return!1===t.disabled},disabled:function(t){return!0===t.disabled},checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!di.pseudos.empty(t)},header:function(t){return Su.test(t.nodeName)},input:function(t){return Cu.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:Pu((function(){return[0]})),last:Pu((function(t,e){return[e-1]})),eq:Pu((function(t,e,n){return[n<0?n+e:n]})),even:Pu((function(t,e){for(var n=0;n<e;n+=2)t.push(n);return t})),odd:Pu((function(t,e){for(var n=1;n<e;n+=2)t.push(n);return t})),lt:Pu((function(t,e,n){for(var r=n<0?n+e:n;--r>=0;)t.push(r);return t})),gt:Pu((function(t,e,n){for(var r=n<0?n+e:n;++r<e;)t.push(r);return t}))}},di.pseudos.nth=di.pseudos.eq,X(["radio","checkbox","file","password","image"],(function(t){di.pseudos[t]=zu(t)})),X(["submit","reset"],(function(t){di.pseudos[t]=Bu(t)})),Iu.prototype=di.filters=di.pseudos,di.setFilters=new Iu,hi=Du.tokenize=function(t,e){var n,r,o,i,u,a,c,s=Qi[t+" "];if(s)return e?0:s.slice(0);u=t,a=[],c=di.preFilter;while(u){for(i in n&&!(r=pu.exec(u))||(r&&(u=u.slice(r[0].length)||u),a.push(o=[])),n=!1,(r=vu.exec(u))&&(n=r.shift(),o.push({value:n,type:r[0].replace(hu," ")}),u=u.slice(n.length)),di.filter)di.filter.hasOwnProperty(i)&&(!(r=xu[i].exec(u))||c[i]&&!(r=c[i](r))||(n=r.shift(),o.push({value:n,type:i,matches:r}),u=u.slice(n.length)));if(!n)break}return e?u.length:u?Du.error(t):Qi(t,a).slice(0)},pi=Du.compile=function(t,e){var n,r=[],o=[],i=Zi[t+" "];if(!i){e||(e=hi(t)),n=e.length;while(n--)i=qu(e[n]),i[Gi]?r.push(i):o.push(i);i=Zi(t,$u(o,r)),i.selector=t}return i},vi=Du.select=function(t,e,n,r){var o,i,u,a,c,s="function"===typeof t&&t,l=!r&&hi(t=s.selector||t);if(n=n||[],1===l.length){if(i=l[0]=l[0].slice(0),i.length>2&&"ID"===(u=i[0]).type&&fi.getById&&9===e.nodeType&&ki&&di.relative[i[1].type]){if(e=(di.find.ID(u.matches[0].replace(_u,Au),e)||[])[0],!e)return n;s&&(e=e.parentNode),t=t.slice(i.shift().value.length)}o=xu.needsContext.test(t)?0:i.length;while(o--){if(u=i[o],di.relative[a=u.type])break;if((c=di.find[a])&&(r=c(u.matches[0].replace(_u,Au),Tu.test(i[0].type)&&Hu(e.parentNode)||e))){if(i.splice(o,1),t=r.length&&Lu(i),!t)return au.apply(n,r),n;break}}}return(s||pi(t,l))(r,e,!ki,n,Tu.test(t)&&Hu(e.parentNode)||e),n},fi.sortStable=Gi.split("").sort(tu).join("")===Gi,fi.detectDuplicates=!!wi,xi(),fi.sortDetached=!0;var Gu=n.document,Ku=Array.prototype.push,Xu=Array.prototype.slice,Yu=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,Ju=$i.Event,Qu=nn.makeMap("children,contents,next,prev"),Zu=function(t){return"undefined"!==typeof t},ta=function(t){return"string"===typeof t},ea=function(t){return t&&t===t.window},na=function(t,e){e=e||Gu;var n,r=e.createElement("div"),o=e.createDocumentFragment();r.innerHTML=t;while(n=r.firstChild)o.appendChild(n);return o},ra=function(t,e,n,r){var o;if(ta(e))e=na(e,ba(t[0]));else if(e.length&&!e.nodeType){if(e=Ca.makeArray(e),r)for(o=e.length-1;o>=0;o--)ra(t,e[o],n,r);else for(o=0;o<e.length;o++)ra(t,e[o],n,r);return t}if(e.nodeType){o=t.length;while(o--)n.call(t[o],e)}return t},oa=function(t,e){return t&&e&&-1!==(" "+t.className+" ").indexOf(" "+e+" ")},ia=function(t,e,n){var r,o;return e=Ca(e)[0],t.each((function(){var t=this;n&&r===t.parentNode||(r=t.parentNode,o=e.cloneNode(!1),t.parentNode.insertBefore(o,t)),o.appendChild(t)})),t},ua=nn.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),aa=nn.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),ca={for:"htmlFor",class:"className",readonly:"readOnly"},sa={float:"cssFloat"},la={},fa={},da=function(t,e){return new Ca.fn.init(t,e)},ma=function(t,e){var n;if(e.indexOf)return e.indexOf(t);n=e.length;while(n--)if(e[n]===t)return n;return-1},ga=/^\s*|\s*$/g,ha=function(t){return null===t||void 0===t?"":(""+t).replace(ga,"")},pa=function(t,e){var n,r,o,i;if(t)if(n=t.length,void 0===n){for(r in t)if(t.hasOwnProperty(r)&&(i=t[r],!1===e.call(i,r,i)))break}else for(o=0;o<n;o++)if(i=t[o],!1===e.call(i,o,i))break;return t},va=function(t,e){var n=[];return pa(t,(function(t,r){e(r,t)&&n.push(r)})),n},ba=function(t){return t?9===t.nodeType?t:t.ownerDocument:Gu};da.fn=da.prototype={constructor:da,selector:"",context:null,length:0,init:function(t,e){var r,o,i=this;if(!t)return i;if(t.nodeType)return i.context=i[0]=t,i.length=1,i;if(e&&e.nodeType)i.context=e;else{if(e)return Ca(t).attr(e);i.context=e=n.document}if(ta(t)){if(i.selector=t,r="<"===t.charAt(0)&&">"===t.charAt(t.length-1)&&t.length>=3?[null,t,null]:Yu.exec(t),!r)return Ca(e).find(t);if(r[1]){o=na(t,ba(e)).firstChild;while(o)Ku.call(i,o),o=o.nextSibling}else{if(o=ba(e).getElementById(r[2]),!o)return i;if(o.id!==r[2])return i.find(t);i.length=1,i[0]=o}}else this.add(t,!1);return i},toArray:function(){return nn.toArray(this)},add:function(t,e){var n,r,o=this;if(ta(t))return o.add(Ca(t));if(!1!==e)for(n=Ca.unique(o.toArray().concat(Ca.makeArray(t))),o.length=n.length,r=0;r<n.length;r++)o[r]=n[r];else Ku.apply(o,Ca.makeArray(t));return o},attr:function(t,e){var n,r=this;if("object"===typeof t)pa(t,(function(t,e){r.attr(t,e)}));else{if(!Zu(e)){if(r[0]&&1===r[0].nodeType){if(n=la[t],n&&n.get)return n.get(r[0],t);if(aa[t])return r.prop(t)?t:void 0;e=r[0].getAttribute(t,2),null===e&&(e=void 0)}return e}this.each((function(){var n;if(1===this.nodeType){if(n=la[t],n&&n.set)return void n.set(this,e);null===e?this.removeAttribute(t,2):this.setAttribute(t,e,2)}}))}return r},removeAttr:function(t){return this.attr(t,null)},prop:function(t,e){var n=this;if(t=ca[t]||t,"object"===typeof t)pa(t,(function(t,e){n.prop(t,e)}));else{if(!Zu(e))return n[0]&&n[0].nodeType&&t in n[0]?n[0][t]:e;this.each((function(){1===this.nodeType&&(this[t]=e)}))}return n},css:function(t,e){var n,r,o=this,i=function(t){return t.replace(/-(\D)/g,(function(t,e){return e.toUpperCase()}))},u=function(t){return t.replace(/[A-Z]/g,(function(t){return"-"+t}))};if("object"===typeof t)pa(t,(function(t,e){o.css(t,e)}));else if(Zu(e))t=i(t),"number"!==typeof e||ua[t]||(e=e.toString()+"px"),o.each((function(){var n=this.style;if(r=fa[t],r&&r.set)r.set(this,e);else{try{this.style[sa[t]||t]=e}catch(o){}null!==e&&""!==e||(n.removeProperty?n.removeProperty(u(t)):n.removeAttribute(t))}}));else{if(n=o[0],r=fa[t],r&&r.get)return r.get(n);if(!n.ownerDocument.defaultView)return n.currentStyle?n.currentStyle[i(t)]:"";try{return n.ownerDocument.defaultView.getComputedStyle(n,null).getPropertyValue(u(t))}catch(a){return}}return o},remove:function(){var t,e=this,n=this.length;while(n--)t=e[n],Ju.clean(t),t.parentNode&&t.parentNode.removeChild(t);return this},empty:function(){var t,e=this,n=this.length;while(n--){t=e[n];while(t.firstChild)t.removeChild(t.firstChild)}return this},html:function(t){var e,n=this;if(Zu(t)){e=n.length;try{while(e--)n[e].innerHTML=t}catch(r){Ca(n[e]).empty().append(t)}return n}return n[0]?n[0].innerHTML:""},text:function(t){var e,n=this;if(Zu(t)){e=n.length;while(e--)"innerText"in n[e]?n[e].innerText=t:n[0].textContent=t;return n}return n[0]?n[0].innerText||n[0].textContent:""},append:function(){return ra(this,arguments,(function(t){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.appendChild(t)}))},prepend:function(){return ra(this,arguments,(function(t){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.insertBefore(t,this.firstChild)}),!0)},before:function(){var t=this;return t[0]&&t[0].parentNode?ra(t,arguments,(function(t){this.parentNode.insertBefore(t,this)})):t},after:function(){var t=this;return t[0]&&t[0].parentNode?ra(t,arguments,(function(t){this.parentNode.insertBefore(t,this.nextSibling)}),!0):t},appendTo:function(t){return Ca(t).append(this),this},prependTo:function(t){return Ca(t).prepend(this),this},replaceWith:function(t){return this.before(t).remove()},wrap:function(t){return ia(this,t)},wrapAll:function(t){return ia(this,t,!0)},wrapInner:function(t){return this.each((function(){Ca(this).contents().wrapAll(t)})),this},unwrap:function(){return this.parent().each((function(){Ca(this).replaceWith(this.childNodes)}))},clone:function(){var t=[];return this.each((function(){t.push(this.cloneNode(!0))})),Ca(t)},addClass:function(t){return this.toggleClass(t,!0)},removeClass:function(t){return this.toggleClass(t,!1)},toggleClass:function(t,e){var n=this;return"string"!==typeof t||(-1!==t.indexOf(" ")?pa(t.split(" "),(function(){n.toggleClass(this,e)})):n.each((function(n,r){var o=oa(r,t);if(o!==e){var i=r.className;o?r.className=ha((" "+i+" ").replace(" "+t+" "," ")):r.className+=i?" "+t:t}}))),n},hasClass:function(t){return oa(this[0],t)},each:function(t){return pa(this,t)},on:function(t,e){return this.each((function(){Ju.bind(this,t,e)}))},off:function(t,e){return this.each((function(){Ju.unbind(this,t,e)}))},trigger:function(t){return this.each((function(){"object"===typeof t?Ju.fire(this,t.type,t):Ju.fire(this,t)}))},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return new Ca(Xu.apply(this,arguments))},eq:function(t){return-1===t?this.slice(t):this.slice(t,+t+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},find:function(t){var e,n,r=[];for(e=0,n=this.length;e<n;e++)Ca.find(t,this[e],r);return Ca(r)},filter:function(t){return Ca("function"===typeof t?va(this.toArray(),(function(e,n){return t(n,e)})):Ca.filter(t,this.toArray()))},closest:function(t){var e=[];return t instanceof Ca&&(t=t[0]),this.each((function(n,r){while(r){if("string"===typeof t&&Ca(r).is(t)){e.push(r);break}if(r===t){e.push(r);break}r=r.parentNode}})),Ca(e)},offset:function(t){var e,n,r,o,i=0,u=0;return t?this.css(t):(e=this[0],e&&(n=e.ownerDocument,r=n.documentElement,e.getBoundingClientRect&&(o=e.getBoundingClientRect(),i=o.left+(r.scrollLeft||n.body.scrollLeft)-r.clientLeft,u=o.top+(r.scrollTop||n.body.scrollTop)-r.clientTop)),{left:i,top:u})},push:Ku,sort:Array.prototype.sort,splice:Array.prototype.splice},nn.extend(da,{extend:nn.extend,makeArray:function(t){return ea(t)||t.nodeType?[t]:nn.toArray(t)},inArray:ma,isArray:nn.isArray,each:pa,trim:ha,grep:va,find:Du,expr:Du.selectors,unique:Du.uniqueSort,text:Du.getText,contains:Du.contains,filter:function(t,e,n){var r=e.length;n&&(t=":not("+t+")");while(r--)1!==e[r].nodeType&&e.splice(r,1);return e=1===e.length?Ca.find.matchesSelector(e[0],t)?[e[0]]:[]:Ca.find.matches(t,e),e}});var ya=function(t,e,n){var r=[],o=t[e];"string"!==typeof n&&n instanceof Ca&&(n=n[0]);while(o&&9!==o.nodeType){if(void 0!==n){if(o===n)break;if("string"===typeof n&&Ca(o).is(n))break}1===o.nodeType&&r.push(o),o=o[e]}return r},wa=function(t,e,n,r){var o=[];for(r instanceof Ca&&(r=r[0]);t;t=t[e])if(!n||t.nodeType===n){if(void 0!==r){if(t===r)break;if("string"===typeof r&&Ca(t).is(r))break}o.push(t)}return o},xa=function(t,e,n){for(t=t[e];t;t=t[e])if(t.nodeType===n)return t;return null};pa({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return ya(t,"parentNode")},next:function(t){return xa(t,"nextSibling",1)},prev:function(t){return xa(t,"previousSibling",1)},children:function(t){return wa(t.firstChild,"nextSibling",1)},contents:function(t){return nn.toArray(("iframe"===t.nodeName?t.contentDocument||t.contentWindow.document:t).childNodes)}},(function(t,e){da.fn[t]=function(n){var r=this,o=[];r.each((function(){var t=e.call(o,this,n,o);t&&(Ca.isArray(t)?o.push.apply(o,t):o.push(t))})),this.length>1&&(Qu[t]||(o=Ca.unique(o)),0===t.indexOf("parents")&&(o=o.reverse()));var i=Ca(o);return n?i.filter(n):i}})),pa({parentsUntil:function(t,e){return ya(t,"parentNode",e)},nextUntil:function(t,e){return wa(t,"nextSibling",1,e).slice(1)},prevUntil:function(t,e){return wa(t,"previousSibling",1,e).slice(1)}},(function(t,e){da.fn[t]=function(n,r){var o=this,i=[];o.each((function(){var t=e.call(i,this,n,i);t&&(Ca.isArray(t)?i.push.apply(i,t):i.push(t))})),this.length>1&&(i=Ca.unique(i),0!==t.indexOf("parents")&&"prevUntil"!==t||(i=i.reverse()));var u=Ca(i);return r?u.filter(r):u}})),da.fn.is=function(t){return!!t&&this.filter(t).length>0},da.fn.init.prototype=da.fn,da.overrideDefaults=function(t){var e,n=function(r,o){return e=e||t(),0===arguments.length&&(r=e.element),o||(o=e.context),new n.fn.init(r,o)};return Ca.extend(n,this),n},da.attrHooks=la,da.cssHooks=fa;var Ca=da,Sa=function(){function t(t,e){this.node=t,this.rootNode=e,this.current=this.current.bind(this),this.next=this.next.bind(this),this.prev=this.prev.bind(this),this.prev2=this.prev2.bind(this)}return t.prototype.current=function(){return this.node},t.prototype.next=function(t){return this.node=this.findSibling(this.node,"firstChild","nextSibling",t),this.node},t.prototype.prev=function(t){return this.node=this.findSibling(this.node,"lastChild","previousSibling",t),this.node},t.prototype.prev2=function(t){return this.node=this.findPreviousNode(this.node,"lastChild","previousSibling",t),this.node},t.prototype.findSibling=function(t,e,n,r){var o,i;if(t){if(!r&&t[e])return t[e];if(t!==this.rootNode){if(o=t[n],o)return o;for(i=t.parentNode;i&&i!==this.rootNode;i=i.parentNode)if(o=i[n],o)return o}}},t.prototype.findPreviousNode=function(t,e,n,r){var o,i,u;if(t){if(o=t[n],this.rootNode&&o===this.rootNode)return;if(o){if(!r)for(u=o[e];u;u=u[e])if(!u[e])return u;return o}if(i=t.parentNode,i&&i!==this.rootNode)return i}},t}(),ka={},Oa={exports:ka};(function(t,n,r,o){(function(o){if("object"===typeof n&&"undefined"!==typeof r)r.exports=o();else if("function"===typeof t&&t.amd)t([],o);else{var i;i="undefined"!==typeof window?window:"undefined"!==typeof e?e:"undefined"!==typeof self?self:this,i.EphoxContactWrapper=o()}})((function(){return function(){function t(e,n,r){function i(a,c){if(!n[a]){if(!e[a]){var s="function"==typeof o&&o;if(!c&&s)return s(a,!0);if(u)return u(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var f=n[a]={exports:{}};e[a][0].call(f.exports,(function(t){var n=e[a][1][t];return i(n||t)}),f,f.exports,t,e,n,r)}return n[a].exports}for(var u="function"==typeof o&&o,a=0;a<r.length;a++)i(r[a]);return i}return t}()({1:[function(t,e,n){var r,o,i=e.exports={};function u(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function c(t){if(r===setTimeout)return setTimeout(t,0);if((r===u||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(XI){try{return r.call(null,t,0)}catch(XI){return r.call(this,t,0)}}}function s(t){if(o===clearTimeout)return clearTimeout(t);if((o===a||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{return o(t)}catch(XI){try{return o.call(null,t)}catch(XI){return o.call(this,t)}}}(function(){try{r="function"===typeof setTimeout?setTimeout:u}catch(XI){r=u}try{o="function"===typeof clearTimeout?clearTimeout:a}catch(XI){o=a}})();var l,f=[],d=!1,m=-1;function g(){d&&l&&(d=!1,l.length?f=l.concat(f):m=-1,f.length&&h())}function h(){if(!d){var t=c(g);d=!0;var e=f.length;while(e){l=f,f=[];while(++m<e)l&&l[m].run();m=-1,e=f.length}l=null,d=!1,s(t)}}function p(t,e){this.fun=t,this.array=e}function v(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];f.push(new p(t,e)),1!==f.length||d||c(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=v,i.addListener=v,i.once=v,i.off=v,i.removeListener=v,i.removeAllListeners=v,i.emit=v,i.prependListener=v,i.prependOnceListener=v,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],2:[function(t,e,n){(function(t){(function(n){var r=setTimeout;function o(){}function i(t,e){return function(){t.apply(e,arguments)}}function u(t){if("object"!==typeof this)throw new TypeError("Promises must be constructed via new");if("function"!==typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],d(t,this)}function a(t,e){while(3===t._state)t=t._value;0!==t._state?(t._handled=!0,u._immediateFn((function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(XI){return void s(e.promise,XI)}c(e.promise,r)}else(1===t._state?c:s)(e.promise,t._value)}))):t._deferreds.push(e)}function c(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"===typeof e||"function"===typeof e)){var n=e.then;if(e instanceof u)return t._state=3,t._value=e,void l(t);if("function"===typeof n)return void d(i(n,e),t)}t._state=1,t._value=e,l(t)}catch(XI){s(t,XI)}}function s(t,e){t._state=2,t._value=e,l(t)}function l(t){2===t._state&&0===t._deferreds.length&&u._immediateFn((function(){t._handled||u._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)a(t,t._deferreds[e]);t._deferreds=null}function f(t,e,n){this.onFulfilled="function"===typeof t?t:null,this.onRejected="function"===typeof e?e:null,this.promise=n}function d(t,e){var n=!1;try{t((function(t){n||(n=!0,c(e,t))}),(function(t){n||(n=!0,s(e,t))}))}catch(r){if(n)return;n=!0,s(e,r)}}u.prototype["catch"]=function(t){return this.then(null,t)},u.prototype.then=function(t,e){var n=new this.constructor(o);return a(this,new f(t,e,n)),n},u.all=function(t){var e=Array.prototype.slice.call(t);return new u((function(t,n){if(0===e.length)return t([]);var r=e.length;function o(i,u){try{if(u&&("object"===typeof u||"function"===typeof u)){var a=u.then;if("function"===typeof a)return void a.call(u,(function(t){o(i,t)}),n)}e[i]=u,0===--r&&t(e)}catch(c){n(c)}}for(var i=0;i<e.length;i++)o(i,e[i])}))},u.resolve=function(t){return t&&"object"===typeof t&&t.constructor===u?t:new u((function(e){e(t)}))},u.reject=function(t){return new u((function(e,n){n(t)}))},u.race=function(t){return new u((function(e,n){for(var r=0,o=t.length;r<o;r++)t[r].then(e,n)}))},u._immediateFn="function"===typeof t?function(e){t(e)}:function(t){r(t,0)},u._unhandledRejectionFn=function(t){"undefined"!==typeof console&&console},u._setImmediateFn=function(t){u._immediateFn=t},u._setUnhandledRejectionFn=function(t){u._unhandledRejectionFn=t},"undefined"!==typeof e&&e.exports?e.exports=u:n.Promise||(n.Promise=u)})(this)}).call(this,t("timers").setImmediate)},{timers:3}],3:[function(t,e,n){(function(e,r){var o=t("process/browser.js").nextTick,i=Function.prototype.apply,u=Array.prototype.slice,a={},c=0;function s(t,e){this._id=t,this._clearFn=e}n.setTimeout=function(){return new s(i.call(setTimeout,window,arguments),clearTimeout)},n.setInterval=function(){return new s(i.call(setInterval,window,arguments),clearInterval)},n.clearTimeout=n.clearInterval=function(t){t.close()},s.prototype.unref=s.prototype.ref=function(){},s.prototype.close=function(){this._clearFn.call(window,this._id)},n.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},n.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},n._unrefActive=n.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},n.setImmediate="function"===typeof e?e:function(t){var e=c++,r=!(arguments.length<2)&&u.call(arguments,1);return a[e]=!0,o((function(){a[e]&&(r?t.apply(null,r):t.call(null),n.clearImmediate(e))})),e},n.clearImmediate="function"===typeof r?r:function(t){delete a[t]}}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(t,e,n){var r=t("promise-polyfill"),o=function(){return"undefined"!==typeof window?window:Function("return this;")()}();e.exports={boltExport:o.Promise||r}},{"promise-polyfill":2}]},{},[4])(4)}))})(void 0,ka,Oa,void 0);var Ta,Ea=Oa.exports.boltExport,_a=function(t){var e=_.none(),r=[],o=function(t){return _a((function(e){i((function(n){e(t(n))}))}))},i=function(t){a()?s(t):r.push(t)},u=function(t){a()||(e=_.some(t),c(r),r=[])},a=function(){return e.isSome()},c=function(t){X(t,s)},s=function(t){e.each((function(e){n.setTimeout((function(){t(e)}),0)}))};return t(u),{get:i,map:o,isReady:a}},Aa=function(t){return _a((function(e){e(t)}))},Da={nu:_a,pure:Aa},Na=function(t){n.setTimeout((function(){throw t}),0)},Ra=function(t){var e=function(e){t().then(e,Na)},n=function(e){return Ra((function(){return t().then(e)}))},r=function(e){return Ra((function(){return t().then((function(t){return e(t).toPromise()}))}))},o=function(e){return Ra((function(){return t().then((function(){return e.toPromise()}))}))},i=function(){return Da.nu(e)},u=function(){var e=null;return Ra((function(){return null===e&&(e=t()),e}))},a=t;return{map:n,bind:r,anonBind:o,toLazy:i,toCached:u,toPromise:a,get:e}},Ma=function(t){return Ra((function(){return new Ea(t)}))},za=function(t){return Ra((function(){return Ea.resolve(t)}))},Ba={nu:Ma,pure:za},Pa=function(t,e){return e((function(e){var n=[],r=0,o=function(o){return function(i){n[o]=i,r++,r>=t.length&&e(n)}};0===t.length?e([]):X(t,(function(t,e){t.get(o(e))}))}))},Ha=function(t){return Pa(t,Ba.nu)},Ia=function(t){var e=function(e){return t===e},n=function(e){return Ia(t)},r=function(e){return Ia(t)},o=function(e){return Ia(e(t))},i=function(e){return Ia(t)},u=function(e){e(t)},a=function(e){return e(t)},c=function(e,n){return n(t)},s=function(e){return e(t)},l=function(e){return e(t)},f=function(){return _.some(t)};return{is:e,isValue:S,isError:C,getOr:v(t),getOrThunk:v(t),getOrDie:v(t),or:n,orThunk:r,fold:c,map:o,mapError:i,each:u,bind:a,exists:s,forall:l,toOption:f}},La=function(t){var e=function(t){return t()},n=function(){return x(String(t))()},r=function(t){return t},o=function(t){return t()},i=function(e){return La(t)},u=function(e){return La(e(t))},a=function(e){return La(t)},c=function(e,n){return e(t)};return{is:C,isValue:C,isError:S,getOr:b,getOrThunk:e,getOrDie:n,or:r,orThunk:o,fold:c,map:i,mapError:u,each:g,bind:a,exists:C,forall:S,toOption:_.none}},Fa=function(t,e){return t.fold((function(){return La(e)}),Ia)},Va={value:Ia,error:La,fromOption:Fa},Ua=function(t){if(!B(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],r={};return X(t,(function(o,i){var u=gt(o);if(1!==u.length)throw new Error("one and only one name per case");var a=u[0],c=o[a];if(void 0!==r[a])throw new Error("duplicate key detected:"+a);if("cata"===a)throw new Error("cannot have a case named cata (sorry)");if(!B(c))throw new Error("case arguments must be an array");e.push(a),r[a]=function(){var r=arguments.length;if(r!==c.length)throw new Error("Wrong number of arguments to case "+a+". Expected "+c.length+" ("+c+"), got "+r);for(var o=new Array(r),u=0;u<o.length;u++)o[u]=arguments[u];var s=function(t){var n=gt(t);if(e.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+n.join(","));var r=ut(e,(function(t){return $(n,t)}));if(!r)throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+e.join(", "));return t[a].apply(null,o)};return{fold:function(){if(arguments.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+arguments.length);var e=arguments[i];return e.apply(null,o)},match:s,log:function(t){n.console.log(t,{constructors:e,constructor:a,params:o})}}}})),r},ja={generate:Ua},Wa=(ja.generate([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),function(t){return t.fold(b,b)}),qa=function(){function t(t,e){return function(){t.apply(e,arguments)}}var e=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},r=function(e){if("object"!==typeof this)throw new TypeError("Promises must be constructed via new");if("function"!==typeof e)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],l(e,t(u,this),t(a,this))},o=r.immediateFn||"function"===typeof n.setImmediate&&n.setImmediate||function(t){n.setTimeout(t,1)};function i(t){var e=this;null!==this._state?o((function(){var n=e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(XI){return void t.reject(XI)}t.resolve(r)}else(e._state?t.resolve:t.reject)(e._value)})):this._deferreds.push(t)}function u(e){try{if(e===this)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"===typeof e||"function"===typeof e)){var n=e.then;if("function"===typeof n)return void l(t(n,e),t(u,this),t(a,this))}this._state=!0,this._value=e,c.call(this)}catch(XI){a.call(this,XI)}}function a(t){this._state=!1,this._value=t,c.call(this)}function c(){for(var t=0,e=this._deferreds.length;t<e;t++)i.call(this,this._deferreds[t]);this._deferreds=null}function s(t,e,n,r){this.onFulfilled="function"===typeof t?t:null,this.onRejected="function"===typeof e?e:null,this.resolve=n,this.reject=r}function l(t,e,n){var r=!1;try{t((function(t){r||(r=!0,e(t))}),(function(t){r||(r=!0,n(t))}))}catch(o){if(r)return;r=!0,n(o)}}return r.prototype.catch=function(t){return this.then(null,t)},r.prototype.then=function(t,e){var n=this;return new r((function(r,o){i.call(n,new s(t,e,r,o))}))},r.all=function(){var t=Array.prototype.slice.call(1===arguments.length&&e(arguments[0])?arguments[0]:arguments);return new r((function(e,n){if(0===t.length)return e([]);var r=t.length;function o(i,u){try{if(u&&("object"===typeof u||"function"===typeof u)){var a=u.then;if("function"===typeof a)return void a.call(u,(function(t){o(i,t)}),n)}t[i]=u,0===--r&&e(t)}catch(c){n(c)}}for(var i=0;i<t.length;i++)o(i,t[i])}))},r.resolve=function(t){return t&&"object"===typeof t&&t.constructor===r?t:new r((function(e){e(t)}))},r.reject=function(t){return new r((function(e,n){n(t)}))},r.race=function(t){return new r((function(e,n){for(var r=0,o=t.length;r<o;r++)t[r].then(e,n)}))},r},$a=window.Promise?window.Promise:qa(),Ga=function(t,e){var r,o=n.window.requestAnimationFrame,i=["ms","moz","webkit"],u=function(t){n.window.setTimeout(t,0)};for(r=0;r<i.length&&!o;r++)o=n.window[i[r]+"RequestAnimationFrame"];o||(o=u),o(t,e)},Ka=function(t,e){return"number"!==typeof e&&(e=0),n.setTimeout(t,e)},Xa=function(t,e){return"number"!==typeof e&&(e=1),n.setInterval(t,e)},Ya=function(t){return n.clearTimeout(t)},Ja=function(t){return n.clearInterval(t)},Qa=function(t,e){var r,o=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];n.clearTimeout(r),r=Ka((function(){t.apply(this,o)}),e)};return o.stop=function(){n.clearTimeout(r)},o},Za={requestAnimationFrame:function(t,e){Ta?Ta.then(t):Ta=new $a((function(t){e||(e=n.document.body),Ga(t,e)})).then(t)},setTimeout:Ka,setInterval:Xa,setEditorTimeout:function(t,e,n){return Ka((function(){t.removed||e()}),n)},setEditorInterval:function(t,e,r){var o=Xa((function(){t.removed?n.clearInterval(o):e()}),r);return o},debounce:Qa,throttle:Qa,clearInterval:Ja,clearTimeout:Ya};function tc(t,e){void 0===e&&(e={});var r=0,o={},i=sn.fromDom(t),u=Pn(i),a=e.maxLoadTime||5e3,c=function(t){e.referrerPolicy=t},s=function(t){ur(tr(i),t)},l=function(i,c,l){var f,d,m,g=function(t){m.status=t,m.passed=[],m.failed=[],f&&(f.onload=null,f.onerror=null,f=null)},h=function(){var t=m.passed,e=t.length;while(e--)t[e]();g(2)},p=function(){var t=m.failed,e=t.length;while(e--)t[e]();g(3)},v=function(){var t=n.navigator.userAgent.match(/WebKit\/(\d*)/);return!!(t&&parseInt(t[1],10)<536)},b=function(t,e){t()||((new Date).getTime()-x<a?Za.setTimeout(e):p())},y=function(){b((function(){var e,n,r=t.styleSheets,o=r.length;while(o--)if(e=r[o],n=e.ownerNode?e.ownerNode:e.owningElement,n&&n.id===f.id)return h(),!0}),y)},w=function(){b((function(){try{var t=d.sheet.cssRules;return h(),!!t}catch(e){}}),w)};if(i=nn._addCacheSuffix(i),o[i]?m=o[i]:(m={passed:[],failed:[]},o[i]=m),c&&m.passed.push(c),l&&m.failed.push(l),1!==m.status)if(2!==m.status)if(3!==m.status){m.status=1,f=u.dom().createElement("link"),f.rel="stylesheet",f.type="text/css",f.id="u"+r++,f.async=!1,f.defer=!1;var x=(new Date).getTime();if(e.contentCssCors&&(f.crossOrigin="anonymous"),e.referrerPolicy&&Gr(sn.fromDom(f),"referrerpolicy",e.referrerPolicy),"onload"in f&&!v())f.onload=y,f.onerror=p;else{if(n.navigator.userAgent.indexOf("Firefox")>0)return d=u.dom().createElement("style"),d.textContent='@import "'+i+'"',w(),void s(sn.fromDom(d));y()}s(sn.fromDom(f)),f.href=i}else p();else h()},f=function(t){return Ba.nu((function(e){l(t,h(e,v(Va.value(t))),h(e,v(Va.error(t))))}))},d=function(t,e,n){Ha(K(t,f)).get((function(t){var r=J(t,(function(t){return t.isValue()}));r.fail.length>0?n(r.fail.map(Wa)):e(r.pass.map(Wa))}))};return{load:l,loadAll:d,_setReferrerPolicy:c}}var ec=function(){var t=new WeakMap,e=function(e,n){var r=Zn(e),o=r.dom();return _.from(t.get(o)).getOrThunk((function(){var e=tc(o,n);return t.set(o,e),e}))};return{forElement:e}},nc=ec(),rc=nn.each,oc=nn.grep,ic=je.ie,uc=/^([a-z0-9],?)+$/i,ac=/^[ \t\r\n]*$/,cc=function(t,e,n){var r=e.keep_values,o={set:function(t,r,o){e.url_converter&&(r=e.url_converter.call(e.url_converter_scope||n(),r,o,t[0])),t.attr("data-mce-"+o,r).attr(o,r)},get:function(t,e){return t.attr("data-mce-"+e)||t.attr(e)}},i={style:{set:function(e,n){null===n||"object"!==typeof n?(r&&e.attr("data-mce-style",n),null!==n&&"string"===typeof n?(e.removeAttr("style"),e.css(t.parse(n))):e.attr("style",n)):e.css(n)},get:function(e){var n=e.attr("data-mce-style")||e.attr("style");return n=t.serialize(t.parse(n),e[0].nodeName),n}}};return r&&(i.href=i.src=o),i},sc=function(t,e){var n=e.attr("style"),r=t.serialize(t.parse(n),e[0].nodeName);r||(r=null),e.attr("data-mce-style",r)},lc=function(t,e){var n,r,o=0;if(t)for(n=t.nodeType,t=t.previousSibling;t;t=t.previousSibling)r=t.nodeType,(!e||3!==r||r!==n&&t.nodeValue.length)&&(o++,n=r);return o};function fc(t,e){var r=this;void 0===e&&(e={});var o={},i=n.window,u={},a=0,c=!0,s=!0,l=nc.forElement(sn.fromDom(t),{contentCssCors:e.contentCssCors,referrerPolicy:e.referrerPolicy}),f=[],d=e.schema?e.schema:li({}),m=zi({url_converter:e.url_converter,url_converter_scope:e.url_converter_scope},e.schema),g=e.ownEvents?new $i:$i.Event,h=d.getBlockElements(),p=Ca.overrideDefaults((function(){return{context:t,element:_t.getRoot()}})),v=function(t){if("string"===typeof t)return!!h[t];if(t){var e=t.nodeType;if(e)return!(1!==e||!h[t.nodeName])}return!1},b=function(e){return e&&t&&M(e)?t.getElementById(e):e},y=function(t){return p("string"===typeof t?b(t):t)},w=function(t,e,n){var r,o,i=y(t);return i.length&&(r=At[e],o=r&&r.get?r.get(i,e):i.attr(e)),"undefined"===typeof o&&(o=n||""),o},x=function(t){var e=b(t);return e?e.attributes:[]},C=function(t,n,r){""===r&&(r=null);var o=y(t),i=o.attr(n);if(o.length){var u=At[n];u&&u.set?u.set(o,r,n):o.attr(n,r),i!==r&&e.onSetAttrib&&e.onSetAttrib({attrElm:o,attrName:n,attrValue:r})}},S=function(e,n){if(!ic||1!==e.nodeType||n)return e.cloneNode(n);var r=t.createElement(e.nodeName);return rc(x(e),(function(t){C(r,t.nodeName,w(e,t.nodeName))})),r},k=function(){return e.root_element||t.body},O=function(t){var e=Or(t);return{x:e.x,y:e.y,w:e.width,h:e.height}},T=function(e,n){return so(t.body,b(e),n)},E=function(t,n,r){var o=M(n)?y(t).css(n,r):y(t).css(n);e.update_styles&&sc(m,o)},_=function(t,n){var r=y(t).css(n);e.update_styles&&sc(m,r)},A=function(t,e,n){var r=y(t);return n?r.css(e):(e=e.replace(/-(\D)/g,(function(t,e){return e.toUpperCase()})),"float"===e&&(e=je.browser.isIE()?"styleFloat":"cssFloat"),r[0]&&r[0].style?r[0].style[e]:void 0)},D=function(t){var e,n;return t=b(t),e=A(t,"width"),n=A(t,"height"),-1===e.indexOf("px")&&(e=0),-1===n.indexOf("px")&&(n=0),{w:parseInt(e,10)||t.offsetWidth||t.clientWidth,h:parseInt(n,10)||t.offsetHeight||t.clientHeight}},N=function(t){t=b(t);var e=T(t),n=D(t);return{x:e.x,y:e.y,w:n.w,h:n.h}},R=function(t,e){var n;if(!t)return!1;if(!Array.isArray(t)){if("*"===e)return 1===t.nodeType;if(uc.test(e)){var r=e.toLowerCase().split(/,/),o=t.nodeName.toLowerCase();for(n=r.length-1;n>=0;n--)if(r[n]===o)return!0;return!1}if(t.nodeType&&1!==t.nodeType)return!1}var i=Array.isArray(t)?t:[t];return Du(e,i[0].ownerDocument||i[0],null,i).length>0},z=function(t,e,n,r){var o,i=[],u=b(t);r=void 0===r,n=n||("BODY"!==k().nodeName?k().parentNode:null),nn.is(e,"string")&&(o=e,e="*"===e?function(t){return 1===t.nodeType}:function(t){return R(t,o)});while(u){if(u===n||!u.nodeType||9===u.nodeType)break;if(!e||"function"===typeof e&&e(u)){if(!r)return[u];i.push(u)}u=u.parentNode}return r?i:null},B=function(t,e,n){var r=z(t,e,n,!1);return r&&r.length>0?r[0]:null},P=function(t,e,n){var r=e;if(t)for("string"===typeof e&&(r=function(t){return R(t,e)}),t=t[n];t;t=t[n])if("function"===typeof r&&r(t))return t;return null},H=function(t,e){return P(t,e,"nextSibling")},I=function(t,e){return P(t,e,"previousSibling")},L=function(n,r){return Du(n,b(r)||e.root_element||t,[])},F=function(t,e,n){var o,i="string"===typeof t?b(t):t;if(!i)return!1;if(nn.isArray(i)&&(i.length||0===i.length))return o=[],rc(i,(function(t,r){t&&("string"===typeof t&&(t=b(t)),o.push(e.call(n,t,r)))})),o;var u=n||r;return e.call(u,i)},V=function(t,e){y(t).each((function(t,n){rc(e,(function(t,e){C(n,e,t)}))}))},U=function(t,e){var n=y(t);ic?n.each((function(t,n){if(!1!==n.canHaveHTML){while(n.firstChild)n.removeChild(n.firstChild);try{n.innerHTML="<br>"+e,n.removeChild(n.firstChild)}catch(r){Ca("<div></div>").html("<br>"+e).contents().slice(1).appendTo(n)}return e}})):n.html(e)},j=function(e,n,r,o,i){return F(e,(function(e){var u="string"===typeof n?t.createElement(n):n;return V(u,r),o&&("string"!==typeof o&&o.nodeType?u.appendChild(o):"string"===typeof o&&U(u,o)),i?u:e.appendChild(u)}))},W=function(e,n,r){return j(t.createElement(e),e,n,r,!0)},q=Zo.decode,$=Zo.encodeAllRaw,G=function(t,e,n){var r,o="";for(r in o+="<"+t,e)e.hasOwnProperty(r)&&null!==e[r]&&"undefined"!==typeof e[r]&&(o+=" "+r+'="'+$(e[r])+'"');return"undefined"!==typeof n?o+">"+n+"</"+t+">":o+" />"},K=function(e){var n,r=t.createElement("div"),o=t.createDocumentFragment();o.appendChild(r),e&&(r.innerHTML=e);while(n=r.firstChild)o.appendChild(n);return o.removeChild(r),o},X=function(t,e){var n=y(t);return e?n.each((function(){var t;while(t=this.firstChild)3===t.nodeType&&0===t.data.length?this.removeChild(t):this.parentNode.insertBefore(t,this)})).remove():n.remove(),n.length>1?n.toArray():n[0]},Y=function(t){return F(t,(function(t){var e,n=t.attributes;for(e=n.length-1;e>=0;e--)t.removeAttributeNode(n.item(e))}))},J=function(t){return m.parse(t)},Q=function(t,e){return m.serialize(t,e)},Z=function(e){var r,i;if(_t!==fc.DOM&&t===n.document){if(o[e])return;o[e]=!0}i=t.getElementById("mceDefaultStyles"),i||(i=t.createElement("style"),i.id="mceDefaultStyles",i.type="text/css",r=t.getElementsByTagName("head")[0],r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i)),i.styleSheet?i.styleSheet.cssText+=e:i.appendChild(t.createTextNode(e))},tt=function(r){if(_t===fc.DOM||t!==n.document){r||(r="");var o=t.getElementsByTagName("head")[0];rc(r.split(","),(function(t){if(t=nn._addCacheSuffix(t),!u[t]){u[t]=!0;var n=W("link",Ht(Ht({rel:"stylesheet",type:"text/css",href:t},e.contentCssCors?{crossOrigin:"anonymous"}:{}),e.referrerPolicy?{referrerPolicy:e.referrerPolicy}:{}));o.appendChild(n)}}))}else fc.DOM.loadCSS(r)},et=function(t,e,n){y(t).toggleClass(e,n).each((function(){""===this.className&&Ca(this).attr("class",null)}))},nt=function(t,e){y(t).addClass(e)},rt=function(t,e){et(t,e,!1)},ot=function(t,e){return y(t).hasClass(e)},it=function(t){y(t).show()},ut=function(t){y(t).hide()},at=function(t){return"none"===y(t).css("display")},ct=function(t){return(t||"mce_")+a++},st=function(t){var e="string"===typeof t?b(t):t;return _r(e)?e.outerHTML:Ca("<div></div>").append(Ca(e).clone()).html()},lt=function(t,e){y(t).each((function(){try{if("outerHTML"in this)return void(this.outerHTML=e)}catch(t){}X(Ca(this).html(e),!0)}))},ft=function(t,e){var n=b(e);return F(t,(function(t){var e=n.parentNode,r=n.nextSibling;return r?e.insertBefore(t,r):e.appendChild(t),t}))},dt=function(t,e,n){return F(e,(function(e){return nn.is(e,"array")&&(t=t.cloneNode(!0)),n&&rc(oc(e.childNodes),(function(e){t.appendChild(e)})),e.parentNode.replaceChild(t,e)}))},mt=function(t,e){var n;return t.nodeName!==e.toUpperCase()&&(n=W(e),rc(x(t),(function(e){C(n,e.nodeName,w(t,e.nodeName))})),dt(n,t,!0)),n||t},gt=function(t,e){var n,r=t;while(r){n=e;while(n&&r!==n)n=n.parentNode;if(r===n)break;r=r.parentNode}return!r&&t.ownerDocument?t.ownerDocument.documentElement:r},ht=function(t){return m.toHex(nn.trim(t))},pt=function(t){if(_r(t)){var e="a"===t.nodeName.toLowerCase()&&!w(t,"href")&&w(t,"id");if(w(t,"name")||w(t,"data-mce-bookmark")||e)return!0}return!1},vt=function(t,e){var n,r,o=0;if(pt(t))return!1;if(t=t.firstChild,t){var i=new Sa(t,t.parentNode),u=d?d.getWhiteSpaceElements():{};e=e||(d?d.getNonEmptyElements():null);do{if(n=t.nodeType,_r(t)){var a=t.getAttribute("data-mce-bogus");if(a){t=i.next("all"===a);continue}if(r=t.nodeName.toLowerCase(),e&&e[r]){if("br"===r){o++,t=i.next();continue}return!1}if(pt(t))return!1}if(8===n)return!1;if(3===n&&!ac.test(t.nodeValue))return!1;if(3===n&&t.parentNode&&u[t.parentNode.nodeName]&&ac.test(t.nodeValue))return!1;t=i.next()}while(t)}return o<=1},bt=function(){return t.createRange()},yt=function(t,e,n){var r,o,i,u=bt();if(t&&e)return u.setStart(t.parentNode,lc(t)),u.setEnd(e.parentNode,lc(e)),r=u.extractContents(),u=bt(),u.setStart(e.parentNode,lc(e)+1),u.setEnd(t.parentNode,lc(t)+1),o=u.extractContents(),i=t.parentNode,i.insertBefore(Bo(_t,r),t),n?i.insertBefore(n,t):i.insertBefore(e,t),i.insertBefore(Bo(_t,o),t),X(t),n||e},wt=function(n,r,o,u){if(nn.isArray(n)){var a=n.length,c=[];while(a--)c[a]=wt(n[a],r,o,u);return c}return!e.collect||n!==t&&n!==i||f.push([n,r,o,u]),g.bind(n,r,o,u||_t)},xt=function(e,n,r){var o;if(nn.isArray(e)){o=e.length;var u=[];while(o--)u[o]=xt(e[o],n,r);return u}if(f.length>0&&(e===t||e===i)){o=f.length;while(o--){var a=f[o];e!==a[0]||n&&n!==a[1]||r&&r!==a[2]||g.unbind(a[0],a[1],a[2])}}return g.unbind(e,n,r)},Ct=function(t,e,n){return g.fire(t,e,n)},St=function(t){if(t&&_r(t)){var e=t.getAttribute("data-mce-contenteditable");return e&&"inherit"!==e?e:"inherit"!==t.contentEditable?t.contentEditable:null}return null},kt=function(t){for(var e=k(),n=null;t&&t!==e;t=t.parentNode)if(n=St(t),null!==n)break;return n},Ot=function(){if(f.length>0){var t=f.length;while(t--){var e=f[t];g.unbind(e[0],e[1],e[2])}}Du.setDocument&&Du.setDocument()},Tt=function(t,e){while(t){if(e===t)return!0;t=t.parentNode}return!1},Et=function(t){return"startContainer: "+t.startContainer.nodeName+", startOffset: "+t.startOffset+", endContainer: "+t.endContainer.nodeName+", endOffset: "+t.endOffset},_t={doc:t,settings:e,win:i,files:u,stdMode:c,boxModel:s,styleSheetLoader:l,boundEvents:f,styles:m,schema:d,events:g,isBlock:v,$:p,$$:y,root:null,clone:S,getRoot:k,getViewPort:O,getRect:N,getSize:D,getParent:B,getParents:z,get:b,getNext:H,getPrev:I,select:L,is:R,add:j,create:W,createHTML:G,createFragment:K,remove:X,setStyle:E,getStyle:A,setStyles:_,removeAllAttribs:Y,setAttrib:C,setAttribs:V,getAttrib:w,getPos:T,parseStyle:J,serializeStyle:Q,addStyle:Z,loadCSS:tt,addClass:nt,removeClass:rt,hasClass:ot,toggleClass:et,show:it,hide:ut,isHidden:at,uniqueId:ct,setHTML:U,getOuterHTML:st,setOuterHTML:lt,decode:q,encode:$,insertAfter:ft,replace:dt,rename:mt,findCommonAncestor:gt,toHex:ht,run:F,getAttribs:x,isEmpty:vt,createRng:bt,nodeIndex:lc,split:yt,bind:wt,unbind:xt,fire:Ct,getContentEditable:St,getContentEditableParent:kt,destroy:Ot,isChildOf:Tt,dumpRng:Et},At=cc(m,e,(function(){return _t}));return _t}(function(t){t.DOM=t(n.document),t.nodeIndex=lc})(fc||(fc={}));var dc=fc,mc=dc.DOM,gc=nn.each,hc=nn.grep,pc=0,vc=1,bc=2,yc=3,wc=function(){function t(t){void 0===t&&(t={}),this.states={},this.queue=[],this.scriptLoadedCallbacks={},this.queueLoadedCallbacks=[],this.loading=0,this.settings=t}return t.prototype._setReferrerPolicy=function(t){this.settings.referrerPolicy=t},t.prototype.loadScript=function(t,e,r){var o,i=mc,u=function(){i.remove(c),o&&(o.onreadystatechange=o.onload=o=null),e()},a=function(){L(r)?r():"undefined"!==typeof n.console&&n.console.log&&n.console.log("Failed to load script: "+t)},c=i.uniqueId();o=n.document.createElement("script"),o.id=c,o.type="text/javascript",o.src=nn._addCacheSuffix(t),this.settings.referrerPolicy&&i.setAttrib(o,"referrerpolicy",this.settings.referrerPolicy),o.onload=u,o.onerror=a,(n.document.getElementsByTagName("head")[0]||n.document.body).appendChild(o)},t.prototype.isDone=function(t){return this.states[t]===bc},t.prototype.markDone=function(t){this.states[t]=bc},t.prototype.add=function(t,e,n,r){var o=this.states[t];void 0===o&&(this.queue.push(t),this.states[t]=pc),e&&(this.scriptLoadedCallbacks[t]||(this.scriptLoadedCallbacks[t]=[]),this.scriptLoadedCallbacks[t].push({success:e,failure:r,scope:n||this}))},t.prototype.load=function(t,e,n,r){return this.add(t,e,n,r)},t.prototype.remove=function(t){delete this.states[t],delete this.scriptLoadedCallbacks[t]},t.prototype.loadQueue=function(t,e,n){this.loadScripts(this.queue,t,e,n)},t.prototype.loadScripts=function(t,e,n,r){var o=this,i=[],u=function(t,e){gc(o.scriptLoadedCallbacks[e],(function(e){L(e[t])&&e[t].call(e.scope)})),o.scriptLoadedCallbacks[e]=void 0};o.queueLoadedCallbacks.push({success:e,failure:r,scope:n||this});var a=function(){var e=hc(t);if(t.length=0,gc(e,(function(t){o.states[t]!==bc?o.states[t]!==yc?o.states[t]!==vc&&(o.states[t]=vc,o.loading++,o.loadScript(t,(function(){o.states[t]=bc,o.loading--,u("success",t),a()}),(function(){o.states[t]=yc,o.loading--,i.push(t),u("failure",t),a()}))):u("failure",t):u("success",t)})),!o.loading){var n=o.queueLoadedCallbacks.slice(0);o.queueLoadedCallbacks.length=0,gc(n,(function(t){0===i.length?L(t.success)&&t.success.call(t.scope):L(t.failure)&&t.failure.call(t.scope,i)}))}};a()},t.ScriptLoader=new t,t}(),xc=function(t){var e=t,n=function(){return e},r=function(t){e=t};return{get:n,set:r}},Cc=function(t){return z(t)&&Tt(t,"raw")},Sc=function(t){return B(t)&&t.length>1},kc={},Oc=xc("en"),Tc=function(){return Ot(kc,Oc.get())},Ec=function(){return vt(kc,(function(t){return Ht({},t)}))},_c=function(t){t&&Oc.set(t)},Ac=function(){return Oc.get()},Dc=function(t,e){var n=kc[t];n||(kc[t]=n={}),pt(e,(function(t,e){n[e.toLowerCase()]=t}))},Nc=function(t){var e=Tc().getOr({}),n=function(t){return L(t)?Object.prototype.toString.call(t):r(t)?"":""+t},r=function(t){return""===t||null===t||void 0===t},o=function(t){var r=n(t);return Ot(e,r.toLowerCase()).map(n).getOr(r)},i=function(t){return t.replace(/{context:\w+}$/,"")},u=function(t){return t};if(r(t))return u("");if(Cc(t))return u(n(t.raw));if(Sc(t)){var a=t.slice(1),c=o(t[0]).replace(/\{([0-9]+)\}/g,(function(t,e){return Tt(a,e)?n(a[e]):t}));return u(i(c))}return u(i(o(t)))},Rc=function(){return Tc().bind((function(t){return Ot(t,"_dir")})).exists((function(t){return"rtl"===t}))},Mc=function(t){return Tt(kc,t)},zc={getData:Ec,setCode:_c,getCode:Ac,add:Dc,translate:Nc,isRtl:Rc,hasCode:Mc};function Bc(){var t=this,e=[],n={},r={},o=[],i=function(t,e){var n=Q(o,(function(n){return n.name===t&&n.state===e}));X(n,(function(t){return t.callback()}))},u=function(t){if(r[t])return r[t].instance},a=function(t){var e;return r[t]&&(e=r[t].dependencies),e||[]},c=function(t,e){!1!==Bc.languageLoad&&h(t,(function(){var r=zc.getCode(),o=","+(e||"")+",";!r||e&&-1===o.indexOf(","+r+",")||wc.ScriptLoader.add(n[t]+"/langs/"+r+".js")}),"loaded")},s=function(t,n,o){var u=n;return e.push(u),r[t]={instance:u,dependencies:o},i(t,"added"),u},l=function(t){delete n[t],delete r[t]},f=function(t,e){return"object"===typeof e?e:"string"===typeof t?{prefix:"",resource:e,suffix:""}:{prefix:t.prefix,resource:e,suffix:t.suffix}},d=function(e,n){var r=t.urls[e];X(n,(function(t){wc.ScriptLoader.add(r+"/"+t)}))},m=function(t,e,n,r){var o=a(t);X(o,(function(t){var n=f(e,t);g(n.resource,n,void 0,void 0)})),n&&(r?n.call(r):n.call(wc))},g=function(t,e,o,u,a){if(!n[t]){var c="string"===typeof e?e:e.prefix+e.resource+e.suffix;0!==c.indexOf("/")&&-1===c.indexOf("://")&&(c=Bc.baseURL+"/"+c),n[t]=c.substring(0,c.lastIndexOf("/"));var s=function(){i(t,"loaded"),m(t,e,o,u)};r[t]?s():wc.ScriptLoader.add(c,s,u,a)}},h=function(t,e,i){void 0===i&&(i="added"),Tt(r,t)&&"added"===i||Tt(n,t)&&"loaded"===i?e():o.push({name:t,state:i,callback:e})};return{items:e,urls:n,lookup:r,_listeners:o,get:u,dependencies:a,requireLangPack:c,add:s,remove:l,createUrl:f,addComponents:d,load:g,waitFor:h}}(function(t){t.PluginManager=t(),t.ThemeManager=t()})(Bc||(Bc={}));var Pc=Bc,Hc=function(t,e){var r=null,o=function(){null!==r&&(n.clearTimeout(r),r=null)},i=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];null===r&&(r=n.setTimeout((function(){t.apply(null,o),r=null}),e))};return{cancel:o,throttle:i}},Ic=function(t,e){var r=null,o=function(){null!==r&&(n.clearTimeout(r),r=null)},i=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];null!==r&&n.clearTimeout(r),r=n.setTimeout((function(){t.apply(null,o),r=null}),e)};return{cancel:o,throttle:i}},Lc=function(t,e){var n=Xr(t,e);return void 0===n||""===n?[]:n.split(" ")},Fc=function(t,e,n){var r=Lc(t,e),o=r.concat([n]);return Gr(t,e,o.join(" ")),!0},Vc=function(t,e,n){var r=Q(Lc(t,e),(function(t){return t!==n}));return r.length>0?Gr(t,e,r.join(" ")):Qr(t,e),!1},Uc=function(t){return void 0!==t.dom().classList},jc=function(t){return Lc(t,"class")},Wc=function(t,e){return Fc(t,"class",e)},qc=function(t,e){return Vc(t,"class",e)},$c=function(t,e){Uc(t)?t.dom().classList.add(e):Wc(t,e)},Gc=function(t){var e=Uc(t)?t.dom().classList:jc(t);0===e.length&&Qr(t,"class")},Kc=function(t,e){if(Uc(t)){var n=t.dom().classList;n.remove(e)}else qc(t,e);Gc(t)},Xc=function(t,e){return Uc(t)&&t.dom().classList.contains(e)},Yc=function(t,e){var n=[];return X($n(t),(function(t){e(t)&&(n=n.concat([t])),n=n.concat(Yc(t,e))})),n},Jc=function(t,e){return An(e,t)};function Qc(t,e,n,r,o){return t(n,r)?_.some(n):L(o)&&o(n)?_.none():e(n,r,o)}var Zc=function(t,e,n){var r=t.dom(),o=L(n)?n:v(!1);while(r.parentNode){r=r.parentNode;var i=sn.fromDom(r);if(e(i))return _.some(i);if(o(i))break}return _.none()},ts=function(t,e,n){var r=function(t,e){return e(t)};return Qc(r,Zc,t,e,n)},es=function(t,e,n){return Zc(t,(function(t){return En(t,e)}),n)},ns=function(t,e){return Dn(e,t)},rs=function(t,e,n){var r=function(t,e){return En(t,e)};return Qc(r,es,t,e,n)},os=v("mce-annotation"),is=v("data-mce-annotation"),us=v("data-mce-annotation-uid"),as=function(t,e){var n=t.selection.getRng(),r=sn.fromDom(n.startContainer),o=sn.fromDom(t.getBody()),i=e.fold((function(){return"."+os()}),(function(t){return"["+is()+'="'+t+'"]'})),u=Gn(r,n.startOffset).getOr(r),a=rs(u,i,(function(t){return Nn(t,o)})),c=function(t,e){return Jr(t,e)?_.some(Xr(t,e)):_.none()};return a.bind((function(e){return c(e,""+us()).bind((function(n){return c(e,""+is()).map((function(e){var r=ss(t,n);return{uid:n,name:e,elements:r}}))}))}))},cs=function(t){return yn(t)&&Xc(t,os())},ss=function(t,e){var n=sn.fromDom(t.getBody());return Jc(n,"["+us()+'="'+e+'"]')},ls=function(t,e){var n=sn.fromDom(t.getBody()),r=Jc(n,"["+is()+'="'+e+'"]'),o={};return X(r,(function(t){var e=Xr(t,us()),n=o.hasOwnProperty(e)?o[e]:[];o[e]=n.concat([t])})),o},fs=function(t,e){var n=xc({}),r=function(){return{listeners:[],previous:xc(_.none())}},o=function(t,e){i(t,(function(t){return e(t),t}))},i=function(t,e){var o=n.get(),i=o.hasOwnProperty(t)?o[t]:r(),u=e(i);o[t]=u,n.set(o)},u=function(t,e,n){o(t,(function(r){X(r.listeners,(function(r){return r(!0,t,{uid:e,nodes:K(n,(function(t){return t.dom()}))})}))}))},a=function(t){o(t,(function(e){X(e.listeners,(function(e){return e(!1,t)}))}))},c=Ic((function(){var e=n.get(),r=lt(gt(e));X(r,(function(e){i(e,(function(n){var r=n.previous.get();return as(t,_.some(e)).fold((function(){r.isSome()&&(a(e),n.previous.set(_.none()))}),(function(t){var e=t.uid,o=t.name,i=t.elements;r.is(e)||(u(o,e,i),n.previous.set(_.some(e)))})),{previous:n.previous,listeners:n.listeners}}))}))}),30);t.on("remove",(function(){c.cancel()})),t.on("NodeChange",(function(){c.throttle()}));var s=function(t,e){i(t,(function(t){return{previous:t.previous,listeners:t.listeners.concat([e])}}))};return{addListener:s}},ds=function(t,e){var n=function(t){return _.from(t.attr(is())).bind(e.lookup)};t.on("init",(function(){t.serializer.addNodeFilter("span",(function(t){X(t,(function(t){n(t).each((function(e){!1===e.persistent&&t.unwrap()}))}))}))}))},ms=function(){var t={},e=function(e,n){t[e]={name:e,settings:n}},n=function(e){return t.hasOwnProperty(e)?_.from(t[e]).map((function(t){return t.settings})):_.none()};return{register:e,lookup:n}},gs=0,hs=function(t){var e=new Date,n=e.getTime(),r=Math.floor(1e9*Math.random());return gs++,t+"_"+r+gs+String(n)},ps=function(t,e){X(e,(function(e){$c(t,e)}))},vs=function(t,e){var r=e||n.document,o=r.createElement("div");return o.innerHTML=t,$n(sn.fromDom(o))},bs=function(t){return t.dom().innerHTML},ys=function(t,e){var n=Bn(t),r=n.dom(),o=sn.fromDom(r.createDocumentFragment()),i=vs(e,r);sr(o,i),lr(t),ur(t,o)},ws=function(t,e){return sn.fromDom(t.dom().cloneNode(e))},xs=function(t){return ws(t,!1)},Cs=function(t){return ws(t,!0)},Ss=function(t,e,n){void 0===n&&(n=C);var r=new Sa(t,e),o=function(t){var e;do{e=r[t]()}while(e&&!Ir(e)&&!n(e));return _.from(e).filter(Ir)};return{current:function(){return _.from(r.current()).filter(Ir)},next:function(){return o("next")},prev:function(){return o("prev")},prev2:function(){return o("prev2")}}},ks=function(t,e){var n=e||function(e){return t.isBlock(e)||Ur(e)||Wr(e)},r=function(t,e,n,o){if(Ir(t)){var i=o(t,e,t.data);if(-1!==i)return _.some({container:t,offset:i})}return n().bind((function(t){return r(t.container,t.offset,n,o)}))},o=function(t,e,o,i){var u=Ss(t,i,n);return r(t,e,(function(){return u.prev().map((function(t){return{container:t,offset:t.length}}))}),o).getOrNull()},i=function(t,e,o,i){var u=Ss(t,i,n);return r(t,e,(function(){return u.next().map((function(t){return{container:t,offset:0}}))}),o).getOrNull()};return{backwards:o,forwards:i}},Os=Ai,Ts=Ni,Es=Ri,_s=_r,As=Ir,Ds=function(t){return As(t)&&(t=t.parentNode),_s(t)&&t.hasAttribute("data-mce-caret")},Ns=function(t){return As(t)&&Ts(t.data)},Rs=function(t){return Ds(t)||Ns(t)},Ms=function(t){return t.firstChild!==t.lastChild||!Ur(t.firstChild)},zs=function(t,e){var n,r=t.ownerDocument,o=r.createTextNode(Os),i=t.parentNode;if(e){if(n=t.previousSibling,As(n)){if(Rs(n))return n;if(Fs(n))return n.splitText(n.data.length-1)}i.insertBefore(o,t)}else{if(n=t.nextSibling,As(n)){if(Rs(n))return n;if(Ls(n))return n.splitText(1),n}t.nextSibling?i.insertBefore(o,t.nextSibling):i.appendChild(o)}return o},Bs=function(t){var e=t.container();return!(!t||!Ir(e))&&(e.data.charAt(t.offset())===Os||t.isAtStart()&&Ns(e.previousSibling))},Ps=function(t){var e=t.container();return!(!t||!Ir(e))&&(e.data.charAt(t.offset()-1)===Os||t.isAtEnd()&&Ns(e.nextSibling))},Hs=function(){var t=n.document.createElement("br");return t.setAttribute("data-mce-bogus","1"),t},Is=function(t,e,n){var r=e.ownerDocument,o=r.createElement(t);o.setAttribute("data-mce-caret",n?"before":"after"),o.setAttribute("data-mce-bogus","all"),o.appendChild(Hs());var i=e.parentNode;return n?i.insertBefore(o,e):e.nextSibling?i.insertBefore(o,e.nextSibling):i.appendChild(o),o},Ls=function(t){return As(t)&&t.data[0]===Os},Fs=function(t){return As(t)&&t.data[t.data.length-1]===Os},Vs=function(t){var e=t.getElementsByTagName("br"),n=e[e.length-1];Mr(n)&&n.parentNode.removeChild(n)},Us=function(t){return t&&t.hasAttribute("data-mce-caret")?(Vs(t),t.removeAttribute("data-mce-caret"),t.removeAttribute("data-mce-bogus"),t.removeAttribute("style"),t.removeAttribute("_moz_abspos"),t):null},js=function(t){return Ds(t.startContainer)},Ws=function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e},qs=function(t,e,n){return t.isSome()&&e.isSome()?_.some(n(t.getOrDie(),e.getOrDie())):_.none()},$s=function(t,e,n,r){return t.isSome()&&e.isSome()&&n.isSome()?_.some(r(t.getOrDie(),e.getOrDie(),n.getOrDie())):_.none()},Gs=function(t,e){return t?_.some(e):_.none()},Ks=Math.round,Xs=function(t){return t?{left:Ks(t.left),top:Ks(t.top),bottom:Ks(t.bottom),right:Ks(t.right),width:Ks(t.width),height:Ks(t.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0}},Ys=function(t,e){return t=Xs(t),e||(t.left=t.left+t.width),t.right=t.left,t.width=0,t},Js=function(t,e){return t.left===e.left&&t.top===e.top&&t.bottom===e.bottom&&t.right===e.right},Qs=function(t,e,n){return t>=0&&t<=Math.min(e.height,n.height)/2},Zs=function(t,e){return t.bottom-t.height/2<e.top||!(t.top>e.bottom)&&Qs(e.top-t.bottom,t,e)},tl=function(t,e){return t.top>e.bottom||!(t.bottom<e.top)&&Qs(e.bottom-t.top,t,e)},el=function(t,e,n){return e>=t.left&&e<=t.right&&n>=t.top&&n<=t.bottom},nl=function(t){var e=t.startContainer,n=t.startOffset;return e.hasChildNodes()&&t.endOffset===n+1?e.childNodes[n]:null},rl=function(t,e){return 1===t.nodeType&&t.hasChildNodes()&&(e>=t.childNodes.length&&(e=t.childNodes.length-1),t=t.childNodes[e]),t},ol=new RegExp("[̀-ͯ҃-҇҈-҉֑-ֽֿׁ-ׂׄ-ׇׅؐ-ًؚ-ٰٟۖ-ۜ۟-ۤۧ-۪ۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣣ-ंऺ़ु-ै्॑-ॗॢ-ॣঁ়াু-ৄ্ৗৢ-ৣਁ-ਂ਼ੁ-ੂੇ-ੈੋ-੍ੑੰ-ੱੵઁ-ં઼ુ-ૅે-ૈ્ૢ-ૣଁ଼ାିୁ-ୄ୍ୖୗୢ-ୣஂாீ்ௗఀా-ీె-ైొ-్ౕ-ౖౢ-ౣಁ಼ಿೂೆೌ-್ೕ-ೖೢ-ೣഁാു-ൄ്ൗൢ-ൣ්ාි-ුූෟัิ-ฺ็-๎ັິ-ູົ-ຼ່-ໍ༘-ཱ༹༙༵༷-ཾྀ-྄྆-྇ྍ-ྗྙ-ྼ࿆ိ-ူဲ-့္-်ွ-ှၘ-ၙၞ-ၠၱ-ၴႂႅ-ႆႍႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒ-ᝓᝲ-ᝳ឴-឵ិ-ួំ៉-៓៝᠋-᠍ᢩᤠ-ᤢᤧ-ᤨᤲ᤹-᤻ᨗ-ᨘᨛᩖᩘ-ᩞ᩠ᩢᩥ-ᩬᩳ-᩿᩼᪰-᪽᪾ᬀ-ᬃ᬴ᬶ-ᬺᬼᭂ᭫-᭳ᮀ-ᮁᮢ-ᮥᮨ-ᮩ᮫-ᮭ᯦ᯨ-ᯩᯭᯯ-ᯱᰬ-ᰳᰶ-᰷᳐-᳔᳒-᳢᳠-᳨᳭᳴᳸-᳹᷀-᷵᷼-᷿-⃐-⃜⃝-⃠⃡⃢-⃤⃥-⃰⳯-⵿⳱ⷠ-〪ⷿ-〭〮-゙〯-゚꙯꙰-꙲ꙴ-꙽ꚞ-ꚟ꛰-꛱ꠂ꠆ꠋꠥ-ꠦ꣄꣠-꣱ꤦ-꤭ꥇ-ꥑꦀ-ꦂ꦳ꦶ-ꦹꦼꧥꨩ-ꨮꨱ-ꨲꨵ-ꨶꩃꩌꩼꪰꪲ-ꪴꪷ-ꪸꪾ-꪿꫁ꫬ-ꫭ꫶ꯥꯨ꯭ﬞ︀-️︠-゙︯-゚]"),il=function(t){return"string"===typeof t&&t.charCodeAt(0)>=768&&ol.test(t)},ul=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){for(var n=0;n<t.length;n++)if(t[n](e))return!0;return!1}},al=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){for(var n=0;n<t.length;n++)if(!t[n](e))return!1;return!0}},cl=jr,sl=Wr,ll=Ur,fl=Ir,dl=Ar(["script","style","textarea"]),ml=Ar(["img","input","textarea","hr","iframe","video","audio","object"]),gl=Ar(["table"]),hl=Rs,pl=function(t){return!hl(t)&&(fl(t)?!dl(t.parentNode):ml(t)||ll(t)||gl(t)||bl(t))},vl=function(t){return _r(t)&&"true"===t.getAttribute("unselectable")},bl=function(t){return!1===vl(t)&&sl(t)},yl=function(t,e){for(t=t.parentNode;t&&t!==e;t=t.parentNode){if(bl(t))return!1;if(cl(t))return!0}return!0},wl=function(t){return!!bl(t)&&!0!==tt(mt(t.getElementsByTagName("*")),(function(t,e){return t||cl(e)}),!1)},xl=function(t){return ml(t)||wl(t)},Cl=function(t,e){return pl(t)&&yl(t,e)},Sl=_r,kl=pl,Ol=Dr("display","block table"),Tl=Dr("float","left right"),El=al(Sl,kl,w(Tl)),_l=w(Dr("white-space","pre pre-line pre-wrap")),Al=Ir,Dl=Ur,Nl=dc.nodeIndex,Rl=rl,Ml=function(t){return"createRange"in t?t.createRange():dc.DOM.createRng()},zl=function(t){return t&&/[\r\n\t ]/.test(t)},Bl=function(t){return!!t.setStart&&!!t.setEnd},Pl=function(t){var e,n=t.startContainer,r=t.startOffset;return!!(zl(t.toString())&&_l(n.parentNode)&&Ir(n)&&(e=n.data,zl(e[r-1])||zl(e[r+1])))},Hl=function(t){var e=t.ownerDocument,n=Ml(e),r=e.createTextNode(Di),o=t.parentNode;o.insertBefore(r,t),n.setStart(r,0),n.setEnd(r,1);var i=Xs(n.getBoundingClientRect());return o.removeChild(r),i},Il=function(t){var e=t.startContainer,n=t.endContainer,r=t.startOffset,o=t.endOffset;if(e===n&&Ir(n)&&0===r&&1===o){var i=t.cloneRange();return i.setEndAfter(n),Fl(i)}return null},Ll=function(t){return 0===t.left&&0===t.right&&0===t.top&&0===t.bottom},Fl=function(t){var e,n=t.getClientRects();return e=n.length>0?Xs(n[0]):Xs(t.getBoundingClientRect()),!Bl(t)&&Dl(t)&&Ll(e)?Hl(t):Ll(e)&&Bl(t)?Il(t):e},Vl=function(t,e){var n=Ys(t,e);return n.width=1,n.right=n.left+1,n},Ul=function(t){var e,n,r=[],o=function(t){0!==t.height&&(r.length>0&&Js(t,r[r.length-1])||r.push(t))},i=function(t,e){var n=Ml(t.ownerDocument);if(e<t.data.length){if(il(t.data[e]))return r;if(il(t.data[e-1])&&(n.setStart(t,e),n.setEnd(t,e+1),!Pl(n)))return o(Vl(Fl(n),!1)),r}e>0&&(n.setStart(t,e-1),n.setEnd(t,e),Pl(n)||o(Vl(Fl(n),!1))),e<t.data.length&&(n.setStart(t,e),n.setEnd(t,e+1),Pl(n)||o(Vl(Fl(n),!0)))};if(Al(t.container()))return i(t.container(),t.offset()),r;if(Sl(t.container()))if(t.isAtEnd())n=Rl(t.container(),t.offset()),Al(n)&&i(n,n.data.length),El(n)&&!Dl(n)&&o(Vl(Fl(n),!1));else{if(n=Rl(t.container(),t.offset()),Al(n)&&i(n,0),El(n)&&t.isAtEnd())return o(Vl(Fl(n),!1)),r;e=Rl(t.container(),t.offset()-1),El(e)&&!Dl(e)&&(Ol(e)||Ol(n)||!El(n))&&o(Vl(Fl(e),!1)),El(n)&&o(Vl(Fl(n),!0))}return r};function jl(t,e,n){var r=function(){return Al(t),0===e},o=function(){return Al(t)?e>=t.data.length:e>=t.childNodes.length},i=function(){var n=Ml(t.ownerDocument);return n.setStart(t,e),n.setEnd(t,e),n},u=function(){return n||(n=Ul(jl(t,e))),n},a=function(){return u().length>0},c=function(n){return n&&t===n.container()&&e===n.offset()},s=function(n){return Rl(t,n?e-1:e)};return{container:v(t),offset:v(e),toRange:i,getClientRects:u,isVisible:a,isAtStart:r,isAtEnd:o,isEqual:c,getNode:s}}(function(t){t.fromRangeStart=function(e){return t(e.startContainer,e.startOffset)},t.fromRangeEnd=function(e){return t(e.endContainer,e.endOffset)},t.after=function(e){return t(e.parentNode,Nl(e)+1)},t.before=function(e){return t(e.parentNode,Nl(e))},t.isAbove=function(t,e){return qs(ft(e.getClientRects()),dt(t.getClientRects()),Zs).getOr(!1)},t.isBelow=function(t,e){return qs(dt(e.getClientRects()),ft(t.getClientRects()),tl).getOr(!1)},t.isAtStart=function(t){return!!t&&t.isAtStart()},t.isAtEnd=function(t){return!!t&&t.isAtEnd()},t.isTextPosition=function(t){return!!t&&Ir(t.container())},t.isElementPosition=function(e){return!1===t.isTextPosition(e)}})(jl||(jl={}));var Wl,ql=jl,$l=function(t,e){Ir(e)&&0===e.data.length&&t.remove(e)},Gl=function(t,e,n){e.insertNode(n),$l(t,n.previousSibling),$l(t,n.nextSibling)},Kl=function(t,e,n){var r=_.from(n.firstChild),o=_.from(n.lastChild);e.insertNode(n),r.each((function(e){return $l(t,e.previousSibling)})),o.each((function(e){return $l(t,e.nextSibling)}))},Xl=function(t,e,n){Vr(n)?Kl(t,e,n):Gl(t,e,n)},Yl=Ir,Jl=Mr,Ql=dc.nodeIndex,Zl=function(t){var e=t.parentNode;return Jl(e)?Zl(e):e},tf=function(t){return t?zt(t.childNodes,(function(t,e){return Jl(e)&&"BR"!==e.nodeName?t=t.concat(tf(e)):t.push(e),t}),[]):[]},ef=function(t,e){while(t=t.previousSibling){if(!Yl(t))break;e+=t.data.length}return e},nf=function(t){return function(e){return t===e}},rf=function(t){var e,n;e=tf(Zl(t)),n=Bt(e,nf(t),t),e=e.slice(0,n+1);var r=zt(e,(function(t,n,r){return Yl(n)&&Yl(e[r-1])&&t++,t}),0);return e=Rt(e,Ar([t.nodeName])),n=Bt(e,nf(t),t),n-r},of=function(t){var e;return e=Yl(t)?"text()":t.nodeName.toLowerCase(),e+"["+rf(t)+"]"},uf=function(t,e,n){var r=[];for(e=e.parentNode;e!==t;e=e.parentNode){if(n&&n(e))break;r.push(e)}return r},af=function(t,e){var n,r,o,i,u,a=[];return n=e.container(),r=e.offset(),Yl(n)?o=ef(n,r):(i=n.childNodes,r>=i.length?(o="after",r=i.length-1):o="before",n=i[r]),a.push(of(n)),u=uf(t,n),u=Rt(u,w(Mr)),a=a.concat(Nt(u,(function(t){return of(t)}))),a.reverse().join("/")+","+o},cf=function(t,e,n){var r=tf(t);return r=Rt(r,(function(t,e){return!Yl(t)||!Yl(r[e-1])})),r=Rt(r,Ar([e])),r[n]},sf=function(t,e){var n,r=t,o=0;while(Yl(r)){if(n=r.data.length,e>=o&&e<=o+n){t=r,e-=o;break}if(!Yl(r.nextSibling)){t=r,e=n;break}o+=n,r=r.nextSibling}return Yl(t)&&e>t.data.length&&(e=t.data.length),ql(t,e)},lf=function(t,e){var n;if(!e)return null;var r=e.split(","),o=r[0].split("/");n=r.length>1?r[1]:"before";var i=zt(o,(function(t,e){return e=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(e),e?("text()"===e[1]&&(e[1]="#text"),cf(t,e[1],parseInt(e[2],10))):null}),t);return i?Yl(i)?sf(i,parseInt(n,10)):(n="after"===n?Ql(i)+1:Ql(i),ql(i.parentNode,n)):null},ff=Wr,df=function(t,e,n){var r,o;for(o=t(e.data.slice(0,n)).length,r=e.previousSibling;r&&Ir(r);r=r.previousSibling)o+=t(r.data).length;return o},mf=function(t,e,n,r,o){var i,u=r[o?"startContainer":"endContainer"],a=r[o?"startOffset":"endOffset"],c=[],s=0,l=t.getRoot();for(Ir(u)?c.push(n?df(e,u,a):a):(i=u.childNodes,a>=i.length&&i.length&&(s=1,a=Math.max(0,i.length-1)),c.push(t.nodeIndex(i[a],n)+s));u&&u!==l;u=u.parentNode)c.push(t.nodeIndex(u,n));return c},gf=function(t,e,n,r){var o=e.dom,i={};return i.start=mf(o,t,n,r,!0),e.isCollapsed()||(i.end=mf(o,t,n,r,!1)),i},hf=function(t,e,n){var r=0;return nn.each(t.select(e),(function(t){if("all"!==t.getAttribute("data-mce-bogus"))return t!==n&&void r++})),r},pf=function(t,e){var n,r,o,i=e?"start":"end";n=t[i+"Container"],r=t[i+"Offset"],_r(n)&&"TR"===n.nodeName&&(o=n.childNodes,n=o[Math.min(e?r:r-1,o.length-1)],n&&(r=e?0:n.childNodes.length,t["set"+(e?"Start":"End")](n,r)))},vf=function(t){return pf(t,!0),pf(t,!1),t},bf=function(t,e){var n;if(_r(t)&&(t=rl(t,e),ff(t)))return t;if(Rs(t)){if(Ir(t)&&Ds(t)&&(t=t.parentNode),n=t.previousSibling,ff(n))return n;if(n=t.nextSibling,ff(n))return n}},yf=function(t){return bf(t.startContainer,t.startOffset)||bf(t.endContainer,t.endOffset)},wf=function(t,e,n){var r=n.getNode(),o=r?r.nodeName:null,i=n.getRng();if(ff(r)||"IMG"===o)return{name:o,index:hf(n.dom,o,r)};var u=yf(i);return u?(o=u.tagName,{name:o,index:hf(n.dom,o,u)}):gf(t,n,e,i)},xf=function(t){var e=t.getRng();return{start:af(t.dom.getRoot(),ql.fromRangeStart(e)),end:af(t.dom.getRoot(),ql.fromRangeEnd(e))}},Cf=function(t){return{rng:t.getRng()}},Sf=function(t,e,n){var r={"data-mce-type":"bookmark",id:e,style:"overflow:hidden;line-height:0px"};return n?t.create("span",r,""):t.create("span",r)},kf=function(t,e){var n=t.dom,r=t.getRng(),o=n.uniqueId(),i=t.isCollapsed(),u=t.getNode(),a=u.nodeName;if("IMG"===a)return{name:a,index:hf(n,a,u)};var c=vf(r.cloneRange());if(!i){c.collapse(!1);var s=Sf(n,o+"_end",e);Xl(n,c,s)}r=vf(r),r.collapse(!0);var l=Sf(n,o+"_start",e);return Xl(n,r,l),t.moveToBookmark({id:o,keep:!0}),{id:o}},Of=function(t,e,n){return 2===e?wf(Es,n,t):3===e?xf(t):e?Cf(t):kf(t,!1)},Tf=y(wf,b,!0),Ef=dc.DOM,_f="font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow",Af=function(t,e,n){var r=t.getParam(e,n);if(-1!==r.indexOf("=")){var o=t.getParam(e,"","hash");return o.hasOwnProperty(t.id)?o[t.id]:n}return r},Df=function(t){return t.getParam("iframe_attrs",{})},Nf=function(t){return t.getParam("doctype","<!DOCTYPE html>")},Rf=function(t){return t.getParam("document_base_url","")},Mf=function(t){return Af(t,"body_id","tinymce")},zf=function(t){return Af(t,"body_class","")},Bf=function(t){return t.getParam("content_security_policy","")},Pf=function(t){return t.getParam("br_in_pre",!0)},Hf=function(t){if(t.getParam("force_p_newlines",!1))return"p";var e=t.getParam("forced_root_block","p");return!1===e?"":!0===e?"p":e},If=function(t){return t.getParam("forced_root_block_attrs",{})},Lf=function(t){return t.getParam("br_newline_selector",".mce-toc h2,figcaption,caption")},Ff=function(t){return t.getParam("no_newline_selector","")},Vf=function(t){return t.getParam("keep_styles",!0)},Uf=function(t){return t.getParam("end_container_on_empty_block",!1)},jf=function(t){return nn.explode(t.getParam("font_size_style_values","xx-small,x-small,small,medium,large,x-large,xx-large"))},Wf=function(t){return nn.explode(t.getParam("font_size_classes",""))},qf=function(t){return t.getParam("images_dataimg_filter",v(!0),"function")},$f=function(t){return t.getParam("automatic_uploads",!0,"boolean")},Gf=function(t){return t.getParam("images_reuse_filename",!1,"boolean")},Kf=function(t){return t.getParam("images_replace_blob_uris",!0,"boolean")},Xf=function(t){return t.getParam("icons","","string")},Yf=function(t){return t.getParam("icons_url","","string")},Jf=function(t){return t.getParam("images_upload_url","","string")},Qf=function(t){return t.getParam("images_upload_base_path","","string")},Zf=function(t){return t.getParam("images_upload_credentials",!1,"boolean")},td=function(t){return t.getParam("images_upload_handler",null,"function")},ed=function(t){return t.getParam("content_css_cors",!1,"boolean")},nd=function(t){return t.getParam("referrer_policy","","string")},rd=function(t){return t.getParam("language","en","string")},od=function(t){return t.getParam("language_url","","string")},id=function(t){return t.getParam("indent_use_margin",!1)},ud=function(t){return t.getParam("indentation","40px","string")},ad=function(t){var e=t.getParam("content_css");return M(e)?K(e.split(","),Ce):B(e)?e:!1===e||t.inline?[]:["default"]},cd=function(t){return t.getParam("directionality",zc.isRtl()?"rtl":void 0)},sd=function(t){return t.getParam("inline_boundaries_selector","a[href],code,.mce-annotation","string")},ld=function(t){return t.getParam("object_resizing")},fd=function(t){return t.getParam("resize_img_proportional",!0,"boolean")},dd=function(t){return t.getParam("placeholder",Ef.getAttrib(t.getElement(),"placeholder"),"string")},md=function(t){return t.getParam("event_root")},gd=function(t){return t.getParam("service_message")},hd=function(t){return t.getParam("theme")},pd=function(t){return t.getParam("validate")},vd=function(t){return!1!==t.getParam("inline_boundaries")},bd=function(t){return t.getParam("formats")},yd=function(t){var e=t.getParam("preview_styles",_f);return M(e)?e:""},wd=function(t){return t.getParam("custom_ui_selector","","string")},xd=function(t){return t.getParam("theme_url")},Cd=function(t){return t.getParam("inline")},Sd=function(t){return t.getParam("hidden_input")},kd=function(t){return t.getParam("submit_patch")},Od=function(t){return"xml"===t.getParam("encoding")},Td=function(t){return t.getParam("add_form_submit_trigger")},Ed=function(t){return t.getParam("add_unload_trigger")},_d=function(t){return""!==Hf(t)},Ad=function(t){return t.getParam("custom_undo_redo_levels",0,"number")},Dd=function(t){return t.getParam("disable_nodechange")},Nd=function(t){return t.getParam("readonly")},Rd=function(t){return t.getParam("content_css_cors")},Md=function(t){return t.getParam("plugins")},zd=function(t){return t.getParam("external_plugins")},Bd=function(t){return t.getParam("block_unsupported_drop",!0,"boolean")},Pd=_r,Hd=Ir,Id=function(t){var e=t.parentNode;e&&e.removeChild(t)},Ld=function(t){try{return t.nodeValue}catch(e){return""}},Fd=function(t,e){0===e.length?Id(t):t.nodeValue=e},Vd=function(t){var e=Es(t);return{count:t.length-e.length,text:e}},Ud=function(t,e){return Kd(t),e},jd=function(t,e){var n=Vd(t.data.substr(0,e.offset())),r=Vd(t.data.substr(e.offset())),o=n.text+r.text;return o.length>0?(Fd(t,o),ql(t,e.offset()-n.count)):e},Wd=function(t,e){var n=e.container(),r=q(mt(n.childNodes),t).map((function(t){return t<e.offset()?ql(n,e.offset()-1):e})).getOr(e);return Kd(t),r},qd=function(t,e){return Hd(t)&&e.container()===t?jd(t,e):Ud(t,e)},$d=function(t,e){return e.container()===t.parentNode?Wd(t,e):Ud(t,e)},Gd=function(t,e){return ql.isTextPosition(e)?qd(t,e):$d(t,e)},Kd=function(t){if(Pd(t)&&Rs(t)&&(Ms(t)?t.removeAttribute("data-mce-caret"):Id(t)),Hd(t)){var e=Es(Ld(t));Fd(t,e)}},Xd=ze().browser,Yd=Wr,Jd=function(t){return _r(t)&&/^(TD|TH)$/i.test(t.tagName)},Qd=function(t,e,n){var r,o,i,u,a,c=Ys(e.getBoundingClientRect(),n);return"BODY"===t.tagName?(r=t.ownerDocument.documentElement,o=t.scrollLeft||r.scrollLeft,i=t.scrollTop||r.scrollTop):(a=t.getBoundingClientRect(),o=t.scrollLeft-a.left,i=t.scrollTop-a.top),c.left+=o,c.right+=o,c.top+=i,c.bottom+=i,c.width=1,u=e.offsetWidth-e.clientWidth,u>0&&(n&&(u*=-1),c.left+=u,c.right+=u),c},Zd=function(t){var e,n,r,o,i=Jc(sn.fromDom(t),"*[contentEditable=false]");for(r=0;r<i.length;r++)e=i[r].dom(),n=e.previousSibling,Fs(n)&&(o=n.data,1===o.length?n.parentNode.removeChild(n):n.deleteData(o.length-1,1)),n=e.nextSibling,Ls(n)&&(o=n.data,1===o.length?n.parentNode.removeChild(n):n.deleteData(0,1))},tm=function(t,e,n,r){var o,i,u=xc(_.none()),a=Hf(t),c=a.length>0?a:"p",s=function(t,r){var o,a;if(l(),Jd(r))return null;if(!n(r))return i=zs(r,t),a=r.ownerDocument.createRange(),Yd(i.nextSibling)?(a.setStart(i,0),a.setEnd(i,0)):(a.setStart(i,1),a.setEnd(i,1)),a;i=Is(c,r,t),o=Qd(e,r,t),Ca(i).css("top",o.top);var s=Ca('<div class="mce-visual-caret" data-mce-bogus="all"></div>').css(o).appendTo(e)[0];return u.set(_.some({caret:s,element:r,before:t})),u.get().each((function(e){t&&Ca(e.caret).addClass("mce-visual-caret-before")})),f(),a=r.ownerDocument.createRange(),a.setStart(i,0),a.setEnd(i,0),a},l=function(){Zd(e),i&&(Kd(i),i=null),u.get().each((function(t){Ca(t.caret).remove(),u.set(_.none())})),o&&(Za.clearInterval(o),o=null)},f=function(){o=Za.setInterval((function(){r()?Ca("div.mce-visual-caret",e).toggleClass("mce-visual-caret-hidden"):Ca("div.mce-visual-caret",e).addClass("mce-visual-caret-hidden")}),500)},d=function(){u.get().each((function(t){var n=Qd(e,t.element,t.before);Ca(t.caret).css(Ht({},n))}))},m=function(){return Za.clearInterval(o)},g=function(){return".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}"};return{show:s,hide:l,getCss:g,reposition:d,destroy:m}},em=function(){return Xd.isIE()||Xd.isEdge()||Xd.isFirefox()},nm=function(t){return Yd(t)||Br(t)&&em()},rm=Wr,om=Dr("display","block table table-cell table-caption list-item"),im=Rs,um=Ds,am=_r,cm=pl,sm=function(t){return t>0},lm=function(t){return t<0},fm=function(t,e){var n;while(n=t(e))if(!um(n))return n;return null},dm=function(t,e,n,r,o){var i=new Sa(t,r);if(lm(e)){if((rm(t)||um(t))&&(t=fm(i.prev,!0),n(t)))return t;while(t=fm(i.prev,o))if(n(t))return t}if(sm(e)){if((rm(t)||um(t))&&(t=fm(i.next,!0),n(t)))return t;while(t=fm(i.next,o))if(n(t))return t}return null},mm=function(t,e){while(t&&t!==e){if(om(t))return t;t=t.parentNode}return null},gm=function(t,e,n){return mm(t.container(),n)===mm(e.container(),n)},hm=function(t,e){if(!e)return null;var n=e.container(),r=e.offset();return am(n)?n.childNodes[r+t]:null},pm=function(t,e){var n=e.ownerDocument.createRange();return t?(n.setStartBefore(e),n.setEndBefore(e)):(n.setStartAfter(e),n.setEndAfter(e)),n},vm=function(t,e,n){return mm(e,t)===mm(n,t)},bm=function(t,e,n){var r,o;o=t?"previousSibling":"nextSibling";while(n&&n!==e){if(r=n[o],im(r)&&(r=r[o]),rm(r)){if(vm(e,r,n))return r;break}if(cm(r))break;n=n.parentNode}return null},ym=y(pm,!0),wm=y(pm,!1),xm=function(t,e,n){var r,o,i,u=y(bm,!0,e),a=y(bm,!1,e);o=n.startContainer;var c=n.startOffset;if(Ds(o)){if(am(o)||(o=o.parentNode),i=o.getAttribute("data-mce-caret"),"before"===i&&(r=o.nextSibling,nm(r)))return ym(r);if("after"===i&&(r=o.previousSibling,nm(r)))return wm(r)}if(!n.collapsed)return n;if(Ir(o)){if(im(o)){if(1===t){if(r=a(o),r)return ym(r);if(r=u(o),r)return wm(r)}if(-1===t){if(r=u(o),r)return wm(r);if(r=a(o),r)return ym(r)}return n}if(Fs(o)&&c>=o.data.length-1)return 1===t&&(r=a(o),r)?ym(r):n;if(Ls(o)&&c<=1)return-1===t&&(r=u(o),r)?wm(r):n;if(c===o.data.length)return r=a(o),r?ym(r):n;if(0===c)return r=u(o),r?wm(r):n}return n},Cm=function(t,e){return _.from(hm(t?0:-1,e)).filter(rm)},Sm=function(t,e,n){var r=xm(t,e,n);return-1===t?jl.fromRangeStart(r):jl.fromRangeEnd(r)},km=function(t){return _.from(t.getNode()).map(sn.fromDom)},Om=function(t){return _.from(t.getNode(!0)).map(sn.fromDom)},Tm=function(t,e){while(e=t(e))if(e.isVisible())return e;return e},Em=function(t,e){var n=gm(t,e);return!(n||!Ur(t.getNode()))||n};(function(t){t[t["Backwards"]=-1]="Backwards",t[t["Forwards"]=1]="Forwards"})(Wl||(Wl={}));var _m=Wr,Am=Ir,Dm=_r,Nm=Ur,Rm=pl,Mm=xl,zm=Cl,Bm=function(t,e){var n=[];while(t&&t!==e)n.push(t),t=t.parentNode;return n},Pm=function(t,e){return t.hasChildNodes()&&e<t.childNodes.length?t.childNodes[e]:null},Hm=function(t,e){if(sm(t)){if(Rm(e.previousSibling)&&!Am(e.previousSibling))return ql.before(e);if(Am(e))return ql(e,0)}if(lm(t)){if(Rm(e.nextSibling)&&!Am(e.nextSibling))return ql.after(e);if(Am(e))return ql(e,e.data.length)}return lm(t)?Nm(e)?ql.before(e):ql.after(e):ql.before(e)},Im=function(t,e){var n=e.nextSibling;return n&&Rm(n)?Am(n)?ql(n,0):ql.before(n):Lm(Wl.Forwards,ql.after(e),t)},Lm=function(t,e,n){var r,o,i,u;if(!Dm(n)||!e)return null;if(e.isEqual(ql.after(n))&&n.lastChild){if(u=ql.after(n.lastChild),lm(t)&&Rm(n.lastChild)&&Dm(n.lastChild))return Nm(n.lastChild)?ql.before(n.lastChild):u}else u=e;var a=u.container(),c=u.offset();if(Am(a)){if(lm(t)&&c>0)return ql(a,--c);if(sm(t)&&c<a.length)return ql(a,++c);r=a}else{if(lm(t)&&c>0&&(o=Pm(a,c-1),Rm(o)))return!Mm(o)&&(i=dm(o,t,zm,o),i)?Am(i)?ql(i,i.data.length):ql.after(i):Am(o)?ql(o,o.data.length):ql.before(o);if(sm(t)&&c<a.childNodes.length&&(o=Pm(a,c),Rm(o)))return Nm(o)?Im(n,o):!Mm(o)&&(i=dm(o,t,zm,o),i)?Am(i)?ql(i,0):ql.before(i):Am(o)?ql(o,0):ql.after(o);r=o||u.getNode()}if((sm(t)&&u.isAtEnd()||lm(t)&&u.isAtStart())&&(r=dm(r,t,v(!0),n,!0),zm(r,n)))return Hm(t,r);o=dm(r,t,zm,n);var s=Pt(Q(Bm(a,n),_m));return!s||o&&s.contains(o)?o?Hm(t,o):null:(u=sm(t)?ql.after(s):ql.before(s),u)},Fm=function(t){return{next:function(e){return Lm(Wl.Forwards,e,t)},prev:function(e){return Lm(Wl.Backwards,e,t)}}},Vm=function(t,e,n){var r=t?ql.before(n):ql.after(n);return Km(t,e,r)},Um=function(t){return Ur(t)?ql.before(t):ql.after(t)},jm=function(t){return ql.isTextPosition(t)?0===t.offset():pl(t.getNode())},Wm=function(t){if(ql.isTextPosition(t)){var e=t.container();return t.offset()===e.data.length}return pl(t.getNode(!0))},qm=function(t,e){return!ql.isTextPosition(t)&&!ql.isTextPosition(e)&&t.getNode()===e.getNode(!0)},$m=function(t){return!ql.isTextPosition(t)&&Ur(t.getNode())},Gm=function(t,e,n){return t?!qm(e,n)&&!$m(e)&&Wm(e)&&jm(n):!qm(n,e)&&jm(e)&&Wm(n)},Km=function(t,e,n){var r=Fm(e);return _.from(t?r.next(n):r.prev(n))},Xm=function(t,e,n){return Km(t,e,n).bind((function(r){return gm(n,r,e)&&Gm(t,n,r)?Km(t,e,r):_.some(r)}))},Ym=function(t,e,n,r){return Xm(t,e,n).bind((function(n){return r(n)?Ym(t,e,n,r):_.some(n)}))},Jm=function(t,e){var n=t?e.firstChild:e.lastChild;return Ir(n)?_.some(ql(n,t?0:n.data.length)):n?pl(n)?_.some(t?ql.before(n):Um(n)):Vm(t,e,n):_.none()},Qm=y(Km,!0),Zm=y(Km,!1),tg=y(Jm,!0),eg=y(Jm,!1),ng="_mce_caret",rg=function(t){return _r(t)&&t.id===ng},og=function(t,e){while(e&&e!==t){if(e.id===ng)return e;e=e.parentNode}return null},ig=function(t){return"string"===typeof t.start},ug=function(t){return t.hasOwnProperty("rng")},ag=function(t){return t.hasOwnProperty("id")},cg=function(t){return t.hasOwnProperty("name")},sg=function(t){return nn.isArray(t.start)},lg=function(t,e){return _r(e)&&t.isBlock(e)&&!e.innerHTML&&!je.ie&&(e.innerHTML='<br data-mce-bogus="1" />'),e},fg=function(t,e){var n,r=t.createRng();return n=lf(t.getRoot(),e.start),r.setStart(n.container(),n.offset()),n=lf(t.getRoot(),e.end),r.setEnd(n.container(),n.offset()),r},dg=function(t,e){var n=t.ownerDocument.createTextNode(Os);t.appendChild(n),e.setStart(n,0),e.setEnd(n,0)},mg=function(t){return!1===t.hasChildNodes()},gg=function(t,e){return eg(t).fold((function(){return!1}),(function(t){return e.setStart(t.container(),t.offset()),e.setEnd(t.container(),t.offset()),!0}))},hg=function(t,e,n){return!(!mg(e)||!og(t,e))&&(dg(e,n),!0)},pg=function(t,e,n,r){var o,i,u,a,c=n[e?"start":"end"],s=t.getRoot();if(c){for(u=c[0],i=s,o=c.length-1;o>=1;o--){if(a=i.childNodes,hg(s,i,r))return!0;if(c[o]>a.length-1)return!!hg(s,i,r)||gg(i,r);i=a[c[o]]}3===i.nodeType&&(u=Math.min(c[0],i.nodeValue.length)),1===i.nodeType&&(u=Math.min(c[0],i.childNodes.length)),e?r.setStart(i,u):r.setEnd(i,u)}return!0},vg=function(t){return Ir(t)&&t.data.length>0},bg=function(t,e,n){var r,o,i,u,a,c,s=t.get(n.id+"_"+e),l=n.keep;if(s){if(r=s.parentNode,"start"===e?(l?s.hasChildNodes()?(r=s.firstChild,o=1):vg(s.nextSibling)?(r=s.nextSibling,o=0):vg(s.previousSibling)?(r=s.previousSibling,o=s.previousSibling.data.length):(r=s.parentNode,o=t.nodeIndex(s)+1):o=t.nodeIndex(s),a=r,c=o):(l?s.hasChildNodes()?(r=s.firstChild,o=1):vg(s.previousSibling)?(r=s.previousSibling,o=s.previousSibling.data.length):(r=s.parentNode,o=t.nodeIndex(s)):o=t.nodeIndex(s),a=r,c=o),!l){u=s.previousSibling,i=s.nextSibling,nn.each(nn.grep(s.childNodes),(function(t){Ir(t)&&(t.nodeValue=t.nodeValue.replace(/\uFEFF/g,""))}));while(s=t.get(n.id+"_"+e))t.remove(s,!0);u&&i&&u.nodeType===i.nodeType&&Ir(u)&&!je.opera&&(o=u.nodeValue.length,u.appendData(i.nodeValue),t.remove(i),a=u,c=o)}return _.some(ql(a,c))}return _.none()},yg=function(t,e){var n=t.createRng();return pg(t,!0,e,n)&&pg(t,!1,e,n)?_.some(n):_.none()},wg=function(t,e){var n=bg(t,"start",e),r=bg(t,"end",e);return qs(n,r.or(n),(function(e,n){var r=t.createRng();return r.setStart(lg(t,e.container()),e.offset()),r.setEnd(lg(t,n.container()),n.offset()),r}))},xg=function(t,e){return _.from(t.select(e.name)[e.index]).map((function(e){var n=t.createRng();return n.selectNode(e),n}))},Cg=function(t,e){var n=t.dom;if(e){if(sg(e))return yg(n,e);if(ig(e))return _.some(fg(n,e));if(ag(e))return wg(n,e);if(cg(e))return xg(n,e);if(ug(e))return _.some(e.rng)}return _.none()},Sg=function(t,e,n){return Of(t,e,n)},kg=function(t,e){Cg(t,e).each((function(e){t.setRng(e)}))},Og=function(t){return _r(t)&&"SPAN"===t.tagName&&"bookmark"===t.getAttribute("data-mce-type")},Tg=function(t){return function(e){return t===e}},Eg=Tg(Di),_g=function(t){return""!==t&&-1!==" \f\n\r\t\v".indexOf(t)},Ag=function(t){return!_g(t)&&!Eg(t)},Dg=function(t){return!!t.nodeType},Ng=function(t){return t&&/^(IMG)$/.test(t.nodeName)},Rg=function(t,e,n){var r,o,i,u=n.startOffset,a=n.startContainer;if((n.startContainer!==n.endContainer||!Ng(n.startContainer.childNodes[n.startOffset]))&&1===a.nodeType)for(i=a.childNodes,u<i.length?(a=i[u],r=new Sa(a,t.getParent(a,t.isBlock))):(a=i[i.length-1],r=new Sa(a,t.getParent(a,t.isBlock)),r.next(!0)),o=r.current();o;o=r.next())if(3===o.nodeType&&!Pg(o))return n.setStart(o,0),void e.setRng(n)},Mg=function(t,e,n){if(t){var r=e?"nextSibling":"previousSibling";for(t=n?t:t[r];t;t=t[r])if(1===t.nodeType||!Pg(t))return t}},zg=function(t,e){return Dg(e)&&(e=e.nodeName),!!t.schema.getTextBlockElements()[e.toLowerCase()]},Bg=function(t,e,n){return t.schema.isValidChild(e,n)},Pg=function(t){return t&&Ir(t)&&/^([\t \r\n]+|)$/.test(t.nodeValue)},Hg=function(t){return t&&Ir(t)&&0===t.length},Ig=function(t,e){return"string"!==typeof t?t=t(e):e&&(t=t.replace(/%(\w+)/g,(function(t,n){return e[n]||t}))),t},Lg=function(t,e){return t=t||"",e=e||"",t=""+(t.nodeName||t),e=""+(e.nodeName||e),t.toLowerCase()===e.toLowerCase()},Fg=function(t,e,n){return"color"!==n&&"backgroundColor"!==n||(e=t.toHex(e)),"fontWeight"===n&&700===e&&(e="bold"),"fontFamily"===n&&(e=e.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),""+e},Vg=function(t,e,n){return Fg(t,t.getStyle(e,n),n)},Ug=function(t,e){var n;return t.getParent(e,(function(e){return n=t.getStyle(e,"text-decoration"),n&&"none"!==n})),n},jg=function(t,e,n){return t.getParents(e,n,t.getRoot())},Wg=function(t,e){var n=function(t){var e=function(t){return t.length>1&&"%"===t.charAt(0)};return G(["styles","attributes"],(function(n){return Ot(t,n).exists((function(t){var n=B(t)?t:kt(t);return G(n,e)}))}))};return G(t.formatter.get(e),n)},qg=function(t,e,n){var r=["inline","block","selector","attributes","styles","classes"],o=function(t){return Ct(t,(function(t,e){return G(r,(function(t){return t===e}))}))};return G(t.formatter.get(e),(function(e){var r=o(e);return G(t.formatter.get(n),(function(t){var e=o(t);return Et(r,e)}))}))},$g=Og,Gg=jg,Kg=Pg,Xg=zg,Yg=function(t){return"BR"===t.nodeName&&t.getAttribute("data-mce-bogus")&&!t.nextSibling},Jg=function(t,e){var n=e;while(n){if(_r(n)&&t.getContentEditable(n))return"false"===t.getContentEditable(n)?n:e;n=n.parentNode}return e},Qg=function(t,e,n,r){for(var o=e.data,i=n;t?i>=0:i<o.length;t?i--:i++)if(r(o.charAt(i)))return t?i+1:i;return-1},Zg=function(t,e,n){return Qg(t,e,n,(function(t){return Eg(t)||_g(t)}))},th=function(t,e,n){return Qg(t,e,n,Ag)},eh=function(t,e,n,r,o,i){var u,a=t.getParent(n,t.isBlock)||e,c=function(e,n,r){var i=ks(t),c=o?i.backwards:i.forwards;return _.from(c(e,n,(function(t,e){return $g(t.parentNode)?-1:(u=t,r(o,t,e))}),a))},s=c(n,r,Zg);return s.bind((function(t){return i?c(t.container,t.offset+(o?-1:0),th):_.some(t)})).orThunk((function(){return u?_.some({container:u,offset:o?0:u.length}):_.none()}))},nh=function(t,e,n,r,o){Ir(r)&&0===r.nodeValue.length&&r[o]&&(r=r[o]);for(var i=Gg(t,r),u=0;u<i.length;u++)for(var a=0;a<e.length;a++){var c=e[a];if((!("collapsed"in c)||c.collapsed===n.collapsed)&&t.is(i[u],c.selector))return i[u]}return r},rh=function(t,e,n,r){var o,i=t.dom,u=i.getRoot();if(e[0].wrapper||(o=i.getParent(n,e[0].block,u)),!o){var a=i.getParent(n,"LI,TD,TH");o=i.getParent(Ir(n)?n.parentNode:n,(function(e){return e!==u&&Xg(t,e)}),a)}if(o&&e[0].wrapper&&(o=Gg(i,o,"ul,ol").reverse()[0]||o),!o){o=n;while(o[r]&&!i.isBlock(o[r]))if(o=o[r],Lg(o,"br"))break}return o||n},oh=function(t,e,n,r,o,i,u){var a,c,s;a=c=u?n:o;var l=u?"previousSibling":"nextSibling",f=t.getRoot();if(Ir(a)&&!Kg(a)&&(u?r>0:i<a.nodeValue.length))return a;while(1){if(!e[0].block_expand&&t.isBlock(c))return c;for(s=c[l];s;s=s[l])if(!$g(s)&&!Kg(s)&&!Yg(s))return c;if(c===f||c.parentNode===f){a=c;break}c=c.parentNode}return a},ih=function(t,e,n,r){void 0===r&&(r=!1);var o=e.startContainer,i=e.startOffset,u=e.endContainer,a=e.endOffset,c=t.dom;if(_r(o)&&o.hasChildNodes()&&(o=rl(o,i),Ir(o)&&(i=0)),_r(u)&&u.hasChildNodes()&&(u=rl(u,e.collapsed?a:a-1),Ir(u)&&(a=u.nodeValue.length)),o=Jg(c,o),u=Jg(c,u),($g(o.parentNode)||$g(o))&&(o=$g(o)?o:o.parentNode,o=e.collapsed?o.previousSibling||o:o.nextSibling||o,Ir(o)&&(i=e.collapsed?o.length:0)),($g(u.parentNode)||$g(u))&&(u=$g(u)?u:u.parentNode,u=e.collapsed?u.nextSibling||u:u.previousSibling||u,Ir(u)&&(a=e.collapsed?0:u.length)),e.collapsed){var s=eh(c,t.getBody(),o,i,!0,r);s.each((function(t){var e=t.container,n=t.offset;o=e,i=n}));var l=eh(c,t.getBody(),u,a,!1,r);l.each((function(t){var e=t.container,n=t.offset;u=e,a=n}))}return(n[0].inline||n[0].block_expand)&&(n[0].inline&&Ir(o)&&0!==i||(o=oh(c,n,o,i,u,a,!0)),n[0].inline&&Ir(u)&&a!==u.nodeValue.length||(u=oh(c,n,o,i,u,a,!1))),n[0].selector&&!1!==n[0].expand&&!n[0].inline&&(o=nh(c,n,e,o,"previousSibling"),u=nh(c,n,e,u,"nextSibling")),(n[0].block||n[0].selector)&&(o=rh(t,n,o,"previousSibling"),u=rh(t,n,u,"nextSibling"),n[0].block&&(c.isBlock(o)||(o=oh(c,n,o,i,u,a,!0)),c.isBlock(u)||(u=oh(c,n,o,i,u,a,!1)))),_r(o)&&(i=c.nodeIndex(o),o=o.parentNode),_r(u)&&(a=c.nodeIndex(u)+1,u=u.parentNode),{startContainer:o,startOffset:i,endContainer:u,endOffset:a}},uh=function(t,e){var n=t.childNodes;return e>=n.length?e=n.length-1:e<0&&(e=0),n[e]||t},ah=function(t,e){return uh(t,e-1)},ch=function(t,e,n){var r=e.startContainer,o=e.startOffset,i=e.endContainer,u=e.endOffset,a=function(t){var e;return e=t[0],3===e.nodeType&&e===r&&o>=e.nodeValue.length&&t.splice(0,1),e=t[t.length-1],0===u&&t.length>0&&e===i&&3===e.nodeType&&t.splice(t.length-1,1),t},c=function(t,e,n){for(var r=[];t&&t!==n;t=t[e])r.push(t);return r},s=function(t,e){do{if(t.parentNode===e)return t;t=t.parentNode}while(t)},l=function(t,e,r){for(var o=r?"nextSibling":"previousSibling",i=t,u=i.parentNode;i&&i!==e;i=u){u=i.parentNode;var s=c(i===t?i:i[o],o);s.length&&(r||s.reverse(),n(a(s)))}};if(1===r.nodeType&&r.hasChildNodes()&&(r=uh(r,o)),1===i.nodeType&&i.hasChildNodes()&&(i=ah(i,u)),r===i)return n(a([r]));for(var f=t.findCommonAncestor(r,i),d=r;d;d=d.parentNode){if(d===i)return l(r,f,!0);if(d===f)break}for(d=i;d;d=d.parentNode){if(d===r)return l(i,f);if(d===f)break}var m=s(r,f)||r,g=s(i,f)||i;l(r,m,!0);var h=c(m===r?m:m.nextSibling,"nextSibling",g===i?g.nextSibling:g);h.length&&n(a(h)),l(i,g)},sh=function(t){var e=[];if(t)for(var n=0;n<t.rangeCount;n++)e.push(t.getRangeAt(n));return e},lh=function(t){return it(t,(function(t){var e=nl(t);return e?[sn.fromDom(e)]:[]}))},fh=function(t){return sh(t).length>1},dh=function(t){return Q(lh(t),No)},mh=function(t){return Jc(t,"td[data-mce-selected],th[data-mce-selected]")},gh=function(t,e){var n=mh(e);return n.length>0?n:dh(t)},hh=function(t){return gh(sh(t.selection.getSel()),sn.fromDom(t.getBody()))},ph=function(t){var e=t.startContainer,n=t.startOffset;return Ir(e)?0===n?_.some(sn.fromDom(e)):_.none():_.from(e.childNodes[n]).map(sn.fromDom)},vh=function(t){var e=t.endContainer,n=t.endOffset;return Ir(e)?n===e.data.length?_.some(sn.fromDom(e)):_.none():_.from(e.childNodes[n-1]).map(sn.fromDom)},bh=function(t){return Kn(t).fold(v([t]),(function(e){return[t].concat(bh(e))}))},yh=function(t){return Xn(t).fold(v([t]),(function(e){return"br"===hn(e)?Un(e).map((function(e){return[t].concat(yh(e))})).getOr([]):[t].concat(yh(e))}))},wh=function(t,e){return qs(ph(e),vh(e),(function(e,n){var r=nt(bh(t),y(Nn,e)),o=nt(yh(t),y(Nn,n));return r.isSome()&&o.isSome()})).getOr(!1)},xh=function(t,e,n,r){var o=n,i=new Sa(n,o),u=t.schema.getNonEmptyElements();do{if(3===n.nodeType&&0!==nn.trim(n.nodeValue).length)return void(r?e.setStart(n,0):e.setEnd(n,n.nodeValue.length));if(u[n.nodeName]&&!/^(TD|TH)$/.test(n.nodeName))return void(r?e.setStartBefore(n):"BR"===n.nodeName?e.setEndBefore(n):e.setEndAfter(n))}while(n=r?i.next():i.prev());"BODY"===o.nodeName&&(r?e.setStart(o,0):e.setEnd(o,o.childNodes.length))},Ch=function(t){var e=t.selection.getSel();return e&&e.rangeCount>0},Sh=function(t,e){var n=hh(t);n.length>0?X(n,(function(n){var r=n.dom(),o=t.dom.createRng();o.setStartBefore(r),o.setEndAfter(r),e(o,!0)})):e(t.selection.getRng(),!1)},kh=function(t,e,n){var r=kf(t,e);n(r),t.moveToBookmark(r)};function Oh(t,e){var n=function(n){if(!t(n))throw new Error("Can only get "+e+" value of a "+e+" node");return r(n).getOr("")},r=function(e){return t(e)?_.from(e.dom().nodeValue):_.none()},o=function(n,r){if(!t(n))throw new Error("Can only set raw "+e+" value of a "+e+" node");n.dom().nodeValue=r};return{get:n,getOption:r,set:o}}var Th=Oh(wn,"text"),Eh=function(t){return Th.get(t)},_h=function(t){return wn(t)&&Eh(t)===Ai},Ah=function(t,e,n,r){return Ln(e).fold((function(){return"skipping"}),(function(o){return"br"===r||_h(e)?"valid":cs(e)?"existing":rg(e)?"caret":Bg(t,n,r)&&Bg(t,hn(o),n)?"valid":"invalid-child"}))},Dh=function(t,e){var n=ih(t,e,[{inline:!0}]);e.setStart(n.startContainer,n.startOffset),e.setEnd(n.endContainer,n.endOffset),t.selection.setRng(e)},Nh=function(t,e,n,r){var o=e.uid,i=void 0===o?hs("mce-annotation"):o,u=It(e,["uid"]),a=sn.fromTag("span",t);$c(a,os()),Gr(a,""+us(),i),Gr(a,""+is(),n);var c=r(i,u),s=c.attributes,l=void 0===s?{}:s,f=c.classes,d=void 0===f?[]:f;return Kr(a,l),ps(a,d),a},Rh=function(t,e,n,r,o){var i=[],u=Nh(t.getDoc(),o,n,r),a=xc(_.none()),c=function(){a.set(_.none())},s=function(){return a.get().getOrThunk((function(){var t=xs(u);return i.push(t),a.set(_.some(t)),t}))},l=function(t){X(t,f)},f=function(e){var n=Ah(t,e,"span",hn(e));switch(n){case"invalid-child":c();var r=$n(e);l(r),c();break;case"valid":var o=s();ar(e,o);break}},d=function(t){var e=K(t,sn.fromDom);l(e)};return ch(t.dom,e,(function(t){c(),d(t)})),i},Mh=function(t,e,n,r){t.undoManager.transact((function(){var o=t.selection,i=o.getRng(),u=hh(t).length>0;if(i.collapsed&&!u&&Dh(t,i),o.getRng().collapsed&&!u){var a=Nh(t.getDoc(),r,e,n.decorate);ys(a,Di),o.getRng().insertNode(a.dom()),o.select(a.dom())}else kh(o,!1,(function(){Sh(t,(function(o){Rh(t,o,e,n.decorate,r)}))}))}))},zh=function(t){var e=ms();ds(t,e);var n=fs(t);return{register:function(t,n){e.register(t,n)},annotate:function(n,r){e.lookup(n).each((function(e){Mh(t,n,e,r)}))},annotationChanged:function(t,e){n.addListener(t,e)},remove:function(e){as(t,_.some(e)).each((function(t){var e=t.elements;X(e,dr)}))},getAll:function(e){var n=ls(t,e);return vt(n,(function(t){return K(t,(function(t){return t.dom()}))}))}}},Bh=/^[ \t\r\n]*$/,Ph={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},Hh=function(t,e,n){var r=n?"lastChild":"firstChild",o=n?"prev":"next";if(t[r])return t[r];if(t!==e){var i=t[o];if(i)return i;for(var u=t.parent;u&&u!==e;u=u.parent)if(i=u[o],i)return i}},Ih=function(t){if(!Bh.test(t.value))return!1;var e=t.parent;return!e||"span"===e.name&&!e.attr("style")||!/^[ ]+$/.test(t.value)},Lh=function(t){var e="a"===t.name&&!t.attr("href")&&t.attr("id");return t.attr("name")||t.attr("id")&&!t.firstChild||t.attr("data-mce-bookmark")||e},Fh=function(){function t(t,e){this.name=t,this.type=e,1===e&&(this.attributes=[],this.attributes.map={})}return t.create=function(e,n){var r=new t(e,Ph[e]||1);return n&&pt(n,(function(t,e){r.attr(e,t)})),r},t.prototype.replace=function(t){var e=this;return t.parent&&t.remove(),e.insert(t,e),e.remove(),e},t.prototype.attr=function(t,e){var n,r=this;if("string"!==typeof t)return void 0!==t&&null!==t&&pt(t,(function(t,e){r.attr(e,t)})),r;if(n=r.attributes){if(void 0!==e){if(null===e){if(t in n.map){delete n.map[t];var o=n.length;while(o--)if(n[o].name===t)return n.splice(o,1),r}return r}if(t in n.map){o=n.length;while(o--)if(n[o].name===t){n[o].value=e;break}}else n.push({name:t,value:e});return n.map[t]=e,r}return n.map[t]}},t.prototype.clone=function(){var e,n=this,r=new t(n.name,n.type);if(e=n.attributes){var o=[];o.map={};for(var i=0,u=e.length;i<u;i++){var a=e[i];"id"!==a.name&&(o[o.length]={name:a.name,value:a.value},o.map[a.name]=a.value)}r.attributes=o}return r.value=n.value,r.shortEnded=n.shortEnded,r},t.prototype.wrap=function(t){var e=this;return e.parent.insert(t,e),t.append(e),e},t.prototype.unwrap=function(){for(var t=this,e=t.firstChild;e;){var n=e.next;t.insert(e,t,!0),e=n}t.remove()},t.prototype.remove=function(){var t=this,e=t.parent,n=t.next,r=t.prev;return e&&(e.firstChild===t?(e.firstChild=n,n&&(n.prev=null)):r.next=n,e.lastChild===t?(e.lastChild=r,r&&(r.next=null)):n.prev=r,t.parent=t.next=t.prev=null),t},t.prototype.append=function(t){var e=this;t.parent&&t.remove();var n=e.lastChild;return n?(n.next=t,t.prev=n,e.lastChild=t):e.lastChild=e.firstChild=t,t.parent=e,t},t.prototype.insert=function(t,e,n){t.parent&&t.remove();var r=e.parent||this;return n?(e===r.firstChild?r.firstChild=t:e.prev.next=t,t.prev=e.prev,t.next=e,e.prev=t):(e===r.lastChild?r.lastChild=t:e.next.prev=t,t.next=e.next,t.prev=e,e.next=t),t.parent=r,t},t.prototype.getAll=function(t){for(var e=this,n=[],r=e.firstChild;r;r=Hh(r,e))r.name===t&&n.push(r);return n},t.prototype.empty=function(){var t=this;if(t.firstChild){for(var e=[],n=t.firstChild;n;n=Hh(n,t))e.push(n);var r=e.length;while(r--){n=e[r];n.parent=n.firstChild=n.lastChild=n.next=n.prev=null}}return t.firstChild=t.lastChild=null,t},t.prototype.isEmpty=function(t,e,n){void 0===e&&(e={});var r=this,o=r.firstChild;if(Lh(r))return!1;if(o)do{if(1===o.type){if(o.attr("data-mce-bogus"))continue;if(t[o.name])return!1;if(Lh(o))return!1}if(8===o.type)return!1;if(3===o.type&&!Ih(o))return!1;if(3===o.type&&o.parent&&e[o.parent.name]&&Bh.test(o.value))return!1;if(n&&n(o))return!1}while(o=Hh(o,r));return!0},t.prototype.walk=function(t){return Hh(this,null,t)},t}(),Vh=nn.makeMap,Uh=function(t){var e=[];t=t||{};var n=t.indent,r=Vh(t.indent_before||""),o=Vh(t.indent_after||""),i=Zo.getEncodeFunc(t.entity_encoding||"raw",t.entities),u="html"===t.element_format;return{start:function(t,a,c){var s,l,f,d;if(n&&r[t]&&e.length>0&&(d=e[e.length-1],d.length>0&&"\n"!==d&&e.push("\n")),e.push("<",t),a)for(s=0,l=a.length;s<l;s++)f=a[s],e.push(" ",f.name,'="',i(f.value,!0),'"');e[e.length]=!c||u?">":" />",c&&n&&o[t]&&e.length>0&&(d=e[e.length-1],d.length>0&&"\n"!==d&&e.push("\n"))},end:function(t){var r;e.push("</",t,">"),n&&o[t]&&e.length>0&&(r=e[e.length-1],r.length>0&&"\n"!==r&&e.push("\n"))},text:function(t,n){t.length>0&&(e[e.length]=n?t:i(t))},cdata:function(t){e.push("<![CDATA[",t,"]]>")},comment:function(t){e.push("\x3c!--",t,"--\x3e")},pi:function(t,r){r?e.push("<?",t," ",i(r),"?>"):e.push("<?",t,"?>"),n&&e.push("\n")},doctype:function(t){e.push("<!DOCTYPE",t,">",n?"\n":"")},reset:function(){e.length=0},getContent:function(){return e.join("").replace(/\n$/,"")}}},jh=function(t,e){void 0===e&&(e=li());var n=Uh(t);t=t||{},t.validate=!("validate"in t)||t.validate;var r=function(r){var o=t.validate,i={3:function(t){n.text(t.value,t.raw)},8:function(t){n.comment(t.value)},7:function(t){n.pi(t.name,t.value)},10:function(t){n.doctype(t.value)},4:function(t){n.cdata(t.value)},11:function(t){if(t=t.firstChild)do{u(t)}while(t=t.next)}};n.reset();var u=function(t){var r,a,c,s,l,f,d,m,g,h=i[t.type];if(h)h(t);else{if(r=t.name,a=t.shortEnded,c=t.attributes,o&&c&&c.length>1&&(f=[],f.map={},g=e.getElementRule(t.name),g)){for(d=0,m=g.attributesOrder.length;d<m;d++)s=g.attributesOrder[d],s in c.map&&(l=c.map[s],f.map[s]=l,f.push({name:s,value:l}));for(d=0,m=c.length;d<m;d++)s=c[d].name,s in f.map||(l=c.map[s],f.map[s]=l,f.push({name:s,value:l}));c=f}if(n.start(t.name,c,a),!a){if(t=t.firstChild)do{u(t)}while(t=t.next);n.end(r)}}};return 1!==r.type||t.inner?i[11](r):u(r),n.getContent()};return{serialize:r}},Wh=function(t){var e,n=/data:[^;]+;base64,([a-z0-9\+\/=]+)/gi,r=[],o={},i=hs("img"),u=0,a=0;while(e=n.exec(t)){var c=e[0],s=i+"_"+a++;o[s]=c,u<e.index&&r.push(t.substr(u,e.index-u)),r.push(s),u=e.index+c.length}return 0===u?{prefix:i,uris:o,html:t}:(u<t.length&&r.push(t.substr(u)),{prefix:i,uris:o,html:r.join("")})},qh=function(t,e){return t.replace(new RegExp(e.prefix+"_[0-9]+","g"),(function(t){return Ot(e.uris,t).getOr(t)}))},$h=function(t){var e=/data:([^;]+);base64,([a-z0-9\+\/=]+)/i.exec(t);return e?_.some({type:e[1],data:decodeURIComponent(e[2])}):_.none()},Gh=function(t){return 0===t.indexOf("data-")||0===t.indexOf("aria-")},Kh=function(t,e){return!t.allow_html_data_urls&&(/^data:image\//i.test(e)?!1===t.allow_svg_data_urls&&/^data:image\/svg\+xml/i.test(e):/^data:/i.test(e))},Xh=function(t,e,n){var r,o,i=1,u=t.getShortEndedElements(),a=/<([!?\/])?([A-Za-z0-9\-_\:\.]+)((?:\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g;a.lastIndex=r=n;while(o=a.exec(e)){if(r=a.lastIndex,"/"===o[1])i--;else if(!o[1]){if(o[2]in u)continue;i++}if(0===i)break}return r},Yh=function(t,e){return/^\s*\[if [\w\W]+\]>.*<!\[endif\](--!?)?>/.test(t.substr(e))},Jh=function(t,e,n){void 0===n&&(n=0);var r=t.toLowerCase();if(-1!==r.indexOf("[if ",n)&&Yh(r,n)){var o=r.indexOf("[endif]",n);return r.indexOf(">",o)}if(e){var i=r.indexOf(">",n);return-1!==i?i:r.length}var u=/--!?>/;u.lastIndex=n;var a=u.exec(t);return a?a.index+a[0].length:r.length},Qh=function(t,e){var n=t.exec(e);if(n){var r=n[1],o=n[2];return"string"===typeof r&&"data-mce-bogus"===r.toLowerCase()?o:null}return null};function Zh(t,e){void 0===e&&(e=li());var n=function(){};t=t||{},!1!==t.fix_self_closing&&(t.fix_self_closing=!0);var r=t.comment?t.comment:n,o=t.cdata?t.cdata:n,i=t.text?t.text:n,u=t.start?t.start:n,a=t.end?t.end:n,c=t.pi?t.pi:n,s=t.doctype?t.doctype:n,l=function(n,l){void 0===l&&(l="html");var f,d,m,g,h,p,v,b,y,w,x,C,S,k,O,T,E,_,A,D,N=n.html,R=0,M=[],z=0,B=Zo.decode,P=nn.makeMap("src,href,data,background,formaction,poster,xlink:href"),H=/((java|vb)script|mhtml):/i,I="html"===l?0:1,L=function(t){var e,n;e=M.length;while(e--)if(M[e].name===t)break;if(e>=0){for(n=M.length-1;n>=e;n--)t=M[n],t.valid&&a(t.name);M.length=e}},F=function(t,e){return i(qh(t,n),e)},V=function(e){""!==e&&(">"===e.charAt(0)&&(e=" "+e),t.allow_conditional_comments||"[if"!==e.substr(0,3).toLowerCase()||(e=" "+e),r(qh(e,n)))},U=function(t){return Ot(n.uris,t).getOr(t)},j=function(t,e){var n=t||"",r=!we(n,"--"),o=Jh(N,r,e);return t=N.substr(e,o-e),V(r?n+t:t),o+1},W=function(e,n,r,o,i){var u,a,c=/[\s\u0000-\u001F]+/g;if(n=n.toLowerCase(),r=U(n in X?n:B(r||o||i||"")),Y&&!b&&!1===Gh(n)){if(u=k[n],!u&&O){a=O.length;while(a--)if(u=O[a],u.pattern.test(n))break;-1===a&&(u=null)}if(!u)return;if(u.validValues&&!(r in u.validValues))return}if(P[n]&&!t.allow_script_urls){var s=r.replace(c,"");try{s=decodeURIComponent(s)}catch(l){s=unescape(s)}if(H.test(s))return;if(Kh(t,s))return}b&&(n in P||0===n.indexOf("on"))||(g.map[n]=r,g.push({name:n,value:r}))},q=new RegExp("<(?:(?:!--([\\w\\W]*?)--!?>)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:![Dd][Oo][Cc][Tt][Yy][Pp][Ee]([\\w\\W]*?)>)|(?:!(--)?)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)>)|(?:([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g"),$=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,G=e.getShortEndedElements(),K=t.self_closing_elements||e.getSelfClosingElements(),X=e.getBoolAttrs(),Y=t.validate,J=t.remove_internals,Q=t.fix_self_closing,Z=e.getSpecialElements(),tt=N+">";while(f=q.exec(tt)){var et=f[0];if(R<f.index&&F(B(N.substr(R,f.index-R))),d=f[7])d=d.toLowerCase(),":"===d.charAt(0)&&(d=d.substr(1)),L(d);else if(d=f[8]){if(f.index+et.length>N.length){F(B(N.substr(f.index))),R=f.index+et.length;continue}d=d.toLowerCase(),":"===d.charAt(0)&&(d=d.substr(1)),y=d in G,Q&&K[d]&&M.length>0&&M[M.length-1].name===d&&L(d);var nt=Qh($,f[9]);if(null!==nt){if("all"===nt){R=Xh(e,N,q.lastIndex),q.lastIndex=R;continue}x=!1}if(!Y||(w=e.getElementRule(d))){if(x=!0,Y&&(k=w.attributes,O=w.attributePatterns),(S=f[9])?(b=-1!==S.indexOf("data-mce-type"),b&&J&&(x=!1),g=[],g.map={},S.replace($,W)):(g=[],g.map={}),Y&&!b){if(T=w.attributesRequired,E=w.attributesDefault,_=w.attributesForced,A=w.removeEmptyAttrs,A&&!g.length&&(x=!1),_){h=_.length;while(h--)C=_[h],v=C.name,D=C.value,"{$uid}"===D&&(D="mce_"+z++),g.map[v]=D,g.push({name:v,value:D})}if(E){h=E.length;while(h--)C=E[h],v=C.name,v in g.map||(D=C.value,"{$uid}"===D&&(D="mce_"+z++),g.map[v]=D,g.push({name:v,value:D}))}if(T){h=T.length;while(h--)if(T[h]in g.map)break;-1===h&&(x=!1)}if(C=g.map["data-mce-bogus"]){if("all"===C){R=Xh(e,N,q.lastIndex),q.lastIndex=R;continue}x=!1}}x&&u(d,g,y)}else x=!1;if(m=Z[d]){m.lastIndex=R=f.index+et.length,(f=m.exec(N))?(x&&(p=N.substr(R,f.index-R)),R=f.index+f[0].length):(p=N.substr(R),R=N.length),x&&(p.length>0&&F(p,!0),a(d)),q.lastIndex=R;continue}y||(S&&S.indexOf("/")===S.length-1?x&&a(d):M.push({name:d,valid:x}))}else if(d=f[1])V(d);else if(d=f[2]){var rt=1===I||t.preserve_cdata||M.length>0&&e.isValidChild(M[M.length-1].name,"#cdata");if(!rt){R=j("",f.index+2),q.lastIndex=R;continue}o(d)}else if(d=f[3])s(d);else{if((d=f[4])||"<!"===et){R=j(d,f.index+et.length),q.lastIndex=R;continue}if(d=f[5]){if(1!==I){R=j("?",f.index+2),q.lastIndex=R;continue}c(d,f[6])}}R=f.index+et.length}for(R<N.length&&F(B(N.substr(R))),h=M.length-1;h>=0;h--)d=M[h],d.valid&&a(d.name)},f=function(t,e){void 0===e&&(e="html"),l(Wh(t),e)};return{parse:f}}(function(t){t.findEndTag=Xh})(Zh||(Zh={}));var tp,ep=Zh,np=function(t,e){var n=new RegExp(["\\s?("+t.join("|")+')="[^"]+"'].join("|"),"gi");return e.replace(n,"")},rp=function(t,e){var n,r,o,i,u=e,a=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,c=t.schema;u=np(t.getTempAttrs(),u);var s=c.getShortEndedElements();while(i=a.exec(u))r=a.lastIndex,o=i[0].length,n=s[i[1]]?r:ep.findEndTag(c,u,r),u=u.substring(0,r-o)+u.substring(n),a.lastIndex=r-o;return Es(u)},op=rp,ip=function(t,e){var n=Hf(t),r=new RegExp("^(<"+n+"[^>]*>( | |\\s| |<br \\/>|)<\\/"+n+">[\r\n]*|<br \\/>[\r\n]*)$");return e.replace(r,"")},up=function(t,e,n,r){var o;if(e.format=n,e.get=!0,e.getInner=!0,e.no_events||t.fire("BeforeGetContent",e),"raw"===e.format)o=nn.trim(op(t.serializer,r.innerHTML));else if("text"===e.format)o=Es(r.innerText||r.textContent);else{if("tree"===e.format)return t.serializer.serialize(r,e);o=ip(t,t.serializer.serialize(r,e))}return"text"===e.format||Ro(sn.fromDom(r))?e.content=o:e.content=nn.trim(o),e.no_events||t.fire("GetContent",e),e.content},ap=function(t,e,n){return _.from(t.getBody()).fold(v("tree"===e.format?new Fh("body",11):""),(function(r){return up(t,e,n,r)}))},cp=nn.each,sp=function(t){this.compare=function(e,n){if(e.nodeName!==n.nodeName)return!1;var r=function(e){var n={};return cp(t.getAttribs(e),(function(r){var o=r.nodeName.toLowerCase();0!==o.indexOf("_")&&"style"!==o&&0!==o.indexOf("data-")&&(n[o]=t.getAttrib(e,o))})),n},o=function(t,e){var n,r;for(r in t)if(t.hasOwnProperty(r)){if(n=e[r],"undefined"===typeof n)return!1;if(t[r]!==n)return!1;delete e[r]}for(r in e)if(e.hasOwnProperty(r))return!1;return!0};return!!o(r(e),r(n))&&(!!o(t.parseStyle(t.getAttrib(e,"style")),t.parseStyle(t.getAttrib(n,"style")))&&(!Og(e)&&!Og(n)))}},lp=function(t,e,n){return _.from(n.container()).filter(Ir).exists((function(r){var o=t?0:-1;return e(r.data.charAt(n.offset()+o))}))},fp=y(lp,!0,_g),dp=y(lp,!1,_g),mp=function(t){var e=t.container();return Ir(e)&&0===e.data.length},gp=function(t,e){return function(n){return _.from(hm(t?0:-1,n)).filter(e).isSome()}},hp=function(t){return"IMG"===t.nodeName&&"block"===to(sn.fromDom(t),"display")},pp=function(t){return Wr(t)&&!zr(t)},vp=gp(!0,hp),bp=gp(!1,hp),yp=gp(!0,Br),wp=gp(!1,Br),xp=gp(!0,pp),Cp=gp(!1,pp),Sp=function(t,e,n){return es(t,e,n).isSome()},kp=function(t,e){var n=sn.fromDom(t),r=sn.fromDom(e);return Sp(r,"pre,code",y(Nn,n))},Op=function(t,e){return Ir(e)&&/^[ \t\r\n]*$/.test(e.data)&&!1===kp(t,e)},Tp=function(t){return _r(t)&&"A"===t.nodeName&&t.hasAttribute("name")},Ep=function(t,e){return pl(e)&&!1===Op(t,e)||Tp(e)||_p(e)},_p=Nr("data-mce-bookmark"),Ap=Nr("data-mce-bogus"),Dp=Rr("data-mce-bogus","all"),Np=function(t,e){var n,r=0;if(Ep(t,t))return!1;if(n=t.firstChild,!n)return!0;var o=new Sa(n,t);do{if(e){if(Dp(n)){n=o.next(!0);continue}if(Ap(n)){n=o.next();continue}}if(Ur(n))r++,n=o.next();else{if(Ep(t,n))return!1;n=o.next()}}while(n);return r<=1},Rp=function(t,e){return void 0===e&&(e=!0),Np(t.dom(),e)},Mp=function(t){var e=[],n=t.dom();while(n)e.push(sn.fromDom(n)),n=n.lastChild;return e},zp=function(t){var e=Jc(t,"br"),n=Q(Mp(t).slice(-1),Oo);e.length===n.length&&X(n,fr)},Bp=function(t){lr(t),ur(t,sn.fromHtml('<br data-mce-bogus="1">'))},Pp=function(t){Xn(t).each((function(e){Un(e).each((function(n){Co(t)&&Oo(e)&&Co(n)&&fr(e)}))}))},Hp=function(t){return t.slice(0,-1)},Ip=function(t,e,n){return zn(e,t)?Hp(Fn(t,(function(t){return n(t)||Nn(t,e)}))):[]},Lp=function(t,e){return Ip(t,e,v(!1))},Fp=function(t,e){return[t].concat(Lp(t,e))},Vp=function(t,e,n){var r=tt(t,(function(r,o){return _g(o)||Eg(o)?r.previousCharIsSpace||""===r.str&&e||r.str.length===t.length-1&&n?{previousCharIsSpace:!1,str:r.str+Di}:{previousCharIsSpace:!0,str:r.str+" "}:{previousCharIsSpace:!1,str:r.str+o}}),{previousCharIsSpace:!1,str:""});return r.str},Up=function(t,e,n){if(0!==n){var r=t.data.slice(e,e+n),o=e+n>=t.data.length,i=0===e;t.replaceData(e,n,Vp(r,i,o))}},jp=function(t,e){var n=t.data.slice(e),r=n.length-Se(n).length;return Up(t,e,r)},Wp=function(t,e){var n=t.data.slice(0,e),r=n.length-ke(n).length;return Up(t,e-r,r)},qp=function(t,e,n){var r=ke(t.data).length;return t.appendData(e.data),fr(sn.fromDom(e)),n&&jp(t,r),t},$p=function(t,e){var n=t.container(),r=t.offset();return!1===ql.isTextPosition(t)&&n===e.parentNode&&r>ql.before(e).offset()},Gp=function(t,e){return $p(e,t)?ql(e.container(),e.offset()-1):e},Kp=function(t){return Ir(t)?ql(t,0):ql.before(t)},Xp=function(t){return Ir(t)?ql(t,t.data.length):ql.after(t)},Yp=function(t){return pl(t.previousSibling)?_.some(Xp(t.previousSibling)):t.previousSibling?eg(t.previousSibling):_.none()},Jp=function(t){return pl(t.nextSibling)?_.some(Kp(t.nextSibling)):t.nextSibling?tg(t.nextSibling):_.none()},Qp=function(t,e){var n=ql.before(e.previousSibling?e.previousSibling:e.parentNode);return Zm(t,n).fold((function(){return Qm(t,ql.after(e))}),_.some)},Zp=function(t,e){return Qm(t,ql.after(e)).fold((function(){return Zm(t,ql.before(e))}),_.some)},tv=function(t,e){return Yp(e).orThunk((function(){return Jp(e)})).orThunk((function(){return Qp(t,e)}))},ev=function(t,e){return Jp(e).orThunk((function(){return Yp(e)})).orThunk((function(){return Zp(t,e)}))},nv=function(t,e,n){return t?ev(e,n):tv(e,n)},rv=function(t,e,n){return nv(t,e,n).map(y(Gp,n))},ov=function(t,e,n){n.fold((function(){t.focus()}),(function(n){t.selection.setRng(n.toRange(),e)}))},iv=function(t){return function(e){return e.dom()===t}},uv=function(t,e){return e&&t.schema.getBlockElements().hasOwnProperty(hn(e))},av=function(t){if(Rp(t)){var e=sn.fromHtml('<br data-mce-bogus="1">');return lr(t),ur(t,e),_.some(ql.before(e.dom()))}return _.none()},cv=function(t,e,n){var r=Un(t).filter(wn),o=jn(t).filter(wn);return fr(t),$s(r,o,e,(function(t,e,r){var o=t.dom(),i=e.dom(),u=o.data.length;return qp(o,i,n),r.container()===i?ql(o,u):r})).orThunk((function(){return n&&(r.each((function(t){return Wp(t.dom(),t.dom().length)})),o.each((function(t){return jp(t.dom(),0)}))),e}))},sv=function(t,e){return Tt(t.schema.getTextInlineElements(),hn(e))},lv=function(t,e,n,r){void 0===r&&(r=!0);var o=rv(e,t.getBody(),n.dom()),i=Zc(n,y(uv,t),iv(t.getBody())),u=cv(n,o,sv(t,n));t.dom.isEmpty(t.getBody())?(t.setContent(""),t.selection.setCursorLocation()):i.bind(av).fold((function(){r&&ov(t,e,u)}),(function(n){r&&ov(t,e,_.some(n))}))},fv=function(t,e){return{start:t,end:e}},dv=function(t,e,n){return{rng:t,table:e,cells:n}},mv=ja.generate([{removeTable:["element"]},{emptyCells:["cells"]},{deleteCellSelection:["rng","cell"]}]),gv=function(t){return function(e){return Nn(t,e)}},hv=function(t,e){return rs(sn.fromDom(t),"td,th",e)},pv=function(t,e){return es(t,"table",e)},vv=function(t){return!Nn(t.start,t.end)},bv=function(t,e){return pv(t.start,e).bind((function(n){return pv(t.end,e).bind((function(t){return Gs(Nn(n,t),n)}))}))},yv=function(t,e){return!vv(t)&&bv(t,e).exists((function(t){var e=t.dom().rows;return 1===e.length&&1===e[0].cells.length}))},wv=function(t){return Jc(t,"td,th")},xv=function(t,e){var n=hv(t.startContainer,e),r=hv(t.endContainer,e);return qs(n,r,fv)},Cv=function(t,e){return pv(t.start,e).bind((function(e){return dt(wv(e)).map((function(e){return fv(t.start,e)}))}))},Sv=function(t,e){var n=hv(e.startContainer,t),r=hv(e.endContainer,t);return e.collapsed?_.none():qs(n,r,fv).fold((function(){return n.fold((function(){return r.bind((function(e){return pv(e,t).bind((function(t){return ft(wv(t)).map((function(t){return fv(t,e)}))}))}))}),(function(e){return pv(e,t).bind((function(t){return dt(wv(t)).map((function(t){return fv(e,t)}))}))}))}),(function(e){return kv(t,e)?_.none():Cv(e,t)}))},kv=function(t,e){return bv(e,t).isSome()},Ov=function(t,e){return bv(t,e).map((function(e){return dv(t,e,wv(e))}))},Tv=function(t,e,n){return t.filter((function(t){return vv(t)&&kv(n,t)})).orThunk((function(){return Sv(n,e)})).bind((function(t){return Ov(t,n)}))},Ev=function(t,e){return rt(t,(function(t){return Nn(t,e)}))},_v=function(t){return qs(Ev(t.cells,t.rng.start),Ev(t.cells,t.rng.end),(function(e,n){return t.cells.slice(e,n+1)}))},Av=function(t,e,n){return t.filter((function(t){return yv(t,n)&&wh(t.start,e)})).map((function(t){return t.start}))},Dv=function(t){return _v(t).map((function(e){var n=t.cells;return e.length===n.length?mv.removeTable(t.table):mv.emptyCells(e)}))},Nv=function(t,e){var n=gv(t),r=xv(e,n);return Av(r,e,n).map((function(t){return mv.deleteCellSelection(e,t)})).orThunk((function(){return Tv(r,e,n).bind(Dv)}))},Rv=function(t){var e=bn(t)?Un(t):Xn(t);return e.bind(Rv).orThunk((function(){return _.some(t)}))},Mv=function(t,e){return X(e,Bp),t.selection.setCursorLocation(e[0].dom(),0),!0},zv=function(t,e,n){e.deleteContents();var r=Rv(n).getOr(n),o=sn.fromDom(t.dom.getParent(r.dom(),t.dom.isBlock));if(Rp(o)&&(Bp(o),t.selection.setCursorLocation(o.dom(),0)),!Nn(n,o)){var i=Ln(o).is(n)?[]:Vn(o);X(i.concat($n(n)),(function(t){Nn(t,o)||zn(t,o)||fr(t)}))}return!0},Bv=function(t,e){return lv(t,!1,e),!0},Pv=function(t,e,n){return Nv(e,n).map((function(e){return e.fold(y(Bv,t),y(Mv,t),y(zv,t))}))},Hv=function(t,e){return jv(t,e)},Iv=function(t,e,n,r){return Vv(e,r).fold((function(){return Pv(t,e,n)}),(function(e){return Hv(t,e)})).getOr(!1)},Lv=function(t,e){var n=sn.fromDom(t.getBody()),r=t.selection.getRng(),o=hh(t);return 0!==o.length?Mv(t,o):Iv(t,n,r,e)},Fv=function(t,e){return nt(Fp(e,t),No)},Vv=function(t,e){return nt(Fp(e,t),(function(t){return"caption"===hn(t)}))},Uv=function(t,e,n,r,o){return Xm(n,t.getBody(),o).bind((function(t){return Fv(e,sn.fromDom(t.getNode())).map((function(t){return!1===Nn(t,r)}))}))},jv=function(t,e){return Bp(e),t.selection.setCursorLocation(e.dom(),0),_.some(!0)},Wv=function(t,e,n,r){return tg(t.dom()).bind((function(o){return eg(t.dom()).map((function(t){return e?n.isEqual(o)&&r.isEqual(t):n.isEqual(t)&&r.isEqual(o)}))})).getOr(!0)},qv=function(t,e){return jv(t,e)},$v=function(t,e,n){return Vv(t,sn.fromDom(n.getNode())).map((function(t){return!1===Nn(t,e)}))},Gv=function(t,e,n,r,o){return Xm(n,t.getBody(),o).bind((function(i){return Wv(r,n,o,i)?qv(t,r):$v(e,r,i)})).or(_.some(!0))},Kv=function(t,e,n,r){var o=ql.fromRangeStart(t.selection.getRng());return Fv(n,r).bind((function(r){return Rp(r)?jv(t,r):Uv(t,n,e,r,o)})).getOr(!1)},Xv=function(t,e,n,r){var o=ql.fromRangeStart(t.selection.getRng());return Rp(r)?jv(t,r):Gv(t,n,e,r,o)},Yv=function(t,e){return t?yp(e):wp(e)},Jv=function(t,e){var n=ql.fromRangeStart(t.selection.getRng());return Yv(e,n)||Km(e,t.getBody(),n).map((function(t){return Yv(e,t)})).getOr(!1)},Qv=function(t,e,n){var r=sn.fromDom(t.getBody());return Vv(r,n).fold((function(){return Kv(t,e,r,n)||Jv(t,e)}),(function(n){return Xv(t,e,r,n).getOr(!1)}))},Zv=function(t,e){var n=sn.fromDom(t.selection.getStart(!0)),r=hh(t);return t.selection.isCollapsed()&&0===r.length?Qv(t,e,n):Lv(t,n)},tb=function(t,e,r,o){var i=n.document.createRange();return i.setStart(t,e),i.setEnd(r,o),i},eb=function(t){var e=ql.fromRangeStart(t),n=ql.fromRangeEnd(t),r=t.commonAncestorContainer;return Km(!1,r,n).map((function(o){return!gm(e,n,r)&&gm(e,o,r)?tb(e.container(),e.offset(),o.container(),o.offset()):t})).getOr(t)},nb=function(t){return t.collapsed?t:eb(t)},rb=function(t){return t.firstChild&&t.firstChild===t.lastChild},ob=function(t){return"br"===t.name||t.value===Di},ib=function(t,e){var n=t.getBlockElements();return n[e.name]&&rb(e)&&ob(e.firstChild)},ub=function(t,e){var n=t.getNonEmptyElements();return e&&(e.isEmpty(n)||ib(t,e))},ab=function(t,e){var n=e.firstChild,r=e.lastChild;return n&&"meta"===n.name&&(n=n.next),r&&"mce_marker"===r.attr("id")&&(r=r.prev),ub(t,r)&&(r=r.prev),!(!n||n!==r)&&("ul"===n.name||"ol"===n.name)},cb=function(t){var e=t.firstChild,n=t.lastChild;return e&&"META"===e.nodeName&&e.parentNode.removeChild(e),n&&"mce_marker"===n.id&&n.parentNode.removeChild(n),t},sb=function(t,e,n){var r=e.serialize(n),o=t.createFragment(r);return cb(o)},lb=function(t){return nn.grep(t.childNodes,(function(t){return"LI"===t.nodeName}))},fb=function(t){return t.data===Di||Ur(t)},db=function(t){return t&&t.firstChild&&t.firstChild===t.lastChild&&fb(t.firstChild)},mb=function(t){return!t.firstChild||db(t)},gb=function(t){return t.length>0&&mb(t[t.length-1])?t.slice(0,-1):t},hb=function(t,e){var n=t.getParent(e,t.isBlock);return n&&"LI"===n.nodeName?n:null},pb=function(t,e){return!!hb(t,e)},vb=function(t,e){var n=e.cloneRange(),r=e.cloneRange();return n.setStartBefore(t),r.setEndAfter(t),[n.cloneContents(),r.cloneContents()]},bb=function(t,e){var n=ql.before(t),r=Fm(e),o=r.next(n);return o?o.toRange():null},yb=function(t,e){var n=ql.after(t),r=Fm(e),o=r.prev(n);return o?o.toRange():null},wb=function(t,e,n,r){var o=vb(t,r),i=t.parentNode;return i.insertBefore(o[0],t),nn.each(e,(function(e){i.insertBefore(e,t)})),i.insertBefore(o[1],t),i.removeChild(t),yb(e[e.length-1],n)},xb=function(t,e,n){var r=t.parentNode;return nn.each(e,(function(e){r.insertBefore(e,t)})),bb(t,n)},Cb=function(t,e,n,r){return r.insertAfter(e.reverse(),t),yb(e[0],n)},Sb=function(t,e,n,r){var o=sb(e,t,r),i=hb(e,n.startContainer),u=gb(lb(o.firstChild)),a=1,c=2,s=e.getRoot(),l=function(t){var r=ql.fromRangeStart(n),o=Fm(e.getRoot()),u=t===a?o.prev(r):o.next(r);return!u||hb(e,u.getNode())!==i};return l(a)?xb(i,u,s):l(c)?Cb(i,u,s,e):wb(i,u,s,n)},kb=function(t,e){return Ir(t)&&t.nodeValue[e-1]===Di},Ob=function(t,e){var n=t.startContainer,r=t.startOffset,o=function(t){return n[t]&&3===n[t].nodeType};return Ir(n)&&(r>0?e=e.replace(/^ /," "):o("previousSibling")||(e=e.replace(/^ /," ")),r<n.length?e=e.replace(/ (<br>|)$/," "):o("nextSibling")||(e=e.replace(/( | )(<br>|)$/," "))),e},Tb=function(t,e){var n=t.startContainer,r=t.startOffset;return Ir(n)&&t.collapsed&&(n.data[r]===Di?(n.deleteData(r,1),/[\u00a0| ]$/.test(e)||(e+=" ")):n.data[r-1]===Di&&(n.deleteData(r-1,1),/[\u00a0| ]$/.test(e)||(e=" "+e))),e},Eb=Ar(["td","th"]),_b=function(t,e,n){if(null!==n){var r=t.getParent(e.endContainer,Eb);return n===r&&wh(sn.fromDom(n),e)}return!1},Ab=function(t,e){var n=t.selection.getRng(),r=n.startContainer,o=n.startOffset;n.collapsed&&kb(r,o)&&Ir(r)&&(r.insertData(o-1," "),r.deleteData(o,1),n.setStart(r,o),n.setEnd(r,o),t.selection.setRng(n)),t.selection.setContent(e)},Db=function(t,e,n){if("all"===n.getAttribute("data-mce-bogus"))n.parentNode.insertBefore(t.dom.createFragment(e),n);else{var r=n.firstChild,o=n.lastChild;!r||r===o&&"BR"===r.nodeName?t.dom.setHTML(n,e):Ab(t,e)}},Nb=function(t,e){_.from(t.getParent(e,"td,th")).map(sn.fromDom).each(Pp)},Rb=function(t,e){var n=t.schema.getTextInlineElements(),r=t.dom;if(e){var o=t.getBody(),i=new sp(r);nn.each(r.select("*[data-mce-fragment]"),(function(t){for(var e=t.parentNode;e&&e!==o;e=e.parentNode)n[t.nodeName.toLowerCase()]&&i.compare(e,t)&&r.remove(t,!0)}))}},Mb=function(t){var e=t;while(e=e.walk())1===e.type&&e.attr("data-mce-fragment","1")},zb=function(t){nn.each(t.getElementsByTagName("*"),(function(t){t.removeAttribute("data-mce-fragment")}))},Bb=function(t){return!!t.getAttribute("data-mce-fragment")},Pb=function(t,e){return e&&!t.schema.getShortEndedElements()[e.nodeName]},Hb=function(t,e){var n,r,o=t.dom,i=t.selection,u=function(e){for(var n=t.getBody();e&&e!==n;e=e.parentNode)if("false"===t.dom.getContentEditable(e))return e;return null};if(e){t.selection.scrollIntoView(e);var a=u(e);if(a)return o.remove(e),void i.select(a);var c=o.createRng(),s=e.previousSibling;s&&3===s.nodeType?(c.setStart(s,s.nodeValue.length),je.ie||(r=e.nextSibling,r&&3===r.nodeType&&(s.appendData(r.data),r.parentNode.removeChild(r)))):(c.setStartBefore(e),c.setEndBefore(e));var l=function(e){var n=ql.fromRangeStart(e),r=Fm(t.getBody());if(n=r.next(n),n)return n.toRange()},f=o.getParent(e,o.isBlock);o.remove(e),f&&o.isEmpty(f)&&(t.$(f).empty(),c.setStart(f,0),c.setEnd(f,0),Eb(f)||Bb(f)||!(n=l(c))?o.add(f,o.create("br",{"data-mce-bogus":"1"})):(c=n,o.remove(f))),i.setRng(c)}},Ib=function(t){var e=t.dom,n=nb(t.selection.getRng());t.selection.setRng(n);var r=e.getParent(n.startContainer,Eb);_b(e,n,r)?zv(t,n,sn.fromDom(r)):t.getDoc().execCommand("Delete",!1,null)},Lb=function(t,e,n){var r,o,i,u,a,c,s=t.selection,l=t.dom;/^ | $/.test(e)&&(e=Ob(s.getRng(),e));var f=t.parser,d=n.merge,m=jh({validate:pd(t)},t.schema),g='<span id="mce_marker" data-mce-type="bookmark">​</span>';if(i={content:e,format:"html",selection:!0,paste:n.paste},i=t.fire("BeforeSetContent",i),i.isDefaultPrevented())t.fire("SetContent",{content:i.content,format:"html",selection:!0,paste:n.paste});else{e=i.content,-1===e.indexOf("{$caret}")&&(e+="{$caret}"),e=e.replace(/\{\$caret\}/,g),a=s.getRng();var h=a.startContainer||(a.parentElement?a.parentElement():null),p=t.getBody();h===p&&s.isCollapsed()&&l.isBlock(p.firstChild)&&Pb(t,p.firstChild)&&l.isEmpty(p.firstChild)&&(a=l.createRng(),a.setStart(p.firstChild,0),a.setEnd(p.firstChild,0),s.setRng(a)),s.isCollapsed()||(Ib(t),e=Tb(t.selection.getRng(),e)),r=s.getNode();var v={context:r.nodeName.toLowerCase(),data:n.data,insert:!0},b=f.parse(e,v);if(!0===n.paste&&ab(t.schema,b)&&pb(l,r))return a=Sb(m,l,t.selection.getRng(),b),t.selection.setRng(a),void t.fire("SetContent",i);if(Mb(b),c=b.lastChild,"mce_marker"===c.attr("id"))for(u=c,c=c.prev;c;c=c.walk(!0))if(3===c.type||!l.isBlock(c.name)){t.schema.isValidChild(c.parent.name,"span")&&c.parent.insert(u,c,"br"===c.name);break}if(t._selectionOverrides.showBlockCaretContainer(r),v.invalid){Ab(t,g),r=s.getNode(),o=t.getBody(),9===r.nodeType?r=c=o:c=r;while(c!==o)r=c,c=c.parentNode;e=r===o?o.innerHTML:l.getOuterHTML(r),e=m.serialize(f.parse(e.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,(function(){return m.serialize(b)})))),r===o?l.setHTML(o,e):l.setOuterHTML(r,e)}else e=m.serialize(b),Db(t,e,r);Rb(t,d),Hb(t,l.get("mce_marker")),zb(t.getBody()),Nb(t.dom,t.selection.getStart()),t.fire("SetContent",i),t.addVisual()}},Fb=function(){return sn.fromDom(n.document)},Vb=function(t){var e=Zn(t).dom();return t.dom()===e.activeElement},Ub=function(t){return void 0===t&&(t=Fb()),_.from(t.dom().activeElement).map(sn.fromDom)},jb=function(t){return Ub(Zn(t)).filter((function(e){return t.dom().contains(e.dom())}))},Wb=function(t,e,n,r){return{start:v(t),soffset:v(e),finish:v(n),foffset:v(r)}},qb={create:Wb},$b=ja.generate([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Gb=function(t,e,n,r){return t.fold(e,n,r)},Kb=function(t){return t.fold(b,b,b)},Xb=$b.before,Yb=$b.on,Jb=$b.after,Qb={before:Xb,on:Yb,after:Jb,cata:Gb,getStart:Kb},Zb=ja.generate([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),ty=function(t){return Zb.exact(t.start(),t.soffset(),t.finish(),t.foffset())},ey=function(t){return t.match({domRange:function(t){return sn.fromDom(t.startContainer)},relative:function(t,e){return Qb.getStart(t)},exact:function(t,e,n,r){return t}})},ny=Zb.domRange,ry=Zb.relative,oy=Zb.exact,iy=function(t){var e=ey(t);return In(e)},uy=qb.create,ay={domRange:ny,relative:ry,exact:oy,exactFromRange:ty,getWin:iy,range:uy},cy=ze().browser,sy=function(t,e){var n=wn(e)?Eh(e).length:$n(e).length+1;return t>n?n:t<0?0:t},ly=function(t){return ay.range(t.start(),sy(t.soffset(),t.start()),t.finish(),sy(t.foffset(),t.finish()))},fy=function(t,e){return!Er(e.dom())&&(zn(t,e)||Nn(t,e))},dy=function(t){return function(e){return fy(t,e.start())&&fy(t,e.finish())}},my=function(t){return!0===t.inline||cy.isIE()},gy=function(t){return ay.range(sn.fromDom(t.startContainer),t.startOffset,sn.fromDom(t.endContainer),t.endOffset)},hy=function(t){var e=t.getSelection(),n=e&&0!==e.rangeCount?_.from(e.getRangeAt(0)):_.none();return n.map(gy)},py=function(t){var e=In(t);return hy(e.dom()).filter(dy(t))},vy=function(t,e){return _.from(e).filter(dy(t)).map(ly)},by=function(t){var e=n.document.createRange();try{return e.setStart(t.start().dom(),t.soffset()),e.setEnd(t.finish().dom(),t.foffset()),_.some(e)}catch(r){return _.none()}},yy=function(t){var e=my(t)?py(sn.fromDom(t.getBody())):_.none();t.bookmark=e.isSome()?e:t.bookmark},wy=function(t,e){var n=sn.fromDom(t.getBody()),r=my(t)?_.from(e):_.none(),o=r.map(gy).filter(dy(n));t.bookmark=o.isSome()?o:t.bookmark},xy=function(t){var e=t.bookmark?t.bookmark:_.none();return e.bind((function(e){return vy(sn.fromDom(t.getBody()),e)})).bind(by)},Cy=function(t){xy(t).each((function(e){t.selection.setRng(e)}))},Sy=function(t){var e=t.className.toString();return-1!==e.indexOf("tox-")||-1!==e.indexOf("mce-")},ky={isEditorUIElement:Sy},Oy=function(t){return"nodechange"===t.type&&t.selectionChange},Ty=function(t,e){var r=function(){e.throttle()};dc.DOM.bind(n.document,"mouseup",r),t.on("remove",(function(){dc.DOM.unbind(n.document,"mouseup",r)}))},Ey=function(t){t.on("focusout",(function(){yy(t)}))},_y=function(t,e){t.on("mouseup touchend",(function(t){e.throttle()}))},Ay=function(t,e){var n=ze().browser;n.isIE()?Ey(t):_y(t,e),t.on("keyup NodeChange",(function(e){Oy(e)||yy(t)}))},Dy=function(t){var e=Hc((function(){yy(t)}),0);t.on("init",(function(){t.inline&&Ty(t,e),Ay(t,e)})),t.on("remove",(function(){e.cancel()}))},Ny=dc.DOM,Ry=function(t){return ky.isEditorUIElement(t)},My=function(t){var e=t.classList;return void 0!==e&&(e.contains("tox-edit-area")||e.contains("tox-edit-area__iframe")||e.contains("mce-content-body"))},zy=function(t,e){var n=wd(t),r=Ny.getParent(e,(function(e){return Ry(e)||!!n&&t.dom.is(e,n)}));return null!==r},By=function(){try{return n.document.activeElement}catch(t){return n.document.body}},Py=function(t,e){var r=e.editor;Dy(r),r.on("focusin",(function(){var e=this,n=t.focusedEditor;n!==e&&(n&&n.fire("blur",{focusedEditor:e}),t.setActive(e),t.focusedEditor=e,e.fire("focus",{blurredEditor:n}),e.focus(!0))})),r.on("focusout",(function(){var e=this;Za.setEditorTimeout(e,(function(){var n=t.focusedEditor;zy(e,By())||n!==e||(e.fire("blur",{focusedEditor:null}),t.focusedEditor=null)}))})),tp||(tp=function(e){var r=t.activeEditor,o=e.target;r&&o.ownerDocument===n.document&&(o===n.document.body||zy(r,o)||t.focusedEditor!==r||(r.fire("blur",{focusedEditor:null}),t.focusedEditor=null))},Ny.bind(n.document,"focusin",tp))},Hy=function(t,e){t.focusedEditor===e.editor&&(t.focusedEditor=null),t.activeEditor||(Ny.unbind(n.document,"focusin",tp),tp=null)},Iy=function(t){t.on("AddEditor",y(Py,t)),t.on("RemoveEditor",y(Hy,t))},Ly=function(t,e){return t.dom.getParent(e,(function(e){return"true"===t.dom.getContentEditable(e)}))},Fy=function(t){return t.collapsed?_.from(rl(t.startContainer,t.startOffset)).map(sn.fromDom):_.none()},Vy=function(t,e){return Fy(e).bind((function(e){return Do(e)?_.some(e):!1===zn(t,e)?_.some(t):_.none()}))},Uy=function(t,e){Vy(sn.fromDom(t.getBody()),e).bind((function(t){return tg(t.dom())})).fold((function(){t.selection.normalize()}),(function(e){return t.selection.setRng(e.toRange())}))},jy=function(t){if(t.setActive)try{t.setActive()}catch(e){t.focus()}else t.focus()},Wy=function(t){return Vb(t)||jb(t).isSome()},qy=function(t){return t.iframeElement&&Vb(sn.fromDom(t.iframeElement))},$y=function(t){var e=t.getBody();return e&&Wy(sn.fromDom(e))},Gy=function(t){return Ub().filter((function(e){return!My(e.dom())&&zy(t,e.dom())})).isSome()},Ky=function(t){return t.inline?$y(t):qy(t)},Xy=function(t){return Ky(t)||Gy(t)},Yy=function(t){var e=t.selection,n=t.getBody(),r=e.getRng();t.quirks.refreshContentEditable(),void 0!==t.bookmark&&!1===Ky(t)&&xy(t).each((function(e){t.selection.setRng(e),r=e}));var o=Ly(t,e.getNode());if(t.$.contains(n,o))return jy(o),Uy(t,r),void Jy(t);t.inline||(je.opera||jy(n),t.getWin().focus()),(je.gecko||t.inline)&&(jy(n),Uy(t,r)),Jy(t)},Jy=function(t){return t.editorManager.setActive(t)},Qy=function(t,e){t.removed||(e?Jy(t):Yy(t))},Zy=function(t,e){e(t),t.firstChild&&Zy(t.firstChild,e),t.next&&Zy(t.next,e)},tw=function(t,e,n){var r={},o={},i=[];for(var u in n.firstChild&&Zy(n.firstChild,(function(n){X(t,(function(t){t.name===n.name&&(r[t.name]?r[t.name].nodes.push(n):r[t.name]={filter:t,nodes:[n]})})),X(e,(function(t){"string"===typeof n.attr(t.name)&&(o[t.name]?o[t.name].nodes.push(n):o[t.name]={filter:t,nodes:[n]})}))})),r)r.hasOwnProperty(u)&&i.push(r[u]);for(var a in o)o.hasOwnProperty(a)&&i.push(o[a]);return i},ew=function(t,e,n){var r=tw(t,e,n);X(r,(function(t){X(t.filter.callbacks,(function(e){e(t.nodes,t.filter.name,{})}))}))},nw="html",rw=function(t){return t instanceof Fh},ow=function(t){Ky(t)&&tg(t.getBody()).each((function(e){var n=e.getNode(),r=Br(n)?tg(n).getOr(e):e;t.selection.setRng(r.toRange())}))},iw=function(t,e){t.dom.setHTML(t.getBody(),e),ow(t)},uw=function(t,e,n,r){var o,i;return 0===n.length||/^\s+$/.test(n)?(i='<br data-mce-bogus="1">',"TABLE"===e.nodeName?n="<tr><td>"+i+"</td></tr>":/^(UL|OL)$/.test(e.nodeName)&&(n="<li>"+i+"</li>"),o=Hf(t),o&&t.schema.isValidChild(e.nodeName.toLowerCase(),o.toLowerCase())?(n=i,n=t.dom.createHTML(o,If(t),n)):n||(n='<br data-mce-bogus="1">'),iw(t,n),t.fire("SetContent",r)):("raw"!==r.format&&(n=jh({validate:t.validate},t.schema).serialize(t.parser.parse(n,{isRootContent:!0,insert:!0}))),r.content=Ro(sn.fromDom(e))?n:nn.trim(n),iw(t,r.content),r.no_events||t.fire("SetContent",r)),r.content},aw=function(t,e,n,r){ew(t.parser.getNodeFilters(),t.parser.getAttributeFilters(),n);var o=jh({validate:t.validate},t.schema).serialize(n);return r.content=Ro(sn.fromDom(e))?o:nn.trim(o),iw(t,r.content),r.no_events||t.fire("SetContent",r),n},cw=function(t,e,n){return n.format=n.format?n.format:nw,n.set=!0,n.content=rw(e)?"":e,rw(e)||n.no_events||(t.fire("BeforeSetContent",n),e=n.content),_.from(t.getBody()).fold(v(e),(function(r){return rw(e)?aw(t,r,e,n):uw(t,r,e,n)}))},sw=function(t,e){return t.splitText(e)},lw=function(t){var e=t.startContainer,n=t.startOffset,r=t.endContainer,o=t.endOffset;return e===r&&Ir(e)?n>0&&n<e.nodeValue.length&&(r=sw(e,n),e=r.previousSibling,o>n?(o-=n,e=r=sw(r,o).previousSibling,o=r.nodeValue.length,n=0):o=0):(Ir(e)&&n>0&&n<e.nodeValue.length&&(e=sw(e,n),n=0),Ir(r)&&o>0&&o<r.nodeValue.length&&(r=sw(r,o).previousSibling,o=r.nodeValue.length)),{startContainer:e,startOffset:n,endContainer:r,endOffset:o}},fw=Lg,dw=function(t,e,n){var r=t.formatter.get(n);if(r)for(var o=0;o<r.length;o++)if(!1===r[o].inherit&&t.dom.is(e,r[o].selector))return!0;return!1},mw=function(t,e,n,r){var o=t.dom.getRoot();return e!==o&&(e=t.dom.getParent(e,(function(e){return!!dw(t,e,n)||(e.parentNode===o||!!pw(t,e,n,r,!0))})),pw(t,e,n,r))},gw=function(t,e,n){return!!fw(e,n.inline)||(!!fw(e,n.block)||(n.selector?1===e.nodeType&&t.is(e,n.selector):void 0))},hw=function(t,e,n,r,o,i){var u,a,c,s=n[r];if(n.onmatch)return n.onmatch(e,n,r);if(s)if("undefined"===typeof s.length){for(u in s)if(s.hasOwnProperty(u)){if(a="attributes"===r?t.getAttrib(e,u):Vg(t,e,u),o&&!a&&!n.exact)return;if((!o||n.exact)&&!fw(a,Fg(t,Ig(s[u],i),u)))return}}else for(c=0;c<s.length;c++)if("attributes"===r?t.getAttrib(e,s[c]):Vg(t,e,s[c]))return n;return n},pw=function(t,e,n,r,o){var i,u,a,c,s=t.formatter.get(n),l=t.dom;if(s&&e)for(u=0;u<s.length;u++)if(i=s[u],gw(t.dom,e,i)&&hw(l,e,i,"attributes",o,r)&&hw(l,e,i,"styles",o,r)){if(c=i.classes)for(a=0;a<c.length;a++)if(!t.dom.hasClass(e,c[a]))return;return i}},vw=function(t,e,n,r){if(r)return mw(t,r,e,n);if(r=t.selection.getNode(),mw(t,r,e,n))return!0;var o=t.selection.getStart();return!(o===r||!mw(t,o,e,n))},bw=function(t,e,n){var r=[],o={},i=t.selection.getStart();return t.dom.getParent(i,(function(i){for(var u=0;u<e.length;u++){var a=e[u];!o[a]&&pw(t,i,a,n)&&(o[a]=!0,r.push(a))}}),t.dom.getRoot()),r},yw=function(t,e){var n,r,o,i,u,a=t.formatter.get(e),c=t.dom;if(a)for(n=t.selection.getStart(),r=jg(c,n),i=a.length-1;i>=0;i--){if(u=a[i].selector,!u||a[i].defaultBlock)return!0;for(o=r.length-1;o>=0;o--)if(c.is(r[o],u))return!0}return!1},ww=function(t,e,n){return tt(n,(function(n,r){var o=Wg(t,r);return t.formatter.matchNode(e,r,{},o)?n.concat([r]):n}),[])},xw=Os,Cw="_mce_caret",Sw=function(t,e){return t.importNode(e,!0)},kw=function(t){var e=[];while(t){if(3===t.nodeType&&t.nodeValue!==xw||t.childNodes.length>1)return[];1===t.nodeType&&e.push(t),t=t.firstChild}return e},Ow=function(t){return kw(t).length>0},Tw=function(t){if(t){var e=new Sa(t,t);for(t=e.current();t;t=e.next())if(Ir(t))return t}return null},Ew=function(t){var e=sn.fromTag("span");return Kr(e,{id:Cw,"data-mce-bogus":"1","data-mce-type":"format-caret"}),t&&ur(e,sn.fromText(xw)),e},_w=function(t){var e=Tw(t);return e&&e.nodeValue.charAt(0)===xw&&e.deleteData(0,1),e},Aw=function(t,e,n){void 0===n&&(n=!0);var r=t.dom,o=t.selection;if(Ow(e))lv(t,!1,sn.fromDom(e),n);else{var i=o.getRng(),u=r.getParent(e,r.isBlock),a=i.startContainer,c=i.startOffset,s=i.endContainer,l=i.endOffset,f=_w(e);r.remove(e,!0),a===f&&c>0&&i.setStart(f,c-1),s===f&&l>0&&i.setEnd(f,l-1),u&&r.isEmpty(u)&&Bp(sn.fromDom(u)),o.setRng(i)}},Dw=function(t,e,n){void 0===n&&(n=!0);var r=t.dom,o=t.selection;if(e)Aw(t,e,n);else if(e=og(t.getBody(),o.getStart()),!e)while(e=r.get(Cw))Aw(t,e,!1)},Nw=function(t,e,n){var r=t.dom,o=r.getParent(n,y(zg,t));o&&r.isEmpty(o)?n.parentNode.replaceChild(e,n):(zp(sn.fromDom(n)),r.isEmpty(n)?n.parentNode.replaceChild(e,n):r.insertAfter(e,n))},Rw=function(t,e){return t.appendChild(e),e},Mw=function(t,e){var n=Z(t,(function(t,e){return Rw(t,e.cloneNode(!1))}),e);return Rw(n,n.ownerDocument.createTextNode(xw))},zw=function(t,e,n,r,o,i){var u=t.formatter,a=t.dom,c=Q(gt(u.get()),(function(t){return"removeformat"!==t&&t!==r})),s=ww(t,n,c),l=Q(s,(function(e){return!qg(t,e,r)}));if(l.length>0){var f=n.cloneNode(!1);return a.add(e,f),u.remove(r,o,f,i),a.remove(f),_.some(f)}return _.none()},Bw=function(t,e,n){var r,o,i=t.selection,u=i.getRng(),a=u.startOffset,c=u.startContainer,s=c.nodeValue;r=og(t.getBody(),i.getStart()),r&&(o=Tw(r));var l=/[^\s\u00a0\u00ad\u200b\ufeff]/;if(s&&a>0&&a<s.length&&l.test(s.charAt(a))&&l.test(s.charAt(a-1))){var f=i.getBookmark();u.collapse(!0);var d=ih(t,u,t.formatter.get(e));d=lw(d),t.formatter.apply(e,n,d),i.moveToBookmark(f)}else r&&o.nodeValue===xw||(r=Sw(t.getDoc(),Ew(!0).dom()),o=r.firstChild,u.insertNode(r),a=1),t.formatter.apply(e,n,r),i.setCursorLocation(o,a)},Pw=function(t,e,n,r){var o,i,u,a=t.dom,c=t.selection,s=[],l=c.getRng(),f=l.startContainer,d=l.startOffset;i=f,3===f.nodeType&&(d!==f.nodeValue.length&&(o=!0),i=i.parentNode);while(i){if(pw(t,i,e,n,r)){u=i;break}i.nextSibling&&(o=!0),s.push(i),i=i.parentNode}if(u)if(o){var m=c.getBookmark();l.collapse(!0);var g=ih(t,l,t.formatter.get(e),!0);g=lw(g),t.formatter.remove(e,n,g,r),c.moveToBookmark(m)}else{var h=og(t.getBody(),u),p=Ew(!1).dom();Nw(t,p,null!==h?h:u);var v=zw(t,p,u,e,n,r),b=Mw(s.concat(v.toArray()),p);Aw(t,h,!1),c.setCursorLocation(b,1),a.isEmpty(u)&&a.remove(u)}},Hw=function(t,e){var n=t.selection,r=t.getBody();Dw(t,null,!1),8!==e&&46!==e||!n.isCollapsed()||n.getStart().innerHTML!==xw||Dw(t,og(r,n.getStart())),37!==e&&39!==e||Dw(t,og(r,n.getStart()))},Iw=function(t){t.on("mouseup keydown",(function(e){Hw(t,e.keyCode)}))},Lw=function(t,e){var n=Ew(!1),r=Mw(e,n.dom());return rr(sn.fromDom(t),n),fr(sn.fromDom(t)),ql(r,0)},Fw=function(t,e){var n=t.schema.getTextInlineElements();return n.hasOwnProperty(hn(e))&&!rg(e.dom())&&!Mr(e.dom())},Vw=function(t){return rg(t.dom())&&Ow(t.dom())},Uw={},jw=Rt,Ww=Dt,qw=function(t,e){var n=Uw[t];n||(Uw[t]=[]),Uw[t].push(e)},$w=function(t,e){Ww(Uw[t],(function(t){t(e)}))};qw("pre",(function(t){var e,n=t.selection.getRng(),r=function(t){return i(t.previousSibling)&&-1!==Mt(e,t.previousSibling)},o=function(t,e){Ca(e).remove(),Ca(t).append("<br><br>").append(e.childNodes)},i=Ar(["pre"]);n.collapsed||(e=t.selection.getSelectedBlocks(),Ww(jw(jw(e,i),r),(function(t){o(t.previousSibling,t)})))}));var Gw=/^(src|href|style)$/,Kw=nn.each,Xw=Lg,Yw=function(t){return/^(TR|TH|TD)$/.test(t.nodeName)},Jw=function(t,e,n){return t.isChildOf(e,n)&&e!==n&&!t.isBlock(n)},Qw=function(t,e,n){var r,o;if(r=e[n?"startContainer":"endContainer"],o=e[n?"startOffset":"endOffset"],_r(r)){var i=r.childNodes.length-1;!n&&o&&o--,r=r.childNodes[o>i?i:o]}return Ir(r)&&n&&o>=r.nodeValue.length&&(r=new Sa(r,t.getBody()).next()||r),Ir(r)&&!n&&0===o&&(r=new Sa(r,t.getBody()).prev()||r),r},Zw=function(t,e){var n=e?"firstChild":"lastChild";if(Yw(t)&&t[n]){var r=t[n];return"TR"===t.nodeName&&r[n]||r}return t},tx=function(t,e,n,r){var o=t.create(n,r);return e.parentNode.insertBefore(o,e),o.appendChild(e),o},ex=function(t,e,n,r,o){var i=sn.fromDom(e),u=sn.fromDom(t.create(r,o)),a=n?qn(i):Wn(i);return sr(u,a),n?(rr(i,u),ir(u,i)):(or(i,u),ur(u,i)),u.dom()},nx=function(t,e,n){return!!Xw(e,n.inline)||(!!Xw(e,n.block)||(n.selector?_r(e)&&t.is(e,n.selector):void 0))},rx=function(t,e){return e.links&&"A"===t.nodeName},ox=function(t,e,n,r){return e=Mg(e,n,r),!e||"BR"===e.nodeName||t.isBlock(e)},ix=function(t,e,n){var r,o=e.parentNode,i=t.dom,u=Hf(t);n.block&&(u?o===i.getRoot()&&(n.list_block&&Xw(e,n.list_block)||X(mt(e.childNodes),(function(e){Bg(t,u,e.nodeName.toLowerCase())?r?r.appendChild(e):(r=tx(i,e,u),i.setAttribs(r,t.settings.forced_root_block_attrs)):r=0}))):i.isBlock(e)&&!i.isBlock(o)&&(ox(i,e,!1)||ox(i,e.firstChild,!0,!0)||e.insertBefore(i.create("br"),e.firstChild),ox(i,e,!0)||ox(i,e.lastChild,!1,!0)||e.appendChild(i.create("br")))),n.selector&&n.inline&&!Xw(n.inline,e)||i.remove(e,!0)},ux=function(t,e,n,r,o){var i,u=t.dom;if(!nx(u,r,e)&&!rx(r,e))return!1;var a=r;if(e.inline&&"all"===e.remove&&B(e.preserve_attributes)){var c=Q(u.getAttribs(a),(function(t){return $(e.preserve_attributes,t.name.toLowerCase())}));if(u.removeAllAttribs(a),X(c,(function(t){return u.setAttrib(a,t.name,t.value)})),c.length>0)return t.dom.rename(r,"span"),!0}if("all"!==e.remove){Kw(e.styles,(function(t,r){t=Fg(u,Ig(t,n),r),"number"===typeof r&&(r=t,o=null),(e.remove_similar||!o||Xw(Vg(u,o,r),t))&&u.setStyle(a,r,""),i=!0})),i&&""===u.getAttrib(a,"style")&&(a.removeAttribute("style"),a.removeAttribute("data-mce-style")),Kw(e.attributes,(function(t,r){var i;if(t=Ig(t,n),"number"===typeof r&&(r=t,o=null),e.remove_similar||!o||Xw(u.getAttrib(o,r),t)){if("class"===r&&(t=u.getAttrib(a,r),t&&(i="",X(t.split(/\s+/),(function(t){/mce\-\w+/.test(t)&&(i+=(i?" ":"")+t)})),i)))return void u.setAttrib(a,r,i);"class"===r&&a.removeAttribute("className"),Gw.test(r)&&a.removeAttribute("data-mce-"+r),a.removeAttribute(r)}})),Kw(e.classes,(function(t){t=Ig(t,n),o&&!u.hasClass(o,t)||u.removeClass(a,t)}));for(var s=u.getAttribs(a),l=0;l<s.length;l++){var f=s[l].nodeName;if(0!==f.indexOf("_")&&0!==f.indexOf("data-"))return!1}}return"none"!==e.remove?(ix(t,a,e),!0):void 0},ax=function(t,e,n,r,o){var i;return X(jg(t.dom,e.parentNode).reverse(),(function(e){if(!i&&"_start"!==e.id&&"_end"!==e.id){var u=pw(t,e,n,r,o);u&&!1!==u.split&&(i=e)}})),i},cx=function(t,e,n,r,o,i,u,a){var c,s,l,f=t.dom;if(n){for(var d=n.parentNode,m=r.parentNode;m&&m!==d;m=m.parentNode){c=f.clone(m,!1);for(var g=0;g<e.length;g++)if(ux(t,e[g],a,c,c)){c=0;break}c&&(s&&c.appendChild(s),l||(l=c),s=c)}!i||u.mixed&&f.isBlock(n)||(r=f.split(n,r)),s&&(o.parentNode.insertBefore(s,o),l.appendChild(o))}return r},sx=function(t,e,n,r,o){var i=t.formatter.get(e),u=i[0],a=!0,c=t.dom,s=t.selection,l=function(r){var a=ax(t,r,e,n,o);return cx(t,i,a,r,r,!0,u,n)},f=function(t){return Og(t)&&_r(t)&&("_start"===t.id||"_end"===t.id)},d=function(e){var r,o;_r(e)&&c.getContentEditable(e)&&(r=a,a="true"===c.getContentEditable(e),o=!0);var s=mt(e.childNodes);if(a&&!o)for(var l=0;l<i.length;l++)if(ux(t,i[l],n,e,e))break;if(u.deep&&s.length){for(l=0;l<s.length;l++)d(s[l]);o&&(a=r)}},m=function(t){var e=c.get(t?"_start":"_end"),n=e[t?"firstChild":"lastChild"];return f(n)&&(n=n[t?"firstChild":"lastChild"]),Ir(n)&&0===n.data.length&&(n=t?e.previousSibling||e.nextSibling:e.nextSibling||e.previousSibling),c.remove(e,!0),n},g=function(e){var n,r,o=ih(t,e,i,!0);if(u.split){if(o=lw(o),n=Qw(t,o,!0),r=Qw(t,o),n!==r){if(n=Zw(n,!0),r=Zw(r,!1),Jw(c,n,r)){var a=_.from(n.firstChild).getOr(n);return l(ex(c,a,!0,"span",{id:"_start","data-mce-type":"bookmark"})),void m(!0)}if(Jw(c,r,n)){a=_.from(r.lastChild).getOr(r);return l(ex(c,a,!1,"span",{id:"_end","data-mce-type":"bookmark"})),void m(!1)}n=tx(c,n,"span",{id:"_start","data-mce-type":"bookmark"}),r=tx(c,r,"span",{id:"_end","data-mce-type":"bookmark"});var s=c.createRng();s.setStartAfter(n),s.setEndBefore(r),ch(c,s,(function(t){X(t,(function(t){Og(t)||Og(t.parentNode)||l(t)}))})),l(n),l(r),n=m(!0),r=m()}else n=r=l(n);o.startContainer=n.parentNode?n.parentNode:n,o.startOffset=c.nodeIndex(n),o.endContainer=r.parentNode?r.parentNode:r,o.endOffset=c.nodeIndex(r)+1}ch(c,o,(function(e){X(e,(function(e){d(e);var n=["underline","line-through","overline"];X(n,(function(n){_r(e)&&t.dom.getStyle(e,"text-decoration")===n&&e.parentNode&&Ug(c,e.parentNode)===n&&ux(t,{deep:!1,exact:!0,inline:"span",styles:{textDecoration:n}},null,e)}))}))}))};if(r)if(Dg(r)){var h=c.createRng();h.setStartBefore(r),h.setEndAfter(r),g(h)}else g(r);else if("false"!==c.getContentEditable(s.getNode()))s.isCollapsed()&&u.inline&&!hh(t).length?Pw(t,e,n,o):(kh(s,!0,(function(){Sh(t,g)})),u.inline&&vw(t,e,n,s.getStart())&&Rg(c,s,s.getRng()),t.nodeChanged());else{r=s.getNode();for(var p=0;p<i.length;p++)if(i[p].ceFalseOverride&&ux(t,i[p],n,r,r))break}},lx=nn.each,fx=function(t){return _r(t)&&!Og(t)&&!rg(t)&&!Mr(t)},dx=function(t,e){var n;for(n=t;n;n=n[e]){if(Ir(n)&&0!==n.nodeValue.length)return t;if(_r(n)&&!Og(n))return n}return t},mx=function(t,e,n){var r,o,i=new sp(t);if(e&&n&&(e=dx(e,"previousSibling"),n=dx(n,"nextSibling"),i.compare(e,n))){for(r=e.nextSibling;r&&r!==n;)o=r,r=r.nextSibling,e.appendChild(o);return t.remove(n),nn.each(nn.grep(n.childNodes),(function(t){e.appendChild(t)})),e}return n},gx=function(t,e,n){lx(t.childNodes,(function(t){fx(t)&&(e(t)&&n(t),t.hasChildNodes()&&gx(t,e,n))}))},hx=function(t,e){return function(n){return!(!n||!Vg(t,n,e))}},px=function(t,e,n){return function(r){t.setStyle(r,e,n),""===r.getAttribute("style")&&r.removeAttribute("style"),vx(t,r)}},vx=function(t,e){"SPAN"===e.nodeName&&0===t.getAttribs(e).length&&t.remove(e,!0)},bx=function(t,e,n,r){var o=function(e){if(1===e.nodeType&&e.parentNode&&1===e.parentNode.nodeType){var n=Ug(t,e.parentNode);t.getStyle(e,"color")&&n?t.setStyle(e,"text-decoration",n):t.getStyle(e,"text-decoration")===n&&t.setStyle(e,"text-decoration",null)}};e.styles&&(e.styles.color||e.styles.textDecoration)&&(nn.walk(r,o,"childNodes"),o(r))},yx=function(t,e,n,r){e.styles&&e.styles.backgroundColor&&gx(r,hx(t,"fontSize"),px(t,"backgroundColor",Ig(e.styles.backgroundColor,n)))},wx=function(t,e,n,r){"sub"!==e.inline&&"sup"!==e.inline||(gx(r,hx(t,"fontSize"),px(t,"fontSize","")),t.remove(t.select("sup"===e.inline?"sub":"sup",r),!0))},xx=function(t,e,n,r){r&&!1!==e.merge_siblings&&(r=mx(t,Mg(r),r),r=mx(t,r,Mg(r,!0)))},Cx=function(t,e,n){if(e.clear_child_styles){var r=e.links?"*:not(a)":"*";lx(t.select(r,n),(function(n){fx(n)&&lx(e.styles,(function(e,r){t.setStyle(n,r,"")}))}))}},Sx=function(t,e,n,r){lx(e,(function(e){lx(t.dom.select(e.inline,r),(function(r){fx(r)&&ux(t,e,n,r,e.exact?r:null)})),Cx(t.dom,e,r)}))},kx=function(t,e,n,r,o){pw(t,o.parentNode,n,r)&&ux(t,e,r,o)||e.merge_with_parents&&t.dom.getParent(o.parentNode,(function(i){if(pw(t,i,n,r))return ux(t,e,r,o),!0}))},Ox=nn.each,Tx=function(t){return t&&1===t.nodeType&&!Og(t)&&!rg(t)&&!Mr(t)},Ex=function(t,e,n,r){var o,i=t.formatter.get(e),u=i[0],a=!r&&t.selection.isCollapsed(),c=t.dom,s=t.selection,l=function(t,e){if(e=e||u,t){if(e.onformat&&e.onformat(t,e,n,r),Ox(e.styles,(function(e,r){c.setStyle(t,r,Ig(e,n))})),e.styles){var o=c.getAttrib(t,"style");o&&c.setAttrib(t,"data-mce-style",o)}Ox(e.attributes,(function(e,r){c.setAttrib(t,r,Ig(e,n))})),Ox(e.classes,(function(e){e=Ig(e,n),c.hasClass(t,e)||c.addClass(t,e)}))}},f=function(t,e){var n=!1;return!!u.selector&&(Ox(t,(function(t){if(!("collapsed"in t)||t.collapsed===a)return c.is(e,t.selector)&&!rg(e)?(l(e,t),n=!0,!1):void 0})),n)},d=function(r,o,a,c){var s=[],d=!0,m=u.inline||u.block,g=r.create(m);l(g),ch(r,o,(function(o){var a,h=function(o){var p=!1,v=d,b=o.nodeName.toLowerCase(),y=o.parentNode.nodeName.toLowerCase();if(_r(o)&&r.getContentEditable(o)&&(v=d,d="true"===r.getContentEditable(o),p=!0),Lg(b,"br"))return a=0,void(u.block&&r.remove(o));if(u.wrapper&&pw(t,o,e,n))a=0;else{if(d&&!p&&u.block&&!u.wrapper&&zg(t,b)&&Bg(t,y,m))return o=r.rename(o,m),l(o),s.push(o),void(a=0);if(u.selector){var w=f(i,o);if(!u.inline||w)return void(a=0)}!d||p||!Bg(t,m,b)||!Bg(t,y,m)||!c&&3===o.nodeType&&1===o.nodeValue.length&&65279===o.nodeValue.charCodeAt(0)||rg(o)||u.inline&&r.isBlock(o)?(a=0,Ox(nn.grep(o.childNodes),h),p&&(d=v),a=0):(a||(a=r.clone(g,!1),o.parentNode.insertBefore(a,o),s.push(a)),a.appendChild(o))}};Ox(o,h)})),!0===u.links&&Ox(s,(function(t){var e=function(t){"A"===t.nodeName&&l(t,u),Ox(nn.grep(t.childNodes),e)};e(t)})),Ox(s,(function(o){var a=function(t){var e=0;return Ox(t.childNodes,(function(t){Hg(t)||Og(t)||e++})),e},c=function(t){var e=!1;return Ox(t.childNodes,(function(t){if(Tx(t))return e=t,!1})),e},f=function(t){var e,n=c(t);return n&&!Og(n)&&gw(r,n,u)&&(e=r.clone(n,!1),l(e),r.replace(e,t,!0),r.remove(n,!0)),e||t},d=a(o);!(s.length>1)&&r.isBlock(o)||0!==d?(u.inline||u.wrapper)&&(u.exact||1!==d||(o=f(o)),Sx(t,i,n,o),kx(t,u,e,n,o),yx(r,u,n,o),bx(r,u,n,o),wx(r,u,n,o),xx(r,u,n,o)):r.remove(o,!0)}))};if("false"!==c.getContentEditable(s.getNode())){if(u){if(r)Dg(r)?f(i,r)||(o=c.createRng(),o.setStartBefore(r),o.setEndAfter(r),d(c,ih(t,o,i),null,!0)):d(c,r,null,!0);else if(a&&u.inline&&!hh(t).length)Bw(t,e,n);else{var m=s.getNode();t.settings.forced_root_block||!i[0].defaultBlock||c.getParent(m,c.isBlock)||Ex(t,i[0].defaultBlock),s.setRng(nb(s.getRng())),kh(s,!0,(function(e){Sh(t,(function(e,n){var r=n?e:ih(t,e,i);d(c,r)}))})),Rg(c,s,s.getRng()),t.nodeChanged()}$w(e,t)}}else{r=s.getNode();for(var g=0,h=i.length;g<h;g++)if(i[g].ceFalseOverride&&c.is(r,i[g].selector))return void l(r,i[g])}},_x=function(t,e,n,r){var o=t.formatter.get(e);!vw(t,e,n,r)||"toggle"in o[0]&&!o[0].toggle?Ex(t,e,n,r):sx(t,e,n,r)},Ax=function(t,e){return K(e,(function(e){var n=t.fire("GetSelectionRange",{range:e});return n.range!==e?n.range:e}))},Dx=function(t,e){var r=e||n.document,o=r.createDocumentFragment();return X(t,(function(t){o.appendChild(t.dom())})),sn.fromDom(o)},Nx=function(t,e,n){return{element:v(t),width:v(e),rows:v(n)}},Rx=function(t,e){return{element:v(t),cells:v(e)}},Mx=function(t,e){return{x:v(t),y:v(e)}},zx=function(t,e){var n=parseInt(Xr(t,e),10);return isNaN(n)?1:n},Bx=function(t,e,n,r,o){for(var i=zx(o,"rowspan"),u=zx(o,"colspan"),a=t.rows(),c=n;c<n+i;c++){a[c]||(a[c]=Rx(Cs(r),[]));for(var s=e;s<e+u;s++){var l=a[c].cells();l[s]=c===n&&s===e?o:xs(o)}}},Px=function(t,e,n){var r=t.rows(),o=r[n]?r[n].cells():[];return!!o[e]},Hx=function(t,e,n){while(Px(t,e,n))e++;return e},Ix=function(t){return tt(t,(function(t,e){return e.cells().length>t?e.cells().length:t}),0)},Lx=function(t,e){for(var n=t.rows(),r=0;r<n.length;r++)for(var o=n[r].cells(),i=0;i<o.length;i++)if(Nn(o[i],e))return _.some(Mx(i,r));return _.none()},Fx=function(t,e,n,r,o){for(var i=[],u=t.rows(),a=n;a<=o;a++){var c=u[a].cells(),s=e<r?c.slice(e,r+1):c.slice(r,e+1);i.push(Rx(u[a].element(),s))}return i},Vx=function(t,e,n){var r=e.x(),o=e.y(),i=n.x(),u=n.y(),a=o<u?Fx(t,r,o,i,u):Fx(t,r,u,i,o);return Nx(t.element(),Ix(a),a)},Ux=function(t,e){var n=xs(t.element()),r=sn.fromTag("tbody");return sr(r,e),ur(n,r),n},jx=function(t){return K(t.rows(),(function(t){var e=K(t.cells(),(function(t){var e=Cs(t);return Qr(e,"colspan"),Qr(e,"rowspan"),e})),n=xs(t.element());return sr(n,e),n}))},Wx=function(t){var e=Nx(xs(t),0,[]);return X(Jc(t,"tr"),(function(t,n){X(Jc(t,"td,th"),(function(r,o){Bx(e,Hx(e,o,n),n,t,r)}))})),Nx(e.element(),Ix(e.rows()),e.rows())},qx=function(t){return Ux(t,jx(t))},$x=function(t,e,n){return Lx(t,e).bind((function(e){return Lx(t,n).map((function(n){return Vx(t,e,n)}))}))},Gx=function(t){return nt(t,(function(t){return"ul"===hn(t)||"ol"===hn(t)}))},Kx=function(t,e){return nt(t,(function(t){return"li"===hn(t)&&wh(t,e)})).fold(v([]),(function(e){return Gx(t).map((function(t){return[sn.fromTag("li"),sn.fromTag(hn(t))]})).getOr([])}))},Xx=function(t,e){var n=tt(e,(function(t,e){return ur(e,t),e}),t);return e.length>0?Dx([n]):n},Yx=function(t){return _o(t)?Ln(t).filter(Eo).fold(v([]),(function(e){return[t,e]})):Eo(t)?[t]:[]},Jx=function(t,e){var n=sn.fromDom(e.commonAncestorContainer),r=Fp(n,t),o=Q(r,(function(t){return ko(t)||xo(t)})),i=Kx(r,e),u=o.concat(i.length?i:Yx(n));return K(u,xs)},Qx=function(){return Dx([])},Zx=function(t,e){return Xx(sn.fromDom(e.cloneContents()),Jx(t,e))},tC=function(t,e){return es(e,"table",y(Nn,t))},eC=function(t,e){return tC(t,e[0]).bind((function(t){var n=e[0],r=e[e.length-1],o=Wx(t);return $x(o,n,r).map((function(t){return Dx([qx(t)])}))})).getOrThunk(Qx)},nC=function(t,e){return e.length>0&&e[0].collapsed?Qx():Zx(t,e[0])},rC=function(t,e){var n=gh(e,t);return n.length>0?eC(t,n):nC(t,e)},oC=function(t){return t.replace(/^[ \f\n\r\t\v]+/,"")},iC=function(t,e){return e>=0&&e<t.length&&_g(t.charAt(e))},uC=function(t){var e=Es(t.innerText);return je.browser.isIE()?oC(e):e},aC=function(t){return _.from(t.selection.getRng()).map((function(e){var n=t.dom.add(t.getBody(),"div",{"data-mce-bogus":"all",style:"overflow: hidden; opacity: 0;"},e.cloneContents()),r=uC(n),o=Es(n.textContent);if(t.dom.remove(n),iC(o,0)||iC(o,o.length-1)){var i=t.dom.getParent(e.commonAncestorContainer,t.dom.isBlock),u=uC(i),a=u.indexOf(r);if(-1!==a){var c=iC(u,a-1),s=iC(u,a+r.length);return(c?" ":"")+r+(s?" ":"")}return r}return r})).getOr("")},cC=function(t,e){var n=t.selection.getRng(),r=t.dom.create("body"),o=t.selection.getSel(),i=Ax(t,sh(o)),u=e.contextual?rC(sn.fromDom(t.getBody()),i).dom():n.cloneContents();return u&&r.appendChild(u),t.selection.serializer.serialize(r,e)},sC=function(t,e,n){if(void 0===n&&(n={}),n.get=!0,n.format=e,n.selection=!0,n=t.fire("BeforeGetContent",n),n.isDefaultPrevented())return t.fire("GetContent",n),n.content;if("text"===n.format)return aC(t);n.getInner=!0;var r=cC(t,n);return"tree"===n.format?r:(n.content=t.selection.isCollapsed()?"":r,t.fire("GetContent",n),n.content)},lC=0,fC=1,dC=2,mC=function(t,e){var n=t.length+e.length+2,r=new Array(n),o=new Array(n),i=function(t,e,n){return{start:t,end:e,diag:n}},u=function(n,r,o,i,a){var s=c(n,r,o,i);if(null===s||s.start===r&&s.diag===r-i||s.end===n&&s.diag===n-o){var l=n,f=o;while(l<r||f<i)l<r&&f<i&&t[l]===e[f]?(a.push([lC,t[l]]),++l,++f):r-n>i-o?(a.push([dC,t[l]]),++l):(a.push([fC,e[f]]),++f)}else{u(n,s.start,o,s.start-s.diag,a);for(var d=s.start;d<s.end;++d)a.push([lC,t[d]]);u(s.end,r,s.end-s.diag,i,a)}},a=function(n,r,o,u){var a=n;while(a-r<u&&a<o&&t[a]===e[a-r])++a;return i(n,a,r)},c=function(n,i,u,c){var s=i-n,l=c-u;if(0===s||0===l)return null;var f,d,m,g,h,p=s-l,v=l+s,b=(v%2===0?v:v+1)/2;for(r[1+b]=n,o[1+b]=i+1,f=0;f<=b;++f){for(d=-f;d<=f;d+=2){m=d+b,d===-f||d!==f&&r[m-1]<r[m+1]?r[m]=r[m+1]:r[m]=r[m-1]+1,g=r[m],h=g-n+u-d;while(g<i&&h<c&&t[g]===e[h])r[m]=++g,++h;if(p%2!==0&&p-f<=d&&d<=p+f&&o[m-p]<=r[m])return a(o[m-p],d+n-u,i,c)}for(d=p-f;d<=p+f;d+=2){m=d+b-p,d===p-f||d!==p+f&&o[m+1]<=o[m-1]?o[m]=o[m+1]-1:o[m]=o[m-1],g=o[m]-1,h=g-n+u-d;while(g>=n&&h>=u&&t[g]===e[h])o[m]=g--,h--;if(p%2===0&&-f<=d&&d<=f&&o[m]<=r[m+p])return a(o[m],d+n-u,i,c)}}},s=[];return u(0,t.length,0,e.length,s),s},gC=function(t){return _r(t)?t.outerHTML:Ir(t)?Zo.encodeRaw(t.data,!1):Lr(t)?"\x3c!--"+t.data+"--\x3e":""},hC=function(t){var e,r=n.document.createElement("div"),o=n.document.createDocumentFragment();t&&(r.innerHTML=t);while(e=r.firstChild)o.appendChild(e);return o},pC=function(t,e,n){var r=hC(e);if(t.hasChildNodes()&&n<t.childNodes.length){var o=t.childNodes[n];o.parentNode.insertBefore(r,o)}else t.appendChild(r)},vC=function(t,e){if(t.hasChildNodes()&&e<t.childNodes.length){var n=t.childNodes[e];n.parentNode.removeChild(n)}},bC=function(t,e){var n=0;X(t,(function(t){t[0]===lC?n++:t[0]===fC?(pC(e,t[1],n),n++):t[0]===dC&&vC(e,n)}))},yC=function(t){return Q(K(mt(t.childNodes),gC),(function(t){return t.length>0}))},wC=function(t,e){var n=K(mt(e.childNodes),gC);return bC(mC(n,t),e),e},xC=xc(_.none()),CC=function(){return xC.get().getOrThunk((function(){var t=n.document.implementation.createHTMLDocument("undo");return xC.set(_.some(t)),t}))},SC=function(t){return-1!==t.indexOf("</iframe>")},kC=function(t){return{type:"fragmented",fragments:t,content:"",bookmark:null,beforeBookmark:null}},OC=function(t){return{type:"complete",fragments:null,content:t,bookmark:null,beforeBookmark:null}},TC=function(t){var e=yC(t.getBody()),n=it(e,(function(e){var n=rp(t.serializer,e);return n.length>0?[n]:[]})),r=n.join("");return SC(r)?kC(n):OC(r)},EC=function(t,e,n){"fragmented"===e.type?wC(e.fragments,t.getBody()):t.setContent(e.content,{format:"raw"}),t.selection.moveToBookmark(n?e.beforeBookmark:e.bookmark)},_C=function(t){return"fragmented"===t.type?t.fragments.join(""):t.content},AC=function(t){var e=sn.fromTag("body",CC());return ys(e,_C(t)),X(Jc(e,"*[data-mce-bogus]"),dr),bs(e)},DC=function(t,e){return _C(t)===_C(e)},NC=function(t,e){return AC(t)===AC(e)},RC=function(t,e){return!(!t||!e)&&(!!DC(t,e)||NC(t,e))},MC=function(t){return 0===t.get()},zC=function(t,e,n){MC(n)&&(t.typing=e)},BC=function(t,e){t.typing&&(zC(t,!1,e),t.add())},PC=function(t){t.typing&&(t.typing=!1,t.add())},HC=function(t,e,n){MC(e)&&n.set(_.some(Tf(t.selection)))},IC=function(t,e,n,r,o,i,u){var a=TC(t);if(i=i||{},i=nn.extend(i,a),!1===MC(r)||t.removed)return null;var c=e.data[n.get()];if(t.fire("BeforeAddUndo",{level:i,lastLevel:c,originalEvent:u}).isDefaultPrevented())return null;if(c&&RC(c,i))return null;e.data[n.get()]&&o.get().each((function(t){e.data[n.get()].beforeBookmark=t}));var s=Ad(t);if(s&&e.data.length>s){for(var l=0;l<e.data.length-1;l++)e.data[l]=e.data[l+1];e.data.length--,n.set(e.data.length)}i.bookmark=Tf(t.selection),n.get()<e.data.length-1&&(e.data.length=n.get()+1),e.data.push(i),n.set(e.data.length-1);var f={level:i,lastLevel:c,originalEvent:u};return t.fire("AddUndo",f),n.get()>0&&(t.setDirty(!0),t.fire("change",f)),i},LC=function(t,e,n){e.data=[],n.set(0),e.typing=!1,t.fire("ClearUndos")},FC=function(t,e,n,r,o){if(e.transact(r)){var i=e.data[n.get()].bookmark,u=e.data[n.get()-1];EC(t,u,!0),e.transact(o)&&(e.data[n.get()-1].beforeBookmark=i)}},VC=function(t,e,n){var r;return e.get()<n.length-1&&(e.set(e.get()+1),r=n[e.get()],EC(t,r,!1),t.setDirty(!0),t.fire("Redo",{level:r})),r},UC=function(t,e,n,r){var o;return e.typing&&(e.add(),e.typing=!1,zC(e,!1,n)),r.get()>0&&(r.set(r.get()-1),o=e.data[r.get()],EC(t,o,!0),t.setDirty(!0),t.fire("Undo",{level:o})),o},jC=function(t){t.clear(),t.add()},WC=function(t,e,n){return n.get()>0||e.typing&&e.data[0]&&!RC(TC(t),e.data[0])},qC=function(t,e){return e.get()<t.data.length-1&&!t.typing},$C=function(t,e,n){return BC(t,e),t.beforeChange(),t.ignore(n),t.add()},GC=function(t,e){try{t.set(t.get()+1),e()}finally{t.set(t.get()-1)}},KC=function(t){return t instanceof Fh},XC=function(t,e){ew(t.serializer.getNodeFilters(),t.serializer.getAttributeFilters(),e)},YC=function(){return{type:"complete",fragments:[],content:"",bookmark:null,beforeBookmark:null}},JC=function(t){return{undoManager:{beforeChange:function(e,n){return HC(t,e,n)},addUndoLevel:function(e,n,r,o,i,u){return IC(t,e,n,r,o,i,u)},undo:function(e,n,r){return UC(t,e,n,r)},redo:function(e,n){return VC(t,e,n)},clear:function(e,n){return LC(t,e,n)},reset:function(t){return jC(t)},hasUndo:function(e,n){return WC(t,e,n)},hasRedo:function(t,e){return qC(t,e)},transact:function(t,e,n){return $C(t,e,n)},ignore:function(t,e){return GC(t,e)},extra:function(e,n,r,o){return FC(t,e,n,r,o)}},formatter:{apply:function(e,n,r){return Ex(t,e,n,r)},remove:function(e,n,r,o){return sx(t,e,n,r,o)},toggle:function(e,n,r){return _x(t,e,n,r)}},editor:{getContent:function(e,n){return ap(t,e,n)},setContent:function(e,n){return cw(t,e,n)},insertContent:function(e,n){return Lb(t,e,n)}},selection:{getContent:function(e,n){return sC(t,e,n)}},raw:{getModel:function(){return _.none()}}}},QC=function(t,e){var n=function(t){return z(t)?t:{}},r=x("Unimplemented feature for rtc"),o=g;return{undoManager:{beforeChange:o,addUndoLevel:r,undo:function(){return e.undo(),YC()},redo:function(){return e.redo(),YC()},clear:r,reset:r,hasUndo:function(){return e.hasUndo()},hasRedo:function(){return e.hasRedo()},transact:function(t,n,r){return e.transact(r),YC()},ignore:r,extra:r},formatter:{apply:function(t,r,o){return e.applyFormat(t,n(r))},remove:function(t,r,o,i){return e.removeFormat(t,n(r))},toggle:function(t,r,o){return e.toggleFormat(t,n(r))}},editor:{getContent:function(n,r){if("html"===r||"tree"===r){var o=e.getContent(),i=jh({inner:!0});return XC(t,o),"tree"===r?o:i.serialize(o)}return JC(t).editor.getContent(n,r)},setContent:function(n,r){var o=KC(n)?n:t.parser.parse(n,{isRootContent:!0,insert:!0});return e.setContent(o),n},insertContent:function(n,r){var o=KC(n)?n:t.parser.parse(n,{insert:!0});e.insertContent(o)}},selection:{getContent:function(n,r){if("html"===n||"tree"===n){var o=e.getSelectedContent(),i=jh({});return XC(t,o),"tree"===n?o:i.serialize(o)}return JC(t).selection.getContent(n,r)}},raw:{getModel:function(){return _.some(e.getRawModel())}}}},ZC=function(t){return Tt(t.plugins,"rtc")},tS=function(t){var e=t;return Ot(t.plugins,"rtc").fold((function(){return e.rtcInstance=JC(t),_.none()}),(function(n){return _.some(n.setup().then((function(n){return e.rtcInstance=QC(t,n),n.isRemote})))}))},eS=function(t){return t.rtcInstance?t.rtcInstance:JC(t)},nS=function(t){var e=t.rtcInstance;if(e)return e;throw new Error("Failed to get RTC instance not yet initialized.")},rS=function(t,e,n){nS(t).undoManager.beforeChange(e,n)},oS=function(t,e,n,r,o,i,u){return nS(t).undoManager.addUndoLevel(e,n,r,o,i,u)},iS=function(t,e,n,r){return nS(t).undoManager.undo(e,n,r)},uS=function(t,e,n){return nS(t).undoManager.redo(e,n)},aS=function(t,e,n){nS(t).undoManager.clear(e,n)},cS=function(t,e){nS(t).undoManager.reset(e)},sS=function(t,e,n){return nS(t).undoManager.hasUndo(e,n)},lS=function(t,e,n){return nS(t).undoManager.hasRedo(e,n)},fS=function(t,e,n,r){return nS(t).undoManager.transact(e,n,r)},dS=function(t,e,n){nS(t).undoManager.ignore(e,n)},mS=function(t,e,n,r,o){nS(t).undoManager.extra(e,n,r,o)},gS=function(t,e,n,r){nS(t).formatter.apply(e,n,r)},hS=function(t,e,n,r,o){nS(t).formatter.remove(e,n,r,o)},pS=function(t,e,n,r){nS(t).formatter.toggle(e,n,r)},vS=function(t,e,n){return eS(t).editor.getContent(e,n)},bS=function(t,e,n){return eS(t).editor.setContent(e,n)},yS=function(t,e,n){return eS(t).editor.insertContent(e,n)},wS=function(t,e,n){return nS(t).selection.getContent(e,n)},xS="html",CS=function(t,e){void 0===e&&(e={});var n=e.format?e.format:xS;return vS(t,e,n)},SS=function(t,e,n){return void 0===n&&(n={}),bS(t,e,n)},kS=function(t,e){return t.fire("PreProcess",e)},OS=function(t,e){return t.fire("PostProcess",e)},TS=function(t){return t.fire("remove")},ES=function(t){return t.fire("detach")},_S=function(t,e){return t.fire("SwitchMode",{mode:e})},AS=function(t,e,n,r){t.fire("ObjectResizeStart",{target:e,width:n,height:r})},DS=function(t,e,n,r){t.fire("ObjectResized",{target:e,width:n,height:r})},NS=function(t){return t.fire("PreInit")},RS=function(t){return t.fire("PostRender")},MS=function(t){return t.fire("Init")},zS=function(t,e){return t.fire("PlaceholderToggle",{state:e})},BS=function(t,e,n){return t.fire(e,n)},PS=dc.DOM,HS=function(t){PS.setStyle(t.id,"display",t.orgDisplay)},IS=function(t){return _.from(t).each((function(t){return t.destroy()}))},LS=function(t){t.contentAreaContainer=t.formElement=t.container=t.editorContainer=null,t.bodyElement=t.contentDocument=t.contentWindow=null,t.iframeElement=t.targetElm=null,t.selection&&(t.selection=t.selection.win=t.selection.dom=t.selection.dom.doc=null)},FS=function(t){var e=t.formElement;e&&(e._mceOldSubmit&&(e.submit=e._mceOldSubmit,e._mceOldSubmit=null),PS.unbind(e,"submit reset",t.formEventDelegate))},VS=function(t){if(!t.removed){var e=t._selectionOverrides,n=t.editorUpload,r=t.getBody(),o=t.getElement();r&&t.save({is_removing:!0}),t.removed=!0,t.unbindAllNativeEvents(),t.hasHiddenInput&&o&&PS.remove(o.nextSibling),TS(t),t.editorManager.remove(t),!t.inline&&r&&HS(t),ES(t),PS.remove(t.getContainer()),IS(e),IS(n),t.destroy()}},US=function(t,e){var n=t.selection,r=t.dom;t.destroyed||(e||t.removed?(e||(t.editorManager.off("beforeunload",t._beforeUnload),t.theme&&t.theme.destroy&&t.theme.destroy(),IS(n),IS(r)),FS(t),LS(t),t.destroyed=!0):t.remove())},jS=Object.prototype.hasOwnProperty,WS=function(t,e){var n=z(t)&&z(e);return n?$S(t,e):e},qS=function(t){return function(){for(var e=new Array(arguments.length),n=0;n<e.length;n++)e[n]=arguments[n];if(0===e.length)throw new Error("Can't merge zero objects");for(var r={},o=0;o<e.length;o++){var i=e[o];for(var u in i)jS.call(i,u)&&(r[u]=t(r[u],i[u]))}return r}},$S=qS(WS),GS=function(t,e){return{sections:v(t),settings:v(e)}},KS=ze().deviceType,XS=KS.isTouch(),YS=KS.isPhone(),JS=KS.isTablet(),QS=["lists","autolink","autosave"],ZS={table_grid:!1,object_resizing:!1,resize:!1},tk=function(t){var e=B(t)?t.join(" "):t,n=K(M(e)?e.split(" "):[],Ce);return Q(n,(function(t){return t.length>0}))},ek=function(t){return Q(t,y($,QS))},nk=function(t,e){var n=xt(e,(function(e,n){return $(t,n)}));return GS(n.t,n.f)},rk=function(t,e,n){void 0===n&&(n={});var r=t.sections(),o=r.hasOwnProperty(e)?r[e]:{};return nn.extend({},n,o)},ok=function(t,e){return t.sections().hasOwnProperty(e)},ik=function(t,e,n){var r=t.sections();return ok(t,e)&&r[e].theme===n},uk=function(t,e){return ok(t,e)?t.sections()[e]:{}},ak=function(t,e){return Ot(t,"toolbar_mode").orThunk((function(){return Ot(t,"toolbar_drawer").map((function(t){return!1===t?"wrap":t}))})).getOr(e)},ck=function(t,e,n,r,o){var i={id:e,theme:"silver",toolbar_mode:ak(t,"floating"),plugins:"",document_base_url:n,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"<!DOCTYPE html>",visual:!0,font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,inline_styles:!0,convert_fonts_to_spans:!0,indent:!0,indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",entity_encoding:"named",url_converter:o.convertURL,url_converter_scope:o};return Ht(Ht({},i),r?ZS:{})},sk=function(t,e){var n={resize:!1,toolbar_mode:ak(t,"scrolling"),toolbar_sticky:!1},r={menubar:!1};return Ht(Ht(Ht({},ZS),n),e?r:{})},lk=function(t,e){var n=e.external_plugins?e.external_plugins:{};return t&&t.external_plugins?nn.extend({},t.external_plugins,n):n},fk=function(t,e){return[].concat(tk(t)).concat(tk(e))},dk=function(t,e,n,r){var o=tk(n.forced_plugins),i=tk(r.plugins),u=uk(e,"mobile"),a=u.plugins?tk(u.plugins):i,c=t&&ik(e,"mobile","mobile")?ek(a):t&&ok(e,"mobile")?a:i,s=fk(o,c);return nn.extend(r,{plugins:s.join(" ")})},mk=function(t,e){return t&&ok(e,"mobile")},gk=function(t,e,n,r,o){var i=t?{mobile:sk(o.mobile||{},e)}:{},u=nk(["mobile"],$S(i,o)),a=nn.extend(n,r,u.settings(),mk(t,u)?rk(u,"mobile"):{},{validate:!0,external_plugins:lk(r,u.settings())});return dk(t,u,r,a)},hk=function(t,e,n,r,o){var i=ck(o,e,n,XS,t);return gk(YS||JS,YS,i,r,o)},pk=function(t,e,n){return _.from(e.settings[n]).filter(t)},vk=function(t){var e={};return"string"===typeof t?X(t.indexOf("=")>0?t.split(/[;,](?![^=;,]*(?:[;,]|$))/):t.split(","),(function(t){var n=t.split("=");n.length>1?e[nn.trim(n[0])]=nn.trim(n[1]):e[nn.trim(n[0])]=nn.trim(n[0])})):e=t,e},bk=function(t){return function(e){return B(e)&&ut(e,t)}},yk=function(t,e,n,r){var o=e in t.settings?t.settings[e]:n;return"hash"===r?vk(o):"string"===r?pk(M,t,e).getOr(n):"number"===r?pk(F,t,e).getOr(n):"boolean"===r?pk(H,t,e).getOr(n):"object"===r?pk(z,t,e).getOr(n):"array"===r?pk(B,t,e).getOr(n):"string[]"===r?pk(bk(M),t,e).getOr(n):"function"===r?pk(L,t,e).getOr(n):o},wk=function(){var t={},e=function(e,n){t[e]=n},n=function(e){return t[e]?t[e]:{icons:{}}},r=function(e){return Tt(t,e)};return{add:e,get:n,has:r}},xk=wk(),Ck=function(t,e){var n=e.dom();return n[t]},Sk=function(t,e){return parseInt(to(e,t),10)},kk=y(Ck,"clientWidth"),Ok=y(Ck,"clientHeight"),Tk=y(Sk,"margin-top"),Ek=y(Sk,"margin-left"),_k=function(t){return t.dom().getBoundingClientRect()},Ak=function(t,e,n){var r=kk(t),o=Ok(t);return e>=0&&n>=0&&e<=r&&n<=o},Dk=function(t,e,n,r){var o=_k(e),i=t?o.left+e.dom().clientLeft+Ek(e):0,u=t?o.top+e.dom().clientTop+Tk(e):0,a=n-i,c=r-u;return{x:a,y:c}},Nk=function(t,e,n){var r=sn.fromDom(t.getBody()),o=t.inline?r:Hn(r),i=Dk(t.inline,o,e,n);return Ak(o,i.x,i.y)},Rk=function(t){return _.from(t).map(sn.fromDom)},Mk=function(t){var e=t.inline?t.getBody():t.getContentAreaContainer();return Rk(e).map((function(t){return zn(Bn(t),t)})).getOr(!1)};function zk(){var t=function(){throw new Error("Theme did not provide a NotificationManager implementation.")};return{open:t,close:t,reposition:t,getArgs:t}}function Bk(t){var e=[],n=function(){var e=t.theme;return e&&e.getNotificationManagerImpl?e.getNotificationManagerImpl():zk()},r=function(){return _.from(e[0])},o=function(t,e){return t.type===e.type&&t.text===e.text&&!t.progressBar&&!t.timeout&&!e.progressBar&&!e.timeout},i=function(){e.length>0&&n().reposition(e)},u=function(t){e.push(t)},a=function(t){rt(e,(function(e){return e===t})).each((function(t){e.splice(t,1)}))},c=function(r){if(!t.removed&&Mk(t))return nt(e,(function(t){return o(n().getArgs(t),r)})).getOrThunk((function(){t.editorManager.setActive(t);var e=n().open(r,(function(){a(e),i()}));return u(e),i(),e}))},s=function(){r().each((function(t){n().close(t),a(t),i()}))},l=function(){return e},f=function(t){t.on("SkinLoaded",(function(){var e=gd(t);e&&c({text:e,type:"warning",timeout:0})})),t.on("ResizeEditor ResizeWindow NodeChange",(function(){Za.requestAnimationFrame(i)})),t.on("remove",(function(){X(e.slice(),(function(t){n().close(t)}))}))};return f(t),{open:c,close:s,getNotifications:l}}var Pk=Pc.PluginManager,Hk=Pc.ThemeManager;function Ik(){var t=function(){throw new Error("Theme did not provide a WindowManager implementation.")};return{open:t,openUrl:t,alert:t,confirm:t,close:t,getParams:t,setParams:t}}var Lk=function(t){var e=[],n=function(){var e=t.theme;return e&&e.getWindowManagerImpl?e.getWindowManagerImpl():Ik()},r=function(t,e){return function(){return e?e.apply(t,arguments):void 0}},o=function(e){t.fire("OpenWindow",{dialog:e})},i=function(e){t.fire("CloseWindow",{dialog:e})},u=function(t){e.push(t),o(t)},a=function(n){i(n),e=Q(e,(function(t){return t!==n})),0===e.length&&t.focus()},c=function(){return _.from(e[e.length-1])},s=function(e){t.editorManager.setActive(t),yy(t);var n=e();return u(n),n},l=function(t,e){return s((function(){return n().open(t,e,a)}))},f=function(t){return s((function(){return n().openUrl(t,a)}))},d=function(t,e,o){n().alert(t,r(o||this,e))},m=function(t,e,o){n().confirm(t,r(o||this,e))},g=function(){c().each((function(t){n().close(t),a(t)}))};return t.on("remove",(function(){X(e,(function(t){n().close(t)}))})),{open:l,openUrl:f,alert:d,confirm:m,close:g}},Fk=function(t,e){t.notificationManager.open({type:"error",text:e})},Vk=function(t,e){t._skinLoaded?Fk(t,e):t.on("SkinLoaded",(function(){Fk(t,e)}))},Uk=function(t,e){Vk(t,zc.translate(["Failed to upload image: {0}",e]))},jk=function(t,e,r){BS(t,e,{message:r}),n.console.error(r)},Wk=function(t,e,n){return n?"Failed to load "+t+": "+n+" from url "+e:"Failed to load "+t+" url: "+e},qk=function(t,e,n){jk(t,"PluginLoadError",Wk("plugin",e,n))},$k=function(t,e,n){jk(t,"IconsLoadError",Wk("icons",e,n))},Gk=function(t,e,n){jk(t,"LanguageLoadError",Wk("language",e,n))},Kk=function(t,e,n){var r=zc.translate(["Failed to initialize plugin: {0}",e]);Xk(r,n),Vk(t,r)},Xk=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var o=n.window.console;o&&(o.error?o.error.apply(o,Lt([t],e)):o.log.apply(o,Lt([t],e)))},Yk=function(t){return/^[a-z0-9\-]+$/i.test(t)},Jk=function(t){var e=ad(t),n=t.editorManager.baseURL+"/skins/content",r=t.editorManager.suffix,o="content"+r+".css",i=!0===t.inline;return K(e,(function(e){return Yk(e)&&!i?n+"/"+e+"/"+o:t.documentBaseURI.toAbsolute(e)}))},Qk=function(t){t.contentCSS=t.contentCSS.concat(Jk(t))};function Zk(t,e){var n=function(e,n){if(!F(n)&&!n.match(/^[0-9]+$/))throw new Error(t+".set accepts only positive integer values. Value was "+n);var r=e.dom();qr(r)&&(r.style[t]=n+"px")},r=function(n){var r=e(n);if(r<=0||null===r){var o=to(n,t);return parseFloat(o)||0}return r},o=r,i=function(t,e){return tt(e,(function(e,n){var r=to(t,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?e:e+o}),0)},u=function(t,e,n){var r=i(t,n),o=e>r?e-r:0;return o};return{set:n,get:r,getOuter:o,aggregate:i,max:u}}var tO=Zk("height",(function(t){var e=t.dom();return mr(t)?e.getBoundingClientRect().height:e.offsetHeight})),eO=function(t){return tO.get(t)},nO=function(t,e){var n=t.view(e);return n.fold(v([]),(function(e){var n=t.owner(e),r=nO(t,n);return[e].concat(r)}))},rO=function(t,e){var n=e.owner(t);return nO(e,n)},oO=function(t){var e=t.dom()===n.document?_.none():_.from(t.dom().defaultView.frameElement);return e.map(sn.fromDom)},iO=function(t){return Bn(t)},uO=Object.freeze({__proto__:null,view:oO,owner:iO}),aO=function(t){var e=sn.fromDom(n.document),r=wr(e),o=rO(t,uO),i=yr(t),u=Z(o,(function(t,e){var n=yr(e);return{left:t.left+n.left(),top:t.top+n.top()}}),{left:0,top:0});return hr(u.left+i.left()+r.left(),u.top+i.top()+r.top())},cO=function(t){return"textarea"===hn(t)},sO=function(t,e){var n=t.fire("ScrollIntoView",e);return n.isDefaultPrevented()},lO=function(t,e){t.fire("AfterScrollIntoView",e)},fO=function(t,e){var n=$n(t);if(0===n.length||cO(t))return{element:t,offset:e};if(e<n.length&&!cO(n[e]))return{element:n[e],offset:0};var r=n[n.length-1];return cO(r)?{element:t,offset:e}:"img"===hn(r)?{element:r,offset:1}:wn(r)?{element:r,offset:Eh(r).length}:{element:r,offset:$n(r).length}},dO=function(t,e){var n=br(t),r=eO(t);return{element:t,bottom:n.top()+r,height:r,pos:n,cleanup:e}},mO=function(t,e){var n=fO(t,e),r=sn.fromHtml('<span data-mce-bogus="all">'+Os+"</span>");return rr(n.element,r),dO(r,(function(){return fr(r)}))},gO=function(t){return dO(sn.fromDom(t),g)},hO=function(t,e,n,r){yO(t,(function(o,i){return vO(t,e,n,r)}),n)},pO=function(t,e,n,r,o){var i={elm:r.element.dom(),alignToTop:o};if(!sO(t,i)){var u=wr(e).top();n(e,u,r,o),lO(t,i)}},vO=function(t,e,n,r){var o=sn.fromDom(t.getBody()),i=sn.fromDom(t.getDoc());oo(o);var u=mO(sn.fromDom(n.startContainer),n.startOffset);pO(t,i,e,u,r),u.cleanup()},bO=function(t,e,n,r){var o=sn.fromDom(t.getDoc());pO(t,o,n,gO(e),r)},yO=function(t,e,n){var r=n.startContainer,o=n.startOffset,i=n.endContainer,u=n.endOffset;e(sn.fromDom(r),sn.fromDom(i));var a=t.dom.createRng();a.setStart(r,o),a.setEnd(i,u),t.selection.setRng(n)},wO=function(t,e,n,r){var o=t.pos;if(n)xr(o.left(),o.top(),r);else{var i=o.top()-e+t.height;xr(o.left(),i,r)}},xO=function(t,e,n,r,o){var i=n+e,u=r.pos.top(),a=r.bottom,c=a-u>=n;if(u<e)wO(r,n,!1!==o,t);else if(u>i){var s=c?!1!==o:!0===o;wO(r,n,s,t)}else a>i&&!c&&wO(r,n,!0===o,t)},CO=function(t,e,n,r){var o=t.dom().defaultView.innerHeight;xO(t,e,o,n,r)},SO=function(t,e,r,o){var i=t.dom().defaultView.innerHeight;xO(t,e,i,r,o);var u=aO(r.element),a=Or(n.window);u.top()<a.y?Cr(r.element,!1!==o):u.top()>a.bottom&&Cr(r.element,!0===o)},kO=function(t,e,n){return hO(t,CO,e,n)},OO=function(t,e,n){return bO(t,e,CO,n)},TO=function(t,e,n){return hO(t,SO,e,n)},EO=function(t,e,n){return bO(t,e,SO,n)},_O=function(t,e,n){var r=t.inline?OO:EO;r(t,e,n)},AO=function(t,e,n){var r=t.inline?kO:TO;r(t,e,n)},DO=function(t){return jr(t)||Wr(t)},NO=function(t,e,n){while(t&&t!==e){if(n(t))return t;t=t.parentNode}return null},RO=function(t,e,n){var r,o=n.elementFromPoint(t,e),i=n.body.createTextRange();if(o&&"HTML"!==o.tagName||(o=n.body),i.moveToElementText(o),r=nn.toArray(i.getClientRects()),r=r.sort((function(t,n){return t=Math.abs(Math.max(t.top-e,t.bottom-e)),n=Math.abs(Math.max(n.top-e,n.bottom-e)),t-n})),r.length>0){e=(r[0].bottom+r[0].top)/2;try{return i.moveToPoint(t,e),i.collapse(!0),i}catch(u){}}return null},MO=function(t,e){var n=t&&t.parentElement?t.parentElement():null;return Wr(NO(n,e,DO))?null:t},zO=function(t,e,n){var r,o,i=n;if(i.caretPositionFromPoint)o=i.caretPositionFromPoint(t,e),o&&(r=n.createRange(),r.setStart(o.offsetNode,o.offset),r.collapse(!0));else if(n.caretRangeFromPoint)r=n.caretRangeFromPoint(t,e);else if(i.body.createTextRange){r=i.body.createTextRange();try{r.moveToPoint(t,e),r.collapse(!0)}catch(u){r=RO(t,e,n)}return MO(r,n.body)}return r},BO=function(t,e,n,r,o){var i=n?e.startContainer:e.endContainer,u=n?e.startOffset:e.endOffset;return _.from(i).map(sn.fromDom).map((function(t){return r&&e.collapsed?t:Gn(t,o(t,u)).getOr(t)})).bind((function(t){return yn(t)?_.some(t):Ln(t).filter(yn)})).map((function(t){return t.dom()})).getOr(t)},PO=function(t,e,n){return BO(t,e,!0,n,(function(t,e){return Math.min(Yn(t),e)}))},HO=function(t,e,n){return BO(t,e,!1,n,(function(t,e){return e>0?e-1:e}))},IO=function(t,e){var n=t;while(t&&Ir(t)&&0===t.length)t=e?t.nextSibling:t.previousSibling;return t||n},LO=function(t,e){var n,r,o;if(!e)return t;r=e.startContainer,o=e.endContainer;var i=e.startOffset,u=e.endOffset;return n=e.commonAncestorContainer,!e.collapsed&&(r===o&&u-i<2&&r.hasChildNodes()&&(n=r.childNodes[i]),3===r.nodeType&&3===o.nodeType&&(r=r.length===i?IO(r.nextSibling,!0):r.parentNode,o=0===u?IO(o.previousSibling,!1):o.parentNode,r&&r===o))?r:n&&3===n.nodeType?n.parentNode:n},FO=function(t,e,n,r){var o,i=[],u=t.getRoot();if(n=t.getParent(n||PO(u,e,e.collapsed),t.isBlock),r=t.getParent(r||HO(u,e,e.collapsed),t.isBlock),n&&n!==u&&i.push(n),n&&r&&n!==r){o=n;var a=new Sa(n,u);while((o=a.next())&&o!==r)t.isBlock(o)&&i.push(o)}return r&&n!==r&&r!==u&&i.push(r),i},VO=function(t,e,n){return _.from(e).map((function(e){var r=t.nodeIndex(e),o=t.createRng();return o.setStart(e.parentNode,r),o.setEnd(e.parentNode,r+1),n&&(xh(t,o,e,!0),xh(t,o,e,!1)),o}))},UO=function(t,e){void 0===e&&(e={});var n=e.format?e.format:"html";return wS(t,n,e)},jO=function(t,e){return t&&e&&t.startContainer===e.startContainer&&t.startOffset===e.startOffset&&t.endContainer===e.endContainer&&t.endOffset===e.endOffset},WO=function(t,e,n){while(t&&t!==e){if(n(t))return t;t=t.parentNode}return null},qO=function(t,e,n){return null!==WO(t,e,n)},$O=function(t,e,n){return qO(t,e,(function(t){return t.nodeName===n}))},GO=function(t){return t&&"TABLE"===t.nodeName},KO=function(t){return t&&/^(TD|TH|CAPTION)$/.test(t.nodeName)},XO=function(t,e){return Rs(t)&&!1===qO(t,e,rg)},YO=function(t,e,n){var r=new Sa(e,t.getParent(e.parentNode,t.isBlock)||t.getRoot());while(e=r[n?"prev":"next"]())if(Ur(e))return!0},JO=function(t,e){return t.previousSibling&&t.previousSibling.nodeName===e},QO=function(t,e){while(e&&e!==t){if(Wr(e))return!0;e=e.parentNode}return!1},ZO=function(t,e,n,r,o){var i,u,a=t.getRoot(),c=t.schema.getNonEmptyElements(),s=t.getParent(o.parentNode,t.isBlock)||a;if(r&&Ur(o)&&e&&t.isEmpty(s))return _.some(jl(o.parentNode,t.nodeIndex(o)));var l=new Sa(o,s);while(u=l[r?"prev":"next"]()){if("false"===t.getContentEditableParent(u)||XO(u,a))return _.none();if(Ir(u)&&u.nodeValue.length>0)return!1===$O(u,a,"A")?_.some(jl(u,r?u.nodeValue.length:0)):_.none();if(t.isBlock(u)||c[u.nodeName.toLowerCase()])return _.none();i=u}return n&&i?_.some(jl(i,0)):_.none()},tT=function(t,e,n,r){var o,i,u,a,c=t.getRoot(),s=!1;o=r[(n?"start":"end")+"Container"],i=r[(n?"start":"end")+"Offset"];var l=_r(o)&&i===o.childNodes.length,f=t.schema.getNonEmptyElements();if(a=n,Rs(o))return _.none();if(_r(o)&&i>o.childNodes.length-1&&(a=!1),Fr(o)&&(o=c,i=0),o===c){if(a&&(u=o.childNodes[i>0?i-1:0],u)){if(Rs(u))return _.none();if(f[u.nodeName]||GO(u))return _.none()}if(o.hasChildNodes()){if(i=Math.min(!a&&i>0?i-1:i,o.childNodes.length-1),o=o.childNodes[i],i=Ir(o)&&l?o.data.length:0,!e&&o===c.lastChild&&GO(o))return _.none();if(QO(c,o)||Rs(o))return _.none();if(o.hasChildNodes()&&!1===GO(o)){u=o;var d=new Sa(o,c);do{if(Wr(u)||Rs(u)){s=!1;break}if(Ir(u)&&u.nodeValue.length>0){i=a?0:u.nodeValue.length,o=u,s=!0;break}if(f[u.nodeName.toLowerCase()]&&!KO(u)){i=t.nodeIndex(u),o=u.parentNode,a||i++,s=!0;break}}while(u=a?d.next():d.prev())}}}return e&&(Ir(o)&&0===i&&ZO(t,l,e,!0,o).each((function(t){o=t.container(),i=t.offset(),s=!0})),_r(o)&&(u=o.childNodes[i],u||(u=o.childNodes[i-1]),!u||!Ur(u)||JO(u,"A")||YO(t,u,!1)||YO(t,u,!0)||ZO(t,l,e,!0,u).each((function(t){o=t.container(),i=t.offset(),s=!0})))),a&&!e&&Ir(o)&&i===o.nodeValue.length&&ZO(t,l,e,!1,o).each((function(t){o=t.container(),i=t.offset(),s=!0})),s?_.some(jl(o,i)):_.none()},eT=function(t,e){var n=e.collapsed,r=e.cloneRange(),o=jl.fromRangeStart(e);return tT(t,n,!0,r).each((function(t){n&&jl.isAbove(o,t)||r.setStart(t.container(),t.offset())})),n||tT(t,n,!1,r).each((function(t){r.setEnd(t.container(),t.offset())})),n&&r.collapse(!0),jO(e,r)?_.none():_.some(r)},nT=function(t,e){t.insertData(0,e)},rT=function(t){return 0===t.dom().length?(fr(t),_.none()):_.some(t)},oT=function(t,e){var n=_.from(e.firstChild).map(sn.fromDom),r=_.from(e.lastChild).map(sn.fromDom);t.deleteContents(),t.insertNode(e);var o=n.bind(Un).filter(wn).bind(rT),i=r.bind(jn).filter(wn).bind(rT);qs(o,n.filter(wn),(function(t,e){nT(e.dom(),t.dom().data),fr(t)})),qs(i,r.filter(wn),(function(e,n){var r=n.dom().length;n.dom().appendData(e.dom().data),t.setEnd(n.dom(),r),fr(e)})),t.collapse(!1)},iT=function(t,e){return Ht(Ht({format:"html"},t),{set:!0,selection:!0,content:e})},uT=function(t,e){if("raw"!==e.format){var n=t.parser.parse(e.content,Ht({isRootContent:!0,forced_root_block:!1},e));return jh({validate:t.validate},t.schema).serialize(n)}return e.content},aT=function(t,e,n){void 0===n&&(n={});var r=iT(n,e);if(r.no_events||(r=t.fire("BeforeSetContent",r),!r.isDefaultPrevented())){n.content=uT(t,r);var o=t.selection.getRng();oT(o,o.createContextualFragment(n.content)),t.selection.setRng(o),AO(t,o),r.no_events||t.fire("SetContent",r)}else t.fire("SetContent",r)};function cT(t){return{getBookmark:y(Sg,t),moveToBookmark:y(kg,t)}}(function(t){t.isBookmarkNode=Og})(cT||(cT={}));var sT=cT,lT=function(t,e,n){if(n.collapsed)return!1;if(je.browser.isIE()&&n.startOffset===n.endOffset-1&&n.startContainer===n.endContainer){var r=n.startContainer.childNodes[n.startOffset];if(_r(r))return G(r.getClientRects(),(function(n){return el(n,t,e)}))}return G(n.getClientRects(),(function(n){return el(n,t,e)}))},fT={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,END:35,HOME:36,modifierPressed:function(t){return t.shiftKey||t.ctrlKey||t.altKey||this.metaKeyPressed(t)},metaKeyPressed:function(t){return je.mac?t.metaKey:t.ctrlKey&&!t.altKey}},dT=Wr,mT=jr,gT=function(t,e){while(e&&e!==t){if(mT(e)||dT(e))return e;e=e.parentNode}return null},hT=function(t,e){var r,o,i,u,a,c,s,l,f,d,m,g,h,p,v,b,y=e.dom,w=nn.each,x=e.getDoc(),C=n.document,S=Math.abs,k=Math.round,O=e.getBody(),T={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]},E=function(t){return t&&("IMG"===t.nodeName||e.dom.is(t,"figure.image"))},_=function(t,e){if("longpress"===t.type||0===t.type.indexOf("touch")){var n=t.touches[0];return E(t.target)&&!lT(n.clientX,n.clientY,e)}return E(t.target)&&!lT(t.clientX,t.clientY,e)},A=function(t){var n=t.target;_(t,e.selection.getRng())&&!t.isDefaultPrevented()&&e.selection.select(n)},D=function(t){return e.dom.is(t,"figure.image")?t.querySelector("img"):t},N=function(t){var n=ld(e);return!1!==n&&!je.iOS&&("string"!==typeof n&&(n="table,img,figure.image,div"),"false"!==t.getAttribute("data-mce-resize")&&(t!==e.getBody()&&En(sn.fromDom(t),n)))},R=function(t,e,n){y.setStyles(D(t),{width:e,height:n})},M=function(t){var n,w,x,C,T;n=t.screenX-a,w=t.screenY-c,h=n*u[2]+f,p=w*u[3]+d,h=h<5?5:h,p=p<5?5:p,x=E(r)&&!1!==fd(e)?!fT.modifierPressed(t):fT.modifierPressed(t),x&&(S(n)>S(w)?(p=k(h*m),h=k(p/m)):(h=k(p/m),p=k(h*m))),R(o,h,p),C=u.startPos.x+n,T=u.startPos.y+w,C=C>0?C:0,T=T>0?T:0,y.setStyles(i,{left:C,top:T,display:"block"}),i.innerHTML=h+" × "+p,u[2]<0&&o.clientWidth<=h&&y.setStyle(o,"left",s+(f-h)),u[3]<0&&o.clientHeight<=p&&y.setStyle(o,"top",l+(d-p)),n=O.scrollWidth-v,w=O.scrollHeight-b,n+w!==0&&y.setStyles(i,{left:C-n,top:T-w}),g||(AS(e,r,f,d),g=!0)},z=function(){var t=g;g=!1;var n=function(t,n){n&&(r.style[t]||!e.schema.isValid(r.nodeName.toLowerCase(),t)?y.setStyle(D(r),t,n):y.setAttrib(D(r),t,""+n))};t&&(n("width",h),n("height",p)),y.unbind(x,"mousemove",M),y.unbind(x,"mouseup",z),C!==x&&(y.unbind(C,"mousemove",M),y.unbind(C,"mouseup",z)),y.remove(o),y.remove(i),B(r),t&&(DS(e,r,h,p),y.setAttrib(r,"style",y.getAttrib(r,"style"))),e.nodeChanged()},B=function(t){P(),L();var n=y.getPos(t,O),s=n.x,l=n.y,g=t.getBoundingClientRect(),S=g.width||g.right-g.left,k=g.height||g.bottom-g.top;r!==t&&(r=t,h=p=0);var E=e.fire("ObjectSelected",{target:t});N(t)&&!E.isDefaultPrevented()?w(T,(function(t,e){var n,g=function(e){a=e.screenX,c=e.screenY,f=D(r).clientWidth,d=D(r).clientHeight,m=d/f,u=t,t.startPos={x:S*t[0]+s,y:k*t[1]+l},v=O.scrollWidth,b=O.scrollHeight,o=r.cloneNode(!0),y.addClass(o,"mce-clonedresizable"),y.setAttrib(o,"data-mce-bogus","all"),o.contentEditable=!1,o.unSelectabe=!0,y.setStyles(o,{left:s,top:l,margin:0}),R(o,S,k),o.removeAttribute("data-mce-selected"),O.appendChild(o),y.bind(x,"mousemove",M),y.bind(x,"mouseup",z),C!==x&&(y.bind(C,"mousemove",M),y.bind(C,"mouseup",z)),i=y.add(O,"div",{class:"mce-resize-helper","data-mce-bogus":"all"},f+" × "+d)};n=y.get("mceResizeHandle"+e),n&&y.remove(n),n=y.add(O,"div",{id:"mceResizeHandle"+e,"data-mce-bogus":"all",class:"mce-resizehandle",unselectable:!0,style:"cursor:"+e+"-resize; margin:0; padding:0"}),11===je.ie&&(n.contentEditable=!1),y.bind(n,"mousedown",(function(t){t.stopImmediatePropagation(),t.preventDefault(),g(t)})),t.elm=n,y.setStyles(n,{left:S*t[0]+s-n.offsetWidth/2,top:k*t[1]+l-n.offsetHeight/2})})):P(),r.setAttribute("data-mce-selected","1")},P=function(){L(),r&&r.removeAttribute("data-mce-selected"),pt(T,(function(t,e){var n=y.get("mceResizeHandle"+e);n&&(y.unbind(n),y.remove(n))}))},H=function(n){var r,o,i=function(t,e){if(t)do{if(t===e)return!0}while(t=t.parentNode)};g||e.removed||(w(y.select("img[data-mce-selected],hr[data-mce-selected]"),(function(t){t.removeAttribute("data-mce-selected")})),o="mousedown"===n.type?n.target:t.getNode(),o=y.$(o).closest("table,img,figure.image,hr")[0],i(o,O)&&(F(),r=t.getStart(!0),i(r,o)&&i(t.getEnd(!0),o))?B(o):P())},I=function(t){return dT(gT(e.getBody(),t))},L=function(){pt(T,(function(t){t.elm&&(y.unbind(t.elm),delete t.elm)}))},F=function(){try{e.getDoc().execCommand("enableObjectResizing",!1,!1)}catch(t){}};e.on("init",(function(){if(F(),je.browser.isIE()||je.browser.isEdge()){e.on("mousedown click",(function(t){var n=t.target,r=n.nodeName;g||!/^(TABLE|IMG|HR)$/.test(r)||I(n)||(2!==t.button&&e.selection.select(n,"TABLE"===r),"mousedown"===t.type&&e.nodeChanged())}));var t=function(t){var n=function(t){Za.setEditorTimeout(e,(function(){return e.selection.select(t)}))};if(I(t.target))return t.preventDefault(),void n(t.target);/^(TABLE|IMG|HR)$/.test(t.target.nodeName)&&(t.preventDefault(),"IMG"===t.target.tagName&&n(t.target))};y.bind(O,"mscontrolselect",t),e.on("remove",(function(){return y.unbind(O,"mscontrolselect",t)}))}var n=Za.throttle((function(t){e.composing||H(t)}));e.on("nodechange ResizeEditor ResizeWindow ResizeContent drop FullscreenStateChanged",n),e.on("keyup compositionend",(function(t){r&&"TABLE"===r.nodeName&&n(t)})),e.on("hide blur",P),e.on("contextmenu longpress",A,!0)})),e.on("remove",L);var V=function(){r=o=null};return{isResizable:N,showResizeRect:B,hideResizeRect:P,updateResizeRect:H,destroy:V}},pT=function(t,e,n){if(t&&t.hasOwnProperty(e)){var r=Q(t[e],(function(t){return t!==n}));0===r.length?delete t[e]:t[e]=r}};function vT(t,e){var n,r;return{selectorChangedWithUnbind:function(o,i){return n||(n={},r={},e.on("NodeChange",(function(e){var o=e.element,i=t.getParents(o,null,t.getRoot()),u={};nn.each(n,(function(e,n){nn.each(i,(function(o){if(t.is(o,n))return r[n]||(nn.each(e,(function(t){t(!0,{node:o,selector:n,parents:i})})),r[n]=e),u[n]=e,!1}))})),nn.each(r,(function(t,e){u[e]||(delete r[e],nn.each(t,(function(t){t(!1,{node:o,selector:e,parents:i})})))}))}))),n[o]||(n[o]=[]),n[o].push(i),{unbind:function(){pT(n,o,i),pT(r,o,i)}}}}}var bT=function(t){return!!t.select},yT=function(t){return!(!t||!t.ownerDocument)&&zn(sn.fromDom(t.ownerDocument),sn.fromDom(t))},wT=function(t){return!!t&&(!!bT(t)||yT(t.startContainer)&&yT(t.endContainer))},xT=function(t,e,n,r){var o,i,u=vT(t,r).selectorChangedWithUnbind,a=function(e,n){var o=t.createRng();e?(o.setStart(e,n),o.setEnd(e,n),y(o),p(!1)):(xh(t,o,r.getBody(),!0),y(o))},c=function(t){return UO(r,t)},s=function(t,e){return aT(r,t,e)},l=function(t){return PO(r.getBody(),b(),t)},f=function(t){return HO(r.getBody(),b(),t)},d=function(t,e){return R.getBookmark(t,e)},m=function(t){return R.moveToBookmark(t)},g=function(e,n){return VO(t,e,n).each(y),e},h=function(){var t=b(),e=v();return!(!t||t.item)&&(t.compareEndPoints?0===t.compareEndPoints("StartToEnd",t):!e||t.collapsed)},p=function(t){var e=b();e.collapse(!!t),y(e)},v=function(){return e.getSelection?e.getSelection():e.document.selection},b=function(){var n,u,a,c=function(t,e,n){try{return e.compareBoundaryPoints(t,n)}catch(r){return-1}};if(!e)return null;var s=e.document;if("undefined"===typeof s||null===s)return null;if(void 0!==r.bookmark&&!1===Ky(r)){var l=xy(r);if(l.isSome())return l.map((function(t){return Ax(r,[t])[0]})).getOr(s.createRange())}try{(n=v())&&!Er(n.anchorNode)&&(u=n.rangeCount>0?n.getRangeAt(0):n.createRange?n.createRange():s.createRange())}catch(f){}return u=Ax(r,[u])[0],u||(u=s.createRange?s.createRange():s.body.createTextRange()),u.setStart&&9===u.startContainer.nodeType&&u.collapsed&&(a=t.getRoot(),u.setStart(a,0),u.setEnd(a,0)),o&&i&&(0===c(u.START_TO_START,u,o)&&0===c(u.END_TO_END,u,o)?u=i:(o=null,i=null)),u},y=function(t,e){var n;if(wT(t)){var u=bT(t)?t:null;if(u){i=null;try{u.select()}catch(s){}}else{var a=v(),c=r.fire("SetSelectionRange",{range:t,forward:e});if(t=c.range,a){i=t;try{a.removeAllRanges(),a.addRange(t)}catch(s){}!1===e&&a.extend&&(a.collapse(t.endContainer,t.endOffset),a.extend(t.startContainer,t.startOffset)),o=a.rangeCount>0?a.getRangeAt(0):null}t.collapsed||t.startContainer!==t.endContainer||!a.setBaseAndExtent||je.ie||t.endOffset-t.startOffset<2&&t.startContainer.hasChildNodes()&&(n=t.startContainer.childNodes[t.startOffset],n&&"IMG"===n.tagName&&(a.setBaseAndExtent(t.startContainer,t.startOffset,t.endContainer,t.endOffset),a.anchorNode===t.startContainer&&a.focusNode===t.endContainer||a.setBaseAndExtent(n,0,n,1))),r.fire("AfterSetSelectionRange",{range:t,forward:e})}}},w=function(e){return s(t.getOuterHTML(e)),e},x=function(){return LO(r.getBody(),b())},C=function(e,n){return FO(t,b(),e,n)},S=function(){var e=v();if(!e||!e.anchorNode||!e.focusNode)return!0;var n=t.createRng();n.setStart(e.anchorNode,e.anchorOffset),n.collapse(!0);var r=t.createRng();return r.setStart(e.focusNode,e.focusOffset),r.collapse(!0),n.compareBoundaryPoints(n.START_TO_START,r)<=0},k=function(){var e=b(),n=v();if(!fh(n)&&Ch(r)){var o=eT(t,e);return o.each((function(t){y(t,S())})),o.getOr(e)}return e},O=function(t,e){return u(t,e),N},T=function(){var e,n=t.getRoot();while(n&&"BODY"!==n.nodeName){if(n.scrollHeight>n.clientHeight){e=n;break}n=n.parentNode}return e},E=function(t,e){return _O(r,t,e)},_=function(t,e){return y(zO(t,e,r.getDoc()))},A=function(){var t=b();return t.collapsed?ql.fromRangeStart(t).getClientRects()[0]:t.getBoundingClientRect()},D=function(){e=o=i=null,M.destroy()},N={bookmarkManager:null,controlSelection:null,dom:t,win:e,serializer:n,editor:r,collapse:p,setCursorLocation:a,getContent:c,setContent:s,getBookmark:d,moveToBookmark:m,select:g,isCollapsed:h,isForward:S,setNode:w,getNode:x,getSel:v,setRng:y,getRng:b,getStart:l,getEnd:f,getSelectedBlocks:C,normalize:k,selectorChanged:O,selectorChangedWithUnbind:u,getScrollContainer:T,scrollIntoView:E,placeCaretAt:_,getBoundingClientRect:A,destroy:D},R=sT(N),M=hT(N,r);return N.bookmarkManager=R,N.controlSelection=M,N},CT=function(t,e){X(e,(function(e){t.attr(e,null)}))},ST=function(t,e,n){t.addNodeFilter("font",(function(t){X(t,(function(t){var r=e.parse(t.attr("style")),o=t.attr("color"),i=t.attr("face"),u=t.attr("size");o&&(r.color=o),i&&(r["font-family"]=i),u&&(r["font-size"]=n[parseInt(t.attr("size"),10)-1]),t.name="span",t.attr("style",e.serialize(r)),CT(t,["color","face","size"])}))}))},kT=function(t,e){t.addNodeFilter("strike",(function(t){X(t,(function(t){var n=e.parse(t.attr("style"));n["text-decoration"]="line-through",t.name="span",t.attr("style",e.serialize(n))}))}))},OT=function(t,e){var n=zi();e.convert_fonts_to_spans&&ST(t,n,nn.explode(e.font_size_legacy_values)),kT(t,n)},TT=function(t,e){e.inline_styles&&OT(t,e)},ET=function(t){return new $a((function(e,r){var o=function(){r("Cannot convert "+t+" to Blob. Resource might not exist or is inaccessible.")};try{var i=new n.XMLHttpRequest;i.open("GET",t,!0),i.responseType="blob",i.onload=function(){200===this.status?e(this.response):o()},i.onerror=o,i.send()}catch(u){o()}}))},_T=function(t){var e,n=decodeURIComponent(t).split(","),r=/data:([^;]+)/.exec(n[0]);return r&&(e=r[1]),{type:e,data:n[1]}},AT=function(t,e){var r;try{r=n.atob(e)}catch(XI){return _.none()}for(var o=new Uint8Array(r.length),i=0;i<o.length;i++)o[i]=r.charCodeAt(i);return _.some(new n.Blob([o],{type:t}))},DT=function(t){return new $a((function(e){var r=_T(t),o=r.type,i=r.data;AT(o,i).fold((function(){return e(new n.Blob([]))}),e)}))},NT=function(t){return 0===t.indexOf("blob:")?ET(t):0===t.indexOf("data:")?DT(t):null},RT=function(t){return new $a((function(e){var r=new n.FileReader;r.onloadend=function(){e(r.result)},r.readAsDataURL(t)}))},MT=0,zT=function(t){return(t||"blobid")+MT++},BT=function(t,e,n,r){var o,i;if(0===e.src.indexOf("blob:"))return i=t.getByUri(e.src),void(i?n({image:e,blobInfo:i}):NT(e.src).then((function(r){RT(r).then((function(u){o=_T(u).data,i=t.create(zT(),r,o),t.add(i),n({image:e,blobInfo:i})}))}),(function(t){r(t)})));var u=_T(e.src),a=u.data,c=u.type;o=a,i=t.getByData(o,c),i?n({image:e,blobInfo:i}):NT(e.src).then((function(r){i=t.create(zT(),r,o),t.add(i),n({image:e,blobInfo:i})}),(function(t){r(t)}))},PT=function(t){return t?mt(t.getElementsByTagName("img")):[]};function HT(t,e){var n={},r=function(r,o){o||(o=v(!0));var i=Q(PT(r),(function(e){var n=e.src;return!!je.fileApi&&(!e.hasAttribute("data-mce-bogus")&&(!e.hasAttribute("data-mce-placeholder")&&(!(!n||n===je.transparentSrc)&&(0===n.indexOf("blob:")?!t.isUploaded(n)&&o(e):0===n.indexOf("data:")&&o(e)))))})),u=K(i,(function(t){if(void 0!==n[t.src])return new $a((function(e){n[t.src].then((function(n){if("string"===typeof n)return n;e({image:t,blobInfo:n.blobInfo})}))}));var r=new $a((function(n,r){BT(e,t,n,r)})).then((function(t){return delete n[t.image.src],t})).catch((function(e){return delete n[t.src],e}));return n[t.src]=r,r}));return $a.all(u)};return{findAll:r}}var IT=function(t,e,n,r){var o=t.padd_empty_with_br||e.insert;o&&n[r.name]?r.empty().append(new Fh("br",1)).shortEnded=!0:r.empty().append(new Fh("#text",3)).value=Di},LT=function(t){return FT(t,"#text")&&t.firstChild.value===Di},FT=function(t,e){return t&&t.firstChild&&t.firstChild===t.lastChild&&t.firstChild.name===e},VT=function(t,e){var n=t.getElementRule(e.name);return n&&n.paddEmpty},UT=function(t,e,n,r){return r.isEmpty(e,n,(function(e){return VT(t,e)}))},jT=function(t,e){return t&&(e[t.name]||"br"===t.name)},WT=function(t){return t.attr("data-mce-bogus")},qT=function(t){return t.attr("src")===je.transparentSrc||t.attr("data-mce-placeholder")},$T=function(t,e){if(e.images_dataimg_filter){var r=new n.Image;return r.src=t.attr("src"),pt(t.attributes.map,(function(t,e){r.setAttribute(e,t)})),e.images_dataimg_filter(r)}return!0},GT=function(t,e){var n=e.blob_cache,r=function(t){var r=t.attr("src");qT(t)||WT(t)||$h(r).filter((function(){return $T(t,e)})).bind((function(t){var e=t.type,r=t.data;return _.from(n.getByData(r,e)).orThunk((function(){return AT(e,r).map((function(t){var e=n.create(zT(),t,r);return n.add(e),e}))}))})).each((function(e){t.attr("src",e.blobUri())}))};n&&t.addAttributeFilter("src",(function(t){return X(t,r)}))},KT=function(t,e){var n=t.schema;e.remove_trailing_brs&&t.addNodeFilter("br",(function(t,r,o){var i,u,a,c,s,l,f,d,m=t.length,g=nn.extend({},n.getBlockElements()),h=n.getNonEmptyElements(),p=n.getWhiteSpaceElements();for(g.body=1,i=0;i<m;i++)if(u=t[i],a=u.parent,g[u.parent.name]&&u===a.lastChild){s=u.prev;while(s){if(l=s.name,"span"!==l||"bookmark"!==s.attr("data-mce-type")){if("br"!==l)break;if("br"===l){u=null;break}}s=s.prev}u&&(u.remove(),UT(n,h,p,a)&&(f=n.getElementRule(a.name),f&&(f.removeEmpty?a.remove():f.paddEmpty&&IT(e,o,g,a))))}else{c=u;while(a&&a.firstChild===c&&a.lastChild===c){if(c=a,g[a.name])break;a=a.parent}c===a&&!0!==e.padd_empty_with_br&&(d=new Fh("#text",3),d.value=Di,u.replace(d))}})),t.addAttributeFilter("href",(function(t){var n=t.length,r=function(t){var e=t.split(" ").filter((function(t){return t.length>0}));return e.concat(["noopener"]).sort().join(" ")},o=function(t){var e=t?nn.trim(t):"";return/\b(noopener)\b/g.test(e)?e:r(e)};if(!e.allow_unsafe_link_target)while(n--){var i=t[n];"a"===i.name&&"_blank"===i.attr("target")&&i.attr("rel",o(i.attr("rel")))}})),e.allow_html_in_named_anchor||t.addAttributeFilter("id,name",(function(t){var e,n,r,o,i=t.length;while(i--)if(o=t[i],"a"===o.name&&o.firstChild&&!o.attr("href")){r=o.parent,e=o.lastChild;do{n=e.prev,r.insert(e,o),e=n}while(e)}})),e.fix_list_elements&&t.addNodeFilter("ul,ol",(function(t){var e,n,r=t.length;while(r--)if(e=t[r],n=e.parent,"ul"===n.name||"ol"===n.name)if(e.prev&&"li"===e.prev.name)e.prev.append(e);else{var o=new Fh("li",1);o.attr("style","list-style-type: none"),e.wrap(o)}})),e.validate&&n.getValidClasses()&&t.addAttributeFilter("class",(function(t){var e,r,o,i,u,a,c,s=t.length,l=n.getValidClasses();while(s--){for(e=t[s],r=e.attr("class").split(" "),u="",o=0;o<r.length;o++)i=r[o],c=!1,a=l["*"],a&&a[i]&&(c=!0),a=l[e.name],!c&&a&&a[i]&&(c=!0),c&&(u&&(u+=" "),u+=i);u.length||(u=null),e.attr("class",u)}})),GT(t,e)},XT=nn.makeMap,YT=nn.each,JT=nn.explode,QT=nn.extend,ZT=function(t,e){void 0===e&&(e=li());var n={},r=[],o={},i={};t=t||{},t.validate=!("validate"in t)||t.validate,t.root_name=t.root_name||"body";var u=function(t){var n,r,o,i,u,c,s,l,f,d,m,g=XT("tr,td,th,tbody,thead,tfoot,table"),h=e.getNonEmptyElements(),p=e.getWhiteSpaceElements(),v=e.getTextBlockElements(),b=e.getSpecialElements();for(n=0;n<t.length;n++)if(r=t[n],r.parent&&!r.fixed)if(v[r.name]&&"li"===r.parent.name){d=r.next;while(d){if(!v[d.name])break;d.name="li",d.fixed=!0,r.parent.insert(d,r.parent),d=d.next}r.unwrap(r)}else{for(i=[r],o=r.parent;o&&!e.isValidChild(o.name,r.name)&&!g[o.name];o=o.parent)i.push(o);if(o&&i.length>1){for(i.reverse(),u=c=a(i[0].clone()),f=0;f<i.length-1;f++){for(e.isValidChild(c.name,i[f].name)?(s=a(i[f].clone()),c.append(s)):s=c,l=i[f].firstChild;l&&l!==i[f+1];)m=l.next,s.append(l),l=m;c=s}UT(e,h,p,u)?o.insert(r,i[0],!0):(o.insert(u,i[0],!0),o.insert(r,u)),o=i[0],(UT(e,h,p,o)||FT(o,"br"))&&o.empty().remove()}else if(r.parent){if("li"===r.name){if(d=r.prev,d&&("ul"===d.name||"ul"===d.name)){d.append(r);continue}if(d=r.next,d&&("ul"===d.name||"ul"===d.name)){d.insert(r,d.firstChild,!0);continue}r.wrap(a(new Fh("ul",1)));continue}e.isValidChild(r.parent.name,"div")&&e.isValidChild("div",r.name)?r.wrap(a(new Fh("div",1))):b[r.name]?r.empty().remove():r.unwrap()}}},a=function(t){var e,u,a;u=t.name,u in n&&(a=o[u],a?a.push(t):o[u]=[t]),e=r.length;while(e--)u=r[e].name,u in t.attributes.map&&(a=i[u],a?a.push(t):i[u]=[t]);return t},c=function(t,e){YT(JT(t),(function(t){var r=n[t];r||(n[t]=r=[]),r.push(e)}))},s=function(){var t=[];for(var e in n)n.hasOwnProperty(e)&&t.push({name:e,callbacks:n[e]});return t},l=function(t,e){YT(JT(t),(function(t){var n;for(n=0;n<r.length;n++)if(r[n].name===t)return void r[n].callbacks.push(e);r.push({name:t,callbacks:[e]})}))},f=function(){return[].concat(r)},d=function(a,c){var s,l,f,d,m,g,h,p,v,b=[],y=function(t){return!1===t?"":!0===t?"p":t};c=c||{},o={},i={};var w=QT(XT("script,style,head,html,body,title,meta,param"),e.getBlockElements()),x=e.getNonEmptyElements(),C=e.children,S=t.validate,k="forced_root_block"in c?c.forced_root_block:t.forced_root_block,O=y(k),T=e.getWhiteSpaceElements(),E=/^[ \t\r\n]+/,_=/[ \t\r\n]+$/,A=/[ \t\r\n]+/g,D=/^[ \t\r\n]+$/;p=T.hasOwnProperty(c.context)||T.hasOwnProperty(t.root_name);var N=function(){var n,r,o=P.firstChild,i=function(t){t&&(o=t.firstChild,o&&3===o.type&&(o.value=o.value.replace(E,"")),o=t.lastChild,o&&3===o.type&&(o.value=o.value.replace(_,"")))};if(e.isValidChild(P.name,O.toLowerCase())){while(o)n=o.next,3===o.type||1===o.type&&"p"!==o.name&&!w[o.name]&&!o.attr("data-mce-type")?(r||(r=R(O,1),r.attr(t.forced_root_block_attrs),P.insert(r,o)),r.append(o)):(i(r),r=null),o=n;i(r)}},R=function(t,e){var r,i=new Fh(t,e);return t in n&&(r=o[t],r?r.push(i):o[t]=[i]),i},M=function(t){var n,r,o,i,u=e.getBlockElements();for(n=t.prev;n&&3===n.type;){if(o=n.value.replace(_,""),o.length>0)return void(n.value=o);if(r=n.next,r){if(3===r.type&&r.value.length){n=n.prev;continue}if(!u[r.name]&&"script"!==r.name&&"style"!==r.name){n=n.prev;continue}}i=n.prev,n.remove(),n=i}},z=function(t){var e,n={};for(e in t)"li"!==e&&"p"!==e&&(n[e]=t[e]);return n},B=ep({validate:S,allow_html_data_urls:t.allow_html_data_urls,allow_script_urls:t.allow_script_urls,allow_conditional_comments:t.allow_conditional_comments,preserve_cdata:t.preserve_cdata,self_closing_elements:z(e.getSelfClosingElements()),cdata:function(t){v.append(R("#cdata",4)).value=t},text:function(t,e){var n;p||(t=t.replace(A," "),jT(v.lastChild,w)&&(t=t.replace(E,""))),0!==t.length&&(n=R("#text",3),n.raw=!!e,v.append(n).value=t)},comment:function(t){v.append(R("#comment",8)).value=t},pi:function(t,e){v.append(R(t,7)).value=e,M(v)},doctype:function(t){var e=v.append(R("#doctype",10));e.value=t,M(v)},start:function(t,n,o){var u,a,c,s,l=S?e.getElementRule(t):{};if(l){u=R(l.outputName||t,1),u.attributes=n,u.shortEnded=o,v.append(u),s=C[v.name],s&&C[u.name]&&!s[u.name]&&b.push(u),a=r.length;while(a--)c=r[a].name,c in n.map&&(g=i[c],g?g.push(u):i[c]=[u]);w[t]&&M(u),o||(v=u),!p&&T[t]&&(p=!0)}},end:function(n){var r,o,i,u,a=S?e.getElementRule(n):{};if(a){if(w[n]&&!p){if(r=v.firstChild,r&&3===r.type)if(o=r.value.replace(E,""),o.length>0)r.value=o,r=r.next;else{i=r.next,r.remove(),r=i;while(r&&3===r.type)o=r.value,i=r.next,(0===o.length||D.test(o))&&(r.remove(),r=i),r=i}if(r=v.lastChild,r&&3===r.type)if(o=r.value.replace(_,""),o.length>0)r.value=o,r=r.prev;else{i=r.prev,r.remove(),r=i;while(r&&3===r.type)o=r.value,i=r.prev,(0===o.length||D.test(o))&&(r.remove(),r=i),r=i}}if(p&&T[n]&&(p=!1),a.removeEmpty&&UT(e,x,T,v))return u=v.parent,w[v.name]?v.empty().remove():v.unwrap(),void(v=u);a.paddEmpty&&(LT(v)||UT(e,x,T,v))&&IT(t,c,w,v),v=v.parent}}},e),P=v=new Fh(c.context||t.root_name,11);if(B.parse(a,c.format),S&&b.length&&(c.context?c.invalid=!0:u(b)),O&&("body"===P.name||c.isRootContent)&&N(),!c.invalid){for(h in o)if(o.hasOwnProperty(h)){g=n[h],s=o[h],d=s.length;while(d--)s[d].parent||s.splice(d,1);for(l=0,f=g.length;l<f;l++)g[l](s,h,c)}for(l=0,f=r.length;l<f;l++)if(g=r[l],g.name in i){s=i[g.name],d=s.length;while(d--)s[d].parent||s.splice(d,1);for(d=0,m=g.callbacks.length;d<m;d++)g.callbacks[d](s,g.name,c)}}return P},m={schema:e,addAttributeFilter:l,getAttributeFilters:f,addNodeFilter:c,getNodeFilters:s,filterNode:a,parse:d};return KT(m,t),TT(m,t),m},tE=function(t,e,n){t.addAttributeFilter("data-mce-tabindex",(function(t,e){var n,r=t.length;while(r--)n=t[r],n.attr("tabindex",n.attr("data-mce-tabindex")),n.attr(e,null)})),t.addAttributeFilter("src,href,style",(function(t,r){var o,i,u=t.length,a="data-mce-"+r,c=e.url_converter,s=e.url_converter_scope;while(u--)o=t[u],i=o.attr(a),void 0!==i?(o.attr(r,i.length>0?i:null),o.attr(a,null)):(i=o.attr(r),"style"===r?i=n.serializeStyle(n.parseStyle(i),o.name):c&&(i=c.call(s,i,r,o.name)),o.attr(r,i.length>0?i:null))})),t.addAttributeFilter("class",(function(t){var e,n,r=t.length;while(r--)e=t[r],n=e.attr("class"),n&&(n=e.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),e.attr("class",n.length>0?n:null))})),t.addAttributeFilter("data-mce-type",(function(t,e,n){var r,o=t.length;while(o--)if(r=t[o],"bookmark"===r.attr("data-mce-type")&&!n.cleanup){var i=_.from(r.firstChild).exists((function(t){return!Ts(t.value)}));i?r.unwrap():r.remove()}})),t.addNodeFilter("noscript",(function(t){var e,n=t.length;while(n--)e=t[n].firstChild,e&&(e.value=Zo.decode(e.value))})),t.addNodeFilter("script,style",(function(t,n){var r,o,i,u=t.length,a=function(t){return t.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi,"").replace(/\s*(\/\*\s*\]\]>\s*\*\/(-->)?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")};while(u--)r=t[u],o=r.firstChild?r.firstChild.value:"","script"===n?(i=r.attr("type"),i&&r.attr("type","mce-no/type"===i?null:i.replace(/^mce\-/,"")),"xhtml"===e.element_format&&o.length>0&&(r.firstChild.value="// <![CDATA[\n"+a(o)+"\n// ]]>")):"xhtml"===e.element_format&&o.length>0&&(r.firstChild.value="\x3c!--\n"+a(o)+"\n--\x3e")})),t.addNodeFilter("#comment",(function(t){var r,o=t.length;while(o--)r=t[o],e.preserve_cdata&&0===r.value.indexOf("[CDATA[")?(r.name="#cdata",r.type=4,r.value=n.decode(r.value.replace(/^\[CDATA\[|\]\]$/g,""))):0===r.value.indexOf("mce:protected ")&&(r.name="#text",r.type=3,r.raw=!0,r.value=unescape(r.value).substr(14))})),t.addNodeFilter("xml:namespace,input",(function(t,e){var n,r=t.length;while(r--)n=t[r],7===n.type?n.remove():1===n.type&&("input"!==e||n.attr("type")||n.attr("type","text"))})),t.addAttributeFilter("data-mce-type",(function(e){X(e,(function(e){"format-caret"===e.attr("data-mce-type")&&(e.isEmpty(t.schema.getNonEmptyElements())?e.remove():e.unwrap())}))})),t.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-type,data-mce-resize,data-mce-placeholder",(function(t,e){var n=t.length;while(n--)t[n].attr(e,null)}))},eE=function(t){var e=function(t){return t&&"br"===t.name},n=t.lastChild;if(e(n)){var r=n.prev;e(r)&&(n.remove(),r.remove())}},nE=function(t,e,r){var o,i,u=t.dom;e=e.cloneNode(!0);var a=n.document.implementation;return a.createHTMLDocument&&(o=a.createHTMLDocument(""),nn.each("BODY"===e.nodeName?e.childNodes:[e],(function(t){o.body.appendChild(o.importNode(t,!0))})),e="BODY"!==e.nodeName?o.body.firstChild:o.body,i=u.doc,u.doc=o),kS(t,Ht(Ht({},r),{node:e})),i&&(u.doc=i),e},rE=function(t,e){return t&&t.hasEventListeners("PreProcess")&&!e.no_events},oE=function(t,e,n){return rE(t,n)?nE(t,e,n):e},iE=function(t,e,n){-1===nn.inArray(e,n)&&(t.addAttributeFilter(n,(function(t,e){var n=t.length;while(n--)t[n].attr(e,null)})),e.push(n))},uE=function(t,e,n){if(!e.no_events&&t){var r=OS(t,Ht(Ht({},e),{content:n}));return r.content}return n},aE=function(t,e,n){var r=Es(n.getInner?e.innerHTML:t.getOuterHTML(e));return n.selection||Ro(sn.fromDom(e))?r:nn.trim(r)},cE=function(t,e,n){var r=n.selection?Ht({forced_root_block:!1},n):n,o=t.parse(e,r);return eE(o),o},sE=function(t,e,n){var r=jh(t,e);return r.serialize(n)},lE=function(t,e,n,r,o){var i=sE(e,n,r);return uE(t,o,i)},fE=function(t,e){var n=["data-mce-selected"],r=e&&e.dom?e.dom:dc.DOM,o=e&&e.schema?e.schema:li(t);t.entity_encoding=t.entity_encoding||"named",t.remove_trailing_brs=!("remove_trailing_brs"in t)||t.remove_trailing_brs;var i=ZT(t,o);tE(i,t,r);var u=function(n,u){void 0===u&&(u={});var a=Ht({format:"html"},u),c=oE(e,n,a),s=aE(r,c,a),l=cE(i,s,a);return"tree"===a.format?l:lE(e,t,o,l,a)};return{schema:o,addNodeFilter:i.addNodeFilter,addAttributeFilter:i.addAttributeFilter,serialize:u,addRules:function(t){o.addValidElements(t)},setRules:function(t){o.setValidElements(t)},addTempAttr:y(iE,i,n),getTempAttrs:function(){return n},getNodeFilters:i.getNodeFilters,getAttributeFilters:i.getAttributeFilters}},dE=function(t,e){var n=fE(t,e);return{schema:n.schema,addNodeFilter:n.addNodeFilter,addAttributeFilter:n.addAttributeFilter,serialize:n.serialize,addRules:n.addRules,setRules:n.setRules,addTempAttr:n.addTempAttr,getTempAttrs:n.getTempAttrs,getNodeFilters:n.getNodeFilters,getAttributeFilters:n.getAttributeFilters}};function mE(t,e){var r={},o=function(t,e){return t?t.replace(/\/$/,"")+"/"+e.replace(/^\//,""):e},i=function(t,r,i,u){var a=new n.XMLHttpRequest;a.open("POST",e.url),a.withCredentials=e.credentials,a.upload.onprogress=function(t){u(t.loaded/t.total*100)},a.onerror=function(){i("Image upload failed due to a XHR Transport error. Code: "+a.status)},a.onload=function(){if(a.status<200||a.status>=300)i("HTTP Error: "+a.status);else{var t=JSON.parse(a.responseText);t&&"string"===typeof t.location?r(o(e.basePath,t.location)):i("Invalid JSON: "+a.responseText)}};var c=new n.FormData;c.append("file",t.blob(),t.filename()),a.send(c)},u=function(){return new $a((function(t){t([])}))},a=function(t,e){return{url:e,blobInfo:t,status:!0}},c=function(t,e){return{url:"",blobInfo:t,status:!1,error:e}},s=function(t,e){nn.each(r[t],(function(t){t(e)})),delete r[t]},l=function(e,n,r){return t.markPending(e.blobUri()),new $a((function(o){var i,u,l=function(){};try{var f=function(){i&&(i.close(),u=l)},d=function(n){f(),t.markUploaded(e.blobUri(),n),s(e.blobUri(),a(e,n)),o(a(e,n))},m=function(n){f(),t.removeFailed(e.blobUri()),s(e.blobUri(),c(e,n)),o(c(e,n))};u=function(t){t<0||t>100||(i||(i=r()),i.progressBar.value(t))},n(e,d,m,u)}catch(g){o(c(e,g.message))}}))},f=function(t){return t===i},d=function(t){var e=t.blobUri();return new $a((function(t){r[e]=r[e]||[],r[e].push(t)}))},m=function(n,r){return n=nn.grep(n,(function(e){return!t.isUploaded(e.blobUri())})),$a.all(nn.map(n,(function(n){return t.isPending(n.blobUri())?d(n):l(n,e.handler,r)})))},g=function(t,n){return!e.url&&f(e.handler)?u():m(t,n)};return!1===L(e.handler)&&(e.handler=i),{upload:g}}function gE(){var t=1,e=2,n={},r=function(t,e){return{status:t,resultUri:e}},o=function(t){return t in n},i=function(t){var e=n[t];return e?e.resultUri:null},u=function(e){return!!o(e)&&n[e].status===t},a=function(t){return!!o(t)&&n[t].status===e},c=function(e){n[e]=r(t,null)},s=function(t,o){n[t]=r(e,o)},l=function(t){delete n[t]},f=function(){n={}};return{hasBlobUri:o,getResultUri:i,isPending:u,isUploaded:a,markPending:c,markUploaded:s,removeFailed:l,destroy:f}}var hE=0,pE=function(){var t=function(){return Math.round(4294967295*Math.random()).toString(36)},e=(new Date).getTime();return"s"+e.toString(36)+t()+t()+t()},vE=function(t){return t+hE+++pE()},bE=function(){var t=[],e=function(t){var e={"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png"};return e[t.toLowerCase()]||"dat"},r=function(t,e,n,r){if(M(t)){var i=t;return o({id:i,name:r,blob:e,base64:n})}if(z(t))return o(t);throw new Error("Unknown input type")},o=function(t){if(!t.blob||!t.base64)throw new Error("blob and base64 representations of the image are required for BlobInfo to be created");var r=t.id||vE("blobid"),o=t.name||r;return{id:v(r),name:v(o),filename:v(o+"."+e(t.blob.type)),blob:v(t.blob),base64:v(t.base64),blobUri:v(t.blobUri||n.URL.createObjectURL(t.blob)),uri:v(t.uri)}},i=function(e){a(e.id())||t.push(e)},u=function(e){return nt(t,e).getOrUndefined()},a=function(t){return u((function(e){return e.id()===t}))},c=function(t){return u((function(e){return e.blobUri()===t}))},s=function(t,e){return u((function(n){return n.base64()===t&&n.blob().type===e}))},l=function(e){t=Q(t,(function(t){return t.blobUri()!==e||(n.URL.revokeObjectURL(t.blobUri()),!1)}))},f=function(){X(t,(function(t){n.URL.revokeObjectURL(t.blobUri())})),t=[]};return{create:r,add:i,get:a,getByUri:c,getByData:s,findFirst:u,removeByUri:l,destroy:f}},yE=function(t){var e,n,r=bE(),o=gE(),i=[],u=function(e){return function(n){return t.selection?e(n):[]}},a=function(t){return t+(-1===t.indexOf("?")?"?":"&")+(new Date).getTime()},c=function(t,e,n){var r=0;do{r=t.indexOf(e,r),-1!==r&&(t=t.substring(0,r)+n+t.substr(r+e.length),r+=n.length-e.length+1)}while(-1!==r);return t},s=function(t,e,n){return t=c(t,'src="'+e+'"','src="'+n+'"'),t=c(t,'data-mce-src="'+e+'"','data-mce-src="'+n+'"'),t},l=function(e,n){X(t.undoManager.data,(function(t){"fragmented"===t.type?t.fragments=K(t.fragments,(function(t){return s(t,e,n)})):t.content=s(t.content,e,n)}))},f=function(){return t.notificationManager.open({text:t.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0})},d=function(e,n){var r=t.convertURL(n,"src");l(e.src,n),t.$(e).attr({src:Gf(t)?a(n):n,"data-mce-src":r})},m=function(n){return e||(e=mE(o,{url:Jf(t),basePath:Qf(t),credentials:Zf(t),handler:td(t)})),v().then(u((function(o){var i=K(o,(function(t){return t.blobInfo}));return e.upload(i,f).then(u((function(e){var i=K(e,(function(e,n){var i=o[n].blobInfo,u=o[n].image;return e.status&&Kf(t)?(r.removeByUri(u.src),d(u,e.url)):e.error&&Uk(t,e.error),{element:u,status:e.status,uploadUri:e.url,blobInfo:i}}));return n&&n(i),i})))})))},g=function(e){if($f(t))return m(e)},h=function(e){if(!1===ut(i,(function(t){return t(e)})))return!1;if(0===e.getAttribute("src").indexOf("data:")){var n=qf(t);return n(e)}return!0},p=function(t){i.push(t)},v=function(){return n||(n=HT(o,r)),n.findAll(t.getBody(),h).then(u((function(e){return e=Q(e,(function(e){return"string"!==typeof e||(Vk(t,e),!1)})),X(e,(function(t){l(t.image.src,t.blobInfo.blobUri()),t.image.src=t.blobInfo.blobUri(),t.image.removeAttribute("data-mce-src")})),e})))},b=function(){r.destroy(),o.destroy(),n=e=null},y=function(e){return e.replace(/src="(blob:[^"]+)"/g,(function(e,n){var i=o.getResultUri(n);if(i)return'src="'+i+'"';var u=r.getByUri(n);if(u||(u=tt(t.editorManager.get(),(function(t,e){return t||e.editorUpload&&e.editorUpload.blobCache.getByUri(n)}),null)),u){var a=u.blob();return'src="data:'+a.type+";base64,"+u.base64()+'"'}return e}))};return t.on("SetContent",(function(){$f(t)?g():v()})),t.on("RawSaveContent",(function(t){t.content=y(t.content)})),t.on("GetContent",(function(t){t.source_view||"raw"===t.format||(t.content=y(t.content))})),t.on("PostRender",(function(){t.parser.addNodeFilter("img",(function(t){X(t,(function(t){var e=t.attr("src");if(!r.getByUri(e)){var n=o.getResultUri(e);n&&t.attr("src",n)}}))}))})),{blobCache:r,addFilter:p,uploadImages:m,uploadImagesAuto:g,scanForImages:v,destroy:b}},wE=function(t,e){var n=xc({});t.set({}),e.on("NodeChange",(function(r){xE(e,r.element,n,t.get())}))},xE=function(t,e,n,r){var o=gt(n.get()),i={},u={},a=Q(jg(t.dom,e),(function(t){return 1===t.nodeType&&!t.getAttribute("data-mce-bogus")}));pt(r,(function(e,n){nn.each(a,(function(r){return t.formatter.matchNode(r,n,{},e.similar)?(-1===o.indexOf(n)&&(X(e.callbacks,(function(t){t(!0,{node:r,format:n,parents:a})})),i[n]=e.callbacks),u[n]=e.callbacks,!1):!dw(t,r,n)&&void 0}))}));var c=CE(n.get(),u,e,a);n.set(Ht(Ht({},i),c))},CE=function(t,e,n,r){return xt(t,(function(t,o){return!!Tt(e,o)||(X(t,(function(t){t(!1,{node:n,format:o,parents:r})})),!1)})).t},SE=function(t,e,n,r){var o=t.get();X(e.split(","),(function(t){o[t]||(o[t]={similar:r,callbacks:[]}),o[t].callbacks.push(n)})),t.set(o)},kE=function(t,e,n){var r=t.get();X(e.split(","),(function(t){r[t].callbacks=Q(r[t].callbacks,(function(t){return t!==n})),0===r[t].callbacks.length&&delete r[t]})),t.set(r)},OE=function(t,e,n,r,o){return null===e.get()&&wE(e,t),SE(e,n,r,o),{unbind:function(){return kE(e,n,r)}}},TE=function(t){var e={valigntop:[{selector:"td,th",styles:{verticalAlign:"top"}}],valignmiddle:[{selector:"td,th",styles:{verticalAlign:"middle"}}],valignbottom:[{selector:"td,th",styles:{verticalAlign:"bottom"}}],alignleft:[{selector:"figure.image",collapsed:!1,classes:"align-left",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"left"},inherit:!1,preview:!1,defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{float:"left"},preview:"font-family font-size"}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"center"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"figure.image",collapsed:!1,classes:"align-center",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"img",collapsed:!1,styles:{display:"block",marginLeft:"auto",marginRight:"auto"},preview:!1},{selector:"table",collapsed:!1,styles:{marginLeft:"auto",marginRight:"auto"},preview:"font-family font-size"}],alignright:[{selector:"figure.image",collapsed:!1,classes:"align-right",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"right"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{float:"right"},preview:"font-family font-size"}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"justify"},inherit:!1,defaultBlock:"div",preview:"font-family font-size"}],bold:[{inline:"strong",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all",preserve_attributes:["class","style"]}],italic:[{inline:"em",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all",preserve_attributes:["class","style"]}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all",preserve_attributes:["class","style"]}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:!0},{inline:"strike",remove:"all",preserve_attributes:["class","style"]}],forecolor:{inline:"span",styles:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},fontname:{inline:"span",toggle:!1,styles:{fontFamily:"%value"},clear_child_styles:!0},fontsize:{inline:"span",toggle:!1,styles:{fontSize:"%value"},clear_child_styles:!0},fontsize_class:{inline:"span",attributes:{class:"%value"}},blockquote:{block:"blockquote",wrapper:!0,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},code:{inline:"code"},link:{inline:"a",selector:"a",remove:"all",split:!0,deep:!0,onmatch:function(){return!0},onformat:function(e,n,r){nn.each(r,(function(n,r){t.setAttrib(e,r,n)}))}},removeformat:[{selector:"b,strong,em,i,font,u,strike,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins",remove:"all",split:!0,expand:!1,block_expand:!0,deep:!0},{selector:"span",attributes:["style","class"],remove:"empty",split:!0,expand:!1,deep:!0},{selector:"*",attributes:["style","class"],split:!1,expand:!1,deep:!0}]};return nn.each("p h1 h2 h3 h4 h5 h6 div address pre div dt dd samp".split(/\s/),(function(t){e[t]={block:t,remove:"all"}})),e};function EE(t){var e={},n=function(t){return t?e[t]:e},r=function(t){return Tt(e,t)},o=function(t,n){t&&("string"!==typeof t?nn.each(t,(function(t,e){o(e,t)})):(B(n)||(n=[n]),nn.each(n,(function(t){"undefined"===typeof t.deep&&(t.deep=!t.selector),"undefined"===typeof t.split&&(t.split=!t.selector||t.inline),"undefined"===typeof t.remove&&t.selector&&!t.inline&&(t.remove="none"),t.selector&&t.inline&&(t.mixed=!0,t.block_expand=!0),"string"===typeof t.classes&&(t.classes=t.classes.split(/\s+/))})),e[t]=n))},i=function(t){return t&&e[t]&&delete e[t],e};return o(TE(t.dom)),o(bd(t)),{get:n,has:r,register:o,unregister:i}}var _E,AE=nn.each,DE=dc.DOM,NE=function(t,e){var n,r,o,i=e&&e.schema||li({}),u=function(t,e){e.classes.length&&DE.addClass(t,e.classes.join(" ")),DE.setAttribs(t,e.attrs)},a=function(t){r="string"===typeof t?{name:t,classes:[],attrs:{}}:t;var e=DE.create(r.name);return u(e,r),e},c=function(t,e){var n="string"!==typeof t?t.nodeName.toLowerCase():t,r=i.getElementRule(n),o=r&&r.parentsRequired;return!(!o||!o.length)&&(e&&-1!==nn.inArray(o,e)?e:o[0])},s=function(t,e,n){var r,o,i=e.length>0&&e[0],u=i&&i.name,l=c(t,u);if(l)u===l?(o=e[0],e=e.slice(1)):o=l;else if(i)o=e[0],e=e.slice(1);else if(!n)return t;return o&&(r=a(o),r.appendChild(t)),n&&(r||(r=DE.create("div"),r.appendChild(t)),nn.each(n,(function(e){var n=a(e);r.insertBefore(n,t)}))),s(r,e,o&&o.siblings)};return t&&t.length?(r=t[0],n=a(r),o=DE.create("div"),o.appendChild(s(n,t.slice(1),r.siblings)),o):""},RE=function(t){var e,n={classes:[],attrs:{}};return t=n.selector=nn.trim(t),"*"!==t&&(e=t.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g,(function(t,e,r,o,i){switch(e){case"#":n.attrs.id=r;break;case".":n.classes.push(r);break;case":":-1!==nn.inArray("checked disabled enabled read-only required".split(" "),r)&&(n.attrs[r]=r);break}if("["===o){var u=i.match(/([\w\-]+)(?:\=\"([^\"]+))?/);u&&(n.attrs[u[1]]=u[2])}return""}))),n.name=e||"div",n},ME=function(t){return t&&"string"===typeof t?(t=t.split(/\s*,\s*/)[0],t=t.replace(/\s*(~\+|~|\+|>)\s*/g,"$1"),nn.map(t.split(/(?:>|\s+(?![^\[\]]+\]))/),(function(t){var e=nn.map(t.split(/(?:~\+|~|\+)/),RE),n=e.pop();return e.length&&(n.siblings=e),n})).reverse()):[]},zE=function(t,e){var n,r,o,i="",u=yd(t);if(""===u)return"";var a=function(t){return t.replace(/%(\w+)/g,"")};if("string"===typeof e){if(e=t.formatter.get(e),!e)return;e=e[0]}if("preview"in e){var c=Ot(e,"preview");if(c.is(!1))return"";u=c.getOr(u)}n=e.block||e.inline||"span";var s=ME(e.selector);s.length?(s[0].name||(s[0].name=n),n=e.selector,r=NE(s,t)):r=NE([n],t);var l=DE.select(n,r)[0]||r.firstChild;return AE(e.styles,(function(t,e){t=a(t),t&&DE.setStyle(l,e,t)})),AE(e.attributes,(function(t,e){t=a(t),t&&DE.setAttrib(l,e,t)})),AE(e.classes,(function(t){t=a(t),DE.hasClass(l,t)||DE.addClass(l,t)})),t.fire("PreviewFormats"),DE.setStyles(r,{position:"absolute",left:-65535}),t.getBody().appendChild(r),o=DE.getStyle(t.getBody(),"fontSize",!0),o=/px$/.test(o)?parseInt(o,10):0,AE(u.split(" "),(function(e){var n=DE.getStyle(l,e,!0);if(("background-color"!==e||!/transparent|rgba\s*\([^)]+,\s*0\)/.test(n)||(n=DE.getStyle(t.getBody(),e,!0),"#ffffff"!==DE.toHex(n).toLowerCase()))&&("color"!==e||"#000000"!==DE.toHex(n).toLowerCase())){if("font-size"===e&&/em|%$/.test(n)){if(0===o)return;var r=parseFloat(n)/(/%$/.test(n)?100:1);n=r*o+"px"}"border"===e&&n&&(i+="padding:0 2px;"),i+=e+":"+n+";"}})),t.fire("AfterPreviewFormats"),DE.remove(r),i},BE=function(t){t.addShortcut("meta+b","","Bold"),t.addShortcut("meta+i","","Italic"),t.addShortcut("meta+u","","Underline");for(var e=1;e<=6;e++)t.addShortcut("access+"+e,"",["FormatBlock",!1,"h"+e]);t.addShortcut("access+7","",["FormatBlock",!1,"p"]),t.addShortcut("access+8","",["FormatBlock",!1,"div"]),t.addShortcut("access+9","",["FormatBlock",!1,"address"])},PE=function(t){var e=EE(t),n=xc(null);return BE(t),Iw(t),{get:e.get,has:e.has,register:e.register,unregister:e.unregister,apply:function(e,n,r){gS(t,e,n,r)},remove:function(e,n,r,o){hS(t,e,n,r,o)},toggle:function(e,n,r){pS(t,e,n,r)},match:y(vw,t),matchAll:y(bw,t),matchNode:y(pw,t),canApply:y(yw,t),formatChanged:y(OE,t,n),getCssText:y(zE,t)}},HE=function(t,e,n){var r=xc(!1),o=function(t){zC(e,!1,n),e.add({},t)};t.on("init",(function(){e.add()})),t.on("BeforeExecCommand",(function(t){var r=t.command.toLowerCase();"undo"!==r&&"redo"!==r&&"mcerepaint"!==r&&(BC(e,n),e.beforeChange())})),t.on("ExecCommand",(function(t){var e=t.command.toLowerCase();"undo"!==e&&"redo"!==e&&"mcerepaint"!==e&&o(t)})),t.on("ObjectResizeStart cut",(function(){e.beforeChange()})),t.on("SaveContent ObjectResized blur",o),t.on("dragend",o),t.on("keyup",(function(n){var i=n.keyCode;n.isDefaultPrevented()||((i>=33&&i<=36||i>=37&&i<=40||45===i||n.ctrlKey)&&(o(),t.nodeChanged()),46!==i&&8!==i||t.nodeChanged(),r.get()&&e.typing&&!1===RC(TC(t),e.data[0])&&(!1===t.isDirty()&&(t.setDirty(!0),t.fire("change",{level:e.data[0],lastLevel:null})),t.fire("TypingUndo"),r.set(!1),t.nodeChanged()))})),t.on("keydown",(function(t){var i=t.keyCode;if(!t.isDefaultPrevented())if(i>=33&&i<=36||i>=37&&i<=40||45===i)e.typing&&o(t);else{var u=t.ctrlKey&&!t.altKey||t.metaKey;!(i<16||i>20)||224===i||91===i||e.typing||u||(e.beforeChange(),zC(e,!0,n),e.add({},t),r.set(!0))}})),t.on("mousedown",(function(t){e.typing&&o(t)}));var i=function(t){return"insertReplacementText"===t.inputType},u=function(t){return"insertText"===t.inputType&&null===t.data},a=function(t){return"insertFromPaste"===t.inputType||"insertFromDrop"===t.inputType};t.on("input",(function(t){t.inputType&&(i(t)||u(t)||a(t))&&o(t)})),t.on("AddUndo Undo Redo ClearUndos",(function(e){e.isDefaultPrevented()||t.nodeChanged()}))},IE=function(t){t.addShortcut("meta+z","","Undo"),t.addShortcut("meta+y,meta+shift+z","","Redo")},LE=function(t){var e=xc(_.none()),n=xc(0),r=xc(0),o={data:[],typing:!1,beforeChange:function(){rS(t,n,e)},add:function(i,u){return oS(t,o,r,n,e,i,u)},undo:function(){return iS(t,o,n,r)},redo:function(){return uS(t,r,o.data)},clear:function(){aS(t,o,r)},reset:function(){cS(t,o)},hasUndo:function(){return sS(t,o,r)},hasRedo:function(){return lS(t,o,r)},transact:function(e){return fS(t,o,n,e)},ignore:function(e){dS(t,n,e)},extra:function(e,n){mS(t,o,r,e,n)}};return ZC(t)||HE(t,o,n),IE(t),o},FE=[9,27,fT.HOME,fT.END,19,20,44,144,145,33,34,45,16,17,18,91,92,93,fT.DOWN,fT.UP,fT.LEFT,fT.RIGHT].concat(je.browser.isFirefox()?[224]:[]),VE="data-mce-placeholder",UE=function(t){return"keydown"===t.type||"keyup"===t.type},jE=function(t){var e=t.keyCode;return e===fT.BACKSPACE||e===fT.DELETE},WE=function(t){if(UE(t)){var e=t.keyCode;return!jE(t)&&(fT.metaKeyPressed(t)||t.altKey||e>=112&&e<=123||$(FE,e))}return!1},qE=function(t){return UE(t)&&!(jE(t)||"keyup"===t.type&&229===t.keyCode)},$E=function(t,e,n){if(Rp(sn.fromDom(e),!1)){var r=""===n,o=e.firstElementChild;return!o||!t.getStyle(e.firstElementChild,"padding-left")&&!t.getStyle(e.firstElementChild,"padding-right")&&(r?!t.isBlock(o):n===o.nodeName.toLowerCase())}return!1},GE=function(t){var e=t.dom,n=Hf(t),r=dd(t),o=function(i,u){if(!WE(i)){var a=t.getBody(),c=!qE(i)&&$E(e,a,n),s=""!==e.getAttrib(a,VE);(s!==c||u)&&(e.setAttrib(a,VE,c?r:null),e.setAttrib(a,"aria-placeholder",c?r:null),zS(t,c),t.on(c?"keydown":"keyup",o),t.off(c?"keyup":"keydown",o))}};r&&t.on("init",(function(e){o(e,!0),t.on("change SetContent ExecCommand",o),t.on("paste",(function(e){return Za.setEditorTimeout(t,(function(){return o(e)}))}))}))},KE=5,XE=400,YE=function(t){return void 0===t.touches||1!==t.touches.length?_.none():_.some(t.touches[0])},JE=function(t,e){var n=Math.abs(t.clientX-e.x()),r=Math.abs(t.clientY-e.y());return n>KE||r>KE},QE=function(t){var e=xc(_.none()),n=xc(!1),r=Ic((function(e){t.fire("longpress",Ht(Ht({},e),{type:"longpress"})),n.set(!0)}),XE);t.on("touchstart",(function(t){YE(t).each((function(o){r.cancel();var i={x:v(o.clientX),y:v(o.clientY),target:v(t.target)};r.throttle(t),n.set(!1),e.set(_.some(i))}))}),!0),t.on("touchmove",(function(o){r.cancel(),YE(o).each((function(r){e.get().each((function(o){JE(r,o)&&(e.set(_.none()),n.set(!1),t.fire("longpresscancel"))}))}))}),!0),t.on("touchend touchcancel",(function(o){r.cancel(),"touchcancel"!==o.type&&e.get().filter((function(t){return t.target().isEqualNode(o.target)})).each((function(){n.get()?o.preventDefault():t.fire("tap",Ht(Ht({},o),{type:"tap"}))}))}),!0)},ZE=function(t,e){return t.hasOwnProperty(e.nodeName)},t_=function(t,e){return!!Ir(e)||!!_r(e)&&(!ZE(t,e)&&!Og(e))},e_=function(t,e,n){return G(Lp(sn.fromDom(n),sn.fromDom(e)),(function(e){return ZE(t,e.dom())}))},n_=function(t,e){if(Ir(e)){if(0===e.nodeValue.length)return!0;if(/^\s+$/.test(e.nodeValue)&&(!e.nextSibling||ZE(t,e.nextSibling)))return!0}return!1},r_=function(t){var e,n,r,o=t.dom,i=t.selection,u=t.schema,a=u.getBlockElements(),c=i.getStart(),s=t.getBody(),l=Hf(t);if(c&&_r(c)&&l){var f=s.nodeName.toLowerCase();if(u.isValidChild(f,l.toLowerCase())&&!e_(a,s,c)){var d=i.getRng(),m=d.startContainer,g=d.startOffset,h=d.endContainer,p=d.endOffset,v=Ky(t);c=s.firstChild;while(c)if(t_(a,c)){if(n_(a,c)){n=c,c=c.nextSibling,o.remove(n);continue}e||(e=o.create(l,If(t)),c.parentNode.insertBefore(e,c),r=!0),n=c,c=c.nextSibling,e.appendChild(n)}else e=null,c=c.nextSibling;r&&v&&(d.setStart(m,g),d.setEnd(h,p),i.setRng(d),t.nodeChanged())}}},o_=function(t){Hf(t)&&t.on("NodeChange",y(r_,t))},i_=function(t){return L(t.selection.getSel().modify)},u_=function(t,e,n){var r=t?1:-1;return e.setRng(ql(n.container(),n.offset()+r).toRange()),e.getSel().modify("move",t?"forward":"backward","word"),!0},a_=function(t,e){var n=e.selection.getRng(),r=t?ql.fromRangeEnd(n):ql.fromRangeStart(n);return!!i_(e)&&(t&&Bs(r)?u_(!0,e.selection,r):!(t||!Ps(r))&&u_(!1,e.selection,r))},c_=Ir,s_=function(t){return c_(t)&&t.data[0]===Os},l_=function(t){return c_(t)&&t.data[t.data.length-1]===Os},f_=function(t){return t.ownerDocument.createTextNode(Os)},d_=function(t){if(c_(t.previousSibling))return l_(t.previousSibling)||t.previousSibling.appendData(Os),t.previousSibling;if(c_(t))return s_(t)||t.insertData(0,Os),t;var e=f_(t);return t.parentNode.insertBefore(e,t),e},m_=function(t){if(c_(t.nextSibling))return s_(t.nextSibling)||t.nextSibling.insertData(0,Os),t.nextSibling;if(c_(t))return l_(t)||t.appendData(Os),t;var e=f_(t);return t.nextSibling?t.parentNode.insertBefore(e,t.nextSibling):t.parentNode.appendChild(e),e},g_=function(t,e){return t?d_(e):m_(e)},h_=y(g_,!0),p_=y(g_,!1),v_=function(t,e){return Ir(t.container())?g_(e,t.container()):g_(e,t.getNode())},b_=function(t,e){var n=e.get();return n&&t.container()===n&&Ns(n)},y_=function(t,e){return e.fold((function(e){Kd(t.get());var n=h_(e);return t.set(n),_.some(ql(n,n.length-1))}),(function(e){return tg(e).map((function(e){if(b_(e,t))return ql(t.get(),1);Kd(t.get());var n=v_(e,!0);return t.set(n),ql(n,1)}))}),(function(e){return eg(e).map((function(e){if(b_(e,t))return ql(t.get(),t.get().length-1);Kd(t.get());var n=v_(e,!1);return t.set(n),ql(n,n.length-1)}))}),(function(e){Kd(t.get());var n=p_(e);return t.set(n),_.some(ql(n,1))}))},w_=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,x_=function(t){return w_.test(t)},C_=function(t,e){return En(sn.fromDom(e),sd(t))},S_=function(t){return"rtl"===dc.DOM.getStyle(t,"direction",!0)||x_(t.textContent)},k_=function(t,e,n){return Q(dc.DOM.getParents(n.container(),"*",e),t)},O_=function(t,e,n){var r=k_(t,e,n);return _.from(r[r.length-1])},T_=function(t,e,n){var r=mm(e,t),o=mm(n,t);return r&&r===o},E_=function(t){return Bs(t)||Ps(t)},__=function(t,e){if(!e)return e;var n=e.container(),r=e.offset();return t?Ns(n)?Ir(n.nextSibling)?ql(n.nextSibling,0):ql.after(n):Bs(e)?ql(n,r+1):e:Ns(n)?Ir(n.previousSibling)?ql(n.previousSibling,n.previousSibling.data.length):ql.before(n):Ps(e)?ql(n,r-1):e},A_=y(__,!0),D_=y(__,!1),N_=function(t,e){for(var n=0;n<t.length;n++){var r=t[n].apply(null,e);if(r.isSome())return r}return _.none()},R_=ja.generate([{before:["element"]},{start:["element"]},{end:["element"]},{after:["element"]}]),M_=function(t,e){var n=mm(e,t);return n||t},z_=function(t,e,n){var r=A_(n),o=M_(e,r.container());return O_(t,o,r).fold((function(){return Qm(o,r).bind(y(O_,t,o)).map((function(t){return R_.before(t)}))}),_.none)},B_=function(t,e){return null===og(t,e)},P_=function(t,e,n){return O_(t,e,n).filter(y(B_,e))},H_=function(t,e,n){var r=D_(n);return P_(t,e,r).bind((function(t){var e=Zm(t,r);return e.isNone()?_.some(R_.start(t)):_.none()}))},I_=function(t,e,n){var r=A_(n);return P_(t,e,r).bind((function(t){var e=Qm(t,r);return e.isNone()?_.some(R_.end(t)):_.none()}))},L_=function(t,e,n){var r=D_(n),o=M_(e,r.container());return O_(t,o,r).fold((function(){return Zm(o,r).bind(y(O_,t,o)).map((function(t){return R_.after(t)}))}),_.none)},F_=function(t){return!1===S_(U_(t))},V_=function(t,e,n){var r=N_([z_,H_,I_,L_],[t,e,n]);return r.filter(F_)},U_=function(t){return t.fold(b,b,b,b)},j_=function(t){return t.fold(v("before"),v("start"),v("end"),v("after"))},W_=function(t){return t.fold(R_.before,R_.before,R_.after,R_.after)},q_=function(t){return t.fold(R_.start,R_.start,R_.end,R_.end)},$_=function(t,e){return j_(t)===j_(e)&&U_(t)===U_(e)},G_=function(t,e,n,r,o,i){return qs(O_(e,n,r),O_(e,n,o),(function(e,r){return e!==r&&T_(n,e,r)?R_.after(t?e:r):i})).getOr(i)},K_=function(t,e){return t.fold(v(!0),(function(t){return!$_(t,e)}))},X_=function(t,e,n,r,o){var i=__(t,o),u=Km(t,n,i).map(y(__,t)),a=u.fold((function(){return r.map(W_)}),(function(o){return V_(e,n,o).map(y(G_,t,e,n,i,o)).filter(y(K_,r))}));return a.filter(F_)},Y_=function(t,e){return t?e.fold(h(_.some,R_.start),_.none,h(_.some,R_.after),_.none):e.fold(_.none,h(_.some,R_.before),_.none,h(_.some,R_.end))},J_=function(t,e,n,r){var o=__(t,r),i=V_(e,n,o);return V_(e,n,o).bind(y(Y_,t)).orThunk((function(){return X_(t,e,n,i,r)}))},Q_=(y(J_,!1),y(J_,!0),function(t,e){var n=t.dom.createRng();n.setStart(e.container(),e.offset()),n.setEnd(e.container(),e.offset()),t.selection.setRng(n)}),Z_=function(t,e){t?e.setAttribute("data-mce-selected","inline-boundary"):e.removeAttribute("data-mce-selected")},tA=function(t,e,n){return y_(e,n).map((function(e){return Q_(t,e),n}))},eA=function(t,e,n){var r=t.getBody(),o=ql.fromRangeStart(t.selection.getRng()),i=y(C_,t),u=J_(n,i,r,o);return u.bind((function(n){return tA(t,e,n)}))},nA=function(t,e,n){var r=K(Jc(sn.fromDom(e.getRoot()),'*[data-mce-selected="inline-boundary"]'),(function(t){return t.dom()})),o=Q(r,t),i=Q(n,t);X(ct(o,i),y(Z_,!1)),X(ct(i,o),y(Z_,!0))},rA=function(t,e){if(t.selection.isCollapsed()&&!0!==t.composing&&e.get()){var n=ql.fromRangeStart(t.selection.getRng());ql.isTextPosition(n)&&!1===E_(n)&&(Q_(t,Gd(e.get(),n)),e.set(null))}},oA=function(t,e,n,r){if(e.selection.isCollapsed()){var o=Q(r,t);X(o,(function(r){var o=ql.fromRangeStart(e.selection.getRng());V_(t,e.getBody(),o).bind((function(t){return tA(e,n,t)}))}))}},iA=function(t,e,n){return function(){return!!vd(t)&&eA(t,e,n).isSome()}},uA=function(t,e,n){return function(){return!!vd(e)&&a_(t,e)}},aA=function(t){var e=xc(null),n=y(C_,t);return t.on("NodeChange",(function(r){!vd(t)||je.browser.isIE()&&r.initial||(nA(n,t.dom,r.parents),rA(t,e),oA(n,t,e,r.parents))})),e},cA=y(uA,!0),sA=y(uA,!1);(function(t){t[t["Br"]=0]="Br",t[t["Block"]=1]="Block",t[t["Wrap"]=2]="Wrap",t[t["Eol"]=3]="Eol"})(_E||(_E={}));var lA,fA=function(t,e){return t===Wl.Backwards?at(e):e},dA=function(t,e,n){return t===Wl.Forwards?e.next(n):e.prev(n)},mA=function(t,e,n,r){return Ur(r.getNode(e===Wl.Forwards))?_E.Br:!1===gm(n,r)?_E.Block:_E.Wrap},gA=function(t,e,n,r){var o,i=Fm(n),u=r,a=[];while(u){if(o=dA(e,i,u),!o)break;if(Ur(o.getNode(!1)))return e===Wl.Forwards?{positions:fA(e,a).concat([o]),breakType:_E.Br,breakAt:_.some(o)}:{positions:fA(e,a),breakType:_E.Br,breakAt:_.some(o)};if(o.isVisible()){if(t(u,o)){var c=mA(n,e,u,o);return{positions:fA(e,a),breakType:c,breakAt:_.some(o)}}a.push(o),u=o}else u=o}return{positions:fA(e,a),breakType:_E.Eol,breakAt:_.none()}},hA=function(t,e,n,r){return e(n,r).breakAt.map((function(r){var o=e(n,r).positions;return t===Wl.Backwards?o.concat(r):[r].concat(o)})).getOr([])},pA=function(t,e){return tt(t,(function(t,n){return t.fold((function(){return _.some(n)}),(function(r){return qs(ft(r.getClientRects()),ft(n.getClientRects()),(function(t,o){var i=Math.abs(e-t.left),u=Math.abs(e-o.left);return u<=i?n:r})).or(t)}))}),_.none())},vA=function(t,e){return ft(e.getClientRects()).bind((function(e){return pA(t,e.left)}))},bA=y(gA,jl.isAbove,-1),yA=y(gA,jl.isBelow,1),wA=function(t,e){return bA(t,e).breakAt.isNone()},xA=function(t,e){return yA(t,e).breakAt.isNone()},CA=y(hA,-1,bA),SA=y(hA,1,yA),kA=function(t){return tg(t).map((function(e){return[e].concat(yA(t,e).positions)})).getOr([])},OA=function(t){return eg(t).map((function(e){return bA(t,e).positions.concat(e)})).getOr([])},TA=function(t){var e=function(e){return K(e,(function(e){return e=Xs(e),e.node=t,e}))};if(_r(t))return e(t.getClientRects());if(Ir(t)){var n=t.ownerDocument.createRange();return n.setStart(t,0),n.setEnd(t,t.data.length),e(n.getClientRects())}},EA=function(t){return it(t,TA)};(function(t){t[t["Up"]=-1]="Up",t[t["Down"]=1]="Down"})(lA||(lA={}));var _A,AA,DA=function(t,e,n,r){while(r=dm(r,t,Cl,e))if(n(r))return},NA=function(t,e,n,r,o,i){var u=0,a=[],c=function(r){var i,c,l;for(l=EA([r]),-1===t&&(l=l.reverse()),i=0;i<l.length;i++)if(c=l[i],!n(c,s)){if(a.length>0&&e(c,Pt(a))&&u++,c.line=u,o(c))return!0;a.push(c)}},s=Pt(i.getClientRects());if(!s)return a;var l=i.getNode();return c(l),DA(t,r,c,l),a},RA=function(t,e){return e.line>t},MA=function(t,e){return e.line===t},zA=y(NA,lA.Up,Zs,tl),BA=y(NA,lA.Down,tl,Zs),PA=function(t,e,n,r){var o,i,u,a,c,s=Fm(e),l=[],f=0,d=function(t){return Pt(t.getClientRects())};1===t?(o=s.next,i=tl,u=Zs,a=ql.after(r)):(o=s.prev,i=Zs,u=tl,a=ql.before(r));var m=d(a);do{if(a.isVisible()&&(c=d(a),!u(c,m))){if(l.length>0&&i(c,Pt(l))&&f++,c=Xs(c),c.position=a,c.line=f,n(c))return l;l.push(c)}}while(a=o(a));return l},HA=function(t){return function(e){return RA(t,e)}},IA=function(t){return function(e){return MA(t,e)}},LA=Wr,FA=dm,VA=function(t,e){return Math.abs(t.left-e)},UA=function(t,e){return Math.abs(t.right-e)},jA=function(t,e){return t>=e.left&&t<=e.right},WA=function(t,e){return t>=e.top&&t<=e.bottom},qA=function(t,e){return zt(t,(function(t,n){var r=Math.min(VA(t,e),UA(t,e)),o=Math.min(VA(n,e),UA(n,e));return jA(e,n)?n:jA(e,t)?t:o===r&&LA(n.node)||o<r?n:t}))},$A=function(t,e,n,r,o){var i=FA(r,t,Cl,e,!o);do{if(!i||n(i))return}while(i=FA(i,t,Cl,e))},GA=function(t,e,n){void 0===n&&(n=!0);var r=[],o=function(t,n){var o=Q(EA([n]),(function(n){return!t(n,e)}));return r=r.concat(o),0===o.length};return r.push(e),$A(lA.Up,t,y(o,Zs),e.node,n),$A(lA.Down,t,y(o,tl),e.node,n),r},KA=function(t){return Q(mt(t.getElementsByTagName("*")),nm)},XA=function(t,e){return{node:t.node,before:VA(t,e)<UA(t,e)}},YA=function(t,e,n){var r=EA(KA(t)),o=Q(r,y(WA,n)),i=qA(o,e);if(i){var u=!Br(i.node);if(i=qA(GA(t,i,u),e),i&&nm(i.node))return XA(i,e)}return null},JA=jr,QA=Wr,ZA=function(t,e,n,r,o){return e._selectionOverrides.showCaret(t,n,r,o)},tD=function(t){var e=t.ownerDocument.createRange();return e.selectNode(t),e},eD=function(t,e){var n=t.fire("BeforeObjectSelected",{target:e});return n.isDefaultPrevented()?null:tD(e)},nD=function(t,e,n){var r=xm(1,t.getBody(),e),o=ql.fromRangeStart(r),i=o.getNode();if(QA(i))return ZA(1,t,i,!o.isAtEnd(),!1);var u=o.getNode(!0);if(QA(u))return ZA(1,t,u,!1,!1);var a=t.dom.getParent(o.getNode(),(function(t){return QA(t)||JA(t)}));return QA(a)?ZA(1,t,a,!1,n):null},rD=function(t,e,n){if(!e||!e.collapsed)return e;var r=nD(t,e,n);return r||e},oD=Wr,iD=nl,uD=function(t,e,n,r){var o=t===Wl.Forwards,i=o?xp:Cp;if(!r.collapsed){var u=iD(r);if(oD(u))return ZA(t,e,u,t===Wl.Backwards,!0)}var a=js(r),c=Sm(t,e.getBody(),r);if(i(c))return eD(e,c.getNode(!o));var s=__(o,n(c));if(!s)return a?r:null;if(i(s))return ZA(t,e,s.getNode(!o),o,!0);var l=n(s);return l&&i(l)&&Em(s,l)?ZA(t,e,l.getNode(!o),o,!0):a?rD(e,s.toRange(),!0):null},aD=function(t,e,n,r){var o,i,u,a;a=iD(r);var c=Sm(t,e.getBody(),r),s=n(e.getBody(),HA(1),c),l=Q(s,IA(1)),f=Pt(c.getClientRects());if((xp(c)||yp(c))&&(a=c.getNode()),(Cp(c)||wp(c))&&(a=c.getNode(!0)),!f)return null;var d=f.left;if(o=qA(l,d),o&&oD(o.node))return i=Math.abs(d-o.left),u=Math.abs(d-o.right),ZA(t,e,o.node,i<u,!0);if(a){var m=PA(t,e.getBody(),HA(1),a);if(o=qA(Q(m,IA(1)),d),o)return rD(e,o.position.toRange(),!0);if(o=Pt(Q(m,IA(0))),o)return rD(e,o.position.toRange(),!0)}},cD=function(t){var e=t.dom.create(Hf(t));return(!je.ie||je.ie>=11)&&(e.innerHTML='<br data-mce-bogus="1">'),e},sD=function(t,e,n){var r,o,i,u=Fm(t.getBody()),a=y(Tm,u.next),c=y(Tm,u.prev);if(n.collapsed&&_d(t)){if(r=t.dom.getParent(n.startContainer,"PRE"),!r)return;o=1===e?a(ql.fromRangeStart(n)):c(ql.fromRangeStart(n)),o||(i=cD(t),1===e?t.$(r).after(i):t.$(r).before(i),t.selection.select(i,!0),t.selection.collapse())}},lD=function(t,e){var n,r=Fm(t.getBody()),o=y(Tm,r.next),i=y(Tm,r.prev),u=e?Wl.Forwards:Wl.Backwards,a=e?o:i,c=t.selection.getRng();return n=uD(u,t,a,c),n||(n=sD(t,u,c),n||null)},fD=function(t,e){var n,r=e?1:-1,o=e?BA:zA,i=t.selection.getRng();return n=aD(r,t,o,i),n||(n=sD(t,r,i),n||null)},dD=function(t,e){return function(){var n=lD(t,e);return!!n&&(t.selection.setRng(n),!0)}},mD=function(t,e){return function(){var n=fD(t,e);return!!n&&(t.selection.setRng(n),!0)}},gD=function(t){return function(e){return t?Cp(e):xp(e)}},hD=function(t,e){return function(){var n=e?ql.fromRangeEnd(t.selection.getRng()):ql.fromRangeStart(t.selection.getRng()),r=e?yA(t.getBody(),n):bA(t.getBody(),n),o=e?dt(r.positions):ft(r.positions);return o.filter(gD(e)).fold(v(!1),(function(e){return t.selection.setRng(e.toRange()),!0}))}},pD=function(t,e){return{left:t.left-e,top:t.top-e,right:t.right+2*e,bottom:t.bottom+2*e,width:t.width+e,height:t.height+e}},vD=function(t,e){return it(e,(function(e){var n=pD(Xs(e.getBoundingClientRect()),-1);return[{x:n.left,y:t(n),cell:e},{x:n.right,y:t(n),cell:e}]}))},bD=function(t,e,n){return tt(t,(function(t,r){return t.fold((function(){return _.some(r)}),(function(t){var o=Math.sqrt(Math.abs(t.x-e)+Math.abs(t.y-n)),i=Math.sqrt(Math.abs(r.x-e)+Math.abs(r.y-n));return _.some(i<o?r:t)}))}),_.none())},yD=function(t,e,n,r,o){var i=Jc(sn.fromDom(n),"td,th,caption").map((function(t){return t.dom()})),u=Q(vD(t,i),(function(t){return e(t,o)}));return bD(u,r,o).map((function(t){return t.cell}))},wD=function(t){return t.bottom},xD=function(t){return t.top},CD=function(t,e){return t.y<e},SD=function(t,e){return t.y>e},kD=y(yD,wD,CD),OD=y(yD,xD,SD),TD=function(t,e){return ft(e.getClientRects()).bind((function(e){return kD(t,e.left,e.top)})).bind((function(t){return vA(OA(t),e)}))},ED=function(t,e){return dt(e.getClientRects()).bind((function(e){return OD(t,e.left,e.top)})).bind((function(t){return vA(kA(t),e)}))},_D=function(t,e){t.selection.setRng(e),AO(t,e)},AD=function(t,e,n){return n.breakAt.map((function(n){return t(e,n).breakAt.isSome()})).getOr(!1)},DD=function(t){return t.breakType===_E.Wrap&&0===t.positions.length},ND=function(t){return t.breakType===_E.Br&&1===t.positions.length},RD=function(t,e,n){var r=t(e,n);return DD(r)||!Ur(n.getNode())&&ND(r)?!AD(t,e,r):r.breakAt.isNone()},MD=y(RD,bA),zD=y(RD,yA),BD=function(t,e,n){var r=ql.fromRangeStart(e);return Jm(!t,n).map((function(t){return t.isEqual(r)})).getOr(!1)},PD=function(t,e,n,r){var o=t.selection.getRng(),i=e?1:-1;if(em()&&BD(e,o,n)){var u=ZA(i,t,n,!e,!0);return _D(t,u),!0}return!1},HD=function(t,e,n){return TD(e,n).orThunk((function(){return ft(n.getClientRects()).bind((function(n){return pA(CA(t,ql.before(e)),n.left)}))})).getOr(ql.before(e))},ID=function(t,e,n){return ED(e,n).orThunk((function(){return ft(n.getClientRects()).bind((function(n){return pA(SA(t,ql.after(e)),n.left)}))})).getOr(ql.after(e))},LD=function(t,e){var n=e.getNode(t);return _r(n)&&"TABLE"===n.nodeName?_.some(n):_.none()},FD=function(t,e,n,r){var o=Hf(e);o?e.undoManager.transact((function(){var r=sn.fromTag(o);Kr(r,If(e)),ur(r,sn.fromTag("br")),t?or(sn.fromDom(n),r):rr(sn.fromDom(n),r);var i=e.dom.createRng();i.setStart(r.dom(),0),i.setEnd(r.dom(),0),_D(e,i)})):_D(e,r.toRange())},VD=function(t,e,n){var r=LD(!!e,n),o=!1===e;r.fold((function(){return _D(t,n.toRange())}),(function(r){return Jm(o,t.getBody()).filter((function(t){return t.isEqual(n)})).fold((function(){return _D(t,n.toRange())}),(function(o){return FD(e,t,r,n)}))}))},UD=function(t,e,n,r){var o=t.selection.getRng(),i=ql.fromRangeStart(o),u=t.getBody();if(!e&&MD(r,i)){var a=HD(u,n,i);return VD(t,e,a),!0}if(e&&zD(r,i)){a=ID(u,n,i);return VD(t,e,a),!0}return!1},jD=function(t,e){return function(){return _.from(t.dom.getParent(t.selection.getNode(),"td,th")).bind((function(n){return _.from(t.dom.getParent(n,"table")).map((function(n){return PD(t,e,n)}))})).getOr(!1)}},WD=function(t,e){return function(){return _.from(t.dom.getParent(t.selection.getNode(),"td,th")).bind((function(n){return _.from(t.dom.getParent(n,"table")).map((function(r){return UD(t,e,r,n)}))})).getOr(!1)}},qD=function(t){return $(["figcaption"],hn(t))},$D=function(t){var e=n.document.createRange();return e.setStartBefore(t.dom()),e.setEndBefore(t.dom()),e},GD=function(t,e,n){n?ur(t,e):ir(t,e)},KD=function(t,e){var n=sn.fromTag("br");return GD(t,n,e),$D(n)},XD=function(t,e,n,r){var o=sn.fromTag(n),i=sn.fromTag("br");return Kr(o,r),ur(o,i),GD(t,o,e),$D(i)},YD=function(t,e,n,r){return""===e?KD(t,r):XD(t,r,e,n)},JD=function(t,e){var n=y(Nn,e);return ts(sn.fromDom(t.container()),Co,n).filter(qD)},QD=function(t,e,n){return e?xA(t.dom(),n):wA(t.dom(),n)},ZD=function(t,e){var n=sn.fromDom(t.getBody()),r=ql.fromRangeStart(t.selection.getRng()),o=Hf(t),i=If(t);return JD(r,n).exists((function(){if(QD(n,e,r)){var u=YD(n,o,i,e);return t.selection.setRng(u),!0}return!1}))},tN=function(t,e){return function(){return!!t.selection.isCollapsed()&&ZD(t,e)}},eN=function(t){return K(t,(function(t){return Ht({shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0,action:g},t)}))},nN=function(t,e){return e.keyCode===t.keyCode&&e.shiftKey===t.shiftKey&&e.altKey===t.altKey&&e.ctrlKey===t.ctrlKey&&e.metaKey===t.metaKey},rN=function(t,e){return it(eN(t),(function(t){return nN(t,e)?[t]:[]}))},oN=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){return t.apply(null,e)}},iN=function(t,e){return nt(rN(t,e),(function(t){return t.action()}))},uN=function(t,e,n){var r=ze().os;iN([{keyCode:fT.RIGHT,action:dD(t,!0)},{keyCode:fT.LEFT,action:dD(t,!1)},{keyCode:fT.UP,action:mD(t,!1)},{keyCode:fT.DOWN,action:mD(t,!0)},{keyCode:fT.RIGHT,action:jD(t,!0)},{keyCode:fT.LEFT,action:jD(t,!1)},{keyCode:fT.UP,action:WD(t,!1)},{keyCode:fT.DOWN,action:WD(t,!0)},{keyCode:fT.RIGHT,action:iA(t,e,!0)},{keyCode:fT.LEFT,action:iA(t,e,!1)},{keyCode:fT.RIGHT,ctrlKey:!r.isOSX(),altKey:r.isOSX(),action:cA(t,e)},{keyCode:fT.LEFT,ctrlKey:!r.isOSX(),altKey:r.isOSX(),action:sA(t,e)},{keyCode:fT.UP,action:tN(t,!1)},{keyCode:fT.DOWN,action:tN(t,!0)}],n).each((function(t){n.preventDefault()}))},aN=function(t,e){t.on("keydown",(function(n){!1===n.isDefaultPrevented()&&uN(t,e,n)}))},cN=function(t){return function(e){return Nn(t,sn.fromDom(e.dom().parentNode))}},sN=function(t,e){return zn(t,e)?ts(e,(function(t){return To(t)||_o(t)}),cN(t)):_.none()},lN=function(t){var e=t.getBody(),n=e.firstChild&&t.dom.isBlock(e.firstChild)?e.firstChild:e;t.selection.setCursorLocation(n,0)},fN=function(t){t.dom.isEmpty(t.getBody())&&(t.setContent(""),lN(t))},dN=function(t,e,n){return qs(tg(n),eg(n),(function(r,o){var i=__(!0,r),u=__(!1,o),a=__(!1,e);return t?Qm(n,a).map((function(t){return t.isEqual(u)&&e.isEqual(i)})).getOr(!1):Zm(n,a).map((function(t){return t.isEqual(i)&&e.isEqual(u)})).getOr(!1)})).getOr(!0)},mN=function(t,e){return{block:t,position:e}},gN=function(t,e){return{from:t,to:e}},hN=function(t,e){var n=sn.fromDom(t),r=sn.fromDom(e.container());return sN(n,r).map((function(t){return mN(t,e)}))},pN=function(t){return!1===Nn(t.from.block,t.to.block)},vN=function(t){return Ln(t.from.block).bind((function(e){return Ln(t.to.block).filter((function(t){return Nn(e,t)}))})).isSome()},bN=function(t){return!1===Wr(t.from.block.dom())&&!1===Wr(t.to.block.dom())},yN=function(t,e,n){return Ur(n.position.getNode())&&!1===Rp(n.block)?Jm(!1,n.block.dom()).bind((function(r){return r.isEqual(n.position)?Km(e,t,r).bind((function(e){return hN(t,e)})):_.some(n)})).getOr(n):n},wN=function(t,e,n){var r=hN(t,ql.fromRangeStart(n)),o=r.bind((function(n){return Km(e,t,n.position).bind((function(n){return hN(t,n).map((function(n){return yN(t,e,n)}))}))}));return qs(r,o,gN).filter((function(t){return pN(t)&&vN(t)&&bN(t)}))},xN=function(t,e,n){return n.collapsed?wN(t,e,n):_.none()},CN=function(t){var e=$n(t);return rt(e,Co).fold((function(){return e}),(function(t){return e.slice(0,t)}))},SN=function(t){var e=CN(t);return X(e,fr),e},kN=function(t,e){var n=Fp(e,t);return nt(n.reverse(),(function(t){return Rp(t)})).each(fr)},ON=function(t){return 0===Q(Wn(t),(function(t){return!Rp(t)})).length},TN=function(t,e,n,r){if(Rp(n))return Bp(n),tg(n.dom());ON(r)&&Rp(e)&&rr(r,sn.fromTag("br"));var o=Zm(n.dom(),ql.before(r.dom()));return X(SN(e),(function(t){rr(r,t)})),kN(t,e),o},EN=function(t,e,n){if(Rp(n))return fr(n),Rp(e)&&Bp(e),tg(e.dom());var r=eg(n.dom());return X(SN(e),(function(t){ur(n,t)})),kN(t,e),r},_N=function(t,e){var n=Fp(e,t);return _.from(n[n.length-1])},AN=function(t,e){return zn(e,t)?_N(e,t):_.none()},DN=function(t,e){Jm(t,e.dom()).map((function(t){return t.getNode()})).map(sn.fromDom).filter(Oo).each(fr)},NN=function(t,e,n){return DN(!0,e),DN(!1,n),AN(e,n).fold(y(EN,t,e,n),y(TN,t,e,n))},RN=function(t,e,n,r){return e?NN(t,r,n):NN(t,n,r)},MN=function(t,e){var n=sn.fromDom(t.getBody()),r=xN(n.dom(),e,t.selection.getRng()).bind((function(t){return RN(n,e,t.from.block,t.to.block)}));return r.each((function(e){t.selection.setRng(e.toRange())})),r.isSome()},zN=function(t,e){var n=e.getRng();return qs(sN(t,sn.fromDom(n.startContainer)),sN(t,sn.fromDom(n.endContainer)),(function(r,o){return!1===Nn(r,o)&&(n.deleteContents(),RN(t,!0,r,o).each((function(t){e.setRng(t.toRange())})),!0)})).getOr(!1)},BN=function(t,e){var n=sn.fromDom(e),r=y(Nn,t);return Zc(n,No,r).isSome()},PN=function(t,e){return BN(t,e.startContainer)||BN(t,e.endContainer)},HN=function(t,e){var n=Zm(t.dom(),ql.fromRangeStart(e)).isNone(),r=Qm(t.dom(),ql.fromRangeEnd(e)).isNone();return!PN(t,e)&&n&&r},IN=function(t){return t.setContent(""),t.selection.setCursorLocation(),!0},LN=function(t){var e=sn.fromDom(t.getBody()),n=t.selection.getRng();return HN(e,n)?IN(t):zN(e,t.selection)},FN=function(t,e){return!t.selection.isCollapsed()&&LN(t)},VN=function(t){return km(t).exists(Oo)},UN=function(t,e,n){var r=Q(Fp(sn.fromDom(n.container()),e),Co),o=ft(r).getOr(e);return Km(t,o.dom(),n).filter(VN)},jN=function(t,e){return km(e).exists(Oo)||UN(!0,t,e).isSome()},WN=function(t,e){return Om(e).exists(Oo)||UN(!1,t,e).isSome()},qN=y(UN,!1),$N=y(UN,!0),GN=function(t){return No(sn.fromDom(t))||_o(sn.fromDom(t))},KN=ja.generate([{remove:["element"]},{moveToElement:["element"]},{moveToPosition:["position"]}]),XN=function(t,e){var n=e.getNode(!1===t),r=t?"after":"before";return _r(n)&&n.getAttribute("data-mce-caret")===r},YN=function(t,e,n,r){var o=function(e){return ko(sn.fromDom(e))&&!gm(n,r,t)};return Cm(!e,n).fold((function(){return Cm(e,r).fold(v(!1),o)}),o)},JN=function(t,e,n,r){var o=r.getNode(!1===e);return sN(sn.fromDom(t),sn.fromDom(n.getNode())).map((function(t){return Rp(t)?KN.remove(t.dom()):KN.moveToElement(o)})).orThunk((function(){return _.some(KN.moveToElement(o))}))},QN=function(t,e,n){return Km(e,t,n).bind((function(r){return GN(r.getNode())||YN(t,e,n,r)?_.none():e&&Wr(r.getNode())||!1===e&&Wr(r.getNode(!0))?JN(t,e,n,r):e&&Cp(n)||!1===e&&xp(n)?_.some(KN.moveToPosition(r)):_.none()}))},ZN=function(t,e){return t&&Wr(e.nextSibling)?_.some(KN.moveToElement(e.nextSibling)):!1===t&&Wr(e.previousSibling)?_.some(KN.moveToElement(e.previousSibling)):_.none()},tR=function(t,e,n){return n.fold((function(t){return _.some(KN.remove(t))}),(function(t){return _.some(KN.moveToElement(t))}),(function(n){return gm(e,n,t)?_.none():_.some(KN.moveToPosition(n))}))},eR=function(t,e,n){return XN(e,n)?ZN(e,n.getNode(!1===e)).fold((function(){return QN(t,e,n)}),_.some):QN(t,e,n).bind((function(e){return tR(t,n,e)}))},nR=function(t,e,n){var r=xm(e?1:-1,t,n),o=ql.fromRangeStart(r),i=sn.fromDom(t);return!1===e&&Cp(o)?_.some(KN.remove(o.getNode(!0))):e&&xp(o)?_.some(KN.remove(o.getNode())):!1===e&&xp(o)&&WN(i,o)?qN(i,o).map((function(t){return KN.remove(t.getNode())})):e&&Cp(o)&&jN(i,o)?$N(i,o).map((function(t){return KN.remove(t.getNode())})):eR(t,e,o)},rR=function(t,e){return function(n){return t._selectionOverrides.hideFakeCaret(),lv(t,e,sn.fromDom(n)),!0}},oR=function(t,e){return function(n){var r=e?ql.before(n):ql.after(n);return t.selection.setRng(r.toRange()),!0}},iR=function(t){return function(e){return t.selection.setRng(e.toRange()),!0}},uR=function(t,e){return _.from(lR(t.getBody(),e))},aR=function(t,e){var n=t.selection.getNode();return uR(t,n).filter(Wr).fold((function(){var n=nR(t.getBody(),e,t.selection.getRng()).map((function(n){return n.fold(rR(t,e),oR(t,e),iR(t))}));return n.getOr(!1)}),(function(){return!0}))},cR=function(t){X(Jc(t,".mce-offscreen-selection"),fr)},sR=function(t,e){var n=t.selection.getNode();if(Wr(n)){var r=uR(t,n.parentNode).filter(Wr);return r.fold((function(){return cR(sn.fromDom(t.getBody())),lv(t,e,sn.fromDom(t.selection.getNode())),fN(t),!0}),(function(){return!0}))}return!1},lR=function(t,e){while(e&&e!==t){if(jr(e)||Wr(e))return e;e=e.parentNode}return null},fR=function(t){var e,n=lR(t.getBody(),t.selection.getNode());return jr(n)&&t.dom.isBlock(n)&&t.dom.isEmpty(n)&&(e=t.dom.create("br",{"data-mce-bogus":"1"}),t.dom.setHTML(n,""),n.appendChild(e),t.selection.setRng(ql.before(e).toRange())),!0},dR=function(t,e){return t.selection.isCollapsed()?aR(t,e):sR(t,e)},mR=function(t,e){Ir(e)&&0===e.data.length&&t.remove(e)},gR=function(t,e,n,r,o,i){var u=ZA(r,t,i.getNode(!o),o,!0);if(e.collapsed){var a=e.cloneRange();o?a.setEnd(u.startContainer,u.startOffset):a.setStart(u.endContainer,u.endOffset),a.deleteContents()}else e.deleteContents();return t.selection.setRng(u),mR(t.dom,n),!0},hR=function(t,e){var n=t.selection.getRng();if(!Ir(n.commonAncestorContainer))return!1;var r=e?Wl.Forwards:Wl.Backwards,o=Fm(t.getBody()),i=y(Tm,o.next),u=y(Tm,o.prev),a=e?i:u,c=e?xp:Cp,s=Sm(r,t.getBody(),n),l=__(e,a(s));if(!l||!Em(s,l))return!1;if(c(l))return gR(t,n,s.getNode(),r,e,l);var f=a(l);return!!(f&&c(f)&&Em(l,f))&&gR(t,n,s.getNode(),r,e,f)},pR=function(t,e){return hR(t,e)},vR=function(t,e){var r=n.document.createRange();return r.setStart(t.container(),t.offset()),r.setEnd(e.container(),e.offset()),r},bR=function(t){return qs(tg(t),eg(t),(function(e,n){var r=__(!0,e),o=__(!1,n);return Qm(t,r).map((function(t){return t.isEqual(o)})).getOr(!0)})).getOr(!0)},yR=function(t,e){return function(n){return y_(e,n).map((function(e){return Q_(t,e),!0})).getOr(!1)}},wR=function(t,e,n,r){var o=t.getBody(),i=y(C_,t);t.undoManager.ignore((function(){t.selection.setRng(vR(n,r)),t.execCommand("Delete"),V_(i,o,ql.fromRangeStart(t.selection.getRng())).map(q_).map(yR(t,e))})),t.nodeChanged()},xR=function(t,e){var n=mm(e,t);return n||t},CR=function(t,e,n,r){var o=xR(t.getBody(),r.container()),i=y(C_,t),u=V_(i,o,r);return u.bind((function(t){return n?t.fold(v(_.some(q_(t))),_.none,v(_.some(W_(t))),_.none):t.fold(_.none,v(_.some(W_(t))),_.none,v(_.some(q_(t))))})).map(yR(t,e)).getOrThunk((function(){var a=Xm(n,o,r),c=a.bind((function(t){return V_(i,o,t)}));return u.isSome()&&c.isSome()?O_(i,o,r).map((function(e){return!!bR(e)&&(lv(t,n,sn.fromDom(e)),!0)})).getOr(!1):c.bind((function(o){return a.map((function(o){return n?wR(t,e,r,o):wR(t,e,o,r),!0}))})).getOr(!1)}))},SR=function(t,e,n){if(t.selection.isCollapsed()&&vd(t)){var r=ql.fromRangeStart(t.selection.getRng());return CR(t,e,n,r)}return!1},kR=function(t,e){var n=Fp(e,t);return rt(n,Co).fold(v(n),(function(t){return n.slice(0,t)}))},OR=function(t){return 1===$n(t).length},TR=function(t,e,n,r){var o=y(Fw,e),i=K(Q(r,o),(function(t){return t.dom()}));if(0===i.length)lv(e,t,n);else{var u=Lw(n.dom(),i);e.selection.setRng(u.toRange())}},ER=function(t,e){var n=sn.fromDom(t.getBody()),r=sn.fromDom(t.selection.getStart()),o=Q(kR(n,r),OR);return dt(o).map((function(n){var r=ql.fromRangeStart(t.selection.getRng());return!(!dN(e,r,n.dom())||Vw(n))&&(TR(e,t,n,o),!0)})).getOr(!1)},_R=function(t,e){return!!t.selection.isCollapsed()&&ER(t,e)},AR=function(t,e){var n=ql.fromRangeStart(t.selection.getRng());return Km(e,t.getBody(),n).filter((function(t){return e?vp(t):bp(t)})).bind((function(t){return _.from(hm(e?0:-1,t))})).map((function(e){return t.selection.select(e),!0})).getOr(!1)},DR=function(t,e){return!!t.selection.isCollapsed()&&AR(t,e)},NR=function(t){return ts(t,(function(t){return jr(t.dom())||Wr(t.dom())})).exists((function(t){return jr(t.dom())}))},RR=function(t){var e=parseInt(t,10);return isNaN(e)?0:e},MR=function(t,e){var n=t||So(e)?"margin":"padding",r="rtl"===to(e,"direction")?"-right":"-left";return n+r},zR=function(t,e,n,r,o,i){var u=MR(n,sn.fromDom(i));if("outdent"===e){var a=Math.max(0,RR(i.style[u])-r);t.setStyle(i,u,a?a+o:"")}else{a=RR(i.style[u])+r+o;t.setStyle(i,u,a)}},BR=function(t,e){return ut(e,(function(e){var n=MR(id(t),e),r=no(e,n).map(RR).getOr(0),o=t.dom.getContentEditable(e.dom());return"false"!==o&&r>0}))},PR=function(t){var e=LR(t);return!t.mode.isReadOnly()&&(e.length>1||BR(t,e))},HR=function(t){return Eo(t)||_o(t)},IR=function(t){return Ln(t).map(HR).getOr(!1)},LR=function(t){return Q(K(t.selection.getSelectedBlocks(),sn.fromDom),(function(t){return!HR(t)&&!IR(t)&&NR(t)}))},FR=function(t,e){var n=t.dom,r=t.selection,o=t.formatter,i=ud(t),u=/[a-z%]+$/i.exec(i)[0],a=parseInt(i,10),c=id(t),s=Hf(t);t.queryCommandState("InsertUnorderedList")||t.queryCommandState("InsertOrderedList")||""!==s||n.getParent(r.getNode(),n.isBlock)||o.apply("div"),X(LR(t),(function(t){zR(n,e,c,a,u,t.dom())}))},VR=function(t,e,n){return Ym(t,e,n,mp)},UR=function(t,e){return nt(Fp(sn.fromDom(e.container()),t),Co)},jR=function(t,e,n){return VR(t,e.dom(),n).forall((function(t){return UR(e,n).fold((function(){return!1===gm(t,n,e.dom())}),(function(r){return!1===gm(t,n,e.dom())&&zn(r,sn.fromDom(t.container()))}))}))},WR=function(t,e,n){return UR(e,n).fold((function(){return VR(t,e.dom(),n).forall((function(t){return!1===gm(t,n,e.dom())}))}),(function(e){return VR(t,e.dom(),n).isNone()}))},qR=y(WR,!1),$R=y(WR,!0),GR=y(jR,!1),KR=y(jR,!0),XR=function(t,e,n){if(t.selection.isCollapsed()&&PR(t)){var r=t.dom,o=t.selection.getRng(),i=ql.fromRangeStart(o),u=r.getParent(o.startContainer,r.isBlock);if(null!==u&&qR(sn.fromDom(u),i))return FR(t,"outdent"),!0}return!1},YR=function(t,e,n){iN([{keyCode:fT.BACKSPACE,action:oN(XR,t,!1)},{keyCode:fT.BACKSPACE,action:oN(dR,t,!1)},{keyCode:fT.DELETE,action:oN(dR,t,!0)},{keyCode:fT.BACKSPACE,action:oN(pR,t,!1)},{keyCode:fT.DELETE,action:oN(pR,t,!0)},{keyCode:fT.BACKSPACE,action:oN(SR,t,e,!1)},{keyCode:fT.DELETE,action:oN(SR,t,e,!0)},{keyCode:fT.BACKSPACE,action:oN(Zv,t,!1)},{keyCode:fT.DELETE,action:oN(Zv,t,!0)},{keyCode:fT.BACKSPACE,action:oN(DR,t,!1)},{keyCode:fT.DELETE,action:oN(DR,t,!0)},{keyCode:fT.BACKSPACE,action:oN(FN,t,!1)},{keyCode:fT.DELETE,action:oN(FN,t,!0)},{keyCode:fT.BACKSPACE,action:oN(MN,t,!1)},{keyCode:fT.DELETE,action:oN(MN,t,!0)},{keyCode:fT.BACKSPACE,action:oN(_R,t,!1)},{keyCode:fT.DELETE,action:oN(_R,t,!0)}],n).each((function(t){n.preventDefault()}))},JR=function(t,e){iN([{keyCode:fT.BACKSPACE,action:oN(fR,t)},{keyCode:fT.DELETE,action:oN(fR,t)}],e)},QR=function(t,e){t.on("keydown",(function(n){!1===n.isDefaultPrevented()&&YR(t,e,n)})),t.on("keyup",(function(e){!1===e.isDefaultPrevented()&&JR(t,e)}))},ZR=function(t){while(t){if(1===t.nodeType||3===t.nodeType&&t.data&&/[\r\n\s]/.test(t.data))return t;t=t.nextSibling}},tM=function(t,e){var n,r=e,o=t.dom,i=t.schema.getMoveCaretBeforeOnEnterElements();if(e){if(/^(LI|DT|DD)$/.test(e.nodeName)){var u=ZR(e.firstChild);u&&/^(UL|OL|DL)$/.test(u.nodeName)&&e.insertBefore(o.doc.createTextNode(Di),e.firstChild)}var a=o.createRng();if(e.normalize(),e.hasChildNodes()){var c=new Sa(e,e);while(n=c.current()){if(Ir(n)){a.setStart(n,0),a.setEnd(n,0);break}if(i[n.nodeName.toLowerCase()]){a.setStartBefore(n),a.setEndBefore(n);break}r=n,n=c.next()}n||(a.setStart(r,0),a.setEnd(r,0))}else Ur(e)?e.nextSibling&&o.isBlock(e.nextSibling)?(a.setStartBefore(e),a.setEndBefore(e)):(a.setStartAfter(e),a.setEndAfter(e)):(a.setStart(e,0),a.setEnd(e,0));t.selection.setRng(a),AO(t,a)}},eM=function(t,e){var n,r,o=t.getRoot();n=e;while(n!==o&&"false"!==t.getContentEditable(n))"true"===t.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},nM=function(t){return _.from(t.dom.getParent(t.selection.getStart(!0),t.dom.isBlock))},rM=function(t){return nM(t).fold(v(""),(function(t){return t.nodeName.toUpperCase()}))},oM=function(t){return nM(t).filter((function(t){return _o(sn.fromDom(t))})).isSome()},iM=function(t,e){return t.firstChild&&t.firstChild.nodeName===e},uM=function(t,e){return t&&t.parentNode&&t.parentNode.nodeName===e},aM=function(t){return t&&/^(OL|UL|LI)$/.test(t.nodeName)},cM=function(t){return aM(t)&&aM(t.parentNode)},sM=function(t){var e=t.parentNode;return/^(LI|DT|DD)$/.test(e.nodeName)?e:t},lM=function(t,e,n){var r=t[n?"firstChild":"lastChild"];while(r){if(_r(r))break;r=r[n?"nextSibling":"previousSibling"]}return r===e},fM=function(t,e,n,r,o){var i=t.dom,u=t.selection.getRng();if(n!==t.getBody()){cM(n)&&(o="LI");var a=o?e(o):i.create("BR");if(lM(n,r,!0)&&lM(n,r,!1))uM(n,"LI")?i.insertAfter(a,sM(n)):i.replace(a,n);else if(lM(n,r,!0))uM(n,"LI")?(i.insertAfter(a,sM(n)),a.appendChild(i.doc.createTextNode(" ")),a.appendChild(n)):n.parentNode.insertBefore(a,n);else if(lM(n,r,!1))i.insertAfter(a,sM(n));else{n=sM(n);var c=u.cloneRange();c.setStartAfter(r),c.setEndAfter(n);var s=c.extractContents();"LI"===o&&iM(s,"LI")?(a=s.firstChild,i.insertAfter(s,n)):(i.insertAfter(s,n),i.insertAfter(a,n))}i.remove(r),tM(t,a)}},dM=function(t){X(Yc(sn.fromDom(t),wn),(function(t){var e=t.dom();e.nodeValue=Es(e.nodeValue)}))},mM=function(t,e){return e&&"A"===e.nodeName&&t.isEmpty(e)},gM=function(t){return t&&/^(TD|TH|CAPTION)$/.test(t.nodeName)},hM=function(t){t.innerHTML='<br data-mce-bogus="1">'},pM=function(t,e){return t.nodeName===e||t.previousSibling&&t.previousSibling.nodeName===e},vM=function(t,e){return e&&t.isBlock(e)&&!/^(TD|TH|CAPTION|FORM)$/.test(e.nodeName)&&!/^(fixed|absolute)/i.test(e.style.position)&&"true"!==t.getContentEditable(e)},bM=function(t,e,n){var r,o=n,i=[];if(o){while(o=o.firstChild){if(t.isBlock(o))return;_r(o)&&!e[o.nodeName.toLowerCase()]&&i.push(o)}r=i.length;while(r--)o=i[r],(!o.hasChildNodes()||o.firstChild===o.lastChild&&""===o.firstChild.nodeValue||mM(t,o))&&t.remove(o)}},yM=function(t,e,n){return!1===Ir(e)?n:t?1===n&&e.data.charAt(n-1)===Os?0:n:n===e.data.length-1&&e.data.charAt(n)===Os?e.data.length:n},wM=function(t){var e=t.cloneRange();return e.setStart(t.startContainer,yM(!0,t.startContainer,t.startOffset)),e.setEnd(t.endContainer,yM(!1,t.endContainer,t.endOffset)),e},xM=function(t){do{Ir(t)&&(t.nodeValue=t.nodeValue.replace(/^[\r\n]+/,"")),t=t.firstChild}while(t)},CM=function(t,e){var n,r,o=t.getRoot();n=e;while(n!==o&&"false"!==t.getContentEditable(n))"true"===t.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},SM=function(t,e,n){_.from(n.style).map(t.dom.parseStyle).each((function(n){var r=ro(sn.fromDom(e)),o=Ht(Ht({},r),n);t.dom.setStyles(e,o)}));var r=_.from(n.class).map((function(t){return t.split(/\s+/)})),o=_.from(e.className).map((function(t){return Q(t.split(/\s+/),(function(t){return""!==t}))}));qs(r,o,(function(n,r){var o=Q(r,(function(t){return!$(n,t)})),i=Lt(n,o);t.dom.setAttrib(e,"class",i.join(" "))}));var i=["style","class"],u=Ct(n,(function(t,e){return!$(i,e)}));t.dom.setAttribs(e,u)},kM=function(t,e){var n=Hf(t);if(n&&n.toLowerCase()===e.tagName.toLowerCase()){var r=If(t);SM(t,e,r)}},OM=function(t,e,n,r,o){var i,u,a,c,s,l,f=e||"P",d=t.dom,m=CM(d,r);if(u=d.getParent(r,d.isBlock),!u||!vM(d,u)){if(u=u||m,l=u===t.getBody()||gM(u)?u.nodeName.toLowerCase():u.parentNode.nodeName.toLowerCase(),!u.hasChildNodes())return i=d.create(f),kM(t,i),u.appendChild(i),n.setStart(i,0),n.setEnd(i,0),i;c=r;while(c.parentNode!==u)c=c.parentNode;while(c&&!d.isBlock(c))a=c,c=c.previousSibling;if(a&&t.schema.isValidChild(l,f.toLowerCase())){i=d.create(f),kM(t,i),a.parentNode.insertBefore(i,a),c=a;while(c&&!d.isBlock(c))s=c.nextSibling,i.appendChild(c),c=s;n.setStart(r,o),n.setEnd(r,o)}}return r},TM=function(t,e){e.normalize();var n=e.lastChild;n&&!/^(left|right)$/gi.test(t.getStyle(n,"float",!0))||t.add(e,"br")},EM=function(t,e){var n,r,o,i,u,a,c,s,l,f,d=t.dom,m=t.schema,g=m.getNonEmptyElements(),h=t.selection.getRng(),p=function(e){var n,o,u,a=r,c=m.getTextInlineElements();if(n=e||"TABLE"===s||"HR"===s?d.create(e||l):i.cloneNode(!1),u=n,!1===Vf(t))d.setAttrib(n,"style",null),d.setAttrib(n,"class",null);else do{if(c[a.nodeName]){if(rg(a)||Og(a))continue;o=a.cloneNode(!1),d.setAttrib(o,"id",""),n.hasChildNodes()?(o.appendChild(n.firstChild),n.appendChild(o)):(u=o,n.appendChild(o))}}while((a=a.parentNode)&&a!==x);return kM(t,n),hM(u),n},v=function(t){var e,n,u=yM(t,r,o);if(Ir(r)&&(t?u>0:u<r.nodeValue.length))return!1;if(r.parentNode===i&&f&&!t)return!0;if(t&&_r(r)&&r===i.firstChild)return!0;if(pM(r,"TABLE")||pM(r,"HR"))return f&&!t||!f&&t;var a=new Sa(r,i);Ir(r)&&(t&&0===u?a.prev():t||u!==r.nodeValue.length||a.next());while(e=a.current()){if(_r(e)){if(!e.getAttribute("data-mce-bogus")&&(n=e.nodeName.toLowerCase(),g[n]&&"br"!==n))return!1}else if(Ir(e)&&!/^[ \t\r\n]*$/.test(e.nodeValue))return!1;t?a.prev():a.next()}return!0},b=function(){u=/^(H[1-6]|PRE|FIGURE)$/.test(s)&&"HGROUP"!==C?p(l):p(),Uf(t)&&vM(d,c)&&d.isEmpty(i)?u=d.split(c,i):d.insertAfter(u,i),tM(t,u)};eT(d,h).each((function(t){h.setStart(t.startContainer,t.startOffset),h.setEnd(t.endContainer,t.endOffset)})),r=h.startContainer,o=h.startOffset,l=Hf(t);var y=!(!e||!e.shiftKey),w=!(!e||!e.ctrlKey);_r(r)&&r.hasChildNodes()&&(f=o>r.childNodes.length-1,r=r.childNodes[Math.min(o,r.childNodes.length-1)]||r,o=f&&Ir(r)?r.nodeValue.length:0);var x=CM(d,r);if(x){(l&&!y||!l&&y)&&(r=OM(t,l,h,r,o)),i=d.getParent(r,d.isBlock),c=i?d.getParent(i.parentNode,d.isBlock):null,s=i?i.nodeName.toUpperCase():"";var C=c?c.nodeName.toUpperCase():"";"LI"!==C||w||(i=c,c=c.parentNode,s=C),/^(LI|DT|DD)$/.test(s)&&d.isEmpty(i)?fM(t,p,c,i,l):l&&i===t.getBody()||(l=l||"P",Ds(i)?(u=Us(i),d.isEmpty(i)&&hM(i),kM(t,u),tM(t,u)):v()?b():v(!0)?(u=i.parentNode.insertBefore(p(),i),tM(t,pM(i,"HR")?u:i)):(n=wM(h).cloneRange(),n.setEndAfter(i),a=n.extractContents(),dM(a),xM(a),u=a.firstChild,d.insertAfter(a,i),bM(d,g,u),TM(d,i),d.isEmpty(i)&&hM(i),u.normalize(),d.isEmpty(u)?(d.remove(u),b()):(kM(t,u),tM(t,u))),d.setAttrib(u,"id",""),t.fire("NewBlock",{newBlock:u}))}},_M=function(t,e,n){var r,o=new Sa(e,n),i=t.getNonEmptyElements();while(r=o.next())if(i[r.nodeName.toLowerCase()]||r.length>0)return!0},AM=function(t,e,n){var r=t.create("span",{}," ");n.parentNode.insertBefore(r,n),e.scrollIntoView(r),t.remove(r)},DM=function(t,e,n,r){var o=t.createRng();r?(o.setStartBefore(n),o.setEndBefore(n)):(o.setStartAfter(n),o.setEndAfter(n)),e.setRng(o)},NM=function(t,e){var n,r,o=t.selection,i=t.dom,u=o.getRng();eT(i,u).each((function(t){u.setStart(t.startContainer,t.startOffset),u.setEnd(t.endContainer,t.endOffset)}));var a=u.startOffset,c=u.startContainer;if(1===c.nodeType&&c.hasChildNodes()){var s=a>c.childNodes.length-1;c=c.childNodes[Math.min(a,c.childNodes.length-1)]||c,a=s&&3===c.nodeType?c.nodeValue.length:0}var l=i.getParent(c,i.isBlock),f=l?i.getParent(l.parentNode,i.isBlock):null,d=f?f.nodeName.toUpperCase():"",m=!(!e||!e.ctrlKey);"LI"!==d||m||(l=f),c&&3===c.nodeType&&a>=c.nodeValue.length&&(_M(t.schema,c,l)||(n=i.create("br"),u.insertNode(n),u.setStartAfter(n),u.setEndAfter(n),r=!0)),n=i.create("br"),Xl(i,u,n),AM(i,o,n),DM(i,o,n,r),t.undoManager.add()},RM=function(t,e){var n=sn.fromTag("br");rr(sn.fromDom(e),n),t.undoManager.add()},MM=function(t,e){BM(t.getBody(),e)||or(sn.fromDom(e),sn.fromTag("br"));var n=sn.fromTag("br");or(sn.fromDom(e),n),AM(t.dom,t.selection,n.dom()),DM(t.dom,t.selection,n.dom(),!1),t.undoManager.add()},zM=function(t){return Ur(t.getNode())},BM=function(t,e){return!!zM(ql.after(e))||Qm(t,ql.after(e)).map((function(t){return Ur(t.getNode())})).getOr(!1)},PM=function(t){return t&&"A"===t.nodeName&&"href"in t},HM=function(t){return t.fold(v(!1),PM,PM,v(!1))},IM=function(t){var e=y(C_,t),n=ql.fromRangeStart(t.selection.getRng());return V_(e,t.getBody(),n).filter(HM)},LM=function(t,e){e.fold(g,y(RM,t),y(MM,t),g)},FM=function(t,e){var n=IM(t);n.isSome()?n.each(y(LM,t)):NM(t,e)},VM=function(t,e){return nM(t).filter((function(t){return e.length>0&&En(sn.fromDom(t),e)})).isSome()},UM=function(t){return VM(t,Lf(t))},jM=function(t){return VM(t,Ff(t))},WM=ja.generate([{br:[]},{block:[]},{none:[]}]),qM=function(t,e){return jM(t)},$M=function(t){return function(e,n){var r=""===Hf(e);return r===t}},GM=function(t){return function(e,n){return oM(e)===t}},KM=function(t,e){return function(n,r){var o=rM(n)===t.toUpperCase();return o===e}},XM=function(t){return KM("pre",t)},YM=function(){return KM("summary",!0)},JM=function(t){return function(e,n){return Pf(e)===t}},QM=function(t,e){return UM(t)},ZM=function(t,e){return e},tz=function(t){var e=Hf(t),n=eM(t.dom,t.selection.getStart());return n&&t.schema.isValidChild(n.nodeName,e||"P")},ez=function(t,e){return function(n,r){var o=tt(t,(function(t,e){return t&&e(n,r)}),!0);return o?_.some(e):_.none()}},nz=function(t,e){return N_([ez([qM],WM.none()),ez([YM()],WM.br()),ez([XM(!0),JM(!1),ZM],WM.br()),ez([XM(!0),JM(!1)],WM.block()),ez([XM(!0),JM(!0),ZM],WM.block()),ez([XM(!0),JM(!0)],WM.br()),ez([GM(!0),ZM],WM.br()),ez([GM(!0)],WM.block()),ez([$M(!0),ZM,tz],WM.block()),ez([$M(!0)],WM.br()),ez([QM],WM.br()),ez([$M(!1),ZM],WM.br()),ez([tz],WM.block())],[t,!(!e||!e.shiftKey)]).getOr(WM.none())},rz=function(t,e){nz(t,e).fold((function(){FM(t,e)}),(function(){EM(t,e)}),g)},oz=function(t,e){e.isDefaultPrevented()||(e.preventDefault(),PC(t.undoManager),t.undoManager.transact((function(){!1===t.selection.isCollapsed()&&t.execCommand("Delete"),rz(t,e)})))},iz=function(t){t.on("keydown",(function(e){e.keyCode===fT.ENTER&&oz(t,e)}))},uz=function(t,e){var n=e.container(),r=e.offset();return Ir(n)?(n.insertData(r,t),_.some(jl(n,r+t.length))):km(e).map((function(n){var r=sn.fromText(t);return e.isAtEnd()?or(n,r):rr(n,r),jl(r.dom(),t.length)}))},az=y(uz,Di),cz=y(uz," "),sz=function(t){return jl.isTextPosition(t)&&!t.isAtStart()&&!t.isAtEnd()},lz=function(t,e){var n=Q(Fp(sn.fromDom(e.container()),t),Co);return ft(n).getOr(t)},fz=function(t,e){return sz(e)?dp(e):dp(e)||Zm(lz(t,e).dom(),e).exists(dp)},dz=function(t,e){return sz(e)?fp(e):fp(e)||Qm(lz(t,e).dom(),e).exists(fp)},mz=function(t){return $(["pre","pre-wrap"],t)},gz=function(t){return km(t).bind((function(t){return ts(t,yn)})).exists((function(t){return mz(to(t,"white-space"))}))},hz=function(t,e){return Zm(t.dom(),e).isNone()},pz=function(t,e){return Qm(t.dom(),e).isNone()},vz=function(t,e){return hz(t,e)||pz(t,e)||qR(t,e)||$R(t,e)||WN(t,e)||jN(t,e)},bz=function(t,e){return!gz(e)&&(vz(t,e)||fz(t,e)||dz(t,e))},yz=function(t,e){return!gz(e)&&(qR(t,e)||GR(t,e)||WN(t,e)||fz(t,e))},wz=function(t){var e=t.container(),n=t.offset();return Ir(e)&&n<e.data.length?jl(e,n+1):t},xz=function(t,e){var n=wz(e);return!gz(n)&&($R(t,n)||KR(t,n)||jN(t,n)||dz(t,n))},Cz=function(t,e){return yz(t,e)||xz(t,e)},Sz=function(t,e){return Eg(t.charAt(e))},kz=function(t){var e=t.container();return Ir(e)&&ye(e.data,Di)},Oz=function(t){var e=t.split("");return K(e,(function(t,n){return Eg(t)&&n>0&&n<e.length-1&&Ag(e[n-1])&&Ag(e[n+1])?" ":t})).join("")},Tz=function(t,e){var n=e.data,r=jl(e,0);return!(!Sz(n,0)||Cz(t,r))&&(e.data=" "+n.slice(1),!0)},Ez=function(t){var e=t.data,n=Oz(e);return n!==e&&(t.data=n,!0)},_z=function(t,e){var n=e.data,r=jl(e,n.length-1);return!(!Sz(n,n.length-1)||Cz(t,r))&&(e.data=n.slice(0,-1)+" ",!0)},Az=function(t,e){return _.some(e).filter(kz).bind((function(e){var n=e.container(),r=Tz(t,n)||Ez(n)||_z(t,n);return r?_.some(e):_.none()}))},Dz=function(t){var e=sn.fromDom(t.getBody());t.selection.isCollapsed()&&Az(e,jl.fromRangeStart(t.selection.getRng())).each((function(e){t.selection.setRng(e.toRange())}))},Nz=function(t){return function(e){return e.fold((function(e){return Zm(t.dom(),ql.before(e))}),(function(t){return tg(t)}),(function(t){return eg(t)}),(function(e){return Qm(t.dom(),ql.after(e))}))}},Rz=function(t,e){return function(n){return bz(t,n)?az(e):cz(e)}},Mz=function(t){return function(e){return t.selection.setRng(e.toRange()),t.nodeChanged(),!0}},zz=function(t){var e=ql.fromRangeStart(t.selection.getRng()),n=sn.fromDom(t.getBody());if(t.selection.isCollapsed()){var r=y(C_,t),o=ql.fromRangeStart(t.selection.getRng());return V_(r,t.getBody(),o).bind(Nz(n)).bind(Rz(n,e)).exists(Mz(t))}return!1},Bz=function(t,e){iN([{keyCode:fT.SPACEBAR,action:oN(zz,t)}],e).each((function(t){e.preventDefault()}))},Pz=function(t){t.on("keydown",(function(e){!1===e.isDefaultPrevented()&&Bz(t,e)}))},Hz=function(t){return ns(sn.fromDom(t.getBody()),"*[data-mce-caret]").fold(v(null),(function(t){return t.dom()}))},Iz=function(t){t.selection.setRng(t.selection.getRng())},Lz=function(t,e){e.hasAttribute("data-mce-caret")&&(Us(e),Iz(t),t.selection.scrollIntoView(e))},Fz=function(t,e){var n=Hz(t);if(n)return"compositionstart"===e.type?(e.preventDefault(),e.stopPropagation(),void Lz(t,n)):void(Ms(n)&&(Lz(t,n),t.undoManager.add()))},Vz=function(t){t.on("keyup compositionstart",y(Fz,t))},Uz=ze().browser,jz=function(t){var e=Hc((function(){t.composing||Dz(t)}),0);Uz.isIE()&&(t.on("keypress",(function(t){e.throttle()})),t.on("remove",(function(t){e.cancel()})))},Wz=function(t){jz(t),t.on("input",(function(e){!1===e.isComposing&&Dz(t)}))},qz=function(t,e){iN([{keyCode:fT.END,action:hD(t,!0)},{keyCode:fT.HOME,action:hD(t,!1)}],e).each((function(t){e.preventDefault()}))},$z=function(t){t.on("keydown",(function(e){!1===e.isDefaultPrevented()&&qz(t,e)}))},Gz=function(t){var e=aA(t);Vz(t),aN(t,e),QR(t,e),iz(t),Pz(t),Wz(t),$z(t)},Kz=function(t){ZC(t)||Gz(t)},Xz=function(){function t(t){var e;this.lastPath=[],this.editor=t;var n=this;"onselectionchange"in t.getDoc()||t.on("NodeChange click mouseup keyup focus",(function(n){var r=t.selection.getRng(),o={startContainer:r.startContainer,startOffset:r.startOffset,endContainer:r.endContainer,endOffset:r.endOffset};"nodechange"!==n.type&&jO(o,e)||t.fire("SelectionChange"),e=o})),t.on("contextmenu",(function(){t.fire("SelectionChange")})),t.on("SelectionChange",(function(){var e=t.selection.getStart(!0);!e||!je.range&&t.selection.isCollapsed()||Ch(t)&&!n.isSameElementPath(e)&&t.dom.isChildOf(e,t.getBody())&&t.nodeChanged({selectionChange:!0})})),t.on("mouseup",(function(e){!e.isDefaultPrevented()&&Ch(t)&&("IMG"===t.selection.getNode().nodeName?Za.setEditorTimeout(t,(function(){t.nodeChanged()})):t.nodeChanged())}))}return t.prototype.nodeChanged=function(t){var e,n,r,o=this.editor.selection;this.editor.initialized&&o&&!Dd(this.editor)&&!this.editor.mode.isReadOnly()&&(r=this.editor.getBody(),e=o.getStart(!0)||r,e.ownerDocument===this.editor.getDoc()&&this.editor.dom.isChildOf(e,r)||(e=r),n=[],this.editor.dom.getParent(e,(function(t){if(t===r)return!0;n.push(t)})),t=t||{},t.element=e,t.parents=n,this.editor.fire("NodeChange",t))},t.prototype.isSameElementPath=function(t){var e,n=this.editor.$(t).parentsUntil(this.editor.getBody()).add(t);if(n.length===this.lastPath.length){for(e=n.length;e>=0;e--)if(n[e]!==this.lastPath[e])break;if(-1===e)return this.lastPath=n,!0}return this.lastPath=n,!1},t}(),Yz=function(t){t.on("click",(function(e){t.dom.getParent(e.target,"details")&&e.preventDefault()}))},Jz=function(t){t.parser.addNodeFilter("details",(function(t){X(t,(function(t){t.attr("data-mce-open",t.attr("open")),t.attr("open","open")}))})),t.serializer.addNodeFilter("details",(function(t){X(t,(function(t){var e=t.attr("data-mce-open");t.attr("open",M(e)?e:null),t.attr("data-mce-open",null)}))}))},Qz=function(t){Yz(t),Jz(t)},Zz=function(t){return _r(t)&&To(sn.fromDom(t))},tB=function(t){var e=t.selection.getRng(),n=jl.fromRangeStart(e),r=jl.fromRangeEnd(e);if(jl.isElementPosition(n)){var o=n.container();Zz(o)&&tg(o).each((function(t){return e.setStart(t.container(),t.offset())}))}if(jl.isElementPosition(r)){o=n.container();Zz(o)&&eg(o).each((function(t){return e.setEnd(t.container(),t.offset())}))}t.selection.setRng(nb(e))},eB=function(t){t.on("click",(function(e){e.detail>=3&&tB(t)}))},nB=function(t){var e=t.getBoundingClientRect(),n=t.ownerDocument,r=n.documentElement,o=n.defaultView;return{top:e.top+o.pageYOffset-r.clientTop,left:e.left+o.pageXOffset-r.clientLeft}},rB=function(t){return t.inline?nB(t.getBody()):{left:0,top:0}},oB=function(t){var e=t.getBody();return t.inline?{left:e.scrollLeft,top:e.scrollTop}:{left:0,top:0}},iB=function(t){var e=t.getBody(),n=t.getDoc().documentElement,r={left:e.scrollLeft,top:e.scrollTop},o={left:e.scrollLeft||n.scrollLeft,top:e.scrollTop||n.scrollTop};return t.inline?r:o},uB=function(t,e){if(e.target.ownerDocument!==t.getDoc()){var n=nB(t.getContentAreaContainer()),r=iB(t);return{left:e.pageX-n.left+r.left,top:e.pageY-n.top+r.top}}return{left:e.pageX,top:e.pageY}},aB=function(t,e,n){return{pageX:n.left-t.left+e.left,pageY:n.top-t.top+e.top}},cB=function(t,e){return aB(rB(t),oB(t),uB(t,e))},sB=Wr,lB=jr,fB=function(t,e){return sB(e)&&e!==t},dB=function(t,e,n){return e!==n&&!t.dom.isChildOf(e,n)&&!sB(e)},mB=function(t){var e=t.cloneNode(!0);return e.removeAttribute("data-mce-selected"),e},gB=function(t,e,n,r){var o=e.cloneNode(!0);t.dom.setStyles(o,{width:n,height:r}),t.dom.setAttrib(o,"data-mce-selected",null);var i=t.dom.create("div",{class:"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return t.dom.setStyles(i,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:n,height:r}),t.dom.setStyles(o,{margin:0,boxSizing:"border-box"}),i.appendChild(o),i},hB=function(t,e){t.parentNode!==e&&e.appendChild(t)},pB=function(t,e,n,r,o,i){var u=0,a=0;t.style.left=e.pageX+"px",t.style.top=e.pageY+"px",e.pageX+n>o&&(u=e.pageX+n-o),e.pageY+r>i&&(a=e.pageY+r-i),t.style.width=n-u+"px",t.style.height=r-a+"px"},vB=function(t){t&&t.parentNode&&t.parentNode.removeChild(t)},bB=function(t){return 0===t.button},yB=function(t){return t.element},wB=function(t,e){return{pageX:e.pageX-t.relX,pageY:e.pageY+5}},xB=function(t,e){return function(n){if(bB(n)){var r=nt(e.dom.getParents(n.target),ul(sB,lB)).getOr(null);if(fB(e.getBody(),r)){var o=e.dom.getPos(r),i=e.getBody(),u=e.getDoc().documentElement;t.element=r,t.screenX=n.screenX,t.screenY=n.screenY,t.maxX=(e.inline?i.scrollWidth:u.offsetWidth)-2,t.maxY=(e.inline?i.scrollHeight:u.offsetHeight)-2,t.relX=n.pageX-o.x,t.relY=n.pageY-o.y,t.width=r.offsetWidth,t.height=r.offsetHeight,t.ghost=gB(e,r,t.width,t.height)}}}},CB=function(t,e){var n=Za.throttle((function(t,n){e._selectionOverrides.hideFakeCaret(),e.selection.placeCaretAt(t,n)}),0);return function(r){var o=Math.max(Math.abs(r.screenX-t.screenX),Math.abs(r.screenY-t.screenY));if(yB(t)&&!t.dragging&&o>10){var i=e.fire("dragstart",{target:t.element});if(i.isDefaultPrevented())return;t.dragging=!0,e.focus()}if(t.dragging){var u=wB(t,cB(e,r));hB(t.ghost,e.getBody()),pB(t.ghost,u,t.width,t.height,t.maxX,t.maxY),n(r.clientX,r.clientY)}}},SB=function(t){var e=t.getSel().getRangeAt(0),n=e.startContainer;return 3===n.nodeType?n.parentNode:n},kB=function(t,e){return function(n){if(t.dragging&&dB(e,SB(e.selection),t.element)){var r=mB(t.element),o=e.fire("drop",{targetClone:r,clientX:n.clientX,clientY:n.clientY});o.isDefaultPrevented()||(r=o.targetClone,e.undoManager.transact((function(){vB(t.element),e.insertContent(e.dom.getOuterHTML(r)),e._selectionOverrides.hideFakeCaret()})))}TB(t)}},OB=function(t,e){return function(){t.dragging&&e.fire("dragend"),TB(t)}},TB=function(t){t.dragging=!1,t.element=null,vB(t.ghost)},EB=function(t){var e={},r=dc.DOM,o=n.document,i=xB(e,t),u=CB(e,t),a=kB(e,t),c=OB(e,t);t.on("mousedown",i),t.on("mousemove",u),t.on("mouseup",a),r.bind(o,"mousemove",u),r.bind(o,"mouseup",c),t.on("remove",(function(){r.unbind(o,"mousemove",u),r.unbind(o,"mouseup",c)}))},_B=function(t){t.on("drop",(function(e){var n="undefined"!==typeof e.clientX?t.getDoc().elementFromPoint(e.clientX,e.clientY):null;(sB(n)||sB(t.dom.getContentEditableParent(n)))&&e.preventDefault()}))},AB=function(t){var e=function(t){if(!t.defaultPrevented){var e=t.dataTransfer;e&&($(e.types,"Files")||e.files.length>0)&&t.preventDefault()}},r=function(n){zy(t,n.target)&&e(n)},o=function(){var o=dc.DOM,i=t.dom,u=n.document,a=t.inline?t.getBody():t.getDoc(),c=["drop","dragover"];X(c,(function(t){o.bind(u,t,r),i.bind(a,t,e)})),t.on("remove",(function(){X(c,(function(t){o.unbind(u,t,r),i.unbind(a,t,e)}))}))};t.on("init",(function(){Za.setEditorTimeout(t,o,0)}))},DB=function(t){EB(t),_B(t),Bd(t)&&AB(t)},NB=function(t){var e=Hc((function(){if(!t.removed&&t.getBody().contains(n.document.activeElement)){var e=t.selection.getRng();if(e.collapsed){var r=rD(t,t.selection.getRng(),!1);t.selection.setRng(r)}}}),0);t.on("focus",(function(){e.throttle()})),t.on("blur",(function(){e.cancel()}))},RB=jr,MB=Wr,zB=function(t,e){var n=t.getBody();while(e&&e!==n){if(RB(e)||MB(e))return e;e=e.parentNode}return null},BB=function(t){var e,n=function(e){return t.dom.isBlock(e)},r=t.getBody(),o=tm(t,r,n,(function(){return Ky(t)})),i="sel-"+t.dom.uniqueId(),u=function(e){return t.dom.hasClass(e,"mce-offscreen-selection")},a=function(){var e=t.dom.get(i);return e?e.getElementsByTagName("*")[0]:e},c=function(e){e&&t.selection.setRng(e)},s=function(){return t.selection.getRng()},l=function(e,n,r,i){void 0===i&&(i=!0);var u=t.fire("ShowCaret",{target:n,direction:e,before:r});return u.isDefaultPrevented()?null:(i&&t.selection.scrollIntoView(n,-1===e),o.show(r,n))},f=function(e){e.hasAttribute("data-mce-caret")&&(Us(e),c(s()),t.selection.scrollIntoView(e))},d=function(){t.on("mouseup",(function(e){var n=s();n.collapsed&&Nk(t,e.clientX,e.clientY)&&c(nD(t,n,!1))})),t.on("click",(function(e){var n=zB(t,e.target);n&&(MB(n)&&(e.preventDefault(),t.focus()),RB(n)&&t.dom.isChildOf(n,t.selection.getNode())&&v())})),t.on("blur NewBlock",(function(){v()})),t.on("ResizeWindow FullscreenStateChanged",(function(){return o.reposition()}));var n=function(t){t.on("tap",(function(e){var n=zB(t,e.target);MB(n)&&(e.preventDefault(),p(eD(t,n)))}),!0)},i=function(t){var e=Fm(t);if(!t.firstChild)return!1;var n=ql.before(t.firstChild),r=e.next(n);return r&&!xp(r)&&!Cp(r)},f=function(e,n){var r=t.dom.getParent(e,t.dom.isBlock),o=t.dom.getParent(n,t.dom.isBlock);return r===o},d=function(e,n){var r=t.dom.getParent(e,t.dom.isBlock),o=t.dom.getParent(n,t.dom.isBlock);return!(!r||!t.dom.isChildOf(r,o)||!1!==MB(zB(t,r)))||r&&!f(r,o)&&i(r)};n(t),t.on("mousedown",(function(e){var n=e.target;if((n===r||"HTML"===n.nodeName||t.dom.isChildOf(n,r))&&!1!==Nk(t,e.clientX,e.clientY)){var o=zB(t,n);if(o)MB(o)?(e.preventDefault(),p(eD(t,o))):(v(),RB(o)&&e.shiftKey||lT(e.clientX,e.clientY,t.selection.getRng())||(y(),t.selection.placeCaretAt(e.clientX,e.clientY)));else if(!1===nm(n)){v(),y();var i=YA(r,e.clientX,e.clientY);if(i&&!d(e.target,i.node)){e.preventDefault();var u=l(1,i.node,i.before,!1);t.getBody().focus(),c(u)}}}})),t.on("keypress",(function(e){if(!fT.modifierPressed(e))switch(e.keyCode){default:MB(t.selection.getNode())&&e.preventDefault();break}})),t.on("GetSelectionRange",(function(t){var n=t.range;if(e){if(!e.parentNode)return void(e=null);n=n.cloneRange(),n.selectNode(e),t.range=n}})),t.on("SetSelectionRange",(function(t){t.range=h(t.range);var e=p(t.range,t.forward);e&&(t.range=e)}));var m=function(t){return"mcepastebin"===t.id};t.on("AfterSetSelectionRange",(function(t){var e=t.range;g(e)||m(e.startContainer.parentNode)||y(),u(e.startContainer.parentNode)||v()})),t.on("copy",(function(t){var e=t.clipboardData;if(!t.isDefaultPrevented()&&t.clipboardData&&!je.ie){var n=a();n&&(t.preventDefault(),e.clearData(),e.setData("text/html",n.outerHTML),e.setData("text/plain",n.outerText))}})),DB(t),NB(t)},m=function(t){return Rs(t)||Ls(t)||Fs(t)},g=function(t){return m(t.startContainer)||m(t.endContainer)},h=function(e){var n=t.schema.getShortEndedElements(),r=t.dom.createRng(),o=e.startContainer,i=e.startOffset,u=e.endContainer,a=e.endOffset;return Tt(n,o.nodeName.toLowerCase())?0===i?r.setStartBefore(o):r.setStartAfter(o):r.setStart(o,i),Tt(n,u.nodeName.toLowerCase())?0===a?r.setEndBefore(u):r.setEndAfter(u):r.setEnd(u,a),r},p=function(n,o){var u,a,c,s,f,d,m,h=t.$,p=t.dom;if(!n)return null;if(n.collapsed){if(!g(n))if(!1===o){if(f=Sm(-1,r,n),nm(f.getNode(!0)))return l(-1,f.getNode(!0),!1,!1);if(nm(f.getNode()))return l(-1,f.getNode(),!f.isAtEnd(),!1)}else{if(f=Sm(1,r,n),nm(f.getNode()))return l(1,f.getNode(),!f.isAtEnd(),!1);if(nm(f.getNode(!0)))return l(1,f.getNode(!0),!1,!1)}return null}c=n.startContainer,s=n.startOffset;var v=n.endOffset;if(3===c.nodeType&&0===s&&MB(c.parentNode)&&(c=c.parentNode,s=p.nodeIndex(c),c=c.parentNode),1!==c.nodeType)return null;if(v===s+1&&c===n.endContainer&&(u=c.childNodes[s]),!MB(u))return null;d=m=u.cloneNode(!0);var b=t.fire("ObjectSelected",{target:u,targetClone:d});if(b.isDefaultPrevented())return null;a=ns(sn.fromDom(t.getBody()),"#"+i).fold((function(){return h([])}),(function(t){return h([t.dom()])})),d=b.targetClone,0===a.length&&(a=h('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>').attr("id",i),a.appendTo(t.getBody())),n=t.dom.createRng(),d===m&&je.ie?(a.empty().append('<p style="font-size: 0" data-mce-bogus="all"> </p>').append(d),n.setStartAfter(a[0].firstChild.firstChild),n.setEndAfter(d)):(a.empty().append(Di).append(d).append(Di),n.setStart(a[0].firstChild,1),n.setEnd(a[0].lastChild,0)),a.css({top:p.getPos(u,t.getBody()).y}),a[0].focus();var w=t.selection.getSel();w.removeAllRanges(),w.addRange(n);var x=sn.fromDom(u);return X(Jc(sn.fromDom(t.getBody()),"*[data-mce-selected]"),(function(t){Nn(x,t)||Qr(t,"data-mce-selected")})),t.dom.getAttrib(u,"data-mce-selected")||u.setAttribute("data-mce-selected","1"),e=u,y(),n},v=function(){e&&(e.removeAttribute("data-mce-selected"),ns(sn.fromDom(t.getBody()),"#"+i).each(fr),e=null),ns(sn.fromDom(t.getBody()),"#"+i).each(fr),e=null},b=function(){o.destroy(),e=null},y=function(){o.hide()};return je.ceFalse&&d(),{showCaret:l,showBlockCaretContainer:f,hideFakeCaret:y,destroy:b}},PB=function(t){var e=nn.each,r=fT.BACKSPACE,o=fT.DELETE,i=t.dom,u=t.selection,a=t.parser,c=je.gecko,s=je.ie,l=je.webkit,f="data:text/mce-internal,",d=s?"Text":"URL",m=function(e,n){try{t.getDoc().execCommand(e,!1,n)}catch(r){}},g=function(t){return t.isDefaultPrevented()},h=function(e){var n,r;e.dataTransfer&&(t.selection.isCollapsed()&&"IMG"===e.target.tagName&&u.select(e.target),n=t.selection.getContent(),n.length>0&&(r=f+escape(t.id)+","+escape(n),e.dataTransfer.setData(d,r)))},p=function(t){var e;return t.dataTransfer&&(e=t.dataTransfer.getData(d),e&&e.indexOf(f)>=0)?(e=e.substr(f.length).split(","),{id:unescape(e[0]),html:unescape(e[1])}):null},v=function(e,n){t.queryCommandSupported("mceInsertClipboardContent")?t.execCommand("mceInsertClipboardContent",!1,{content:e,internal:n}):t.execCommand("mceInsertContent",!1,e)},b=function(){var e=function(t){var e=i.create("body"),n=t.cloneContents();return e.appendChild(n),u.serializer.serialize(e,{format:"html"})},n=function(n){var r=e(n),o=i.createRng();o.selectNode(t.getBody());var u=e(o);return r===u};t.on("keydown",(function(e){var u,a,c=e.keyCode;if(!g(e)&&(c===o||c===r)){if(u=t.selection.isCollapsed(),a=t.getBody(),u&&!i.isEmpty(a))return;if(!u&&!n(t.selection.getRng()))return;e.preventDefault(),t.setContent(""),a.firstChild&&i.isBlock(a.firstChild)?t.selection.setCursorLocation(a.firstChild,0):t.selection.setCursorLocation(a,0),t.nodeChanged()}}))},y=function(){t.shortcuts.add("meta+a",null,"SelectAll")},w=function(){t.inline||i.bind(t.getDoc(),"mousedown mouseup",(function(e){var n;if(e.target===t.getDoc().documentElement)if(n=u.getRng(),t.getBody().focus(),"mousedown"===e.type){if(Rs(n.startContainer))return;u.placeCaretAt(e.clientX,e.clientY)}else u.setRng(n)}))},x=function(){t.on("keydown",(function(e){if(!g(e)&&e.keyCode===r){if(!t.getBody().getElementsByTagName("hr").length)return;if(u.isCollapsed()&&0===u.getRng().startOffset){var n=u.getNode(),o=n.previousSibling;if("HR"===n.nodeName)return i.remove(n),void e.preventDefault();o&&o.nodeName&&"hr"===o.nodeName.toLowerCase()&&(i.remove(o),e.preventDefault())}}}))},C=function(){n.Range.prototype.getClientRects||t.on("mousedown",(function(e){if(!g(e)&&"HTML"===e.target.nodeName){var n=t.getBody();n.blur(),Za.setEditorTimeout(t,(function(){n.focus()}))}}))},S=function(){t.on("click",(function(e){var n=e.target;/^(IMG|HR)$/.test(n.nodeName)&&"false"!==i.getContentEditableParent(n)&&(e.preventDefault(),t.selection.select(n),t.nodeChanged()),"A"===n.nodeName&&i.hasClass(n,"mce-item-anchor")&&(e.preventDefault(),u.select(n))}))},k=function(){var n=function(){var n=i.getAttribs(u.getStart().cloneNode(!1));return function(){var r=u.getStart();r!==t.getBody()&&(i.setAttrib(r,"style",null),e(n,(function(t){r.setAttributeNode(t.cloneNode(!0))})))}},r=function(){return!u.isCollapsed()&&i.getParent(u.getStart(),i.isBlock)!==i.getParent(u.getEnd(),i.isBlock)};t.on("keypress",(function(e){var o;if(!g(e)&&(8===e.keyCode||46===e.keyCode)&&r())return o=n(),t.getDoc().execCommand("delete",!1,null),o(),e.preventDefault(),!1})),i.bind(t.getDoc(),"cut",(function(e){var o;!g(e)&&r()&&(o=n(),Za.setEditorTimeout(t,(function(){o()})))}))},O=function(){t.on("keydown",(function(t){if(!g(t)&&t.keyCode===r&&u.isCollapsed()&&0===u.getRng().startOffset){var e=u.getNode().previousSibling;if(e&&e.nodeName&&"table"===e.nodeName.toLowerCase())return t.preventDefault(),!1}}))},T=function(){t.on("keydown",(function(e){var n,r;if(!g(e)&&e.keyCode===fT.BACKSPACE){n=u.getRng();var o=n.startContainer,a=n.startOffset,c=i.getRoot();if(r=o,n.collapsed&&0===a){while(r&&r.parentNode&&r.parentNode.firstChild===r&&r.parentNode!==c)r=r.parentNode;"BLOCKQUOTE"===r.tagName&&(t.formatter.toggle("blockquote",null,r),n=i.createRng(),n.setStart(o,0),n.setEnd(o,0),u.setRng(n))}}}))},E=function(){var e=function(){m("StyleWithCSS",!1),m("enableInlineTableEditing",!1),ld(t)||m("enableObjectResizing",!1)};Nd(t)||t.on("BeforeExecCommand mousedown",e)},_=function(){var n=function(){e(i.select("a"),(function(t){var e=t.parentNode,n=i.getRoot();if(e.lastChild===t){while(e&&!i.isBlock(e)){if(e.parentNode.lastChild!==e||e===n)return;e=e.parentNode}i.add(e,"br",{"data-mce-bogus":1})}}))};t.on("SetContent ExecCommand",(function(t){"setcontent"!==t.type&&"mceInsertLink"!==t.command||n()}))},A=function(){Hf(t)&&t.on("init",(function(){m("DefaultParagraphSeparator",Hf(t))}))},D=function(){t.on("keyup focusin mouseup",(function(t){fT.modifierPressed(t)||u.normalize()}),!0)},N=function(){t.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")},R=function(){t.inline||t.on("keydown",(function(){n.document.activeElement===n.document.body&&t.getWin().focus()}))},M=function(){t.inline||(t.contentStyles.push("body {min-height: 150px}"),t.on("click",(function(e){var n;if("HTML"===e.target.nodeName){if(je.ie>11)return void t.getBody().focus();n=t.selection.getRng(),t.getBody().focus(),t.selection.setRng(n),t.selection.normalize(),t.nodeChanged()}})))},z=function(){je.mac&&t.on("keydown",(function(e){if(fT.metaKeyPressed(e)&&!e.shiftKey&&(37===e.keyCode||39===e.keyCode)){e.preventDefault();var n=t.selection.getSel();n.modify("move",37===e.keyCode?"backward":"forward","lineboundary")}}))},B=function(){m("AutoUrlDetect",!1)},P=function(){t.on("click",(function(t){var e=t.target;do{if("A"===e.tagName)return void t.preventDefault()}while(e=e.parentNode)})),t.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")},H=function(){t.on("init",(function(){t.dom.bind(t.getBody(),"submit",(function(t){t.preventDefault()}))}))},I=function(){a.addNodeFilter("br",(function(t){var e=t.length;while(e--)"Apple-interchange-newline"===t[e].attr("class")&&t[e].remove()}))},L=function(){t.on("dragstart",(function(t){h(t)})),t.on("drop",(function(e){if(!g(e)){var n=p(e);if(n&&n.id!==t.id){e.preventDefault();var r=zO(e.x,e.y,t.getDoc());u.setRng(r),v(n.html,!0)}}}))},F=function(){},V=function(){if(!c||t.removed)return!1;var e=t.selection.getSel();return!e||!e.rangeCount||0===e.rangeCount};return T(),b(),je.windowsPhone||D(),l&&(w(),S(),A(),H(),O(),I(),je.iOS?(R(),M(),P()):y()),je.ie>=11&&(M(),O()),je.ie&&(y(),B(),L()),c&&(x(),C(),k(),E(),_(),N(),z(),O()),{refreshContentEditable:F,isHidden:V}},HB=dc.DOM,IB=function(t,e){var n=sn.fromDom(t.getDoc().head),r=sn.fromTag("style");Gr(r,"type","text/css"),ur(r,sn.fromText(e)),ur(n,r)},LB=function(t){return t.inline?t.getElement().nodeName.toLowerCase():void 0},FB=function(t){return Ct(t,(function(t){return!1===I(t)}))},VB=function(t){var e=t.settings,n=t.editorUpload.blobCache;return FB({allow_conditional_comments:e.allow_conditional_comments,allow_html_data_urls:e.allow_html_data_urls,allow_html_in_named_anchor:e.allow_html_in_named_anchor,allow_script_urls:e.allow_script_urls,allow_unsafe_link_target:e.allow_unsafe_link_target,convert_fonts_to_spans:e.convert_fonts_to_spans,fix_list_elements:e.fix_list_elements,font_size_legacy_values:e.font_size_legacy_values,forced_root_block:e.forced_root_block,forced_root_block_attrs:e.forced_root_block_attrs,padd_empty_with_br:e.padd_empty_with_br,preserve_cdata:e.preserve_cdata,remove_trailing_brs:e.remove_trailing_brs,inline_styles:e.inline_styles,root_name:LB(t),validate:!0,blob_cache:n,images_dataimg_filter:e.images_dataimg_filter})},UB=function(t){var e=t.settings;return Ht(Ht({},VB(t)),FB({url_converter:e.url_converter,url_converter_scope:e.url_converter_scope,element_format:e.element_format,entities:e.entities,entity_encoding:e.entity_encoding,indent:e.indent,indent_after:e.indent_after,indent_before:e.indent_before,block_elements:e.block_elements,boolean_attributes:e.boolean_attributes,custom_elements:e.custom_elements,extended_valid_elements:e.extended_valid_elements,invalid_elements:e.invalid_elements,invalid_styles:e.invalid_styles,move_caret_before_on_enter_elements:e.move_caret_before_on_enter_elements,non_empty_elements:e.non_empty_elements,schema:e.schema,self_closing_elements:e.self_closing_elements,short_ended_elements:e.short_ended_elements,special:e.special,text_block_elements:e.text_block_elements,text_inline_elements:e.text_inline_elements,valid_children:e.valid_children,valid_classes:e.valid_classes,valid_elements:e.valid_elements,valid_styles:e.valid_styles,verify_html:e.verify_html,whitespace_elements:e.whitespace_elements}))},jB=function(t){var e=ZT(VB(t),t.schema);return e.addAttributeFilter("src,href,style,tabindex",(function(e,n){var r,o,i=e.length,u=t.dom,a="data-mce-"+n;while(i--)if(r=e[i],o=r.attr(n),o&&!r.attr(a)){if(0===o.indexOf("data:")||0===o.indexOf("blob:"))continue;"style"===n?(o=u.serializeStyle(u.parseStyle(o),r.name),o.length||(o=null),r.attr(a,o),r.attr(n,o)):"tabindex"===n?(r.attr(a,o),r.attr(n,null)):r.attr(a,t.convertURL(o,n,r.name))}})),e.addNodeFilter("script",(function(t){var e=t.length;while(e--){var n=t[e],r=n.attr("type")||"no/type";0!==r.indexOf("mce-")&&n.attr("type","mce-"+r)}})),t.settings.preserve_cdata&&e.addNodeFilter("#cdata",(function(e){var n=e.length;while(n--){var r=e[n];r.type=8,r.name="#comment",r.value="[CDATA["+t.dom.encode(r.value)+"]]"}})),e.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",(function(e){var n=e.length,r=t.schema.getNonEmptyElements();while(n--){var o=e[n];o.isEmpty(r)&&0===o.getAll("br").length&&(o.append(new Fh("br",1)).shortEnded=!0)}})),e},WB=function(t){t.settings.auto_focus&&Za.setEditorTimeout(t,(function(){var e;e=!0===t.settings.auto_focus?t:t.editorManager.get(t.settings.auto_focus),e.destroyed||e.focus()}),100)},qB=function(t){var e=t.dom.getRoot();t.inline||Ch(t)&&t.selection.getStart(!0)!==e||tg(e).each((function(e){var n=e.getNode(),r=Br(n)?tg(n).getOr(e):e;je.browser.isIE()?wy(t,r.toRange()):t.selection.setRng(r.toRange())}))},$B=function(t){t.bindPendingEventDelegates(),t.initialized=!0,MS(t),t.focus(!0),qB(t),t.nodeChanged({initial:!0}),t.execCallback("init_instance_callback",t),WB(t)},GB=function(t){return t.inline?HB.styleSheetLoader:t.dom.styleSheetLoader},KB=function(t,e){var n=t.settings,r=t.getDoc(),o=t.getBody();n.browser_spellcheck||n.gecko_spellcheck||(r.body.spellcheck=!1,HB.setAttrib(o,"spellcheck","false")),t.quirks=PB(t),RS(t);var i=cd(t);if(void 0!==i&&(o.dir=i),n.protect&&t.on("BeforeSetContent",(function(t){nn.each(n.protect,(function(e){t.content=t.content.replace(e,(function(t){return"\x3c!--mce:protected "+escape(t)+"--\x3e"}))}))})),t.on("SetContent",(function(){t.addVisual(t.getBody())})),!1===e&&t.load({initial:!0,format:"html"}),t.startContent=t.getContent({format:"raw"}),t.on("compositionstart compositionend",(function(e){t.composing="compositionstart"===e.type})),t.contentStyles.length>0){var u="";nn.each(t.contentStyles,(function(t){u+=t+"\r\n"})),t.dom.addStyle(u)}GB(t).loadAll(t.contentCSS,(function(e){$B(t)}),(function(e){$B(t)})),n.content_style&&IB(t,n.content_style)},XB=function(t,e){var r=t.settings,o=t.getElement(),i=t.getDoc();r.inline||(t.getElement().style.visibility=t.orgVisibility),e||t.inline||(i.open(),i.write(t.iframeHTML),i.close()),t.inline&&(HB.addClass(o,"mce-content-body"),t.contentDocument=i=n.document,t.contentWindow=n.window,t.bodyElement=o,t.contentAreaContainer=o);var u=t.getBody();u.disabled=!0,t.readonly=!!r.readonly,t.readonly||(t.inline&&"static"===HB.getStyle(u,"position",!0)&&(u.style.position="relative"),u.contentEditable=t.getParam("content_editable_state",!0)),u.disabled=!1,t.editorUpload=yE(t),t.schema=li(r),t.dom=dc(i,{keep_values:!0,url_converter:t.convertURL,url_converter_scope:t,hex_colors:r.force_hex_style_colors,update_styles:!0,root_element:t.inline?t.getBody():null,collect:function(){return t.inline},schema:t.schema,contentCssCors:ed(t),referrerPolicy:nd(t),onSetAttrib:function(e){t.fire("SetAttrib",e)}}),t.parser=jB(t),t.serializer=dE(UB(t),t),t.selection=xT(t.dom,t.getWin(),t.serializer,t),t.annotator=zh(t),t.formatter=PE(t),t.undoManager=LE(t),t._nodeChangeDispatcher=new Xz(t),t._selectionOverrides=BB(t),QE(t),Qz(t),ZC(t)||eB(t),Kz(t),o_(t),GE(t),NS(t),tS(t).fold((function(){KB(t,!1)}),(function(e){t.setProgressState(!0),e.then((function(e){t.setProgressState(!1),KB(t,e)}))}))},YB=dc.DOM,JB=function(t,e){if(n.document.domain!==n.window.location.hostname&&je.browser.isIE()){var r=vE("mce");t[r]=function(){XB(t)};var o='javascript:(function(){document.open();document.domain="'+n.document.domain+'";var ed = window.parent.tinymce.get("'+t.id+'");document.write(ed.iframeHTML);document.close();ed.'+r+"(true);})()";return YB.setAttrib(e,"src",o),!0}return!1},QB=function(t,e,n,r){var o=sn.fromTag("iframe");return Kr(o,r),Kr(o,{id:t+"_ifr",frameBorder:"0",allowTransparency:"true",title:e}),$c(o,"tox-edit-area__iframe"),o},ZB=function(t){var e=Nf(t)+"<html><head>";Rf(t)!==t.documentBaseUrl&&(e+='<base href="'+t.documentBaseURI.getURI()+'" />'),e+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';var n=Mf(t),r=zf(t);return Bf(t)&&(e+='<meta http-equiv="Content-Security-Policy" content="'+Bf(t)+'" />'),e+='</head><body id="'+n+'" class="mce-content-body '+r+'" data-id="'+t.id+'"><br></body></html>',e},tP=function(t,e){var n=t.editorManager.translate("Rich Text Area. Press ALT-0 for help."),r=QB(t.id,n,e.height,Df(t)).dom();r.onload=function(){r.onload=null,t.fire("load")};var o=JB(t,r);return t.contentAreaContainer=e.iframeContainer,t.iframeElement=r,t.iframeHTML=ZB(t),YB.add(e.iframeContainer,r),o},eP=function(t,e){var n=tP(t,e);e.editorContainer&&(YB.get(e.editorContainer).style.display=t.orgDisplay,t.hidden=YB.isHidden(e.editorContainer)),t.getElement().style.display="none",YB.setAttrib(t.id,"aria-hidden","true"),n||XB(t)},nP=dc.DOM,rP=function(t,e,n){var r=Pk.get(n),o=Pk.urls[n]||t.documentBaseUrl.replace(/\/$/,"");if(n=nn.trim(n),r&&-1===nn.inArray(e,n)){if(nn.each(Pk.dependencies(n),(function(n){rP(t,e,n)})),t.plugins[n])return;try{var i=new r(t,o,t.$);t.plugins[n]=i,i.init&&(i.init(t,o),e.push(n))}catch(XI){Kk(t,n,XI)}}},oP=function(t){return t.replace(/^\-/,"")},iP=function(t){var e=[];nn.each(Md(t).split(/[ ,]/),(function(n){rP(t,e,oP(n))}))},uP=function(t){var e=nn.trim(Xf(t)),n=t.ui.registry.getAll().icons,r=Ht(Ht({},xk.get("default").icons),xk.get(e).icons);pt(r,(function(e,r){Tt(n,r)||t.ui.registry.addIcon(r,e)}))},aP=function(t){var e=hd(t);if(M(e)){t.settings.theme=oP(e);var n=Hk.get(e);t.theme=new n(t,Hk.urls[e]),t.theme.init&&t.theme.init(t,Hk.urls[e]||t.documentBaseUrl.replace(/\/$/,""),t.$)}else t.theme={}},cP=function(t){return t.theme.renderUI()},sP=function(t){var e=t.getElement(),n=hd(t),r=n(t,e);return r.editorContainer.nodeType&&(r.editorContainer.id=r.editorContainer.id||t.id+"_parent"),r.iframeContainer&&r.iframeContainer.nodeType&&(r.iframeContainer.id=r.iframeContainer.id||t.id+"_iframecontainer"),r.height=r.iframeHeight?r.iframeHeight:e.offsetHeight,r},lP=function(t){return{editorContainer:t,iframeContainer:t}},fP=function(t){var e=nP.create("div");return nP.insertAfter(e,t),lP(e)},dP=function(t){var e=t.getElement();return t.inline?lP(null):fP(e)},mP=function(t){var e=t.getElement();return t.orgDisplay=e.style.display,M(hd(t))?cP(t):L(hd(t))?sP(t):dP(t)},gP=function(t){t.fire("ScriptsLoaded"),uP(t),aP(t),iP(t);var e=mP(t);return t.editorContainer=e.editorContainer?e.editorContainer:null,Qk(t),t.inline?XB(t):eP(t,e)},hP=dc.DOM,pP=function(t){return"-"===t.charAt(0)},vP=function(t,e){var n=rd(e),r=od(e);if(!1===zc.hasCode(n)&&"en"!==n){var o=""!==r?r:e.editorManager.baseURL+"/langs/"+n+".js";t.add(o,g,void 0,(function(){Gk(e,o,n)}))}},bP=function(t,e,n,r){var o=hd(e);if(M(o)){if(!pP(o)&&!Hk.urls.hasOwnProperty(o)){var i=xd(e);i?Hk.load(o,e.documentBaseURI.toAbsolute(i)):Hk.load(o,"themes/"+o+"/theme"+n+".js")}t.loadQueue((function(){Hk.waitFor(o,r)}))}else r()},yP=function(t){return _.from(Yf(t)).filter((function(t){return t.length>0})).map((function(t){return{url:t,name:_.none()}}))},wP=function(t,e,n){return _.from(e).filter((function(t){return t.length>0&&!xk.has(t)})).map((function(e){return{url:t.editorManager.baseURL+"/icons/"+e+"/icons"+n+".js",name:_.some(e)}}))},xP=function(t,e,n){var r=wP(e,"default",n),o=yP(e).orThunk((function(){return wP(e,Xf(e),"")}));X(Ws([r,o]),(function(n){t.add(n.url,g,void 0,(function(){$k(e,n.url,n.name.getOrUndefined())}))}))},CP=function(t,e){nn.each(zd(t),(function(e,n){Pk.load(n,e,g,void 0,(function(){qk(t,e,n)})),t.settings.plugins+=" "+n})),nn.each(Md(t).split(/[ ,]/),(function(n){if(n=nn.trim(n),n&&!Pk.urls[n])if(pP(n)){n=n.substr(1,n.length);var r=Pk.dependencies(n);nn.each(r,(function(n){var r={prefix:"plugins/",resource:n,suffix:"/plugin"+e+".js"},o=Pk.createUrl(r,n);Pk.load(o.resource,o,g,void 0,(function(){qk(t,o.prefix+o.resource+o.suffix,o.resource)}))}))}else{var o={prefix:"plugins/",resource:n,suffix:"/plugin"+e+".js"};Pk.load(n,o,g,void 0,(function(){qk(t,o.prefix+o.resource+o.suffix,n)}))}}))},SP=function(t,e){var n=wc.ScriptLoader;bP(n,t,e,(function(){vP(n,t),xP(n,t,e),CP(t,e),n.loadQueue((function(){t.removed||gP(t)}),t,(function(){t.removed||gP(t)}))}))},kP=function(t,e){return nc.forElement(t,{contentCssCors:Rd(e),referrerPolicy:nd(e)})},OP=function(t){var e=t.id;zc.setCode(rd(t));var r=function(){hP.unbind(n.window,"ready",r),t.render()};if($i.Event.domLoaded){if(t.getElement()&&je.contentEditable){var o=sn.fromDom(t.getElement()),i=Zr(o);t.on("remove",(function(){Y(o.dom().attributes,(function(t){return Qr(o,t.name)})),Kr(o,i)})),t.ui.styleSheetLoader=kP(o,t),Cd(t)?t.inline=!0:(t.orgVisibility=t.getElement().style.visibility,t.getElement().style.visibility="hidden");var u=t.getElement().form||hP.getParent(e,"form");u&&(t.formElement=u,Sd(t)&&!Hr(t.getElement())&&(hP.insertAfter(hP.create("input",{type:"hidden",name:e}),e),t.hasHiddenInput=!0),t.formEventDelegate=function(e){t.fire(e.type,e)},hP.bind(u,"submit reset",t.formEventDelegate),t.on("reset",(function(){t.resetContent()})),!kd(t)||u.submit.nodeType||u.submit.length||u._mceOldSubmit||(u._mceOldSubmit=u.submit,u.submit=function(){return t.editorManager.triggerSave(),t.setDirty(!1),u._mceOldSubmit(u)})),t.windowManager=Lk(t),t.notificationManager=Bk(t),Od(t)&&t.on("GetContent",(function(t){t.save&&(t.content=hP.encode(t.content))})),Td(t)&&t.on("submit",(function(){t.initialized&&t.save()})),Ed(t)&&(t._beforeUnload=function(){!t.initialized||t.destroyed||t.isHidden()||t.save({format:"raw",no_events:!0,set_dirty:!1})},t.editorManager.on("BeforeUnload",t._beforeUnload)),t.editorManager.add(t),SP(t,t.suffix)}}else hP.bind(n.window,"ready",r)},TP=function(t){return L(t)?t:v(!1)},EP=function(t,e,n){var r=t.dom(),o=TP(n);while(r.parentNode){r=r.parentNode;var i=sn.fromDom(r),u=e(i);if(u.isSome())return u;if(o(i))break}return _.none()},_P=function(t,e,n){var r=e(t),o=TP(n);return r.orThunk((function(){return o(t)?_.none():EP(t,e,o)}))},AP={"font-size":"size","font-family":"face"},DP=function(t,e,n){var r=function(e){return no(e,t).orThunk((function(){return"font"===hn(e)?Ot(AP,t).bind((function(t){return Yr(e,t)})):_.none()}))},o=function(t){return Nn(sn.fromDom(e),t)};return _P(sn.fromDom(n),(function(t){return r(t)}),o)},NP=function(t){return t.replace(/[\'\"\\]/g,"").replace(/,\s+/g,",")},RP=function(t,e){return _.from(dc.DOM.getStyle(e,t,!0))},MP=function(t){return function(e,n){return _.from(n).map(sn.fromDom).filter(yn).bind((function(n){return DP(t,e,n.dom()).or(RP(t,n.dom()))})).getOr("")}},zP=MP("font-size"),BP=h(NP,MP("font-family")),PP=function(t){return tg(t.getBody()).map((function(t){var e=t.container();return Ir(e)?e.parentNode:e}))},HP=function(t,e){return t.startContainer===e&&0===t.startOffset},IP=function(t){return _.from(t.selection.getRng()).bind((function(e){var n=t.getBody();return HP(e,n)?_.none():_.from(t.selection.getStart(!0))}))},LP=function(t,e){if(/^[0-9\.]+$/.test(e)){var n=parseInt(e,10);if(n>=1&&n<=7){var r=jf(t),o=Wf(t);return o?o[n-1]||e:r[n-1]||e}return e}return e},FP=function(t){var e=t.split(/\s*,\s*/);return K(e,(function(t){return-1===t.indexOf(" ")||we(t,'"')||we(t,"'")?t:"'"+t+"'"})).join(",")},VP=function(t,e){var n=LP(t,e);t.formatter.toggle("fontname",{value:FP(n)}),t.nodeChanged()},UP=function(t){return IP(t).fold((function(){return PP(t).map((function(e){return BP(t.getBody(),e)})).getOr("")}),(function(e){return BP(t.getBody(),e)}))},jP=function(t,e){t.formatter.toggle("fontsize",{value:LP(t,e)}),t.nodeChanged()},WP=function(t){return IP(t).fold((function(){return PP(t).map((function(e){return zP(t.getBody(),e)})).getOr("")}),(function(e){return zP(t.getBody(),e)}))},qP=function(t){var e;return"string"!==typeof t?(e=nn.extend({paste:t.paste,data:{paste:t.paste}},t),{content:t.content,details:e}):{content:t,details:{}}},$P=function(t,e){var n=qP(e);yS(t,n.content,n.details)},GP=function(t,e){t.getDoc().execCommand(e,!1,null)},KP=function(t){XR(t)||dR(t,!1)||pR(t,!1)||SR(t,!1)||MN(t,!1)||Zv(t)||FN(t)||_R(t,!1)||(GP(t,"Delete"),fN(t))},XP=function(t){dR(t,!0)||pR(t,!0)||SR(t,!0)||MN(t,!0)||Zv(t)||FN(t)||_R(t,!0)||GP(t,"ForwardDelete")},YP=nn.each,JP=nn.map,QP=nn.inArray,ZP=function(){function t(t){this.commands={state:{},exec:{},value:{}},this.editor=t,this.setupCommands(t)}return t.prototype.execCommand=function(t,e,n,r){var o,i=!1,u=this;if(!u.editor.removed){if(/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(t)||r&&r.skip_focus?Cy(u.editor):u.editor.focus(),r=u.editor.fire("BeforeExecCommand",{command:t,ui:e,value:n}),r.isDefaultPrevented())return!1;var a=t.toLowerCase();if(o=u.commands.exec[a])return o(a,e,n),u.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!0;if(YP(this.editor.plugins,(function(r){if(r.execCommand&&r.execCommand(t,e,n))return u.editor.fire("ExecCommand",{command:t,ui:e,value:n}),i=!0,!1})),i)return i;if(u.editor.theme&&u.editor.theme.execCommand&&u.editor.theme.execCommand(t,e,n))return u.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!0;try{i=u.editor.getDoc().execCommand(t,e,n)}catch(c){}return!!i&&(u.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!0)}},t.prototype.queryCommandState=function(t){var e;if(!this.editor.quirks.isHidden()&&!this.editor.removed){if(t=t.toLowerCase(),e=this.commands.state[t])return e(t);try{return this.editor.getDoc().queryCommandState(t)}catch(n){}return!1}},t.prototype.queryCommandValue=function(t){var e;if(!this.editor.quirks.isHidden()&&!this.editor.removed){if(t=t.toLowerCase(),e=this.commands.value[t])return e(t);try{return this.editor.getDoc().queryCommandValue(t)}catch(n){}}},t.prototype.addCommands=function(t,e){var n=this;e=e||"exec",YP(t,(function(t,r){YP(r.toLowerCase().split(","),(function(r){n.commands[e][r]=t}))}))},t.prototype.addCommand=function(t,e,n){var r=this;t=t.toLowerCase(),this.commands.exec[t]=function(t,o,i,u){return e.call(n||r.editor,o,i,u)}},t.prototype.queryCommandSupported=function(t){if(t=t.toLowerCase(),this.commands.exec[t])return!0;try{return this.editor.getDoc().queryCommandSupported(t)}catch(e){}return!1},t.prototype.addQueryStateHandler=function(t,e,n){var r=this;t=t.toLowerCase(),this.commands.state[t]=function(){return e.call(n||r.editor)}},t.prototype.addQueryValueHandler=function(t,e,n){var r=this;t=t.toLowerCase(),this.commands.value[t]=function(){return e.call(n||r.editor)}},t.prototype.hasCustomCommand=function(t){return t=t.toLowerCase(),!!this.commands.exec[t]},t.prototype.execNativeCommand=function(t,e,n){return void 0===e&&(e=!1),void 0===n&&(n=null),this.editor.getDoc().execCommand(t,e,n)},t.prototype.isFormatMatch=function(t){return this.editor.formatter.match(t)},t.prototype.toggleFormat=function(t,e){this.editor.formatter.toggle(t,e?{value:e}:void 0),this.editor.nodeChanged()},t.prototype.storeSelection=function(t){this.selectionBookmark=this.editor.selection.getBookmark(t)},t.prototype.restoreSelection=function(){this.editor.selection.moveToBookmark(this.selectionBookmark)},t.prototype.setupCommands=function(t){var e=this;this.addCommands({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){t.undoManager.add()},"Cut,Copy,Paste":function(n){var r,o=t.getDoc();try{e.execNativeCommand(n)}catch(u){r=!0}if("paste"!==n||o.queryCommandEnabled(n)||(r=!0),r||!o.queryCommandSupported(n)){var i=t.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");je.mac&&(i=i.replace(/Ctrl\+/g,"⌘+")),t.notificationManager.open({text:i,type:"error"})}},unlink:function(){if(t.selection.isCollapsed()){var e=t.dom.getParent(t.selection.getStart(),"a");e&&t.dom.remove(e,!0)}else t.formatter.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone":function(n){var r=n.substring(7);"full"===r&&(r="justify"),YP("left,center,right,justify".split(","),(function(e){r!==e&&t.formatter.remove("align"+e)})),"none"!==r&&e.toggleFormat("align"+r)},"InsertUnorderedList,InsertOrderedList":function(n){var r;e.execNativeCommand(n);var o=t.dom.getParent(t.selection.getNode(),"ol,ul");o&&(r=o.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(r.nodeName)&&(e.storeSelection(),t.dom.split(r,o),e.restoreSelection()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(t){e.toggleFormat(t)},"ForeColor,HiliteColor":function(t,n,r){e.toggleFormat(t,r)},FontName:function(e,n,r){VP(t,r)},FontSize:function(e,n,r){jP(t,r)},RemoveFormat:function(e){t.formatter.remove(e)},mceBlockQuote:function(){e.toggleFormat("blockquote")},FormatBlock:function(t,n,r){return e.toggleFormat(r||"p")},mceCleanup:function(){var e=t.selection.getBookmark();t.setContent(t.getContent()),t.selection.moveToBookmark(e)},mceRemoveNode:function(n,r,o){var i=o||t.selection.getNode();i!==t.getBody()&&(e.storeSelection(),t.dom.remove(i,!0),e.restoreSelection())},mceSelectNodeDepth:function(e,n,r){var o=0;t.dom.getParent(t.selection.getNode(),(function(e){if(1===e.nodeType&&o++===r)return t.selection.select(e),!1}),t.getBody())},mceSelectNode:function(e,n,r){t.selection.select(r)},mceInsertContent:function(e,n,r){$P(t,r)},mceInsertRawHTML:function(e,n,r){t.selection.setContent("tiny_mce_marker");var o=t.getContent();t.setContent(o.replace(/tiny_mce_marker/g,(function(){return r})))},mceInsertNewLine:function(e,n,r){rz(t,r)},mceToggleFormat:function(t,n,r){e.toggleFormat(r)},mceSetContent:function(e,n,r){t.setContent(r)},"Indent,Outdent":function(e){FR(t,e)},mceRepaint:function(){},InsertHorizontalRule:function(){t.execCommand("mceInsertContent",!1,"<hr />")},mceToggleVisualAid:function(){t.hasVisual=!t.hasVisual,t.addVisual()},mceReplaceContent:function(e,n,r){t.execCommand("mceInsertContent",!1,r.replace(/\{\$selection\}/g,t.selection.getContent({format:"text"})))},mceInsertLink:function(e,n,r){"string"===typeof r&&(r={href:r});var o=t.dom.getParent(t.selection.getNode(),"a");r.href=r.href.replace(/ /g,"%20"),o&&r.href||t.formatter.remove("link"),r.href&&t.formatter.apply("link",r,o)},selectAll:function(){var e=t.dom.getParent(t.selection.getStart(),jr);if(e){var n=t.dom.createRng();n.selectNodeContents(e),t.selection.setRng(n)}},delete:function(){KP(t)},forwardDelete:function(){XP(t)},mceNewDocument:function(){t.setContent("")},InsertLineBreak:function(e,n,r){return FM(t,r),!0}});var n=function(e){return function(){var n=t.selection.isCollapsed()?[t.dom.getParent(t.selection.getNode(),t.dom.isBlock)]:t.selection.getSelectedBlocks(),r=JP(n,(function(n){return!!t.formatter.matchNode(n,e)}));return-1!==QP(r,!0)}};e.addCommands({JustifyLeft:n("alignleft"),JustifyCenter:n("aligncenter"),JustifyRight:n("alignright"),JustifyFull:n("alignjustify"),"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(t){return e.isFormatMatch(t)},mceBlockQuote:function(){return e.isFormatMatch("blockquote")},Outdent:function(){return PR(t)},"InsertUnorderedList,InsertOrderedList":function(e){var n=t.dom.getParent(t.selection.getNode(),"ul,ol");return n&&("insertunorderedlist"===e&&"UL"===n.tagName||"insertorderedlist"===e&&"OL"===n.tagName)}},"state"),e.addCommands({Undo:function(){t.undoManager.undo()},Redo:function(){t.undoManager.redo()}}),e.addQueryValueHandler("FontName",(function(){return UP(t)}),this),e.addQueryValueHandler("FontSize",(function(){return WP(t)}),this)},t}(),tH="data-mce-contenteditable",eH=function(t,e,n){Xc(t,e)&&!1===n?Kc(t,e):n&&$c(t,e)},nH=function(t,e,n){try{t.getDoc().execCommand(e,!1,n)}catch(r){}},rH=function(t,e){t.dom().contentEditable=e?"true":"false"},oH=function(t){X(Jc(t,'*[contenteditable="true"]'),(function(t){Gr(t,tH,"true"),rH(t,!1)}))},iH=function(t){X(Jc(t,"*["+tH+'="true"]'),(function(t){Qr(t,tH),rH(t,!0)}))},uH=function(t){_.from(t.selection.getNode()).each((function(t){t.removeAttribute("data-mce-selected")}))},aH=function(t){t.selection.setRng(t.selection.getRng())},cH=function(t,e){var n=sn.fromDom(t.getBody());eH(n,"mce-content-readonly",e),e?(t.selection.controlSelection.hideResizeRect(),t._selectionOverrides.hideFakeCaret(),uH(t),t.readonly=!0,rH(n,!1),oH(n)):(t.readonly=!1,rH(n,!0),iH(n),nH(t,"StyleWithCSS",!1),nH(t,"enableInlineTableEditing",!1),nH(t,"enableObjectResizing",!1),Xy(t)&&t.focus(),aH(t),t.nodeChanged())},sH=function(t){return t.readonly},lH=function(t){t.parser.addAttributeFilter("contenteditable",(function(e){sH(t)&&X(e,(function(t){t.attr(tH,t.attr("contenteditable")),t.attr("contenteditable","false")}))})),t.serializer.addAttributeFilter(tH,(function(e){sH(t)&&X(e,(function(t){t.attr("contenteditable",t.attr(tH))}))})),t.serializer.addTempAttr(tH)},fH=function(t){t.serializer?lH(t):t.on("PreInit",(function(){lH(t)}))},dH=function(t){return"click"===t.type},mH=function(t,e){return null!==t.dom.getParent(e,"a")},gH=function(t,e){var n=e.target;dH(e)&&!fT.metaKeyPressed(e)&&mH(t,n)&&e.preventDefault()},hH=function(t){t.on("ShowCaret",(function(e){sH(t)&&e.preventDefault()})),t.on("ObjectSelected",(function(e){sH(t)&&e.preventDefault()}))},pH=nn.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input beforeinput contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchmove touchend touchcancel"," "),vH=function(){function t(t){this.bindings={},this.settings=t||{},this.scope=this.settings.scope||this,this.toggleEvent=this.settings.toggleEvent||C}return t.isNative=function(t){return!!pH[t.toLowerCase()]},t.prototype.fire=function(t,e){t=t.toLowerCase(),e=e||{},e.type=t,e.target||(e.target=this.scope),e.preventDefault||(e.preventDefault=function(){e.isDefaultPrevented=S},e.stopPropagation=function(){e.isPropagationStopped=S},e.stopImmediatePropagation=function(){e.isImmediatePropagationStopped=S},e.isDefaultPrevented=C,e.isPropagationStopped=C,e.isImmediatePropagationStopped=C),this.settings.beforeFire&&this.settings.beforeFire(e);var n=this.bindings[t];if(n)for(var r=0,o=n.length;r<o;r++){var i=n[r];if(i.once&&this.off(t,i.func),e.isImmediatePropagationStopped())return e.stopPropagation(),e;if(!1===i.func.call(this.scope,e))return e.preventDefault(),e}return e},t.prototype.on=function(t,e,n,r){var o,i,u;if(!1===e&&(e=C),e){var a={func:e};r&&nn.extend(a,r),i=t.toLowerCase().split(" "),u=i.length;while(u--)t=i[u],o=this.bindings[t],o||(o=this.bindings[t]=[],this.toggleEvent(t,!0)),n?o.unshift(a):o.push(a)}return this},t.prototype.off=function(t,e){var n,r,o,i,u=this;if(t){o=t.toLowerCase().split(" "),n=o.length;while(n--){if(t=o[n],r=this.bindings[t],!t)return pt(this.bindings,(function(t,e){u.toggleEvent(e,!1),delete u.bindings[e]})),this;if(r){if(e){i=r.length;while(i--)r[i].func===e&&(r=r.slice(0,i).concat(r.slice(i+1)),this.bindings[t]=r)}else r.length=0;r.length||(this.toggleEvent(t,!1),delete this.bindings[t])}}}else pt(this.bindings,(function(t,e){u.toggleEvent(e,!1)})),this.bindings={};return this},t.prototype.once=function(t,e,n){return this.on(t,e,n,{once:!0})},t.prototype.has=function(t){return t=t.toLowerCase(),!(!this.bindings[t]||0===this.bindings[t].length)},t}(),bH=function(t){return t._eventDispatcher||(t._eventDispatcher=new vH({scope:t,toggleEvent:function(e,n){vH.isNative(e)&&t.toggleNativeEvent&&t.toggleNativeEvent(e,n)}})),t._eventDispatcher},yH={fire:function(t,e,n){var r=this;if(r.removed&&"remove"!==t&&"detach"!==t)return e;var o=bH(r).fire(t,e);if(!1!==n&&r.parent){var i=r.parent();while(i&&!o.isPropagationStopped())i.fire(t,o,!1),i=i.parent()}return o},on:function(t,e,n){return bH(this).on(t,e,n)},off:function(t,e){return bH(this).off(t,e)},once:function(t,e){return bH(this).once(t,e)},hasEventListeners:function(t){return bH(this).has(t)}},wH=dc.DOM,xH=function(t,e){if("selectionchange"===e)return t.getDoc();if(!t.inline&&/^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(e))return t.getDoc().documentElement;var n=md(t);return n?(t.eventRoot||(t.eventRoot=wH.select(n)[0]),t.eventRoot):t.getBody()},CH=function(t){return!t.hidden&&!sH(t)},SH=function(t,e,n){CH(t)?t.fire(e,n):sH(t)&&gH(t,n)},kH=function(t,e){var n;if(t.delegates||(t.delegates={}),!t.delegates[e]&&!t.removed){var r=xH(t,e);if(md(t)){if(_A||(_A={},t.editorManager.on("removeEditor",(function(){t.editorManager.activeEditor||_A&&(pt(_A,(function(e,n){t.dom.unbind(xH(t,n))})),_A=null)}))),_A[e])return;n=function(n){var r=n.target,o=t.editorManager.get(),i=o.length;while(i--){var u=o[i].getBody();(u===r||wH.isChildOf(r,u))&&SH(o[i],e,n)}},_A[e]=n,wH.bind(r,e,n)}else n=function(n){SH(t,e,n)},wH.bind(r,e,n),t.delegates[e]=n}},OH=Ht(Ht({},yH),{bindPendingEventDelegates:function(){var t=this;nn.each(t._pendingNativeEvents,(function(e){kH(t,e)}))},toggleNativeEvent:function(t,e){var n=this;"focus"!==t&&"blur"!==t&&(e?n.initialized?kH(n,t):n._pendingNativeEvents?n._pendingNativeEvents.push(t):n._pendingNativeEvents=[t]:n.initialized&&(n.dom.unbind(xH(n,t),t,n.delegates[t]),delete n.delegates[t]))},unbindAllNativeEvents:function(){var t=this,e=t.getBody(),n=t.dom;t.delegates&&(pt(t.delegates,(function(e,n){t.dom.unbind(xH(t,n),n,e)})),delete t.delegates),!t.inline&&e&&n&&(e.onload=null,n.unbind(t.getWin()),n.unbind(t.getDoc())),n&&(n.unbind(e),n.unbind(t.getContainer()))}}),TH=["design","readonly"],EH=function(t,e,r,o){var i=r[e.get()],u=r[o];try{u.activate()}catch(XI){return void n.console.error("problem while activating editor mode "+o+":",XI)}i.deactivate(),i.editorReadOnly!==u.editorReadOnly&&cH(t,u.editorReadOnly),e.set(o),_S(t,o)},_H=function(t,e,n,r){if(r!==n.get()){if(!Tt(e,r))throw new Error("Editor mode '"+r+"' is invalid");t.initialized?EH(t,n,e,r):t.on("init",(function(){return EH(t,n,e,r)}))}},AH=function(t,e,r){var o;if($(TH,e))throw new Error("Cannot override default mode "+e);return Ht(Ht({},t),(o={},o[e]=Ht(Ht({},r),{deactivate:function(){try{r.deactivate()}catch(XI){n.console.error("problem while deactivating editor mode "+e+":",XI)}}}),o))},DH=function(t){var e=xc("design"),n=xc({design:{activate:g,deactivate:g,editorReadOnly:!1},readonly:{activate:g,deactivate:g,editorReadOnly:!0}});return fH(t),hH(t),{isReadOnly:function(){return sH(t)},set:function(r){return _H(t,n.get(),e,r)},get:function(){return e.get()},register:function(t,e){n.set(AH(n.get(),t,e))}}},NH=nn.each,RH=nn.explode,MH={f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123},zH=nn.makeMap("alt,ctrl,shift,meta,access"),BH=function(){function t(t){this.shortcuts={},this.pendingPatterns=[],this.editor=t;var e=this;t.on("keyup keypress keydown",(function(t){!e.hasModifier(t)&&!e.isFunctionKey(t)||t.isDefaultPrevented()||(NH(e.shortcuts,(function(n){if(e.matchShortcut(t,n))return e.pendingPatterns=n.subpatterns.slice(0),"keydown"===t.type&&e.executeShortcutAction(n),!0})),e.matchShortcut(t,e.pendingPatterns[0])&&(1===e.pendingPatterns.length&&"keydown"===t.type&&e.executeShortcutAction(e.pendingPatterns[0]),e.pendingPatterns.shift()))}))}return t.prototype.add=function(t,e,n,r){var o=this,i=n;return"string"===typeof i?n=function(){o.editor.execCommand(i,!1,null)}:nn.isArray(i)&&(n=function(){o.editor.execCommand(i[0],i[1],i[2])}),NH(RH(nn.trim(t)),(function(t){var i=o.createShortcut(t,e,n,r);o.shortcuts[i.id]=i})),!0},t.prototype.remove=function(t){var e=this.createShortcut(t);return!!this.shortcuts[e.id]&&(delete this.shortcuts[e.id],!0)},t.prototype.parseShortcut=function(t){var e,n={};NH(RH(t.toLowerCase(),"+"),(function(t){t in zH?n[t]=!0:/^[0-9]{2,}$/.test(t)?n.keyCode=parseInt(t,10):(n.charCode=t.charCodeAt(0),n.keyCode=MH[t]||t.toUpperCase().charCodeAt(0))}));var r=[n.keyCode];for(e in zH)n[e]?r.push(e):n[e]=!1;return n.id=r.join(","),n.access&&(n.alt=!0,je.mac?n.ctrl=!0:n.shift=!0),n.meta&&(je.mac?n.meta=!0:(n.ctrl=!0,n.meta=!1)),n},t.prototype.createShortcut=function(t,e,n,r){var o=nn.map(RH(t,">"),this.parseShortcut);return o[o.length-1]=nn.extend(o[o.length-1],{func:n,scope:r||this.editor}),nn.extend(o[0],{desc:this.editor.translate(e),subpatterns:o.slice(1)})},t.prototype.hasModifier=function(t){return t.altKey||t.ctrlKey||t.metaKey},t.prototype.isFunctionKey=function(t){return"keydown"===t.type&&t.keyCode>=112&&t.keyCode<=123},t.prototype.matchShortcut=function(t,e){return!!e&&(e.ctrl===t.ctrlKey&&e.meta===t.metaKey&&(e.alt===t.altKey&&e.shift===t.shiftKey&&(!!(t.keyCode===e.keyCode||t.charCode&&t.charCode===e.charCode)&&(t.preventDefault(),!0))))},t.prototype.executeShortcutAction=function(t){return t.func?t.func.call(t.scope):null},t}(),PH=function(){var t={},e={},n={},r={},o={},i={},u={},a=function(t,e){return function(n,r){return t[n.toLowerCase()]=Ht(Ht({},r),{type:e})}},c=function(t,e){return r[t.toLowerCase()]=e};return{addButton:a(t,"button"),addGroupToolbarButton:a(t,"grouptoolbarbutton"),addToggleButton:a(t,"togglebutton"),addMenuButton:a(t,"menubutton"),addSplitButton:a(t,"splitbutton"),addMenuItem:a(e,"menuitem"),addNestedMenuItem:a(e,"nestedmenuitem"),addToggleMenuItem:a(e,"togglemenuitem"),addAutocompleter:a(n,"autocompleter"),addContextMenu:a(o,"contextmenu"),addContextToolbar:a(i,"contexttoolbar"),addContextForm:a(i,"contextform"),addSidebar:a(u,"sidebar"),addIcon:c,getAll:function(){return{buttons:t,menuItems:e,icons:r,popups:n,contextMenus:o,contextToolbars:i,sidebars:u}}}},HH=function(){var t=PH();return{addAutocompleter:t.addAutocompleter,addButton:t.addButton,addContextForm:t.addContextForm,addContextMenu:t.addContextMenu,addContextToolbar:t.addContextToolbar,addIcon:t.addIcon,addMenuButton:t.addMenuButton,addMenuItem:t.addMenuItem,addNestedMenuItem:t.addNestedMenuItem,addSidebar:t.addSidebar,addSplitButton:t.addSplitButton,addToggleButton:t.addToggleButton,addGroupToolbarButton:t.addGroupToolbarButton,addToggleMenuItem:t.addToggleMenuItem,getAll:t.getAll}},IH=nn.each,LH=nn.trim,FH="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),VH={ftp:21,http:80,https:443,mailto:25},UH=function(){function t(e,r){e=LH(e),this.settings=r||{};var o=this.settings.base_uri,i=this;if(/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e))i.source=e;else{var u=0===e.indexOf("//");if(0!==e.indexOf("/")||u||(e=(o&&o.protocol||"http")+"://mce_host"+e),!/^[\w\-]*:?\/\//.test(e)){var a=this.settings.base_uri?this.settings.base_uri.path:new t(n.document.location.href).directory;if(this.settings.base_uri&&""==this.settings.base_uri.protocol)e="//mce_host"+i.toAbsPath(a,e);else{var c=/([^#?]*)([#?]?.*)/.exec(e);e=(o&&o.protocol||"http")+"://mce_host"+i.toAbsPath(a,c[1])+c[2]}}e=e.replace(/@@/g,"(mce_at)");var s=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);IH(FH,(function(t,e){var n=s[e];n&&(n=n.replace(/\(mce_at\)/g,"@@")),i[t]=n})),o&&(i.protocol||(i.protocol=o.protocol),i.userInfo||(i.userInfo=o.userInfo),i.port||"mce_host"!==i.host||(i.port=o.port),i.host&&"mce_host"!==i.host||(i.host=o.host),i.source=""),u&&(i.protocol="")}}return t.parseDataUri=function(t){var e,n=decodeURIComponent(t).split(","),r=/data:([^;]+)/.exec(n[0]);return r&&(e=r[1]),{type:e,data:n[1]}},t.getDocumentBaseUrl=function(t){var e;return e=0!==t.protocol.indexOf("http")&&"file:"!==t.protocol?t.href:t.protocol+"//"+t.host+t.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(e)&&(e=e.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(e)||(e+="/")),e},t.prototype.setPath=function(t){var e=/^(.*?)\/?(\w+)?$/.exec(t);this.path=e[0],this.directory=e[1],this.file=e[2],this.source="",this.getURI()},t.prototype.toRelative=function(e){var n;if("./"===e)return e;var r=new t(e,{base_uri:this});if("mce_host"!==r.host&&this.host!==r.host&&r.host||this.port!==r.port||this.protocol!==r.protocol&&""!==r.protocol)return r.getURI();var o=this.getURI(),i=r.getURI();return o===i||"/"===o.charAt(o.length-1)&&o.substr(0,o.length-1)===i?o:(n=this.toRelPath(this.path,r.path),r.query&&(n+="?"+r.query),r.anchor&&(n+="#"+r.anchor),n)},t.prototype.toAbsolute=function(e,n){var r=new t(e,{base_uri:this});return r.getURI(n&&this.isSameOrigin(r))},t.prototype.isSameOrigin=function(t){if(this.host==t.host&&this.protocol==t.protocol){if(this.port==t.port)return!0;var e=VH[this.protocol];if(e&&(this.port||e)==(t.port||e))return!0}return!1},t.prototype.toRelPath=function(t,e){var n,r,o=0,i="",u=t.substring(0,t.lastIndexOf("/")).split("/"),a=e.split("/");if(u.length>=a.length)for(n=0,r=u.length;n<r;n++)if(n>=a.length||u[n]!==a[n]){o=n+1;break}if(u.length<a.length)for(n=0,r=a.length;n<r;n++)if(n>=u.length||u[n]!==a[n]){o=n+1;break}if(1===o)return e;for(n=0,r=u.length-(o-1);n<r;n++)i+="../";for(n=o-1,r=a.length;n<r;n++)i+=n!==o-1?"/"+a[n]:a[n];return i},t.prototype.toAbsPath=function(t,e){var n,r,o=0,i=[],u=/\/$/.test(e)?"/":"",a=t.split("/"),c=e.split("/");for(IH(a,(function(t){t&&i.push(t)})),a=i,n=c.length-1,i=[];n>=0;n--)0!==c[n].length&&"."!==c[n]&&(".."!==c[n]?o>0?o--:i.push(c[n]):o++);return n=a.length-o,r=n<=0?at(i).join("/"):a.slice(0,n).join("/")+"/"+at(i).join("/"),0!==r.indexOf("/")&&(r="/"+r),u&&r.lastIndexOf("/")!==r.length-1&&(r+=u),r},t.prototype.getURI=function(t){var e;return void 0===t&&(t=!1),this.source&&!t||(e="",t||(this.protocol?e+=this.protocol+"://":e+="//",this.userInfo&&(e+=this.userInfo+"@"),this.host&&(e+=this.host),this.port&&(e+=":"+this.port)),this.path&&(e+=this.path),this.query&&(e+="?"+this.query),this.anchor&&(e+="#"+this.anchor),this.source=e),this.source},t}(),jH=dc.DOM,WH=nn.extend,qH=nn.each,$H=nn.resolve,GH=je.ie,KH=function(){function t(t,e,n){var r=this;this.plugins={},this.contentCSS=[],this.contentStyles=[],this.loadedCSS={},this.isNotDirty=!1,this.editorManager=n,this.documentBaseUrl=n.documentBaseURL,WH(this,OH),this.settings=hk(this,t,this.documentBaseUrl,n.defaultSettings,e),this.settings.suffix&&(n.suffix=this.settings.suffix),this.suffix=n.suffix,this.settings.base_url&&n._setBaseUrl(this.settings.base_url),this.baseUri=n.baseURI,this.settings.referrer_policy&&(wc.ScriptLoader._setReferrerPolicy(this.settings.referrer_policy),dc.DOM.styleSheetLoader._setReferrerPolicy(this.settings.referrer_policy)),Pc.languageLoad=this.settings.language_load,Pc.baseURL=n.baseURL,this.id=t,this.setDirty(!1),this.documentBaseURI=new UH(this.settings.document_base_url,{base_uri:this.baseUri}),this.baseURI=this.baseUri,this.inline=!!this.settings.inline,this.shortcuts=new BH(this),this.editorCommands=new ZP(this),this.settings.cache_suffix&&(je.cacheSuffix=this.settings.cache_suffix.replace(/^[\?\&]+/,"")),this.ui={registry:HH(),styleSheetLoader:void 0};var o=this,i=DH(o);this.mode=i,this.setMode=i.set,n.fire("SetupEditor",{editor:this}),this.execCallback("setup",this),this.$=Ca.overrideDefaults((function(){return{context:r.inline?r.getBody():r.getDoc(),element:r.getBody()}}))}return t.prototype.render=function(){OP(this)},t.prototype.focus=function(t){Qy(this,t)},t.prototype.hasFocus=function(){return Ky(this)},t.prototype.execCallback=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r,o=this,i=o.settings[t];if(i)return o.callbackLookup&&(r=o.callbackLookup[t])&&(i=r.func,r=r.scope),"string"===typeof i&&(r=i.replace(/\.\w+$/,""),r=r?$H(r):0,i=$H(i),o.callbackLookup=o.callbackLookup||{},o.callbackLookup[t]={func:i,scope:r}),i.apply(r||o,e)},t.prototype.translate=function(t){return zc.translate(t)},t.prototype.getParam=function(t,e,n){return yk(this,t,e,n)},t.prototype.nodeChanged=function(t){this._nodeChangeDispatcher.nodeChanged(t)},t.prototype.addCommand=function(t,e,n){this.editorCommands.addCommand(t,e,n)},t.prototype.addQueryStateHandler=function(t,e,n){this.editorCommands.addQueryStateHandler(t,e,n)},t.prototype.addQueryValueHandler=function(t,e,n){this.editorCommands.addQueryValueHandler(t,e,n)},t.prototype.addShortcut=function(t,e,n,r){this.shortcuts.add(t,e,n,r)},t.prototype.execCommand=function(t,e,n,r){return this.editorCommands.execCommand(t,e,n,r)},t.prototype.queryCommandState=function(t){return this.editorCommands.queryCommandState(t)},t.prototype.queryCommandValue=function(t){return this.editorCommands.queryCommandValue(t)},t.prototype.queryCommandSupported=function(t){return this.editorCommands.queryCommandSupported(t)},t.prototype.show=function(){var t=this;t.hidden&&(t.hidden=!1,t.inline?t.getBody().contentEditable="true":(jH.show(t.getContainer()),jH.hide(t.id)),t.load(),t.fire("show"))},t.prototype.hide=function(){var t=this,e=t.getDoc();t.hidden||(GH&&e&&!t.inline&&e.execCommand("SelectAll"),t.save(),t.inline?(t.getBody().contentEditable="false",t===t.editorManager.focusedEditor&&(t.editorManager.focusedEditor=null)):(jH.hide(t.getContainer()),jH.setStyle(t.id,"display",t.orgDisplay)),t.hidden=!0,t.fire("hide"))},t.prototype.isHidden=function(){return!!this.hidden},t.prototype.setProgressState=function(t,e){this.fire("ProgressState",{state:t,time:e})},t.prototype.load=function(t){var e,n=this,r=n.getElement();if(n.removed)return"";if(r){t=t||{},t.load=!0;var o=Hr(r)?r.value:r.innerHTML;return e=n.setContent(o,t),t.element=r,t.no_events||n.fire("LoadContent",t),t.element=r=null,e}},t.prototype.save=function(t){var e,n,r=this,o=r.getElement();if(o&&r.initialized&&!r.removed)return t=t||{},t.save=!0,t.element=o,e=t.content=r.getContent(t),t.no_events||r.fire("SaveContent",t),"raw"===t.format&&r.fire("RawSaveContent",t),e=t.content,Hr(o)?o.value=e:(!t.is_removing&&r.inline||(o.innerHTML=e),(n=jH.getParent(r.id,"form"))&&qH(n.elements,(function(t){if(t.name===r.id)return t.value=e,!1}))),t.element=o=null,!1!==t.set_dirty&&r.setDirty(!1),e},t.prototype.setContent=function(t,e){return SS(this,t,e)},t.prototype.getContent=function(t){return CS(this,t)},t.prototype.insertContent=function(t,e){e&&(t=WH({content:t},e)),this.execCommand("mceInsertContent",!1,t)},t.prototype.resetContent=function(t){void 0===t?SS(this,this.startContent,{format:"raw"}):SS(this,t),this.undoManager.reset(),this.setDirty(!1),this.nodeChanged()},t.prototype.isDirty=function(){return!this.isNotDirty},t.prototype.setDirty=function(t){var e=!this.isNotDirty;this.isNotDirty=!t,t&&t!==e&&this.fire("dirty")},t.prototype.getContainer=function(){var t=this;return t.container||(t.container=jH.get(t.editorContainer||t.id+"_parent")),t.container},t.prototype.getContentAreaContainer=function(){return this.contentAreaContainer},t.prototype.getElement=function(){return this.targetElm||(this.targetElm=jH.get(this.id)),this.targetElm},t.prototype.getWin=function(){var t,e=this;return e.contentWindow||(t=e.iframeElement,t&&(e.contentWindow=t.contentWindow)),e.contentWindow},t.prototype.getDoc=function(){var t,e=this;return e.contentDocument||(t=e.getWin(),t&&(e.contentDocument=t.document)),e.contentDocument},t.prototype.getBody=function(){var t=this.getDoc();return this.bodyElement||(t?t.body:null)},t.prototype.convertURL=function(t,e,n){var r=this,o=r.settings;return o.urlconverter_callback?r.execCallback("urlconverter_callback",t,n,!0,e):!o.convert_urls||n&&"LINK"===n.nodeName||0===t.indexOf("file:")||0===t.length?t:o.relative_urls?r.documentBaseURI.toRelative(t):(t=r.documentBaseURI.toAbsolute(t,o.remove_script_host),t)},t.prototype.addVisual=function(t){var e,n=this,r=n.settings,o=n.dom;t=t||n.getBody(),void 0===n.hasVisual&&(n.hasVisual=r.visual),qH(o.select("table,a",t),(function(t){var i;switch(t.nodeName){case"TABLE":return e=r.visual_table_class||"mce-item-table",i=o.getAttrib(t,"border"),void(i&&"0"!==i||!n.hasVisual?o.removeClass(t,e):o.addClass(t,e));case"A":return void(o.getAttrib(t,"href")||(i=o.getAttrib(t,"name")||t.id,e=r.visual_anchor_class||"mce-item-anchor",i&&n.hasVisual?o.addClass(t,e):o.removeClass(t,e)))}})),n.fire("VisualAid",{element:t,hasVisual:n.hasVisual})},t.prototype.remove=function(){VS(this)},t.prototype.destroy=function(t){US(this,t)},t.prototype.uploadImages=function(t){return this.editorUpload.uploadImages(t)},t.prototype._scanForImages=function(){return this.editorUpload.scanForImages()},t.prototype.addButton=function(){throw new Error("editor.addButton has been removed in tinymce 5x, use editor.ui.registry.addButton or editor.ui.registry.addToggleButton or editor.ui.registry.addSplitButton instead")},t.prototype.addSidebar=function(){throw new Error("editor.addSidebar has been removed in tinymce 5x, use editor.ui.registry.addSidebar instead")},t.prototype.addMenuItem=function(){throw new Error("editor.addMenuItem has been removed in tinymce 5x, use editor.ui.registry.addMenuItem instead")},t.prototype.addContextToolbar=function(){throw new Error("editor.addContextToolbar has been removed in tinymce 5x, use editor.ui.registry.addContextToolbar instead")},t}(),XH=dc.DOM,YH=nn.explode,JH=nn.each,QH=nn.extend,ZH=0,tI=!1,eI=[],nI=[],rI=function(t){return"length"!==t},oI=function(t){var e=t.type;JH(sI.get(),(function(n){switch(e){case"scroll":n.fire("ScrollWindow",t);break;case"resize":n.fire("ResizeWindow",t);break}}))},iI=function(t){t!==tI&&(t?Ca(window).on("resize scroll",oI):Ca(window).off("resize scroll",oI),tI=t)},uI=function(t){var e=nI;delete eI[t.id];for(var n=0;n<eI.length;n++)if(eI[n]===t){eI.splice(n,1);break}return nI=Q(nI,(function(e){return t!==e})),sI.activeEditor===t&&(sI.activeEditor=nI.length>0?nI[0]:null),sI.focusedEditor===t&&(sI.focusedEditor=null),e.length!==nI.length},aI=function(t){return t&&t.initialized&&!(t.getContainer()||t.getBody()).parentNode&&(uI(t),t.unbindAllNativeEvents(),t.destroy(!0),t.removed=!0,t=null),t},cI="CSS1Compat"!==n.document.compatMode,sI=Ht(Ht({},yH),{baseURI:null,baseURL:null,defaultSettings:{},documentBaseURL:null,suffix:null,$:Ca,majorVersion:"5",minorVersion:"4.1",releaseDate:"2020-07-08",editors:eI,i18n:zc,activeEditor:null,focusedEditor:null,settings:{},setup:function(){var t,e,r=this,o="";e=UH.getDocumentBaseUrl(n.document.location),/^[^:]+:\/\/\/?[^\/]+\//.test(e)&&(e=e.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(e)||(e+="/"));var i=window.tinymce||window.tinyMCEPreInit;if(i)t=i.base||i.baseURL,o=i.suffix;else{for(var u=n.document.getElementsByTagName("script"),a=0;a<u.length;a++){var c=u[a].src||"";if(""!==c){var s=c.substring(c.lastIndexOf("/"));if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(c)){-1!==s.indexOf(".min")&&(o=".min"),t=c.substring(0,c.lastIndexOf("/"));break}}}if(!t&&n.document.currentScript){c=n.document.currentScript.src;-1!==c.indexOf(".min")&&(o=".min"),t=c.substring(0,c.lastIndexOf("/"))}}r.baseURL=new UH(e).toAbsolute(t),r.documentBaseURL=e,r.baseURI=new UH(r.baseURL),r.suffix=o,Iy(r)},overrideDefaults:function(t){var e=t.base_url;e&&this._setBaseUrl(e);var n=t.suffix;t.suffix&&(this.suffix=n),this.defaultSettings=t;var r=t.plugin_base_urls;void 0!==r&&pt(r,(function(t,e){Pc.PluginManager.urls[e]=t}))},init:function(t){var e,r=this,o=nn.makeMap("area base basefont br col frame hr img input isindex link meta param embed source wbr track colgroup option table tbody tfoot thead tr th td script noscript style textarea video audio iframe object menu"," "),i=function(t,e){return t.inline&&e.tagName.toLowerCase()in o},u=function(t){var e=t.id;return e||(e=Ot(t,"name").filter((function(t){return!XH.get(t)})).getOrThunk(XH.uniqueId),t.setAttribute("id",e)),e},a=function(e){var n=t[e];if(n)return n.apply(r,Array.prototype.slice.call(arguments,2))},c=function(t,e){return e.constructor===RegExp?e.test(t.className):XH.hasClass(t,e)},s=function(t){var e=[];if(je.browser.isIE()&&je.browser.version.major<11)return Xk("TinyMCE does not support the browser you are using. For a list of supported browsers please see: https://www.tinymce.com/docs/get-started/system-requirements/"),[];if(cI)return Xk("Failed to initialize the editor as the document is not in standards mode. TinyMCE requires standards mode."),[];if(t.types)return JH(t.types,(function(t){e=e.concat(XH.select(t.selector))})),e;if(t.selector)return XH.select(t.selector);if(t.target)return[t.target];switch(t.mode){case"exact":var r=t.elements||"";r.length>0&&JH(YH(r),(function(t){var r=XH.get(t);r?e.push(r):JH(n.document.forms,(function(n){JH(n.elements,(function(n){n.name===t&&(t="mce_editor_"+ZH++,XH.setAttrib(n,"id",t),e.push(n))}))}))}));break;case"textareas":case"specific_textareas":JH(XH.select("textarea"),(function(n){t.editor_deselector&&c(n,t.editor_deselector)||t.editor_selector&&!c(n,t.editor_selector)||e.push(n)}));break}return e},l=function(t){e=t},f=function(){var e,n=0,o=[],c=function(t,i,u){var a=new KH(t,i,r);o.push(a),a.on("init",(function(){++n===e.length&&l(o)})),a.targetElm=a.targetElm||u,a.render()};XH.unbind(window,"ready",f),a("onpageload"),e=Ca.unique(s(t)),t.types?JH(t.types,(function(n){nn.each(e,(function(e){return!XH.is(e,n.selector)||(c(u(e),QH({},t,n),e),!1)}))})):(nn.each(e,(function(t){aI(r.get(t.id))})),e=nn.grep(e,(function(t){return!r.get(t.id)})),0===e.length?l([]):JH(e,(function(e){i(t,e)?Xk("Could not initialize inline editor on invalid inline target element",e):c(u(e),t,e)})))};return r.settings=t,XH.bind(window,"ready",f),new $a((function(t){e?t(e):l=function(e){t(e)}}))},get:function(t){return 0===arguments.length?nI.slice(0):M(t)?nt(nI,(function(e){return e.id===t})).getOr(null):F(t)&&nI[t]?nI[t]:null},add:function(t){var e=this,n=eI[t.id];return n===t||(null===e.get(t.id)&&(rI(t.id)&&(eI[t.id]=t),eI.push(t),nI.push(t)),iI(!0),e.activeEditor=t,e.fire("AddEditor",{editor:t}),AA||(AA=function(t){var n=e.fire("BeforeUnload");if(n.returnValue)return t.preventDefault(),t.returnValue=n.returnValue,n.returnValue},window.addEventListener("beforeunload",AA))),t},createEditor:function(t,e){return this.add(new KH(t,e,this))},remove:function(t){var e,n,r=this;if(t){if(!M(t))return n=t,P(r.get(n.id))?null:(uI(n)&&r.fire("RemoveEditor",{editor:n}),0===nI.length&&window.removeEventListener("beforeunload",AA),n.remove(),iI(nI.length>0),n);JH(XH.select(t),(function(t){n=r.get(t.id),n&&r.remove(n)}))}else for(e=nI.length-1;e>=0;e--)r.remove(nI[e])},execCommand:function(t,e,n){var r=this,o=r.get(n);switch(t){case"mceAddEditor":return r.get(n)||new KH(n,r.settings,r).render(),!0;case"mceRemoveEditor":return o&&o.remove(),!0;case"mceToggleEditor":return o?(o.isHidden()?o.show():o.hide(),!0):(r.execCommand("mceAddEditor",0,n),!0)}return!!r.activeEditor&&r.activeEditor.execCommand(t,e,n)},triggerSave:function(){JH(nI,(function(t){t.save()}))},addI18n:function(t,e){zc.add(t,e)},translate:function(t){return zc.translate(t)},setActive:function(t){var e=this.activeEditor;this.activeEditor!==t&&(e&&e.fire("deactivate",{relatedTarget:t}),t.fire("activate",{relatedTarget:e})),this.activeEditor=t},_setBaseUrl:function(t){this.baseURL=new UH(this.documentBaseURL).toAbsolute(t.replace(/\/+$/,"")),this.baseURI=new UH(this.baseURL)}});function lI(t){var e=function(e,n){return ch(t,e,n)},n=lw,r=function(e){return eT(t,e).fold(v(!1),(function(t){return e.setStart(t.startContainer,t.startOffset),e.setEnd(t.endContainer,t.endOffset),!0}))};return{walk:e,split:n,normalize:r}}sI.setup(),function(t){t.compareRanges=jO,t.getCaretRangeFromPoint=zO,t.getSelectedNode=nl,t.getNode=rl}(lI||(lI={}));var fI,dI,mI=lI,gI=function(t,e,r){void 0===r&&(r=1e3);var o=!1,i=null,u=function(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];o||(o=!0,null!==i&&(n.clearTimeout(i),i=null),t.apply(null,e))}},a=u(t),c=u(e),s=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];o||null!==i||(i=n.setTimeout((function(){return c.apply(null,t)}),r))};return{start:s,resolve:a,reject:c}},hI=function(){var t={},e={},n=function(n,r){var o='Script at URL "'+r+'" failed to load',i='Script at URL "'+r+"\" did not call `tinymce.Resource.add('"+n+"', data)` within 1 second";if(void 0!==t[n])return t[n];var u=new $a((function(t,u){var a=gI(t,u);e[n]=a.resolve,wc.ScriptLoader.loadScript(r,(function(){return a.start(i)}),(function(){return a.reject(o)}))}));return t[n]=u,u},r=function(n,r){void 0!==e[n]&&(e[n](r),delete e[n]),t[n]=$a.resolve(r)};return{load:n,add:r}},pI=hI(),vI=Math.min,bI=Math.max,yI=Math.round,wI=function(t,e,n){var r=e.x,o=e.y,i=t.w,u=t.h,a=e.w,c=e.h;return n=(n||"").split(""),"b"===n[0]&&(o+=c),"r"===n[1]&&(r+=a),"c"===n[0]&&(o+=yI(c/2)),"c"===n[1]&&(r+=yI(a/2)),"b"===n[3]&&(o-=u),"r"===n[4]&&(r-=i),"c"===n[3]&&(o-=yI(u/2)),"c"===n[4]&&(r-=yI(i/2)),OI(r,o,i,u)},xI=function(t,e,n,r){var o,i;for(i=0;i<r.length;i++)if(o=wI(t,e,r[i]),o.x>=n.x&&o.x+o.w<=n.w+n.x&&o.y>=n.y&&o.y+o.h<=n.h+n.y)return r[i];return null},CI=function(t,e,n){return OI(t.x-e,t.y-n,t.w+2*e,t.h+2*n)},SI=function(t,e){var n=bI(t.x,e.x),r=bI(t.y,e.y),o=vI(t.x+t.w,e.x+e.w),i=vI(t.y+t.h,e.y+e.h);return o-n<0||i-r<0?null:OI(n,r,o-n,i-r)},kI=function(t,e,n){var r=t.x,o=t.y,i=t.x+t.w,u=t.y+t.h,a=e.x+e.w,c=e.y+e.h,s=bI(0,e.x-r),l=bI(0,e.y-o),f=bI(0,i-a),d=bI(0,u-c);return r+=s,o+=l,n&&(i+=s,u+=l,r-=f,o-=d),i-=f,u-=d,OI(r,o,i-r,u-o)},OI=function(t,e,n,r){return{x:t,y:e,w:n,h:r}},TI=function(t){return OI(t.left,t.top,t.width,t.height)},EI={inflate:CI,relativePosition:wI,findBestRelativePosition:xI,intersect:SI,clamp:kI,create:OI,fromClientRect:TI},_I=nn.each,AI=nn.extend,DI=function(){};DI.extend=fI=function(t){var e=this,n=e.prototype,r=function(){var t,e,n,r=this;if(!dI&&(r.init&&r.init.apply(r,arguments),e=r.Mixins,e)){t=e.length;while(t--)n=e[t],n.init&&n.init.apply(r,arguments)}},o=function(){return this},i=function(t,e){return function(){var r=this,o=r._super;r._super=n[t];var i=e.apply(r,arguments);return r._super=o,i}};dI=!0;var u=new e;return dI=!1,t.Mixins&&(_I(t.Mixins,(function(e){for(var n in e)"init"!==n&&(t[n]=e[n])})),n.Mixins&&(t.Mixins=n.Mixins.concat(t.Mixins))),t.Methods&&_I(t.Methods.split(","),(function(e){t[e]=o})),t.Properties&&_I(t.Properties.split(","),(function(e){var n="_"+e;t[e]=function(t){var e=this;return void 0!==t?(e[n]=t,e):e[n]}})),t.Statics&&_I(t.Statics,(function(t,e){r[e]=t})),t.Defaults&&n.Defaults&&(t.Defaults=AI({},n.Defaults,t.Defaults)),pt(t,(function(t,e){"function"===typeof t&&n[e]?u[e]=i(e,t):u[e]=t})),r.prototype=u,r.constructor=r,r.extend=fI,r};var NI,RI=Math.min,MI=Math.max,zI=Math.round,BI=function(t){var e={},n=0,r=0,o=0,i=function(t,e,n){var r,o,i;r=0,o=0,i=0,t/=255,e/=255,n/=255;var u=RI(t,RI(e,n)),a=MI(t,MI(e,n));if(u===a)return i=u,{h:0,s:0,v:100*i};var c=t===u?e-n:n===u?t-e:n-t;return r=t===u?3:n===u?1:5,r=60*(r-c/(a-u)),o=(a-u)/a,i=a,{h:zI(r),s:zI(100*o),v:zI(100*i)}},u=function(t,e,i){if(t=(parseInt(t,10)||0)%360,e=parseInt(e,10)/100,i=parseInt(i,10)/100,e=MI(0,RI(e,1)),i=MI(0,RI(i,1)),0!==e){var u=t/60,a=i*e,c=a*(1-Math.abs(u%2-1)),s=i-a;switch(Math.floor(u)){case 0:n=a,r=c,o=0;break;case 1:n=c,r=a,o=0;break;case 2:n=0,r=a,o=c;break;case 3:n=0,r=c,o=a;break;case 4:n=c,r=0,o=a;break;case 5:n=a,r=0,o=c;break;default:n=r=o=0}n=zI(255*(n+s)),r=zI(255*(r+s)),o=zI(255*(o+s))}else n=r=o=zI(255*i)},a=function(){var t=function(t){return t=parseInt(t,10).toString(16),t.length>1?t:"0"+t};return"#"+t(n)+t(r)+t(o)},c=function(){return{r:n,g:r,b:o}},s=function(){return i(n,r,o)},l=function(t){var i;return"object"===typeof t?"r"in t?(n=t.r,r=t.g,o=t.b):"v"in t&&u(t.h,t.s,t.v):(i=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(t))?(n=parseInt(i[1],10),r=parseInt(i[2],10),o=parseInt(i[3],10)):(i=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(t))?(n=parseInt(i[1],16),r=parseInt(i[2],16),o=parseInt(i[3],16)):(i=/#([0-F])([0-F])([0-F])/gi.exec(t))&&(n=parseInt(i[1]+i[1],16),r=parseInt(i[2]+i[2],16),o=parseInt(i[3]+i[3],16)),n=n<0?0:n>255?255:n,r=r<0?0:r>255?255:r,o=o<0?0:o>255?255:o,e};return t&&l(t),e.toRgb=c,e.toHsv=s,e.toHex=a,e.parse=l,e},PI=function(t){var e=JSON.stringify(t);return M(e)?e.replace(/[\u0080-\uFFFF]/g,(function(t){var e=t.charCodeAt(0).toString(16);return"\\u"+"0000".substring(e.length)+e})):e},HI={serialize:PI,parse:function(t){try{return JSON.parse(t)}catch(e){}}},II={callbacks:{},count:0,send:function(t){var e=this,n=dc.DOM,r=void 0!==t.count?t.count:e.count,o="tinymce_jsonp_"+r;e.callbacks[r]=function(i){n.remove(o),delete e.callbacks[r],t.callback(i)},n.add(n.doc.body,"script",{id:o,src:t.url,type:"text/javascript"}),e.count++}},LI=Ht(Ht({},yH),{send:function(t){var e,r=0,o=function(){!t.async||4===e.readyState||r++>1e4?(t.success&&r<1e4&&200===e.status?t.success.call(t.success_scope,""+e.responseText,e,t):t.error&&t.error.call(t.error_scope,r>1e4?"TIMED_OUT":"GENERAL",e,t),e=null):Za.setTimeout(o,10)};if(t.scope=t.scope||this,t.success_scope=t.success_scope||t.scope,t.error_scope=t.error_scope||t.scope,t.async=!1!==t.async,t.data=t.data||"",LI.fire("beforeInitialize",{settings:t}),e=new n.XMLHttpRequest,e){if(e.overrideMimeType&&e.overrideMimeType(t.content_type),e.open(t.type||(t.data?"POST":"GET"),t.url,t.async),t.crossDomain&&(e.withCredentials=!0),t.content_type&&e.setRequestHeader("Content-Type",t.content_type),t.requestheaders&&nn.each(t.requestheaders,(function(t){e.setRequestHeader(t.key,t.value)})),e.setRequestHeader("X-Requested-With","XMLHttpRequest"),e=LI.fire("beforeSend",{xhr:e,settings:t}).xhr,e.send(t.data),!t.async)return o();Za.setTimeout(o,10)}}}),FI=nn.extend,VI=function(){function t(t){this.settings=FI({},t),this.count=0}return t.sendRPC=function(e){return(new t).send(e)},t.prototype.send=function(t){var e=t.error,n=t.success,r=FI(this.settings,t);r.success=function(t,o){t=HI.parse(t),"undefined"===typeof t&&(t={error:"JSON Parse error."}),t.error?e.call(r.error_scope||r.scope,t.error,o):n.call(r.success_scope||r.scope,t.result)},r.error=function(t,n){e&&e.call(r.error_scope||r.scope,t,n)},r.data=HI.serialize({id:t.id||"c"+this.count++,method:t.method,params:t.params}),r.content_type="application/json",LI.send(r)},t}(),UI=function(){return function(){var t={},e=[],n={getItem:function(e){var n=t[e];return n||null},setItem:function(n,r){e.push(n),t[n]=String(r)},key:function(t){return e[t]},removeItem:function(n){e=e.filter((function(t){return t===n})),delete t[n]},clear:function(){e=[],t={}},length:0};return Object.defineProperty(n,"length",{get:function(){return e.length},configurable:!1,enumerable:!1}),n}()};try{var jI="__storage_test__";NI=n.window.localStorage,NI.setItem(jI,jI),NI.removeItem(jI)}catch(XI){NI=UI()}var WI=NI,qI={geom:{Rect:EI},util:{Promise:$a,Delay:Za,Tools:nn,VK:fT,URI:UH,Class:DI,EventDispatcher:vH,Observable:yH,I18n:zc,XHR:LI,JSON:HI,JSONRequest:VI,JSONP:II,LocalStorage:WI,Color:BI},dom:{EventUtils:$i,Sizzle:Du,DomQuery:Ca,TreeWalker:Sa,TextSeeker:ks,DOMUtils:dc,ScriptLoader:wc,RangeUtils:mI,Serializer:dE,StyleSheetLoader:tc,ControlSelection:hT,BookmarkManager:sT,Selection:xT,Event:$i.Event},html:{Styles:zi,Entities:Zo,Node:Fh,Schema:li,SaxParser:ep,DomParser:ZT,Writer:Uh,Serializer:jh},Env:je,AddOnManager:Pc,Annotator:zh,Formatter:PE,UndoManager:LE,EditorCommands:ZP,WindowManager:Lk,NotificationManager:Bk,EditorObservable:OH,Shortcuts:BH,Editor:KH,FocusManager:ky,EditorManager:sI,DOM:dc.DOM,ScriptLoader:wc.ScriptLoader,PluginManager:Pc.PluginManager,ThemeManager:Pc.ThemeManager,IconManager:xk,Resource:pI,trim:nn.trim,isArray:nn.isArray,is:nn.is,toArray:nn.toArray,makeMap:nn.makeMap,each:nn.each,map:nn.map,grep:nn.grep,inArray:nn.inArray,extend:nn.extend,create:nn.create,walk:nn.walk,createNS:nn.createNS,resolve:nn.resolve,explode:nn.explode,_addCacheSuffix:nn._addCacheSuffix,isOpera:je.opera,isWebKit:je.webkit,isIE:je.ie,isGecko:je.gecko,isMac:je.mac},$I=nn.extend(sI,qI),GI=function(e){try{t.exports=e}catch(n){}},KI=function(t){window.tinymce=t,window.tinyMCE=t};KI($I),GI($I)})(window)}).call(this,n("c8ba"))},e8b0:function(t,e){(function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=function(t){return t},n=function(){return n=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n],e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},n.apply(this,arguments)},r="\ufeff",o=function(t){return t.replace(/\uFEFF/g,"")},i="[!-#%-*,-\\/:;?@\\[-\\]_{}¡«·»¿;·՚-՟։֊־׀׃׆׳״؉؊،؍؛؞؟٪-٭۔܀-܍߷-߹࠰-࠾࡞।॥॰෴๏๚๛༄-༒༺-༽྅࿐-࿔࿙࿚၊-၏჻፡-፨᐀᙭᙮᚛᚜᛫-᛭᜵᜶។-៖៘-៚᠀-᠊᥄᥅᨞᨟᪠-᪦᪨-᪭᭚-᭠᯼-᯿᰻-᰿᱾᱿᳓‐-‧‰-⁃⁅-⁑⁓-⁞⁽⁾₍₎〈〉❨-❵⟅⟆⟦-⟯⦃-⦘⧘-⧛⧼⧽⳹-⳼⳾⳿⵰⸀-⸮⸰⸱、-〃〈-】〔-〟〰〽゠・꓾꓿꘍-꘏꙳꙾꛲-꛷꡴-꡷꣎꣏꣸-꣺꤮꤯꥟꧁-꧍꧞꧟꩜-꩟꫞꫟꯫﴾﴿︐-︙︰-﹒﹔-﹡﹣﹨﹪﹫!-#%-*,-/:;?@[-]_{}⦅-・]",u={aletter:"[A-Za-zªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-׳ؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆༀཀ-ཇཉ-ཬྈ-ྌႠ-Ⴥა-ჺჼᄀ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᨀ-ᨖᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᯀ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⒶ-ⓩⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⴀ-ⴥⴰ-ⵥⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々〻〼ㄅ-ㄭㄱ-ㆎㆠ-ㆺꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐꞑꞠ-ꞩꟺ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zᅠ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]",midnumlet:"[-'\\.‘’․﹒'.]",midletter:"[:··״‧︓﹕:]",midnum:"[±+*/,;;։،؍٬߸⁄︐︔﹐﹔,;]",numeric:"[0-9٠-٩٫۰-۹߀-߉०-९০-৯੦-੯૦-૯୦-୯௦-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩၀-၉႐-႙០-៩᠐-᠙᥆-᥏᧐-᧙᪀-᪉᪐-᪙᭐-᭙᮰-᮹᱀-᱉᱐-᱙꘠-꘩꣐-꣙꤀-꤉꧐-꧙꩐-꩙꯰-꯹]",cr:"\\r",lf:"\\n",newline:"[\v\f
\u2028\u2029]",extend:"[̀-ͯ҃-҉֑-ׇֽֿׁׂׅׄؐ-ًؚ-ٰٟۖ-ۜ۟-۪ۤۧۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ऀ-ःऺ-़ा-ॏ॑-ॗॢॣঁ-ঃ়া-ৄেৈো-্ৗৢৣਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑੰੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣஂா-ூெ-ைொ-்ௗఁ-ఃా-ౄె-ైొ-్ౕౖౢౣಂಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣംഃാ-ൄെ-ൈൊ-്ൗൢൣංඃ්ා-ුූෘ-ෟෲෳัิ-ฺ็-๎ັິ-ູົຼ່-ໍ༹༘༙༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏႚ-ႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳា-៓៝᠋-᠍ᢩᤠ-ᤫᤰ-᤻ᦰ-ᧀᧈᧉᨗ-ᨛᩕ-ᩞ᩠-᩿᩼ᬀ-ᬄ᬴-᭄᭫-᭳ᮀ-ᮂᮡ-᯦᮪-᯳ᰤ-᰷᳐-᳔᳒-᳨᳭ᳲ᷀-ᷦ᷼-᷿⃐-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꙯-꙲꙼꙽꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-꣄꣠-꣱ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀ꨩ-ꨶꩃꩌꩍꩻꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꯣ-ꯪ꯬꯭ﬞ︀-️︠-゙゚︦]",format:"[-឴឵---\ufeff-]",katakana:"[〱-〵゛゜゠-ヺー-ヿㇰ-ㇿ㋐-㋾㌀-㍗ヲ-ン]",extendnumlet:"[=_‿⁀⁔︳︴﹍-﹏_∀-⋿<>]",punctuation:i},a={ALETTER:0,MIDNUMLET:1,MIDLETTER:2,MIDNUM:3,NUMERIC:4,CR:5,LF:6,NEWLINE:7,EXTEND:8,FORMAT:9,KATAKANA:10,EXTENDNUMLET:11,AT:12,OTHER:13},c=[new RegExp(u.aletter),new RegExp(u.midnumlet),new RegExp(u.midletter),new RegExp(u.midnum),new RegExp(u.numeric),new RegExp(u.cr),new RegExp(u.lf),new RegExp(u.newline),new RegExp(u.extend),new RegExp(u.format),new RegExp(u.katakana),new RegExp(u.extendnumlet),new RegExp("@")],s="",l=new RegExp("^"+u.punctuation+"$"),f=/^\s+$/,d=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},m=c,g=a.OTHER,h=function(t){for(var e=g,n=m.length,r=0;r<n;++r){var o=m[r];if(o&&o.test(t)){e=r;break}}return e},p=function(t){var e={};return function(n){if(e[n])return e[n];var r=t(n);return e[n]=r,r}},v=function(t){var e=p(h);return d(t,e)},b=function(t,e){var n=t[e],r=t[e+1];if(e<0||e>t.length-1&&0!==e)return!1;if(n===a.ALETTER&&r===a.ALETTER)return!1;var o=t[e+2];if(n===a.ALETTER&&(r===a.MIDLETTER||r===a.MIDNUMLET||r===a.AT)&&o===a.ALETTER)return!1;var i=t[e-1];return(n!==a.MIDLETTER&&n!==a.MIDNUMLET&&r!==a.AT||r!==a.ALETTER||i!==a.ALETTER)&&((n!==a.NUMERIC&&n!==a.ALETTER||r!==a.NUMERIC&&r!==a.ALETTER)&&((n!==a.MIDNUM&&n!==a.MIDNUMLET||r!==a.NUMERIC||i!==a.NUMERIC)&&((n!==a.NUMERIC||r!==a.MIDNUM&&r!==a.MIDNUMLET||o!==a.NUMERIC)&&(n!==a.EXTEND&&n!==a.FORMAT&&i!==a.EXTEND&&i!==a.FORMAT&&r!==a.EXTEND&&r!==a.FORMAT&&((n!==a.CR||r!==a.LF)&&(n===a.NEWLINE||n===a.CR||n===a.LF||(r===a.NEWLINE||r===a.CR||r===a.LF||(n!==a.KATAKANA||r!==a.KATAKANA)&&((r!==a.EXTENDNUMLET||n!==a.ALETTER&&n!==a.NUMERIC&&n!==a.KATAKANA&&n!==a.EXTENDNUMLET)&&((n!==a.EXTENDNUMLET||r!==a.ALETTER&&r!==a.NUMERIC&&r!==a.KATAKANA)&&n!==a.AT)))))))))},y=s,w=f,x=l,C=function(t){return"http"===t||"https"===t},S=function(t,e){var n;for(n=e;n<t.length;n++)if(w.test(t[n]))break;return n},k=function(t,e){var n=S(t,e+1),r=t.slice(e+1,n).join(y);return"://"===r.substr(0,3)?n:e},O=function(t,e,n,r){for(var o=[],i=[],u=0;u<n.length;++u)if(i.push(t[u]),b(n,u)){var a=e[u];if((r.includeWhitespace||!w.test(a))&&(r.includePunctuation||!x.test(a))){var c=u-i.length+1,s=u+1,l=e.slice(c,s).join(y);if(C(l)){var f=k(e,u),d=t.slice(s,f);Array.prototype.push.apply(i,d),u=f}o.push(i)}i=[]}return o},T=function(){return{includeWhitespace:!1,includePunctuation:!1}},E=function(t,e,o){o=n(n({},T()),o);for(var i=[],u=[],a=0;a<t.length;a++){var c=e(t[a]);c!==r&&(i.push(t[a]),u.push(c))}var s=v(u);return O(i,u,s,o)},_=E,A=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),D=function(t,e){var n=e.getBlockElements(),r=e.getShortEndedElements(),i=function(t){return n[t.nodeName]||r[t.nodeName]},u=[],a="",c=new A(t,t);while(t=c.next())3===t.nodeType?a+=o(t.data):i(t)&&a.length&&(u.push(a),a="");return a.length&&u.push(a),u},N=function(t){return t.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"_").length},R=function(t,n){var r=D(t,n).join("\n");return _(r.split(""),e).length},M=function(t,e){var n=D(t,e).join("");return N(n)},z=function(t,e){var n=D(t,e).join("").replace(/\s/g,"");return N(n)},B=function(t,e){return function(){return e(t.getBody(),t.schema)}},P=function(t,e){return function(){return e(t.selection.getRng().cloneContents(),t.schema)}},H=function(t){return B(t,R)},I=function(t){return{body:{getWordCount:H(t),getCharacterCount:B(t,M),getCharacterCountWithoutSpaces:B(t,z)},selection:{getWordCount:P(t,R),getCharacterCount:P(t,M),getCharacterCountWithoutSpaces:P(t,z)},getCount:H(t)}},L=tinymce.util.Tools.resolve("tinymce.util.Delay"),F=function(t,e){t.fire("wordCountUpdate",{wordCount:{words:e.body.getWordCount(),characters:e.body.getCharacterCount(),charactersWithoutSpaces:e.body.getCharacterCountWithoutSpaces()}})},V=function(t,e){F(t,e)},U=function(t,e,n){var r=L.debounce((function(){return V(t,e)}),n);t.on("init",(function(){V(t,e),L.setEditorTimeout(t,(function(){t.on("SetContent BeforeAddUndo Undo Redo keyup",r)}),0)}))},j=function(t,e){t.windowManager.open({title:"Word Count",body:{type:"panel",items:[{type:"table",header:["Count","Document","Selection"],cells:[["Words",String(e.body.getWordCount()),String(e.selection.getWordCount())],["Characters (no spaces)",String(e.body.getCharacterCountWithoutSpaces()),String(e.selection.getCharacterCountWithoutSpaces())],["Characters",String(e.body.getCharacterCount()),String(e.selection.getCharacterCount())]]}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}]})},W=function(t,e){t.ui.registry.addButton("wordcount",{tooltip:"Word count",icon:"character-count",onAction:function(){return j(t,e)}}),t.ui.registry.addMenuItem("wordcount",{text:"Word count",icon:"character-count",onAction:function(){return j(t,e)}})};function q(e){void 0===e&&(e=300),t.add("wordcount",(function(t){var n=I(t);return W(t,n),U(t,n,e),n}))}q()})()},ec27:function(t,e,n){n("fc39")},f034:function(t,e){(function(t){"use strict";var e=function(t){var e=t,n=function(){return e},r=function(t){e=t};return{get:n,set:r}},n=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=function(t){return{isFullscreen:function(){return null!==t.get()}}},o=function(){},i=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t(e.apply(null,n))}},u=function(t,e){return function(n){return t(e(n))}},a=function(t){return function(){return t}},c=a(!1),s=a(!0),l=function(){return f},f=function(){var t=function(t){return t.isNone()},e=function(t){return t()},n=function(t){return t},r={fold:function(t,e){return t()},is:c,isSome:c,isNone:s,getOr:n,getOrThunk:e,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:a(null),getOrUndefined:a(void 0),or:n,orThunk:e,map:l,each:o,bind:l,exists:c,forall:s,filter:l,equals:t,equals_:t,toArray:function(){return[]},toString:a("none()")};return r}(),d=function(t){var e=a(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:s,isNone:c,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return d(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:f},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(c,(function(e){return n(t,e)}))}};return o},m=function(t){return null===t||void 0===t?f:d(t)},g={some:d,none:l,from:m},h=function(t){var n=e(g.none()),r=function(){n.get().each(t)},o=function(){r(),n.set(g.none())},i=function(t){r(),n.set(g.some(t))},u=function(){return n.get().isSome()};return{clear:o,isSet:u,set:i}},p=function(){return h((function(t){t.unbind()}))},v=function(){var t=e(g.none()),n=function(){t.set(g.none())},r=function(e){t.set(g.some(e))},o=function(e){t.get().each(e)},i=function(){return t.get().isSome()};return{clear:n,set:r,isSet:i,on:o}},b=function(t){var e=typeof t;return null===t?"null":"object"===e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e},y=function(t){return function(e){return b(e)===t}},w=function(t){return function(e){return typeof e===t}},x=y("string"),C=y("array"),S=w("boolean"),k=function(t){return null===t||void 0===t},O=function(t){return!k(t)},T=w("function"),E=w("number"),_=Array.prototype.push,A=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},D=function(t,e){for(var n=0,r=t.length;n<r;n++){var o=t[n];e(o,n)}},N=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},R=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!C(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);_.apply(e,t[n])}return e},M=function(t,e){return R(A(t,e))},z=function(t){return 0===t.length?g.none():g.some(t[0])},B=Object.keys,P=function(t,e){for(var n=B(t),r=0,o=n.length;r<o;r++){var i=n[r],u=t[i];e(u,i)}},H=function(t){return void 0!==t.style&&T(t.style.getPropertyValue)},I=function(e,n){var r=n||t.document,o=r.createElement("div");if(o.innerHTML=e,!o.hasChildNodes()||o.childNodes.length>1)throw t.console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return V(o.childNodes[0])},L=function(e,n){var r=n||t.document,o=r.createElement(e);return V(o)},F=function(e,n){var r=n||t.document,o=r.createTextNode(e);return V(o)},V=function(t){if(null===t||void 0===t)throw new Error("Node cannot be null or undefined");return{dom:a(t)}},U=function(t,e,n){var r=t.dom();return g.from(r.elementFromPoint(e,n)).map(V)},j={fromHtml:I,fromTag:L,fromText:F,fromDom:V,fromPoint:U},W=("undefined"!==typeof t.window?t.window:Function("return this;")(),9),q=11,$=1,G=3,K=function(t){return t.dom().nodeType},X=function(t){return function(e){return K(e)===t}},Y=X($),J=X(G),Q=X(W),Z=X(q),tt=function(t,e){var n=t.dom();if(n.nodeType!==$)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},et=function(t){return t.nodeType!==$&&t.nodeType!==W&&t.nodeType!==q||0===t.childElementCount},nt=function(e,n){var r=void 0===n?t.document:n.dom();return et(r)?[]:A(r.querySelectorAll(e),j.fromDom)},rt=function(t,e){return t.dom()===e.dom()},ot=function(t){return j.fromDom(t.dom().ownerDocument)},it=function(t){return Q(t)?t:ot(t)},ut=function(t){return g.from(t.dom().parentNode).map(j.fromDom)},at=function(t,e){var n=T(e)?e:c,r=t.dom(),o=[];while(null!==r.parentNode&&void 0!==r.parentNode){var i=r.parentNode,u=j.fromDom(i);if(o.push(u),!0===n(u))break;r=i}return o},ct=function(t){var e=function(e){return N(e,(function(e){return!rt(t,e)}))};return ut(t).map(st).map(e).getOr([])},st=function(t){return A(t.dom().childNodes,j.fromDom)},lt=function(t){return Z(t)},ft=T(t.Element.prototype.attachShadow)&&T(t.Node.prototype.getRootNode),dt=a(ft),mt=ft?function(t){return j.fromDom(t.dom().getRootNode())}:it,gt=function(t){var e=mt(t);return lt(e)?g.some(e):g.none()},ht=function(t){return j.fromDom(t.dom().host)},pt=function(t){if(dt()&&O(t.target)){var e=j.fromDom(t.target);if(Y(e)&&vt(j.fromDom(t.target))){var n=t;if(n.composed&&n.composedPath){var r=n.composedPath();if(r)return z(r)}}}return g.from(t.target)},vt=function(t){return O(t.dom().shadowRoot)},bt=function(t){var e=J(t)?t.dom().parentNode:t.dom();return void 0!==e&&null!==e&&null!==e.ownerDocument&>(j.fromDom(e)).fold((function(){return e.ownerDocument.body.contains(e)}),u(bt,ht))},yt=function(e,n,r){if(!(x(r)||S(r)||E(r)))throw t.console.error("Invalid call to Attr.set. Key ",n,":: Value ",r,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(n,r+"")},wt=function(t,e,n){yt(t.dom(),e,n)},xt=function(t,e){var n=t.dom().getAttribute(e);return null===n?void 0:n},Ct=function(t,e){t.dom().removeAttribute(e)},St=function(e,n,r){if(!x(r))throw t.console.error("Invalid call to CSS.set. Property ",n,":: Value ",r,":: Element ",e),new Error("CSS value must be a string: "+r);H(e)&&e.style.setProperty(n,r)},kt=function(t,e){var n=t.dom();P(e,(function(t,e){St(n,e,t)}))},Ot=function(e,n){var r=e.dom(),o=t.window.getComputedStyle(r),i=o.getPropertyValue(n);return""!==i||bt(e)?i:Tt(r,n)},Tt=function(t,e){return H(t)?t.style.getPropertyValue(e):""},Et=function(t,e,n,r,o,i,u){return{target:a(t),x:a(e),y:a(n),stop:r,prevent:o,kill:i,raw:a(u)}},_t=function(t){var e=j.fromDom(pt(t).getOr(t.target)),n=function(){return t.stopPropagation()},r=function(){return t.preventDefault()},o=i(r,n);return Et(e,t.clientX,t.clientY,n,r,o,t)},At=function(t,e){var n=function(n,r){return At(t+n,e+r)};return{left:a(t),top:a(e),translate:n}},Dt=At,Nt=function(e){var n=void 0!==e?e.dom():t.document,r=n.body.scrollLeft||n.documentElement.scrollLeft,o=n.body.scrollTop||n.documentElement.scrollTop;return Dt(r,o)},Rt=function(e){var n=void 0===e?t.window:e;return g.from(n["visualViewport"])},Mt=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},zt=function(e){var n=void 0===e?t.window:e,r=n.document,o=Nt(j.fromDom(r));return Rt(n).fold((function(){var t=n.document.documentElement,e=t.clientWidth,r=t.clientHeight;return Mt(o.left(),o.top(),e,r)}),(function(t){return Mt(Math.max(t.pageLeft,o.left()),Math.max(t.pageTop,o.top()),t.width,t.height)}))},Bt=function(t,e,n){return Rt(n).map((function(e){var n=function(t){return _t(t)};return e.addEventListener(t,n),{unbind:function(){return e.removeEventListener(t,n)}}})).getOrThunk((function(){return{unbind:o}}))},Pt=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Ht=tinymce.util.Tools.resolve("tinymce.Env"),It=tinymce.util.Tools.resolve("tinymce.util.Delay"),Lt=function(t,e){t.fire("FullscreenStateChanged",{state:e})},Ft=function(t,e,n){return N(at(t,n),e)},Vt=function(t,e){return N(ct(t),e)},Ut=function(t){return nt(t)},jt=function(t,e,n){return Ft(t,(function(t){return tt(t,e)}),n)},Wt=function(t,e){return Vt(t,(function(t){return tt(t,e)}))},qt="data-ephox-mobile-fullscreen-style",$t="display:none!important;",Gt="position:absolute!important;",Kt="top:0!important;left:0!important;margin:0!important;padding:0!important;width:100%!important;height:100%!important;overflow:visible!important;",Xt="background-color:rgb(255,255,255)!important;",Yt=Ht.os.isAndroid(),Jt=function(t){var e=Ot(t,"background-color");return void 0!==e&&""!==e?"background-color:"+e+"!important":Xt},Qt=function(t,e,n){var r=function(t){return Wt(t,"*:not(.tox-silver-sink)")},o=function(e){return function(n){var r=xt(n,"style"),o=void 0===r?"no-styles":r.trim();o!==e&&(wt(n,qt,o),kt(n,t.parseStyle(e)))}},i=jt(e,"*"),u=M(i,r),a=Jt(n);D(u,o($t)),D(i,o(Gt+Kt+a));var c=!0===Yt?"":Gt;o(c+Kt+a)(e)},Zt=function(t){var e=Ut("["+qt+"]");D(e,(function(e){var n=xt(e,qt);"no-styles"!==n?kt(e,t.parseStyle(n)):Ct(e,"style"),Ct(e,qt)}))},te=Pt.DOM,ee=function(){var e=zt(t.window);return{x:e.x,y:e.y}},ne=function(e){t.window.scrollTo(e.x,e.y)},re=Rt().fold((function(){return{bind:o,unbind:o}}),(function(e){var n=v(),r=p(),o=p(),i=function(){t.document.body.scrollTop=0,t.document.documentElement.scrollTop=0},u=function(){t.window.requestAnimationFrame((function(){n.on((function(t){return kt(t,{top:e.offsetTop+"px",left:e.offsetLeft+"px",height:e.height+"px",width:e.width+"px"})}))}))},a=It.throttle((function(){i(),u()}),50),c=function(t){n.set(t),a(),r.set(Bt("resize")),o.set(Bt("scroll"))},s=function(){n.on((function(){r.clear(),o.clear()})),n.clear()};return{bind:c,unbind:s}})),oe=function(e,n){var r=t.document.body,o=t.document.documentElement,i=e.getContainer(),u=j.fromDom(i),a=n.get(),c=j.fromDom(e.getBody()),s=Ht.deviceType.isTouch(),l=i.style,f=e.iframeElement,d=f.style,m=function(){s&&Zt(e.dom),te.removeClass(r,"tox-fullscreen"),te.removeClass(o,"tox-fullscreen"),te.removeClass(i,"tox-fullscreen"),re.unbind()};if(a)d.width=a.iframeWidth,d.height=a.iframeHeight,l.width=a.containerWidth,l.height=a.containerHeight,l.top=a.containerTop,l.left=a.containerLeft,ne(a.scrollPos),n.set(null),Lt(e,!1),m(),e.off("remove",m);else{var g={scrollPos:ee(),containerWidth:l.width,containerHeight:l.height,containerTop:l.top,containerLeft:l.left,iframeWidth:d.width,iframeHeight:d.height};s&&Qt(e.dom,u,c),d.width=d.height="100%",l.width=l.height="",te.addClass(r,"tox-fullscreen"),te.addClass(o,"tox-fullscreen"),te.addClass(i,"tox-fullscreen"),re.bind(u),e.on("remove",m),n.set(g),Lt(e,!0)}},ie=function(t,e){t.addCommand("mceFullScreen",(function(){oe(t,e)}))},ue=function(t,e){return function(n){n.setActive(null!==e.get());var r=function(t){return n.setActive(t.state)};return t.on("FullscreenStateChanged",r),function(){return t.off("FullscreenStateChanged",r)}}},ae=function(t,e){t.ui.registry.addToggleMenuItem("fullscreen",{text:"Fullscreen",icon:"fullscreen",shortcut:"Meta+Shift+F",onAction:function(){return t.execCommand("mceFullScreen")},onSetup:ue(t,e)}),t.ui.registry.addToggleButton("fullscreen",{tooltip:"Fullscreen",icon:"fullscreen",onAction:function(){return t.execCommand("mceFullScreen")},onSetup:ue(t,e)})};function ce(){n.add("fullscreen",(function(t){var n=e(null);return t.inline||(ie(t,n),ae(t,n),t.addShortcut("Meta+Shift+F","","mceFullScreen")),r(n)}))}ce()})(window)},f557:function(t,e,n){n("5e4c")},fc39:function(t,e){tinymce.IconManager.add("default",{icons:{"accessibility-check":'<svg width="24" height="24"><path d="M12 2a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2c0-1.1.9-2 2-2zm8 7h-5v12c0 .6-.4 1-1 1a1 1 0 01-1-1v-5c0-.6-.4-1-1-1a1 1 0 00-1 1v5c0 .6-.4 1-1 1a1 1 0 01-1-1V9H4a1 1 0 110-2h16c.6 0 1 .4 1 1s-.4 1-1 1z" fill-rule="nonzero"/></svg>',"action-next":'<svg width="24" height="24"><path fill-rule="nonzero" d="M5.7 7.3a1 1 0 00-1.4 1.4l7.7 7.7 7.7-7.7a1 1 0 10-1.4-1.4L12 13.6 5.7 7.3z"/></svg>',"action-prev":'<svg width="24" height="24"><path fill-rule="nonzero" d="M18.3 15.7a1 1 0 001.4-1.4L12 6.6l-7.7 7.7a1 1 0 001.4 1.4L12 9.4l6.3 6.3z"/></svg>',"align-center":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm3 4h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 110-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 010-2zm-3-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2z" fill-rule="evenodd"/></svg>',"align-justify":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2z" fill-rule="evenodd"/></svg>',"align-left":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm0 4h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2zm0-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2z" fill-rule="evenodd"/></svg>',"align-none":'<svg width="24" height="24"><path d="M14.2 5L13 7H5a1 1 0 110-2h9.2zm4 0h.8a1 1 0 010 2h-2l1.2-2zm-6.4 4l-1.2 2H5a1 1 0 010-2h6.8zm4 0H19a1 1 0 010 2h-4.4l1.2-2zm-6.4 4l-1.2 2H5a1 1 0 010-2h4.4zm4 0H19a1 1 0 010 2h-6.8l1.2-2zM7 17l-1.2 2H5a1 1 0 010-2h2zm4 0h8a1 1 0 010 2H9.8l1.2-2zm5.2-13.5l1.3.7-9.7 16.3-1.3-.7 9.7-16.3z" fill-rule="evenodd"/></svg>',"align-right":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm6 4h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm-6-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2z" fill-rule="evenodd"/></svg>',"arrow-left":'<svg width="24" height="24"><path d="M5.6 13l12 6a1 1 0 001.4-1V6a1 1 0 00-1.4-.9l-12 6a1 1 0 000 1.8z" fill-rule="evenodd"/></svg>',"arrow-right":'<svg width="24" height="24"><path d="M18.5 13l-12 6A1 1 0 015 18V6a1 1 0 011.4-.9l12 6a1 1 0 010 1.8z" fill-rule="evenodd"/></svg>',bold:'<svg width="24" height="24"><path d="M7.8 19c-.3 0-.5 0-.6-.2l-.2-.5V5.7c0-.2 0-.4.2-.5l.6-.2h5c1.5 0 2.7.3 3.5 1 .7.6 1.1 1.4 1.1 2.5a3 3 0 01-.6 1.9c-.4.6-1 1-1.6 1.2.4.1.9.3 1.3.6s.8.7 1 1.2c.4.4.5 1 .5 1.6 0 1.3-.4 2.3-1.3 3-.8.7-2.1 1-3.8 1H7.8zm5-8.3c.6 0 1.2-.1 1.6-.5.4-.3.6-.7.6-1.3 0-1.1-.8-1.7-2.3-1.7H9.3v3.5h3.4zm.5 6c.7 0 1.3-.1 1.7-.4.4-.4.6-.9.6-1.5s-.2-1-.7-1.4c-.4-.3-1-.4-2-.4H9.4v3.8h4z" fill-rule="evenodd"/></svg>',bookmark:'<svg width="24" height="24"><path d="M6 4v17l6-4 6 4V4c0-.6-.4-1-1-1H7a1 1 0 00-1 1z" fill-rule="nonzero"/></svg>',"border-width":'<svg width="24" height="24"><path d="M5 14.8h14a1 1 0 010 2H5a1 1 0 010-2zm-.5 3.7h15c.3 0 .5.2.5.5s-.2.5-.5.5h-15a.5.5 0 110-1zm.5-8.3h14c.6 0 1 .4 1 1v1c0 .5-.4 1-1 1H5a1 1 0 01-1-1v-1c0-.6.4-1 1-1zm0-5.7h14c.6 0 1 .4 1 1v2c0 .6-.4 1-1 1H5a1 1 0 01-1-1v-2c0-.6.4-1 1-1z" fill-rule="evenodd"/></svg>',brightness:'<svg width="24" height="24"><path d="M12 17c.3 0 .5.1.7.3.2.2.3.4.3.7v1c0 .3-.1.5-.3.7a1 1 0 01-.7.3 1 1 0 01-.7-.3 1 1 0 01-.3-.7v-1c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3zm0-10a1 1 0 01-.7-.3A1 1 0 0111 6V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3.3 0 .5.1.7.3.2.2.3.4.3.7v1c0 .3-.1.5-.3.7a1 1 0 01-.7.3zm7 4c.3 0 .5.1.7.3.2.2.3.4.3.7 0 .3-.1.5-.3.7a1 1 0 01-.7.3h-1a1 1 0 01-.7-.3 1 1 0 01-.3-.7c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h1zM7 12c0 .3-.1.5-.3.7a1 1 0 01-.7.3H5a1 1 0 01-.7-.3A1 1 0 014 12c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h1c.3 0 .5.1.7.3.2.2.3.4.3.7zm10 3.5l.7.8c.2.1.3.4.3.6 0 .3-.1.6-.3.8a1 1 0 01-.8.3 1 1 0 01-.6-.3l-.8-.7a1 1 0 01-.3-.8c0-.2.1-.5.3-.7a1 1 0 011.4 0zm-10-7l-.7-.8a1 1 0 01-.3-.6c0-.3.1-.6.3-.8.2-.2.5-.3.8-.3.2 0 .5.1.7.3l.7.7c.2.2.3.5.3.8 0 .2-.1.5-.3.7a1 1 0 01-.7.3 1 1 0 01-.8-.3zm10 0a1 1 0 01-.8.3 1 1 0 01-.7-.3 1 1 0 01-.3-.7c0-.3.1-.6.3-.8l.8-.7c.1-.2.4-.3.6-.3.3 0 .6.1.8.3.2.2.3.5.3.8 0 .2-.1.5-.3.7l-.7.7zm-10 7c.2-.2.5-.3.8-.3.2 0 .5.1.7.3a1 1 0 010 1.4l-.8.8a1 1 0 01-.6.3 1 1 0 01-.8-.3 1 1 0 01-.3-.8c0-.2.1-.5.3-.6l.7-.8zM12 8a4 4 0 013.7 2.4 4 4 0 010 3.2A4 4 0 0112 16a4 4 0 01-3.7-2.4 4 4 0 010-3.2A4 4 0 0112 8zm0 6.5c.7 0 1.3-.2 1.8-.7.5-.5.7-1.1.7-1.8s-.2-1.3-.7-1.8c-.5-.5-1.1-.7-1.8-.7s-1.3.2-1.8.7c-.5.5-.7 1.1-.7 1.8s.2 1.3.7 1.8c.5.5 1.1.7 1.8.7z" fill-rule="evenodd"/></svg>',browse:'<svg width="24" height="24"><path d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2h-4v-2h4V8H5v10h4v2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm-8 9.4l-2.3 2.3a1 1 0 11-1.4-1.4l4-4a1 1 0 011.4 0l4 4a1 1 0 01-1.4 1.4L13 13.4V20a1 1 0 01-2 0v-6.6z" fill-rule="nonzero"/></svg>',cancel:'<svg width="24" height="24"><path d="M12 4.6a7.4 7.4 0 110 14.8 7.4 7.4 0 010-14.8zM12 3a9 9 0 100 18 9 9 0 000-18zm0 8L14.8 8l1 1.1-2.7 2.8 2.7 2.7-1.1 1.1-2.7-2.7-2.7 2.7-1-1.1 2.6-2.7-2.7-2.7 1-1.1 2.8 2.7z" fill-rule="nonzero"/></svg>',"change-case":'<svg width="24" height="24"><path d="M18.4 18.2v-.6c-.5.8-1.3 1.2-2.4 1.2-2.2 0-3.3-1.6-3.3-4.8 0-3.1 1-4.7 3.3-4.7 1.1 0 1.8.3 2.4 1.1v-.6c0-.5.4-.8.8-.8s.8.3.8.8v8.4c0 .5-.4.8-.8.8a.8.8 0 01-.8-.8zm-2-7.4c-1.3 0-1.8.9-1.8 3.2 0 2.4.5 3.3 1.7 3.3 1.3 0 1.8-.9 1.8-3.2 0-2.4-.5-3.3-1.7-3.3zM10 15.7H5.5l-.8 2.6a1 1 0 01-1 .7h-.2a.7.7 0 01-.7-1l4-12a1 1 0 012 0l4 12a.7.7 0 01-.8 1h-.2a1 1 0 01-1-.7l-.8-2.6zm-.3-1.5l-2-6.5-1.9 6.5h3.9z" fill-rule="evenodd"/></svg>',"character-count":'<svg width="24" height="24"><path d="M4 11.5h16v1H4v-1zm4.8-6.8V10H7.7V5.8h-1v-1h2zM11 8.3V9h2v1h-3V7.7l2-1v-.9h-2v-1h3v2.4l-2 1zm6.3-3.4V10h-3.1V9h2.1V8h-2.1V6.8h2.1v-1h-2.1v-1h3.1zM5.8 16.4c0-.5.2-.8.5-1 .2-.2.6-.3 1.2-.3l.8.1c.2 0 .4.2.5.3l.4.4v2.8l.2.3H8.2v-.1-.2l-.6.3H7c-.4 0-.7 0-1-.2a1 1 0 01-.3-.9c0-.3 0-.6.3-.8.3-.2.7-.4 1.2-.4l.6-.2h.3v-.2l-.1-.2a.8.8 0 00-.5-.1 1 1 0 00-.4 0l-.3.4h-1zm2.3.8h-.2l-.2.1-.4.1a1 1 0 00-.4.2l-.2.2.1.3.5.1h.4l.4-.4v-.6zm2-3.4h1.2v1.7l.5-.3h.5c.5 0 .9.1 1.2.5.3.4.5.8.5 1.4 0 .6-.2 1.1-.5 1.5-.3.4-.7.6-1.3.6l-.6-.1-.4-.4v.4h-1.1v-5.4zm1.1 3.3c0 .3 0 .6.2.8a.7.7 0 001.2 0l.2-.8c0-.4 0-.6-.2-.8a.7.7 0 00-.6-.3l-.6.3-.2.8zm6.1-.5c0-.2 0-.3-.2-.4a.8.8 0 00-.5-.2c-.3 0-.5.1-.6.3l-.2.9c0 .3 0 .6.2.8.1.2.3.3.6.3.2 0 .4 0 .5-.2l.2-.4h1.1c0 .5-.3.8-.6 1.1a2 2 0 01-1.3.4c-.5 0-1-.2-1.3-.6a2 2 0 01-.5-1.4c0-.6.1-1.1.5-1.5.3-.4.8-.5 1.4-.5.5 0 1 0 1.2.3.4.3.5.7.5 1.2h-1v-.1z" fill-rule="evenodd"/></svg>',"checklist-rtl":'<svg width="24" height="24"><path d="M5 17h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm14.2 11c.2-.4.6-.5.9-.3.3.2.4.6.2 1L18 20c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 010-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L18 14c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 010-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L18 8c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 010-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8z" fill-rule="evenodd"/></svg>',checklist:'<svg width="24" height="24"><path d="M11 17h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0-6h8a1 1 0 010 2h-8a1 1 0 010-2zM7.2 16c.2-.4.6-.5.9-.3.3.2.4.6.2 1L6 20c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 010-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L6 14c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 010-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L6 8c-.2.3-.7.4-1 0L3.8 6.9a.7.7 0 010-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8z" fill-rule="evenodd"/></svg>',checkmark:'<svg width="24" height="24"><path d="M18.2 5.4a1 1 0 011.6 1.2l-8 12a1 1 0 01-1.5.1l-5-5a1 1 0 111.4-1.4l4.1 4.1 7.4-11z" fill-rule="nonzero"/></svg>',"chevron-down":'<svg width="10" height="10"><path d="M8.7 2.2c.3-.3.8-.3 1 0 .4.4.4.9 0 1.2L5.7 7.8c-.3.3-.9.3-1.2 0L.2 3.4a.8.8 0 010-1.2c.3-.3.8-.3 1.1 0L5 6l3.7-3.8z" fill-rule="nonzero"/></svg>',"chevron-left":'<svg width="10" height="10"><path d="M7.8 1.3L4 5l3.8 3.7c.3.3.3.8 0 1-.4.4-.9.4-1.2 0L2.2 5.7a.8.8 0 010-1.2L6.6.2C7 0 7.4 0 7.8.2c.3.3.3.8 0 1.1z" fill-rule="nonzero"/></svg>',"chevron-right":'<svg width="10" height="10"><path d="M2.2 1.3a.8.8 0 010-1c.4-.4.9-.4 1.2 0l4.4 4.1c.3.4.3.9 0 1.2L3.4 9.8c-.3.3-.8.3-1.2 0a.8.8 0 010-1.1L6 5 2.2 1.3z" fill-rule="nonzero"/></svg>',"chevron-up":'<svg width="10" height="10"><path d="M8.7 7.8L5 4 1.3 7.8c-.3.3-.8.3-1 0a.8.8 0 010-1.2l4.1-4.4c.3-.3.9-.3 1.2 0l4.2 4.4c.3.3.3.9 0 1.2-.3.3-.8.3-1.1 0z" fill-rule="nonzero"/></svg>',close:'<svg width="24" height="24"><path d="M17.3 8.2L13.4 12l3.9 3.8a1 1 0 01-1.5 1.5L12 13.4l-3.8 3.9a1 1 0 01-1.5-1.5l3.9-3.8-3.9-3.8a1 1 0 011.5-1.5l3.8 3.9 3.8-3.9a1 1 0 011.5 1.5z" fill-rule="evenodd"/></svg>',"code-sample":'<svg width="24" height="26"><path d="M7.1 11a2.8 2.8 0 01-.8 2 2.8 2.8 0 01.8 2v1.7c0 .3.1.6.4.8.2.3.5.4.8.4.3 0 .4.2.4.4v.8c0 .2-.1.4-.4.4-.7 0-1.4-.3-2-.8-.5-.6-.8-1.3-.8-2V15c0-.3-.1-.6-.4-.8-.2-.3-.5-.4-.8-.4a.4.4 0 01-.4-.4v-.8c0-.2.2-.4.4-.4.3 0 .6-.1.8-.4.3-.2.4-.5.4-.8V9.3c0-.7.3-1.4.8-2 .6-.5 1.3-.8 2-.8.3 0 .4.2.4.4v.8c0 .2-.1.4-.4.4-.3 0-.6.1-.8.4-.3.2-.4.5-.4.8V11zm9.8 0V9.3c0-.3-.1-.6-.4-.8-.2-.3-.5-.4-.8-.4a.4.4 0 01-.4-.4V7c0-.2.1-.4.4-.4.7 0 1.4.3 2 .8.5.6.8 1.3.8 2V11c0 .3.1.6.4.8.2.3.5.4.8.4.2 0 .4.2.4.4v.8c0 .2-.2.4-.4.4-.3 0-.6.1-.8.4-.3.2-.4.5-.4.8v1.7c0 .7-.3 1.4-.8 2-.6.5-1.3.8-2 .8a.4.4 0 01-.4-.4v-.8c0-.2.1-.4.4-.4.3 0 .6-.1.8-.4.3-.2.4-.5.4-.8V15a2.8 2.8 0 01.8-2 2.8 2.8 0 01-.8-2zm-3.3-.4c0 .4-.1.8-.5 1.1-.3.3-.7.5-1.1.5-.4 0-.8-.2-1.1-.5-.4-.3-.5-.7-.5-1.1 0-.5.1-.9.5-1.2.3-.3.7-.4 1.1-.4.4 0 .8.1 1.1.4.4.3.5.7.5 1.2zM12 13c.4 0 .8.1 1.1.5.4.3.5.7.5 1.1 0 1-.1 1.6-.5 2a3 3 0 01-1.1 1c-.4.3-.8.4-1.1.4a.5.5 0 01-.5-.5V17a3 3 0 001-.2l.6-.6c-.6 0-1-.2-1.3-.5-.2-.3-.3-.7-.3-1 0-.5.1-1 .5-1.2.3-.4.7-.5 1.1-.5z" fill-rule="evenodd"/></svg>',"color-levels":'<svg width="24" height="24"><path d="M17.5 11.4A9 9 0 0118 14c0 .5 0 1-.2 1.4 0 .4-.3.9-.5 1.3a6.2 6.2 0 01-3.7 3 5.7 5.7 0 01-3.2 0A5.9 5.9 0 017.6 18a6.2 6.2 0 01-1.4-2.6 6.7 6.7 0 010-2.8c0-.4.1-.9.3-1.3a13.6 13.6 0 012.3-4A20 20 0 0112 4a26.4 26.4 0 013.2 3.4 18.2 18.2 0 012.3 4zm-2 4.5c.4-.7.5-1.4.5-2a7.3 7.3 0 00-1-3.2c.2.6.2 1.2.2 1.9a4.5 4.5 0 01-1.3 3 5.3 5.3 0 01-2.3 1.5 4.9 4.9 0 01-2 .1 4.3 4.3 0 002.4.8 4 4 0 002-.6 4 4 0 001.5-1.5z" fill-rule="evenodd"/></svg>',"color-picker":'<svg width="24" height="24"><path d="M12 3a9 9 0 000 18 1.5 1.5 0 001.1-2.5c-.2-.3-.4-.6-.4-1 0-.8.7-1.5 1.5-1.5H16a5 5 0 005-5c0-4.4-4-8-9-8zm-5.5 9a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm3-4a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm5 0a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm3 4a1.5 1.5 0 110-3 1.5 1.5 0 010 3z" fill-rule="nonzero"/></svg>',"color-swatch-remove-color":'<svg width="24" height="24"><path stroke="#000" stroke-width="2" d="M21 3L3 21" fill-rule="evenodd"/></svg>',"color-swatch":'<svg width="24" height="24"><rect x="3" y="3" width="18" height="18" rx="1" fill-rule="evenodd"/></svg>',"comment-add":'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M9 19l3-2h7c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H5a1 1 0 00-1 1v10c0 .6.4 1 1 1h4v2zm-2 4v-4H5a3 3 0 01-3-3V6a3 3 0 013-3h14a3 3 0 013 3v10a3 3 0 01-3 3h-6.4L7 23z"/><path d="M13 10h2a1 1 0 010 2h-2v2a1 1 0 01-2 0v-2H9a1 1 0 010-2h2V8a1 1 0 012 0v2z"/></g></svg>',comment:'<svg width="24" height="24"><path fill-rule="nonzero" d="M9 19l3-2h7c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H5a1 1 0 00-1 1v10c0 .6.4 1 1 1h4v2zm-2 4v-4H5a3 3 0 01-3-3V6a3 3 0 013-3h14a3 3 0 013 3v10a3 3 0 01-3 3h-6.4L7 23z"/></svg>',contrast:'<svg width="24" height="24"><path d="M12 4a7.8 7.8 0 015.7 2.3A8 8 0 1112 4zm-6 8a6 6 0 006 6V6a6 6 0 00-6 6z" fill-rule="evenodd"/></svg>',copy:'<svg width="24" height="24"><path d="M16 3H6a2 2 0 00-2 2v11h2V5h10V3zm1 4a2 2 0 012 2v10a2 2 0 01-2 2h-7a2 2 0 01-2-2V9c0-1.2.9-2 2-2h7zm0 12V9h-7v10h7z" fill-rule="nonzero"/></svg>',crop:'<svg width="24" height="24"><path d="M17 8v7h2c.6 0 1 .4 1 1s-.4 1-1 1h-2v2c0 .6-.4 1-1 1a1 1 0 01-1-1v-2H7V9H5a1 1 0 110-2h2V5c0-.6.4-1 1-1s1 .4 1 1v2h7l3-3 1 1-3 3zM9 9v5l5-5H9zm1 6h5v-5l-5 5z" fill-rule="evenodd"/></svg>',"cut-column":'<svg width="24" height="24"><path fill-rule="evenodd" d="M7.2 4.5c.9 0 1.6.4 2.2 1A3.7 3.7 0 0110.5 8v.5l1 1 4-4 1-.5a3.3 3.3 0 012 0c.4 0 .7.3 1 .5L17 8h4v13h-6V10l-1.5 1.5.5.5v4l-2.5-2.5-1 1v.5c0 .4 0 .8-.3 1.2-.2.5-.4.9-.8 1.2-.6.7-1.3 1-2.2 1-.8.2-1.5 0-2-.6l-.5-.8-.2-1c0-.4 0-.8.3-1.2A3.9 3.9 0 017 12.7c.5-.2 1-.3 1.5-.2l1-1-1-1c-.5 0-1 0-1.5-.2-.5-.1-1-.4-1.4-.9-.4-.3-.6-.7-.8-1.2L4.5 7c0-.4 0-.7.2-1 0-.3.3-.6.5-.8.5-.5 1.2-.8 2-.7zm12.3 5h-3v10h3v-10zM8 13.8h-.3l-.4.2a2.8 2.8 0 00-.7.4v.1a2.8 2.8 0 00-.6.8l-.1.4v.7l.2.5.5.2h.7a2.6 2.6 0 00.8-.3 2.4 2.4 0 00.7-.7 2.5 2.5 0 00.3-.8 1.5 1.5 0 000-.8 1 1 0 00-.2-.4 1 1 0 00-.5-.2H8zm3.5-3.7c-.4 0-.7.1-1 .4-.3.3-.4.6-.4 1s.1.7.4 1c.3.3.6.4 1 .4s.7-.1 1-.4c.3-.3.4-.6.4-1s-.1-.7-.4-1c-.3-.3-.6-.4-1-.4zM7 5.8h-.4a1 1 0 00-.5.3 1 1 0 00-.2.5v.7a2.5 2.5 0 00.3.8l.2.3h.1l.4.4.4.2.4.1h.7L9 9l.2-.4a1.6 1.6 0 000-.8 2.6 2.6 0 00-.3-.8A2.5 2.5 0 007.7 6l-.4-.1H7z"/></svg>',"cut-row":'<svg width="24" height="24"><path fill-rule="evenodd" d="M22 3v5H9l3 3 2-2h4l-4 4 1 1h.5c.4 0 .8 0 1.2.3.5.2.9.4 1.2.8.7.6 1 1.3 1 2.2.2.8 0 1.5-.6 2l-.8.5-1 .2c-.4 0-.8 0-1.2-.3a3.9 3.9 0 01-2.1-2.2c-.2-.5-.3-1-.2-1.5l-1-1-1 1c0 .5 0 1-.2 1.5-.1.5-.4 1-.9 1.4-.3.4-.7.6-1.2.8l-1.2.3c-.4 0-.7 0-1-.2-.3 0-.6-.3-.8-.5-.5-.5-.8-1.2-.7-2 0-.9.4-1.6 1-2.2A3.7 3.7 0 018.6 14H9l1-1-4-4-.5-1a3.3 3.3 0 010-2c0-.4.3-.7.5-1l2 2V3h14zM8.5 15.3h-.3a2.6 2.6 0 00-.8.4 2.5 2.5 0 00-.9 1.1l-.1.4v.7l.2.5.5.2h.7a2.5 2.5 0 00.8-.3L9 18V18l.4-.4.2-.4.1-.4v-.3-.4a1 1 0 00-.2-.5 1 1 0 00-.4-.2h-.5zm7 0H15a1 1 0 00-.4.3 1 1 0 00-.2.5 1.5 1.5 0 000 .7v.4a2.8 2.8 0 00.5.7h.1a2.8 2.8 0 00.8.6l.4.1h.7l.5-.2.2-.5v-.4-.3a2.6 2.6 0 00-.3-.8 2.4 2.4 0 00-.7-.7 2.5 2.5 0 00-.8-.3h-.3zM12 11.6c-.4 0-.7.1-1 .4-.3.3-.4.6-.4 1s.1.7.4 1c.3.3.6.4 1 .4s.7-.1 1-.4c.3-.3.4-.6.4-1s-.1-.7-.4-1c-.3-.3-.6-.4-1-.4zm8.5-7.1h-11v2h11v-2z"/></svg>',cut:'<svg width="24" height="24"><path d="M18 15c.6.7 1 1.4 1 2.3 0 .8-.2 1.5-.7 2l-.8.5-1 .2c-.4 0-.8 0-1.2-.3a3.9 3.9 0 01-2.1-2.2c-.2-.5-.3-1-.2-1.5l-1-1-1 1c0 .5 0 1-.2 1.5-.1.5-.4 1-.9 1.4-.3.4-.7.6-1.2.8l-1.2.3c-.4 0-.7 0-1-.2-.3 0-.6-.3-.8-.5-.5-.5-.8-1.2-.7-2 0-.9.4-1.6 1-2.2A3.7 3.7 0 018.6 14H9l1-1-4-4-.5-1a3.3 3.3 0 010-2c0-.4.3-.7.5-1l6 6 6-6 .5 1a3.3 3.3 0 010 2c0 .4-.3.7-.5 1l-4 4 1 1h.5c.4 0 .8 0 1.2.3.5.2.9.4 1.2.8zm-8.5 2.2l.1-.4v-.3-.4a1 1 0 00-.2-.5 1 1 0 00-.4-.2 1.6 1.6 0 00-.8 0 2.6 2.6 0 00-.8.3 2.5 2.5 0 00-.9 1.1l-.1.4v.7l.2.5.5.2h.7a2.5 2.5 0 00.8-.3 2.8 2.8 0 001-1zm2.5-2.8c.4 0 .7-.1 1-.4.3-.3.4-.6.4-1s-.1-.7-.4-1c-.3-.3-.6-.4-1-.4s-.7.1-1 .4c-.3.3-.4.6-.4 1s.1.7.4 1c.3.3.6.4 1 .4zm5.4 4l.2-.5v-.4-.3a2.6 2.6 0 00-.3-.8 2.4 2.4 0 00-.7-.7 2.5 2.5 0 00-.8-.3 1.5 1.5 0 00-.8 0 1 1 0 00-.4.2 1 1 0 00-.2.5 1.5 1.5 0 000 .7v.4l.3.4.3.4a2.8 2.8 0 00.8.5l.4.1h.7l.5-.2z" fill-rule="evenodd"/></svg>',"document-properties":'<svg width="24" height="24"><path d="M14.4 3H7a2 2 0 00-2 2v14c0 1.1.9 2 2 2h10a2 2 0 002-2V7.6L14.4 3zM17 19H7V5h6v4h4v10z" fill-rule="nonzero"/></svg>',drag:'<svg width="24" height="24"><path d="M13 5h2v2h-2V5zm0 4h2v2h-2V9zM9 9h2v2H9V9zm4 4h2v2h-2v-2zm-4 0h2v2H9v-2zm0 4h2v2H9v-2zm4 0h2v2h-2v-2zM9 5h2v2H9V5z" fill-rule="evenodd"/></svg>',"duplicate-column":'<svg width="24" height="24"><path d="M17 6v16h-7V6h7zm-2 2h-3v12h3V8zm-2-6v2H8v15H6V2h7z"/></svg>',"duplicate-row":'<svg width="24" height="24"><path d="M22 11v7H6v-7h16zm-2 2H8v3h12v-3zm-1-6v2H4v5H2V7h17z"/></svg>',duplicate:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M16 3v2H6v11H4V5c0-1.1.9-2 2-2h10zm3 8h-2V9h-7v10h9a2 2 0 01-2 2h-7a2 2 0 01-2-2V9c0-1.2.9-2 2-2h7a2 2 0 012 2v2z"/><path d="M17 14h1a1 1 0 010 2h-1v1a1 1 0 01-2 0v-1h-1a1 1 0 010-2h1v-1a1 1 0 012 0v1z"/></g></svg>',"edit-block":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19.8 8.8l-9.4 9.4c-.2.2-.5.4-.9.4l-5.4 1.2 1.2-5.4.5-.8 9.4-9.4c.7-.7 1.8-.7 2.5 0l2.1 2.1c.7.7.7 1.8 0 2.5zm-2-.2l1-.9v-.3l-2.2-2.2a.3.3 0 00-.3 0l-1 1L18 8.5zm-1 1l-2.5-2.4-6 6 2.5 2.5 6-6zm-7 7.1l-2.6-2.4-.3.3-.1.2-.7 3 3.1-.6h.1l.4-.5z"/></svg>',"edit-image":'<svg width="24" height="24"><path d="M18 16h2V7a2 2 0 00-2-2H7v2h11v9zM6 17h15a1 1 0 010 2h-1v1a1 1 0 01-2 0v-1H6a2 2 0 01-2-2V7H3a1 1 0 110-2h1V4a1 1 0 112 0v13zm3-5.3l1.3 2 3-4.7 3.7 6H7l2-3.3z" fill-rule="nonzero"/></svg>',"embed-page":'<svg width="24" height="24"><path d="M19 6V5H5v14h2A13 13 0 0119 6zm0 1.4c-.8.8-1.6 2.4-2.2 4.6H19V7.4zm0 5.6h-2.4c-.4 1.8-.6 3.8-.6 6h3v-6zm-4 6c0-2.2.2-4.2.6-6H13c-.7 1.8-1.1 3.8-1.1 6h3zm-4 0c0-2.2.4-4.2 1-6H9.6A12 12 0 008 19h3zM4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 01-1-1V4c0-.6.4-1 1-1zm11.8 9c.4-1.9 1-3.4 1.8-4.5a9.2 9.2 0 00-4 4.5h2.2zm-3.4 0a12 12 0 012.8-4 12 12 0 00-5 4h2.2z" fill-rule="nonzero"/></svg>',embed:'<svg width="24" height="24"><path d="M4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 01-1-1V4c0-.6.4-1 1-1zm1 2v14h14V5H5zm4.8 2.6l5.6 4a.5.5 0 010 .8l-5.6 4A.5.5 0 019 16V8a.5.5 0 01.8-.4z" fill-rule="nonzero"/></svg>',emoji:'<svg width="24" height="24"><path d="M9 11c.6 0 1-.4 1-1s-.4-1-1-1a1 1 0 00-1 1c0 .6.4 1 1 1zm6 0c.6 0 1-.4 1-1s-.4-1-1-1a1 1 0 00-1 1c0 .6.4 1 1 1zm-3 5.5c2.1 0 4-1.5 4.4-3.5H7.6c.5 2 2.3 3.5 4.4 3.5zM12 4a8 8 0 100 16 8 8 0 000-16zm0 14.5a6.5 6.5 0 110-13 6.5 6.5 0 010 13z" fill-rule="nonzero"/></svg>',fill:'<svg width="24" height="26"><path d="M16.6 12l-9-9-1.4 1.4 2.4 2.4-5.2 5.1c-.5.6-.5 1.6 0 2.2L9 19.6a1.5 1.5 0 002.2 0l5.5-5.5c.5-.6.5-1.6 0-2.2zM5.2 13L10 8.2l4.8 4.8H5.2zM19 14.5s-2 2.2-2 3.5c0 1.1.9 2 2 2a2 2 0 002-2c0-1.3-2-3.5-2-3.5z" fill-rule="nonzero"/></svg>',"flip-horizontally":'<svg width="24" height="24"><path d="M14 19h2v-2h-2v2zm4-8h2V9h-2v2zM4 7v10c0 1.1.9 2 2 2h3v-2H6V7h3V5H6a2 2 0 00-2 2zm14-2v2h2a2 2 0 00-2-2zm-7 16h2V3h-2v18zm7-6h2v-2h-2v2zm-4-8h2V5h-2v2zm4 12a2 2 0 002-2h-2v2z" fill-rule="nonzero"/></svg>',"flip-vertically":'<svg width="24" height="24"><path d="M5 14v2h2v-2H5zm8 4v2h2v-2h-2zm4-14H7a2 2 0 00-2 2v3h2V6h10v3h2V6a2 2 0 00-2-2zm2 14h-2v2a2 2 0 002-2zM3 11v2h18v-2H3zm6 7v2h2v-2H9zm8-4v2h2v-2h-2zM5 18c0 1.1.9 2 2 2v-2H5z" fill-rule="nonzero"/></svg>',"format-painter":'<svg width="24" height="24"><path d="M18 5V4c0-.5-.4-1-1-1H5a1 1 0 00-1 1v4c0 .6.5 1 1 1h12c.6 0 1-.4 1-1V7h1v4H9v9c0 .6.4 1 1 1h2c.6 0 1-.4 1-1v-7h8V5h-3z" fill-rule="nonzero"/></svg>',format:'<svg width="24" height="24"><path fill-rule="evenodd" d="M17 5a1 1 0 010 2h-4v11a1 1 0 01-2 0V7H7a1 1 0 110-2h10z"/></svg>',fullscreen:'<svg width="24" height="24"><path d="M15.3 10l-1.2-1.3 2.9-3h-2.3a.9.9 0 110-1.7H19c.5 0 .9.4.9.9v4.4a.9.9 0 11-1.8 0V7l-2.9 3zm0 4l3 3v-2.3a.9.9 0 111.7 0V19c0 .5-.4.9-.9.9h-4.4a.9.9 0 110-1.8H17l-3-2.9 1.3-1.2zM10 15.4l-2.9 3h2.3a.9.9 0 110 1.7H5a.9.9 0 01-.9-.9v-4.4a.9.9 0 111.8 0V17l2.9-3 1.2 1.3zM8.7 10L5.7 7v2.3a.9.9 0 01-1.7 0V5c0-.5.4-.9.9-.9h4.4a.9.9 0 010 1.8H7l3 2.9-1.3 1.2z" fill-rule="nonzero"/></svg>',gallery:'<svg width="24" height="24"><path fill-rule="nonzero" d="M5 15.7l2.3-2.2c.3-.3.7-.3 1 0L11 16l5.1-5c.3-.4.8-.4 1 0l2 1.9V8H5v7.7zM5 18V19h3l1.8-1.9-2-2L5 17.9zm14-3l-2.5-2.4-6.4 6.5H19v-4zM4 6h16c.6 0 1 .4 1 1v13c0 .6-.4 1-1 1H4a1 1 0 01-1-1V7c0-.6.4-1 1-1zm6 7a2 2 0 110-4 2 2 0 010 4zM4.5 4h15a.5.5 0 110 1h-15a.5.5 0 010-1zm2-2h11a.5.5 0 110 1h-11a.5.5 0 010-1z"/></svg>',gamma:'<svg width="24" height="24"><path d="M4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 01-1-1V4c0-.6.4-1 1-1zm1 2v14h14V5H5zm6.5 11.8V14L9.2 8.7a5.1 5.1 0 00-.4-.8l-.1-.2H8 8v-1l.3-.1.3-.1h.7a1 1 0 01.6.5l.1.3a8.5 8.5 0 01.3.6l1.9 4.6 2-5.2a1 1 0 011-.6.5.5 0 01.5.6L13 14v2.8a.7.7 0 01-1.4 0z" fill-rule="nonzero"/></svg>',help:'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M12 5.5a6.5 6.5 0 00-6 9 6.3 6.3 0 001.4 2l1 1a6.3 6.3 0 003.6 1 6.5 6.5 0 006-9 6.3 6.3 0 00-1.4-2l-1-1a6.3 6.3 0 00-3.6-1zM12 4a7.8 7.8 0 015.7 2.3A8 8 0 1112 4z"/><path d="M9.6 9.7a.7.7 0 01-.7-.8c0-1.1 1.5-1.8 3.2-1.8 1.8 0 3.2.8 3.2 2.4 0 1.4-.4 2.1-1.5 2.8-.2 0-.3.1-.3.2a2 2 0 00-.8.8.8.8 0 01-1.4-.6c.3-.7.8-1 1.3-1.5l.4-.2c.7-.4.8-.6.8-1.5 0-.5-.6-.9-1.7-.9-.5 0-1 .1-1.4.3-.2 0-.3.1-.3.2v-.2c0 .4-.4.8-.8.8z" fill-rule="nonzero"/><circle cx="12" cy="16" r="1"/></g></svg>',"highlight-bg-color":'<svg width="24" height="24"><g fill-rule="evenodd"><path id="tox-icon-highlight-bg-color__color" d="M3 18h18v3H3z"/><path fill-rule="nonzero" d="M7.7 16.7H3l3.3-3.3-.7-.8L10.2 8l4 4.1-4 4.2c-.2.2-.6.2-.8 0l-.6-.7-1.1 1.1zm5-7.5L11 7.4l3-2.9a2 2 0 012.6 0L18 6c.7.7.7 2 0 2.7l-2.9 2.9-1.8-1.8-.5-.6"/></g></svg>',home:'<svg width="24" height="24"><path fill-rule="nonzero" d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/></svg>',"horizontal-rule":'<svg width="24" height="24"><path d="M4 11h16v2H4z" fill-rule="evenodd"/></svg>',"image-options":'<svg width="24" height="24"><path d="M6 10a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2zm12 0a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2zm-6 0a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2z" fill-rule="nonzero"/></svg>',image:'<svg width="24" height="24"><path d="M5 15.7l3.3-3.2c.3-.3.7-.3 1 0L12 15l4.1-4c.3-.4.8-.4 1 0l2 1.9V5H5v10.7zM5 18V19h3l2.8-2.9-2-2L5 17.9zm14-3l-2.5-2.4-6.4 6.5H19v-4zM4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 01-1-1V4c0-.6.4-1 1-1zm6 8a2 2 0 100-4 2 2 0 000 4z" fill-rule="nonzero"/></svg>',indent:'<svg width="24" height="24"><path d="M7 5h12c.6 0 1 .4 1 1s-.4 1-1 1H7a1 1 0 110-2zm5 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm0 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm-5 4h12a1 1 0 010 2H7a1 1 0 010-2zm-2.6-3.8L6.2 12l-1.8-1.2a1 1 0 011.2-1.6l3 2a1 1 0 010 1.6l-3 2a1 1 0 11-1.2-1.6z" fill-rule="evenodd"/></svg>',info:'<svg width="24" height="24"><path d="M12 4a7.8 7.8 0 015.7 2.3A8 8 0 1112 4zm-1 3v2h2V7h-2zm3 10v-1h-1v-5h-3v1h1v4h-1v1h4z" fill-rule="evenodd"/></svg>',"insert-character":'<svg width="24" height="24"><path d="M15 18h4l1-2v4h-6v-3.3l1.4-1a6 6 0 001.8-2.9 6.3 6.3 0 00-.1-4.1 5.8 5.8 0 00-3-3.2c-.6-.3-1.3-.5-2.1-.5a5.1 5.1 0 00-3.9 1.8 6.3 6.3 0 00-1.3 6 6.2 6.2 0 001.8 3l1.4.9V20H4v-4l1 2h4v-.5l-2-1L5.4 15A6.5 6.5 0 014 11c0-1 .2-1.9.6-2.7A7 7 0 016.3 6C7.1 5.4 8 5 9 4.5c1-.3 2-.5 3.1-.5a8.8 8.8 0 015.7 2 7 7 0 011.7 2.3 6 6 0 01.2 4.8c-.2.7-.6 1.3-1 1.9a7.6 7.6 0 01-3.6 2.5v.5z" fill-rule="evenodd"/></svg>',"insert-time":'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M12 19a7 7 0 100-14 7 7 0 000 14zm0 2a9 9 0 110-18 9 9 0 010 18z"/><path d="M16 12h-3V7c0-.6-.4-1-1-1a1 1 0 00-1 1v7h5c.6 0 1-.4 1-1s-.4-1-1-1z"/></g></svg>',invert:'<svg width="24" height="24"><path d="M18 19.3L16.5 18a5.8 5.8 0 01-3.1 1.9 6.1 6.1 0 01-5.5-1.6A5.8 5.8 0 016 14v-.3l.1-1.2A13.9 13.9 0 017.7 9l-3-3 .7-.8 2.8 2.9 9 8.9 1.5 1.6-.7.6zm0-5.5v.3l-.1 1.1-.4 1-1.2-1.2a4.3 4.3 0 00.2-1v-.2c0-.4 0-.8-.2-1.3l-.5-1.4a14.8 14.8 0 00-3-4.2L12 6a26.1 26.1 0 00-2.2 2.5l-1-1a20.9 20.9 0 012.9-3.3L12 4l1 .8a22.2 22.2 0 014 5.4c.6 1.2 1 2.4 1 3.6z" fill-rule="evenodd"/></svg>',italic:'<svg width="24" height="24"><path d="M16.7 4.7l-.1.9h-.3c-.6 0-1 0-1.4.3-.3.3-.4.6-.5 1.1l-2.1 9.8v.6c0 .5.4.8 1.4.8h.2l-.2.8H8l.2-.8h.2c1.1 0 1.8-.5 2-1.5l2-9.8.1-.5c0-.6-.4-.8-1.4-.8h-.3l.2-.9h5.8z" fill-rule="evenodd"/></svg>',line:'<svg width="24" height="24"><path d="M15 9l-8 8H4v-3l8-8 3 3zm1-1l-3-3 1-1h1c-.2 0 0 0 0 0l2 2s0 .2 0 0v1l-1 1zM4 18h16v2H4v-2z" fill-rule="evenodd"/></svg>',link:'<svg width="24" height="24"><path d="M6.2 12.3a1 1 0 011.4 1.4l-2.1 2a2 2 0 102.7 2.8l4.8-4.8a1 1 0 000-1.4 1 1 0 111.4-1.3 2.9 2.9 0 010 4L9.6 20a3.9 3.9 0 01-5.5-5.5l2-2zm11.6-.6a1 1 0 01-1.4-1.4l2-2a2 2 0 10-2.6-2.8L11 10.3a1 1 0 000 1.4A1 1 0 119.6 13a2.9 2.9 0 010-4L14.4 4a3.9 3.9 0 015.5 5.5l-2 2z" fill-rule="nonzero"/></svg>',"list-bull-circle":'<svg width="48" height="48"><g fill-rule="evenodd"><path d="M11 16a2 2 0 100-4 2 2 0 000 4zm0 1a3 3 0 110-6 3 3 0 010 6zM11 26a2 2 0 100-4 2 2 0 000 4zm0 1a3 3 0 110-6 3 3 0 010 6zM11 36a2 2 0 100-4 2 2 0 000 4zm0 1a3 3 0 110-6 3 3 0 010 6z" fill-rule="nonzero"/><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/></g></svg>',"list-bull-default":'<svg width="48" height="48"><g fill-rule="evenodd"><circle cx="11" cy="14" r="3"/><circle cx="11" cy="24" r="3"/><circle cx="11" cy="34" r="3"/><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/></g></svg>',"list-bull-square":'<svg width="48" height="48"><g fill-rule="evenodd"><path d="M8 11h6v6H8zM8 21h6v6H8zM8 31h6v6H8z"/><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/></g></svg>',"list-num-default-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M37.4 17v-4.8l-1.6 1v-1.1l1.6-1h1.2V17zM33.3 17.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm1.7 5.7c0-1.2 1-2 2.2-2 1.3 0 2.1.8 2.1 1.8 0 .7-.3 1.2-1.3 2.2l-1.2 1v.2h2.6v1h-4.3v-.9l2-1.9c.8-.8 1-1.1 1-1.5 0-.5-.4-.8-1-.8-.5 0-.9.3-.9.9H35zm-1.7 4.3c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm3.2 7.3v-1h.7c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7s-1 .3-1 .8H35c0-1.1 1-1.8 2.2-1.8 1.2 0 2.1.6 2.1 1.6 0 .7-.4 1.2-1 1.3v.1c.7.1 1.3.7 1.3 1.4 0 1-1 1.9-2.4 1.9-1.3 0-2.2-.8-2.3-2h1.2c0 .6.5 1 1.1 1 .6 0 1-.4 1-1 0-.5-.3-.8-1-.8h-.7zm-3.3 2.7c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7z"/></g></svg>',"list-num-default":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M10 17v-4.8l-1.5 1v-1.1l1.6-1h1.2V17h-1.2zm3.6.1c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7zm-5 5.7c0-1.2.8-2 2.1-2s2.1.8 2.1 1.8c0 .7-.3 1.2-1.4 2.2l-1.1 1v.2h2.6v1H8.6v-.9l2-1.9c.8-.8 1-1.1 1-1.5 0-.5-.4-.8-1-.8-.5 0-.9.3-.9.9H8.5zm6.3 4.3c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zM10 34.4v-1h.7c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7s-1 .3-1 .8H8.6c0-1.1 1-1.8 2.2-1.8 1.3 0 2.1.6 2.1 1.6 0 .7-.4 1.2-1 1.3v.1c.8.1 1.3.7 1.3 1.4 0 1-1 1.9-2.4 1.9-1.3 0-2.2-.8-2.3-2h1.2c0 .6.5 1 1.1 1 .7 0 1-.4 1-1 0-.5-.3-.8-1-.8h-.7zm4.7 2.7c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7z"/></g></svg>',"list-num-lower-alpha-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M36.5 16c-.9 0-1.5-.5-1.5-1.3s.6-1.3 1.8-1.4h1v-.4c0-.4-.2-.6-.7-.6-.4 0-.7.1-.8.4h-1.1c0-.8.8-1.4 2-1.4S39 12 39 13V16h-1.2v-.6c-.3.4-.8.7-1.4.7zm.4-.8c.6 0 1-.4 1-.9V14h-1c-.5.1-.7.3-.7.6 0 .4.3.6.7.6zM33.1 16.1c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7zM37.7 26c-.7 0-1.2-.2-1.5-.7v.7H35v-6.3h1.2v2.5c.3-.5.8-.9 1.5-.9 1.1 0 1.8 1 1.8 2.4 0 1.5-.7 2.4-1.8 2.4zm-.5-3.6c-.6 0-1 .5-1 1.3s.4 1.4 1 1.4c.7 0 1-.6 1-1.4 0-.8-.3-1.3-1-1.3zM33.2 26.1c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7zm6 7h-1c-.1-.5-.4-.8-1-.8s-1 .5-1 1.4c0 1 .4 1.4 1 1.4.5 0 .9-.2 1-.7h1c0 1-.8 1.7-2 1.7-1.4 0-2.2-.9-2.2-2.4s.8-2.4 2.2-2.4c1.2 0 2 .7 2 1.7zm-6.1 3c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',"list-num-lower-alpha":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M10.3 15.2c.5 0 1-.4 1-.9V14h-1c-.5.1-.8.3-.8.6 0 .4.3.6.8.6zm-.4.9c-1 0-1.5-.6-1.5-1.4 0-.8.6-1.3 1.7-1.4h1.1v-.4c0-.4-.2-.6-.7-.6-.5 0-.8.1-.9.4h-1c0-.8.8-1.4 2-1.4 1.1 0 1.8.6 1.8 1.6V16h-1.1v-.6h-.1c-.2.4-.7.7-1.3.7zm4.6 0c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm-3.2 10c-.6 0-1.2-.3-1.4-.8v.7H8.5v-6.3H10v2.5c.3-.5.8-.9 1.4-.9 1.2 0 1.9 1 1.9 2.4 0 1.5-.7 2.4-1.9 2.4zm-.4-3.7c-.7 0-1 .5-1 1.3s.3 1.4 1 1.4c.6 0 1-.6 1-1.4 0-.8-.4-1.3-1-1.3zm4 3.7c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm-2.2 7h-1.2c0-.5-.4-.8-.9-.8-.6 0-1 .5-1 1.4 0 1 .4 1.4 1 1.4.5 0 .8-.2 1-.7h1c0 1-.8 1.7-2 1.7-1.4 0-2.2-.9-2.2-2.4s.8-2.4 2.2-2.4c1.2 0 2 .7 2 1.7zm1.8 3c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',"list-num-lower-greek-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M37.4 16c-1.2 0-2-.8-2-2.3 0-1.5.8-2.4 2-2.4.6 0 1 .4 1.3 1v-.9H40v3.2c0 .4.1.5.4.5h.2v.9h-.6c-.6 0-1-.2-1-.7h-.2c-.2.4-.7.8-1.3.8zm.3-1c.6 0 1-.5 1-1.3s-.4-1.3-1-1.3-1 .5-1 1.3.4 1.4 1 1.4zM33.3 16.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zM36 21.9c0-1.5.8-2.3 2.1-2.3 1.2 0 2 .6 2 1.6 0 .6-.3 1-.9 1.3.9.3 1.3.8 1.3 1.7 0 1.2-.7 1.9-1.8 1.9-.6 0-1.1-.3-1.4-.8v2.2H36V22zm1.8 1.2v-1h.3c.5 0 .9-.2.9-.7 0-.5-.3-.8-.9-.8-.5 0-.8.3-.8 1v2.2c0 .8.4 1.3 1 1.3s1-.4 1-1-.4-1-1.2-1h-.3zM33.3 26.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zM37.1 34.6L34.8 30h1.4l1.7 3.5 1.7-3.5h1.1l-2.2 4.6v.1c.5.8.7 1.4.7 1.8 0 .4-.2.8-.4 1-.2.2-.6.3-1 .3-.9 0-1.3-.4-1.3-1.2 0-.5.2-1 .5-1.7l.1-.2zm.7 1a2 2 0 00-.4.9c0 .3.1.4.4.4.3 0 .4-.1.4-.4 0-.2-.1-.6-.4-1zM33.3 36.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',"list-num-lower-greek":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M10.5 15c.7 0 1-.5 1-1.3s-.3-1.3-1-1.3c-.5 0-.9.5-.9 1.3s.4 1.4 1 1.4zm-.3 1c-1.1 0-1.8-.8-1.8-2.3 0-1.5.7-2.4 1.8-2.4.7 0 1.1.4 1.3 1h.1v-.9h1.2v3.2c0 .4.1.5.4.5h.2v.9h-.6c-.6 0-1-.2-1.1-.7h-.1c-.2.4-.7.8-1.4.8zm5 .1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7zm-4.9 7v-1h.3c.6 0 1-.2 1-.7 0-.5-.4-.8-1-.8-.5 0-.8.3-.8 1v2.2c0 .8.4 1.3 1.1 1.3.6 0 1-.4 1-1s-.5-1-1.3-1h-.3zM8.6 22c0-1.5.7-2.3 2-2.3 1.2 0 2 .6 2 1.6 0 .6-.3 1-.8 1.3.8.3 1.3.8 1.3 1.7 0 1.2-.8 1.9-1.9 1.9-.6 0-1.1-.3-1.3-.8v2.2H8.5V22zm6.2 4.2c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7zm-4.5 8.5L8 30h1.4l1.7 3.5 1.7-3.5h1.1l-2.2 4.6v.1c.5.8.7 1.4.7 1.8 0 .4-.1.8-.4 1-.2.2-.6.3-1 .3-.9 0-1.3-.4-1.3-1.2 0-.5.2-1 .5-1.7l.1-.2zm.7 1a2 2 0 00-.4.9c0 .3.1.4.4.4.3 0 .4-.1.4-.4 0-.2-.1-.6-.4-1zm4.5.5c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',"list-num-lower-roman-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M32.9 16v-1.2h-1.3V16H33zm0 10v-1.2h-1.3V26H33zm0 10v-1.2h-1.3V36H33z"/><path fill-rule="nonzero" d="M36 21h-1.5v5H36zM36 31h-1.5v5H36zM39 21h-1.5v5H39zM39 31h-1.5v5H39zM42 31h-1.5v5H42zM36 11h-1.5v5H36zM36 19h-1.5v1H36zM36 29h-1.5v1H36zM39 19h-1.5v1H39zM39 29h-1.5v1H39zM42 29h-1.5v1H42zM36 9h-1.5v1H36z"/></g></svg>',"list-num-lower-roman":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M15.1 16v-1.2h1.3V16H15zm0 10v-1.2h1.3V26H15zm0 10v-1.2h1.3V36H15z"/><path fill-rule="nonzero" d="M12 21h1.5v5H12zM12 31h1.5v5H12zM9 21h1.5v5H9zM9 31h1.5v5H9zM6 31h1.5v5H6zM12 11h1.5v5H12zM12 19h1.5v1H12zM12 29h1.5v1H12zM9 19h1.5v1H9zM9 29h1.5v1H9zM6 29h1.5v1H6zM12 9h1.5v1H12z"/></g></svg>',"list-num-upper-alpha-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M39.3 17l-.5-1.4h-2l-.5 1.4H35l2-6h1.6l2 6h-1.3zm-1.6-4.7l-.7 2.3h1.6l-.8-2.3zM33.4 17c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7zm4.7 9.9h-2.7v-6H38c1.2 0 1.9.6 1.9 1.5 0 .6-.5 1.2-1 1.3.7.1 1.3.7 1.3 1.5 0 1-.8 1.7-2 1.7zm-1.4-5v1.5h1c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7h-1zm0 4h1.1c.7 0 1.1-.3 1.1-.8 0-.6-.4-.9-1.1-.9h-1.1V26zM33 27.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm4.9 10c-1.8 0-2.8-1.1-2.8-3.1s1-3.1 2.8-3.1c1.4 0 2.5.9 2.6 2.2h-1.3c0-.7-.6-1.1-1.3-1.1-1 0-1.6.7-1.6 2s.6 2 1.6 2c.7 0 1.2-.4 1.4-1h1.2c-.1 1.3-1.2 2.2-2.6 2.2zm-4.5 0c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',"list-num-upper-alpha":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M12.6 17l-.5-1.4h-2L9.5 17H8.3l2-6H12l2 6h-1.3zM11 12.3l-.7 2.3h1.6l-.8-2.3zm4.7 4.8c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7zM11.4 27H8.7v-6h2.6c1.2 0 1.9.6 1.9 1.5 0 .6-.5 1.2-1 1.3.7.1 1.3.7 1.3 1.5 0 1-.8 1.7-2 1.7zM10 22v1.5h1c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7h-1zm0 4H11c.7 0 1.1-.3 1.1-.8 0-.6-.4-.9-1.1-.9H10V26zm5.4 1.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm-4.1 10c-1.8 0-2.8-1.1-2.8-3.1s1-3.1 2.8-3.1c1.4 0 2.5.9 2.6 2.2h-1.3c0-.7-.6-1.1-1.3-1.1-1 0-1.6.7-1.6 2s.6 2 1.6 2c.7 0 1.2-.4 1.4-1h1.2c-.1 1.3-1.2 2.2-2.6 2.2zm4.5 0c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',"list-num-upper-roman-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M31.6 17v-1.2H33V17h-1.3zm0 10v-1.2H33V27h-1.3zm0 10v-1.2H33V37h-1.3z"/><path fill-rule="nonzero" d="M34.5 20H36v7h-1.5zM34.5 30H36v7h-1.5zM37.5 20H39v7h-1.5zM37.5 30H39v7h-1.5zM40.5 30H42v7h-1.5zM34.5 10H36v7h-1.5z"/></g></svg>',"list-num-upper-roman":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M15.1 17v-1.2h1.3V17H15zm0 10v-1.2h1.3V27H15zm0 10v-1.2h1.3V37H15z"/><path fill-rule="nonzero" d="M12 20h1.5v7H12zM12 30h1.5v7H12zM9 20h1.5v7H9zM9 30h1.5v7H9zM6 30h1.5v7H6zM12 10h1.5v7H12z"/></g></svg>',lock:'<svg width="24" height="24"><path d="M16.3 11c.2 0 .3 0 .5.2l.2.6v7.4c0 .3 0 .4-.2.6l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 01-.2-.6v-7.4c0-.3 0-.4.2-.6l.5-.2H8V8c0-.8.3-1.5.9-2.1.6-.6 1.3-.9 2.1-.9h2c.8 0 1.5.3 2.1.9.6.6.9 1.3.9 2.1v3h.3zM10 8v3h4V8a1 1 0 00-.3-.7A1 1 0 0013 7h-2a1 1 0 00-.7.3 1 1 0 00-.3.7z" fill-rule="evenodd"/></svg>',ltr:'<svg width="24" height="24"><path d="M11 5h7a1 1 0 010 2h-1v11a1 1 0 01-2 0V7h-2v11a1 1 0 01-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 017.8 10a3.3 3.3 0 010-2.8 3.4 3.4 0 011.8-1.8L11 5zM4.4 16.2L6.2 15l-1.8-1.2a1 1 0 011.2-1.6l3 2a1 1 0 010 1.6l-3 2a1 1 0 11-1.2-1.6z" fill-rule="evenodd"/></svg>',"more-drawer":'<svg width="24" height="24"><path d="M6 10a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2zm12 0a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2zm-6 0a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2z" fill-rule="nonzero"/></svg>',"new-document":'<svg width="24" height="24"><path d="M14.4 3H7a2 2 0 00-2 2v14c0 1.1.9 2 2 2h10a2 2 0 002-2V7.6L14.4 3zM17 19H7V5h6v4h4v10z" fill-rule="nonzero"/></svg>',"new-tab":'<svg width="24" height="24"><path d="M15 13l2-2v8H5V7h8l-2 2H7v8h8v-4zm4-8v5.5l-2-2-5.6 5.5H10v-1.4L15.5 7l-2-2H19z" fill-rule="evenodd"/></svg>',"non-breaking":'<svg width="24" height="24"><path d="M11 11H8a1 1 0 110-2h3V6c0-.6.4-1 1-1s1 .4 1 1v3h3c.6 0 1 .4 1 1s-.4 1-1 1h-3v3c0 .6-.4 1-1 1a1 1 0 01-1-1v-3zm10 4v5H3v-5c0-.6.4-1 1-1s1 .4 1 1v3h14v-3c0-.6.4-1 1-1s1 .4 1 1z" fill-rule="evenodd"/></svg>',notice:'<svg width="24" height="24"><path d="M17.8 9.8L15.4 4 20 8.5v7L15.5 20h-7L4 15.5v-7L8.5 4h7l2.3 5.8zm0 0l2.2 5.7-2.3-5.8zM13 17v-2h-2v2h2zm0-4V7h-2v6h2z" fill-rule="evenodd"/></svg>',"ordered-list-rtl":'<svg width="24" height="24"><path d="M6 17h8a1 1 0 010 2H6a1 1 0 010-2zm0-6h8a1 1 0 010 2H6a1 1 0 010-2zm0-6h8a1 1 0 010 2H6a1 1 0 110-2zm13-1v3.5a.5.5 0 11-1 0V5h-.5a.5.5 0 110-1H19zm-1 8.8l.2.2h1.3a.5.5 0 110 1h-1.6a1 1 0 01-.9-1V13c0-.4.3-.8.6-1l1.2-.4.2-.3a.2.2 0 00-.2-.2h-1.3a.5.5 0 01-.5-.5c0-.3.2-.5.5-.5h1.6c.5 0 .9.4.9 1v.1c0 .4-.3.8-.6 1l-1.2.4-.2.3zm2 4.2v2c0 .6-.4 1-1 1h-1.5a.5.5 0 010-1h1.2a.3.3 0 100-.6h-1.3a.4.4 0 110-.8h1.3a.3.3 0 000-.6h-1.2a.5.5 0 110-1H19c.6 0 1 .4 1 1z" fill-rule="evenodd"/></svg>',"ordered-list":'<svg width="24" height="24"><path d="M10 17h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 110-2zM6 4v3.5c0 .3-.2.5-.5.5a.5.5 0 01-.5-.5V5h-.5a.5.5 0 010-1H6zm-1 8.8l.2.2h1.3c.3 0 .5.2.5.5s-.2.5-.5.5H4.9a1 1 0 01-.9-1V13c0-.4.3-.8.6-1l1.2-.4.2-.3a.2.2 0 00-.2-.2H4.5a.5.5 0 01-.5-.5c0-.3.2-.5.5-.5h1.6c.5 0 .9.4.9 1v.1c0 .4-.3.8-.6 1l-1.2.4-.2.3zM7 17v2c0 .6-.4 1-1 1H4.5a.5.5 0 010-1h1.2c.2 0 .3-.1.3-.3 0-.2-.1-.3-.3-.3H4.4a.4.4 0 110-.8h1.3c.2 0 .3-.1.3-.3 0-.2-.1-.3-.3-.3H4.5a.5.5 0 110-1H6c.6 0 1 .4 1 1z" fill-rule="evenodd"/></svg>',orientation:'<svg width="24" height="24"><path d="M7.3 6.4L1 13l6.4 6.5 6.5-6.5-6.5-6.5zM3.7 13l3.6-3.7L11 13l-3.7 3.7-3.6-3.7zM12 6l2.8 2.7c.3.3.3.8 0 1-.3.4-.9.4-1.2 0L9.2 5.7a.8.8 0 010-1.2L13.6.2c.3-.3.9-.3 1.2 0 .3.3.3.8 0 1.1L12 4h1a9 9 0 11-4.3 16.9l1.5-1.5A7 7 0 1013 6h-1z" fill-rule="nonzero"/></svg>',outdent:'<svg width="24" height="24"><path d="M7 5h12c.6 0 1 .4 1 1s-.4 1-1 1H7a1 1 0 110-2zm5 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm0 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm-5 4h12a1 1 0 010 2H7a1 1 0 010-2zm1.6-3.8a1 1 0 01-1.2 1.6l-3-2a1 1 0 010-1.6l3-2a1 1 0 011.2 1.6L6.8 12l1.8 1.2z" fill-rule="evenodd"/></svg>',"page-break":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M5 11c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zm3 0h1c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 010-2zm4 0c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zm3 0h1c.6 0 1 .4 1 1s-.4 1-1 1h-1a1 1 0 010-2zm4 0c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zM7 3v5h10V3c0-.6.4-1 1-1s1 .4 1 1v7H5V3c0-.6.4-1 1-1s1 .4 1 1zM6 22a1 1 0 01-1-1v-7h14v7c0 .6-.4 1-1 1a1 1 0 01-1-1v-5H7v5c0 .6-.4 1-1 1z"/></g></svg>',paragraph:'<svg width="24" height="24"><path fill-rule="evenodd" d="M10 5h7a1 1 0 010 2h-1v11a1 1 0 01-2 0V7h-2v11a1 1 0 01-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 016.8 10a3.3 3.3 0 010-2.8 3.4 3.4 0 011.8-1.8L10 5z"/></svg>',"paste-column-after":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 012.8 2H18c1 0 2 .8 2 1.9V7h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h7v2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2H9.2A3 3 0 0112 1zm8 7v12h-6V8h6zm-1.5 1.5h-3v9h3v-9zM12 3a1 1 0 100 2 1 1 0 000-2z"/></svg>',"paste-column-before":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 012.8 2H18c1 0 2 .8 2 1.9V18c0 1-.8 2-1.9 2H11v-2h7V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v2H4V5c0-1 .8-2 1.9-2H9.2A3 3 0 0112 1zm-2 7v12H4V8h6zM8.5 9.5h-3v9h3v-9zM12 3a1 1 0 100 2 1 1 0 000-2z"/></svg>',"paste-row-after":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 012.8 2H18c1 0 2 .8 2 1.9V11h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h14c0 1-.8 2-1.9 2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2H9.2A3 3 0 0112 1zm10 11v5H8v-5h14zm-1.5 1.5h-11v2h11v-2zM12 3a1 1 0 100 2 1 1 0 000-2z"/></svg>',"paste-row-before":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 012.8 2H18c1 0 2 .8 2 1.9V7h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h12v-4h2v4c0 1-.8 2-1.9 2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2H9.2A3 3 0 0112 1zm10 7v5H8V8h14zm-1.5 1.5h-11v2h11v-2zM12 3a1 1 0 100 2 1 1 0 000-2z"/></svg>',"paste-text":'<svg width="24" height="24"><path d="M18 9V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h3V9h9zM9 20H6a2 2 0 01-2-2V5c0-1.1.9-2 2-2h3.2A3 3 0 0112 1a3 3 0 012.8 2H18a2 2 0 012 2v4h1v12H9v-1zm1.5-9.5v9h9v-9h-9zM12 3a1 1 0 00-1 1c0 .5.4 1 1 1s1-.5 1-1-.4-1-1-1zm0 9h6v2h-.5l-.5-1h-1v4h.8v1h-3.6v-1h.8v-4h-1l-.5 1H12v-2z" fill-rule="nonzero"/></svg>',paste:'<svg width="24" height="24"><path d="M18 9V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h3V9h9zM9 20H6a2 2 0 01-2-2V5c0-1.1.9-2 2-2h3.2A3 3 0 0112 1a3 3 0 012.8 2H18a2 2 0 012 2v4h1v12H9v-1zm1.5-9.5v9h9v-9h-9zM12 3a1 1 0 00-1 1c0 .5.4 1 1 1s1-.5 1-1-.4-1-1-1z" fill-rule="nonzero"/></svg>',"permanent-pen":'<svg width="24" height="24"><path d="M10.5 17.5L8 20H3v-3l3.5-3.5a2 2 0 010-3L14 3l1 1-7.3 7.3a1 1 0 000 1.4l3.6 3.6c.4.4 1 .4 1.4 0L20 9l1 1-7.6 7.6a2 2 0 01-2.8 0l-.1-.1z" fill-rule="nonzero"/></svg>',plus:'<svg width="24" height="24"><path d="M12 4c.5 0 1 .4 1 .9V11h6a1 1 0 01.1 2H13v6a1 1 0 01-2 .1V13H5a1 1 0 01-.1-2H11V5c0-.6.4-1 1-1z"/></svg>',preferences:'<svg width="24" height="24"><path d="M20.1 13.5l-1.9.2a5.8 5.8 0 01-.6 1.5l1.2 1.5c.4.4.3 1 0 1.4l-.7.7a1 1 0 01-1.4 0l-1.5-1.2a6.2 6.2 0 01-1.5.6l-.2 1.9c0 .5-.5.9-1 .9h-1a1 1 0 01-1-.9l-.2-1.9a5.8 5.8 0 01-1.5-.6l-1.5 1.2a1 1 0 01-1.4 0l-.7-.7a1 1 0 010-1.4l1.2-1.5a6.2 6.2 0 01-.6-1.5l-1.9-.2a1 1 0 01-.9-1v-1c0-.5.4-1 .9-1l1.9-.2a5.8 5.8 0 01.6-1.5L5.2 7.3a1 1 0 010-1.4l.7-.7a1 1 0 011.4 0l1.5 1.2a6.2 6.2 0 011.5-.6l.2-1.9c0-.5.5-.9 1-.9h1c.5 0 1 .4 1 .9l.2 1.9a5.8 5.8 0 011.5.6l1.5-1.2a1 1 0 011.4 0l.7.7c.3.4.4 1 0 1.4l-1.2 1.5a6.2 6.2 0 01.6 1.5l1.9.2c.5 0 .9.5.9 1v1c0 .5-.4 1-.9 1zM12 15a3 3 0 100-6 3 3 0 000 6z" fill-rule="evenodd"/></svg>',preview:'<svg width="24" height="24"><path d="M3.5 12.5c.5.8 1.1 1.6 1.8 2.3 2 2 4.2 3.2 6.7 3.2s4.7-1.2 6.7-3.2a16.2 16.2 0 002.1-2.8 15.7 15.7 0 00-2.1-2.8c-2-2-4.2-3.2-6.7-3.2a9.3 9.3 0 00-6.7 3.2A16.2 16.2 0 003.2 12c0 .2.2.3.3.5zm-2.4-1l.7-1.2L4 7.8C6.2 5.4 8.9 4 12 4c3 0 5.8 1.4 8.1 3.8a18.2 18.2 0 012.8 3.7v1l-.7 1.2-2.1 2.5c-2.3 2.4-5 3.8-8.1 3.8-3 0-5.8-1.4-8.1-3.8a18.2 18.2 0 01-2.8-3.7 1 1 0 010-1zm12-3.3a2 2 0 102.7 2.6 4 4 0 11-2.6-2.6z" fill-rule="nonzero"/></svg>',print:'<svg width="24" height="24"><path d="M18 8H6a3 3 0 00-3 3v6h2v3h14v-3h2v-6a3 3 0 00-3-3zm-1 10H7v-4h10v4zm.5-5c-.8 0-1.5-.7-1.5-1.5s.7-1.5 1.5-1.5 1.5.7 1.5 1.5-.7 1.5-1.5 1.5zm.5-8H6v2h12V5z" fill-rule="nonzero"/></svg>',quote:'<svg width="24" height="24"><path d="M7.5 17h.9c.4 0 .7-.2.9-.6L11 13V8c0-.6-.4-1-1-1H6a1 1 0 00-1 1v4c0 .6.4 1 1 1h2l-1.3 2.7a1 1 0 00.8 1.3zm8 0h.9c.4 0 .7-.2.9-.6L19 13V8c0-.6-.4-1-1-1h-4a1 1 0 00-1 1v4c0 .6.4 1 1 1h2l-1.3 2.7a1 1 0 00.8 1.3z" fill-rule="nonzero"/></svg>',redo:'<svg width="24" height="24"><path d="M17.6 10H12c-2.8 0-4.4 1.4-4.9 3.5-.4 2 .3 4 1.4 4.6a1 1 0 11-1 1.8c-2-1.2-2.9-4.1-2.3-6.8.6-3 3-5.1 6.8-5.1h5.6l-3.3-3.3a1 1 0 111.4-1.4l5 5a1 1 0 010 1.4l-5 5a1 1 0 01-1.4-1.4l3.3-3.3z" fill-rule="nonzero"/></svg>',reload:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M5 22.1l-1.2-4.7v-.2a1 1 0 011-1l5 .4a1 1 0 11-.2 2l-2.2-.2a7.8 7.8 0 008.4.2 7.5 7.5 0 003.5-6.4 1 1 0 112 0 9.5 9.5 0 01-4.5 8 9.9 9.9 0 01-10.2 0l.4 1.4a1 1 0 11-2 .5zM13.6 7.4c0-.5.5-1 1-.9l2.8.2a8 8 0 00-9.5-1 7.5 7.5 0 00-3.6 7 1 1 0 01-2 0 9.5 9.5 0 014.5-8.6 10 10 0 0110.9.3l-.3-1a1 1 0 012-.5l1.1 4.8a1 1 0 01-1 1.2l-5-.4a1 1 0 01-.9-1z"/></g></svg>',"remove-formatting":'<svg width="24" height="24"><path d="M13.2 6a1 1 0 010 .2l-2.6 10a1 1 0 01-1 .8h-.2a.8.8 0 01-.8-1l2.6-10H8a1 1 0 110-2h9a1 1 0 010 2h-3.8zM5 18h7a1 1 0 010 2H5a1 1 0 010-2zm13 1.5L16.5 18 15 19.5a.7.7 0 01-1-1l1.5-1.5-1.5-1.5a.7.7 0 011-1l1.5 1.5 1.5-1.5a.7.7 0 011 1L17.5 17l1.5 1.5a.7.7 0 01-1 1z" fill-rule="evenodd"/></svg>',remove:'<svg width="24" height="24"><path d="M16 7h3a1 1 0 010 2h-1v9a3 3 0 01-3 3H9a3 3 0 01-3-3V9H5a1 1 0 110-2h3V6a3 3 0 013-3h2a3 3 0 013 3v1zm-2 0V6c0-.6-.4-1-1-1h-2a1 1 0 00-1 1v1h4zm2 2H8v9c0 .6.4 1 1 1h6c.6 0 1-.4 1-1V9zm-7 3a1 1 0 012 0v4a1 1 0 01-2 0v-4zm4 0a1 1 0 012 0v4a1 1 0 01-2 0v-4z" fill-rule="nonzero"/></svg>',"resize-handle":'<svg width="10" height="10"><g fill-rule="nonzero"><path d="M8.1 1.1A.5.5 0 119 2l-7 7A.5.5 0 111 8l7-7zM8.1 5.1A.5.5 0 119 6l-3 3A.5.5 0 115 8l3-3z"/></g></svg>',resize:'<svg width="24" height="24"><path d="M4 5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h6c.3 0 .5.1.7.3.2.2.3.4.3.7 0 .3-.1.5-.3.7a1 1 0 01-.7.3H7.4L18 16.6V13c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3.3 0 .5.1.7.3.2.2.3.4.3.7v6c0 .3-.1.5-.3.7a1 1 0 01-.7.3h-6a1 1 0 01-.7-.3 1 1 0 01-.3-.7c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h3.6L6 7.4V11c0 .3-.1.5-.3.7a1 1 0 01-.7.3 1 1 0 01-.7-.3A1 1 0 014 11V5z" fill-rule="evenodd"/></svg>',"restore-draft":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M17 13c0 .6-.4 1-1 1h-4V8c0-.6.4-1 1-1s1 .4 1 1v4h2c.6 0 1 .4 1 1z"/><path d="M4.7 10H9a1 1 0 010 2H3a1 1 0 01-1-1V5a1 1 0 112 0v3l2.5-2.4a9.2 9.2 0 0110.8-1.5A9 9 0 0113.4 21c-2.4.1-4.7-.7-6.5-2.2a1 1 0 111.3-1.5 7.2 7.2 0 0011.6-3.7 7 7 0 00-3.5-7.7A7.2 7.2 0 008 7L4.7 10z" fill-rule="nonzero"/></g></svg>',"rotate-left":'<svg width="24" height="24"><path d="M4.7 10H9a1 1 0 010 2H3a1 1 0 01-1-1V5a1 1 0 112 0v3l2.5-2.4a9.2 9.2 0 0110.8-1.5A9 9 0 0113.4 21c-2.4.1-4.7-.7-6.5-2.2a1 1 0 111.3-1.5 7.2 7.2 0 0011.6-3.7 7 7 0 00-3.5-7.7A7.2 7.2 0 008 7L4.7 10z" fill-rule="nonzero"/></svg>',"rotate-right":'<svg width="24" height="24"><path d="M20 8V5a1 1 0 012 0v6c0 .6-.4 1-1 1h-6a1 1 0 010-2h4.3L16 7A7.2 7.2 0 007.7 6a7 7 0 003 13.1c1.9.1 3.7-.5 5-1.7a1 1 0 011.4 1.5A9.2 9.2 0 012.2 14c-.9-3.9 1-8 4.5-9.9 3.5-1.9 8-1.3 10.8 1.5L20 8z" fill-rule="nonzero"/></svg>',rtl:'<svg width="24" height="24"><path d="M8 5h8v2h-2v12h-2V7h-2v12H8v-7c-.5 0-1 0-1.4-.3A3.4 3.4 0 014.8 10a3.3 3.3 0 010-2.8 3.4 3.4 0 011.8-1.8L8 5zm12 11.2a1 1 0 11-1 1.6l-3-2a1 1 0 010-1.6l3-2a1 1 0 111 1.6L18.4 15l1.8 1.2z" fill-rule="evenodd"/></svg>',save:'<svg width="24" height="24"><path d="M5 16h14a2 2 0 012 2v2a2 2 0 01-2 2H5a2 2 0 01-2-2v-2c0-1.1.9-2 2-2zm0 2v2h14v-2H5zm10 0h2v2h-2v-2zm-4-6.4L8.7 9.3a1 1 0 10-1.4 1.4l4 4c.4.4 1 .4 1.4 0l4-4a1 1 0 10-1.4-1.4L13 11.6V4a1 1 0 00-2 0v7.6z" fill-rule="nonzero"/></svg>',search:'<svg width="24" height="24"><path d="M16 17.3a8 8 0 111.4-1.4l4.3 4.4a1 1 0 01-1.4 1.4l-4.4-4.3zm-5-.3a6 6 0 100-12 6 6 0 000 12z" fill-rule="nonzero"/></svg>',"select-all":'<svg width="24" height="24"><path d="M3 5h2V3a2 2 0 00-2 2zm0 8h2v-2H3v2zm4 8h2v-2H7v2zM3 9h2V7H3v2zm10-6h-2v2h2V3zm6 0v2h2a2 2 0 00-2-2zM5 21v-2H3c0 1.1.9 2 2 2zm-2-4h2v-2H3v2zM9 3H7v2h2V3zm2 18h2v-2h-2v2zm8-8h2v-2h-2v2zm0 8a2 2 0 002-2h-2v2zm0-12h2V7h-2v2zm0 8h2v-2h-2v2zm-4 4h2v-2h-2v2zm0-16h2V3h-2v2zM7 17h10V7H7v10zm2-8h6v6H9V9z" fill-rule="nonzero"/></svg>',selected:'<svg width="24" height="24"><path fill-rule="nonzero" d="M6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6c0-1.1.9-2 2-2zm3.6 10.9L7 12.3a.7.7 0 00-1 1L9.6 17 18 8.6a.7.7 0 000-1 .7.7 0 00-1 0l-7.4 7.3z"/></svg>',settings:'<svg width="24" height="24"><path d="M11 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8v.3c0 .2 0 .3-.2.5l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 01-.2-.6V8H5a1 1 0 110-2h2v-.3c0-.2 0-.3.2-.5l.5-.2h2.5c.3 0 .4 0 .6.2l.2.5V6zM8 8h2V6H8v2zm9 2.8v.2h2c.6 0 1 .4 1 1s-.4 1-1 1h-2v.3c0 .2 0 .3-.2.5l-.6.2h-2.4c-.3 0-.4 0-.6-.2a.7.7 0 01-.2-.6V13H5a1 1 0 010-2h8v-.3c0-.2 0-.3.2-.5l.6-.2h2.4c.3 0 .4 0 .6.2l.2.6zM14 13h2v-2h-2v2zm-3 2.8v.2h8c.6 0 1 .4 1 1s-.4 1-1 1h-8v.3c0 .2 0 .3-.2.5l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 01-.2-.6V18H5a1 1 0 010-2h2v-.3c0-.2 0-.3.2-.5l.5-.2h2.5c.3 0 .4 0 .6.2l.2.6zM8 18h2v-2H8v2z" fill-rule="evenodd"/></svg>',sharpen:'<svg width="24" height="24"><path d="M16 6l4 4-8 9-8-9 4-4h8zm-4 10.2l5.5-6.2-.1-.1H12v-.3h5.1l-.2-.2H12V9h4.6l-.2-.2H12v-.3h4.1l-.2-.2H12V8h3.6l-.2-.2H8.7L6.5 10l.1.1H12v.3H6.9l.2.2H12v.3H7.3l.2.2H12v.3H7.7l.3.2h4v.3H8.2l.2.2H12v.3H8.6l.3.2H12v.3H9l.3.2H12v.3H9.5l.2.2H12v.3h-2l.2.2H12v.3h-1.6l.2.2H12v.3h-1.1l.2.2h.9v.3h-.7l.2.2h.5v.3h-.3l.3.2z" fill-rule="evenodd"/></svg>',sourcecode:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M9.8 15.7c.3.3.3.8 0 1-.3.4-.9.4-1.2 0l-4.4-4.1a.8.8 0 010-1.2l4.4-4.2c.3-.3.9-.3 1.2 0 .3.3.3.8 0 1.1L6 12l3.8 3.7zM14.2 15.7c-.3.3-.3.8 0 1 .4.4.9.4 1.2 0l4.4-4.1c.3-.3.3-.9 0-1.2l-4.4-4.2a.8.8 0 00-1.2 0c-.3.3-.3.8 0 1.1L18 12l-3.8 3.7z"/></g></svg>',"spell-check":'<svg width="24" height="24"><path d="M6 8v3H5V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h2c.3 0 .5.1.7.3.2.2.3.4.3.7v6H8V8H6zm0-3v2h2V5H6zm13 0h-3v5h3v1h-3a1 1 0 01-.7-.3 1 1 0 01-.3-.7V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h3v1zm-5 1.5l-.1.7c-.1.2-.3.3-.6.3.3 0 .5.1.6.3l.1.7V10c0 .3-.1.5-.3.7a1 1 0 01-.7.3h-3V4h3c.3 0 .5.1.7.3.2.2.3.4.3.7v1.5zM13 10V8h-2v2h2zm0-3V5h-2v2h2zm3 5l1 1-6.5 7L7 15.5l1.3-1 2.2 2.2L16 12z" fill-rule="evenodd"/></svg>',"strike-through":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M15.6 8.5c-.5-.7-1-1.1-1.3-1.3-.6-.4-1.3-.6-2-.6-2.7 0-2.8 1.7-2.8 2.1 0 1.6 1.8 2 3.2 2.3 4.4.9 4.6 2.8 4.6 3.9 0 1.4-.7 4.1-5 4.1A6.2 6.2 0 017 16.4l1.5-1.1c.4.6 1.6 2 3.7 2 1.6 0 2.5-.4 3-1.2.4-.8.3-2-.8-2.6-.7-.4-1.6-.7-2.9-1-1-.2-3.9-.8-3.9-3.6C7.6 6 10.3 5 12.4 5c2.9 0 4.2 1.6 4.7 2.4l-1.5 1.1z"/><path d="M5 11h14a1 1 0 010 2H5a1 1 0 010-2z" fill-rule="nonzero"/></g></svg>',subscript:'<svg width="24" height="24"><path d="M10.4 10l4.6 4.6-1.4 1.4L9 11.4 4.4 16 3 14.6 7.6 10 3 5.4 4.4 4 9 8.6 13.6 4 15 5.4 10.4 10zM21 19h-5v-1l1-.8 1.7-1.6c.3-.4.5-.8.5-1.2 0-.3 0-.6-.2-.7-.2-.2-.5-.3-.9-.3a2 2 0 00-.8.2l-.7.3-.4-1.1 1-.6 1.2-.2c.8 0 1.4.3 1.8.7.4.4.6.9.6 1.5s-.2 1.1-.5 1.6a8 8 0 01-1.3 1.3l-.6.6h2.6V19z" fill-rule="nonzero"/></svg>',superscript:'<svg width="24" height="24"><path d="M15 9.4L10.4 14l4.6 4.6-1.4 1.4L9 15.4 4.4 20 3 18.6 7.6 14 3 9.4 4.4 8 9 12.6 13.6 8 15 9.4zm5.9 1.6h-5v-1l1-.8 1.7-1.6c.3-.5.5-.9.5-1.3 0-.3 0-.5-.2-.7-.2-.2-.5-.3-.9-.3l-.8.2-.7.4-.4-1.2c.2-.2.5-.4 1-.5.3-.2.8-.2 1.2-.2.8 0 1.4.2 1.8.6.4.4.6 1 .6 1.6 0 .5-.2 1-.5 1.5l-1.3 1.4-.6.5h2.6V11z" fill-rule="nonzero"/></svg>',"table-cell-properties":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm-8 9H5v5h6v-5zm8 0h-6v5h6v-5zm-8-7H5v5h6V6z"/></svg>',"table-cell-select-all":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm0 2H5v12h14V6z"/><path d="M13 6v5h6v2h-6v5h-2v-5H5v-2h6V6h2z" opacity=".2"/></g></svg>',"table-cell-select-inner":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm0 2H5v12h14V6z" opacity=".2"/><path d="M13 6v5h6v2h-6v5h-2v-5H5v-2h6V6h2z"/></g></svg>',"table-delete-column":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm-4 4h-2V6h-2v2H9V6H5v12h4v-2h2v2h2v-2h2v2h4V6h-4v2zm.3.5l1 1.2-3 2.3 3 2.3-1 1.2L12 13l-3.3 2.6-1-1.2 3-2.3-3-2.3 1-1.2L12 11l3.3-2.5z"/></svg>',"table-delete-row":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm0 2H5v3h2.5v2H5v2h2.5v2H5v3h14v-3h-2.5v-2H19v-2h-2.5V9H19V6zm-4.7 1.8l1.2 1L13 12l2.6 3.3-1.2 1-2.3-3-2.3 3-1.2-1L11 12 8.5 8.7l1.2-1 2.3 3 2.3-3z"/></svg>',"table-delete-table":'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zM5 6v12h14V6H5z"/><path d="M14.4 8.6l1 1-2.3 2.4 2.3 2.4-1 1-2.4-2.3-2.4 2.3-1-1 2.3-2.4-2.3-2.4 1-1 2.4 2.3z"/></g></svg>',"table-insert-column-after":'<svg width="24" height="24"><path fill-rule="nonzero" d="M20 4c.6 0 1 .4 1 1v2a1 1 0 01-2 0V6h-8v12h8v-1a1 1 0 012 0v2c0 .5-.4 1-.9 1H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h15zM9 13H5v5h4v-5zm7-5c.5 0 1 .4 1 .9V11h2a1 1 0 01.1 2H17v2a1 1 0 01-2 .1V13h-2a1 1 0 01-.1-2H15V9c0-.6.4-1 1-1zM9 6H5v5h4V6z"/></svg>',"table-insert-column-before":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H4a1 1 0 01-1-1v-2a1 1 0 012 0v1h8V6H5v1a1 1 0 11-2 0V5c0-.6.4-1 1-1h15zm0 9h-4v5h4v-5zM8 8c.5 0 1 .4 1 .9V11h2a1 1 0 01.1 2H9v2a1 1 0 01-2 .1V13H5a1 1 0 01-.1-2H7V9c0-.6.4-1 1-1zm11-2h-4v5h4V6z"/></svg>',"table-insert-row-above":'<svg width="24" height="24"><path fill-rule="nonzero" d="M6 4a1 1 0 110 2H5v6h14V6h-1a1 1 0 010-2h2c.6 0 1 .4 1 1v13a2 2 0 01-2 2H5a2 2 0 01-2-2V5c0-.6.4-1 1-1h2zm5 10H5v4h6v-4zm8 0h-6v4h6v-4zM12 3c.5 0 1 .4 1 .9V6h2a1 1 0 010 2h-2v2a1 1 0 01-2 .1V8H9a1 1 0 010-2h2V4c0-.6.4-1 1-1z"/></svg>',"table-insert-row-after":'<svg width="24" height="24"><path fill-rule="nonzero" d="M12 13c.5 0 1 .4 1 .9V16h2a1 1 0 01.1 2H13v2a1 1 0 01-2 .1V18H9a1 1 0 01-.1-2H11v-2c0-.6.4-1 1-1zm6 7a1 1 0 010-2h1v-6H5v6h1a1 1 0 010 2H4a1 1 0 01-1-1V6c0-1.1.9-2 2-2h14a2 2 0 012 2v13c0 .5-.4 1-.9 1H18zM11 6H5v4h6V6zm8 0h-6v4h6V6z"/></svg>',"table-left-header":'<svg width="24" height="24"><path d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm0 9h-4v5h4v-5zm-6 0H9v5h4v-5zm0-7H9v5h4V6zm6 0h-4v5h4V6z"/></svg>',"table-merge-cells":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zM5 15.5V18h3v-2.5H5zm14-5h-9V18h9v-7.5zM19 6h-4v2.5h4V6zM8 6H5v2.5h3V6zm5 0h-3v2.5h3V6zm-8 7.5h3v-3H5v3z"/></svg>',"table-row-properties":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zM5 15v3h6v-3H5zm14 0h-6v3h6v-3zm0-9h-6v3h6V6zM5 9h6V6H5v3z"/></svg>',"table-split-cells":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zM8 15.5H5V18h3v-2.5zm11-5h-9V18h9v-7.5zm-2.5 1l1 1-2 2 2 2-1 1-2-2-2 2-1-1 2-2-2-2 1-1 2 2 2-2zm-8.5-1H5v3h3v-3zM19 6h-4v2.5h4V6zM8 6H5v2.5h3V6zm5 0h-3v2.5h3V6z"/></svg>',"table-top-header":'<svg width="24" height="24"><path d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm-8 11H5v3h6v-3zm8 0h-6v3h6v-3zm0-5h-6v3h6v-3zM5 13h6v-3H5v3z"/></svg>',table:'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zM5 14v4h6v-4H5zm14 0h-6v4h6v-4zm0-6h-6v4h6V8zM5 12h6V8H5v4z"/></svg>',template:'<svg width="24" height="24"><path d="M19 19v-1H5v1h14zM9 16v-4a5 5 0 116 0v4h4a2 2 0 012 2v3H3v-3c0-1.1.9-2 2-2h4zm4 0v-5l.8-.6a3 3 0 10-3.6 0l.8.6v5h2z" fill-rule="nonzero"/></svg>',"temporary-placeholder":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M9 7.6V6h2.5V4.5a.5.5 0 111 0V6H15v1.6a8 8 0 11-6 0zm-2.6 5.3a.5.5 0 00.3.6c.3 0 .6 0 .6-.3l.1-.2a5 5 0 013.3-2.8c.3-.1.4-.4.4-.6-.1-.3-.4-.5-.6-.4a6 6 0 00-4.1 3.7z"/><circle cx="14" cy="4" r="1"/><circle cx="12" cy="2" r="1"/><circle cx="10" cy="4" r="1"/></g></svg>',"text-color":'<svg width="24" height="24"><g fill-rule="evenodd"><path id="tox-icon-text-color__color" d="M3 18h18v3H3z"/><path d="M8.7 16h-.8a.5.5 0 01-.5-.6l2.7-9c.1-.3.3-.4.5-.4h2.8c.2 0 .4.1.5.4l2.7 9a.5.5 0 01-.5.6h-.8a.5.5 0 01-.4-.4l-.7-2.2c0-.3-.3-.4-.5-.4h-3.4c-.2 0-.4.1-.5.4l-.7 2.2c0 .3-.2.4-.4.4zm2.6-7.6l-.6 2a.5.5 0 00.5.6h1.6a.5.5 0 00.5-.6l-.6-2c0-.3-.3-.4-.5-.4h-.4c-.2 0-.4.1-.5.4z"/></g></svg>',toc:'<svg width="24" height="24"><path d="M5 5c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 110-2zm3 0h11c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 110-2zm-3 8c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zm3 0h11c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 010-2zm0-4c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 110-2zm3 0h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm-3 8c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zm3 0h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2z" fill-rule="evenodd"/></svg>',translate:'<svg width="24" height="24"><path d="M12.7 14.3l-.3.7-.4.7-2.2-2.2-3.1 3c-.3.4-.8.4-1 0a.7.7 0 010-1l3.1-3A12.4 12.4 0 016.7 9H8a10.1 10.1 0 001.7 2.4c.5-.5 1-1.1 1.4-1.8l.9-2H4.7a.7.7 0 110-1.5h4.4v-.7c0-.4.3-.8.7-.8.4 0 .7.4.7.8v.7H15c.4 0 .8.3.8.7 0 .4-.4.8-.8.8h-1.4a12.3 12.3 0 01-1 2.4 13.5 13.5 0 01-1.7 2.3l1.9 1.8zm4.3-3l2.7 7.3a.5.5 0 01-.4.7 1 1 0 01-1-.7l-.6-1.5h-3.4l-.6 1.5a1 1 0 01-1 .7.5.5 0 01-.4-.7l2.7-7.4a1 1 0 012 0zm-2.2 4.4h2.4L16 12.5l-1.2 3.2z" fill-rule="evenodd"/></svg>',underline:'<svg width="24" height="24"><path d="M16 5c.6 0 1 .4 1 1v5.5a4 4 0 01-.4 1.8l-1 1.4a5.3 5.3 0 01-5.5 1 5 5 0 01-1.6-1c-.5-.4-.8-.9-1.1-1.4a4 4 0 01-.4-1.8V6c0-.6.4-1 1-1s1 .4 1 1v5.5c0 .3 0 .6.2 1l.6.7a3.3 3.3 0 002.2.8 3.4 3.4 0 002.2-.8c.3-.2.4-.5.6-.8l.2-.9V6c0-.6.4-1 1-1zM8 17h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 010-2z" fill-rule="evenodd"/></svg>',undo:'<svg width="24" height="24"><path d="M6.4 8H12c3.7 0 6.2 2 6.8 5.1.6 2.7-.4 5.6-2.3 6.8a1 1 0 01-1-1.8c1.1-.6 1.8-2.7 1.4-4.6-.5-2.1-2.1-3.5-4.9-3.5H6.4l3.3 3.3a1 1 0 11-1.4 1.4l-5-5a1 1 0 010-1.4l5-5a1 1 0 011.4 1.4L6.4 8z" fill-rule="nonzero"/></svg>',unlink:'<svg width="24" height="24"><path d="M6.2 12.3a1 1 0 011.4 1.4l-2 2a2 2 0 102.6 2.8l4.8-4.8a1 1 0 000-1.4 1 1 0 111.4-1.3 2.9 2.9 0 010 4L9.6 20a3.9 3.9 0 01-5.5-5.5l2-2zm11.6-.6a1 1 0 01-1.4-1.4l2.1-2a2 2 0 10-2.7-2.8L11 10.3a1 1 0 000 1.4A1 1 0 119.6 13a2.9 2.9 0 010-4L14.4 4a3.9 3.9 0 015.5 5.5l-2 2zM7.6 6.3a.8.8 0 01-1 1.1L3.3 4.2a.7.7 0 111-1l3.2 3.1zM5.1 8.6a.8.8 0 010 1.5H3a.8.8 0 010-1.5H5zm5-3.5a.8.8 0 01-1.5 0V3a.8.8 0 011.5 0V5zm6 11.8a.8.8 0 011-1l3.2 3.2a.8.8 0 01-1 1L16 17zm-2.2 2a.8.8 0 011.5 0V21a.8.8 0 01-1.5 0V19zm5-3.5a.7.7 0 110-1.5H21a.8.8 0 010 1.5H19z" fill-rule="nonzero"/></svg>',unlock:'<svg width="24" height="24"><path d="M16 5c.8 0 1.5.3 2.1.9.6.6.9 1.3.9 2.1v3h-2V8a1 1 0 00-.3-.7A1 1 0 0016 7h-2a1 1 0 00-.7.3 1 1 0 00-.3.7v3h.3c.2 0 .3 0 .5.2l.2.6v7.4c0 .3 0 .4-.2.6l-.6.2H4.8c-.3 0-.4 0-.6-.2a.7.7 0 01-.2-.6v-7.4c0-.3 0-.4.2-.6l.5-.2H11V8c0-.8.3-1.5.9-2.1.6-.6 1.3-.9 2.1-.9h2z" fill-rule="evenodd"/></svg>',"unordered-list":'<svg width="24" height="24"><path d="M11 5h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zM4.5 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1zm0 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1zm0 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1z" fill-rule="evenodd"/></svg>',unselected:'<svg width="24" height="24"><path fill-rule="nonzero" d="M6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6c0-1.1.9-2 2-2zm0 1a1 1 0 00-1 1v12c0 .6.4 1 1 1h12c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H6z"/></svg>',upload:'<svg width="24" height="24"><path d="M18 19v-2a1 1 0 012 0v3c0 .6-.4 1-1 1H5a1 1 0 01-1-1v-3a1 1 0 012 0v2h12zM11 6.4L8.7 8.7a1 1 0 01-1.4-1.4l4-4a1 1 0 011.4 0l4 4a1 1 0 11-1.4 1.4L13 6.4V16a1 1 0 01-2 0V6.4z" fill-rule="nonzero"/></svg>',user:'<svg width="24" height="24"><path d="M12 24a12 12 0 110-24 12 12 0 010 24zm-8.7-5.3a11 11 0 0017.4 0C19.4 16.3 14.6 15 12 15c-2.6 0-7.4 1.3-8.7 3.7zM12 13c2.2 0 4-2 4-4.5S14.2 4 12 4 8 6 8 8.5 9.8 13 12 13z" fill-rule="nonzero"/></svg>',visualblocks:'<svg width="24" height="24"><path d="M9 19v2H7v-2h2zm-4 0v2a2 2 0 01-2-2h2zm8 0v2h-2v-2h2zm8 0a2 2 0 01-2 2v-2h2zm-4 0v2h-2v-2h2zM15 7a1 1 0 010 2v7a1 1 0 01-2 0V9h-1v7a1 1 0 01-2 0v-4a2.5 2.5 0 01-.2-5H15zM5 15v2H3v-2h2zm16 0v2h-2v-2h2zM5 11v2H3v-2h2zm16 0v2h-2v-2h2zM5 7v2H3V7h2zm16 0v2h-2V7h2zM5 3v2H3c0-1.1.9-2 2-2zm8 0v2h-2V3h2zm6 0a2 2 0 012 2h-2V3zM9 3v2H7V3h2zm8 0v2h-2V3h2z" fill-rule="evenodd"/></svg>',visualchars:'<svg width="24" height="24"><path d="M10 5h7a1 1 0 010 2h-1v11a1 1 0 01-2 0V7h-2v11a1 1 0 01-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 016.8 10a3.3 3.3 0 010-2.8 3.4 3.4 0 011.8-1.8L10 5z" fill-rule="evenodd"/></svg>',warning:'<svg width="24" height="24"><path d="M19.8 18.3c.2.5.3.9 0 1.2-.1.3-.5.5-1 .5H5.2c-.5 0-.9-.2-1-.5-.3-.3-.2-.7 0-1.2L11 4.7l.5-.5.5-.2c.2 0 .3 0 .5.2.2 0 .3.3.5.5l6.8 13.6zM12 18c.3 0 .5-.1.7-.3.2-.2.3-.4.3-.7a1 1 0 00-.3-.7 1 1 0 00-.7-.3 1 1 0 00-.7.3 1 1 0 00-.3.7c0 .3.1.5.3.7.2.2.4.3.7.3zm.7-3l.3-4a1 1 0 00-.3-.7 1 1 0 00-.7-.3 1 1 0 00-.7.3 1 1 0 00-.3.7l.3 4h1.4z" fill-rule="evenodd"/></svg>',"zoom-in":'<svg width="24" height="24"><path d="M16 17.3a8 8 0 111.4-1.4l4.3 4.4a1 1 0 01-1.4 1.4l-4.4-4.3zm-5-.3a6 6 0 100-12 6 6 0 000 12zm-1-9a1 1 0 012 0v6a1 1 0 01-2 0V8zm-2 4a1 1 0 010-2h6a1 1 0 010 2H8z" fill-rule="nonzero"/></svg>',"zoom-out":'<svg width="24" height="24"><path d="M16 17.3a8 8 0 111.4-1.4l4.3 4.4a1 1 0 01-1.4 1.4l-4.4-4.3zm-5-.3a6 6 0 100-12 6 6 0 000 12zm-3-5a1 1 0 010-2h6a1 1 0 010 2H8z" fill-rule="nonzero"/></svg>'}})}}]);
|