json-object-editor
Version:
JOE the Json Object Editor | Platform Edition
4 lines • 453 kB
JavaScript
/**
* TinyMCE version 7.8.0 (TBD)
*/
!function(){"use strict";const e=Object.getPrototypeOf,t=(e,t,o)=>{var n;return!!o(e,t.prototype)||(null===(n=e.constructor)||void 0===n?void 0:n.name)===t.name},o=e=>o=>(e=>{const o=typeof e;return null===e?"null":"object"===o&&Array.isArray(e)?"array":"object"===o&&t(e,String,((e,t)=>t.isPrototypeOf(e)))?"string":o})(o)===e,n=e=>t=>typeof t===e,s=e=>t=>e===t,r=o("string"),a=o("object"),i=o=>((o,n)=>a(o)&&t(o,n,((t,o)=>e(t)===o)))(o,Object),l=o("array"),c=s(null),d=n("boolean"),u=s(void 0),m=e=>null==e,g=e=>!m(e),p=n("function"),h=n("number"),f=(e,t)=>{if(l(e)){for(let o=0,n=e.length;o<n;++o)if(!t(e[o]))return!1;return!0}return!1},b=()=>{},v=e=>()=>e(),x=(e,t)=>(...o)=>e(t.apply(null,o)),y=e=>()=>e,w=e=>e,S=(e,t)=>e===t;function C(e,...t){return(...o)=>{const n=t.concat(o);return e.apply(null,n)}}const k=e=>t=>!e(t),O=e=>()=>{throw new Error(e)},_=e=>e(),T=y(!1),E=y(!0);class A{constructor(e,t){this.tag=e,this.value=t}static some(e){return new A(!0,e)}static none(){return A.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?A.some(e(this.value)):A.none()}bind(e){return this.tag?e(this.value):A.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:A.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return g(e)?A.some(e):A.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}A.singletonNone=new A(!1);const M=Array.prototype.slice,D=Array.prototype.indexOf,B=Array.prototype.push,I=(e,t)=>D.call(e,t),F=(e,t)=>I(e,t)>-1,R=(e,t)=>{for(let o=0,n=e.length;o<n;o++)if(t(e[o],o))return!0;return!1},N=(e,t)=>{const o=[];for(let n=0;n<e;n++)o.push(t(n));return o},z=(e,t)=>{const o=[];for(let n=0;n<e.length;n+=t){const s=M.call(e,n,n+t);o.push(s)}return o},L=(e,t)=>{const o=e.length,n=new Array(o);for(let s=0;s<o;s++){const o=e[s];n[s]=t(o,s)}return n},V=(e,t)=>{for(let o=0,n=e.length;o<n;o++)t(e[o],o)},H=(e,t)=>{const o=[],n=[];for(let s=0,r=e.length;s<r;s++){const r=e[s];(t(r,s)?o:n).push(r)}return{pass:o,fail:n}},P=(e,t)=>{const o=[];for(let n=0,s=e.length;n<s;n++){const s=e[n];t(s,n)&&o.push(s)}return o},U=(e,t,o)=>(((e,t)=>{for(let o=e.length-1;o>=0;o--)t(e[o],o)})(e,((e,n)=>{o=t(o,e,n)})),o),W=(e,t,o)=>(V(e,((e,n)=>{o=t(o,e,n)})),o),$=(e,t)=>((e,t,o)=>{for(let n=0,s=e.length;n<s;n++){const s=e[n];if(t(s,n))return A.some(s);if(o(s,n))break}return A.none()})(e,t,T),G=(e,t)=>{for(let o=0,n=e.length;o<n;o++)if(t(e[o],o))return A.some(o);return A.none()},j=e=>{const t=[];for(let o=0,n=e.length;o<n;++o){if(!l(e[o]))throw new Error("Arr.flatten item "+o+" was not an array, input: "+e);B.apply(t,e[o])}return t},q=(e,t)=>j(L(e,t)),X=(e,t)=>{for(let o=0,n=e.length;o<n;++o)if(!0!==t(e[o],o))return!1;return!0},Y=e=>{const t=M.call(e,0);return t.reverse(),t},K=(e,t)=>P(e,(e=>!F(t,e))),J=(e,t)=>{const o={};for(let n=0,s=e.length;n<s;n++){const s=e[n];o[String(s)]=t(s,n)}return o},Q=e=>[e],Z=(e,t)=>{const o=M.call(e,0);return o.sort(t),o},ee=(e,t)=>t>=0&&t<e.length?A.some(e[t]):A.none(),te=e=>ee(e,0),oe=e=>ee(e,e.length-1),ne=p(Array.from)?Array.from:e=>M.call(e),se=(e,t)=>{for(let o=0;o<e.length;o++){const n=t(e[o],o);if(n.isSome())return n}return A.none()},re=Object.keys,ae=Object.hasOwnProperty,ie=(e,t)=>{const o=re(e);for(let n=0,s=o.length;n<s;n++){const s=o[n];t(e[s],s)}},le=(e,t)=>ce(e,((e,o)=>({k:o,v:t(e,o)}))),ce=(e,t)=>{const o={};return ie(e,((e,n)=>{const s=t(e,n);o[s.k]=s.v})),o},de=e=>(t,o)=>{e[o]=t},ue=(e,t,o,n)=>{ie(e,((e,s)=>{(t(e,s)?o:n)(e,s)}))},me=(e,t)=>{const o={};return ue(e,t,de(o),b),o},ge=(e,t)=>{const o=[];return ie(e,((e,n)=>{o.push(t(e,n))})),o},pe=(e,t)=>{const o=re(e);for(let n=0,s=o.length;n<s;n++){const s=o[n],r=e[s];if(t(r,s,e))return A.some(r)}return A.none()},he=e=>ge(e,w),fe=(e,t)=>be(e,t)?A.from(e[t]):A.none(),be=(e,t)=>ae.call(e,t),ve=(e,t)=>be(e,t)&&void 0!==e[t]&&null!==e[t],xe=(e,t,o=S)=>e.exists((e=>o(e,t))),ye=e=>{const t=[],o=e=>{t.push(e)};for(let t=0;t<e.length;t++)e[t].each(o);return t},we=(e,t,o)=>e.isSome()&&t.isSome()?A.some(o(e.getOrDie(),t.getOrDie())):A.none(),Se=(e,t)=>null!=e?A.some(t(e)):A.none(),Ce=(e,t)=>e?A.some(t):A.none(),ke=(e,t,o)=>""===t||e.length>=t.length&&e.substr(o,o+t.length)===t,Oe=(e,t)=>Te(e,t)?((e,t)=>e.substring(t))(e,t.length):e,_e=(e,t,o=0,n)=>{const s=e.indexOf(t,o);return-1!==s&&(!!u(n)||s+t.length<=n)},Te=(e,t)=>ke(e,t,0),Ee=(e,t)=>ke(e,t,e.length-t.length),Ae=(Eo=/^\s+|\s+$/g,e=>e.replace(Eo,"")),Me=e=>e.length>0,De=e=>!Me(e),Be=e=>void 0!==e.style&&p(e.style.getPropertyValue),Ie=e=>{if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},Fe=(e,t)=>{const o=(t||document).createElement("div");if(o.innerHTML=e,!o.hasChildNodes()||o.childNodes.length>1){const t="HTML does not have a single root node";throw console.error(t,e),new Error(t)}return Ie(o.childNodes[0])},Re=(e,t)=>{const o=(t||document).createElement(e);return Ie(o)},Ne=(e,t)=>{const o=(t||document).createTextNode(e);return Ie(o)},ze=Ie,Le="undefined"!=typeof window?window:Function("return this;")(),Ve=(e,t)=>((e,t)=>{let o=null!=t?t:Le;for(let t=0;t<e.length&&null!=o;++t)o=o[e[t]];return o})(e.split("."),t),He=Object.getPrototypeOf,Pe=e=>{const t=Ve("ownerDocument.defaultView",e);return a(e)&&((e=>((e,t)=>{const o=((e,t)=>Ve(e,t))(e,t);if(null==o)throw new Error(e+" not available on this browser");return o})("HTMLElement",e))(t).prototype.isPrototypeOf(e)||/^HTML\w*Element$/.test(He(e).constructor.name))},Ue=e=>e.dom.nodeName.toLowerCase(),We=e=>t=>(e=>e.dom.nodeType)(t)===e,$e=e=>Ge(e)&&Pe(e.dom),Ge=We(1),je=We(3),qe=We(9),Xe=We(11),Ye=e=>t=>Ge(t)&&Ue(t)===e,Ke=(e,t)=>{const o=e.dom;if(1!==o.nodeType)return!1;{const e=o;if(void 0!==e.matches)return e.matches(t);if(void 0!==e.msMatchesSelector)return e.msMatchesSelector(t);if(void 0!==e.webkitMatchesSelector)return e.webkitMatchesSelector(t);if(void 0!==e.mozMatchesSelector)return e.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")}},Je=e=>1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType||0===e.childElementCount,Qe=(e,t)=>{const o=void 0===t?document:t.dom;return Je(o)?A.none():A.from(o.querySelector(e)).map(ze)},Ze=(e,t)=>e.dom===t.dom,et=(e,t)=>{const o=e.dom,n=t.dom;return o!==n&&o.contains(n)},tt=e=>ze(e.dom.ownerDocument),ot=e=>qe(e)?e:tt(e),nt=e=>ze(ot(e).dom.documentElement),st=e=>ze(ot(e).dom.defaultView),rt=e=>A.from(e.dom.parentNode).map(ze),at=e=>A.from(e.dom.parentElement).map(ze),it=e=>A.from(e.dom.offsetParent).map(ze),lt=e=>L(e.dom.childNodes,ze),ct=(e,t)=>{const o=e.dom.childNodes;return A.from(o[t]).map(ze)},dt=e=>ct(e,0),ut=(e,t)=>({element:e,offset:t}),mt=(e,t)=>{const o=lt(e);return o.length>0&&t<o.length?ut(o[t],0):ut(e,t)},gt=e=>Xe(e)&&g(e.dom.host),pt=e=>ze(e.dom.getRootNode()),ht=e=>gt(e)?e:ze(ot(e).dom.body),ft=e=>{const t=pt(e);return gt(t)?A.some(t):A.none()},bt=e=>ze(e.dom.host),vt=e=>{const t=je(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return!1;const o=t.ownerDocument;return ft(ze(t)).fold((()=>o.body.contains(t)),(n=vt,s=bt,e=>n(s(e))));var n,s},xt=()=>yt(ze(document)),yt=e=>{const t=e.dom.body;if(null==t)throw new Error("Body is not available yet");return ze(t)},wt=(e,t,o)=>{if(!(r(o)||d(o)||h(o)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",o,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,o+"")},St=(e,t,o)=>{wt(e.dom,t,o)},Ct=(e,t)=>{const o=e.dom;ie(t,((e,t)=>{wt(o,t,e)}))},kt=(e,t)=>{const o=e.dom.getAttribute(t);return null===o?void 0:o},Ot=(e,t)=>A.from(kt(e,t)),_t=(e,t)=>{const o=e.dom;return!(!o||!o.hasAttribute)&&o.hasAttribute(t)},Tt=(e,t)=>{e.dom.removeAttribute(t)},Et=(e,t,o)=>{if(!r(o))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",o,":: Element ",e),new Error("CSS value must be a string: "+o);Be(e)&&e.style.setProperty(t,o)},At=(e,t)=>{Be(e)&&e.style.removeProperty(t)},Mt=(e,t,o)=>{const n=e.dom;Et(n,t,o)},Dt=(e,t)=>{const o=e.dom;ie(t,((e,t)=>{Et(o,t,e)}))},Bt=(e,t)=>{const o=e.dom;ie(t,((e,t)=>{e.fold((()=>{At(o,t)}),(e=>{Et(o,t,e)}))}))},It=(e,t)=>{const o=e.dom,n=window.getComputedStyle(o).getPropertyValue(t);return""!==n||vt(e)?n:Ft(o,t)},Ft=(e,t)=>Be(e)?e.style.getPropertyValue(t):"",Rt=(e,t)=>{const o=e.dom,n=Ft(o,t);return A.from(n).filter((e=>e.length>0))},Nt=e=>{const t={},o=e.dom;if(Be(o))for(let e=0;e<o.style.length;e++){const n=o.style.item(e);t[n]=o.style[n]}return t},zt=(e,t,o)=>{const n=Re(e);return Mt(n,t,o),Rt(n,t).isSome()},Lt=(e,t)=>{const o=e.dom;At(o,t),xe(Ot(e,"style").map(Ae),"")&&Tt(e,"style")},Vt=e=>e.dom.offsetWidth,Ht=(e,t)=>{const o=o=>{const n=t(o);if(n<=0||null===n){const t=It(o,e);return parseFloat(t)||0}return n},n=(e,t)=>W(t,((t,o)=>{const n=It(e,o),s=void 0===n?0:parseInt(n,10);return isNaN(s)?t:t+s}),0);return{set:(t,o)=>{if(!h(o)&&!o.match(/^[0-9]+$/))throw new Error(e+".set accepts only positive integer values. Value was "+o);const n=t.dom;Be(n)&&(n.style[e]=o+"px")},get:o,getOuter:o,aggregate:n,max:(e,t,o)=>{const s=n(e,o);return t>s?t-s:0}}},Pt=Ht("height",(e=>{const t=e.dom;return vt(e)?t.getBoundingClientRect().height:t.offsetHeight})),Ut=e=>Pt.get(e),Wt=e=>Pt.getOuter(e),$t=(e,t)=>({left:e,top:t,translate:(o,n)=>$t(e+o,t+n)}),Gt=$t,jt=(e,t)=>void 0!==e?e:void 0!==t?t:0,qt=e=>{const t=e.dom.ownerDocument,o=t.body,n=t.defaultView,s=t.documentElement;if(o===e.dom)return Gt(o.offsetLeft,o.offsetTop);const r=jt(null==n?void 0:n.pageYOffset,s.scrollTop),a=jt(null==n?void 0:n.pageXOffset,s.scrollLeft),i=jt(s.clientTop,o.clientTop),l=jt(s.clientLeft,o.clientLeft);return Xt(e).translate(a-l,r-i)},Xt=e=>{const t=e.dom,o=t.ownerDocument.body;return o===t?Gt(o.offsetLeft,o.offsetTop):vt(e)?(e=>{const t=e.getBoundingClientRect();return Gt(t.left,t.top)})(t):Gt(0,0)},Yt=Ht("width",(e=>e.dom.offsetWidth)),Kt=e=>Yt.get(e),Jt=e=>Yt.getOuter(e),Qt=e=>{let t,o=!1;return(...n)=>(o||(o=!0,t=e.apply(null,n)),t)},Zt=()=>eo(0,0),eo=(e,t)=>({major:e,minor:t}),to={nu:eo,detect:(e,t)=>{const o=String(t).toLowerCase();return 0===e.length?Zt():((e,t)=>{const o=((e,t)=>{for(let o=0;o<e.length;o++){const n=e[o];if(n.test(t))return n}})(e,t);if(!o)return{major:0,minor:0};const n=e=>Number(t.replace(o,"$"+e));return eo(n(1),n(2))})(e,o)},unknown:Zt},oo=(e,t)=>{const o=String(t).toLowerCase();return $(e,(e=>e.search(o)))},no=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,so=e=>t=>_e(t,e),ro=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:e=>_e(e,"edge/")&&_e(e,"chrome")&&_e(e,"safari")&&_e(e,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,no],search:e=>_e(e,"chrome")&&!_e(e,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:e=>_e(e,"msie")||_e(e,"trident")},{name:"Opera",versionRegexes:[no,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:so("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:so("firefox")},{name:"Safari",versionRegexes:[no,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:e=>(_e(e,"safari")||_e(e,"mobile/"))&&_e(e,"applewebkit")}],ao=[{name:"Windows",search:so("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:e=>_e(e,"iphone")||_e(e,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:so("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:so("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:so("linux"),versionRegexes:[]},{name:"Solaris",search:so("sunos"),versionRegexes:[]},{name:"FreeBSD",search:so("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:so("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],io={browsers:y(ro),oses:y(ao)},lo="Edge",co="Chromium",uo="Opera",mo="Firefox",go="Safari",po=e=>{const t=e.current,o=e.version,n=e=>()=>t===e;return{current:t,version:o,isEdge:n(lo),isChromium:n(co),isIE:n("IE"),isOpera:n(uo),isFirefox:n(mo),isSafari:n(go)}},ho=()=>po({current:void 0,version:to.unknown()}),fo=po,bo=(y(lo),y(co),y("IE"),y(uo),y(mo),y(go),"Windows"),vo="Android",xo="Linux",yo="macOS",wo="Solaris",So="FreeBSD",Co="ChromeOS",ko=e=>{const t=e.current,o=e.version,n=e=>()=>t===e;return{current:t,version:o,isWindows:n(bo),isiOS:n("iOS"),isAndroid:n(vo),isMacOS:n(yo),isLinux:n(xo),isSolaris:n(wo),isFreeBSD:n(So),isChromeOS:n(Co)}},Oo=()=>ko({current:void 0,version:to.unknown()}),_o=ko,To=(y(bo),y("iOS"),y(vo),y(xo),y(yo),y(wo),y(So),y(Co),e=>window.matchMedia(e).matches);var Eo;let Ao=Qt((()=>((e,t,o)=>{const n=io.browsers(),s=io.oses(),r=t.bind((e=>((e,t)=>se(t.brands,(t=>{const o=t.brand.toLowerCase();return $(e,(e=>{var t;return o===(null===(t=e.brand)||void 0===t?void 0:t.toLowerCase())})).map((e=>({current:e.name,version:to.nu(parseInt(t.version,10),0)})))})))(n,e))).orThunk((()=>((e,t)=>oo(e,t).map((e=>{const o=to.detect(e.versionRegexes,t);return{current:e.name,version:o}})))(n,e))).fold(ho,fo),a=((e,t)=>oo(e,t).map((e=>{const o=to.detect(e.versionRegexes,t);return{current:e.name,version:o}})))(s,e).fold(Oo,_o),i=((e,t,o,n)=>{const s=e.isiOS()&&!0===/ipad/i.test(o),r=e.isiOS()&&!s,a=e.isiOS()||e.isAndroid(),i=a||n("(pointer:coarse)"),l=s||!r&&a&&n("(min-device-width:768px)"),c=r||a&&!l,d=t.isSafari()&&e.isiOS()&&!1===/safari/i.test(o),u=!c&&!l&&!d;return{isiPad:y(s),isiPhone:y(r),isTablet:y(l),isPhone:y(c),isTouch:y(i),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:y(d),isDesktop:y(u)}})(a,r,e,o);return{browser:r,os:a,deviceType:i}})(window.navigator.userAgent,A.from(window.navigator.userAgentData),To)));const Mo=()=>Ao(),Do=e=>{const t=ze((e=>{if(g(e.target)){const t=ze(e.target);if(Ge(t)&&(e=>g(e.dom.shadowRoot))(t)&&e.composed&&e.composedPath){const t=e.composedPath();if(t)return te(t)}}return A.from(e.target)})(e).getOr(e.target)),o=()=>e.stopPropagation(),n=()=>e.preventDefault(),s=x(n,o);return((e,t,o,n,s,r,a)=>({target:e,x:t,y:o,stop:n,prevent:s,kill:r,raw:a}))(t,e.clientX,e.clientY,o,n,s,e)},Bo=(e,t,o,n,s)=>{const r=((e,t)=>o=>{e(o)&&t(Do(o))})(o,n);return e.dom.addEventListener(t,r,s),{unbind:C(Io,e,t,r,s)}},Io=(e,t,o,n)=>{e.dom.removeEventListener(t,o,n)},Fo=(e,t)=>{rt(e).each((o=>{o.dom.insertBefore(t.dom,e.dom)}))},Ro=(e,t)=>{const o=(e=>A.from(e.dom.nextSibling).map(ze))(e);o.fold((()=>{rt(e).each((e=>{zo(e,t)}))}),(e=>{Fo(e,t)}))},No=(e,t)=>{dt(e).fold((()=>{zo(e,t)}),(o=>{e.dom.insertBefore(t.dom,o.dom)}))},zo=(e,t)=>{e.dom.appendChild(t.dom)},Lo=(e,t)=>{V(t,(t=>{zo(e,t)}))},Vo=e=>{e.dom.textContent="",V(lt(e),(e=>{Ho(e)}))},Ho=e=>{const t=e.dom;null!==t.parentNode&&t.parentNode.removeChild(t)},Po=e=>{const t=void 0!==e?e.dom:document,o=t.body.scrollLeft||t.documentElement.scrollLeft,n=t.body.scrollTop||t.documentElement.scrollTop;return Gt(o,n)},Uo=(e,t,o)=>{const n=(void 0!==o?o.dom:document).defaultView;n&&n.scrollTo(e,t)},Wo=(e,t,o,n)=>({x:e,y:t,width:o,height:n,right:e+o,bottom:t+n}),$o=e=>{const t=void 0===e?window:e,o=t.document,n=Po(ze(o));return(e=>{const t=void 0===e?window:e;return Mo().browser.isFirefox()?A.none():A.from(t.visualViewport)})(t).fold((()=>{const e=t.document.documentElement,o=e.clientWidth,s=e.clientHeight;return Wo(n.left,n.top,o,s)}),(e=>Wo(Math.max(e.pageLeft,n.left),Math.max(e.pageTop,n.top),e.width,e.height)))},Go=()=>ze(document),jo=(e,t)=>e.view(t).fold(y([]),(t=>{const o=e.owner(t),n=jo(e,o);return[t].concat(n)}));var qo=Object.freeze({__proto__:null,view:e=>{var t;return(e.dom===document?A.none():A.from(null===(t=e.dom.defaultView)||void 0===t?void 0:t.frameElement)).map(ze)},owner:e=>tt(e)});const Xo=e=>{const t=Go(),o=Po(t),n=((e,t)=>{const o=t.owner(e),n=jo(t,o);return A.some(n)})(e,qo);return n.fold(C(qt,e),(t=>{const n=Xt(e),s=U(t,((e,t)=>{const o=Xt(t);return{left:e.left+o.left,top:e.top+o.top}}),{left:0,top:0});return Gt(s.left+n.left+o.left,s.top+n.top+o.top)}))},Yo=(e,t,o,n)=>({x:e,y:t,width:o,height:n,right:e+o,bottom:t+n}),Ko=e=>{const t=qt(e),o=Jt(e),n=Wt(e);return Yo(t.left,t.top,o,n)},Jo=e=>{const t=Xo(e),o=Jt(e),n=Wt(e);return Yo(t.left,t.top,o,n)},Qo=(e,t)=>{const o=Math.max(e.x,t.x),n=Math.max(e.y,t.y),s=Math.min(e.right,t.right),r=Math.min(e.bottom,t.bottom);return Yo(o,n,s-o,r-n)},Zo=()=>$o(window),en=e=>{let t=e;return{get:()=>t,set:e=>{t=e}}},tn=e=>{const t=en(A.none()),o=()=>t.get().each(e);return{clear:()=>{o(),t.set(A.none())},isSet:()=>t.get().isSome(),get:()=>t.get(),set:e=>{o(),t.set(A.some(e))}}},on=()=>tn((e=>e.unbind())),nn=()=>{const e=tn(b);return{...e,on:t=>e.get().each(t)}};var sn=(e,t,o,n,s)=>e(o,n)?A.some(o):p(s)&&s(o)?A.none():t(o,n,s);const rn=(e,t,o)=>{let n=e.dom;const s=p(o)?o:T;for(;n.parentNode;){n=n.parentNode;const e=ze(n);if(t(e))return A.some(e);if(s(e))break}return A.none()},an=(e,t,o)=>sn(((e,t)=>t(e)),rn,e,t,o),ln=(e,t)=>$(e.dom.childNodes,(e=>t(ze(e)))).map(ze),cn=(e,t,o)=>rn(e,(e=>Ke(e,t)),o),dn=(e,t)=>(e=>{const o=e.dom;return o.parentNode?ln(ze(o.parentNode),(o=>!Ze(e,o)&&Ke(o,t))):A.none()})(e),un=(e,t)=>ln(e,(e=>Ke(e,t))),mn=(e,t)=>Qe(t,e),gn=(e,t,o)=>sn(((e,t)=>Ke(e,t)),cn,e,t,o);var pn=tinymce.util.Tools.resolve("tinymce.ThemeManager");const hn=e=>{const t=t=>t(e),o=y(e),n=()=>s,s={tag:!0,inner:e,fold:(t,o)=>o(e),isValue:E,isError:T,map:t=>bn.value(t(e)),mapError:n,bind:t,exists:t,forall:t,getOr:o,or:n,getOrThunk:o,orThunk:n,getOrDie:o,each:t=>{t(e)},toOptional:()=>A.some(e)};return s},fn=e=>{const t=()=>o,o={tag:!1,inner:e,fold:(t,o)=>t(e),isValue:T,isError:E,map:t,mapError:t=>bn.error(t(e)),bind:t,exists:T,forall:E,getOr:w,or:w,getOrThunk:_,orThunk:_,getOrDie:O(String(e)),each:b,toOptional:A.none};return o},bn={value:hn,error:fn,fromOption:(e,t)=>e.fold((()=>fn(t)),hn)};var vn;!function(e){e[e.Error=0]="Error",e[e.Value=1]="Value"}(vn||(vn={}));const xn=(e,t,o)=>e.stype===vn.Error?t(e.serror):o(e.svalue),yn=e=>({stype:vn.Value,svalue:e}),wn=e=>({stype:vn.Error,serror:e}),Sn=yn,Cn=wn,kn=xn,On=(e,t,o,n)=>({tag:"field",key:e,newKey:t,presence:o,prop:n}),_n=(e,t,o)=>{switch(e.tag){case"field":return t(e.key,e.newKey,e.presence,e.prop);case"custom":return o(e.newKey,e.instantiator)}},Tn=e=>(...t)=>{if(0===t.length)throw new Error("Can't merge zero objects");const o={};for(let n=0;n<t.length;n++){const s=t[n];for(const t in s)be(s,t)&&(o[t]=e(o[t],s[t]))}return o},En=Tn(((e,t)=>i(e)&&i(t)?En(e,t):t)),An=Tn(((e,t)=>t)),Mn=e=>({tag:"defaultedThunk",process:e}),Dn=e=>Mn(y(e)),Bn=e=>({tag:"mergeWithThunk",process:e}),In=e=>{const t=(e=>{const t=[],o=[];return V(e,(e=>{xn(e,(e=>o.push(e)),(e=>t.push(e)))})),{values:t,errors:o}})(e);return t.errors.length>0?(o=t.errors,x(Cn,j)(o)):Sn(t.values);var o},Fn=e=>a(e)&&re(e).length>100?" removed due to size":JSON.stringify(e,null,2),Rn=(e,t)=>Cn([{path:e,getErrorInfo:t}]),Nn=e=>({extract:(t,o)=>((e,t)=>e.stype===vn.Error?t(e.serror):e)(e(o),(e=>((e,t)=>Rn(e,y(t)))(t,e))),toString:y("val")}),zn=Nn(Sn),Ln=(e,t,o,n)=>n(fe(e,t).getOrThunk((()=>o(e)))),Vn=(e,t,o,n,s)=>{const r=e=>s.extract(t.concat([n]),e),a=e=>e.fold((()=>Sn(A.none())),(e=>((e,t)=>e.stype===vn.Value?{stype:vn.Value,svalue:t(e.svalue)}:e)(s.extract(t.concat([n]),e),A.some)));switch(e.tag){case"required":return((e,t,o,n)=>fe(t,o).fold((()=>((e,t,o)=>Rn(e,(()=>'Could not find valid *required* value for "'+t+'" in '+Fn(o))))(e,o,t)),n))(t,o,n,r);case"defaultedThunk":return Ln(o,n,e.process,r);case"option":return((e,t,o)=>o(fe(e,t)))(o,n,a);case"defaultedOptionThunk":return((e,t,o,n)=>n(fe(e,t).map((t=>!0===t?o(e):t))))(o,n,e.process,a);case"mergeWithThunk":return Ln(o,n,y({}),(t=>{const n=En(e.process(o),t);return r(n)}))}},Hn=e=>({extract:(t,o)=>e().extract(t,o),toString:()=>e().toString()}),Pn=e=>re(me(e,g)),Un=e=>{const t=Wn(e),o=U(e,((e,t)=>_n(t,(t=>En(e,{[t]:!0})),y(e))),{});return{extract:(e,n)=>{const s=d(n)?[]:Pn(n),r=P(s,(e=>!ve(o,e)));return 0===r.length?t.extract(e,n):((e,t)=>Rn(e,(()=>"There are unsupported fields: ["+t.join(", ")+"] specified")))(e,r)},toString:t.toString}},Wn=e=>({extract:(t,o)=>((e,t,o)=>{const n={},s=[];for(const r of o)_n(r,((o,r,a,i)=>{const l=Vn(a,e,t,o,i);kn(l,(e=>{s.push(...e)}),(e=>{n[r]=e}))}),((e,o)=>{n[e]=o(t)}));return s.length>0?Cn(s):Sn(n)})(t,o,e),toString:()=>"obj{\n"+L(e,(e=>_n(e,((e,t,o,n)=>e+" -> "+n.toString()),((e,t)=>"state("+e+")")))).join("\n")+"}"}),$n=e=>({extract:(t,o)=>{const n=L(o,((o,n)=>e.extract(t.concat(["["+n+"]"]),o)));return In(n)},toString:()=>"array("+e.toString()+")"}),Gn=(e,t)=>{const o=void 0!==t?t:w;return{extract:(t,n)=>{const s=[];for(const r of e){const e=r.extract(t,n);if(e.stype===vn.Value)return{stype:vn.Value,svalue:o(e.svalue)};s.push(e)}return In(s)},toString:()=>"oneOf("+L(e,(e=>e.toString())).join(", ")+")"}},jn=(e,t)=>({extract:(o,n)=>{const s=re(n),r=((t,o)=>$n(Nn(e)).extract(t,o))(o,s);return((e,t)=>e.stype===vn.Value?t(e.svalue):e)(r,(e=>{const s=L(e,(e=>On(e,e,{tag:"required",process:{}},t)));return Wn(s).extract(o,n)}))},toString:()=>"setOf("+t.toString()+")"}),qn=x($n,Wn),Xn=y(zn),Yn=(e,t)=>Nn((o=>{const n=typeof o;return e(o)?Sn(o):Cn(`Expected type: ${t} but got: ${n}`)})),Kn=Yn(h,"number"),Jn=Yn(r,"string"),Qn=Yn(d,"boolean"),Zn=Yn(p,"function"),es=e=>{if(Object(e)!==e)return!0;switch({}.toString.call(e).slice(8,-1)){case"Boolean":case"Number":case"String":case"Date":case"RegExp":case"Blob":case"FileList":case"ImageData":case"ImageBitmap":case"ArrayBuffer":return!0;case"Array":case"Object":return Object.keys(e).every((t=>es(e[t])));default:return!1}},ts=Nn((e=>es(e)?Sn(e):Cn("Expected value to be acceptable for sending via postMessage"))),os=(e,t)=>({extract:(o,n)=>fe(n,e).fold((()=>((e,t)=>Rn(e,(()=>'Choice schema did not contain choice key: "'+t+'"')))(o,e)),(e=>((e,t,o,n)=>fe(o,n).fold((()=>((e,t,o)=>Rn(e,(()=>'The chosen schema: "'+o+'" did not exist in branches: '+Fn(t))))(e,o,n)),(o=>o.extract(e.concat(["branch: "+n]),t))))(o,n,t,e))),toString:()=>"chooseOn("+e+"). Possible values: "+re(t)}),ns=e=>Nn((t=>e(t).fold(Cn,Sn))),ss=(e,t)=>jn((t=>e(t).fold(wn,yn)),t),rs=(e,t,o)=>{return n=((e,t,o)=>((e,t)=>e.stype===vn.Error?{stype:vn.Error,serror:t(e.serror)}:e)(t.extract([e],o),(e=>({input:o,errors:e}))))(e,t,o),xn(n,bn.error,bn.value);var n},as=e=>e.fold((e=>{throw new Error(ls(e))}),w),is=(e,t,o)=>as(rs(e,t,o)),ls=e=>"Errors: \n"+(e=>{const t=e.length>10?e.slice(0,10).concat([{path:[],getErrorInfo:y("... (only showing first ten failures)")}]):e;return L(t,(e=>"Failed path: ("+e.path.join(" > ")+")\n"+e.getErrorInfo()))})(e.errors).join("\n")+"\n\nInput object: "+Fn(e.input),cs=(e,t)=>os(e,le(t,Wn)),ds=(e,t)=>((e,t)=>{const o=Qt(t);return{extract:(e,t)=>o().extract(e,t),toString:()=>o().toString()}})(0,t),us=On,ms=(e,t)=>({tag:"custom",newKey:e,instantiator:t}),gs=e=>ns((t=>F(e,t)?bn.value(t):bn.error(`Unsupported value: "${t}", choose one of "${e.join(", ")}".`))),ps=e=>us(e,e,{tag:"required",process:{}},Xn()),hs=(e,t)=>us(e,e,{tag:"required",process:{}},t),fs=e=>hs(e,Kn),bs=e=>hs(e,Jn),vs=(e,t)=>us(e,e,{tag:"required",process:{}},gs(t)),xs=e=>hs(e,Zn),ys=(e,t)=>us(e,e,{tag:"required",process:{}},Wn(t)),ws=(e,t)=>us(e,e,{tag:"required",process:{}},qn(t)),Ss=(e,t)=>us(e,e,{tag:"required",process:{}},$n(t)),Cs=e=>us(e,e,{tag:"option",process:{}},Xn()),ks=(e,t)=>us(e,e,{tag:"option",process:{}},t),Os=e=>ks(e,Kn),_s=e=>ks(e,Jn),Ts=(e,t)=>ks(e,gs(t)),Es=e=>ks(e,Zn),As=(e,t)=>ks(e,$n(t)),Ms=(e,t)=>ks(e,Wn(t)),Ds=(e,t)=>us(e,e,Dn(t),Xn()),Bs=(e,t,o)=>us(e,e,Dn(t),o),Is=(e,t)=>Bs(e,t,Kn),Fs=(e,t)=>Bs(e,t,Jn),Rs=(e,t,o)=>Bs(e,t,gs(o)),Ns=(e,t)=>Bs(e,t,Qn),zs=(e,t)=>Bs(e,t,Zn),Ls=(e,t,o)=>Bs(e,t,$n(o)),Vs=(e,t,o)=>Bs(e,t,Wn(o)),Hs=e=>{if(!l(e))throw new Error("cases must be an array");if(0===e.length)throw new Error("there must be at least one case");const t=[],o={};return V(e,((n,s)=>{const r=re(n);if(1!==r.length)throw new Error("one and only one name per case");const a=r[0],i=n[a];if(void 0!==o[a])throw new Error("duplicate key detected:"+a);if("cata"===a)throw new Error("cannot have a case named cata (sorry)");if(!l(i))throw new Error("case arguments must be an array");t.push(a),o[a]=(...o)=>{const n=o.length;if(n!==i.length)throw new Error("Wrong number of arguments to case "+a+". Expected "+i.length+" ("+i+"), got "+n);return{fold:(...t)=>{if(t.length!==e.length)throw new Error("Wrong number of arguments to fold. Expected "+e.length+", got "+t.length);return t[s].apply(null,o)},match:e=>{const n=re(e);if(t.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+t.join(",")+"\nActual: "+n.join(","));if(!X(t,(e=>F(n,e))))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+t.join(", "));return e[a].apply(null,o)},log:e=>{console.log(e,{constructors:t,constructor:a,params:o})}}}})),o};Hs([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);const Ps=(e,t)=>((e,t)=>({[e]:t}))(e,t),Us=e=>(e=>{const t={};return V(e,(e=>{t[e.key]=e.value})),t})(e),Ws=e=>p(e)?e:T,$s=(e,t,o)=>{let n=e.dom;const s=Ws(o);for(;n.parentNode;){n=n.parentNode;const e=ze(n),o=t(e);if(o.isSome())return o;if(s(e))break}return A.none()},Gs=(e,t,o)=>{const n=t(e),s=Ws(o);return n.orThunk((()=>s(e)?A.none():$s(e,t,s)))},js=(e,t)=>Ze(e.element,t.event.target),qs={can:E,abort:T,run:b},Xs=e=>{if(!ve(e,"can")&&!ve(e,"abort")&&!ve(e,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(e,null,2)+" does not have can, abort, or run!");return{...qs,...e}},Ys=y,Ks=Ys("touchstart"),Js=Ys("touchmove"),Qs=Ys("touchend"),Zs=Ys("touchcancel"),er=Ys("mousedown"),tr=Ys("mousemove"),or=Ys("mouseout"),nr=Ys("mouseup"),sr=Ys("mouseover"),rr=Ys("focusin"),ar=Ys("focusout"),ir=Ys("keydown"),lr=Ys("keyup"),cr=Ys("input"),dr=Ys("change"),ur=Ys("click"),mr=Ys("transitioncancel"),gr=Ys("transitionend"),pr=Ys("transitionstart"),hr=Ys("selectstart"),fr=e=>y("alloy."+e),br={tap:fr("tap")},vr=fr("focus"),xr=fr("blur.post"),yr=fr("paste.post"),wr=fr("receive"),Sr=fr("execute"),Cr=fr("focus.item"),kr=br.tap,Or=fr("longpress"),_r=fr("sandbox.close"),Tr=fr("typeahead.cancel"),Er=fr("system.init"),Ar=fr("system.touchmove"),Mr=fr("system.touchend"),Dr=fr("system.scroll"),Br=fr("system.resize"),Ir=fr("system.attached"),Fr=fr("system.detached"),Rr=fr("system.dismissRequested"),Nr=fr("system.repositionRequested"),zr=fr("focusmanager.shifted"),Lr=fr("slotcontainer.visibility"),Vr=fr("system.external.element.scroll"),Hr=fr("change.tab"),Pr=fr("dismiss.tab"),Ur=fr("highlight"),Wr=fr("dehighlight"),$r=(e,t)=>{Xr(e,e.element,t,{})},Gr=(e,t,o)=>{Xr(e,e.element,t,o)},jr=e=>{$r(e,Sr())},qr=(e,t,o)=>{Xr(e,t,o,{})},Xr=(e,t,o,n)=>{const s={target:t,...n};e.getSystem().triggerEvent(o,t,s)},Yr=(e,t,o,n)=>{e.getSystem().triggerEvent(o,t,n.event)},Kr=e=>Us(e),Jr=(e,t)=>({key:e,value:Xs({abort:t})}),Qr=e=>({key:e,value:Xs({run:(e,t)=>{t.event.prevent()}})}),Zr=(e,t)=>({key:e,value:Xs({run:t})}),ea=(e,t,o)=>({key:e,value:Xs({run:(e,n)=>{t.apply(void 0,[e,n].concat(o))}})}),ta=e=>t=>({key:e,value:Xs({run:(e,o)=>{js(e,o)&&t(e,o)}})}),oa=(e,t,o)=>((e,t)=>Zr(e,((o,n)=>{o.getSystem().getByUid(t).each((t=>{Yr(t,t.element,e,n)}))})))(e,t.partUids[o]),na=(e,t)=>Zr(e,((e,o)=>{const n=o.event,s=e.getSystem().getByDom(n.target).getOrThunk((()=>Gs(n.target,(t=>e.getSystem().getByDom(t).toOptional()),T).getOr(e)));t(e,s,o)})),sa=e=>Zr(e,((e,t)=>{t.cut()})),ra=e=>Zr(e,((e,t)=>{t.stop()})),aa=(e,t)=>ta(e)(t),ia=ta(Ir()),la=ta(Fr()),ca=ta(Er()),da=(li=Sr(),e=>Zr(li,e)),ua=e=>L(e,(e=>Ee(e,"/*")?e.substring(0,e.length-2):e)),ma=(e,t)=>{const o=e.toString(),n=o.indexOf(")")+1,s=o.indexOf("("),r=o.substring(s+1,n-1).split(/,\s*/);return e.toFunctionAnnotation=()=>({name:t,parameters:ua(r)}),e},ga=e=>({classes:u(e.classes)?[]:e.classes,attributes:u(e.attributes)?{}:e.attributes,styles:u(e.styles)?{}:e.styles}),pa=(e,t,o)=>ca(((n,s)=>{o(n,e,t)})),ha=e=>({key:e,value:void 0}),fa=(e,t,o,n,s,r,a)=>{const i=e=>ve(e,o)?e[o]():A.none(),l=le(s,((e,t)=>((e,t,o)=>((e,t,o)=>{const n=o.toString(),s=n.indexOf(")")+1,r=n.indexOf("("),a=n.substring(r+1,s-1).split(/,\s*/);return e.toFunctionAnnotation=()=>({name:t,parameters:ua(a.slice(0,1).concat(a.slice(3)))}),e})(((n,...s)=>{const r=[n].concat(s);return n.config({name:y(e)}).fold((()=>{throw new Error("We could not find any behaviour configuration for: "+e+". Using API: "+o)}),(e=>{const o=Array.prototype.slice.call(r,1);return t.apply(void 0,[n,e.config,e.state].concat(o))}))}),o,t))(o,e,t))),c={...le(r,((e,t)=>ma(e,t))),...l,revoke:C(ha,o),config:t=>{const n=is(o+"-config",e,t);return{key:o,value:{config:n,me:c,configAsRaw:Qt((()=>is(o+"-config",e,t))),initialConfig:t,state:a}}},schema:y(t),exhibit:(e,t)=>we(i(e),fe(n,"exhibit"),((e,o)=>o(t,e.config,e.state))).getOrThunk((()=>ga({}))),name:y(o),handlers:e=>i(e).map((e=>fe(n,"events").getOr((()=>({})))(e.config,e.state))).getOr({})};return c},ba={init:()=>va({readState:y("No State required")})},va=e=>e,xa=e=>Us(e),ya=Un([ps("fields"),ps("name"),Ds("active",{}),Ds("apis",{}),Ds("state",ba),Ds("extra",{})]),wa=e=>{const t=is("Creating behaviour: "+e.name,ya,e);return((e,t,o,n,s,r)=>{const a=Un(e),i=Ms(t,[(l=e,ks("config",Un(l)))]);var l;return fa(a,i,t,o,n,s,r)})(t.fields,t.name,t.active,t.apis,t.extra,t.state)},Sa=Un([ps("branchKey"),ps("branches"),ps("name"),Ds("active",{}),Ds("apis",{}),Ds("state",ba),Ds("extra",{})]),Ca=e=>{const t=is("Creating behaviour: "+e.name,Sa,e);return((e,t,o,n,s,r)=>{const a=e,i=Ms(t,[ks("config",e)]);return fa(a,i,t,o,n,s,r)})(cs(t.branchKey,t.branches),t.name,t.active,t.apis,t.extra,t.state)},ka=y(void 0),Oa=(e,t)=>{const o=kt(e,t);return void 0===o||""===o?[]:o.split(" ")},_a=e=>void 0!==e.dom.classList,Ta=e=>Oa(e,"class"),Ea=(e,t)=>((e,t,o)=>{const n=Oa(e,t).concat([o]);return St(e,t,n.join(" ")),!0})(e,"class",t),Aa=(e,t)=>((e,t,o)=>{const n=P(Oa(e,t),(e=>e!==o));return n.length>0?St(e,t,n.join(" ")):Tt(e,t),!1})(e,"class",t),Ma=(e,t)=>{_a(e)?e.dom.classList.add(t):Ea(e,t)},Da=e=>{0===(_a(e)?e.dom.classList:Ta(e)).length&&Tt(e,"class")},Ba=(e,t)=>{_a(e)?e.dom.classList.remove(t):Aa(e,t),Da(e)},Ia=(e,t)=>_a(e)&&e.dom.classList.contains(t),Fa=(e,t)=>{V(t,(t=>{Ma(e,t)}))},Ra=(e,t)=>{V(t,(t=>{Ba(e,t)}))},Na=e=>_a(e)?(e=>{const t=e.dom.classList,o=new Array(t.length);for(let e=0;e<t.length;e++){const n=t.item(e);null!==n&&(o[e]=n)}return o})(e):Ta(e),za=(e,t,o,n,s)=>{const r=e=>e+"px";return{position:e,left:t.map(r),top:o.map(r),right:n.map(r),bottom:s.map(r)}},La=(e,t)=>{Bt(e,(e=>({...e,position:A.some(e.position)}))(t))},Va=e=>(xe(Rt(e,"position"),"fixed")?A.none():it(e)).orThunk((()=>{const t=Re("span");return rt(e).bind((e=>{zo(e,t);const o=it(t);return Ho(t),o}))})),Ha=e=>Va(e).map(qt).getOrThunk((()=>Gt(0,0))),Pa=(e,t)=>{const o=e.element;Ma(o,t.transitionClass),Ba(o,t.fadeOutClass),Ma(o,t.fadeInClass),t.onShow(e)},Ua=(e,t)=>{const o=e.element;Ma(o,t.transitionClass),Ba(o,t.fadeInClass),Ma(o,t.fadeOutClass),t.onHide(e)},Wa=(e,t)=>e.y>=t.y,$a=(e,t)=>e.bottom<=t.bottom,Ga=(e,t,o)=>({location:"top",leftX:t,topY:o.bounds.y-e.y}),ja=(e,t,o)=>({location:"bottom",leftX:t,bottomY:e.bottom-o.bounds.bottom}),qa=e=>e.box.x-e.win.x,Xa=(e,t,o)=>o.getInitialPos().map((o=>{const n=((e,t)=>{const o=t.optScrollEnv.fold(y(e.bounds.y),(t=>t.scrollElmTop+(e.bounds.y-t.currentScrollTop)));return Gt(e.bounds.x,o)})(o,t);return{box:Yo(n.left,n.top,Kt(e),Ut(e)),location:o.location}})),Ya=(e,t,o,n,s)=>{const r=((e,t)=>{const o=t.optScrollEnv.fold(y(e.y),(t=>e.y+t.currentScrollTop-t.scrollElmTop));return Gt(e.x,o)})(t,o),a=Yo(r.left,r.top,t.width,t.height);n.setInitialPos({style:Nt(e),position:It(e,"position")||"static",bounds:a,location:s.location})},Ka=(e,t,o)=>o.getInitialPos().bind((n=>{var s;switch(o.clearInitialPos(),n.position){case"static":return A.some({morph:"static"});case"absolute":const o=Va(e).getOr(xt()),r=Ko(o),a=null!==(s=o.dom.scrollTop)&&void 0!==s?s:0;return A.some({morph:"absolute",positionCss:za("absolute",fe(n.style,"left").map((e=>t.x-r.x)),fe(n.style,"top").map((e=>t.y-r.y+a)),fe(n.style,"right").map((e=>r.right-t.right)),fe(n.style,"bottom").map((e=>r.bottom-t.bottom)))});default:return A.none()}})),Ja=e=>{switch(e.location){case"top":return A.some({morph:"fixed",positionCss:za("fixed",A.some(e.leftX),A.some(e.topY),A.none(),A.none())});case"bottom":return A.some({morph:"fixed",positionCss:za("fixed",A.some(e.leftX),A.none(),A.none(),A.some(e.bottomY))});default:return A.none()}},Qa=(e,t,o)=>{const n=e.element;return xe(Rt(n,"position"),"fixed")?((e,t,o)=>((e,t,o)=>Xa(e,t,o).filter((({box:e})=>((e,t,o)=>X(e,(e=>{switch(e){case"bottom":return $a(t,o.bounds);case"top":return Wa(t,o.bounds)}})))(o.getModes(),e,t))).bind((({box:t})=>Ka(e,t,o))))(e,t,o).orThunk((()=>t.optScrollEnv.bind((n=>Xa(e,t,o))).bind((({box:e,location:o})=>{const n=Zo(),s=qa({win:n,box:e}),r="top"===o?Ga(n,s,t):ja(n,s,t);return Ja(r)})))))(n,t,o):((e,t,o)=>{const n=Ko(e),s=Zo(),r=((e,t,o)=>{const n=t.win,s=t.box,r=qa(t);return se(e,(e=>{switch(e){case"bottom":return $a(s,o.bounds)?A.none():A.some(ja(n,r,o));case"top":return Wa(s,o.bounds)?A.none():A.some(Ga(n,r,o));default:return A.none()}})).getOr({location:"no-dock"})})(o.getModes(),{win:s,box:n},t);return"top"===r.location||"bottom"===r.location?(Ya(e,n,t,o,r),Ja(r)):A.none()})(n,t,o)},Za=(e,t,o)=>{o.setDocked(!1),V(["left","right","top","bottom","position"],(t=>Lt(e.element,t))),t.onUndocked(e)},ei=(e,t,o,n)=>{const s="fixed"===n.position;o.setDocked(s),La(e.element,n),(s?t.onDocked:t.onUndocked)(e)},ti=(e,t,o,n,s=!1)=>{t.contextual.each((t=>{t.lazyContext(e).each((r=>{const a=((e,t)=>e.y<t.bottom&&e.bottom>t.y)(r,n.bounds);a!==o.isVisible()&&(o.setVisible(a),s&&!a?(Fa(e.element,[t.fadeOutClass]),t.onHide(e)):(a?Pa:Ua)(e,t))}))}))},oi=(e,t,o,n,s)=>{ti(e,t,o,n,!0),ei(e,t,o,s.positionCss)},ni=(e,t,o)=>{e.getSystem().isConnected()&&((e,t,o)=>{const n=t.lazyViewport(e);ti(e,t,o,n),Qa(e,n,o).each((s=>{((e,t,o,n,s)=>{switch(s.morph){case"static":return Za(e,t,o);case"absolute":return ei(e,t,o,s.positionCss);case"fixed":oi(e,t,o,n,s)}})(e,t,o,n,s)}))})(e,t,o)},si=(e,t,o)=>{o.isDocked()&&((e,t,o)=>{const n=e.element;o.setDocked(!1);const s=t.lazyViewport(e);((e,t,o)=>{const n=e.element;return Xa(n,t,o).bind((({box:e})=>Ka(n,e,o)))})(e,s,o).each((n=>{switch(n.morph){case"static":Za(e,t,o);break;case"absolute":ei(e,t,o,n.positionCss)}})),o.setVisible(!0),t.contextual.each((t=>{Ra(n,[t.fadeInClass,t.fadeOutClass,t.transitionClass]),t.onShow(e)})),ni(e,t,o)})(e,t,o)},ri=e=>(t,o,n)=>{const s=o.lazyViewport(t);((e,t,o,n)=>{const s=Ko(e),r=Zo(),a=n(r,qa({win:r,box:s}),t);return"bottom"===a.location||"top"===a.location?(((e,t,o,n,s)=>{n.getInitialPos().fold((()=>Ya(e,t,o,n,s)),(()=>b))})(e,s,t,o,a),Ja(a)):A.none()})(t.element,s,n,e).each((e=>{oi(t,o,n,s,e)}))},ai=ri(Ga),ii=ri(ja);var li,ci=Object.freeze({__proto__:null,refresh:ni,reset:si,isDocked:(e,t,o)=>o.isDocked(),getModes:(e,t,o)=>o.getModes(),setModes:(e,t,o,n)=>o.setModes(n),forceDockToTop:ai,forceDockToBottom:ii}),di=Object.freeze({__proto__:null,events:(e,t)=>Kr([aa(gr(),((o,n)=>{e.contextual.each((e=>{Ia(o.element,e.transitionClass)&&(Ra(o.element,[e.transitionClass,e.fadeInClass]),(t.isVisible()?e.onShown:e.onHidden)(o)),n.stop()}))})),Zr(Dr(),((o,n)=>{ni(o,e,t)})),Zr(Vr(),((o,n)=>{ni(o,e,t)})),Zr(Br(),((o,n)=>{si(o,e,t)}))])});const ui=e=>e.dom.innerHTML,mi=(e,t)=>{const o=tt(e).dom,n=ze(o.createDocumentFragment()),s=((e,t)=>{const o=(t||document).createElement("div");return o.innerHTML=e,lt(ze(o))})(t,o);Lo(n,s),Vo(e),zo(e,n)},gi=(e,t)=>ze(e.dom.cloneNode(t)),pi=e=>(e=>{if(gt(e))return"#shadow-root";{const t=(e=>gi(e,!1))(e);return(e=>{const t=Re("div"),o=ze(e.dom.cloneNode(!0));return zo(t,o),ui(t)})(t)}})(e);var hi;!function(e){e[e.STOP=0]="STOP",e[e.NORMAL=1]="NORMAL",e[e.LOGGING=2]="LOGGING"}(hi||(hi={}));const fi=en({}),bi=["alloy/data/Fields","alloy/debugging/Debugging"],vi=(e,t,o)=>((e,t,o)=>{switch(fe(fi.get(),e).orThunk((()=>{const t=re(fi.get());return se(t,(t=>e.indexOf(t)>-1?A.some(fi.get()[t]):A.none()))})).getOr(hi.NORMAL)){case hi.NORMAL:return o(xi());case hi.LOGGING:{const n=((e,t)=>{const o=[],n=(new Date).getTime();return{logEventCut:(e,t,n)=>{o.push({outcome:"cut",target:t,purpose:n})},logEventStopped:(e,t,n)=>{o.push({outcome:"stopped",target:t,purpose:n})},logNoParent:(e,t,n)=>{o.push({outcome:"no-parent",target:t,purpose:n})},logEventNoHandlers:(e,t)=>{o.push({outcome:"no-handlers-left",target:t})},logEventResponse:(e,t,n)=>{o.push({outcome:"response",purpose:n,target:t})},write:()=>{const s=(new Date).getTime();F(["mousemove","mouseover","mouseout",Er()],e)||console.log(e,{event:e,time:s-n,target:t.dom,sequence:L(o,(e=>F(["cut","stopped","response"],e.outcome)?"{"+e.purpose+"} "+e.outcome+" at ("+pi(e.target)+")":e.outcome))})}}})(e,t),s=o(n);return n.write(),s}case hi.STOP:return!0}})(e,t,o),xi=y({logEventCut:b,logEventStopped:b,logNoParent:b,logEventNoHandlers:b,logEventResponse:b,write:b}),yi=y([ps("menu"),ps("selectedMenu")]),wi=y([ps("item"),ps("selectedItem")]);y(Wn(wi().concat(yi())));const Si=y(Wn(wi())),Ci=ys("initSize",[ps("numColumns"),ps("numRows")]),ki=()=>ys("markers",[ps("backgroundMenu")].concat(yi()).concat(wi())),Oi=e=>ys("markers",L(e,ps)),_i=(e,t,o)=>((()=>{const e=new Error;if(void 0!==e.stack){const t=e.stack.split("\n");$(t,(e=>e.indexOf("alloy")>0&&!R(bi,(t=>e.indexOf(t)>-1)))).getOr("unknown")}})(),us(t,t,o,ns((e=>bn.value(((...t)=>e.apply(void 0,t))))))),Ti=e=>_i(0,e,Dn(b)),Ei=e=>_i(0,e,Dn(A.none)),Ai=e=>_i(0,e,{tag:"required",process:{}}),Mi=e=>_i(0,e,{tag:"required",process:{}}),Di=(e,t)=>ms(e,y(t)),Bi=e=>ms(e,w),Ii=y(Ci);var Fi=[Ms("contextual",[bs("fadeInClass"),bs("fadeOutClass"),bs("transitionClass"),xs("lazyContext"),Ti("onShow"),Ti("onShown"),Ti("onHide"),Ti("onHidden")]),zs("lazyViewport",(()=>({bounds:Zo(),optScrollEnv:A.none()}))),Ls("modes",["top","bottom"],Jn),Ti("onDocked"),Ti("onUndocked")];const Ri=wa({fields:Fi,name:"docking",active:di,apis:ci,state:Object.freeze({__proto__:null,init:e=>{const t=en(!1),o=en(!0),n=nn(),s=en(e.modes);return va({isDocked:t.get,setDocked:t.set,getInitialPos:n.get,setInitialPos:n.set,clearInitialPos:n.clear,isVisible:o.get,setVisible:o.set,getModes:s.get,setModes:s.set,readState:()=>`docked: ${t.get()}, visible: ${o.get()}, modes: ${s.get().join(",")}`})}})}),Ni=Kr([(e=>({key:e,value:Xs({can:(e,t)=>{const o=t.event,n=o.originator,s=o.target;return!((e,t,o)=>Ze(t,e.element)&&!Ze(t,o))(e,n,s)||(console.warn(vr()+" did not get interpreted by the desired target. \nOriginator: "+pi(n)+"\nTarget: "+pi(s)+"\nCheck the "+vr()+" event handlers"),!1)}})}))(vr())]);var zi=Object.freeze({__proto__:null,events:Ni});const Li=(e,t,o,n)=>{const s=e+t;return s>n?o:s<o?n:s},Vi=(e,t,o)=>Math.min(Math.max(e,t),o);let Hi=0;const Pi=e=>{const t=(new Date).getTime(),o=Math.floor(window.crypto.getRandomValues(new Uint32Array(1))[0]/4294967295*1e9);return Hi++,e+"_"+o+Hi+String(t)},Ui=y("alloy-id-"),Wi=y("data-alloy-id"),$i=Ui(),Gi=Wi(),ji=(e,t)=>{Object.defineProperty(e.dom,Gi,{value:t,writable:!0})},qi=e=>{const t=Ge(e)?e.dom[Gi]:null;return A.from(t)},Xi=e=>Pi(e),Yi=w,Ki=e=>{const t=t=>`The component must be in a context to execute: ${t}`+(e?"\n"+pi(e().element)+" is not in context.":""),o=e=>()=>{throw new Error(t(e))},n=e=>()=>{console.warn(t(e))};return{debugInfo:y("fake"),triggerEvent:n("triggerEvent"),triggerFocus:n("triggerFocus"),triggerEscape:n("triggerEscape"),broadcast:n("broadcast"),broadcastOn:n("broadcastOn"),broadcastEvent:n("broadcastEvent"),build:o("build"),buildOrPatch:o("buildOrPatch"),addToWorld:o("addToWorld"),removeFromWorld:o("removeFromWorld"),addToGui:o("addToGui"),removeFromGui:o("removeFromGui"),getByUid:o("getByUid"),getByDom:o("getByDom"),isConnected:T}},Ji=Ki(),Qi=Pi("alloy-premade"),Zi=e=>(Object.defineProperty(e.element.dom,Qi,{value:e.uid,writable:!0}),Ps(Qi,e)),el=e=>fe(e,Qi),tl=e=>((e,t)=>{const o=t.toString(),n=o.indexOf(")")+1,s=o.indexOf("("),r=o.substring(s+1,n-1).split(/,\s*/);return e.toFunctionAnnotation=()=>({name:"OVERRIDE",parameters:ua(r.slice(1))}),e})(((t,...o)=>e(t.getApis(),t,...o)),e),ol=(e,t)=>{const o={};return ie(e,((e,n)=>{ie(e,((e,s)=>{const r=fe(o,s).getOr([]);o[s]=r.concat([t(n,e)])}))})),o},nl=e=>e.cHandler,sl=(e,t)=>({name:e,handler:t}),rl=(e,t)=>{const o={};return V(e,(e=>{o[e.name()]=e.handlers(t)})),o},al=(e,t,o)=>{const n=t[o];return n?((e,t,o,n)=>{try{const s=Z(o,((o,s)=>{const r=o[t],a=s[t],i=n.indexOf(r),l=n.indexOf(a);if(-1===i)throw new Error("The ordering for "+e+" does not have an entry for "+r+".\nOrder specified: "+JSON.stringify(n,null,2));if(-1===l)throw new Error("The ordering for "+e+" does not have an entry for "+a+".\nOrder specified: "+JSON.stringify(n,null,2));return i<l?-1:l<i?1:0}));return bn.value(s)}catch(e){return bn.error([e])}})("Event: "+o,"name",e,n).map((e=>(e=>{const t=(e=>(...t)=>W(e,((e,o)=>e&&(e=>e.can)(o).apply(void 0,t)),!0))(e),o=(e=>(...t)=>W(e,((e,o)=>e||(e=>e.abort)(o).apply(void 0,t)),!1))(e);return{can:t,abort:o,run:(...t)=>{V(e,(e=>{e.run.apply(void 0,t)}))}}})(L(e,(e=>e.handler))))):((e,t)=>bn.error(["The event ("+e+') has more than one behaviour that listens to it.\nWhen this occurs, you must specify an event ordering for the behaviours in your spec (e.g. [ "listing", "toggling" ]).\nThe behaviours that can trigger it are: '+JSON.stringify(L(t,(e=>e.name)),null,2)]))(o,e)},il=(e,t)=>((e,t)=>{const o=(e=>{const t=[],o=[];return V(e,(e=>{e.fold((e=>{t.push(e)}),(e=>{o.push(e)}))})),{errors:t,values:o}})(e);return o.errors.length>0?(n=o.errors,bn.error(j(n))):((e,t)=>0===e.length?bn.value(t):bn.value(En(t,An.apply(void 0,e))))(o.values,t);var n})(ge(e,((e,o)=>(1===e.length?bn.value(e[0].handler):al(e,t,o)).map((n=>{const s=(e=>{const t=(e=>p(e)?{can:E,abort:T,run:e}:e)(e);return(e,o,...n)=>{const s=[e,o].concat(n);t.abort.apply(void 0,s)?o.stop():t.can.apply(void 0,s)&&t.run.apply(void 0,s)}})(n),r=e.length>1?P(t[o],(t=>R(e,(e=>e.name===t)))).join(" > "):e[0].name;return Ps(o,((e,t)=>({handler:e,purpose:t}))(s,r))})))),{}),ll="alloy.base.behaviour",cl=Wn([us("dom","dom",{tag:"required",process:{}},Wn([ps("tag"),Ds("styles",{}),Ds("classes",[]),Ds("attributes",{}),Cs("value"),Cs("innerHtml")])),ps("components"),ps("uid"),Ds("events",{}),Ds("apis",{}),us("eventOrder","eventOrder",(lc={[Sr()]:["disabling",ll,"toggling","typeaheadevents"],[vr()]:[ll,"focusing","keying"],[Er()]:[ll,"disabling","toggling","representing","tooltipping"],[cr()]:[ll,"representing","streaming","invalidating"],[Fr()]:[ll,"representing","item-events","toolbar-button-events","tooltipping"],[er()]:["focusing",ll,"item-type-events"],[Ks()]:["focusing",ll,"item-type-events"],[sr()]:["item-type-events","tooltipping"],[wr()]:["receiving","reflecting","tooltipping"]},Bn(y(lc))),Xn()),Cs("domModification")]),dl=e=>e.events,ul=e=>e.dom.value,ml=(e,t)=>{if(void 0===t)throw new Error("Value.set was undefined");e.dom.value=t},gl=(e,t,o)=>{o.fold((()=>zo(e,t)),(e=>{Ze(e,t)||(Fo(e,t),Ho(e))}))},pl=(e,t,o)=>{const n=L(t,o),s=lt(e);return V(s.slice(n.length),Ho),n},hl=(e,t,o,n)=>{const s=ct(e,t),r=n(o,s),a=((e,t,o)=>ct(e,t).map((e=>{if(o.exists((t=>!Ze(t,e)))){const t=o.map(Ue).getOr("span"),n=Re(t);return Fo(e,n),n}return e})))(e,t,s);return gl(e,r.element,a),r},fl=(e,t)=>{const o=re(e),n=re(t),s=K(n,o),r=(e=>{const o={},n={};return ue(e,((e,o)=>!be(t,o)||e!==t[o]),de(o),de(n)),{t:o,f:n}})(e).t;return{toRemove:s,toSet:r}},bl=(e,t)=>{const o=t.filter((t=>Ue(t)===e.tag&&!(e=>e.innerHtml.isSome()&&e.domChildren.length>0)(e)&&!(e=>be(e.dom,Qi))(t))).bind((t=>((e,t)=>{try{const o=((e,t)=>{const{class:o,style:n,...s}=(e=>W(e.dom.attributes,((e,t)=>(e[t.name]=t.value,e)),{}))(t),{toSet:r,toRemove:a}=fl(e.attributes,s),i=Nt(t),{toSet:l,toRemove:c}=fl(e.styles,i),d=Na(t),u=K(d,e.classes),m=K(e.classes,d);return V(a,(e=>Tt(t,e))),Ct(t,r),Fa(t,m),Ra(t,u),V(c,(e=>Lt(t,e))),Dt(t,l),e.innerHtml.fold((()=>{const o=e.domChildren;((e,t)=>{pl(e,t,((t,o)=>{const n=ct(e,o);return gl(e,t,n),t}))})(t,o)}),(e=>{mi(t,e)})),(()=>{const o=t,n=e.value.getOrUndefined();n!==ul(o)&&ml(o,null!=n?n:"")})(),t})(e,t);return A.some(o)}catch(e){return A.none()}})(e,t))).getOrThunk((()=>(e=>{const t=Re(e.tag);Ct(t,e.attributes),Fa(t,e.classes),Dt(t,e.styles),e.innerHtml.each((e=>mi(t,e)));const o=e.domChildren;return Lo(t,o),e.value.each((e=>{ml(t,e)})),t})(e)));return ji(o,e.uid),o},vl=e=>{const t=(e=>{const t=fe(e,"behaviours").getOr({});return q(re(t),(e=>{const o=t[e];return g(o)?[o.me]:[]}))})(e);return((e,t)=>((e,t)=>{const o=L(t,(e=>Ms(e.name(),[ps("config"),Ds("state",ba)]))),n=rs("component.behaviours",Wn(o),e.behaviours).fold((t=>{throw new Error(ls(t)+"\nComplete spec:\n"+JSON.stringify(e,null,2))}),w);return{list:t,data:le(n,(e=>{const t=e.map((e=>({config:e.config,state:e.state.init(e.config)})));return y(t)}))}})(e,t))(e,t)},xl=(e,t)=>{const o=()=>m,n=en(Ji),s=as((e=>rs("custom.definition",cl,e))(e)),r=vl(e),a=(e=>e.list)(r),i=(e=>e.data)(r),l=((e,t,o)=>{const n={...(s=e).dom,uid:s.uid,domChildren:L(s.components,(e=>e.element))};var s;const r=(e=>e.domModification.fold((()=>ga({})),ga))(e),a={"alloy.base.modification":r},i=t.length>0?((e,t,o,n)=>{const s={...t};V(o,(t=>{s[t.name()]=t.exhibit(e,n)}));const r=ol(s,((e,t)=>({name:e,modification:t}))),a=e=>U(e,((e,t)=>({...t.modification,...e})),{}),i=U(r.classes,((e,t)=>t.modification.concat(e)),[]),l=a(r.attributes),c=a(r.styles);return ga({classes:i,attributes:l,styles:c})})(o,a,t,n):r;return l=n,c=i,{...l,attributes:{...l.attributes,...c.attributes},styles:{...l.styles,...c.styles},classes:l.classes.concat(c.classes)};var l,c})(s,a,i),c=bl(l,t),d=((e,t,o)=>{const n={"alloy.base.behaviour":dl(e)};return((e,t,o,n)=>{const s=((e,t,o)=>{const n={...o,...rl(t,e)};return ol(n,sl)})(e,o,n);return il(s,t)})(o,e.eventOrder,t,n).getOrDie()})(s,a,i),u=en(s.components),m={uid:e.uid,getSystem:n.get,config:t=>{const o=i;return(p(o[t.name()])?o[t.name()]:()=>{throw new Error("Could not find "+t.name()+" in "+JSON.stringify(e,null,2))})()},hasConfigured:e=>p(i[e.name()]),spec:e,readState:e=>i[e]().map((e=>e.state.readState())).getOr("not enabled"),getApis:()=>s.apis,connect:e=>{n.set(e)},disconnect:()=>{n.set(Ki(o))},element:c,syncComponents:()=>{const e=lt(c),t=q(e,(e=>n.get().getByDom(e).fold((()=>[]),Q)));u.set(t)},components:u.get,events:d};return m},yl=e=>{const t=Ne(e);return wl({element:t})},wl=e=>{const t=is("external.component",Un([ps("element"),Cs("uid")]),e),o=en(Ki()),n=t.uid.getOrThunk((()=>Xi("external")));ji(t.element,n);const s={uid:n,getSystem:o.get,config:A.none,hasConfigured:T,connect:e=>{o.set(e)},disconnect:()=>{o.set(Ki((()=>s)))},getApis:()=>({}),element:t.element,spec:e,readState:y("No state"),syncComponents:b,components:y([]),events:{}};return Zi(s)},Sl=Xi,Cl=(e,t)=>el(e).getOrThunk((()=>((e,t)=>{const{events:o,...n}=Yi(e),s=((e,t)=>{const o=fe(e,"components").getOr([]);return t.fold((()=>L(o,kl)),(e=>L(o,((t,o)=>Cl(t,ct(e,o))))))})(n,t),r={...n,events:{...zi,...o},components:s};return bn.value(xl(r,t))})((e=>be(e,"uid"))(e)?e:{uid:Sl(""),...e},t).getOrDie())),kl=e=>Cl(e,A.none()),Ol=Zi,_l=(e,t,o)=>an(e,t,o).isSome(),Tl="aria-controls",El=()=>{const e=Pi(Tl);return{id:e,link:t=>{St(t,Tl,e)},unlink:e=>{Tt(e,Tl)}}},Al=(e,t)=>_l(t,(t=>Ze(t,e.element)),T)||((e,t)=>(e=>an(e,(e=>{if(!Ge(e))return!1;const t=kt(e,"id");return void 0!==t&&t.indexOf(Tl)>-1})).bind((e=>{const t=kt(e,"id"),o=pt(e);return mn(o,`[${Tl}="${t}"]`)})))(t).exists((t=>Al(e,t))))(e,t),Ml=(e,t,o,n,s,r,a,i=!1)=>({x:e,y:t,bubble:o,direction:n,placement:s,restriction:r,label:`${a}-${s}`,alwaysFit:i}),Dl=Hs([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),Bl=Dl.southeast,Il=Dl.southwest,Fl=Dl.northeast,Rl=Dl.northwest,Nl=Dl.south,zl=Dl.north,Ll=Dl.east,Vl=Dl.west,Hl=(e,t)=>J(["left","right","top","bottom"],(o=>fe(t,o).map((t=>((e,t)=>{switch(t){case 1:return e.x;case 0:return e.x+e.width;case 2:return e.y;case 3:return e.y+e.height}})(e,t))))),Pl="layout",Ul=e=>e.x,Wl=(e,t)=>e.x+e.width/2-t.width/2,$l=(e,t)=>e.x+e.width-t.width,Gl=(e,t)=>e.y-t.height,jl=e=>e.y+e.height,ql=(e,t)=>e.y+e.height/2-t.height/2,Xl=(e,t,o)=>Ml(Ul(e),jl(e),o.southeast(),Bl(),"southeast",Hl(e,{left:1,top:3}),Pl),Yl=(e,t,o)=>Ml($l(e,t),jl(e),o.southwest(),Il(),"southwest",Hl(e,{right:0,top:3}),Pl),Kl=(e,t,o)=>Ml(Ul(e),Gl(e,t),o.northeast(),Fl(),"northeast",Hl(e,{left:1,bottom:2}),Pl),Jl=(e,t,o)=>Ml($l(e,t),Gl(e,t),o.northwest(),Rl(),"northwest",Hl(e,{right:0,bottom:2}),Pl),Ql=(e,t,o)=>Ml(Wl(e,t),Gl(e,t),o.north(),zl(),"north",Hl(e,{bottom:2}),Pl),Zl=(e,t,o)=>Ml(Wl(e,t),jl(e),o.south(),Nl(),"south",Hl(e,{top:3}),Pl),ec=(e,t,o)=>Ml((e=>e.x+e.width)(e),ql(e,t),o.east(),Ll(),"east",Hl(e,{left:0}),Pl),tc=(e,t,o)=>Ml(((e,t)=>e.x-t.width)(e,t),ql(e,t),o.west(),Vl(),"west",Hl(e,{right:1}),Pl),oc=()=>[Xl,Yl,Kl,Jl,Zl,Ql,ec,tc],nc=()=>[Yl,Xl,Jl,Kl,Zl,Ql,ec,tc],sc=()=>[Kl,Jl,Xl,Yl,Ql,Zl],rc=()=>[Jl,Kl,Yl,Xl,Ql,Zl],ac=()=>[Xl,Yl,Kl,Jl,Zl,Ql],ic=()=>[Yl,Xl,Jl,Kl,Zl,Ql];var lc,cc=Object.freeze({__proto__:null,events:e=>Kr([Zr(wr(),((t,o)=>{const n=e.channels,s=re(n),r=o,a=((e,t)=>t.universal?e:P(e,(e=>F(t.channels,e))))(s,r);V(a,(e=>{const o=n[e],s=o.schema,a=is("channel["+e+"] data\nReceiver: "+pi(t.element),s,r.data);o.onReceive(t,a)}))}))])}),dc=[hs("channels",ss(bn.value,Un([Ai("onReceive"),Ds("schema",Xn())])))];const uc=wa({fields:dc,name:"receiving",active:cc});var mc=Object.freeze({__proto__:null,exhibit:(e,t)=>ga({classes:[],styles:t.useFixed()?{}:{position:"relative"}})});const gc=(e,t=!1)=>e.dom.focus({preventScroll:t}),pc=e=>e.dom.blur(),hc=e=>{const t=pt(e).dom;return e.dom===t.activeElement},fc=(e=Go())=>A.f