UNPKG

cthep-ui-vue3

Version:

Vue 3 试题组件库

9 lines 403 kB
/** * Copyright (c) Tiny Technologies, Inc. All rights reserved. * Licensed under the LGPL or a commercial license. * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ * * Version: 5.10.5 (2022-05-25) */ !function(){"use strict";function t(o){return function(t){return e=typeof(n=t),(null===n?"null":"object"==e&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"==e&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":e)===o;var n,e}}function n(n){return function(t){return typeof t===n}}function e(n){return function(t){return n===t}}function g(t){return null==t}function f(t,n){if(c(t)){for(var e=0,o=t.length;e<o;++e)if(!n(t[e]))return;return 1}}function st(){}function r(e,o){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e(o.apply(null,t))}}function rt(t){return function(){return t}}function h(t){return t}function v(t,n){return t===n}var y=t("string"),x=t("object"),c=t("array"),b=e(null),w=n("boolean"),E=e(void 0),k=function(t){return!g(t)},S=n("function"),u=n("number");function C(o){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var e=r.concat(t);return o.apply(null,e)}}function O(n){return function(t){return!n(t)}}function _(t){return function(){throw new Error(t)}}var T=rt(!1),D=rt(!0),o=tinymce.util.Tools.resolve("tinymce.ThemeManager"),lt=function(){return(lt=Object.assign||function(t){for(var n,e=1,o=arguments.length;e<o;e++)for(var r in n=arguments[e])Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t}).apply(this,arguments)};function B(t,n){var e={};for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&n.indexOf(r)<0&&(e[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(t);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(e[r[o]]=t[r[o]]);return e}function H(t,n,e){if(e||2===arguments.length)for(var o,r=0,i=n.length;r<i;r++)!o&&r in n||((o=o||Array.prototype.slice.call(n,0,r))[r]=n[r]);return t.concat(o||Array.prototype.slice.call(n))}function i(){return a}var a={fold:function(t,n){return t()},isSome:T,isNone:D,getOr:h,getOrThunk:s,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:rt(null),getOrUndefined:rt(void 0),or:h,orThunk:s,map:i,each:st,bind:i,exists:T,forall:D,filter:function(){return a},toArray:function(){return[]},toString:rt("none()")};function s(t){return t()}function l(t,n){return yt.call(t,n)}function d(t,n){for(var e=0,o=t.length;e<o;e++)if(n(t[e],e))return!0;return!1}function m(t,n){for(var e=[],o=0;o<t;o++)e.push(n(o));return e}function p(t,n){for(var e=[],o=0;o<t.length;o+=n){var r=bt.call(t,o,o+n);e.push(r)}return e}function M(t,n){for(var e=t.length,o=new Array(e),r=0;r<e;r++){var i=t[r];o[r]=n(i,r)}return o}function A(t,n){for(var e=[],o=[],r=0,i=t.length;r<i;r++){var u=t[r];(n(u,r)?e:o).push(u)}return{pass:e,fail:o}}function F(t,n){for(var e=[],o=0,r=t.length;o<r;o++){var i=t[o];n(i,o)&&e.push(i)}return e}function I(t,o,r){return function(t){for(var n,e=t.length-1;0<=e;e--)n=t[e],r=o(r,n,e)}(t),r}function R(t,e,o){return St(t,function(t,n){o=e(o,t,n)}),o}function V(t,n){return function(t,n,e){for(var o=0,r=t.length;o<r;o++){var i=t[o];if(n(i,o))return vt.some(i);if(e(i,o))break}return vt.none()}(t,n,T)}function P(t,n){for(var e=0,o=t.length;e<o;e++)if(n(t[e],e))return vt.some(e);return vt.none()}function ft(t){for(var n=[],e=0,o=t.length;e<o;++e){if(!c(t[e]))throw new Error("Arr.flatten item "+e+" was not an array, input: "+t);xt.apply(n,t[e])}return n}function z(t,n){return ft(M(t,n))}function N(t,n){for(var e=0,o=t.length;e<o;++e)if(!0!==n(t[e],e))return!1;return!0}function L(t){var n=bt.call(t,0);return n.reverse(),n}function W(t,n){return F(t,function(t){return!wt(n,t)})}function U(t,n){for(var e={},o=0,r=t.length;o<r;o++){var i=t[o];e[String(i)]=n(i,o)}return e}function j(t){return[t]}function G(t,n){var e=bt.call(t,0);return e.sort(n),e}function X(t,n){return 0<=n&&n<t.length?vt.some(t[n]):vt.none()}function Y(t){return X(t,0)}function q(t){return X(t,t.length-1)}function K(t,n){for(var e=0;e<t.length;e++){var o=n(t[e],e);if(o.isSome())return o}return vt.none()}function J(t,n){for(var e=Ct(t),o=0,r=e.length;o<r;o++){var i=e[o];n(t[i],i)}}function dt(t,e){return _t(t,function(t,n){return{k:n,v:e(t,n)}})}function $(t,e){var o=[];return J(t,function(t,n){o.push(e(t,n))}),o}function Q(t,n){for(var e=Ct(t),o=0,r=e.length;o<r;o++){var i=e[o],u=t[i];if(n(u,i,t))return vt.some(u)}return vt.none()}function Z(t){return $(t,h)}function tt(t,n){return Tt(t,n)?vt.from(t[n]):vt.none()}function nt(t,n){return Tt(t,n)&&void 0!==t[n]&&null!==t[n]}function mt(t,n,e){return void 0===e&&(e=v),t.exists(function(t){return e(t,n)})}function et(t){for(var n=[],e=function(t){n.push(t)},o=0;o<t.length;o++)t[o].each(e);return n}function ot(t,n){return t?vt.some(n):vt.none()}function it(t,n,e){return""===n||t.length>=n.length&&t.substr(e,e+n.length)===n}function ut(t,n){return-1!==t.indexOf(n)}function at(t){return 0<t.length}function ct(t){return void 0!==t.style&&S(t.style.getPropertyValue)}function gt(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}}var pt,ht=function(e){function t(){return r}function n(t){return t(e)}var o=rt(e),r={fold:function(t,n){return n(e)},isSome:D,isNone:T,getOr:o,getOrThunk:o,getOrDie:o,getOrNull:o,getOrUndefined:o,or:t,orThunk:t,map:function(t){return ht(t(e))},each:function(t){t(e)},bind:n,exists:n,forall:n,filter:function(t){return t(e)?r:a},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};return r},vt={some:ht,none:i,from:function(t){return null==t?a:ht(t)}},bt=Array.prototype.slice,yt=Array.prototype.indexOf,xt=Array.prototype.push,wt=function(t,n){return-1<l(t,n)},St=function(t,n){for(var e=0,o=t.length;e<o;e++)n(t[e],e)},kt=S(Array.from)?Array.from:function(t){return bt.call(t)},Ct=Object.keys,Ot=Object.hasOwnProperty,_t=function(t,o){var r={};return J(t,function(t,n){var e=o(t,n);r[e.k]=e.v}),r},Tt=function(t,n){return Ot.call(t,n)},Et=function(t,n,e){return t.isSome()&&n.isSome()?vt.some(e(t.getOrDie(),n.getOrDie())):vt.none()},Dt=function(t,n){return it(t,n,0)},Bt=function(t,n){return it(t,n,t.length-n.length)},Mt=(pt=/^\s+|\s+$/g,function(t){return t.replace(pt,"")}),At={fromHtml:function(t,n){var e=(n||document).createElement("div");if(e.innerHTML=t,!e.hasChildNodes()||1<e.childNodes.length)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return gt(e.childNodes[0])},fromTag:function(t,n){var e=(n||document).createElement(t);return gt(e)},fromText:function(t,n){var e=(n||document).createTextNode(t);return gt(e)},fromDom:gt,fromPoint:function(t,n,e){return vt.from(t.dom.elementFromPoint(n,e)).map(gt)}};function Ft(t){return t.dom.nodeName.toLowerCase()}function It(n){return function(t){return t.dom.nodeType===n}}function Rt(e){var o,r=!1;return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return r||(r=!0,o=e.apply(null,t)),o}}function Vt(t,n){var e=String(n).toLowerCase();return V(t,function(t){return t.search(e)})}function Pt(n){return function(t){return ut(t,n)}}function Ht(t){return window.matchMedia(t).matches}function zt(t,n){var e=t.dom;if(1!==e.nodeType)return!1;var o=e;if(void 0!==o.matches)return o.matches(n);if(void 0!==o.msMatchesSelector)return o.msMatchesSelector(n);if(void 0!==o.webkitMatchesSelector)return o.webkitMatchesSelector(n);if(void 0!==o.mozMatchesSelector)return o.mozMatchesSelector(n);throw new Error("Browser lacks native selectors")}function Nt(t){return 1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType||0===t.childElementCount}function Lt(t,n){return t.dom===n.dom}function Wt(t,n){return le().browser.isIE()?(e=t.dom,o=n.dom,r=Node.DOCUMENT_POSITION_CONTAINED_BY,0!=(e.compareDocumentPosition(o)&r)):(i=t.dom)!==(u=n.dom)&&i.contains(u);var e,o,r,i,u}function Ut(t){return At.fromDom(t.dom.ownerDocument)}function jt(t){return qn(t)?t:Ut(t)}function Gt(t){return At.fromDom(jt(t).dom.documentElement)}function Xt(t){return At.fromDom(jt(t).dom.defaultView)}function Yt(t){return vt.from(t.dom.parentNode).map(At.fromDom)}function qt(t){return vt.from(t.dom.offsetParent).map(At.fromDom)}function Kt(t){return M(t.dom.childNodes,At.fromDom)}function Jt(t,n){var e=t.dom.childNodes;return vt.from(e[n]).map(At.fromDom)}function $t(t,n){return{element:t,offset:n}}function Qt(t,n){var e=Kt(t);return 0<e.length&&n<e.length?$t(e[n],0):$t(t,n)}function Zt(t){return Kn(t)&&k(t.dom.host)}function tn(t){return Zt(t)?t:At.fromDom(jt(t).dom.body)}function nn(t){return At.fromDom(t.dom.host)}function en(t,n,e){if(!(y(e)||w(e)||u(e)))throw console.error("Invalid call to Attribute.set. Key ",n,":: Value ",e,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(n,e+"")}function on(t,n,e){en(t.dom,n,e)}function rn(t,n){var e=t.dom;J(n,function(t,n){en(e,n,t)})}function un(t,n){var e=t.dom.getAttribute(n);return null===e?void 0:e}function an(t,n){return vt.from(un(t,n))}function cn(t,n){var e=t.dom;return!(!e||!e.hasAttribute)&&e.hasAttribute(n)}function sn(t,n){t.dom.removeAttribute(n)}function ln(t,n,e){if(!y(e))throw console.error("Invalid call to CSS.set. Property ",n,":: Value ",e,":: Element ",t),new Error("CSS value must be a string: "+e);ct(t)&&t.style.setProperty(n,e)}function fn(t,n){ct(t)&&t.style.removeProperty(n)}function dn(t,n,e){ln(t.dom,n,e)}function mn(t,n){var e=t.dom;J(n,function(t,n){ln(e,n,t)})}function gn(t,n){var e=t.dom;J(n,function(t,n){t.fold(function(){fn(e,n)},function(t){ln(e,n,t)})})}function pn(t,n){var e=t.dom,o=window.getComputedStyle(e).getPropertyValue(n);return""!==o||ve(t)?o:xe(e,n)}function hn(t,n){var e=t.dom,o=xe(e,n);return vt.from(o).filter(function(t){return 0<t.length})}function vn(t,n,e){var o=At.fromTag(t);return dn(o,n,e),hn(o,n).isSome()}function bn(t,n){fn(t.dom,n),mt(an(t,"style").map(Mt),"")&&sn(t,"style")}function yn(t){return t.dom.offsetWidth}function xn(o,r){function t(t){var n=r(t);if(n<=0||null===n){var e=pn(t,o);return parseFloat(e)||0}return n}function i(r,t){return R(t,function(t,n){var e=pn(r,n),o=void 0===e?0:parseInt(e,10);return isNaN(o)?t:t+o},0)}return{set:function(t,n){if(!u(n)&&!n.match(/^[0-9]+$/))throw new Error(o+".set accepts only positive integer values. Value was "+n);var e=t.dom;ct(e)&&(e.style[o]=n+"px")},get:t,getOuter:t,aggregate:i,max:function(t,n,e){var o=i(t,e);return o<n?n-o:0}}}function wn(t){return we.get(t)}function Sn(t){return we.getOuter(t)}function kn(t,n){return void 0!==t?t:void 0!==n?n:0}function Cn(t){var n=t.dom.ownerDocument,e=n.body,o=n.defaultView,r=n.documentElement;if(e===t.dom)return ke(e.offsetLeft,e.offsetTop);var i=kn(null==o?void 0:o.pageYOffset,r.scrollTop),u=kn(null==o?void 0:o.pageXOffset,r.scrollLeft),a=kn(r.clientTop,e.clientTop),c=kn(r.clientLeft,e.clientLeft);return Ce(t).translate(u-c,i-a)}function On(t){return Oe.get(t)}function _n(t){return Oe.getOuter(t)}function Tn(t){function n(){return t.stopPropagation()}function e(){return t.preventDefault()}var o=r(e,n);return{target:At.fromDom(function(t){if(me()&&k(t.target)){var n=At.fromDom(t.target);if(Xn(n)&&he(n)&&t.composed&&t.composedPath){var e=t.composedPath();if(e)return Y(e)}}return vt.from(t.target)}(t).getOr(t.target)),x:t.clientX,y:t.clientY,stop:n,prevent:e,kill:o,raw:t}}function En(t,n,e,o,r){var i,u,a=(i=e,u=o,function(t){i(t)&&u(Tn(t))});return t.dom.addEventListener(n,a,r),{unbind:C(_e,t,n,a,r)}}function Dn(n,e){Yt(n).each(function(t){t.dom.insertBefore(e.dom,n.dom)})}function Bn(t,n){vt.from(t.dom.nextSibling).map(At.fromDom).fold(function(){Yt(t).each(function(t){Te(t,n)})},function(t){Dn(t,n)})}function Mn(n,e){Jt(n,0).fold(function(){Te(n,e)},function(t){n.dom.insertBefore(e.dom,t.dom)})}function An(n,t){St(t,function(t){Te(n,t)})}function Fn(t){t.dom.textContent="",St(Kt(t),function(t){Ee(t)})}function In(t){var n,e=Kt(t);0<e.length&&(n=t,St(e,function(t){Dn(n,t)})),Ee(t)}function Rn(t){var n=void 0!==t?t.dom:document,e=n.body.scrollLeft||n.documentElement.scrollLeft,o=n.body.scrollTop||n.documentElement.scrollTop;return ke(e,o)}function Vn(t,n,e){var o=(void 0!==e?e.dom:document).defaultView;o&&o.scrollTo(t,n)}function Pn(t,n,e,o){return{x:t,y:n,width:e,height:o,right:t+e,bottom:n+o}}function Hn(t){var o=void 0===t?window:t,n=o.document,r=Rn(At.fromDom(n)),e=void 0===o?window:o;return(le().browser.isFirefox()?vt.none():vt.from(e.visualViewport)).fold(function(){var t=o.document.documentElement,n=t.clientWidth,e=t.clientHeight;return Pn(r.left,r.top,n,e)},function(t){return Pn(Math.max(t.pageLeft,r.left),Math.max(t.pageTop,r.top),t.width,t.height)})}function zn(o){var t,r=Rn(At.fromDom(document)),n=(t=Be).owner(o),e=De(t,n);return vt.some(e).fold(C(Cn,o),function(t){var n=Ce(o),e=I(t,function(t,n){var e=Ce(n);return{left:t.left+e.left,top:t.top+e.top}},{left:0,top:0});return ke(e.left+n.left+r.left,e.top+n.top+r.top)})}function Nn(t){var n=zn(t),e=_n(t),o=Sn(t);return Me(n.left,n.top,e,o)}"undefined"!=typeof window||Function("return this;")();function Ln(){return Jn(0,0)}function Wn(t){function n(t){return function(){return e===t}}var e=t.current,o=t.version;return{current:e,version:o,isEdge:n("Edge"),isChrome:n("Chrome"),isIE:n("IE"),isOpera:n("Opera"),isFirefox:n(te),isSafari:n("Safari")}}function Un(t){function n(t){return function(){return e===t}}var e=t.current,o=t.version;return{current:e,version:o,isWindows:n(oe),isiOS:n("iOS"),isAndroid:n(re),isOSX:n("OSX"),isLinux:n("Linux"),isSolaris:n(ie),isFreeBSD:n(ue),isChromeOS:n(ae)}}var jn,Gn,Xn=It(1),Yn=It(3),qn=It(9),Kn=It(11),Jn=function(t,n){return{major:t,minor:n}},$n={nu:Jn,detect:function(t,n){var e,o,r=String(n).toLowerCase();return 0===t.length?Ln():(o=function(t,n){for(var e=0;e<t.length;e++){var o=t[e];if(o.test(n))return o}}(t,e=r))?Jn(i(1),i(2)):{major:0,minor:0};function i(t){return Number(e.replace(o,"$"+t))}},unknown:Ln},Qn=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Zn={browsers:rt([{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return ut(t,"edge/")&&ut(t,"chrome")&&ut(t,"safari")&&ut(t,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Qn],search:function(t){return ut(t,"chrome")&&!ut(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return ut(t,"msie")||ut(t,"trident")}},{name:"Opera",versionRegexes:[Qn,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Pt("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Pt("firefox")},{name:"Safari",versionRegexes:[Qn,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(ut(t,"safari")||ut(t,"mobile/"))&&ut(t,"applewebkit")}}]),oses:rt([{name:"Windows",search:Pt("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return ut(t,"iphone")||ut(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Pt("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Pt("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Pt("linux"),versionRegexes:[]},{name:"Solaris",search:Pt("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Pt("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:Pt("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}])},te="Firefox",ne=function(){return Wn({current:void 0,version:$n.unknown()})},ee=Wn,oe=(rt("Edge"),rt("Chrome"),rt("IE"),rt("Opera"),rt(te),rt("Safari"),"Windows"),re="Android",ie="Solaris",ue="FreeBSD",ae="ChromeOS",ce=function(){return Un({current:void 0,version:$n.unknown()})},se=Un,le=(rt(oe),rt("iOS"),rt(re),rt("Linux"),rt("OSX"),rt(ie),rt(ue),rt(ae),Rt(function(){return t=navigator.userAgent,n=vt.from(navigator.userAgentData),e=Ht,p=Zn.browsers(),h=Zn.oses(),v=n.bind(function(t){return o=p,K(t.brands,function(n){var e=n.brand.toLowerCase();return V(o,function(t){var n;return e===(null===(n=t.brand)||void 0===n?void 0:n.toLowerCase())}).map(function(t){return{current:t.name,version:$n.nu(parseInt(n.version,10),0)}})});var o}).orThunk(function(){return Vt(p,e=t).map(function(t){var n=$n.detect(t.versionRegexes,e);return{current:t.name,version:n}});var e}).fold(ne,ee),b=Vt(h,o=t).map(function(t){var n=$n.detect(t.versionRegexes,o);return{current:t.name,version:n}}).fold(ce,se),{browser:v,os:b,deviceType:(i=v,u=t,a=e,c=(r=b).isiOS()&&!0===/ipad/i.test(u),s=r.isiOS()&&!c,f=(l=r.isiOS()||r.isAndroid())||a("(pointer:coarse)"),d=c||!s&&l&&a("(min-device-width:768px)"),m=s||l&&!d,g=i.isSafari()&&r.isiOS()&&!1===/safari/i.test(u),{isiPad:rt(c),isiPhone:rt(s),isTablet:rt(d),isPhone:rt(m),isTouch:rt(f),isAndroid:r.isAndroid,isiOS:r.isiOS,isWebView:rt(g),isDesktop:rt(!m&&!d&&!g)})};var t,n,e,o,r,i,u,a,c,s,l,f,d,m,g,p,h,v,b})),fe=Yt,de=S(Element.prototype.attachShadow)&&S(Node.prototype.getRootNode),me=rt(de),ge=de?function(t){return At.fromDom(t.dom.getRootNode())}:jt,pe=function(t){var n=ge(t);return Zt(n)?vt.some(n):vt.none()},he=function(t){return k(t.dom.shadowRoot)},ve=function(t){var n=Yn(t)?t.dom.parentNode:t.dom;if(null==n||null===n.ownerDocument)return!1;var e,o,r=n.ownerDocument;return pe(At.fromDom(n)).fold(function(){return r.body.contains(n)},(e=ve,o=nn,function(t){return e(o(t))}))},be=function(){return ye(At.fromDom(document))},ye=function(t){var n=t.dom.body;if(null==n)throw new Error("Body is not available yet");return At.fromDom(n)},xe=function(t,n){return ct(t)?t.style.getPropertyValue(n):""},we=xn("height",function(t){var n=t.dom;return ve(t)?n.getBoundingClientRect().height:n.offsetHeight}),Se=function(e,o){return{left:e,top:o,translate:function(t,n){return Se(e+t,o+n)}}},ke=Se,Ce=function(t){var n,e=t.dom,o=e.ownerDocument.body;return o===e?ke(o.offsetLeft,o.offsetTop):ve(t)?(n=e.getBoundingClientRect(),ke(n.left,n.top)):ke(0,0)},Oe=xn("width",function(t){return t.dom.offsetWidth}),_e=function(t,n,e,o){t.dom.removeEventListener(n,e,o)},Te=function(t,n){t.dom.appendChild(n.dom)},Ee=function(t){var n=t.dom;null!==n.parentNode&&n.parentNode.removeChild(n)},De=function(o,t){return o.view(t).fold(rt([]),function(t){var n=o.owner(t),e=De(o,n);return[t].concat(e)})},Be=Object.freeze({__proto__:null,view:function(t){var n;return(t.dom===document?vt.none():vt.from(null===(n=t.dom.defaultView)||void 0===n?void 0:n.frameElement)).map(At.fromDom)},owner:Ut}),Me=function(t,n,e,o){return{x:t,y:n,width:e,height:o,right:t+e,bottom:n+o}},Ae=function(t){var n=Cn(t),e=_n(t),o=Sn(t);return Me(n.left,n.top,e,o)},Fe=function(){return Hn(window)},Ie=function(e){return{isValue:D,isError:T,getOr:rt(e),getOrThunk:rt(e),getOrDie:rt(e),or:function(t){return Ie(e)},orThunk:function(t){return Ie(e)},fold:function(t,n){return n(e)},map:function(t){return Ie(t(e))},mapError:function(t){return Ie(e)},each:function(t){t(e)},bind:function(t){return t(e)},exists:function(t){return t(e)},forall:function(t){return t(e)},toOptional:function(){return vt.some(e)}}},Re=function(e){return{isValue:T,isError:D,getOr:h,getOrThunk:function(t){return t()},getOrDie:function(){return _(String(e))()},or:h,orThunk:function(t){return t()},fold:function(t,n){return t(e)},map:function(t){return Re(e)},mapError:function(t){return Re(t(e))},each:st,bind:function(t){return Re(e)},exists:T,forall:D,toOptional:vt.none}},Ve={value:Ie,error:Re,fromOption:function(t,n){return t.fold(function(){return Re(n)},Ie)}};function Pe(t,n,e){return t.stype===jn.Error?n(t.serror):e(t.svalue)}function He(t){return{stype:jn.Value,svalue:t}}function ze(t){return{stype:jn.Error,serror:t}}function Ne(t,n,e,o){return{tag:"field",key:t,newKey:n,presence:e,prop:o}}function Le(t,n,e){switch(t.tag){case"field":return n(t.key,t.newKey,t.presence,t.prop);case"custom":return e(t.newKey,t.instantiator)}}function We(u){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(0===t.length)throw new Error("Can't merge zero objects");for(var e={},o=0;o<t.length;o++){var r,i=t[o];for(r in i)Tt(i,r)&&(e[r]=u(e[r],i[r]))}return e}}function Ue(){return{tag:"required",process:{}}}function je(t){return{tag:"defaultedThunk",process:t}}function Ge(t){return je(rt(t))}function Xe(){return{tag:"option",process:{}}}function Ye(t){return{tag:"mergeWithThunk",process:t}}function qe(t){return x(t)&&100<Ct(t).length?" removed due to size":JSON.stringify(t,null,2)}function Ke(t,n){return Lo([{path:t,getErrorInfo:n}])}function Je(e){return{extract:function(n,t){return Uo(e(t),function(t){return Ke(n,rt(t))})},toString:rt("val")}}function $e(t,n,e,o){return o(tt(t,n).getOrThunk(function(){return e(t)}))}function Qe(n,e,o,r,i){function u(t){return i.extract(e.concat([r]),t)}function t(t){return t.fold(function(){return No(vt.none())},function(t){var n=i.extract(e.concat([r]),t);return jo(n,vt.some)})}var a,c,s,l,f,d;switch(n.tag){case"required":return s=e,d=u,tt(l=o,f=r).fold(function(){return t=f,n=l,Ke(s,function(){return'Could not find valid *required* value for "'+t+'" in '+qe(n)});var t,n},d);case"defaultedThunk":return $e(o,r,n.process,u);case"option":return t(tt(o,r));case"defaultedOptionThunk":return c=n.process,t(tt(a=o,r).map(function(t){return!0===t?c(a):t}));case"mergeWithThunk":return $e(o,r,rt({}),function(t){return u(Yo(n.process(o),t))})}}function Ze(e){return{extract:function(t,n){return e().extract(t,n)},toString:function(){return e().toString()}}}function to(t){var s=$o(t),l=I(t,function(e,t){return Le(t,function(t){var n;return Yo(e,((n={})[t]=!0,n))},rt(e))},{});return{extract:function(t,n){var e,o,r,i,u,a,c=F(w(n)?[]:Ct((r=k,i=o={},u=function(t,n){i[n]=t},a=st,J(n,function(t,n){(r(t,n)?u:a)(t,n)}),o)),function(t){return!nt(l,t)});return 0===c.length?s.extract(t,n):(e=c,Ke(t,function(){return"There are unsupported fields: ["+e.join(", ")+"] specified"}))},toString:s.toString}}function no(o){return{extract:function(e,t){var n=M(t,function(t,n){return o.extract(e.concat(["["+n+"]"]),t)});return Ko(n)},toString:function(){return"array("+o.toString()+")"}}}function eo(u){return{extract:function(t,n){for(var e=[],o=0,r=u;o<r.length;o++){var i=r[o].extract(t,n);if(i.stype===jn.Value)return i;e.push(i)}return Ko(e)},toString:function(){return"oneOf("+M(u,function(t){return t.toString()}).join(", ")+")"}}}function oo(e,o){return Je(function(t){var n=typeof t;return e(t)?No(t):Lo("Expected type: "+o+" but got: "+n)})}function ro(n,a){return{extract:function(i,u){return tt(u,n).fold(function(){return t=n,Ke(i,function(){return'Choice schema did not contain choice key: "'+t+'"'});var t},function(t){return e=i,n=u,tt(o=a,r=t).fold(function(){return t=o,n=r,Ke(e,function(){return'The chosen schema: "'+n+'" did not exist in branches: '+qe(t)});var t,n},function(t){return t.extract(e.concat(["branch: "+r]),n)});var e,n,o,r})},toString:function(){return"chooseOn("+n+"). Possible values: "+Ct(a)}}}function io(n){return Je(function(t){return n(t).fold(Lo,No)})}function uo(n,t){return r=function(t){return n(t).fold(ze,He)},i=t,{extract:function(e,o){var t=Ct(o),n=no(Je(r)).extract(e,t);return Wo(n,function(t){var n=M(t,function(t){return Ne(t,t,Ue(),i)});return $o(n).extract(e,o)})},toString:function(){return"setOf("+i.toString()+")"}};var r,i}function ao(t,n,e){return zo((r=n.extract([t],o=e),Go(r,function(t){return{input:o,errors:t}})));var o,r}function co(t){return t.fold(function(t){throw new Error(ur(t))},h)}function so(t,n,e){return co(ao(t,n,e))}function lo(t,n){return ro(t,dt(n,$o))}function fo(n){return io(function(t){return wt(n,t)?Ve.value(t):Ve.error('Unsupported value: "'+t+'", choose one of "'+n.join(", ")+'".')})}function mo(t){return ar(t,t,Ue(),Zo())}function go(t,n){return ar(t,t,Ue(),n)}function po(t){return go(t,nr)}function ho(t,n){return ar(t,t,Ue(),fo(n))}function vo(t){return go(t,or)}function bo(t,n){return ar(t,t,Ue(),$o(n))}function yo(t,n){return ar(t,t,Ue(),Qo(n))}function xo(t,n){return ar(t,t,Ue(),no(n))}function wo(t){return ar(t,t,Xe(),Zo())}function So(t,n){return ar(t,t,Xe(),n)}function ko(t){return So(t,tr)}function Co(t){return So(t,nr)}function Oo(t){return So(t,or)}function _o(t,n){return So(t,no(n))}function To(t,n){return So(t,$o(n))}function Eo(t,n){return ar(t,t,Ge(n),Zo())}function Do(t,n,e){return ar(t,t,Ge(n),e)}function Bo(t,n){return Do(t,n,tr)}function Mo(t,n){return Do(t,n,nr)}function Ao(t,n,e){return Do(t,n,fo(e))}function Fo(t,n){return Do(t,n,er)}function Io(t,n){return Do(t,n,or)}function Ro(t,n,e){return Do(t,n,no(e))}function Vo(t,n,e){return Do(t,n,$o(e))}function Po(t){var n=t;return{get:function(){return n},set:function(t){n=t}}}(Gn=jn={})[Gn.Error=0]="Error",Gn[Gn.Value=1]="Value";function Ho(u){if(!c(u))throw new Error("cases must be an array");if(0===u.length)throw new Error("there must be at least one case");var a=[],e={};return St(u,function(t,o){var n=Ct(t);if(1!==n.length)throw new Error("one and only one name per case");var r=n[0],i=t[r];if(void 0!==e[r])throw new Error("duplicate key detected:"+r);if("cata"===r)throw new Error("cannot have a case named cata (sorry)");if(!c(i))throw new Error("case arguments must be an array");a.push(r),e[r]=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e.length;if(n!==i.length)throw new Error("Wrong number of arguments to case "+r+". Expected "+i.length+" ("+i+"), got "+n);return{fold:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(t.length!==u.length)throw new Error("Wrong number of arguments to fold. Expected "+u.length+", got "+t.length);return t[o].apply(null,e)},match:function(t){var n=Ct(t);if(a.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+a.join(",")+"\nActual: "+n.join(","));if(!N(a,function(t){return wt(n,t)}))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+a.join(", "));return t[r].apply(null,e)},log:function(t){console.log(t,{constructors:a,constructor:r,params:e})}}}}),e}var zo=function(t){return Pe(t,Ve.error,Ve.value)},No=He,Lo=ze,Wo=function(t,n){return t.stype===jn.Value?n(t.svalue):t},Uo=function(t,n){return t.stype===jn.Error?n(t.serror):t},jo=function(t,n){return t.stype===jn.Value?{stype:jn.Value,svalue:n(t.svalue)}:t},Go=function(t,n){return t.stype===jn.Error?{stype:jn.Error,serror:n(t.serror)}:t},Xo=Pe,Yo=We(function(t,n){return x(t)&&x(n)?Yo(t,n):n}),qo=We(function(t,n){return n}),Ko=function(t){var n,e,o=(n=[],e=[],St(t,function(t){Pe(t,function(t){return e.push(t)},function(t){return n.push(t)})}),{values:n,errors:e});return 0<o.errors.length?r(Lo,ft)(o.errors):No(o.values)},Jo=Je(No),$o=function(e){return{extract:function(i,u){for(var a={},c=[],t=0,n=e;t<n.length;t++)Le(n[t],function(t,n,e,o){var r=Qe(e,i,u,t,o);Xo(r,function(t){c.push.apply(c,t)},function(t){a[n]=t})},function(t,n){a[t]=n(u)});return 0<c.length?Lo(c):No(a)},toString:function(){return"obj{\n"+M(e,function(t){return Le(t,function(t,n,e,o){return t+" -> "+o.toString()},function(t,n){return"state("+t+")"})}).join("\n")+"}"}}},Qo=r(no,$o),Zo=rt(Jo),tr=oo(u,"number"),nr=oo(y,"string"),er=oo(w,"boolean"),or=oo(S,"function"),rr=function(n){if(Object(n)!==n)return!0;switch({}.toString.call(n).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(n).every(function(t){return rr(n[t])});default:return!1}},ir=Je(function(t){return rr(t)?No(t):Lo("Expected value to be acceptable for sending via postMessage")}),ur=function(t){return"Errors: \n"+M(10<(n=t.errors).length?n.slice(0,10).concat([{path:[],getErrorInfo:rt("... (only showing first ten failures)")}]):n,function(t){return"Failed path: ("+t.path.join(" > ")+")\n"+t.getErrorInfo()}).join("\n")+"\n\nInput object: "+qe(t.input);var n},ar=Ne,cr=function(t,n){return{tag:"custom",newKey:t,instantiator:n}};function sr(t,n){return(e={})[t]=n,e;var e}function lr(t){return n={},St(t,function(t){n[t.key]=t.value}),n;var n}function fr(t){return S(t)?t:T}function dr(t,n,e){for(var o=t.dom,r=fr(e);o.parentNode;){var o=o.parentNode,i=At.fromDom(o),u=n(i);if(u.isSome())return u;if(r(i))break}return vt.none()}function mr(t,n,e){var o=n(t),r=fr(e);return o.orThunk(function(){return r(t)?vt.none():dr(t,n,r)})}function gr(t,n){return Lt(t.element,n.event.target)}function pr(t){if(!nt(t,"can")&&!nt(t,"abort")&&!nt(t,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(t,null,2)+" does not have can, abort, or run!");return lt(lt({},ai),t)}function hr(t){return rt("alloy."+t)}function vr(t,n){nu(t,t.element,n,{})}function br(t,n,e){nu(t,t.element,n,e)}function yr(t){vr(t,Ii())}function xr(t,n,e){nu(t,n,e,{})}function wr(t,n,e,o){t.getSystem().triggerEvent(e,n,o.event)}function Sr(t,n){return{key:t,value:pr({abort:n})}}function kr(t){return{key:t,value:pr({run:function(t,n){n.event.prevent()}})}}function Cr(t,n){return{key:t,value:pr({run:n})}}function Or(t,e,o){return{key:t,value:pr({run:function(t,n){e.apply(void 0,[t,n].concat(o))}})}}function _r(t){return function(e){return{key:t,value:pr({run:function(t,n){gr(t,n)&&e(t,n)}})}}}function Tr(t,n,e){var o,r=n.partUids[e];return Cr(o=t,function(t,n){t.getSystem().getByUid(r).each(function(t){wr(t,t.element,o,n)})})}function Er(t,r){return Cr(t,function(n,t){var e=t.event,o=n.getSystem().getByDom(e.target).getOrThunk(function(){return mr(e.target,function(t){return n.getSystem().getByDom(t).toOptional()},T).getOr(n)});r(n,o,t)})}function Dr(t){return Cr(t,function(t,n){n.cut()})}function Br(t,n){return _r(t)(n)}function Mr(t){return t.dom.innerHTML}function Ar(t,n){var e,o,r=Ut(t).dom,i=At.fromDom(r.createDocumentFragment());An(i,(e=n,(o=(r||document).createElement("div")).innerHTML=e,Kt(At.fromDom(o)))),Fn(t),Te(t,i)}function Fr(t){if(Zt(t))return"#shadow-root";var n=At.fromDom(t.dom.cloneNode(!1)),e=At.fromTag("div"),o=At.fromDom(n.dom.cloneNode(!0));return Te(e,o),Mr(e)}function Ir(t){var n=(new Date).getTime();return t+"_"+Math.floor(1e9*Math.random())+ ++su+String(n)}function Rr(t){var n=Xn(t)?t.dom[mu]:null;return vt.from(n)}function Vr(n){function e(t){return"The component must be in a context to execute: "+t+(n?"\n"+Fr(n().element)+" is not in context.":"")}function t(t){return function(){throw new Error(e(t))}}function o(t){return function(){console.warn(e(t))}}return{debugInfo:rt("fake"),triggerEvent:o("triggerEvent"),triggerFocus:o("triggerFocus"),triggerEscape:o("triggerEscape"),broadcast:o("broadcast"),broadcastOn:o("broadcastOn"),broadcastEvent:o("broadcastEvent"),build:t("build"),addToWorld:t("addToWorld"),removeFromWorld:t("removeFromWorld"),addToGui:t("addToGui"),removeFromGui:t("removeFromGui"),getByUid:t("getByUid"),getByDom:t("getByDom"),isConnected:T}}function Pr(t,n){var e=t.toString(),o=e.indexOf(")")+1,r=e.indexOf("("),i=e.substring(r+1,o-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:n,parameters:bu(i)}},t}function Hr(t){return sr(yu,t)}function zr(o){return t=function(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];return o.apply(void 0,H([t.getApis(),t],n,!1))},e=(n=o.toString()).indexOf(")")+1,r=n.indexOf("("),i=n.substring(r+1,e-1).split(/,\s*/),t.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:bu(i.slice(1))}},t;var t,n,e,r,i}function Nr(t,r){var i={};return J(t,function(t,o){J(t,function(t,n){var e=tt(i,n).getOr([]);i[n]=e.concat([r(o,t)])})}),i}function Lr(t){return{classes:E(t.classes)?[]:t.classes,attributes:E(t.attributes)?{}:t.attributes,styles:E(t.styles)?{}:t.styles}}function Wr(t){return t.cHandler}function Ur(t,n){return{name:t,handler:n}}function jr(t,n,e){var o=n[e];return o?function(u,t,a){try{var n=G(t,function(t,n){var e=t.name,o=n.name,r=a.indexOf(e),i=a.indexOf(o);if(-1===r)throw new Error("The ordering for "+u+" does not have an entry for "+e+".\nOrder specified: "+JSON.stringify(a,null,2));if(-1===i)throw new Error("The ordering for "+u+" does not have an entry for "+o+".\nOrder specified: "+JSON.stringify(a,null,2));return r<i?-1:i<r?1:0});return Ve.value(n)}catch(t){return Ve.error([t])}}("Event: "+e,t,o).map(function(t){var e,n,o,r,i=M(t,function(t){return t.handler});return{can:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return R(n,function(t,n){return t&&n.can.apply(void 0,e)},!0)},abort:(o=n=e=i,r=function(t){return t.abort},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return R(o,function(t,n){return t||r(n).apply(void 0,e)},!1)}),run:function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];St(e,function(t){t.run.apply(void 0,n)})}}}):Ve.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(M(t,function(t){return t.name}),null,2)])}function Gr(t,n){var e=un(t,n);return void 0===e||""===e?[]:e.split(" ")}function Xr(t){return void 0!==t.dom.classList}function Yr(t,n){var e,o,r;Xr(t)?t.dom.classList.add(n):(o=n,r=Gr(e=t,"class").concat([o]),on(e,"class",r.join(" ")))}function qr(t,n){var e,o,r,i;Xr(t)?t.dom.classList.remove(n):(r=n,0<(i=F(Gr(o=t,"class"),function(t){return t!==r})).length?on(o,"class",i.join(" ")):sn(o,"class")),0===(Xr(e=t)?e.dom.classList:Gr(e,"class")).length&&sn(e,"class")}function Kr(t,n){return Xr(t)&&t.dom.classList.contains(n)}function Jr(n,t){St(t,function(t){Yr(n,t)})}function $r(n,t){St(t,function(t){qr(n,t)})}function Qr(t){return t.dom.value}function Zr(t,n){if(void 0===n)throw new Error("Value.set was undefined");t.dom.value=n}function ti(t){var e,n,o,r,i=(e=tt(t,"behaviours").getOr({}),z(Ct(e),function(t){var n=e[t];return k(n)?[n.me]:[]}));return n=t,r=M(o=i,function(t){return To(t.name(),[mo("config"),Eo("state",xu)])}),{list:o,data:dt(ao("component.behaviours",$o(r),n.behaviours).fold(function(t){throw new Error(ur(t)+"\nComplete spec:\n"+JSON.stringify(n,null,2))},h),function(t){return rt(t.map(function(t){return{config:t.config,state:t.state.init(t.config)}}))})}}function ni(t,n,e){var o,r,i=lt(lt({},(o=t).dom),{uid:o.uid,domChildren:M(o.components,function(t){return t.element})}),u=t.domModification.fold(function(){return Lr({})},Lr),a=0<n.length?function(n,t,e,o){var r=lt({},t);function i(t){return I(t,function(t,n){return lt(lt({},n.modification),t)},{})}St(e,function(t){r[t.name()]=t.exhibit(n,o)});var u=Nr(r,function(t,n){return{name:t,modification:n}});return Lr({classes:I(u.classes,function(t,n){return n.modification.concat(t)},[]),attributes:i(u.attributes),styles:i(u.styles)})}(e,{"alloy.base.modification":u},n,i):u;return lt(lt({},r=i),{attributes:lt(lt({},r.attributes),a.attributes),styles:lt(lt({},r.styles),a.styles),classes:r.classes.concat(a.classes)})}function ei(t,n,e){var o,r,i,u,a,c={"alloy.base.behaviour":t.events},s=t.eventOrder;return r=e,i=n,o=Nr(lt(lt({},c),(u=r,a={},St(i,function(t){a[t.name()]=t.handlers(u)}),a)),Ur),Su(o,s).getOrDie()}function oi(t){var e,n,o,r,i,u,a,c,s,l,f=hu(t),d=f.events,m=B(f,["events"]),g=M(tt(m,"components").getOr([]),Tu),p=lt(lt({},m),{events:lt(lt({},cu),d),components:g});return Ve.value((n=Po(vu),o=co(ao("custom.definition",Cu,e=p)),r=ti(e),i=r.list,u=r.data,a=function(t){var n=At.fromTag(t.tag);rn(n,t.attributes),Jr(n,t.classes),mn(n,t.styles),t.innerHtml.each(function(t){return Ar(n,t)});var e=t.domChildren;return An(n,e),t.value.each(function(t){Zr(n,t)}),t.uid,gu(n,t.uid),n}(ni(o,i,u)),c=ei(o,i,u),s=Po(o.components),l={uid:e.uid,getSystem:n.get,config:function(t){var n=u;return(S(n[t.name()])?n[t.name()]:function(){throw new Error("Could not find "+t.name()+" in "+JSON.stringify(e,null,2))})()},hasConfigured:function(t){return S(u[t.name()])},spec:e,readState:function(t){return u[t]().map(function(t){return t.state.readState()}).getOr("not enabled")},getApis:function(){return o.apis},connect:function(t){n.set(t)},disconnect:function(){n.set(Vr(h))},element:a,syncComponents:function(){var t=z(Kt(a),function(t){return n.get().getByDom(t).fold(function(){return[]},j)});s.set(t)},components:s.get,events:c}));function h(){return l}}function ri(t){var n=At.fromText(t);return Ou({element:n})}Ho([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);var ii,ui,ai={can:D,abort:T,run:st},ci=rt,si=ci("touchstart"),li=ci("touchmove"),fi=ci("touchend"),di=ci("touchcancel"),mi=ci("mousedown"),gi=ci("mousemove"),pi=ci("mouseout"),hi=ci("mouseup"),vi=ci("mouseover"),bi=ci("focusin"),yi=ci("focusout"),xi=ci("keydown"),wi=ci("keyup"),Si=ci("input"),ki=ci("change"),Ci=ci("click"),Oi=ci("transitioncancel"),_i=ci("transitionend"),Ti=ci("transitionstart"),Ei=ci("selectstart"),Di={tap:hr("tap")},Bi=hr("focus"),Mi=hr("blur.post"),Ai=hr("paste.post"),Fi=hr("receive"),Ii=hr("execute"),Ri=hr("focus.item"),Vi=Di.tap,Pi=hr("longpress"),Hi=hr("sandbox.close"),zi=hr("typeahead.cancel"),Ni=hr("system.init"),Li=hr("system.touchmove"),Wi=hr("system.touchend"),Ui=hr("system.scroll"),ji=hr("system.resize"),Gi=hr("system.attached"),Xi=hr("system.detached"),Yi=hr("system.dismissRequested"),qi=hr("system.repositionRequested"),Ki=hr("focusmanager.shifted"),Ji=hr("slotcontainer.visibility"),$i=hr("change.tab"),Qi=hr("dismiss.tab"),Zi=hr("highlight"),tu=hr("dehighlight"),nu=function(t,n,e,o){var r=lt({target:n},o);t.getSystem().triggerEvent(e,n,r)},eu=lr,ou=_r(Gi()),ru=_r(Xi()),iu=_r(Ni()),uu=(ii=Ii(),function(t){return Cr(ii,t)}),au=eu([{key:Bi(),value:pr({can:function(t,n){var e,o=n.event,r=o.originator,i=o.target;return!(Lt(e=r,t.element)&&!Lt(e,i)&&(console.warn(Bi()+" did not get interpreted by the desired target. \nOriginator: "+Fr(r)+"\nTarget: "+Fr(i)+"\nCheck the "+Bi()+" event handlers"),1))}})}]),cu=Object.freeze({__proto__:null,events:au}),su=0,lu=rt("alloy-id-"),fu=rt("data-alloy-id"),du=lu(),mu=fu(),gu=function(t,n){Object.defineProperty(t.dom,mu,{value:n,writable:!0})},pu=Ir,hu=h,vu=Vr(),bu=function(t){return M(t,function(t){return Bt(t,"/*")?t.substring(0,t.length-"/*".length):t})},yu=Ir("alloy-premade"),xu={init:function(){return wu({readState:rt("No State required")})}},wu=function(t){return t},Su=function(t,a){var n,e,o,r,i,u,c=$(t,function(r,u){return(1===r.length?Ve.value(r[0].handler):jr(r,a,u)).map(function(t){var n,i,e=(i=S(n=t)?{can:D,abort:T,run:n}:n,function(t,n){for(var e=[],o=2;o<arguments.length;o++)e[o-2]=arguments[o];var r=[t,n].concat(e);i.abort.apply(void 0,r)?n.stop():i.can.apply(void 0,r)&&i.run.apply(void 0,r)}),o=1<r.length?F(a[u],function(n){return d(r,function(t){return t.name===n})}).join(" > "):r[0].name;return sr(u,{handler:e,purpose:o})})});return n={},e=[],o=[],St(c,function(t){t.fold(function(t){e.push(t)},function(t){o.push(t)})}),0<(u={errors:e,values:o}).errors.length?Ve.error(ft(u.errors)):(i=n,0===(r=u.values).length?Ve.value(i):Ve.value(Yo(i,qo.apply(void 0,r))))},ku="alloy.base.behaviour",Cu=$o([ar("dom","dom",Ue(),$o([mo("tag"),Eo("styles",{}),Eo("classes",[]),Eo("attributes",{}),wo("value"),wo("innerHtml")])),mo("components"),mo("uid"),Eo("events",{}),Eo("apis",{}),ar("eventOrder","eventOrder",((ui={})[Ii()]=["disabling",ku,"toggling","typeaheadevents"],ui[Bi()]=[ku,"focusing","keying"],ui[Ni()]=[ku,"disabling","toggling","representing"],ui[Si()]=[ku,"representing","streaming","invalidating"],ui[Xi()]=[ku,"representing","item-events","tooltipping"],ui[mi()]=["focusing",ku,"item-type-events"],ui[si()]=["focusing",ku,"item-type-events"],ui[vi()]=["item-type-events","tooltipping"],ui[Fi()]=["receiving","reflecting","tooltipping"],Ye(rt(ui))),Zo()),wo("domModification")]),Ou=function(t){var n=so("external.component",to([mo("element"),wo("uid")]),t),e=Po(Vr()),o=n.uid.getOrThunk(function(){return pu("external")});gu(n.element,o);var r={uid:o,getSystem:e.get,config:vt.none,hasConfigured:T,connect:function(t){e.set(t)},disconnect:function(){e.set(Vr(function(){return r}))},getApis:function(){return{}},element:n.element,spec:t,readState:rt("No state"),syncComponents:st,components:rt([]),events:{}};return Hr(r)},_u=pu,Tu=function(t){return tt(t,yu).getOrThunk(function(){return oi(Tt(t,"uid")?t:lt({uid:_u("")},t)).getOrDie()})},Eu=Hr;function Du(t,n,e,o,r){return t(e,o)?vt.some(e):S(r)&&r(e)?vt.none():n(e,o,r)}function Bu(t,n,e){for(var o=t.dom,r=S(e)?e:T;o.parentNode;){var o=o.parentNode,i=At.fromDom(o);if(n(i))return vt.some(i);if(r(i))break}return vt.none()}function Mu(t,n,e){return Du(function(t,n){return n(t)},Bu,t,n,e)}function Au(t,n,e){return Mu(t,n,e).isSome()}function Fu(t,n,e){return Bu(t,function(t){return zt(t,n)},e)}function Iu(t,n){return e=n,Nt(o=void 0===t?document:t.dom)?vt.none():vt.from(o.querySelector(e)).map(At.fromDom);var e,o}function Ru(t,n,e){return Du(zt,Fu,t,n,e)}function Vu(){var n=Ir("aria-owns");return{id:n,link:function(t){on(t,"aria-owns",n)},unlink:function(t){sn(t,"aria-owns")}}}var Pu,Hu,zu=function(n,t){return Au(t,function(t){return Lt(t,n.element)},T)||(e=n,Mu(t,function(t){if(!Xn(t))return!1;var n=un(t,"id");return void 0!==n&&-1<n.indexOf("aria-owns")}).bind(function(t){var n=un(t,"id");return Iu(ge(t),'[aria-owns="'+n+'"]')}).exists(function(t){return zu(e,t)}));var e},Nu="unknown";function Lu(n,t,e){var o,r,i,u;switch(tt(Wu.get(),n).orThunk(function(){return K(Ct(Wu.get()),function(t){return-1<n.indexOf(t)?vt.some(Wu.get()[t]):vt.none()})}).getOr(Pu.NORMAL)){case Pu.NORMAL:return e(ju());case Pu.LOGGING:var a=(o=n,r=t,i=[],u=(new Date).getTime(),{logEventCut:function(t,n,e){i.push({outcome:"cut",target:n,purpose:e})},logEventStopped:function(t,n,e){i.push({outcome:"stopped",target:n,purpose:e})},logNoParent:function(t,n,e){i.push({outcome:"no-parent",target:n,purpose:e})},logEventNoHandlers:function(t,n){i.push({outcome:"no-handlers-left",target:n})},logEventResponse:function(t,n,e){i.push({outcome:"response",purpose:e,target:n})},write:function(){var t=(new Date).getTime();wt(["mousemove","mouseover","mouseout",Ni()],o)||console.log(o,{event:o,time:t-u,target:r.dom,sequence:M(i,function(t){return wt(["cut","stopped","response"],t.outcome)?"{"+t.purpose+"} "+t.outcome+" at ("+Fr(t.target)+")":t.outcome})})}}),c=e(a);return a.write(),c;case Pu.STOP:return!0}}(Hu=Pu=Pu||{})[Hu.STOP=0]="STOP",Hu[Hu.NORMAL=1]="NORMAL",Hu[Hu.LOGGING=2]="LOGGING";var Wu=Po({}),Uu=["alloy/data/Fields","alloy/debugging/Debugging"],ju=rt({logEventCut:st,logEventStopped:st,logNoParent:st,logEventNoHandlers:st,logEventResponse:st,write:st}),Gu=rt([mo("menu"),mo("selectedMenu")]),Xu=rt([mo("item"),mo("selectedItem")]);function Yu(){return bo("markers",[mo("backgroundMenu")].concat(Gu()).concat(Xu()))}function qu(t){return bo("markers",M(t,mo))}function Ku(t,n,e){return void 0!==(o=new Error).stack&&V(o.stack.split("\n"),function(n){return 0<n.indexOf("alloy")&&!d(Uu,function(t){return-1<n.indexOf(t)})}).getOr(Nu),ar(n,n,e,io(function(e){return Ve.value(function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.apply(void 0,t)})}));var o}function Ju(t){return Ku(0,t,Ge(st))}function $u(t){return Ku(0,t,Ge(vt.none))}function Qu(t){return Ku(0,t,Ue())}function Zu(t){return Ku(0,t,Ue())}function ta(t,n){return cr(t,rt(n))}function na(t){return cr(t,h)}function ea(t,n,e,o,r,i,u,a){return{x:t,y:n,bubble:e,direction:o,placement:r,restriction:i,label:u+"-"+r,alwaysFit:a=void 0!==a&&a}}function oa(t,n,e,o){var r=t+n;return o<r?e:r<e?o:r}function ra(e,n){return U(["left","right","top","bottom"],function(t){return tt(n,t).map(function(n){return function(t){switch(n){case 1:return t.x;case 0:return t.x+t.width;case 2:return t.y;case 3:return t.y+t.height}}(e)})})}function ia(t,n){return t.x+t.width/2-n.width/2}function ua(t,n){return t.x+t.width-n.width}function aa(t,n){return t.y-n.height}function ca(t){return t.y+t.height}function sa(t,n){return t.y+t.height/2-n.height/2}function la(t,n,e){return ea(t.x+t.width,sa(t,n),e.east(),Wa(),"east",ra(t,{left:0}),Ga)}function fa(t,n,e){return ea(t.x-n.width,sa(t,n),e.west(),Ua(),"west",ra(t,{right:1}),Ga)}function da(){return[Xa,Ya,qa,Ka,$a,Ja,la,fa]}function ma(){return[Ya,Xa,Ka,qa,$a,Ja,la,fa]}function ga(){return[qa,Ka,Xa,Ya,Ja,$a]}function pa(){return[Ka,qa,Ya,Xa,Ja,$a]}function ha(){return[Xa,Ya,qa,Ka,$a,Ja]}function va(){return[Ya,Xa,Ka,qa,$a,Ja]}function ba(e,o,r){return iu(function(t,n){r(t,e,o)})}function ya(t){return{key:t,value:void 0}}function xa(t){var n,e,o,r,i,u,a,c,s=so("Creating behaviour: "+t.name,ec,t);return n=s.fields,e=s.name,o=s.active,r=s.apis,i=s.extra,u=s.state,a=to(n),c=To(e,[So("config",to(n))]),tc(a,c,e,o,r,i,u)}function wa(t){var n,e=so("Creating behaviour: "+t.name,oc,t),o=lo(e.branchKey,e.branches),r=e.name,i=e.active,u=e.apis,a=e.extra,c=e.state,s=To(r,[So("config",n=o)]);return tc(n,s,r,i,u,a,c)}function Sa(){return At.fromDom(document)}function ka(t){return t.dom.focus()}function Ca(t){var n=ge(t).dom;return t.dom===n.activeElement}function Oa(t){return void 0===t&&(t=Sa()),vt.from(t.dom.activeElement).map(At.fromDom)}function _a(n){return Oa(ge(n)).filter(function(t){return n.dom.contains(t.dom)})}function Ta(t,e){var o=ge(e),n=Oa(o).bind(function(n){function t(t){return Lt(n,t)}var r,i;return t(e)?vt.some(e):(r=t,(i=function(t){for(var n=0;n<t.childNodes.length;n++){var e=At.fromDom(t.childNodes[n]);if(r(e))return vt.some(e);var o=i(t.childNodes[n]);if(o.isSome())return o}return vt.none()})(e.dom))}),r=t(e);return n.each(function(n){Oa(o).filter(function(t){return Lt(t,n)}).fold(function(){ka(n)},st)}),r}function Ea(t,n,e,o,r){function i(t){return t+"px"}return{position:t,left:n.map(i),top:e.map(i),right:o.map(i),bottom:r.map(i)}}function Da(t,n){var e;gn(t,lt(lt({},e=n),{position:vt.some(e.position)}))}function Ba(t,n,e,o,r,i){var u=n.rect,a=u.x-e,c=u.y-o,s=r-(a+u.width),l=i-(c+u.height),f=vt.some(a),d=vt.some(c),m=vt.some(s),g=vt.some(l),p=vt.none();return n.direction.fold(function(){return Ea(t,f,d,p,p)},function(){return Ea(t,p,d,m,p)},function(){return Ea(t,f,p,p,g)},function(){return Ea(t,p,p,m,g)},function(){return Ea(t,f,d,p,p)},function(){return Ea(t,f,p,p,g)},function(){return Ea(t,f,d,p,p)},function(){return Ea(t,p,d,m,p)})}function Ma(t,r){return t.fold(function(){var t=r.rect;return Ea("absolute",vt.some(t.x),vt.some(t.y),vt.none(),vt.none())},function(t,n,e,o){return Ba("absolute",r,t,n,e,o)},function(t,n,e,o){return Ba("fixed",r,t,n,e,o)})}function Aa(t,n){var e=C(zn,n),o=t.fold(e,e,function(){var t=Rn();return zn(n).translate(-t.left,-t.top)}),r=_n(n),i=Sn(n);return Me(o.left,o.top,r,i)}rt($o(Xu().concat(Gu())));var Fa=rt($o(Xu())),Ia=rt(bo("initSize",[mo("numColumns"),mo("numRows")])),Ra=Ho([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),Va=Ra.southeast,Pa=Ra.southwest,Ha=Ra.northeast,za=Ra.northwest,Na=Ra.south,La=Ra.north,Wa=Ra.east,Ua=Ra.west,ja=function(t,n,e){return Math.min(Math.max(t,n),e)},Ga="layout",Xa=function(t,n,e){return ea(t.x,ca(t),e.southeast(),Va(),"southeast",ra(t,{left:1,top:3}),Ga)},Ya=function(t,n,e){return ea(ua(t,n),ca(t),e.southwest(),Pa(),"southwest",ra(t,{right:0,top:3}),Ga)},qa=function(t,n,e){return ea(t.x,aa(t,n),e.northeast(),Ha(),"northeast",ra(t,{left:1,bottom:2}),Ga)},Ka=function(t,n,e){return ea(ua(t,n),aa(t,n),e.northwest(),za(),"northwest",ra(t,{right:0,bottom:2}),Ga)},Ja=function(t,n,e){return ea(ia(t,n),aa(t,n),e.north(),La(),"north",ra(t,{bottom:2}),Ga)},$a=function(t,n,e){return ea(ia(t,n),ca(t),e.south(),Na(),"south",ra(t,{top:3}),Ga)},Qa=Object.freeze({__proto__:null,events:function(a){return eu([Cr(Fi(),function(r,t){var n,i=a.channels,e=Ct(i),u=t,o=(n=u).universal?e:F(e,function(t){return wt(n.channels,t)});St(o,function(t){var n=i[t],e=n.schema,o=so("channel["+t+"] data\nReceiver: "+Fr(r.element),e,u.data);n.onReceive(r,o)})})])}}),Za=[go("channels",uo(Ve.value,to([Qu("onReceive"),Eo("schema",Zo())])))],tc=function(e,t,f,n,o,r,i){function u(t){return nt(t,f)?t[f]():vt.none()}var a=dt(o,function(t,n){return r=f,e=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var o=[e].concat(t);return e.config({name:rt(r)}).fold(function(){throw new Error("We could not find any behaviour configuration for: "+r+". Using API: "+u)},function(t){var n=Array.prototype.slice.call(o,1);return i.apply(void 0,[e,t.config,t.state].concat(n))})},o=u=n,a=(i=t).toString(),c=a.indexOf(")")+1,s=a.indexOf("("),l=a.substring(s+1,c-1).split(/,\s*/),e.toFunctionAnnotation=function(){return{name:o,parameters:bu(l.slice(0,1).concat(l.slice(3)))}},e;var r,i,u,e,o,a,c,s,l}),c=dt(r,Pr),s=lt(lt(lt({},c),a),{revoke:C(ya,f),config:function(t){var n=so(f+"-config",e,t);return{key:f,value:{config:n,me:s,configAsRaw:Rt(function(){return so(f+"-config",e,t)}),initialConfig:t,state:i}}},schema:rt(t),exhibit:function(t,e){return Et(u(t),tt(n,"exhibit"),function(t,n){return n(e,t.config,t.state)}).getOrThunk(function(){return Lr({})})},name:rt(f),handlers:function(t){return u(t).map(function(t){return tt(n,"events").getOr(function(){return{}})(t.config,t.state)}).getOr({})}});return s},nc=lr,ec=to([mo("fields"),mo("name"),Eo("active",{}),Eo("apis",{}),Eo("state",xu),Eo("extra",{})]),oc=to([mo("branchKey"),mo("branches"),mo("name"),Eo("active",{}),Eo("apis",{}),Eo("state",xu),Eo("extra",{})]),rc=rt(void 0),ic=xa({fields:Za,name:"receiving",active:Qa}),uc=Object.freeze({__proto__:null,exhibit:function(t,n){return Lr({classes:[],styles:n.useFixed()?{}:{position:"relative"}})}}),ac=Ho([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),cc=function(t,n,e){var o=ke(n,e);return t.fold(rt(o),rt(o),function(){var t=Rn();return o.tran