Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@pelagiccreatures/sargasso

Package Overview
Dependencies
Maintainers
1
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pelagiccreatures/sargasso - npm Package Compare versions

Comparing version 2.3.2 to 2.3.3

dist/component/index.mjs

9

dist/sargasso.iife.min.js

@@ -1,9 +0,2 @@

var SargassoModule=function(e){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var s="object"==typeof t&&t&&t.Object===Object&&t,i=s,n="object"==typeof self&&self&&self.Object===Object&&self,o=i||n||Function("return this")(),a=o.Symbol;var l=function arrayMap$1(e,t){for(var s=-1,i=null==e?0:e.length,n=Array(i);++s<i;)n[s]=t(e[s],s,e);return n},h=Array.isArray,u=a,p=Object.prototype,f=p.hasOwnProperty,b=p.toString,v=u?u.toStringTag:void 0;var m=function getRawTag$1(e){var t=f.call(e,v),s=e[v];try{e[v]=void 0;var i=!0}catch(e){}var n=b.call(e);return i&&(t?e[v]=s:delete e[v]),n},y=Object.prototype.toString;var _=m,w=function objectToString$1(e){return y.call(e)},O=a?a.toStringTag:void 0;var A=function baseGetTag$5(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":O&&O in Object(e)?_(e):w(e)};var $=function isObjectLike$5(e){return null!=e&&"object"==typeof e},x=A,j=$;var D=function isSymbol$2(e){return"symbol"==typeof e||j(e)&&"[object Symbol]"==x(e)},T=l,R=h,L=D,F=a?a.prototype:void 0,z=F?F.toString:void 0;var W=function baseToString$1(e){if("string"==typeof e)return e;if(R(e))return T(e,baseToString$1)+"";if(L(e))return z?z.call(e):"";var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t},U=W;var B=function toString$4(e){return null==e?"":U(e)};var q=function baseSlice$1(e,t,s){var i=-1,n=e.length;t<0&&(t=-t>n?0:n+t),(s=s>n?n:s)<0&&(s+=n),n=t>s?0:s-t>>>0,t>>>=0;for(var o=Array(n);++i<n;)o[i]=e[i+t];return o};var Q=function castSlice$1(e,t,s){var i=e.length;return s=void 0===s?i:s,!t&&s>=i?e:q(e,t,s)},G=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");var J=function hasUnicode$2(e){return G.test(e)};var Y=function asciiToArray$1(e){return e.split("")},K="\\ud800-\\udfff",X="["+K+"]",ee="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",te="\\ud83c[\\udffb-\\udfff]",se="[^"+K+"]",re="(?:\\ud83c[\\udde6-\\uddff]){2}",ie="[\\ud800-\\udbff][\\udc00-\\udfff]",ne="(?:"+ee+"|"+te+")"+"?",oe="[\\ufe0e\\ufe0f]?",ae=oe+ne+("(?:\\u200d(?:"+[se,re,ie].join("|")+")"+oe+ne+")*"),le="(?:"+[se+ee+"?",ee,re,ie,X].join("|")+")",he=RegExp(te+"(?="+te+")|"+le+ae,"g");var ce=Y,ue=J,de=function unicodeToArray$1(e){return e.match(he)||[]};var pe=Q,fe=J,be=function stringToArray$1(e){return ue(e)?de(e):ce(e)},ge=B;var ve=function createCaseFirst$1(e){return function(t){t=ge(t);var s=fe(t)?be(t):void 0,i=s?s[0]:t.charAt(0),n=s?pe(s,1).join(""):t.slice(1);return i[e]()+n}}("toUpperCase"),me=B,ye=ve;var _e=function capitalize$1(e){return ye(me(e).toLowerCase())};var we=function arrayReduce$1(e,t,s,i){var n=-1,o=null==e?0:e.length;for(i&&o&&(s=e[++n]);++n<o;)s=t(s,e[n],n,e);return s};var Oe=function basePropertyOf$1(e){return function(t){return null==e?void 0:e[t]}}({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Ae=B,$e=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,xe=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");var Se=function deburr$1(e){return(e=Ae(e))&&e.replace($e,Oe).replace(xe,"")},Ee=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var je=function asciiWords$1(e){return e.match(Ee)||[]},Ce=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var ke=function hasUnicodeWord$1(e){return Ce.test(e)},Me="\\ud800-\\udfff",De="\\u2700-\\u27bf",Pe="a-z\\xdf-\\xf6\\xf8-\\xff",Te="A-Z\\xc0-\\xd6\\xd8-\\xde",He="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Re="["+He+"]",Le="\\d+",Fe="["+De+"]",ze="["+Pe+"]",Ne="[^"+Me+He+Le+De+Pe+Te+"]",Ie="(?:\\ud83c[\\udde6-\\uddff]){2}",We="[\\ud800-\\udbff][\\udc00-\\udfff]",Ve="["+Te+"]",Ue="(?:"+ze+"|"+Ne+")",Be="(?:"+Ve+"|"+Ne+")",qe="(?:['’](?:d|ll|m|re|s|t|ve))?",Qe="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ge="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",Ze="[\\ufe0e\\ufe0f]?",Je=Ze+Ge+("(?:\\u200d(?:"+["[^"+Me+"]",Ie,We].join("|")+")"+Ze+Ge+")*"),Ye="(?:"+[Fe,Ie,We].join("|")+")"+Je,Ke=RegExp([Ve+"?"+ze+"+"+qe+"(?="+[Re,Ve,"$"].join("|")+")",Be+"+"+Qe+"(?="+[Re,Ve+Ue,"$"].join("|")+")",Ve+"?"+Ue+"+"+qe,Ve+"+"+Qe,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Le,Ye].join("|"),"g");var Xe=je,et=ke,tt=B,st=function unicodeWords$1(e){return e.match(Ke)||[]};var rt=we,it=Se,nt=function words$1(e,t,s){return e=tt(e),void 0===(t=s?void 0:t)?et(e)?st(e):Xe(e):e.match(t)||[]},ot=RegExp("['’]","g");var at=function createCompounder$2(e){return function(t){return rt(nt(it(t).replace(ot,"")),e,"")}},lt=_e,ht=at((function(e,t,s){return t=t.toLowerCase(),e+(s?lt(t):t)}));const ct={},setValidator=(e,t)=>{ct[e]=t};setValidator("isDefined",(e=>void 0!==e)),setValidator("isUnDefined",(e=>void 0===e)),setValidator("isNull",(e=>null===e)),setValidator("isElement",(e=>e&&(e instanceof Element||e instanceof Window))),setValidator("isEventTarget",(e=>e&&e instanceof EventTarget)),setValidator("isString",(e=>e&&("string"==typeof e||e instanceof String))),setValidator("isArray",(e=>e&&e instanceof Array)),setValidator("notEmpty",(e=>e instanceof Array?0!==e.length:""!==e)),setValidator("isEmpty",(e=>void 0===e||!e||(e instanceof Array?0===e.length:""===e))),setValidator("isObject",(e=>e&&e instanceof Object)),setValidator("isFunction",(e=>e&&"function"==typeof e));const validate=(e,t,s)=>{const i=s.map((e=>{if(e instanceof Array){return-1!==e.map((e=>ct[e]&&ct[e](t))).indexOf(!0)}return ct[e]&&ct[e](t)}));if(-1!==i.indexOf(!1))throw new Error("call to "+e+" invalid value: "+t+" "+s,0+i)},ut=new WeakMap,hasClass=(e,t)=>(validate("hasClass element",e,["isDefined","isElement"]),validate("hasClass cssClass",t,["isDefined","notEmpty","isString"]),e.classList.contains(t)),isVisible=e=>(validate("isVisible element",e,["isDefined","isElement"]),!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)),setMetaData=(e,t,s)=>{validate("setMetaData element",e,["isDefined","isElement"]),validate("setMetaData k",t,["isDefined","isString"]),validate("setMetaData v",s,[["isUnDefined","isNull","isString","isObject"]]);const i=ut.get(e)||{};s?i[t]=s:delete i[t],ut.set(e,i)},getMetaData=(e,t)=>{validate("getMetaData element",e,["isDefined","isElement"]),validate("getMetaData k",t,["isDefined","isString"]);const s=ut.get(e)||{};return t?s[t]:s},on=function(e,t,s,i,n,o,a){"function"==typeof i&&(a=o,o=n,n=i,i=void 0),validate("on uid",e,["isDefined","notEmpty"]),validate("on container",t,["isDefined","isEventTarget"]),validate("on events",s,["isDefined","isString"]),validate("on fn",n,["isDefined","isFunction"]),validate("on selector",i,[["isEmpty","isString"]]);const l="on:"+e+"-"+s+"-"+i;if(getMetaData(t,l))return void console.error("Error: Sargasso utils.on: duplicate event handler specification. %o %s",t,l);const h={uid:e,events:s,selector:i||void 0,fn:o=>{a&&off(e,t,s,i),i?Array.from(t.querySelectorAll(i)).forEach((e=>{(o.target===e||e.contains(o.target))&&n(o,e)})):n(o)},options:o||!1};setMetaData(t,l,h),s.split(/[\s,]+/).forEach((e=>{t.addEventListener(e.trim(),h.fn,h.options)}))},off=function(e,t,s,i){validate("off uid",e,["isDefined","notEmpty"]),validate("off container",t,["isDefined","isEventTarget"]),validate("off events",s,["isDefined","isString"]),validate("off selector",i,[["isEmpty","isString"]]);const n="on:"+e+"-"+s+"-"+i,o=getMetaData(t,n);o&&(s.split(/[\s,]+/).forEach((e=>{t.removeEventListener(e.trim(),o.fn,o.options)})),setMetaData(t,n))},dt={hasClass:hasClass,addClass:(e,t)=>{validate("addClass element",e,["isDefined","isElement"]),validate("addClass addClasses",t,["isDefined","notEmpty",["isString","isArray"]]),Array.isArray(t)||(t=t.split(/[\s,]/)),t.forEach((t=>{t=t.trim(),hasClass(e,t)||e.classList.add(t)}))},removeClass:(e,t)=>{validate("removeClass element",e,["isDefined","isElement"]),validate("removeClass removeClasses",t,["isDefined","notEmpty",["isString","isArray"]]),Array.isArray(t)||(t=t.split(/[\s,]/)),t.forEach((t=>{t=t.trim(),hasClass(e,t)&&e.classList.remove(t)}))},isVisible:isVisible,inViewPort:(e,t=window)=>{validate("inViewPort element",e,["isDefined","isElement"]);const s=e.getBoundingClientRect(),i=isVisible(e),n=s.bottom<0;let o;return o=t.self===window?s.top>(window.innerHeight||document.documentElement.clientHeight):s.top>t.clientHeight,i&&!o&&!n},setCSS:(e,t)=>{validate("css element",e,["isDefined","isElement"]),validate("css css",t,["isDefined",["isObject"]]);for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)){const i=ht(s);e.style[i]=null!==t[s]?t[s]:null}},setMetaData:setMetaData,getMetaData:getMetaData,on:on,off:off,once:function(e,t,s,i,n,o){"function"==typeof i&&(o=n,n=i,i=void 0),on(e,t,s,i,n,o,!0)},offAll:function(e){validate("offAll container",e,["isDefined","isEventTarget"]);const t=ut.get(e)||{},s=[];for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&e.match(/^on:/)&&s.push(e);s.forEach((s=>{off(t[s].uid,e,t[s].events,t[s].selector)}))}};var pt=function isObject$4(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},ft=o,bt=/\s/;var gt=function trimmedEndIndex$1(e){for(var t=e.length;t--&&bt.test(e.charAt(t)););return t},vt=/^\s+/;var mt=function baseTrim$1(e){return e?e.slice(0,gt(e)+1).replace(vt,""):e},yt=pt,_t=D,wt=/^[-+]0x[0-9a-f]+$/i,Ot=/^0b[01]+$/i,At=/^0o[0-7]+$/i,$t=parseInt;var xt=pt,now=function(){return ft.Date.now()},St=function toNumber$1(e){if("number"==typeof e)return e;if(_t(e))return NaN;if(yt(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=yt(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=mt(e);var s=Ot.test(e);return s||At.test(e)?$t(e.slice(2),s?2:8):wt.test(e)?NaN:+e},Et=Math.max,jt=Math.min;var Ct=function debounce(e,t,s){var i,n,o,a,l,h,u=0,p=!1,f=!1,b=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function invokeFunc(t){var s=i,o=n;return i=n=void 0,u=t,a=e.apply(o,s)}function leadingEdge(e){return u=e,l=setTimeout(timerExpired,t),p?invokeFunc(e):a}function shouldInvoke(e){var s=e-h;return void 0===h||s>=t||s<0||f&&e-u>=o}function timerExpired(){var e=now();if(shouldInvoke(e))return trailingEdge(e);l=setTimeout(timerExpired,function remainingWait(e){var s=t-(e-h);return f?jt(s,o-(e-u)):s}(e))}function trailingEdge(e){return l=void 0,b&&i?invokeFunc(e):(i=n=void 0,a)}function debounced(){var e=now(),s=shouldInvoke(e);if(i=arguments,n=this,h=e,s){if(void 0===l)return leadingEdge(h);if(f)return clearTimeout(l),l=setTimeout(timerExpired,t),invokeFunc(h)}return void 0===l&&(l=setTimeout(timerExpired,t)),a}return t=St(t)||0,xt(s)&&(p=!!s.leading,o=(f="maxWait"in s)?Et(St(s.maxWait)||0,t):o,b="trailing"in s?!!s.trailing:b),debounced.cancel=function cancel(){void 0!==l&&clearTimeout(l),u=0,i=h=n=l=void 0},debounced.flush=function flush(){return void 0===l?a:trailingEdge(now())},debounced};var kt=function listCacheClear$1(){this.__data__=[],this.size=0};var Mt=function eq$2(e,t){return e===t||e!=e&&t!=t},Dt=Mt;var Pt=function assocIndexOf$4(e,t){for(var s=e.length;s--;)if(Dt(e[s][0],t))return s;return-1},Tt=Pt,Ht=Array.prototype.splice;var Rt=Pt;var Lt=Pt;var Ft=Pt;var zt=kt,Nt=function listCacheDelete$1(e){var t=this.__data__,s=Tt(t,e);return!(s<0)&&(s==t.length-1?t.pop():Ht.call(t,s,1),--this.size,!0)},It=function listCacheGet$1(e){var t=this.__data__,s=Rt(t,e);return s<0?void 0:t[s][1]},Wt=function listCacheHas$1(e){return Lt(this.__data__,e)>-1},Vt=function listCacheSet$1(e,t){var s=this.__data__,i=Ft(s,e);return i<0?(++this.size,s.push([e,t])):s[i][1]=t,this};function ListCache$4(e){var t=-1,s=null==e?0:e.length;for(this.clear();++t<s;){var i=e[t];this.set(i[0],i[1])}}ListCache$4.prototype.clear=zt,ListCache$4.prototype.delete=Nt,ListCache$4.prototype.get=It,ListCache$4.prototype.has=Wt,ListCache$4.prototype.set=Vt;var Ut=ListCache$4,Bt=Ut;var qt=function stackClear$1(){this.__data__=new Bt,this.size=0};var Qt=function stackDelete$1(e){var t=this.__data__,s=t.delete(e);return this.size=t.size,s};var Gt=function stackGet$1(e){return this.__data__.get(e)};var Zt=function stackHas$1(e){return this.__data__.has(e)},Jt=A,Yt=pt;var Kt,Xt=function isFunction$2(e){if(!Yt(e))return!1;var t=Jt(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},es=o["__core-js_shared__"],ts=(Kt=/[^.]+$/.exec(es&&es.keys&&es.keys.IE_PROTO||""))?"Symbol(src)_1."+Kt:"";var ss=function isMasked$1(e){return!!ts&&ts in e},rs=Function.prototype.toString;var is=function toSource$2(e){if(null!=e){try{return rs.call(e)}catch(e){}try{return e+""}catch(e){}}return""},ns=Xt,os=ss,as=pt,ls=is,hs=/^\[object .+?Constructor\]$/,cs=Function.prototype,us=Object.prototype,ds=cs.toString,ps=us.hasOwnProperty,fs=RegExp("^"+ds.call(ps).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var bs=function baseIsNative$1(e){return!(!as(e)||os(e))&&(ns(e)?fs:hs).test(ls(e))},gs=function getValue$1(e,t){return null==e?void 0:e[t]};var vs=function getNative$6(e,t){var s=gs(e,t);return bs(s)?s:void 0},ms=vs(o,"Map"),ys=vs(Object,"create"),_s=ys;var ws=function hashClear$1(){this.__data__=_s?_s(null):{},this.size=0};var Os=function hashDelete$1(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},As=ys,$s=Object.prototype.hasOwnProperty;var xs=function hashGet$1(e){var t=this.__data__;if(As){var s=t[e];return"__lodash_hash_undefined__"===s?void 0:s}return $s.call(t,e)?t[e]:void 0},Ss=ys,Es=Object.prototype.hasOwnProperty;var js=ys;var Cs=ws,ks=Os,Ms=xs,Ds=function hashHas$1(e){var t=this.__data__;return Ss?void 0!==t[e]:Es.call(t,e)},Ps=function hashSet$1(e,t){var s=this.__data__;return this.size+=this.has(e)?0:1,s[e]=js&&void 0===t?"__lodash_hash_undefined__":t,this};function Hash$1(e){var t=-1,s=null==e?0:e.length;for(this.clear();++t<s;){var i=e[t];this.set(i[0],i[1])}}Hash$1.prototype.clear=Cs,Hash$1.prototype.delete=ks,Hash$1.prototype.get=Ms,Hash$1.prototype.has=Ds,Hash$1.prototype.set=Ps;var Ts=Hash$1,Hs=Ut,Rs=ms;var Ls=function isKeyable$1(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var Fs=function getMapData$4(e,t){var s=e.__data__;return Ls(t)?s["string"==typeof t?"string":"hash"]:s.map},zs=Fs;var Ns=Fs;var Is=Fs;var Ws=Fs;var Vs=function mapCacheClear$1(){this.size=0,this.__data__={hash:new Ts,map:new(Rs||Hs),string:new Ts}},Us=function mapCacheDelete$1(e){var t=zs(this,e).delete(e);return this.size-=t?1:0,t},Bs=function mapCacheGet$1(e){return Ns(this,e).get(e)},qs=function mapCacheHas$1(e){return Is(this,e).has(e)},Qs=function mapCacheSet$1(e,t){var s=Ws(this,e),i=s.size;return s.set(e,t),this.size+=s.size==i?0:1,this};function MapCache$2(e){var t=-1,s=null==e?0:e.length;for(this.clear();++t<s;){var i=e[t];this.set(i[0],i[1])}}MapCache$2.prototype.clear=Vs,MapCache$2.prototype.delete=Us,MapCache$2.prototype.get=Bs,MapCache$2.prototype.has=qs,MapCache$2.prototype.set=Qs;var Gs=MapCache$2,Zs=Ut,Js=ms,Ys=Gs;var Ks=Ut,Xs=qt,er=Qt,tr=Gt,sr=Zt,rr=function stackSet$1(e,t){var s=this.__data__;if(s instanceof Zs){var i=s.__data__;if(!Js||i.length<199)return i.push([e,t]),this.size=++s.size,this;s=this.__data__=new Ys(i)}return s.set(e,t),this.size=s.size,this};function Stack$1(e){var t=this.__data__=new Ks(e);this.size=t.size}Stack$1.prototype.clear=Xs,Stack$1.prototype.delete=er,Stack$1.prototype.get=tr,Stack$1.prototype.has=sr,Stack$1.prototype.set=rr;var ir=Gs,nr=function setCacheAdd$1(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},or=function setCacheHas$1(e){return this.__data__.has(e)};function SetCache$1(e){var t=-1,s=null==e?0:e.length;for(this.__data__=new ir;++t<s;)this.add(e[t])}SetCache$1.prototype.add=SetCache$1.prototype.push=nr,SetCache$1.prototype.has=or;o.Uint8Array;var ar=a?a.prototype:void 0;ar&&ar.valueOf;Object.prototype.propertyIsEnumerable,Object.getOwnPropertySymbols;var lr=A,hr=$;var cr=function baseIsArguments$1(e){return hr(e)&&"[object Arguments]"==lr(e)},ur=$,dr=Object.prototype,pr=dr.hasOwnProperty,fr=dr.propertyIsEnumerable,br=(cr(function(){return arguments}()),{}),gr={get exports(){return br},set exports(e){br=e}};var vr=function stubFalse(){return!1};!function(e,t){var s=o,i=vr,n=t&&!t.nodeType&&t,a=n&&e&&!e.nodeType&&e,l=a&&a.exports===n?s.Buffer:void 0,h=(l?l.isBuffer:void 0)||i;e.exports=h}(gr,br);var mr=function isLength$2(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},yr=A,_r=mr,wr=$,Or={};Or["[object Float32Array]"]=Or["[object Float64Array]"]=Or["[object Int8Array]"]=Or["[object Int16Array]"]=Or["[object Int32Array]"]=Or["[object Uint8Array]"]=Or["[object Uint8ClampedArray]"]=Or["[object Uint16Array]"]=Or["[object Uint32Array]"]=!0,Or["[object Arguments]"]=Or["[object Array]"]=Or["[object ArrayBuffer]"]=Or["[object Boolean]"]=Or["[object DataView]"]=Or["[object Date]"]=Or["[object Error]"]=Or["[object Function]"]=Or["[object Map]"]=Or["[object Number]"]=Or["[object Object]"]=Or["[object RegExp]"]=Or["[object Set]"]=Or["[object String]"]=Or["[object WeakMap]"]=!1;var Ar=function baseIsTypedArray$1(e){return wr(e)&&_r(e.length)&&!!Or[yr(e)]};var $r=function baseUnary$1(e){return function(t){return e(t)}},xr={},Sr={get exports(){return xr},set exports(e){xr=e}};!function(e,t){var i=s,n=t&&!t.nodeType&&t,o=n&&e&&!e.nodeType&&e,a=o&&o.exports===n&&i.process,l=function(){try{var e=o&&o.require&&o.require("util").types;return e||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=l}(Sr,xr);var Er=Ar,jr=$r,Cr=xr&&xr.isTypedArray;Cr&&jr(Cr),Object.prototype.hasOwnProperty;Object.prototype;(function overArg$1(e,t){return function(s){return e(t(s))}})(Object.keys,Object),Object.prototype.hasOwnProperty;Object.prototype.hasOwnProperty;var kr=vs(o,"DataView"),Mr=ms,Dr=vs(o,"Promise"),Pr=vs(o,"Set"),Tr=vs(o,"WeakMap"),Hr=A,Rr=is,Lr="[object Map]",Fr="[object Promise]",zr="[object Set]",Nr="[object WeakMap]",Ir="[object DataView]",Wr=Rr(kr),Vr=Rr(Mr),Ur=Rr(Dr),Br=Rr(Pr),qr=Rr(Tr),Qr=Hr;(kr&&Qr(new kr(new ArrayBuffer(1)))!=Ir||Mr&&Qr(new Mr)!=Lr||Dr&&Qr(Dr.resolve())!=Fr||Pr&&Qr(new Pr)!=zr||Tr&&Qr(new Tr)!=Nr)&&(Qr=function(e){var t=Hr(e),s="[object Object]"==t?e.constructor:void 0,i=s?Rr(s):"";if(i)switch(i){case Wr:return Ir;case Vr:return Lr;case Ur:return Fr;case Br:return zr;case qr:return Nr}return t});Object.prototype.hasOwnProperty;var Gr,Zr,Jr,Yr,Kr,Xr,ei={},ti={get exports(){return ei},set exports(e){ei=e}},si=(Gr=[],Zr=[],Jr=[],Yr=[],Kr=null,Xr=function(e,t,s,i){var n=s||null,o=i||[{target:e,property:""}];Gr.push(o),e instanceof Array&&(e.hasOwnProperty("__length")?e.__length=e.length:Object.defineProperty(e,"__length",{enumerable:!1,value:e.length,writable:!0}));var a=[],_getPath=function(e,t,s){for(var i="",n=null,a=0;a<o.length;a++)n instanceof Array&&!isNaN(o[a].property)&&(o[a].property=n.indexOf(o[a].target)),i=i+"."+o[a].property,n=o[a].target;return i=(i=i+"."+t).substring(2),!0===s&&(i="/"+i.replace(/\./g,"/")),i},_notifyObservers=function(e){if(!0!==n.paused){var s="number"==typeof t;if(s||!0===t)setTimeout((function(){if(e===a.length){var t=a.slice(0);a=[];for(var s=0;s<n.observers.length;s++)n.observers[s](t)}}),s&&t>0?t:10);else{var i=a.slice(0);a=[];for(var o=0;o<n.observers.length;o++)n.observers[o](i)}}},l={get:function(e,s){if("__getTarget"===s)return e;if("__isProxy"===s)return!0;if("__getParent"===s)return function(e){void 0===e&&(e=1);var t=_getPath(0,"__getParent").split(".");return t.splice(-(e+1),e+1),function(e,t){return t.split(".").reduce((function(e,t){return e?e[t]:void 0}),e||self)}(n.parentProxy,t.join("."))};if("__getPath"===s)return _getPath(0,"__getParent").slice(0,-12);var i=e[s];if(e instanceof Date&&i instanceof Function&&null!==i)return i.bind(e);if(i instanceof Object&&null!==i&&e.hasOwnProperty(s)){if(!0===i.__isProxy&&(i=i.__getTarget),i.__targetPosition>-1&&null!==Jr[i.__targetPosition])for(var a=Yr[i.__targetPosition],l=0,h=a.length;l<h;l++)if(n===a[l].observable)return a[l].proxy;var u=o.slice(0);return u.push({target:i,property:s}),Xr(i,t,n,u)}return i},deleteProperty:function(e,t){var s=!0;Kr===u&&(s=!1,Kr=null);var i=Object.assign({},e);if(a.push({type:"delete",target:e,property:t,newValue:null,previousValue:i[t],currentPath:_getPath(0,t),jsonPointer:_getPath(0,t,!0),proxy:u}),!0===s){n.changesPaused||delete e[t];for(var o=0,l=Jr.length;o<l&&e!==Jr[o];o++);for(var h=Yr[o]||[],p=h.length;p--;)h[p].proxy!==u&&(Kr=h[p].proxy,delete h[p].proxy[t])}return _notifyObservers(a.length),!0},set:function(e,t,s,i){s&&s.__isProxy&&(s=s.__getTarget);var o=!0;Kr===u&&(o=!1,Kr=null);var l=e[t];if(l!==s||!1===o||"length"===t&&e instanceof Array&&e.__length!==s){var h=!0,p=typeof l,f="update";if("undefined"===p&&(f="add"),a.push({type:f,target:e,property:t,newValue:s,previousValue:i[t],currentPath:_getPath(0,t),jsonPointer:_getPath(0,t,!0),proxy:u}),"length"===t&&e instanceof Array&&e.__length!==s&&(a[a.length-1].previousValue=e.__length,e.__length=s),!0===o){n.changesPaused||(e[t]=s),h=!1;for(var b=e.__targetPosition,v=Yr[b].length;v--;)if(n===Yr[b][v].observable&&null!==Jr[Yr[b][v].observable.parentTarget.__targetPosition]){h=!0;break}if(h){for(var m=Yr[b],y=0,_=m.length;y<_;y++)m[y].proxy!==u&&(Kr=m[y].proxy,m[y].proxy[t]=s);setTimeout((function(){if("object"===p&&null!==l){for(var t=Object.keys(e),s=0,i=t.length;s<i;s++)if(e[t[s]]===l)return;var o=!1;if(function iterate(e){for(var t=Object.keys(e),s=0,i=t.length;s<i;s++){var n=e[t[s]];if(n instanceof Object&&null!==n&&iterate(n),n===l)return void(o=!0)}}(e),!0===o)return;!function iterate(e){for(var t=Object.keys(e),s=0,i=t.length;s<i;s++){var o=e[t[s]];o instanceof Object&&null!==o&&iterate(o)}var a=-1;for(s=0,i=Jr.length;s<i;s++)if(e===Jr[s]){a=s;break}if(a>-1){for(var l=Yr[a],h=l.length;h--;)if(n===l[h].observable){l.splice(h,1);break}0==l.length&&(Jr[a]=null)}}(l)}}),1e4)}}h&&_notifyObservers(a.length)}return!0}},h=e.__targetPosition;h>-1||Object.defineProperty(e,"__targetPosition",{value:Jr.length,writable:!1,enumerable:!1,configurable:!1});var u=new Proxy(e,l);null===n&&(n={parentTarget:e,domDelay:t,parentProxy:u,observers:[],paused:!1,path:o,changesPaused:!1},Zr.push(n));var p={target:e,proxy:u,observable:n};return h>-1?(null===Jr[h]&&(Jr[h]=e),Yr[h].push(p)):(Jr.push(e),Yr.push([p])),u},{create:function(e,t,s){!0===e.__isProxy&&(e=e.__getTarget);var i=Xr(e,t);return"function"==typeof s&&this.observe(i,s),function iterate(e){for(var t=e.__getTarget,s=Object.keys(t),i=0,n=s.length;i<n;i++){var o=s[i];t[o]instanceof Object&&null!==t[o]&&iterate(e[o])}}(i),i},observe:function(e,t){for(var s=Zr.length;s--;)if(Zr[s].parentProxy===e){Zr[s].observers.push(t);break}},pause:function(e){for(var t=Zr.length,s=!1;t--;)if(Zr[t].parentProxy===e){Zr[t].paused=!0,s=!0;break}if(0==s)throw new Error("ObseravableSlim could not pause observable -- matching proxy not found.")},resume:function(e){for(var t=Zr.length,s=!1;t--;)if(Zr[t].parentProxy===e){Zr[t].paused=!1,s=!0;break}if(0==s)throw new Error("ObseravableSlim could not resume observable -- matching proxy not found.")},pauseChanges:function(e){for(var t=Zr.length,s=!1;t--;)if(Zr[t].parentProxy===e){Zr[t].changesPaused=!0,s=!0;break}if(0==s)throw new Error("ObseravableSlim could not pause changes on observable -- matching proxy not found.")},resumeChanges:function(e){for(var t=Zr.length,s=!1;t--;)if(Zr[t].parentProxy===e){Zr[t].changesPaused=!1,s=!0;break}if(0==s)throw new Error("ObseravableSlim could not resume changes on observable -- matching proxy not found.")},remove:function(e){for(var t=null,s=!1,i=Zr.length;i--;)if(Zr[i].parentProxy===e){t=Zr[i],s=!0;break}for(var n=Yr.length;n--;)for(var o=Yr[n].length;o--;)Yr[n][o].observable===t&&(Yr[n].splice(o,1),0===Yr[n].length&&(Jr[n]=null));!0===s&&Zr.splice(i,1)}});try{ti.exports=si}catch(e){}const ri={};class ObservableObject{constructor(e,t={},s={}){if(this.id=e,ri[this.id])throw new Error("ObservableObject "+e+" already exists.");this.bound={},this.data=ei.create(t,!1,(e=>{this.sync(e)})),this.options=s,ri[this.id]=this}destroy(){ei.pause(this.data),delete ri[this.id],delete this.data,Object.keys(this.bound).forEach((e=>{Object.keys(this.bound[e]).forEach((t=>{this.unbind(t,e)}))})),ei.remove(this.data)}getObservableData(){return this.data}bind(e,t,s="*"){this.bound[s]||(this.bound[s]={}),this.bound[s][e]=t,t(this.id,"connect")}unbind(e,t="*"){this.bound[t][e](this.id,"disconnect"),this.bound[t]&&this.bound[t][e]&&delete this.bound[t][e]}sync(e){for(const t of e){const e=t.type,s=t.currentPath,i=t.newValue,n=t.previousValue,o=[];for(const e in this.bound)if("*"===e)o.push(e);else{const t=new RegExp("^"+e.replace(".","\\."));s.match(t)&&o.push(e)}for(const t of o)for(const o in this.bound[t])this.bound[t][o](this.id,e,s,i,n)}}}let ii,ni,oi,ai,li,hi;class ObserverSubscriptionManager{constructor(e){this.options=e,this.observers=[],this.pendingAnimationFrame=void 0,this.frameQueue=[],this.sleeping=!0}subscribe(e){!this.observers.length&&this.sleeping&&this.wakeup(),this.observers.push(e)}unSubscribe(e){-1!==this.observers.indexOf(e)&&this.observers.splice(this.observers.indexOf(e),1),this.observers.length||this.sleep()}sleep(){this.sleeping=!0}wakeup(){this.sleeping=!1}notifyObservers(e,t){for(let s=0;s<this.observers.length;s++)this.observers[s][e]&&this.observers[s][e].apply(this.observers[s],t||[])}flushQueue(){this.pendingAnimationFrame&&(cancelAnimationFrame(this.pendingAnimationFrame),this.pendingAnimationFrame=void 0),this.frameQueue=[]}queueFrame(e){this.frameQueue.push(e.bind(this)),this.pendingAnimationFrame||(this.pendingAnimationFrame=requestAnimationFrame((()=>{this.processQueue()})))}processQueue(){this.pendingAnimationFrame=void 0;const e=this.frameQueue.slice(0);this.frameQueue=[];for(let t=0;t<e.length;t++)e[t]()}}class DOMWatcher extends ObserverSubscriptionManager{constructor(e={}){super(e),this.mutationHandler=Ct(((e,t)=>{this.observeDOM(this.options.shadowDOM||document.body)}),25,{maxWait:100}),this.mutationObserver=new MutationObserver(this.mutationHandler,!1)}subscribe(e){super.subscribe(e),e.watchDOM(this.options.shadowDOM||document.body)}wakeup(){super.wakeup(),this.mutationObserver.observe(this.options.shadowDOM||document.body,{childList:!0,subtree:!0})}sleep(){super.sleep(),this.mutationObserver.disconnect()}observeDOM(e){this.notifyObservers("watchDOM",[e||this.options.shadowDOM||document.body])}}ii=new DOMWatcher,ni=new class ScrollWatcher extends ObserverSubscriptionManager{constructor(e={}){super(e),this.scrollElement=this.options.scrollElement||window,this.lastscroll=0,this.scrolling=!1}trigger(){this.scrolling||this.scrollLoop()}scrollLoop(){if(this.lastscroll!==this.scrollTop()){this.scrolling=!0,this.lastscroll=this.scrollTop(),this.watchScroll();const frame=()=>{this.scrollLoop()};this.queueFrame(frame)}else this.scrolling=!1}setOptions(e={}){this.sleep(),this.scrollElement=e.scrollElement||window,this.wakeup()}subscribe(e){super.subscribe(e),e.watchScroll()}wakeup(){super.wakeup(),dt.on("theScrollWatcher",this.scrollElement,"scroll",(()=>{this.trigger()}))}sleep(){super.sleep(),dt.off("theScrollWatcher",this.scrollElement,"scroll")}inViewPort(e){return dt.inViewPort(e,this.scrollElement)}watchScroll(){this.notifyObservers("watchScroll")}scrollTop(e){if(this.scrollElement===window){if(void 0===e)return window.pageYOffset;window.scrollTo(0,e)}else{if(void 0===e)return this.scrollElement.scrollTop;this.scrollElement.scrollTop=e}}},oi=new class ResizeWatcher extends ObserverSubscriptionManager{constructor(e){super(e),this.debounce=Ct((()=>{this.watchResize()}),250)}subscribe(e){super.subscribe(e),e.watchResize()}wakeup(){super.wakeup(),window.addEventListener("resize",this.debounce,!1)}sleep(){super.sleep(),window.removeEventListener("resize",this.debounce)}watchResize(){this.notifyObservers("watchResize")}},ai=new class OrientationWatcher extends ObserverSubscriptionManager{constructor(e){super(e),"onorientationchange"in window?dt.addClass(document.body,"have-orientation"):dt.addClass(document.body,"no-orientation"),this.debounce=Ct((()=>{this.watchOrientation()}),250)}subscribe(e){super.subscribe(e),e.watchOrientation()}wakeup(){super.wakeup(),"onorientationchange"in window&&window.addEventListener("orientationchange",this.debounce,!1)}sleep(){super.sleep(),"onorientationchange"in window&&window.removeEventListener("orientationchange",this.debounce)}watchOrientation(){this.notifyObservers("watchOrientation")}},li=new class WorkerWatcher extends ObserverSubscriptionManager{constructor(e){super(e),this.workers={}}registerWorker(e,t){if(!this.workers[e]){let s=t,i=!1;if(!t.match(/^(http|\/)/i)){const e=new Blob([t],{type:"text/javascript"});s=URL.createObjectURL(e),i=!0}this.workers[e]={worker:new Worker(s),observers:[]},i&&URL.revokeObjectURL(s),this.workers[e].worker.onmessage=t=>{this.workerMessage(e,t)}}return this.workers[e].worker}subscribe(e,t){if(!this.workers[t])throw new Error("worker "+t+" does not exist");this.workers[t].observers.push(e),super.subscribe(e)}unSubscribe(e,t){if(!this.workers[t])throw new Error("worker "+t+" does not exist");const s=this.workers[t].observers;-1!==s.indexOf(e)&&s.splice(s.indexOf(e),1),s.length||(this.workers[t].worker.terminate(),delete this.workers[t]),super.unSubscribe(e)}workerMessage(e,t){this.workers[e].observers.forEach((s=>{s.workerMessage&&s.workerMessage(e,t)}))}wakeup(){super.wakeup()}sleep(){super.sleep()}},hi=new class ObservableObjectWatcher extends ObserverSubscriptionManager{constructor(e){super(e),this.registeredObservableObjects={}}getObservable(e){return this.registeredObservableObjects[e]?this.registeredObservableObjects[e].observable:void 0}observableStart(e,t){const s=(e=>ri[e])(e);if(s&&void 0!==t)throw new Error("ObservableObject "+e+" already exists, can't build.");return this.registeredObservableObjects[e]||(this.registeredObservableObjects[e]=s?{id:e,observable:s,observers:[],managed:!1}:{id:e,observable:new ObservableObject(e,t),observers:[],managed:!0},this.registeredObservableObjects[e].observable.bind(this.constructor.name,this.notify.bind(this))),this.registeredObservableObjects[e].observable}observableDestroy(e){if(!this.registeredObservableObjects[e])throw new Error("ObservableObject observableDestroy "+e+" does not exist");this.registeredObservableObjects[e].observable.unbind(this.constructor.name),this.registeredObservableObjects[e].observable.destroy(),delete this.registeredObservableObjects[e]}subscribe(e,t,s){this.registeredObservableObjects[t]||this.observableStart(t,s),this.registeredObservableObjects[t].observers.push(e),super.subscribe(e)}unSubscribe(e,t){if(!this.registeredObservableObjects[t])throw new Error("ObservableObject unSubscribe "+t+" does not exist");const s=this.registeredObservableObjects[t].observers;-1!==s.indexOf(e)&&s.splice(s.indexOf(e),1),!s.length&&this.registeredObservableObjects[t].managed&&this.observableDestroy(t),super.unSubscribe(e)}notify(e,t,s,i,n){if(!this.registeredObservableObjects[e])throw new Error("ObservableObject notify "+e+" does not exist");this.registeredObservableObjects[e].observers.forEach((o=>{o.observableChanged&&o.observableChanged(e,t,s,i,n)}))}};var ci=at((function(e,t,s){return e+(s?"-":"")+t.toLowerCase()}));let ui=0;const di=[],pi="customElements"in window,fi={},registerSargassoClass=(e,t)=>{if(fi[e])throw new Error("Sargasso class "+e+" is already registered.");if(fi[e]=t,pi){const t=new Function("registeredClasses",`\n\t\t\treturn class ${e}Element extends HTMLElement {\n\t\t\t\tconstructor(element, options = {}) {\n\t\t\t\t\tsuper()\n\t\t\t\t\tthis.helperClass= '${e}'\n\t\t\t\t\tthis.helpers = []\n\t\t\t\t}\n\n\t\t\t\tconnectedCallback () {\n\t\t\t\t\tthis.helpers.push(new registeredClasses[this.helperClass](this,{isCustomElement:true}))\n\t\t\t\t\tif (this.hasAttributes()) {\n\t\t\t\t\t\tfor(let i = 0; i < this.attributes.length; i++) {\n\t\t\t\t\t\t\tif(this.attributes[i].name.match(/^sargasso-/)) {\n\t\t\t\t\t\t\t\tlet classname = this.attributes[i].name.replace(/^sargasso-/,'').split('-').map(word=> word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join('')\n\t\t\t\t\t\t\t\tif(!registeredClasses[classname]) {\n\t\t\t\t\t\t\t\t\tconsole.log('instantiate by attribute ' + this.attributes[i].name + ' > ' + classname + ' is not a sargasso class')\n\t\t\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tthis.helpers.push(new registeredClasses[classname](this,{isCustomElement:true}))\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.helpers.forEach((helper) => {\n\t\t\t\t\t\thelper.start()\n\t\t\t\t\t})\n\t\t\t\t}\n\n\t\t\t\tdisconnectedCallback () {\n\t\t\t\t\tthis.helpers.forEach((helper) => {\n\t\t\t\t\t\thelper.sleep()\n\t\t\t\t\t\thelper.destroy()\n\t\t\t\t \t})\n\t\t\t\t\tthis.helpers = [] // nuke the reference for trash collection\n\t\t\t\t}\n\t\t\t}`)(fi),s=window.sargassoOptions||{},i=void 0!==s.customElementPrefix?s.customElementPrefix:"sargasso-";customElements.define(i+ci(e),t)}},bi=["DOMChanged","didScroll","didResize","didBreakpoint","enterViewport","exitViewport","enterFullscreen","exitFullscreen","newPage","elementEvent","workerOnMessage","observableChanged"];class Sargasso{constructor(e,t={}){validate("Sargasso constructor element",e,["isDefined","isElement"]),validate("Sargasso constructor options",t,["isDefined",["isObject"]]),this.uid=++ui,this.element=e,t.shadowDOM&&(this._shadowDOM=e.attachShadow({mode:"open"}),this._shadowRoot=document.createElement("div"),this._shadowDOM.append(this._shadowRoot),this._hostElement=this.element,this.element=this._shadowRoot),this.options=t,this._pendingAnimationFrame=void 0,this._frameQueue=[],this._isInViewport=!1,this._workers={},this._observables={},this._template=void 0,this._templateArgs={},this._started=!1,this.render=Ct((()=>{this._render()}),100,{maxWait:250})}start(){const e=this.getMetaData("registeredResponsiveControllers")||[];e.push(this),this.setMetaData("registeredResponsiveControllers",e),this.setMetaData(this.constructor.name,this),di.push(this),this._shadowDOM&&(this._shadowDOMWatcher||(this._shadowDOMWatcher=new DOMWatcher({shadowDOM:this._shadowRoot})),this._shadowDOMWatcher.subscribe(this)),this.options.watchDOM&&ii.subscribe(this),(this.options.watchScroll||this.options.watchViewport)&&ni.subscribe(this),(this.options.watchResize||this.options.watchViewport)&&oi.subscribe(this),(this.options.watchOrientation||this.options.watchViewport)&&ai.subscribe(this),this.elementListener=e=>{e.detail&&e.detail.sargassoEvent&&-1!==bi.indexOf(e.detail.sargassoEvent)?this[e.detail.sargassoEvent].apply(this,e.detail.sargassoEventOptions||[]):this.elementEvent(e)},this.element.addEventListener("sargasso",this.elementListener),this._started=!0}sleep(){this._shadowDOM&&this._shadowDOMWatcher.unSubscribe(this),this.options.watchDOM&&ii.unSubscribe(this),(this.options.watchScroll||this.options.watchViewport)&&ni.unSubscribe(this),(this.options.watchResize||this.options.watchViewport)&&oi.unSubscribe(this),(this.options.watchOrientation||this.options.watchViewport)&&ai.unSubscribe(this),this.element.removeEventListener("sargasso",this.elementListener),dt.offAll(this.element),this._started=!1}DOMChanged(e){}didScroll(){}didResize(){}didBreakpoint(){}enterViewport(){}exitViewport(){}enterFullscreen(){}exitFullscreen(){}newPage(e,t){}elementEvent(e){}workerOnMessage(e,t){}observableChanged(e,t,s,i,n){this.render()}setMetaData(e,t){dt.setMetaData(this.element,e,t)}getMetaData(e){return dt.getMetaData(this.element,e)}on(e,t,s,i){dt.on(this.constructor.name+"-"+this.uid,this.element,e,t,s,i)}off(e,t){dt.off(this.constructor.name+"-"+this.uid,this.element,e,t)}once(e,t,s,i){dt.once(this.constructor.name+"-"+this.uid,this.element,e,t,s,i)}notifyAll(e,t){if(-1===bi.indexOf(e))throw new Error("invalid event name "+e);for(let s=0;s<di.length;s++){const i=di[s];i!==this&&i[e]&&i[e].apply(i,t)}}notifyElement(e,t,s){if(-1===bi.indexOf(t))throw new Error("invalid event name "+t);const i=this.getMetaData("registeredResponsiveControllers");if(i)for(let e=0;e<i.length;e++){const n=i[e];n!==this&&n[t]&&n[t].apply(n,s)}}queueFrame(e){this._frameQueue.push(e.bind(this)),this._pendingAnimationFrame||(this._pendingAnimationFrame=requestAnimationFrame((()=>{this._processQueue()})))}wantFullscreen(e){e?this.enterFullscreen():this.exitFullscreen()}hasClass(e){return dt.hasClass(this.element,e)}addClass(e){dt.addClass(this.element,e)}removeClass(e){dt.removeClass(this.element,e)}setCSS(e){dt.setCSS(this.element,e)}isVisible(){return dt.isVisible(this.element)}workerStart(e,t){return this._workers[e]=li.registerWorker(e,t),li.subscribe(this,e),this._workers[e]}workerPostMessage(e,t){t.uid||(t.uid=this.uid),this._workers[e]&&this._workers[e].postMessage(t)}getObservable(e){return this._observables[e]}getObservableData(e){return this._observables[e].data}observableStart(e,t){return hi.subscribe(this,e,t),this._observables[e]=hi.getObservable(e),this._observables[e]}observableStop(e){this._observables[e]&&(hi.unSubscribe(this,e),delete this._observables[e])}observableStopAll(){for(const e in this._observables)this.observableStop(e)}setTemplate(e){this._template=e}setRenderer(e){this.renderer=e}setTemplateArgs(e={}){this._templateArgs=e,this.render()}getTemplateArgs(){const e=this._templateArgs||{};return JSON.parse(JSON.stringify(e))}_render(){this._template&&this.renderer&&this.renderer(this._template(this.getTemplateArgs()),this.element)}_flushQueue(){this._pendingAnimationFrame&&(cancelAnimationFrame(this._pendingAnimationFrame),this._pendingAnimationFrame=void 0),this._frameQueue=[]}_processQueue(){this._pendingAnimationFrame=void 0;const e=this._frameQueue.slice(0);this._frameQueue=[];for(let t=0;t<e.length;t++)e[t]()}_stopWorker(e){this._workers[e]&&(li.unSubscribe(this,e),delete this._workers[e])}_stopAllWorkers(){for(const e in this._workers)this._stopWorker(e)}destroy(){this._stopAllWorkers(),this.observableStopAll(),this._flushQueue(),this._started&&this.sleep();const e=this.getMetaData("registeredResponsiveControllers");e&&-1!==e.indexOf(this)&&(e.splice(e.indexOf(this),1),this.setMetaData("registeredResponsiveControllers",e)),this.setMetaData(this.constructor.name,null),this.element=null,-1!==di.indexOf(this)&&di.splice(di.indexOf(this),1)}watchDOM(e){e===this._shadowRoot?ii.observeDOM(this._shadowRoot):this.DOMChanged(e)}watchScroll(){this.options.watchViewport&&this.inViewport(),this.didScroll()}watchResize(){this.options.watchViewport&&this.inViewport(),this.didResize()}watchOrientation(){!window.orientation||90!==window.orientation&&-90!==window.orientation?this.wantFullscreen(!1):this.wantFullscreen(!0)}inViewport(){ni.inViewPort(this.element)?this._isInViewport||(this.enterViewport(),this._isInViewport=!0):this._isInViewport&&(this.exitViewport(),this._isInViewport=!1)}workerMessage(e,t){t.data.uid===this.uid&&this.workerOnMessage(e,t.data)}nativeRequestFullScreen(){if(document.fullscreenElement){if(document.fullscreenElement===this.element)return;document.exitFullscreen()}this.element.requestFullscreen()}nativeExitFullScreen(){document.fullscreenElement&&document.fullscreenElement===this.element&&document.exitFullscreen()}}registerSargassoClass("Sargasso",Sargasso);class LazyInstantiate extends Sargasso{constructor(e,t={}){t.watchScroll=!0,t.watchResize=!0,t.watchDOM=!0,t.immortal=!0,super(e,t)}didResize(){super.didResize(),this.lazyHandler()}didScroll(){super.didScroll(),this.lazyHandler()}DOMChanged(e){super.DOMChanged(e),this.lazyHandler(e)}lazyHandler(e=document){const t=e.querySelectorAll("[data-lazy-sargasso-class]");for(let e=0;e<t.length;e++){const s=t[e];if(ni.inViewPort(s)){const i=s.getAttribute("data-lazy-sargasso-class").split(/\s*,\s*/);for(let s=0;s<i.length;s++){new fi[i[s]](t[e]).start()}s.removeAttribute("data-lazy-sargasso-class")}}}}registerSargassoClass("LazyInstantiate",LazyInstantiate);class SargassoSupervisor extends Sargasso{constructor(e,t={}){super(e,{watchDOM:!0,mortal:!1}),this.lazy=new LazyInstantiate(e,t)}start(){this.lazy.start(),super.start()}instantiate(e){const t=e.getAttribute("data-sargasso-class").split(/\s*,\s*/);for(let s=0;s<t.length;s++)try{new fi[t[s]](e).start()}catch(e){console.log("error instantiating "+t[s],e,fi)}e.removeAttribute("data-sargasso-class")}newPage(){this.doIt()}DOMChanged(e){this.doIt(e)}doIt(e=document.body){e.getAttribute("data-sargasso-class")&&this.instantiate(e);const t=e.querySelectorAll("[data-sargasso-class]");for(const e of t)this.instantiate(e);const s=[];for(let e=0;e<di.length;e++)di[e].options.immortal||di[e].options.isCustomElement||document.body.contains(di[e].element)||s.push(di[e]);for(let e=0;e<s.length;e++)s[e].destroy()}}registerSargassoClass("SargassoSupervisor",SargassoSupervisor);const gi=window.breakpoints||{widths:[{className:"breakpoint-phone",maxWidth:599},{className:"breakpoint-tablet",maxWidth:904},{className:"breakpoint-desktop",maxWidth:void 0}]};class Breakpoints extends Sargasso{constructor(e,t={}){t.watchResize=!0,super(e,t),this.options.widths=t.widths||gi,this.scale=void 0,this.widths=[],this.classes=[],this.debouncedDetectGeometry=Ct((()=>{this.detectGeometry()}),100,{maxWait:150})}start(){super.start(),this.debouncedDetectGeometry()}didResize(){this.debouncedDetectGeometry()}detectGeometry(){const e=window.doBreakpoints(this.options.widths);if(e!==this.scale){const frame=()=>{this.notifyAll("didBreakpoint",[e])};this.queueFrame(frame)}this.scale=e}}registerSargassoClass("Breakpoints",Breakpoints);class HijaxLoader extends Sargasso{constructor(e,t={}){t.watchDOM=!0,t.immortal=!0,super(e,t),this.excludeRegex=new RegExp("^(//|http|javascript|mailto|#)","i"),this.currentPage=location.pathname+location.search,this.cachedMarkup={}}start(){const e=document.querySelectorAll("[data-hijax-skip-unchanged]");for(let t=0;t<e.length;t++){const s=e[t],i=s.getAttribute("id");this.cachedMarkup[i]=s.innerHTML}super.start(),window.addEventListener("popstate",(e=>{this.watchPopState(e)}),!1)}DOMChanged(e){super.DOMChanged(e),this.hijaxLinks(e)}watchPopState(e){location.pathname+location.search!==this.currentPage&&this.preFlight(location.pathname+location.search)}hijaxLinks(e){const t=e?e.getElementsByTagName("a"):this.element.getElementsByTagName("a");for(let e=0;e<t.length;e++){const s=t[e],i=s.getAttribute("href");!i||s.getAttribute("data-hijaxed")||s.getAttribute("target")||s.hasAttribute("data-no-hijax")||this.excludeRegex.exec(i)||(s.setAttribute("data-hijaxed",!0),s.addEventListener("click",(e=>{e.preventDefault(),this.setPage(i)}),!1))}}setPage(e,t){e===this.currentPage||t?this.preFlight(e):(history.pushState(null,null,e),this.watchPopState())}preFlight(e){if(!this.options.preFlight)return this.loadPage(e);this.options.preFlight(e,((t,s,i)=>{t&&(this.options.onError?this.options.onError("danger",t):alert("Error loading page: "+t)),s?this.currentPage=location.pathname+location.search:this.loadPage(i||e)}))}loadPage(e){this.queueFrame((()=>{dt.addClass(document.body,"hijax-loading")})),this.options.onExitPage&&this.options.onExitPage();const t=new XMLHttpRequest;t.open("GET",e),t.setRequestHeader("Sargasso-Hijax",1),t.setRequestHeader("x-digitopia-hijax",1),this.options.onLoading&&(this.options.onLoading(),t.onreadystatechange=this.options.onLoading),t.onload=()=>{if(301===t.status||302===t.status||t.getResponseHeader("Sargasso-Location")){const e=t.getResponseHeader("Location")?t.getResponseHeader("Location"):t.getResponseHeader("Sargasso-Location");this.setPage(e)}else if(200===t.status){ni.scrollTop(0),this.mergePage(t.responseText);const e=this.currentPage,frame=()=>{this.notifyAll("newPage",[e,location.pathname+location.search]),dt.removeClass(document.body,"hijax-loading")};this.queueFrame(frame),this.currentPage=location.pathname+location.search}else{const e=t.getResponseHeader("Sargasso-Flash-Level")||"danger";let s=t.getResponseHeader("Sargasso-Flash-Message")||t.statusText;s||(s="Could not connect to server."),this.options.onError?this.options.onError(e,s):alert("Error loading page: "+s)}},t.send()}processScripts(e){Array.from(e).forEach((e=>{e.remove();const t=e.getAttribute("id");document.getElementById(t)||document.getElementsByTagName("head")[0].appendChild(e)}))}mergePage(e){const t=document.querySelectorAll("[data-ephemeral]");Array.from(t).forEach((e=>{e.remove()}));const s=e.split(/(<body[^>]*>|<\/body>)/gi),i=makeFragment(s[2]),n=document.querySelectorAll("[data-hijax]");for(let e=0;e<n.length;e++){const t=n[e],s=t.getAttribute("id"),o=i.getElementById(s);if(t.hasAttribute("data-hijax-skip-unchanged")){if(this.cachedMarkup[s]===o.innerHTML)continue;this.cachedMarkup[s]=o.innerHTML}const a=t.getAttribute("data-hijax-cache-key-selector");if(a&&o.querySelector(a)&&t.querySelector(a)&&t.querySelector(a).getAttribute("data-hijax-cache-key")===o.querySelector(a).getAttribute("data-hijax-cache-key"))continue;this.processScripts(o.querySelectorAll("script"));const frame=()=>{t.parentNode.replaceChild(o,t),this.options.onEnterPage&&this.options.onEnterPage(),this.hijaxLinks(o)};this.queueFrame(frame)}}}registerSargassoClass("HijaxLoader",HijaxLoader);const makeFragment=e=>{if(document.createRange&&document.createRange().createContextualFragment)return document.createRange().createContextualFragment(e);const t=document.createDocumentFragment(),s=document.createElement("div");return s.insertAdjacentHTML("afterBegin",e),t.appendChild(s),t};e.loadPageHandler=void 0;var vi;const mi=window,yi=mi.trustedTypes,_i=yi?yi.createPolicy("lit-html",{createHTML:e=>e}):void 0,wi=`lit$${(Math.random()+"").slice(9)}$`,Oi="?"+wi,Ai=`<${Oi}>`,$i=document,r=(e="")=>$i.createComment(e),d=e=>null===e||"object"!=typeof e&&"function"!=typeof e,xi=Array.isArray,c=e=>xi(e)||"function"==typeof(null==e?void 0:e[Symbol.iterator]),Si=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ei=/-->/g,ji=/>/g,Ci=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),ki=/'/g,Mi=/"/g,Di=/^(?:script|style|textarea|title)$/i,g=e=>(t,...s)=>({_$litType$:e,strings:t,values:s}),Pi=g(1),Ti=(g(2),Symbol.for("lit-noChange")),Hi=Symbol.for("lit-nothing"),Ri=new WeakMap,Li=$i.createTreeWalker($i,129,null,!1),E=(e,t)=>{const s=e.length-1,i=[];let n,o=2===t?"<svg>":"",a=Si;for(let t=0;t<s;t++){const s=e[t];let l,h,u=-1,p=0;for(;p<s.length&&(a.lastIndex=p,h=a.exec(s),null!==h);)p=a.lastIndex,a===Si?"!--"===h[1]?a=Ei:void 0!==h[1]?a=ji:void 0!==h[2]?(Di.test(h[2])&&(n=RegExp("</"+h[2],"g")),a=Ci):void 0!==h[3]&&(a=Ci):a===Ci?">"===h[0]?(a=null!=n?n:Si,u=-1):void 0===h[1]?u=-2:(u=a.lastIndex-h[2].length,l=h[1],a=void 0===h[3]?Ci:'"'===h[3]?Mi:ki):a===Mi||a===ki?a=Ci:a===Ei||a===ji?a=Si:(a=Ci,n=void 0);const f=a===Ci&&e[t+1].startsWith("/>")?" ":"";o+=a===Si?s+Ai:u>=0?(i.push(l),s.slice(0,u)+"$lit$"+s.slice(u)+wi+f):s+wi+(-2===u?(i.push(void 0),t):f)}const l=o+(e[s]||"<?>")+(2===t?"</svg>":"");if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==_i?_i.createHTML(l):l,i]};class C{constructor({strings:e,_$litType$:t},s){let i;this.parts=[];let n=0,o=0;const a=e.length-1,l=this.parts,[h,u]=E(e,t);if(this.el=C.createElement(h,s),Li.currentNode=this.el.content,2===t){const e=this.el.content,t=e.firstChild;t.remove(),e.append(...t.childNodes)}for(;null!==(i=Li.nextNode())&&l.length<a;){if(1===i.nodeType){if(i.hasAttributes()){const e=[];for(const t of i.getAttributeNames())if(t.endsWith("$lit$")||t.startsWith(wi)){const s=u[o++];if(e.push(t),void 0!==s){const e=i.getAttribute(s.toLowerCase()+"$lit$").split(wi),t=/([.?@])?(.*)/.exec(s);l.push({type:1,index:n,name:t[2],strings:e,ctor:"."===t[1]?M:"?"===t[1]?k:"@"===t[1]?H:S})}else l.push({type:6,index:n})}for(const t of e)i.removeAttribute(t)}if(Di.test(i.tagName)){const e=i.textContent.split(wi),t=e.length-1;if(t>0){i.textContent=yi?yi.emptyScript:"";for(let s=0;s<t;s++)i.append(e[s],r()),Li.nextNode(),l.push({type:2,index:++n});i.append(e[t],r())}}}else if(8===i.nodeType)if(i.data===Oi)l.push({type:2,index:n});else{let e=-1;for(;-1!==(e=i.data.indexOf(wi,e+1));)l.push({type:7,index:n}),e+=wi.length-1}n++}}static createElement(e,t){const s=$i.createElement("template");return s.innerHTML=e,s}}function P(e,t,s=e,i){var n,o,a,l;if(t===Ti)return t;let h=void 0!==i?null===(n=s._$Co)||void 0===n?void 0:n[i]:s._$Cl;const u=d(t)?void 0:t._$litDirective$;return(null==h?void 0:h.constructor)!==u&&(null===(o=null==h?void 0:h._$AO)||void 0===o||o.call(h,!1),void 0===u?h=void 0:(h=new u(e),h._$AT(e,s,i)),void 0!==i?(null!==(a=(l=s)._$Co)&&void 0!==a?a:l._$Co=[])[i]=h:s._$Cl=h),void 0!==h&&(t=P(e,h._$AS(e,t.values),h,i)),t}class V{constructor(e,t){this.u=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}v(e){var t;const{el:{content:s},parts:i}=this._$AD,n=(null!==(t=null==e?void 0:e.creationScope)&&void 0!==t?t:$i).importNode(s,!0);Li.currentNode=n;let o=Li.nextNode(),a=0,l=0,h=i[0];for(;void 0!==h;){if(a===h.index){let t;2===h.type?t=new N(o,o.nextSibling,this,e):1===h.type?t=new h.ctor(o,h.name,h.strings,this,e):6===h.type&&(t=new I(o,this,e)),this.u.push(t),h=i[++l]}a!==(null==h?void 0:h.index)&&(o=Li.nextNode(),a++)}return n}p(e){let t=0;for(const s of this.u)void 0!==s&&(void 0!==s.strings?(s._$AI(e,s,t),t+=s.strings.length-2):s._$AI(e[t])),t++}}class N{constructor(e,t,s,i){var n;this.type=2,this._$AH=Hi,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=s,this.options=i,this._$Cm=null===(n=null==i?void 0:i.isConnected)||void 0===n||n}get _$AU(){var e,t;return null!==(t=null===(e=this._$AM)||void 0===e?void 0:e._$AU)&&void 0!==t?t:this._$Cm}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===e.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=P(this,e,t),d(e)?e===Hi||null==e||""===e?(this._$AH!==Hi&&this._$AR(),this._$AH=Hi):e!==this._$AH&&e!==Ti&&this.g(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):c(e)?this.k(e):this.g(e)}O(e,t=this._$AB){return this._$AA.parentNode.insertBefore(e,t)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}g(e){this._$AH!==Hi&&d(this._$AH)?this._$AA.nextSibling.data=e:this.T($i.createTextNode(e)),this._$AH=e}$(e){var t;const{values:s,_$litType$:i}=e,n="number"==typeof i?this._$AC(e):(void 0===i.el&&(i.el=C.createElement(i.h,this.options)),i);if((null===(t=this._$AH)||void 0===t?void 0:t._$AD)===n)this._$AH.p(s);else{const e=new V(n,this),t=e.v(this.options);e.p(s),this.T(t),this._$AH=e}}_$AC(e){let t=Ri.get(e.strings);return void 0===t&&Ri.set(e.strings,t=new C(e)),t}k(e){xi(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let s,i=0;for(const n of e)i===t.length?t.push(s=new N(this.O(r()),this.O(r()),this,this.options)):s=t[i],s._$AI(n),i++;i<t.length&&(this._$AR(s&&s._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){var s;for(null===(s=this._$AP)||void 0===s||s.call(this,!1,!0,t);e&&e!==this._$AB;){const t=e.nextSibling;e.remove(),e=t}}setConnected(e){var t;void 0===this._$AM&&(this._$Cm=e,null===(t=this._$AP)||void 0===t||t.call(this,e))}}class S{constructor(e,t,s,i,n){this.type=1,this._$AH=Hi,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=n,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=Hi}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,t=this,s,i){const n=this.strings;let o=!1;if(void 0===n)e=P(this,e,t,0),o=!d(e)||e!==this._$AH&&e!==Ti,o&&(this._$AH=e);else{const i=e;let a,l;for(e=n[0],a=0;a<n.length-1;a++)l=P(this,i[s+a],t,a),l===Ti&&(l=this._$AH[a]),o||(o=!d(l)||l!==this._$AH[a]),l===Hi?e=Hi:e!==Hi&&(e+=(null!=l?l:"")+n[a+1]),this._$AH[a]=l}o&&!i&&this.j(e)}j(e){e===Hi?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=e?e:"")}}class M extends S{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===Hi?void 0:e}}const Fi=yi?yi.emptyScript:"";class k extends S{constructor(){super(...arguments),this.type=4}j(e){e&&e!==Hi?this.element.setAttribute(this.name,Fi):this.element.removeAttribute(this.name)}}class H extends S{constructor(e,t,s,i,n){super(e,t,s,i,n),this.type=5}_$AI(e,t=this){var s;if((e=null!==(s=P(this,e,t,0))&&void 0!==s?s:Hi)===Ti)return;const i=this._$AH,n=e===Hi&&i!==Hi||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,o=e!==Hi&&(i===Hi||n);n&&this.element.removeEventListener(this.name,this,i),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t,s;"function"==typeof this._$AH?this._$AH.call(null!==(s=null===(t=this.options)||void 0===t?void 0:t.host)&&void 0!==s?s:this.element,e):this._$AH.handleEvent(e)}}class I{constructor(e,t,s){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(e){P(this,e)}}const zi=mi.litHtmlPolyfillSupport;null==zi||zi(C,N),(null!==(vi=mi.litHtmlVersions)&&void 0!==vi?vi:mi.litHtmlVersions=[]).push("2.5.0");const Z=(e,t,s)=>{var i,n;const o=null!==(i=null==s?void 0:s.renderBefore)&&void 0!==i?i:t;let a=o._$litPart$;if(void 0===a){const e=null!==(n=null==s?void 0:s.renderBefore)&&void 0!==n?n:null;o._$litPart$=a=new N(t.insertBefore(r(),e),e,void 0,null!=s?s:{})}return a._$AI(e),a};class SargassoComponent extends Sargasso{constructor(e,t={}){t.shadowDOM=void 0===t.shadowDOM||t.shadowDOM,t.componentOptions=window.sagassoComponentOptions||{},super(e,t),this.templateAttributes=[],this.renderAttributes=[],this.templateOptions={},this.obervableId=(this._hostElement||this.element).getAttribute("data-observable-id"),this.toDestroy=[]}start(){super.start(),this.obervableId&&(this.observable=this.observableStart(this.obervableId),this.observableData=this.getObservableData(this.obervableId)),this.renderOptions=this.observableStart("SargassoComponent-"+this.uid,{}),this.getAttributes(),this.watchAttributes(),this.setTemplateArgs({options:this.options.componentOptions||{},attributes:this.renderOptions.data,data:this.observableData?this.observableData:void 0}),this.setTemplate(this.buildTemplate()),this._template&&this.setRenderer(Z)}watchAttributes(){this.allAttributes=this.templateAttributes.concat(this.renderAttributes),this.attributeObserver=new MutationObserver((e=>{let t=!1,s=!1;e.forEach((e=>{"attributes"===e.type&&-1!==this.allAttributes.indexOf(e.attributeName)&&(t=!0,-1!==this.templateAttributes.indexOf(e.attributeName)&&(s=!0))})),t&&(this.getAttributes(),s&&(this.setTemplate(this.buildTemplate()),this.render()))})),this.attributeObserver.observe(this._hostElement||this.element,{attributes:!0})}getAttributes(){for(const e of this.templateAttributes){const t=(this._hostElement||this.element).getAttribute(e)||(this._hostElement||this.element).hasAttribute(e)||void 0;this.templateOptions[e]!==t&&(this.templateOptions[e]=t)}for(const e of this.renderAttributes){const t=(this._hostElement||this.element).getAttribute(e)||(this._hostElement||this.element).hasAttribute(e)||void 0;this.renderOptions.data[e]!==t&&(this.renderOptions.data[e]=t)}}buildTemplate(){return e=>Pi`
<div class="web-component-body">
<p>using default buildTemplate - override buildTemplate to customize component markup</p>
<pre>${this.obervableId}: ${JSON.stringify(e.data,"",2)}</pre>
<pre>attributes: ${JSON.stringify(e.attributes,"",2)}</pre>
<pre>options: ${JSON.stringify(e.options,"",2)}</pre>
</div>
`}sleep(){if(this.toDestroy)for(const e of this.toDestroy)e.destroy();this.attributeObserver&&this.attributeObserver.disconnect(),super.sleep()}_render(){super._render(),this.didRender()}didRender(){}}registerSargassoClass("SargassoComponent",SargassoComponent);const Ni={registerSargassoClass:registerSargassoClass,bootSargasso:(t={})=>{if(t.scrollElement&&ni.setOptions(t),t.breakpoints){new Breakpoints(document.body,t.breakpoints).start()}if(t.hijax){const s=new HijaxLoader(document.body,t.hijax);s.start(),e.loadPageHandler=s.setPage.bind(s)}else e.loadPageHandler=e=>{document.location.href=e};const s=new SargassoSupervisor(document.body,t);return s.start(t),s},elementTools:dt,validate:validate,setValidator:setValidator},Ii={theDOMWatcher:ii,theScrollWatcher:ni,theResizeWatcher:oi,theOrientationWatcher:ai,theWorkerWatcher:li,theObservableObjectWatcher:hi},Wi={liveElements:di,registeredClasses:fi,elementMetaData:ut};return e.ObservableObject=ObservableObject,e.Sargasso=Sargasso,e.SargassoComponent=SargassoComponent,e.services=Ii,e.system=Wi,e.utils=Ni,e}({});
var SargassoModule=function(e){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var r="object"==typeof t&&t&&t.Object===Object&&t,s=r,n="object"==typeof self&&self&&self.Object===Object&&self,i=s||n||Function("return this")(),o=i.Symbol;var a=function arrayMap$1(e,t){for(var r=-1,s=null==e?0:e.length,n=Array(s);++r<s;)n[r]=t(e[r],r,e);return n},c=Array.isArray,l=o,h=Object.prototype,u=h.hasOwnProperty,d=h.toString,p=l?l.toStringTag:void 0;var f=function getRawTag$1(e){var t=u.call(e,p),r=e[p];try{e[p]=void 0;var s=!0}catch(e){}var n=d.call(e);return s&&(t?e[p]=r:delete e[p]),n},b=Object.prototype.toString;var g=f,v=function objectToString$1(e){return b.call(e)},m=o?o.toStringTag:void 0;var w=function baseGetTag$5(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":m&&m in Object(e)?g(e):v(e)};var y=function isObjectLike$5(e){return null!=e&&"object"==typeof e},_=w,O=y;var x=function isSymbol$2(e){return"symbol"==typeof e||O(e)&&"[object Symbol]"==_(e)},j=a,S=c,E=x,k=o?o.prototype:void 0,A=k?k.toString:void 0;var C=function baseToString$1(e){if("string"==typeof e)return e;if(S(e))return j(e,baseToString$1)+"";if(E(e))return A?A.call(e):"";var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t},D=C;var $=function toString$4(e){return null==e?"":D(e)};var M=function baseSlice$1(e,t,r){var s=-1,n=e.length;t<0&&(t=-t>n?0:n+t),(r=r>n?n:r)<0&&(r+=n),n=t>r?0:r-t>>>0,t>>>=0;for(var i=Array(n);++s<n;)i[s]=e[s+t];return i};var P=function castSlice$1(e,t,r){var s=e.length;return r=void 0===r?s:r,!t&&r>=s?e:M(e,t,r)},T=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");var F=function hasUnicode$2(e){return T.test(e)};var L=function asciiToArray$1(e){return e.split("")},R="\\ud800-\\udfff",z="["+R+"]",W="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",H="\\ud83c[\\udffb-\\udfff]",V="[^"+R+"]",I="(?:\\ud83c[\\udde6-\\uddff]){2}",q="[\\ud800-\\udbff][\\udc00-\\udfff]",N="(?:"+W+"|"+H+")"+"?",U="[\\ufe0e\\ufe0f]?",B=U+N+("(?:\\u200d(?:"+[V,I,q].join("|")+")"+U+N+")*"),Q="(?:"+[V+W+"?",W,I,q,z].join("|")+")",G=RegExp(H+"(?="+H+")|"+Q+B,"g");var Z=L,J=F,Y=function unicodeToArray$1(e){return e.match(G)||[]};var K=P,X=F,ee=function stringToArray$1(e){return J(e)?Y(e):Z(e)},te=$;var re=function createCaseFirst$1(e){return function(t){t=te(t);var r=X(t)?ee(t):void 0,s=r?r[0]:t.charAt(0),n=r?K(r,1).join(""):t.slice(1);return s[e]()+n}}("toUpperCase"),se=$,ne=re;var ie=function capitalize$1(e){return ne(se(e).toLowerCase())};var oe=function arrayReduce$1(e,t,r,s){var n=-1,i=null==e?0:e.length;for(s&&i&&(r=e[++n]);++n<i;)r=t(r,e[n],n,e);return r};var ae=function basePropertyOf$1(e){return function(t){return null==e?void 0:e[t]}}({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),ce=$,le=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,he=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");var ue=function deburr$1(e){return(e=ce(e))&&e.replace(le,ae).replace(he,"")},de=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var pe=function asciiWords$1(e){return e.match(de)||[]},fe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var be=function hasUnicodeWord$1(e){return fe.test(e)},ge="\\ud800-\\udfff",ve="\\u2700-\\u27bf",me="a-z\\xdf-\\xf6\\xf8-\\xff",we="A-Z\\xc0-\\xd6\\xd8-\\xde",ye="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",_e="["+ye+"]",Oe="\\d+",xe="["+ve+"]",je="["+me+"]",Se="[^"+ge+ye+Oe+ve+me+we+"]",Ee="(?:\\ud83c[\\udde6-\\uddff]){2}",ke="[\\ud800-\\udbff][\\udc00-\\udfff]",Ae="["+we+"]",Ce="(?:"+je+"|"+Se+")",De="(?:"+Ae+"|"+Se+")",$e="(?:['’](?:d|ll|m|re|s|t|ve))?",Me="(?:['’](?:D|LL|M|RE|S|T|VE))?",Pe="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",Te="[\\ufe0e\\ufe0f]?",Fe=Te+Pe+("(?:\\u200d(?:"+["[^"+ge+"]",Ee,ke].join("|")+")"+Te+Pe+")*"),Le="(?:"+[xe,Ee,ke].join("|")+")"+Fe,Re=RegExp([Ae+"?"+je+"+"+$e+"(?="+[_e,Ae,"$"].join("|")+")",De+"+"+Me+"(?="+[_e,Ae+Ce,"$"].join("|")+")",Ae+"?"+Ce+"+"+$e,Ae+"+"+Me,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Oe,Le].join("|"),"g");var ze=pe,We=be,He=$,Ve=function unicodeWords$1(e){return e.match(Re)||[]};var Ie=oe,qe=ue,Ne=function words$1(e,t,r){return e=He(e),void 0===(t=r?void 0:t)?We(e)?Ve(e):ze(e):e.match(t)||[]},Ue=RegExp("['’]","g");var Be=function createCompounder$2(e){return function(t){return Ie(Ne(qe(t).replace(Ue,"")),e,"")}},Qe=ie,Ge=Be((function(e,t,r){return t=t.toLowerCase(),e+(r?Qe(t):t)}));const Ze={},setValidator=(e,t)=>{Ze[e]=t};setValidator("isDefined",(e=>void 0!==e)),setValidator("isUnDefined",(e=>void 0===e)),setValidator("isNull",(e=>null===e)),setValidator("isElement",(e=>e&&(e instanceof Element||e instanceof Window))),setValidator("isEventTarget",(e=>e&&e instanceof EventTarget)),setValidator("isString",(e=>e&&("string"==typeof e||e instanceof String))),setValidator("isArray",(e=>e&&e instanceof Array)),setValidator("notEmpty",(e=>e instanceof Array?0!==e.length:""!==e)),setValidator("isEmpty",(e=>void 0===e||!e||(e instanceof Array?0===e.length:""===e))),setValidator("isObject",(e=>e&&e instanceof Object)),setValidator("isFunction",(e=>e&&"function"==typeof e));const validate=(e,t,r)=>{const s=r.map((e=>{if(e instanceof Array){return-1!==e.map((e=>Ze[e]&&Ze[e](t))).indexOf(!0)}return Ze[e]&&Ze[e](t)}));if(-1!==s.indexOf(!1))throw new Error("call to "+e+" invalid value: "+t+" "+r,0+s)},Je=new WeakMap,hasClass=(e,t)=>(validate("hasClass element",e,["isDefined","isElement"]),validate("hasClass cssClass",t,["isDefined","notEmpty","isString"]),e.classList.contains(t)),isVisible=e=>(validate("isVisible element",e,["isDefined","isElement"]),!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)),setMetaData=(e,t,r)=>{validate("setMetaData element",e,["isDefined","isElement"]),validate("setMetaData k",t,["isDefined","isString"]),validate("setMetaData v",r,[["isUnDefined","isNull","isString","isObject"]]);const s=Je.get(e)||{};r?s[t]=r:delete s[t],Je.set(e,s)},getMetaData=(e,t)=>{validate("getMetaData element",e,["isDefined","isElement"]),validate("getMetaData k",t,["isDefined","isString"]);const r=Je.get(e)||{};return t?r[t]:r},on=function(e,t,r,s,n,i,o){"function"==typeof s&&(o=i,i=n,n=s,s=void 0),validate("on uid",e,["isDefined","notEmpty"]),validate("on container",t,["isDefined","isEventTarget"]),validate("on events",r,["isDefined","isString"]),validate("on fn",n,["isDefined","isFunction"]),validate("on selector",s,[["isEmpty","isString"]]);const a="on:"+e+"-"+r+"-"+s;if(getMetaData(t,a))return void console.error("Error: Sargasso utils.on: duplicate event handler specification. %o %s",t,a);const c={uid:e,events:r,selector:s||void 0,fn:i=>{o&&off(e,t,r,s),s?Array.from(t.querySelectorAll(s)).forEach((e=>{(i.target===e||e.contains(i.target))&&n(i,e)})):n(i)},options:i||!1};setMetaData(t,a,c),r.split(/[\s,]+/).forEach((e=>{t.addEventListener(e.trim(),c.fn,c.options)}))},off=function(e,t,r,s){validate("off uid",e,["isDefined","notEmpty"]),validate("off container",t,["isDefined","isEventTarget"]),validate("off events",r,["isDefined","isString"]),validate("off selector",s,[["isEmpty","isString"]]);const n="on:"+e+"-"+r+"-"+s,i=getMetaData(t,n);i&&(r.split(/[\s,]+/).forEach((e=>{t.removeEventListener(e.trim(),i.fn,i.options)})),setMetaData(t,n))},Ye={hasClass:hasClass,addClass:(e,t)=>{validate("addClass element",e,["isDefined","isElement"]),validate("addClass addClasses",t,["isDefined","notEmpty",["isString","isArray"]]),Array.isArray(t)||(t=t.split(/[\s,]/)),t.forEach((t=>{t=t.trim(),hasClass(e,t)||e.classList.add(t)}))},removeClass:(e,t)=>{validate("removeClass element",e,["isDefined","isElement"]),validate("removeClass removeClasses",t,["isDefined","notEmpty",["isString","isArray"]]),Array.isArray(t)||(t=t.split(/[\s,]/)),t.forEach((t=>{t=t.trim(),hasClass(e,t)&&e.classList.remove(t)}))},isVisible:isVisible,inViewPort:(e,t=window)=>{validate("inViewPort element",e,["isDefined","isElement"]);const r=e.getBoundingClientRect(),s=isVisible(e),n=r.bottom<0;let i;return i=t.self===window?r.top>(window.innerHeight||document.documentElement.clientHeight):r.top>t.clientHeight,s&&!i&&!n},setCSS:(e,t)=>{validate("css element",e,["isDefined","isElement"]),validate("css css",t,["isDefined",["isObject"]]);for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)){const s=Ge(r);e.style[s]=null!==t[r]?t[r]:null}},setMetaData:setMetaData,getMetaData:getMetaData,on:on,off:off,once:function(e,t,r,s,n,i){"function"==typeof s&&(i=n,n=s,s=void 0),on(e,t,r,s,n,i,!0)},offAll:function(e){validate("offAll container",e,["isDefined","isEventTarget"]);const t=Je.get(e)||{},r=[];for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&e.match(/^on:/)&&r.push(e);r.forEach((r=>{off(t[r].uid,e,t[r].events,t[r].selector)}))}};var Ke=function isObject$4(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},Xe=i,et=/\s/;var tt=function trimmedEndIndex$1(e){for(var t=e.length;t--&&et.test(e.charAt(t)););return t},rt=/^\s+/;var st=function baseTrim$1(e){return e?e.slice(0,tt(e)+1).replace(rt,""):e},nt=Ke,it=x,ot=/^[-+]0x[0-9a-f]+$/i,at=/^0b[01]+$/i,ct=/^0o[0-7]+$/i,lt=parseInt;var ht=Ke,now=function(){return Xe.Date.now()},ut=function toNumber$1(e){if("number"==typeof e)return e;if(it(e))return NaN;if(nt(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=nt(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=st(e);var r=at.test(e);return r||ct.test(e)?lt(e.slice(2),r?2:8):ot.test(e)?NaN:+e},dt=Math.max,pt=Math.min;var ft=function debounce(e,t,r){var s,n,i,o,a,c,l=0,h=!1,u=!1,d=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function invokeFunc(t){var r=s,i=n;return s=n=void 0,l=t,o=e.apply(i,r)}function leadingEdge(e){return l=e,a=setTimeout(timerExpired,t),h?invokeFunc(e):o}function shouldInvoke(e){var r=e-c;return void 0===c||r>=t||r<0||u&&e-l>=i}function timerExpired(){var e=now();if(shouldInvoke(e))return trailingEdge(e);a=setTimeout(timerExpired,function remainingWait(e){var r=t-(e-c);return u?pt(r,i-(e-l)):r}(e))}function trailingEdge(e){return a=void 0,d&&s?invokeFunc(e):(s=n=void 0,o)}function debounced(){var e=now(),r=shouldInvoke(e);if(s=arguments,n=this,c=e,r){if(void 0===a)return leadingEdge(c);if(u)return clearTimeout(a),a=setTimeout(timerExpired,t),invokeFunc(c)}return void 0===a&&(a=setTimeout(timerExpired,t)),o}return t=ut(t)||0,ht(r)&&(h=!!r.leading,i=(u="maxWait"in r)?dt(ut(r.maxWait)||0,t):i,d="trailing"in r?!!r.trailing:d),debounced.cancel=function cancel(){void 0!==a&&clearTimeout(a),l=0,s=c=n=a=void 0},debounced.flush=function flush(){return void 0===a?o:trailingEdge(now())},debounced};var bt=function listCacheClear$1(){this.__data__=[],this.size=0};var gt=function eq$2(e,t){return e===t||e!=e&&t!=t},vt=gt;var mt=function assocIndexOf$4(e,t){for(var r=e.length;r--;)if(vt(e[r][0],t))return r;return-1},wt=mt,yt=Array.prototype.splice;var _t=mt;var Ot=mt;var xt=mt;var jt=bt,St=function listCacheDelete$1(e){var t=this.__data__,r=wt(t,e);return!(r<0)&&(r==t.length-1?t.pop():yt.call(t,r,1),--this.size,!0)},Et=function listCacheGet$1(e){var t=this.__data__,r=_t(t,e);return r<0?void 0:t[r][1]},kt=function listCacheHas$1(e){return Ot(this.__data__,e)>-1},At=function listCacheSet$1(e,t){var r=this.__data__,s=xt(r,e);return s<0?(++this.size,r.push([e,t])):r[s][1]=t,this};function ListCache$4(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var s=e[t];this.set(s[0],s[1])}}ListCache$4.prototype.clear=jt,ListCache$4.prototype.delete=St,ListCache$4.prototype.get=Et,ListCache$4.prototype.has=kt,ListCache$4.prototype.set=At;var Ct=ListCache$4,Dt=Ct;var $t=function stackClear$1(){this.__data__=new Dt,this.size=0};var Mt=function stackDelete$1(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r};var Pt=function stackGet$1(e){return this.__data__.get(e)};var Tt=function stackHas$1(e){return this.__data__.has(e)},Ft=w,Lt=Ke;var Rt,zt=function isFunction$2(e){if(!Lt(e))return!1;var t=Ft(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},Wt=i["__core-js_shared__"],Ht=(Rt=/[^.]+$/.exec(Wt&&Wt.keys&&Wt.keys.IE_PROTO||""))?"Symbol(src)_1."+Rt:"";var Vt=function isMasked$1(e){return!!Ht&&Ht in e},It=Function.prototype.toString;var qt=function toSource$2(e){if(null!=e){try{return It.call(e)}catch(e){}try{return e+""}catch(e){}}return""},Nt=zt,Ut=Vt,Bt=Ke,Qt=qt,Gt=/^\[object .+?Constructor\]$/,Zt=Function.prototype,Jt=Object.prototype,Yt=Zt.toString,Kt=Jt.hasOwnProperty,Xt=RegExp("^"+Yt.call(Kt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var er=function baseIsNative$1(e){return!(!Bt(e)||Ut(e))&&(Nt(e)?Xt:Gt).test(Qt(e))},tr=function getValue$1(e,t){return null==e?void 0:e[t]};var rr=function getNative$6(e,t){var r=tr(e,t);return er(r)?r:void 0},sr=rr(i,"Map"),nr=rr(Object,"create"),ir=nr;var or=function hashClear$1(){this.__data__=ir?ir(null):{},this.size=0};var ar=function hashDelete$1(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},cr=nr,lr=Object.prototype.hasOwnProperty;var hr=function hashGet$1(e){var t=this.__data__;if(cr){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return lr.call(t,e)?t[e]:void 0},ur=nr,dr=Object.prototype.hasOwnProperty;var pr=nr;var fr=or,br=ar,gr=hr,vr=function hashHas$1(e){var t=this.__data__;return ur?void 0!==t[e]:dr.call(t,e)},mr=function hashSet$1(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=pr&&void 0===t?"__lodash_hash_undefined__":t,this};function Hash$1(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var s=e[t];this.set(s[0],s[1])}}Hash$1.prototype.clear=fr,Hash$1.prototype.delete=br,Hash$1.prototype.get=gr,Hash$1.prototype.has=vr,Hash$1.prototype.set=mr;var wr=Hash$1,yr=Ct,_r=sr;var Or=function isKeyable$1(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var xr=function getMapData$4(e,t){var r=e.__data__;return Or(t)?r["string"==typeof t?"string":"hash"]:r.map},jr=xr;var Sr=xr;var Er=xr;var kr=xr;var Ar=function mapCacheClear$1(){this.size=0,this.__data__={hash:new wr,map:new(_r||yr),string:new wr}},Cr=function mapCacheDelete$1(e){var t=jr(this,e).delete(e);return this.size-=t?1:0,t},Dr=function mapCacheGet$1(e){return Sr(this,e).get(e)},$r=function mapCacheHas$1(e){return Er(this,e).has(e)},Mr=function mapCacheSet$1(e,t){var r=kr(this,e),s=r.size;return r.set(e,t),this.size+=r.size==s?0:1,this};function MapCache$2(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var s=e[t];this.set(s[0],s[1])}}MapCache$2.prototype.clear=Ar,MapCache$2.prototype.delete=Cr,MapCache$2.prototype.get=Dr,MapCache$2.prototype.has=$r,MapCache$2.prototype.set=Mr;var Pr=MapCache$2,Tr=Ct,Fr=sr,Lr=Pr;var Rr=Ct,zr=$t,Wr=Mt,Hr=Pt,Vr=Tt,Ir=function stackSet$1(e,t){var r=this.__data__;if(r instanceof Tr){var s=r.__data__;if(!Fr||s.length<199)return s.push([e,t]),this.size=++r.size,this;r=this.__data__=new Lr(s)}return r.set(e,t),this.size=r.size,this};function Stack$1(e){var t=this.__data__=new Rr(e);this.size=t.size}Stack$1.prototype.clear=zr,Stack$1.prototype.delete=Wr,Stack$1.prototype.get=Hr,Stack$1.prototype.has=Vr,Stack$1.prototype.set=Ir;var qr=Pr,Nr=function setCacheAdd$1(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Ur=function setCacheHas$1(e){return this.__data__.has(e)};function SetCache$1(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new qr;++t<r;)this.add(e[t])}SetCache$1.prototype.add=SetCache$1.prototype.push=Nr,SetCache$1.prototype.has=Ur;i.Uint8Array;var Br=o?o.prototype:void 0;Br&&Br.valueOf;Object.prototype.propertyIsEnumerable,Object.getOwnPropertySymbols;var Qr=w,Gr=y;var Zr=function baseIsArguments$1(e){return Gr(e)&&"[object Arguments]"==Qr(e)},Jr=y,Yr=Object.prototype,Kr=Yr.hasOwnProperty,Xr=Yr.propertyIsEnumerable,es=(Zr(function(){return arguments}()),{});var ts=function stubFalse(){return!1};!function(e,t){var r=i,s=ts,n=t&&!t.nodeType&&t,o=n&&e&&!e.nodeType&&e,a=o&&o.exports===n?r.Buffer:void 0,c=(a?a.isBuffer:void 0)||s;e.exports=c}({get exports(){return es},set exports(e){es=e}},es);var rs=function isLength$2(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},ss=w,ns=rs,is=y,os={};os["[object Float32Array]"]=os["[object Float64Array]"]=os["[object Int8Array]"]=os["[object Int16Array]"]=os["[object Int32Array]"]=os["[object Uint8Array]"]=os["[object Uint8ClampedArray]"]=os["[object Uint16Array]"]=os["[object Uint32Array]"]=!0,os["[object Arguments]"]=os["[object Array]"]=os["[object ArrayBuffer]"]=os["[object Boolean]"]=os["[object DataView]"]=os["[object Date]"]=os["[object Error]"]=os["[object Function]"]=os["[object Map]"]=os["[object Number]"]=os["[object Object]"]=os["[object RegExp]"]=os["[object Set]"]=os["[object String]"]=os["[object WeakMap]"]=!1;var as=function baseIsTypedArray$1(e){return is(e)&&ns(e.length)&&!!os[ss(e)]};var cs=function baseUnary$1(e){return function(t){return e(t)}},ls={};!function(e,t){var s=r,n=t&&!t.nodeType&&t,i=n&&e&&!e.nodeType&&e,o=i&&i.exports===n&&s.process,a=function(){try{var e=i&&i.require&&i.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=a}({get exports(){return ls},set exports(e){ls=e}},ls);var hs=as,us=cs,ds=ls&&ls.isTypedArray;ds&&us(ds),Object.prototype.hasOwnProperty;Object.prototype;(function overArg$1(e,t){return function(r){return e(t(r))}})(Object.keys,Object),Object.prototype.hasOwnProperty;Object.prototype.hasOwnProperty;var ps=rr(i,"DataView"),fs=sr,bs=rr(i,"Promise"),gs=rr(i,"Set"),vs=rr(i,"WeakMap"),ms=w,ws=qt,ys="[object Map]",_s="[object Promise]",Os="[object Set]",xs="[object WeakMap]",js="[object DataView]",Ss=ws(ps),Es=ws(fs),ks=ws(bs),As=ws(gs),Cs=ws(vs),Ds=ms;(ps&&Ds(new ps(new ArrayBuffer(1)))!=js||fs&&Ds(new fs)!=ys||bs&&Ds(bs.resolve())!=_s||gs&&Ds(new gs)!=Os||vs&&Ds(new vs)!=xs)&&(Ds=function(e){var t=ms(e),r="[object Object]"==t?e.constructor:void 0,s=r?ws(r):"";if(s)switch(s){case Ss:return js;case Es:return ys;case ks:return _s;case As:return Os;case Cs:return xs}return t});Object.prototype.hasOwnProperty;var $s,Ms,Ps,Ts,Fs,Ls,Rs={},zs={get exports(){return Rs},set exports(e){Rs=e}},Ws=($s=[],Ms=[],Ps=[],Ts=[],Fs=null,Ls=function(e,t,r,s){var n=r||null,i=s||[{target:e,property:""}];$s.push(i),e instanceof Array&&(e.hasOwnProperty("__length")?e.__length=e.length:Object.defineProperty(e,"__length",{enumerable:!1,value:e.length,writable:!0}));var o=[],_getPath=function(e,t,r){for(var s="",n=null,o=0;o<i.length;o++)n instanceof Array&&!isNaN(i[o].property)&&(i[o].property=n.indexOf(i[o].target)),s=s+"."+i[o].property,n=i[o].target;return s=(s=s+"."+t).substring(2),!0===r&&(s="/"+s.replace(/\./g,"/")),s},_notifyObservers=function(e){if(!0!==n.paused){var r="number"==typeof t;if(r||!0===t)setTimeout((function(){if(e===o.length){var t=o.slice(0);o=[];for(var r=0;r<n.observers.length;r++)n.observers[r](t)}}),r&&t>0?t:10);else{var s=o.slice(0);o=[];for(var i=0;i<n.observers.length;i++)n.observers[i](s)}}},a={get:function(e,r){if("__getTarget"===r)return e;if("__isProxy"===r)return!0;if("__getParent"===r)return function(e){void 0===e&&(e=1);var t=_getPath(0,"__getParent").split(".");return t.splice(-(e+1),e+1),function(e,t){return t.split(".").reduce((function(e,t){return e?e[t]:void 0}),e||self)}(n.parentProxy,t.join("."))};if("__getPath"===r)return _getPath(0,"__getParent").slice(0,-12);var s=e[r];if(e instanceof Date&&s instanceof Function&&null!==s)return s.bind(e);if(s instanceof Object&&null!==s&&e.hasOwnProperty(r)){if(!0===s.__isProxy&&(s=s.__getTarget),s.__targetPosition>-1&&null!==Ps[s.__targetPosition])for(var o=Ts[s.__targetPosition],a=0,c=o.length;a<c;a++)if(n===o[a].observable)return o[a].proxy;var l=i.slice(0);return l.push({target:s,property:r}),Ls(s,t,n,l)}return s},deleteProperty:function(e,t){var r=!0;Fs===l&&(r=!1,Fs=null);var s=Object.assign({},e);if(o.push({type:"delete",target:e,property:t,newValue:null,previousValue:s[t],currentPath:_getPath(0,t),jsonPointer:_getPath(0,t,!0),proxy:l}),!0===r){n.changesPaused||delete e[t];for(var i=0,a=Ps.length;i<a&&e!==Ps[i];i++);for(var c=Ts[i]||[],h=c.length;h--;)c[h].proxy!==l&&(Fs=c[h].proxy,delete c[h].proxy[t])}return _notifyObservers(o.length),!0},set:function(e,t,r,s){r&&r.__isProxy&&(r=r.__getTarget);var i=!0;Fs===l&&(i=!1,Fs=null);var a=e[t];if(a!==r||!1===i||"length"===t&&e instanceof Array&&e.__length!==r){var c=!0,h=typeof a,u="update";if("undefined"===h&&(u="add"),o.push({type:u,target:e,property:t,newValue:r,previousValue:s[t],currentPath:_getPath(0,t),jsonPointer:_getPath(0,t,!0),proxy:l}),"length"===t&&e instanceof Array&&e.__length!==r&&(o[o.length-1].previousValue=e.__length,e.__length=r),!0===i){n.changesPaused||(e[t]=r),c=!1;for(var d=e.__targetPosition,p=Ts[d].length;p--;)if(n===Ts[d][p].observable&&null!==Ps[Ts[d][p].observable.parentTarget.__targetPosition]){c=!0;break}if(c){for(var f=Ts[d],b=0,g=f.length;b<g;b++)f[b].proxy!==l&&(Fs=f[b].proxy,f[b].proxy[t]=r);setTimeout((function(){if("object"===h&&null!==a){for(var t=Object.keys(e),r=0,s=t.length;r<s;r++)if(e[t[r]]===a)return;var i=!1;if(function iterate(e){for(var t=Object.keys(e),r=0,s=t.length;r<s;r++){var n=e[t[r]];if(n instanceof Object&&null!==n&&iterate(n),n===a)return void(i=!0)}}(e),!0===i)return;!function iterate(e){for(var t=Object.keys(e),r=0,s=t.length;r<s;r++){var i=e[t[r]];i instanceof Object&&null!==i&&iterate(i)}var o=-1;for(r=0,s=Ps.length;r<s;r++)if(e===Ps[r]){o=r;break}if(o>-1){for(var a=Ts[o],c=a.length;c--;)if(n===a[c].observable){a.splice(c,1);break}0==a.length&&(Ps[o]=null)}}(a)}}),1e4)}}c&&_notifyObservers(o.length)}return!0}},c=e.__targetPosition;c>-1||Object.defineProperty(e,"__targetPosition",{value:Ps.length,writable:!1,enumerable:!1,configurable:!1});var l=new Proxy(e,a);null===n&&(n={parentTarget:e,domDelay:t,parentProxy:l,observers:[],paused:!1,path:i,changesPaused:!1},Ms.push(n));var h={target:e,proxy:l,observable:n};return c>-1?(null===Ps[c]&&(Ps[c]=e),Ts[c].push(h)):(Ps.push(e),Ts.push([h])),l},{create:function(e,t,r){!0===e.__isProxy&&(e=e.__getTarget);var s=Ls(e,t);return"function"==typeof r&&this.observe(s,r),function iterate(e){for(var t=e.__getTarget,r=Object.keys(t),s=0,n=r.length;s<n;s++){var i=r[s];t[i]instanceof Object&&null!==t[i]&&iterate(e[i])}}(s),s},observe:function(e,t){for(var r=Ms.length;r--;)if(Ms[r].parentProxy===e){Ms[r].observers.push(t);break}},pause:function(e){for(var t=Ms.length,r=!1;t--;)if(Ms[t].parentProxy===e){Ms[t].paused=!0,r=!0;break}if(0==r)throw new Error("ObseravableSlim could not pause observable -- matching proxy not found.")},resume:function(e){for(var t=Ms.length,r=!1;t--;)if(Ms[t].parentProxy===e){Ms[t].paused=!1,r=!0;break}if(0==r)throw new Error("ObseravableSlim could not resume observable -- matching proxy not found.")},pauseChanges:function(e){for(var t=Ms.length,r=!1;t--;)if(Ms[t].parentProxy===e){Ms[t].changesPaused=!0,r=!0;break}if(0==r)throw new Error("ObseravableSlim could not pause changes on observable -- matching proxy not found.")},resumeChanges:function(e){for(var t=Ms.length,r=!1;t--;)if(Ms[t].parentProxy===e){Ms[t].changesPaused=!1,r=!0;break}if(0==r)throw new Error("ObseravableSlim could not resume changes on observable -- matching proxy not found.")},remove:function(e){for(var t=null,r=!1,s=Ms.length;s--;)if(Ms[s].parentProxy===e){t=Ms[s],r=!0;break}for(var n=Ts.length;n--;)for(var i=Ts[n].length;i--;)Ts[n][i].observable===t&&(Ts[n].splice(i,1),0===Ts[n].length&&(Ps[n]=null));!0===r&&Ms.splice(s,1)}});try{zs.exports=Ws}catch(e){}const Hs={};class ObservableObject{constructor(e,t={},r={}){if(this.id=e,Hs[this.id])throw new Error("ObservableObject "+e+" already exists.");this.bound={},this.data=Rs.create(t,!1,(e=>{this.sync(e)})),this.options=r,Hs[this.id]=this}destroy(){Rs.pause(this.data),delete Hs[this.id],delete this.data,Object.keys(this.bound).forEach((e=>{Object.keys(this.bound[e]).forEach((t=>{this.unbind(t,e)}))})),Rs.remove(this.data)}getObservableData(){return this.data}bind(e,t,r="*"){this.bound[r]||(this.bound[r]={}),this.bound[r][e]=t,t(this.id,"connect")}unbind(e,t="*"){this.bound[t][e](this.id,"disconnect"),this.bound[t]&&this.bound[t][e]&&delete this.bound[t][e]}sync(e){for(const t of e){const e=t.type,r=t.currentPath,s=t.newValue,n=t.previousValue,i=[];for(const e in this.bound)if("*"===e)i.push(e);else{const t=new RegExp("^"+e.replace(".","\\."));r.match(t)&&i.push(e)}for(const t of i)for(const i in this.bound[t])this.bound[t][i](this.id,e,r,s,n)}}}let Vs,Is,qs,Ns,Us,Bs;class ObserverSubscriptionManager{constructor(e){this.options=e,this.observers=[],this.pendingAnimationFrame=void 0,this.frameQueue=[],this.sleeping=!0}subscribe(e){!this.observers.length&&this.sleeping&&this.wakeup(),this.observers.push(e)}unSubscribe(e){-1!==this.observers.indexOf(e)&&this.observers.splice(this.observers.indexOf(e),1),this.observers.length||this.sleep()}sleep(){this.sleeping=!0}wakeup(){this.sleeping=!1}notifyObservers(e,t){for(let r=0;r<this.observers.length;r++)this.observers[r][e]&&this.observers[r][e].apply(this.observers[r],t||[])}flushQueue(){this.pendingAnimationFrame&&(cancelAnimationFrame(this.pendingAnimationFrame),this.pendingAnimationFrame=void 0),this.frameQueue=[]}queueFrame(e){this.frameQueue.push(e.bind(this)),this.pendingAnimationFrame||(this.pendingAnimationFrame=requestAnimationFrame((()=>{this.processQueue()})))}processQueue(){this.pendingAnimationFrame=void 0;const e=this.frameQueue.slice(0);this.frameQueue=[];for(let t=0;t<e.length;t++)e[t]()}}class DOMWatcher extends ObserverSubscriptionManager{constructor(e={}){super(e),this.mutationHandler=ft(((e,t)=>{this.observeDOM(this.options.shadowDOM||document.body)}),25,{maxWait:100}),this.mutationObserver=new MutationObserver(this.mutationHandler,!1)}subscribe(e){super.subscribe(e),e.watchDOM(this.options.shadowDOM||document.body)}wakeup(){super.wakeup(),this.mutationObserver.observe(this.options.shadowDOM||document.body,{childList:!0,subtree:!0})}sleep(){super.sleep(),this.mutationObserver.disconnect()}observeDOM(e){this.notifyObservers("watchDOM",[e||this.options.shadowDOM||document.body])}}Vs=new DOMWatcher,Is=new class ScrollWatcher extends ObserverSubscriptionManager{constructor(e={}){super(e),this.scrollElement=this.options.scrollElement||window,this.lastscroll=0,this.scrolling=!1}trigger(){this.scrolling||this.scrollLoop()}scrollLoop(){if(this.lastscroll!==this.scrollTop()){this.scrolling=!0,this.lastscroll=this.scrollTop(),this.watchScroll();const frame=()=>{this.scrollLoop()};this.queueFrame(frame)}else this.scrolling=!1}setOptions(e={}){this.sleep(),this.scrollElement=e.scrollElement||window,this.wakeup()}subscribe(e){super.subscribe(e),e.watchScroll()}wakeup(){super.wakeup(),Ye.on("theScrollWatcher",this.scrollElement,"scroll",(()=>{this.trigger()}))}sleep(){super.sleep(),Ye.off("theScrollWatcher",this.scrollElement,"scroll")}inViewPort(e){return Ye.inViewPort(e,this.scrollElement)}watchScroll(){this.notifyObservers("watchScroll")}scrollTop(e){if(this.scrollElement===window){if(void 0===e)return window.pageYOffset;window.scrollTo(0,e)}else{if(void 0===e)return this.scrollElement.scrollTop;this.scrollElement.scrollTop=e}}},qs=new class ResizeWatcher extends ObserverSubscriptionManager{constructor(e){super(e),this.debounce=ft((()=>{this.watchResize()}),250)}subscribe(e){super.subscribe(e),e.watchResize()}wakeup(){super.wakeup(),window.addEventListener("resize",this.debounce,!1)}sleep(){super.sleep(),window.removeEventListener("resize",this.debounce)}watchResize(){this.notifyObservers("watchResize")}},Ns=new class OrientationWatcher extends ObserverSubscriptionManager{constructor(e){super(e),"onorientationchange"in window?Ye.addClass(document.body,"have-orientation"):Ye.addClass(document.body,"no-orientation"),this.debounce=ft((()=>{this.watchOrientation()}),250)}subscribe(e){super.subscribe(e),e.watchOrientation()}wakeup(){super.wakeup(),"onorientationchange"in window&&window.addEventListener("orientationchange",this.debounce,!1)}sleep(){super.sleep(),"onorientationchange"in window&&window.removeEventListener("orientationchange",this.debounce)}watchOrientation(){this.notifyObservers("watchOrientation")}},Us=new class WorkerWatcher extends ObserverSubscriptionManager{constructor(e){super(e),this.workers={}}registerWorker(e,t){if(!this.workers[e]){let r=t,s=!1;if(!t.match(/^(http|\/)/i)){const e=new Blob([t],{type:"text/javascript"});r=URL.createObjectURL(e),s=!0}this.workers[e]={worker:new Worker(r),observers:[]},s&&URL.revokeObjectURL(r),this.workers[e].worker.onmessage=t=>{this.workerMessage(e,t)}}return this.workers[e].worker}subscribe(e,t){if(!this.workers[t])throw new Error("worker "+t+" does not exist");this.workers[t].observers.push(e),super.subscribe(e)}unSubscribe(e,t){if(!this.workers[t])throw new Error("worker "+t+" does not exist");const r=this.workers[t].observers;-1!==r.indexOf(e)&&r.splice(r.indexOf(e),1),r.length||(this.workers[t].worker.terminate(),delete this.workers[t]),super.unSubscribe(e)}workerMessage(e,t){this.workers[e].observers.forEach((r=>{r.workerMessage&&r.workerMessage(e,t)}))}wakeup(){super.wakeup()}sleep(){super.sleep()}},Bs=new class ObservableObjectWatcher extends ObserverSubscriptionManager{constructor(e){super(e),this.registeredObservableObjects={}}getObservable(e){return this.registeredObservableObjects[e]?this.registeredObservableObjects[e].observable:void 0}observableStart(e,t){const r=(e=>Hs[e])(e);if(r&&void 0!==t)throw new Error("ObservableObject "+e+" already exists, can't build.");return this.registeredObservableObjects[e]||(this.registeredObservableObjects[e]=r?{id:e,observable:r,observers:[],managed:!1}:{id:e,observable:new ObservableObject(e,t),observers:[],managed:!0},this.registeredObservableObjects[e].observable.bind(this.constructor.name,this.notify.bind(this))),this.registeredObservableObjects[e].observable}observableDestroy(e){if(!this.registeredObservableObjects[e])throw new Error("ObservableObject observableDestroy "+e+" does not exist");this.registeredObservableObjects[e].observable.unbind(this.constructor.name),this.registeredObservableObjects[e].observable.destroy(),delete this.registeredObservableObjects[e]}subscribe(e,t,r){this.registeredObservableObjects[t]||this.observableStart(t,r),this.registeredObservableObjects[t].observers.push(e),super.subscribe(e)}unSubscribe(e,t){if(!this.registeredObservableObjects[t])throw new Error("ObservableObject unSubscribe "+t+" does not exist");const r=this.registeredObservableObjects[t].observers;-1!==r.indexOf(e)&&r.splice(r.indexOf(e),1),!r.length&&this.registeredObservableObjects[t].managed&&this.observableDestroy(t),super.unSubscribe(e)}notify(e,t,r,s,n){if(!this.registeredObservableObjects[e])throw new Error("ObservableObject notify "+e+" does not exist");this.registeredObservableObjects[e].observers.forEach((i=>{i.observableChanged&&i.observableChanged(e,t,r,s,n)}))}};var Qs=Be((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()}));let Gs=0;const Zs=[],Js="customElements"in window,Ys={},registerSargassoClass=(e,t)=>{if(Ys[e])throw new Error("Sargasso class "+e+" is already registered.");if(Ys[e]=t,Js){const t=new Function("registeredClasses",`\n\t\t\treturn class ${e}Element extends HTMLElement {\n\t\t\t\tconstructor(element, options = {}) {\n\t\t\t\t\tsuper()\n\t\t\t\t\tthis.helperClass= '${e}'\n\t\t\t\t\tthis.helpers = []\n\t\t\t\t}\n\n\t\t\t\tconnectedCallback () {\n\t\t\t\t\tthis.helpers.push(new registeredClasses[this.helperClass](this,{isCustomElement:true}))\n\t\t\t\t\tif (this.hasAttributes()) {\n\t\t\t\t\t\tfor(let i = 0; i < this.attributes.length; i++) {\n\t\t\t\t\t\t\tif(this.attributes[i].name.match(/^sargasso-/)) {\n\t\t\t\t\t\t\t\tlet classname = this.attributes[i].name.replace(/^sargasso-/,'').split('-').map(word=> word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join('')\n\t\t\t\t\t\t\t\tif(!registeredClasses[classname]) {\n\t\t\t\t\t\t\t\t\tconsole.log('instantiate by attribute ' + this.attributes[i].name + ' > ' + classname + ' is not a sargasso class')\n\t\t\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tthis.helpers.push(new registeredClasses[classname](this,{isCustomElement:true}))\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.helpers.forEach((helper) => {\n\t\t\t\t\t\thelper.start()\n\t\t\t\t\t})\n\t\t\t\t}\n\n\t\t\t\tdisconnectedCallback () {\n\t\t\t\t\tthis.helpers.forEach((helper) => {\n\t\t\t\t\t\thelper.sleep()\n\t\t\t\t\t\thelper.destroy()\n\t\t\t\t \t})\n\t\t\t\t\tthis.helpers = [] // nuke the reference for trash collection\n\t\t\t\t}\n\t\t\t}`)(Ys),r=window.sargassoOptions||{},s=void 0!==r.customElementPrefix?r.customElementPrefix:"sargasso-";customElements.define(s+Qs(e),t)}},Ks=["DOMChanged","didScroll","didResize","didBreakpoint","enterViewport","exitViewport","enterFullscreen","exitFullscreen","newPage","elementEvent","workerOnMessage","observableChanged"];class Sargasso{constructor(e,t={}){validate("Sargasso constructor element",e,["isDefined","isElement"]),validate("Sargasso constructor options",t,["isDefined",["isObject"]]),this.uid=++Gs,this.element=e,t.shadowDOM&&(this._shadowDOM=e.attachShadow({mode:"open"}),this._shadowRoot=document.createElement("div"),this._shadowDOM.append(this._shadowRoot),this._hostElement=this.element,this.element=this._shadowRoot),this.options=t,this._pendingAnimationFrame=void 0,this._frameQueue=[],this._isInViewport=!1,this._workers={},this._observables={},this._template=void 0,this._templateArgs={},this._started=!1,this.render=ft((()=>{this._render()}),100,{maxWait:250})}start(){const e=this.getMetaData("registeredResponsiveControllers")||[];e.push(this),this.setMetaData("registeredResponsiveControllers",e),this.setMetaData(this.constructor.name,this),Zs.push(this),this._shadowDOM&&(this._shadowDOMWatcher||(this._shadowDOMWatcher=new DOMWatcher({shadowDOM:this._shadowRoot})),this._shadowDOMWatcher.subscribe(this)),this.options.watchDOM&&Vs.subscribe(this),(this.options.watchScroll||this.options.watchViewport)&&Is.subscribe(this),(this.options.watchResize||this.options.watchViewport)&&qs.subscribe(this),(this.options.watchOrientation||this.options.watchViewport)&&Ns.subscribe(this),this.elementListener=e=>{e.detail&&e.detail.sargassoEvent&&-1!==Ks.indexOf(e.detail.sargassoEvent)?this[e.detail.sargassoEvent].apply(this,e.detail.sargassoEventOptions||[]):this.elementEvent(e)},this.element.addEventListener("sargasso",this.elementListener),this._started=!0}sleep(){this._shadowDOM&&this._shadowDOMWatcher.unSubscribe(this),this.options.watchDOM&&Vs.unSubscribe(this),(this.options.watchScroll||this.options.watchViewport)&&Is.unSubscribe(this),(this.options.watchResize||this.options.watchViewport)&&qs.unSubscribe(this),(this.options.watchOrientation||this.options.watchViewport)&&Ns.unSubscribe(this),this.element.removeEventListener("sargasso",this.elementListener),Ye.offAll(this.element),this._started=!1}DOMChanged(e){}didScroll(){}didResize(){}didBreakpoint(){}enterViewport(){}exitViewport(){}enterFullscreen(){}exitFullscreen(){}newPage(e,t){}elementEvent(e){}workerOnMessage(e,t){}observableChanged(e,t,r,s,n){this.render()}setMetaData(e,t){Ye.setMetaData(this.element,e,t)}getMetaData(e){return Ye.getMetaData(this.element,e)}on(e,t,r,s){Ye.on(this.constructor.name+"-"+this.uid,this.element,e,t,r,s)}off(e,t){Ye.off(this.constructor.name+"-"+this.uid,this.element,e,t)}once(e,t,r,s){Ye.once(this.constructor.name+"-"+this.uid,this.element,e,t,r,s)}notifyAll(e,t){if(-1===Ks.indexOf(e))throw new Error("invalid event name "+e);for(let r=0;r<Zs.length;r++){const s=Zs[r];s!==this&&s[e]&&s[e].apply(s,t)}}notifyElement(e,t,r){if(-1===Ks.indexOf(t))throw new Error("invalid event name "+t);const s=this.getMetaData("registeredResponsiveControllers");if(s)for(let e=0;e<s.length;e++){const n=s[e];n!==this&&n[t]&&n[t].apply(n,r)}}queueFrame(e){this._frameQueue.push(e.bind(this)),this._pendingAnimationFrame||(this._pendingAnimationFrame=requestAnimationFrame((()=>{this._processQueue()})))}wantFullscreen(e){e?this.enterFullscreen():this.exitFullscreen()}hasClass(e){return Ye.hasClass(this.element,e)}addClass(e){Ye.addClass(this.element,e)}removeClass(e){Ye.removeClass(this.element,e)}setCSS(e){Ye.setCSS(this.element,e)}isVisible(){return Ye.isVisible(this.element)}workerStart(e,t){return this._workers[e]=Us.registerWorker(e,t),Us.subscribe(this,e),this._workers[e]}workerPostMessage(e,t){t.uid||(t.uid=this.uid),this._workers[e]&&this._workers[e].postMessage(t)}getObservable(e){return this._observables[e]}getObservableData(e){return this._observables[e].data}observableStart(e,t){return Bs.subscribe(this,e,t),this._observables[e]=Bs.getObservable(e),this._observables[e]}observableStop(e){this._observables[e]&&(Bs.unSubscribe(this,e),delete this._observables[e])}observableStopAll(){for(const e in this._observables)this.observableStop(e)}setTemplate(e){this._template=e}setRenderer(e){this.renderer=e}setTemplateArgs(e={}){this._templateArgs=e,this.render()}getTemplateArgs(){const e=this._templateArgs||[];return JSON.parse(JSON.stringify(e))}_render(){this._template&&this.renderer&&this.renderer(this._template.apply(this,this.getTemplateArgs()),this.element)}_flushQueue(){this._pendingAnimationFrame&&(cancelAnimationFrame(this._pendingAnimationFrame),this._pendingAnimationFrame=void 0),this._frameQueue=[]}_processQueue(){this._pendingAnimationFrame=void 0;const e=this._frameQueue.slice(0);this._frameQueue=[];for(let t=0;t<e.length;t++)e[t]()}_stopWorker(e){this._workers[e]&&(Us.unSubscribe(this,e),delete this._workers[e])}_stopAllWorkers(){for(const e in this._workers)this._stopWorker(e)}destroy(){this._stopAllWorkers(),this.observableStopAll(),this._flushQueue(),this._started&&this.sleep();const e=this.getMetaData("registeredResponsiveControllers");e&&-1!==e.indexOf(this)&&(e.splice(e.indexOf(this),1),this.setMetaData("registeredResponsiveControllers",e)),this.setMetaData(this.constructor.name,null),this.element=null,-1!==Zs.indexOf(this)&&Zs.splice(Zs.indexOf(this),1)}watchDOM(e){e===this._shadowRoot?Vs.observeDOM(this._shadowRoot):this.DOMChanged(e)}watchScroll(){this.options.watchViewport&&this.inViewport(),this.didScroll()}watchResize(){this.options.watchViewport&&this.inViewport(),this.didResize()}watchOrientation(){!window.orientation||90!==window.orientation&&-90!==window.orientation?this.wantFullscreen(!1):this.wantFullscreen(!0)}inViewport(){Is.inViewPort(this.element)?this._isInViewport||(this.enterViewport(),this._isInViewport=!0):this._isInViewport&&(this.exitViewport(),this._isInViewport=!1)}workerMessage(e,t){t.data.uid===this.uid&&this.workerOnMessage(e,t.data)}nativeRequestFullScreen(){if(document.fullscreenElement){if(document.fullscreenElement===this.element)return;document.exitFullscreen()}this.element.requestFullscreen()}nativeExitFullScreen(){document.fullscreenElement&&document.fullscreenElement===this.element&&document.exitFullscreen()}}registerSargassoClass("Sargasso",Sargasso);class LazyInstantiate extends Sargasso{constructor(e,t={}){t.watchScroll=!0,t.watchResize=!0,t.watchDOM=!0,t.immortal=!0,super(e,t)}didResize(){super.didResize(),this.lazyHandler()}didScroll(){super.didScroll(),this.lazyHandler()}DOMChanged(e){super.DOMChanged(e),this.lazyHandler(e)}lazyHandler(e=document){const t=e.querySelectorAll("[data-lazy-sargasso-class]");for(let e=0;e<t.length;e++){const r=t[e];if(Is.inViewPort(r)){const s=r.getAttribute("data-lazy-sargasso-class").split(/\s*,\s*/);for(let r=0;r<s.length;r++){new Ys[s[r]](t[e]).start()}r.removeAttribute("data-lazy-sargasso-class")}}}}registerSargassoClass("LazyInstantiate",LazyInstantiate);class SargassoSupervisor extends Sargasso{constructor(e,t={}){super(e,{watchDOM:!0,mortal:!1}),this.lazy=new LazyInstantiate(e,t)}start(){this.lazy.start(),super.start()}instantiate(e){const t=e.getAttribute("data-sargasso-class").split(/\s*,\s*/);for(let r=0;r<t.length;r++)try{new Ys[t[r]](e).start()}catch(e){console.log("error instantiating "+t[r],e,Ys)}e.removeAttribute("data-sargasso-class")}newPage(){this.doIt()}DOMChanged(e){this.doIt(e)}doIt(e=document.body){e.getAttribute("data-sargasso-class")&&this.instantiate(e);const t=e.querySelectorAll("[data-sargasso-class]");for(const e of t)this.instantiate(e);const r=[];for(let e=0;e<Zs.length;e++)Zs[e].options.immortal||Zs[e].options.isCustomElement||document.body.contains(Zs[e].element)||r.push(Zs[e]);for(let e=0;e<r.length;e++)r[e].destroy()}}registerSargassoClass("SargassoSupervisor",SargassoSupervisor);const Xs=window.breakpoints||{widths:[{className:"breakpoint-phone",maxWidth:599},{className:"breakpoint-tablet",maxWidth:904},{className:"breakpoint-desktop",maxWidth:void 0}]};class Breakpoints extends Sargasso{constructor(e,t={}){t.watchResize=!0,super(e,t),this.options.widths=t.widths||Xs,this.scale=void 0,this.widths=[],this.classes=[],this.debouncedDetectGeometry=ft((()=>{this.detectGeometry()}),100,{maxWait:150})}start(){super.start(),this.debouncedDetectGeometry()}didResize(){this.debouncedDetectGeometry()}detectGeometry(){const e=window.doBreakpoints(this.options.widths);if(e!==this.scale){const frame=()=>{this.notifyAll("didBreakpoint",[e])};this.queueFrame(frame)}this.scale=e}}registerSargassoClass("Breakpoints",Breakpoints);class HijaxLoader extends Sargasso{constructor(e,t={}){t.watchDOM=!0,t.immortal=!0,super(e,t),this.excludeRegex=new RegExp("^(//|http|javascript|mailto|#)","i"),this.currentPage=location.pathname+location.search,this.cachedMarkup={}}start(){const e=document.querySelectorAll("[data-hijax-skip-unchanged]");for(let t=0;t<e.length;t++){const r=e[t],s=r.getAttribute("id");this.cachedMarkup[s]=r.innerHTML}super.start(),window.addEventListener("popstate",(e=>{this.watchPopState(e)}),!1)}DOMChanged(e){super.DOMChanged(e),this.hijaxLinks(e)}watchPopState(e){location.pathname+location.search!==this.currentPage&&this.preFlight(location.pathname+location.search)}hijaxLinks(e){const t=e?e.getElementsByTagName("a"):this.element.getElementsByTagName("a");for(let e=0;e<t.length;e++){const r=t[e],s=r.getAttribute("href");!s||r.getAttribute("data-hijaxed")||r.getAttribute("target")||r.hasAttribute("data-no-hijax")||this.excludeRegex.exec(s)||(r.setAttribute("data-hijaxed",!0),r.addEventListener("click",(e=>{e.preventDefault(),this.setPage(s)}),!1))}}setPage(e,t){e===this.currentPage||t?this.preFlight(e):(history.pushState(null,null,e),this.watchPopState())}preFlight(e){if(!this.options.preFlight)return this.loadPage(e);this.options.preFlight(e,((t,r,s)=>{t&&(this.options.onError?this.options.onError("danger",t):alert("Error loading page: "+t)),r?this.currentPage=location.pathname+location.search:this.loadPage(s||e)}))}loadPage(e){this.queueFrame((()=>{Ye.addClass(document.body,"hijax-loading")})),this.options.onExitPage&&this.options.onExitPage();const t=new XMLHttpRequest;t.open("GET",e),t.setRequestHeader("Sargasso-Hijax",1),t.setRequestHeader("x-digitopia-hijax",1),this.options.onLoading&&(this.options.onLoading(),t.onreadystatechange=this.options.onLoading),t.onload=()=>{if(301===t.status||302===t.status||t.getResponseHeader("Sargasso-Location")){const e=t.getResponseHeader("Location")?t.getResponseHeader("Location"):t.getResponseHeader("Sargasso-Location");this.setPage(e)}else if(200===t.status){Is.scrollTop(0),this.mergePage(t.responseText);const e=this.currentPage,frame=()=>{this.notifyAll("newPage",[e,location.pathname+location.search]),Ye.removeClass(document.body,"hijax-loading")};this.queueFrame(frame),this.currentPage=location.pathname+location.search}else{const e=t.getResponseHeader("Sargasso-Flash-Level")||"danger";let r=t.getResponseHeader("Sargasso-Flash-Message")||t.statusText;r||(r="Could not connect to server."),this.options.onError?this.options.onError(e,r):alert("Error loading page: "+r)}},t.send()}processScripts(e){Array.from(e).forEach((e=>{e.remove();const t=e.getAttribute("id");document.getElementById(t)||document.getElementsByTagName("head")[0].appendChild(e)}))}mergePage(e){const t=document.querySelectorAll("[data-ephemeral]");Array.from(t).forEach((e=>{e.remove()}));const r=e.split(/(<body[^>]*>|<\/body>)/gi),s=makeFragment(r[2]),n=document.querySelectorAll("[data-hijax]");for(let e=0;e<n.length;e++){const t=n[e],r=t.getAttribute("id"),i=s.getElementById(r);if(t.hasAttribute("data-hijax-skip-unchanged")){if(this.cachedMarkup[r]===i.innerHTML)continue;this.cachedMarkup[r]=i.innerHTML}const o=t.getAttribute("data-hijax-cache-key-selector");if(o&&i.querySelector(o)&&t.querySelector(o)&&t.querySelector(o).getAttribute("data-hijax-cache-key")===i.querySelector(o).getAttribute("data-hijax-cache-key"))continue;this.processScripts(i.querySelectorAll("script"));const frame=()=>{t.parentNode.replaceChild(i,t),this.options.onEnterPage&&this.options.onEnterPage(),this.hijaxLinks(i)};this.queueFrame(frame)}}}registerSargassoClass("HijaxLoader",HijaxLoader);const makeFragment=e=>{if(document.createRange&&document.createRange().createContextualFragment)return document.createRange().createContextualFragment(e);const t=document.createDocumentFragment(),r=document.createElement("div");return r.insertAdjacentHTML("afterBegin",e),t.appendChild(r),t};e.loadPageHandler=void 0;const en={registerSargassoClass:registerSargassoClass,bootSargasso:(t={})=>{if(t.scrollElement&&Is.setOptions(t),t.breakpoints){new Breakpoints(document.body,t.breakpoints).start()}if(t.hijax){const r=new HijaxLoader(document.body,t.hijax);r.start(),e.loadPageHandler=r.setPage.bind(r)}else e.loadPageHandler=e=>{document.location.href=e};const r=new SargassoSupervisor(document.body,t);return r.start(t),r},elementTools:Ye,validate:validate,setValidator:setValidator},tn={theDOMWatcher:Vs,theScrollWatcher:Is,theResizeWatcher:qs,theOrientationWatcher:Ns,theWorkerWatcher:Us,theObservableObjectWatcher:Bs},rn={liveElements:Zs,registeredClasses:Ys,elementMetaData:Je};return e.ObservableObject=ObservableObject,e.Sargasso=Sargasso,e.services=tn,e.system=rn,e.utils=en,e}({});
//# sourceMappingURL=sargasso.iife.min.js.map
{
"name": "@pelagiccreatures/sargasso",
"version": "2.3.2",
"version": "2.3.3",
"description": "Simple, Fast, Reactive, Supervised Javascript controllers for custom html elements.",

@@ -39,3 +39,3 @@ "type": "module",

"@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-terser": "^0.2.1",
"@rollup/plugin-terser": "^0.3.0",
"chai": "^4.3.7",

@@ -42,0 +42,0 @@ "core-js": "^3.27.1",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc