(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-0e956594","chunk-2d21065a"],{"030f":function(t,e,n){(function(t){(function(){"use strict";var e=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},n=function(t){return function(n){return e(n)===t}},r=function(t){return function(e){return typeof e===t}},o=function(t){return function(e){return t===e}},i=n("string"),u=n("object"),a=n("array"),c=o(null),s=r("boolean"),l=o(void 0),f=function(t){return null===t||void 0===t},d=function(t){return!f(t)},m=r("function"),g=r("number"),h=function(t,e){if(a(t)){for(var n=0,r=t.length;n-1},j=function(t,e){for(var n=0,r=t.length;n=0;n--){var r=t[n];e(r,n)}},X=function(t,e){for(var n=[],r=[],o=0,i=t.length;o=0&&e=e.length&&t.substr(n,n+e.length)===e},Ft=function(t,e){return jt(t,e)?It(t,e.length):t},Vt=function(t,e){return Wt(t,e)?t:Ht(t,e)},Ut=function(t,e){return-1!==t.indexOf(e)},jt=function(t,e){return Pt(t,e,0)},Wt=function(t,e){return Pt(t,e,t.length-e.length)},qt=function(t){return function(e){return e.replace(t,"")}},$t=qt(/^\s+|\s+$/g),Gt=function(t){return t.length>0},Kt=function(t){return!Gt(t)},Xt=function(t){return void 0!==t.style&&m(t.style.getPropertyValue)},Yt=function(t,e){var n=e||document,r=n.createElement("div");if(r.innerHTML=t,!r.hasChildNodes()||r.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return Zt(r.childNodes[0])},Jt=function(t,e){var n=e||document,r=n.createElement(t);return Zt(r)},Qt=function(t,e){var n=e||document,r=n.createTextNode(t);return Zt(r)},Zt=function(t){if(null===t||void 0===t)throw new Error("Node cannot be null or undefined");return{dom:t}},te=function(t,e,n){return L.from(t.dom.elementFromPoint(e,n)).map(Zt)},ee={fromHtml:Yt,fromTag:Jt,fromText:Qt,fromDom:Zt,fromPoint:te};"undefined"!==typeof window?window:Function("return this;")();var ne,re=9,oe=11,ie=1,ue=3,ae=function(t){var e=t.dom.nodeName;return e.toLowerCase()},ce=function(t){return t.dom.nodeType},se=function(t){return function(e){return ce(e)===t}},le=se(ie),fe=se(ue),de=se(re),me=se(oe),ge=function(t){var e,n=!1;return function(){for(var r=[],o=0;o0&&e0}))},tr=function(t){var e={},n=t.dom;if(Xt(n))for(var r=0;rr?e-r:0;return o};return{set:n,get:r,getOuter:o,aggregate:i,max:u}},ir=or("height",(function(t){var e=t.dom;return Ln(t)?e.getBoundingClientRect().height:e.offsetHeight})),ur=function(t){return ir.get(t)},ar=function(t){return ir.getOuter(t)},cr=function(t,e){var n=["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"],r=ir.max(t,e,n);Kn(t,"max-height",r+"px")},sr=function(t,e){var n=function(n,r){return sr(t+n,e+r)};return{left:t,top:e,translate:n}},lr=sr,fr=function(t){var e=t.getBoundingClientRect();return lr(e.left,e.top)},dr=function(t,e){return void 0!==t?t:void 0!==e?e:0},mr=function(t){var e=t.dom.ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom)return lr(n.offsetLeft,n.offsetTop);var i=dr(null===r||void 0===r?void 0:r.pageYOffset,o.scrollTop),u=dr(null===r||void 0===r?void 0:r.pageXOffset,o.scrollLeft),a=dr(o.clientTop,n.clientTop),c=dr(o.clientLeft,n.clientLeft);return gr(t).translate(u-c,i-a)},gr=function(t){var e=t.dom,n=e.ownerDocument,r=n.body;return r===e?lr(r.offsetLeft,r.offsetTop):Ln(t)?fr(e):lr(0,0)},hr=or("width",(function(t){return t.dom.offsetWidth})),pr=function(t,e){return hr.set(t,e)},vr=function(t){return hr.get(t)},br=function(t){return hr.getOuter(t)},yr=function(t,e){var n=["margin-left","border-left-width","padding-left","padding-right","border-right-width","margin-right"],r=hr.max(t,e,n);Kn(t,"max-width",r+"px")},wr=function(t,e,n,r,o,i,u){return{target:t,x:e,y:n,stop:r,prevent:o,kill:i,raw:u}},xr=function(t){var e=ee.fromDom(zn(t).getOr(t.target)),n=function(){return t.stopPropagation()},r=function(){return t.preventDefault()},o=b(r,n);return wr(e,t.clientX,t.clientY,n,r,o,t)},Cr=function(t,e){return function(n){t(n)&&e(xr(n))}},Sr=function(t,e,n,r,o){var i=Cr(n,r);return t.dom.addEventListener(e,i,o),{unbind:S(Or,t,e,i,o)}},kr=function(t,e,n,r){return Sr(t,e,n,r,!1)},Tr=function(t,e,n,r){return Sr(t,e,n,r,!0)},Or=function(t,e,n,r){t.dom.removeEventListener(e,n,r)},Er=function(t,e){var n=vn(t);n.each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},_r=function(t,e){var n=wn(t);n.fold((function(){var n=vn(t);n.each((function(t){Dr(t,e)}))}),(function(t){Er(t,e)}))},Ar=function(t,e){var n=Sn(t);n.fold((function(){Dr(t,e)}),(function(n){t.dom.insertBefore(e.dom,n.dom)}))},Dr=function(t,e){t.dom.appendChild(e.dom)},Mr=function(t,e,n){Cn(t,n).fold((function(){Dr(t,e)}),(function(t){Er(t,e)}))},Rr=function(t,e){G(e,(function(e){Er(t,e)}))},Nr=function(t,e){G(e,(function(e){Dr(t,e)}))},zr=function(t){t.dom.textContent="",G(xn(t),(function(t){Br(t)}))},Br=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},Lr=function(t){var e=xn(t);e.length>0&&Rr(t,e),Br(t)},Hr=function(t){var e=void 0!==t?t.dom:document,n=e.body.scrollLeft||e.documentElement.scrollLeft,r=e.body.scrollTop||e.documentElement.scrollTop;return lr(n,r)},Ir=function(t,e,n){var r=void 0!==n?n.dom:document,o=r.defaultView;o&&o.scrollTo(t,e)},Pr=function(t){var e=void 0===t?window:t;return en().browser.isFirefox()?L.none():L.from(e["visualViewport"])},Fr=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},Vr=function(t){var e=void 0===t?window:t,n=e.document,r=Hr(ee.fromDom(n));return Pr(e).fold((function(){var t=e.document.documentElement,n=t.clientWidth,o=t.clientHeight;return Fr(r.left,r.top,n,o)}),(function(t){return Fr(Math.max(t.pageLeft,r.left),Math.max(t.pageTop,r.top),t.width,t.height)}))},Ur=function(t,e){var n=t.view(e);return n.fold(w([]),(function(e){var n=t.owner(e),r=Ur(t,n);return[e].concat(r)}))},jr=function(t,e){var n=e.owner(t),r=Ur(e,n);return L.some(r)},Wr=function(t){var e,n=t.dom===document?L.none():L.from(null===(e=t.dom.defaultView)||void 0===e?void 0:e.frameElement);return n.map(ee.fromDom)},qr=function(t){return mn(t)},$r=Object.freeze({__proto__:null,view:Wr,owner:qr}),Gr=function(t){var e=ee.fromDom(document),n=Hr(e),r=jr(t,$r);return r.fold(S(mr,t),(function(e){var r=gr(t),o=J(e,(function(t,e){var n=gr(e);return{left:t.left+n.left,top:t.top+n.top}}),{left:0,top:0});return lr(o.left+r.left+n.left,o.top+r.top+n.top)}))},Kr=function(t,e,n){return{point:t,width:e,height:n}},Xr=function(t,e,n,r){return{x:t,y:e,width:n,height:r}},Yr=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},Jr=function(t){var e=mr(t),n=br(t),r=ar(t);return Yr(e.left,e.top,n,r)},Qr=function(t){var e=Gr(t),n=br(t),r=ar(t);return Yr(e.left,e.top,n,r)},Zr=function(){return Vr(window)},to=function(t){var e=function(e){return to(t)},n=function(e){return to(t)},r=function(e){return to(e(t))},o=function(e){return to(t)},i=function(e){e(t)},u=function(e){return e(t)},a=function(e,n){return n(t)},c=function(e){return e(t)},s=function(e){return e(t)},l=function(){return L.some(t)};return{isValue:E,isError:O,getOr:w(t),getOrThunk:w(t),getOrDie:w(t),or:e,orThunk:n,fold:a,map:r,mapError:o,each:i,bind:u,exists:c,forall:s,toOptional:l}},eo=function(t){var e=function(t){return t()},n=function(){return T(String(t))()},r=x,o=function(t){return t()},i=function(e){return eo(t)},u=function(e){return eo(e(t))},a=function(e){return eo(t)},c=function(e,n){return e(t)};return{isValue:O,isError:E,getOr:x,getOrThunk:e,getOrDie:n,or:r,orThunk:o,fold:c,map:i,mapError:u,each:p,bind:a,exists:O,forall:E,toOptional:L.none}},no=function(t,e){return t.fold((function(){return eo(e)}),to)},ro={value:to,error:eo,fromOption:no};(function(t){t[t["Error"]=0]="Error",t[t["Value"]=1]="Value"})(ne||(ne={}));var oo=function(t,e,n){return t.stype===ne.Error?e(t.serror):n(t.svalue)},io=function(t){var e=[],n=[];return G(t,(function(t){oo(t,(function(t){return n.push(t)}),(function(t){return e.push(t)}))})),{values:e,errors:n}},uo=function(t,e){return t.stype===ne.Error?{stype:ne.Error,serror:e(t.serror)}:t},ao=function(t,e){return t.stype===ne.Value?{stype:ne.Value,svalue:e(t.svalue)}:t},co=function(t,e){return t.stype===ne.Value?e(t.svalue):t},so=function(t,e){return t.stype===ne.Error?e(t.serror):t},lo=function(t){return{stype:ne.Value,svalue:t}},fo=function(t){return{stype:ne.Error,serror:t}},mo=function(t){return oo(t,ro.error,ro.value)},go=function(t){return t.fold(fo,lo)},ho={fromResult:go,toResult:mo,svalue:lo,partition:io,serror:fo,bind:co,bindError:so,map:ao,mapError:uo,fold:oo},po=function(t,e,n,r){return{tag:"field",key:t,newKey:e,presence:n,prop:r}},vo=function(t,e){return{tag:"custom",newKey:t,instantiator:e}},bo=function(t,e,n){switch(t.tag){case"field":return e(t.key,t.newKey,t.presence,t.prop);case"custom":return n(t.newKey,t.instantiator)}},yo=function(t,e){return e},wo=function(t,e){var n=u(t)&&u(e);return n?Co(t,e):e},xo=function(t){return function(){for(var e=[],n=0;n0?ho.svalue(Co(e,So.apply(void 0,t))):ho.svalue(e)},Mo=function(t){return b(ho.serror,nt)(t)},Ro=function(t,e){var n=ho.partition(t);return n.errors.length>0?Mo(n.errors):Do(n.values,e)},No=function(t){var e=ho.partition(t);return e.errors.length>0?Mo(e.errors):ho.svalue(e.values)},zo={consolidateObj:Ro,consolidateArr:No},Bo=function(t){return u(t)&&ht(t).length>100?" removed due to size":JSON.stringify(t,null,2)},Lo=function(t){var e=t.length>10?t.slice(0,10).concat([{path:[],getErrorInfo:w("... (only showing first ten failures)")}]):t;return $(e,(function(t){return"Failed path: ("+t.path.join(" > ")+")\n"+t.getErrorInfo()}))},Ho=function(t,e){return ho.serror([{path:t,getErrorInfo:e}])},Io=function(t,e,n){return Ho(t,(function(){return'Could not find valid *required* value for "'+e+'" in '+Bo(n)}))},Po=function(t,e){return Ho(t,(function(){return'Choice schema did not contain choice key: "'+e+'"'}))},Fo=function(t,e,n){return Ho(t,(function(){return'The chosen schema: "'+n+'" did not exist in branches: '+Bo(e)}))},Vo=function(t,e){return Ho(t,(function(){return"There are unsupported fields: ["+e.join(", ")+"] specified"}))},Uo=function(t,e){return Ho(t,w(e))},jo=function(t){var e=function(e,n){return ho.bindError(t(n),(function(t){return Uo(e,t)}))},n=w("val");return{extract:e,toString:n}},Wo=jo(ho.svalue),qo=function(t,e,n,r){return Ot(e,n).fold((function(){return Io(t,n,e)}),r)},$o=function(t,e,n,r){var o=Ot(t,e).getOrThunk((function(){return n(t)}));return r(o)},Go=function(t,e,n){return n(Ot(t,e))},Ko=function(t,e,n,r){var o=Ot(t,e).map((function(e){return!0===e?n(t):e}));return r(o)},Xo=function(t,e,n,r,o){var i=function(t){return o.extract(e.concat([r]),t)},u=function(t){return t.fold((function(){return ho.svalue(L.none())}),(function(t){var n=o.extract(e.concat([r]),t);return ho.map(n,L.some)}))};switch(t.tag){case"required":return qo(e,n,r,i);case"defaultedThunk":return $o(n,r,t.process,i);case"option":return Go(n,r,u);case"defaultedOptionThunk":return Ko(n,r,t.process,u);case"mergeWithThunk":return $o(n,r,w({}),(function(e){var r=Co(t.process(n),e);return i(r)}))}},Yo=function(t,e,n){for(var r={},o=[],i=0,u=n;i0?ho.serror(o):ho.svalue(r)},Jo=function(t){var e=function(e,n){return t().extract(e,n)},n=function(){return t().toString()};return{extract:e,toString:n}},Qo=function(t){return ht(Ct(t,d))},Zo=function(t){var e=ti(t),n=J(t,(function(t,e){return bo(e,(function(e){var n;return Co(t,(n={},n[e]=!0,n))}),w(t))}),{}),r=function(t,r){var o=s(r)?[]:Qo(r),i=Y(o,(function(t){return!_t(n,t)}));return 0===i.length?e.extract(t,r):Vo(t,i)};return{extract:r,toString:e.toString}},ti=function(t){var e=function(e,n){return Yo(e,n,t)},n=function(){var e=$(t,(function(t){return bo(t,(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}},ei=function(t){var e=function(e,n){var r=$(n,(function(n,r){return t.extract(e.concat(["["+r+"]"]),n)}));return zo.consolidateArr(r)},n=function(){return"array("+t.toString()+")"};return{extract:e,toString:n}},ni=function(t){var e=function(e,n){for(var r=[],o=0,i=t;o0?pu(n.errors):hu(n.values,e)},bu=function(t){return m(t)?t:O},yu=function(t,e,n){var r=t.dom,o=bu(n);while(r.parentNode){r=r.parentNode;var i=ee.fromDom(r),u=e(i);if(u.isSome())return u;if(o(i))break}return L.none()},wu=function(t,e,n){var r=e(t),o=bu(n);return r.orThunk((function(){return o(t)?L.none():yu(t,e,o)}))},xu=function(t,e){return sn(t.element,e.event.target)},Cu={can:E,abort:O,run:p},Su=function(t){if(!_t(t,"can")&&!_t(t,"abort")&&!_t(t,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(t,null,2)+" does not have can, abort, or run!");return A(A({},Cu),t)},ku=function(t,e){return function(){for(var n=[],r=0;r1?Y(e[n],(function(e){return j(t,(function(t){return t.name===e}))})).join(" > "):t[0].name;return mu(n,zc(o,i))}))}));return vu(n,{})},$c="alloy.base.behaviour",Gc=ti([Oi("dom","dom",ko(),ti([Ai("tag"),Ki("styles",{}),Ki("classes",[]),Ki("attributes",{}),Fi("value"),Fi("innerHtml")])),Ai("components"),Ai("uid"),Ki("events",{}),Ki("apis",{}),Oi("eventOrder","eventOrder",Ao((au={},au[ea()]=["disabling",$c,"toggling","typeaheadevents"],au[Ju()]=[$c,"focusing","keying"],au[aa()]=[$c,"disabling","toggling","representing"],au[Uu()]=[$c,"representing","streaming","invalidating"],au[ma()]=[$c,"representing","item-events","tooltipping"],au[Nu()]=["focusing",$c,"item-type-events"],au[Au()]=["focusing",$c,"item-type-events"],au[Hu()]=["item-type-events","tooltipping"],au[ta()]=["receiving","reflecting","tooltipping"],au)),ui()),Fi("domModification")]),Kc=function(t){return wi("custom.definition",Gc,t)},Xc=function(t){return A(A({},t.dom),{uid:t.uid,domChildren:$(t.components,(function(t){return t.element}))})},Yc=function(t){return t.domModification.fold((function(){return Dc({})}),Dc)},Jc=function(t){return t.events},Qc=function(t,e){var n=Un(t,e);return void 0===n||""===n?[]:n.split(" ")},Zc=function(t,e,n){var r=Qc(t,e),o=r.concat([n]);return Fn(t,e,o.join(" ")),!0},ts=function(t,e,n){var r=Y(Qc(t,e),(function(t){return t!==n}));return r.length>0?Fn(t,e,r.join(" ")):qn(t,e),!1},es=function(t){return void 0!==t.dom.classList},ns=function(t){return Qc(t,"class")},rs=function(t,e){return Zc(t,"class",e)},os=function(t,e){return ts(t,"class",e)},is=function(t,e){es(t)?t.dom.classList.add(e):rs(t,e)},us=function(t){var e=es(t)?t.dom.classList:ns(t);0===e.length&&qn(t,"class")},as=function(t,e){if(es(t)){var n=t.dom.classList;n.remove(e)}else os(t,e);us(t)},cs=function(t,e){return es(t)&&t.dom.classList.contains(e)},ss=function(t,e){G(e,(function(e){is(t,e)}))},ls=function(t,e){G(e,(function(e){as(t,e)}))},fs=function(t,e){return ot(e,(function(e){return cs(t,e)}))},ds=function(t){return t.dom.value},ms=function(t,e){if(void 0===e)throw new Error("Value.set was undefined");t.dom.value=e},gs=function(t){var e=ee.fromTag(t.tag);Vn(e,t.attributes),ss(e,t.classes),Xn(e,t.styles),t.innerHtml.each((function(t){return Ka(e,t)}));var n=t.domChildren;return Nr(e,n),t.value.each((function(t){ms(e,t)})),t.uid,lc(e,t.uid),e},hs=function(t){var e=Ot(t,"behaviours").getOr({});return rt(ht(e),(function(t){var n=e[t];return d(n)?[n.me]:[]}))},ps=function(t,e){return Oc(t,e)},vs=function(t){var e=hs(t);return ps(t,e)},bs=function(t,e,n){var r=Xc(t),o=Yc(t),i={"alloy.base.modification":o},u=e.length>0?Rc(n,i,e,r):o;return Mc(r,u)},ys=function(t,e,n){var r={"alloy.base.behaviour":Jc(t)};return Vc(n,t.eventOrder,e,r).getOrDie()},ws=function(t){var e=function(){return y},n=ou(hc),r=xi(Kc(t)),o=vs(t),i=Ec(o),u=_c(o),a=bs(r,i,u),c=gs(a),s=ys(r,i,u),l=ou(r.components),f=function(t){n.set(t)},d=function(){n.set(gc(e))},g=function(){var t=xn(c),e=rt(t,(function(t){return n.get().getByDom(t).fold((function(){return[]}),ct)}));l.set(e)},h=function(e){var n=u,r=m(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 m(u[t.name()])},v=function(){return r.apis},b=function(t){return u[t]().map((function(t){return t.state.readState()})).getOr("not enabled")},y={uid:t.uid,getSystem:n.get,config:h,hasConfigured:p,spec:t,readState:b,getApis:v,connect:f,disconnect:d,element:c,syncComponents:g,components:l.get,events:s};return y},xs=function(t){var e=Ot(t,"components").getOr([]);return $(e,Es)},Cs=function(t){var e=mc(t),n=e.events,r=D(e,["events"]),o=xs(r),i=A(A({},r),{events:A(A({},nc),n),components:o});return ro.value(ws(i))},Ss=function(t){var e=ee.fromText(t);return ks({element:e})},ks=function(t){var e=Ci("external.component",Zo([Ai("element"),Fi("uid")]),t),n=ou(gc()),r=function(t){n.set(t)},o=function(){n.set(gc((function(){return u})))},i=e.uid.getOrThunk((function(){return dc("external")}));lc(e.element,i);var u={uid:i,getSystem:n.get,config:L.none,hasConfigured:O,connect:r,disconnect:o,getApis:function(){return{}},element:e.element,spec:t,readState:w("No state"),syncComponents:p,components:w([]),events:{}};return xc(u)},Ts=dc,Os=function(t){return Et(t,"uid")},Es=function(t){return Cc(t).getOrThunk((function(){var e=Os(t)?t:A({uid:Ts("")},t);return Cs(e).getOrDie()}))},_s=xc;function As(t,e,n,r,o){return t(n,r)?L.some(n):m(o)&&o(n)?L.none():e(n,r,o)}var Ds,Ms=function(t,e,n){var r=t.dom,o=m(n)?n:O;while(r.parentNode){r=r.parentNode;var i=ee.fromDom(r);if(e(i))return L.some(i);if(o(i))break}return L.none()},Rs=function(t,e,n){var r=function(t,e){return e(t)};return As(r,Ms,t,e,n)},Ns=function(t,e){var n=function(t){return e(ee.fromDom(t))},r=tt(t.dom.childNodes,n);return r.map(ee.fromDom)},zs=function(t,e){var n=function(t){for(var r=0;r-1}));return e.bind((function(t){var e=Un(t,"id"),n=An(t);return Is(n,'[aria-owns="'+e+'"]')}))},Vs=function(){var t=oc("aria-owns"),e=function(e){Fn(e,"aria-owns",t)},n=function(t){qn(t,"aria-owns")};return{id:t,link:e,unlink:n}},Us=function(t,e){return Fs(e).exists((function(e){return js(t,e)}))},js=function(t,e){return Bs(e,(function(e){return sn(e,t.element)}),O)||Us(t,e)},Ws="unknown";(function(t){t[t["STOP"]=0]="STOP",t[t["NORMAL"]=1]="NORMAL",t[t["LOGGING"]=2]="LOGGING"})(Ds||(Ds={}));var qs=ou({}),$s=function(t,e){var n=[],r=(new Date).getTime();return{logEventCut:function(t,e,r){n.push({outcome:"cut",target:e,purpose:r})},logEventStopped:function(t,e,r){n.push({outcome:"stopped",target:e,purpose:r})},logNoParent:function(t,e,r){n.push({outcome:"no-parent",target:e,purpose:r})},logEventNoHandlers:function(t,e){n.push({outcome:"no-handlers-left",target:e})},logEventResponse:function(t,e,r){n.push({outcome:"response",purpose:r,target:e})},write:function(){var o=(new Date).getTime();U(["mousemove","mouseover","mouseout",aa()],t)||console.log(t,{event:t,time:o-r,target:e.dom,sequence:$(n,(function(t){return U(["cut","stopped","response"],t.outcome)?"{"+t.purpose+"} "+t.outcome+" at ("+Za(t.target)+")":t.outcome}))})}}},Gs=function(t,e,n){var r=Ot(qs.get(),t).orThunk((function(){var e=ht(qs.get());return gt(e,(function(e){return t.indexOf(e)>-1?L.some(qs.get()[e]):L.none()}))})).getOr(Ds.NORMAL);switch(r){case Ds.NORMAL:return n(Qs());case Ds.LOGGING:var o=$s(t,e),i=n(o);return o.write(),i;case Ds.STOP:return!0}},Ks=["alloy/data/Fields","alloy/debugging/Debugging"],Xs=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(Ks,(function(e){return t.indexOf(e)>-1}))})).getOr(Ws)}return Ws},Ys={logEventCut:p,logEventStopped:p,logNoParent:p,logEventNoHandlers:p,logEventResponse:p,write:p},Js=function(t,e,n){return Gs(t,e,n)},Qs=w(Ys),Zs=w([Ai("menu"),Ai("selectedMenu")]),tl=w([Ai("item"),Ai("selectedItem")]);w(ti(tl().concat(Zs())));var el=w(ti(tl())),nl=Hi("initSize",[Ai("numColumns"),Ai("numRows")]),rl=function(){return Di("markers",el())},ol=function(){return Hi("markers",[Ai("backgroundMenu")].concat(Zs()).concat(tl()))},il=function(t){return Hi("markers",$(t,Ai))},ul=function(t,e,n){return Xs(),Oi(e,e,n,vi((function(t){return ro.value((function(){for(var e=[],n=0;nr?n:o=n&&u<=o,m=a>=r&&a<=i,g=d&&m,h=c<=o&&c>=n,p=s<=i&&s>=r,v=h&&p,b=Math.min(l,u>=n?o-u:c-n),y=Math.min(f,a>=r?i-a:s-r);return{originInBounds:g,sizeInBounds:v,visibleW:b,visibleH:y}},Yf=function(t,e){var n=e.x,r=e.y,o=e.right,i=e.bottom,u=t.x,a=t.y,c=t.width,s=t.height,l=Math.max(n,o-c),f=Math.max(r,i-s),d=_l(u,n,l),m=_l(a,r,f),g=Math.min(d+c,o)-d,h=Math.min(m+s,i)-m;return Yr(d,m,g,h)},Jf=function(t,e,n){var r=w(e.bottom-n.y),o=w(n.bottom-e.y),i=vl(t,o,o,r),u=w(e.right-n.x),a=w(n.right-e.x),c=bl(t,a,a,u);return{maxWidth:c,maxHeight:i}},Qf=function(t,e,n,r){var o=t.bubble,i=o.offset,u=Ml(r,t.restriction,i),a=t.x+i.left,c=t.y+i.top,s=Yr(a,c,e,n),l=Xf(s,u),f=l.originInBounds,d=l.sizeInBounds,m=l.visibleW,g=l.visibleH,h=f&&d,p=h?s:Yf(s,u),v=p.width>0&&p.height>0,b=Jf(t.direction,p,r),y=b.maxWidth,w=b.maxHeight,x={rect:p,maxHeight:w,maxWidth:y,direction:t.direction,placement:t.placement,classes:{on:o.classesOn,off:o.classesOff},layout:t.label,testY:c};return h||t.alwaysFit?Kf.fit(x):Kf.nofit(x,m,g,v)},Zf=function(t,e,n,r,o,i){var u=r.width,a=r.height,c=function(e,c,s,l,f){var d=e(n,r,o,t,i),m=Qf(d,u,a,i);return m.fold(w(m),(function(t,e,n,r){var o=f===r?n>l||e>s:!f&&r;return o?m:Kf.nofit(c,s,l,f)}))},s=Q(e,(function(t,e){var n=S(c,e);return t.fold(w(t),n)}),Kf.nofit({rect:n,maxHeight:r.height,maxWidth:r.width,direction:yl(),placement:"southeast",classes:{on:[],off:[]},layout:"none",testY:n.y},-1,-1,!1));return s.fold(x,x)},td=function(t){var e=ou(L.none()),n=function(){return e.get().each(t)},r=function(){n(),e.set(L.none())},o=function(){return e.get().isSome()},i=function(){return e.get()},u=function(t){n(),e.set(L.some(t))};return{clear:r,isSet:o,get:i,set:u}},ed=function(){return td((function(t){return t.destroy()}))},nd=function(){return td((function(t){return t.unbind()}))},rd=function(){var t=ed(),e=function(e){return t.get().each(e)};return A(A({},t),{run:e})},od=function(){var t=td(p),e=function(e){return t.get().each(e)};return A(A({},t),{on:e})},id=E,ud=function(t,e,n){return kr(t,e,id,n)},ad=function(t,e,n){return Tr(t,e,id,n)},cd=xr,sd=["top","bottom","right","left"],ld="data-alloy-transition-timer",fd=function(t,e){return fs(t,e.classes)},dd=function(t,e,n){return n.exists((function(n){var r=t.mode;return"all"===r||n[r]!==e[r]}))},md=function(t,e){var n=function(t){return parseFloat(t).toFixed(3)};return kt(e,(function(e,r){var o=t[r].map(n),i=e.map(n);return!Dt(o,i)})).isSome()},gd=function(t){var e=function(e){var n=Jn(t,e),r=i(n)?n.split(/\s*,\s*/):[];return Y(r,Gt)},n=function(t){if(i(t)&&/^[\d.]+/.test(t)){var e=parseFloat(t);return Wt(t,"ms")?e:1e3*e}return 0},r=e("transition-delay"),o=e("transition-duration");return Q(o,(function(t,e,o){var i=n(r[o])+n(e);return Math.max(t,i)}),0)},hd=function(t,e){var n,r=nd(),o=nd(),i=function(e){var n,r=null!==(n=e.raw.pseudoElement)&&void 0!==n?n:"";return sn(e.target,t)&&Kt(r)&&U(sd,e.raw.propertyName)},u=function(u){if(f(u)||i(u)){r.clear(),o.clear();var a=null===u||void 0===u?void 0:u.raw.type;(f(a)||a===$u())&&(clearTimeout(n),qn(t,ld),ls(t,e.classes))}},a=function(){r.set(ud(t,$u(),u)),o.set(ud(t,qu(),u))};if("ontransitionstart"in t.dom)var c=ud(t,Gu(),(function(t){i(t)&&(c.unbind(),a())}));else a();var s=gd(t);requestAnimationFrame((function(){n=setTimeout(u,s+17),Fn(t,ld,n)}))},pd=function(t,e){ss(t,e.classes),jn(t,ld).each((function(e){clearTimeout(parseInt(e,10)),qn(t,ld)})),hd(t,e)},vd=function(t,e,n,r,o,i){var u=dd(r,o,i);if(u||fd(t,r)){Kn(t,"position",n.position);var a=Bf(e,t),c=zf(e,A(A({},o),{rect:a})),s=at(sd,(function(t){return c[t]}));md(n,s)&&(Yn(t,s),u&&pd(t,r),rr(t))}else ls(t,r.classes)},bd=function(t){return{width:br(t),height:ar(t)}},yd=function(t,e,n,r){nr(e,"max-height"),nr(e,"max-width");var o=bd(e);return Zf(e,r.preference,t,o,n,r.bounds)},wd=function(t,e){var n=e.classes;ls(t,n.off),ss(t,n.on)},xd=function(t,e,n){var r=n.maxHeightFunction;r(t,e.maxHeight)},Cd=function(t,e,n){var r=n.maxWidthFunction;r(t,e.maxWidth)},Sd=function(t,e,n){var r=zf(n.origin,e);n.transition.each((function(o){vd(t,n.origin,r,o,e,n.lastPlacement)})),Mf(t,r)},kd=function(t,e){qf(t,e.placement)},Td=function(t,e){cr(t,Math.floor(e))},Od=w((function(t,e){Td(t,e),Xn(t,{"overflow-x":"hidden","overflow-y":"auto"})})),Ed=w((function(t,e){Td(t,e)})),_d=function(t,e,n){return void 0===t[e]?n:t[e]},Ad=function(t,e,n,r,o,i,u,a){var c=_d(u,"maxHeightFunction",Od()),s=_d(u,"maxWidthFunction",p),l=t.anchorBox,f=t.origin,d={bounds:Lf(f,i),origin:f,preference:r,maxHeightFunction:c,maxWidthFunction:s,lastPlacement:o,transition:a};return Dd(l,e,n,d)},Dd=function(t,e,n,r){var o=yd(t,e,n,r);return Sd(e,o,r),kd(e,o),wd(e,o),xd(e,o,r),Cd(e,o,r),{layout:o.layout,placement:o.placement}},Md=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right","inset"],Rd=function(t,e,n,r){void 0===r&&(r=1);var o=t*r,i=e*r,u=function(t){return Ot(n,t).getOr([])},a=function(t,e,n){var r=ut(Md,n);return{offset:lr(t,e),classesOn:rt(n,u),classesOff:rt(r,u)}};return{southeast:function(){return a(-t,e,["top","alignLeft"])},southwest:function(){return a(t,e,["top","alignRight"])},south:function(){return a(-t/2,e,["top","alignCentre"])},northeast:function(){return a(-t,-e,["bottom","alignLeft"])},northwest:function(){return a(t,-e,["bottom","alignRight"])},north:function(){return a(-t/2,-e,["bottom","alignCentre"])},east:function(){return a(t,-e/2,["valignCentre","left"])},west:function(){return a(-t,-e/2,["valignCentre","right"])},insetNortheast:function(){return a(o,i,["top","alignLeft","inset"])},insetNorthwest:function(){return a(-o,i,["top","alignRight","inset"])},insetNorth:function(){return a(-o/2,i,["top","alignCentre","inset"])},insetSoutheast:function(){return a(o,-i,["bottom","alignLeft","inset"])},insetSouthwest:function(){return a(-o,-i,["bottom","alignRight","inset"])},insetSouth:function(){return a(-o/2,-i,["bottom","alignCentre","inset"])},insetEast:function(){return a(-o,-i/2,["valignCentre","right","inset"])},insetWest:function(){return a(o,-i/2,["valignCentre","left","inset"])}}},Nd=function(){return Rd(0,0,{})},zd=x,Bd=function(t,e){return function(n){return"rtl"===Ld(n)?e:t}},Ld=function(t){return"rtl"===Jn(t,"direction")?"rtl":"ltr"};(function(t){t["TopToBottom"]="toptobottom",t["BottomToTop"]="bottomtotop"})(Pf||(Pf={}));var Hd="data-alloy-vertical-dir",Id=function(t){return Bs(t,(function(t){return le(t)&&Un(t,"data-alloy-vertical-dir")===Pf.BottomToTop}))},Pd=function(){return $i("layouts",[Ai("onLtr"),Ai("onRtl"),Fi("onBottomLtr"),Fi("onBottomRtl")])},Fd=function(t,e,n,r,o,i,u){var a=u.map(Id).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=Bd(l,f);return d(t)},Vd=function(t,e,n){var r=e.hotspot,o=Bf(n,r.element),i=Fd(t.element,e,Zl(),tf(),Jl(),Ql(),L.some(e.hotspot.element));return L.some(zd({anchorBox:o,bubble:e.bubble.getOr(Nd()),overrides:e.overrides,layouts:i,placer:L.none()}))},Ud=[Ai("hotspot"),Fi("bubble"),Ki("overrides",{}),Pd(),fl("placement",Vd)],jd=function(t,e,n){var r=Hf(n,e.x,e.y),o=Yr(r.left,r.top,e.width,e.height),i=Fd(t.element,e,Xl(),Yl(),Xl(),Yl(),L.none());return L.some(zd({anchorBox:o,bubble:e.bubble,overrides:e.overrides,layouts:i,placer:L.none()}))},Wd=[Ai("x"),Ai("y"),Ki("height",0),Ki("width",0),Ki("bubble",Nd()),Ki("overrides",{}),Pd(),fl("placement",jd)],qd=uu.generate([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),$d=function(t){return t.fold(x,(function(t,e,n){return t.translate(-e,-n)}))},Gd=function(t){return t.fold(x,x)},Kd=function(t){return Q(t,(function(t,e){return t.translate(e.left,e.top)}),lr(0,0))},Xd=function(t){var e=$(t,$d);return Kd(e)},Yd=function(t){var e=$(t,Gd);return Kd(e)},Jd=qd.screen,Qd=qd.absolute,Zd=function(t,e,n){var r=pn(n.root).dom,o=function(e){var n=mn(e),r=mn(t.element);return sn(n,r)};return L.from(r.frameElement).map(ee.fromDom).filter(o).map(mr)},tm=function(t,e,n){var r=mn(t.element),o=Hr(r),i=Zd(t,e,n).getOr(o);return Qd(i,o.left,o.top)},em=function(t,e,n,r){var o=Jd(lr(t,e));return L.some(Kr(o,n,r))},nm=function(t,e,n,r,o){return t.map((function(t){var i=[e,t.point],u=If(r,(function(){return Yd(i)}),(function(){return Yd(i)}),(function(){return Xd(i)})),a=Xr(u.left,u.top,t.width,t.height),c=n.showAbove?Jl():Zl(),s=n.showAbove?Ql():tf(),l=Fd(o,n,c,s,c,s,L.none());return zd({anchorBox:a,bubble:n.bubble.getOr(Nd()),overrides:n.overrides,layouts:l,placer:L.none()})}))},rm=function(t,e,n){var r=tm(t,n,e);return e.node.filter(Ln).bind((function(o){var i=o.dom.getBoundingClientRect(),u=em(i.left,i.top,i.width,i.height),a=e.node.getOr(t.element);return nm(u,r,e,n,a)}))},om=[Ai("node"),Ai("root"),Fi("bubble"),Pd(),Ki("overrides",{}),Ki("showAbove",!1),fl("placement",rm)],im="\ufeff",um=" ",am=function(t,e,n,r){return{start:t,soffset:e,finish:n,foffset:r}},cm={create:am},sm=uu.generate([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),lm=function(t,e,n,r){return t.fold(e,n,r)},fm=function(t){return t.fold(x,x,x)},dm=sm.before,mm=sm.on,gm=sm.after,hm={before:dm,on:mm,after:gm,cata:lm,getStart:fm},pm=uu.generate([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),vm=function(t){return pm.exact(t.start,t.soffset,t.finish,t.foffset)},bm=function(t){return t.match({domRange:function(t){return ee.fromDom(t.startContainer)},relative:function(t,e){return hm.getStart(t)},exact:function(t,e,n,r){return t}})},ym=pm.domRange,wm=pm.relative,xm=pm.exact,Cm=function(t){var e=bm(t);return pn(e)},Sm=cm.create,km={domRange:ym,relative:wm,exact:xm,exactFromRange:vm,getWin:Cm,range:Sm},Tm=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)}))},Om=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)}))},Em=function(t,e,n){var r=t.document.createRange();return Tm(r,e),Om(r,n),r},_m=function(t,e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},Am=function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom,width:t.width,height:t.height}},Dm=function(t){var e=t.getClientRects(),n=e.length>0?e[0]:t.getBoundingClientRect();return n.width>0||n.height>0?L.some(n).map(Am):L.none()},Mm=function(t){var e=t.getBoundingClientRect();return e.width>0||e.height>0?L.some(e).map(Am):L.none()},Rm=uu.generate([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Nm=function(t,e,n){return e(ee.fromDom(n.startContainer),n.startOffset,ee.fromDom(n.endContainer),n.endOffset)},zm=function(t,e){return e.match({domRange:function(t){return{ltr:w(t),rtl:L.none}},relative:function(e,n){return{ltr:ge((function(){return Em(t,e,n)})),rtl:ge((function(){return L.some(Em(t,n,e))}))}},exact:function(e,n,r,o){return{ltr:ge((function(){return _m(t,e,n,r,o)})),rtl:ge((function(){return L.some(_m(t,r,o,e,n))}))}}})},Bm=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 Rm.rtl(ee.fromDom(t.endContainer),t.endOffset,ee.fromDom(t.startContainer),t.startOffset)})).getOrThunk((function(){return Nm(t,Rm.ltr,n)}))}return Nm(t,Rm.ltr,n)},Lm=function(t,e){var n=zm(t,e);return Bm(t,n)},Hm=function(t,e){var n=Lm(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}})};Rm.ltr,Rm.rtl;var Im,Pm=function(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)?L.from(e.dom.nodeValue):L.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}},Fm=Pm(fe,"text"),Vm=function(t){return Fm.get(t)},Um=function(t){return Fm.getOption(t)},jm=function(t){return"img"===ae(t)?1:Um(t).fold((function(){return xn(t).length}),(function(t){return t.length}))},Wm=function(t){return Um(t).filter((function(t){return 0!==t.trim().length||t.indexOf(um)>-1})).isSome()},qm=["img","br"],$m=function(t){var e=Wm(t);return e||U(qm,ae(t))},Gm=function(t){return Km(t,$m)},Km=function(t,e){var n=function(t){for(var r=xn(t),o=r.length-1;o>=0;o--){var i=r[o];if(e(i))return L.some(i);var u=n(i);if(u.isSome())return u}return L.none()};return n(t)},Xm=function(t,e){return an(e,t)},Ym=function(t,e,n,r){var o=mn(t),i=o.dom.createRange();return i.setStart(t.dom,e),i.setEnd(n.dom,r),i},Jm=function(t,e,n,r){var o=Ym(t,e,n,r),i=sn(t,n)&&e===r;return o.collapsed&&!i},Qm=function(t){return L.from(t.getSelection())},Zm=function(t){if(t.rangeCount>0){var e=t.getRangeAt(0),n=t.getRangeAt(t.rangeCount-1);return L.some(cm.create(ee.fromDom(e.startContainer),e.startOffset,ee.fromDom(n.endContainer),n.endOffset))}return L.none()},tg=function(t){if(null===t.anchorNode||null===t.focusNode)return Zm(t);var e=ee.fromDom(t.anchorNode),n=ee.fromDom(t.focusNode);return Jm(e,t.anchorOffset,n,t.focusOffset)?L.some(cm.create(e,t.anchorOffset,n,t.focusOffset)):Zm(t)},eg=function(t){return Qm(t).filter((function(t){return t.rangeCount>0})).bind(tg)},ng=function(t,e){var n=Hm(t,e);return Dm(n)},rg=function(t,e){var n=Hm(t,e);return Mm(n)},og=function(t,e){return{element:t,offset:e}},ig=function(t,e){var n=xn(t);if(0===n.length)return og(t,e);if(e"})),ui()),Cp=Ei("schema",(function(){return[Fi("preprocess")]})),Sp=Ki("defaults",w({})),kp=Ki("overrides",w({})),Tp=ti([bp,yp,wp,xp,Sp,kp]),Op=ti([bp,yp,wp,Sp,kp]),Ep=ti([bp,yp,wp,xp,Sp,kp]),_p=ti([bp,Cp,wp,Ai("unit"),xp,Sp,kp]),Ap=function(t){return t.fold(L.some,L.none,L.some,L.some)},Dp=function(t){var e=function(t){return t.name};return t.fold(e,e,e,e)},Mp=function(t){return t.fold(x,x,x,x)},Rp=function(t,e){return function(n){var r=Ci("Converting part type",e,n);return t(r)}},Np=Rp(vp.required,Tp),zp=Rp(vp.external,Op),Bp=Rp(vp.optional,Ep),Lp=Rp(vp.group,_p),Hp=w("entirety"),Ip=Object.freeze({__proto__:null,required:Np,external:zp,optional:Bp,group:Lp,asNamedPart:Ap,name:Dp,asCommon:Mp,original:Hp}),Pp=function(t,e,n,r){return Co(e.defaults(t,n,r),n,{uid:t.partUids[e.name]},e.overrides(t,n,r))},Fp=function(t,e,n){var r={},o={};return G(n,(function(t){t.fold((function(t){r[t.pname]=gp(!0,(function(e,n,r){return t.factory.sketch(Pp(e,t,n,r))}))}),(function(t){var n=e.parts[t.name];o[t.name]=w(t.factory.sketch(Pp(e,t,n[Hp()]),n))}),(function(t){r[t.pname]=gp(!1,(function(e,n,r){return t.factory.sketch(Pp(e,t,n,r))}))}),(function(t){r[t.pname]=hp(!0,(function(e,n,r){var o=e[t.name];return $(o,(function(n){return t.factory.sketch(Co(t.defaults(e,n,r),n,t.overrides(e,n)))}))}))}))})),{internals:w(r),externals:w(o)}},Vp=function(t,e){var n={};return G(e,(function(e){Ap(e).each((function(e){var r=Up(t,e.pname);n[e.name]=function(n){var o=Ci("Part: "+e.name+" in "+t,ti(e.schema),n);return A(A({},r),{config:n,validated:o})}}))})),n},Up=function(t,e){return{uiType:pp(),owner:t,name:e}},jp=function(t,e,n){return{uiType:pp(),owner:t,name:e,config:n,validated:{}}},Wp=function(t){return rt(t,(function(t){return t.fold(L.none,L.some,L.none,L.none).map((function(t){return Hi(t.name,t.schema.concat([dl(Hp())]))})).toArray()}))},qp=function(t){return $(t,Dp)},$p=function(t,e,n){return Fp(t,e,n)},Gp=function(t,e,n){return mp(L.some(t),e,e.components,n)},Kp=function(t,e,n){var r=e.partUids[n];return t.getSystem().getByUid(r).toOptional()},Xp=function(t,e,n){return Kp(t,e,n).getOrDie("Could not find part: "+n)},Yp=function(t,e,n){var r={},o=e.partUids,i=t.getSystem();return G(n,(function(t){r[t]=w(i.getByUid(o[t]))})),r},Jp=function(t,e){var n=t.getSystem();return bt(e.partUids,(function(t,e){return w(n.getByUid(t))}))},Qp=function(t){return ht(t.partUids)},Zp=function(t,e,n){var r={},o=e.partUids,i=t.getSystem();return G(n,(function(t){r[t]=w(i.getByUid(o[t]).getOrDie())})),r},tv=function(t,e){var n=qp(e);return gu($(n,(function(e){return{key:e,value:t+"-"+e}})))},ev=function(t){return Oi("partUids","partUids",_o((function(e){return tv(e.uid,t)})),ui())},nv=Object.freeze({__proto__:null,generate:Vp,generateOne:jp,schemas:Wp,names:qp,substitutes:$p,components:Gp,defaultUids:tv,defaultUidsSchema:ev,getAllParts:Jp,getAllPartNames:Qp,getPart:Kp,getPartOrDie:Xp,getParts:Yp,getPartsOrDie:Zp}),rv=function(t,e){var n=t.length>0?[Hi("parts",t)]:[];return n.concat([Ai("uid"),Ki("dom",{}),Ki("components",[]),dl("originalSpec"),Ki("debug.sketcher",{})]).concat(e)},ov=function(t,e,n,r,o){var i=rv(r,o);return Ci(t+" [SpecSchema]",Zo(i.concat(e)),n)},iv=function(t,e,n,r){var o=cv(r),i=ov(t,e,o,[],[]);return n(i,o)},uv=function(t,e,n,r,o){var i=cv(o),u=Wp(n),a=ev(n),c=ov(t,e,i,u,[a]),s=$p(t,c,n),l=Gp(t,c,s.internals());return r(c,l,i,s.externals())},av=function(t){return Et(t,"uid")},cv=function(t){return av(t)?t:A(A({},t),{uid:dc("uid")})},sv=function(t){return void 0!==t.uid},lv=Zo([Ai("name"),Ai("factory"),Ai("configFields"),Ki("apis",{}),Ki("extraApis",{})]),fv=Zo([Ai("name"),Ai("factory"),Ai("configFields"),Ai("partFields"),Ki("apis",{}),Ki("extraApis",{})]),dv=function(t){var e=Ci("Sketcher for "+t.name,lv,t),n=function(t){return iv(e.name,e.configFields,e.factory,t)},r=bt(e.apis,Sc),o=bt(e.extraApis,(function(t,e){return bc(t,e)}));return A(A({name:e.name,configFields:e.configFields,sketch:n},r),o)},mv=function(t){var e=Ci("Sketcher for "+t.name,fv,t),n=function(t){return uv(e.name,e.configFields,e.partFields,e.factory,t)},r=Vp(e.name,e.partFields),o=bt(e.apis,Sc),i=bt(e.extraApis,(function(t,e){return bc(t,e)}));return A(A({name:e.name,partFields:e.partFields,configFields:e.configFields,sketch:n,parts:r},o),i)},gv=function(t){return"input"===ae(t)&&"radio"!==Un(t,"type")||"textarea"===ae(t)},hv=function(t,e,n){return e.find(t)},pv=Object.freeze({__proto__:null,getCurrent:hv}),vv=[Ai("find")],bv=hf({fields:vv,name:"composing",apis:pv}),yv=["input","button","textarea","select"],wv=function(t,e,n){var r=e.disabled()?_v:Av;r(t,e)},xv=function(t,e){return!0===e.useNative&&U(yv,ae(t.element))},Cv=function(t){return Wn(t.element,"disabled")},Sv=function(t){Fn(t.element,"disabled","disabled")},kv=function(t){qn(t.element,"disabled")},Tv=function(t){return"true"===Un(t.element,"aria-disabled")},Ov=function(t){Fn(t.element,"aria-disabled","true")},Ev=function(t){Fn(t.element,"aria-disabled","false")},_v=function(t,e,n){e.disableClass.each((function(e){is(t.element,e)}));var r=xv(t,e)?Sv:Ov;r(t),e.onDisabled(t)},Av=function(t,e,n){e.disableClass.each((function(e){as(t.element,e)}));var r=xv(t,e)?kv:Ev;r(t),e.onEnabled(t)},Dv=function(t,e){return xv(t,e)?Cv(t):Tv(t)},Mv=function(t,e,n,r){var o=r?_v:Av;o(t,e)},Rv=Object.freeze({__proto__:null,enable:Av,disable:_v,isDisabled:Dv,onLoad:wv,set:Mv}),Nv=function(t,e){return Dc({classes:e.disabled()?e.disableClass.toArray():[]})},zv=function(t,e){return _a([Aa(ea(),(function(e,n){return Dv(e,t)})),af(t,e,wv)])},Bv=Object.freeze({__proto__:null,exhibit:Nv,events:zv}),Lv=[tu("disabled",O),Ki("useNative",!0),Fi("disableClass"),al("onDisabled"),al("onEnabled")],Hv=hf({fields:Lv,name:"disabling",active:Bv,apis:Rv}),Iv=function(t,e,n,r){var o=Xm(t.element,"."+e.highlightClass);G(o,(function(n){j(r,(function(t){return t.element===n}))||(as(n,e.highlightClass),t.getSystem().getByDom(n).each((function(n){e.onDehighlight(t,n),Ca(n,xa())})))}))},Pv=function(t,e,n){return Iv(t,e,n,[])},Fv=function(t,e,n,r){$v(t,e,n,r)&&(as(r.element,e.highlightClass),e.onDehighlight(t,r),Ca(r,xa()))},Vv=function(t,e,n,r){Iv(t,e,n,[r]),$v(t,e,n,r)||(is(r.element,e.highlightClass),e.onHighlight(t,r),Ca(r,wa()))},Uv=function(t,e,n){Xv(t,e).each((function(r){Vv(t,e,n,r)}))},jv=function(t,e,n){Yv(t,e).each((function(r){Vv(t,e,n,r)}))},Wv=function(t,e,n,r){Kv(t,e,n,r).fold((function(t){throw t}),(function(r){Vv(t,e,n,r)}))},qv=function(t,e,n,r){var o=tb(t,e),i=tt(o,r);i.each((function(r){Vv(t,e,n,r)}))},$v=function(t,e,n,r){return cs(r.element,e.highlightClass)},Gv=function(t,e,n){return Is(t.element,"."+e.highlightClass).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},Kv=function(t,e,n,r){var o=Xm(t.element,"."+e.itemClass);return L.from(o[r]).fold((function(){return ro.error(new Error("No element found with index "+r))}),t.getSystem().getByDom)},Xv=function(t,e,n){return Is(t.element,"."+e.itemClass).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},Yv=function(t,e,n){var r=Xm(t.element,"."+e.itemClass),o=r.length>0?L.some(r[r.length-1]):L.none();return o.bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},Jv=function(t,e,n,r){var o=Xm(t.element,"."+e.itemClass),i=et(o,(function(t){return cs(t,e.highlightClass)}));return i.bind((function(e){var n=El(e,r,0,o.length-1);return t.getSystem().getByDom(o[n]).toOptional()}))},Qv=function(t,e,n){return Jv(t,e,n,-1)},Zv=function(t,e,n){return Jv(t,e,n,1)},tb=function(t,e,n){var r=Xm(t.element,"."+e.itemClass);return Mt($(r,(function(e){return t.getSystem().getByDom(e).toOptional()})))},eb=Object.freeze({__proto__:null,dehighlightAll:Pv,dehighlight:Fv,highlight:Vv,highlightFirst:Uv,highlightLast:jv,highlightAt:Wv,highlightBy:qv,isHighlighted:$v,getHighlighted:Gv,getFirst:Xv,getLast:Yv,getPrevious:Qv,getNext:Zv,getCandidates:tb}),nb=[Ai("highlightClass"),Ai("itemClass"),al("onHighlight"),al("onDehighlight")],rb=hf({fields:nb,name:"highlighting",apis:eb}),ob=[8],ib=[9],ub=[13],ab=[27],cb=[32],sb=[37],lb=[38],fb=[39],db=[40],mb=function(t,e,n){var r=it(t.slice(0,e)),o=it(t.slice(e+1));return tt(r.concat(o),n)},gb=function(t,e,n){var r=it(t.slice(0,e));return tt(r,n)},hb=function(t,e,n){var r=t.slice(0,e),o=t.slice(e+1);return tt(o.concat(r),n)},pb=function(t,e,n){var r=t.slice(e+1);return tt(r,n)},vb=function(t){return function(e){var n=e.raw;return U(t,n.which)}},bb=function(t){return function(e){return ot(t,(function(t){return t(e)}))}},yb=function(t){var e=t.raw;return!0===e.shiftKey},wb=function(t){var e=t.raw;return!0===e.ctrlKey},xb=k(yb),Cb=function(t,e){return{matches:t,classification:e}},Sb=function(t,e){var n=tt(t,(function(t){return t.matches(e)}));return n.map((function(t){return t.classification}))},kb=function(t,e,n){var r=e.exists((function(t){return n.exists((function(e){return sn(e,t)}))}));r||Sa(t,pa(),{prevFocus:e,newFocus:n})},Tb=function(){var t=function(t){return Ef(t.element)},e=function(e,n){var r=t(e);e.getSystem().triggerFocus(n,e.element);var o=t(e);kb(e,r,o)};return{get:t,set:e}},Ob=function(){var t=function(t){return rb.getHighlighted(t).map((function(t){return t.element}))},e=function(e,n){var r=t(e);e.getSystem().getByDom(n).fold(p,(function(t){rb.highlight(e,t)}));var o=t(e);kb(e,r,o)};return{get:t,set:e}};(function(t){t["OnFocusMode"]="onFocus",t["OnEnterOrSpaceMode"]="onEnterOrSpace",t["OnApiMode"]="onApi"})(Im||(Im={}));var Eb=function(t,e,n,r,o){var i=function(){return t.concat([Ki("focusManager",Tb()),Xi("focusInside","onFocus",vi((function(t){return U(["onFocus","onEnterOrSpace","onApi"],t)?ro.value(t):ro.error("Invalid value for focusInside")}))),fl("handler",c),fl("state",e),fl("sendFocusIn",o)])},u=function(t,e,n,r,o){var i=n(t,e,r,o);return Sb(i,e.event).bind((function(n){return n(t,e,r,o)}))},a=function(t,e){var i=t.focusInside!==Im.OnFocusMode?L.none():o(t).map((function(n){return Ra(Ju(),(function(r,o){n(r,t,e),o.stop()}))})),a=function(n,r){var i=vb(cb.concat(ub))(r.event);t.focusInside===Im.OnEnterOrSpaceMode&&i&&xu(n,r)&&o(t).each((function(o){o(n,t,e),r.stop()}))},c=[Ra(Fu(),(function(r,o){u(r,o,n,t,e).fold((function(){a(r,o)}),(function(t){o.stop()}))})),Ra(Vu(),(function(n,o){u(n,o,r,t,e).each((function(t){o.stop()}))}))];return _a(i.toArray().concat(c))},c={schema:i,processKey:u,toEvents:a};return c},_b=function(t){var e=[Fi("onEscape"),Fi("onEnter"),Ki("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),Ki("firstTabstop",0),Ki("useTabstopAt",E),Fi("visibilitySelector")].concat([t]),n=function(t,e){var n=t.visibilitySelector.bind((function(t){return Ps(e,t)})).getOr(e);return ur(n)>0},r=function(t,e){var r=Xm(t.element,e.selector),o=Y(r,(function(t){return n(e,t)}));return L.from(o[e.firstTabstop])},o=function(t,e){return e.focusManager.get(t).bind((function(t){return Ps(t,e.selector)}))},i=function(t,e){return n(t,e)&&t.useTabstopAt(e)},u=function(t,e,n){r(t,e).each((function(n){e.focusManager.set(t,n)}))},a=function(t,e,n,r,o){return o(e,n,(function(t){return i(r,t)})).fold((function(){return r.cyclic?L.some(!0):L.none()}),(function(e){return r.focusManager.set(t,e),L.some(!0)}))},c=function(t,e,n,r){var i=Xm(t.element,n.selector);return o(t,n).bind((function(e){var o=et(i,S(sn,e));return o.bind((function(e){return a(t,i,e,n,r)}))}))},s=function(t,e,n){var r=n.cyclic?mb:gb;return c(t,e,n,r)},l=function(t,e,n){var r=n.cyclic?hb:pb;return c(t,e,n,r)},f=function(t,e,n){return n.onEnter.bind((function(n){return n(t,e)}))},d=function(t,e,n){return n.onEscape.bind((function(n){return n(t,e)}))},m=w([Cb(bb([yb,vb(ib)]),s),Cb(vb(ib),l),Cb(vb(ab),d),Cb(bb([xb,vb(ub)]),f)]),g=w([]);return Eb(e,kc.init,m,g,(function(){return L.some(u)}))},Ab=_b(Ei("cyclic",O)),Db=_b(Ei("cyclic",E)),Mb=function(t,e,n){return Ta(t,n,ea()),L.some(!0)},Rb=function(t,e,n){var r=gv(n)&&vb(cb)(e.event);return r?L.none():Mb(t,e,n)},Nb=function(t,e){return L.some(!0)},zb=[Ki("execute",Rb),Ki("useSpace",!1),Ki("useEnter",!0),Ki("useControlEnter",!1),Ki("useDown",!1)],Bb=function(t,e,n){return n.execute(t,e,t.element)},Lb=function(t,e,n,r){var o=n.useSpace&&!gv(t.element)?cb:[],i=n.useEnter?ub:[],u=n.useDown?db:[],a=o.concat(i).concat(u);return[Cb(vb(a),Bb)].concat(n.useControlEnter?[Cb(bb([wb,vb(ub)]),Bb)]:[])},Hb=function(t,e,n,r){return n.useSpace&&!gv(t.element)?[Cb(vb(cb),Nb)]:[]},Ib=Eb(zb,kc.init,Lb,Hb,(function(){return L.none()})),Pb=function(){var t=od(),e=function(e,n){t.set({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 Tc({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})},Fb=function(t){return t.state(t)},Vb=Object.freeze({__proto__:null,flatgrid:Pb,init:Fb}),Ub=function(t){return function(e,n,r,o){var i=t(e.element);return $b(i,e,n,r,o)}},jb=function(t,e){var n=Bd(t,e);return Ub(n)},Wb=function(t,e){var n=Bd(e,t);return Ub(n)},qb=function(t){return function(e,n,r,o){return $b(t,e,n,r,o)}},$b=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}))},Gb=qb,Kb=qb,Xb=qb,Yb=function(t){return t.offsetWidth<=0&&t.offsetHeight<=0},Jb=function(t){return!Yb(t.dom)},Qb=function(t,e){return et(t,e).map((function(e){return{index:e,candidates:t}}))},Zb=function(t,e,n){var r=function(t){return sn(t,e)},o=Xm(t,n),i=Y(o,Jb);return Qb(i,r)},ty=function(t,e){return et(t,(function(t){return sn(e,t)}))},ey=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&&r1?L.some(t.slice(1)):L.none()}))},g=function(t){return Ot(n.get(),t)},h=function(t){return p(t).bind(qx)},p=function(t){return Ot(e.get(),t)},v=function(e){return Ot(t.get(),e)},b=function(t){var e=o.get();return ut(ht(e),t)},y=function(){return r.get().bind(h)},w=function(){return e.get()};return{setMenuBuilt:a,setContents:c,expand:d,refresh:g,collapse:m,lookupMenu:p,lookupItem:v,otherMenus:b,getPrimary:y,getMenus:w,clear:i,isClear:u,getTriggeringPath:f}},qx=function(t){return"prepared"===t.type?L.some(t.menu):L.none()},$x={init:Wx,extractPreparedMenu:qx},Gx=function(t,e){var n,r=od(),o=function(e,n,r){return bt(r,(function(r,o){var i=function(){return Fx.sketch(A(A({},r),{value:o,markers:t.markers,fakeFocus:t.fakeFocus,onHighlight:t.onHighlight,focusManager:t.fakeFocus?Ob():Tb()}))};return o===n?{type:"prepared",menu:e.getSystem().build(i())}:{type:"notbuilt",nbMenu:i}}))},i=$x.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 tp.getValue(t).value},c=function(t,e,n){return gt(e,(function(t){if(!t.getSystem().isConnected())return L.none();var e=rb.getCandidates(t);return tt(e,(function(t){return a(t)===n}))}))},s=function(e){return bt(t.data.menus,(function(t,e){return rt(t.items,(function(t){return"separator"===t.type?[]:[t.data.value]}))}))},l=function(t,e){rb.highlight(t,e),rb.getHighlighted(e).orThunk((function(){return rb.getFirst(e)})).each((function(e){Ta(t,e.element,na())}))},f=function(t,e){return Mt($(e,(function(e){return t.lookupMenu(e).bind((function(t){return"prepared"===t.type?L.some(t.menu):L.none()}))})))},d=function(e,n,r){var o=f(n,n.otherMenus(r));G(o,(function(n){ls(n.element,[t.markers.backgroundMenu]),t.stayInDom||Pw.remove(e,n)}))},m=function(e){return r.get().getOrThunk((function(){var n={},o=Xm(e.element,"."+t.markers.item),i=Y(o,(function(t){return"true"===Un(t,"aria-haspopup")}));return G(i,(function(t){e.getSystem().getByDom(t).each((function(t){var e=a(t);n[e]=t}))})),r.set(n),n}))},g=function(t,e){var n=m(t);vt(n,(function(t,n){var r=U(e,n);Fn(t.element,"aria-expanded",r)}))},h=function(e,n,r){return L.from(r[0]).bind((function(o){return n.lookupMenu(o).bind((function(o){if("notbuilt"===o.type)return L.none();var i=o.menu,u=f(n,r.slice(1));return G(u,(function(e){is(e.element,t.markers.backgroundMenu)})),Ln(i.element)||Pw.append(e,_s(i)),ls(i.element,[t.markers.backgroundMenu]),l(e,i),d(e,n,r),L.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){if(void 0===o&&(o=n.HighlightSubmenu),r.hasConfigured(Hv)&&Hv.isDisabled(r))return L.some(r);var u=a(r);return i.expand(u).bind((function(u){return g(e,u),L.from(u[0]).bind((function(a){return i.lookupMenu(a).bind((function(c){var s=v(e,a,c);return Ln(s.element)||Pw.append(e,_s(s)),t.onOpenSubmenu(e,r,s,it(u)),o===n.HighlightSubmenu?(rb.highlightFirst(s),h(e,i,u)):(rb.dehighlightAll(s),L.some(r))}))}))}))},y=function(e,n){var r=a(n);return i.collapse(r).bind((function(r){return g(e,r),h(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 g(t,e),h(t,i,e)}))},x=function(t,e){return gv(e.element)?L.none():b(t,e,n.HighlightSubmenu)},C=function(t,e){return gv(e.element)?L.none():y(t,e)},S=function(e,n){return y(e,n).orThunk((function(){return t.onEscape(e,n).map((function(){return e}))}))},k=function(e){return function(n,r){return Ps(r.getSource(),"."+t.markers.item).bind((function(t){return n.getSystem().getByDom(t).toOptional().bind((function(t){return e(n,t).map(E)}))}))}},T=_a([Ra(Ix(),(function(t,e){var n=e.event.item;i.lookupItem(a(n)).each((function(){var n=e.event.menu;rb.highlight(t,n);var r=a(e.event.item);i.refresh(r).each((function(e){return d(t,i,e)}))}))})),qa((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)}),p)}))})),Ua((function(e,n){u(e).each((function(n){Pw.append(e,_s(n)),t.onOpenMenu(e,n),t.highlightImmediately&&l(e,n)}))}))].concat(t.navigateOnHover?[Ra(Cx(),(function(e,r){var o=r.event.item;w(e,o),b(e,o,n.HighlightParent),t.onHover(e,o)}))]:[])),O=function(t){return rb.getHighlighted(t).bind(rb.getHighlighted)},_=function(t){O(t).each((function(e){y(t,e)}))},D=function(t){i.getPrimary().each((function(e){l(t,e)}))},M=function(t){return L.from(t.components()[0]).filter((function(t){return"menu"===Un(t.element,"role")}))},R=function(e){var n=i.getPrimary().bind((function(t){return O(e).bind((function(t){var n=a(t),r=Tt(i.getMenus()),o=Mt($(r,$x.extractPreparedMenu));return i.getTriggeringPath(n,(function(t){return c(e,o,t)}))})).map((function(e){return{primary:t,triggeringPath:e}}))}));n.fold((function(){M(e).each((function(n){t.onRepositionMenu(e,n,[])}))}),(function(n){var r=n.primary,o=n.triggeringPath;t.onRepositionMenu(e,r,o)}))},N={collapseMenu:_,highlightPrimary:D,repositionMenus:R};return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:rp(t.tmenuBehaviours,[Aw.config({mode:"special",onRight:k(x),onLeft:k(C),onEscape:k(S),focusIn:function(t,e){i.getPrimary().each((function(e){Ta(t,e.element,na())}))}}),rb.config({highlightClass:t.markers.selectedMenu,itemClass:t.markers.menu}),bv.config({find:function(t){return rb.getHighlighted(t)}}),Pw.config({})]),eventOrder:t.eventOrder,apis:N,events:T}},Kx=w("collapse-item"),Xx=function(t,e,n){return{primary:t,menus:e,expansions:n}},Yx=function(t,e){return{primary:t,menus:mu(t,e),expansions:{}}},Jx=function(t){return{value:oc(Kx()),meta:{text:t}}},Qx=dv({name:"TieredMenu",configFields:[ll("onExecute"),ll("onEscape"),sl("onOpenMenu"),sl("onOpenSubmenu"),al("onRepositionMenu"),al("onCollapseMenu"),Ki("highlightImmediately",!0),Hi("data",[Ai("primary"),Ai("menus"),Ai("expansions")]),Ki("fakeFocus",!1),al("onHighlight"),al("onHover"),ol(),Ai("dom"),Ki("navigateOnHover",!0),Ki("stayInDom",!1),ep("tmenuBehaviours",[Aw,rb,bv,Pw]),Ki("eventOrder",{})],apis:{collapseMenu:function(t,e){t.collapseMenu(e)},highlightPrimary:function(t,e){t.highlightPrimary(e)},repositionMenus:function(t,e){t.repositionMenus(e)}},factory:Gx,extraApis:{tieredData:Xx,singleData:Yx,collapseItem:Jx}}),Zx=function(t,e,n,r,o){var i=function(){return t.lazySink(e)},u="horizontal"===r.type?{layouts:{onLtr:function(){return Zl()},onRtl:function(){return tf()}}}:{},a=function(t){return 2===t.length},c=function(t){return a(t)?u:{}};return Qx.sketch({dom:{tag:"div"},data:r.data,markers:r.menu.markers,highlightImmediately:r.menu.highlightImmediately,onEscape:function(){return bh.close(e),t.onEscape.map((function(t){return t(e)})),L.some(!0)},onExecute:function(){return L.some(!0)},onOpenMenu:function(t,e){Ig.positionWithinBounds(i().getOrDie(),e,n,o())},onOpenSubmenu:function(t,e,n,r){var o=i().getOrDie();Ig.position(o,n,{anchor:A({type:"submenu",item:e},c(r))})},onRepositionMenu:function(t,e,r){var u=i().getOrDie();Ig.positionWithinBounds(u,e,n,o()),G(r,(function(t){var e=c(t.triggeringPath);Ig.position(u,t.triggeredMenu,{anchor:A({type:"submenu",item:t.triggeringItem},e)})}))}})},tC=function(t,e){var n=function(e,n){var r=t.getRelated(e);return r.exists((function(t){return js(t,n)}))},r=function(t,e){bh.setContent(t,e)},o=function(t,e,n){i(t,e,n,L.none())},i=function(t,e,n,r){u(t,e,n,(function(){return r.map((function(t){return Jr(t)}))}))},u=function(e,n,r,o){var i=t.lazySink(e).getOrDie();bh.openWhileCloaked(e,n,(function(){return Ig.positionWithinBounds(i,e,r,o())})),tp.setValue(e,L.some({mode:"position",config:r,getBounds:o}))},a=function(t,e,n){c(t,e,n,L.none)},c=function(e,n,r,o){var i=Zx(t,e,n,r,o);bh.open(e,i),tp.setValue(e,L.some({mode:"menu",menu:i}))},s=function(t){bh.isOpen(t)&&(tp.setValue(t,L.none()),bh.close(t))},l=function(t){return bh.getState(t)},f=function(e){bh.isOpen(e)&&tp.getValue(e).each((function(n){switch(n.mode){case"menu":bh.getState(e).each(Qx.repositionMenus);break;case"position":var r=t.lazySink(e).getOrDie();Ig.positionWithinBounds(r,e,n.config,n.getBounds());break}}))},d={setContent:r,showAt:o,showWithin:i,showWithinBounds:u,showMenuAt:a,showMenuWithinBounds:c,hide:s,getContent:l,reposition:f,isOpen:bh.isOpen};return{uid:t.uid,dom:t.dom,behaviours:rp(t.inlineBehaviours,[bh.config({isPartOf:function(t,e,r){return js(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)}}),tp.config({store:{mode:"memory",initialValue:L.none()}}),yf.config({channels:A(A({},Sh(A({isExtraPart:e.isExtraPart},t.fireDismissalEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})))),Th(A(A({},t.fireRepositionEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})),{doReposition:f})))})]),eventOrder:t.eventOrder,apis:d}},eC=dv({name:"InlineView",configFields:[Ai("lazySink"),al("onShow"),al("onHide"),Wi("onEscape"),ep("inlineBehaviours",[bh,tp,yf]),$i("fireDismissalEventInstead",[Ki("event",ga())]),$i("fireRepositionEventInstead",[Ki("event",ha())]),Ki("getRelated",L.none),Ki("isExtraPart",O),Ki("eventOrder",L.none)],factory:tC,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)}}}),nC="layout-inset",rC=function(t){return t.x},oC=function(t,e){return t.x+t.width/2-e.width/2},iC=function(t,e){return t.x+t.width-e.width},uC=function(t){return t.y},aC=function(t,e){return t.y+t.height-e.height},cC=function(t,e){return t.y+t.height/2-e.height/2},sC=function(t,e,n){return gl(iC(t,e),aC(t,e),n.insetSouthwest(),Cl(),"southwest",Dl(t,{right:0,bottom:3}),nC)},lC=function(t,e,n){return gl(rC(t),aC(t,e),n.insetSoutheast(),xl(),"southeast",Dl(t,{left:1,bottom:3}),nC)},fC=function(t,e,n){return gl(iC(t,e),uC(t),n.insetNorthwest(),wl(),"northwest",Dl(t,{right:0,top:2}),nC)},dC=function(t,e,n){return gl(rC(t),uC(t),n.insetNortheast(),yl(),"northeast",Dl(t,{left:1,top:2}),nC)},mC=function(t,e,n){return gl(oC(t,e),uC(t),n.insetNorth(),Sl(),"north",Dl(t,{top:2}),nC)},gC=function(t,e,n){return gl(oC(t,e),aC(t,e),n.insetSouth(),kl(),"south",Dl(t,{bottom:3}),nC)},hC=function(t,e,n){return gl(iC(t,e),cC(t,e),n.insetEast(),Ol(),"east",Dl(t,{right:0}),nC)},pC=function(t,e,n){return gl(rC(t),cC(t,e),n.insetWest(),Tl(),"west",Dl(t,{left:1}),nC)},vC=function(t){switch(t){case"north":return mC;case"northeast":return dC;case"northwest":return fC;case"south":return gC;case"southeast":return lC;case"southwest":return sC;case"east":return hC;case"west":return pC}},bC=function(t,e,n,r,o){var i=$f(r).map(vC).getOr(mC);return i(t,e,n,r,o)},yC=function(t){switch(t){case"north":return gC;case"northeast":return lC;case"northwest":return sC;case"south":return mC;case"southeast":return dC;case"southwest":return fC;case"east":return pC;case"west":return hC}},wC=function(t,e,n,r,o){var i=$f(r).map(yC).getOr(mC);return i(t,e,n,r,o)},xC=tinymce.util.Tools.resolve("tinymce.util.Delay"),CC=function(t){var e=vx(t.action),n=t.dom.tag,r=function(e){return Ot(t.dom,"attributes").bind((function(t){return Ot(t,e)}))},o=function(){if("button"===n){var t=r("type").getOr("button"),e=r("role").map((function(t){return{role:t}})).getOr({});return A({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:op.augment(t.buttonBehaviours,[Yw.config({}),Aw.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:o()},eventOrder:t.eventOrder}},SC=dv({name:"Button",factory:CC,configFields:[Ki("uid",void 0),Ai("dom"),Ki("components",[]),op.field("buttonBehaviours",[Yw,Aw]),Fi("action"),Fi("role"),Ki("eventOrder",{})]}),kC=function(t){var e=sv(t)&&_t(t,"uid")?t.uid:dc("memento"),n=function(t){return t.getSystem().getByUid(e).getOrDie()},r=function(t){return t.getSystem().getByUid(e).toOptional()},o=function(){return A(A({},t),{uid:e})};return{get:n,getOpt:r,asSpec:o}},TC=tinymce.util.Tools.resolve("tinymce.util.I18n"),OC={indent:!0,outdent:!0,"table-insert-column-after":!0,"table-insert-column-before":!0,"paste-column-after":!0,"paste-column-before":!0,"unordered-list":!0,"list-bull-circle":!0,"list-bull-default":!0,"list-bull-square":!0},EC="temporary-placeholder",_C=function(t){return function(){return Ot(t,EC).getOr("!not found!")}},AC=function(t,e){var n=t.toLowerCase();if(TC.isRtl()){var r=Vt(n,"-rtl");return Et(e,r)?r:n}return n},DC=function(t,e){return Ot(e,AC(t,e))},MC=function(t,e){var n=e();return DC(t,n).getOrThunk(_C(n))},RC=function(t,e,n){var r=e();return DC(t,r).or(n).getOrThunk(_C(r))},NC=function(t){return!!TC.isRtl()&&Et(OC,t)},zC=function(){return Vw("add-focusable",[Ua((function(t){Hs(t.element,"svg").each((function(t){return Fn(t,"focusable","false")}))}))])},BC=function(t,e,n,r){var o,i,u=NC(e)?["tox-icon--flip"]:[],a=Ot(n,AC(e,n)).or(r).getOrThunk(_C(n));return{dom:{tag:t.tag,attributes:null!==(o=t.attributes)&&void 0!==o?o:{},classes:t.classes.concat(u),innerHtml:a},behaviours:mf(M(M([],null!==(i=t.behaviours)&&void 0!==i?i:[],!0),[zC()],!1))}},LC=function(t,e,n,r){return void 0===r&&(r=L.none()),BC(e,t,n(),r)},HC=function(t,e,n){var r=n(),o=tt(t,(function(t){return Et(r,AC(t,r))}));return BC(e,o.getOr(EC),r,L.none())},IC={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},PC=function(t){var e=kC({dom:{tag:"p",innerHtml:t.translationProvider(t.text)},behaviours:mf([Pw.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=kC({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:mf([Pw.config({})])}),i=function(t,e){t.getSystem().isConnected()&&o.getOpt(t).each((function(t){Pw.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);Pw.set(r,[Ss(n)])}},a={updateProgress:i,updateText:u},c=nt([t.icon.toArray(),t.level.toArray(),t.level.bind((function(t){return L.from(IC[t])})).toArray()]),s=kC(SC.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"]},components:[LC("close",{tag:"div",classes:["tox-icon"],attributes:{"aria-label":t.translationProvider("Close")}},t.iconProvider)],action:function(e){t.onAction(e)}})),l=HC(c,{tag:"div",classes:["tox-notification__icon"]},t.iconProvider),f={dom:{tag:"div",classes:["tox-notification__body"]},components:[e.asSpec()],behaviours:mf([Pw.config({})])},d=[l,f];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"])},behaviours:mf([Yw.config({}),Vw("notification-events",[Ra(Iu(),(function(t){s.getOpt(t).each(Yw.focus)}))])]),components:d.concat(t.progress?[o.asSpec()]:[]).concat(t.closeButton?[s.asSpec()]:[]),apis:a}},FC=dv({name:"Notification",factory:PC,configFields:[Fi("level"),Ai("progress"),Ai("icon"),Ai("onAction"),Ai("text"),Ai("iconProvider"),Ai("translationProvider"),Zi("closeButton",!0)],apis:{updateProgress:function(t,e,n){t.updateProgress(e,n)},updateText:function(t,e,n){t.updateText(e,n)}}});function VC(t,e,n){var r=e.backstage.shared,o=function(t){switch(t){case"bc-bc":return gC;case"tc-tc":return mC;case"tc-bc":return ql;case"bc-tc":default:return $l}},i=function(t){t.length>0&&G(t,(function(e,n){0===n?e.moveRel(null,"banner"):e.moveRel(t[n-1].getEl(),"bc-tc")}))},u=function(e,i){var u=!e.closeButton&&e.timeout&&(e.timeout>0||e.timeout<0),a=function(){i(),eC.hide(s)},c=Es(FC.sketch({text:e.text,level:U(["success","error","warning","warn","info"],e.type)?e.type:void 0,progress:!0===e.progressBar,icon:L.from(e.icon),closeButton:!u,onAction:a,iconProvider:r.providers.icons,translationProvider:r.providers.translate})),s=Es(eC.sketch(A({dom:{tag:"div",classes:["tox-notifications-container"]},lazySink:r.getSink,fireDismissalEventInstead:{}},r.header.isPositionedAtTop()?{}:{fireRepositionEventInstead:{}})));n.add(s),e.timeout>0&&xC.setTimeout((function(){a()}),e.timeout);var l=function(){var e=Jr(ee.fromDom(t.getContentAreaContainer())),n=Zr(),r=_l(n.x,e.x,e.right),o=_l(n.y,e.y,e.bottom),i=Math.max(e.right,n.right),u=Math.max(e.bottom,n.bottom);return L.some(Yr(r,o,i-r,u-o))};return{close:a,moveTo:function(t,e){eC.showAt(s,_s(c),{anchor:{type:"makeshift",x:t,y:e}})},moveRel:function(t,e){var n=_s(c),i={maxHeightFunction:Ed()};if("banner"!==e&&d(t)){var u=o(e),a={type:"node",root:Hn(),node:L.some(ee.fromDom(t)),overrides:i,layouts:{onRtl:function(){return[u]},onLtr:function(){return[u]}}};eC.showWithinBounds(s,n,{anchor:a},l)}else{var f=A(A({},r.anchors.banner()),{overrides:i});eC.showWithinBounds(s,n,{anchor:f},l)}},text:function(t){FC.updateText(c,t)},settings:e,getEl:function(){return c.element.dom},progressBar:{value:function(t){FC.updateProgress(c,t)}}}},a=function(t){t.close()},c=function(t){return t.settings};return{open:u,close:a,reposition:i,getArgs:c}}var UC,jC=function(t,e){var n=null,r=function(){c(n)||(clearTimeout(n),n=null)},o=function(){for(var r=[],o=0;o',t.getDoc());return Dr(n,ee.fromDom(e.extractContents())),e.insertNode(n.dom),vn(n).each((function(t){return t.dom.normalize()})),Gm(n).map((function(e){t.selection.setCursorLocation(e.dom,jm(e))})),n}))},YC=function(t){return Ps(t,KC)},JC=function(t){return t.collapsed&&3===t.startContainer.nodeType},QC=function(t){return t.toString().replace(/\u00A0/g," ").replace(/\uFEFF/g,"")},ZC=function(t){return""!==t&&-1!=="  \f\n\r\t\v".indexOf(t)},tS=function(t,e){return t.substring(e.length)},eS=function(t,e,n){var r;for(r=e-1;r>=0;r--){var o=t.charAt(r);if(ZC(o))return L.none();if(o===n)break}return L.some(r)},nS=function(t,e,n,r){if(void 0===r&&(r=0),!JC(e))return L.none();var o=function(t,e,r){return eS(r,e,n).getOr(e)},i=t.getParent(e.startContainer,t.isBlock)||t.getRoot();return GC(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 L.none();var i=QC(o),u=i.lastIndexOf(n);return 0!==u||tS(i,n).length0?lS(e[e.length-1]):aS(t,e.length)},fS=function(t,e){var n=t.childNodes;return n.length>0&&e0&&sS(t)&&n.length===e?lS(n[n.length-1]):aS(t,e)},dS=function(t,e){return GC(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!ZC(e)})).isSome()},mS=function(t){return function(e){var n=fS(e.startContainer,e.startOffset);return!dS(t,n)}},gS=function(t,e,n){return gt(n.triggerChars,(function(n){return rS(t,e,n)}))},hS=function(t,e){var n=e(),r=t.selection.getRng();return gS(t.dom,r,n).bind((function(n){return pS(t,e,n)}))},pS=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 mS(t.dom)}))(n.range,u,n.text)}));if(0===a.length)return L.none();var c=uS.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,highlightOn:t.highlightOn}}))})));return L.some({lookupData:c,context:n})},vS=ti([Ri("type"),ji("text")]),bS=function(t){return wi("separatormenuitem",vS,t)},yS=ti([Ki("type","autocompleteitem"),Ki("active",!1),Ki("disabled",!1),Ki("meta",{}),Ri("value"),ji("text"),ji("icon")]),wS=ti([Ri("type"),Ri("ch"),Yi("minChars",1),Ki("columns",1),Yi("maxResults",10),Wi("matches"),Bi("fetch"),Bi("onAction"),nu("highlightOn",[],si)]),xS=function(t){return wi("Autocompleter.Separator",vS,t)},CS=function(t){return wi("Autocompleter.Item",yS,t)},SS=function(t){return wi("Autocompleter",wS,t)},kS=[Zi("disabled",!1),ji("tooltip"),ji("icon"),ji("text"),tu("onSetup",(function(){return p}))],TS=ti([Ri("type"),Bi("onAction")].concat(kS)),OS=function(t){return wi("toolbarbutton",TS,t)},ES=[Zi("active",!1)].concat(kS),_S=ti(ES.concat([Ri("type"),Bi("onAction")])),AS=function(t){return wi("ToggleButton",_S,t)},DS=[tu("predicate",O),Qi("scope","node",["node","editor"]),Qi("position","selection",["node","selection","line"])],MS=kS.concat([Ki("type","contextformbutton"),Ki("primary",!1),Bi("onAction"),Ei("original",x)]),RS=ES.concat([Ki("type","contextformbutton"),Ki("primary",!1),Bi("onAction"),Ei("original",x)]),NS=kS.concat([Ki("type","contextformbutton")]),zS=ES.concat([Ki("type","contextformtogglebutton")]),BS=ki("type",{contextformbutton:MS,contextformtogglebutton:RS}),LS=ti([Ki("type","contextform"),tu("initValue",w("")),ji("label"),Pi("commands",BS),Vi("launch",ki("type",{contextformbutton:NS,contextformtogglebutton:zS}))].concat(DS)),HS=function(t){return wi("ContextForm",LS,t)},IS=ti([Ki("type","contexttoolbar"),Ri("items")].concat(DS)),PS=function(t){return wi("ContextToolbar",IS,t)},FS=function(t){var e={};return G(t,(function(t){e[t]={}})),ht(e)},VS=function(t){var e=t.ui.registry.getAll().popups,n=bt(e,(function(t){return SS(t).fold((function(t){throw new Error(Si(t))}),x)})),r=FS(St(n,(function(t){return t.ch}))),o=Tt(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"})(UC||(UC={}));var US,jS=UC,WS="tox-menu-nav__js",qS="tox-collection__item",$S="tox-swatch",GS={normal:WS,color:$S},KS="tox-collection__item--enabled",XS="tox-collection__group-heading",YS="tox-collection__item-icon",JS="tox-collection__item-label",QS="tox-collection__item-accessory",ZS="tox-collection__item-caret",tk="tox-collection__item-checkmark",ek="tox-collection__item--active",nk="tox-collection__item-container",rk="tox-collection__item-container--column",ok="tox-collection__item-container--row",ik="tox-collection__item-container--align-right",uk="tox-collection__item-container--align-left",ak="tox-collection__item-container--valign-top",ck="tox-collection__item-container--valign-middle",sk="tox-collection__item-container--valign-bottom",lk=function(t){return Ot(GS,t).getOr(WS)},fk=function(t){return"color"===t?"tox-swatches":"tox-menu"},dk=function(t){return{backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:fk(t),tieredMenu:"tox-tiered-menu"}},mk=function(t){var e=dk(t);return{backgroundMenu:e.backgroundMenu,selectedMenu:e.selectedMenu,menu:e.menu,selectedItem:e.selectedItem,item:lk(t)}},gk=function(t,e,n){var r=dk(n);return{tag:"div",classes:nt([[r.menu,"tox-menu-"+e+"-column"],t?[r.hasIcons]:[]])}},hk=[Fx.parts.items({})],pk=function(t,e,n){var r=dk(n),o={tag:"div",classes:nt([[r.tieredMenu]])};return{dom:o,markers:mk(n)}},vk=function(t,e){return function(n){var r=q(n,e);return $(r,(function(e){return{dom:t,components:e}}))}},bk=function(t){return{dom:{tag:"div",classes:["tox-menu","tox-swatches-menu"]},components:[{dom:{tag:"div",classes:["tox-swatches"]},components:[Fx.parts.items({preprocess:"auto"!==t?vk({tag:"div",classes:["tox-swatches__row"]},t):x})]}]}},yk=function(t){return{dom:{tag:"div",classes:["tox-menu","tox-collection","tox-collection--toolbar","tox-collection--toolbar-lg"]},components:[Fx.parts.items({preprocess:vk({tag:"div",classes:["tox-collection__group"]},t)})]}},wk=function(t,e){var n=[],r=[];return G(t,(function(t,o){e(t,o)?(r.length>0&&n.push(r),r=[],Et(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}}))},xk=function(t,e,n){return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===t?["tox-collection--list"]:["tox-collection--grid"])},components:[Fx.parts.items({preprocess:function(n){return"auto"!==t&&t>1?vk({tag:"div",classes:["tox-collection__group"]},t)(n):wk(n,(function(t,n){return"separator"===e[n].type}))}})]}},Ck=function(t,e){return{dom:{tag:"div",classes:["tox-collection","tox-collection--horizontal"]},components:[Fx.parts.items({preprocess:function(e){return wk(e,(function(e,n){return"separator"===t[n].type}))}})]}},Sk=function(t){return j(t,(function(t){return"icon"in t&&void 0!==t.icon}))},kk=function(t){return console.error(Si(t)),console.log(t),L.none()},Tk=function(t,e,n,r,o){var i=Ck(n);return{value:t,dom:i.dom,components:i.components,items:n}},Ok=function(t,e,n,r,o){if("color"===o){var i=bk(r);return{value:t,dom:i.dom,components:i.components,items:n}}if("normal"===o&&"auto"===r){i=xk(r,n);return{value:t,dom:i.dom,components:i.components,items:n}}if("normal"===o&&1===r){i=xk(1,n);return{value:t,dom:i.dom,components:i.components,items:n}}if("normal"===o){i=xk(r,n);return{value:t,dom:i.dom,components:i.components,items:n}}if("listpreview"===o&&"auto"!==r){i=yk(r);return{value:t,dom:i.dom,components:i.components,items:n}}return{value:t,dom:gk(e,r,o),components:hk,items:n}},Ek=[Ri("type"),Ri("src"),ji("alt"),nu("classes",[],si)],_k=ti(Ek),Ak=[Ri("type"),Ri("text"),ji("name"),nu("classes",["tox-collection__item-label"],si)],Dk=ti(Ak),Mk=Jo((function(){return hi("type",{cardimage:_k,cardtext:Dk,cardcontainer:Rk})})),Rk=ti([Ri("type"),Ji("direction","horizontal"),Ji("align","left"),Ji("valign","middle"),Pi("items",Mk)]),Nk=[Zi("disabled",!1),ji("text"),ji("shortcut"),Oi("value","value",To((function(){return oc("menuitem-value")})),ui()),Ki("meta",{})],zk=ti([Ri("type"),ji("label"),Pi("items",Mk),tu("onSetup",(function(){return p})),tu("onAction",p)].concat(Nk)),Bk=function(t){return wi("cardmenuitem",zk,t)},Lk=ti([Ri("type"),Zi("active",!1),ji("icon")].concat(Nk)),Hk=function(t){return wi("choicemenuitem",Lk,t)},Ik=[Ri("type"),Ri("fancytype"),tu("onAction",p)],Pk=[Ki("initData",{})].concat(Ik),Fk=[ru("initData",{},[Zi("allowCustomColors",!0),qi("colors",ui())])].concat(Ik),Vk=ki("fancytype",{inserttable:Pk,colorswatch:Fk}),Uk=function(t){return wi("fancymenuitem",Vk,t)},jk=ti([Ri("type"),tu("onSetup",(function(){return p})),tu("onAction",p),ji("icon")].concat(Nk)),Wk=function(t){return wi("menuitem",jk,t)},qk=ti([Ri("type"),Bi("getSubmenuItems"),tu("onSetup",(function(){return p})),ji("icon")].concat(Nk)),$k=function(t){return wi("nestedmenuitem",qk,t)},Gk=ti([Ri("type"),ji("icon"),Zi("active",!1),tu("onSetup",(function(){return p})),Bi("onAction")].concat(Nk)),Kk=function(t){return wi("togglemenuitem",Gk,t)},Xk=function(t,e,n){var r=Xm(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 L.some({numColumns:o,numRows:Math.ceil(r.length/o)})}return L.none()},Yk=function(t,e){return mf([Vw(t,e)])},Jk=function(t){return Yk(oc("unnamed-events"),t)},Qk={namedEvents:Yk,unnamedEvents:Jk},Zk=oc("tooltip.exclusive"),tT=oc("tooltip.show"),eT=oc("tooltip.hide"),nT=function(t,e,n){t.getSystem().broadcastOn([Zk],{})},rT=function(t,e,n,r){n.getTooltip().each((function(t){t.getSystem().isConnected()&&Pw.set(t,r)}))},oT=Object.freeze({__proto__:null,hideAllExclusive:nT,setComponents:rT}),iT=function(t,e){var n=function(n){e.getTooltip().each((function(r){Gg(r),t.onHide(n,r),e.clearTooltip()})),e.clearTimer()},r=function(n){if(!e.isShowing()){nT(n);var r=t.lazySink(n).getOrDie(),o=n.getSystem().build({dom:t.tooltipDom,components:t.tooltipComponents,events:_a("normal"===t.mode?[Ra(Hu(),(function(t){Ca(n,tT)})),Ra(Bu(),(function(t){Ca(n,eT)}))]:[]),behaviours:mf([Pw.config({})])});e.setTooltip(o),Wg(r,o),t.onShow(n,o),Ig.position(r,o,{anchor:t.anchor(n)})}};return _a(nt([[Ra(tT,(function(n){e.resetTimer((function(){r(n)}),t.delay)})),Ra(eT,(function(r){e.resetTimer((function(){n(r)}),t.delay)})),Ra(ta(),(function(t,e){var r=e;r.universal||U(r.channels,Zk)&&n(t)})),ja((function(t){n(t)}))],"normal"===t.mode?[Ra(Iu(),(function(t){Ca(t,tT)})),Ra(Qu(),(function(t){Ca(t,eT)})),Ra(Hu(),(function(t){Ca(t,tT)})),Ra(Bu(),(function(t){Ca(t,eT)}))]:[Ra(wa(),(function(t,e){Ca(t,tT)})),Ra(xa(),(function(t){Ca(t,eT)}))]]))},uT=Object.freeze({__proto__:null,events:iT}),aT=[Ai("lazySink"),Ai("tooltipDom"),Ki("exclusive",!0),Ki("tooltipComponents",[]),Ki("delay",300),Qi("mode","normal",["normal","follow-highlight"]),Ki("anchor",(function(t){return{type:"hotspot",hotspot:t,layouts:{onLtr:w([$l,ql,Vl,jl,Ul,Wl]),onRtl:w([$l,ql,Vl,jl,Ul,Wl])}}})),al("onHide"),al("onShow")],cT=function(){var t=od(),e=od(),n=function(){t.on(clearTimeout)},r=function(e,r){n(),t.set(setTimeout(e,r))},o=w("not-implemented");return Tc({getTooltip:e.get,isShowing:e.isSet,setTooltip:e.set,clearTooltip:e.clear,clearTimer:n,resetTimer:r,readState:o})},sT=Object.freeze({__proto__:null,init:cT}),lT=hf({fields:aT,name:"tooltipping",active:uT,state:sT,apis:oT}),fT=function(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")},dT=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),mT=tinymce.util.Tools.resolve("tinymce.EditorManager"),gT=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):mT.baseURL+"/skins/ui/"+r}return n},hT=function(t){return t.getParam("readonly",!1,"boolean")},pT=function(t){return!1===t.getParam("skin")},vT=function(t){return t.getParam("height",Math.max(t.getElement().offsetHeight,200))},bT=function(t){return t.getParam("width",dT.DOM.getStyle(t.getElement(),"width"))},yT=function(t){return L.from(t.getParam("min_width")).filter(g)},wT=function(t){return L.from(t.getParam("min_height")).filter(g)},xT=function(t){return L.from(t.getParam("max_width")).filter(g)},CT=function(t){return L.from(t.getParam("max_height")).filter(g)},ST=function(t){return L.from(t.getParam("style_formats")).filter(a)},kT=function(t){return t.getParam("style_formats_merge",!1,"boolean")},TT=function(t){return t.getParam("lineheight_formats","1 1.1 1.2 1.3 1.4 1.5 2","string").split(" ")},OT=function(t){return t.getParam("content_langs",void 0,"array")},ET=function(t){return t.getParam("removed_menuitems","")},_T=function(t){return!1!==t.getParam("menubar",!0,"boolean")},AT=function(t){var e=t.getParam("toolbar",!0),n=!0===e,r=i(e),o=a(e)&&e.length>0;return!MT(t)&&(o||r||n)},DT=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?L.some(n):L.none()},MT=function(t){return DT(t).fold((function(){var e=t.getParam("toolbar",[],"string[]");return e.length>0}),E)};(function(t){t["default"]="wrap",t["floating"]="floating",t["sliding"]="sliding",t["scrolling"]="scrolling"})(US||(US={}));var RT,NT=function(t){return t.getParam("toolbar_mode","","string")};(function(t){t["auto"]="auto",t["top"]="top",t["bottom"]="bottom"})(RT||(RT={}));var zT,BT=function(t){return t.getParam("toolbar_groups",{},"object")},LT=function(t){return t.getParam("toolbar_location",RT.auto,"string")},HT=function(t){return LT(t)===RT.bottom},IT=function(t){return t.getParam("fixed_toolbar_container","","string")},PT=function(t){return t.getParam("fixed_toolbar_container_target")},FT=function(t){return t.getParam("toolbar_persist",!1,"boolean")},VT=function(t){if(!t.inline)return L.none();var e=IT(t);if(e.length>0)return Is(Hn(),e);var n=PT(t);return d(n)?L.some(ee.fromDom(n)):L.none()},UT=function(t){return t.inline&&VT(t).isSome()},jT=function(t){var e=VT(t);return e.getOrThunk((function(){return Dn(An(ee.fromDom(t.getElement())))}))},WT=function(t){return t.inline&&!_T(t)&&!AT(t)&&!MT(t)},qT=function(t){var e=t.getParam("toolbar_sticky",!1,"boolean");return(e||t.inline)&&!UT(t)&&!WT(t)},$T=function(t){return t.getParam("toolbar_sticky_offset",0,"number")},GT=function(t){return t.getParam("draggable_modal",!1,"boolean")},KT=function(t){var e=t.getParam("menu");return e?bt(e,(function(t){return A(A({},t),{items:t.items})})):{}},XT=function(t){return t.getParam("menubar")},YT=function(t){return t.getParam("toolbar",!0)},JT=function(t){return t.getParam("file_picker_callback")},QT=function(t){return t.getParam("file_picker_types")},ZT=function(t){return t.getParam("file_browser_callback_types")},tO=function(t){return!1===t.getParam("typeahead_urls")},eO=function(t){return t.getParam("anchor_top","#top")},nO=function(t){return t.getParam("anchor_bottom","#bottom")},rO=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},oO="silver.readonly",iO=ti([zi("readonly")]),uO=function(t,e){var n=t.outerContainer,r=n.element;e&&(t.mothership.broadcastOn([yh()],{target:r}),t.uiMothership.broadcastOn([yh()],{target:r})),t.mothership.broadcastOn([oO],{readonly:e}),t.uiMothership.broadcastOn([oO],{readonly:e})},aO=function(t,e){t.on("init",(function(){t.mode.isReadOnly()&&uO(e,!0)})),t.on("SwitchMode",(function(){return uO(e,t.mode.isReadOnly())})),hT(t)&&t.setMode("readonly")},cO=function(){var t;return yf.config({channels:(t={},t[oO]={schema:iO,onReceive:function(t,e){Hv.set(t,e.readonly)}},t)})},sO=function(t){return Hv.config({disabled:t,disableClass:"tox-collection__item--state-disabled"})},lO=function(t){return Hv.config({disabled:t})},fO=function(t){return Hv.config({disabled:t,disableClass:"tox-tbtn--disabled"})},dO=function(t){return Hv.config({disabled:t,disableClass:"tox-tbtn--disabled",useNative:!1})},mO={item:sO,button:lO,splitButton:fO,toolbarButton:dO},gO=function(t,e){var n=t.getApi(e);return function(t){t(n)}},hO=function(t,e){return Ua((function(n){var r=gO(t,n);r((function(n){var r=t.onSetup(n);m(r)&&e.set(r)}))}))},pO=function(t,e){return ja((function(n){return gO(t,n)(e.get())}))},vO=function(t,e){return qa((function(n,r){gO(t,n)(t.onAction),t.triggersSubmenu||e!==jS.CLOSE_ON_EXECUTE||(Ca(n,ia()),r.stop())}))},bO=(zT={},zT[ea()]=["disabling","alloy.base.behaviour","toggling","item-events"],zT),yO=Mt,wO=function(t,e,n,r){var o=ou(p);return{type:"item",dom:e.dom,components:yO(e.optComponents),data:t.data,eventOrder:bO,hasSubmenu:t.triggersSubmenu,itemBehaviours:mf([Vw("item-events",[vO(t,n),hO(t,o),pO(t,o)]),mO.item((function(){return t.disabled||r.isDisabled()})),cO(),Pw.config({})].concat(t.itemBehaviours))}},xO=function(t){return{value:t.value,meta:A({text:t.text.getOr("")},t.meta)}},CO=tinymce.util.Tools.resolve("tinymce.Env"),SO=function(t){var e={alt:"⌥",ctrl:"⌃",shift:"⇧",meta:"⌘",access:"⌃⌥"},n={meta:"Ctrl",access:"Shift+Alt"},r=CO.mac?e:n,o=t.split("+"),i=$(o,(function(t){var e=t.toLowerCase().trim();return Et(r,e)?r[e]:t}));return CO.mac?i.join(""):i.join("+")},kO=function(t,e,n){return void 0===n&&(n=[YS]),LC(t,{tag:"div",classes:n},e)},TO=function(t){return{dom:{tag:"div",classes:[JS]},components:[Ss(TC.translate(t))]}},OO=function(t,e){return{dom:{tag:"div",classes:e,innerHtml:t}}},EO=function(t,e){return{dom:{tag:"div",classes:[JS]},components:[{dom:{tag:t.tag,styles:t.styles},components:[Ss(TC.translate(e))]}]}},_O=function(t){return{dom:{tag:"div",classes:[QS],innerHtml:SO(t)}}},AO=function(t){return kO("checkmark",t,[tk])},DO=function(t){return kO("chevron-right",t,[ZS])},MO=function(t){return kO("chevron-down",t,[ZS])},RO=function(t,e){var n="vertical"===t.direction?rk:ok,r="left"===t.align?uk:ik,o=function(){switch(t.valign){case"top":return ak;case"middle":return ck;case"bottom":return sk}};return{dom:{tag:"div",classes:[nk,n,r,o()]},components:e}},NO=function(t,e,n){return{dom:{tag:"img",classes:e,attributes:{src:t,alt:n.getOr("")}}}},zO=function(t,e,n){var r="custom",o="remove",i=t.ariaLabel,u=t.value,a=t.iconContent.map((function(t){return RC(t,e.icons,n)})),c=function(){var t=$S,n=a.getOr(""),c=i.map((function(t){return{title:e.translate(t)}})).getOr({}),s={tag:"div",attributes:c,classes:[t]};return A(A({},s),u===r?{tag:"button",classes:M(M([],s.classes,!0),["tox-swatches__picker-btn"],!1),innerHtml:n}:u===o?{classes:M(M([],s.classes,!0),["tox-swatch--remove"],!1),innerHtml:n}:{attributes:A(A({},s.attributes),{"data-mce-color":u}),styles:{"background-color":u}})};return{dom:c(),optComponents:[]}},BO=function(t){var e=t.map((function(t){return{attributes:{title:TC.translate(t)}}})).getOr({});return A({tag:"div",classes:[WS,qS]},e)},LO=function(t,e,n,r){var o={tag:"div",classes:[YS]},i=function(t){return LC(t,o,e.icons,r)},u=function(){return L.some({dom:o})},a=n?t.iconContent.map(i).orThunk(u):L.none(),c=t.checkMark,s=L.from(t.meta).fold((function(){return TO}),(function(t){return Et(t,"style")?S(EO,t.style):TO})),l=t.htmlContent.fold((function(){return t.textContent.map(s)}),(function(t){return L.some(OO(t,[JS]))})),f={dom:BO(t.ariaLabel),optComponents:[a,l,t.shortcutContent.map(_O),c,t.caret]};return f},HO=function(t,e,n,r){return void 0===r&&(r=L.none()),"color"===t.presets?zO(t,e,r):LO(t,e,n,r)},IO=function(t,e){return Ot(t,"tooltipWorker").map((function(t){return[lT.config({lazySink:e.getSink,tooltipDom:{tag:"div",classes:["tox-tooltip-worker-container"]},tooltipComponents:[],anchor:function(t){return{type:"submenu",item:t,overrides:{maxHeightFunction:Ed}}},mode:"follow-highlight",onShow:function(e,n){t((function(t){lT.setComponents(e,[ks({element:ee.fromDom(t)})])}))}})]})).getOr([])},PO=function(t){return dT.DOM.encode(t)},FO=function(t,e){var n=TC.translate(t),r=PO(n);if(e.length>0){var o=new RegExp(fT(e),"gi");return r.replace(o,(function(t){return''+t+""}))}return r},VO=function(t,e,n,r,o,i,u,a){void 0===a&&(a=!0);var c=HO({presets:r,textContent:L.none(),htmlContent:n?t.text.map((function(t){return FO(t,e)})):L.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:L.none(),checkMark:L.none(),caret:L.none(),value:t.value},u.providers,a,t.icon);return wO({data:xO(t),disabled:t.disabled,getApi:w({}),onAction:function(e){return o(t.value,t.meta)},onSetup:w(p),triggersSubmenu:!1,itemBehaviours:IO(t.meta,u)},c,i,u.providers)},UO=function(t,e){return $(t,(function(t){switch(t.type){case"cardcontainer":return RO(t,UO(t.items,e));case"cardimage":return NO(t.src,t.classes,t.alt);case"cardtext":var n=t.name.exists((function(t){return U(e.cardText.highlightOn,t)})),r=n?L.from(e.cardText.matchText).getOr(""):"";return OO(FO(t.text,r),t.classes)}}))},jO=function(t,e,n,r){var o=function(t){return{isDisabled:function(){return Hv.isDisabled(t)},setDisabled:function(e){Hv.set(t,e),G(Xm(t.element,"*"),(function(n){t.getSystem().getByDom(n).each((function(t){t.hasConfigured(Hv)&&Hv.set(t,e)}))}))}}},i={dom:BO(t.label),optComponents:[L.some({dom:{tag:"div",classes:[nk,ok]},components:UO(t.items,r)})]};return wO({data:xO(A({text:L.none()},t)),disabled:t.disabled,getApi:o,onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:L.from(r.itemBehaviours).getOr([])},i,e,n.providers)},WO=function(t,e,n,r,o,i,u,a){void 0===a&&(a=!0);var c=function(t){return{setActive:function(e){hx.set(t,e)},isActive:function(){return hx.isOn(t)},isDisabled:function(){return Hv.isDisabled(t)},setDisabled:function(e){return Hv.set(t,e)}}},s=HO({presets:n,textContent:e?t.text:L.none(),htmlContent:L.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:e?t.shortcut:L.none(),checkMark:e?L.some(AO(u.icons)):L.none(),caret:L.none(),value:t.value},u,a);return Co(wO({data:xO(t),disabled:t.disabled,getApi:c,onAction:function(e){return r(t.value)},onSetup:function(t){return t.setActive(o),p},triggersSubmenu:!1,itemBehaviours:[]},s,i,u),{toggling:{toggleClass:KS,toggleOnExecute:!1,selected:t.active}})},qO=Vp(_x(),Ax()),$O=function(t){return{value:t}},GO=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,KO=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,XO=function(t){return GO.test(t)||KO.test(t)},YO=function(t){return Ft(t,"#").toUpperCase()},JO=function(t){return XO(t)?L.some({value:YO(t)}):L.none()},QO=function(t){var e=t.value.replace(GO,(function(t,e,n,r){return e+e+n+n+r+r}));return{value:e}},ZO=function(t){var e=QO(t),n=KO.exec(e.value);return null===n?["FFFFFF","FF","FF","FF"]:n},tE=function(t){var e=t.toString(16);return(1===e.length?"0"+e:e).toUpperCase()},eE=function(t){var e=tE(t.red)+tE(t.green)+tE(t.blue);return $O(e)},nE=Math.min,rE=Math.max,oE=Math.round,iE=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,uE=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,aE=function(t,e,n,r){return{red:t,green:e,blue:n,alpha:r}},cE=function(t){var e=parseInt(t,10);return e.toString()===t&&e>=0&&e<=255},sE=function(t){var e,n,r,o=(t.hue||0)%360,i=t.saturation/100,u=t.value/100;if(i=rE(0,nE(i,1)),u=rE(0,nE(u,1)),0===i)return e=n=r=oE(255*u),aE(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=oE(255*(e+l)),n=oE(255*(n+l)),r=oE(255*(r+l)),aE(e,n,r,1)},lE=function(t){var e=ZO(t),n=parseInt(e[1],16),r=parseInt(e[2],16),o=parseInt(e[3],16);return aE(n,r,o,1)},fE=function(t,e,n,r){var o=parseInt(t,10),i=parseInt(e,10),u=parseInt(n,10),a=parseFloat(r);return aE(o,i,u,a)},dE=function(t){if("transparent"===t)return L.some(aE(0,0,0,0));var e=iE.exec(t);if(null!==e)return L.some(fE(e[1],e[2],e[3],"1"));var n=uE.exec(t);return null!==n?L.some(fE(n[1],n[2],n[3],n[4])):L.none()},mE=function(t){return"rgba("+t.red+","+t.green+","+t.blue+","+t.alpha+")"},gE=aE(255,0,0,1),hE=function(t){return t.fire("SkinLoaded")},pE=function(t,e){return t.fire("SkinLoadError",e)},vE=function(t){return t.fire("ResizeEditor")},bE=function(t,e){return t.fire("ResizeContent",e)},yE=function(t,e){return t.fire("ScrollContent",e)},wE=function(t,e){return t.fire("TextColorChange",e)},xE=function(t,e,n){return{hue:t,saturation:e,value:n}},CE=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,xE(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,xE(Math.round(e),Math.round(100*n),Math.round(100*r))},SE=function(t){return CE(lE(t))},kE=function(t){return eE(sE(t))},TE=function(t){return JO(t).orThunk((function(){return dE(t).map(eE)})).getOrThunk((function(){var e=document.createElement("canvas");e.height=1,e.width=1;var n=e.getContext("2d");n.clearRect(0,0,e.width,e.height),n.fillStyle="#FFFFFF",n.fillStyle=t,n.fillRect(0,0,1,1);var r=n.getImageData(0,0,1,1).data,o=r[0],i=r[1],u=r[2],a=r[3];return eE(aE(o,i,u,a))}))},OE=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),EE="tinymce-custom-colors";function _E(t){void 0===t&&(t=10);var e=OE.getItem(EE),n=i(e)?JSON.parse(e):[],r=function(e){var n=t-e.length;return n<0?e.slice(0,t):e},o=r(n),u=function(e){V(o,e).each(a),o.unshift(e),o.length>t&&o.pop(),OE.setItem(EE,JSON.stringify(o))},a=function(t){o.splice(t,1)},c=function(){return o.slice(0)};return{add:u,state:c}}var AE,DE="choiceitem",ME=[{type:DE,text:"Light Green",value:"#BFEDD2"},{type:DE,text:"Light Yellow",value:"#FBEEB8"},{type:DE,text:"Light Red",value:"#F8CAC6"},{type:DE,text:"Light Purple",value:"#ECCAFA"},{type:DE,text:"Light Blue",value:"#C2E0F4"},{type:DE,text:"Green",value:"#2DC26B"},{type:DE,text:"Yellow",value:"#F1C40F"},{type:DE,text:"Red",value:"#E03E2D"},{type:DE,text:"Purple",value:"#B96AD9"},{type:DE,text:"Blue",value:"#3598DB"},{type:DE,text:"Dark Turquoise",value:"#169179"},{type:DE,text:"Orange",value:"#E67E23"},{type:DE,text:"Dark Red",value:"#BA372A"},{type:DE,text:"Dark Purple",value:"#843FA1"},{type:DE,text:"Dark Blue",value:"#236FA1"},{type:DE,text:"Light Gray",value:"#ECF0F1"},{type:DE,text:"Medium Gray",value:"#CED4D9"},{type:DE,text:"Gray",value:"#95A5A6"},{type:DE,text:"Dark Gray",value:"#7E8C8D"},{type:DE,text:"Navy Blue",value:"#34495E"},{type:DE,text:"Black",value:"#000000"},{type:DE,text:"White",value:"#ffffff"}],RE=_E(10),NE=function(t){for(var e=[],n=0;n0?d(n,r,e,o):r.text.length-n.matchLength>=10?c():a()}}))}))}))},h=WC((function(t){27!==t.which&&g()}),50),p={onKeypress:h,cancelIfNecessary:c,isMenuOpen:i,isActive:u,isProcessingAction:r.get,getView:function(){return eC.getContent(o)}};!1===t.hasPlugin("rtc")&&iS.setup(p,t)},B_={register:z_},L_=function(t,e,n){return Ps(t,e,n).isSome()},H_=function(t,e){var n=null,r=function(){for(var r=[],o=0;oI_||r>I_},U_=function(t){var e=od(),n=ou(!1),r=H_((function(e){t.triggerEvent(oa(),e),n.set(!0)}),P_),o=function(t){return F_(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(i)})),L.none()},i=function(t){return r.cancel(),F_(t).each((function(t){e.on((function(n){V_(t,n)&&e.clear()}))})),L.none()},u=function(o){r.cancel();var i=function(t){return sn(t.target,o.target)};return e.get().filter(i).map((function(e){return n.get()?(o.prevent(),!1):t.triggerEvent(ra(),o)}))},a=gu([{key:Au(),value:o},{key:Du(),value:i},{key:Mu(),value:u}]),c=function(t,e){return Ot(a,e).bind((function(e){return e(t)}))};return{fireIfReady:c}},j_=function(t){var e=t.raw;return e.which===ob[0]&&!U(["input","textarea"],ae(t.target))&&!L_(t.target,'[contenteditable="true"]')},W_=function(){return en().browser.isFirefox()},q_=function(t,e){return W_()?ad(t,"focus",e):ud(t,"focusin",e)},$_=function(t,e){return W_()?ad(t,"blur",e):ud(t,"focusout",e)},G_=function(t,e){var n=A({stopBackspace:!0},e),r=["touchstart","touchmove","touchend","touchcancel","gesturestart","mousedown","mouseup","mouseover","mousemove","mouseout","click"],o=U_(n),i=$(r.concat(["selectstart","input","contextmenu","change","transitionend","transitioncancel","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),(function(e){return ud(t,e,(function(t){o.fireIfReady(t,e).each((function(e){e&&t.kill()}));var r=n.triggerEvent(e,t);r&&t.kill()}))})),u=od(),a=ud(t,"paste",(function(t){o.fireIfReady(t,"paste").each((function(e){e&&t.kill()}));var e=n.triggerEvent("paste",t);e&&t.kill(),u.set(setTimeout((function(){n.triggerEvent(Zu(),t)}),0))})),c=ud(t,"keydown",(function(t){var e=n.triggerEvent("keydown",t);e?t.kill():n.stopBackspace&&j_(t)&&t.prevent()})),s=q_(t,(function(t){var e=n.triggerEvent("focusin",t);e&&t.kill()})),l=od(),f=$_(t,(function(t){var e=n.triggerEvent("focusout",t);e&&t.kill(),l.set(setTimeout((function(){n.triggerEvent(Qu(),t)}),0))})),d=function(){G(i,(function(t){t.unbind()})),c.unbind(),s.unbind(),f.unbind(),a.unbind(),u.on(clearTimeout),l.on(clearTimeout)};return{unbind:d}},K_=function(t,e){var n=Ot(t,"target").getOr(e);return ou(n)},X_=function(t,e){var n=ou(!1),r=ou(!1),o=function(){n.set(!0)},i=function(){r.set(!0)};return{stop:o,cut:i,isStopped:n.get,isCut:r.get,event:t,setSource:e.set,getSource:e.get}},Y_=function(t){var e=ou(!1),n=function(){e.set(!0)};return{stop:n,cut:p,isStopped:e.get,isCut:O,event:t,setSource:T("Cannot set source of a broadcasted event"),getSource:T("Cannot get source of a broadcasted event")}},J_=uu.generate([{stopped:[]},{resume:["element"]},{complete:[]}]),Q_=function(t,e,n,r,o,i){var u=t(e,r),a=X_(n,o);return u.fold((function(){return i.logEventNoHandlers(e,r),J_.complete()}),(function(t){var n=t.descHandler,r=Hc(n);return r(a),a.isStopped()?(i.logEventStopped(e,t.element,n.purpose),J_.stopped()):a.isCut()?(i.logEventCut(e,t.element,n.purpose),J_.complete()):vn(t.element).fold((function(){return i.logNoParent(e,t.element,n.purpose),J_.complete()}),(function(r){return i.logEventResponse(e,t.element,n.purpose),J_.resume(r)}))}))},Z_=function(t,e,n,r,o,i){return Q_(t,e,n,r,o,i).fold(E,(function(r){return Z_(t,e,n,r,o,i)}),O)},tA=function(t,e,n,r,o){var i=K_(n,r);return Q_(t,e,n,r,i,o)},eA=function(t,e,n){var r=Y_(e);return G(t,(function(t){var e=t.descHandler,n=Hc(e);n(r)})),r.isStopped()},nA=function(t,e,n,r){return rA(t,e,n,n.target,r)},rA=function(t,e,n,r,o){var i=K_(n,r);return Z_(t,e,n,r,i,o)},oA=function(t,e){return{element:t,descHandler:e}},iA=function(t,e){return{id:t,descHandler:e}},uA=function(){var t={},e=function(e,n,r){vt(r,(function(r,o){var i=void 0!==t[o]?t[o]:{};i[n]=Lc(r,e),t[o]=i}))},n=function(t,e){return fc(e).bind((function(e){return Ot(t,e)})).map((function(t){return oA(e,t)}))},r=function(e){return Ot(t,e).map((function(t){return St(t,(function(t,e){return iA(e,t)}))})).getOr([])},o=function(e,r,o){return Ot(t,r).bind((function(t){return wu(o,(function(e){return n(t,e)}),e)}))},i=function(e){vt(t,(function(t,n){Et(t,e)&&delete t[e]}))};return{registerId:e,unregisterId:i,filterByType:r,find:o}},aA=function(){var t=uA(),e={},n=function(t){var e=t.element;return fc(e).getOrThunk((function(){return sc("uid-",t.element)}))},r=function(t,n){var r=e[n];if(r!==t)throw new Error('The tagId "'+n+'" is already used by: '+Za(r.element)+"\nCannot use it for: "+Za(t.element)+"\nThe conflicting element is"+(Ln(r.element)?" ":" not ")+"already in the DOM");i(t)},o=function(o){var i=n(o);_t(e,i)&&r(o,i);var u=[o];t.registerId(u,i,o.events),e[i]=o},i=function(n){fc(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 Ot(e,t)};return{find:a,filter:u,register:o,unregister:i,getById:c}},cA=function(t){var e=t.dom,n=e.attributes,r=D(e,["attributes"]);return{uid:t.uid,dom:A({tag:"div",attributes:A({role:"presentation"},n)},r),components:t.components,behaviours:np(t.containerBehaviours),events:t.events,domModification:t.domModification,eventOrder:t.eventOrder}},sA=dv({name:"Container",factory:cA,configFields:[Ki("components",[]),ep("containerBehaviours",[]),Ki("events",{}),Ki("domModification",{}),Ki("eventOrder",{})]}),lA=function(t){var e=function(e){return vn(t.element).fold(E,(function(t){return sn(e,t)}))},n=aA(),r=function(t,r){return n.find(e,t,r)},o=G_(t.element,{triggerEvent:function(t,e){return Js(t,e.target,(function(n){return nA(r,t,e,n)}))}}),i={debugInfo:w("real"),triggerEvent:function(t,e,n){Js(t,e,(function(o){return rA(r,t,n,e,o)}))},triggerFocus:function(t,e){fc(t).fold((function(){Sf(t)}),(function(n){Js(Ju(),t,(function(n){return tA(r,Ju(),{originator:e,kill:p,prevent:p,target:t},t,n),!1}))}))},triggerEscape:function(t,e){i.triggerEvent("keydown",t.element,e.event)},getByUid:function(t){return h(t)},getByDom:function(t){return v(t)},build:Es,addToGui:function(t){c(t)},removeFromGui:function(t){s(t)},addToWorld:function(t){u(t)},removeFromWorld:function(t){a(t)},broadcast:function(t){d(t)},broadcastOn:function(t,e){m(t,e)},broadcastEvent:function(t,e){g(t,e)},isConnected:E},u=function(t){t.connect(i),fe(t.element)||(n.register(t),G(t.components(),u),i.triggerEvent(aa(),t.element,{target:t.element}))},a=function(t){fe(t.element)||(G(t.components(),a),n.unregister(t)),t.disconnect()},c=function(e){Wg(t,e)},s=function(t){Gg(t)},l=function(){o.unbind(),Br(t.element)},f=function(t){var e=n.filter(ta());G(e,(function(e){var n=e.descHandler,r=Hc(n);r(t)}))},d=function(t){f({universal:!0,data:t})},m=function(t,e){f({universal:!1,channels:t,data:e})},g=function(t,e){var r=n.filter(t);return eA(r,e)},h=function(t){return n.getById(t).fold((function(){return ro.error(new Error('Could not find component with uid: "'+t+'" in system.'))}),ro.value)},v=function(t){var e=fc(t).getOr("not found");return h(e)};return u(t),{root:t,element:t.element,destroy:l,add:c,remove:s,getByUid:h,getByDom:v,addToWorld:u,removeFromWorld:a,broadcast:d,broadcastOn:m,broadcastEvent:g}},fA=function(t,e){return{dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:$(t.items,e.interpreter)}},dA=w([Ki("prefix","form-field"),ep("fieldBehaviours",[bv,tp])]),mA=w([Bp({schema:[Ai("dom")],name:"label"}),Bp({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[Ai("text")],name:"aria-descriptor"}),Np({factory:{sketch:function(t){var e=du(t,["factory"]);return t.factory.sketch(e)}},schema:[Ai("factory")],name:"field"})]),gA=function(t,e,n,r){var o=rp(t.fieldBehaviours,[bv.config({find:function(e){return Kp(e,t,"field")}}),tp.config({store:{mode:"manual",getValue:function(t){return bv.getCurrent(t).bind(tp.getValue)},setValue:function(t,e){bv.getCurrent(t).each((function(t){tp.setValue(t,e)}))}}})]),i=_a([Ua((function(e,n){var r=Yp(e,t,["label","field","aria-descriptor"]);r.field().each((function(e){var n=oc(t.prefix);r.label().each((function(t){Fn(t.element,"for",n),Fn(e.element,"id",n)})),r["aria-descriptor"]().each((function(n){var r=oc(t.prefix);Fn(n.element,"id",r),Fn(e.element,"aria-describedby",r)}))}))}))]),u={getField:function(e){return Kp(e,t,"field")},getLabel:function(e){return Kp(e,t,"label")}};return{uid:t.uid,dom:t.dom,components:e,behaviours:o,events:i,apis:u}},hA=mv({name:"FormField",configFields:dA(),partFields:mA(),factory:gA,apis:{getField:function(t,e){return t.getField(e)},getLabel:function(t,e){return t.getLabel(e)}}}),pA=function(t,e){return Dc({attributes:gu([{key:e.tabAttr,value:"true"}])})},vA=Object.freeze({__proto__:null,exhibit:pA}),bA=[Ki("tabAttr","data-alloy-tabstop")],yA=hf({fields:bA,name:"tabstopping",active:vA}),wA=tinymce.util.Tools.resolve("tinymce.html.Entities"),xA=function(t,e,n,r){var o=SA(t,e,n,r);return hA.sketch(o)},CA=function(t,e){return xA(t,e,[],[])},SA=function(t,e,n,r){return{dom:TA(n),components:t.toArray().concat([e]),fieldBehaviours:mf(r)}},kA=function(){return TA([])},TA=function(t){return{tag:"div",classes:["tox-form__group"].concat(t)}},OA=function(t,e){return hA.parts.label({dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}})},EA=oc("form-component-change"),_A=oc("form-close"),AA=oc("form-cancel"),DA=oc("form-action"),MA=oc("form-submit"),RA=oc("form-block"),NA=oc("form-unblock"),zA=oc("form-tabchange"),BA=oc("form-resize"),LA=function(t,e){var n,r=t.label.map((function(t){return OA(t,e)})),o=function(t){return function(e,n){Ps(n.event.target,"[data-collection-item-value]").each((function(r){t(e,n,r,Un(r,"data-collection-item-value"))}))}},i=function(n,r){var o=$(r,(function(n){var r=TC.translate(n.text),o=1===t.columns?'
'+r+"
":"",i='
'+n.icon+"
",u={_:" "," - ":" ","-":" "},a=r.replace(/\_| \- |\-/g,(function(t){return u[t]})),c=e.isDisabled()?" tox-collection__item--state-disabled":"";return'
'+i+o+"
"})),i="auto"!==t.columns&&t.columns>1?q(o,t.columns):[o],u=$(i,(function(t){return'
'+t.join("")+"
"}));Ka(n.element,u.join(""))},u=o((function(n,r,o,i){r.stop(),e.isDisabled()||Sa(n,DA,{name:t.name,value:i})})),a=[Ra(Hu(),o((function(t,e,n){Sf(n)}))),Ra(Wu(),u),Ra(ra(),u),Ra(Iu(),o((function(t,e,n){Is(t.element,"."+ek).each((function(t){as(t,ek)})),is(n,ek)}))),Ra(Pu(),o((function(t){Is(t.element,"."+ek).each((function(t){as(t,ek)}))}))),qa(o((function(e,n,r,o){Sa(e,DA,{name:t.name,value:o})})))],c=function(t,e){return $(Xm(t.element,".tox-collection__item"),e)},s=hA.parts.field({dom:{tag:"div",classes:["tox-collection"].concat(1!==t.columns?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:x},behaviours:mf([Hv.config({disabled:e.isDisabled,onDisabled:function(t){c(t,(function(t){is(t,"tox-collection__item--state-disabled"),Fn(t,"aria-disabled",!0)}))},onEnabled:function(t){c(t,(function(t){as(t,"tox-collection__item--state-disabled"),qn(t,"aria-disabled")}))}}),cO(),Pw.config({}),tp.config({store:{mode:"memory",initialValue:[]},onSetValue:function(e,n){i(e,n),"auto"===t.columns&&Xk(e,5,"tox-collection__item").each((function(t){var n=t.numRows,r=t.numColumns;Aw.setGridSize(e,n,r)})),Ca(e,BA)}}),yA.config({}),Aw.config(i_(t.columns,"normal")),Vw("collection-events",a)]),eventOrder:(n={},n[ea()]=["disabling","alloy.base.behaviour","collection-events"],n)}),l=["tox-form__group--collection"];return xA(r,s,l,[])},HA=w([Fi("data"),Ki("inputAttributes",{}),Ki("inputStyles",{}),Ki("tag","input"),Ki("inputClasses",[]),al("onSetValue"),Ki("styles",{}),Ki("eventOrder",{}),ep("inputBehaviours",[tp,Yw]),Ki("selectOnFocus",!0)]),IA=function(t){return mf([Yw.config({onFocus:t.selectOnFocus?function(t){var e=t.element,n=ds(e);e.dom.setSelectionRange(0,n.length)}:p})])},PA=function(t){return A(A({},IA(t)),rp(t.inputBehaviours,[tp.config({store:A(A({mode:"manual"},t.data.map((function(t){return{initialValue:t}})).getOr({})),{getValue:function(t){return ds(t.element)},setValue:function(t,e){var n=ds(t.element);n!==e&&ms(t.element,e)}}),onSetValue:t.onSetValue})]))},FA=function(t){return{tag:t.tag,attributes:A({type:"text"},t.inputAttributes),styles:t.inputStyles,classes:t.inputClasses}},VA=function(t,e){return{uid:t.uid,dom:FA(t),components:[],behaviours:PA(t),eventOrder:t.eventOrder}},UA=dv({name:"Input",configFields:HA(),factory:VA}),jA={},WA={exports:jA};(function(e,n,r,o){(function(t,o){"object"===typeof n&&"undefined"!==typeof r?r.exports=o():"function"===typeof e&&e.amd?e(o):(t="undefined"!==typeof globalThis?globalThis:t||self,t.EphoxContactWrapper=o())})(this,(function(){var e="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof t?t:"undefined"!==typeof self?self:{},n={exports:{}};(function(t){(function(e){var n=setTimeout;function r(){}function o(t,e){return function(){t.apply(e,arguments)}}function i(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=[],f(t,this)}function u(t,e){while(3===t._state)t=t._value;0!==t._state?(t._handled=!0,i._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 c(e.promise,o)}a(e.promise,r)}else(1===t._state?a:c)(e.promise,t._value)}))):t._deferreds.push(e)}function a(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 i)return t._state=3,t._value=e,void s(t);if("function"===typeof n)return void f(o(n,e),t)}t._state=1,t._value=e,s(t)}catch(r){c(t,r)}}function c(t,e){t._state=2,t._value=e,s(t)}function s(t){2===t._state&&0===t._deferreds.length&&i._immediateFn((function(){t._handled||i._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;en?n:t===e?e-1:Math.max(e,t-r)},tR=function(t,e,n,r){return t>n?t:td)return h;var p=rR(o,f,d),v=eR(p/m*r+e,g,h);return u&&v>=e&&v<=n?nR(v,e,n,i,a):c?Math.round(v):v},iR=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 on?u?a:l:(o-e)/r*c},uR="top",aR="right",cR="bottom",sR="left",lR="width",fR="height",dR=function(t){return t.element.dom.getBoundingClientRect()},mR=function(t,e){return t[e]},gR=function(t){var e=dR(t);return mR(e,sR)},hR=function(t){var e=dR(t);return mR(e,aR)},pR=function(t){var e=dR(t);return mR(e,uR)},vR=function(t){var e=dR(t);return mR(e,cR)},bR=function(t){var e=dR(t);return mR(e,lR)},yR=function(t){var e=dR(t);return mR(e,fR)},wR=function(t,e,n){return(t+e)/2-n},xR=function(t,e){var n=dR(t),r=dR(e),o=mR(n,sR),i=mR(n,aR),u=mR(r,sR);return wR(o,i,u)},CR=function(t,e){var n=dR(t),r=dR(e),o=mR(n,uR),i=mR(n,cR),u=mR(r,uR);return wR(o,i,u)},SR=function(t,e){Sa(t,aM(),{value:e})},kR=function(t){return{x:t}},TR=function(t,e,n){var r={min:gM(e),max:bM(e),range:SM(e),value:n,step:EM(e),snap:_M(e),snapStart:AM(e),rounded:DM(e),hasMinEdge:RM(e),hasMaxEdge:NM(e),minBound:gR(t),maxBound:hR(t),screenRange:bR(t)};return oR(r)},OR=function(t,e,n){var r=TR(t,e,n),o=kR(r);return SR(t,o),r},ER=function(t,e){var n=gM(e);SR(t,kR(n))},_R=function(t,e){var n=bM(e);SR(t,kR(n))},AR=function(t,e,n){var r=t>0?tR:ZM,o=r(LM(n).x,gM(n),bM(n),EM(n));return SR(e,kR(o)),L.some(o)},DR=function(t){return function(e,n){return AR(t,e,n).map(E)}},MR=function(t){var e=sM(t);return e.map((function(t){return t.left}))},RR=function(t,e,n,r,o){var i=0,u=bR(t),a=r.bind((function(e){return L.some(xR(e,t))})).getOr(i),c=o.bind((function(e){return L.some(xR(e,t))})).getOr(u),s={min:gM(e),max:bM(e),range:SM(e),value:n,hasMinEdge:RM(e),hasMaxEdge:NM(e),minBound:gR(t),minOffset:i,maxBound:hR(t),maxOffset:u,centerMinEdge:a,centerMaxEdge:c};return iR(s)},NR=function(t,e,n,r,o,i){var u=RR(e,i,n,r,o);return gR(e)-gR(t)+u},zR=function(t,e,n,r){var o=LM(n),i=NR(t,r.getSpectrum(t),o.x,r.getLeftEdge(t),r.getRightEdge(t),n),u=vr(e.element)/2;Kn(e.element,"left",i-u+"px")},BR=DR(-1),LR=DR(1),HR=L.none,IR=L.none,PR={"top-left":L.none(),top:L.none(),"top-right":L.none(),right:L.some(qM),"bottom-right":L.none(),bottom:L.none(),"bottom-left":L.none(),left:L.some(JM)},FR=Object.freeze({__proto__:null,setValueFrom:OR,setToMin:ER,setToMax:_R,findValueOfOffset:TR,getValueFromEvent:MR,findPositionOfValue:NR,setPositionFromValue:zR,onLeft:BR,onRight:LR,onUp:HR,onDown:IR,edgeActions:PR}),VR=function(t,e){Sa(t,aM(),{value:e})},UR=function(t){return{y:t}},jR=function(t,e,n){var r={min:hM(e),max:yM(e),range:kM(e),value:n,step:EM(e),snap:_M(e),snapStart:AM(e),rounded:DM(e),hasMinEdge:zM(e),hasMaxEdge:BM(e),minBound:pR(t),maxBound:vR(t),screenRange:yR(t)};return oR(r)},WR=function(t,e,n){var r=jR(t,e,n),o=UR(r);return VR(t,o),r},qR=function(t,e){var n=hM(e);VR(t,UR(n))},$R=function(t,e){var n=yM(e);VR(t,UR(n))},GR=function(t,e,n){var r=t>0?tR:ZM,o=r(LM(n).y,hM(n),yM(n),EM(n));return VR(e,UR(o)),L.some(o)},KR=function(t){return function(e,n){return GR(t,e,n).map(E)}},XR=function(t){var e=sM(t);return e.map((function(t){return t.top}))},YR=function(t,e,n,r,o){var i=0,u=yR(t),a=r.bind((function(e){return L.some(CR(e,t))})).getOr(i),c=o.bind((function(e){return L.some(CR(e,t))})).getOr(u),s={min:hM(e),max:yM(e),range:kM(e),value:n,hasMinEdge:zM(e),hasMaxEdge:BM(e),minBound:pR(t),minOffset:i,maxBound:vR(t),maxOffset:u,centerMinEdge:a,centerMaxEdge:c};return iR(s)},JR=function(t,e,n,r,o,i){var u=YR(e,i,n,r,o);return pR(e)-pR(t)+u},QR=function(t,e,n,r){var o=LM(n),i=JR(t,r.getSpectrum(t),o.y,r.getTopEdge(t),r.getBottomEdge(t),n),u=ur(e.element)/2;Kn(e.element,"top",i-u+"px")},ZR=L.none,tN=L.none,eN=KR(-1),nN=KR(1),rN={"top-left":L.none(),top:L.some(UM),"top-right":L.none(),right:L.none(),"bottom-right":L.none(),bottom:L.some(KM),"bottom-left":L.none(),left:L.none()},oN=Object.freeze({__proto__:null,setValueFrom:WR,setToMin:qR,setToMax:$R,findValueOfOffset:jR,getValueFromEvent:XR,findPositionOfValue:JR,setPositionFromValue:QR,onLeft:ZR,onRight:tN,onUp:eN,onDown:nN,edgeActions:rN}),iN=function(t,e){Sa(t,aM(),{value:e})},uN=function(t,e){return{x:t,y:e}},aN=function(t,e,n){var r=TR(t,e,n.left),o=jR(t,e,n.top),i=uN(r,o);return iN(t,i),i},cN=function(t,e,n,r){var o=t>0?tR:ZM,i=e?LM(r).x:o(LM(r).x,gM(r),bM(r),EM(r)),u=e?o(LM(r).y,hM(r),yM(r),EM(r)):LM(r).y;return iN(n,uN(i,u)),L.some(i)},sN=function(t,e){return function(n,r){return cN(t,e,n,r).map(E)}},lN=function(t,e){var n=gM(e),r=hM(e);iN(t,uN(n,r))},fN=function(t,e){var n=bM(e),r=yM(e);iN(t,uN(n,r))},dN=function(t){return sM(t)},mN=function(t,e,n,r){var o=LM(n),i=NR(t,r.getSpectrum(t),o.x,r.getLeftEdge(t),r.getRightEdge(t),n),u=JR(t,r.getSpectrum(t),o.y,r.getTopEdge(t),r.getBottomEdge(t),n),a=vr(e.element)/2,c=ur(e.element)/2;Kn(e.element,"left",i-a+"px"),Kn(e.element,"top",u-c+"px")},gN=sN(-1,!1),hN=sN(1,!1),pN=sN(-1,!0),vN=sN(1,!0),bN={"top-left":L.some(VM),top:L.some(jM),"top-right":L.some(WM),right:L.some($M),"bottom-right":L.some(GM),bottom:L.some(XM),"bottom-left":L.some(YM),left:L.some(QM)},yN=Object.freeze({__proto__:null,setValueFrom:aN,setToMin:lN,setToMax:fN,getValueFromEvent:dN,setPositionFromValue:mN,onLeft:gN,onRight:hN,onUp:pN,onDown:vN,edgeActions:bN}),wN=[Ki("stepSize",1),Ki("onChange",p),Ki("onChoose",p),Ki("onInit",p),Ki("onDragStart",p),Ki("onDragEnd",p),Ki("snapToGrid",!1),Ki("rounded",!0),Fi("snapStart"),Di("model",ki("mode",{x:[Ki("minX",0),Ki("maxX",100),Ei("value",(function(t){return ou(t.mode.minX)})),Ai("getInitialValue"),fl("manager",FR)],y:[Ki("minY",0),Ki("maxY",100),Ei("value",(function(t){return ou(t.mode.minY)})),Ai("getInitialValue"),fl("manager",oN)],xy:[Ki("minX",0),Ki("maxX",100),Ki("minY",0),Ki("maxY",100),Ei("value",(function(t){return ou({x:t.mode.minX,y:t.mode.minY})})),Ai("getInitialValue"),fl("manager",yN)]})),ep("sliderBehaviours",[Aw,tp]),Ei("mouseIsDown",(function(){return ou(!1)}))],xN=function(t,e,n,r){var o,i=function(e){return Xp(e,t,"thumb")},u=function(e){return Xp(e,t,"spectrum")},a=function(e){return Kp(e,t,"left-edge")},c=function(e){return Kp(e,t,"right-edge")},s=function(e){return Kp(e,t,"top-edge")},l=function(e){return Kp(e,t,"bottom-edge")},f=t.model,d=f.manager,m=function(e,n){d.setPositionFromValue(e,n,t,{getLeftEdge:a,getRightEdge:c,getTopEdge:s,getBottomEdge:l,getSpectrum:u})},g=function(t,e){f.value.set(e);var n=i(t);m(t,n)},h=function(e,n){g(e,n);var r=i(e);return t.onChange(e,r,n),L.some(!0)},p=function(e){d.setToMin(e,t)},v=function(e){d.setToMax(e,t)},b=function(e){var n=function(){Kp(e,t,"thumb").each((function(n){var r=f.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:rp(t.sliderBehaviours,[Aw.config({mode:"special",focusIn:function(e){return Kp(e,t,"spectrum").map(Aw.focusIn).map(E)}}),tp.config({store:{mode:"manual",getValue:function(t){return f.value.get()}}}),yf.config({channels:(o={},o[xh()]={onReceive:b},o)})]),events:_a([Ra(aM(),(function(t,e){h(t,e.event.value)})),Ua((function(e,n){var r=f.getInitialValue();f.value.set(r);var o=i(e);m(e,o);var a=u(e);t.onInit(e,o,a,f.value.get())})),Ra(Au(),y),Ra(Mu(),w),Ra(Nu(),y),Ra(Lu(),w)]),apis:{resetToMin:p,resetToMax:v,setValue:g,refresh:m},domModification:{styles:{position:"relative"}}}},CN=mv({name:"Slider",configFields:wN,partFields:iM,factory:xN,apis:{setValue:function(t,e,n){t.setValue(e,n)},resetToMin:function(t,e){t.resetToMin(e)},resetToMax:function(t,e){t.resetToMax(e)},refresh:function(t,e){t.refresh(e)}}}),SN=oc("rgb-hex-update"),kN=oc("slider-update"),TN=oc("palette-update"),ON=function(t,e){var n=CN.parts.spectrum({dom:{tag:"div",classes:[e("hue-slider-spectrum")],attributes:{role:"presentation"}}}),r=CN.parts.thumb({dom:{tag:"div",classes:[e("hue-slider-thumb")],attributes:{role:"presentation"}}});return CN.sketch({dom:{tag:"div",classes:[e("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:w({y:0})},components:[n,r],sliderBehaviours:mf([Yw.config({})]),onChange:function(t,e,n){Sa(t,kN,{value:n})}})},EN="form",_N=[ep("formBehaviours",[tp])],AN=function(t){return""},DN=function(t){var e=function(){var t=[],e=function(e,n){return t.push(e),jp(EN,AN(e),n)};return{field:e,record:w(t)}}(),n=t(e),r=e.record(),o=$(r,(function(t){return Np({name:t,pname:AN(t)})}));return uv(EN,_N,o,RN,n)},MN=function(t,e){return t.fold((function(){return ro.error(e)}),ro.value)},RN=function(t,e){return{uid:t.uid,dom:t.dom,components:e,behaviours:rp(t.formBehaviours,[tp.config({store:{mode:"manual",getValue:function(e){var n=Jp(e,t);return bt(n,(function(t,e){return t().bind((function(t){var n=bv.getCurrent(t);return MN(n,new Error("Cannot find a current component to extract the value from for form part '"+e+"': "+Za(t.element)))})).map(tp.getValue)}))},setValue:function(e,n){vt(n,(function(n,r){Kp(e,t,r).each((function(t){bv.getCurrent(t).each((function(t){tp.setValue(t,n)}))}))}))}}})]),apis:{getField:function(e,n){return Kp(e,t,n).bind(bv.getCurrent)}}}},NN={getField:Sc((function(t,e,n){return t.getField(e,n)})),sketch:DN},zN=oc("valid-input"),BN=oc("invalid-input"),LN=oc("validating-input"),HN="colorcustom.rgb.",IN=function(t,e,n,r){var o=function(n,r){return dD.config({invalidClass:e("invalid"),notify:{onValidate:function(t){Sa(t,LN,{type:n})},onValid:function(t){Sa(t,zN,{type:n,value:tp.getValue(t)})},onInvalid:function(t){Sa(t,BN,{type:n,value:tp.getValue(t)})}},validator:{validate:function(e){var n=tp.getValue(e),o=r(n)?ro.value(!0):ro.error(t("aria.input.invalid"));return tD.pure(o)},validateOnLoad:!1}})},i=function(n,r,i,u,a){var c=t(HN+"range"),s=hA.parts.label({dom:{tag:"label",innerHtml:i,attributes:{"aria-label":u}}}),l=hA.parts.field({data:a,factory:UA,inputAttributes:A({type:"text"},"hex"===r?{"aria-live":"polite"}:{}),inputClasses:[e("textfield")],inputBehaviours:mf([o(r,n),yA.config({})]),onSetValue:function(t){if(dD.isInvalid(t)){var e=dD.run(t);e.get(p)}}}),f=[s,l],d="hex"!==r?[hA.parts["aria-descriptor"]({text:c})]:[],m=f.concat(d);return{dom:{tag:"div",attributes:{role:"presentation"}},components:m}},u=function(t,e){var n=eE(e);return NN.getField(t,"hex").each((function(e){Yw.isFocused(e)||tp.setValue(t,{hex:n.value})})),n},a=function(t,e){var n=e.red,r=e.green,o=e.blue;tp.setValue(t,{red:n,green:r,blue:o})},c=kC({dom:{tag:"div",classes:[e("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),s=function(t,e){c.getOpt(t).each((function(t){Kn(t.element,"background-color","#"+e.value)}))},l=function(){var o={red:ou(L.some(255)),green:ou(L.some(255)),blue:ou(L.some(255)),hex:ou(L.some("ffffff"))},l=function(t,e){var n=lE(e);a(t,n),g(n)},f=function(t){return o[t].get()},d=function(t,e){o[t].set(e)},m=function(){return f("red").bind((function(t){return f("green").bind((function(e){return f("blue").map((function(n){return aE(t,e,n,1)}))}))}))},g=function(t){var e=t.red,n=t.green,r=t.blue;d("red",L.some(e)),d("green",L.some(n)),d("blue",L.some(r))},h=function(t,e){var n=e.event;"hex"!==n.type?d(n.type,L.none()):r(t)},p=function(t,e){n(t);var r=$O(e);d("hex",L.some(e));var o=lE(r);a(t,o),g(o),Sa(t,SN,{hex:r}),s(t,r)},v=function(t,e,n){var r=parseInt(n,10);d(e,L.some(r)),m().each((function(e){var n=u(t,e);Sa(t,SN,{hex:n}),s(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(HN+e+".label"),description:t(HN+e+".description")}},x=w("red"),C=w("green"),S=w("blue"),k=w("hex");return Co(NN.sketch((function(n){return{dom:{tag:"form",classes:[e("rgb-form")],attributes:{"aria-label":t("aria.color.picker")}},components:[n.field("red",hA.sketch(i(cE,"red",x.label,x.description,255))),n.field("green",hA.sketch(i(cE,"green",C.label,C.description,255))),n.field("blue",hA.sketch(i(cE,"blue",S.label,S.description,255))),n.field("hex",hA.sketch(i(XO,"hex",k.label,k.description,"ffffff"))),c.asSpec()],formBehaviours:mf([dD.config({invalidClass:e("form-invalid")}),Vw("rgb-form-events",[Ra(zN,y),Ra(BN,h),Ra(LN,h)])])}})),{apis:{updateHex:function(t,e){tp.setValue(t,{hex:e.value}),l(t,e),s(t,e)}}})},f=dv({factory:l,name:"RgbForm",configFields:[],apis:{updateHex:function(t,e,n){t.updateHex(e,n)}},extraApis:{}});return f},PN=function(t,e){var n=CN.parts.spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[e("sv-palette-spectrum")]}}),r=CN.parts.thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[e("sv-palette-thumb")],innerHtml:"'}}),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,r=xE(e,100,100),i=sE(r);o(n,mE(i))},u=function(t,e){var n=CE(lE(e));CN.setValue(t,{x:n.saturation,y:100-n.value})},a=function(t){var i=w({x:0,y:0}),u=function(t,e,n){Sa(t,TN,{value:n})},a=function(t,e,n,r){o(n.element.dom,mE(gE))},c=mf([bv.config({find:L.some}),Yw.config({})]);return CN.sketch({dom:{tag:"div",attributes:{role:"presentation"},classes:[e("sv-palette")]},model:{mode:"xy",getInitialValue:i},rounded:!1,components:[n,r],onChange:u,onInit:a,sliderBehaviours:c})},c=dv({factory:a,name:"SaturationBrightnessPalette",configFields:[],apis:{setHue:function(t,e,n){i(e,n)},setThumb:function(t,e,n){u(e,n)}},extraApis:{}});return c},FN=function(t,e){var n=function(n){var r=IN(t,e,n.onValidHex,n.onInvalidHex),o=PN(t,e),i=function(t){return(100-t)/100*360},u=function(t){return 100-t/360*100},a={paletteRgba:ou(gE),paletteHue:ou(0)},c=kC(ON(t,e)),s=kC(o.sketch({})),l=kC(r.sketch({})),f=function(t,e,n){s.getOpt(t).each((function(t){o.setHue(t,n)}))},d=function(t,e){l.getOpt(t).each((function(t){r.updateHex(t,e)}))},m=function(t,e,n){c.getOpt(t).each((function(t){CN.setValue(t,{y:u(n)})}))},g=function(t,e){s.getOpt(t).each((function(t){o.setThumb(t,e)}))},h=function(t,e){var n=lE(t);a.paletteRgba.set(n),a.paletteHue.set(e)},p=function(t,e,n,r){h(e,n),G(r,(function(r){r(t,e,n)}))},v=function(){var t=[d];return function(e,n){var r=n.event.value,o=a.paletteHue.get(),i=xE(o,r.x,100-r.y),u=kE(i);p(e,u,o,t)}},b=function(){var t=[f,d];return function(e,n){var r=i(n.event.value.y),o=a.paletteRgba.get(),u=CE(o),c=xE(r,u.saturation,u.value),s=kE(c);p(e,s,r,t)}},y=function(){var t=[f,m,g];return function(e,n){var r=n.event.hex,o=SE(r);p(e,r,o.hue,t)}};return{uid:n.uid,dom:n.dom,components:[s.asSpec(),c.asSpec(),l.asSpec()],behaviours:mf([Vw("colour-picker-events",[Ra(SN,y()),Ra(TN,v()),Ra(kN,b())]),bv.config({find:function(t){return l.getOpt(t)}}),Aw.config({mode:"acyclic"})])}},r=dv({name:"ColourPicker",configFields:[Ai("dom"),Ki("onValidHex",p),Ki("onInvalidHex",p)],factory:n});return r},VN=function(){return bv.config({find:L.some})},UN=function(t){return bv.config({find:t.getOpt})},jN=function(t){return bv.config({find:function(e){return Cn(e.element,t).bind((function(t){return e.getSystem().getByDom(t).toOptional()}))}})},WN={self:VN,memento:UN,childAt:jN},qN={"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"},$N=function(t){return qN[t]},GN=function(t){return $N(t)},KN=function(t){var e=function(t){return"tox-"+t},n=FN(GN,e),r=function(t){Sa(t,DA,{name:"hex-valid",value:!0})},o=function(t){Sa(t,DA,{name:"hex-valid",value:!1})},i=kC(n.sketch({dom:{tag:"div",classes:[e("color-picker-container")],attributes:{role:"presentation"}},onValidHex:r,onInvalidHex:o}));return{dom:{tag:"div"},components:[i.asSpec()],behaviours:mf([tp.config({store:{mode:"manual",getValue:function(t){var e=i.get(t),n=bv.getCurrent(e),r=n.bind((function(t){var e=tp.getValue(t);return e.hex}));return r.map((function(t){return"#"+t})).getOr("")},setValue:function(t,e){var n=/^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/,r=n.exec(e),o=i.get(t),u=bv.getCurrent(o);u.fold((function(){console.log("Can not find form")}),(function(t){tp.setValue(t,{hex:L.from(r[1]).getOr("")}),NN.getField(t,"hex").each((function(t){Ca(t,Uu())}))}))}}}),WN.self()])}},XN=tinymce.util.Tools.resolve("tinymce.Resource"),YN=function(t){return Et(t,"init")},JN=function(t){var e=od(),n=kC({dom:{tag:t.tag}}),r=od();return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:mf([Vw("custom-editor-events",[Ua((function(o){n.getOpt(o).each((function(n){(YN(t)?t.init(n.element.dom):XN.load(t.scriptId,t.scriptUrl).then((function(e){return e(n.element.dom,t.settings)}))).then((function(t){r.on((function(e){t.setValue(e)})),r.clear(),e.set(t)}))}))}))]),tp.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(n)}),(function(t){return t.setValue(n)}))}}}),WN.self()]),components:[n.asSpec()]}},QN=tinymce.util.Tools.resolve("tinymce.util.Tools"),ZN=ti([Ki("preprocess",x),Ki("postprocess",x)]),tz=function(t,e){var n=Ci("RepresentingConfigs.memento processors",ZN,e);return tp.config({store:{mode:"manual",getValue:function(e){var r=t.get(e),o=tp.getValue(r);return n.postprocess(o)},setValue:function(e,r){var o=n.preprocess(r),i=t.get(e);tp.setValue(i,o)}}})},ez=function(t,e,n){return tp.config(Co({store:{mode:"manual",getValue:e,setValue:n}},t.map((function(t){return{store:{initialValue:t}}})).getOr({})))},nz=function(t,e,n){return ez(t,(function(t){return e(t.element)}),(function(t,e){return n(t.element,e)}))},rz=function(t){return nz(t,ds,ms)},oz=function(t){return nz(t,Ga,Ka)},iz=function(t){return tp.config({store:{mode:"memory",initialValue:t}})},uz={memento:tz,withElement:nz,withComp:ez,domValue:rz,domHtml:oz,memory:iz},az="jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp",cz=function(t,e){var n=QN.explode(e.getSetting("images_file_types",az,"string")),r=function(t){return j(n,(function(e){return Wt(t.name.toLowerCase(),"."+e.toLowerCase())}))};return Y(mt(t),r)},sz=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(!Hv.isDisabled(t)){var n=e.event.raw;u(t,n.dataTransfer.files)}},i=function(t,e){var n=e.event.raw.target;u(t,n.files)},u=function(n,r){tp.setValue(n,cz(r,e)),Sa(n,EA,{name:t.name})},a=kC({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:mf([Vw("input-file-events",[Pa(Wu()),Pa(ra())])])}),c=function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:mf([uz.memory([]),WN.self(),Hv.config({}),hx.config({toggleClass:"dragenter",toggleOnExecute:!1}),Vw("dropzone-events",[Ra("dragenter",r([n,hx.toggle])),Ra("dragleave",r([n,hx.toggle])),Ra("dragover",n),Ra("drop",r([n,o])),Ra(ju(),i)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:e.translate("Drop an image here")}},SC.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:mf([yA.config({}),mO.button(e.isDisabled),cO()])})]}]}},s=t.label.map((function(t){return OA(t,e)})),l=hA.parts.field({factory:{sketch:c}});return xA(s,l,["tox-form__group--stretched"],[])},lz=function(t,e){return{dom:{tag:"div",classes:["tox-form__grid","tox-form__grid--"+t.columns+"col"]},components:$(t.items,e.interpreter)}},fz=oc("alloy-fake-before-tabstop"),dz=oc("alloy-fake-after-tabstop"),mz=function(t){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:t},behaviours:mf([Yw.config({ignore:!0}),yA.config({})])}},gz=function(t){return{dom:{tag:"div",classes:["tox-navobj"]},components:[mz([fz]),t,mz([dz])],behaviours:mf([WN.childAt(1)])}},hz=function(t,e){Sa(t,Fu(),{raw:{which:9,shiftKey:e}})},pz=function(t,e){var n=e.element;cs(n,fz)?hz(t,!0):cs(n,dz)&&hz(t,!1)},vz=function(t){return L_(t,["."+fz,"."+dz].join(","),O)},bz=!(en().browser.isIE()||en().browser.isEdge()),yz=function(t){var e=ou("");return{getValue:function(t){return e.get()},setValue:function(n,r){if(t)Fn(n.element,"srcdoc",r);else{Fn(n.element,"src","javascript:''");var o=n.element.dom.contentWindow.document;o.open(),o.write(r),o.close()}e.set(r)}}},wz=function(t,e){var n=bz&&t.sandboxed,r=A(A({},t.label.map((function(t){return{title:t}})).getOr({})),n?{sandbox:"allow-scripts allow-same-origin"}:{}),o=yz(n),i=t.label.map((function(t){return OA(t,e)})),u=function(t){return gz({uid:t.uid,dom:{tag:"iframe",attributes:r},behaviours:mf([yA.config({}),Yw.config({}),uz.withComp(L.none(),o.getValue,o.setValue)])})},a=hA.parts.field({factory:{sketch:u}});return xA(i,a,["tox-form__group--stretched"],[])},xz=function(t,e){return kz(document.createElement("canvas"),t,e)},Cz=function(t){var e=xz(t.width,t.height),n=Sz(e);return n.drawImage(t,0,0),e},Sz=function(t){return t.getContext("2d")},kz=function(t,e,n){return t.width=e,t.height=n,t},Tz=function(t){return t.naturalWidth||t.width},Oz=function(t){return t.naturalHeight||t.height},Ez=function(t){return new $A((function(e,n){var r=URL.createObjectURL(t),o=new Image,i=function(){o.removeEventListener("load",u),o.removeEventListener("error",a)},u=function(){i(),e(o)},a=function(){i(),n("Unable to load data of type "+t.type+": "+r)};o.addEventListener("load",u),o.addEventListener("error",a),o.src=r,o.complete&&setTimeout(u,0)}))},_z=function(t){var e=t.split(","),n=/data:([^;]+)/.exec(e[0]);if(!n)return L.none();for(var r=n[1],o=e[1],i=1024,u=atob(o),a=u.length,c=Math.ceil(a/i),s=new Array(c),l=0;ln?r=n:rn?t=n:t2)&&(i=i<.5?.5:2,a=!0),(u<.5||u>2)&&(u=u<.5?.5:2,a=!0);var c=aB(t,i,u);return a?c.then((function(t){return uB(t,e,n)})):c},aB=function(t,e,n){return new $A((function(r){var o=Tz(t),i=Oz(t),u=Math.floor(o*e),a=Math.floor(i*n),c=xz(u,a),s=Sz(c);s.drawImage(t,0,0,o,i,0,0,u,a),r(c)}))},cB=function(t,e){void 0===e&&(e=2);var n=Math.pow(10,e),r=Math.round(t*n);return Math.ceil(r/n)},sB=function(t,e){return t.toCanvas().then((function(n){return lB(n,t.getType(),e)}))},lB=function(t,e,n){var r=n<0?360+n:n,o=r*Math.PI/180,i=t.width,u=t.height,a=Math.sin(o),c=Math.cos(o),s=cB(Math.abs(i*c)+Math.abs(u*a)),l=cB(Math.abs(i*a)+Math.abs(u*c)),f=xz(s,l),d=Sz(f);return d.translate(s/2,l/2),d.rotate(o),d.drawImage(t,-i/2,-u/2),Hz(f,e)},fB=function(t,e){return t.toCanvas().then((function(n){return dB(n,t.getType(),e)}))},dB=function(t,e,n){var r=xz(t.width,t.height),o=Sz(r);return"v"===n?(o.scale(1,-1),o.drawImage(t,0,-r.height)):(o.scale(-1,1),o.drawImage(t,-r.width,0)),Hz(r,e)},mB=function(t,e,n,r,o){return t.toCanvas().then((function(i){return gB(i,t.getType(),e,n,r,o)}))},gB=function(t,e,n,r,o,i){var u=xz(o,i),a=Sz(u);return a.drawImage(t,-n,-r),Hz(u,e)},hB=function(t,e,n){return t.toCanvas().then((function(r){return uB(r,e,n).then((function(e){return Hz(e,t.getType())}))}))},pB=function(t){return tB(t)},vB=function(t){return oB(t)},bB=function(t,e){return iB(t,e)},yB=function(t,e,n,r){return rB(t,e,n,r)},wB=function(t,e){return eB(t,e)},xB=function(t,e){return nB(t,e)},CB=function(t,e){return fB(t,e)},SB=function(t,e,n,r,o){return mB(t,e,n,r,o)},kB=function(t,e,n){return hB(t,e,n)},TB=function(t,e){return sB(t,e)},OB=function(t,e,n){return LC(t,{tag:"span",classes:["tox-icon","tox-tbtn__icon-wrap"],behaviours:n},e)},EB=function(t,e){return OB(t,e,[])},_B=function(t,e){return OB(t,e,[Pw.config({})])},AB=function(t,e,n){return{dom:{tag:"span",innerHtml:n.translate(t),classes:[e+"__select-label"]},behaviours:mf([Pw.config({})])}},DB=oc("toolbar.button.execute"),MB=function(t){return qa((function(e,n){gO(t,e)((function(n){Sa(e,DB,{buttonApi:n}),t.onAction(n)}))}))},RB=(xD={},xD[ea()]=["disabling","alloy.base.behaviour","toggling","toolbar-button-events"],xD),NB=oc("update-menu-text"),zB=oc("update-menu-icon"),BB=function(t,e,n){var r=ou(p),o=t.text.map((function(t){return kC(AB(t,e,n.providers))})),i=t.icon.map((function(t){return kC(_B(t,n.providers.icons))})),u=function(t,e){var n=tp.getValue(t);return Yw.focus(n),Sa(n,"keydown",{raw:e.event.raw}),HD.close(n),L.some(!0)},a=t.role.fold((function(){return{}}),(function(t){return{role:t}})),c=t.tooltip.fold((function(){return{}}),(function(t){var e=n.providers.translate(t);return{title:e,"aria-label":e}})),s=LC("chevron-down",{tag:"div",classes:[e+"__select-chevron"]},n.providers.icons),l=kC(HD.sketch(A(A(A({},t.uid?{uid:t.uid}:{}),a),{dom:{tag:"button",classes:[e,e+"--select"].concat($(t.classes,(function(t){return e+"--"+t}))),attributes:A({},c)},components:yO([i.map((function(t){return t.asSpec()})),o.map((function(t){return t.asSpec()})),L.some(s)]),matchWidth:!0,useMinWidth:!0,dropdownBehaviours:mf(M(M([],t.dropdownBehaviours,!0),[mO.button((function(){return t.disabled||n.providers.isDisabled()})),cO(),VD.config({}),Pw.config({}),Vw("dropdown-events",[hO(t,r),pO(t,r)]),Vw("menubutton-update-display-text",[Ra(NB,(function(t,e){o.bind((function(e){return e.getOpt(t)})).each((function(t){Pw.set(t,[Ss(n.providers.translate(e.event.text))])}))})),Ra(zB,(function(t,e){i.bind((function(e){return e.getOpt(t)})).each((function(t){Pw.set(t,[_B(e.event.icon,n.providers.icons)])}))}))])],!1)),eventOrder:Co(RB,{mousedown:["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"]}),sandboxBehaviours:mf([Aw.config({mode:"special",onLeft:u,onRight:u})]),lazySink:n.getSink,toggleClass:e+"--active",parts:{menu:pk(!1,t.columns,t.presets)},fetch:function(e){return tD.nu(S(t.fetch,e))}})));return l.asSpec()},LB=function(t){return i(t)},HB=function(t){return"separator"===t.type},IB=function(t){return Et(t,"getSubmenuItems")},PB={type:"separator"},FB=function(t,e){var n=Q(t,(function(t,n){return LB(n)?""===n?t:"|"===n?t.length>0&&!HB(t[t.length-1])?t.concat([PB]):t:Et(e,n.toLowerCase())?t.concat([e[n.toLowerCase()]]):t:t.concat([n])}),[]);return n.length>0&&HB(n[n.length-1])&&n.pop(),n},VB=function(t,e){var n=t.getSubmenuItems(),r=WB(n,e),o=Co(r.menus,mu(t.value,r.items)),i=Co(r.expansions,mu(t.value,t.value));return{item:t,menus:o,expansions:i}},UB=function(t,e){return IB(t)?VB(t,e):{item:t,menus:{},expansions:{}}},jB=function(t){if(HB(t))return t;var e=Ot(t,"value").getOrThunk((function(){return oc("generated-menu-item")}));return Co({value:e},t)},WB=function(t,e){var n=FB(i(t)?t.split(" "):t,e);return J(n,(function(t,n){var r=jB(n),o=UB(r,e);return{menus:Co(t.menus,o.menus),items:[o.item].concat(t.items),expansions:Co(t.expansions,o.expansions)}}),{menus:{},expansions:{},items:[]})},qB=function(t,e,n,r){var o=oc("primary-menu"),i=WB(t,n.shared.providers.menuItems());if(0===i.items.length)return L.none();var u=M_(o,i.items,e,n,r),a=bt(i.menus,(function(t,r){return M_(r,t,e,n,!1)})),c=Co(a,mu(o,u));return L.from(Qx.tieredData(o,c,i.expansions))},$B=function(t){return{isDisabled:function(){return Hv.isDisabled(t)},setDisabled:function(e){return Hv.set(t,e)},setActive:function(e){var n=t.element;e?(is(n,"tox-tbtn--enabled"),Fn(n,"aria-pressed",!0)):(as(n,"tox-tbtn--enabled"),qn(n,"aria-pressed"))},isActive:function(){return cs(t.element,"tox-tbtn--enabled")}}},GB=function(t,e,n,r){return BB({text:t.text,icon:t.icon,tooltip:t.tooltip,role:r,fetch:function(e,r){t.fetch((function(t){r(qB(t,jS.CLOSE_ON_EXECUTE,n,!1))}))},onSetup:t.onSetup,getApi:$B,columns:1,presets:"normal",classes:[],dropdownBehaviours:[yA.config({})]},e,n.shared)},KB=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){Sf(e.element),Sa(e,DA,{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 A(A({type:t.type,active:!1},e),{onAction:r(t),onSetup:o(t)})})))}},XB=function(t,e,n,r,o,i){void 0===n&&(n=[]);var u=e.fold((function(){return{}}),(function(t){return{action:t}})),a=A({buttonBehaviours:mf([mO.button((function(){return t.disabled||i.isDisabled()})),cO(),yA.config({}),Vw("button press",[Ma("click"),Ma("mousedown")])].concat(n)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]}},u),c=Co(a,{dom:r});return Co(c,{components:o})},YB=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 EB(t,n.icons)})),a=yO([u]);return XB(t,e,r,i,a,n)},JB=function(t,e,n,r){void 0===r&&(r=[]);var o=YB(t,L.some(e),n,r);return SC.sketch(o)},QB=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 EB(t,n.icons)})):L.none(),a=u.isSome()?yO([u]):[],c=u.isSome()?{}:{innerHtml:i},s=M(M(M(M([],t.primary||t.borderless?["tox-button"]:["tox-button","tox-button--secondary"],!0),u.isSome()?["tox-button--icon"]:[],!0),t.borderless?["tox-button--naked"]:[],!0),o,!0),l=A(A({tag:"button",classes:s},c),{attributes:{title:i}});return XB(t,e,r,l,a,n)},ZB=function(t,e,n,r,o){void 0===r&&(r=[]),void 0===o&&(o=[]);var i=QB(t,L.some(e),n,r,o);return SC.sketch(i)},tL=function(t,e){return function(n){"custom"===e?Sa(n,DA,{name:t,value:{}}):"submit"===e?Ca(n,MA):"cancel"===e?Ca(n,AA):console.error("Unknown button type: ",e)}},eL=function(t,e){return"menu"===e},nL=function(t,e){return"custom"===e||"cancel"===e||"submit"===e},rL=function(t,e,n){if(eL(t,e)){var r=function(){return u},o=t,i=A(A({},t),{onSetup:function(e){return e.setDisabled(t.disabled),p},fetch:KB(o.items,r,n)}),u=kC(GB(i,"tox-tbtn",n,L.none()));return u.asSpec()}if(nL(t,e)){var a=tL(t.name,e),c=A(A({},t),{borderless:!1});return ZB(c,a,n.shared.providers,[])}console.error("Unknown footer button type: ",e)},oL=function(t,e){var n=tL(t.name,"custom");return CA(L.none(),hA.parts.field(A({factory:SC},QB(t,L.some(n),e,[uz.memory(""),WN.self()]))))},iL=w([Ki("field1Name","field1"),Ki("field2Name","field2"),sl("onLockedChange"),il(["lockClass"]),Ki("locked",!1),op.field("coupledFieldBehaviours",[bv,tp])]),uL=function(t,e,n){return Kp(t,e,n).bind(bv.getCurrent)},aL=function(t,e){return Np({factory:hA,name:t,overrides:function(t){return{fieldBehaviours:mf([Vw("coupled-input-behaviour",[Ra(Uu(),(function(n){uL(n,t,e).each((function(e){Kp(n,t,"lock").each((function(r){hx.isOn(r)&&t.onLockedChange(n,e,r)}))}))}))])])}}})},cL=w([aL("field1","field2"),aL("field2","field1"),Np({factory:SC,schema:[Ai("dom")],name:"lock",overrides:function(t){return{buttonBehaviours:mf([hx.config({selected:t.locked,toggleClass:t.markers.lockClass,aria:{mode:"pressed"}})])}}})]),sL=function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,behaviours:op.augment(t.coupledFieldBehaviours,[bv.config({find:L.some}),tp.config({store:{mode:"manual",getValue:function(e){var n,r=Zp(e,t,["field1","field2"]);return n={},n[t.field1Name]=tp.getValue(r.field1()),n[t.field2Name]=tp.getValue(r.field2()),n},setValue:function(e,n){var r=Zp(e,t,["field1","field2"]);_t(n,t.field1Name)&&tp.setValue(r.field1(),n[t.field1Name]),_t(n,t.field2Name)&&tp.setValue(r.field2(),n[t.field2Name])}}})]),apis:{getField1:function(e){return Kp(e,t,"field1")},getField2:function(e){return Kp(e,t,"field2")},getLock:function(e){return Kp(e,t,"lock")}}}},lL=mv({name:"FormCoupledInputs",configFields:iL(),partFields:cL(),factory:sL,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)}}}),fL=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},dL=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 ro.value({value:r,unit:o})}return ro.error(t)},mL=function(t,e){var n={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,in:1},r=function(t){return Et(n,t)};return t.unit===e?L.some(t.value):r(t.unit)&&r(e)?n[t.unit]===n[e]?L.some(t.value):L.some(t.value/n[t.unit]*n[e]):L.none()},gL=function(t){return L.none()},hL=function(t,e){return function(n){return mL(n,e).map((function(n){return{value:n*t,unit:e}}))}},pL=function(t,e){var n=dL(t).toOptional(),r=dL(e).toOptional();return Nt(n,r,(function(t,e){return mL(t,e.unit).map((function(t){return e.value/t})).map((function(t){return hL(t,e.unit)})).getOr(gL)})).getOr(gL)},vL=function(t,e){var n=gL,r=oc("ratio-event"),o=function(t){return LC(t,{tag:"span",classes:["tox-icon","tox-lock-icon__"+t]},e.icons)},i=lL.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:[o("lock"),o("unlock")],buttonBehaviours:mf([Hv.config({disabled:function(){return t.disabled||e.isDisabled()}}),cO(),yA.config({})])}),u=function(t){return{dom:{tag:"div",classes:["tox-form__group"]},components:t}},a=function(n){return hA.parts.field({factory:UA,inputClasses:["tox-textfield"],inputBehaviours:mf([Hv.config({disabled:function(){return t.disabled||e.isDisabled()}}),cO(),yA.config({}),Vw("size-input-events",[Ra(Iu(),(function(t,e){Sa(t,r,{isField1:n})})),Ra(ju(),(function(e,n){Sa(e,EA,{name:t.name})}))])]),selectOnFocus:!1})},c=function(t){return{dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}}},s=lL.parts.field1(u([hA.parts.label(c("Width")),a(!0)])),l=lL.parts.field2(u([hA.parts.label(c("Height")),a(!1)]));return lL.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:[s,l,u([c(" "),i])]}],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:function(t,e,r){dL(tp.getValue(t)).each((function(t){n(t).each((function(t){tp.setValue(e,fL(t))}))}))},coupledFieldBehaviours:mf([Hv.config({disabled:function(){return t.disabled||e.isDisabled()},onDisabled:function(t){lL.getField1(t).bind(hA.getField).each(Hv.disable),lL.getField2(t).bind(hA.getField).each(Hv.disable),lL.getLock(t).each(Hv.disable)},onEnabled:function(t){lL.getField1(t).bind(hA.getField).each(Hv.enable),lL.getField2(t).bind(hA.getField).each(Hv.enable),lL.getLock(t).each(Hv.enable)}}),cO(),Vw("size-input-events2",[Ra(r,(function(t,e){var r=e.event.isField1,o=r?lL.getField1(t):lL.getField2(t),i=r?lL.getField2(t):lL.getField1(t),u=o.map(tp.getValue).getOr(""),a=i.map(tp.getValue).getOr("");n=pL(u,a)}))])])})},bL=w(oc("undo")),yL=w(oc("redo")),wL=w(oc("zoom")),xL=w(oc("back")),CL=w(oc("apply")),SL=w(oc("swap")),kL=w(oc("transform")),TL=w(oc("temp-transform")),OL=w(oc("transform-apply")),EL={undo:bL,redo:yL,zoom:wL,back:xL,apply:CL,swap:SL,transform:kL,tempTransform:TL,transformApply:OL},_L=w("save-state"),AL=w("disable"),DL=w("enable"),ML={formActionEvent:DA,saveState:_L,disable:AL,enable:DL},RL=function(t,e){var n=function(t,n,r,o){return kC(ZB({name:t,text:t,disabled:r,primary:o,icon:L.none(),borderless:!1},n,e))},r=function(t,n,r,o){return kC(JB({name:t,icon:L.some(t),tooltip:L.some(n),disabled:o,primary:!1,borderless:!1},r,e))},o=function(t,e){t.map((function(t){var n=t.get(e);n.hasConfigured(Hv)&&Hv.disable(n)}))},i=function(t,e){t.map((function(t){var n=t.get(e);n.hasConfigured(Hv)&&Hv.enable(n)}))},u={tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools-edit-panel"]},a=p,c=function(t,e,n){Sa(t,e,n)},s=function(t){return Ca(t,ML.disable())},l=function(t){return Ca(t,ML.enable())},f=function(t,e){s(t),c(t,EL.transform(),{transform:e}),l(t)},d=function(t,e){s(t),c(t,EL.tempTransform(),{transform:e}),l(t)},m=function(t){return function(){ut.getOpt(t).each((function(t){Pw.set(t,[ot])}))}},g=function(t,e){s(t),c(t,EL.transformApply(),{transform:e,swap:m(t)}),l(t)},h=function(){return n("Back",(function(t){return c(t,EL.back(),{swap:m(t)})}),!1,!1)},v=function(){return kC({dom:{tag:"div",classes:["tox-spacer"]},behaviours:mf([Hv.config({})])})},b=function(){return n("Apply",(function(t){return c(t,EL.apply(),{swap:m(t)})}),!0,!0)},y=function(){return function(e){var n=t.getRect();return SB(e,n.x,n.y,n.w,n.h)}},x=[h(),v(),n("Apply",(function(e){var n=y();g(e,n),t.hideCrop()}),!1,!0)],C=sA.sketch({dom:u,components:x.map((function(t){return t.asSpec()})),containerBehaviours:mf([Vw("image-tools-crop-buttons-events",[Ra(ML.disable(),(function(t,e){o(x,t)})),Ra(ML.enable(),(function(t,e){i(x,t)}))])])}),S=kC(vL({name:"size",label:L.none(),constrain:!0,disabled:!1},e)),k=function(t,e){return function(n){return kB(n,t,e)}},T=[h(),v(),S,v(),n("Apply",(function(t){S.getOpt(t).each((function(e){var n=tp.getValue(e),r=parseInt(n.width,10),o=parseInt(n.height,10),i=k(r,o);g(t,i)}))}),!1,!0)],O=sA.sketch({dom:u,components:T.map((function(t){return t.asSpec()})),containerBehaviours:mf([Vw("image-tools-resize-buttons-events",[Ra(ML.disable(),(function(t,e){o(T,t)})),Ra(ML.enable(),(function(t,e){i(T,t)}))])])}),E=function(t,e){return function(n){return t(n,e)}},_=E(CB,"h"),A=E(CB,"v"),D=E(TB,-90),M=E(TB,90),R=function(t,e){d(t,e)},N=[h(),v(),r("flip-horizontally","Flip horizontally",(function(t){R(t,_)}),!1),r("flip-vertically","Flip vertically",(function(t){R(t,A)}),!1),r("rotate-left","Rotate counterclockwise",(function(t){R(t,D)}),!1),r("rotate-right","Rotate clockwise",(function(t){R(t,M)}),!1),v(),b()],z=sA.sketch({dom:u,components:N.map((function(t){return t.asSpec()})),containerBehaviours:mf([Vw("image-tools-fliprotate-buttons-events",[Ra(ML.disable(),(function(t,e){o(N,t)})),Ra(ML.enable(),(function(t,e){i(N,t)}))])])}),B=function(t,n,r,o,i){var u=CN.parts.label({dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}}),a=CN.parts.spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}}),c=CN.parts.thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});return kC(CN.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:r,maxX:i,getInitialValue:w({x:o})},components:[u,a,c],sliderBehaviours:mf([Yw.config({})]),onChoose:n}))},H=function(t,e,n,r,o){var i=function(t,n,r){var o=E(e,r.x/100);f(t,o)};return B(t,i,n,r,o)},I=function(t,e,n,r,o){return[h(),H(t,e,n,r,o),b()]},P=function(t,e,n,r,a){var c=I(t,e,n,r,a);return sA.sketch({dom:u,components:c.map((function(t){return t.asSpec()})),containerBehaviours:mf([Vw("image-tools-filter-panel-buttons-events",[Ra(ML.disable(),(function(t,e){o(c,t)})),Ra(ML.enable(),(function(t,e){i(c,t)}))])])})},F=[h(),v(),b()],V=sA.sketch({dom:u,components:F.map((function(t){return t.asSpec()}))}),U=P("Brightness",wB,-100,0,100),j=P("Contrast",xB,-100,0,100),W=P("Gamma",bB,-100,0,100),q=function(t,e,n){return function(r){return yB(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=tp.getValue(e).x/100,i=tp.getValue(r).x/100,u=tp.getValue(n).x/100,a=q(o,i,u);f(t,a)}))}))}))};return B(t,e,0,100,200)},G=$("R"),K=$("G"),X=$("B"),Y=[h(),G,K,X,b()],J=sA.sketch({dom:u,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){Pw.set(e,[t]),n(e)}))};c(r,EL.swap(),{transform:e,swap:o})}},Z=function(e){t.showCrop()},tt=function(e){S.getOpt(e).each((function(e){var n=t.getMeasurements(),r=n.width,o=n.height;tp.setValue(e,{width:r,height:o})}))},et=L.some(vB),nt=L.some(pB),rt=[r("crop","Crop",Q(C,L.none(),Z),!1),r("resize","Resize",Q(O,L.none(),tt),!1),r("orientation","Orientation",Q(z,L.none(),a),!1),r("brightness","Brightness",Q(U,L.none(),a),!1),r("sharpen","Sharpen",Q(V,et,a),!1),r("contrast","Contrast",Q(j,L.none(),a),!1),r("color-levels","Color levels",Q(J,L.none(),a),!1),r("gamma","Gamma",Q(W,L.none(),a),!1),r("invert","Invert",Q(V,nt,a),!1)],ot=sA.sketch({dom:u,components:rt.map((function(t){return t.asSpec()}))}),it=sA.sketch({dom:{tag:"div"},components:[ot],containerBehaviours:mf([Pw.config({})])}),ut=kC(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}},NL=tinymce.util.Tools.resolve("tinymce.geom.Rect"),zL=tinymce.util.Tools.resolve("tinymce.util.Observable"),BL=tinymce.util.Tools.resolve("tinymce.util.VK"),LL=function(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=1?n.set(1):n.set(a)}))},c=function(t,e){var n=ee.fromTag("img");return Fn(n,"src",e),jL(n.dom).then((function(){t.getSystem().isConnected()&&g.getOpt(t).map((function(t){var e=ks({element:n});Pw.replaceAt(t,1,L.some(e));var r=i.get(),c={x:0,y:0,w:n.dom.naturalWidth,h:n.dom.naturalHeight};i.set(c);var s=NL.inflate(c,-20,-20);o.set(s),r.w===c.w&&r.h===c.h||a(t,n),u(t,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.run((function(t){t.toggleVisibility(!0)}))},f=function(){r.run((function(t){t.toggleVisibility(!1)}))},d=function(){return o.get()},m=sA.sketch({dom:{tag:"div",classes:["tox-image-tools__image"]},components:[e.asSpec(),{dom:{tag:"img",attributes:{src:t}}},{dom:{tag:"div"},behaviours:mf([Vw("image-panel-crop-events",[Ua((function(t){g.getOpt(t).each((function(t){var e=t.element.dom,i=UL.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,p);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(i)}))})),ja((function(){r.clear()}))])])}],containerBehaviours:mf([Pw.config({}),Vw("image-panel-events",[Ua((function(e){c(e,t)}))])])}),g=kC(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}},qL=function(t,e,n,r,o){return JB({name:t,icon:L.some(e),disabled:n,tooltip:L.some(t),primary:!1,borderless:!1},r,o)},$L=function(t,e){e?Hv.enable(t):Hv.disable(t)},GL=function(t){var e=function(t,e,o){n.getOpt(t).each((function(t){$L(t,e)})),r.getOpt(t).each((function(t){$L(t,o)}))},n=kC(qL("Undo","undo",!0,(function(t){Sa(t,EL.undo(),{direction:1})}),t)),r=kC(qL("Redo","redo",!0,(function(t){Sa(t,EL.redo(),{direction:1})}),t)),o=sA.sketch({dom:{tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools__sidebar"]},components:[n.asSpec(),r.asSpec(),qL("Zoom in","zoom-in",!1,(function(t){Sa(t,EL.zoom(),{direction:1})}),t),qL("Zoom out","zoom-out",!1,(function(t){Sa(t,EL.zoom(),{direction:-1})}),t)]});return{container:o,updateButtonUndoStates:e}};function KL(){var t=[],e=-1,n=function(n){var r=t.splice(++e);return t.push(n),{state:n,removed:r}},r=function(){if(i())return t[--e]},o=function(){if(u())return t[++e]},i=function(){return e>0},u=function(){return-1!==e&&e1?L.none():L.some(LC("chevron-down",{tag:"div",classes:["tox-selectfield__icon-js"]},e.icons)),u={dom:{tag:"div",classes:["tox-selectfield"]},components:nt([[o],i.toArray()])};return hA.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:nt([r.toArray(),[u]]),fieldBehaviours:mf([Hv.config({disabled:function(){return t.disabled||e.isDisabled()},onDisabled:function(t){hA.getField(t).each(Hv.disable)},onEnabled:function(t){hA.getField(t).each(Hv.enable)}}),cO()])})},cH=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:mf([yA.config({}),Yw.config({})])}},sH=function(t,e){var n=t.label.map((function(t){return OA(t,e)})),r=[Hv.config({disabled:function(){return t.disabled||e.isDisabled()}}),cO(),Aw.config({mode:"execution",useEnter:!0!==t.multiline,useControlEnter:!0===t.multiline,execute:function(t){return Ca(t,MA),L.some(!0)}}),Vw("textfield-change",[Ra(Uu(),(function(e,n){Sa(e,EA,{name:t.name})})),Ra(Zu(),(function(e,n){Sa(e,EA,{name:t.name})}))]),yA.config({})],o=t.validation.map((function(t){return dD.config({getRoot:function(t){return vn(t.element)},invalidClass:"tox-invalid",validator:{validate:function(e){var n=tp.getValue(e),r=t.validator(n);return tD.pure(!0===r?ro.value(n):ro.error(r))},validateOnLoad:t.validateOnLoad}})})).toArray(),i=t.placeholder.fold(w({}),(function(t){return{placeholder:e.translate(t)}})),u=t.inputMode.fold(w({}),(function(t){return{inputmode:t}})),a=A(A({},i),u),c=hA.parts.field({tag:!0===t.multiline?"textarea":"input",inputAttributes:a,inputClasses:[t.classname],inputBehaviours:mf(nt([r,o])),selectOnFocus:!1,factory:UA}),s=t.flex?["tox-form__group--stretched"]:[],l=s.concat(t.maximized?["tox-form-group--maximize"]:[]),f=[Hv.config({disabled:function(){return t.disabled||e.isDisabled()},onDisabled:function(t){hA.getField(t).each(Hv.disable)},onEnabled:function(t){hA.getField(t).each(Hv.enable)}}),cO()];return xA(n,c,l,f)},lH=function(t,e){return sH({name:t.name,multiline:!1,label:t.label,inputMode:t.inputMode,placeholder:t.placeholder,flex:!1,disabled:t.disabled,classname:"tox-textfield",validation:L.none(),maximized:t.maximized},e)},fH=function(t,e){return sH({name:t.name,multiline:!0,label:t.label,inputMode:L.none(),placeholder:t.placeholder,flex:!0,disabled:t.disabled,classname:"tox-textarea",validation:L.none(),maximized:t.maximized},e)},dH=function(t,e){var n=t.stream.streams,r=n.setup(t,e);return _a([Ra(t.event,r),ja((function(){return e.cancel()}))].concat(t.cancelEvent.map((function(t){return[Ra(t,(function(){return e.cancel()}))]})).getOr([])))},mH=Object.freeze({__proto__:null,events:dH}),gH=function(t){var e=ou(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 Tc({readState:n,setTimer:r,cancel:o})},hH=function(t){return t.stream.streams.state(t)},pH=Object.freeze({__proto__:null,throttle:gH,init:hH}),vH=function(t,e){var n=t.stream,r=WC(t.onStream,n.delay);return e.setTimer(r),function(t,e){r.throttle(t,e),n.stopEvent&&e.stop()}},bH=[Di("stream",ki("mode",{throttle:[Ai("delay"),Ki("stopEvent",!0),fl("streams",{setup:vH,state:gH})]})),Ki("event","input"),Fi("cancelEvent"),sl("onStream")],yH=hf({fields:bH,name:"streaming",active:mH,state:pH}),wH=function(t,e,n){var r=tp.getValue(n);tp.setValue(e,r),CH(e)},xH=function(t,e){var n=t.element,r=ds(n),o=n.dom;"number"!==Un(n,"type")&&e(o,r)},CH=function(t){xH(t,(function(t,e){return t.setSelectionRange(e.length,e.length)}))},SH=function(t,e){xH(t,(function(t,n){return t.setSelectionRange(e,n.length)}))},kH=function(t,e,n){if(t.selectsOver){var r=tp.getValue(e),o=t.getDisplayText(r),i=tp.getValue(n),u=t.getDisplayText(i);return 0===u.indexOf(o)?L.some((function(){wH(t,e,n),SH(e,o.length)})):L.none()}return L.none()},TH=w("alloy.typeahead.itemexecute"),OH=function(t,e,n,r){var o=function(e,n,o){t.previewing.set(!1);var i=bD.getCoupled(e,"sandbox");if(bh.isOpen(i))bv.getCurrent(i).each((function(t){rb.getHighlighted(t).fold((function(){o(t)}),(function(){Ea(i,t.element,"keydown",n)}))}));else{var a=function(t){bv.getCurrent(t).each(o)};TD(t,u(e),e,i,r,a,qA.HighlightFirst).get(p)}},i=IA(t),u=function(t){return function(e){return e.map((function(e){var n=Tt(e.menus),r=rt(n,(function(t){return Y(t.items,(function(t){return"item"===t.type}))})),o=tp.getState(t);return o.update($(r,(function(t){return t.data}))),e}))}},a=[Yw.config({}),tp.config({onSetValue:t.onSetValue,store:A({mode:"dataset",getDataKey:function(t){return ds(t.element)},getFallbackEntry:function(t){return{value:t,meta:{}}},setValue:function(e,n){ms(e.element,t.model.getDisplayText(n))}},t.initialData.map((function(t){return mu("initialValue",t)})).getOr({}))}),yH.config({stream:{mode:"throttle",delay:t.responseTime,stopEvent:!1},onStream:function(e,n){var o=bD.getCoupled(e,"sandbox"),i=Yw.isFocused(e);if(i&&ds(e.element).length>=t.minChars){var a=bv.getCurrent(o).bind((function(t){return rb.getHighlighted(t).map(tp.getValue)}));t.previewing.set(!0);var c=function(e){bv.getCurrent(o).each((function(e){a.fold((function(){t.model.selectsOver&&rb.highlightFirst(e)}),(function(t){rb.highlightBy(e,(function(e){var n=tp.getValue(e);return n.value===t.value})),rb.getHighlighted(e).orThunk((function(){return rb.highlightFirst(e),L.none()}))}))}))};TD(t,u(e),e,o,r,c,qA.HighlightFirst).get(p)}},cancelEvent:ua()}),Aw.config({mode:"special",onDown:function(t,e){return o(t,e,rb.highlightFirst),L.some(!0)},onEscape:function(t){var e=bD.getCoupled(t,"sandbox");return bh.isOpen(e)?(bh.close(e),L.some(!0)):L.none()},onUp:function(t,e){return o(t,e,rb.highlightLast),L.some(!0)},onEnter:function(e){var n=bD.getCoupled(e,"sandbox"),r=bh.isOpen(n);if(r&&!t.previewing.get())return bv.getCurrent(n).bind((function(t){return rb.getHighlighted(t)})).map((function(t){return Sa(e,TH(),{item:t}),!0}));var o=tp.getValue(e);return Ca(e,ua()),t.onExecute(n,e,o),r&&bh.close(n),L.some(!0)}}),hx.config({toggleClass:t.markers.openClass,aria:{mode:"expanded"}}),bD.config({others:{sandbox:function(e){return MD(t,e,{onOpen:function(){return hx.on(e)},onClose:function(){return hx.off(e)}})}}}),Vw("typeaheadevents",[qa((function(e){var n=p;ED(t,u(e),e,r,n,qA.HighlightFirst).get(p)})),Ra(TH(),(function(e,n){var r=bD.getCoupled(e,"sandbox");wH(t.model,e,n.event.item),Ca(e,ua()),t.onItemExecute(e,r,n.event.item,tp.getValue(e)),bh.close(r),CH(e)}))].concat(t.dismissOnBlur?[Ra(Qu(),(function(t){var e=bD.getCoupled(t,"sandbox");Ef(e.element).isNone()&&bh.close(e)}))]:[]))];return{uid:t.uid,dom:FA(Co(t,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:A(A({},i),rp(t.typeaheadBehaviours,a)),eventOrder:t.eventOrder}},EH=w([Fi("lazySink"),Ai("fetch"),Ki("minChars",5),Ki("responseTime",1e3),al("onOpen"),Ki("getHotspot",L.some),Ki("getAnchorOverrides",w({})),Ki("layouts",L.none()),Ki("eventOrder",{}),ru("model",{},[Ki("getDisplayText",(function(t){return void 0!==t.meta&&void 0!==t.meta.text?t.meta.text:t.value})),Ki("selectsOver",!0),Ki("populateFromBrowse",!0)]),al("onSetValue"),cl("onExecute"),al("onItemExecute"),Ki("inputClasses",[]),Ki("inputAttributes",{}),Ki("inputStyles",{}),Ki("matchWidth",!0),Ki("useMinWidth",!1),Ki("dismissOnBlur",!0),il(["openClass"]),Fi("initialData"),ep("typeaheadBehaviours",[Yw,tp,yH,Aw,hx,bD]),Ei("previewing",(function(){return ou(!0)}))].concat(HA()).concat(ND())),_H=w([zp({schema:[ol()],name:"menu",overrides:function(t){return{fakeFocus:!0,onHighlight:function(e,n){t.previewing.get()?e.getSystem().getByUid(t.uid).each((function(r){kH(t.model,r,n).fold((function(){return rb.dehighlight(e,n)}),(function(t){return t()}))})):e.getSystem().getByUid(t.uid).each((function(e){t.model.populateFromBrowse&&wH(t.model,e,n)})),t.previewing.set(!1)},onExecute:function(e,n){return e.getSystem().getByUid(t.uid).toOptional().map((function(t){return Sa(t,TH(),{item:n}),!0}))},onHover:function(e,n){t.previewing.set(!1),e.getSystem().getByUid(t.uid).each((function(e){t.model.populateFromBrowse&&wH(t.model,e,n)}))}}}})]),AH=mv({name:"Typeahead",configFields:EH(),partFields:_H(),factory:OH}),DH=function(t){var e=function(){return DH(t.toCached())},n=function(e){return DH(t.bind((function(t){return t.fold((function(t){return tD.pure(ro.error(t))}),(function(t){return e(t)}))})))},r=function(e){return DH(t.map((function(t){return t.bind(e)})))},o=function(e){return DH(t.map((function(t){return t.map(e)})))},i=function(e){return DH(t.map((function(t){return t.mapError(e)})))},u=function(e,n){return t.map((function(t){return t.fold(e,n)}))},a=function(e,n){return DH(tD.nu((function(r){var o=!1,i=setTimeout((function(){o=!0,r(ro.error(n()))}),e);t.get((function(t){o||(clearTimeout(i),r(t))}))})))};return A(A({},t),{toCached:e,bindFuture:n,bindResult:r,mapResult:o,mapError:i,foldResult:u,withTimeout:a})},MH=function(t){return DH(tD.nu(t))},RH=function(t){return DH(tD.pure(ro.value(t)))},NH=function(t){return DH(tD.pure(ro.error(t)))},zH=function(t){return DH(tD.pure(t))},BH=function(t){return DH(t.map(ro.value))},LH=function(t){return MH((function(e){t.then((function(t){e(ro.value(t))}),(function(t){e(ro.error(t))}))}))},HH={nu:MH,wrap:DH,pure:RH,value:RH,error:NH,fromResult:zH,fromFuture:BH,fromPromise:LH},IH={type:"separator"},PH=function(t){return{type:"menuitem",value:t.url,text:t.title,meta:{attach:t.attach},onAction:p}},FH=function(t,e){return{type:"menuitem",value:e,text:t,meta:{attach:void 0},onAction:p}},VH=function(t){return $(t,PH)},UH=function(t,e){return Y(e,(function(e){return e.type===t}))},jH=function(t,e){return VH(UH(t,e))},WH=function(t){return jH("header",t.targets)},qH=function(t){return jH("anchor",t.targets)},$H=function(t){return L.from(t.anchorTop).map((function(t){return FH("",t)})).toArray()},GH=function(t){return L.from(t.anchorBottom).map((function(t){return FH("",t)})).toArray()},KH=function(t){return $(t,(function(t){return FH(t,t)}))},XH=function(t){return Q(t,(function(t,e){var n=0===t.length||0===e.length;return n?t.concat(e):t.concat(IH,e)}),[])},YH=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 Ut(e.toLowerCase(),n)||Ut(t.value.toLowerCase(),n)}))},JH=function(t,e,n){var r=tp.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=YH(o,KH(n.getHistory(t)));return"file"===t?XH([r,YH(o,WH(e)),YH(o,nt([$H(e),qH(e),GH(e)]))]):r}))},QH=oc("aria-invalid"),ZH=function(t,e,n){var r,o=e.shared.providers,i=function(e){var r=tp.getValue(e);n.addToHistory(r.value,t.filetype)},u=hA.parts.field({factory:AH,dismissOnBlur:!0,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],inputAttributes:{"aria-errormessage":QH,type:"url"},minChars:0,responseTime:0,fetch:function(r){var o=JH(t.filetype,r,n),i=qB(o,jS.BUBBLE_TO_SANDBOX,e,!1);return tD.pure(i)},getHotspot:function(t){return m.getOpt(t)},onSetValue:function(t,e){t.hasConfigured(dD)&&dD.run(t).get(p)},typeaheadBehaviours:mf(nt([n.getValidationHandler().map((function(e){return dD.config({getRoot:function(t){return vn(t.element)},invalidClass:"tox-control-wrap--status-invalid",notify:{onInvalid:function(t,e){s.getOpt(t).each((function(t){Fn(t.element,"title",o.translate(e))}))}},validator:{validate:function(n){var r=tp.getValue(n);return HH.nu((function(n){e({type:t.filetype,url:r.value},(function(t){if("invalid"===t.status){var e=ro.error(t.message);n(e)}else{var r=ro.value(t.message);n(r)}}))}))},validateOnLoad:!1}})})).toArray(),[Hv.config({disabled:function(){return t.disabled||o.isDisabled()}}),yA.config({}),Vw("urlinput-events",nt(["file"===t.filetype?[Ra(Uu(),(function(e){Sa(e,EA,{name:t.name})}))]:[],[Ra(ju(),(function(e){Sa(e,EA,{name:t.name}),i(e)})),Ra(Zu(),(function(e){Sa(e,EA,{name:t.name}),i(e)}))]]))]])),eventOrder:(r={},r[Uu()]=["streaming","urlinput-events","invalidating"],r),model:{getDisplayText:function(t){return t.value},selectsOver:!1,populateFromBrowse:!1},markers:{openClass:"tox-textfield--popup-open"},lazySink:e.shared.getSink,parts:{menu:pk(!1,1,"normal")},onExecute:function(t,e,n){Sa(e,MA,{})},onItemExecute:function(e,n,r,o){i(e),Sa(e,EA,{name:t.name})}}),a=t.label.map((function(t){return OA(t,o)})),c=function(t,e,n,r){return void 0===n&&(n=t),void 0===r&&(r=t),LC(n,{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+t],attributes:A({title:o.translate(r),"aria-live":"polite"},e.fold((function(){return{}}),(function(t){return{id:t}})))},o.icons)},s=kC(c("invalid",L.some(QH),"warning")),l=kC({dom:{tag:"div",classes:["tox-control-wrap__status-icon-wrap"]},components:[s.asSpec()]}),f=n.getUrlPicker(t.filetype),d=oc("browser.url.event"),m=kC({dom:{tag:"div",classes:["tox-control-wrap"]},components:[u,l.asSpec()],behaviours:mf([Hv.config({disabled:function(){return t.disabled||o.isDisabled()}})])}),g=kC(ZB({name:t.name,icon:L.some("browse"),text:t.label.getOr(""),disabled:t.disabled,primary:!1,borderless:!0},(function(t){return Ca(t,d)}),o,[],["tox-browse-url"])),h=function(){return{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:nt([[m.asSpec()],f.map((function(){return g.asSpec()})).toArray()])}},v=function(e){bv.getCurrent(e).each((function(n){var r=tp.getValue(n),o=A({fieldname:t.name},r);f.each((function(r){r(o).get((function(r){tp.setValue(n,r),Sa(e,EA,{name:t.name})}))}))}))};return hA.sketch({dom:kA(),components:a.toArray().concat([h()]),fieldBehaviours:mf([Hv.config({disabled:function(){return t.disabled||o.isDisabled()},onDisabled:function(t){hA.getField(t).each(Hv.disable),g.getOpt(t).each(Hv.disable)},onEnabled:function(t){hA.getField(t).each(Hv.enable),g.getOpt(t).each(Hv.enable)}}),cO(),Vw("url-input-events",[Ra(d,v)])])})},tI=function(t,e){return sA.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:[SC.sketch({dom:{tag:"button",classes:["tox-button","tox-button--naked","tox-button--icon"],innerHtml:MC(t.icon,e.icons),attributes:{title:e.translate(t.iconTooltip)}},action:function(e){Sa(e,DA,{name:"alert-banner",value:t.url})},buttonBehaviours:mf([zC()])})]},{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:e.translate(t.text)}}]})},eI=function(t,e){var n=tp.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(),L.some(!0)},o=hA.parts.field({factory:{sketch:x},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:mf([WN.self(),Hv.config({disabled:function(){return t.disabled||e.isDisabled()}}),yA.config({}),Yw.config({}),n,Aw.config({mode:"special",onEnter:r,onSpace:r,stopSpaceKeyup:!0}),Vw("checkbox-events",[Ra(ju(),(function(e,n){Sa(e,EA,{name:t.name})}))])])}),i=hA.parts.label({dom:{tag:"span",classes:["tox-checkbox__label"],innerHtml:e.translate(t.label)},behaviours:mf([VD.config({})])}),u=function(t){var n="checked"===t?"selected":"unselected";return LC(n,{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+t]},e.icons)},a=kC({dom:{tag:"div",classes:["tox-checkbox__icons"]},components:[u("checked"),u("unchecked")]});return hA.sketch({dom:{tag:"label",classes:["tox-checkbox"]},components:[o,a.asSpec(),i],fieldBehaviours:mf([Hv.config({disabled:function(){return t.disabled||e.isDisabled()},disableClass:"tox-checkbox--disabled",onDisabled:function(t){hA.getField(t).each(Hv.disable)},onEnabled:function(t){hA.getField(t).each(Hv.enable)}}),cO()])})},nI=function(t){return"presentation"===t.presets?sA.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html}}):sA.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html,attributes:{role:"document"}},containerBehaviours:mf([yA.config({}),Yw.config({})])})},rI=function(t){return function(e,n,r){return Ot(n,"name").fold((function(){return t(n,r)}),(function(o){return e.field(o,t(n,r))}))}},oI=function(t){return function(e,n,r){var o=Co(n,{source:"dynamic"});return rI(t)(e,o,r)}},iI={bar:rI((function(t,e){return fA(t,e.shared)})),collection:rI((function(t,e){return LA(t,e.shared.providers)})),alertbanner:rI((function(t,e){return tI(t,e.shared.providers)})),input:rI((function(t,e){return lH(t,e.shared.providers)})),textarea:rI((function(t,e){return fH(t,e.shared.providers)})),label:rI((function(t,e){return QL(t,e.shared)})),iframe:oI((function(t,e){return wz(t,e.shared.providers)})),button:rI((function(t,e){return oL(t,e.shared.providers)})),checkbox:rI((function(t,e){return eI(t,e.shared.providers)})),colorinput:rI((function(t,e){return $D(t,e.shared,e.colorinput)})),colorpicker:rI(KN),dropzone:rI((function(t,e){return sz(t,e.shared.providers)})),grid:rI((function(t,e){return lz(t,e.shared)})),listbox:rI((function(t,e){return rH(t,e)})),selectbox:rI((function(t,e){return aH(t,e.shared.providers)})),sizeinput:rI((function(t,e){return vL(t,e.shared.providers)})),urlinput:rI((function(t,e){return ZH(t,e,e.urlinput)})),customeditor:rI(JN),htmlpanel:rI(nI),imagetools:rI((function(t,e){return JL(t,e.shared.providers)})),table:rI((function(t,e){return cH(t,e.shared.providers)})),panel:rI((function(t,e){return oH(t,e)}))},uI={field:function(t,e){return e}},aI=function(t,e,n){var r=Co(n,{shared:{interpreter:function(e){return cI(t,e,r)}}});return cI(t,e,r)},cI=function(t,e,n){return Ot(iI,e.type).fold((function(){return console.error('Unknown factory type "'+e.type+'", defaulting to container: ',e),e}),(function(r){return r(t,e,n)}))},sI=function(t,e){var n=uI;return cI(n,t,e)},lI={valignCentre:[],alignCentre:[],alignLeft:[],alignRight:[],right:[],left:[],bottom:[],top:[]},fI=function(t,e,n){var r=12,o={maxHeightFunction:Ed()},i=function(){return{type:"node",root:Dn(t()),node:L.from(t()),bubble:Rd(r,r,lI),layouts:{onRtl:function(){return[dC]},onLtr:function(){return[fC]}},overrides:o}},u=function(){return{type:"hotspot",hotspot:e(),bubble:Rd(-r,r,lI),layouts:{onRtl:function(){return[Vl]},onLtr:function(){return[Ul]}},overrides:o}};return function(){return n()?i():u()}},dI=function(t,e,n){var r=function(){return{type:"node",root:Dn(t()),node:L.from(t()),layouts:{onRtl:function(){return[mC]},onLtr:function(){return[mC]}}}},o=function(){return{type:"hotspot",hotspot:e(),layouts:{onRtl:function(){return[$l]},onLtr:function(){return[$l]}}}};return function(){return n()?r():o()}},mI=function(t,e){return function(){return{type:"selection",root:e(),getSelection:function(){var e=t.selection.getRng();return L.some(km.range(ee.fromDom(e.startContainer),e.startOffset,ee.fromDom(e.endContainer),e.endOffset))}}}},gI=function(t){return function(e){return{type:"node",root:t(),node:e}}},hI=function(t,e,n){var r=UT(t),o=function(){return ee.fromDom(t.getBody())},i=function(){return ee.fromDom(t.getContentAreaContainer())},u=function(){return r||!n()};return{inlineDialog:fI(i,e,u),banner:dI(i,e,u),cursor:mI(t,o),node:gI(o)}},pI=function(t){return function(e,n){var r=t_(t);r(e,n)}},vI=function(t){return function(){return BE(t)}},bI=function(t){return function(){return HE(t)}},yI=function(t){return function(){return $E(t)}},wI=function(t){return{colorPicker:pI(t),hasCustomColors:vI(t),getColors:bI(t),getColorCols:yI(t)}},xI=function(t){return function(){return GT(t)}},CI=function(t){return{isDraggableModal:xI(t)}},SI=function(t){var e=ou(HT(t)?"bottom":"top");return{isPositionedAtTop:function(){return"top"===e.get()},getDockingMode:e.get,setDockingMode:e.set}},kI=[{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"}]}],TI=function(t){return Et(t,"items")},OI=function(t){return Et(t,"block")},EI=function(t){return Et(t,"inline")},_I=function(t){return Et(t,"selector")},AI=function(t){return Q(t,(function(t,e){if(TI(e)){var n=AI(e.items);return{customFormats:t.customFormats.concat(n.customFormats),formats:t.formats.concat([{title:e.title,items:n.formats}])}}if(EI(e)||OI(e)||_I(e)){var r=i(e.name)?e.name:e.title.toLowerCase(),o="custom-"+r;return{customFormats:t.customFormats.concat([{name:o,format:e}]),formats:t.formats.concat([{title:e.title,format:o,icon:e.icon}])}}return A(A({},t),{formats:t.formats.concat(e)})}),{customFormats:[],formats:[]})},DI=function(t,e){var n=AI(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},MI=function(t){return ST(t).map((function(e){var n=DI(t,e);return kT(t)?kI.concat(n):n})).getOr(kI)},RI=function(t,e,n){var r={type:"formatter",isSelected:e(t.format),getStylePreview:n(t.format)};return Co(t,r)},NI=function(t,e,n,r){var o=function(t){return RI(t,n,r)},u=function(t){var e={type:"submenu"};return Co(t,e)},a=function(e){var o=i(e.name)?e.name:oc(e.title),u="custom-"+o,a={type:"formatter",format:u,isSelected:n(u),getStylePreview:r(u)},c=Co(e,a);return t.formatter.register(o,c),c},c=function(t){return $(t,(function(t){var e=ht(t);if(_t(t,"items")){var n=c(t.items);return Co(u(t),{getStyleItems:w(n)})}return _t(t,"format")?o(t):1===e.length&&U(e,"title")?Co(t,{type:"separator"}):a(t)}))};return c(e)},zI=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?L.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))}):L.none()}},r=function(t){var e=t.items;return void 0!==e&&e.length>0?rt(e,r):[t.format]},o=ou([]),i=ou([]),u=ou([]),a=ou([]),c=ou(!1);t.on("PreInit",(function(u){var a=MI(t),c=NI(t,a,e,n);o.set(c),i.set(rt(c,r))})),t.on("addStyleModifications",(function(o){var i=NI(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}},BI=function(t){return d(t)&&1===t.nodeType},LI=QN.trim,HI=function(t){return function(e){if(BI(e)){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},II=HI("true"),PI=HI("false"),FI=function(t,e,n,r,o){return{type:t,title:e,url:n,level:r,attach:o}},VI=function(t){while(t=t.parentNode){var e=t.contentEditable;if(e&&"inherit"!==e)return II(t)}return!1},UI=function(t,e){return $(Xm(ee.fromDom(e),t),(function(t){return t.dom}))},jI=function(t){return t.innerText||t.textContent},WI=function(t){return t.id?t.id:oc("h")},qI=function(t){return t&&"A"===t.nodeName&&void 0!==(t.id||t.name)},$I=function(t){return qI(t)&&KI(t)},GI=function(t){return t&&/^(H[1-6])$/.test(t.nodeName)},KI=function(t){return VI(t)&&!PI(t)},XI=function(t){return GI(t)&&KI(t)},YI=function(t){return GI(t)?parseInt(t.nodeName.substr(1),10):0},JI=function(t){var e=WI(t),n=function(){t.id=e};return FI("header",jI(t),"#"+e,YI(t),n)},QI=function(t){var e=t.id||t.name,n=jI(t);return FI("anchor",n||"#"+e,"#"+e,0,p)},ZI=function(t){return $(Y(t,XI),JI)},tP=function(t){return $(Y(t,$I),QI)},eP=function(t){var e=UI("h1,h2,h3,h4,h5,h6,a:not([href])",t);return e},nP=function(t){return LI(t.title).length>0},rP=function(t){var e=eP(t);return Y(ZI(e).concat(tP(e)),nP)},oP={find:rP},iP="tinymce-url-history",uP=5,aP=function(t){return i(t)&&/^https?/.test(t)},cP=function(t){return a(t)&&t.length<=uP&&ot(t,aP)},sP=function(t){return u(t)&&kt(t,(function(t){return!cP(t)})).isNone()},lP=function(){var t,e=OE.getItem(iP);if(null===e)return{};try{t=JSON.parse(e)}catch(n){if(n instanceof SyntaxError)return console.log("Local storage "+iP+" was not valid JSON",n),{};throw n}return sP(t)?t:(console.log("Local storage "+iP+" was not valid format",t),{})},fP=function(t){if(!sP(t))throw new Error("Bad format for history:\n"+JSON.stringify(t));OE.setItem(iP,JSON.stringify(t))},dP=function(t){var e=lP();return Ot(e,t).getOr([])},mP=function(t,e){if(aP(t)){var n=lP(),r=Ot(n,e).getOr([]),o=Y(r,(function(e){return e!==t}));n[e]=[t].concat(o).slice(0,uP),fP(n)}},gP=function(t){return!!t},hP=function(t){return bt(QN.makeMap(t,/[, ]/),gP)},pP=function(t){return L.from(JT(t)).filter(m)},vP=function(t){var e=L.some(QT(t)).filter(gP),n=L.some(ZT(t)).filter(gP),r=e.or(n).map(hP);return pP(t).fold(O,(function(t){return r.fold(E,(function(t){return ht(t).length>0&&t}))}))},bP=function(t,e){var n=vP(t);return s(n)?n?pP(t):L.none():n[e]?pP(t):L.none()},yP=function(t,e){return bP(t,e).map((function(n){return function(r){return tD.nu((function(o){var a=function(t,e){if(!i(t))throw new Error("Expected value to be string");if(void 0!==e&&!u(e))throw new Error("Expected meta to be a object");var n={value:t,meta:e};o(n)},c=A({filetype:e,fieldname:r.fieldname},L.from(r.meta).getOr({}));n.call(t,a,r.value,c)}))}}))},wP=function(t){return L.from(t).filter(i).getOrUndefined()},xP=function(t){return tO(t)?L.none():L.some({targets:oP.find(t.getBody()),anchorTop:wP(eO(t)),anchorBottom:wP(nO(t))})},CP=function(t){return L.from(rO(t))},SP=function(t){return{getHistory:dP,addToHistory:mP,getLinkInformation:function(){return xP(t)},getValidationHandler:function(){return CP(t)},getUrlPicker:function(e){return yP(t,e)}}},kP=function(t,e,n){var r=ou(!1),o=SI(e),i={shared:{providers:{icons:function(){return e.ui.registry.getAll().icons},menuItems:function(){return e.ui.registry.getAll().menuItems},translate:TC.translate,isDisabled:function(){return e.mode.isReadOnly()||e.ui.isDisabled()},getSetting:e.getParam.bind(e)},interpreter:function(t){return sI(t,i)},anchors:hI(e,n,o.isPositionedAtTop),header:o,getSink:function(){return ro.value(t)}},urlinput:SP(e),styleselect:zI(e),colorinput:wI(e),dialog:CI(e),isContextMenuOpen:function(){return r.get()},setContextMenuState:function(t){return r.set(t)}};return i},TP=function(t,e,n){var r=function(t,r){G([e,n],(function(e){e.broadcastEvent(t,r)}))},o=function(t,r){G([e,n],(function(e){e.broadcastOn([t],r)}))},i=function(t){return o(yh(),{target:t.target})},u=Cf(),a=ud(u,"touchstart",i),c=ud(u,"touchmove",(function(t){return r(ca(),t)})),s=ud(u,"touchend",(function(t){return r(sa(),t)})),l=ud(u,"mousedown",i),f=ud(u,"mouseup",(function(t){0===t.raw.button&&o(xh(),{target:t.target})})),d=function(t){return o(yh(),{target:ee.fromDom(t.target)})},m=function(t){0===t.button&&o(xh(),{target:ee.fromDom(t.target)})},g=function(){G(t.editorManager.get(),(function(e){t!==e&&e.fire("DismissPopups",{relatedTarget:t})}))},h=function(t){return r(la(),cd(t))},p=function(t){o(wh(),{}),r(fa(),cd(t))},v=function(){return o(wh(),{})},b=function(e){e.state&&o(yh(),{target:ee.fromDom(t.getContainer())})},y=function(t){o(yh(),{target:ee.fromDom(t.relatedTarget.getContainer())})};t.on("PostRender",(function(){t.on("click",d),t.on("tap",d),t.on("mouseup",m),t.on("mousedown",g),t.on("ScrollWindow",h),t.on("ResizeWindow",p),t.on("ResizeEditor",v),t.on("AfterProgressState",b),t.on("DismissPopups",y)})),t.on("remove",(function(){t.off("click",d),t.off("tap",d),t.off("mouseup",m),t.off("mousedown",g),t.off("ScrollWindow",h),t.off("ResizeWindow",p),t.off("ResizeEditor",v),t.off("AfterProgressState",b),t.off("DismissPopups",y),l.unbind(),a.unbind(),c.unbind(),s.unbind(),f.unbind()})),t.on("detach",(function(){Qg(e),Qg(n),e.destroy(),n.destroy()}))},OP=nv,EP=Ip,_P=w([Ki("shell",!1),Ai("makeItem"),Ki("setupItem",p),op.field("listBehaviours",[Pw])]),AP=function(){return{behaviours:mf([Pw.config({})])}},DP=Bp({name:"items",overrides:AP}),MP=w([DP]),RP=w("CustomList"),NP=function(t,e,n,r){var o=function(e,n){u(e).fold((function(){throw 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(r){var o=Pw.contents(r),i=n.length,u=i-o.length,a=u>0?W(u,(function(){return t.makeItem()})):[],c=o.slice(i);G(c,(function(t){return Pw.remove(r,t)})),G(a,(function(t){return Pw.append(r,t)}));var s=Pw.contents(r);G(s,(function(r,o){t.setupItem(e,r,n[o],o)}))}))},i=t.shell?{behaviours:[Pw.config({})],components:[]}:{behaviours:[],components:e},u=function(e){return t.shell?L.some(e):Kp(e,t,"items")};return{uid:t.uid,dom:t.dom,components:i.components,behaviours:rp(t.listBehaviours,i.behaviours),apis:{setItems:o}}},zP=mv({name:RP(),configFields:_P(),partFields:MP(),factory:NP,apis:{setItems:function(t,e,n){t.setItems(e,n)}}}),BP=w([Ai("dom"),Ki("shell",!0),ep("toolbarBehaviours",[Pw])]),LP=function(){return{behaviours:mf([Pw.config({})])}},HP=w([Bp({name:"groups",overrides:LP})]),IP=function(t,e,n,r){var o=function(t,e){i(t).fold((function(){throw 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){Pw.set(t,e)}))},i=function(e){return t.shell?L.some(e):Kp(e,t,"groups")},u=t.shell?{behaviours:[Pw.config({})],components:[]}:{behaviours:[],components:e};return{uid:t.uid,dom:t.dom,components:u.components,behaviours:rp(t.toolbarBehaviours,u.behaviours),apis:{setGroups:o},domModification:{attributes:{role:"group"}}}},PP=mv({name:"Toolbar",configFields:BP(),partFields:HP(),factory:IP,apis:{setGroups:function(t,e,n){t.setGroups(e,n)}}}),FP=p,VP=O,UP=w([]),jP=Object.freeze({__proto__:null,setup:FP,isDocked:VP,getBehaviours:UP}),WP=function(t){var e=At(Zn(t,"position"),"fixed"),n=e?L.none():yn(t);return n.orThunk((function(){var e=ee.fromTag("span");return vn(t).bind((function(t){Dr(t,e);var n=yn(e);return Br(e),n}))}))},qP=function(t){return WP(t).map(mr).getOrThunk((function(){return lr(0,0)}))},$P=uu.generate([{static:[]},{absolute:["positionCss"]},{fixed:["positionCss"]}]),GP=function(t,e){var n=t.element;is(n,e.transitionClass),as(n,e.fadeOutClass),is(n,e.fadeInClass),e.onShow(t)},KP=function(t,e){var n=t.element;is(n,e.transitionClass),as(n,e.fadeInClass),is(n,e.fadeOutClass),e.onHide(t)},XP=function(t,e){return t.ye.y},YP=function(t,e){return t.y>=e.y},JP=function(t,e){return t.bottom<=e.bottom},QP=function(t,e,n){return ot(t,(function(t){switch(t){case"bottom":return JP(e,n);case"top":return YP(e,n)}}))},ZP=function(t,e){return e.getInitialPos().map((function(e){return Yr(e.bounds.x,e.bounds.y,vr(t),ur(t))}))},tF=function(t,e,n){n.setInitialPos({style:tr(t),position:Jn(t,"position")||"static",bounds:e})},eF=function(t,e,n){return n.getInitialPos().bind((function(r){switch(n.clearInitialPos(),r.position){case"static":return L.some($P.static());case"absolute":var o=WP(t).map(Jr).getOrThunk((function(){return Jr(Hn())}));return L.some($P.absolute(Af("absolute",Ot(r.style,"left").map((function(t){return e.x-o.x})),Ot(r.style,"top").map((function(t){return e.y-o.y})),Ot(r.style,"right").map((function(t){return o.right-e.right})),Ot(r.style,"bottom").map((function(t){return o.bottom-e.bottom})))));default:return L.none()}}))},nF=function(t,e,n){return ZP(t,n).filter((function(t){return QP(n.getModes(),t,e)})).bind((function(e){return eF(t,e,n)}))},rF=function(t,e,n){var r=Jr(t);if(QP(n.getModes(),r,e))return L.none();tF(t,r,n);var o=Zr(),i=r.x-o.x,u=e.y-o.y,a=o.bottom-e.bottom,c=r.y<=e.y;return L.some($P.fixed(Af("fixed",L.some(i),c?L.some(u):L.none(),L.none(),c?L.none():L.some(a))))},oF=function(t,e,n){var r=t.element,o=At(Zn(r,"position"),"fixed");return o?nF(r,e,n):rF(r,e,n)},iF=function(t,e){var n=t.element;return ZP(n,e).bind((function(t){return eF(n,t,e)}))},uF=function(t,e,n){n.setDocked(!1),G(["left","right","top","bottom","position"],(function(e){return nr(t.element,e)})),e.onUndocked(t)},aF=function(t,e,n,r){var o="fixed"===r.position;n.setDocked(o),Mf(t.element,r);var i=o?e.onDocked:e.onUndocked;i(t)},cF=function(t,e,n,r,o){void 0===o&&(o=!1),e.contextual.each((function(e){e.lazyContext(t).each((function(i){var u=XP(i,r);if(u!==n.isVisible())if(n.setVisible(u),o&&!u)ss(t.element,[e.fadeOutClass]),e.onHide(t);else{var a=u?GP:KP;a(t,e)}}))}))},sF=function(t,e,n){var r=e.lazyViewport(t),o=n.isDocked();o&&cF(t,e,n,r),oF(t,r,n).each((function(o){o.fold((function(){return uF(t,e,n)}),(function(r){return aF(t,e,n,r)}),(function(o){cF(t,e,n,r,!0),aF(t,e,n,o)}))}))},lF=function(t,e,n){var r=t.element;n.setDocked(!1),iF(t,n).each((function(r){r.fold((function(){return uF(t,e,n)}),(function(r){return aF(t,e,n,r)}),p)})),n.setVisible(!0),e.contextual.each((function(e){ls(r,[e.fadeInClass,e.fadeOutClass,e.transitionClass]),e.onShow(t)})),fF(t,e,n)},fF=function(t,e,n){t.getSystem().isConnected()&&sF(t,e,n)},dF=function(t,e,n){n.isDocked()&&lF(t,e,n)},mF=function(t,e,n){return n.isDocked()},gF=function(t,e,n,r){return n.setModes(r)},hF=function(t,e,n){return n.getModes()},pF=Object.freeze({__proto__:null,refresh:fF,reset:dF,isDocked:mF,getModes:hF,setModes:gF}),vF=function(t,e){return _a([Va($u(),(function(n,r){t.contextual.each((function(t){if(cs(n.element,t.transitionClass)){ls(n.element,[t.transitionClass,t.fadeInClass]);var o=e.isVisible()?t.onShown:t.onHidden;o(n)}r.stop()}))})),Ra(la(),(function(n,r){fF(n,t,e)})),Ra(fa(),(function(n,r){dF(n,t,e)}))])},bF=Object.freeze({__proto__:null,events:vF}),yF=[$i("contextual",[Ri("fadeInClass"),Ri("fadeOutClass"),Ri("transitionClass"),Bi("lazyContext"),al("onShow"),al("onShown"),al("onHide"),al("onHidden")]),tu("lazyViewport",Zr),nu("modes",["top","bottom"],si),al("onDocked"),al("onUndocked")],wF=function(t){var e=ou(!1),n=ou(!0),r=od(),o=ou(t.modes),i=function(){return"docked: "+e.get()+", visible: "+n.get()+", modes: "+o.get().join(",")};return Tc({isDocked:e.get,setDocked:e.set,getInitialPos:r.get,setInitialPos:r.set,clearInitialPos:r.clear,isVisible:n.get,setVisible:n.set,getModes:o.get,setModes:o.set,readState:i})},xF=Object.freeze({__proto__:null,init:wF}),CF=hf({fields:yF,name:"docking",active:bF,apis:pF,state:xF}),SF=w(oc("toolbar-height-change")),kF={fadeInClass:"tox-editor-dock-fadein",fadeOutClass:"tox-editor-dock-fadeout",transitionClass:"tox-editor-dock-transition"},TF="tox-tinymce--toolbar-sticky-on",OF="tox-tinymce--toolbar-sticky-off",EF=function(t,e){var n=mn(e),r=n.dom.defaultView.innerHeight,o=Hr(n),i=ee.fromDom(t.elm),u=Qr(i),a=ur(i),c=u.y,s=c+a,l=mr(e),f=ur(e),d=l.top,m=d+f,g=Math.abs(d-o.top)<2,h=Math.abs(m-(o.top+r))<2;if(g&&cd){var p=c-r+a+f;Ir(o.left,p,n)}},_F=function(t,e){return U(CF.getModes(t),e)},AF=function(t){var e=function(t){return ar(t)+(parseInt(Jn(t,"margin-top"),10)||0)+(parseInt(Jn(t,"margin-bottom"),10)||0)},n=t.element;vn(n).each((function(r){var o="padding-"+CF.getModes(t)[0];if(CF.isDocked(t)){var i=vr(r);Kn(n,"width",i+"px"),Kn(r,o,e(n)+"px")}else nr(n,"width"),nr(r,o)}))},DF=function(t,e){e?(as(t,kF.fadeOutClass),ss(t,[kF.transitionClass,kF.fadeInClass])):(as(t,kF.fadeInClass),ss(t,[kF.fadeOutClass,kF.transitionClass]))},MF=function(t,e){var n=ee.fromDom(t.getContainer());e?(is(n,TF),as(n,OF)):(is(n,OF),as(n,TF))},RF=function(t,e){var n=mn(e);Of(n).filter((function(t){return!sn(e,t)})).filter((function(e){return sn(e,ee.fromDom(n.dom.body))||dn(t,e)})).each((function(){return Sf(e)}))},NF=function(t,e){return Ef(t).orThunk((function(){return e().toOptional().bind((function(t){return Ef(t.element)}))}))},zF=function(t,e,n){t.inline||(e.header.isPositionedAtTop()||t.on("ResizeEditor",(function(){n().each(CF.reset)})),t.on("ResizeWindow ResizeEditor",(function(){n().each(AF)})),t.on("SkinLoaded",(function(){n().each((function(t){CF.isDocked(t)?CF.reset(t):CF.refresh(t)}))})),t.on("FullscreenStateChanged",(function(){n().each(CF.reset)}))),t.on("AfterScrollIntoView",(function(t){n().each((function(e){CF.refresh(e);var n=e.element;Jb(n)&&EF(t,n)}))})),t.on("PostRender",(function(){MF(t,!1)}))},BF=function(t){return t().map(CF.isDocked).getOr(!1)},LF=function(){var t;return[yf.config({channels:(t={},t[SF()]={onReceive:AF},t)})]},HF=function(t,e){var n=od(),r=e.getSink,o=function(t){r().each((function(e){return t(e.element)}))},i=function(e){t.inline||AF(e),MF(t,CF.isDocked(e)),e.getSystem().broadcastOn([wh()],{}),r().each((function(t){return t.getSystem().broadcastOn([wh()],{})}))},u=t.inline?[]:LF();return M([Yw.config({}),CF.config({contextual:A({lazyContext:function(e){var n=ar(e.element),r=t.inline?t.getContentAreaContainer():t.getContainer(),o=Jr(ee.fromDom(r)),i=o.height-n,u=o.y+(_F(e,"top")?0:n);return L.some(Yr(o.x,u,o.width,i))},onShow:function(){o((function(t){return DF(t,!0)}))},onShown:function(t){o((function(t){return ls(t,[kF.transitionClass,kF.fadeInClass])})),n.get().each((function(e){RF(t.element,e),n.clear()}))},onHide:function(t){NF(t.element,r).fold(n.clear,n.set),o((function(t){return DF(t,!1)}))},onHidden:function(){o((function(t){return ls(t,[kF.transitionClass])}))}},kF),lazyViewport:function(e){var n=Zr(),r=$T(t),o=n.y+(_F(e,"top")?r:0),i=n.height-(_F(e,"bottom")?r:0);return Yr(n.x,o,n.width,i)},modes:[e.header.getDockingMode()],onDocked:i,onUndocked:i})],u,!0)},IF=Object.freeze({__proto__:null,setup:zF,isDocked:BF,getBehaviours:HF}),PF=function(t){var e=t.editor,n=t.sticky?HF:UP;return{uid:t.uid,dom:t.dom,components:t.components,behaviours:mf(n(e,t.sharedBackstage))}},FF=ti([Ri("type"),Di("items",ni([ii([Ri("name"),Pi("items",si)]),si]))].concat(kS)),VF=function(t){return wi("GroupToolbarButton",FF,t)},UF=[ji("text"),ji("tooltip"),ji("icon"),Bi("fetch"),tu("onSetup",(function(){return p}))],jF=ti(M([Ri("type")],UF,!0)),WF=function(t){return wi("menubutton",jF,t)},qF=ti([Ri("type"),ji("tooltip"),ji("icon"),ji("text"),Wi("select"),Bi("fetch"),tu("onSetup",(function(){return p})),Qi("presets","normal",["normal","color","listpreview"]),Ki("columns",1),Bi("onAction"),Bi("onItemAction")]),$F=function(t){return wi("SplitButton",qF,t)},GF=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=WF(n).mapError((function(t){return Si(t)})).getOrDie();return GB(r,"tox-mbtn",e.backstage,L.some("menuitem"))}));Pw.set(t,r)},r={focus:Aw.focusIn,setMenus:n};return{uid:t.uid,dom:t.dom,components:[],behaviours:mf([Pw.config({}),Vw("menubar-events",[Ua((function(e){t.onSetup(e)})),Ra(Hu(),(function(t,e){Is(t.element,".tox-mbtn--active").each((function(n){Ps(e.event.target,".tox-mbtn").each((function(e){sn(n,e)||t.getSystem().getByDom(n).each((function(n){t.getSystem().getByDom(e).each((function(t){HD.expand(t),HD.close(n),Yw.focus(t)}))}))}))}))})),Ra(pa(),(function(t,e){e.event.prevFocus.bind((function(e){return t.getSystem().getByDom(e).toOptional()})).each((function(n){e.event.newFocus.bind((function(e){return t.getSystem().getByDom(e).toOptional()})).each((function(t){HD.isOpen(n)&&(HD.expand(t),HD.close(n))}))}))}))]),Aw.config({mode:"flow",selector:".tox-mbtn",onEscape:function(e){return t.onEscape(e),L.some(!0)}}),yA.config({})]),apis:r,domModification:{attributes:{role:"menubar"}}}},KF=dv({factory:GF,name:"silver.Menubar",configFields:[Ai("dom"),Ai("uid"),Ai("onEscape"),Ai("backstage"),Ki("onSetup",p)],apis:{focus:function(t,e){t.focus(e)},setMenus:function(t,e,n){t.setMenus(e,n)}}}),XF=function(t,e){return e.getAnimationRoot.fold((function(){return t.element}),(function(e){return e(t)}))},YF=function(t){return t.dimension.property},JF=function(t,e){return t.dimension.getDimension(e)},QF=function(t,e){var n=XF(t,e);ls(n,[e.shrinkingClass,e.growingClass])},ZF=function(t,e){as(t.element,e.openClass),is(t.element,e.closedClass),Kn(t.element,YF(e),"0px"),rr(t.element)},tV=function(t,e){as(t.element,e.closedClass),is(t.element,e.openClass),nr(t.element,YF(e))},eV=function(t,e,n,r){n.setCollapsed(),Kn(t.element,YF(e),JF(e,t.element)),rr(t.element),QF(t,e),ZF(t,e),e.onStartShrink(t),e.onShrunk(t)},nV=function(t,e,n,r){var o=r.getOrThunk((function(){return JF(e,t.element)}));n.setCollapsed(),Kn(t.element,YF(e),o),rr(t.element);var i=XF(t,e);as(i,e.growingClass),is(i,e.shrinkingClass),ZF(t,e),e.onStartShrink(t)},rV=function(t,e,n){var r=JF(e,t.element),o="0px"===r?eV:nV;o(t,e,n,L.some(r))},oV=function(t,e,n){var r=XF(t,e),o=cs(r,e.shrinkingClass),i=JF(e,t.element);tV(t,e);var u=JF(e,t.element),a=function(){Kn(t.element,YF(e),i),rr(t.element)},c=function(){ZF(t,e)},s=o?a:c;s(),as(r,e.shrinkingClass),is(r,e.growingClass),tV(t,e),Kn(t.element,YF(e),u),n.setExpanded(),e.onStartGrow(t)},iV=function(t,e,n){if(n.isExpanded()){nr(t.element,YF(e));var r=JF(e,t.element);Kn(t.element,YF(e),r)}},uV=function(t,e,n){n.isExpanded()||oV(t,e,n)},aV=function(t,e,n){n.isExpanded()&&rV(t,e,n)},cV=function(t,e,n){n.isExpanded()&&eV(t,e,n)},sV=function(t,e,n){return n.isExpanded()},lV=function(t,e,n){return n.isCollapsed()},fV=function(t,e,n){var r=XF(t,e);return!0===cs(r,e.growingClass)},dV=function(t,e,n){var r=XF(t,e);return!0===cs(r,e.shrinkingClass)},mV=function(t,e,n){return fV(t,e)||dV(t,e)},gV=function(t,e,n){var r=n.isExpanded()?rV:oV;r(t,e,n)},hV=Object.freeze({__proto__:null,refresh:iV,grow:uV,shrink:aV,immediateShrink:cV,hasGrown:sV,hasShrunk:lV,isGrowing:fV,isShrinking:dV,isTransitioning:mV,toggleGrow:gV,disableTransitions:QF}),pV=function(t,e,n){var r=e.expanded;return Dc(r?{classes:[e.openClass],styles:{}}:{classes:[e.closedClass],styles:mu(e.dimension.property,"0px")})},vV=function(t,e){return _a([Va($u(),(function(n,r){var o=r.event.raw;if(o.propertyName===t.dimension.property){QF(n,t),e.isExpanded()&&nr(n.element,t.dimension.property);var i=e.isExpanded()?t.onGrown:t.onShrunk;i(n)}}))])},bV=Object.freeze({__proto__:null,exhibit:pV,events:vV}),yV=[Ai("closedClass"),Ai("openClass"),Ai("shrinkingClass"),Ai("growingClass"),Fi("getAnimationRoot"),al("onShrunk"),al("onStartShrink"),al("onGrown"),al("onStartGrow"),Ki("expanded",!1),Di("dimension",ki("property",{width:[fl("property","width"),fl("getDimension",(function(t){return vr(t)+"px"}))],height:[fl("property","height"),fl("getDimension",(function(t){return ur(t)+"px"}))]}))],wV=function(t){var e=ou(t.expanded),n=function(){return"expanded: "+e.get()};return Tc({isExpanded:function(){return!0===e.get()},isCollapsed:function(){return!1===e.get()},setCollapsed:S(e.set,!1),setExpanded:S(e.set,!0),readState:n})},xV=Object.freeze({__proto__:null,init:wV}),CV=hf({fields:yV,name:"sliding",active:bV,apis:hV,state:xV}),SV="container",kV=[ep("slotBehaviours",[])],TV=function(t){return""},OV=function(t){var e=function(){var t=[],e=function(e,n){return t.push(e),jp(SV,TV(e),n)};return{slot:e,record:w(t)}}(),n=t(e),r=e.record(),o=$(r,(function(t){return Np({name:t,pname:TV(t)})}));return uv(SV,kV,o,EV,n)},EV=function(t,e){var n=function(e){return Qp(t)},r=function(e,n){return Kp(e,t,n)},o=function(e,n){return function(r,o){return Kp(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"!==Un(t.element,"aria-hidden")},a=function(t,e){if(!u(t)){var n=t.element;nr(n,"display"),qn(n,"aria-hidden"),Sa(t,va(),{name:e,visible:!0})}},c=function(t,e){if(u(t)){var n=t.element;Kn(n,"display","none"),Fn(n,"aria-hidden","true"),Sa(t,va(),{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:np(t.slotBehaviours),apis:g}},_V=bt({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 Sc(t)})),AV=A(A({},_V),{sketch:OV}),DV=ti([ji("icon"),ji("tooltip"),tu("onShow",p),tu("onHide",p),tu("onSetup",(function(){return p}))]),MV=function(t){return wi("sidebar",DV,t)},RV=function(t){var e=t.ui.registry.getAll().sidebars;G(ht(e),(function(n){var r=e[n],o=function(){return At(L.from(t.queryCommandValue("ToggleSidebar")),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)}}})}))},NV=function(t){return{element:function(){return t.element.dom}}},zV=function(t,e){var n=$(ht(e),(function(t){var n=e[t],r=xi(MV(n));return{name:t,getApi:NV,onSetup:r.onSetup,onShow:r.onShow,onHide:r.onHide}}));return $(n,(function(e){var r=ou(p);return t.slot(e.name,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:Qk.unnamedEvents([hO(e,r),pO(e,r),Ra(va(),(function(t,e){var r=e.event,o=tt(n,(function(t){return t.name===r.name}));o.each((function(e){var n=r.visible?e.onShow:e.onHide;n(e.getApi(t))}))}))])})}))},BV=function(t){return AV.sketch((function(e){return{dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:zV(e,t),slotBehaviours:Qk.unnamedEvents([Ua((function(t){return AV.hideAllSlots(t)}))])}}))},LV=function(t,e){var n=bv.getCurrent(t);n.each((function(t){return Pw.set(t,[BV(e)])}))},HV=function(t,e){var n=bv.getCurrent(t);n.each((function(t){var n=bv.getCurrent(t);n.each((function(n){CV.hasGrown(t)?AV.isShowing(n,e)?CV.shrink(t):(AV.hideAllSlots(n),AV.showSlot(n,e)):(AV.hideAllSlots(n),AV.showSlot(n,e),CV.grow(t))}))}))},IV=function(t){var e=bv.getCurrent(t);return e.bind((function(t){var e=CV.isGrowing(t)||CV.hasGrown(t);if(e){var n=bv.getCurrent(t);return n.bind((function(t){return tt(AV.getSlotNames(t),(function(e){return AV.isShowing(t,e)}))}))}return L.none()}))},PV=oc("FixSizeEvent"),FV=oc("AutoSizeEvent"),VV=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:mf([yA.config({}),Yw.config({}),CV.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=bv.getCurrent(t);e.each(AV.hideAllSlots),Ca(t,FV)},onGrown:function(t){Ca(t,FV)},onStartGrow:function(t){Sa(t,PV,{width:Zn(t.element,"width").getOr("")})},onStartShrink:function(t){Sa(t,PV,{width:vr(t.element)+"px"})}}),Pw.config({}),bv.config({find:function(t){var e=Pw.contents(t);return ft(e)}})])}],behaviours:mf([WN.childAt(0),Vw("sidebar-sliding-events",[Ra(PV,(function(t,e){Kn(t.element,"width",e.event.width)})),Ra(FV,(function(t,e){nr(t.element,"width")}))])])}},UV=function(t,e,n,r){Fn(t.element,"aria-busy",!0);var o=e.getRoot(t).getOr(t),i=mf([Aw.config({mode:"special",onTab:function(){return L.some(!0)},onShiftTab:function(){return L.some(!0)}}),Yw.config({})]),u=r(o,i),a=o.getSystem().build(u);Pw.append(o,_s(a)),a.hasConfigured(Aw)&&e.focus&&Aw.focusIn(a),n.isBlocked()||e.onBlock(t),n.blockWith((function(){return Pw.remove(o,a)}))},jV=function(t,e,n){qn(t.element,"aria-busy"),n.isBlocked()&&e.onUnblock(t),n.clear()},WV=Object.freeze({__proto__:null,block:UV,unblock:jV}),qV=[tu("getRoot",L.none),Zi("focus",!0),al("onBlock"),al("onUnblock")],$V=function(){var t=ed(),e=function(e){t.set({destroy:e})};return Tc({readState:t.isSet,blockWith:e,clear:t.clear,isBlocked:t.isSet})},GV=Object.freeze({__proto__:null,init:$V}),KV=hf({fields:qV,name:"blocking",apis:WV,state:GV}),XV=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:A(A({},t),(n={},n[e.name]=e.value,n))}),{})},YV=function(t){return Array.prototype.slice.call(t.dom.classList,0)},JV=function(t){var e=ee.fromHtml(t),n=xn(e),r=XV(e),o=YV(e),i=0===n.length?{}:{innerHtml:Ga(e)};return A({tag:ae(e),classes:o,attributes:r},i)},QV=function(t){return function(e,n){return{dom:{tag:"div",attributes:{"aria-label":t.translate("Loading..."),tabindex:"0"},classes:["tox-throbber__busy-spinner"]},components:[{dom:JV('
')}]}}},ZV=function(t){return bv.getCurrent(t).each((function(t){return Sf(t.element)}))},tU=function(t,e){var n="tabindex",r="data-mce-"+n;L.from(t.iframeElement).map(ee.fromDom).each((function(t){e?(jn(t,n).each((function(e){return Fn(t,r,e)})),Fn(t,n,-1)):(qn(t,n),jn(t,r).each((function(e){Fn(t,n,e),qn(t,r)})))}))},eU=function(t,e,n,r){var o=e.element;if(tU(t,n),n)KV.block(e,QV(r)),nr(o,"display"),qn(o,"aria-hidden"),t.hasFocus()&&ZV(e);else{var i=bv.getCurrent(e).exists((function(t){return Tf(t.element)}));KV.unblock(e),Kn(o,"display","none"),Fn(o,"aria-hidden","true"),i&&t.focus()}},nU=function(t){return{uid:t.uid,dom:{tag:"div",attributes:{"aria-hidden":"true"},classes:["tox-throbber"],styles:{display:"none"}},behaviours:mf([Pw.config({}),KV.config({focus:!1}),bv.config({find:function(t){return ft(t.components())}})]),components:[]}},rU=function(t){return"focusin"===t.type},oU=function(t){if(rU(t)){var e=t.composed?ft(t.composedPath()):L.from(t.target);return e.map(ee.fromDom).filter(le).exists((function(t){return cs(t,"mce-pastebin")}))}return!1},iU=function(t,e,n){var r=ou(!1),o=od(),i=function(n){r.get()&&!oU(n)&&(n.preventDefault(),ZV(e()),t.editorManager.setActive(t))};t.inline||t.on("PreInit",(function(){t.dom.bind(t.getWin(),"focusin",i),t.on("BeforeExecCommand",(function(t){"mcefocus"===t.command.toLowerCase()&&!0!==t.value&&i(t)}))}));var u=function(o){o!==r.get()&&(r.set(o),eU(t,e(),o,n.providers),t.fire("AfterProgressState",{state:o}))};t.on("ProgressState",(function(e){if(o.on(xC.clearTimeout),g(e.time)){var n=xC.setEditorTimeout(t,(function(){return u(e.state)}),e.time);o.set(n)}else u(e.state),o.clear()}))},uU=function(t,e){var n={len:0,list:[]},r=Q(t,(function(t,n){var r=e(n,t.len);return r.fold(w(t),(function(e){return{len:e.finish,list:t.list.concat([e])}}))}),n);return r.list},aU=function(t,e,n){return{within:t,extra:e,withinWidth:n}},cU=function(t,e,n){var r=uU(t,(function(t,e){var r=n(t);return L.some({element:t,start:e,finish:e+r,width:r})})),o=Y(r,(function(t){return t.finish<=e})),i=J(o,(function(t,e){return t+e.width}),0),u=r.slice(o.length);return{within:o,extra:u,withinWidth:i}},sU=function(t){return $(t,(function(t){return t.element}))},lU=function(t,e,n){var r=sU(t.concat(e));return aU(r,[],n)},fU=function(t,e,n,r){var o=sU(t).concat([n]);return aU(o,sU(e),r)},dU=function(t,e,n){return aU(sU(t),[],n)},mU=function(t,e,n){var r=cU(e,t,n);return 0===r.extra.length?L.some(r):L.none()},gU=function(t,e,n,r){var o=mU(t,e,n).getOrThunk((function(){return cU(e,t-n(r),n)})),i=o.within,u=o.extra,a=o.withinWidth;return 1===u.length&&u[0].width<=n(r)?lU(i,u,a):u.length>=1?fU(i,u,r,a):dU(i,u,a)},hU=function(t,e){var n=$(e,(function(t){return _s(t)}));PP.setGroups(t,n)},pU=function(t){return gt(t,(function(t){return Ef(t.element).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))}))},vU=function(t,e,n){var r=e.builtGroups.get();if(0!==r.length){var o=Xp(t,e,"primary"),i=bD.getCoupled(t,"overflowGroup");Kn(o.element,"visibility","hidden");var u=r.concat([i]),a=pU(u);n([]),hU(o,u);var c=vr(o.element),s=gU(c,e.builtGroups.get(),(function(t){return vr(t.element)}),i);0===s.extra.length?(Pw.remove(o,i),n([])):(hU(o,s.within),n(s.extra)),nr(o.element,"visibility"),rr(o.element),a.each(Yw.focus)}},bU=w([ep("splitToolbarBehaviours",[bD]),Ei("builtGroups",(function(){return ou([])}))]),yU=w([il(["overflowToggledClass"]),Wi("getOverflowBounds"),Ai("lazySink"),Ei("overflowGroups",(function(){return ou([])}))].concat(bU())),wU=w([Np({factory:PP,schema:BP(),name:"primary"}),zp({schema:BP(),name:"overflow"}),zp({name:"overflow-button"}),zp({name:"overflow-group"})]),xU=w((function(t,e){yr(t,Math.floor(e))})),CU=w([il(["toggledClass"]),Ai("lazySink"),Bi("fetch"),Wi("getBounds"),$i("fireDismissalEventInstead",[Ki("event",ga())]),Pd()]),SU=w([zp({name:"button",overrides:function(t){return{dom:{attributes:{"aria-haspopup":"true"}},buttonBehaviours:mf([hx.config({toggleClass:t.markers.toggledClass,aria:{mode:"expanded"},toggleOnExecute:!1})])}}}),zp({factory:PP,schema:BP(),name:"toolbar",overrides:function(t){return{toolbarBehaviours:mf([Aw.config({mode:"cyclic",onEscape:function(e){return Kp(e,t,"button").each(Yw.focus),L.none()}})])}}})]),kU=function(t,e){var n=bD.getCoupled(t,"toolbarSandbox");bh.isOpen(n)?bh.close(n):bh.open(n,e.toolbar())},TU=function(t,e,n,r){var o=n.getBounds.map((function(t){return t()})),i=n.lazySink(t).getOrDie();Ig.positionWithinBounds(i,e,{anchor:{type:"hotspot",hotspot:t,layouts:r,overrides:{maxWidthFunction:xU()}}},o)},OU=function(t,e,n,r,o){PP.setGroups(e,o),TU(t,e,n,r),hx.on(t)},EU=function(t,e,n){var r=Vs(),o=function(o,i){n.fetch().get((function(o){OU(t,i,n,e.layouts,o),r.link(t.element),Aw.focusIn(i)}))},i=function(){hx.off(t),Yw.focus(t),r.unlink(t.element)};return{dom:{tag:"div",attributes:{id:r.id}},behaviours:mf([Aw.config({mode:"special",onEscape:function(t){return bh.close(t),L.some(!0)}}),bh.config({onOpen:o,onClose:i,isPartOf:function(e,n,r){return js(n,r)||js(t,r)},getAttachPoint:function(){return n.lazySink(t).getOrDie()}}),yf.config({channels:A(A({},Sh(A({isExtraPart:O},n.fireDismissalEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})))),Th({doReposition:function(){bh.getState(bD.getCoupled(t,"toolbarSandbox")).each((function(r){TU(t,r,n,e.layouts)}))}}))})])}},_U=function(t,e,n,r){return A(A({},SC.sketch(A(A({},r.button()),{action:function(t){kU(t,r)},buttonBehaviours:op.augment({dump:r.button().buttonBehaviours},[bD.config({others:{toolbarSandbox:function(e){return EU(e,n,t)}}})])}))),{apis:{setGroups:function(e,r){bh.getState(bD.getCoupled(e,"toolbarSandbox")).each((function(o){OU(e,o,t,n.layouts,r)}))},reposition:function(e){bh.getState(bD.getCoupled(e,"toolbarSandbox")).each((function(r){TU(e,r,t,n.layouts)}))},toggle:function(t){kU(t,r)},getToolbar:function(t){return bh.getState(bD.getCoupled(t,"toolbarSandbox"))},isOpen:function(t){return bh.isOpen(bD.getCoupled(t,"toolbarSandbox"))}}})},AU=mv({name:"FloatingToolbarButton",factory:_U,configFields:CU(),partFields:SU(),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)},isOpen:function(t,e){return t.isOpen(e)}}}),DU=w([Ai("items"),il(["itemSelector"]),ep("tgroupBehaviours",[Aw])]),MU=w([Lp({name:"items",unit:"item"})]),RU=function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,behaviours:rp(t.tgroupBehaviours,[Aw.config({mode:"flow",selector:t.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}},NU=mv({name:"ToolbarGroup",configFields:DU(),partFields:MU(),factory:RU}),zU=function(t){return $(t,(function(t){return _s(t)}))},BU=function(t,e,n){vU(t,n,(function(r){n.overflowGroups.set(r),e.getOpt(t).each((function(t){AU.setGroups(t,zU(r))}))}))},LU=function(t,e,n,r){var o=kC(AU.sketch({fetch:function(){return tD.nu((function(e){e(zU(t.overflowGroups.get()))}))},layouts:{onLtr:function(){return[Ul,Vl]},onRtl:function(){return[Vl,Ul]},onBottomLtr:function(){return[Wl,jl]},onBottomRtl:function(){return[jl,Wl]}},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:rp(t.splitToolbarBehaviours,[bD.config({others:{overflowGroup:function(){return NU.sketch(A(A({},r["overflow-group"]()),{items:[o.asSpec()]}))}}})]),apis:{setGroups:function(e,n){t.builtGroups.set($(n,e.getSystem().build)),BU(e,o,t)},refresh:function(e){return BU(e,o,t)},toggle:function(t){o.getOpt(t).each((function(t){AU.toggle(t)}))},isOpen:function(t){return o.getOpt(t).map(AU.isOpen).getOr(!1)},reposition:function(t){o.getOpt(t).each((function(t){AU.reposition(t)}))},getOverflow:function(t){return o.getOpt(t).bind(AU.getToolbar)}},domModification:{attributes:{role:"group"}}}},HU=mv({name:"SplitFloatingToolbar",configFields:yU(),partFields:wU(),factory:LU,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)},isOpen:function(t,e){return t.isOpen(e)},getOverflow:function(t,e){return t.getOverflow(e)}}}),IU=w([il(["closedClass","openClass","shrinkingClass","growingClass","overflowToggledClass"]),al("onOpened"),al("onClosed")].concat(bU())),PU=w([Np({factory:PP,schema:BP(),name:"primary"}),Np({factory:PP,schema:BP(),name:"overflow",overrides:function(t){return{toolbarBehaviours:mf([CV.config({dimension:{property:"height"},closedClass:t.markers.closedClass,openClass:t.markers.openClass,shrinkingClass:t.markers.shrinkingClass,growingClass:t.markers.growingClass,onShrunk:function(e){Kp(e,t,"overflow-button").each((function(t){hx.off(t),Yw.focus(t)})),t.onClosed(e)},onGrown:function(e){Aw.focusIn(e),t.onOpened(e)},onStartGrow:function(e){Kp(e,t,"overflow-button").each(hx.on)}}),Aw.config({mode:"acyclic",onEscape:function(e){return Kp(e,t,"overflow-button").each(Yw.focus),L.some(!0)}})])}}}),zp({name:"overflow-button",overrides:function(t){return{buttonBehaviours:mf([hx.config({toggleClass:t.markers.overflowToggledClass,aria:{mode:"pressed"},toggleOnExecute:!1})])}}}),zp({name:"overflow-group"})]),FU=function(t,e){return Kp(t,e,"overflow").map(CV.hasGrown).getOr(!1)},VU=function(t,e){Kp(t,e,"overflow-button").bind((function(){return Kp(t,e,"overflow")})).each((function(n){UU(t,e),CV.toggleGrow(n)}))},UU=function(t,e){Kp(t,e,"overflow").each((function(n){vU(t,e,(function(t){var e=$(t,(function(t){return _s(t)}));PP.setGroups(n,e)})),Kp(t,e,"overflow-button").each((function(t){CV.hasGrown(n)&&hx.on(t)})),CV.refresh(n)}))},jU=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:rp(t.splitToolbarBehaviours,[bD.config({others:{overflowGroup:function(t){return NU.sketch(A(A({},r["overflow-group"]()),{items:[SC.sketch(A(A({},r["overflow-button"]()),{action:function(e){Ca(t,o)}}))]}))}}}),Vw("toolbar-toggle-events",[Ra(o,(function(e){VU(e,t)}))])]),apis:{setGroups:function(e,n){i(e,n),UU(e,t)},refresh:function(e){return UU(e,t)},toggle:function(e){return VU(e,t)},isOpen:function(e){return FU(e,t)}},domModification:{attributes:{role:"group"}}}},WU=mv({name:"SplitSlidingToolbar",configFields:IU(),partFields:PU(),factory:jU,apis:{setGroups:function(t,e,n){t.setGroups(e,n)},refresh:function(t,e){t.refresh(e)},toggle:function(t,e){t.toggle(e)},isOpen:function(t,e){return t.isOpen(e)}}}),qU=function(t){var e=t.title.fold((function(){return{}}),(function(t){return{attributes:{title:t}}}));return{dom:A({tag:"div",classes:["tox-toolbar__group"]},e),components:[NU.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:mf([yA.config({}),Yw.config({})])}},$U=function(t){return NU.sketch(qU(t))},GU=function(t,e){var n=Ua((function(e){var n=$(t.initGroups,$U);PP.setGroups(e,n)}));return mf([mO.toolbarButton(t.providers.isDisabled),cO(),Aw.config({mode:e,onEscape:t.onEscape,selector:".tox-toolbar__group"}),Vw("toolbar-events",[n])])},KU=function(t){var e=t.cyclicKeying?"cyclic":"acyclic";return{uid:t.uid,dom:{tag:"div",classes:["tox-toolbar-overlord"]},parts:{"overflow-group":qU({title:L.none(),items:[]}),"overflow-button":YB({name:"more",icon:L.some("more-drawer"),disabled:!1,tooltip:L.some("More..."),primary:!1,borderless:!1},L.none(),t.providers)},splitToolbarBehaviours:GU(t,e)}},XU=function(t){var e=KU(t),n=4,r=HU.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}});return HU.sketch(A(A({},e),{lazySink:t.getSink,getOverflowBounds:function(){var e=t.moreDrawerData.lazyHeader().element,r=Qr(e),o=hn(e),i=Qr(o),u=Math.max(o.dom.scrollHeight,i.height);return Yr(r.x+n,i.y,r.width-2*n,u)},parts:A(A({},e.parts),{overflow:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:t.attributes}}}),components:[r],markers:{overflowToggledClass:"tox-tbtn--enabled"}}))},YU=function(t){var e=WU.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}}),n=WU.parts.overflow({dom:{tag:"div",classes:["tox-toolbar__overflow"]}}),r=KU(t);return WU.sketch(A(A({},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([SF()],{type:"opened"})},onClosed:function(t){t.getSystem().broadcastOn([SF()],{type:"closed"})}}))},JU=function(t){var e=t.cyclicKeying?"cyclic":"acyclic";return PP.sketch({uid:t.uid,dom:{tag:"div",classes:["tox-toolbar"].concat(t.type===US.scrolling?["tox-toolbar--scrolling"]:[])},components:[PP.parts.groups({})],toolbarBehaviours:GU(t,e)})},QU=function(t,e,n){var r={getSocket:function(e){return OP.getPart(e,t,"socket")},setSidebar:function(e,n){OP.getPart(e,t,"sidebar").each((function(t){return LV(t,n)}))},toggleSidebar:function(e,n){OP.getPart(e,t,"sidebar").each((function(t){return HV(t,n)}))},whichSidebar:function(e){return OP.getPart(e,t,"sidebar").bind(IV).getOrNull()},getHeader:function(e){return OP.getPart(e,t,"header")},getToolbar:function(e){return OP.getPart(e,t,"toolbar")},setToolbar:function(e,n){OP.getPart(e,t,"toolbar").each((function(t){t.getApis().setGroups(t,n)}))},setToolbars:function(e,n){OP.getPart(e,t,"multiple-toolbar").each((function(t){zP.setItems(t,n)}))},refreshToolbar:function(e){var n=OP.getPart(e,t,"toolbar");n.each((function(t){return t.getApis().refresh(t)}))},toggleToolbarDrawer:function(e){OP.getPart(e,t,"toolbar").each((function(t){Bt(t.getApis().toggle,(function(e){return e(t)}))}))},isToolbarDrawerToggled:function(e){return OP.getPart(e,t,"toolbar").bind((function(t){return L.from(t.getApis().isOpen).map((function(e){return e(t)}))})).getOr(!1)},getThrobber:function(e){return OP.getPart(e,t,"throbber")},focusToolbar:function(e){var n=OP.getPart(e,t,"toolbar").orThunk((function(){return OP.getPart(e,t,"multiple-toolbar")}));n.each((function(t){Aw.focusIn(t)}))},setMenubar:function(e,n){OP.getPart(e,t,"menubar").each((function(t){KF.setMenus(t,n)}))},focusMenubar:function(e){OP.getPart(e,t,"menubar").each((function(t){KF.focus(t)}))}};return{uid:t.uid,dom:t.dom,components:e,apis:r,behaviours:t.behaviours}},ZU=EP.optional({factory:KF,name:"menubar",schema:[Ai("backstage")]}),tj=function(t){return t.type===US.sliding?YU:t.type===US.floating?XU:JU},ej=EP.optional({factory:{sketch:function(t){return zP.sketch({uid:t.uid,dom:t.dom,listBehaviours:mf([Aw.config({mode:"acyclic",selector:".tox-toolbar"})]),makeItem:function(){return JU({type:t.type,uid:oc("multiple-toolbar-item"),cyclicKeying:!1,initGroups:[],providers:t.providers,onEscape:function(){return t.onEscape(),L.some(!0)}})},setupItem:function(t,e,n,r){PP.setGroups(e,n)},shell:!0})}},name:"multiple-toolbar",schema:[Ai("dom"),Ai("onEscape")]}),nj=EP.optional({factory:{sketch:function(t){var e=tj(t),n={type:t.type,uid:t.uid,onEscape:function(){return t.onEscape(),L.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:[Ai("dom"),Ai("onEscape"),Ai("getSink")]}),rj=EP.optional({factory:{sketch:PF},name:"header",schema:[Ai("dom")]}),oj=EP.optional({name:"socket",schema:[Ai("dom")]}),ij=EP.optional({factory:{sketch:VV},name:"sidebar",schema:[Ai("dom")]}),uj=EP.optional({factory:{sketch:nU},name:"throbber",schema:[Ai("dom")]}),aj=mv({name:"OuterContainer",factory:QU,configFields:[Ai("dom"),Ai("behaviours")],partFields:[rj,ZU,nj,ej,oj,ij,uj],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 $U(t)}));t.setToolbar(e,r)},setToolbars:function(t,e,n){var r=$(n,(function(t){return $(t,$U)}));t.setToolbars(e,r)},refreshToolbar:function(t,e){return t.refreshToolbar(e)},toggleToolbarDrawer:function(t,e){t.toggleToolbarDrawer(e)},isToolbarDrawerToggled:function(t,e){return t.isToolbarDrawerToggled(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)}}}),cj="file edit view insert format tools table help",sj={file:{title:"File",items:"newdocument restoredraft | preview | export 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 lineheight | forecolor backcolor | language | 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"}},lj=function(t,e,n){var r=ET(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]]:[]}))}}},fj=function(t){return"string"===typeof t?t.split(" "):t},dj=function(t,e){var n=A(A({},sj),e.menus),r=ht(e.menus).length>0,o=void 0===e.menubar||!0===e.menubar?fj(cj):fj(!1===e.menubar?"":e.menubar),i=Y(o,(function(t){var n=Et(sj,t);return r?n||Ot(e.menus,t).exists((function(t){return Et(t,"items")})):n})),u=$(i,(function(r){var o=n[r];return lj({title:o.title,items:fj(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)}))},mj=function(t){var e=function(){t._skinLoaded=!0,hE(t)};return function(){t.initialized?e():t.on("init",e)}},gj=function(t,e){return function(){return pE(t,{message:e})}},hj=function(t,e,n){return new uS((function(r,o){n.load(e,r,o),t.on("remove",(function(){return n.unload(e)}))}))},pj=function(t,e){var n=e+"/skin.min.css";return hj(t,n,t.ui.styleSheetLoader)},vj=function(t,e){var n=Mn(ee.fromDom(t.getElement()));if(n){var r=e+"/skin.shadowdom.min.css";return hj(t,r,dT.DOM.styleSheetLoader)}return uS.resolve()},bj=function(t,e){var n=gT(e);n&&e.contentCSS.push(n+(t?"/content.inline":"/content")+".min.css"),!1===pT(e)&&i(n)?uS.all([pj(e,n),vj(e,n)]).then(mj(e),gj(e,"Skin could not be loaded")):mj(e)()},yj=S(bj,!1),wj=S(bj,!0),xj=function(t,e){return function(n){var r=nd(),o=function(){n.setActive(t.formatter.match(e));var o=t.formatter.formatChanged(e,n.setActive);r.set(o)};return t.initialized?o():t.once("init",o),function(){t.off("init",o),r.clear()}}},Cj=function(t,e,n){return function(r){var o=function(){return n(r)},i=function(){n(r),t.on(e,o)};return t.initialized?i():t.once("init",i),function(){t.off("init",i),t.off(e,o)}}},Sj=function(t){return function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("mceToggleFormat",!1,e.format)}))}}},kj=function(t,e){return function(){return t.execCommand(e)}},Tj=function(t,e,n){var r=function(t,r,i,u){var a=e.shared.providers.translate(t.title);if("separator"===t.type)return L.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?L.none():L.some({type:"nestedmenuitem",text:a,disabled:c.length<=0,getSubmenuItems:function(){return rt(t.getStyleItems(),(function(t){return o(t,r,u)}))}})}return L.some(A({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,r){var o=e(),u=i(o),a=qB(u,jS.CLOSE_ON_EXECUTE,t,!1);r(a)}};return{validateItems:i,getFetch:u}},Oj=function(t,e,n){var r=n.dataset,o="basic"===r.type?function(){return $(r.data,(function(t){return RI(t,n.isSelectedFor,n.getPreviewFor)}))}:r.getData;return{items:Tj(t,e,n),getStyleItems:o}},Ej=function(t,e,n){var r=Oj(t,e,n),o=r.items,i=r.getStyleItems,u=function(t){return{getComponent:w(t)}},a=Cj(t,"NodeChange",(function(t){var e=t.getComponent();n.updateText(e)}));return BB({text:n.icon.isSome()?L.none():n.text,icon:n.icon,tooltip:L.from(n.tooltip),role:L.none(),fetch:o.getFetch(e,i),onSetup:a,getApi:u,columns:1,presets:"normal",classes:n.icon.isSome()?[]:["bespoke"],dropdownBehaviours:[]},"tox-tbtn",e.shared)},_j=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}}))},Aj=function(t){return{type:"basic",data:t}};(function(t){t[t["SemiColon"]=0]="SemiColon",t[t["Space"]=1]="Space"})(XL||(XL={}));var Dj,Mj=function(t,e){return e===XL.SemiColon?t.replace(/;$/,"").split(";"):t.split(" ")},Rj=function(t,e,n,r){var o=t.getParam(e,n,"string"),i=_j(Mj(o,r));return{type:"basic",data:i}},Nj=[{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"}],zj=function(t){var e=function(){return tt(Nj,(function(e){return t.formatter.match(e.format)}))},n=function(e){return function(){return t.formatter.match(e)}},r=function(t){return L.none},o=function(t){var n=e(),r=n.fold(w("left"),(function(t){return t.title.toLowerCase()}));Sa(t,zB,{icon:"align-"+r})},i=Aj(Nj),u=function(e){return function(){return tt(Nj,(function(t){return t.format===e.format})).each((function(e){return t.execCommand(e.command)}))}};return{tooltip:"Align",text:L.none(),icon:L.some("align-left"),isSelectedFor:n,getCurrentValue:L.none,getPreviewFor:r,onAction:u,updateText:o,dataset:i,shouldHide:!1,isInvalid:function(e){return!t.formatter.canApply(e.format)}}},Bj=function(t,e){return Ej(t,e,zj(t))},Lj=function(t,e){var n=Oj(t,e,zj(t));t.ui.registry.addNestedMenuItem("align",{text:e.shared.providers.translate("Align"),getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})},Hj="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",Ij=["-apple-system","Segoe UI","Roboto","Helvetica Neue","sans-serif"],Pj=function(t){var e=t.split(/\s*,\s*/);return $(e,(function(t){return t.replace(/^['"]+|['"]+$/g,"")}))},Fj=function(t){var e=function(){var e=Pj(t.toLowerCase());return ot(Ij,(function(t){return e.indexOf(t.toLowerCase())>-1}))};return 0===t.indexOf("-apple-system")&&e()},Vj=function(t){var e="System Font",n=function(){var n=function(t){return t?Pj(t)[0]:""},r=t.queryCommandValue("FontName"),o=c.data,i=r?r.toLowerCase():"",u=tt(o,(function(t){var e=t.format;return e.toLowerCase()===i||n(e).toLowerCase()===n(i).toLowerCase()})).orThunk((function(){return Lt(Fj(i),{title:e,format:i})}));return{matchOpt:u,font:r}},r=function(t){return function(e){return e.exists((function(e){return e.format===t}))}},o=function(){var t=n().matchOpt;return t},i=function(t){return function(){return L.some({tag:"div",styles:-1===t.indexOf("dings")?{"font-family":t}:{}})}},u=function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("FontName",!1,e.format)}))}},a=function(t){var e=n(),r=e.matchOpt,o=e.font,i=r.fold(w(o),(function(t){return t.title}));Sa(t,NB,{text:i})},c=Rj(t,"font_formats",Hj,XL.SemiColon);return{tooltip:"Fonts",text:L.some(e),icon:L.none(),isSelectedFor:r,getCurrentValue:o,getPreviewFor:i,onAction:u,updateText:a,dataset:c,shouldHide:!1,isInvalid:O}},Uj=function(t,e){return Ej(t,e,Vj(t))},jj=function(t,e){var n=Oj(t,e,Vj(t));t.ui.registry.addNestedMenuItem("fontformats",{text:e.shared.providers.translate("Fonts"),getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})},Wj="8pt 10pt 12pt 14pt 18pt 24pt 36pt",qj={"8pt":"1","10pt":"2","12pt":"3","14pt":"4","18pt":"5","24pt":"6","36pt":"7"},$j={"xx-small":"7pt","x-small":"8pt",small:"10pt",medium:"12pt",large:"14pt","x-large":"18pt","xx-large":"24pt"},Gj=function(t,e){var n=Math.pow(10,e);return Math.round(t*n)/n},Kj=function(t,e){return/[0-9.]+px$/.test(t)?Gj(72*parseInt(t,10)/96,e||0)+"pt":Ot($j,t).getOr(t)},Xj=function(t){return Ot(qj,t).getOr("")},Yj=function(t){var e=function(){var e=L.none(),n=a.data,r=t.queryCommandValue("FontSize");if(r)for(var o=function(t){var o=Kj(r,t),i=Xj(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=w(L.none),i=function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("FontSize",!1,e.format)}))}},u=function(t){var n=e(),r=n.matchOpt,o=n.size,i=r.fold(w(o),(function(t){return t.title}));Sa(t,NB,{text:i})},a=Rj(t,"fontsize_formats",Wj,XL.Space);return{tooltip:"Font sizes",text:L.some("12pt"),icon:L.none(),isSelectedFor:n,getPreviewFor:o,getCurrentValue:r,onAction:i,updateText:u,dataset:a,shouldHide:!1,isInvalid:O}},Jj=function(t,e){return Ej(t,e,Yj(t))},Qj=function(t,e){var n=Oj(t,e,Yj(t));t.ui.registry.addNestedMenuItem("fontsizes",{text:"Font sizes",getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})},Zj=function(t,e){var n=e(),r=$(n,(function(t){return t.format}));return L.from(t.formatter.closest(r)).bind((function(t){return tt(n,(function(e){return e.format===t}))})).orThunk((function(){return Lt(t.formatter.match("p"),{title:"Paragraph",format:"p"})}))},tW="Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre",eW=function(t){var e="Paragraph",n=function(e){return function(){return t.formatter.match(e)}},r=function(e){return function(){var n=t.formatter.get(e);return L.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))})}},o=function(n){var r=Zj(t,(function(){return i.data})),o=r.fold(w(e),(function(t){return t.title}));Sa(n,NB,{text:o})},i=Rj(t,"block_formats",tW,XL.SemiColon);return{tooltip:"Blocks",text:L.some(e),icon:L.none(),isSelectedFor:n,getCurrentValue:L.none,getPreviewFor:r,onAction:Sj(t),updateText:o,dataset:i,shouldHide:!1,isInvalid:function(e){return!t.formatter.canApply(e.format)}}},nW=function(t,e){return Ej(t,e,eW(t))},rW=function(t,e){var n=Oj(t,e,eW(t));t.ui.registry.addNestedMenuItem("blockformats",{text:"Blocks",getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})},oW=function(t,e){var n="Paragraph",r=function(e){return function(){return t.formatter.match(e)}},o=function(e){return function(){var n=t.formatter.get(e);return void 0!==n?L.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))}):L.none()}},i=function(e){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(MI(t),r),i=Zj(t,w(o)),u=i.fold(w(n),(function(t){return t.title}));Sa(e,NB,{text:u})};return{tooltip:"Formats",text:L.some(n),icon:L.none(),isSelectedFor:r,getCurrentValue:L.none,getPreviewFor:o,onAction:Sj(t),updateText:i,shouldHide:t.getParam("style_formats_autohide",!1,"boolean"),isInvalid:function(e){return!t.formatter.canApply(e.format)},dataset:e}},iW=function(t,e){var n=A({type:"advanced"},e.styleselect);return Ej(t,e,oW(t,n))},uW=function(t,e){var n=A({type:"advanced"},e.styleselect),r=Oj(t,e,oW(t,n));t.ui.registry.addNestedMenuItem("formats",{text:"Formats",getSubmenuItems:function(){return r.items.validateItems(r.getStyleItems())}})},aW=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);jg(n,i)}))};return _a([Ra(ta(),(function(e,r){var o=r;if(!o.universal){var i=t.channel;U(o.channels,i)&&n(e,o.data)}})),Ua((function(e,r){t.initialData.each((function(t){n(e,t)}))}))])},cW=Object.freeze({__proto__:null,events:aW}),sW=function(t,e,n){return n},lW=Object.freeze({__proto__:null,getState:sW}),fW=[Ai("channel"),Fi("renderComponents"),Fi("updateState"),Fi("initialData")],dW=function(){var t=ou(L.none()),e=function(){return t.set(L.none())},n=function(){return t.get().getOr("none")};return{readState:n,get:t.get,set:t.set,clear:e}},mW=Object.freeze({__proto__:null,init:dW}),gW=hf({fields:fW,name:"reflecting",active:cW,apis:lW,state:mW}),hW=w([Ai("toggleClass"),Ai("fetch"),sl("onExecute"),Ki("getHotspot",L.some),Ki("getAnchorOverrides",w({})),Pd(),sl("onItemExecute"),Fi("lazySink"),Ai("dom"),al("onOpen"),ep("splitDropdownBehaviours",[bD,Aw,Yw]),Ki("matchWidth",!1),Ki("useMinWidth",!1),Ki("eventOrder",{}),Fi("role")].concat(ND())),pW=Np({factory:SC,schema:[Ai("dom")],name:"arrow",defaults:function(){return{buttonBehaviours:mf([Yw.revoke()])}},overrides:function(t){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(e){e.getSystem().getByUid(t.uid).each(ka)},buttonBehaviours:mf([hx.config({toggleOnExecute:!1,toggleClass:t.toggleClass})])}}}),vW=Np({factory:SC,schema:[Ai("dom")],name:"button",defaults:function(){return{buttonBehaviours:mf([Yw.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)}))}}}}),bW=w([pW,vW,Bp({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[Ai("text")],name:"aria-descriptor"}),zp({schema:[ol()],name:"menu",defaults:function(t){return{onExecute:function(e,n){e.getSystem().getByUid(t.uid).each((function(r){t.onItemExecute(r,e,n)}))}}}}),wD()]),yW=function(t,e,n,r){var o,i=function(t){bv.getCurrent(t).each((function(t){rb.highlightFirst(t),Aw.focusIn(t)}))},u=function(e){var n=i;ED(t,x,e,r,n,qA.HighlightFirst).get(p)},a=function(t){return u(t),L.some(!0)},c=function(e){var n=Xp(e,t,"button");return ka(n),L.some(!0)},s=A(A({},_a([Ua((function(e,n){var r=Kp(e,t,"aria-descriptor");r.each((function(t){var n=oc("aria");Fn(t.element,"id",n),Fn(e.element,"aria-describedby",n)}))}))])),vx(L.some(u))),l={repositionMenus:function(t){hx.isOn(t)&&RD(t)}};return{uid:t.uid,dom:t.dom,components:e,apis:l,eventOrder:A(A({},t.eventOrder),(o={},o[ea()]=["disabling","toggling","alloy.base.behaviour"],o)),events:s,behaviours:rp(t.splitDropdownBehaviours,[bD.config({others:{sandbox:function(e){var n=Xp(e,t,"arrow"),r={onOpen:function(){hx.on(n),hx.on(e)},onClose:function(){hx.off(n),hx.off(e)}};return MD(t,e,r)}}}),Aw.config({mode:"special",onSpace:c,onEnter:c,onDown:a}),Yw.config({}),hx.config({toggleOnExecute:!1,aria:{mode:"expanded"}})]),domModification:{attributes:{role:t.role.getOr("button"),"aria-haspopup":!0}}}},wW=mv({name:"SplitDropdown",configFields:hW(),partFields:bW(),factory:yW,apis:{repositionMenus:function(t,e){return t.repositionMenus(e)}}}),xW=function(t){return{isDisabled:function(){return Hv.isDisabled(t)},setDisabled:function(e){return Hv.set(t,e)}}},CW=function(t){return{setActive:function(e){hx.set(t,e)},isActive:function(){return hx.isOn(t)},isDisabled:function(){return Hv.isDisabled(t)},setDisabled:function(e){return Hv.set(t,e)}}},SW=function(t,e){return t.map((function(t){return{"aria-label":e.translate(t),title:e.translate(t)}})).getOr({})},kW=oc("focus-button"),TW=function(t,e,n,r,o,i){var u;return{dom:{tag:"button",classes:["tox-tbtn"].concat(e.isSome()?["tox-tbtn--select"]:[]),attributes:SW(n,i)},components:yO([t.map((function(t){return EB(t,i.icons)})),e.map((function(t){return AB(t,"tox-tbtn",i)}))]),eventOrder:(u={},u[Nu()]=["focusing","alloy.base.behaviour","common-button-display-events"],u),buttonBehaviours:mf([mO.toolbarButton(i.isDisabled),cO(),Vw("common-button-display-events",[Ra(Nu(),(function(t,e){e.event.prevent(),Ca(t,kW)}))])].concat(r.map((function(n){return gW.config({channel:n,initialData:{icon:t,text:e},renderComponents:function(t,e){return yO([t.icon.map((function(t){return EB(t,i.icons)})),t.text.map((function(t){return AB(t,"tox-tbtn",i)}))])}})})).toArray()).concat(o.getOr([])))}},OW=function(t,e,n,r){var o=e.shared;return AU.sketch({lazySink:o.getSink,fetch:function(){return tD.nu((function(e){e($(n(t.items),$U))}))},markers:{toggledClass:"tox-tbtn--enabled"},parts:{button:TW(t.icon,t.text,t.tooltip,L.none(),L.none(),o.providers),toolbar:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:r}}}})},EW=function(t,e,n){var r=ou(p),o=TW(t.icon,t.text,t.tooltip,L.none(),L.none(),n);return SC.sketch({dom:o.dom,components:o.components,eventOrder:RB,buttonBehaviours:mf([Vw("toolbar-button-events",[MB({onAction:t.onAction,getApi:e.getApi}),hO(e,r),pO(e,r)]),mO.toolbarButton((function(){return t.disabled||n.isDisabled()})),cO()].concat(e.toolbarButtonBehaviours))})},_W=function(t,e){return AW(t,e,[])},AW=function(t,e,n){return EW(t,{toolbarButtonBehaviours:[].concat(n.length>0?[Vw("toolbarButtonWith",n)]:[]),getApi:xW,onSetup:t.onSetup},e)},DW=function(t,e){return MW(t,e,[])},MW=function(t,e,n){return Co(EW(t,{toolbarButtonBehaviours:[Pw.config({}),hx.config({toggleClass:"tox-tbtn--enabled",aria:{mode:"pressed"},toggleOnExecute:!1})].concat(n.length>0?[Vw("toolbarToggleButtonWith",n)]:[]),getApi:CW,onSetup:t.onSetup},e))},RW=function(t,e,n){return function(r){return tD.nu((function(t){return e.fetch(t)})).map((function(o){return L.from(R_(Co(n_(oc("menu-value"),o,(function(n){e.onItemAction(t(r),n)}),e.columns,e.presets,jS.CLOSE_ON_EXECUTE,e.select.getOr(O),n),{movement:o_(e.columns,e.presets),menuBehaviours:Qk.unnamedEvents("auto"!==e.columns?[]:[Ua((function(t,n){Xk(t,4,lk(e.presets)).each((function(e){var n=e.numRows,r=e.numColumns;Aw.setGridSize(t,n,r)}))}))])})))}))}},NW=function(t,e){var n,r=oc("channel-update-split-dropdown-display"),o=function(t){return{isDisabled:function(){return Hv.isDisabled(t)},setDisabled:function(e){return Hv.set(t,e)},setIconFill:function(e,n){Is(t.element,'svg path[id="'+e+'"], rect[id="'+e+'"]').each((function(t){Fn(t,"fill",n)}))},setIconStroke:function(e,n){Is(t.element,'svg path[id="'+e+'"], rect[id="'+e+'"]').each((function(t){Fn(t,"stroke",n)}))},setActive:function(e){Fn(t.element,"aria-pressed",e),Is(t.element,"span").each((function(n){t.getSystem().getByDom(n).each((function(t){return hx.set(t,e)}))}))},isActive:function(){return Is(t.element,"span").exists((function(e){return t.getSystem().getByDom(e).exists(hx.isOn)}))}}},i=ou(p),u={getApi:o,onSetup:t.onSetup};return wW.sketch({dom:{tag:"div",classes:["tox-split-button"],attributes:A({"aria-pressed":!1},SW(t.tooltip,e.providers))},onExecute:function(e){t.onAction(o(e))},onItemExecute:function(t,e,n){},splitDropdownBehaviours:mf([mO.splitButton(e.providers.isDisabled),cO(),Vw("split-dropdown-events",[Ra(kW,Yw.focus),hO(u,i),pO(u,i)]),VD.config({})]),eventOrder:(n={},n[da()]=["alloy.base.behaviour","split-dropdown-events"],n),toggleClass:"tox-tbtn--enabled",lazySink:e.getSink,fetch:RW(o,t,e.providers),parts:{menu:pk(!1,t.columns,t.presets)},components:[wW.parts.button(TW(t.icon,t.text,L.none(),L.some(r),L.some([hx.config({toggleClass:"tox-tbtn--enabled",toggleOnExecute:!1})]),e.providers)),wW.parts.arrow({dom:{tag:"button",classes:["tox-tbtn","tox-split-button__chevron"],innerHtml:MC("chevron-down",e.providers.icons)},buttonBehaviours:mf([mO.splitButton(e.providers.isDisabled),cO(),zC()])}),wW.parts["aria-descriptor"]({text:e.providers.translate("To open the popup, press Shift+Enter")})]})},zW=[{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"]}],BW=function(t,e){return function(n,r,o){var i=t(n).mapError((function(t){return Si(t)})).getOrDie();return e(i,r,o)}},LW={button:BW(OS,(function(t,e){return _W(t,e.backstage.shared.providers)})),togglebutton:BW(AS,(function(t,e){return DW(t,e.backstage.shared.providers)})),menubutton:BW(WF,(function(t,e){return GB(t,"tox-tbtn",e.backstage,L.none())})),splitbutton:BW($F,(function(t,e){return NW(t,e.backstage.shared)})),grouptoolbarbutton:BW(VF,(function(t,e,n){var r,o=n.ui.registry.getAll().buttons,i=function(t){return WW(n,{buttons:o,toolbar:t,allowToolbarGroups:!1},e,L.none())},u=(r={},r[Hd]=e.backstage.shared.header.isPositionedAtTop()?Pf.TopToBottom:Pf.BottomToTop,r);switch(NT(n)){case US.floating:return OW(t,e.backstage,i,u);default:throw new Error("Toolbar groups are only supported when using floating toolbar mode")}})),styleSelectButton:function(t,e){return iW(t,e.backstage)},fontsizeSelectButton:function(t,e){return Jj(t,e.backstage)},fontSelectButton:function(t,e){return Uj(t,e.backstage)},formatButton:function(t,e){return nW(t,e.backstage)},alignMenuButton:function(t,e){return Bj(t,e.backstage)}},HW=function(t,e,n){return Ot(LW,t.type).fold((function(){return console.error("skipping button defined by",t),L.none()}),(function(r){return L.some(r(t,e,n))}))},IW={styleselect:LW.styleSelectButton,fontsizeselect:LW.fontsizeSelectButton,fontselect:LW.fontSelectButton,formatselect:LW.formatButton,align:LW.alignMenuButton},PW=function(t){var e=$(zW,(function(e){var n=Y(e.items,(function(e){return Et(t,e)||Et(IW,e)}));return{name:e.name,items:n}}));return Y(e,(function(t){return t.items.length>0}))},FW=function(t){var e=t.split("|");return $(e,(function(t){return{items:t.trim().split(" ")}}))},VW=function(t){return h(t,(function(t){return Et(t,"name")&&Et(t,"items")}))},UW=function(t){var e=t.toolbar,n=t.buttons;return!1===e?[]:void 0===e||!0===e?PW(n):i(e)?FW(e):VW(e)?e:(console.error("Toolbar type should be string, string[], boolean or ToolbarGroup[]"),[])},jW=function(t,e,n,r,o,i){return Ot(e,n.toLowerCase()).orThunk((function(){return i.bind((function(t){return gt(t,(function(t){return Ot(e,t+n.toLowerCase())}))}))})).fold((function(){return Ot(IW,n.toLowerCase()).map((function(e){return e(t,o)})).orThunk((function(){return L.none()}))}),(function(e){return"grouptoolbarbutton"!==e.type||r?HW(e,o,t):(console.warn("Ignoring the '"+n+"' toolbar button. Group toolbar buttons are only supported when using floating toolbar mode and cannot be nested."),L.none())}))},WW=function(t,e,n,r){var o=UW(e),i=$(o,(function(o){var i=rt(o.items,(function(o){return 0===o.trim().length?[]:jW(t,e.buttons,o,e.allowToolbarGroups,n,r).toArray()}));return{title:L.from(t.translate(o.name)),items:i}}));return Y(i,(function(t){return t.items.length>0}))},qW=function(t,e,n,r){var o=e.outerContainer,u=n.toolbar,a=n.buttons;if(h(u,i)){var c=u.map((function(e){var o={toolbar:e,buttons:a,allowToolbarGroups:n.allowToolbarGroups};return WW(t,o,{backstage:r},L.none())}));aj.setToolbars(o,c)}else aj.setToolbar(o,WW(t,n,{backstage:r},L.none()))},$W=en(),GW=$W.os.isiOS()&&$W.os.version.major<=12,KW=function(t,e){var n=t.dom,r=t.getWin(),o=t.getDoc().documentElement,i=ou(lr(r.innerWidth,r.innerHeight)),u=ou(lr(o.offsetWidth,o.offsetHeight)),a=function(){var e=i.get();e.left===r.innerWidth&&e.top===r.innerHeight||(i.set(lr(r.innerWidth,r.innerHeight)),bE(t))},c=function(){var e=t.getDoc().documentElement,n=u.get();n.left===e.offsetWidth&&n.top===e.offsetHeight||(u.set(lr(e.offsetWidth,e.offsetHeight)),bE(t))},s=function(e){return yE(t,e)};n.bind(r,"resize",a),n.bind(r,"scroll",s);var l=ad(ee.fromDom(t.getBody()),"load",c),f=e.uiMothership.element;t.on("hide",(function(){Kn(f,"display","none")})),t.on("show",(function(){nr(f,"display")})),t.on("NodeChange",c),t.on("remove",(function(){l.unbind(),n.unbind(r,"resize",a),n.unbind(r,"scroll",s),r=null}))},XW=function(t,e,n,r,o){var i=ou(0),u=e.outerContainer;yj(t);var a=ee.fromDom(o.targetNode),c=Dn(An(a));Yg(a,e.mothership),Xg(c,e.uiMothership),t.on("PostRender",(function(){qW(t,e,n,r),i.set(t.getWin().innerWidth),aj.setMenubar(u,dj(t,n)),aj.setSidebar(u,n.sidebar),KW(t,e)}));var s=aj.getSocket(u).getOrDie("Could not find expected socket element");if(GW){Xn(s.element,{overflow:"scroll","-webkit-overflow-scrolling":"touch"});var l=jC((function(){t.fire("ScrollContent")}),20),f=ud(s.element,"scroll",l.throttle);t.on("remove",f.unbind)}aO(t,e),t.addCommand("ToggleSidebar",(function(e,n){aj.toggleSidebar(u,n),t.fire("ToggleSidebar")})),t.addQueryValueHandler("ToggleSidebar",(function(){return aj.whichSidebar(u)}));var d=NT(t),m=function(){aj.refreshToolbar(e.outerContainer)};d!==US.sliding&&d!==US.floating||t.on("ResizeWindow ResizeEditor ResizeContent",(function(){var e=t.getWin().innerWidth;e!==i.get()&&(m(),i.set(e))}));var g={enable:function(){uO(e,!1)},disable:function(){uO(e,!0)},isDisabled:function(){return Hv.isDisabled(u)}};return{iframeContainer:s.element.dom,editorContainer:u.element.dom,api:g}},YW=Object.freeze({__proto__:null,render:XW}),JW=function(t){var e=/^[0-9\.]+(|px)$/i;return e.test(""+t)?L.some(parseInt(""+t,10)):L.none()},QW=function(t){return g(t)?t+"px":t},ZW=function(t,e,n){var r=e.filter((function(e){return te}));return r.or(o).getOr(t)},tq=function(t){var e=vT(t),n=wT(t),r=CT(t);return JW(e).map((function(t){return ZW(t,n,r)}))},eq=function(t){var e=tq(t);return e.getOr(vT(t))},nq=function(t){var e=bT(t),n=yT(t),r=xT(t);return JW(e).map((function(t){return ZW(t,n,r)}))},rq=function(t){var e=nq(t);return e.getOr(bT(t))},oq=function(t,e,n,r,o){var i=n.uiMothership,u=n.outerContainer,a=dT.DOM,c=UT(t),s=qT(t),l=xT(t).or(nq(t)),f=r.shared.header,d=f.isPositionedAtTop,m=NT(t),g=m===US.sliding||m===US.floating,h=ou(!1),p=function(){return h.get()&&!t.removed},v=function(t){return g?t.fold(w(0),(function(t){return t.components().length>1?ur(t.components()[1].element):0})):0},b=function(n){switch(LT(t)){case RT.auto:var r=aj.getToolbar(u),o=v(r),i=ur(n.element)-o,a=Jr(e),c=a.y>i;if(c)return"top";var s=hn(e),l=Math.max(s.dom.scrollHeight,ur(s)),f=a.bottom=n&&t.bottom-e.y>=n},xq=function(t){var e=t.getBoundingClientRect();if(e.height<=0&&e.width<=0){var n=Tn(ee.fromDom(t.startContainer),t.startOffset).element,r=fe(n)?vn(n):L.some(n);return r.filter(le).map((function(t){return t.dom.getBoundingClientRect()})).getOr(e)}return e},Cq=function(t){var e=t.selection.getRng(),n=xq(e);if(t.inline){var r=Hr();return Yr(r.left+n.left,r.top+n.top,n.width,n.height)}var o=Qr(ee.fromDom(t.getBody()));return Yr(o.x+n.left,o.y+n.top,n.width,n.height)},Sq=function(t,e){return e.filter(Ln).map(Qr).getOrThunk((function(){return Cq(t)}))},kq=function(t,e,n){var r=Math.max(t.x+n,e.x),o=Math.min(t.right-n,e.right);return{x:r,width:o-r}},Tq=function(t,e,n,r,o,i){var u=ee.fromDom(t.getContainer()),a=Is(u,".tox-editor-header").getOr(u),c=Jr(a),s=c.y>=e.bottom,l=r&&!s;if(t.inline&&l)return{y:Math.max(c.bottom+i,n.y),bottom:n.bottom};if(t.inline&&!l)return{y:n.y,bottom:Math.min(c.y-i,n.bottom)};var f="line"===o?Jr(u):e;return l?{y:Math.max(c.bottom+i,n.y),bottom:Math.min(f.bottom-i,n.bottom)}:{y:Math.max(f.y+i,n.y),bottom:Math.min(c.y-i,n.bottom)}},Oq=function(t,e,n,r){void 0===r&&(r=0);var o=Vr(window),i=Jr(ee.fromDom(t.getContentAreaContainer())),u=_T(t)||AT(t)||MT(t),a=kq(i,o,r),c=a.x,s=a.width;if(t.inline&&!u)return Yr(c,o.y,s,o.height);var l=e.header.isPositionedAtTop(),f=Tq(t,i,o,l,n,r),d=f.y,m=f.bottom;return Yr(c,d,s,m-d)},Eq=12,_q={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"],inset:["tox-pop--inset"]},Aq={maxHeightFunction:Ed(),maxWidthFunction:xU()},Dq=function(t,e){var n=t.selection.getRng(),r=Tn(ee.fromDom(n.startContainer),n.startOffset);return n.startContainer===n.endContainer&&n.startOffset===n.endOffset-1&&sn(r.element,e)},Mq=function(t,e,n){var r=Zn(t,"position");Kn(t,"position",e);var o=n(t);return r.each((function(e){return Kn(t,"position",e)})),o},Rq=function(t){return"node"===t},Nq=function(t,e,n,r,o){var i=Cq(t),u=r.lastElement().exists((function(t){return sn(n,t)}));if(Dq(t,n))return u?bC:mC;if(u)return Mq(e,r.getMode(),(function(){var t=wq(i,Jr(e));return t&&!r.isReposition()?wC:bC}));var a="fixed"===r.getMode()?o.y+Hr().top:o.y,c=ur(e)+Eq;return a+c<=i.y?mC:gC},zq=function(t,e,n,r){var o=function(e){return function(r,o,i,u,a){var c=Nq(t,u,e,n,a),s=A(A({},r),{y:a.y,height:a.height});return A(A({},c(s,o,i,u,a)),{alwaysFit:!0})}},i=function(t){return Rq(r)?[o(t)]:[]},u={onLtr:function(t){return[ql,$l,jl,Vl,Wl,Ul].concat(i(t))},onRtl:function(t){return[ql,$l,Wl,Ul,jl,Vl].concat(i(t))}},a={onLtr:function(t){return[$l,Vl,Ul,jl,Wl,ql].concat(i(t))},onRtl:function(t){return[$l,Ul,Vl,Wl,jl,ql].concat(i(t))}};return e?a:u},Bq=function(t,e,n,r){return"line"===e?{bubble:Rd(Eq,0,_q),layouts:{onLtr:function(){return[Gl]},onRtl:function(){return[Kl]}},overrides:Aq}:{bubble:Rd(0,Eq,_q,1/Eq),layouts:zq(t,n,r,e),overrides:Aq}},Lq=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}},Hq=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 A(A({},t),{position:"node"})}));return i.concat(u)}return n(r?"selection":"node")}return n("line")},Iq=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}))}))},Pq=function(t,e,n){var r=Lq(t,e);if(r.contextForms.length>0)return L.some({elem:t,toolbars:[r.contextForms[0]]});var o=Lq(t,n);if(o.contextForms.length>0)return L.some({elem:t,toolbars:[o.contextForms[0]]});if(r.contextToolbars.length>0||o.contextToolbars.length>0){var i=Hq(r.contextToolbars.concat(o.contextToolbars));return L.some({elem:t,toolbars:i})}return L.none()},Fq=function(t,e,n){return t(e)?L.none():yu(e,(function(t){if(le(t)){var e=Lq(t,n.inNodeScope),r=e.contextToolbars,o=e.contextForms,i=o.length>0?o:Iq(r);return i.length>0?L.some({elem:t,toolbars:i}):L.none()}return L.none()}),t)},Vq=function(t,e){var n=ee.fromDom(e.getBody()),r=function(t){return sn(t,n)},o=function(t){return!r(t)&&!dn(n,t)},i=ee.fromDom(e.selection.getNode());return o(i)?L.none():Pq(i,t.inNodeScope,t.inEditorScope).orThunk((function(){return Fq(r,i,t)}))},Uq=function(t,e){var n={},r=[],o=[],i={},u={},a=function(t,a){var c=xi(HS(a));n[t]=c,c.launch.map((function(n){i["form:"+t]=A(A({},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){PS(e).each((function(n){"editor"===e.scope?o.push(n):r.push(n),u[t]=n}))},s=ht(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}},jq=oc("forward-slide"),Wq=oc("backward-slide"),qq=oc("change-slide-event"),$q="tox-pop--resizing",Gq=function(t){var e=ou([]);return eC.sketch({dom:{tag:"div",classes:["tox-pop"]},fireDismissalEventInstead:{event:"doNotDismissYet"},onShow:function(t){e.set([]),eC.getContent(t).each((function(t){nr(t.element,"visibility")})),as(t.element,$q),nr(t.element,"width")},inlineBehaviours:mf([Vw("context-toolbar-events",[Va($u(),(function(t,e){"width"===e.event.raw.propertyName&&(as(t.element,$q),nr(t.element,"width"))})),Ra(qq,(function(t,e){var n=t.element;nr(n,"width");var r=vr(n);eC.setContent(t,e.event.contents),is(n,$q);var o=vr(n);Kn(n,"width",r+"px"),eC.getContent(t).each((function(t){e.event.focus.bind((function(t){return Sf(t),Ef(n)})).orThunk((function(){return Aw.focusIn(t),Of(An(n))}))})),xC.setTimeout((function(){Kn(t.element,"width",o+"px")}),0)})),Ra(jq,(function(t,n){eC.getContent(t).each((function(n){e.set(e.get().concat([{bar:n,focus:Of(An(t.element))}]))})),Sa(t,qq,{contents:n.event.forwardContents,focus:L.none()})})),Ra(Wq,(function(t,n){dt(e.get()).each((function(n){e.set(e.get().slice(0,e.get().length-1)),Sa(t,qq,{contents:_s(n.bar),focus:n.focus})}))}))]),Aw.config({mode:"special",onEscape:function(n){return dt(e.get()).fold((function(){return t.onEscape()}),(function(t){return Ca(n,Wq),L.some(!0)}))}})]),lazySink:function(){return ro.value(t.sink)}})},Kq="tox-pop--transition",Xq=function(t,e,n,r){var o=r.backstage,i=o.shared,u=en().deviceType.isTouch,a=od(),c=od(),s=od(),l=Es(Gq({sink:n,onEscape:function(){return t.focus(),L.some(!0)}})),f=function(){var e=s.get().getOr("node"),n=Rq(e)?1:0;return Oq(t,i,e,n)},d=function(){return!t.removed&&!(u()&&o.isContextMenuOpen())},m=function(t){return At(Nt(t,a.get(),sn),!0)},g=function(){if(d()){var e=f(),n=At(s.get(),"node")?Sq(t,a.get()):Cq(t);return e.height<=0||!wq(n,e)}return!0},h=function(){a.clear(),c.clear(),s.clear(),eC.hide(l)},v=function(){if(eC.isOpen(l)){var t=l.element;nr(t,"display"),g()?Kn(t,"display","none"):(c.set(0),eC.reposition(l))}},b=function(e){return{dom:{tag:"div",classes:["tox-pop__dialog"]},components:[e],behaviours:mf([Aw.config({mode:"acyclic"}),Vw("pop-dialog-wrap-events",[Ua((function(e){t.shortcuts.add("ctrl+F9","focus statusbar",(function(){return Aw.focusIn(e)}))})),ja((function(e){t.shortcuts.remove("ctrl+F9")}))])])}},y=ge((function(){return Uq(e,(function(t){var e=C([t]);Sa(l,jq,{forwardContents:b(e)})}))})),w=function(e,n){return WW(t,{buttons:e,toolbar:n.items,allowToolbarGroups:!1},r,L.some(["form:"]))},x=function(t,e){return yq.buildInitGroups(t,e)},C=function(e){var n=t.ui.registry.getAll().buttons,r=y(),o=A(A({},n),r.formNavigators),u=NT(t)===US.scrolling?US.scrolling:US.default,a=nt($(e,(function(t){return"contexttoolbar"===t.type?w(o,t):x(t,i.providers)})));return JU({type:u,uid:oc("context-toolbar"),initGroups:a,onEscape:L.none,cyclicKeying:!0,providers:i.providers})},S=function(e,r){var o="node"===e?i.anchors.node(r):i.anchors.cursor(),s=Bq(t,e,u(),{lastElement:a.get,isReposition:function(){return At(c.get(),0)},getMode:function(){return Ig.getMode(n)}});return Co(o,s)},k=function(t,e){if(T.cancel(),d()){var r=C(t),o=t[0].position,i=S(o,e);s.set(o),c.set(1);var u=l.element;nr(u,"display"),m(e)||(as(u,Kq),Ig.reset(n,l)),eC.showWithinBounds(l,b(r),{anchor:i,transition:{classes:[Kq],mode:"placement"}},(function(){return L.some(f())})),e.fold(a.clear,a.set),g()&&Kn(u,"display","none")}},T=WC((function(){if(t.hasFocus()&&!t.removed)if(cs(l.element,Kq))T.throttle();else{var e=y();Vq(e,t).fold(h,(function(t){k(t.toolbars,L.some(t.elem))}))}}),17);t.on("init",(function(){t.on("remove",h),t.on("ScrollContent ScrollWindow ObjectResized ResizeEditor longpress",v),t.on("click keyup focus SetContent",T.throttle),t.on(lq,h),t.on(sq,(function(e){var n=y();Ot(n.lookupTable,e.toolbarKey).each((function(n){k([n],Lt(e.target!==t,e.target)),eC.getContent(l).each(Aw.focusIn)}))})),t.on("focusout",(function(e){xC.setEditorTimeout(t,(function(){Ef(n.element).isNone()&&Ef(l.element).isNone()&&h()}),0)})),t.on("SwitchMode",(function(){t.mode.isReadOnly()&&h()})),t.on("AfterProgressState",(function(e){e.state?h():t.hasFocus()&&T.throttle()})),t.on("NodeChange",(function(t){Ef(l.element).fold(T.throttle,p)}))}))},Yq=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"}];G(e,(function(e){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onAction:kj(t,e.cmd),onSetup:xj(t,e.name)})})),t.ui.registry.addButton("alignnone",{tooltip:"No alignment",icon:"align-none",onAction:kj(t,"JustifyNone")})},Jq={unsupportedLength:["em","ex","cap","ch","ic","rem","lh","rlh","vw","vh","vi","vb","vmin","vmax","cm","mm","Q","in","pc","pt","px"],fixed:["px","pt"],relative:["%"],empty:[""]},Qq=function(){var t="[0-9]+",e="[+-]?"+t,n="[eE]"+e,r="\\.",o=function(t){return"(?:"+t+")?"},i=["Infinity",t+r+o(t)+o(n),r+t+o(n),t+o(n)].join("|"),u="[+-]?(?:"+i+")";return new RegExp("^("+u+")(.*)$")}(),Zq=function(t,e){return j(e,(function(e){return j(Jq[e],(function(e){return t===e}))}))},t$=function(t,e){var n=L.from(Qq.exec(t));return n.bind((function(t){var n=Number(t[1]),r=t[2];return Zq(r,e)?L.some({value:n,unit:r}):L.none()}))},e$=function(t,e){return t$(t,e).map((function(t){var e=t.value,n=t.unit;return e+n}))},n$=function(t,e){var n=function(){var n=e.getOptions(t),r=e.getCurrent(t).map(e.hash),o=od();return $(n,(function(n){return{type:"togglemenuitem",text:e.display(n),onSetup:function(i){var u=function(t){t&&(o.on((function(t){return t.setActive(!1)})),o.set(i)),i.setActive(t)};u(At(r,e.hash(n)));var a=e.watcher(t,n,u);return function(){o.clear(),a()}},onAction:function(){return e.setCurrent(t,n)}}}))};t.ui.registry.addMenuButton(e.name,{tooltip:e.text,icon:e.icon,fetch:function(t){return t(n())},onSetup:e.onToolbarSetup}),t.ui.registry.addNestedMenuItem(e.name,{type:"nestedmenuitem",text:e.text,getSubmenuItems:n,onSetup:e.onMenuSetup})},r$={name:"lineheight",text:"Line height",icon:"line-height",getOptions:TT,hash:function(t){return e$(t,["fixed","relative","empty"]).getOr(t)},display:x,watcher:function(t,e,n){return t.formatter.formatChanged("lineheight",n,!1,{value:e}).unbind},getCurrent:function(t){return L.from(t.queryCommandValue("LineHeight"))},setCurrent:function(t,e){return t.execCommand("LineHeight",!1,e)}},o$=function(t){var e=L.from(OT(t));return e.map((function(e){return{name:"language",text:"Language",icon:"language",getOptions:w(e),hash:function(t){return l(t.customCode)?t.code:t.code+"/"+t.customCode},display:function(t){return t.title},watcher:function(t,e,n){return t.formatter.formatChanged("lang",n,!1,{value:e.code,customValue:e.customCode}).unbind},getCurrent:function(t){var e=ee.fromDom(t.selection.getNode());return wu(e,(function(t){return L.some(t).filter(le).bind((function(t){var e=jn(t,"lang");return e.map((function(e){var n=jn(t,"data-mce-lang").getOrUndefined();return{code:e,customCode:n,title:""}}))}))}))},setCurrent:function(t,e){return t.execCommand("Lang",!1,e)},onToolbarSetup:function(e){var n=nd();return e.setActive(t.formatter.match("lang",{},void 0,!0)),n.set(t.formatter.formatChanged("lang",e.setActive,!0)),n.clear}}}))},i$=function(t){n$(t,r$),o$(t).each((function(e){return n$(t,e)}))},u$=function(t,e){Lj(t,e),jj(t,e),uW(t,e),rW(t,e),Qj(t,e)},a$=function(t){return Cj(t,"NodeChange",(function(e){e.setDisabled(!t.queryCommandState("outdent"))}))},c$=function(t){t.ui.registry.addButton("outdent",{tooltip:"Decrease indent",icon:"outdent",onSetup:a$(t),onAction:kj(t,"outdent")}),t.ui.registry.addButton("indent",{tooltip:"Increase indent",icon:"indent",onAction:kj(t,"indent")})},s$=function(t){c$(t)},l$=function(t,e){return function(){t.execCommand("mceToggleFormat",!1,e)}},f$=function(t){QN.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:xj(t,e.name),onAction:l$(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:xj(t,n),onAction:l$(t,n)})}},d$=function(t){QN.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:kj(t,e.action)})}))},m$=function(t){QN.each([{name:"blockquote",text:"Blockquote",action:"mceBlockQuote",icon:"quote"}],(function(e){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onAction:kj(t,e.action),onSetup:xj(t,e.name)})}))},g$=function(t){f$(t),d$(t),m$(t)},h$=function(t){QN.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:kj(t,e.action)})})),t.ui.registry.addMenuItem("codeformat",{text:"Code",icon:"sourcecode",onAction:l$(t,"code")})},p$=function(t){g$(t),h$(t)},v$=function(t,e){return Cj(t,"Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",(function(n){n.setDisabled(t.mode.isReadOnly()||!t.undoManager[e]())}))},b$=function(t){t.ui.registry.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onSetup:v$(t,"hasUndo"),onAction:kj(t,"undo")}),t.ui.registry.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onSetup:v$(t,"hasRedo"),onAction:kj(t,"redo")})},y$=function(t){t.ui.registry.addButton("undo",{tooltip:"Undo",icon:"undo",disabled:!0,onSetup:v$(t,"hasUndo"),onAction:kj(t,"undo")}),t.ui.registry.addButton("redo",{tooltip:"Redo",icon:"redo",disabled:!0,onSetup:v$(t,"hasRedo"),onAction:kj(t,"redo")})},w$=function(t){b$(t),y$(t)},x$=function(t){return Cj(t,"VisualAid",(function(e){e.setActive(t.hasVisual)}))},C$=function(t){t.ui.registry.addToggleMenuItem("visualaid",{text:"Visual aids",onSetup:x$(t),onAction:kj(t,"mceToggleVisualAid")})},S$=function(t){t.ui.registry.addButton("visualaid",{tooltip:"Visual aids",text:"Visual aids",onAction:kj(t,"mceToggleVisualAid")})},k$=function(t){S$(t),C$(t)},T$=function(t,e){Yq(t),p$(t),u$(t,e),w$(t),e_(t),k$(t),s$(t),i$(t)},O$=function(t,e){return{type:"makeshift",x:t,y:e}},E$=function(t,e,n){return O$(t.x+e,t.y+n)},_$=function(t){return"longpress"===t.type||0===t.type.indexOf("touch")},A$=function(t){if(_$(t)){var e=t.touches[0];return O$(e.pageX,e.pageY)}return O$(t.pageX,t.pageY)},D$=function(t){if(_$(t)){var e=t.touches[0];return O$(e.clientX,e.clientY)}return O$(t.clientX,t.clientY)},M$=function(t,e){var n=dT.DOM.getPos(t);return E$(e,n.x,n.y)},R$=function(t,e){return"contextmenu"===e.type||"longpress"===e.type?t.inline?A$(e):M$(t.getContentAreaContainer(),D$(e)):N$(t)},N$=function(t){return{type:"selection",root:ee.fromDom(t.selection.getNode())}},z$=function(t){return{type:"node",node:L.some(ee.fromDom(t.selection.getNode())),root:ee.fromDom(t.getBody())}},B$=function(t,e,n){switch(n){case"node":return z$(t);case"point":return R$(t,e);case"selection":return N$(t)}},L$=function(t,e,n,r,o,i){var u=n(),a=B$(t,e,i);qB(u,jS.CLOSE_ON_EXECUTE,r,!1).map((function(t){e.preventDefault(),eC.showMenuAt(o,{anchor:a},{menu:{markers:mk("normal")},data:t})}))},H$={onLtr:function(){return[$l,Vl,Ul,jl,Wl,ql,mC,gC,dC,lC,fC,sC]},onRtl:function(){return[$l,Ul,Vl,Wl,jl,ql,mC,gC,fC,sC,dC,lC]}},I$=12,P$={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"]},F$=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=ng(t.getWin(),km.domRange(o));return i.exists((function(t){return t.left<=r.clientX&&t.right>=r.clientX&&t.top<=r.clientY&&t.bottom>=r.clientY}))},V$=function(t){var e=t.selection.getRng(),n=function(){xC.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)}},U$=function(t,e,n){var r=B$(t,e,n),o="point"===n?I$:0;return A({bubble:Rd(0,o,P$),layouts:H$,overrides:{maxWidthFunction:xU(),maxHeightFunction:Ed()}},r)},j$=function(t,e,n,r,o,i,u){var a=U$(t,e,i);qB(n,jS.CLOSE_ON_EXECUTE,r,!0).map((function(n){e.preventDefault(),eC.showMenuWithinBounds(o,{anchor:a},{menu:{markers:mk("normal"),highlightImmediately:u},data:n,type:"horizontal"},(function(){return L.some(Oq(t,r.shared,"node"===i?"node":"selection"))})),t.fire(lq)}))},W$=function(t,e,n,r,o,i){var u=en(),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();j$(t,e,u,r,o,i,f())};if((c||a)&&"node"!==i){var m=function(){V$(t),d()};F$(t,e)?m():(t.once("selectionchange",m),t.once("touchend",(function(){return t.off("selectionchange",m)})))}else d()},q$=function(t){return"string"===typeof t?t.split(/[ ,]/):t},$$=function(t){return t.getParam("contextmenu_never_use_native",!1,"boolean")},G$=function(t,e,n){var r=t.ui.registry.getAll().contextMenus;return L.from(t.getParam(e)).map(q$).getOrThunk((function(){return Y(q$(n),(function(t){return Et(r,t)}))}))},K$=function(t){return!1===t.getParam("contextmenu")},X$=function(t){return G$(t,"contextmenu","link linkchecker image imagetools table spellchecker configurepermanentpen")},Y$=function(t){return t.getParam("contextmenu_avoid_overlap","","string")},J$=function(t){return i(t)?"|"===t:"separator"===t.type},Q$={type:"separator"},Z$=function(t){var e=function(t){return{text:t.text,icon:t.icon,disabled:t.disabled,shortcut:t.shortcut}};if(i(t))return t;switch(t.type){case"separator":return Q$;case"submenu":return A(A({type:"nestedmenuitem"},e(t)),{getSubmenuItems:function(){var e=t.getSubmenuItems();return i(e)?e:$(e,Z$)}});default:return A(A({type:"menuitem"},e(t)),{onAction:v(t.onAction)})}},tG=function(t,e){if(0===e.length)return t;var n=dt(t).filter((function(t){return!J$(t)})),r=n.fold((function(){return[]}),(function(t){return[Q$]}));return t.concat(r).concat(e).concat([Q$])},eG=function(t,e,n){var r=Q(e,(function(e,r){return Ot(t,r.toLowerCase()).map((function(t){var r=t.update(n);if(i(r))return tG(e,r.split(" "));if(r.length>0){var o=$(r,Z$);return tG(e,o)}return e})).getOrThunk((function(){return e.concat([r])}))}),[]);return r.length>0&&J$(r[r.length-1])&&r.pop(),r},nG=function(t,e){return e.ctrlKey&&!$$(t)},rG=function(t,e){return"longpress"!==e.type&&(2!==e.button||e.target===t.getBody()&&""===e.pointerType)},oG=function(t,e){return rG(t,e)?t.selection.getStart(!0):e.target},iG=function(t,e){var n=Y$(t),r=rG(t,e)?"selection":"point";if(Gt(n)){var o=oG(t,e),i=L_(ee.fromDom(o),n);return i?"node":r}return r},uG=function(t,e,n){var r=en(),o=r.deviceType.isTouch,i=Es(eC.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:mf([Vw("dismissContextMenu",[Ra(ga(),(function(e,n){bh.close(e),t.focus()}))])])})),u=function(t){return eC.hide(i)},a=function(e){if($$(t)&&e.preventDefault(),!nG(t,e)&&!K$(t)){var r=iG(t,e),u=function(){var n=oG(t,e),r=t.ui.registry.getAll(),o=X$(t);return eG(r.contextMenus,o,n)},a=o()?W$:L$;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)}))},aG=uu.generate([{offset:["x","y"]},{absolute:["x","y"]},{fixed:["x","y"]}]),cG=function(t){return function(e){return e.translate(-t.left,-t.top)}},sG=function(t){return function(e){return e.translate(t.left,t.top)}},lG=function(t){return function(e,n){return Q(t,(function(t,e){return e(t)}),lr(e,n))}},fG=function(t,e,n){return t.fold(lG([sG(n),cG(e)]),lG([cG(e)]),lG([]))},dG=function(t,e,n){return t.fold(lG([sG(n)]),lG([]),lG([sG(e)]))},mG=function(t,e,n){return t.fold(lG([]),lG([cG(n)]),lG([sG(e),cG(n)]))},gG=function(t,e,n,r,o,i){var u=dG(t,o,i),a=dG(e,o,i);return Math.abs(u.left-a.left)<=n&&Math.abs(u.top-a.top)<=r},hG=function(t,e,n,r,o,i){var u=dG(t,o,i),a=dG(e,o,i),c=Math.abs(u.left-a.left),s=Math.abs(u.top-a.top);return lr(c,s)},pG=function(t,e,n){var r=t.fold((function(t,e){return{position:L.some("absolute"),left:L.some(t+"px"),top:L.some(e+"px")}}),(function(t,e){return{position:L.some("absolute"),left:L.some(t-n.left+"px"),top:L.some(e-n.top+"px")}}),(function(t,e){return{position:L.some("fixed"),left:L.some(t+"px"),top:L.some(e+"px")}}));return A({right:L.none(),bottom:L.none()},r)},vG=function(t,e,n){return t.fold((function(t,r){return yG(t+e,r+n)}),(function(t,r){return wG(t+e,r+n)}),(function(t,r){return xG(t+e,r+n)}))},bG=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(mG,yG),o(dG,wG),o(fG,xG))},yG=aG.offset,wG=aG.absolute,xG=aG.fixed,CG=function(t,e){var n=Un(t,e);return l(n)?NaN:parseInt(n,10)},SG=function(t,e){var n=t.element,r=CG(n,e.leftAttr),o=CG(n,e.topAttr);return isNaN(r)||isNaN(o)?L.none():L.some(lr(r,o))},kG=function(t,e,n){var r=t.element;Fn(r,e.leftAttr,n.left+"px"),Fn(r,e.topAttr,n.top+"px")},TG=function(t,e){var n=t.element;qn(n,e.leftAttr),qn(n,e.topAttr)},OG=function(t,e,n,r){return SG(t,e).fold((function(){return n}),(function(t){return xG(t.left+r.left,t.top+r.top)}))},EG=function(t,e,n,r,o,i){var u=OG(t,e,n,r),a=e.mustSnap?DG(t,e,u,o,i):MG(t,e,u,o,i),c=fG(u,o,i);return kG(t,e,c),a.fold((function(){return{coord:xG(c.left,c.top),extra:L.none()}}),(function(t){return{coord:t.output,extra:t.extra}}))},_G=function(t,e){TG(t,e)},AG=function(t,e,n,r){return gt(t,(function(t){var o=t.sensor,i=gG(e,o,t.range.left,t.range.top,n,r);return i?L.some({output:bG(t.output,e,n,r),extra:t.extra}):L.none()}))},DG=function(t,e,n,r,o){var i=e.getSnapPoints(t),u=AG(i,n,r,o);return u.orThunk((function(){var t=Q(i,(function(t,e){var i=e.sensor,u=hG(n,i,e.range.left,e.range.top,r,o);return t.deltas.fold((function(){return{deltas:L.some(u),snap:L.some(e)}}),(function(n){var r=(u.left+u.top)/2,o=(n.left+n.top)/2;return r<=o?{deltas:L.some(u),snap:L.some(e)}:t}))}),{deltas:L.none(),snap:L.none()});return t.snap.map((function(t){return{output:bG(t.output,n,r,o),extra:t.extra}}))}))},MG=function(t,e,n,r,o){var i=e.getSnapPoints(t);return AG(i,n,r,o)},RG=function(t,e,n){return{coord:bG(t.output,t.output,e,n),extra:t.extra}},NG=function(t,e,n,r){var o=e.getTarget(t.element);if(e.repositionTarget){var i=mn(t.element),u=Hr(i),a=qP(o),c=RG(r,u,a),s=pG(c.coord,u,a);Yn(o,s)}},zG=Object.freeze({__proto__:null,snapTo:NG}),BG="data-initial-z-index",LG=function(t){vn(t.element).filter(le).each((function(t){jn(t,BG).fold((function(){return nr(t,"z-index")}),(function(e){return Kn(t,"z-index",e)})),qn(t,BG)}))},HG=function(t){vn(t.element).filter(le).each((function(e){Zn(e,"z-index").each((function(t){Fn(e,BG,t)})),Kn(e,"z-index",Jn(t.element,"z-index"))}))},IG=function(t,e){t.getSystem().addToGui(e),HG(e)},PG=function(t){LG(t),t.getSystem().removeFromGui(t)},FG=function(t,e,n){return t.getSystem().build(sA.sketch({dom:{styles:{left:"0px",top:"0px",width:"100%",height:"100%",position:"fixed","z-index":"1000000000000000"},classes:[e]},events:n}))},VG=$i("snaps",[Ai("getSnapPoints"),al("onSensor"),Ai("leftAttr"),Ai("topAttr"),Ki("lazyViewport",Zr),Ki("mustSnap",!1)]),UG=[Ki("useFixed",O),Ai("blockerClass"),Ki("getTarget",x),Ki("onDrag",p),Ki("repositionTarget",!0),Ki("onDrop",p),tu("getBounds",Zr),VG],jG=function(t){return zt(Zn(t,"left"),Zn(t,"top"),Zn(t,"position"),(function(t,e,n){var r="fixed"===n?xG:yG;return r(parseInt(t,10),parseInt(e,10))})).getOrThunk((function(){var e=mr(t);return wG(e.left,e.top)}))},WG=function(t,e,n,r,o){var i=o.bounds,u=dG(e,n,r),a=_l(u.left,i.x,i.x+i.width-o.width),c=_l(u.top,i.y,i.y+i.height-o.height),s=wG(a,c);return e.fold((function(){var t=mG(s,n,r);return yG(t.left,t.top)}),w(s),(function(){var t=fG(s,n,r);return xG(t.left,t.top)}))},qG=function(t,e,n,r,o,i,u){var a=e.fold((function(){var t=vG(n,i.left,i.top),e=fG(t,r,o);return xG(e.left,e.top)}),(function(e){var u=EG(t,e,n,i,r,o);return u.extra.each((function(n){e.onSensor(t,n)})),u.coord}));return WG(t,a,r,o,u)},$G=function(t,e,n,r){var o=e.getTarget(t.element);if(e.repositionTarget){var i=mn(t.element),u=Hr(i),a=qP(o),c=jG(o),s=qG(t,e.snaps,c,u,a,r,n),l=pG(s,u,a);Yn(o,l)}e.onDrag(t,o,r)},GG=function(t,e){return{bounds:t.getBounds(),height:ar(e.element),width:br(e.element)}},KG=function(t,e,n,r,o){var i=n.update(r,o),u=n.getStartData().getOrThunk((function(){return GG(e,t)}));i.each((function(n){$G(t,e,u,n)}))},XG=function(t,e,n,r){e.each(PG),n.snaps.each((function(e){_G(t,e)}));var o=n.getTarget(t.element);r.reset(),n.onDrop(t,o)},YG=function(t){return function(e,n){var r=function(t){n.setStartData(GG(e,t))};return _a(M([Ra(la(),(function(t){n.getStartData().each((function(){return r(t)}))}))],t(e,n,r),!0))}},JG=function(t){return _a([Ra(Nu(),t.forceDrop),Ra(Lu(),t.drop),Ra(zu(),(function(e,n){t.move(n.event)})),Ra(Bu(),t.delayDrop)])},QG=function(t){return L.from(lr(t.x,t.y))},ZG=function(t,e){return lr(e.left-t.left,e.top-t.top)},tK=Object.freeze({__proto__:null,getData:QG,getDelta:ZG}),eK=function(t,e,n){return[Ra(Nu(),(function(r,o){var i=o.event.raw;if(0===i.button){o.stop();var u=function(){return XG(r,L.some(s),t,e)},a=H_(u,200),c={drop:u,delayDrop:a.schedule,forceDrop:u,move:function(n){a.cancel(),KG(r,t,e,tK,n)}},s=FG(r,t.blockerClass,JG(c)),l=function(){n(r),IG(r,s)};l()}}))]},nK=M(M([],UG,!0),[fl("dragger",{handlers:YG(eK)})],!1),rK=function(t){return _a([Ra(Au(),t.forceDrop),Ra(Mu(),t.drop),Ra(Ru(),t.drop),Ra(Du(),(function(e,n){t.move(n.event)}))])},oK=function(t){var e=t[0];return L.some(lr(e.clientX,e.clientY))},iK=function(t){var e=t.raw,n=e.touches;return 1===n.length?oK(n):L.none()},uK=function(t,e){return lr(e.left-t.left,e.top-t.top)},aK=Object.freeze({__proto__:null,getData:iK,getDelta:uK}),cK=function(t,e,n){var r=od(),o=function(n){XG(n,r.get(),t,e),r.clear()};return[Ra(Au(),(function(i,u){u.stop();var a=function(){return o(i)},c={drop:a,delayDrop:p,forceDrop:a,move:function(n){KG(i,t,e,aK,n)}},s=FG(i,t.blockerClass,rK(c));r.set(s);var l=function(){n(i),IG(i,s)};l()})),Ra(Du(),(function(n,r){r.stop(),KG(n,t,e,aK,r.event)})),Ra(Mu(),(function(t,e){e.stop(),o(t)})),Ra(Ru(),o)]},sK=M(M([],UG,!0),[fl("dragger",{handlers:YG(cK)})],!1),lK=function(t,e,n){return M(M([],eK(t,e,n),!0),cK(t,e,n),!0)},fK=M(M([],UG,!0),[fl("dragger",{handlers:YG(lK)})],!1),dK=nK,mK=sK,gK=fK,hK=Object.freeze({__proto__:null,mouse:dK,touch:mK,mouseOrTouch:gK}),pK=function(){var t=L.none(),e=L.none(),n=function(){t=L.none(),e=L.none()},r=function(e,n){var r=t.map((function(t){return e.getDelta(t,n)}));return t=L.some(n),r},o=function(t,e){return t.getData(e).bind((function(e){return r(t,e)}))},i=function(t){e=L.some(t)},u=function(){return e},a=w({});return Tc({readState:a,reset:n,update:o,getStartData:u,setStartData:i})},vK=Object.freeze({__proto__:null,init:pK}),bK=vf({branchKey:"mode",branches:hK,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:L.from(t.extra)}}},state:vK,apis:zG}),yK=40,wK=yK/2,xK=function(t,e,n,r,o,i){return t.fold((function(){return bK.snap({sensor:wG(n-wK,r-wK),range:lr(o,i),output:wG(L.some(n),L.some(r)),extra:{td:e}})}),(function(t){var o=n-wK,i=r-wK,u=yK,a=yK,c=t.element.dom.getBoundingClientRect();return bK.snap({sensor:wG(o,i),range:lr(u,a),output:wG(L.some(n-c.width/2),L.some(r-c.height/2)),extra:{td:e}})}))},CK=function(t,e,n){var r=function(t,e){return t.exists((function(t){return sn(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(i),n(i))},mustSnap:!0}},SK=function(t){return kC(SC.sketch({dom:{tag:"div",classes:["tox-selector"]},buttonBehaviours:mf([bK.config({mode:"mouseOrTouch",blockerClass:"blocker",snaps:t}),VD.config({})]),eventOrder:{mousedown:["dragging","alloy.base.behaviour"],touchstart:["dragging","alloy.base.behaviour"]}}))},kK=function(t,e){var n=ou([]),r=ou([]),o=ou(!1),i=od(),u=od(),a=function(t){var n=Qr(t);return xK(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=Qr(t);return xK(g.getOpt(e),t,n.right,n.bottom,n.width,n.height)},l=function(){return $(r.get(),(function(t){return s(t)}))},f=CK(c,i,(function(e){u.get().each((function(n){t.fire("TableSelectorChange",{start:e,finish:n})}))})),d=CK(l,u,(function(e){i.get().each((function(n){t.fire("TableSelectorChange",{start:n,finish:e})}))})),m=SK(f),g=SK(d),h=Es(m.asSpec()),p=Es(g.asSpec()),v=function(e,n,r,o){var i=n.dom.getBoundingClientRect();nr(e.element,"display");var u=pn(ee.fromDom(t.getBody())).dom.innerHeight,a=r(i),c=o(i,u);(a||c)&&Kn(e.element,"display","none")},b=function(t,e,n,r){var o=n(e);bK.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")},C=function(){return u.get().each(x)};en().deviceType.isTouch()&&(t.on("TableSelectionChange",(function(t){o.get()||(Wg(e,h),Wg(e,p),o.set(!0)),i.set(t.start),u.set(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(),C()})),t.on("TableSelectionClear",(function(){o.get()&&(Gg(h),Gg(p),o.set(!1)),i.clear(),u.clear()})))},TK=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},OK=function(t,e,n){e.delimiter||(e.delimiter="»");var r=function(r){var o=r||[],i=$(o,(function(e,r){return SC.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:mf([mO.button(n.isDisabled),cO()])})})),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&&!TK(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:mf([Aw.config({mode:"flow",selector:"div[role=button]"}),Hv.config({disabled:n.isDisabled}),cO(),yA.config({}),Pw.config({}),Vw("elementPathEvents",[Ua((function(e,n){t.shortcuts.add("alt+F11","focus statusbar elementpath",(function(){return Aw.focusIn(e)})),t.on("NodeChange",(function(t){var n=o(t.parents);n.length>0?Pw.set(e,r(n)):Pw.set(e,[])}))}))])]),components:[]}};(function(t){t[t["None"]=0]="None",t[t["Both"]=1]="Both",t[t["Vertical"]=2]="Vertical"})(Dj||(Dj={}));var EK=function(t,e,n,r,o){var i={};return i.height=ZW(r+e.top,wT(t),CT(t)),n===Dj.Both&&(i.width=ZW(o+e.left,yT(t),xT(t))),i},_K=function(t,e,n){var r=ee.fromDom(t.getContainer()),o=EK(t,e,n,ur(r),vr(r));vt(o,(function(t,e){return Kn(r,e,QW(t))})),vE(t)},AK=function(t){var e=!t.hasPlugin("autoresize"),n=t.getParam("resize",e);return!1===n?Dj.None:"both"===n?Dj.Both:Dj.Vertical},DK=function(t,e,n,r){var o=20,i=lr(n*o,r*o);return _K(t,i,e),L.some(!0)},MK=function(t,e){var n=AK(t);return n===Dj.None?L.none():L.some(LC("resize-handle",{tag:"div",classes:["tox-statusbar__resize-handle"],attributes:{title:e.translate("Resize")},behaviours:[bK.config({mode:"mouse",repositionTarget:!1,onDrag:function(e,r,o){return _K(t,o,n)},blockerClass:"tox-blocker"}),Aw.config({mode:"special",onLeft:function(){return DK(t,n,-1,0)},onRight:function(){return DK(t,n,1,0)},onUp:function(){return DK(t,n,0,-1)},onDown:function(){return DK(t,n,0,1)}}),yA.config({}),Yw.config({})]},e.icons))},RK=function(t,e){var n,r=function(t,n,r){return Pw.set(t,[Ss(e.translate(["{0} "+r,n[r]]))])};return SC.sketch({dom:{tag:"button",classes:["tox-statusbar__wordcount"]},components:[],buttonBehaviours:mf([mO.button(e.isDisabled),cO(),yA.config({}),Pw.config({}),tp.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),Vw("wordcount-events",[qa((function(t){var e=tp.getValue(t),n="words"===e.mode?"characters":"words";tp.setValue(t,{mode:n,count:e.count}),r(t,e.count,n)})),Ua((function(e){t.on("wordCountUpdate",(function(t){var n=tp.getValue(e).mode;tp.setValue(e,{mode:n,count:t.wordCount}),r(e,t.wordCount,n)}))}))])]),eventOrder:(n={},n[ea()]=["disabling","alloy.base.behaviour","wordcount-events"],n)})},NK=function(t,e){var n=function(){var t=TC.translate(["Powered by {0}","Tiny"]),e=''+t+"";return{dom:{tag:"span",classes:["tox-statusbar__branding"],innerHtml:e}}},r=function(){var r=[];return t.getParam("elementpath",!0,"boolean")&&r.push(OK(t,{},e)),t.hasPlugin("wordcount")&&r.push(RK(t,e)),t.getParam("branding",!0,"boolean")&&r.push(n()),r.length>0?[{dom:{tag:"div",classes:["tox-statusbar__text-container"]},components:r}]:[]},o=function(){var n=r(),o=MK(t,e);return n.concat(o.toArray())};return{dom:{tag:"div",classes:["tox-statusbar"]},components:o()}},zK=function(t){var e,n=t.inline,r=n?cq:YW,o=qT(t)?IF:jP,i=L.none(),u=en(),a=u.browser.isIE(),c=a?["tox-platform-ie"]:[],s=u.deviceType.isTouch(),l="tox-platform-touch",f=s?[l]:[],d=HT(t),m=jT(t),g=TC.isRtl()?{attributes:{dir:"rtl"}}:{},h={attributes:(e={},e[Hd]=d?Pf.BottomToTop:Pf.TopToBottom,e)},v=function(){return i.bind(aj.getHeader)},b=function(){return o.isDocked(v)},y=function(){Kn(Q.element,"width",document.body.clientWidth+"px")},w=function(){var t=sn(Hn(),m)&&"grid"===Jn(m,"display"),e={dom:A({tag:"div",classes:["tox","tox-silver-sink","tox-tinymce-aux"].concat(c).concat(f)},g),behaviours:mf([Ig.config({useFixed:function(){return b()}})])},n={dom:{styles:{width:document.body.clientWidth+"px"}},events:_a([Ra(fa(),y)])};return Co(e,t?n:{})},x=Es(w()),C=function(){return ro.value(x)},S=kC({dom:{tag:"div",classes:["tox-anchorbar"]}}),k=function(){return i.bind((function(t){return S.getOpt(t)})).getOrDie("Could not find a anchor bar element")},T=function(){return i.bind((function(t){return aj.getToolbar(t)})).getOrDie("Could not find more toolbar element")},O=function(){return i.bind((function(t){return aj.getThrobber(t)})).getOrDie("Could not find throbber element")},E=kP(x,t,k),_=aj.parts.menubar({dom:{tag:"div",classes:["tox-menubar"]},backstage:E,onEscape:function(){t.focus()}}),D=NT(t),M=aj.parts.toolbar(A({dom:{tag:"div",classes:["tox-toolbar"]},getSink:C,providers:E.shared.providers,onEscape:function(){t.focus()},type:D,lazyToolbar:T,lazyHeader:function(){return v().getOrDie("Could not find header element")}},h)),R=aj.parts["multiple-toolbar"]({dom:{tag:"div",classes:["tox-toolbar-overlord"]},providers:E.shared.providers,onEscape:function(){t.focus()},type:D}),N=aj.parts.socket({dom:{tag:"div",classes:["tox-edit-area"]}}),z=aj.parts.sidebar({dom:{tag:"div",classes:["tox-sidebar"]}}),B=aj.parts.throbber({dom:{tag:"div",classes:["tox-throbber"]},backstage:E}),H=t.getParam("statusbar",!0,"boolean"),I=H&&!n?L.some(NK(t,E.shared.providers)):L.none(),P={dom:{tag:"div",classes:["tox-sidebar-wrap"]},components:[N,z]},F=MT(t),V=AT(t),U=_T(t),j=function(){return F?[R]:V?[M]:[]},W=aj.parts.header({dom:A({tag:"div",classes:["tox-editor-header"]},h),components:nt([U?[_]:[],j(),UT(t)?[]:[S.asSpec()]]),sticky:qT(t),editor:t,sharedBackstage:E.shared}),q=nt([d?[]:[W],n?[]:[P],d?[W]:[]]),$={dom:{tag:"div",classes:["tox-editor-container"]},components:q},G=nt([[$],n?[]:I.toArray(),[B]]),K=WT(t),X=A(A({role:"application"},TC.isRtl()?{dir:"rtl"}:{}),K?{"aria-hidden":"true"}:{}),Y=Es(aj.sketch({dom:{tag:"div",classes:["tox","tox-tinymce"].concat(n?["tox-tinymce-inline"]:[]).concat(d?["tox-tinymce--toolbar-bottom"]:[]).concat(f).concat(c),styles:A({visibility:"hidden"},K?{opacity:"0",border:"0"}:{}),attributes:X},components:G,behaviours:mf([cO(),Hv.config({disableClass:"tox-tinymce--disabled"}),Aw.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, .tox-statusbar__resize-handle"})])}));i=L.some(Y),t.shortcuts.add("alt+F9","focus menubar",(function(){aj.focusMenubar(Y)})),t.shortcuts.add("alt+F10","focus toolbar",(function(){aj.focusToolbar(Y)})),t.addCommand("ToggleToolbarDrawer",(function(){aj.toggleToolbarDrawer(Y)})),t.addQueryStateHandler("ToggleToolbarDrawer",(function(){return aj.isToolbarDrawerToggled(Y)}));var J=lA(Y),Q=lA(x);TP(t,J,Q);var Z=function(){var t={broadcastAll:Q.broadcast,broadcastOn:Q.broadcastOn,register:p};return{channels:t}},tt=function(){var e=QW(eq(t)),n=QW(rq(t));return t.inline||(er("div","width",n)&&Kn(Y.element,"width",n),er("div","height",e)?Kn(Y.element,"height",e):Kn(Y.element,"height","200px")),e},et=function(){o.setup(t,E.shared,v),T$(t,E),uG(t,C,E),RV(t),iU(t,O,E.shared),bt(BT(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=DT(t),s={menuItems:i,menus:KT(t),menubar:XT(t),toolbar:c.getOrThunk((function(){return YT(t)})),allowToolbarGroups:D===US.floating,buttons:n,sidebar:a};Xq(t,u,x,{backstage:E}),kK(t,x);var l=t.getElement(),f=tt(),d={mothership:J,uiMothership:Q,outerContainer:Y},m={targetNode:l,height:f};return r.render(t,d,s,E,m)};return{mothership:J,uiMothership:Q,backstage:E,renderUI:et,getUi:Z}},BK=function(t,e){var n=L.from(Un(t,"id")).fold((function(){var t=oc("dialog-describe");return Fn(e,"id",t),t}),x);Fn(t,"aria-describedby",n)},LK=function(t,e){var n=jn(t,"id").fold((function(){var t=oc("dialog-label");return Fn(e,"id",t),t}),x);Fn(t,"aria-labelledby",n)},HK=w([Ai("lazySink"),Fi("dragBlockClass"),tu("getBounds",Zr),Ki("useTabstopAt",E),Ki("eventOrder",{}),ep("modalBehaviours",[Aw]),cl("onExecute"),ll("onEscape")]),IK={sketch:x},PK=w([Bp({name:"draghandle",overrides:function(t,e){return{behaviours:mf([bK.config({mode:"mouse",getTarget:function(t){return Ls(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})])}}}),Np({schema:[Ai("dom")],name:"title"}),Np({factory:IK,schema:[Ai("dom")],name:"close"}),Np({factory:IK,schema:[Ai("dom")],name:"body"}),Bp({factory:IK,schema:[Ai("dom")],name:"footer"}),zp({factory:{sketch:function(t,e){return A(A({},t),{dom:e.dom,components:e.components})}},schema:[Ki("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),Ki("components",[])],name:"blocker"})]),FK=function(t,e,n,r){var o,i=od(),u=function(e){i.set(e);var n=t.lazySink(e).getOrDie(),o=r.blocker(),u=n.getSystem().build(A(A({},o),{components:o.components.concat([_s(e)]),behaviours:mf([Yw.config({}),Vw("dialog-blocker-events",[Va(Iu(),(function(){Aw.focusIn(e)}))])])}));Wg(n,u),Aw.focusIn(e)},a=function(t){i.clear(),vn(t.element).each((function(e){t.getSystem().getByDom(e).each((function(t){Gg(t)}))}))},c=function(e){return Xp(e,t,"body")},s=function(e){return Xp(e,t,"footer")},l=function(t,e){KV.block(t,e)},f=function(t){KV.unblock(t)},d=oc("modal-events"),m=A(A({},t.eventOrder),(o={},o[da()]=[d].concat(t.eventOrder["alloy.system.attached"]||[]),o));return{uid:t.uid,dom:t.dom,components:e,apis:{show:u,hide:a,getBody:c,getFooter:s,setIdle:f,setBusy:l},eventOrder:m,domModification:{attributes:{role:"dialog","aria-modal":"true"}},behaviours:rp(t.modalBehaviours,[Pw.config({}),Aw.config({mode:"cyclic",onEnter:t.onExecute,onEscape:t.onEscape,useTabstopAt:t.useTabstopAt}),KV.config({getRoot:i.get}),Vw(d,[Ua((function(e){LK(e.element,Xp(e,t,"title").element),BK(e.element,Xp(e,t,"body").element)}))])])}},VK=mv({name:"ModalDialog",configFields:HK(),partFields:PK(),factory:FK,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)}}}),UK=ti([Ri("type"),Ri("name")].concat(Nk)),jK=li,WK=[Oi("name","name",To((function(){return oc("button-name")})),si),ji("icon"),Qi("align","end",["start","end"]),Zi("primary",!1),Zi("disabled",!1)],qK=M(M([],WK,!0),[Ri("text")],!1),$K=M([Ni("type",["submit","cancel","custom"])],qK,!0),GK=M([Ni("type",["menu"]),ji("text"),ji("tooltip"),ji("icon"),Pi("items",UK)],WK,!0),KK=ki("type",{submit:$K,cancel:$K,custom:$K,menu:GK}),XK=[Ri("type"),Ri("text"),Ni("level",["info","warn","error","success"]),Ri("icon"),Ki("url","")],YK=ti(XK),JK=function(t){return[Ri("type"),t]},QK=[Ri("type"),Ri("text"),Zi("disabled",!1),Zi("primary",!1),Oi("name","name",To((function(){return oc("button-name")})),si),ji("icon"),Zi("borderless",!1)],ZK=ti(QK),tX=[Ri("type"),Ri("name"),Ri("label"),Zi("disabled",!1)],eX=ti(tX),nX=li,rX=[Ri("type"),Ri("name")],oX=rX.concat([ji("label")]),iX=oX.concat([Ki("columns","auto")]),uX=ti(iX),aX=ii([Ri("value"),Ri("text"),Ri("icon")]),cX=oX,sX=ti(cX),lX=si,fX=oX,dX=ti(fX),mX=si,gX=rX.concat([Ji("tag","textarea"),Ri("scriptId"),Ri("scriptUrl"),eu("settings",void 0)]),hX=rX.concat([Ji("tag","textarea"),Bi("init")]),pX=vi((function(t){return wi("customeditor.old",Zo(hX),t).orThunk((function(){return wi("customeditor.new",Zo(gX),t)}))})),vX=si,bX=oX,yX=ti(bX),wX=pi(),xX=function(t){return[Ri("type"),Mi("columns"),t]},CX=[Ri("type"),Ri("html"),Qi("presets","presentation",["presentation","document"])],SX=ti(CX),kX=oX.concat([Zi("sandboxed",!0)]),TX=ti(kX),OX=si,EX=oX.concat([Di("currentState",ti([Ai("blob"),Ri("url")]))]),_X=ti(EX),AX=oX.concat([ji("inputMode"),ji("placeholder"),Zi("maximized",!1),Zi("disabled",!1)]),DX=ti(AX),MX=si,RX=function(t){return[Ri("type"),Ri("label"),t]},NX=[Ri("text"),Ri("value")],zX=[Ri("text"),Pi("items",Ti("items",(function(){return BX})))],BX=ni([ti(NX),ti(zX)]),LX=oX.concat([Pi("items",BX),Zi("disabled",!1)]),HX=ti(LX),IX=si,PX=oX.concat([Ii("items",[Ri("text"),Ri("value")]),Yi("size",1),Zi("disabled",!1)]),FX=ti(PX),VX=si,UX=oX.concat([Zi("constrain",!0),Zi("disabled",!1)]),jX=ti(UX),WX=ti([Ri("width"),Ri("height")]),qX=[Ri("type"),Pi("header",si),Pi("cells",ei(si))],$X=ti(qX),GX=oX.concat([ji("placeholder"),Zi("maximized",!1),Zi("disabled",!1)]),KX=ti(GX),XX=si,YX=oX.concat([Qi("filetype","file",["image","media","file"]),Ki("disabled",!1)]),JX=ti(YX),QX=ti([Ri("value"),Ki("meta",{})]),ZX=function(t){return Oi("items","items",ko(),ei(vi((function(e){return wi("Checking item of "+t,tY,e).fold((function(t){return ro.error(Si(t))}),(function(t){return ro.value(t)}))}))))},tY=Jo((function(){return hi("type",{alertbanner:YK,bar:ti(JK(ZX("bar"))),button:ZK,checkbox:eX,colorinput:sX,colorpicker:dX,dropzone:yX,grid:ti(xX(ZX("grid"))),iframe:TX,input:DX,listbox:HX,selectbox:FX,sizeinput:jX,textarea:KX,urlinput:JX,customeditor:pX,htmlpanel:SX,imagetools:_X,collection:uX,label:ti(RX(ZX("label"))),table:$X,panel:nY})})),eY=[Ri("type"),Ki("classes",[]),Pi("items",tY)],nY=ti(eY),rY=[Oi("name","name",To((function(){return oc("tab-name")})),si),Ri("title"),Pi("items",tY)],oY=[Ri("type"),Ii("tabs",rY)],iY=ti(oY),uY=qK,aY=KK,cY=ti([Ri("title"),Di("body",hi("type",{panel:nY,tabpanel:iY})),Ji("size","normal"),Pi("buttons",aY),Ki("initialData",{}),tu("onAction",p),tu("onChange",p),tu("onSubmit",p),tu("onClose",p),tu("onCancel",p),Ki("onTabChange",p)]),sY=function(t){return wi("dialog",cY,t)},lY=ti(M([Ni("type",["cancel","custom"])],uY,!0)),fY=ti([Ri("title"),Ri("url"),Ui("height"),Ui("width"),qi("buttons",lY),tu("onAction",p),tu("onCancel",p),tu("onClose",p),tu("onMessage",p)]),dY=function(t){return wi("dialog",fY,t)},mY=function(t){return u(t)?[t].concat(rt(Tt(t),mY)):a(t)?rt(t,mY):[]},gY=function(t){return i(t.type)&&i(t.name)},hY={checkbox:nX,colorinput:lX,colorpicker:mX,dropzone:wX,input:MX,iframe:OX,sizeinput:WX,selectbox:VX,listbox:IX,size:WX,textarea:XX,urlinput:QX,customeditor:vX,collection:aX,togglemenuitem:jK},pY=function(t){return L.from(hY[t.type])},vY=function(t){return Y(mY(t),gY)},bY=function(t){var e=vY(t),n=rt(e,(function(t){return pY(t).fold((function(){return[]}),(function(e){return[Di(t.name,e)]}))}));return ti(n)},yY=function(t){var e=xi(sY(t)),n=bY(t),r=t.initialData;return{internalDialog:e,dataValidator:n,initialData:r}},wY={open:function(t,e){var n=yY(e);return t(n.internalDialog,n.initialData,n.dataValidator)},openUrl:function(t,e){var n=xi(dY(e));return t(n)},redial:function(t){return yY(t)}},xY=function(t){var e=[],n={};return vt(t,(function(t,r){t.fold((function(){e.push(r)}),(function(t){n[r]=t}))})),e.length>0?ro.error(e):ro.value(n)},CY=function(t,e){var n=kC(NN.sketch((function(n){return{dom:{tag:"div",classes:["tox-form"].concat(t.classes)},components:$(t.items,(function(t){return aI(n,t,e)}))}})));return{dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[n.asSpec()]}],behaviours:mf([Aw.config({mode:"acyclic",useTabstopAt:k(vz)}),WN.memento(n),uz.memento(n,{postprocess:function(t){return xY(t).fold((function(t){return console.error(t),{}}),x)}})])}},SY=function(t,e){return{uid:t.uid,dom:t.dom,components:t.components,events:vx(t.action),behaviours:rp(t.tabButtonBehaviours,[Yw.config({}),Aw.config({mode:"execution",useSpace:!0,useEnter:!0}),tp.config({store:{mode:"memory",initialValue:t.value}})]),domModification:t.domModification}},kY=dv({name:"TabButton",configFields:[Ki("uid",void 0),Ai("value"),Oi("dom","dom",_o((function(){return{attributes:{role:"tab",id:oc("aria"),"aria-selected":"false"}}})),ui()),Fi("action"),Ki("domModification",{}),ep("tabButtonBehaviours",[Yw,Aw,tp]),Ai("view")],factory:SY}),TY=w([Ai("tabs"),Ai("dom"),Ki("clickToDismiss",!1),ep("tabbarBehaviours",[rb,Aw]),il(["tabClass","selectedClass"])]),OY=Lp({factory:kY,name:"tabs",unit:"tab",overrides:function(t){var e=function(t,e){rb.dehighlight(t,e),Sa(t,ya(),{tabbar:t,button:e})},n=function(t,e){rb.highlight(t,e),Sa(t,ba(),{tabbar:t,button:e})};return{action:function(r){var o=r.getSystem().getByUid(t.uid).getOrDie(),i=rb.isHighlighted(o,r),u=function(){return i&&t.clickToDismiss?e:i?p:n}();u(o,r)},domModification:{classes:[t.markers.tabClass]}}}}),EY=w([OY]),_Y=function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,"debug.sketcher":"Tabbar",domModification:{attributes:{role:"tablist"}},behaviours:rp(t.tabbarBehaviours,[rb.config({highlightClass:t.markers.selectedClass,itemClass:t.markers.tabClass,onHighlight:function(t,e){Fn(e.element,"aria-selected","true")},onDehighlight:function(t,e){Fn(e.element,"aria-selected","false")}}),Aw.config({mode:"flow",getInitial:function(t){return rb.getHighlighted(t).map((function(t){return t.element}))},selector:"."+t.markers.tabClass,executeOnMove:!0})])}},AY=mv({name:"Tabbar",configFields:TY(),partFields:EY(),factory:_Y}),DY=function(t,e){return{uid:t.uid,dom:t.dom,behaviours:rp(t.tabviewBehaviours,[Pw.config({})]),domModification:{attributes:{role:"tabpanel"}}}},MY=dv({name:"Tabview",configFields:[ep("tabviewBehaviours",[Pw])],factory:DY}),RY=w([Ki("selectFirst",!0),al("onChangeTab"),al("onDismissTab"),Ki("tabs",[]),ep("tabSectionBehaviours",[])]),NY=Np({factory:AY,schema:[Ai("dom"),Hi("markers",[Ai("tabClass"),Ai("selectedClass")])],name:"tabbar",defaults:function(t){return{tabs:t.tabs}}}),zY=Np({factory:MY,name:"tabview"}),BY=w([NY,zY]),LY=function(t,e,n,r){var o=function(e){var n=tp.getValue(e);Kp(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();jn(e.element,"id").each((function(t){Fn(r.element,"aria-labelledby",t)})),Pw.set(r,o),t.onChangeTab(r,e,o)}))}))},i=function(e,n){Kp(e,t,"tabbar").each((function(t){n(t).each(ka)}))};return{uid:t.uid,dom:t.dom,components:e,behaviours:np(t.tabSectionBehaviours),events:_a(nt([t.selectFirst?[Ua((function(t,e){i(t,rb.getFirst)}))]:[],[Ra(ba(),(function(t,e){var n=e.event.button;o(n)})),Ra(ya(),(function(e,n){var r=n.event.button;t.onDismissTab(e,r)}))]])),apis:{getViewItems:function(e){return Kp(e,t,"tabview").map((function(t){return Pw.contents(t)})).getOr([])},showTab:function(t,e){var n=function(t){var n=rb.getCandidates(t),r=tt(n,(function(t){return tp.getValue(t)===e}));return r.filter((function(e){return!rb.isHighlighted(t,e)}))};i(t,n)}}}},HY=mv({name:"TabSection",configFields:RY(),partFields:BY(),factory:LY,apis:{getViewItems:function(t,e){return t.getViewItems(e)},showTab:function(t,e,n){t.showTab(e,n)}}}),IY=function(t,e,n){return $(t,(function(r,o){Pw.set(n,t[o].view());var i=e.dom.getBoundingClientRect();return Pw.set(n,[]),i.height}))},PY=function(t){return ft(st(t,(function(t,e){return t>e?-1:t=n.dom.offsetLeft+vr(n),s=c?Math.max(ur(n),a):a,l=parseInt(Jn(t,"margin-top"),10)||0,f=parseInt(Jn(t,"margin-bottom"),10)||0,d=ur(t)+l+f,m=d-s;return r-m},VY=function(t,e){ft(t).each((function(t){return HY.showTab(e,t.value)}))},UY=function(t,e){Kn(t,"height",e+"px"),en().browser.isIE()?nr(t,"flex-basis"):Kn(t,"flex-basis",e+"px")},jY=function(t,e,n){Ls(t,'[role="dialog"]').each((function(t){Is(t,'[role="tablist"]').each((function(r){n.get().map((function(n){return Kn(e,"height","0"),Kn(e,"flex-basis","0"),Math.min(n,FY(t,e,r))})).each((function(t){UY(e,t)}))}))}))},WY=function(t){return Is(t,'[role="tabpanel"]')},qY=function(t){var e=function(){var e=od(),n=[Ua((function(n){var r=n.element;WY(r).each((function(o){Kn(o,"visibility","hidden"),n.getSystem().getByDom(o).toOptional().each((function(n){var r=IY(t,o,n),i=PY(r);i.fold(e.clear,e.set)})),jY(r,o,e),nr(o,"visibility"),VY(t,n),xC.requestAnimationFrame((function(){jY(r,o,e)}))}))})),Ra(fa(),(function(t){var n=t.element;WY(n).each((function(t){jY(n,t,e)}))})),Ra(BA,(function(t,n){var r=t.element;WY(r).each((function(t){var n=Of(An(t));Kn(t,"visibility","hidden");var o=Zn(t,"height").map((function(t){return parseInt(t,10)}));nr(t,"height"),nr(t,"flex-basis");var i=t.dom.getBoundingClientRect().height,u=o.forall((function(t){return i>t}));u?(e.set(i),jY(r,t,e)):o.each((function(e){UY(t,e)})),nr(t,"visibility"),n.each(Sf)}))}))],r=!1;return{extraEvents:n,selectFirst:r}}(),n=function(){var t=[],e=!0;return{extraEvents:t,selectFirst:e}}();return{smartTabHeight:e,naiveTabHeight:n}},$Y="send-data-to-section",GY="send-data-to-view",KY=function(t,e){var n=ou({}),r=function(t){var e=tp.getValue(t),r=xY(e).getOr({}),o=n.get(),i=Co(o,r);n.set(i)},o=function(t){var e=n.get();tp.setValue(t,e)},i=ou(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[NN.sketch((function(n){return{dom:{tag:"div",classes:["tox-form"]},components:$(t.items,(function(t){return aI(n,t,e)})),formBehaviours:mf([Aw.config({mode:"acyclic",useTabstopAt:k(vz)}),Vw("TabView.form.events",[Ua(o),ja(r)]),yf.config({channels:gu([{key:$Y,value:{onReceive:r}},{key:GY,value:{onReceive:o}}])})])}}))]}}})),a=qY(u).smartTabHeight;return HY.sketch({dom:{tag:"div",classes:["tox-dialog__body"]},onChangeTab:function(t,e,n){var r=tp.getValue(e);Sa(t,zA,{name:r,oldName:i.get()}),i.set(r)},tabs:u,components:[HY.parts.tabbar({dom:{tag:"div",classes:["tox-dialog__body-nav"]},components:[AY.parts.tabs({})],markers:{tabClass:"tox-tab",selectedClass:"tox-dialog__body-nav-item--active"},tabbarBehaviours:mf([yA.config({})])}),HY.parts.tabview({dom:{tag:"div",classes:["tox-dialog__body-content"]}})],selectFirst:a.selectFirst,tabSectionBehaviours:mf([Vw("tabpanel",a.extraEvents),Aw.config({mode:"acyclic"}),bv.config({find:function(t){return ft(HY.getViewItems(t))}}),tp.config({store:{mode:"manual",getValue:function(t){return t.getSystem().broadcastOn([$Y],{}),n.get()},setValue:function(t,e){n.set(e),t.getSystem().broadcastOn([GY],{})}}})])})},XY=oc("update-dialog"),YY=oc("update-title"),JY=oc("update-body"),QY=oc("update-footer"),ZY=oc("body-send-message"),tJ=function(t,e,n,r){var o=function(t){switch(t.body.type){case"tabpanel":return[KY(t.body,n)];default:return[CY(t.body,n)]}},i=function(t,e){return L.some({isTabPanel:function(){return"tabpanel"===e.body.type}})},u={"aria-live":"polite"};return{dom:{tag:"div",classes:["tox-dialog__content-js"],attributes:A(A({},e.map((function(t){return{id:t}})).getOr({})),r?u:{})},components:[],behaviours:mf([WN.childAt(0),gW.config({channel:JY,updateState:i,renderComponents:o,initialData:t})])}},eJ=function(t,e,n,r){return tJ(t,L.some(e),n,r)},nJ=function(t,e){var n=tJ(t,L.none(),e,!1);return VK.parts.body(n)},rJ=function(t){var e={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[gz({dom:{tag:"iframe",attributes:{src:t.url}},behaviours:mf([yA.config({}),Yw.config({})])})]}],behaviours:mf([Aw.config({mode:"acyclic",useTabstopAt:k(vz)})])};return VK.parts.body(e)};function oJ(t){return oJ="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oJ(t)}function iJ(t,e){return iJ=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},iJ(t,e)}function uJ(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function aJ(t,e,n){return aJ=uJ()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var o=Function.bind.apply(t,r),i=new o;return n&&iJ(i,n.prototype),i},aJ.apply(null,arguments)}function cJ(t){return sJ(t)||lJ(t)||fJ(t)||mJ()}function sJ(t){if(Array.isArray(t))return dJ(t)}function lJ(t){if("undefined"!==typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function fJ(t,e){if(t){if("string"===typeof t)return dJ(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?dJ(t,e):void 0}}function dJ(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n1?n-1:0),o=1;o/gm),ZJ=wJ(/^data-[\-\w.\u00B7-\uFFFF]/),tQ=wJ(/^aria-[\-\w]+$/),eQ=wJ(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),nQ=wJ(/^(?:\w+script|data):/i),rQ=wJ(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),oQ=wJ(/^html$/i),iQ=function(){return"undefined"===typeof window?null:window},uQ=function(t,e){if("object"!==oJ(t)||"function"!==typeof t.createPolicy)return null;var n=null,r="data-tt-policy-suffix";e.currentScript&&e.currentScript.hasAttribute(r)&&(n=e.currentScript.getAttribute(r));var o="dompurify"+(n?"#"+n:"");try{return t.createPolicy(o,{createHTML:function(t){return t}})}catch(i){return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function aQ(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:iQ(),e=function(t){return aQ(t)};if(e.version="2.3.8",e.removed=[],!t||!t.document||9!==t.document.nodeType)return e.isSupported=!1,e;var n=t.document,r=t.document,o=t.DocumentFragment,i=t.HTMLTemplateElement,u=t.Node,a=t.Element,c=t.NodeFilter,s=t.NamedNodeMap,l=void 0===s?t.NamedNodeMap||t.MozNamedAttrMap:s,f=t.HTMLFormElement,d=t.DOMParser,m=t.trustedTypes,g=a.prototype,h=PJ(g,"cloneNode"),p=PJ(g,"nextSibling"),v=PJ(g,"childNodes"),b=PJ(g,"parentNode");if("function"===typeof i){var y=r.createElement("template");y.content&&y.content.ownerDocument&&(r=y.content.ownerDocument)}var w=uQ(m,n),x=w?w.createHTML(""):"",C=r,S=C.implementation,k=C.createNodeIterator,T=C.createDocumentFragment,O=C.getElementsByTagName,E=n.importNode,_={};try{_=IJ(r).documentMode?r.documentMode:{}}catch(Vt){}var A={};e.isSupported="function"===typeof b&&S&&"undefined"!==typeof S.createHTMLDocument&&9!==_;var D,M,R=JJ,N=QJ,z=ZJ,B=tQ,L=nQ,H=rQ,I=eQ,P=null,F=HJ({},[].concat(cJ(FJ),cJ(VJ),cJ(UJ),cJ(WJ),cJ($J))),V=null,U=HJ({},[].concat(cJ(GJ),cJ(KJ),cJ(XJ),cJ(YJ))),j=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),W=null,q=null,$=!0,G=!0,K=!1,X=!1,Y=!1,J=!1,Q=!1,Z=!1,tt=!1,et=!1,nt=!0,rt=!0,ot=!1,it={},ut=null,at=HJ({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),ct=null,st=HJ({},["audio","video","img","source","image","track"]),lt=null,ft=HJ({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),dt="http://www.w3.org/1998/Math/MathML",mt="http://www.w3.org/2000/svg",gt="http://www.w3.org/1999/xhtml",ht=gt,pt=!1,vt=["application/xhtml+xml","text/html"],bt="text/html",yt=null,wt=r.createElement("form"),xt=function(t){return t instanceof RegExp||t instanceof Function},Ct=function(t){yt&&yt===t||(t&&"object"===oJ(t)||(t={}),t=IJ(t),P="ALLOWED_TAGS"in t?HJ({},t.ALLOWED_TAGS):F,V="ALLOWED_ATTR"in t?HJ({},t.ALLOWED_ATTR):U,lt="ADD_URI_SAFE_ATTR"in t?HJ(IJ(ft),t.ADD_URI_SAFE_ATTR):ft,ct="ADD_DATA_URI_TAGS"in t?HJ(IJ(st),t.ADD_DATA_URI_TAGS):st,ut="FORBID_CONTENTS"in t?HJ({},t.FORBID_CONTENTS):at,W="FORBID_TAGS"in t?HJ({},t.FORBID_TAGS):{},q="FORBID_ATTR"in t?HJ({},t.FORBID_ATTR):{},it="USE_PROFILES"in t&&t.USE_PROFILES,$=!1!==t.ALLOW_ARIA_ATTR,G=!1!==t.ALLOW_DATA_ATTR,K=t.ALLOW_UNKNOWN_PROTOCOLS||!1,X=t.SAFE_FOR_TEMPLATES||!1,Y=t.WHOLE_DOCUMENT||!1,Z=t.RETURN_DOM||!1,tt=t.RETURN_DOM_FRAGMENT||!1,et=t.RETURN_TRUSTED_TYPE||!1,Q=t.FORCE_BODY||!1,nt=!1!==t.SANITIZE_DOM,rt=!1!==t.KEEP_CONTENT,ot=t.IN_PLACE||!1,I=t.ALLOWED_URI_REGEXP||I,ht=t.NAMESPACE||gt,t.CUSTOM_ELEMENT_HANDLING&&xt(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(j.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&xt(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(j.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"===typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(j.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),D=D=-1===vt.indexOf(t.PARSER_MEDIA_TYPE)?bt:t.PARSER_MEDIA_TYPE,M="application/xhtml+xml"===D?function(t){return t}:_J,X&&(G=!1),tt&&(Z=!0),it&&(P=HJ({},cJ($J)),V=[],!0===it.html&&(HJ(P,FJ),HJ(V,GJ)),!0===it.svg&&(HJ(P,VJ),HJ(V,KJ),HJ(V,YJ)),!0===it.svgFilters&&(HJ(P,UJ),HJ(V,KJ),HJ(V,YJ)),!0===it.mathMl&&(HJ(P,WJ),HJ(V,XJ),HJ(V,YJ))),t.ADD_TAGS&&(P===F&&(P=IJ(P)),HJ(P,t.ADD_TAGS)),t.ADD_ATTR&&(V===U&&(V=IJ(V)),HJ(V,t.ADD_ATTR)),t.ADD_URI_SAFE_ATTR&&HJ(lt,t.ADD_URI_SAFE_ATTR),t.FORBID_CONTENTS&&(ut===at&&(ut=IJ(ut)),HJ(ut,t.FORBID_CONTENTS)),rt&&(P["#text"]=!0),Y&&HJ(P,["html","head","body"]),P.table&&(HJ(P,["tbody"]),delete W.tbody),yJ&&yJ(t),yt=t)},St=HJ({},["mi","mo","mn","ms","mtext"]),kt=HJ({},["foreignobject","desc","title","annotation-xml"]),Tt=HJ({},["title","style","font","a","script"]),Ot=HJ({},VJ);HJ(Ot,UJ),HJ(Ot,jJ);var Et=HJ({},WJ);HJ(Et,qJ);var _t=function(t){var e=b(t);e&&e.tagName||(e={namespaceURI:gt,tagName:"template"});var n=_J(t.tagName),r=_J(e.tagName);return t.namespaceURI===mt?e.namespaceURI===gt?"svg"===n:e.namespaceURI===dt?"svg"===n&&("annotation-xml"===r||St[r]):Boolean(Ot[n]):t.namespaceURI===dt?e.namespaceURI===gt?"math"===n:e.namespaceURI===mt?"math"===n&&kt[r]:Boolean(Et[n]):t.namespaceURI===gt&&(!(e.namespaceURI===mt&&!kt[r])&&(!(e.namespaceURI===dt&&!St[r])&&(!Et[n]&&(Tt[n]||!Ot[n]))))},At=function(t){EJ(e.removed,{element:t});try{t.parentNode.removeChild(t)}catch(Vt){try{t.outerHTML=x}catch(Vt){t.remove()}}},Dt=function(t,n){try{EJ(e.removed,{attribute:n.getAttributeNode(t),from:n})}catch(Vt){EJ(e.removed,{attribute:null,from:n})}if(n.removeAttribute(t),"is"===t&&!V[t])if(Z||tt)try{At(n)}catch(Vt){}else try{n.setAttribute(t,"")}catch(Vt){}},Mt=function(t){var e,n;if(Q)t=""+t;else{var o=AJ(t,/^[\r\n\t ]+/);n=o&&o[0]}"application/xhtml+xml"===D&&(t=''+t+"");var i=w?w.createHTML(t):t;if(ht===gt)try{e=(new d).parseFromString(i,D)}catch(Vt){}if(!e||!e.documentElement){e=S.createDocument(ht,"template",null);try{e.documentElement.innerHTML=pt?"":i}catch(Vt){}}var u=e.body||e.documentElement;return t&&n&&u.insertBefore(r.createTextNode(n),u.childNodes[0]||null),ht===gt?O.call(e,Y?"html":"body")[0]:Y?e.documentElement:u},Rt=function(t){return k.call(t.ownerDocument||t,t,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,null,!1)},Nt=function(t){return t instanceof f&&("string"!==typeof t.nodeName||"string"!==typeof t.textContent||"function"!==typeof t.removeChild||!(t.attributes instanceof l)||"function"!==typeof t.removeAttribute||"function"!==typeof t.setAttribute||"string"!==typeof t.namespaceURI||"function"!==typeof t.insertBefore)},zt=function(t){return"object"===oJ(u)?t instanceof u:t&&"object"===oJ(t)&&"number"===typeof t.nodeType&&"string"===typeof t.nodeName},Bt=function(t,n,r){A[t]&&TJ(A[t],(function(t){t.call(e,n,r,yt)}))},Lt=function(t){var n;if(Bt("beforeSanitizeElements",t,null),Nt(t))return At(t),!0;if(NJ(/[\u0080-\uFFFF]/,t.nodeName))return At(t),!0;var r=M(t.nodeName);if(Bt("uponSanitizeElement",t,{tagName:r,allowedTags:P}),t.hasChildNodes()&&!zt(t.firstElementChild)&&(!zt(t.content)||!zt(t.content.firstElementChild))&&NJ(/<[/\w]/g,t.innerHTML)&&NJ(/<[/\w]/g,t.textContent))return At(t),!0;if("select"===r&&NJ(/