(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["CommodityAdd~list~role"],{"030f":function(t,e,n){(function(t){(function(){"use strict";var e=function(){},n=function(t){return function(){return t()}},r=function(t,e){return function(){for(var n=[],r=0;r-1},U=function(t,e){for(var n=0,r=t.length;n=0;n--){var r=t[n];e(r,n)}},K=function(t,e){for(var n=[],r=[],o=0,i=t.length;o=0&&e0?de(n.errors):fe(n.values,e)},ge=function(t,e){return t.length>0?Et.svalue(Kt(e,Xt.apply(void 0,t))):Et.svalue(e)},he=function(t){return r(Et.serror,et)(t)},pe=function(t,e){var n=Et.partition(t);return n.errors.length>0?he(n.errors):ge(n.values,e)},ve=function(t){var e=Et.partition(t);return e.errors.length>0?he(e.errors):Et.svalue(e.values)},be={consolidateObj:pe,consolidateArr:ve},ye=function(t){return E(t)&&_t(t).length>100?" removed due to size":JSON.stringify(t,null,2)},we=function(t){var e=t.length>10?t.slice(0,10).concat([{path:[],getErrorInfo:function(){return"... (only showing first ten failures)"}}]):t;return q(e,(function(t){return"Failed path: ("+t.path.join(" > ")+")\n"+t.getErrorInfo()}))},xe=function(t,e){return Et.serror([{path:t,getErrorInfo:e}])},Ce=function(t,e,n){return xe(t,(function(){return'Could not find valid *strict* value for "'+e+'" in '+ye(n)}))},Se=function(t,e){return xe(t,(function(){return'Choice schema did not contain choice key: "'+e+'"'}))},ke=function(t,e,n){return xe(t,(function(){return'The chosen schema: "'+n+'" did not exist in branches: '+ye(e)}))},Oe=function(t,e){return xe(t,(function(){return"There are unsupported fields: ["+e.join(", ")+"] specified"}))},Te=function(t,e){return xe(t,(function(){return e}))},Ee=jt.generate([{field:["key","okey","presence","prop"]},{state:["okey","instantiator"]}]),_e=function(t,e,n){return Lt(e,n).fold((function(){return Ce(t,n,e)}),Et.svalue)},Ae=function(t,e,n){var r=Lt(t,e).fold((function(){return n(t)}),u);return Et.svalue(r)},De=function(t,e){return Et.svalue(Lt(t,e))},Me=function(t,e,n){var r=Lt(t,e).map((function(e){return!0===e?n(t):e}));return Et.svalue(r)},Ne=function(t,e,n,r){return n.fold((function(n,o,u,a){var c=function(e){var i=a.extract(t.concat([n]),r,e);return Et.map(i,(function(t){return ue(o,r(t))}))},s=function(e){return e.fold((function(){var t=ue(o,r(x.none()));return Et.svalue(t)}),(function(e){var i=a.extract(t.concat([n]),r,e);return Et.map(i,(function(t){return ue(o,r(x.some(t)))}))}))};return function(){return u.fold((function(){return Et.bind(_e(t,e,n),c)}),(function(t){return Et.bind(Ae(e,n,t),c)}),(function(){return Et.bind(De(e,n),s)}),(function(t){return Et.bind(Me(e,n,t),s)}),(function(t){var r=t(e),o=Et.map(Ae(e,n,i({})),(function(t){return Kt(r,t)}));return Et.bind(o,c)}))}()}),(function(t,n){var o=n(e);return Et.svalue(ue(t,r(o)))}))},Re=function(t,e,n,r){var o=q(n,(function(n){return Ne(t,e,n,r)}));return be.consolidateObj(o,{})},ze=function(t){var e=function(e,n,r){return t().extract(e,n,r)},n=function(){return t().toString()};return{extract:e,toString:n}},Be=function(t){var e=function(e,n,r){return Et.bindError(t(r,n),(function(t){return Te(e,t)}))},n=function(){return"val"};return{extract:e,toString:n}},Pe=function(t){return _t(Bt(t,(function(t){return void 0!==t&&null!==t})))},Ie=function(t){var e=He(t),n=Y(t,(function(t,e){return e.fold((function(e){return Kt(t,se(e,!0))}),i(t))}),{}),r=function(t,r,o){var i=A(o)?[]:Pe(o),u=X(i,(function(t){return!Vt(n,t)}));return 0===u.length?e.extract(t,r,o):Oe(t,u)};return{extract:r,toString:e.toString}},He=function(t){var e=function(e,n,r){return Re(e,r,t,n)},n=function(){var e=q(t,(function(t){return t.fold((function(t,e,n,r){return t+" -> "+r.toString()}),(function(t,e){return"state("+t+")"}))}));return"obj{\n"+e.join("\n")+"}"};return{extract:e,toString:n}},Le=function(t){var e=function(e,n,r){var o=q(r,(function(r,o){return t.extract(e.concat(["["+o+"]"]),n,r)}));return be.consolidateArr(o)},n=function(){return"array("+t.toString()+")"};return{extract:e,toString:n}},Fe=function(t){var e=function(e,n,r){for(var o=[],i=0,u=t;i1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return Zn(r.childNodes[0])},Jn=function(t,e){var n=e||document,r=n.createElement(t);return Zn(r)},Qn=function(t,e){var n=e||document,r=n.createTextNode(t);return Zn(r)},Zn=function(t){if(null===t||void 0===t)throw new Error("Node cannot be null or undefined");return{dom:t}},tr=function(t,e,n){return x.from(t.dom.elementFromPoint(e,n)).map(Zn)},er={fromHtml:Yn,fromTag:Jn,fromText:Qn,fromDom:Zn,fromPoint:tr},nr=function(t,e,n,r){var o=t.isiOS()&&!0===/ipad/i.test(n),u=t.isiOS()&&!o,a=t.isiOS()||t.isAndroid(),c=a||r("(pointer:coarse)"),s=o||!u&&a&&r("(min-device-width:768px)"),l=u||a&&!s,f=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),d=!l&&!s&&!f;return{isiPad:i(o),isiPhone:i(u),isTablet:i(s),isPhone:i(l),isTouch:i(c),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:i(f),isDesktop:i(d)}},rr=function(t,e){for(var n=0;n=e.length&&t.substr(n,n+e.length)===e},gr=function(t,e){return-1!==t.indexOf(e)},hr=function(t,e){return mr(t,e,t.length-e.length)},pr=function(t){return function(e){return e.replace(t,"")}},vr=pr(/^\s+|\s+$/g),br=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,yr=function(t){return function(e){return gr(e,t)}},wr=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return gr(t,"edge/")&&gr(t,"chrome")&&gr(t,"safari")&&gr(t,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,br],search:function(t){return gr(t,"chrome")&&!gr(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return gr(t,"msie")||gr(t,"trident")}},{name:"Opera",versionRegexes:[br,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:yr("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:yr("firefox")},{name:"Safari",versionRegexes:[br,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(gr(t,"safari")||gr(t,"mobile/"))&&gr(t,"applewebkit")}}],xr=[{name:"Windows",search:yr("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return gr(t,"iphone")||gr(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:yr("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:yr("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:yr("linux"),versionRegexes:[]},{name:"Solaris",search:yr("sunos"),versionRegexes:[]},{name:"FreeBSD",search:yr("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:yr("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Cr={browsers:i(wr),oses:i(xr)},Sr="Edge",kr="Chrome",Or="IE",Tr="Opera",Er="Firefox",_r="Safari",Ar=function(){return Dr({current:void 0,version:cr.unknown()})},Dr=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r(Sr),isChrome:r(kr),isIE:r(Or),isOpera:r(Tr),isFirefox:r(Er),isSafari:r(_r)}},Mr={unknown:Ar,nu:Dr,edge:i(Sr),chrome:i(kr),ie:i(Or),opera:i(Tr),firefox:i(Er),safari:i(_r)},Nr="Windows",Rr="iOS",zr="Android",Br="Linux",Pr="OSX",Ir="Solaris",Hr="FreeBSD",Lr="ChromeOS",Fr=function(){return Vr({current:void 0,version:cr.unknown()})},Vr=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r(Nr),isiOS:r(Rr),isAndroid:r(zr),isOSX:r(Pr),isLinux:r(Br),isSolaris:r(Ir),isFreeBSD:r(Hr),isChromeOS:r(Lr)}},Ur={unknown:Fr,nu:Vr,windows:i(Nr),ios:i(Rr),android:i(zr),linux:i(Br),osx:i(Pr),solaris:i(Ir),freebsd:i(Hr),chromeos:i(Lr)},jr=function(t,e){var n=Cr.browsers(),r=Cr.oses(),o=dr.detectBrowser(n,t).fold(Mr.unknown,Mr.nu),i=dr.detectOs(r,t).fold(Ur.unknown,Ur.nu),u=nr(i,o,t,e);return{browser:o,os:i,deviceType:u}},Wr={detect:jr},qr=function(t){return window.matchMedia(t).matches},$r=Yt((function(){return Wr.detect(navigator.userAgent,qr)})),Gr=function(){return $r()},Kr=function(t,e,n){return 0!==(t.compareDocumentPosition(e)&n)},Xr=function(t,e){return Kr(t,e,Node.DOCUMENT_POSITION_CONTAINED_BY)},Yr=9,Jr=11,Qr=1,Zr=3,to=function(t,e){var n=t.dom;if(n.nodeType!==Qr)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},eo=function(t){return t.nodeType!==Qr&&t.nodeType!==Yr&&t.nodeType!==Jr||0===t.childElementCount},no=function(t,e){var n=void 0===e?document:e.dom;return eo(n)?[]:q(n.querySelectorAll(t),er.fromDom)},ro=function(t,e){var n=void 0===e?document:e.dom;return eo(n)?x.none():x.from(n.querySelector(t)).map(er.fromDom)},oo=function(t,e){return t.dom===e.dom},io=function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)},uo=function(t,e){return Xr(t.dom,e.dom)},ao=function(t,e){return Gr().browser.isIE()?uo(t,e):io(t,e)},co=function(t){return R(t)?t:l},so=function(t,e,n){var r=t.dom,o=co(n);while(r.parentNode){r=r.parentNode;var i=er.fromDom(r),u=e(i);if(u.isSome())return u;if(o(i))break}return x.none()},lo=function(t,e,n){var r=e(t),o=co(n);return r.orThunk((function(){return o(t)?x.none():so(t,e,o)}))},fo=function(t,e){return oo(t.element,e.event.target)},mo=function(t){if(!Vt(t,"can")&&!Vt(t,"abort")&&!Vt(t,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(t,null,2)+" does not have can, abort, or run!");return on("Extracting event.handler",Ie([Hn("can",f),Hn("abort",l),Hn("run",e)]),t)},go=function(t,e){return function(){for(var n=[],r=0;r0&&ru(t,e),uu(t)},cu=function(t,e){var n=e||document,r=n.createElement("div");return r.innerHTML=t,Xi(er.fromDom(r))},su=function(t){return t.dom.innerHTML},lu=function(t,e){var n=Vi(t),r=n.dom,o=er.fromDom(r.createDocumentFragment()),i=cu(e,r);ou(o,i),iu(t),eu(t,o)},fu=function(t){var e=er.fromTag("div"),n=er.fromDom(t.dom.cloneNode(!0));return eu(e,n),su(e)},du=function(t,e,n){if(!(T(n)||A(n)||z(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")},mu=function(t,e,n){du(t.dom,e,n)},gu=function(t,e){var n=t.dom;Dt(e,(function(t,e){du(n,e,t)}))},hu=function(t,e){var n=t.dom.getAttribute(e);return null===n?void 0:n},pu=function(t,e){return x.from(hu(t,e))},vu=function(t,e){var n=t.dom;return!(!n||!n.hasAttribute)&&n.hasAttribute(e)},bu=function(t,e){t.dom.removeAttribute(e)},yu=function(t,e){return er.fromDom(t.dom.cloneNode(e))},wu=function(t){return yu(t,!1)},xu=function(t){var e=wu(t);return fu(e)},Cu=function(t){return xu(t)},Su=function(t,e,n){return oo(e,t.element)&&!oo(e,n)},ku=pi([bi(Lo(),(function(t,e){var n=e.event,r=n.originator,o=n.target;return!Su(t,r,o)||(console.warn(Lo()+" did not get interpreted by the desired target. \nOriginator: "+Cu(r)+"\nTarget: "+Cu(o)+"\nCheck the "+Lo()+" event handlers"),!1)}))]),Ou=Object.freeze({__proto__:null,events:ku}),Tu=0,Eu=function(t){var e=new Date,n=e.getTime(),r=Math.floor(1e9*Math.random());return Tu++,t+"_"+r+Tu+String(n)},_u=i("alloy-id-"),Au=i("data-alloy-id"),Du=_u(),Mu=Au(),Nu=function(t,e){var n=Eu(Du+t);return Ru(e,n),n},Ru=function(t,e){Object.defineProperty(t.dom,Mu,{value:e,writable:!0})},zu=function(t){var e=Ii(t)?t.dom[Mu]:null;return x.from(e)},Bu=function(t){return Eu(t)},Pu=u,Iu=function(t){var e=function(e){return function(){throw new Error("The component must be in a context to send: "+e+(t?"\n"+Cu(t().element)+" is not in context.":""))}};return{debugInfo:i("fake"),triggerEvent:e("triggerEvent"),triggerFocus:e("triggerFocus"),triggerEscape:e("triggerEscape"),build:e("build"),addToWorld:e("addToWorld"),removeFromWorld:e("removeFromWorld"),addToGui:e("addToGui"),removeFromGui:e("removeFromGui"),getByUid:e("getByUid"),getByDom:e("getByDom"),broadcast:e("broadcast"),broadcastOn:e("broadcastOn"),broadcastEvent:e("broadcastEvent"),isConnected:l}},Hu=Iu(),Lu=function(t,e,n){var r=n.toString(),o=r.indexOf(")")+1,i=r.indexOf("("),u=r.substring(i+1,o-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:e,parameters:Fu(u.slice(0,1).concat(u.slice(3)))}},t},Fu=function(t){return q(t,(function(t){return hr(t,"/*")?t.substring(0,t.length-"/*".length):t}))},Vu=function(t,e){var n=t.toString(),r=n.indexOf(")")+1,o=n.indexOf("("),i=n.substring(o+1,r-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:e,parameters:Fu(i)}},t},Uu=function(t,e){var n=e.toString(),r=n.indexOf(")")+1,o=n.indexOf("("),i=n.substring(o+1,r-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:Fu(i.slice(1))}},t},ju=Eu("alloy-premade"),Wu=function(t){return se(ju,t)},qu=function(t){return Lt(t,ju)},$u=function(t){return Uu((function(e){for(var n=[],r=1;r1?X(e[n],(function(e){return U(t,(function(t){return t.name===e}))})).join(" > "):t[0].name;return se(n,ra(o,i))}))}));return me(n,{})},ha="alloy.base.behaviour",pa=function(t){var e;return nn("custom.definition",He([$e("dom","dom",te(),He([yn("tag"),Hn("styles",{}),Hn("classes",[]),Hn("attributes",{}),Dn("value"),Dn("innerHtml")])),yn("components"),yn("uid"),Hn("events",{}),Hn("apis",{}),$e("eventOrder","eventOrder",Zt((e={},e[jo()]=["disabling",ha,"toggling","typeaheadevents"],e[Lo()]=[ha,"focusing","keying"],e[Xo()]=[ha,"disabling","toggling","representing"],e[No()]=[ha,"representing","streaming","invalidating"],e[ei()]=[ha,"representing","item-events","tooltipping"],e[So()]=["focusing",ha,"item-type-events"],e[yo()]=["focusing",ha,"item-type-events"],e[Eo()]=["item-type-events","tooltipping"],e[Uo()]=["receiving","reflecting","tooltipping"],e)),ln()),Dn("domModification")]),t)},va=function(t){return m(m({},t.dom),{uid:t.uid,domChildren:q(t.components,(function(t){return t.element}))})},ba=function(t){return t.domModification.fold((function(){return Zu({})}),Zu)},ya=function(t){return t.events},wa=function(t,e){var n=hu(t,e);return void 0===n||""===n?[]:n.split(" ")},xa=function(t,e,n){var r=wa(t,e),o=r.concat([n]);return mu(t,e,o.join(" ")),!0},Ca=function(t,e,n){var r=X(wa(t,e),(function(t){return t!==n}));return r.length>0?mu(t,e,r.join(" ")):bu(t,e),!1},Sa=function(t){return void 0!==t.dom.classList},ka=function(t){return wa(t,"class")},Oa=function(t,e){return xa(t,"class",e)},Ta=function(t,e){return Ca(t,"class",e)},Ea=function(t,e){Sa(t)?t.dom.classList.add(e):Oa(t,e)},_a=function(t){var e=Sa(t)?t.dom.classList:ka(t);0===e.length&&bu(t,"class")},Aa=function(t,e){if(Sa(t)){var n=t.dom.classList;n.remove(e)}else Ta(t,e);_a(t)},Da=function(t,e){return Sa(t)&&t.dom.classList.contains(e)},Ma=function(t,e){$(e,(function(e){Ea(t,e)}))},Na=function(t,e){$(e,(function(e){Aa(t,e)}))},Ra=function(t){return void 0!==t.style&&R(t.style.getPropertyValue)},za=function(t){return Fi(t)},Ba=R(Element.prototype.attachShadow)&&R(Node.prototype.getRootNode),Pa=i(Ba),Ia=Ba?function(t){return er.fromDom(t.dom.getRootNode())}:Ui,Ha=function(t){return za(t)?t:er.fromDom(Ui(t).dom.body)},La=function(t){return Fa(t).isSome()},Fa=function(t){var e=Ia(t);return za(e)?x.some(e):x.none()},Va=function(t){return er.fromDom(t.dom.host)},Ua=function(t){if(Pa()&&N(t.target)){var e=er.fromDom(t.target);if(Ii(e)&&ja(e)&&t.composed&&t.composedPath){var n=t.composedPath();if(n)return st(n)}}return x.from(t.target)},ja=function(t){return N(t.dom.shadowRoot)},Wa=function(t){var e=Hi(t)?t.dom.parentNode:t.dom;if(void 0===e||null===e||null===e.ownerDocument)return!1;var n=e.ownerDocument;return Fa(er.fromDom(e)).fold((function(){return n.body.contains(e)}),o(Wa,Va))},qa=function(){return $a(er.fromDom(document))},$a=function(t){var e=t.dom.body;if(null===e||void 0===e)throw new Error("Body is not available yet");return er.fromDom(e)},Ga=function(t,e,n){if(!T(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);Ra(t)&&t.style.setProperty(e,n)},Ka=function(t,e){Ra(t)&&t.style.removeProperty(e)},Xa=function(t,e,n){var r=t.dom;Ga(r,e,n)},Ya=function(t,e){var n=t.dom;Dt(e,(function(t,e){Ga(n,e,t)}))},Ja=function(t,e){var n=t.dom;Dt(e,(function(t,e){t.fold((function(){Ka(n,e)}),(function(t){Ga(n,e,t)}))}))},Qa=function(t,e){var n=t.dom,r=window.getComputedStyle(n),o=r.getPropertyValue(e);return""!==o||Wa(t)?o:Za(n,e)},Za=function(t,e){return Ra(t)?t.style.getPropertyValue(e):""},tc=function(t,e){var n=t.dom,r=Za(n,e);return x.from(r).filter((function(t){return t.length>0}))},ec=function(t){var e={},n=t.dom;if(Ra(n))for(var r=0;r0?ea(n,i,e,r):o;return ta(r,u)},dc=function(t,e,n){var r={"alloy.base.behaviour":ya(t)};return la(n,t.eventOrder,e,r).getOrDie()},mc=function(t){var e=function(){return b},n=Xn(Hu),r=rn(pa(t)),o=lc(t),i=Yu(o),u=Ju(o),a=fc(r,i,u),c=ac(a),s=dc(r,i,u),l=Xn(r.components),f=function(t){n.set(t)},d=function(){n.set(Iu(e))},m=function(){var t=Xi(c),e=nt(t,(function(t){return n.get().getByDom(t).fold((function(){return[]}),(function(t){return[t]}))}));l.set(e)},g=function(e){var n=u,r=R(n[e.name()])?n[e.name()]:function(){throw new Error("Could not find "+e.name()+" in "+JSON.stringify(t,null,2))};return r()},h=function(t){return R(u[t.name()])},p=function(){return r.apis},v=function(t){return u[t]().map((function(t){return t.state.readState()})).getOr("not enabled")},b={getSystem:n.get,config:g,hasConfigured:h,spec:t,readState:v,getApis:p,connect:f,disconnect:d,element:c,syncComponents:m,components:l.get,events:s};return b},gc=function(t){var e=Lt(t,"components").getOr([]);return q(e,yc)},hc=function(t){var e=Pu(t),n=e.events,r=g(e,["events"]),o=gc(r),i=m(m({},r),{events:m(m({},Ou),n),components:o});return pt.value(mc(i))},pc=function(t){var e=er.fromText(t);return vc({element:e})},vc=function(t){var n=on("external.component",Ie([yn("element"),Dn("uid")]),t),r=Xn(Iu()),o=function(t){r.set(t)},u=function(){r.set(Iu((function(){return a})))};n.uid.each((function(t){Ru(n.element,t)}));var a={getSystem:r.get,config:x.none,hasConfigured:l,connect:o,disconnect:u,getApis:function(){return{}},element:n.element,spec:t,readState:i("No state"),syncComponents:e,components:i([]),events:{}};return Wu(a)},bc=Bu,yc=function(t){return qu(t).fold((function(){var e=t.hasOwnProperty("uid")?t:m({uid:bc("")},t);return hc(e).getOrDie()}),(function(t){return t}))},wc=Wu;function xc(t,e){var n=function(e,n){if(!z(n)&&!n.match(/^[0-9]+$/))throw new Error(t+".set accepts only positive integer values. Value was "+n);var r=e.dom;Ra(r)&&(r.style[t]=n+"px")},r=function(n){var r=e(n);if(r<=0||null===r){var o=Qa(n,t);return parseFloat(o)||0}return r},o=r,i=function(t,e){return J(e,(function(e,n){var r=Qa(t,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?e:e+o}),0)},u=function(t,e,n){var r=i(t,n),o=e>r?e-r:0;return o};return{set:n,get:r,getOuter:o,aggregate:i,max:u}}var Cc=xc("height",(function(t){var e=t.dom;return Wa(t)?e.getBoundingClientRect().height:e.offsetHeight})),Sc=function(t){return Cc.get(t)},kc=function(t){return Cc.getOuter(t)},Oc=function(t,e){var n=["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"],r=Cc.max(t,e,n);Xa(t,"max-height",r+"px")},Tc=function(t,e){var n=function(n,r){return Tc(t+n,e+r)};return{left:t,top:e,translate:n}},Ec=Tc,_c=function(t){var e=t.getBoundingClientRect();return Ec(e.left,e.top)},Ac=function(t,e){return void 0!==t?t:void 0!==e?e:0},Dc=function(t){var e=t.dom.ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom)return Ec(n.offsetLeft,n.offsetTop);var i=Ac(null===r||void 0===r?void 0:r.pageYOffset,o.scrollTop),u=Ac(null===r||void 0===r?void 0:r.pageXOffset,o.scrollLeft),a=Ac(o.clientTop,n.clientTop),c=Ac(o.clientLeft,n.clientLeft);return Mc(t).translate(u-c,i-a)},Mc=function(t){var e=t.dom,n=e.ownerDocument,r=n.body;return r===e?Ec(r.offsetLeft,r.offsetTop):Wa(t)?_c(e):Ec(0,0)},Nc=xc("width",(function(t){return t.dom.offsetWidth})),Rc=function(t,e){return Nc.set(t,e)},zc=function(t){return Nc.get(t)},Bc=function(t){return Nc.getOuter(t)},Pc=function(t,e){var n=["margin-left","border-left-width","padding-left","padding-right","border-right-width","margin-right"],r=Nc.max(t,e,n);Xa(t,"max-width",r+"px")},Ic=function(t,e,n,r,o,i,u){return{target:t,x:e,y:n,stop:r,prevent:o,kill:i,raw:u}},Hc=function(t){var e=er.fromDom(Ua(t).getOr(t.target)),n=function(){return t.stopPropagation()},o=function(){return t.preventDefault()},i=r(o,n);return Ic(e,t.clientX,t.clientY,n,o,i,t)},Lc=function(t,e){return function(n){t(n)&&e(Hc(n))}},Fc=function(t,e,n,r,o){var i=Lc(n,r);return t.dom.addEventListener(e,i,o),{unbind:a(jc,t,e,i,o)}},Vc=function(t,e,n,r){return Fc(t,e,n,r,!1)},Uc=function(t,e,n,r){return Fc(t,e,n,r,!0)},jc=function(t,e,n,r){t.dom.removeEventListener(e,n,r)},Wc=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 Ec(n,r)},qc=function(t,e,n){var r=void 0!==n?n.dom:document,o=r.defaultView;o&&o.scrollTo(t,e)},$c=function(t){var e=void 0===t?window:t;return x.from(e["visualViewport"])},Gc=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},Kc=function(t){var e=void 0===t?window:t,n=e.document,r=Wc(er.fromDom(n));return $c(e).fold((function(){var t=e.document.documentElement,n=t.clientWidth,o=t.clientHeight;return Gc(r.left,r.top,n,o)}),(function(t){return Gc(Math.max(t.pageLeft,r.left),Math.max(t.pageTop,r.top),t.width,t.height)}))},Xc=function(t,e){var n=t.view(e);return n.fold(i([]),(function(e){var n=t.owner(e),r=Xc(t,n);return[e].concat(r)}))},Yc=function(t,e){var n=e.owner(t),r=Xc(e,n);return x.some(r)},Jc=function(t){var e,n=t.dom===document?x.none():x.from(null===(e=t.dom.defaultView)||void 0===e?void 0:e.frameElement);return n.map(er.fromDom)},Qc=function(t){return Vi(t)},Zc=Object.freeze({__proto__:null,view:Jc,owner:Qc}),ts=function(t){var e=er.fromDom(document),n=Wc(e),r=Yc(t,Zc);return r.fold(a(Dc,t),(function(e){var r=Mc(t),o=Y(e,(function(t,e){var n=Mc(e);return{left:t.left+n.left,top:t.top+n.top}}),{left:0,top:0});return Ec(o.left+r.left+n.left,o.top+r.top+n.top)}))},es=function(t,e,n){return{point:t,width:e,height:n}},ns=function(t,e,n,r){return{x:t,y:e,width:n,height:r}},rs=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},os=function(t){var e=Dc(t),n=Bc(t),r=kc(t);return rs(e.left,e.top,n,r)},is=function(t){var e=ts(t),n=Bc(t),r=kc(t);return rs(e.left,e.top,n,r)},us=function(){return Kc(window)};function as(t,e,n,r,o){return t(n,r)?x.some(n):R(o)&&o(n)?x.none():e(n,r,o)}var cs,ss=function(t,e,n){var r=t.dom,o=R(n)?n:l;while(r.parentNode){r=r.parentNode;var i=er.fromDom(r);if(e(i))return x.some(i);if(o(i))break}return x.none()},ls=function(t,e,n){var r=function(t,e){return e(t)};return as(r,ss,t,e,n)},fs=function(t,e){var n=function(t){for(var r=0;r-1}));return e.bind((function(t){var e=hu(t,"id"),n=Ia(t);return gs(n,'[aria-owns="'+e+'"]')}))},vs=function(){var t=Eu("aria-owns"),e=function(e){mu(e,"aria-owns",t)},n=function(t){bu(t,"aria-owns")};return{id:t,link:e,unlink:n}},bs=function(t,e){return ps(e).exists((function(e){return ys(t,e)}))},ys=function(t,e){return ds(e,(function(e){return oo(e,t.element)}),l)||bs(t,e)},ws="unknown";(function(t){t[t["STOP"]=0]="STOP",t[t["NORMAL"]=1]="NORMAL",t[t["LOGGING"]=2]="LOGGING"})(cs||(cs={}));var xs,Cs=Xn({}),Ss=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();V(["mousemove","mouseover","mouseout",Xo()],t)||console.log(t,{event:t,time:o-r,target:e.dom,sequence:q(n,(function(t){return V(["cut","stopped","response"],t.outcome)?"{"+t.purpose+"} "+t.outcome+" at ("+Cu(t.target)+")":t.outcome}))})}}},ks=function(t,e,n){var r=Lt(Cs.get(),t).orThunk((function(){var e=_t(Cs.get());return dt(e,(function(e){return t.indexOf(e)>-1?x.some(Cs.get()[e]):x.none()}))})).getOr(cs.NORMAL);switch(r){case cs.NORMAL:return n(As());case cs.LOGGING:var o=Ss(t,e),i=n(o);return o.write(),i;case cs.STOP:return!0}},Os=["alloy/data/Fields","alloy/debugging/Debugging"],Ts=function(){var t=new Error;if(void 0!==t.stack){var e=t.stack.split("\n");return Z(e,(function(t){return t.indexOf("alloy")>0&&!U(Os,(function(e){return t.indexOf(e)>-1}))})).getOr(ws)}return ws},Es={logEventCut:e,logEventStopped:e,logNoParent:e,logEventNoHandlers:e,logEventResponse:e,write:e},_s=function(t,e,n){return ks(t,e,n)},As=i(Es),Ds=i([yn("menu"),yn("selectedMenu")]),Ms=i([yn("item"),yn("selectedItem")]),Ns=(i(He(Ms().concat(Ds()))),i(He(Ms()))),Rs=En("initSize",[yn("numColumns"),yn("numRows")]),zs=function(){return wn("markers",Ns())},Bs=function(){return En("markers",[yn("backgroundMenu")].concat(Ds()).concat(Ms()))},Ps=function(t){return En("markers",q(t,yn))},Is=function(t,e,n){Ts();return $e(e,e,n,Ze((function(t){return pt.value((function(){for(var e=[],n=0;n=r?x.some(e):x.none():e<=r?x.some(e):x.none()})).map((function(t){return t+o})).getOr(r)},o=r("left",t.x),i=r("top",t.y),a=r("right",t.right),c=r("bottom",t.bottom);return rs(o,i,a-o,c-i)},al=function(t){return t.x},cl=function(t,e){return t.x+t.width/2-e.width/2},sl=function(t,e){return t.x+t.width-e.width},ll=function(t,e){return t.y-e.height},fl=function(t){return t.y+t.height},dl=function(t,e){return t.y+t.height/2-e.height/2},ml=function(t){return t.x+t.width},gl=function(t,e){return t.x-e.width},hl=function(t,e,n){return qs(al(t),fl(t),n.southeast(),Ys(),il(t,{left:1,top:3}),"layout-se")},pl=function(t,e,n){return qs(sl(t,e),fl(t),n.southwest(),Js(),il(t,{right:0,top:3}),"layout-sw")},vl=function(t,e,n){return qs(al(t),ll(t,e),n.northeast(),Qs(),il(t,{left:1,bottom:2}),"layout-ne")},bl=function(t,e,n){return qs(sl(t,e),ll(t,e),n.northwest(),Zs(),il(t,{right:0,bottom:2}),"layout-nw")},yl=function(t,e,n){return qs(cl(t,e),ll(t,e),n.north(),el(),il(t,{bottom:2}),"layout-n")},wl=function(t,e,n){return qs(cl(t,e),fl(t),n.south(),tl(),il(t,{top:3}),"layout-s")},xl=function(t,e,n){return qs(ml(t),dl(t,e),n.east(),nl(),il(t,{left:0}),"layout-e")},Cl=function(t,e,n){return qs(gl(t,e),dl(t,e),n.west(),rl(),il(t,{right:1}),"layout-w")},Sl=function(){return[hl,pl,vl,bl,wl,yl,xl,Cl]},kl=function(){return[pl,hl,bl,vl,wl,yl,xl,Cl]},Ol=function(){return[vl,bl,hl,pl,yl,wl]},Tl=function(){return[bl,vl,pl,hl,yl,wl]},El=function(){return[hl,pl,vl,bl,wl,yl]},_l=function(){return[pl,hl,bl,vl,wl,yl]},Al=function(t,e){return e.universal?t:X(t,(function(t){return V(e.channels,t)}))},Dl=function(t){return pi([wi(Uo(),(function(e,n){var r=t.channels,o=_t(r),i=n,u=Al(o,i);$(u,(function(t){var n=r[t],o=n.schema,u=on("channel["+t+"] data\nReceiver: "+Cu(e.element),o,i.data);n.onReceive(e,u)}))}))])},Ml=Object.freeze({__proto__:null,events:Dl}),Nl=[wn("channels",tn(pt.value,Ie([Fs("onReceive"),Hn("schema",ln())])))],Rl=function(t,e,n){return Ri((function(r){n(r,t,e)}))},zl=function(t,e,n){return Ni((function(r,o){n(r,t,e)}))},Bl=function(t,e,n,r,o,i){var u=Ie(t),a=Pn(e,[In("config",t)]);return Ll(u,a,e,n,r,o,i)},Pl=function(t,e,n,r,o,i){var u=t,a=Pn(e,[Mn("config",t)]);return Ll(u,a,e,n,r,o,i)},Il=function(t,e,n){var r=function(r){for(var o=[],u=1;ur?n:o=i,l=e>=u,f=s&&l,d=t+n<=i+a,m=e+r<=u+c,g=d&&m,h=Math.abs(Math.min(n,s?i+a-t:i-(t+n))),p=Math.abs(Math.min(r,l?u+c-e:u-(e+r))),v=Math.max(o.x,o.right-n),b=Math.max(o.y,o.bottom-r),y=vf(t,o.x,v),w=vf(e,o.y,b);return{originInBounds:f,sizeInBounds:g,limitX:y,limitY:w,deltaW:h,deltaH:p}},wf=function(t,e,n,r){var o=t.x,u=t.y,a=t.bubble.offset,c=a.left,s=a.top,l=ul(r,t.boundsRestriction,a),f=l.y,d=l.bottom,m=l.x,g=l.right,h=o+c,p=u+s,v=yf(h,p,e,n,l),b=v.originInBounds,y=v.sizeInBounds,w=v.limitX,x=v.limitY,C=v.deltaW,S=v.deltaH,k=i(x+S-f),O=i(d-x),T=Ks(t.direction,O,O,k),E=i(w+C-m),_=i(g-w),A=Xs(t.direction,_,_,E),D={x:w,y:x,width:C,height:S,maxHeight:T,maxWidth:A,direction:t.direction,classes:{on:t.bubble.classesOn,off:t.bubble.classesOff},label:t.label,candidateYforTest:p};return b&&y?bf.fit(D):bf.nofit(D,C,S)},xf=function(t,e,n,r,o){var i=n.width,c=n.height,s=function(t,u,a,s){var l=t(e,n,r),f=wf(l,i,c,o);return f.fold(bf.fit,(function(t,e,n){var r=n>s||e>a;return r?bf.nofit(t,e,n):bf.nofit(u,a,s)}))},l=J(t,(function(t,e){var n=a(s,e);return t.fold(bf.fit,n)}),bf.nofit({x:e.x,y:e.y,width:n.width,height:n.height,maxHeight:n.height,maxWidth:n.width,direction:Ys(),classes:{on:[],off:[]},label:"none",candidateYforTest:e.y},-1,-1));return l.fold(u,u)},Cf=function(t){return{width:Bc(t),height:kc(t)}},Sf=function(t,e,n,r){rc(e,"max-height"),rc(e,"max-width");var o=Cf(e);return xf(r.preference,t,o,n,r.bounds)},kf=function(t,e){var n=e.classes;Na(t,n.off),Ma(t,n.on)},Of=function(t,e,n){var r=n.maxHeightFunction;r(t,e.maxHeight)},Tf=function(t,e,n){var r=n.maxWidthFunction;r(t,e.maxWidth)},Ef=function(t,e,n){rf(t,af(n.origin,e))},_f=function(t,e){Oc(t,Math.floor(e))},Af=i((function(t,e){_f(t,e),Ya(t,{"overflow-x":"hidden","overflow-y":"auto"})})),Df=i((function(t,e){_f(t,e)})),Mf=function(t,e,n){return void 0===t[e]?n:t[e]},Nf=function(t,n,r,o,i,u){var a=Mf(u,"maxHeightFunction",Af()),c=Mf(u,"maxWidthFunction",e),s=t.anchorBox,l=t.origin,f={bounds:sf(l,i),origin:l,preference:o,maxHeightFunction:a,maxWidthFunction:c};Rf(s,n,r,f)},Rf=function(t,e,n,r){var o=Sf(t,e,n,r);Ef(e,o,r),kf(e,o),Of(e,o,r),Tf(e,o,r)},zf=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right"],Bf=function(t,e,n){var r=function(t){return Lt(n,t).getOr([])},o=function(t,e,n){var o=it(zf,n);return{offset:Ec(t,e),classesOn:nt(n,r),classesOff:nt(o,r)}};return{southeast:function(){return o(-t,e,["top","alignLeft"])},southwest:function(){return o(t,e,["top","alignRight"])},south:function(){return o(-t/2,e,["top","alignCentre"])},northeast:function(){return o(-t,-e,["bottom","alignLeft"])},northwest:function(){return o(t,-e,["bottom","alignRight"])},north:function(){return o(-t/2,-e,["bottom","alignCentre"])},east:function(){return o(t,-e/2,["valignCentre","left"])},west:function(){return o(-t,-e/2,["valignCentre","right"])},innerNorthwest:function(){return o(-t,e,["top","alignRight"])},innerNortheast:function(){return o(t,e,["top","alignLeft"])},innerNorth:function(){return o(-t/2,e,["top","alignCentre"])},innerSouthwest:function(){return o(-t,-e,["bottom","alignRight"])},innerSoutheast:function(){return o(t,-e,["bottom","alignLeft"])},innerSouth:function(){return o(-t/2,-e,["bottom","alignCentre"])},innerWest:function(){return o(t,-e/2,["valignCentre","right"])},innerEast:function(){return o(-t,-e/2,["valignCentre","left"])}}},Pf=function(){return Bf(0,0,{})},If=function(t){return t},Hf=function(t,e){return function(n){return"rtl"===Lf(n)?e:t}},Lf=function(t){return"rtl"===Qa(t,"direction")?"rtl":"ltr"};(function(t){t["TopToBottom"]="toptobottom",t["BottomToTop"]="bottomtotop"})(xs||(xs={}));var Ff="data-alloy-vertical-dir",Vf=function(t){return ds(t,(function(t){return Ii(t)&&hu(t,"data-alloy-vertical-dir")===xs.BottomToTop}))},Uf=function(){return Pn("layouts",[yn("onLtr"),yn("onRtl"),Dn("onBottomLtr"),Dn("onBottomRtl")])},jf=function(t,e,n,r,o,i,u){var a=u.map(Vf).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=Hf(l,f);return d(t)},Wf=function(t,e,n){var r=e.hotspot,o=cf(n,r.element),i=jf(t.element,e,El(),_l(),Ol(),Tl(),x.some(e.hotspot.element));return x.some(If({anchorBox:o,bubble:e.bubble.getOr(Pf()),overrides:e.overrides,layouts:i,placer:x.none()}))},qf=[yn("hotspot"),Dn("bubble"),Hn("overrides",{}),Uf(),Us("placement",Wf)],$f=function(t,e,n){var r=lf(n,e.x,e.y),o=rs(r.left,r.top,e.width,e.height),i=jf(t.element,e,Sl(),kl(),Sl(),kl(),x.none());return x.some(If({anchorBox:o,bubble:e.bubble,overrides:e.overrides,layouts:i,placer:x.none()}))},Gf=[yn("x"),yn("y"),Hn("height",0),Hn("width",0),Hn("bubble",Pf()),Hn("overrides",{}),Uf(),Us("placement",$f)],Kf="\ufeff",Xf=" ",Yf=function(t,e,n,r){return{start:t,soffset:e,finish:n,foffset:r}},Jf={create:Yf},Qf=jt.generate([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Zf=function(t,e,n,r){return t.fold(e,n,r)},td=function(t){return t.fold(u,u,u)},ed=Qf.before,nd=Qf.on,rd=Qf.after,od={before:ed,on:nd,after:rd,cata:Zf,getStart:td},id=jt.generate([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),ud=function(t){return id.exact(t.start,t.soffset,t.finish,t.foffset)},ad=function(t){return t.match({domRange:function(t){return er.fromDom(t.startContainer)},relative:function(t,e){return od.getStart(t)},exact:function(t,e,n,r){return t}})},cd=id.domRange,sd=id.relative,ld=id.exact,fd=function(t){var e=ad(t);return Wi(e)},dd=Jf.create,md={domRange:cd,relative:sd,exact:ld,exactFromRange:ud,getWin:fd,range:dd},gd=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)}))},hd=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)}))},pd=function(t,e,n){var r=t.document.createRange();return gd(r,e),hd(r,n),r},vd=function(t,e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},bd=function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom,width:t.width,height:t.height}},yd=function(t){var e=t.getClientRects(),n=e.length>0?e[0]:t.getBoundingClientRect();return n.width>0||n.height>0?x.some(n).map(bd):x.none()},wd=jt.generate([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),xd=function(t,e,n){return e(er.fromDom(n.startContainer),n.startOffset,er.fromDom(n.endContainer),n.endOffset)},Cd=function(t,e){return e.match({domRange:function(t){return{ltr:i(t),rtl:x.none}},relative:function(e,n){return{ltr:Yt((function(){return pd(t,e,n)})),rtl:Yt((function(){return x.some(pd(t,n,e))}))}},exact:function(e,n,r,o){return{ltr:Yt((function(){return vd(t,e,n,r,o)})),rtl:Yt((function(){return x.some(vd(t,r,o,e,n))}))}}})},Sd=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 wd.rtl(er.fromDom(t.endContainer),t.endOffset,er.fromDom(t.startContainer),t.startOffset)})).getOrThunk((function(){return xd(t,wd.ltr,n)}))}return xd(t,wd.ltr,n)},kd=function(t,e){var n=Cd(t,e);return Sd(t,n)},Od=function(t,e){var n=kd(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}})};wd.ltr,wd.rtl;function Td(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)?x.from(e.dom.nodeValue):x.none()},o=function(n,r){if(!t(n))throw new Error("Can only set raw "+e+" value of a "+e+" node");n.dom.nodeValue=r};return{get:n,getOption:r,set:o}}var Ed=Td(Hi,"text"),_d=function(t){return Ed.get(t)},Ad=function(t){return Ed.getOption(t)},Dd=function(t){return"img"===zi(t)?1:Ad(t).fold((function(){return Xi(t).length}),(function(t){return t.length}))},Md=function(t){return Ad(t).filter((function(t){return 0!==t.trim().length||t.indexOf(Xf)>-1})).isSome()},Nd=["img","br"],Rd=function(t){var e=Md(t);return e||V(Nd,zi(t))},zd=function(t){return Bd(t,Rd)},Bd=function(t,e){var n=function(t){for(var r=Xi(t),o=r.length-1;o>=0;o--){var i=r[o];if(e(i))return x.some(i);var u=n(i);if(u.isSome())return u}return x.none()};return n(t)},Pd=function(t,e){return no(e,t)},Id=function(t,e,n,r){var o=Vi(t),i=o.dom.createRange();return i.setStart(t.dom,e),i.setEnd(n.dom,r),i},Hd=function(t,e,n,r){var o=Id(t,e,n,r),i=oo(t,n)&&e===r;return o.collapsed&&!i},Ld=function(t){return x.from(t.getSelection())},Fd=function(t){if(t.rangeCount>0){var e=t.getRangeAt(0),n=t.getRangeAt(t.rangeCount-1);return x.some(Jf.create(er.fromDom(e.startContainer),e.startOffset,er.fromDom(n.endContainer),n.endOffset))}return x.none()},Vd=function(t){if(null===t.anchorNode||null===t.focusNode)return Fd(t);var e=er.fromDom(t.anchorNode),n=er.fromDom(t.focusNode);return Hd(e,t.anchorOffset,n,t.focusOffset)?x.some(Jf.create(e,t.anchorOffset,n,t.focusOffset)):Fd(t)},Ud=function(t){return Ld(t).filter((function(t){return t.rangeCount>0})).bind(Vd)},jd=function(t,e){var n=Od(t,e);return yd(n)},Wd=function(t,e){return{element:t,offset:e}},qd=function(t,e){var n=Xi(t);if(0===n.length)return Wd(t,e);if(e"})),ln()),ph=Kn("schema",(function(){return[Dn("preprocess")]})),vh=Hn("defaults",i({})),bh=Hn("overrides",i({})),yh=He([dh,mh,gh,hh,vh,bh]),wh=He([dh,mh,gh,vh,bh]),xh=He([dh,mh,gh,hh,vh,bh]),Ch=He([dh,ph,gh,yn("unit"),hh,vh,bh]),Sh=function(t){return t.fold(x.some,x.none,x.some,x.some)},kh=function(t){var e=function(t){return t.name};return t.fold(e,e,e,e)},Oh=function(t){return t.fold(u,u,u,u)},Th=function(t,e){return function(n){var r=on("Converting part type",e,n);return t(r)}},Eh=Th(fh.required,yh),_h=Th(fh.external,wh),Ah=Th(fh.optional,xh),Dh=Th(fh.group,Ch),Mh=i("entirety"),Nh=Object.freeze({__proto__:null,required:Eh,external:_h,optional:Ah,group:Dh,asNamedPart:Sh,name:kh,asCommon:Oh,original:Mh}),Rh=function(t,e,n,r){return Kt(e.defaults(t,n,r),n,{uid:t.partUids[e.name]},e.overrides(t,n,r))},zh=function(t,e,n){var r={},o={};return $(n,(function(t){t.fold((function(t){r[t.pname]=ch(!0,(function(e,n,r){return t.factory.sketch(Rh(e,t,n,r))}))}),(function(t){var n=e.parts[t.name];o[t.name]=i(t.factory.sketch(Rh(e,t,n[Mh()]),n))}),(function(t){r[t.pname]=ch(!1,(function(e,n,r){return t.factory.sketch(Rh(e,t,n,r))}))}),(function(t){r[t.pname]=sh(!0,(function(e,n,r){var o=e[t.name];return q(o,(function(n){return t.factory.sketch(Kt(t.defaults(e,n,r),n,t.overrides(e,n)))}))}))}))})),{internals:i(r),externals:i(o)}},Bh=function(t,e){var n={};return $(e,(function(e){Sh(e).each((function(e){var r=Ph(t,e.pname);n[e.name]=function(n){var o=on("Part: "+e.name+" in "+t,He(e.schema),n);return m(m({},r),{config:n,validated:o})}}))})),n},Ph=function(t,e){return{uiType:lh(),owner:t,name:e}},Ih=function(t,e,n){return{uiType:lh(),owner:t,name:e,config:n,validated:{}}},Hh=function(t){return nt(t,(function(t){return t.fold(x.none,x.some,x.none,x.none).map((function(t){return En(t.name,t.schema.concat([js(Mh())]))})).toArray()}))},Lh=function(t){return q(t,kh)},Fh=function(t,e,n){return zh(t,e,n)},Vh=function(t,e,n){return ah(x.some(t),e,e.components,n)},Uh=function(t,e,n){var r=e.partUids[n];return t.getSystem().getByUid(r).toOptional()},jh=function(t,e,n){return Uh(t,e,n).getOrDie("Could not find part: "+n)},Wh=function(t,e,n){var r={},o=e.partUids,u=t.getSystem();return $(n,(function(t){r[t]=i(u.getByUid(o[t]))})),r},qh=function(t,e){var n=t.getSystem();return Mt(e.partUids,(function(t,e){return i(n.getByUid(t))}))},$h=function(t){return _t(t.partUids)},Gh=function(t,e,n){var r={},o=e.partUids,u=t.getSystem();return $(n,(function(t){r[t]=i(u.getByUid(o[t]).getOrDie())})),r},Kh=function(t,e){var n=Lh(e);return le(q(n,(function(e){return{key:e,value:t+"-"+e}})))},Xh=function(t){return $e("partUids","partUids",re((function(e){return Kh(e.uid,t)})),ln())},Yh=Object.freeze({__proto__:null,generate:Bh,generateOne:Ih,schemas:Hh,names:Lh,substitutes:Fh,components:Vh,defaultUids:Kh,defaultUidsSchema:Xh,getAllParts:qh,getAllPartNames:$h,getPart:Uh,getPartOrDie:jh,getParts:Wh,getPartsOrDie:Gh}),Jh=function(t,e){var n=t.length>0?[En("parts",t)]:[];return n.concat([yn("uid"),Hn("dom",{}),Hn("components",[]),js("originalSpec"),Hn("debug.sketcher",{})]).concat(e)},Qh=function(t,e,n,r,o){var i=Jh(r,o);return on(t+" [SpecSchema]",Ie(i.concat(e)),n)},Zh=function(t,e,n,r){var o=np(r),i=Qh(t,e,o,[],[]);return n(i,o)},tp=function(t,e,n,r,o){var i=np(o),u=Hh(n),a=Xh(n),c=Qh(t,e,i,u,[a]),s=Fh(t,c,n),l=Vh(t,c,s.internals());return r(c,l,i,s.externals())},ep=function(t){return Ft(t,"uid")},np=function(t){return ep(t)?t:m(m({},t),{uid:Bu("uid")})};function rp(t){return void 0!==t.uid}var op,ip=Ie([yn("name"),yn("factory"),yn("configFields"),Hn("apis",{}),Hn("extraApis",{})]),up=Ie([yn("name"),yn("factory"),yn("configFields"),yn("partFields"),Hn("apis",{}),Hn("extraApis",{})]),ap=function(t){var e=on("Sketcher for "+t.name,ip,t),n=function(t){return Zh(e.name,e.configFields,e.factory,t)},r=Mt(e.apis,$u),o=Mt(e.extraApis,(function(t,e){return Vu(t,e)}));return m(m({name:e.name,configFields:e.configFields,sketch:n},r),o)},cp=function(t){var e=on("Sketcher for "+t.name,up,t),n=function(t){return tp(e.name,e.configFields,e.partFields,e.factory,t)},r=Bh(e.name,e.partFields),o=Mt(e.apis,$u),i=Mt(e.extraApis,(function(t,e){return Vu(t,e)}));return m(m({name:e.name,partFields:e.partFields,configFields:e.configFields,sketch:n,parts:r},o),i)},sp=function(t){for(var e=[],n=function(t){e.push(t)},r=0;r0?x.some(r[r.length-1]):x.none();return o.bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},Rp=function(t,e,n,r){var o=Pd(t.element,"."+e.itemClass),i=tt(o,(function(t){return Da(t,e.highlightClass)}));return i.bind((function(e){var n=pf(e,r,0,o.length-1);return t.getSystem().getByDom(o[n]).toOptional()}))},zp=function(t,e,n){return Rp(t,e,n,-1)},Bp=function(t,e,n){return Rp(t,e,n,1)},Pp=function(t,e,n){var r=Pd(t.element,"."+e.itemClass);return sp(q(r,(function(e){return t.getSystem().getByDom(e).toOptional()})))},Ip=Object.freeze({__proto__:null,dehighlightAll:xp,dehighlight:Cp,highlight:Sp,highlightFirst:kp,highlightLast:Op,highlightAt:Tp,highlightBy:Ep,isHighlighted:_p,getHighlighted:Ap,getFirst:Mp,getLast:Np,getPrevious:zp,getNext:Bp,getCandidates:Pp}),Hp=[yn("highlightClass"),yn("itemClass"),Hs("onHighlight"),Hs("onDehighlight")],Lp=Ul({fields:Hp,name:"highlighting",apis:Ip}),Fp=[8],Vp=[9],Up=[13],jp=[27],Wp=[32],qp=[37],$p=[38],Gp=[39],Kp=[40],Xp=function(t,e,n){var r=ot(t.slice(0,e)),o=ot(t.slice(e+1));return Z(r.concat(o),n)},Yp=function(t,e,n){var r=ot(t.slice(0,e));return Z(r,n)},Jp=function(t,e,n){var r=t.slice(0,e),o=t.slice(e+1);return Z(o.concat(r),n)},Qp=function(t,e,n){var r=t.slice(e+1);return Z(r,n)},Zp=function(t){return function(e){var n=e.raw;return V(t,n.which)}},tv=function(t){return function(e){return rt(t,(function(t){return t(e)}))}},ev=function(t){var e=t.raw;return!0===e.shiftKey},nv=function(t){var e=t.raw;return!0===e.ctrlKey},rv=c(ev),ov=function(t,e){return{matches:t,classification:e}},iv=function(t,e){var n=Z(t,(function(t){return t.matches(e)}));return n.map((function(t){return t.classification}))},uv=function(t,e,n){var r=e.exists((function(t){return n.exists((function(e){return oo(e,t)}))}));r||fi(t,oi(),{prevFocus:e,newFocus:n})},av=function(){var t=function(t){return tf(t.element)},e=function(e,n){var r=t(e);e.getSystem().triggerFocus(n,e.element);var o=t(e);uv(e,r,o)};return{get:t,set:e}},cv=function(){var t=function(t){return Lp.getHighlighted(t).map((function(t){return t.element}))},n=function(n,r){var o=t(n);n.getSystem().getByDom(r).fold(e,(function(t){Lp.highlight(n,t)}));var i=t(n);uv(n,o,i)};return{get:t,set:n}};(function(t){t["OnFocusMode"]="onFocus",t["OnEnterOrSpaceMode"]="onEnterOrSpace",t["OnApiMode"]="onApi"})(op||(op={}));var sv=function(t,e,n,r,o){var i=function(){return t.concat([Hn("focusManager",av()),Ln("focusInside","onFocus",Ze((function(t){return V(["onFocus","onEnterOrSpace","onApi"],t)?pt.value(t):pt.error("Invalid value for focusInside")}))),Us("handler",c),Us("state",e),Us("sendFocusIn",o)])},u=function(t,e,n,r,o){var i=n(t,e,r,o);return iv(i,e.event).bind((function(n){return n(t,e,r,o)}))},a=function(t,e){var i=t.focusInside!==op.OnFocusMode?x.none():o(t).map((function(n){return wi(Lo(),(function(r,o){n(r,t,e),o.stop()}))})),a=function(n,r){var i=Zp(Wp.concat(Up))(r.event);t.focusInside===op.OnEnterOrSpaceMode&&i&&fo(n,r)&&o(t).each((function(o){o(n,t,e),r.stop()}))},c=[wi(Do(),(function(r,o){u(r,o,n,t,e).fold((function(){a(r,o)}),(function(t){o.stop()}))})),wi(Mo(),(function(n,o){u(n,o,r,t,e).each((function(t){o.stop()}))}))];return pi(i.toArray().concat(c))},c={schema:i,processKey:u,toEvents:a};return c},lv=function(t){var e=[Dn("onEscape"),Dn("onEnter"),Hn("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),Hn("firstTabstop",0),Hn("useTabstopAt",f),Dn("visibilitySelector")].concat([t]),n=function(t,e){var n=t.visibilitySelector.bind((function(t){return hs(e,t)})).getOr(e);return Sc(n)>0},r=function(t,e){var r=Pd(t.element,e.selector),o=X(r,(function(t){return n(e,t)}));return x.from(o[e.firstTabstop])},o=function(t,e){return e.focusManager.get(t).bind((function(t){return hs(t,e.selector)}))},u=function(t,e){return n(t,e)&&t.useTabstopAt(e)},c=function(t,e,n){r(t,e).each((function(n){e.focusManager.set(t,n)}))},s=function(t,e,n,r,o){return o(e,n,(function(t){return u(r,t)})).fold((function(){return r.cyclic?x.some(!0):x.none()}),(function(e){return r.focusManager.set(t,e),x.some(!0)}))},l=function(t,e,n,r){var i=Pd(t.element,n.selector);return o(t,n).bind((function(e){var o=tt(i,a(oo,e));return o.bind((function(e){return s(t,i,e,n,r)}))}))},d=function(t,e,n){var r=n.cyclic?Xp:Yp;return l(t,e,n,r)},m=function(t,e,n){var r=n.cyclic?Jp:Qp;return l(t,e,n,r)},g=function(t,e,n){return n.onEnter.bind((function(n){return n(t,e)}))},h=function(t,e,n){return n.onEscape.bind((function(n){return n(t,e)}))},p=i([ov(tv([ev,Zp(Vp)]),d),ov(Zp(Vp),m),ov(Zp(jp),h),ov(tv([rv,Zp(Up)]),g)]),v=i([]);return sv(e,Gu.init,p,v,(function(){return x.some(c)}))},fv=lv(Kn("cyclic",l)),dv=lv(Kn("cyclic",f)),mv=function(t,e,n){return mi(t,n,jo()),x.some(!0)},gv=function(t,e,n){var r=hp(n)&&Zp(Wp)(e.event);return r?x.none():mv(t,e,n)},hv=function(t,e){return x.some(!0)},pv=[Hn("execute",gv),Hn("useSpace",!1),Hn("useEnter",!0),Hn("useControlEnter",!1),Hn("useDown",!1)],vv=function(t,e,n){return n.execute(t,e,t.element)},bv=function(t,e,n,r){var o=n.useSpace&&!hp(t.element)?Wp:[],i=n.useEnter?Up:[],u=n.useDown?Kp:[],a=o.concat(i).concat(u);return[ov(Zp(a),vv)].concat(n.useControlEnter?[ov(tv([nv,Zp(Up)]),vv)]:[])},yv=function(t,e,n,r){return n.useSpace&&!hp(t.element)?[ov(Zp(Wp),hv)]:[]},wv=sv(pv,Gu.init,bv,yv,(function(){return x.none()})),xv=function(){var t=Xn(x.none()),e=function(e,n){t.set(x.some({numRows:e,numColumns:n}))},n=function(){return t.get().map((function(t){return t.numRows}))},r=function(){return t.get().map((function(t){return t.numColumns}))};return Ku({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})},Cv=function(t){return t.state(t)},Sv=Object.freeze({__proto__:null,flatgrid:xv,init:Cv}),kv=function(t){return function(e,n,r,o){var i=t(e.element);return _v(i,e,n,r,o)}},Ov=function(t,e){var n=Hf(t,e);return kv(n)},Tv=function(t,e){var n=Hf(e,t);return kv(n)},Ev=function(t){return function(e,n,r,o){return _v(t,e,n,r,o)}},_v=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}))},Av=Ev,Dv=Ev,Mv=Ev,Nv=function(t){return t.offsetWidth<=0&&t.offsetHeight<=0},Rv=function(t){return!Nv(t.dom)},zv=function(t,e){return tt(t,e).map((function(e){return{index:e,candidates:t}}))},Bv=function(t,e,n){var r=function(t){return oo(t,e)},o=Pd(t,n),i=X(o,Rv);return zv(i,r)},Pv=function(t,e){return tt(t,(function(t){return oo(e,t)}))},Iv=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?x.some(t.slice(1)):x.none()}))},h=function(t){return Lt(n.get(),t)},p=function(t){return v(t).bind(Ew)},v=function(t){return Lt(e.get(),t)},b=function(e){return Lt(t.get(),e)},y=function(t){var e=o.get();return it(_t(e),t)},w=function(){return r.get().bind(p)},C=function(){return e.get()};return{setMenuBuilt:a,setContents:c,expand:d,refresh:h,collapse:g,lookupMenu:v,lookupItem:b,otherMenus:y,getPrimary:w,getMenus:C,clear:i,isClear:u,getTriggeringPath:f}},Ew=function(t){return"prepared"===t.type?x.some(t.menu):x.none()},_w={init:Tw,extractPreparedMenu:Ew},Aw=function(t,e){var n,r=Xn(x.none()),o=function(e,n,r){return Mt(r,(function(r,o){var i=function(){return Cw.sketch(m(m({},r),{value:o,markers:t.markers,fakeFocus:t.fakeFocus,onHighlight:t.onHighlight,focusManager:t.fakeFocus?cv():av()}))};return o===n?{type:"prepared",menu:e.getSystem().build(i())}:{type:"notbuilt",nbMenu:i}}))},i=_w.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 Kg.getValue(t).value},c=function(t,e,n){return dt(e,(function(t){if(!t.getSystem().isConnected())return x.none();var e=Lp.getCandidates(t);return Z(e,(function(t){return a(t)===n}))}))},s=function(e){return Mt(t.data.menus,(function(t,e){return nt(t.items,(function(t){return"separator"===t.type?[]:[t.data.value]}))}))},l=function(t,e){Lp.highlight(t,e),Lp.getHighlighted(e).orThunk((function(){return Lp.getFirst(e)})).each((function(e){mi(t,e.element,Wo())}))},f=function(t,e){return sp(q(e,(function(e){return t.lookupMenu(e).bind((function(t){return"prepared"===t.type?x.some(t.menu):x.none()}))})))},d=function(e,n,r){var o=f(n,n.otherMenus(r));$(o,(function(n){Na(n.element,[t.markers.backgroundMenu]),t.stayInDom||xy.remove(e,n)}))},g=function(e){return r.get().getOrThunk((function(){var n={},o=Pd(e.element,"."+t.markers.item),i=X(o,(function(t){return"true"===hu(t,"aria-haspopup")}));return $(i,(function(t){e.getSystem().getByDom(t).each((function(t){var e=a(t);n[e]=t}))})),r.set(x.some(n)),n}))},h=function(t,e){var n=g(t);Dt(n,(function(t,n){var r=V(e,n);mu(t.element,"aria-expanded",r)}))},p=function(e,n,r){return x.from(r[0]).bind((function(o){return n.lookupMenu(o).bind((function(o){if("notbuilt"===o.type)return x.none();var i=o.menu,u=f(n,r.slice(1));return $(u,(function(e){Ea(e.element,t.markers.backgroundMenu)})),Wa(i.element)||xy.append(e,wc(i)),Na(i.element,[t.markers.backgroundMenu]),l(e,i),d(e,n,r),x.some(i)}))}))};(function(t){t[t["HighlightSubmenu"]=0]="HighlightSubmenu",t[t["HighlightParent"]=1]="HighlightParent"})(n||(n={}));var v=function(t,e,n){if("notbuilt"===n.type){var r=t.getSystem().build(n.nbMenu());return i.setMenuBuilt(e,r),r}return n.menu},b=function(e,r,o){void 0===o&&(o=n.HighlightSubmenu);var u=a(r);return i.expand(u).bind((function(u){return h(e,u),x.from(u[0]).bind((function(a){return i.lookupMenu(a).bind((function(c){var s=v(e,a,c);return Wa(s.element)||xy.append(e,wc(s)),t.onOpenSubmenu(e,r,s,ot(u)),o===n.HighlightSubmenu?(Lp.highlightFirst(s),p(e,i,u)):(Lp.dehighlightAll(s),x.some(r))}))}))}))},y=function(e,n){var r=a(n);return i.collapse(r).bind((function(r){return h(e,r),p(e,i,r).map((function(r){return t.onCollapseMenu(e,n,r),r}))}))},w=function(t,e){var n=a(e);return i.refresh(n).bind((function(e){return h(t,e),p(t,i,e)}))},C=function(t,e){return hp(e.element)?x.none():b(t,e,n.HighlightSubmenu)},S=function(t,e){return hp(e.element)?x.none():y(t,e)},k=function(e,n){return y(e,n).orThunk((function(){return t.onEscape(e,n).map((function(){return e}))}))},O=function(e){return function(n,r){return hs(r.getSource(),"."+t.markers.item).bind((function(t){return n.getSystem().getByDom(t).toOptional().bind((function(t){return e(n,t).map((function(){return!0}))}))}))}},T=pi([wi(ww(),(function(t,e){var n=e.event.item;i.lookupItem(a(n)).each((function(){var n=e.event.menu;Lp.highlight(t,n);var r=a(e.event.item);i.refresh(r).each((function(e){return d(t,i,e)}))}))})),Ri((function(e,r){var o=r.event.target;e.getSystem().getByDom(o).each((function(r){var o=a(r);0===o.indexOf("collapse-item")&&y(e,r),b(e,r,n.HighlightSubmenu).fold((function(){t.onExecute(e,r)}),(function(){}))}))})),Di((function(e,n){u(e).each((function(n){xy.append(e,wc(n)),t.onOpenMenu(e,n),t.highlightImmediately&&l(e,n)}))}))].concat(t.navigateOnHover?[wi(ow(),(function(e,r){var o=r.event.item;w(e,o),b(e,o,n.HighlightParent),t.onHover(e,o)}))]:[])),E=function(t){return Lp.getHighlighted(t).bind(Lp.getHighlighted)},_=function(t){E(t).each((function(e){y(t,e)}))},A=function(t){i.getPrimary().each((function(e){l(t,e)}))},D=function(t){return x.from(t.components()[0]).filter((function(t){return"menu"===hu(t.element,"role")}))},M=function(e){var n=i.getPrimary().bind((function(t){return E(e).bind((function(t){var n=a(t),r=Ht(i.getMenus()),o=sp(q(r,_w.extractPreparedMenu));return i.getTriggeringPath(n,(function(t){return c(e,o,t)}))})).map((function(e){return{primary:t,triggeringPath:e}}))}));n.fold((function(){D(e).each((function(n){t.onRepositionMenu(e,n,[])}))}),(function(n){var r=n.primary,o=n.triggeringPath;t.onRepositionMenu(e,r,o)}))},N={collapseMenu:_,highlightPrimary:A,repositionMenus:M};return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:Jg(t.tmenuBehaviours,[fy.config({mode:"special",onRight:O(C),onLeft:O(S),onEscape:O(k),focusIn:function(t,e){i.getPrimary().each((function(e){mi(t,e.element,Wo())}))}}),Lp.config({highlightClass:t.markers.selectedMenu,itemClass:t.markers.menu}),yp.config({find:function(t){return Lp.getHighlighted(t)}}),xy.config({})]),eventOrder:t.eventOrder,apis:N,events:T}},Dw=i("collapse-item"),Mw=function(t,e,n){return{primary:t,menus:e,expansions:n}},Nw=function(t,e){return{primary:t,menus:se(t,e),expansions:{}}},Rw=function(t){return{value:Eu(Dw()),meta:{text:t}}},zw=ap({name:"TieredMenu",configFields:[Vs("onExecute"),Vs("onEscape"),Fs("onOpenMenu"),Fs("onOpenSubmenu"),Hs("onRepositionMenu"),Hs("onCollapseMenu"),Hn("highlightImmediately",!0),En("data",[yn("primary"),yn("menus"),yn("expansions")]),Hn("fakeFocus",!1),Hs("onHighlight"),Hs("onHover"),Bs(),yn("dom"),Hn("navigateOnHover",!0),Hn("stayInDom",!1),Xg("tmenuBehaviours",[fy,Lp,yp,xy]),Hn("eventOrder",{})],apis:{collapseMenu:function(t,e){t.collapseMenu(e)},highlightPrimary:function(t,e){t.highlightPrimary(e)},repositionMenus:function(t,e){t.repositionMenus(e)}},factory:Aw,extraApis:{tieredData:Mw,singleData:Nw,collapseItem:Rw}}),Bw=function(t,e,n,r,o){var i=function(){return t.lazySink(e)},u="horizontal"===r.type?{layouts:{onLtr:function(){return El()},onRtl:function(){return _l()}}}:{},a=function(t){return 2===t.length},c=function(t){return a(t)?u:{}};return zw.sketch({dom:{tag:"div"},data:r.data,markers:r.menu.markers,highlightImmediately:r.menu.highlightImmediately,onEscape:function(){return dg.close(e),t.onEscape.map((function(t){return t(e)})),x.some(!0)},onExecute:function(){return x.some(!0)},onOpenMenu:function(t,e){Nm.positionWithinBounds(i().getOrDie(),n,e,o())},onOpenSubmenu:function(t,e,n,r){var o=i().getOrDie();Nm.position(o,m({anchor:"submenu",item:e},c(r)),n)},onRepositionMenu:function(t,e,r){var u=i().getOrDie();Nm.positionWithinBounds(u,n,e,o()),$(r,(function(t){var e=c(t.triggeringPath);Nm.position(u,m({anchor:"submenu",item:t.triggeringItem},e),t.triggeredMenu)}))}})},Pw=function(t,e){var n=function(e,n){var r=t.getRelated(e);return r.exists((function(t){return ys(t,n)}))},r=function(t,e){dg.setContent(t,e)},o=function(t,e,n){i(t,e,n,x.none())},i=function(t,e,n,r){u(t,e,n,(function(){return r.map((function(t){return os(t)}))}))},u=function(e,n,r,o){var i=t.lazySink(e).getOrDie();dg.openWhileCloaked(e,r,(function(){return Nm.positionWithinBounds(i,n,e,o())})),Kg.setValue(e,x.some({mode:"position",anchor:n,getBounds:o}))},a=function(t,e,n){c(t,e,n,(function(){return x.none()}))},c=function(e,n,r,o){var i=Bw(t,e,n,r,o);dg.open(e,i),Kg.setValue(e,x.some({mode:"menu",menu:i}))},s=function(t){dg.isOpen(t)&&(Kg.setValue(t,x.none()),dg.close(t))},l=function(t){return dg.getState(t)},f=function(e){dg.isOpen(e)&&Kg.getValue(e).each((function(n){switch(n.mode){case"menu":dg.getState(e).each((function(t){zw.repositionMenus(t)}));break;case"position":var r=t.lazySink(e).getOrDie();Nm.positionWithinBounds(r,n.anchor,e,n.getBounds());break}}))},d={setContent:r,showAt:o,showWithin:i,showWithinBounds:u,showMenuAt:a,showMenuWithinBounds:c,hide:s,getContent:l,reposition:f,isOpen:dg.isOpen};return{uid:t.uid,dom:t.dom,behaviours:Jg(t.inlineBehaviours,[dg.config({isPartOf:function(t,e,r){return ys(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)}}),Kg.config({store:{mode:"memory",initialValue:x.none()}}),$l.config({channels:m(m({},vg(m({isExtraPart:e.isExtraPart},t.fireDismissalEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})))),yg(m(m({},t.fireRepositionEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})),{doReposition:f})))})]),eventOrder:t.eventOrder,apis:d}},Iw=ap({name:"InlineView",configFields:[yn("lazySink"),Hs("onShow"),Hs("onHide"),zn("onEscape"),Xg("inlineBehaviours",[dg,Kg,$l]),Pn("fireDismissalEventInstead",[Hn("event",ni())]),Pn("fireRepositionEventInstead",[Hn("event",ri())]),Hn("getRelated",x.none),Hn("isExtraPart",l),Hn("eventOrder",x.none)],factory:Pw,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)}}}),Hw=function(t){return t.x},Lw=function(t,e){return t.x+t.width/2-e.width/2},Fw=function(t,e){return t.x+t.width-e.width},Vw=function(t){return t.y},Uw=function(t,e){return t.y+t.height-e.height},jw=function(t,e,n){return qs(Fw(t,e),Uw(t,e),n.innerSoutheast(),Zs(),il(t,{right:0,bottom:3}),"layout-inner-se")},Ww=function(t,e,n){return qs(Hw(t),Uw(t,e),n.innerSouthwest(),Qs(),il(t,{left:1,bottom:3}),"layout-inner-sw")},qw=function(t,e,n){return qs(Fw(t,e),Vw(t),n.innerNortheast(),Js(),il(t,{right:0,top:2}),"layout-inner-ne")},$w=function(t,e,n){return qs(Hw(t),Vw(t),n.innerNorthwest(),Ys(),il(t,{left:1,top:2}),"layout-inner-nw")},Gw=function(t,e,n){return qs(Lw(t,e),Vw(t),n.innerNorth(),tl(),il(t,{top:2}),"layout-inner-n")},Kw=function(t,e,n){return qs(Lw(t,e),Uw(t,e),n.innerSouth(),el(),il(t,{bottom:3}),"layout-inner-s")},Xw=tinymce.util.Tools.resolve("tinymce.util.Delay"),Yw=function(t){var e=Zy(t.action),n=t.dom.tag,r=function(e){return Lt(t.dom,"attributes").bind((function(t){return Lt(t,e)}))},o=function(){if("button"===n){var t=r("type").getOr("button"),e=r("role").map((function(t){return{role:t}})).getOr({});return m({type:t},e)}var o=r("role").getOr("button");return{role:o}};return{uid:t.uid,dom:t.dom,components:t.components,events:e,behaviours:Qg.augment(t.buttonBehaviours,[Ny.config({}),fy.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:o()},eventOrder:t.eventOrder}},Jw=ap({name:"Button",factory:Yw,configFields:[Hn("uid",void 0),yn("dom"),Hn("components",[]),Qg.field("buttonBehaviours",[Ny,fy]),Dn("action"),Dn("role"),Hn("eventOrder",{})]}),Qw=function(t){var e=rp(t)&&Vt(t,"uid")?t.uid:Bu("memento"),n=function(t){return t.getSystem().getByUid(e).getOrDie()},r=function(t){return t.getSystem().getByUid(e).toOptional()},o=function(){return m(m({},t),{uid:e})};return{get:n,getOpt:r,asSpec:o}},Zw=function(t){return x.from(t()["temporary-placeholder"]).getOr("!not found!")},tx=function(t,e){return x.from(e()[t.toLowerCase()]).getOrThunk((function(){return Zw(e)}))},ex=function(t,e,n){return x.from(e()[t.toLowerCase()]).or(n).getOrThunk((function(){return Zw(e)}))},nx=function(t,e){return dt(t,(function(t){return x.from(e()[t.toLowerCase()])})).getOrThunk((function(){return Zw(e)}))},rx={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},ox=function(t){var e=Qw({dom:{tag:"p",innerHtml:t.translationProvider(t.text)},behaviours:Fl([xy.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=Qw({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:Fl([xy.config({})])}),i=function(t,e){t.getSystem().isConnected()&&o.getOpt(t).each((function(t){xy.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);xy.set(r,[pc(n)])}},a={updateProgress:i,updateText:u},c=et([t.icon.toArray(),t.level.toArray(),t.level.bind((function(t){return x.from(rx[t])})).toArray()]),s=Qw(Jw.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"]},components:[{dom:{tag:"div",classes:["tox-icon"],innerHtml:tx("close",t.iconProvider),attributes:{"aria-label":t.translationProvider("Close")}}}],action:function(e){t.onAction(e)}})),l=[{dom:{tag:"div",classes:["tox-notification__icon"],innerHtml:nx(c,t.iconProvider)}},{dom:{tag:"div",classes:["tox-notification__body"]},components:[e.asSpec()],behaviours:Fl([xy.config({})])}];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:Fl([Ny.config({}),Sy("notification-events",[wi(_o(),(function(t){s.getOpt(t).each(Ny.focus)}))])]),components:l.concat(t.progress?[o.asSpec()]:[]).concat(t.closeButton?[s.asSpec()]:[]),apis:a}},ix=ap({name:"Notification",factory:ox,configFields:[Dn("level"),yn("progress"),yn("icon"),yn("onAction"),yn("text"),yn("iconProvider"),yn("translationProvider"),jn("closeButton",!0)],apis:{updateProgress:function(t,e,n){t.updateProgress(e,n)},updateText:function(t,e,n){t.updateText(e,n)}}});function ux(t,e,n){var r=e.backstage,o=function(t){switch(t){case"bc-bc":return Kw;case"tc-tc":return Gw;case"tc-bc":return yl;case"bc-tc":default:return wl}},i=function(t){$(t,(function(t){return t.moveTo(0,0)}))},u=function(t){t.length>0&&(st(t).each((function(t){return t.moveRel(null,"banner")})),$(t,(function(e,n){n>0&&e.moveRel(t[n-1].getEl(),"bc-tc")})))},a=function(t){i(t),u(t)},c=function(t,i){var u=!t.closeButton&&t.timeout&&(t.timeout>0||t.timeout<0),a=function(){i(),Iw.hide(s)},c=yc(ix.sketch({text:t.text,level:V(["success","error","warning","warn","info"],t.type)?t.type:void 0,progress:!0===t.progressBar,icon:x.from(t.icon),closeButton:!u,onAction:a,iconProvider:r.shared.providers.icons,translationProvider:r.shared.providers.translate})),s=yc(Iw.sketch(m({dom:{tag:"div",classes:["tox-notifications-container"]},lazySink:e.backstage.shared.getSink,fireDismissalEventInstead:{}},r.shared.header.isPositionedAtTop()?{}:{fireRepositionEventInstead:{}})));return n.add(s),t.timeout>0&&Xw.setTimeout((function(){a()}),t.timeout),{close:a,moveTo:function(t,e){Iw.showAt(s,{anchor:"makeshift",x:t,y:e},wc(c))},moveRel:function(t,n){if("banner"!==n){var r=o(n),i={anchor:"node",root:qa(),node:x.some(er.fromDom(t)),layouts:{onRtl:function(){return[r]},onLtr:function(){return[r]}}};Iw.showAt(s,i,wc(c))}else Iw.showAt(s,e.backstage.shared.anchors.banner(),wc(c))},text:function(t){ix.updateText(c,t)},settings:t,getEl:function(){return c.element.dom},progressBar:{value:function(t){ix.updateProgress(c,t)}}}},s=function(t){t.close()},l=function(t){return t.settings};return{open:c,close:s,reposition:a,getArgs:l}}var ax,cx=function(t,e){var n=null,r=function(){null!==n&&(clearTimeout(n),n=null)},o=function(){for(var r=[],o=0;o',t.getDoc());return eu(n,er.fromDom(e.extractContents())),e.insertNode(n.dom),qi(n).each((function(t){return t.dom.normalize()})),zd(n).map((function(e){t.selection.setCursorLocation(e.dom,Dd(e))})),n}))},hx=function(t){return hs(t,mx)},px=function(t){return t.collapsed&&3===t.startContainer.nodeType},vx=function(t){return t.toString().replace(/\u00A0/g," ").replace(/\uFEFF/g,"")},bx=function(t){return""!==t&&-1!=="  \f\n\r\t\v".indexOf(t)},yx=function(t,e){return t.substring(e.length)},wx=function(t,e,n){var r;for(r=e-1;r>=0;r--){var o=t.charAt(r);if(bx(o))return x.none();if(o===n)break}return x.some(r)},xx=function(t,e,n,r){if(void 0===r&&(r=0),!px(e))return x.none();var o=function(t,e,r){return wx(r,e,n).getOr(e)},i=t.getParent(e.startContainer,t.isBlock)||t.getRoot();return dx(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 x.none();var i=vx(o),u=i.lastIndexOf(n);return 0!==u||yx(i,n).length0?Ax(e[e.length-1]):Tx(t,e.length)},Dx=function(t,e){var n=t.childNodes;return n.length>0&&e0&&_x(t)&&n.length===e?Ax(n[n.length-1]):Tx(t,e)},Mx=function(t,e){return dx(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!bx(e)})).isSome()},Nx=function(t){return function(e){var n=Dx(e.startContainer,e.startOffset);return!Mx(t,n)}},Rx=function(t,e,n){return dt(n.triggerChars,(function(n){return Cx(t,e,n)}))},zx=function(t,e){var n=e(),r=t.selection.getRng();return Rx(t.dom,r,n).bind((function(n){return Bx(t,e,n)}))},Bx=function(t,e,n,r){void 0===r&&(r={});var o=e(),i=t.selection.getRng(),u=i.startContainer.nodeValue,a=X(o.lookupByChar(n.triggerChar),(function(e){return n.text.length>=e.minChars&&e.matches.getOrThunk((function(){return Nx(t.dom)}))(n.range,u,n.text)}));if(0===a.length)return x.none();var c=Ox.all(q(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 x.some({lookupData:c,context:n})},Px=He([Cn("type"),Rn("text")]),Ix=function(t){return nn("separatormenuitem",Px,t)},Hx=He([Hn("type","autocompleteitem"),Hn("active",!1),Hn("disabled",!1),Hn("meta",{}),Cn("value"),Rn("text"),Rn("icon")]),Lx=He([Cn("type"),Cn("ch"),Fn("minChars",1),Hn("columns",1),Fn("maxResults",10),zn("matches"),On("fetch"),On("onAction"),$n("highlightOn",[],mn)]),Fx=function(t){return nn("Autocompleter.Separator",Px,t)},Vx=function(t){return nn("Autocompleter.Item",Hx,t)},Ux=function(t){return nn("Autocompleter",Lx,t)},jx=[jn("disabled",!1),Rn("tooltip"),Rn("icon"),Rn("text"),Wn("onSetup",(function(){return e}))],Wx=He([Cn("type"),On("onAction")].concat(jx)),qx=function(t){return nn("toolbarbutton",Wx,t)},$x=[jn("active",!1)].concat(jx),Gx=He($x.concat([Cn("type"),On("onAction")])),Kx=function(t){return nn("ToggleButton",Gx,t)},Xx=[Wn("predicate",(function(){return!1})),Un("scope","node",["node","editor"]),Un("position","selection",["node","selection","line"])],Yx=jx.concat([Hn("type","contextformbutton"),Hn("primary",!1),On("onAction"),Kn("original",u)]),Jx=$x.concat([Hn("type","contextformbutton"),Hn("primary",!1),On("onAction"),Kn("original",u)]),Qx=jx.concat([Hn("type","contextformbutton")]),Zx=$x.concat([Hn("type","contextformtogglebutton")]),tC=cn("type",{contextformbutton:Yx,contextformtogglebutton:Jx}),eC=He([Hn("type","contextform"),Wn("initValue",(function(){return""})),Rn("label"),An("commands",tC),Mn("launch",cn("type",{contextformbutton:Qx,contextformtogglebutton:Zx}))].concat(Xx)),nC=function(t){return nn("ContextForm",eC,t)},rC=He([Hn("type","contexttoolbar"),Cn("items")].concat(Xx)),oC=function(t){return nn("ContextToolbar",rC,t)},iC=function(t){var e={};return $(t,(function(t){e[t]={}})),_t(e)},uC=function(t){var e=t.ui.registry.getAll().popups,n=Mt(e,(function(t){return Ux(t).fold((function(t){throw new Error(un(t))}),(function(t){return t}))})),r=iC(Pt(n,(function(t){return t.ch}))),o=Ht(n),i=function(t){return X(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"})(ax||(ax={}));var aC,cC=ax,sC="tox-menu-nav__js",lC="tox-collection__item",fC="tox-swatch",dC={normal:sC,color:fC},mC="tox-collection__item--enabled",gC="tox-collection__group-heading",hC="tox-collection__item-icon",pC="tox-collection__item-label",vC="tox-collection__item-accessory",bC="tox-collection__item-caret",yC="tox-collection__item-checkmark",wC="tox-collection__item--active",xC="tox-collection__item-icon-rtl",CC="tox-collection__item-container",SC="tox-collection__item-container--column",kC="tox-collection__item-container--row",OC="tox-collection__item-container--align-right",TC="tox-collection__item-container--align-left",EC="tox-collection__item-container--valign-top",_C="tox-collection__item-container--valign-middle",AC="tox-collection__item-container--valign-bottom",DC=function(t){return Lt(dC,t).getOr(sC)},MC=function(t){return"color"===t?"tox-swatches":"tox-menu"},NC=function(t){return{backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:MC(t),tieredMenu:"tox-tiered-menu"}},RC=function(t){var e=NC(t);return{backgroundMenu:e.backgroundMenu,selectedMenu:e.selectedMenu,menu:e.menu,selectedItem:e.selectedItem,item:DC(t)}},zC=function(t,e,n){var r=NC(n);return{tag:"div",classes:et([[r.menu,"tox-menu-"+e+"-column"],t?[r.hasIcons]:[]])}},BC=[Cw.parts.items({})],PC=function(t,e,n){var r=NC(n),o={tag:"div",classes:et([[r.tieredMenu]])};return{dom:o,markers:RC(n)}},IC=function(t,e){return function(n){var r=W(n,e);return q(r,(function(e){return{dom:t,components:e}}))}},HC=function(t){return{dom:{tag:"div",classes:["tox-menu","tox-swatches-menu"]},components:[{dom:{tag:"div",classes:["tox-swatches"]},components:[Cw.parts.items({preprocess:"auto"!==t?IC({tag:"div",classes:["tox-swatches__row"]},t):u})]}]}},LC=function(t){return{dom:{tag:"div",classes:["tox-menu","tox-collection","tox-collection--toolbar","tox-collection--toolbar-lg"]},components:[Cw.parts.items({preprocess:IC({tag:"div",classes:["tox-collection__group"]},t)})]}},FC=function(t,e){var n=[],r=[];return $(t,(function(t,o){e(t,o)?(r.length>0&&n.push(r),r=[],Ft(t.dom,"innerHtml")&&r.push(t)):r.push(t)})),r.length>0&&n.push(r),q(n,(function(t){return{dom:{tag:"div",classes:["tox-collection__group"]},components:t}}))},VC=function(t,e,n){return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===t?["tox-collection--list"]:["tox-collection--grid"])},components:[Cw.parts.items({preprocess:function(n){return"auto"!==t&&t>1?IC({tag:"div",classes:["tox-collection__group"]},t)(n):FC(n,(function(t,n){return"separator"===e[n].type}))}})]}},UC=function(t,e){return{dom:{tag:"div",classes:["tox-collection","tox-collection--horizontal"]},components:[Cw.parts.items({preprocess:function(e){return FC(e,(function(e,n){return"separator"===t[n].type}))}})]}},jC=function(t){return U(t,(function(t){return"icon"in t&&void 0!==t.icon}))},WC=function(t){return console.error(un(t)),console.log(t),x.none()},qC=function(t,e,n,r,o){var i=UC(n);return{value:t,dom:i.dom,components:i.components,items:n}},$C=function(t,e,n,r,o){if("color"===o){var i=HC(r);return{value:t,dom:i.dom,components:i.components,items:n}}if("normal"===o&&"auto"===r){i=VC(r,n);return{value:t,dom:i.dom,components:i.components,items:n}}if("normal"===o&&1===r){i=VC(1,n);return{value:t,dom:i.dom,components:i.components,items:n}}if("normal"===o){i=VC(r,n);return{value:t,dom:i.dom,components:i.components,items:n}}if("listpreview"===o&&"auto"!==r){i=LC(r);return{value:t,dom:i.dom,components:i.components,items:n}}return{value:t,dom:zC(e,r,o),components:BC,items:n}},GC=[Cn("type"),Cn("src"),Rn("alt"),$n("classes",[],mn)],KC=He(GC),XC=[Cn("type"),Cn("text"),Rn("name"),$n("classes",["tox-collection__item-label"],mn)],YC=He(XC),JC=Qe((function(){return an("type",{cardimage:KC,cardtext:YC,cardcontainer:QC})})),QC=He([Cn("type"),Vn("direction","horizontal"),Vn("align","left"),Vn("valign","middle"),An("items",JC)]),ZC=[jn("disabled",!1),Rn("text"),Rn("shortcut"),$e("value","value",ne((function(){return Eu("menuitem-value")})),ln()),Hn("meta",{})],tS=He([Cn("type"),Rn("label"),An("items",JC),Wn("onSetup",(function(){return e})),Wn("onAction",e)].concat(ZC)),eS=function(t){return nn("cardmenuitem",tS,t)},nS=He([Cn("type"),jn("active",!1),Rn("icon")].concat(ZC)),rS=function(t){return nn("choicemenuitem",nS,t)},oS=["inserttable","colorswatch"],iS=He([Cn("type"),Sn("fancytype",oS),Wn("onAction",e)]),uS=function(t){return nn("fancymenuitem",iS,t)},aS=He([Cn("type"),Wn("onSetup",(function(){return e})),Wn("onAction",e),Rn("icon")].concat(ZC)),cS=function(t){return nn("menuitem",aS,t)},sS=He([Cn("type"),On("getSubmenuItems"),Wn("onSetup",(function(){return e})),Rn("icon")].concat(ZC)),lS=function(t){return nn("nestedmenuitem",sS,t)},fS=He([Cn("type"),Rn("icon"),jn("active",!1),Wn("onSetup",(function(){return e})),On("onAction")].concat(ZC)),dS=function(t){return nn("togglemenuitem",fS,t)},mS=function(t,e,n){var r=Pd(t.element,"."+n);if(r.length>0){var o=tt(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 x.some({numColumns:o,numRows:Math.ceil(r.length/o)})}return x.none()},gS=function(t,e){return Fl([Sy(t,e)])},hS=function(t){return gS(Eu("unnamed-events"),t)},pS={namedEvents:gS,unnamedEvents:hS},vS=[yn("lazySink"),yn("tooltipDom"),Hn("exclusive",!0),Hn("tooltipComponents",[]),Hn("delay",300),Un("mode","normal",["normal","follow-highlight"]),Hn("anchor",(function(t){return{anchor:"hotspot",hotspot:t,layouts:{onLtr:i([wl,yl,hl,vl,pl,bl]),onRtl:i([wl,yl,hl,vl,pl,bl])}}})),Hs("onHide"),Hs("onShow")],bS=function(){var t=Xn(x.none()),e=Xn(x.none()),n=function(){return e.get()},r=function(t){e.set(x.some(t))},o=function(){e.set(x.none())},u=function(){t.get().each((function(t){clearTimeout(t)}))},a=function(e,n){u(),t.set(x.some(setTimeout((function(){e()}),n)))},c=function(){return e.get().isSome()},s=i("not-implemented");return Ku({getTooltip:n,isShowing:c,setTooltip:r,clearTooltip:o,clearTimer:u,resetTimer:a,readState:s})},yS=Object.freeze({__proto__:null,init:bS}),wS=Eu("tooltip.exclusive"),xS=Eu("tooltip.show"),CS=Eu("tooltip.hide"),SS=function(t,e,n){t.getSystem().broadcastOn([wS],{})},kS=function(t,e,n,r){n.getTooltip().each((function(t){t.getSystem().isConnected()&&xy.set(t,r)}))},OS=Object.freeze({__proto__:null,hideAllExclusive:SS,setComponents:kS}),TS=function(t,e){var n=function(n){e.getTooltip().each((function(r){Vm(r),t.onHide(n,r),e.clearTooltip()})),e.clearTimer()},r=function(n){if(!e.isShowing()){SS(n);var r=t.lazySink(n).getOrDie(),o=n.getSystem().build({dom:t.tooltipDom,components:t.tooltipComponents,events:pi("normal"===t.mode?[wi(Eo(),(function(t){li(n,xS)})),wi(Oo(),(function(t){li(n,CS)}))]:[]),behaviours:Fl([xy.config({})])});e.setTooltip(o),Hm(r,o),t.onShow(n,o),Nm.position(r,t.anchor(n),o)}};return pi(et([[wi(xS,(function(n){e.resetTimer((function(){r(n)}),t.delay)})),wi(CS,(function(r){e.resetTimer((function(){n(r)}),t.delay)})),wi(Uo(),(function(t,e){var r=e;r.universal||V(r.channels,wS)&&n(t)})),Mi((function(t){n(t)}))],"normal"===t.mode?[wi(_o(),(function(t){li(t,xS)})),wi(Fo(),(function(t){li(t,CS)})),wi(Eo(),(function(t){li(t,xS)})),wi(Oo(),(function(t){li(t,CS)}))]:[wi(ci(),(function(t,e){li(t,xS)})),wi(si(),(function(t){li(t,CS)}))]]))},ES=Object.freeze({__proto__:null,events:TS}),_S=Ul({fields:vS,name:"tooltipping",active:ES,state:yS,apis:OS}),AS=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),DS=tinymce.util.Tools.resolve("tinymce.util.I18n"),MS=["input","button","textarea","select"],NS=function(t,e,n){var r=e.disabled()?FS:VS;r(t,e)},RS=function(t,e){return!0===e.useNative&&V(MS,zi(t.element))},zS=function(t){return vu(t.element,"disabled")},BS=function(t){mu(t.element,"disabled","disabled")},PS=function(t){bu(t.element,"disabled")},IS=function(t){return"true"===hu(t.element,"aria-disabled")},HS=function(t){mu(t.element,"aria-disabled","true")},LS=function(t){mu(t.element,"aria-disabled","false")},FS=function(t,e,n){e.disableClass.each((function(e){Ea(t.element,e)}));var r=RS(t,e)?BS:HS;r(t),e.onDisabled(t)},VS=function(t,e,n){e.disableClass.each((function(e){Aa(t.element,e)}));var r=RS(t,e)?PS:LS;r(t),e.onEnabled(t)},US=function(t,e){return RS(t,e)?zS(t):IS(t)},jS=function(t,e,n,r){var o=r?FS:VS;o(t,e)},WS=Object.freeze({__proto__:null,enable:VS,disable:FS,isDisabled:US,onLoad:NS,set:jS}),qS=function(t,e){return Zu({classes:e.disabled()?e.disableClass.toArray():[]})},$S=function(t,e){return pi([vi(jo(),(function(e,n){return US(e,t)})),zl(t,e,NS)])},GS=Object.freeze({__proto__:null,exhibit:qS,events:$S}),KS=[Wn("disabled",l),Hn("useNative",!0),Dn("disableClass"),Hs("onDisabled"),Hs("onEnabled")],XS=Ul({fields:KS,name:"disabling",active:GS,apis:WS}),YS=tinymce.util.Tools.resolve("tinymce.EditorManager"),JS=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):YS.baseURL+"/skins/ui/"+r}return n},QS=function(t){return t.getParam("readonly",!1,"boolean")},ZS=function(t){return!1===t.getParam("skin")},tk=function(t){return t.getParam("height",Math.max(t.getElement().offsetHeight,200))},ek=function(t){return t.getParam("width",AS.DOM.getStyle(t.getElement(),"width"))},nk=function(t){return x.from(t.getParam("min_width")).filter(z)},rk=function(t){return x.from(t.getParam("min_height")).filter(z)},ok=function(t){return x.from(t.getParam("max_width")).filter(z)},ik=function(t){return x.from(t.getParam("max_height")).filter(z)},uk=function(t){return x.from(t.getParam("style_formats")).filter(_)},ak=function(t){return t.getParam("style_formats_merge",!1,"boolean")},ck=function(t){return t.getParam("lineheight_formats","1 1.1 1.2 1.3 1.4 1.5 2","string").split(" ")},sk=function(t){return t.getParam("removed_menuitems","")},lk=function(t){return!1!==t.getParam("menubar",!0,"boolean")},fk=function(t){var e=t.getParam("toolbar",!0),n=!0===e,r=T(e),o=_(e)&&e.length>0;return!mk(t)&&(o||r||n)},dk=function(t){var e=j(9,(function(e){return t.getParam("toolbar"+(e+1),!1,"string")})),n=X(e,(function(t){return"string"===typeof t}));return n.length>0?x.some(n):x.none()},mk=function(t){return dk(t).fold((function(){var e=t.getParam("toolbar",[],"string[]");return e.length>0}),(function(){return!0}))};(function(t){t["default"]="wrap",t["floating"]="floating",t["sliding"]="sliding",t["scrolling"]="scrolling"})(aC||(aC={}));var gk,hk=function(t){return t.getParam("toolbar_mode","","string")};(function(t){t["auto"]="auto",t["top"]="top",t["bottom"]="bottom"})(gk||(gk={}));var pk,vk=function(t){return t.getParam("toolbar_groups",{},"object")},bk=function(t){return t.getParam("toolbar_location",gk.auto,"string")},yk=function(t){return bk(t)===gk.bottom},wk=function(t){return t.getParam("fixed_toolbar_container","","string")},xk=function(t){return t.getParam("toolbar_persist",!1,"boolean")},Ck=function(t){var e=wk(t);return e.length>0&&t.inline?gs(qa(),e):x.none()},Sk=function(t){return t.inline&&Ck(t).isSome()},kk=function(t){var e=Ck(t);return e.getOrThunk((function(){return Ha(Ia(er.fromDom(t.getElement())))}))},Ok=function(t){return t.inline&&!lk(t)&&!fk(t)&&!mk(t)},Tk=function(t){var e=t.getParam("toolbar_sticky",!1,"boolean");return(e||t.inline)&&!Sk(t)&&!Ok(t)},Ek=function(t){return t.getParam("draggable_modal",!1,"boolean")},_k=function(t){var e=t.getParam("menu");return e?Mt(e,(function(t){return m(m({},t),{items:t.items})})):{}},Ak=function(t){return t.getParam("menubar")},Dk=function(t){return t.getParam("toolbar",!0)},Mk=function(t){return t.getParam("file_picker_callback")},Nk=function(t){return t.getParam("file_picker_types")},Rk=function(t){return t.getParam("file_browser_callback_types")},zk=function(t){return!1===t.getParam("typeahead_urls")},Bk=function(t){return t.getParam("anchor_top","#top")},Pk=function(t){return t.getParam("anchor_bottom","#bottom")},Ik=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},Hk="silver.readonly",Lk=He([kn("readonly")]),Fk=function(t,e){var n=t.outerContainer,r=n.element;e&&(t.mothership.broadcastOn([mg()],{target:r}),t.uiMothership.broadcastOn([mg()],{target:r})),t.mothership.broadcastOn([Hk],{readonly:e}),t.uiMothership.broadcastOn([Hk],{readonly:e})},Vk=function(t,e){t.on("init",(function(){t.mode.isReadOnly()&&Fk(e,!0)})),t.on("SwitchMode",(function(){return Fk(e,t.mode.isReadOnly())})),QS(t)&&t.setMode("readonly")},Uk=function(){var t;return $l.config({channels:(t={},t[Hk]={schema:Lk,onReceive:function(t,e){XS.set(t,e.readonly)}},t)})},jk=function(t){return XS.config({disabled:t,disableClass:"tox-collection__item--state-disabled"})},Wk=function(t){return XS.config({disabled:t})},qk=function(t){return XS.config({disabled:t,disableClass:"tox-tbtn--disabled"})},$k=function(t){return XS.config({disabled:t,disableClass:"tox-tbtn--disabled",useNative:!1})},Gk={item:jk,button:Wk,splitButton:qk,toolbarButton:$k},Kk=function(t,e){var n=t.getApi(e);return function(t){t(n)}},Xk=function(t,e){return Di((function(n){var r=Kk(t,n);r((function(n){var r=t.onSetup(n);null!==r&&void 0!==r&&e.set(r)}))}))},Yk=function(t,e){return Mi((function(n){return Kk(t,n)(e.get())}))},Jk=function(t,e){return Ri((function(n,r){Kk(t,n)(t.onAction),t.triggersSubmenu||e!==cC.CLOSE_ON_EXECUTE||(li(n,Go()),r.stop())}))},Qk=(pk={},pk[jo()]=["disabling","alloy.base.behaviour","toggling","item-events"],pk),Zk=function(t){return nt(t,(function(t){return t.toArray()}))},tO=function(t,n,r,o){var i=Xn(e);return{type:"item",dom:n.dom,components:Zk(n.optComponents),data:t.data,eventOrder:Qk,hasSubmenu:t.triggersSubmenu,itemBehaviours:Fl([Sy("item-events",[Jk(t,r),Xk(t,i),Yk(t,i)]),Gk.item((function(){return t.disabled||o.isDisabled()})),Uk(),xy.config({})].concat(t.itemBehaviours))}},eO=function(t){return{value:t.value,meta:m({text:t.text.getOr("")},t.meta)}},nO=tinymce.util.Tools.resolve("tinymce.Env"),rO=function(t){var e={alt:"⌥",ctrl:"⌃",shift:"⇧",meta:"⌘",access:"⌃⌥"},n={meta:"Ctrl",access:"Shift+Alt"},r=nO.mac?e:n,o=t.split("+"),i=q(o,(function(t){var e=t.toLowerCase().trim();return Ft(r,e)?r[e]:t}));return nO.mac?i.join(""):i.join("+")},oO=function(t){return{dom:{tag:"div",classes:[hC],innerHtml:t}}},iO=function(t){return{dom:{tag:"div",classes:[pC]},components:[pc(DS.translate(t))]}},uO=function(t,e){return{dom:{tag:"div",classes:e,innerHtml:t}}},aO=function(t,e){return{dom:{tag:"div",classes:[pC]},components:[{dom:{tag:t.tag,styles:t.styles},components:[pc(DS.translate(e))]}]}},cO=function(t){return{dom:{tag:"div",classes:[vC],innerHtml:rO(t)}}},sO=function(t){return{dom:{tag:"div",classes:[yC],innerHtml:tx("checkmark",t)}}},lO=function(t){return{dom:{tag:"div",classes:[bC],innerHtml:tx("chevron-right",t)}}},fO=function(t){return{dom:{tag:"div",classes:[bC],innerHtml:tx("chevron-down",t)}}},dO=function(t,e){var n="vertical"===t.direction?SC:kC,r="left"===t.align?TC:OC,o=function(){switch(t.valign){case"top":return EC;case"middle":return _C;case"bottom":return AC}};return{dom:{tag:"div",classes:[CC,n,r,o()]},components:e}},mO=function(t,e,n){return{dom:{tag:"img",classes:e,attributes:{src:t,alt:n.getOr("")}}}},gO=function(t,e,n,r){var o="custom",i="remove",u=function(){var u=fC,a=n.getOr(""),c=t.map((function(t){return{title:r.translate(t)}})).getOr({}),s={tag:"div",attributes:c,classes:[u]};return m(m({},s),e===o?{tag:"button",classes:h(s.classes,["tox-swatches__picker-btn"]),innerHtml:a}:e===i?{classes:h(s.classes,["tox-swatch--remove"]),innerHtml:a}:{attributes:m(m({},s.attributes),{"data-mce-color":e}),styles:{"background-color":e}})};return{dom:u(),optComponents:[]}},hO=function(t,e){var n=e.map((function(t){return{attributes:{title:DS.translate(t)}}})).getOr({});return m({tag:"div",classes:[sC,lC].concat(t?[xC]:[])},n)},pO=function(t,e,n,r,o){var i=n?e.or(x.some("")).map(oO):x.none(),u=t.checkMark,a=t.htmlContent.fold((function(){return t.textContent.map(r)}),(function(t){return x.some(uO(t,[pC]))})),c={dom:hO(o,t.ariaLabel),optComponents:[i,a,t.shortcutContent.map(cO),u,t.caret]};return c},vO=["list-num-default","list-num-lower-alpha","list-num-lower-greek","list-num-lower-roman","list-num-upper-alpha","list-num-upper-roman"],bO=["list-bull-circle","list-bull-default","list-bull-square"],yO=function(t,e,n,r){void 0===r&&(r=x.none());var o=function(t){return t.map((function(t){return DS.isRtl()&&V(vO,t)?t+"-rtl":t}))},i=DS.isRtl()&&t.iconContent.exists((function(t){return V(bO,t)})),u=o(t.iconContent).map((function(t){return ex(t,e.icons,r)})),c=x.from(t.meta).fold((function(){return iO}),(function(t){return Ft(t,"style")?a(aO,t.style):iO}));return"color"===t.presets?gO(t.ariaLabel,t.value,u,e):pO(t,u,n,c,i)},wO=function(t,e){return Lt(t,"tooltipWorker").map((function(t){return[_S.config({lazySink:e.getSink,tooltipDom:{tag:"div",classes:["tox-tooltip-worker-container"]},tooltipComponents:[],anchor:function(t){return{anchor:"submenu",item:t,overrides:{maxHeightFunction:Df}}},mode:"follow-highlight",onShow:function(e,n){t((function(t){_S.setComponents(e,[vc({element:er.fromDom(t)})])}))}})]})).getOr([])},xO=function(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")},CO=function(t){return AS.DOM.encode(t)},SO=function(t,e){var n=DS.translate(t),r=CO(n);if(e.length>0){var o=new RegExp(xO(e),"gi");return r.replace(o,(function(t){return''+t+""}))}return r},kO=function(t,e,n,r,o,i,u,a){void 0===a&&(a=!0);var c=yO({presets:r,textContent:x.none(),htmlContent:n?t.text.map((function(t){return SO(t,e)})):x.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:x.none(),checkMark:x.none(),caret:x.none(),value:t.value},u.providers,a,t.icon);return tO({data:eO(t),disabled:t.disabled,getApi:function(){return{}},onAction:function(e){return o(t.value,t.meta)},onSetup:function(){return function(){}},triggersSubmenu:!1,itemBehaviours:wO(t.meta,u)},c,i,u.providers)},OO=function(t,e,n,r,o,i,u,a){void 0===a&&(a=!0);var c=function(t){return{setActive:function(e){Jy.set(t,e)},isActive:function(){return Jy.isOn(t)},isDisabled:function(){return XS.isDisabled(t)},setDisabled:function(e){return XS.set(t,e)}}},s=yO({presets:n,textContent:e?t.text:x.none(),htmlContent:x.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:e?t.shortcut:x.none(),checkMark:e?x.some(sO(u.icons)):x.none(),caret:x.none(),value:t.value},u,a);return Kt(tO({data:eO(t),disabled:t.disabled,getApi:c,onAction:function(e){return r(t.value)},onSetup:function(t){return t.setActive(o),function(){}},triggersSubmenu:!1,itemBehaviours:[]},s,i,u),{toggling:{toggleClass:mC,toggleOnExecute:!1,selected:t.active}})},TO=Bh(lw(),fw()),EO=function(t){return{value:t}},_O=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,AO=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,DO=function(t){return _O.test(t)||AO.test(t)},MO=function(t){var e=t.value.replace(_O,(function(t,e,n,r){return e+e+n+n+r+r}));return{value:e}},NO=function(t){var e=MO(t),n=AO.exec(e.value);return null===n?["FFFFFF","FF","FF","FF"]:n},RO=function(t){var e=t.toString(16);return 1===e.length?"0"+e:e},zO=function(t){var e=RO(t.red)+RO(t.green)+RO(t.blue);return EO(e)},BO=Math.min,PO=Math.max,IO=Math.round,HO=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,LO=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,FO=function(t,e,n,r){return{red:t,green:e,blue:n,alpha:r}},VO=function(t){var e=parseInt(t,10);return e.toString()===t&&e>=0&&e<=255},UO=function(t){var e,n,r,o=(t.hue||0)%360,i=t.saturation/100,u=t.value/100;if(i=PO(0,BO(i,1)),u=PO(0,BO(u,1)),0===i)return e=n=r=IO(255*u),FO(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=IO(255*(e+l)),n=IO(255*(n+l)),r=IO(255*(r+l)),FO(e,n,r,1)},jO=function(t){var e=NO(t),n=parseInt(e[1],16),r=parseInt(e[2],16),o=parseInt(e[3],16);return FO(n,r,o,1)},WO=function(t,e,n,r){var o=parseInt(t,10),i=parseInt(e,10),u=parseInt(n,10),a=parseFloat(r);return FO(o,i,u,a)},qO=function(t){if("transparent"===t)return x.some(FO(0,0,0,0));var e=HO.exec(t);if(null!==e)return x.some(WO(e[1],e[2],e[3],"1"));var n=LO.exec(t);return null!==n?x.some(WO(n[1],n[2],n[3],n[4])):x.none()},$O=function(t){return"rgba("+t.red+","+t.green+","+t.blue+","+t.alpha+")"},GO=FO(255,0,0,1),KO=function(t){return t.fire("SkinLoaded")},XO=function(t,e){return t.fire("SkinLoadError",e)},YO=function(t){return t.fire("ResizeEditor")},JO=function(t,e){return t.fire("ResizeContent",e)},QO=function(t,e){return t.fire("ScrollContent",e)},ZO=function(t,e){return t.fire("TextColorChange",e)},tT=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),eT="tinymce-custom-colors";function nT(t){void 0===t&&(t=10);var e=tT.getItem(eT),n=T(e)?JSON.parse(e):[],r=function(e){var n=t-e.length;return n<0?e.slice(0,t):e},o=r(n),i=function(e){F(o,e).each(u),o.unshift(e),o.length>t&&o.pop(),tT.setItem(eT,JSON.stringify(o))},u=function(t){o.splice(t,1)},a=function(){return o.slice(0)};return{add:i,state:a}}var rT="choiceitem",oT=[{type:rT,text:"Light Green",value:"#BFEDD2"},{type:rT,text:"Light Yellow",value:"#FBEEB8"},{type:rT,text:"Light Red",value:"#F8CAC6"},{type:rT,text:"Light Purple",value:"#ECCAFA"},{type:rT,text:"Light Blue",value:"#C2E0F4"},{type:rT,text:"Green",value:"#2DC26B"},{type:rT,text:"Yellow",value:"#F1C40F"},{type:rT,text:"Red",value:"#E03E2D"},{type:rT,text:"Purple",value:"#B96AD9"},{type:rT,text:"Blue",value:"#3598DB"},{type:rT,text:"Dark Turquoise",value:"#169179"},{type:rT,text:"Orange",value:"#E67E23"},{type:rT,text:"Dark Red",value:"#BA372A"},{type:rT,text:"Dark Purple",value:"#843FA1"},{type:rT,text:"Dark Blue",value:"#236FA1"},{type:rT,text:"Light Gray",value:"#ECF0F1"},{type:rT,text:"Medium Gray",value:"#CED4D9"},{type:rT,text:"Gray",value:"#95A5A6"},{type:rT,text:"Dark Gray",value:"#7E8C8D"},{type:rT,text:"Navy Blue",value:"#34495E"},{type:rT,text:"Black",value:"#000000"},{type:rT,text:"White",value:"#ffffff"}],iT=nT(10),uT=function(t){var e=[],n=document.createElement("canvas");n.height=1,n.width=1;for(var r=n.getContext("2d"),o=function(t,e){var n=255,r=e/255,o=Math.round(t*r+n*(1-r));return("0"+o.toString(16)).slice(-2).toUpperCase()},i=function(t){if(/^[0-9A-Fa-f]{6}$/.test(t))return"#"+t.toUpperCase();r.clearRect(0,0,n.width,n.height),r.fillStyle="#FFFFFF",r.fillStyle=t,r.fillRect(0,0,1,1);var e=r.getImageData(0,0,1,1).data,i=e[0],u=e[1],a=e[2],c=e[3];return"#"+o(i,c)+o(u,c)+o(a,c)},u=0;u0?d(n,r,e,o):r.text.length-n.matchLength>=10?c():a()}}))}))}))},h=sx((function(t){27!==t.which&&g()}),50),p={onKeypress:h,cancelIfNecessary:c,isMenuOpen:i,isActive:u,isProcessingAction:r.get,getView:function(){return Iw.getContent(o)}};!1===t.hasPlugin("rtc")&&kx.setup(p,t)},lE={register:sE},fE=f,dE=function(t,e,n){return Vc(t,e,fE,n)},mE=function(t,e,n){return Uc(t,e,fE,n)},gE=Hc,hE=function(t,e,n){return hs(t,e,n).isSome()};function pE(t,e){var n=null,r=function(){for(var r=[],o=0;ovE||r>vE},xE=function(t){var e=Xn(x.none()),n=Xn(!1),r=pE((function(e){t.triggerEvent($o(),e),n.set(!0)}),bE),o=function(t){return yE(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(x.some(i))})),x.none()},i=function(t){return r.cancel(),yE(t).each((function(t){e.get().each((function(n){wE(t,n)&&e.set(x.none())}))})),x.none()},u=function(o){r.cancel();var i=function(t){return oo(t.target,o.target)};return e.get().filter(i).map((function(e){return n.get()?(o.prevent(),!1):t.triggerEvent(qo(),o)}))},a=le([{key:yo(),value:o},{key:wo(),value:i},{key:xo(),value:u}]),c=function(t,e){return Lt(a,e).bind((function(e){return e(t)}))};return{fireIfReady:c}},CE=function(t){var e=t.raw;return e.which===Fp[0]&&!V(["input","textarea"],zi(t.target))&&!hE(t.target,'[contenteditable="true"]')},SE=function(){return Gr().browser.isFirefox()},kE=Ie([On("triggerEvent"),Hn("stopBackspace",!0)]),OE=function(t,e){return SE()?mE(t,"focus",e):dE(t,"focusin",e)},TE=function(t,e){return SE()?mE(t,"blur",e):dE(t,"focusout",e)},EE=function(t,e){var n=on("Getting GUI events settings",kE,e),r=["touchstart","touchmove","touchend","touchcancel","gesturestart","mousedown","mouseup","mouseover","mousemove","mouseout","click"],o=xE(n),i=q(r.concat(["selectstart","input","contextmenu","change","transitionend","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),(function(e){return dE(t,e,(function(t){o.fireIfReady(t,e).each((function(e){e&&t.kill()}));var r=n.triggerEvent(e,t);r&&t.kill()}))})),u=Xn(x.none()),a=dE(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(x.some(setTimeout((function(){n.triggerEvent(Vo(),t)}),0)))})),c=dE(t,"keydown",(function(t){var e=n.triggerEvent("keydown",t);e?t.kill():!0===n.stopBackspace&&CE(t)&&t.prevent()})),s=OE(t,(function(t){var e=n.triggerEvent("focusin",t);e&&t.kill()})),l=Xn(x.none()),f=TE(t,(function(t){var e=n.triggerEvent("focusout",t);e&&t.kill(),l.set(x.some(setTimeout((function(){n.triggerEvent(Fo(),t)}),0)))})),d=function(){$(i,(function(t){t.unbind()})),c.unbind(),s.unbind(),f.unbind(),a.unbind(),u.get().each(clearTimeout),l.get().each(clearTimeout)};return{unbind:d}},_E=function(t,e){var n=Lt(t,"target").getOr(e);return Xn(n)},AE=function(t,e){var n=Xn(!1),r=Xn(!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}},DE=function(t){var n=Xn(!1),r=function(){n.set(!0)};return{stop:r,cut:e,isStopped:n.get,isCut:l,event:t,setSource:s("Cannot set source of a broadcasted event"),getSource:s("Cannot get source of a broadcasted event")}},ME=jt.generate([{stopped:[]},{resume:["element"]},{complete:[]}]),NE=function(t,e,n,r,o,i){var u=t(e,r),a=AE(n,o);return u.fold((function(){return i.logEventNoHandlers(e,r),ME.complete()}),(function(t){var n=t.descHandler,r=ua(n);return r(a),a.isStopped()?(i.logEventStopped(e,t.element,n.purpose),ME.stopped()):a.isCut()?(i.logEventCut(e,t.element,n.purpose),ME.complete()):qi(t.element).fold((function(){return i.logNoParent(e,t.element,n.purpose),ME.complete()}),(function(r){return i.logEventResponse(e,t.element,n.purpose),ME.resume(r)}))}))},RE=function(t,e,n,r,o,i){return NE(t,e,n,r,o,i).fold((function(){return!0}),(function(r){return RE(t,e,n,r,o,i)}),(function(){return!1}))},zE=function(t,e,n,r,o){var i=_E(n,r);return NE(t,e,n,r,i,o)},BE=function(t,e,n){var r=DE(e);return $(t,(function(t){var e=t.descHandler,n=ua(e);n(r)})),r.isStopped()},PE=function(t,e,n,r){return IE(t,e,n,n.target,r)},IE=function(t,e,n,r,o){var i=_E(n,r);return RE(t,e,n,r,i,o)},HE=function(t,e){return{element:t,descHandler:e}},LE=function(t,e){return{id:t,descHandler:e}};function FE(){var t={},e=function(e,n,r){Dt(r,(function(r,o){var i=void 0!==t[o]?t[o]:{};i[n]=ia(r,e),t[o]=i}))},n=function(t,e){return zu(e).fold((function(){return x.none()}),(function(n){return t.bind((function(t){return Lt(t,n)})).map((function(t){return HE(e,t)}))}))},r=function(e){return Lt(t,e).map((function(t){return Pt(t,(function(t,e){return LE(e,t)}))})).getOr([])},o=function(e,r,o){var i=Lt(t,r);return lo(o,(function(t){return n(i,t)}),e)},i=function(e){Dt(t,(function(t,n){t.hasOwnProperty(e)&&delete t[e]}))};return{registerId:e,unregisterId:i,filterByType:r,find:o}}function VE(){var t=FE(),e={},n=function(t){var e=t.element;return zu(e).fold((function(){return Nu("uid-",t.element)}),(function(t){return t}))},r=function(t,n){var r=e[n];if(r!==t)throw new Error('The tagId "'+n+'" is already used by: '+Cu(r.element)+"\nCannot use it for: "+Cu(t.element)+"\nThe conflicting element is"+(Wa(r.element)?" ":" not ")+"already in the DOM");i(t)},o=function(o){var i=n(o);Vt(e,i)&&r(o,i);var u=[o];t.registerId(u,i,o.events),e[i]=o},i=function(n){zu(n.element).each((function(n){delete e[n],t.unregisterId(n)}))},u=function(e){return t.filterByType(e)},a=function(e,n,r){return t.find(e,n,r)},c=function(t){return Lt(e,t)};return{find:a,filter:u,register:o,unregister:i,getById:c}}var UE=function(t){var e=t.dom,n=e.attributes,r=g(e,["attributes"]);return{uid:t.uid,dom:m({tag:"div",attributes:m({role:"presentation"},n)},r),components:t.components,behaviours:Yg(t.containerBehaviours),events:t.events,domModification:t.domModification,eventOrder:t.eventOrder}},jE=ap({name:"Container",factory:UE,configFields:[Hn("components",[]),Xg("containerBehaviours",[]),Hn("events",{}),Hn("domModification",{}),Hn("eventOrder",{})]}),WE=function(t){var n=function(e){return qi(t.element).fold((function(){return!0}),(function(t){return oo(e,t)}))},r=VE(),o=function(t,e){return r.find(n,t,e)},u=EE(t.element,{triggerEvent:function(t,e){return _s(t,e.target,(function(n){return PE(o,t,e,n)}))}}),a={debugInfo:i("real"),triggerEvent:function(t,e,n){_s(t,e,(function(r){return IE(o,t,n,e,r)}))},triggerFocus:function(t,n){zu(t).fold((function(){Yl(t)}),(function(r){_s(Lo(),t,(function(r){return zE(o,Lo(),{originator:n,kill:e,prevent:e,target:t},t,r),!1}))}))},triggerEscape:function(t,e){a.triggerEvent("keydown",t.element,e.event)},getByUid:function(t){return b(t)},getByDom:function(t){return y(t)},build:yc,addToGui:function(t){l(t)},removeFromGui:function(t){d(t)},addToWorld:function(t){c(t)},removeFromWorld:function(t){s(t)},broadcast:function(t){h(t)},broadcastOn:function(t,e){p(t,e)},broadcastEvent:function(t,e){v(t,e)},isConnected:f},c=function(t){t.connect(a),Hi(t.element)||(r.register(t),$(t.components(),c),a.triggerEvent(Xo(),t.element,{target:t.element}))},s=function(t){Hi(t.element)||($(t.components(),s),r.unregister(t)),t.disconnect()},l=function(e){Hm(t,e)},d=function(t){Vm(t)},m=function(){u.unbind(),uu(t.element)},g=function(t){var e=r.filter(Uo());$(e,(function(e){var n=e.descHandler,r=ua(n);r(t)}))},h=function(t){g({universal:!0,data:t})},p=function(t,e){g({universal:!1,channels:t,data:e})},v=function(t,e){var n=r.filter(t);return BE(n,e)},b=function(t){return r.getById(t).fold((function(){return pt.error(new Error('Could not find component with uid: "'+t+'" in system.'))}),pt.value)},y=function(t){var e=zu(t).getOr("not found");return b(e)};return c(t),{root:t,element:t.element,destroy:m,add:l,remove:d,getByUid:b,getByDom:y,addToWorld:c,removeFromWorld:s,broadcast:h,broadcastOn:p,broadcastEvent:v}},qE=function(t,e){return{dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:q(t.items,e.interpreter)}},$E=i([Hn("prefix","form-field"),Xg("fieldBehaviours",[yp,Kg])]),GE=i([Ah({schema:[yn("dom")],name:"label"}),Ah({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[yn("text")],name:"aria-descriptor"}),Eh({factory:{sketch:function(t){var e=ce(t,["factory"]);return t.factory.sketch(e)}},schema:[yn("factory")],name:"field"})]),KE=function(t,e,n,r){var o=Jg(t.fieldBehaviours,[yp.config({find:function(e){return Uh(e,t,"field")}}),Kg.config({store:{mode:"manual",getValue:function(t){return yp.getCurrent(t).bind(Kg.getValue)},setValue:function(t,e){yp.getCurrent(t).each((function(t){Kg.setValue(t,e)}))}}})]),i=pi([Di((function(e,n){var r=Wh(e,t,["label","field","aria-descriptor"]);r.field().each((function(e){var n=Eu(t.prefix);r.label().each((function(t){mu(t.element,"for",n),mu(e.element,"id",n)})),r["aria-descriptor"]().each((function(n){var r=Eu(t.prefix);mu(n.element,"id",r),mu(e.element,"aria-describedby",r)}))}))}))]),u={getField:function(e){return Uh(e,t,"field")},getLabel:function(e){return Uh(e,t,"label")}};return{uid:t.uid,dom:t.dom,components:e,behaviours:o,events:i,apis:u}},XE=cp({name:"FormField",configFields:$E(),partFields:GE(),factory:KE,apis:{getField:function(t,e){return t.getField(e)},getLabel:function(t,e){return t.getLabel(e)}}}),YE=function(t,e){return Zu({attributes:le([{key:e.tabAttr,value:"true"}])})},JE=Object.freeze({__proto__:null,exhibit:YE}),QE=[Hn("tabAttr","data-alloy-tabstop")],ZE=Ul({fields:QE,name:"tabstopping",active:JE}),t_=tinymce.util.Tools.resolve("tinymce.html.Entities"),e_=function(t,e,n,r){var o=r_(t,e,n,r);return XE.sketch(o)},n_=function(t,e){return e_(t,e,[],[])},r_=function(t,e,n,r){return{dom:i_(n),components:t.toArray().concat([e]),fieldBehaviours:Fl(r)}},o_=function(){return i_([])},i_=function(t){return{tag:"div",classes:["tox-form__group"].concat(t)}},u_=function(t,e){return XE.parts.label({dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}})},a_=Eu("form-component-change"),c_=Eu("form-close"),s_=Eu("form-cancel"),l_=Eu("form-action"),f_=Eu("form-submit"),d_=Eu("form-block"),m_=Eu("form-unblock"),g_=Eu("form-tabchange"),h_=Eu("form-resize"),p_=function(t,e){var n,r=t.label.map((function(t){return u_(t,e)})),o=function(t){return function(e,n){hs(n.event.target,"[data-collection-item-value]").each((function(r){t(e,n,r,hu(r,"data-collection-item-value"))}))}},i=function(n,r){var o=q(r,(function(n){var r=DS.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?W(o,t.columns):[o],u=q(i,(function(t){return'
'+t.join("")+"
"}));lu(n.element,u.join(""))},a=o((function(n,r,o,i){r.stop(),e.isDisabled()||fi(n,l_,{name:t.name,value:i})})),c=[wi(Eo(),o((function(t,e,n){Yl(n)}))),wi(zo(),a),wi(qo(),a),wi(_o(),o((function(t,e,n){gs(t.element,"."+wC).each((function(t){Aa(t,wC)})),Ea(n,wC)}))),wi(Ao(),o((function(t){gs(t.element,"."+wC).each((function(t){Aa(t,wC)}))}))),Ri(o((function(e,n,r,o){fi(e,l_,{name:t.name,value:o})})))],s=function(t,e){return q(Pd(t.element,".tox-collection__item"),e)},l=XE.parts.field({dom:{tag:"div",classes:["tox-collection"].concat(1!==t.columns?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:u},behaviours:Fl([XS.config({disabled:e.isDisabled,onDisabled:function(t){s(t,(function(t){Ea(t,"tox-collection__item--state-disabled"),mu(t,"aria-disabled",!0)}))},onEnabled:function(t){s(t,(function(t){Aa(t,"tox-collection__item--state-disabled"),bu(t,"aria-disabled")}))}}),Uk(),xy.config({}),Kg.config({store:{mode:"memory",initialValue:[]},onSetValue:function(e,n){i(e,n),"auto"===t.columns&&mS(e,5,"tox-collection__item").each((function(t){var n=t.numRows,r=t.numColumns;fy.setGridSize(e,n,r)})),li(e,h_)}}),ZE.config({}),fy.config(MT(t.columns,"normal")),Sy("collection-events",c)]),eventOrder:(n={},n[jo()]=["disabling","alloy.base.behaviour","collection-events"],n)}),f=["tox-form__group--collection"];return e_(r,l,f,[])},v_=i([Dn("data"),Hn("inputAttributes",{}),Hn("inputStyles",{}),Hn("tag","input"),Hn("inputClasses",[]),Hs("onSetValue"),Hn("styles",{}),Hn("eventOrder",{}),Xg("inputBehaviours",[Kg,Ny]),Hn("selectOnFocus",!0)]),b_=function(t){return Fl([Ny.config({onFocus:t.selectOnFocus?function(t){var e=t.element,n=ic(e);e.dom.setSelectionRange(0,n.length)}:e})])},y_=function(t){return m(m({},b_(t)),Jg(t.inputBehaviours,[Kg.config({store:m(m({mode:"manual"},t.data.map((function(t){return{initialValue:t}})).getOr({})),{getValue:function(t){return ic(t.element)},setValue:function(t,e){var n=ic(t.element);n!==e&&uc(t.element,e)}}),onSetValue:t.onSetValue})]))},w_=function(t){return{tag:t.tag,attributes:m({type:"text"},t.inputAttributes),styles:t.inputStyles,classes:t.inputClasses}},x_=function(t,e){return{uid:t.uid,dom:w_(t),components:[],behaviours:y_(t),eventOrder:t.eventOrder}},C_=ap({name:"Input",configFields:v_(),factory:x_}),S_={},k_={exports:S_};(function(e,n,r,o){(function(o){if("object"===typeof n&&"undefined"!==typeof r)r.exports=o();else if("function"===typeof e&&e.amd)e([],o);else{var i;i="undefined"!==typeof window?window:"undefined"!==typeof t?t:"undefined"!==typeof self?self:this,i.EphoxContactWrapper=o()}})((function(){return function(){function t(e,n,r){function i(a,c){if(!n[a]){if(!e[a]){var s="function"==typeof o&&o;if(!c&&s)return s(a,!0);if(u)return u(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var f=n[a]={exports:{}};e[a][0].call(f.exports,(function(t){var n=e[a][1][t];return i(n||t)}),f,f.exports,t,e,n,r)}return n[a].exports}for(var u="function"==typeof o&&o,a=0;a1)for(var n=1;n=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},n.setImmediate="function"===typeof e?e:function(t){var e=c++,r=!(arguments.length<2)&&u.call(arguments,1);return a[e]=!0,o((function(){a[e]&&(r?t.apply(null,r):t.call(null),n.clearImmediate(e))})),e},n.clearImmediate="function"===typeof r?r:function(t){delete a[t]}}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(t,e,n){var r=t("promise-polyfill"),o=function(){return"undefined"!==typeof window?window:Function("return this;")()}();e.exports={boltExport:o.Promise||r}},{"promise-polyfill":2}]},{},[4])(4)}))})(void 0,S_,k_,void 0);var O_,T_=k_.exports.boltExport,E_=function(t){var e=x.none(),n=[],r=function(t){return E_((function(e){o((function(n){e(t(n))}))}))},o=function(t){u()?c(t):n.push(t)},i=function(t){u()||(e=x.some(t),a(n),n=[])},u=function(){return e.isSome()},a=function(t){$(t,c)},c=function(t){e.each((function(e){setTimeout((function(){t(e)}),0)}))};return t(i),{get:o,map:r,isReady:u}},__=function(t){return E_((function(e){e(t)}))},A_={nu:E_,pure:__},D_=function(t){setTimeout((function(){throw t}),0)},M_=function(t){var e=function(e){t().then(e,D_)},n=function(e){return M_((function(){return t().then(e)}))},r=function(e){return M_((function(){return t().then((function(t){return e(t).toPromise()}))}))},o=function(e){return M_((function(){return t().then((function(){return e.toPromise()}))}))},i=function(){return A_.nu(e)},u=function(){var e=null;return M_((function(){return null===e&&(e=t()),e}))},a=t;return{map:n,bind:r,anonBind:o,toLazy:i,toCached:u,toPromise:a,get:e}},N_=function(t){return M_((function(){return new T_(t)}))},R_=function(t){return M_((function(){return T_.resolve(t)}))},z_={nu:N_,pure:R_},B_=["input","textarea"],P_=function(t){var e=zi(t);return V(B_,e)},I_=function(t,e){var n=e.getRoot(t).getOr(t.element);Aa(n,e.invalidClass),e.notify.each((function(e){P_(t.element)&&mu(t.element,"aria-invalid",!1),e.getContainer(t).each((function(t){lu(t,e.validHtml)})),e.onValid(t)}))},H_=function(t,e,n,r){var o=e.getRoot(t).getOr(t.element);Ea(o,e.invalidClass),e.notify.each((function(e){P_(t.element)&&mu(t.element,"aria-invalid",!0),e.getContainer(t).each((function(t){lu(t,r)})),e.onInvalid(t,r)}))},L_=function(t,e,n){return e.validator.fold((function(){return z_.pure(pt.value(!0))}),(function(e){return e.validate(t)}))},F_=function(t,e,n){return e.notify.each((function(e){e.onValidate(t)})),L_(t,e).map((function(r){return t.getSystem().isConnected()?r.fold((function(r){return H_(t,e,n,r),pt.error(r)}),(function(n){return I_(t,e),pt.value(n)})):pt.error("No longer in system")}))},V_=function(t,e){var n=e.getRoot(t).getOr(t.element);return Da(n,e.invalidClass)},U_=Object.freeze({__proto__:null,markValid:I_,markInvalid:H_,query:L_,run:F_,isInvalid:V_}),j_=function(t,n){return t.validator.map((function(r){return pi([wi(r.onEvent,(function(e){F_(e,t,n).get(u)}))].concat(r.validateOnLoad?[Di((function(r){F_(r,t,n).get(e)}))]:[]))})).getOr({})},W_=Object.freeze({__proto__:null,events:j_}),q_=[yn("invalidClass"),Hn("getRoot",x.none),Pn("notify",[Hn("aria","alert"),Hn("getContainer",x.none),Hn("validHtml",""),Hs("onValid"),Hs("onInvalid"),Hs("onValidate")]),Pn("validator",[yn("validate"),Hn("onEvent","input"),Hn("validateOnLoad",!0)])],$_=Ul({fields:q_,name:"invalidating",active:W_,apis:U_,extra:{validation:function(t){return function(e){var n=Kg.getValue(e);return z_.pure(t(n))}}}}),G_=function(t,e,n,r){return n.getOrCreate(t,e,r)},K_=Object.freeze({__proto__:null,getCoupled:G_}),X_=[wn("others",tn(pt.value,ln()))],Y_=function(){var t={},e=function(e,n,r){var o=_t(n.others);if(o)return Lt(t,r).getOrThunk((function(){var o=Lt(n.others,r).getOrDie("No information found for coupled component: "+r),i=o(e),u=e.getSystem().build(i);return t[r]=u,u}));throw new Error("Cannot find coupled component: "+r+". Known coupled components: "+JSON.stringify(o,null,2))},n=i({});return Ku({readState:n,getOrCreate:e})},J_=Object.freeze({__proto__:null,init:Y_}),Q_=Ul({fields:X_,name:"coupling",apis:K_,state:J_}),Z_=i("sink"),tA=i(Ah({name:Z_(),overrides:i({dom:{tag:"div"},behaviours:Fl([Nm.config({useFixed:f})]),events:pi([Ei(Do()),Ei(So()),Ei(zo())])})}));(function(t){t[t["HighlightFirst"]=0]="HighlightFirst",t[t["HighlightNone"]=1]="HighlightNone"})(O_||(O_={}));var eA=function(t,e){var n=t.getHotspot(e).getOr(e),r="hotspot",o=t.getAnchorOverrides();return t.layouts.fold((function(){return{anchor:r,hotspot:n,overrides:o}}),(function(t){return{anchor:r,hotspot:n,overrides:o,layouts:t}}))},nA=function(t,e,n){var r=t.fetch;return r(n).map(e)},rA=function(t,e,n,r,o,i,u){var a=nA(t,e,r),c=cA(r,t);return a.map((function(t){return t.bind((function(t){return x.from(zw.sketch(m(m({},i.menu()),{uid:Bu(""),data:t,highlightImmediately:u===O_.HighlightFirst,onOpenMenu:function(t,e){var r=c().getOrDie();Nm.position(r,n,e),dg.decloak(o)},onOpenSubmenu:function(t,e,n){var r=c().getOrDie();Nm.position(r,{anchor:"submenu",item:e},n),dg.decloak(o)},onRepositionMenu:function(t,e,r){var o=c().getOrDie();Nm.position(o,n,e),$(r,(function(t){Nm.position(o,{anchor:"submenu",item:t.triggeringItem},t.triggeredMenu)}))},onEscape:function(){return Ny.focus(r),dg.close(o),x.some(!0)}})))}))}))},oA=function(t,e,n,r,o,i,u){var a=eA(t,n),c=rA(t,e,a,n,r,o,u);return c.map((function(t){return t.fold((function(){dg.isOpen(r)&&dg.close(r)}),(function(t){dg.cloak(r),dg.open(r,t),i(r)})),r}))},iA=function(t,e,n,r,o,i,u){return dg.close(r),z_.pure(r)},uA=function(t,e,n,r,o,i){var u=Q_.getCoupled(n,"sandbox"),a=dg.isOpen(u),c=a?iA:oA;return c(t,e,n,u,r,o,i)},aA=function(t,e,n){var r=yp.getCurrent(e).getOr(e),o=zc(t.element);n?Xa(r.element,"min-width",o+"px"):Rc(r.element,o)},cA=function(t,e){return t.getSystem().getByUid(e.uid+"-"+Z_()).map((function(t){return function(){return pt.value(t)}})).getOrThunk((function(){return e.lazySink.fold((function(){return function(){return pt.error(new Error("No internal sink is specified, nor could an external sink be found"))}}),(function(e){return function(){return e(t)}}))}))},sA=function(t){dg.getState(t).each((function(t){zw.repositionMenus(t)}))},lA=function(t,e,n){var r=vs(),o=function(o,i){var u=eA(t,e);r.link(e.element),t.matchWidth&&aA(u.hotspot,i,t.useMinWidth),t.onOpen(u,o,i),void 0!==n&&void 0!==n.onOpen&&n.onOpen(o,i)},i=function(t,o){r.unlink(e.element),void 0!==n&&void 0!==n.onClose&&n.onClose(t,o)},u=cA(e,t);return{dom:{tag:"div",classes:t.sandboxClasses,attributes:{id:r.id,role:"listbox"}},behaviours:Qg.augment(t.sandboxBehaviours,[Kg.config({store:{mode:"memory",initialValue:e}}),dg.config({onOpen:o,onClose:i,isPartOf:function(t,n,r){return ys(n,r)||ys(e,r)},getAttachPoint:function(){return u().getOrDie()}}),yp.config({find:function(t){return dg.getState(t).bind((function(t){return yp.getCurrent(t)}))}}),$l.config({channels:m(m({},vg({isExtraPart:l})),yg({doReposition:sA}))})])}},fA=function(t){var e=Q_.getCoupled(t,"sandbox");sA(e)},dA=function(){return[Hn("sandboxClasses",[]),Qg.field("sandboxBehaviours",[yp,$l,dg,Kg])]},mA=i([yn("dom"),yn("fetch"),Hs("onOpen"),Ls("onExecute"),Hn("getHotspot",x.some),Hn("getAnchorOverrides",i({})),Uf(),Xg("dropdownBehaviours",[Jy,Q_,fy,Ny]),yn("toggleClass"),Hn("eventOrder",{}),Dn("lazySink"),Hn("matchWidth",!1),Hn("useMinWidth",!1),Dn("role")].concat(dA())),gA=i([_h({schema:[Bs()],name:"menu",defaults:function(t){return{onExecute:t.onExecute}}}),tA()]),hA=function(t,n,r,o){var i,u=function(e){return Lt(t.dom,"attributes").bind((function(t){return Lt(t,e)}))},a=function(t){dg.getState(t).each((function(t){zw.highlightPrimary(t)}))},c=function(n){var r=a;uA(t,(function(t){return t}),n,o,r,O_.HighlightFirst).get(e)},s={expand:function(n){Jy.isOn(n)||uA(t,(function(t){return t}),n,o,e,O_.HighlightNone).get(e)},open:function(n){Jy.isOn(n)||uA(t,(function(t){return t}),n,o,e,O_.HighlightFirst).get(e)},isOpen:Jy.isOn,close:function(n){Jy.isOn(n)&&uA(t,(function(t){return t}),n,o,e,O_.HighlightFirst).get(e)},repositionMenus:function(t){Jy.isOn(t)&&fA(t)}},l=function(t,e){return di(t),x.some(!0)};return{uid:t.uid,dom:t.dom,components:n,behaviours:Jg(t.dropdownBehaviours,[Jy.config({toggleClass:t.toggleClass,aria:{mode:"expanded"}}),Q_.config({others:{sandbox:function(e){return lA(t,e,{onOpen:function(){Jy.on(e)},onClose:function(){Jy.off(e)}})}}}),fy.config({mode:"special",onSpace:l,onEnter:l,onDown:function(t,e){if(pA.isOpen(t)){var n=Q_.getCoupled(t,"sandbox");a(n)}else pA.open(t);return x.some(!0)},onEscape:function(t,e){return pA.isOpen(t)?(pA.close(t),x.some(!0)):x.none()}}),Ny.config({})]),events:Zy(x.some(c)),eventOrder:m(m({},t.eventOrder),(i={},i[jo()]=["disabling","toggling","alloy.base.behaviour"],i)),apis:s,domModification:{attributes:m(m({"aria-haspopup":"true"},t.role.fold((function(){return{}}),(function(t){return{role:t}}))),"button"===t.dom.tag?{type:u("type").getOr("button")}:{})}}},pA=cp({name:"Dropdown",configFields:mA(),partFields:gA(),factory:hA,apis:{open:function(t,e){return t.open(e)},expand:function(t,e){return t.expand(e)},close:function(t,e){return t.close(e)},isOpen:function(t,e){return t.isOpen(e)},repositionMenus:function(t,e){return t.repositionMenus(e)}}}),vA=function(){return Zu({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})},bA=function(){return pi([vi(Po(),f)])},yA=Object.freeze({__proto__:null,events:bA,exhibit:vA}),wA=Ul({fields:[],name:"unselecting",active:yA}),xA=function(t,e){return pA.sketch({dom:t.dom,components:t.components,toggleClass:"mce-active",dropdownBehaviours:Fl([Gk.button(e.providers.isDisabled),Uk(),wA.config({}),ZE.config({})]),layouts:t.layouts,sandboxClasses:["tox-dialog__popups"],lazySink:e.getSink,fetch:function(n){return z_.nu((function(e){return t.fetch(e)})).map((function(r){return x.from(aE(Kt(_T(Eu("menu-value"),r,(function(e){t.onItemAction(n,e)}),t.columns,t.presets,cC.CLOSE_ON_EXECUTE,(function(){return!1}),e.providers),{movement:DT(t.columns,t.presets)})))}))},parts:{menu:PC(!1,1,t.presets)}})},CA=Eu("color-input-change"),SA=Eu("color-swatch-change"),kA=Eu("color-picker-cancel"),OA=function(t,e,n){var r=XE.parts.field({factory:C_,inputClasses:["tox-textfield"],onSetValue:function(t){return $_.run(t).get((function(){}))},inputBehaviours:Fl([XS.config({disabled:e.providers.isDisabled}),Uk(),ZE.config({}),$_.config({invalidClass:"tox-textbox-field-invalid",getRoot:function(t){return qi(t.element)},notify:{onValid:function(t){var e=Kg.getValue(t);fi(t,CA,{color:e})}},validator:{validateOnLoad:!1,validate:function(t){var e=Kg.getValue(t);if(0===e.length)return z_.pure(pt.value(!0));var n=er.fromTag("span");Xa(n,"background-color",e);var r=tc(n,"background-color").fold((function(){return pt.error("blah")}),(function(t){return pt.value(e)}));return z_.pure(r)}}})]),selectOnFocus:!1}),o=t.label.map((function(t){return u_(t,e.providers)})),i=function(t,e){fi(t,SA,{value:e})},u=function(t,e){a.getOpt(t).each((function(t){"custom"===e?n.colorPicker((function(e){e.fold((function(){return li(t,kA)}),(function(e){i(t,e),dT(e)}))}),"#ffffff"):i(t,"remove"===e?"":e)}))},a=Qw(xA({dom:{tag:"span",attributes:{"aria-label":e.providers.translate("Color swatch")}},layouts:{onRtl:function(){return[pl,hl,wl]},onLtr:function(){return[hl,pl,wl]}},components:[],fetch:CT(n.getColors(),n.hasCustomColors()),columns:n.getColorCols(),presets:"color",onItemAction:u},e));return XE.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:o.toArray().concat([{dom:{tag:"div",classes:["tox-color-input"]},components:[r,a.asSpec()]}]),fieldBehaviours:Fl([Sy("form-field-events",[wi(CA,(function(e,n){a.getOpt(e).each((function(t){Xa(t.element,"background-color",n.event.color)})),fi(e,a_,{name:t.name})})),wi(SA,(function(t,e){XE.getField(t).each((function(n){Kg.setValue(n,e.event.value),yp.getCurrent(t).each(Ny.focus)}))})),wi(kA,(function(t,e){XE.getField(t).each((function(e){yp.getCurrent(t).each(Ny.focus)}))}))])])})},TA=function(t,e,n){return{hue:t,saturation:e,value:n}},EA=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,TA(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,TA(Math.round(e),Math.round(100*n),Math.round(100*r))},_A=function(t){var e=(100-t)/100*360,n=TA(e,100,100),r=UO(n);return zO(r)},AA=Eu("rgb-hex-update"),DA=Eu("slider-update"),MA=Eu("palette-update"),NA=Ah({schema:[yn("dom")],name:"label"}),RA=function(t){return Ah({name:t+"-edge",overrides:function(e){var n=e.model.manager.edgeActions[t];return n.fold((function(){return{}}),(function(t){return{events:pi([xi(yo(),(function(e,n,r){return t(e,r)}),[e]),xi(So(),(function(e,n,r){return t(e,r)}),[e]),xi(ko(),(function(e,n,r){r.mouseIsDown.get()&&t(e,r)}),[e])])}}))}})},zA=RA("top-left"),BA=RA("top"),PA=RA("top-right"),IA=RA("right"),HA=RA("bottom-right"),LA=RA("bottom"),FA=RA("bottom-left"),VA=RA("left"),UA=Eh({name:"thumb",defaults:i({dom:{styles:{position:"absolute"}}}),overrides:function(t){return{events:pi([Oi(yo(),t,"spectrum"),Oi(wo(),t,"spectrum"),Oi(xo(),t,"spectrum"),Oi(So(),t,"spectrum"),Oi(ko(),t,"spectrum"),Oi(To(),t,"spectrum")])}}}),jA=Eh({schema:[Kn("mouseIsDown",(function(){return Xn(!1)}))],name:"spectrum",overrides:function(t){var e=t.model,n=e.manager,r=function(e,r){return n.getValueFromEvent(r).map((function(r){return n.setValueFrom(e,t,r)}))};return{behaviours:Fl([fy.config({mode:"special",onLeft:function(e){return n.onLeft(e,t)},onRight:function(e){return n.onRight(e,t)},onUp:function(e){return n.onUp(e,t)},onDown:function(e){return n.onDown(e,t)}}),Ny.config({})]),events:pi([wi(yo(),r),wi(wo(),r),wi(So(),r),wi(ko(),(function(e,n){t.mouseIsDown.get()&&r(e,n)}))])}}}),WA=[NA,VA,IA,BA,LA,zA,PA,FA,HA,UA,jA],qA="slider.change.value",$A=i(qA),GA=function(t){return-1!==t.type.indexOf("touch")},KA=function(t){var e=t.event.raw;if(GA(e)){var n=e;return void 0!==n.touches&&1===n.touches.length?x.some(n.touches[0]).map((function(t){return Ec(t.clientX,t.clientY)})):x.none()}var r=e;return void 0!==r.clientX?x.some(r).map((function(t){return Ec(t.clientX,t.clientY)})):x.none()},XA="top",YA="right",JA="bottom",QA="left",ZA=function(t){return t.model.minX},tD=function(t){return t.model.minY},eD=function(t){return t.model.minX-1},nD=function(t){return t.model.minY-1},rD=function(t){return t.model.maxX},oD=function(t){return t.model.maxY},iD=function(t){return t.model.maxX+1},uD=function(t){return t.model.maxY+1},aD=function(t,e,n){return e(t)-n(t)},cD=function(t){return aD(t,rD,ZA)},sD=function(t){return aD(t,oD,tD)},lD=function(t){return cD(t)/2},fD=function(t){return sD(t)/2},dD=function(t){return t.stepSize},mD=function(t){return t.snapToGrid},gD=function(t){return t.snapStart},hD=function(t){return t.rounded},pD=function(t,e){return void 0!==t[e+"-edge"]},vD=function(t){return pD(t,QA)},bD=function(t){return pD(t,YA)},yD=function(t){return pD(t,XA)},wD=function(t){return pD(t,JA)},xD=function(t){return t.model.value.get()},CD=function(t){return{x:t}},SD=function(t){return{y:t}},kD=function(t,e){return{x:t,y:e}},OD=function(t,e){fi(t,$A(),{value:e})},TD=function(t,e){OD(t,kD(eD(e),nD(e)))},ED=function(t,e){OD(t,SD(nD(e)))},_D=function(t,e){OD(t,kD(lD(e),nD(e)))},AD=function(t,e){OD(t,kD(iD(e),nD(e)))},DD=function(t,e){OD(t,CD(iD(e)))},MD=function(t,e){OD(t,kD(iD(e),fD(e)))},ND=function(t,e){OD(t,kD(iD(e),uD(e)))},RD=function(t,e){OD(t,SD(uD(e)))},zD=function(t,e){OD(t,kD(lD(e),uD(e)))},BD=function(t,e){OD(t,kD(eD(e),uD(e)))},PD=function(t,e){OD(t,CD(eD(e)))},ID=function(t,e){OD(t,kD(eD(e),fD(e)))},HD=function(t,e,n,r){return tn?n:t===e?e-1:Math.max(e,t-r)},LD=function(t,e,n,r){return t>n?t:td)return h;var p=UD(o,f,d),v=FD(p/m*r+e,g,h);return u&&v>=e&&v<=n?VD(v,e,n,i,a):c?Math.round(v):v},WD=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},qD="top",$D="right",GD="bottom",KD="left",XD="width",YD="height",JD=function(t){return t.element.dom.getBoundingClientRect()},QD=function(t,e){return t[e]},ZD=function(t){var e=JD(t);return QD(e,KD)},tM=function(t){var e=JD(t);return QD(e,$D)},eM=function(t){var e=JD(t);return QD(e,qD)},nM=function(t){var e=JD(t);return QD(e,GD)},rM=function(t){var e=JD(t);return QD(e,XD)},oM=function(t){var e=JD(t);return QD(e,YD)},iM=function(t,e,n){return(t+e)/2-n},uM=function(t,e){var n=JD(t),r=JD(e),o=QD(n,KD),i=QD(n,$D),u=QD(r,KD);return iM(o,i,u)},aM=function(t,e){var n=JD(t),r=JD(e),o=QD(n,qD),i=QD(n,GD),u=QD(r,qD);return iM(o,i,u)},cM=function(t,e){fi(t,$A(),{value:e})},sM=function(t){return{x:t}},lM=function(t,e,n){var r={min:ZA(e),max:rD(e),range:cD(e),value:n,step:dD(e),snap:mD(e),snapStart:gD(e),rounded:hD(e),hasMinEdge:vD(e),hasMaxEdge:bD(e),minBound:ZD(t),maxBound:tM(t),screenRange:rM(t)};return jD(r)},fM=function(t,e,n){var r=lM(t,e,n),o=sM(r);return cM(t,o),r},dM=function(t,e){var n=ZA(e);cM(t,sM(n))},mM=function(t,e){var n=rD(e);cM(t,sM(n))},gM=function(t,e,n){var r=t>0?LD:HD,o=r(xD(n).x,ZA(n),rD(n),dD(n));return cM(e,sM(o)),x.some(o)},hM=function(t){return function(e,n){return gM(t,e,n).map((function(){return!0}))}},pM=function(t){var e=KA(t);return e.map((function(t){return t.left}))},vM=function(t,e,n,r,o){var i=0,u=rM(t),a=r.bind((function(e){return x.some(uM(e,t))})).getOr(i),c=o.bind((function(e){return x.some(uM(e,t))})).getOr(u),s={min:ZA(e),max:rD(e),range:cD(e),value:n,hasMinEdge:vD(e),hasMaxEdge:bD(e),minBound:ZD(t),minOffset:i,maxBound:tM(t),maxOffset:u,centerMinEdge:a,centerMaxEdge:c};return WD(s)},bM=function(t,e,n,r,o,i){var u=vM(e,i,n,r,o);return ZD(e)-ZD(t)+u},yM=function(t,e,n,r){var o=xD(n),i=bM(t,r.getSpectrum(t),o.x,r.getLeftEdge(t),r.getRightEdge(t),n),u=zc(e.element)/2;Xa(e.element,"left",i-u+"px")},wM=hM(-1),xM=hM(1),CM=x.none,SM=x.none,kM={"top-left":x.none(),top:x.none(),"top-right":x.none(),right:x.some(DD),"bottom-right":x.none(),bottom:x.none(),"bottom-left":x.none(),left:x.some(PD)},OM=Object.freeze({__proto__:null,setValueFrom:fM,setToMin:dM,setToMax:mM,findValueOfOffset:lM,getValueFromEvent:pM,findPositionOfValue:bM,setPositionFromValue:yM,onLeft:wM,onRight:xM,onUp:CM,onDown:SM,edgeActions:kM}),TM=function(t,e){fi(t,$A(),{value:e})},EM=function(t){return{y:t}},_M=function(t,e,n){var r={min:tD(e),max:oD(e),range:sD(e),value:n,step:dD(e),snap:mD(e),snapStart:gD(e),rounded:hD(e),hasMinEdge:yD(e),hasMaxEdge:wD(e),minBound:eM(t),maxBound:nM(t),screenRange:oM(t)};return jD(r)},AM=function(t,e,n){var r=_M(t,e,n),o=EM(r);return TM(t,o),r},DM=function(t,e){var n=tD(e);TM(t,EM(n))},MM=function(t,e){var n=oD(e);TM(t,EM(n))},NM=function(t,e,n){var r=t>0?LD:HD,o=r(xD(n).y,tD(n),oD(n),dD(n));return TM(e,EM(o)),x.some(o)},RM=function(t){return function(e,n){return NM(t,e,n).map((function(){return!0}))}},zM=function(t){var e=KA(t);return e.map((function(t){return t.top}))},BM=function(t,e,n,r,o){var i=0,u=oM(t),a=r.bind((function(e){return x.some(aM(e,t))})).getOr(i),c=o.bind((function(e){return x.some(aM(e,t))})).getOr(u),s={min:tD(e),max:oD(e),range:sD(e),value:n,hasMinEdge:yD(e),hasMaxEdge:wD(e),minBound:eM(t),minOffset:i,maxBound:nM(t),maxOffset:u,centerMinEdge:a,centerMaxEdge:c};return WD(s)},PM=function(t,e,n,r,o,i){var u=BM(e,i,n,r,o);return eM(e)-eM(t)+u},IM=function(t,e,n,r){var o=xD(n),i=PM(t,r.getSpectrum(t),o.y,r.getTopEdge(t),r.getBottomEdge(t),n),u=Sc(e.element)/2;Xa(e.element,"top",i-u+"px")},HM=x.none,LM=x.none,FM=RM(-1),VM=RM(1),UM={"top-left":x.none(),top:x.some(ED),"top-right":x.none(),right:x.none(),"bottom-right":x.none(),bottom:x.some(RD),"bottom-left":x.none(),left:x.none()},jM=Object.freeze({__proto__:null,setValueFrom:AM,setToMin:DM,setToMax:MM,findValueOfOffset:_M,getValueFromEvent:zM,findPositionOfValue:PM,setPositionFromValue:IM,onLeft:HM,onRight:LM,onUp:FM,onDown:VM,edgeActions:UM}),WM=function(t,e){fi(t,$A(),{value:e})},qM=function(t,e){return{x:t,y:e}},$M=function(t,e,n){var r=lM(t,e,n.left),o=_M(t,e,n.top),i=qM(r,o);return WM(t,i),i},GM=function(t,e,n,r){var o=t>0?LD:HD,i=e?xD(r).x:o(xD(r).x,ZA(r),rD(r),dD(r)),u=e?o(xD(r).y,tD(r),oD(r),dD(r)):xD(r).y;return WM(n,qM(i,u)),x.some(i)},KM=function(t,e){return function(n,r){return GM(t,e,n,r).map((function(){return!0}))}},XM=function(t,e){var n=ZA(e),r=tD(e);WM(t,qM(n,r))},YM=function(t,e){var n=rD(e),r=oD(e);WM(t,qM(n,r))},JM=function(t){return KA(t)},QM=function(t,e,n,r){var o=xD(n),i=bM(t,r.getSpectrum(t),o.x,r.getLeftEdge(t),r.getRightEdge(t),n),u=PM(t,r.getSpectrum(t),o.y,r.getTopEdge(t),r.getBottomEdge(t),n),a=zc(e.element)/2,c=Sc(e.element)/2;Xa(e.element,"left",i-a+"px"),Xa(e.element,"top",u-c+"px")},ZM=KM(-1,!1),tN=KM(1,!1),eN=KM(-1,!0),nN=KM(1,!0),rN={"top-left":x.some(TD),top:x.some(_D),"top-right":x.some(AD),right:x.some(MD),"bottom-right":x.some(ND),bottom:x.some(zD),"bottom-left":x.some(BD),left:x.some(ID)},oN=Object.freeze({__proto__:null,setValueFrom:$M,setToMin:XM,setToMax:YM,getValueFromEvent:JM,setPositionFromValue:QM,onLeft:ZM,onRight:tN,onUp:eN,onDown:nN,edgeActions:rN}),iN=[Hn("stepSize",1),Hn("onChange",e),Hn("onChoose",e),Hn("onInit",e),Hn("onDragStart",e),Hn("onDragEnd",e),Hn("snapToGrid",!1),Hn("rounded",!0),Dn("snapStart"),wn("model",cn("mode",{x:[Hn("minX",0),Hn("maxX",100),Kn("value",(function(t){return Xn(t.mode.minX)})),yn("getInitialValue"),Us("manager",OM)],y:[Hn("minY",0),Hn("maxY",100),Kn("value",(function(t){return Xn(t.mode.minY)})),yn("getInitialValue"),Us("manager",jM)],xy:[Hn("minX",0),Hn("maxX",100),Hn("minY",0),Hn("maxY",100),Kn("value",(function(t){return Xn({x:t.mode.minX,y:t.mode.minY})})),yn("getInitialValue"),Us("manager",oN)]})),Xg("sliderBehaviours",[fy,Kg]),Kn("mouseIsDown",(function(){return Xn(!1)}))],uN=function(t,e,n,r){var o,i=function(e){return jh(e,t,"thumb")},u=function(e){return jh(e,t,"spectrum")},a=function(e){return Uh(e,t,"left-edge")},c=function(e){return Uh(e,t,"right-edge")},s=function(e){return Uh(e,t,"top-edge")},l=function(e){return Uh(e,t,"bottom-edge")},d=t.model,m=d.manager,g=function(e,n){m.setPositionFromValue(e,n,t,{getLeftEdge:a,getRightEdge:c,getTopEdge:s,getBottomEdge:l,getSpectrum:u})},h=function(e,n){d.value.set(n);var r=i(e);return g(e,r),t.onChange(e,r,n),x.some(!0)},p=function(e){m.setToMin(e,t)},v=function(e){m.setToMax(e,t)},b=function(e){var n=function(){Uh(e,t,"thumb").each((function(n){var r=d.value.get();t.onChoose(e,n,r)}))},r=t.mouseIsDown.get();t.mouseIsDown.set(!1),r&&n()},y=function(e,n){n.stop(),t.mouseIsDown.set(!0),t.onDragStart(e,i(e))},w=function(e,n){n.stop(),t.onDragEnd(e,i(e)),b(e)};return{uid:t.uid,dom:t.dom,components:e,behaviours:Jg(t.sliderBehaviours,[fy.config({mode:"special",focusIn:function(e){return Uh(e,t,"spectrum").map(fy.focusIn).map(f)}}),Kg.config({store:{mode:"manual",getValue:function(t){return d.value.get()}}}),$l.config({channels:(o={},o[hg()]={onReceive:b},o)})]),events:pi([wi($A(),(function(t,e){h(t,e.event.value)})),Di((function(e,n){var r=d.getInitialValue();d.value.set(r);var o=i(e);g(e,o);var a=u(e);t.onInit(e,o,a,d.value.get())})),wi(yo(),y),wi(xo(),w),wi(So(),y),wi(To(),w)]),apis:{resetToMin:p,resetToMax:v,changeValue:h,refresh:g},domModification:{styles:{position:"relative"}}}},aN=cp({name:"Slider",configFields:iN,partFields:WA,factory:uN,apis:{resetToMin:function(t,e){t.resetToMin(e)},resetToMax:function(t,e){t.resetToMax(e)},refresh:function(t,e){t.refresh(e)}}}),cN=function(t,e){var n=aN.parts.spectrum({dom:{tag:"div",classes:[e("hue-slider-spectrum")],attributes:{role:"presentation"}}}),r=aN.parts.thumb({dom:{tag:"div",classes:[e("hue-slider-thumb")],attributes:{role:"presentation"}}});return aN.sketch({dom:{tag:"div",classes:[e("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:i({y:0})},components:[n,r],sliderBehaviours:Fl([Ny.config({})]),onChange:function(t,e,n){fi(t,DA,{value:n})}})},sN="form",lN=[Xg("formBehaviours",[Kg])],fN=function(t){return""},dN=function(t){var e=function(){var t=[],e=function(e,n){return t.push(e),Ih(sN,fN(e),n)};return{field:e,record:function(){return t}}}(),n=t(e),r=e.record(),o=q(r,(function(t){return Eh({name:t,pname:fN(t)})}));return tp(sN,lN,o,gN,n)},mN=function(t,e){return t.fold((function(){return pt.error(e)}),pt.value)},gN=function(t,e){return{uid:t.uid,dom:t.dom,components:e,behaviours:Jg(t.formBehaviours,[Kg.config({store:{mode:"manual",getValue:function(e){var n=qh(e,t);return Mt(n,(function(t,e){return t().bind((function(t){var n=yp.getCurrent(t);return mN(n,new Error("Cannot find a current component to extract the value from for form part '"+e+"': "+Cu(t.element)))})).map(Kg.getValue)}))},setValue:function(e,n){Dt(n,(function(n,r){Uh(e,t,r).each((function(t){yp.getCurrent(t).each((function(t){Kg.setValue(t,n)}))}))}))}}})]),apis:{getField:function(e,n){return Uh(e,t,n).bind(yp.getCurrent)}}}},hN={getField:$u((function(t,e,n){return t.getField(e,n)})),sketch:dN},pN=Eu("valid-input"),vN=Eu("invalid-input"),bN=Eu("validating-input"),yN="colorcustom.rgb.",wN=function(t,n,r,o){var i=function(e,r){return $_.config({invalidClass:n("invalid"),notify:{onValidate:function(t){fi(t,bN,{type:e})},onValid:function(t){fi(t,pN,{type:e,value:Kg.getValue(t)})},onInvalid:function(t){fi(t,vN,{type:e,value:Kg.getValue(t)})}},validator:{validate:function(e){var n=Kg.getValue(e),o=r(n)?pt.value(!0):pt.error(t("aria.input.invalid"));return z_.pure(o)},validateOnLoad:!1}})},u=function(r,o,u,a,c){var s=t(yN+"range"),l=XE.parts.label({dom:{tag:"label",innerHtml:u,attributes:{"aria-label":a}}}),f=XE.parts.field({data:c,factory:C_,inputAttributes:m({type:"text"},"hex"===o?{"aria-live":"polite"}:{}),inputClasses:[n("textfield")],inputBehaviours:Fl([i(o,r),ZE.config({})]),onSetValue:function(t){if($_.isInvalid(t)){var n=$_.run(t);n.get(e)}}}),d=[l,f],g="hex"!==o?[XE.parts["aria-descriptor"]({text:s})]:[],h=d.concat(g);return{dom:{tag:"div",attributes:{role:"presentation"}},components:h}},a=function(t,e){var n=zO(e);return hN.getField(t,"hex").each((function(e){Ny.isFocused(e)||Kg.setValue(t,{hex:n.value})})),n},c=function(t,e){var n=e.red,r=e.green,o=e.blue;Kg.setValue(t,{red:n,green:r,blue:o})},s=Qw({dom:{tag:"div",classes:[n("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),l=function(t,e){s.getOpt(t).each((function(t){Xa(t.element,"background-color","#"+e.value)}))},f=function(){var e={red:Xn(x.some(255)),green:Xn(x.some(255)),blue:Xn(x.some(255)),hex:Xn(x.some("ffffff"))},i=function(t,e){var n=jO(e);c(t,n),g(n)},f=function(t){return e[t].get()},d=function(t,n){e[t].set(n)},m=function(){return f("red").bind((function(t){return f("green").bind((function(e){return f("blue").map((function(n){return FO(t,e,n,1)}))}))}))},g=function(t){var e=t.red,n=t.green,r=t.blue;d("red",x.some(e)),d("green",x.some(n)),d("blue",x.some(r))},h=function(t,e){var n=e.event;"hex"!==n.type?d(n.type,x.none()):o(t)},p=function(t,e){r(t);var n=EO(e);d("hex",x.some(e));var o=jO(n);c(t,o),g(o),fi(t,AA,{hex:n}),l(t,n)},v=function(t,e,n){var r=parseInt(n,10);d(e,x.some(r)),m().each((function(e){var n=a(t,e);l(t,n)}))},b=function(t){return"hex"===t.type},y=function(t,e){var n=e.event;b(n)?p(t,n.value):v(t,n.type,n.value)},w=function(e){return{label:t(yN+e+".label"),description:t(yN+e+".description")}},C=w("red"),S=w("green"),k=w("blue"),O=w("hex");return Kt(hN.sketch((function(e){return{dom:{tag:"form",classes:[n("rgb-form")],attributes:{"aria-label":t("aria.color.picker")}},components:[e.field("red",XE.sketch(u(VO,"red",C.label,C.description,255))),e.field("green",XE.sketch(u(VO,"green",S.label,S.description,255))),e.field("blue",XE.sketch(u(VO,"blue",k.label,k.description,255))),e.field("hex",XE.sketch(u(DO,"hex",O.label,O.description,"ffffff"))),s.asSpec()],formBehaviours:Fl([$_.config({invalidClass:n("form-invalid")}),Sy("rgb-form-events",[wi(pN,y),wi(vN,h),wi(bN,h)])])}})),{apis:{updateHex:function(t,e){Kg.setValue(t,{hex:e.value}),i(t,e),l(t,e)}}})},d=ap({factory:f,name:"RgbForm",configFields:[],apis:{updateHex:function(t,e,n){t.updateHex(e,n)}},extraApis:{}});return d},xN=function(t,e){var n=aN.parts.spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[e("sv-palette-spectrum")]}}),r=aN.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)}},u=function(t,e){var n=t.components()[0].element.dom;o(n,$O(e))},a=function(t){var u=i({x:0,y:0}),a=function(t,e,n){fi(t,MA,{value:n})},c=function(t,e,n,r){o(n.element.dom,$O(GO))},s=Fl([yp.config({find:x.some}),Ny.config({})]);return aN.sketch({dom:{tag:"div",attributes:{role:"presentation"},classes:[e("sv-palette")]},model:{mode:"xy",getInitialValue:u},rounded:!1,components:[n,r],onChange:a,onInit:c,sliderBehaviours:s})},c=ap({factory:a,name:"SaturationBrightnessPalette",configFields:[],apis:{setRgba:function(t,e,n){u(e,n)}},extraApis:{}});return c},CN=function(t,n){var r=function(e){var r=wN(t,n,e.onValidHex,e.onInvalidHex),o=xN(t,n),i={paletteRgba:Xn(GO)},u=Qw(o.sketch({})),a=Qw(r.sketch({})),c=function(t,e){u.getOpt(t).each((function(t){var n=jO(e);i.paletteRgba.set(n),o.setRgba(t,n)}))},s=function(t,e){a.getOpt(t).each((function(t){r.updateHex(t,e)}))},l=function(t,e,n){$(n,(function(n){n(t,e)}))},f=function(){var t=[s];return function(e,n){var r=n.event.value,o=i.paletteRgba.get(),u=EA(o),a=TA(u.hue,r.x,100-r.y),c=UO(a),s=zO(c);l(e,s,t)}},d=function(){var t=[c,s];return function(e,n){var r=n.event.value,o=_A(r.y);l(e,o,t)}};return{uid:e.uid,dom:e.dom,components:[u.asSpec(),cN(t,n),a.asSpec()],behaviours:Fl([Sy("colour-picker-events",[wi(MA,f()),wi(DA,d())]),yp.config({find:function(t){return a.getOpt(t)}}),fy.config({mode:"acyclic"})])}},o=ap({name:"ColourPicker",configFields:[yn("dom"),Hn("onValidHex",e),Hn("onInvalidHex",e)],factory:r});return o},SN=function(){return yp.config({find:x.some})},kN=function(t){return yp.config({find:t.getOpt})},ON=function(t){return yp.config({find:function(e){return Yi(e.element,t).bind((function(t){return e.getSystem().getByDom(t).toOptional()}))}})},TN={self:SN,memento:kN,childAt:ON},EN={"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 EN[t]},AN=function(t){return _N(t)},DN=function(t){var e=function(t){return"tox-"+t},n=CN(AN,e),r=function(t){fi(t,l_,{name:"hex-valid",value:!0})},o=function(t){fi(t,l_,{name:"hex-valid",value:!1})},i=Qw(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:Fl([Kg.config({store:{mode:"manual",getValue:function(t){var e=i.get(t),n=yp.getCurrent(e),r=n.bind((function(t){var e=Kg.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=yp.getCurrent(o);u.fold((function(){console.log("Can not find form")}),(function(t){Kg.setValue(t,{hex:x.from(r[1]).getOr("")}),hN.getField(t,"hex").each((function(t){li(t,No())}))}))}}}),TN.self()])}},MN=tinymce.util.Tools.resolve("tinymce.Resource"),NN=function(t){return Object.prototype.hasOwnProperty.call(t,"init")},RN=function(t){var e=Xn(x.none()),n=Qw({dom:{tag:t.tag}}),r=Xn(x.none());return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:Fl([Sy("custom-editor-events",[Di((function(o){n.getOpt(o).each((function(n){(NN(t)?t.init(n.element.dom):MN.load(t.scriptId,t.scriptUrl).then((function(e){return e(n.element.dom,t.settings)}))).then((function(t){r.get().each((function(e){t.setValue(e)})),r.set(x.none()),e.set(x.some(t))}))}))}))]),Kg.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(x.some(n))}),(function(t){return t.setValue(n)}))}}}),TN.self()]),components:[n.asSpec()]}},zN=tinymce.util.Tools.resolve("tinymce.util.Tools"),BN=He([Hn("preprocess",u),Hn("postprocess",u)]),PN=function(t,e){var n=on("RepresentingConfigs.memento processors",BN,e);return Kg.config({store:{mode:"manual",getValue:function(e){var r=t.get(e),o=Kg.getValue(r);return n.postprocess(o)},setValue:function(e,r){var o=n.preprocess(r),i=t.get(e);Kg.setValue(i,o)}}})},IN=function(t,e,n){return Kg.config(Kt({store:{mode:"manual",getValue:e,setValue:n}},t.map((function(t){return{store:{initialValue:t}}})).getOr({})))},HN=function(t,e,n){return IN(t,(function(t){return e(t.element)}),(function(t,e){return n(t.element,e)}))},LN=function(t){return HN(t,ic,uc)},FN=function(t){return HN(t,su,lu)},VN=function(t){return Kg.config({store:{mode:"memory",initialValue:t}})},UN={memento:PN,withElement:HN,withComp:IN,domValue:LN,domHtml:FN,memory:VN},jN="jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp",WN=function(t,e){var n=zN.explode(e.getSetting("images_file_types",jN,"string")),r=function(t){return U(n,(function(e){return hr(t.name,"."+e)}))};return X(ft(t),r)},qN=function(t,e){var n=function(t,e){e.stop()},r=function(t){return function(e,n){$(t,(function(t){t(e,n)}))}},o=function(t,e){if(!XS.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){Kg.setValue(n,WN(r,e)),fi(n,a_,{name:t.name})},a=Qw({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:Fl([Sy("input-file-events",[Ei(zo()),Ei(qo())])])}),c=function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:Fl([UN.memory([]),TN.self(),XS.config({}),Jy.config({toggleClass:"dragenter",toggleOnExecute:!1}),Sy("dropzone-events",[wi("dragenter",r([n,Jy.toggle])),wi("dragleave",r([n,Jy.toggle])),wi("dragover",n),wi("drop",r([n,o])),wi(Ro(),i)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:e.translate("Drop an image here")}},Jw.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:Fl([ZE.config({}),Gk.button(e.isDisabled),Uk()])})]}]}},s=t.label.map((function(t){return u_(t,e)})),l=XE.parts.field({factory:{sketch:c}});return e_(s,l,["tox-form__group--stretched"],[])},$N=function(t,e){return{dom:{tag:"div",classes:["tox-form__grid","tox-form__grid--"+t.columns+"col"]},components:q(t.items,e.interpreter)}},GN=Eu("alloy-fake-before-tabstop"),KN=Eu("alloy-fake-after-tabstop"),XN=function(t){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:t},behaviours:Fl([Ny.config({ignore:!0}),ZE.config({})])}},YN=function(t){return{dom:{tag:"div",classes:["tox-navobj"]},components:[XN([GN]),t,XN([KN])],behaviours:Fl([TN.childAt(1)])}},JN=function(t,e){fi(t,Do(),{raw:{which:9,shiftKey:e}})},QN=function(t,e){var n=e.element;Da(n,GN)?JN(t,!0):Da(n,KN)&&JN(t,!1)},ZN=function(t){return hE(t,["."+GN,"."+KN].join(","),l)},tR=!(Gr().browser.isIE()||Gr().browser.isEdge()),eR=function(t){var e=Xn("");return{getValue:function(t){return e.get()},setValue:function(n,r){if(t)mu(n.element,"srcdoc",r);else{mu(n.element,"src","javascript:''");var o=n.element.dom.contentWindow.document;o.open(),o.write(r),o.close()}e.set(r)}}},nR=function(t,e){var n=tR&&t.sandboxed,r=m(m({},t.label.map((function(t){return{title:t}})).getOr({})),n?{sandbox:"allow-scripts allow-same-origin"}:{}),o=eR(n),i=t.label.map((function(t){return u_(t,e)})),u=function(t){return YN({uid:t.uid,dom:{tag:"iframe",attributes:r},behaviours:Fl([ZE.config({}),Ny.config({}),UN.withComp(x.none(),o.getValue,o.setValue)])})},a=XE.parts.field({factory:{sketch:u}});return e_(i,a,["tox-form__group--stretched"],[])};function rR(t,e){return uR(document.createElement("canvas"),t,e)}function oR(t){var e=rR(t.width,t.height),n=iR(e);return n.drawImage(t,0,0),e}function iR(t){return t.getContext("2d")}function uR(t,e,n){return t.width=e,t.height=n,t}function aR(t){return t.naturalWidth||t.width}function cR(t){return t.naturalHeight||t.height}var sR=function(){var t=function(t){if("object"!==typeof this)throw new TypeError("Promises must be constructed via new");if("function"!==typeof t)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],l(t,r(u,this),r(a,this))},e=window,n=t.immediateFn||"function"===typeof e.setImmediate&&e.setImmediate||function(t){setTimeout(t,1)};function r(t,e){return function(){return t.apply(e,arguments)}}var o=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function i(t){var e=this;null!==this._state?n((function(){var n=e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(o){return void t.reject(o)}t.resolve(r)}else(e._state?t.resolve:t.reject)(e._value)})):this._deferreds.push(t)}function u(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"===typeof t||"function"===typeof t)){var e=t.then;if("function"===typeof e)return void l(r(e,t),r(u,this),r(a,this))}this._state=!0,this._value=t,c.call(this)}catch(n){a.call(this,n)}}function a(t){this._state=!1,this._value=t,c.call(this)}function c(){for(var t=0,e=this._deferreds;tn?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=qR(t,i,u);return a?c.then((function(t){return WR(t,e,n)})):c}function qR(t,e,n){return new lR((function(r){var o=aR(t),i=cR(t),u=Math.floor(o*e),a=Math.floor(i*n),c=rR(u,a),s=iR(c);s.drawImage(t,0,0,o,i,0,0,u,a),r(c)}))}function $R(t,e){return t.toCanvas().then((function(n){return GR(n,t.getType(),e)}))}function GR(t,e,n){var r=rR(t.width,t.height),o=iR(r),i=0,u=0;return n=n<0?360+n:n,90!==n&&270!==n||uR(r,r.height,r.width),90!==n&&180!==n||(i=r.width),270!==n&&180!==n||(u=r.height),o.translate(i,u),o.rotate(n*Math.PI/180),o.drawImage(t,0,0),xR(r,e)}function KR(t,e){return t.toCanvas().then((function(n){return XR(n,t.getType(),e)}))}function XR(t,e,n){var r=rR(t.width,t.height),o=iR(r);return"v"===n?(o.scale(1,-1),o.drawImage(t,0,-r.height)):(o.scale(-1,1),o.drawImage(t,-r.width,0)),xR(r,e)}function YR(t,e,n,r,o){return t.toCanvas().then((function(i){return JR(i,t.getType(),e,n,r,o)}))}function JR(t,e,n,r,o,i){var u=rR(o,i),a=iR(u);return a.drawImage(t,-n,-r),xR(u,e)}function QR(t,e,n){return t.toCanvas().then((function(r){return WR(r,e,n).then((function(e){return xR(e,t.getType())}))}))}var ZR,tz=function(t){return HR(t)},ez=function(t){return UR(t)},nz=function(t,e){return jR(t,e)},rz=function(t,e,n,r){return VR(t,e,n,r)},oz=function(t,e){return LR(t,e)},iz=function(t,e){return FR(t,e)},uz=function(t,e){return KR(t,e)},az=function(t,e,n,r,o){return YR(t,e,n,r,o)},cz=function(t,e,n){return QR(t,e,n)},sz=function(t,e){return $R(t,e)},lz=function(t,e){return m({dom:{tag:"span",innerHtml:t,classes:["tox-icon","tox-tbtn__icon-wrap"]}},e)},fz=function(t,e){return lz(tx(t,e),{})},dz=function(t,e){return lz(tx(t,e),{behaviours:Fl([xy.config({})])})},mz=function(t,e,n){return{dom:{tag:"span",innerHtml:n.translate(t),classes:[e+"__select-label"]},behaviours:Fl([xy.config({})])}},gz=Eu("toolbar.button.execute"),hz=function(t){return Ri((function(e,n){Kk(t,e)((function(n){fi(e,gz,{buttonApi:n}),t.onAction(n)}))}))},pz=(ZR={},ZR[jo()]=["disabling","alloy.base.behaviour","toggling","toolbar-button-events"],ZR),vz=Eu("update-menu-text"),bz=Eu("update-menu-icon"),yz=function(t,n,r){var o=Xn(e),i=t.text.map((function(t){return Qw(mz(t,n,r.providers))})),u=t.icon.map((function(t){return Qw(dz(t,r.providers.icons))})),c=function(t,e){var n=Kg.getValue(t);return Ny.focus(n),fi(n,"keydown",{raw:e.event.raw}),pA.close(n),x.some(!0)},s=t.role.fold((function(){return{}}),(function(t){return{role:t}})),l=t.tooltip.fold((function(){return{}}),(function(t){var e=r.providers.translate(t);return{title:e,"aria-label":e}})),f=Qw(pA.sketch(m(m(m({},t.uid?{uid:t.uid}:{}),s),{dom:{tag:"button",classes:[n,n+"--select"].concat(q(t.classes,(function(t){return n+"--"+t}))),attributes:m({},l)},components:Zk([u.map((function(t){return t.asSpec()})),i.map((function(t){return t.asSpec()})),x.some({dom:{tag:"div",classes:[n+"__select-chevron"],innerHtml:tx("chevron-down",r.providers.icons)}})]),matchWidth:!0,useMinWidth:!0,dropdownBehaviours:Fl(h(t.dropdownBehaviours,[Gk.button((function(){return t.disabled||r.providers.isDisabled()})),Uk(),wA.config({}),xy.config({}),Sy("dropdown-events",[Xk(t,o),Yk(t,o)]),Sy("menubutton-update-display-text",[wi(vz,(function(t,e){i.bind((function(e){return e.getOpt(t)})).each((function(t){xy.set(t,[pc(r.providers.translate(e.event.text))])}))})),wi(bz,(function(t,e){u.bind((function(e){return e.getOpt(t)})).each((function(t){xy.set(t,[dz(e.event.icon,r.providers.icons)])}))}))])])),eventOrder:Kt(pz,{mousedown:["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"]}),sandboxBehaviours:Fl([fy.config({mode:"special",onLeft:c,onRight:c})]),lazySink:r.getSink,toggleClass:n+"--active",parts:{menu:PC(!1,t.columns,t.presets)},fetch:function(e){return z_.nu(a(t.fetch,e))}})));return f.asSpec()},wz=function(t){return T(t)},xz=function(t){return"separator"===t.type},Cz=function(t){return Ft(t,"getSubmenuItems")},Sz={type:"separator"},kz=function(t,e){var n=J(t,(function(t,n){return wz(n)?""===n?t:"|"===n?t.length>0&&!xz(t[t.length-1])?t.concat([Sz]):t:Ft(e,n.toLowerCase())?t.concat([e[n.toLowerCase()]]):t:t.concat([n])}),[]);return n.length>0&&xz(n[n.length-1])&&n.pop(),n},Oz=function(t,e){var n=t.getSubmenuItems(),r=_z(n,e),o=Kt(r.menus,se(t.value,r.items)),i=Kt(r.expansions,se(t.value,t.value));return{item:t,menus:o,expansions:i}},Tz=function(t,e){return Cz(t)?Oz(t,e):{item:t,menus:{},expansions:{}}},Ez=function(t){if(xz(t))return t;var e=Lt(t,"value").getOrThunk((function(){return Eu("generated-menu-item")}));return Kt({value:e},t)},_z=function(t,e){var n=kz(T(t)?t.split(" "):t,e);return Y(n,(function(t,n){var r=Ez(n),o=Tz(r,e);return{menus:Kt(t.menus,o.menus),items:[o.item].concat(t.items),expansions:Kt(t.expansions,o.expansions)}}),{menus:{},expansions:{},items:[]})},Az=function(t,e,n,r){var o=Eu("primary-menu"),i=_z(t,n.shared.providers.menuItems());if(0===i.items.length)return x.none();var u=uE(o,i.items,e,n,r),a=Mt(i.menus,(function(t,r){return uE(r,t,e,n,!1)})),c=Kt(a,se(o,u));return x.from(zw.tieredData(o,c,i.expansions))},Dz=function(t){return{isDisabled:function(){return XS.isDisabled(t)},setDisabled:function(e){return XS.set(t,e)},setActive:function(e){var n=t.element;e?(Ea(n,"tox-tbtn--enabled"),mu(n,"aria-pressed",!0)):(Aa(n,"tox-tbtn--enabled"),bu(n,"aria-pressed"))},isActive:function(){return Da(t.element,"tox-tbtn--enabled")}}},Mz=function(t,e,n,r){return yz({text:t.text,icon:t.icon,tooltip:t.tooltip,role:r,fetch:function(e,r){t.fetch((function(t){r(Az(t,cC.CLOSE_ON_EXECUTE,n,!1))}))},onSetup:t.onSetup,getApi:Dz,columns:1,presets:"normal",classes:[],dropdownBehaviours:[ZE.config({})]},e,n.shared)},Nz=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){Yl(e.element),fi(e,l_,{name:t.name,value:t.storage.get()})}))}))}},o=function(t){return function(e){e.setActive(t.storage.get())}};return function(e){e(q(t,(function(t){var e=t.text.fold((function(){return{}}),(function(t){return{text:t}}));return m(m({type:t.type,active:!1},e),{onAction:r(t),onSetup:o(t)})})))}},Rz=function(t,e,n,r,o,i){void 0===n&&(n=[]);var u=e.fold((function(){return{}}),(function(t){return{action:t}})),a=m({buttonBehaviours:Fl([Gk.button((function(){return t.disabled||i.isDisabled()})),Uk(),ZE.config({}),Sy("button press",[yi("click"),yi("mousedown")])].concat(n)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]}},u),c=Kt(a,{dom:r});return Kt(c,{components:o})},zz=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 fz(t,n.icons)})),a=Zk([u]);return Rz(t,e,r,i,a,n)},Bz=function(t,e,n,r){void 0===r&&(r=[]);var o=zz(t,x.some(e),n,r);return Jw.sketch(o)},Pz=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 fz(t,n.icons)})):x.none(),a=u.isSome()?Zk([u]):[],c=u.isSome()?{}:{innerHtml:i},s=h(t.primary||t.borderless?["tox-button"]:["tox-button","tox-button--secondary"],u.isSome()?["tox-button--icon"]:[],t.borderless?["tox-button--naked"]:[],o),l=m(m({tag:"button",classes:s},c),{attributes:{title:i}});return Rz(t,e,r,l,a,n)},Iz=function(t,e,n,r,o){void 0===r&&(r=[]),void 0===o&&(o=[]);var i=Pz(t,x.some(e),n,r,o);return Jw.sketch(i)},Hz=function(t,e){return function(n){"custom"===e?fi(n,l_,{name:t,value:{}}):"submit"===e?li(n,f_):"cancel"===e?li(n,s_):console.error("Unknown button type: ",e)}},Lz=function(t,e){return"menu"===e},Fz=function(t,e){return"custom"===e||"cancel"===e||"submit"===e},Vz=function(t,n,r){if(Lz(t,n)){var o=function(){return a},i=t,u=m(m({},t),{onSetup:function(n){return n.setDisabled(t.disabled),e},fetch:Nz(i.items,o,r)}),a=Qw(Mz(u,"tox-tbtn",r,x.none()));return a.asSpec()}if(Fz(t,n)){var c=Hz(t.name,n),s=m(m({},t),{borderless:!1});return Iz(s,c,r.shared.providers,[])}console.error("Unknown footer button type: ",n)},Uz=function(t,e){var n=Hz(t.name,"custom");return n_(x.none(),XE.parts.field(m({factory:Jw},Pz(t,x.some(n),e,[UN.memory(""),TN.self()]))))},jz=i([Hn("field1Name","field1"),Hn("field2Name","field2"),Fs("onLockedChange"),Ps(["lockClass"]),Hn("locked",!1),Qg.field("coupledFieldBehaviours",[yp,Kg])]),Wz=function(t,e,n){return Uh(t,e,n).bind(yp.getCurrent)},qz=function(t,e){return Eh({factory:XE,name:t,overrides:function(t){return{fieldBehaviours:Fl([Sy("coupled-input-behaviour",[wi(No(),(function(n){Wz(n,t,e).each((function(e){Uh(n,t,"lock").each((function(r){Jy.isOn(r)&&t.onLockedChange(n,e,r)}))}))}))])])}}})},$z=i([qz("field1","field2"),qz("field2","field1"),Eh({factory:Jw,schema:[yn("dom")],name:"lock",overrides:function(t){return{buttonBehaviours:Fl([Jy.config({selected:t.locked,toggleClass:t.markers.lockClass,aria:{mode:"pressed"}})])}}})]),Gz=function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,behaviours:Qg.augment(t.coupledFieldBehaviours,[yp.config({find:x.some}),Kg.config({store:{mode:"manual",getValue:function(e){var n,r=Gh(e,t,["field1","field2"]);return n={},n[t.field1Name]=Kg.getValue(r.field1()),n[t.field2Name]=Kg.getValue(r.field2()),n},setValue:function(e,n){var r=Gh(e,t,["field1","field2"]);Vt(n,t.field1Name)&&Kg.setValue(r.field1(),n[t.field1Name]),Vt(n,t.field2Name)&&Kg.setValue(r.field2(),n[t.field2Name])}}})]),apis:{getField1:function(e){return Uh(e,t,"field1")},getField2:function(e){return Uh(e,t,"field2")},getLock:function(e){return Uh(e,t,"lock")}}}},Kz=cp({name:"FormCoupledInputs",configFields:jz(),partFields:$z(),factory:Gz,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)}}}),Xz=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},Yz=function(t){var e=/^\s*(\d+(?:\.\d+)?)\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\s*$/,n=e.exec(t);if(null!==n){var r=parseFloat(n[1]),o=n[2];return pt.value({value:r,unit:o})}return pt.error(t)},Jz=function(t,e){var n={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,in:1},r=function(t){return Object.prototype.hasOwnProperty.call(n,t)};return t.unit===e?x.some(t.value):r(t.unit)&&r(e)?n[t.unit]===n[e]?x.some(t.value):x.some(t.value/n[t.unit]*n[e]):x.none()},Qz=function(t){return x.none()},Zz=function(t,e){return function(n){return Jz(n,e).map((function(n){return{value:n*t,unit:e}}))}},tB=function(t,e){var n=Yz(t).toOptional(),r=Yz(e).toOptional();return fp(n,r,(function(t,e){return Jz(t,e.unit).map((function(t){return e.value/t})).map((function(t){return Zz(t,e.unit)})).getOr(Qz)})).getOr(Qz)},eB=function(t,e){var n=Qz,r=Eu("ratio-event"),o=Kz.parts.lock({dom:{tag:"button",classes:["tox-lock","tox-button","tox-button--naked","tox-button--icon"],attributes:{title:e.translate(t.label.getOr("Constrain proportions"))}},components:[{dom:{tag:"span",classes:["tox-icon","tox-lock-icon__lock"],innerHtml:tx("lock",e.icons)}},{dom:{tag:"span",classes:["tox-icon","tox-lock-icon__unlock"],innerHtml:tx("unlock",e.icons)}}],buttonBehaviours:Fl([XS.config({disabled:function(){return t.disabled||e.isDisabled()}}),Uk(),ZE.config({})])}),i=function(t){return{dom:{tag:"div",classes:["tox-form__group"]},components:t}},u=function(n){return XE.parts.field({factory:C_,inputClasses:["tox-textfield"],inputBehaviours:Fl([XS.config({disabled:function(){return t.disabled||e.isDisabled()}}),Uk(),ZE.config({}),Sy("size-input-events",[wi(_o(),(function(t,e){fi(t,r,{isField1:n})})),wi(Ro(),(function(e,n){fi(e,a_,{name:t.name})}))])]),selectOnFocus:!1})},a=function(t){return{dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}}},c=Kz.parts.field1(i([XE.parts.label(a("Width")),u(!0)])),s=Kz.parts.field2(i([XE.parts.label(a("Height")),u(!1)]));return Kz.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:[c,s,i([a(" "),o])]}],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:function(t,e,r){Yz(Kg.getValue(t)).each((function(t){n(t).each((function(t){Kg.setValue(e,Xz(t))}))}))},coupledFieldBehaviours:Fl([XS.config({disabled:function(){return t.disabled||e.isDisabled()},onDisabled:function(t){Kz.getField1(t).bind(XE.getField).each(XS.disable),Kz.getField2(t).bind(XE.getField).each(XS.disable),Kz.getLock(t).each(XS.disable)},onEnabled:function(t){Kz.getField1(t).bind(XE.getField).each(XS.enable),Kz.getField2(t).bind(XE.getField).each(XS.enable),Kz.getLock(t).each(XS.enable)}}),Uk(),Sy("size-input-events2",[wi(r,(function(t,e){var r=e.event.isField1,o=r?Kz.getField1(t):Kz.getField2(t),i=r?Kz.getField2(t):Kz.getField1(t),u=o.map(Kg.getValue).getOr(""),a=i.map(Kg.getValue).getOr("");n=tB(u,a)}))])])})},nB=i(Eu("undo")),rB=i(Eu("redo")),oB=i(Eu("zoom")),iB=i(Eu("back")),uB=i(Eu("apply")),aB=i(Eu("swap")),cB=i(Eu("transform")),sB=i(Eu("temp-transform")),lB=i(Eu("transform-apply")),fB={undo:nB,redo:rB,zoom:oB,back:iB,apply:uB,swap:aB,transform:cB,tempTransform:sB,transformApply:lB},dB=i("save-state"),mB=i("disable"),gB=i("enable"),hB={formActionEvent:l_,saveState:dB,disable:mB,enable:gB},pB=function(t,n){var r=function(t,e,r,o){return Qw(Iz({name:t,text:t,disabled:r,primary:o,icon:x.none(),borderless:!1},e,n))},o=function(t,e,r,o){return Qw(Bz({name:t,icon:x.some(t),tooltip:x.some(e),disabled:o,primary:!1,borderless:!1},r,n))},u=function(t,e){t.map((function(t){var n=t.get(e);n.hasConfigured(XS)&&XS.disable(n)}))},a=function(t,e){t.map((function(t){var n=t.get(e);n.hasConfigured(XS)&&XS.enable(n)}))},c={tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools-edit-panel"]},s=e,l=function(t,e,n){fi(t,e,n)},f=function(t){return li(t,hB.disable())},d=function(t){return li(t,hB.enable())},m=function(t,e){f(t),l(t,fB.transform(),{transform:e}),d(t)},g=function(t,e){f(t),l(t,fB.tempTransform(),{transform:e}),d(t)},h=function(t){return function(){ut.getOpt(t).each((function(t){xy.set(t,[ot])}))}},p=function(t,e){f(t),l(t,fB.transformApply(),{transform:e,swap:h(t)}),d(t)},v=function(){return r("Back",(function(t){return l(t,fB.back(),{swap:h(t)})}),!1,!1)},b=function(){return Qw({dom:{tag:"div",classes:["tox-spacer"]},behaviours:Fl([XS.config({})])})},y=function(){return r("Apply",(function(t){return l(t,fB.apply(),{swap:h(t)})}),!0,!0)},w=function(){return function(e){var n=t.getRect();return az(e,n.x,n.y,n.w,n.h)}},C=[v(),b(),r("Apply",(function(e){var n=w();p(e,n),t.hideCrop()}),!1,!0)],S=jE.sketch({dom:c,components:C.map((function(t){return t.asSpec()})),containerBehaviours:Fl([Sy("image-tools-crop-buttons-events",[wi(hB.disable(),(function(t,e){u(C,t)})),wi(hB.enable(),(function(t,e){a(C,t)}))])])}),k=Qw(eB({name:"size",label:x.none(),constrain:!0,disabled:!1},n)),O=function(t,e){return function(n){return cz(n,t,e)}},T=[v(),b(),k,b(),r("Apply",(function(t){k.getOpt(t).each((function(e){var n=Kg.getValue(e),r=parseInt(n.width,10),o=parseInt(n.height,10),i=O(r,o);p(t,i)}))}),!1,!0)],E=jE.sketch({dom:c,components:T.map((function(t){return t.asSpec()})),containerBehaviours:Fl([Sy("image-tools-resize-buttons-events",[wi(hB.disable(),(function(t,e){u(T,t)})),wi(hB.enable(),(function(t,e){a(T,t)}))])])}),_=function(t,e){return function(n){return t(n,e)}},A=_(uz,"h"),D=_(uz,"v"),M=_(sz,-90),N=_(sz,90),R=function(t,e){g(t,e)},z=[v(),b(),o("flip-horizontally","Flip horizontally",(function(t){R(t,A)}),!1),o("flip-vertically","Flip vertically",(function(t){R(t,D)}),!1),o("rotate-left","Rotate counterclockwise",(function(t){R(t,M)}),!1),o("rotate-right","Rotate clockwise",(function(t){R(t,N)}),!1),b(),y()],B=jE.sketch({dom:c,components:z.map((function(t){return t.asSpec()})),containerBehaviours:Fl([Sy("image-tools-fliprotate-buttons-events",[wi(hB.disable(),(function(t,e){u(z,t)})),wi(hB.enable(),(function(t,e){a(z,t)}))])])}),P=function(t,e,r,o,u){var a=aN.parts.label({dom:{tag:"label",classes:["tox-label"],innerHtml:n.translate(t)}}),c=aN.parts.spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}}),s=aN.parts.thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});return Qw(aN.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:r,maxX:u,getInitialValue:i({x:o})},components:[a,c,s],sliderBehaviours:Fl([Ny.config({})]),onChoose:e}))},I=function(t,e,n,r,o){var i=function(t,n,r){var o=_(e,r.x/100);m(t,o)};return P(t,i,n,r,o)},H=function(t,e,n,r,o){return[v(),I(t,e,n,r,o),y()]},L=function(t,e,n,r,o){var i=H(t,e,n,r,o);return jE.sketch({dom:c,components:i.map((function(t){return t.asSpec()})),containerBehaviours:Fl([Sy("image-tools-filter-panel-buttons-events",[wi(hB.disable(),(function(t,e){u(i,t)})),wi(hB.enable(),(function(t,e){a(i,t)}))])])})},F=[v(),b(),y()],V=jE.sketch({dom:c,components:F.map((function(t){return t.asSpec()}))}),U=L("Brightness",oz,-100,0,100),j=L("Contrast",iz,-100,0,100),W=L("Gamma",nz,-100,0,100),q=function(t,e,n){return function(r){return rz(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=Kg.getValue(e).x/100,i=Kg.getValue(r).x/100,u=Kg.getValue(n).x/100,a=q(o,i,u);m(t,a)}))}))}))};return P(t,e,0,100,200)},G=$("R"),K=$("G"),X=$("B"),Y=[v(),G,K,X,y()],J=jE.sketch({dom:c,components:Y.map((function(t){return t.asSpec()}))}),Q=function(t,e,n){return function(r){var o=function(){ut.getOpt(r).each((function(e){xy.set(e,[t]),n(e)}))};l(r,fB.swap(),{transform:e,swap:o})}},Z=function(e){t.showCrop()},tt=function(e){k.getOpt(e).each((function(e){var n=t.getMeasurements(),r=n.width,o=n.height;Kg.setValue(e,{width:r,height:o})}))},et=x.some(ez),nt=x.some(tz),rt=[o("crop","Crop",Q(S,x.none(),Z),!1),o("resize","Resize",Q(E,x.none(),tt),!1),o("orientation","Orientation",Q(B,x.none(),s),!1),o("brightness","Brightness",Q(U,x.none(),s),!1),o("sharpen","Sharpen",Q(V,et,s),!1),o("contrast","Contrast",Q(j,x.none(),s),!1),o("color-levels","Color levels",Q(J,x.none(),s),!1),o("gamma","Gamma",Q(W,x.none(),s),!1),o("invert","Invert",Q(V,nt,s),!1)],ot=jE.sketch({dom:c,components:rt.map((function(t){return t.asSpec()}))}),it=jE.sketch({dom:{tag:"div"},components:[ot],containerBehaviours:Fl([xy.config({})])}),ut=Qw(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}},vB=tinymce.util.Tools.resolve("tinymce.geom.Rect"),bB=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),yB=tinymce.util.Tools.resolve("tinymce.util.Observable"),wB=tinymce.util.Tools.resolve("tinymce.util.VK");function xB(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").css({position:"absolute",top:0,left:0,width:f.width,height:f.height,zIndex:2147483647,opacity:1e-4,cursor:c}).appendTo(u.body),bB(u).on("mousemove touchmove",s).on("mouseup touchend",l),e.start(t)},s=function(t){if(CB(t),t.button!==r)return l(t);t.deltaX=t.screenX-o,t.deltaY=t.screenY-i,t.preventDefault(),e.drag(t)},l=function(t){CB(t),bB(u).off("mousemove touchmove",s).off("mouseup touchend",l),n.remove(),e.stop&&e.stop(t)};this.destroy=function(){bB(a).off()},bB(a).on("mousedown touchstart",c)}var kB=0,OB=function(t,e,n,r,o){var i,u="tox-",a=u+"crid-"+kB++,c=[{name:"move",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:0,deltaH:0,label:"Crop Mask"},{name:"nw",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:-1,deltaH:-1,label:"Top Left Crop Handle"},{name:"ne",xMul:1,yMul:0,deltaX:0,deltaY:1,deltaW:1,deltaH:-1,label:"Top Right Crop Handle"},{name:"sw",xMul:0,yMul:1,deltaX:1,deltaY:0,deltaW:-1,deltaH:1,label:"Bottom Left Crop Handle"},{name:"se",xMul:1,yMul:1,deltaX:0,deltaY:0,deltaW:1,deltaH:1,label:"Bottom Right Crop Handle"}],s=["top","right","bottom","left"],l=function(t,e){return{x:e.x+t.x,y:e.y+t.y,w:e.w,h:e.h}},f=function(t,e){return{x:e.x-t.x,y:e.y-t.y,w:e.w,h:e.h}},d=function(){return f(n,t)};function m(e,r,o,i){var u,a,c,s,l;u=r.x,a=r.y,c=r.w,s=r.h,u+=o*e.deltaX,a+=i*e.deltaY,c+=o*e.deltaW,s+=i*e.deltaH,c<20&&(c=20),s<20&&(s=20),l=t=vB.clamp({x:u,y:a,w:c,h:s},n,"move"===e.name),l=f(n,l),C.fire("updateRect",{rect:l}),y(l)}function g(){function e(e){var n;return new SB(a,{document:r.ownerDocument,handle:a+"-"+e.name,start:function(){n=t},drag:function(t){m(e,n,t.deltaX,t.deltaY)}})}bB('
').appendTo(r),zN.each(s,(function(t){bB("#"+a,r).append('