Socket
Socket
Sign inDemoInstall

@pelagiccreatures/sargasso

Package Overview
Dependencies
4
Maintainers
1
Versions
88
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.2.5 to 2.2.6

dist/modules/MDCRipple.mjs

2

dist/sargasso.iife.min.js

@@ -1,2 +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,r=s,n="object"==typeof self&&self&&self.Object===Object&&self,i=r||n||Function("return this")(),o=i.Symbol;var a=function arrayMap$1(e,t){for(var s=-1,r=null==e?0:e.length,n=Array(r);++s<r;)n[s]=t(e[s],s,e);return n},c=Array.isArray,l=o,u=Object.prototype,h=u.hasOwnProperty,d=u.toString,p=l?l.toStringTag:void 0;var f=function getRawTag$1(e){var t=h.call(e,p),s=e[p];try{e[p]=void 0;var r=!0}catch(e){}var n=d.call(e);return r&&(t?e[p]=s: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,s){var r=-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 i=Array(n);++r<n;)i[r]=e[r+t];return i};var P=function castSlice$1(e,t,s){var r=e.length;return s=void 0===s?r:s,!t&&s>=r?e:M(e,t,s)},T=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");var F=function hasUnicode$2(e){return T.test(e)};var R=function asciiToArray$1(e){return e.split("")},L="[\\ud800-\\udfff]",z="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",W="\\ud83c[\\udffb-\\udfff]",H="[^\\ud800-\\udfff]",V="(?:\\ud83c[\\udde6-\\uddff]){2}",I="[\\ud800-\\udbff][\\udc00-\\udfff]",N="(?:"+z+"|"+W+")"+"?",q="[\\ufe0e\\ufe0f]?",U=q+N+("(?:\\u200d(?:"+[H,V,I].join("|")+")"+q+N+")*"),B="(?:"+[H+z+"?",z,V,I,L].join("|")+")",Q=RegExp(W+"(?="+W+")|"+B+U,"g");var G=R,Z=F,J=function unicodeToArray$1(e){return e.match(Q)||[]};var Y=P,K=F,X=function stringToArray$1(e){return Z(e)?J(e):G(e)},ee=$;var te=function createCaseFirst$1(e){return function(t){t=ee(t);var s=K(t)?X(t):void 0,r=s?s[0]:t.charAt(0),n=s?Y(s,1).join(""):t.slice(1);return r[e]()+n}}("toUpperCase"),se=$,re=te;var ne=function capitalize$1(e){return re(se(e).toLowerCase())};var ie=function arrayReduce$1(e,t,s,r){var n=-1,i=null==e?0:e.length;for(r&&i&&(s=e[++n]);++n<i;)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=$,ce=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,le=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");var ue=function deburr$1(e){return(e=ae(e))&&e.replace(ce,oe).replace(le,"")},he=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var de=function asciiWords$1(e){return e.match(he)||[]},pe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var fe=function hasUnicodeWord$1(e){return pe.test(e)},be="\\u2700-\\u27bf",ge="a-z\\xdf-\\xf6\\xf8-\\xff",ve="A-Z\\xc0-\\xd6\\xd8-\\xde",me="\\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",we="["+me+"]",ye="\\d+",_e="[\\u2700-\\u27bf]",Oe="["+ge+"]",xe="[^\\ud800-\\udfff"+me+ye+be+ge+ve+"]",je="(?:\\ud83c[\\udde6-\\uddff]){2}",Se="[\\ud800-\\udbff][\\udc00-\\udfff]",Ee="["+ve+"]",ke="(?:"+Oe+"|"+xe+")",Ae="(?:"+Ee+"|"+xe+")",Ce="(?:['’](?:d|ll|m|re|s|t|ve))?",De="(?:['’](?:D|LL|M|RE|S|T|VE))?",$e="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",Me="[\\ufe0e\\ufe0f]?",Pe=Me+$e+("(?:\\u200d(?:"+["[^\\ud800-\\udfff]",je,Se].join("|")+")"+Me+$e+")*"),Te="(?:"+[_e,je,Se].join("|")+")"+Pe,Fe=RegExp([Ee+"?"+Oe+"+"+Ce+"(?="+[we,Ee,"$"].join("|")+")",Ae+"+"+De+"(?="+[we,Ee+ke,"$"].join("|")+")",Ee+"?"+ke+"+"+Ce,Ee+"+"+De,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ye,Te].join("|"),"g");var Re=de,Le=fe,ze=$,We=function unicodeWords$1(e){return e.match(Fe)||[]};var He=ie,Ve=ue,Ie=function words$1(e,t,s){return e=ze(e),void 0===(t=s?void 0:t)?Le(e)?We(e):Re(e):e.match(t)||[]},Ne=RegExp("['’]","g");var qe=function createCompounder$2(e){return function(t){return He(Ie(Ve(t).replace(Ne,"")),e,"")}},Ue=ne,Be=qe((function(e,t,s){return t=t.toLowerCase(),e+(s?Ue(t):t)}));const Qe={},setValidator=(e,t)=>{Qe[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 r=s.map((e=>{if(e instanceof Array){return-1!==e.map((e=>Qe[e]&&Qe[e](t))).indexOf(!0)}return Qe[e]&&Qe[e](t)}));if(-1!==r.indexOf(!1))throw new Error("call to "+e+" invalid value: "+t+" "+s,0+r)},Ge=new WeakMap,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 r=Ge.get(e)||{};s?r[t]=s:delete r[t],Ge.set(e,r)},getMetaData=(e,t)=>{validate("getMetaData element",e,["isDefined","isElement"]),validate("getMetaData k",t,["isDefined","isString"]);const s=Ge.get(e)||{};return t?s[t]:s},on=function(e,t,s,r,n,i,o){"function"==typeof r&&(o=i,i=n,n=r,r=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",r,[["isEmpty","isString"]]);const a="on:"+e+"-"+s+"-"+r;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:s,selector:r||void 0,fn:i=>{o&&off(e,t,s,r),r?Array.from(t.querySelectorAll(r)).forEach((e=>{(i.target===e||e.contains(i.target))&&n(i,e)})):n(i)},options:i||!1};setMetaData(t,a,c),s.split(/[\s,]+/).forEach((e=>{t.addEventListener(e.trim(),c.fn,c.options)}))},off=function(e,t,s,r){validate("off uid",e,["isDefined","notEmpty"]),validate("off container",t,["isDefined","isEventTarget"]),validate("off events",s,["isDefined","isString"]),validate("off selector",r,[["isEmpty","isString"]]);const n="on:"+e+"-"+s+"-"+r,i=getMetaData(t,n);i&&(s.split(/[\s,]+/).forEach((e=>{t.removeEventListener(e.trim(),i.fn,i.options)})),setMetaData(t,n))},Ze={hasClass:(e,t)=>{validate("hasClass element",e,["isDefined","isElement"]),validate("hasClass cssClass",t,["isDefined","notEmpty","isString"]);return-1!==(e.className||"").split(/\s+/).indexOf(t)},addClass:(e,t)=>{validate("addClass element",e,["isDefined","isElement"]),validate("addClass addClasses",t,["isDefined","notEmpty",["isString","isArray"]]);const s=(e.className||"").split(/\s+/);Array.isArray(t)||(t=t.split(/[\s,]/)),t.forEach((e=>{e=e.trim(),-1===s.indexOf(e)&&s.push(e)})),e.className=s.join(" ")},removeClass:(e,t)=>{validate("removeClass element",e,["isDefined","isElement"]),validate("removeClass removeClasses",t,["isDefined","notEmpty",["isString","isArray"]]);const s=(e.className||"").split(/\s+/);Array.isArray(t)||(t=t.split(/[\s,]/)),t.forEach((e=>{e=e.trim(),-1!==s.indexOf(e)&&s.splice(s.indexOf(e),1)})),e.className=s.join(" ")},isVisible:isVisible,inViewPort:(e,t=window)=>{validate("inViewPort element",e,["isDefined","isElement"]);const s=e.getBoundingClientRect(),r=isVisible(e),n=s.bottom<0;let i;return i=t.self===window?s.top>(window.innerHeight||document.documentElement.clientHeight):s.top>t.clientHeight,r&&!i&&!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 r=Be(s);e.style[r]=null!==t[s]?t[s]:null}},setMetaData:setMetaData,getMetaData:getMetaData,on:on,off:off,once:function(e,t,s,r,n,i){"function"==typeof r&&(i=n,n=r,r=void 0),on(e,t,s,r,n,i,!0)},offAll:function(e){validate("offAll container",e,["isDefined","isEventTarget"]);const t=Ge.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 Je=function isObject$4(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},Ye=i,Ke=/\s/;var Xe=function trimmedEndIndex$1(e){for(var t=e.length;t--&&Ke.test(e.charAt(t)););return t},et=/^\s+/;var tt=function baseTrim$1(e){return e?e.slice(0,Xe(e)+1).replace(et,""):e},st=Je,rt=x,nt=/^[-+]0x[0-9a-f]+$/i,it=/^0b[01]+$/i,ot=/^0o[0-7]+$/i,at=parseInt;var ct=Je,now=function(){return Ye.Date.now()},lt=function toNumber$1(e){if("number"==typeof e)return e;if(rt(e))return NaN;if(st(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=st(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=tt(e);var s=it.test(e);return s||ot.test(e)?at(e.slice(2),s?2:8):nt.test(e)?NaN:+e},ut=Math.max,ht=Math.min;var dt=function debounce(e,t,s){var r,n,i,o,a,c,l=0,u=!1,h=!1,d=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function invokeFunc(t){var s=r,i=n;return r=n=void 0,l=t,o=e.apply(i,s)}function leadingEdge(e){return l=e,a=setTimeout(timerExpired,t),u?invokeFunc(e):o}function shouldInvoke(e){var s=e-c;return void 0===c||s>=t||s<0||h&&e-l>=i}function timerExpired(){var e=now();if(shouldInvoke(e))return trailingEdge(e);a=setTimeout(timerExpired,function remainingWait(e){var s=t-(e-c);return h?ht(s,i-(e-l)):s}(e))}function trailingEdge(e){return a=void 0,d&&r?invokeFunc(e):(r=n=void 0,o)}function debounced(){var e=now(),s=shouldInvoke(e);if(r=arguments,n=this,c=e,s){if(void 0===a)return leadingEdge(c);if(h)return clearTimeout(a),a=setTimeout(timerExpired,t),invokeFunc(c)}return void 0===a&&(a=setTimeout(timerExpired,t)),o}return t=lt(t)||0,ct(s)&&(u=!!s.leading,i=(h="maxWait"in s)?ut(lt(s.maxWait)||0,t):i,d="trailing"in s?!!s.trailing:d),debounced.cancel=function cancel(){void 0!==a&&clearTimeout(a),l=0,r=c=n=a=void 0},debounced.flush=function flush(){return void 0===a?o:trailingEdge(now())},debounced};var pt=function listCacheClear$1(){this.__data__=[],this.size=0};var ft=function eq$2(e,t){return e===t||e!=e&&t!=t},bt=ft;var gt=function assocIndexOf$4(e,t){for(var s=e.length;s--;)if(bt(e[s][0],t))return s;return-1},vt=gt,mt=Array.prototype.splice;var wt=gt;var yt=gt;var _t=gt;var Ot=pt,xt=function listCacheDelete$1(e){var t=this.__data__,s=vt(t,e);return!(s<0)&&(s==t.length-1?t.pop():mt.call(t,s,1),--this.size,!0)},jt=function listCacheGet$1(e){var t=this.__data__,s=wt(t,e);return s<0?void 0:t[s][1]},St=function listCacheHas$1(e){return yt(this.__data__,e)>-1},Et=function listCacheSet$1(e,t){var s=this.__data__,r=_t(s,e);return r<0?(++this.size,s.push([e,t])):s[r][1]=t,this};function ListCache$4(e){var t=-1,s=null==e?0:e.length;for(this.clear();++t<s;){var r=e[t];this.set(r[0],r[1])}}ListCache$4.prototype.clear=Ot,ListCache$4.prototype.delete=xt,ListCache$4.prototype.get=jt,ListCache$4.prototype.has=St,ListCache$4.prototype.set=Et;var kt=ListCache$4,At=kt;var Ct=function stackClear$1(){this.__data__=new At,this.size=0};var Dt=function stackDelete$1(e){var t=this.__data__,s=t.delete(e);return this.size=t.size,s};var $t=function stackGet$1(e){return this.__data__.get(e)};var Mt=function stackHas$1(e){return this.__data__.has(e)},Pt=w,Tt=Je;var Ft,Rt=function isFunction$2(e){if(!Tt(e))return!1;var t=Pt(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},Lt=i["__core-js_shared__"],zt=(Ft=/[^.]+$/.exec(Lt&&Lt.keys&&Lt.keys.IE_PROTO||""))?"Symbol(src)_1."+Ft:"";var Wt=function isMasked$1(e){return!!zt&&zt in e},Ht=Function.prototype.toString;var Vt=function toSource$2(e){if(null!=e){try{return Ht.call(e)}catch(e){}try{return e+""}catch(e){}}return""},It=Rt,Nt=Wt,qt=Je,Ut=Vt,Bt=/^\[object .+?Constructor\]$/,Qt=Function.prototype,Gt=Object.prototype,Zt=Qt.toString,Jt=Gt.hasOwnProperty,Yt=RegExp("^"+Zt.call(Jt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Kt=function baseIsNative$1(e){return!(!qt(e)||Nt(e))&&(It(e)?Yt:Bt).test(Ut(e))},Xt=function getValue$1(e,t){return null==e?void 0:e[t]};var es=function getNative$6(e,t){var s=Xt(e,t);return Kt(s)?s:void 0},ts=es(i,"Map"),ss=es(Object,"create"),rs=ss;var ns=function hashClear$1(){this.__data__=rs?rs(null):{},this.size=0};var is=function hashDelete$1(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},os=ss,as=Object.prototype.hasOwnProperty;var cs=function hashGet$1(e){var t=this.__data__;if(os){var s=t[e];return"__lodash_hash_undefined__"===s?void 0:s}return as.call(t,e)?t[e]:void 0},ls=ss,us=Object.prototype.hasOwnProperty;var hs=ss;var ds=ns,ps=is,fs=cs,bs=function hashHas$1(e){var t=this.__data__;return ls?void 0!==t[e]:us.call(t,e)},gs=function hashSet$1(e,t){var s=this.__data__;return this.size+=this.has(e)?0:1,s[e]=hs&&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 r=e[t];this.set(r[0],r[1])}}Hash$1.prototype.clear=ds,Hash$1.prototype.delete=ps,Hash$1.prototype.get=fs,Hash$1.prototype.has=bs,Hash$1.prototype.set=gs;var vs=Hash$1,ms=kt,ws=ts;var ys=function isKeyable$1(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var _s=function getMapData$4(e,t){var s=e.__data__;return ys(t)?s["string"==typeof t?"string":"hash"]:s.map},Os=_s;var xs=_s;var js=_s;var Ss=_s;var Es=function mapCacheClear$1(){this.size=0,this.__data__={hash:new vs,map:new(ws||ms),string:new vs}},ks=function mapCacheDelete$1(e){var t=Os(this,e).delete(e);return this.size-=t?1:0,t},As=function mapCacheGet$1(e){return xs(this,e).get(e)},Cs=function mapCacheHas$1(e){return js(this,e).has(e)},Ds=function mapCacheSet$1(e,t){var s=Ss(this,e),r=s.size;return s.set(e,t),this.size+=s.size==r?0:1,this};function MapCache$2(e){var t=-1,s=null==e?0:e.length;for(this.clear();++t<s;){var r=e[t];this.set(r[0],r[1])}}MapCache$2.prototype.clear=Es,MapCache$2.prototype.delete=ks,MapCache$2.prototype.get=As,MapCache$2.prototype.has=Cs,MapCache$2.prototype.set=Ds;var $s=MapCache$2,Ms=kt,Ps=ts,Ts=$s;var Fs=kt,Rs=Ct,Ls=Dt,zs=$t,Ws=Mt,Hs=function stackSet$1(e,t){var s=this.__data__;if(s instanceof Ms){var r=s.__data__;if(!Ps||r.length<199)return r.push([e,t]),this.size=++s.size,this;s=this.__data__=new Ts(r)}return s.set(e,t),this.size=s.size,this};function Stack$1(e){var t=this.__data__=new Fs(e);this.size=t.size}Stack$1.prototype.clear=Rs,Stack$1.prototype.delete=Ls,Stack$1.prototype.get=zs,Stack$1.prototype.has=Ws,Stack$1.prototype.set=Hs;var Vs=$s,Is=function setCacheAdd$1(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Ns=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 Vs;++t<s;)this.add(e[t])}SetCache$1.prototype.add=SetCache$1.prototype.push=Is,SetCache$1.prototype.has=Ns;i.Uint8Array;var qs=o?o.prototype:void 0;qs&&qs.valueOf;Object.prototype.propertyIsEnumerable,Object.getOwnPropertySymbols;var Us=w,Bs=y;var Qs=function baseIsArguments$1(e){return Bs(e)&&"[object Arguments]"==Us(e)},Gs=y,Zs=Object.prototype,Js=Zs.hasOwnProperty,Ys=Zs.propertyIsEnumerable,Ks=(Qs(function(){return arguments}()),{exports:{}});var Xs=function stubFalse(){return!1};!function(e,t){var s=i,r=Xs,n=t&&!t.nodeType&&t,o=n&&e&&!e.nodeType&&e,a=o&&o.exports===n?s.Buffer:void 0,c=(a?a.isBuffer:void 0)||r;e.exports=c}(Ks,Ks.exports);var er=function isLength$2(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},tr=w,sr=er,rr=y,nr={};nr["[object Float32Array]"]=nr["[object Float64Array]"]=nr["[object Int8Array]"]=nr["[object Int16Array]"]=nr["[object Int32Array]"]=nr["[object Uint8Array]"]=nr["[object Uint8ClampedArray]"]=nr["[object Uint16Array]"]=nr["[object Uint32Array]"]=!0,nr["[object Arguments]"]=nr["[object Array]"]=nr["[object ArrayBuffer]"]=nr["[object Boolean]"]=nr["[object DataView]"]=nr["[object Date]"]=nr["[object Error]"]=nr["[object Function]"]=nr["[object Map]"]=nr["[object Number]"]=nr["[object Object]"]=nr["[object RegExp]"]=nr["[object Set]"]=nr["[object String]"]=nr["[object WeakMap]"]=!1;var ir=function baseIsTypedArray$1(e){return rr(e)&&sr(e.length)&&!!nr[tr(e)]};var or=function baseUnary$1(e){return function(t){return e(t)}},ar={exports:{}};!function(e,t){var r=s,n=t&&!t.nodeType&&t,i=n&&e&&!e.nodeType&&e,o=i&&i.exports===n&&r.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}(ar,ar.exports);var cr=ir,lr=or,ur=ar.exports,hr=ur&&ur.isTypedArray;hr&&lr(hr),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 dr=es(i,"DataView"),pr=ts,fr=es(i,"Promise"),br=es(i,"Set"),gr=es(i,"WeakMap"),vr=w,mr=Vt,wr="[object Map]",yr="[object Promise]",_r="[object Set]",Or="[object WeakMap]",xr="[object DataView]",jr=mr(dr),Sr=mr(pr),Er=mr(fr),kr=mr(br),Ar=mr(gr),Cr=vr;(dr&&Cr(new dr(new ArrayBuffer(1)))!=xr||pr&&Cr(new pr)!=wr||fr&&Cr(fr.resolve())!=yr||br&&Cr(new br)!=_r||gr&&Cr(new gr)!=Or)&&(Cr=function(e){var t=vr(e),s="[object Object]"==t?e.constructor:void 0,r=s?mr(s):"";if(r)switch(r){case jr:return xr;case Sr:return wr;case Er:return yr;case kr:return _r;case Ar:return Or}return t});Object.prototype.hasOwnProperty;var Dr,$r,Mr,Pr,Tr,Fr,Rr={exports:{}},Lr=(Dr=[],$r=[],Mr=[],Pr=[],Tr=null,Fr=function(e,t,s,r){var n=s||null,i=r||[{target:e,property:""}];Dr.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,s){for(var r="",n=null,o=0;o<i.length;o++)n instanceof Array&&!isNaN(i[o].property)&&(i[o].property=n.indexOf(i[o].target)),r=r+"."+i[o].property,n=i[o].target;return r=(r=r+"."+t).substring(2),!0===s&&(r="/"+r.replace(/\./g,"/")),r},_notifyObservers=function(e){if(!0!==n.paused){var s="number"==typeof t;if(s||!0===t)setTimeout((function(){if(e===o.length){var t=o.slice(0);o=[];for(var s=0;s<n.observers.length;s++)n.observers[s](t)}}),s&&t>0?t:10);else{var r=o.slice(0);o=[];for(var i=0;i<n.observers.length;i++)n.observers[i](r)}}},a={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 r=e[s];if(e instanceof Date&&r instanceof Function&&null!==r)return r.bind(e);if(r instanceof Object&&null!==r&&e.hasOwnProperty(s)){if(!0===r.__isProxy&&(r=r.__getTarget),r.__targetPosition>-1&&null!==Mr[r.__targetPosition])for(var o=Pr[r.__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:r,property:s}),Fr(r,t,n,l)}return r},deleteProperty:function(e,t){var s=!0;Tr===l&&(s=!1,Tr=null);var r=Object.assign({},e);if(o.push({type:"delete",target:e,property:t,newValue:null,previousValue:r[t],currentPath:_getPath(0,t),jsonPointer:_getPath(0,t,!0),proxy:l}),!0===s){n.changesPaused||delete e[t];for(var i=0,a=Mr.length;i<a&&e!==Mr[i];i++);for(var c=Pr[i]||[],u=c.length;u--;)c[u].proxy!==l&&(Tr=c[u].proxy,delete c[u].proxy[t])}return _notifyObservers(o.length),!0},set:function(e,t,s,r){s&&s.__isProxy&&(s=s.__getTarget);var i=!0;Tr===l&&(i=!1,Tr=null);var a=e[t];if(a!==s||!1===i||"length"===t&&e instanceof Array&&e.__length!==s){var c=!0,u=typeof a,h="update";if("undefined"===u&&(h="add"),o.push({type:h,target:e,property:t,newValue:s,previousValue:r[t],currentPath:_getPath(0,t),jsonPointer:_getPath(0,t,!0),proxy:l}),"length"===t&&e instanceof Array&&e.__length!==s&&(o[o.length-1].previousValue=e.__length,e.__length=s),!0===i){n.changesPaused||(e[t]=s),c=!1;for(var d=e.__targetPosition,p=Pr[d].length;p--;)if(n===Pr[d][p].observable&&null!==Mr[Pr[d][p].observable.parentTarget.__targetPosition]){c=!0;break}if(c){for(var f=Pr[d],b=0,g=f.length;b<g;b++)f[b].proxy!==l&&(Tr=f[b].proxy,f[b].proxy[t]=s);setTimeout((function(){if("object"===u&&null!==a){for(var t=Object.keys(e),s=0,r=t.length;s<r;s++)if(e[t[s]]===a)return;var i=!1;if(function iterate(e){for(var t=Object.keys(e),s=0,r=t.length;s<r;s++){var n=e[t[s]];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),s=0,r=t.length;s<r;s++){var i=e[t[s]];i instanceof Object&&null!==i&&iterate(i)}var o=-1;for(s=0,r=Mr.length;s<r;s++)if(e===Mr[s]){o=s;break}if(o>-1){for(var a=Pr[o],c=a.length;c--;)if(n===a[c].observable){a.splice(c,1);break}0==a.length&&(Mr[o]=null)}}(a)}}),1e4)}}c&&_notifyObservers(o.length)}return!0}},c=e.__targetPosition;c>-1||Object.defineProperty(e,"__targetPosition",{value:Mr.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},$r.push(n));var u={target:e,proxy:l,observable:n};return c>-1?(null===Mr[c]&&(Mr[c]=e),Pr[c].push(u)):(Mr.push(e),Pr.push([u])),l},{create:function(e,t,s){!0===e.__isProxy&&(e=e.__getTarget);var r=Fr(e,t);return"function"==typeof s&&this.observe(r,s),function iterate(e){for(var t=e.__getTarget,s=Object.keys(t),r=0,n=s.length;r<n;r++){var i=s[r];t[i]instanceof Object&&null!==t[i]&&iterate(e[i])}}(r),r},observe:function(e,t){for(var s=$r.length;s--;)if($r[s].parentProxy===e){$r[s].observers.push(t);break}},pause:function(e){for(var t=$r.length,s=!1;t--;)if($r[t].parentProxy===e){$r[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=$r.length,s=!1;t--;)if($r[t].parentProxy===e){$r[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=$r.length,s=!1;t--;)if($r[t].parentProxy===e){$r[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=$r.length,s=!1;t--;)if($r[t].parentProxy===e){$r[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,r=$r.length;r--;)if($r[r].parentProxy===e){t=$r[r],s=!0;break}for(var n=Pr.length;n--;)for(var i=Pr[n].length;i--;)Pr[n][i].observable===t&&(Pr[n].splice(i,1),0===Pr[n].length&&(Mr[n]=null));!0===s&&$r.splice(r,1)}});try{Rr.exports=Lr}catch(e){}const zr={};class ObservableObject{constructor(e,t={},s={}){if(this.id=e,zr[this.id])throw new Error("ObservableObject "+e+" already exists.");this.bound={},this.data=Rr.exports.create(t,!1,(e=>{this.sync(e)})),this.options=s,zr[this.id]=this}destroy(){Rr.exports.pause(this.data),delete zr[this.id],delete this.data,Object.keys(this.bound).forEach((e=>{Object.keys(this.bound[e]).forEach((t=>{this.unbind(t,e)}))})),Rr.exports.remove(this.data)}getBoundData(){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,r=t.newValue,n=t.previousValue,i=[];for(const e in this.bound)if("*"===e)i.push(e);else{const t=new RegExp("^"+e.replace(".","\\."));s.match(t)&&i.push(e)}for(const t of i)for(const i in this.bound[t])this.bound[t][i](this.id,e,s,r,n)}}}let Wr,Hr,Vr,Ir,Nr,qr;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=dt(((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])}}Wr=new DOMWatcher,Hr=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(),Ze.on("theScrollWatcher",this.scrollElement,"scroll",(()=>{this.trigger()}))}sleep(){super.sleep(),Ze.off("theScrollWatcher",this.scrollElement,"scroll")}inViewPort(e){return Ze.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}}},Vr=new class ResizeWatcher extends ObserverSubscriptionManager{constructor(e){super(e),this.debounce=dt((()=>{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")}},Ir=new class OrientationWatcher extends ObserverSubscriptionManager{constructor(e){super(e),"onorientationchange"in window?Ze.addClass(document.body,"have-orientation"):Ze.addClass(document.body,"no-orientation"),this.debounce=dt((()=>{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")}},Nr=new class WorkerWatcher extends ObserverSubscriptionManager{constructor(e){super(e),this.workers={}}registerWorker(e,t){if(!this.workers[e]){let s=t,r=!1;if(!t.match(/^(http|\/)/i)){const e=new Blob([t],{type:"text/javascript"});s=URL.createObjectURL(e),r=!0}this.workers[e]={worker:new Worker(s),observers:[]},r&&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()}},qr=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=>zr[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,r,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,s,r,n)}))}};var Ur=qe((function(e,t,s){return e+(s?"-":"")+t.toLowerCase()}));let Br=0;const Qr=[],Gr="customElements"in window,Zr={},registerSargassoClass=(e,t)=>{if(Zr[e])throw new Error("Sargasso class "+e+" is already registered.");if(Zr[e]=t,Gr){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}`)(Zr),s=window.sargassoOptions||{},r=void 0!==s.customElementPrefix?s.customElementPrefix:"sargasso-";customElements.define(r+Ur(e),t)}},Jr=["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=++Br,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=dt((()=>{this._render()}),100,{maxWait:250})}start(){const e=this.getMetaData("registeredResponsiveControllers")||[];e.push(this),this.setMetaData("registeredResponsiveControllers",e),this.setMetaData(this.constructor.name,this),Qr.push(this),this._shadowDOM&&(this._shadowDOMWatcher||(this._shadowDOMWatcher=new DOMWatcher({shadowDOM:this._shadowRoot})),this._shadowDOMWatcher.subscribe(this)),this.options.watchDOM&&Wr.subscribe(this),(this.options.watchScroll||this.options.watchViewport)&&Hr.subscribe(this),(this.options.watchResize||this.options.watchViewport)&&Vr.subscribe(this),(this.options.watchOrientation||this.options.watchViewport)&&Ir.subscribe(this),this.elementListener=e=>{e.detail&&e.detail.sargassoEvent&&-1!==Jr.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&&Wr.unSubscribe(this),(this.options.watchScroll||this.options.watchViewport)&&Hr.unSubscribe(this),(this.options.watchResize||this.options.watchViewport)&&Vr.unSubscribe(this),(this.options.watchOrientation||this.options.watchViewport)&&Ir.unSubscribe(this),this.element.removeEventListener("sargasso",this.elementListener),Ze.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,r,n){this.render()}setMetaData(e,t){Ze.setMetaData(this.element,e,t)}getMetaData(e){return Ze.getMetaData(this.element,e)}on(e,t,s,r){Ze.on(this.constructor.name+"-"+this.uid,this.element,e,t,s,r)}off(e,t){Ze.off(this.constructor.name+"-"+this.uid,this.element,e,t)}once(e,t,s,r){Ze.once(this.constructor.name+"-"+this.uid,this.element,e,t,s,r)}notifyAll(e,t){if(-1===Jr.indexOf(e))throw new Error("invalid event name "+e);for(let s=0;s<Qr.length;s++){const r=Qr[s];r!==this&&r[e]&&r[e].apply(r,t)}}notifyElement(e,t,s){if(-1===Jr.indexOf(t))throw new Error("invalid event name "+t);const r=this.getMetaData("registeredResponsiveControllers");if(r)for(let e=0;e<r.length;e++){const n=r[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 Ze.hasClass(this.element,e)}addClass(e){Ze.addClass(this.element,e)}removeClass(e){Ze.removeClass(this.element,e)}setCSS(e){Ze.setCSS(this.element,e)}isVisible(){return Ze.isVisible(this.element)}workerStart(e,t){return this._workers[e]=Nr.registerWorker(e,t),Nr.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 qr.subscribe(this,e,t),this._observables[e]=qr.getObservable(e),this._observables[e]}observableStop(e){this._observables[e]&&(qr.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]&&(Nr.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!==Qr.indexOf(this)&&Qr.splice(Qr.indexOf(this),1)}watchDOM(e){e===this._shadowRoot?Wr.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(){Hr.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(Hr.inViewPort(s)){const r=s.getAttribute("data-lazy-sargasso-class").split(/\s*,\s*/);for(let s=0;s<r.length;s++){new Zr[r[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 Zr[t[s]](e).start()}catch(e){console.log("error instantiating "+t[s],e,Zr)}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<Qr.length;e++)Qr[e].options.immortal||Qr[e].options.isCustomElement||document.body.contains(Qr[e].element)||s.push(Qr[e]);for(let e=0;e<s.length;e++)s[e].destroy()}}registerSargassoClass("SargassoSupervisor",SargassoSupervisor);const Yr=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||Yr,this.scale=void 0,this.widths=[],this.classes=[],this.debouncedDetectGeometry=dt((()=>{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],r=s.getAttribute("id");this.cachedMarkup[r]=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],r=s.getAttribute("href");!r||s.getAttribute("data-hijaxed")||s.getAttribute("target")||s.hasAttribute("data-no-hijax")||this.excludeRegex.exec(r)||(s.setAttribute("data-hijaxed",!0),s.addEventListener("click",(e=>{e.preventDefault(),this.setPage(r)}),!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,r)=>{t&&(this.options.onError?this.options.onError("danger",t):alert("Error loading page: "+t)),s?this.currentPage=location.pathname+location.search:this.loadPage(r||e)}))}loadPage(e){this.queueFrame((()=>{Ze.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){Hr.scrollTop(0),this.mergePage(t.responseText);const e=this.currentPage,frame=()=>{this.notifyAll("newPage",[e,location.pathname+location.search]),Ze.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),r=makeFragment(s[2]),n=document.querySelectorAll("[data-hijax]");for(let e=0;e<n.length;e++){const t=n[e],s=t.getAttribute("id"),i=r.getElementById(s);if(t.hasAttribute("data-hijax-skip-unchanged")){if(this.cachedMarkup[s]===i.innerHTML)continue;this.cachedMarkup[s]=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(),s=document.createElement("div");return s.insertAdjacentHTML("afterBegin",e),t.appendChild(s),t};e.loadPageHandler=void 0;const Kr={registerSargassoClass:registerSargassoClass,bootSargasso:(t={})=>{if(t.scrollElement&&Hr.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:Ze,validate:validate,setValidator:setValidator},Xr={theDOMWatcher:Wr,theScrollWatcher:Hr,theResizeWatcher:Vr,theOrientationWatcher:Ir,theWorkerWatcher:Nr,theObservableObjectWatcher:qr},en={liveElements:Qr,registeredClasses:Zr,elementMetaData:Ge};return e.ObservableObject=ObservableObject,e.Sargasso=Sargasso,e.services=Xr,e.system=en,e.utils=Kr,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,u=Object.prototype,h=u.hasOwnProperty,d=u.toString,p=l?l.toStringTag:void 0;var f=function getRawTag$1(e){var t=h.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 R=function asciiToArray$1(e){return e.split("")},L="[\\ud800-\\udfff]",z="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",W="\\ud83c[\\udffb-\\udfff]",H="[^\\ud800-\\udfff]",V="(?:\\ud83c[\\udde6-\\uddff]){2}",I="[\\ud800-\\udbff][\\udc00-\\udfff]",N="(?:"+z+"|"+W+")"+"?",q="[\\ufe0e\\ufe0f]?",U=q+N+("(?:\\u200d(?:"+[H,V,I].join("|")+")"+q+N+")*"),B="(?:"+[H+z+"?",z,V,I,L].join("|")+")",Q=RegExp(W+"(?="+W+")|"+B+U,"g");var G=R,Z=F,J=function unicodeToArray$1(e){return e.match(Q)||[]};var Y=P,K=F,X=function stringToArray$1(e){return Z(e)?J(e):G(e)},ee=$;var te=function createCaseFirst$1(e){return function(t){t=ee(t);var r=K(t)?X(t):void 0,s=r?r[0]:t.charAt(0),n=r?Y(r,1).join(""):t.slice(1);return s[e]()+n}}("toUpperCase"),re=$,se=te;var ne=function capitalize$1(e){return se(re(e).toLowerCase())};var ie=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 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=$,ce=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,le=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");var ue=function deburr$1(e){return(e=ae(e))&&e.replace(ce,oe).replace(le,"")},he=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var de=function asciiWords$1(e){return e.match(he)||[]},pe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var fe=function hasUnicodeWord$1(e){return pe.test(e)},be="\\u2700-\\u27bf",ge="a-z\\xdf-\\xf6\\xf8-\\xff",ve="A-Z\\xc0-\\xd6\\xd8-\\xde",me="\\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",we="["+me+"]",ye="\\d+",_e="[\\u2700-\\u27bf]",Oe="["+ge+"]",xe="[^\\ud800-\\udfff"+me+ye+be+ge+ve+"]",je="(?:\\ud83c[\\udde6-\\uddff]){2}",Se="[\\ud800-\\udbff][\\udc00-\\udfff]",Ee="["+ve+"]",ke="(?:"+Oe+"|"+xe+")",Ae="(?:"+Ee+"|"+xe+")",Ce="(?:['’](?:d|ll|m|re|s|t|ve))?",De="(?:['’](?:D|LL|M|RE|S|T|VE))?",$e="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",Me="[\\ufe0e\\ufe0f]?",Pe=Me+$e+("(?:\\u200d(?:"+["[^\\ud800-\\udfff]",je,Se].join("|")+")"+Me+$e+")*"),Te="(?:"+[_e,je,Se].join("|")+")"+Pe,Fe=RegExp([Ee+"?"+Oe+"+"+Ce+"(?="+[we,Ee,"$"].join("|")+")",Ae+"+"+De+"(?="+[we,Ee+ke,"$"].join("|")+")",Ee+"?"+ke+"+"+Ce,Ee+"+"+De,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ye,Te].join("|"),"g");var Re=de,Le=fe,ze=$,We=function unicodeWords$1(e){return e.match(Fe)||[]};var He=ie,Ve=ue,Ie=function words$1(e,t,r){return e=ze(e),void 0===(t=r?void 0:t)?Le(e)?We(e):Re(e):e.match(t)||[]},Ne=RegExp("['’]","g");var qe=function createCompounder$2(e){return function(t){return He(Ie(Ve(t).replace(Ne,"")),e,"")}},Ue=ne,Be=qe((function(e,t,r){return t=t.toLowerCase(),e+(r?Ue(t):t)}));const Qe={},setValidator=(e,t)=>{Qe[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=>Qe[e]&&Qe[e](t))).indexOf(!0)}return Qe[e]&&Qe[e](t)}));if(-1!==s.indexOf(!1))throw new Error("call to "+e+" invalid value: "+t+" "+r,0+s)},Ge=new WeakMap,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=Ge.get(e)||{};r?s[t]=r:delete s[t],Ge.set(e,s)},getMetaData=(e,t)=>{validate("getMetaData element",e,["isDefined","isElement"]),validate("getMetaData k",t,["isDefined","isString"]);const r=Ge.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))},Ze={hasClass:(e,t)=>{validate("hasClass element",e,["isDefined","isElement"]),validate("hasClass cssClass",t,["isDefined","notEmpty","isString"]);return-1!==(e.className||"").split(/\s+/).indexOf(t)},addClass:(e,t)=>{validate("addClass element",e,["isDefined","isElement"]),validate("addClass addClasses",t,["isDefined","notEmpty",["isString","isArray"]]);const r=(e.className||"").split(/\s+/);Array.isArray(t)||(t=t.split(/[\s,]/)),t.forEach((e=>{e=e.trim(),-1===r.indexOf(e)&&r.push(e)})),e.className=r.join(" ")},removeClass:(e,t)=>{validate("removeClass element",e,["isDefined","isElement"]),validate("removeClass removeClasses",t,["isDefined","notEmpty",["isString","isArray"]]);const r=(e.className||"").split(/\s+/);Array.isArray(t)||(t=t.split(/[\s,]/)),t.forEach((e=>{e=e.trim(),-1!==r.indexOf(e)&&r.splice(r.indexOf(e),1)})),e.className=r.join(" ")},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=Be(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=Ge.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 Je=function isObject$4(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},Ye=i,Ke=/\s/;var Xe=function trimmedEndIndex$1(e){for(var t=e.length;t--&&Ke.test(e.charAt(t)););return t},et=/^\s+/;var tt=function baseTrim$1(e){return e?e.slice(0,Xe(e)+1).replace(et,""):e},rt=Je,st=x,nt=/^[-+]0x[0-9a-f]+$/i,it=/^0b[01]+$/i,ot=/^0o[0-7]+$/i,at=parseInt;var ct=Je,now=function(){return Ye.Date.now()},lt=function toNumber$1(e){if("number"==typeof e)return e;if(st(e))return NaN;if(rt(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=rt(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=tt(e);var r=it.test(e);return r||ot.test(e)?at(e.slice(2),r?2:8):nt.test(e)?NaN:+e},ut=Math.max,ht=Math.min;var dt=function debounce(e,t,r){var s,n,i,o,a,c,l=0,u=!1,h=!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),u?invokeFunc(e):o}function shouldInvoke(e){var r=e-c;return void 0===c||r>=t||r<0||h&&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 h?ht(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(h)return clearTimeout(a),a=setTimeout(timerExpired,t),invokeFunc(c)}return void 0===a&&(a=setTimeout(timerExpired,t)),o}return t=lt(t)||0,ct(r)&&(u=!!r.leading,i=(h="maxWait"in r)?ut(lt(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 pt=function listCacheClear$1(){this.__data__=[],this.size=0};var ft=function eq$2(e,t){return e===t||e!=e&&t!=t},bt=ft;var gt=function assocIndexOf$4(e,t){for(var r=e.length;r--;)if(bt(e[r][0],t))return r;return-1},vt=gt,mt=Array.prototype.splice;var wt=gt;var yt=gt;var _t=gt;var Ot=pt,xt=function listCacheDelete$1(e){var t=this.__data__,r=vt(t,e);return!(r<0)&&(r==t.length-1?t.pop():mt.call(t,r,1),--this.size,!0)},jt=function listCacheGet$1(e){var t=this.__data__,r=wt(t,e);return r<0?void 0:t[r][1]},St=function listCacheHas$1(e){return yt(this.__data__,e)>-1},Et=function listCacheSet$1(e,t){var r=this.__data__,s=_t(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=Ot,ListCache$4.prototype.delete=xt,ListCache$4.prototype.get=jt,ListCache$4.prototype.has=St,ListCache$4.prototype.set=Et;var kt=ListCache$4,At=kt;var Ct=function stackClear$1(){this.__data__=new At,this.size=0};var Dt=function stackDelete$1(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r};var $t=function stackGet$1(e){return this.__data__.get(e)};var Mt=function stackHas$1(e){return this.__data__.has(e)},Pt=w,Tt=Je;var Ft,Rt=function isFunction$2(e){if(!Tt(e))return!1;var t=Pt(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},Lt=i["__core-js_shared__"],zt=(Ft=/[^.]+$/.exec(Lt&&Lt.keys&&Lt.keys.IE_PROTO||""))?"Symbol(src)_1."+Ft:"";var Wt=function isMasked$1(e){return!!zt&&zt in e},Ht=Function.prototype.toString;var Vt=function toSource$2(e){if(null!=e){try{return Ht.call(e)}catch(e){}try{return e+""}catch(e){}}return""},It=Rt,Nt=Wt,qt=Je,Ut=Vt,Bt=/^\[object .+?Constructor\]$/,Qt=Function.prototype,Gt=Object.prototype,Zt=Qt.toString,Jt=Gt.hasOwnProperty,Yt=RegExp("^"+Zt.call(Jt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Kt=function baseIsNative$1(e){return!(!qt(e)||Nt(e))&&(It(e)?Yt:Bt).test(Ut(e))},Xt=function getValue$1(e,t){return null==e?void 0:e[t]};var er=function getNative$6(e,t){var r=Xt(e,t);return Kt(r)?r:void 0},tr=er(i,"Map"),rr=er(Object,"create"),sr=rr;var nr=function hashClear$1(){this.__data__=sr?sr(null):{},this.size=0};var ir=function hashDelete$1(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},or=rr,ar=Object.prototype.hasOwnProperty;var cr=function hashGet$1(e){var t=this.__data__;if(or){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return ar.call(t,e)?t[e]:void 0},lr=rr,ur=Object.prototype.hasOwnProperty;var hr=rr;var dr=nr,pr=ir,fr=cr,br=function hashHas$1(e){var t=this.__data__;return lr?void 0!==t[e]:ur.call(t,e)},gr=function hashSet$1(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=hr&&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=dr,Hash$1.prototype.delete=pr,Hash$1.prototype.get=fr,Hash$1.prototype.has=br,Hash$1.prototype.set=gr;var vr=Hash$1,mr=kt,wr=tr;var yr=function isKeyable$1(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var _r=function getMapData$4(e,t){var r=e.__data__;return yr(t)?r["string"==typeof t?"string":"hash"]:r.map},Or=_r;var xr=_r;var jr=_r;var Sr=_r;var Er=function mapCacheClear$1(){this.size=0,this.__data__={hash:new vr,map:new(wr||mr),string:new vr}},kr=function mapCacheDelete$1(e){var t=Or(this,e).delete(e);return this.size-=t?1:0,t},Ar=function mapCacheGet$1(e){return xr(this,e).get(e)},Cr=function mapCacheHas$1(e){return jr(this,e).has(e)},Dr=function mapCacheSet$1(e,t){var r=Sr(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=Er,MapCache$2.prototype.delete=kr,MapCache$2.prototype.get=Ar,MapCache$2.prototype.has=Cr,MapCache$2.prototype.set=Dr;var $r=MapCache$2,Mr=kt,Pr=tr,Tr=$r;var Fr=kt,Rr=Ct,Lr=Dt,zr=$t,Wr=Mt,Hr=function stackSet$1(e,t){var r=this.__data__;if(r instanceof Mr){var s=r.__data__;if(!Pr||s.length<199)return s.push([e,t]),this.size=++r.size,this;r=this.__data__=new Tr(s)}return r.set(e,t),this.size=r.size,this};function Stack$1(e){var t=this.__data__=new Fr(e);this.size=t.size}Stack$1.prototype.clear=Rr,Stack$1.prototype.delete=Lr,Stack$1.prototype.get=zr,Stack$1.prototype.has=Wr,Stack$1.prototype.set=Hr;var Vr=$r,Ir=function setCacheAdd$1(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Nr=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 Vr;++t<r;)this.add(e[t])}SetCache$1.prototype.add=SetCache$1.prototype.push=Ir,SetCache$1.prototype.has=Nr;i.Uint8Array;var qr=o?o.prototype:void 0;qr&&qr.valueOf;Object.prototype.propertyIsEnumerable,Object.getOwnPropertySymbols;var Ur=w,Br=y;var Qr=function baseIsArguments$1(e){return Br(e)&&"[object Arguments]"==Ur(e)},Gr=y,Zr=Object.prototype,Jr=Zr.hasOwnProperty,Yr=Zr.propertyIsEnumerable,Kr=(Qr(function(){return arguments}()),{});var Xr=function stubFalse(){return!1};!function(e,t){var r=i,s=Xr,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 Kr},set exports(e){Kr=e}},Kr);var es=function isLength$2(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},ts=w,rs=es,ss=y,ns={};ns["[object Float32Array]"]=ns["[object Float64Array]"]=ns["[object Int8Array]"]=ns["[object Int16Array]"]=ns["[object Int32Array]"]=ns["[object Uint8Array]"]=ns["[object Uint8ClampedArray]"]=ns["[object Uint16Array]"]=ns["[object Uint32Array]"]=!0,ns["[object Arguments]"]=ns["[object Array]"]=ns["[object ArrayBuffer]"]=ns["[object Boolean]"]=ns["[object DataView]"]=ns["[object Date]"]=ns["[object Error]"]=ns["[object Function]"]=ns["[object Map]"]=ns["[object Number]"]=ns["[object Object]"]=ns["[object RegExp]"]=ns["[object Set]"]=ns["[object String]"]=ns["[object WeakMap]"]=!1;var is=function baseIsTypedArray$1(e){return ss(e)&&rs(e.length)&&!!ns[ts(e)]};var os=function baseUnary$1(e){return function(t){return e(t)}},as={};!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 as},set exports(e){as=e}},as);var cs=is,ls=os,us=as&&as.isTypedArray;us&&ls(us),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 hs=er(i,"DataView"),ds=tr,ps=er(i,"Promise"),fs=er(i,"Set"),bs=er(i,"WeakMap"),gs=w,vs=Vt,ms="[object Map]",ws="[object Promise]",ys="[object Set]",_s="[object WeakMap]",Os="[object DataView]",xs=vs(hs),js=vs(ds),Ss=vs(ps),Es=vs(fs),ks=vs(bs),As=gs;(hs&&As(new hs(new ArrayBuffer(1)))!=Os||ds&&As(new ds)!=ms||ps&&As(ps.resolve())!=ws||fs&&As(new fs)!=ys||bs&&As(new bs)!=_s)&&(As=function(e){var t=gs(e),r="[object Object]"==t?e.constructor:void 0,s=r?vs(r):"";if(s)switch(s){case xs:return Os;case js:return ms;case Ss:return ws;case Es:return ys;case ks:return _s}return t});Object.prototype.hasOwnProperty;var Cs,Ds,$s,Ms,Ps,Ts,Fs={},Rs={get exports(){return Fs},set exports(e){Fs=e}},Ls=(Cs=[],Ds=[],$s=[],Ms=[],Ps=null,Ts=function(e,t,r,s){var n=r||null,i=s||[{target:e,property:""}];Cs.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!==$s[s.__targetPosition])for(var o=Ms[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}),Ts(s,t,n,l)}return s},deleteProperty:function(e,t){var r=!0;Ps===l&&(r=!1,Ps=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=$s.length;i<a&&e!==$s[i];i++);for(var c=Ms[i]||[],u=c.length;u--;)c[u].proxy!==l&&(Ps=c[u].proxy,delete c[u].proxy[t])}return _notifyObservers(o.length),!0},set:function(e,t,r,s){r&&r.__isProxy&&(r=r.__getTarget);var i=!0;Ps===l&&(i=!1,Ps=null);var a=e[t];if(a!==r||!1===i||"length"===t&&e instanceof Array&&e.__length!==r){var c=!0,u=typeof a,h="update";if("undefined"===u&&(h="add"),o.push({type:h,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=Ms[d].length;p--;)if(n===Ms[d][p].observable&&null!==$s[Ms[d][p].observable.parentTarget.__targetPosition]){c=!0;break}if(c){for(var f=Ms[d],b=0,g=f.length;b<g;b++)f[b].proxy!==l&&(Ps=f[b].proxy,f[b].proxy[t]=r);setTimeout((function(){if("object"===u&&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=$s.length;r<s;r++)if(e===$s[r]){o=r;break}if(o>-1){for(var a=Ms[o],c=a.length;c--;)if(n===a[c].observable){a.splice(c,1);break}0==a.length&&($s[o]=null)}}(a)}}),1e4)}}c&&_notifyObservers(o.length)}return!0}},c=e.__targetPosition;c>-1||Object.defineProperty(e,"__targetPosition",{value:$s.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},Ds.push(n));var u={target:e,proxy:l,observable:n};return c>-1?(null===$s[c]&&($s[c]=e),Ms[c].push(u)):($s.push(e),Ms.push([u])),l},{create:function(e,t,r){!0===e.__isProxy&&(e=e.__getTarget);var s=Ts(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=Ds.length;r--;)if(Ds[r].parentProxy===e){Ds[r].observers.push(t);break}},pause:function(e){for(var t=Ds.length,r=!1;t--;)if(Ds[t].parentProxy===e){Ds[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=Ds.length,r=!1;t--;)if(Ds[t].parentProxy===e){Ds[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=Ds.length,r=!1;t--;)if(Ds[t].parentProxy===e){Ds[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=Ds.length,r=!1;t--;)if(Ds[t].parentProxy===e){Ds[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=Ds.length;s--;)if(Ds[s].parentProxy===e){t=Ds[s],r=!0;break}for(var n=Ms.length;n--;)for(var i=Ms[n].length;i--;)Ms[n][i].observable===t&&(Ms[n].splice(i,1),0===Ms[n].length&&($s[n]=null));!0===r&&Ds.splice(s,1)}});try{Rs.exports=Ls}catch(e){}const zs={};class ObservableObject{constructor(e,t={},r={}){if(this.id=e,zs[this.id])throw new Error("ObservableObject "+e+" already exists.");this.bound={},this.data=Fs.create(t,!1,(e=>{this.sync(e)})),this.options=r,zs[this.id]=this}destroy(){Fs.pause(this.data),delete zs[this.id],delete this.data,Object.keys(this.bound).forEach((e=>{Object.keys(this.bound[e]).forEach((t=>{this.unbind(t,e)}))})),Fs.remove(this.data)}getBoundData(){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 Ws,Hs,Vs,Is,Ns,qs;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=dt(((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])}}Ws=new DOMWatcher,Hs=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(),Ze.on("theScrollWatcher",this.scrollElement,"scroll",(()=>{this.trigger()}))}sleep(){super.sleep(),Ze.off("theScrollWatcher",this.scrollElement,"scroll")}inViewPort(e){return Ze.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}}},Vs=new class ResizeWatcher extends ObserverSubscriptionManager{constructor(e){super(e),this.debounce=dt((()=>{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")}},Is=new class OrientationWatcher extends ObserverSubscriptionManager{constructor(e){super(e),"onorientationchange"in window?Ze.addClass(document.body,"have-orientation"):Ze.addClass(document.body,"no-orientation"),this.debounce=dt((()=>{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")}},Ns=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()}},qs=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=>zs[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 Us=qe((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()}));let Bs=0;const Qs=[],Gs="customElements"in window,Zs={},registerSargassoClass=(e,t)=>{if(Zs[e])throw new Error("Sargasso class "+e+" is already registered.");if(Zs[e]=t,Gs){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}`)(Zs),r=window.sargassoOptions||{},s=void 0!==r.customElementPrefix?r.customElementPrefix:"sargasso-";customElements.define(s+Us(e),t)}},Js=["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=++Bs,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=dt((()=>{this._render()}),100,{maxWait:250})}start(){const e=this.getMetaData("registeredResponsiveControllers")||[];e.push(this),this.setMetaData("registeredResponsiveControllers",e),this.setMetaData(this.constructor.name,this),Qs.push(this),this._shadowDOM&&(this._shadowDOMWatcher||(this._shadowDOMWatcher=new DOMWatcher({shadowDOM:this._shadowRoot})),this._shadowDOMWatcher.subscribe(this)),this.options.watchDOM&&Ws.subscribe(this),(this.options.watchScroll||this.options.watchViewport)&&Hs.subscribe(this),(this.options.watchResize||this.options.watchViewport)&&Vs.subscribe(this),(this.options.watchOrientation||this.options.watchViewport)&&Is.subscribe(this),this.elementListener=e=>{e.detail&&e.detail.sargassoEvent&&-1!==Js.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&&Ws.unSubscribe(this),(this.options.watchScroll||this.options.watchViewport)&&Hs.unSubscribe(this),(this.options.watchResize||this.options.watchViewport)&&Vs.unSubscribe(this),(this.options.watchOrientation||this.options.watchViewport)&&Is.unSubscribe(this),this.element.removeEventListener("sargasso",this.elementListener),Ze.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){Ze.setMetaData(this.element,e,t)}getMetaData(e){return Ze.getMetaData(this.element,e)}on(e,t,r,s){Ze.on(this.constructor.name+"-"+this.uid,this.element,e,t,r,s)}off(e,t){Ze.off(this.constructor.name+"-"+this.uid,this.element,e,t)}once(e,t,r,s){Ze.once(this.constructor.name+"-"+this.uid,this.element,e,t,r,s)}notifyAll(e,t){if(-1===Js.indexOf(e))throw new Error("invalid event name "+e);for(let r=0;r<Qs.length;r++){const s=Qs[r];s!==this&&s[e]&&s[e].apply(s,t)}}notifyElement(e,t,r){if(-1===Js.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 Ze.hasClass(this.element,e)}addClass(e){Ze.addClass(this.element,e)}removeClass(e){Ze.removeClass(this.element,e)}setCSS(e){Ze.setCSS(this.element,e)}isVisible(){return Ze.isVisible(this.element)}workerStart(e,t){return this._workers[e]=Ns.registerWorker(e,t),Ns.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 qs.subscribe(this,e,t),this._observables[e]=qs.getObservable(e),this._observables[e]}observableStop(e){this._observables[e]&&(qs.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]&&(Ns.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!==Qs.indexOf(this)&&Qs.splice(Qs.indexOf(this),1)}watchDOM(e){e===this._shadowRoot?Ws.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(){Hs.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(Hs.inViewPort(r)){const s=r.getAttribute("data-lazy-sargasso-class").split(/\s*,\s*/);for(let r=0;r<s.length;r++){new Zs[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 Zs[t[r]](e).start()}catch(e){console.log("error instantiating "+t[r],e,Zs)}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<Qs.length;e++)Qs[e].options.immortal||Qs[e].options.isCustomElement||document.body.contains(Qs[e].element)||r.push(Qs[e]);for(let e=0;e<r.length;e++)r[e].destroy()}}registerSargassoClass("SargassoSupervisor",SargassoSupervisor);const Ys=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||Ys,this.scale=void 0,this.widths=[],this.classes=[],this.debouncedDetectGeometry=dt((()=>{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((()=>{Ze.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){Hs.scrollTop(0),this.mergePage(t.responseText);const e=this.currentPage,frame=()=>{this.notifyAll("newPage",[e,location.pathname+location.search]),Ze.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 Ks={registerSargassoClass:registerSargassoClass,bootSargasso:(t={})=>{if(t.scrollElement&&Hs.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:Ze,validate:validate,setValidator:setValidator},Xs={theDOMWatcher:Ws,theScrollWatcher:Hs,theResizeWatcher:Vs,theOrientationWatcher:Is,theWorkerWatcher:Ns,theObservableObjectWatcher:qs},en={liveElements:Qs,registeredClasses:Zs,elementMetaData:Ge};return e.ObservableObject=ObservableObject,e.Sargasso=Sargasso,e.services=Xs,e.system=en,e.utils=Ks,e}({});
//# sourceMappingURL=sargasso.iife.min.js.map
{
"name": "@pelagiccreatures/sargasso",
"version": "2.2.5",
"version": "2.2.6",
"description": "Simple, Fast, Reactive, Supervised Javascript controllers for custom html elements.",

@@ -37,15 +37,15 @@ "type": "module",

"devDependencies": {
"@rollup/plugin-commonjs": "^23.0.4",
"@rollup/plugin-json": "^5.0.2",
"@rollup/plugin-commonjs": "^24.0.0",
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-node-resolve": "^15.0.1",
"chai": "^4.3.7",
"core-js": "^3.26.1",
"eslint": "^8.29.0",
"eslint": "^8.30.0",
"mocha": "^10.2.0",
"mocha-chrome": "^2.2.0",
"parcel": "^2.8.1",
"rollup": "^3.7.3",
"parcel": "^2.8.2",
"rollup": "^3.7.5",
"rollup-plugin-terser": "^7.0.2",
"setimmediate": "^1.0.5",
"sinon": "^15.0.0"
"sinon": "^15.0.1"
},

@@ -52,0 +52,0 @@ "peerDependencies": {

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 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

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc