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

@pelagiccreatures/sargasso

Package Overview
Dependencies
Maintainers
1
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pelagiccreatures/sargasso - npm Package Compare versions

Comparing version 1.4.1 to 1.4.2

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:{};function s(e){var t={exports:{}};return e(t,t.exports),t.exports}var n="object"==typeof t&&t&&t.Object===Object&&t,r="object"==typeof self&&self&&self.Object===Object&&self,i=n||r||Function("return this")(),o=i.Symbol;var a=function(e,t){for(var s=-1,n=null==e?0:e.length,r=Array(n);++s<n;)r[s]=t(e[s],s,e);return r},c=Array.isArray,l=Object.prototype,u=l.hasOwnProperty,h=l.toString,d=o?o.toStringTag:void 0;var p=function(e){var t=u.call(e,d),s=e[d];try{e[d]=void 0;var n=!0}catch(e){}var r=h.call(e);return n&&(t?e[d]=s:delete e[d]),r},f=Object.prototype.toString;var b=function(e){return f.call(e)},m=o?o.toStringTag:void 0;var v=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":m&&m in Object(e)?p(e):b(e)};var g=function(e){return null!=e&&"object"==typeof e};var w=function(e){return"symbol"==typeof e||g(e)&&"[object Symbol]"==v(e)},y=o?o.prototype:void 0,_=y?y.toString:void 0;var x=function e(t){if("string"==typeof t)return t;if(c(t))return a(t,e)+"";if(w(t))return _?_.call(t):"";var s=t+"";return"0"==s&&1/t==-Infinity?"-0":s};var O=function(e){return null==e?"":x(e)};var j=function(e,t,s){var n=-1,r=e.length;t<0&&(t=-t>r?0:r+t),(s=s>r?r:s)<0&&(s+=r),r=t>s?0:s-t>>>0,t>>>=0;for(var i=Array(r);++n<r;)i[n]=e[n+t];return i};var E=function(e,t,s){var n=e.length;return s=void 0===s?n:s,!t&&s>=n?e:j(e,t,s)},A=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");var k=function(e){return A.test(e)};var S=function(e){return e.split("")},N="[\\ud800-\\udfff]",C="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",M="\\ud83c[\\udffb-\\udfff]",T="[^\\ud800-\\udfff]",V="(?:\\ud83c[\\udde6-\\uddff]){2}",R="[\\ud800-\\udbff][\\udc00-\\udfff]",F="(?:"+C+"|"+M+")"+"?",L="[\\ufe0e\\ufe0f]?",P=L+F+("(?:\\u200d(?:"+[T,V,R].join("|")+")"+L+F+")*"),z="(?:"+[T+C+"?",C,V,R,N].join("|")+")",D=RegExp(M+"(?="+M+")|"+z+P,"g");var W=function(e){return e.match(D)||[]};var H=function(e){return k(e)?W(e):S(e)};var I=function(e){return function(t){t=O(t);var s=k(t)?H(t):void 0,n=s?s[0]:t.charAt(0),r=s?E(s,1).join(""):t.slice(1);return n[e]()+r}}("toUpperCase");var B=function(e){return I(O(e).toLowerCase())};var q=function(e,t,s,n){var r=-1,i=null==e?0:e.length;for(n&&i&&(s=e[++r]);++r<i;)s=t(s,e[r],r,e);return s};var U=function(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"}),$=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Q=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");var G=function(e){return(e=O(e))&&e.replace($,U).replace(Q,"")},Z=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var J=function(e){return e.match(Z)||[]},Y=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var K=function(e){return Y.test(e)},X="\\u2700-\\u27bf",ee="a-z\\xdf-\\xf6\\xf8-\\xff",te="A-Z\\xc0-\\xd6\\xd8-\\xde",se="\\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",ne="["+se+"]",re="\\d+",ie="[\\u2700-\\u27bf]",oe="["+ee+"]",ae="[^\\ud800-\\udfff"+se+re+X+ee+te+"]",ce="(?:\\ud83c[\\udde6-\\uddff]){2}",le="[\\ud800-\\udbff][\\udc00-\\udfff]",ue="["+te+"]",he="(?:"+oe+"|"+ae+")",de="(?:"+ue+"|"+ae+")",pe="(?:['’](?:d|ll|m|re|s|t|ve))?",fe="(?:['’](?:D|LL|M|RE|S|T|VE))?",be="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",me="[\\ufe0e\\ufe0f]?",ve=me+be+("(?:\\u200d(?:"+["[^\\ud800-\\udfff]",ce,le].join("|")+")"+me+be+")*"),ge="(?:"+[ie,ce,le].join("|")+")"+ve,we=RegExp([ue+"?"+oe+"+"+pe+"(?="+[ne,ue,"$"].join("|")+")",de+"+"+fe+"(?="+[ne,ue+he,"$"].join("|")+")",ue+"?"+he+"+"+pe,ue+"+"+fe,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",re,ge].join("|"),"g");var ye=function(e){return e.match(we)||[]};var _e=function(e,t,s){return e=O(e),void 0===(t=s?void 0:t)?K(e)?ye(e):J(e):e.match(t)||[]},xe=RegExp("['’]","g");var Oe=function(e){return function(t){return q(_e(G(t).replace(xe,"")),e,"")}},je=Oe((function(e,t,s){return t=t.toLowerCase(),e+(s?B(t):t)}));const Ee=new WeakMap,Ae=e=>!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length),ke=(e,t,s)=>{const n=Ee.get(e)||{};s?n[t]=s:delete n[t],Ee.set(e,n)},Se=(e,t)=>(Ee.get(e)||{})[t],Ne=function(e,t,s,n,r,i,o){"function"==typeof n&&(o=i,i=r,r=n,n=null);const a="on:"+e+"-"+s+"-"+n;if(Se(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:n,fn:i=>{o&&Ce(e,t,s,n),n?Array.from(t.querySelectorAll(n)).forEach(e=>{(i.target===e||e.contains(i.target))&&r(i,e)}):r(i)},options:i||!1};ke(t,a,c),s.split(/[\s,]+/).forEach(e=>{t.addEventListener(e.trim(),c.fn,c.options)})},Ce=function(e,t,s,n){const r="on:"+e+"-"+s+"-"+n,i=Se(t,r);i&&(s.split(/[\s,]+/).forEach(e=>{t.removeEventListener(e.trim(),i.fn,i.options)}),ke(t,r))},Me={hasClass:(e,t)=>-1!==(e.className||"").split(/\s+/).indexOf(t),addClass:(e,t)=>{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)=>{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:Ae,inViewPort:(e,t=window)=>{const s=e.getBoundingClientRect(),n=Ae(e),r=s.bottom<0;let i;return i=t.self===window?s.top>(window.innerHeight||document.documentElement.clientHeight):s.top>t.clientHeight,n&&!i&&!r},setCSS:(e,t)=>{for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)){const n=je(s);e.style[n]=t[s]}},setMetaData:ke,getMetaData:Se,on:Ne,off:Ce,once:function(e,t,s,n,r,i){Ne(e,t,s,n,r,i,!0)},offAll:function(e){const t=Ee.get(e)||{},s=[];for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&e.match(/^on:/)&&s.push(e);s.forEach(s=>{Ce(t[s].uid,e,t[s].events,t[s].selector)})}};var Te=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},Ve=function(){return i.Date.now()},Re=/\s/;var Fe=function(e){for(var t=e.length;t--&&Re.test(e.charAt(t)););return t},Le=/^\s+/;var Pe=function(e){return e?e.slice(0,Fe(e)+1).replace(Le,""):e},ze=/^[-+]0x[0-9a-f]+$/i,De=/^0b[01]+$/i,We=/^0o[0-7]+$/i,He=parseInt;var Ie=function(e){if("number"==typeof e)return e;if(w(e))return NaN;if(Te(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Te(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Pe(e);var s=De.test(e);return s||We.test(e)?He(e.slice(2),s?2:8):ze.test(e)?NaN:+e},Be=Math.max,qe=Math.min;var Ue=function(e,t,s){var n,r,i,o,a,c,l=0,u=!1,h=!1,d=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function p(t){var s=n,i=r;return n=r=void 0,l=t,o=e.apply(i,s)}function f(e){return l=e,a=setTimeout(m,t),u?p(e):o}function b(e){var s=e-c;return void 0===c||s>=t||s<0||h&&e-l>=i}function m(){var e=Ve();if(b(e))return v(e);a=setTimeout(m,function(e){var s=t-(e-c);return h?qe(s,i-(e-l)):s}(e))}function v(e){return a=void 0,d&&n?p(e):(n=r=void 0,o)}function g(){var e=Ve(),s=b(e);if(n=arguments,r=this,c=e,s){if(void 0===a)return f(c);if(h)return clearTimeout(a),a=setTimeout(m,t),p(c)}return void 0===a&&(a=setTimeout(m,t)),o}return t=Ie(t)||0,Te(s)&&(u=!!s.leading,i=(h="maxWait"in s)?Be(Ie(s.maxWait)||0,t):i,d="trailing"in s?!!s.trailing:d),g.cancel=function(){void 0!==a&&clearTimeout(a),l=0,n=c=r=a=void 0},g.flush=function(){return void 0===a?o:v(Ve())},g};var $e=function(){this.__data__=[],this.size=0};var Qe=function(e,t){return e===t||e!=e&&t!=t};var Ge=function(e,t){for(var s=e.length;s--;)if(Qe(e[s][0],t))return s;return-1},Ze=Array.prototype.splice;var Je=function(e){var t=this.__data__,s=Ge(t,e);return!(s<0)&&(s==t.length-1?t.pop():Ze.call(t,s,1),--this.size,!0)};var Ye=function(e){var t=this.__data__,s=Ge(t,e);return s<0?void 0:t[s][1]};var Ke=function(e){return Ge(this.__data__,e)>-1};var Xe=function(e,t){var s=this.__data__,n=Ge(s,e);return n<0?(++this.size,s.push([e,t])):s[n][1]=t,this};function et(e){var t=-1,s=null==e?0:e.length;for(this.clear();++t<s;){var n=e[t];this.set(n[0],n[1])}}et.prototype.clear=$e,et.prototype.delete=Je,et.prototype.get=Ye,et.prototype.has=Ke,et.prototype.set=Xe;var tt=et;var st=function(){this.__data__=new tt,this.size=0};var nt=function(e){var t=this.__data__,s=t.delete(e);return this.size=t.size,s};var rt=function(e){return this.__data__.get(e)};var it=function(e){return this.__data__.has(e)};var ot,at=function(e){if(!Te(e))return!1;var t=v(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},ct=i["__core-js_shared__"],lt=(ot=/[^.]+$/.exec(ct&&ct.keys&&ct.keys.IE_PROTO||""))?"Symbol(src)_1."+ot:"";var ut=function(e){return!!lt&&lt in e},ht=Function.prototype.toString;var dt=function(e){if(null!=e){try{return ht.call(e)}catch(e){}try{return e+""}catch(e){}}return""},pt=/^\[object .+?Constructor\]$/,ft=Function.prototype,bt=Object.prototype,mt=ft.toString,vt=bt.hasOwnProperty,gt=RegExp("^"+mt.call(vt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var wt=function(e){return!(!Te(e)||ut(e))&&(at(e)?gt:pt).test(dt(e))};var yt=function(e,t){return null==e?void 0:e[t]};var _t=function(e,t){var s=yt(e,t);return wt(s)?s:void 0},xt=_t(i,"Map"),Ot=_t(Object,"create");var jt=function(){this.__data__=Ot?Ot(null):{},this.size=0};var Et=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},At=Object.prototype.hasOwnProperty;var kt=function(e){var t=this.__data__;if(Ot){var s=t[e];return"__lodash_hash_undefined__"===s?void 0:s}return At.call(t,e)?t[e]:void 0},St=Object.prototype.hasOwnProperty;var Nt=function(e){var t=this.__data__;return Ot?void 0!==t[e]:St.call(t,e)};var Ct=function(e,t){var s=this.__data__;return this.size+=this.has(e)?0:1,s[e]=Ot&&void 0===t?"__lodash_hash_undefined__":t,this};function Mt(e){var t=-1,s=null==e?0:e.length;for(this.clear();++t<s;){var n=e[t];this.set(n[0],n[1])}}Mt.prototype.clear=jt,Mt.prototype.delete=Et,Mt.prototype.get=kt,Mt.prototype.has=Nt,Mt.prototype.set=Ct;var Tt=Mt;var Vt=function(){this.size=0,this.__data__={hash:new Tt,map:new(xt||tt),string:new Tt}};var Rt=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var Ft=function(e,t){var s=e.__data__;return Rt(t)?s["string"==typeof t?"string":"hash"]:s.map};var Lt=function(e){var t=Ft(this,e).delete(e);return this.size-=t?1:0,t};var Pt=function(e){return Ft(this,e).get(e)};var zt=function(e){return Ft(this,e).has(e)};var Dt=function(e,t){var s=Ft(this,e),n=s.size;return s.set(e,t),this.size+=s.size==n?0:1,this};function Wt(e){var t=-1,s=null==e?0:e.length;for(this.clear();++t<s;){var n=e[t];this.set(n[0],n[1])}}Wt.prototype.clear=Vt,Wt.prototype.delete=Lt,Wt.prototype.get=Pt,Wt.prototype.has=zt,Wt.prototype.set=Dt;var Ht=Wt;var It=function(e,t){var s=this.__data__;if(s instanceof tt){var n=s.__data__;if(!xt||n.length<199)return n.push([e,t]),this.size=++s.size,this;s=this.__data__=new Ht(n)}return s.set(e,t),this.size=s.size,this};function Bt(e){var t=this.__data__=new tt(e);this.size=t.size}Bt.prototype.clear=st,Bt.prototype.delete=nt,Bt.prototype.get=rt,Bt.prototype.has=it,Bt.prototype.set=It;var qt=Bt;var Ut=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this};var $t=function(e){return this.__data__.has(e)};function Qt(e){var t=-1,s=null==e?0:e.length;for(this.__data__=new Ht;++t<s;)this.add(e[t])}Qt.prototype.add=Qt.prototype.push=Ut,Qt.prototype.has=$t;var Gt=Qt;var Zt=function(e,t){for(var s=-1,n=null==e?0:e.length;++s<n;)if(t(e[s],s,e))return!0;return!1};var Jt=function(e,t){return e.has(t)};var Yt=function(e,t,s,n,r,i){var o=1&s,a=e.length,c=t.length;if(a!=c&&!(o&&c>a))return!1;var l=i.get(e),u=i.get(t);if(l&&u)return l==t&&u==e;var h=-1,d=!0,p=2&s?new Gt:void 0;for(i.set(e,t),i.set(t,e);++h<a;){var f=e[h],b=t[h];if(n)var m=o?n(b,f,h,t,e,i):n(f,b,h,e,t,i);if(void 0!==m){if(m)continue;d=!1;break}if(p){if(!Zt(t,(function(e,t){if(!Jt(p,t)&&(f===e||r(f,e,s,n,i)))return p.push(t)}))){d=!1;break}}else if(f!==b&&!r(f,b,s,n,i)){d=!1;break}}return i.delete(e),i.delete(t),d},Kt=i.Uint8Array;var Xt=function(e){var t=-1,s=Array(e.size);return e.forEach((function(e,n){s[++t]=[n,e]})),s};var es=function(e){var t=-1,s=Array(e.size);return e.forEach((function(e){s[++t]=e})),s},ts=o?o.prototype:void 0,ss=ts?ts.valueOf:void 0;var ns=function(e,t,s,n,r,i,o){switch(s){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!i(new Kt(e),new Kt(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Qe(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var a=Xt;case"[object Set]":var c=1&n;if(a||(a=es),e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;n|=2,o.set(e,t);var u=Yt(a(e),a(t),n,r,i,o);return o.delete(e),u;case"[object Symbol]":if(ss)return ss.call(e)==ss.call(t)}return!1};var rs=function(e,t){for(var s=-1,n=t.length,r=e.length;++s<n;)e[r+s]=t[s];return e};var is=function(e,t,s){var n=t(e);return c(e)?n:rs(n,s(e))};var os=function(e,t){for(var s=-1,n=null==e?0:e.length,r=0,i=[];++s<n;){var o=e[s];t(o,s,e)&&(i[r++]=o)}return i};var as=function(){return[]},cs=Object.prototype.propertyIsEnumerable,ls=Object.getOwnPropertySymbols,us=ls?function(e){return null==e?[]:(e=Object(e),os(ls(e),(function(t){return cs.call(e,t)})))}:as;var hs=function(e,t){for(var s=-1,n=Array(e);++s<e;)n[s]=t(s);return n};var ds=function(e){return g(e)&&"[object Arguments]"==v(e)},ps=Object.prototype,fs=ps.hasOwnProperty,bs=ps.propertyIsEnumerable,ms=ds(function(){return arguments}())?ds:function(e){return g(e)&&fs.call(e,"callee")&&!bs.call(e,"callee")};var vs=function(){return!1},gs=s((function(e,t){var s=t&&!t.nodeType&&t,n=s&&e&&!e.nodeType&&e,r=n&&n.exports===s?i.Buffer:void 0,o=(r?r.isBuffer:void 0)||vs;e.exports=o})),ws=/^(?:0|[1-9]\d*)$/;var ys=function(e,t){var s=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==s||"symbol"!=s&&ws.test(e))&&e>-1&&e%1==0&&e<t};var _s=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},xs={};xs["[object Float32Array]"]=xs["[object Float64Array]"]=xs["[object Int8Array]"]=xs["[object Int16Array]"]=xs["[object Int32Array]"]=xs["[object Uint8Array]"]=xs["[object Uint8ClampedArray]"]=xs["[object Uint16Array]"]=xs["[object Uint32Array]"]=!0,xs["[object Arguments]"]=xs["[object Array]"]=xs["[object ArrayBuffer]"]=xs["[object Boolean]"]=xs["[object DataView]"]=xs["[object Date]"]=xs["[object Error]"]=xs["[object Function]"]=xs["[object Map]"]=xs["[object Number]"]=xs["[object Object]"]=xs["[object RegExp]"]=xs["[object Set]"]=xs["[object String]"]=xs["[object WeakMap]"]=!1;var Os=function(e){return g(e)&&_s(e.length)&&!!xs[v(e)]};var js=function(e){return function(t){return e(t)}},Es=s((function(e,t){var s=t&&!t.nodeType&&t,r=s&&e&&!e.nodeType&&e,i=r&&r.exports===s&&n.process,o=function(){try{var e=r&&r.require&&r.require("util").types;return e||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=o})),As=Es&&Es.isTypedArray,ks=As?js(As):Os,Ss=Object.prototype.hasOwnProperty;var Ns=function(e,t){var s=c(e),n=!s&&ms(e),r=!s&&!n&&gs(e),i=!s&&!n&&!r&&ks(e),o=s||n||r||i,a=o?hs(e.length,String):[],l=a.length;for(var u in e)!t&&!Ss.call(e,u)||o&&("length"==u||r&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||ys(u,l))||a.push(u);return a},Cs=Object.prototype;var Ms=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Cs)};var Ts=function(e,t){return function(s){return e(t(s))}}(Object.keys,Object),Vs=Object.prototype.hasOwnProperty;var Rs=function(e){if(!Ms(e))return Ts(e);var t=[];for(var s in Object(e))Vs.call(e,s)&&"constructor"!=s&&t.push(s);return t};var Fs=function(e){return null!=e&&_s(e.length)&&!at(e)};var Ls=function(e){return Fs(e)?Ns(e):Rs(e)};var Ps=function(e){return is(e,Ls,us)},zs=Object.prototype.hasOwnProperty;var Ds=function(e,t,s,n,r,i){var o=1&s,a=Ps(e),c=a.length;if(c!=Ps(t).length&&!o)return!1;for(var l=c;l--;){var u=a[l];if(!(o?u in t:zs.call(t,u)))return!1}var h=i.get(e),d=i.get(t);if(h&&d)return h==t&&d==e;var p=!0;i.set(e,t),i.set(t,e);for(var f=o;++l<c;){var b=e[u=a[l]],m=t[u];if(n)var v=o?n(m,b,u,t,e,i):n(b,m,u,e,t,i);if(!(void 0===v?b===m||r(b,m,s,n,i):v)){p=!1;break}f||(f="constructor"==u)}if(p&&!f){var g=e.constructor,w=t.constructor;g==w||!("constructor"in e)||!("constructor"in t)||"function"==typeof g&&g instanceof g&&"function"==typeof w&&w instanceof w||(p=!1)}return i.delete(e),i.delete(t),p},Ws=_t(i,"DataView"),Hs=_t(i,"Promise"),Is=_t(i,"Set"),Bs=_t(i,"WeakMap"),qs="[object Map]",Us="[object Promise]",$s="[object Set]",Qs="[object WeakMap]",Gs="[object DataView]",Zs=dt(Ws),Js=dt(xt),Ys=dt(Hs),Ks=dt(Is),Xs=dt(Bs),en=v;(Ws&&en(new Ws(new ArrayBuffer(1)))!=Gs||xt&&en(new xt)!=qs||Hs&&en(Hs.resolve())!=Us||Is&&en(new Is)!=$s||Bs&&en(new Bs)!=Qs)&&(en=function(e){var t=v(e),s="[object Object]"==t?e.constructor:void 0,n=s?dt(s):"";if(n)switch(n){case Zs:return Gs;case Js:return qs;case Ys:return Us;case Ks:return $s;case Xs:return Qs}return t});var tn=en,sn="[object Arguments]",nn="[object Array]",rn="[object Object]",on=Object.prototype.hasOwnProperty;var an=function(e,t,s,n,r,i){var o=c(e),a=c(t),l=o?nn:tn(e),u=a?nn:tn(t),h=(l=l==sn?rn:l)==rn,d=(u=u==sn?rn:u)==rn,p=l==u;if(p&&gs(e)){if(!gs(t))return!1;o=!0,h=!1}if(p&&!h)return i||(i=new qt),o||ks(e)?Yt(e,t,s,n,r,i):ns(e,t,l,s,n,r,i);if(!(1&s)){var f=h&&on.call(e,"__wrapped__"),b=d&&on.call(t,"__wrapped__");if(f||b){var m=f?e.value():e,v=b?t.value():t;return i||(i=new qt),r(m,v,s,n,i)}}return!!p&&(i||(i=new qt),Ds(e,t,s,n,r,i))};var cn=function e(t,s,n,r,i){return t===s||(null==t||null==s||!g(t)&&!g(s)?t!=t&&s!=s:an(t,s,n,r,e,i))};var ln=function(e,t){return cn(e,t)};const un={},hn=e=>({get(t,s){const n=Reflect.get(t,s);return n&&"object"==typeof n?new Proxy(n,hn(e)):n},set:(t,s,n)=>(e.sync(s),Reflect.set(t,s,n)),deleteProperty:(t,s)=>(e.sync(s),Reflect.deleteProperty(t,s))});class dn{constructor(e,t={},s={}){if(this.id=e,un[this.id])throw new Error("ObservableObject "+e+" already exists.");this.bound={},this.data=new Proxy(t,hn(this)),this.options=s,un[this.id]=this}destroy(){delete un[this.id],delete this.data,Object.keys(this.bound).forEach(e=>{Object.keys(this.bound[e]).forEach(t=>{this.unbind(e,t)})})}getBoundData(){return this.data}set(e,t){ln(this.get(e),t)||(this.data[e]=t)}get(e){return this.data[e]}delete(e){delete this.data[e]}syncAll(){Object.keys(this.data||{}).forEach(e=>{this.sync(e)})}bind(e,t,s="*"){this.bound[s]||(this.bound[s]={}),this.bound[s][e]=t,Object.keys(this.data).forEach(e=>{t(this.id,e,this.get(e))})}unbind(e,t="*"){this.bound[t][e]&&delete this.bound[t][e]}observers(){let e=0;for(const t in this.bound)this.bound.hasOwnProperty(t)&&e++;return e}sync(e){Object.keys(this.bound["*"]||{}).forEach(t=>{this.bound["*"][t](this.id,e,this.get(e))}),Object.keys(this.bound[e]||{}).forEach(t=>{this.bound[e][t](this.id,e,this.get(e))})}}let pn,fn,bn,mn,vn,gn;class wn{constructor(e){this.options=e,this.observers=[],this.pendingAnimationFrame=void 0,this.frameQueue=[]}subscribe(e){this.observers.length||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(){}wakeup(){}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]()}}pn=new class extends wn{constructor(e){super(e),this.mutationHandler=Ue((e,t)=>{this.observeDOM(e,t)},100,{maxWait:250}),this.mutationObserver=new MutationObserver(this.mutationHandler,!1)}subscribe(e){super.subscribe(e),e.watchDOM()}wakeup(){super.wakeup(),this.mutationObserver.observe(document.body,{childList:!0,subtree:!0})}sleep(){super.sleep(),this.mutationObserver.disconnect()}observeDOM(){this.notifyObservers("watchDOM")}},fn=new class extends wn{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 e=()=>{this.scrollLoop()};this.queueFrame(e)}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(),Me.on("theScrollWatcher",this.scrollElement,"scroll",()=>{this.trigger()})}sleep(){super.sleep(),Me.off("theScrollWatcher",this.scrollElement,"scroll")}inViewPort(e){return Me.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}}},bn=new class extends wn{constructor(e){super(e),this.debounce=Ue(()=>{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")}},mn=new class extends wn{constructor(e){super(e),"onorientationchange"in window?Me.addClass(document.body,"have-orientation"):Me.addClass(document.body,"no-orientation"),this.debounce=Ue(()=>{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")}},vn=new class extends wn{constructor(e){super(e),this.workers={}}registerWorker(e,t){if(!this.workers[e]){let s=t,n=!1;if(!t.match(/^(http|\/)/i)){const e=new Blob([t],{type:"text/javascript"});s=URL.createObjectURL(e),n=!0}this.workers[e]={worker:new Worker(s),observers:[]},n&&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()}},gn=new class extends wn{constructor(e){super(e),this.registeredObservableObjects={}}getObservable(e){return this.registeredObservableObjects[e]?this.registeredObservableObjects[e].observable:void 0}observableStart(e,t){const s=(e=>un[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 dn(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,n){if(!this.registeredObservableObjects[e])throw new Error("ObservableObject notify "+e+" does not exist");this.registeredObservableObjects[e].observers.forEach(r=>{r.observableChanged&&r.observableChanged(e,t,s,n)})}};var yn=Oe((function(e,t,s){return e+(s?"-":"")+t.toLowerCase()}));const _n=new WeakMap,xn=e=>(...t)=>{const s=e(...t);return _n.set(s,!0),s},On=e=>"function"==typeof e&&_n.has(e),jn="undefined"!=typeof window&&null!=window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,En=(e,t,s=null,n=null)=>{for(;t!==s;){const s=t.nextSibling;e.insertBefore(t,n),t=s}},An=(e,t,s=null)=>{for(;t!==s;){const s=t.nextSibling;e.removeChild(t),t=s}},kn={},Sn={},Nn=`{{lit-${String(Math.random()).slice(2)}}}`,Cn=`\x3c!--${Nn}--\x3e`,Mn=new RegExp(`${Nn}|${Cn}`),Tn="$lit$";class Vn{constructor(e,t){this.parts=[],this.element=t;const s=[],n=[],r=document.createTreeWalker(t.content,133,null,!1);let i=0,o=-1,a=0;const{strings:c,values:{length:l}}=e;for(;a<l;){const e=r.nextNode();if(null!==e){if(o++,1===e.nodeType){if(e.hasAttributes()){const t=e.attributes,{length:s}=t;let n=0;for(let e=0;e<s;e++)Rn(t[e].name,Tn)&&n++;for(;n-- >0;){const t=c[a],s=Pn.exec(t)[2],n=s.toLowerCase()+Tn,r=e.getAttribute(n);e.removeAttribute(n);const i=r.split(Mn);this.parts.push({type:"attribute",index:o,name:s,strings:i}),a+=i.length-1}}"TEMPLATE"===e.tagName&&(n.push(e),r.currentNode=e.content)}else if(3===e.nodeType){const t=e.data;if(t.indexOf(Nn)>=0){const n=e.parentNode,r=t.split(Mn),i=r.length-1;for(let t=0;t<i;t++){let s,i=r[t];if(""===i)s=Ln();else{const e=Pn.exec(i);null!==e&&Rn(e[2],Tn)&&(i=i.slice(0,e.index)+e[1]+e[2].slice(0,-Tn.length)+e[3]),s=document.createTextNode(i)}n.insertBefore(s,e),this.parts.push({type:"node",index:++o})}""===r[i]?(n.insertBefore(Ln(),e),s.push(e)):e.data=r[i],a+=i}}else if(8===e.nodeType)if(e.data===Nn){const t=e.parentNode;null!==e.previousSibling&&o!==i||(o++,t.insertBefore(Ln(),e)),i=o,this.parts.push({type:"node",index:o}),null===e.nextSibling?e.data="":(s.push(e),o--),a++}else{let t=-1;for(;-1!==(t=e.data.indexOf(Nn,t+1));)this.parts.push({type:"node",index:-1}),a++}}else r.currentNode=n.pop()}for(const e of s)e.parentNode.removeChild(e)}}const Rn=(e,t)=>{const s=e.length-t.length;return s>=0&&e.slice(s)===t},Fn=e=>-1!==e.index,Ln=()=>document.createComment(""),Pn=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;class zn{constructor(e,t,s){this.__parts=[],this.template=e,this.processor=t,this.options=s}update(e){let t=0;for(const s of this.__parts)void 0!==s&&s.setValue(e[t]),t++;for(const e of this.__parts)void 0!==e&&e.commit()}_clone(){const e=jn?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),t=[],s=this.template.parts,n=document.createTreeWalker(e,133,null,!1);let r,i=0,o=0,a=n.nextNode();for(;i<s.length;)if(r=s[i],Fn(r)){for(;o<r.index;)o++,"TEMPLATE"===a.nodeName&&(t.push(a),n.currentNode=a.content),null===(a=n.nextNode())&&(n.currentNode=t.pop(),a=n.nextNode());if("node"===r.type){const e=this.processor.handleTextExpression(this.options);e.insertAfterNode(a.previousSibling),this.__parts.push(e)}else this.__parts.push(...this.processor.handleAttributeExpressions(a,r.name,r.strings,this.options));i++}else this.__parts.push(void 0),i++;return jn&&(document.adoptNode(e),customElements.upgrade(e)),e}}const Dn=window.trustedTypes&&trustedTypes.createPolicy("lit-html",{createHTML:e=>e}),Wn=` ${Nn} `;class Hn{constructor(e,t,s,n){this.strings=e,this.values=t,this.type=s,this.processor=n}getHTML(){const e=this.strings.length-1;let t="",s=!1;for(let n=0;n<e;n++){const e=this.strings[n],r=e.lastIndexOf("\x3c!--");s=(r>-1||s)&&-1===e.indexOf("--\x3e",r+1);const i=Pn.exec(e);t+=null===i?e+(s?Wn:Cn):e.substr(0,i.index)+i[1]+i[2]+Tn+i[3]+Nn}return t+=this.strings[e],t}getTemplateElement(){const e=document.createElement("template");let t=this.getHTML();return void 0!==Dn&&(t=Dn.createHTML(t)),e.innerHTML=t,e}}const In=e=>null===e||!("object"==typeof e||"function"==typeof e),Bn=e=>Array.isArray(e)||!(!e||!e[Symbol.iterator]);class qn{constructor(e,t,s){this.dirty=!0,this.element=e,this.name=t,this.strings=s,this.parts=[];for(let e=0;e<s.length-1;e++)this.parts[e]=this._createPart()}_createPart(){return new Un(this)}_getValue(){const e=this.strings,t=e.length-1,s=this.parts;if(1===t&&""===e[0]&&""===e[1]){const e=s[0].value;if("symbol"==typeof e)return String(e);if("string"==typeof e||!Bn(e))return e}let n="";for(let r=0;r<t;r++){n+=e[r];const t=s[r];if(void 0!==t){const e=t.value;if(In(e)||!Bn(e))n+="string"==typeof e?e:String(e);else for(const t of e)n+="string"==typeof t?t:String(t)}}return n+=e[t],n}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}class Un{constructor(e){this.value=void 0,this.committer=e}setValue(e){e===kn||In(e)&&e===this.value||(this.value=e,On(e)||(this.committer.dirty=!0))}commit(){for(;On(this.value);){const e=this.value;this.value=kn,e(this)}this.value!==kn&&this.committer.commit()}}class $n{constructor(e){this.value=void 0,this.__pendingValue=void 0,this.options=e}appendInto(e){this.startNode=e.appendChild(Ln()),this.endNode=e.appendChild(Ln())}insertAfterNode(e){this.startNode=e,this.endNode=e.nextSibling}appendIntoPart(e){e.__insert(this.startNode=Ln()),e.__insert(this.endNode=Ln())}insertAfterPart(e){e.__insert(this.startNode=Ln()),this.endNode=e.endNode,e.endNode=this.startNode}setValue(e){this.__pendingValue=e}commit(){if(null===this.startNode.parentNode)return;for(;On(this.__pendingValue);){const e=this.__pendingValue;this.__pendingValue=kn,e(this)}const e=this.__pendingValue;e!==kn&&(In(e)?e!==this.value&&this.__commitText(e):e instanceof Hn?this.__commitTemplateResult(e):e instanceof Node?this.__commitNode(e):Bn(e)?this.__commitIterable(e):e===Sn?(this.value=Sn,this.clear()):this.__commitText(e))}__insert(e){this.endNode.parentNode.insertBefore(e,this.endNode)}__commitNode(e){this.value!==e&&(this.clear(),this.__insert(e),this.value=e)}__commitText(e){const t=this.startNode.nextSibling,s="string"==typeof(e=null==e?"":e)?e:String(e);t===this.endNode.previousSibling&&3===t.nodeType?t.data=s:this.__commitNode(document.createTextNode(s)),this.value=e}__commitTemplateResult(e){const t=this.options.templateFactory(e);if(this.value instanceof zn&&this.value.template===t)this.value.update(e.values);else{const s=new zn(t,e.processor,this.options),n=s._clone();s.update(e.values),this.__commitNode(n),this.value=s}}__commitIterable(e){Array.isArray(this.value)||(this.value=[],this.clear());const t=this.value;let s,n=0;for(const r of e)s=t[n],void 0===s&&(s=new $n(this.options),t.push(s),0===n?s.appendIntoPart(this):s.insertAfterPart(t[n-1])),s.setValue(r),s.commit(),n++;n<t.length&&(t.length=n,this.clear(s&&s.endNode))}clear(e=this.startNode){An(this.startNode.parentNode,e.nextSibling,this.endNode)}}class Qn{constructor(e,t,s){if(this.value=void 0,this.__pendingValue=void 0,2!==s.length||""!==s[0]||""!==s[1])throw new Error("Boolean attributes can only contain a single expression");this.element=e,this.name=t,this.strings=s}setValue(e){this.__pendingValue=e}commit(){for(;On(this.__pendingValue);){const e=this.__pendingValue;this.__pendingValue=kn,e(this)}if(this.__pendingValue===kn)return;const e=!!this.__pendingValue;this.value!==e&&(e?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name),this.value=e),this.__pendingValue=kn}}class Gn extends qn{constructor(e,t,s){super(e,t,s),this.single=2===s.length&&""===s[0]&&""===s[1]}_createPart(){return new Zn(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}class Zn extends Un{}let Jn=!1;(()=>{try{const e={get capture(){return Jn=!0,!1}};window.addEventListener("test",e,e),window.removeEventListener("test",e,e)}catch(e){}})();class Yn{constructor(e,t,s){this.value=void 0,this.__pendingValue=void 0,this.element=e,this.eventName=t,this.eventContext=s,this.__boundHandleEvent=e=>this.handleEvent(e)}setValue(e){this.__pendingValue=e}commit(){for(;On(this.__pendingValue);){const e=this.__pendingValue;this.__pendingValue=kn,e(this)}if(this.__pendingValue===kn)return;const e=this.__pendingValue,t=this.value,s=null==e||null!=t&&(e.capture!==t.capture||e.once!==t.once||e.passive!==t.passive),n=null!=e&&(null==t||s);s&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),n&&(this.__options=Kn(e),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=e,this.__pendingValue=kn}handleEvent(e){"function"==typeof this.value?this.value.call(this.eventContext||this.element,e):this.value.handleEvent(e)}}const Kn=e=>e&&(Jn?{capture:e.capture,passive:e.passive,once:e.once}:e.capture);const Xn=new class{handleAttributeExpressions(e,t,s,n){const r=t[0];if("."===r){return new Gn(e,t.slice(1),s).parts}if("@"===r)return[new Yn(e,t.slice(1),n.eventContext)];if("?"===r)return[new Qn(e,t.slice(1),s)];return new qn(e,t,s).parts}handleTextExpression(e){return new $n(e)}};function er(e){let t=tr.get(e.type);void 0===t&&(t={stringsArray:new WeakMap,keyString:new Map},tr.set(e.type,t));let s=t.stringsArray.get(e.strings);if(void 0!==s)return s;const n=e.strings.join(Nn);return s=t.keyString.get(n),void 0===s&&(s=new Vn(e,e.getTemplateElement()),t.keyString.set(n,s)),t.stringsArray.set(e.strings,s),s}const tr=new Map,sr=new WeakMap,nr=(e,t,s)=>{let n=sr.get(t);void 0===n&&(An(t,t.firstChild),sr.set(t,n=new $n(Object.assign({templateFactory:er},s))),n.appendInto(t)),n.setValue(e),n.commit()};"undefined"!=typeof window&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.3.0");let rr=0;const ir=[],or="customElements"in window,ar={},cr=(e,t)=>{if(ar[e]=t,or){const t=`\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.helper = null\n\t\t\t\t}\n\n\t\t\t\tconnectedCallback () {\n\t\t\t\t\tthis.helper = new registeredClasses[this.helperClass](this,{isCustomElement:true})\n\t\t\t\t\tthis.helper.start()\n\t\t\t\t}\n\n\t\t\t\tdisconnectedCallback () {\n\t\t\t\t\tthis.helper.destroy()\n\t\t\t\t\tthis.helper = null // nuke the reference for trash collection\n\t\t\t\t}\n\t\t\t}`;customElements.define("sargasso-"+yn(e),new Function("registeredClasses",t)(ar))}},lr=["DOMChanged","didScroll","didResize","didBreakpoint","enterViewport","exitViewport","enterFullscreen","exitFullscreen","newPage","elementEvent"];class ur{constructor(e,t={}){this.uid=++rr,this.element=e,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=Ue(()=>{this._render()},100,{maxWait:250})}start(){const e=this.getMetaData("registeredResponsiveControllers")||[];e.push(this),this.setMetaData("registeredResponsiveControllers",e),this.setMetaData(this.constructor.name,this),ir.push(this),this.options.watchDOM&&pn.subscribe(this),(this.options.watchScroll||this.options.watchViewport)&&fn.subscribe(this),(this.options.watchResize||this.options.watchViewport)&&bn.subscribe(this),(this.options.watchOrientation||this.options.watchViewport)&&mn.subscribe(this),this.elementListener=e=>{e.detail&&e.detail.sargassoEvent&&-1!==lr.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.options.watchDOM&&pn.unSubscribe(this),(this.options.watchScroll||this.options.watchViewport)&&fn.unSubscribe(this),(this.options.watchResize||this.options.watchViewport)&&bn.unSubscribe(this),(this.options.watchOrientation||this.options.watchViewport)&&mn.unSubscribe(this),this.element.removeEventListener("sargasso",this.elementListener),Me.offAll(this.element),this.started=!1}DOMChanged(){}didScroll(){}didResize(){}didBreakpoint(){}enterViewport(){}exitViewport(){}enterFullscreen(){}exitFullscreen(){}newPage(e,t){}elementEvent(e){}workerOnMessage(e,t){}observableChanged(e,t,s){this.render()}setMetaData(e,t){Me.setMetaData(this.element,e,t)}getMetaData(e){return Me.getMetaData(this.element,e)}on(e,t,s,n){Me.on(this.constructor.name+"-"+this.uid,this.element,e,t,s,n)}off(e,t){Me.off(this.constructor.name+"-"+this.uid,this.element,e,t)}once(e,t,s,n){Me.once(this.constructor.name+"-"+this.uid,this.element,e,t,s,n)}notifyAll(e,t){if(-1===lr.indexOf(e))throw new Error("invalid event name "+e);for(let s=0;s<ir.length;s++){const n=ir[s];n!==this&&n[e]&&n[e].apply(n,t)}}notifyElement(e,t,s){if(-1===lr.indexOf(t))throw new Error("invalid event name "+t);const n=this.getMetaData("registeredResponsiveControllers");if(n)for(let e=0;e<n.length;e++){const r=n[e];r!==this&&r[t]&&r[t].apply(r,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 Me.hasClass(this.element,e)}addClass(e){Me.addClass(this.element,e)}removeClass(e){Me.removeClass(this.element,e)}setCSS(e){Me.setCSS(this.element,e)}isVisible(){return Me.isVisible(this.element)}workerStart(e,t){return this.workers[e]=vn.registerWorker(e,t),vn.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]}observableStart(e,t){return gn.subscribe(this,e,t),this.observables[e]=gn.getObservable(e),this.observables[e]}observableStop(e){this.observables[e]&&(gn.unSubscribe(this,e),delete this.observables[e])}observableStopAll(){for(const e in this.observables)this.observableStop(e)}setTemplate(e){this.template=e}setTemplateArgs(e={}){this.templateArgs=e.constructor&&"ObservableObject"===e.constructor.name?e.data:e,this.render()}_render(){this.template&&nr(this.template(JSON.parse(JSON.stringify(this.templateArgs||{}))),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]&&(vn.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!==ir.indexOf(this)&&ir.splice(ir.indexOf(this),1)}watchDOM(){this.DOMChanged()}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(){fn.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()}}cr("Sargasso",ur);class hr extends ur{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(){super.DOMChanged(),this.lazyHandler()}lazyHandler(){const e=document.querySelectorAll("[data-lazy-sargasso-class]");for(let t=0;t<e.length;t++){const s=e[t];if(fn.inViewPort(s)){const n=s.getAttribute("data-lazy-sargasso-class").split(/\s*,\s*/);for(let s=0;s<n.length;s++){new ar[n[s]](e[t]).start()}s.removeAttribute("data-lazy-sargasso-class")}}}}cr("LazyInstantiate",hr);class dr extends ur{constructor(e,t={}){super(e,{watchDOM:!0,mortal:!1}),this.lazy=new hr(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 ar[t[s]](e).start()}catch(e){console.log("error instantiating "+t[s],e,ar)}e.removeAttribute("data-sargasso-class")}newPage(){this.doIt()}DOMChanged(){this.doIt()}doIt(){const e=document.querySelectorAll("[data-sargasso-class]");for(const t of e)this.instantiate(t);const t=[];for(let e=0;e<ir.length;e++)ir[e].options.immortal||ir[e].options.isCustomElement||document.body.contains(ir[e].element)||t.push(ir[e]);for(let e=0;e<t.length;e++)t[e].destroy()}}cr("SargassoSupervisor",dr);var pr=s((function(e,t){!function(t){if(e.exports=t(),!!0){var s=window.Cookies,n=window.Cookies=t();n.noConflict=function(){return window.Cookies=s,n}}}((function(){function e(){for(var e=0,t={};e<arguments.length;e++){var s=arguments[e];for(var n in s)t[n]=s[n]}return t}function t(e){return e.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}return function s(n){function r(){}function i(t,s,i){if("undefined"!=typeof document){"number"==typeof(i=e({path:"/"},r.defaults,i)).expires&&(i.expires=new Date(1*new Date+864e5*i.expires)),i.expires=i.expires?i.expires.toUTCString():"";try{var o=JSON.stringify(s);/^[\{\[]/.test(o)&&(s=o)}catch(e){}s=n.write?n.write(s,t):encodeURIComponent(String(s)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=encodeURIComponent(String(t)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var a="";for(var c in i)i[c]&&(a+="; "+c,!0!==i[c]&&(a+="="+i[c].split(";")[0]));return document.cookie=t+"="+s+a}}function o(e,s){if("undefined"!=typeof document){for(var r={},i=document.cookie?document.cookie.split("; "):[],o=0;o<i.length;o++){var a=i[o].split("="),c=a.slice(1).join("=");s||'"'!==c.charAt(0)||(c=c.slice(1,-1));try{var l=t(a[0]);if(c=(n.read||n)(c,l)||t(c),s)try{c=JSON.parse(c)}catch(e){}if(r[l]=c,e===l)break}catch(e){}}return e?r[e]:r}}return r.set=i,r.get=function(e){return o(e,!1)},r.getJSON=function(e){return o(e,!0)},r.remove=function(t,s){i(t,"",e(s,{expires:-1}))},r.defaults={},r.withConverter=s,r}((function(){}))}))}));const fr=[{className:"screen-xs",maxWidth:599},{className:"screen-sm",maxWidth:1023},{className:"screen-md",maxWidth:1439},{className:"screen-lg",maxWidth:1999},{className:"screen-xl",maxWidth:void 0}];class br extends ur{constructor(e,t={}){t.watchResize=!0,super(e,t),t.widths?this.options.widths=t.widths:this.options.widths=fr,this.scale=void 0,this.disabled=!1,this.forceScale=void 0,this.orientation=void 0,this.widths=[],this.classes=[]}start(){super.start();let e=".show-hide{display:none;}\n";this.widths.push(0);for(let t=0;t<this.options.widths.length;t++)this.options.widths[t].maxWidth&&this.widths.push(this.options.widths[t].maxWidth),this.classes.push(this.options.widths[t].className),e+="."+this.options.widths[t].className+" .hidden-"+this.options.widths[t].className+"{display:none;}\n",e+=".not-"+this.options.widths[t].className+" .hidden-not-"+this.options.widths[t].className+"{display:none;}\n",e+="."+this.options.widths[t].className+" .shown-"+this.options.widths[t].className+"{display:block;}\n",e+=".not-"+this.options.widths[t].className+" .shown-not-"+this.options.widths[t].className+"{display:block;}\n";const t=document.createElement("style");t.type="text/css",t.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(t),this.detectGeometry()}didResize(){super.didResize(),this.detectGeometry()}disableResponsive(e){Me.addClass(document.body,"disable-responsive"),this.disabled=!0,this.forceScale=e,this.detectGeometry()}enableResponsive(){Me.removeClass(document.body,"disable-responsive"),this.disabled=!1,this.forceScale="",this.detectGeometry()}detectGeometry(){let e=this.classes[this.widths.length-1];if(this.disabled)e=this.forceScale;else{const t=window.innerWidth;if(window.innerHeight>t){if("portrait"!==this.orientation){const e=()=>{Me.removeClass(document.body,"landscape"),Me.addClass(document.body,"portrait")};this.queueFrame(e),this.orientation="portrait"}}else if("landscape"!==this.orientation){const e=()=>{Me.removeClass(document.body,"portrait"),Me.addClass(document.body,"landscape")};this.queueFrame(e),this.orientation="landscape"}for(let s=0;s<this.widths.length-1;s++)if(t>=this.widths[s]&&t<this.widths[s+1]){e=this.classes[s];break}}let t=0;if(e!==this.scale){++t;const s=()=>{for(let t=0;t<this.classes.length;t++)this.classes[t]!==e?(Me.addClass(document.body,"not-"+this.classes[t]),Me.removeClass(document.body,this.classes[t]),Me.removeClass(document.body,"shown-"+this.classes[t]),Me.removeClass(document.body,"hidden-"+this.classes[t])):Me.removeClass(document.body,"not-"+this.classes[t]);Me.addClass(document.body,e),Me.addClass(document.body,"shown-"+e),Me.addClass(document.body,"hidden-"+e),this.notifyAll("didBreakpoint",[e])};this.queueFrame(s)}this.scale=e,t&&this.setHints()}setHints(){let e="";this.scale&&(e&&(e+=" "),e+=this.scale),e!==this.getCookie("responsive")&&this.setCookie("responsive",e)}getCookie(e){return pr.get(e)}setCookie(e,t,s){const n={path:"/",domain:this.options.cookieDomain||null,expires:s};pr.set(e,t,n)}deleteCookie(e){this.setCookie(e,null)}}cr("Breakpoints",br);class mr extends ur{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],n=s.getAttribute("id");this.cachedMarkup[n]=s.innerHTML}super.start(),window.addEventListener("popstate",e=>{this.watchPopState(e)},!1)}DOMChanged(){super.DOMChanged(),this.hijaxLinks()}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],n=s.getAttribute("href");!n||s.getAttribute("data-hijaxed")||s.getAttribute("target")||s.hasAttribute("data-no-hijax")||this.excludeRegex.exec(n)||(s.setAttribute("data-hijaxed",!0),s.addEventListener("click",e=>{e.preventDefault(),this.setPage(n)},!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,n)=>{t&&(this.options.onError?this.options.onError("danger",t):alert("Error loading page: "+t)),s?this.currentPage=location.pathname+location.search:this.loadPage(n||e)})}loadPage(e){this.queueFrame(()=>{Me.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){fn.scrollTop(0),this.mergePage(t.responseText);const e=this.currentPage,s=()=>{this.notifyAll("newPage",[e,location.pathname+location.search]),Me.removeClass(document.body,"hijax-loading")};this.queueFrame(s),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),n=vr(s[2]),r=document.querySelectorAll("[data-hijax]");for(let e=0;e<r.length;e++){const t=r[e],s=t.getAttribute("id"),i=n.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 a=()=>{t.parentNode.replaceChild(i,t),this.options.onEnterPage&&this.options.onEnterPage(),this.hijaxLinks(i)};this.queueFrame(a)}}}cr("HijaxLoader",mr);const vr=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 gr=(e,t)=>{const s=e.startNode.parentNode,n=void 0===t?e.endNode:t.startNode,r=s.insertBefore(Ln(),n);s.insertBefore(Ln(),n);const i=new $n(e.options);return i.insertAfterNode(r),i},wr=(e,t)=>(e.setValue(t),e.commit(),e),yr=(e,t,s)=>{const n=e.startNode.parentNode,r=s?s.startNode:e.endNode,i=t.endNode.nextSibling;i!==r&&En(n,t.startNode,i,r)},_r=e=>{An(e.startNode.parentNode,e.startNode,e.endNode.nextSibling)},xr=(e,t,s)=>{const n=new Map;for(let r=t;r<=s;r++)n.set(e[r],r);return n},Or=new WeakMap,jr=new WeakMap,Er=xn((e,t,s)=>{let n;return void 0===s?s=t:void 0!==t&&(n=t),t=>{if(!(t instanceof $n))throw new Error("repeat can only be used in text bindings");const r=Or.get(t)||[],i=jr.get(t)||[],o=[],a=[],c=[];let l,u,h=0;for(const t of e)c[h]=n?n(t,h):h,a[h]=s(t,h),h++;let d=0,p=r.length-1,f=0,b=a.length-1;for(;d<=p&&f<=b;)if(null===r[d])d++;else if(null===r[p])p--;else if(i[d]===c[f])o[f]=wr(r[d],a[f]),d++,f++;else if(i[p]===c[b])o[b]=wr(r[p],a[b]),p--,b--;else if(i[d]===c[b])o[b]=wr(r[d],a[b]),yr(t,r[d],o[b+1]),d++,b--;else if(i[p]===c[f])o[f]=wr(r[p],a[f]),yr(t,r[p],r[d]),p--,f++;else if(void 0===l&&(l=xr(c,f,b),u=xr(i,d,p)),l.has(i[d]))if(l.has(i[p])){const e=u.get(c[f]),s=void 0!==e?r[e]:null;if(null===s){const e=gr(t,r[d]);wr(e,a[f]),o[f]=e}else o[f]=wr(s,a[f]),yr(t,s,r[d]),r[e]=null;f++}else _r(r[p]),p--;else _r(r[d]),d++;for(;f<=b;){const e=gr(t,o[b+1]);wr(e,a[f]),o[f++]=e}for(;d<=p;){const e=r[d++];null!==e&&_r(e)}Or.set(t,o),jr.set(t,c)}}),Ar=new WeakMap,kr=xn(e=>t=>{if(!(t instanceof $n))throw new Error("cache can only be used in text bindings");let s=Ar.get(t);void 0===s&&(s=new WeakMap,Ar.set(t,s));const n=t.value;if(n instanceof zn){if(e instanceof Hn&&n.template===t.options.templateFactory(e))return void t.setValue(e);{let e=s.get(n.template);void 0===e&&(e={instance:n,nodes:document.createDocumentFragment()},s.set(n.template,e)),En(e.nodes,t.startNode.nextSibling,t.endNode)}}if(e instanceof Hn){const n=t.options.templateFactory(e),r=s.get(n);void 0!==r&&(t.setValue(r.nodes),t.commit(),t.value=r.instance)}t.setValue(e)});class Sr{constructor(e){this.classes=new Set,this.changed=!1,this.element=e;const t=(e.getAttribute("class")||"").split(/\s+/);for(const e of t)this.classes.add(e)}add(e){this.classes.add(e),this.changed=!0}remove(e){this.classes.delete(e),this.changed=!0}commit(){if(this.changed){let e="";this.classes.forEach(t=>e+=t+" "),this.element.setAttribute("class",e)}}}const Nr=new WeakMap,Cr=xn(e=>t=>{if(!(t instanceof Un)||t instanceof Zn||"class"!==t.committer.name||t.committer.parts.length>1)throw new Error("The `classMap` directive must be used in the `class` attribute and must be the only part in the attribute.");const{committer:s}=t,{element:n}=s;let r=Nr.get(t);void 0===r&&(n.setAttribute("class",s.strings.join(" ")),Nr.set(t,r=new Set));const i=n.classList||new Sr(n);r.forEach(t=>{t in e||(i.remove(t),r.delete(t))});for(const t in e){const s=e[t];s!=r.has(t)&&(s?(i.add(t),r.add(t)):(i.remove(t),r.delete(t)))}"function"==typeof i.commit&&i.commit()}),Mr=new WeakMap,Tr=xn(e=>t=>{const s=Mr.get(t);if(void 0===e&&t instanceof Un){if(void 0!==s||!Mr.has(t)){const e=t.committer.name;t.committer.element.removeAttribute(e)}}else e!==s&&t.setValue(e);Mr.set(t,e)}),Vr=new WeakMap,Rr=xn((e,t)=>s=>{const n=Vr.get(s);if(Array.isArray(e)){if(Array.isArray(n)&&n.length===e.length&&e.every((e,t)=>e===n[t]))return}else if(n===e&&(void 0!==e||Vr.has(s)))return;s.setValue(t()),Vr.set(s,Array.isArray(e)?Array.from(e):e)}),Fr=new WeakMap,Lr=xn(e=>t=>{if(!(t instanceof Un)||t instanceof Zn||"style"!==t.committer.name||t.committer.parts.length>1)throw new Error("The `styleMap` directive must be used in the style attribute and must be the only part in the attribute.");const{committer:s}=t,{style:n}=s.element;let r=Fr.get(t);void 0===r&&(n.cssText=s.strings.join(" "),Fr.set(t,r=new Set)),r.forEach(t=>{t in e||(r.delete(t),-1===t.indexOf("-")?n[t]=null:n.removeProperty(t))});for(const t in e)r.add(t),-1===t.indexOf("-")?n[t]=e[t]:n.setProperty(t,e[t])}),Pr=new WeakMap,zr=xn(e=>t=>{if(!(t instanceof $n))throw new Error("templateContent can only be used in text bindings");const s=Pr.get(t);if(void 0!==s&&e===s.template&&t.value===s.fragment)return;const n=document.importNode(e.content,!0);t.setValue(n),Pr.set(t,{template:e,fragment:n})}),Dr=new WeakMap,Wr=xn(e=>t=>{if(!(t instanceof $n))throw new Error("unsafeHTML can only be used in text bindings");const s=Dr.get(t);if(void 0!==s&&In(e)&&e===s.value&&t.value===s.fragment)return;const n=document.createElement("template");n.innerHTML=e;const r=document.importNode(n.content,!0);t.setValue(r),Dr.set(t,{value:e,fragment:r})}),Hr=new WeakMap,Ir=2147483647,Br=xn((...e)=>t=>{let s=Hr.get(t);void 0===s&&(s={lastRenderedIndex:Ir,values:[]},Hr.set(t,s));const n=s.values;let r=n.length;s.values=e;for(let i=0;i<e.length&&!(i>s.lastRenderedIndex);i++){const o=e[i];if(In(o)||"function"!=typeof o.then){t.setValue(o),s.lastRenderedIndex=i;break}i<r&&o===n[i]||(s.lastRenderedIndex=Ir,r=0,Promise.resolve(o).then(e=>{const n=s.values.indexOf(o);n>-1&&n<s.lastRenderedIndex&&(s.lastRenderedIndex=n,t.setValue(e),t.commit())}))}}),qr={registerSargassoClass:cr,bootSargasso:(t={})=>{if(t.scrollElement&&fn.setOptions(t),t.breakpoints){new br(document.body,t.breakpoints).start()}if(t.hijax){const s=new mr(document.body,t.hijax);s.start(),e.loadPageHandler=s.setPage.bind(s)}else e.loadPageHandler=e=>{document.location.href=e};new dr(document.body,t).start(t)},elementTools:Me},Ur={theDOMWatcher:pn,theScrollWatcher:fn,theResizeWatcher:bn,theOrientationWatcher:mn,theWorkerWatcher:vn,theObservableObjectWatcher:gn},$r={html:(e,...t)=>new Hn(e,t,"html",Xn),render:nr,repeat:Er,cache:kr,classMap:Cr,ifDefined:Tr,guard:Rr,styleMap:Lr,templateContent:zr,unsafeHTML:Wr,until:Br};return e.ObservableObject=dn,e.Sargasso=ur,e.lit=$r,e.services=Ur,e.utils=qr,Object.defineProperty(e,"__esModule",{value:!0}),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:{};function r(e){var t={exports:{}};return e(t,t.exports),t.exports}var s="object"==typeof t&&t&&t.Object===Object&&t,n="object"==typeof self&&self&&self.Object===Object&&self,i=s||n||Function("return this")(),o=i.Symbol;var a=function(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,u=Object.prototype,l=u.hasOwnProperty,h=u.toString,d=o?o.toStringTag:void 0;var f=function(e){var t=l.call(e,d),r=e[d];try{e[d]=void 0;var s=!0}catch(e){}var n=h.call(e);return s&&(t?e[d]=r:delete e[d]),n},p=Object.prototype.toString;var b=function(e){return p.call(e)},v=o?o.toStringTag:void 0;var g=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":v&&v in Object(e)?f(e):b(e)};var m=function(e){return null!=e&&"object"==typeof e};var w=function(e){return"symbol"==typeof e||m(e)&&"[object Symbol]"==g(e)},y=o?o.prototype:void 0,O=y?y.toString:void 0;var x=function e(t){if("string"==typeof t)return t;if(c(t))return a(t,e)+"";if(w(t))return O?O.call(t):"";var r=t+"";return"0"==r&&1/t==-Infinity?"-0":r};var j=function(e){return null==e?"":x(e)};var _=function(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 E=function(e,t,r){var s=e.length;return r=void 0===r?s:r,!t&&r>=s?e:_(e,t,r)},k=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");var A=function(e){return k.test(e)};var S=function(e){return e.split("")},C="[\\ud800-\\udfff]",R="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",M="\\ud83c[\\udffb-\\udfff]",z="[^\\ud800-\\udfff]",F="(?:\\ud83c[\\udde6-\\uddff]){2}",P="[\\ud800-\\udbff][\\udc00-\\udfff]",D="(?:"+R+"|"+M+")"+"?",L="[\\ufe0e\\ufe0f]?",T=L+D+("(?:\\u200d(?:"+[z,F,P].join("|")+")"+L+D+")*"),N="(?:"+[z+R+"?",R,F,P,C].join("|")+")",H=RegExp(M+"(?="+M+")|"+N+T,"g");var V=function(e){return e.match(H)||[]};var I=function(e){return A(e)?V(e):S(e)};var W=function(e){return function(t){t=j(t);var r=A(t)?I(t):void 0,s=r?r[0]:t.charAt(0),n=r?E(r,1).join(""):t.slice(1);return s[e]()+n}}("toUpperCase");var q=function(e){return W(j(e).toLowerCase())};var U=function(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 B=function(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"}),Q=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,$=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");var G=function(e){return(e=j(e))&&e.replace(Q,B).replace($,"")},Z=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var J=function(e){return e.match(Z)||[]},Y=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var K=function(e){return Y.test(e)},X="\\u2700-\\u27bf",ee="a-z\\xdf-\\xf6\\xf8-\\xff",te="A-Z\\xc0-\\xd6\\xd8-\\xde",re="\\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",se="["+re+"]",ne="\\d+",ie="[\\u2700-\\u27bf]",oe="["+ee+"]",ae="[^\\ud800-\\udfff"+re+ne+X+ee+te+"]",ce="(?:\\ud83c[\\udde6-\\uddff]){2}",ue="[\\ud800-\\udbff][\\udc00-\\udfff]",le="["+te+"]",he="(?:"+oe+"|"+ae+")",de="(?:"+le+"|"+ae+")",fe="(?:['’](?:d|ll|m|re|s|t|ve))?",pe="(?:['’](?:D|LL|M|RE|S|T|VE))?",be="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",ve="[\\ufe0e\\ufe0f]?",ge=ve+be+("(?:\\u200d(?:"+["[^\\ud800-\\udfff]",ce,ue].join("|")+")"+ve+be+")*"),me="(?:"+[ie,ce,ue].join("|")+")"+ge,we=RegExp([le+"?"+oe+"+"+fe+"(?="+[se,le,"$"].join("|")+")",de+"+"+pe+"(?="+[se,le+he,"$"].join("|")+")",le+"?"+he+"+"+fe,le+"+"+pe,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ne,me].join("|"),"g");var ye=function(e){return e.match(we)||[]};var Oe=function(e,t,r){return e=j(e),void 0===(t=r?void 0:t)?K(e)?ye(e):J(e):e.match(t)||[]},xe=RegExp("['’]","g");var je=function(e){return function(t){return U(Oe(G(t).replace(xe,"")),e,"")}},_e=je((function(e,t,r){return t=t.toLowerCase(),e+(r?q(t):t)}));const Ee=new WeakMap,ke=e=>!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length),Ae=(e,t,r)=>{const s=Ee.get(e)||{};r?s[t]=r:delete s[t],Ee.set(e,s)},Se=(e,t)=>(Ee.get(e)||{})[t],Ce=function(e,t,r,s,n,i,o){"function"==typeof s&&(o=i,i=n,n=s,s=null);const a="on:"+e+"-"+r+"-"+s;if(Se(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,fn:i=>{o&&Re(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};Ae(t,a,c),r.split(/[\s,]+/).forEach(e=>{t.addEventListener(e.trim(),c.fn,c.options)})},Re=function(e,t,r,s){const n="on:"+e+"-"+r+"-"+s,i=Se(t,n);i&&(r.split(/[\s,]+/).forEach(e=>{t.removeEventListener(e.trim(),i.fn,i.options)}),Ae(t,n))},Me={hasClass:(e,t)=>-1!==(e.className||"").split(/\s+/).indexOf(t),addClass:(e,t)=>{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)=>{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:ke,inViewPort:(e,t=window)=>{const r=e.getBoundingClientRect(),s=ke(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)=>{for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)){const s=_e(r);e.style[s]=t[r]}},setMetaData:Ae,getMetaData:Se,on:Ce,off:Re,once:function(e,t,r,s,n,i){Ce(e,t,r,s,n,i,!0)},offAll:function(e){const t=Ee.get(e)||{},r=[];for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&e.match(/^on:/)&&r.push(e);r.forEach(r=>{Re(t[r].uid,e,t[r].events,t[r].selector)})}};var ze=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},Fe=function(){return i.Date.now()},Pe=/\s/;var De=function(e){for(var t=e.length;t--&&Pe.test(e.charAt(t)););return t},Le=/^\s+/;var Te=function(e){return e?e.slice(0,De(e)+1).replace(Le,""):e},Ne=/^[-+]0x[0-9a-f]+$/i,He=/^0b[01]+$/i,Ve=/^0o[0-7]+$/i,Ie=parseInt;var We=function(e){if("number"==typeof e)return e;if(w(e))return NaN;if(ze(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=ze(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Te(e);var r=He.test(e);return r||Ve.test(e)?Ie(e.slice(2),r?2:8):Ne.test(e)?NaN:+e},qe=Math.max,Ue=Math.min;var Be=function(e,t,r){var s,n,i,o,a,c,u=0,l=!1,h=!1,d=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function f(t){var r=s,i=n;return s=n=void 0,u=t,o=e.apply(i,r)}function p(e){return u=e,a=setTimeout(v,t),l?f(e):o}function b(e){var r=e-c;return void 0===c||r>=t||r<0||h&&e-u>=i}function v(){var e=Fe();if(b(e))return g(e);a=setTimeout(v,function(e){var r=t-(e-c);return h?Ue(r,i-(e-u)):r}(e))}function g(e){return a=void 0,d&&s?f(e):(s=n=void 0,o)}function m(){var e=Fe(),r=b(e);if(s=arguments,n=this,c=e,r){if(void 0===a)return p(c);if(h)return clearTimeout(a),a=setTimeout(v,t),f(c)}return void 0===a&&(a=setTimeout(v,t)),o}return t=We(t)||0,ze(r)&&(l=!!r.leading,i=(h="maxWait"in r)?qe(We(r.maxWait)||0,t):i,d="trailing"in r?!!r.trailing:d),m.cancel=function(){void 0!==a&&clearTimeout(a),u=0,s=c=n=a=void 0},m.flush=function(){return void 0===a?o:g(Fe())},m};var Qe=function(){this.__data__=[],this.size=0};var $e=function(e,t){return e===t||e!=e&&t!=t};var Ge=function(e,t){for(var r=e.length;r--;)if($e(e[r][0],t))return r;return-1},Ze=Array.prototype.splice;var Je=function(e){var t=this.__data__,r=Ge(t,e);return!(r<0)&&(r==t.length-1?t.pop():Ze.call(t,r,1),--this.size,!0)};var Ye=function(e){var t=this.__data__,r=Ge(t,e);return r<0?void 0:t[r][1]};var Ke=function(e){return Ge(this.__data__,e)>-1};var Xe=function(e,t){var r=this.__data__,s=Ge(r,e);return s<0?(++this.size,r.push([e,t])):r[s][1]=t,this};function et(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])}}et.prototype.clear=Qe,et.prototype.delete=Je,et.prototype.get=Ye,et.prototype.has=Ke,et.prototype.set=Xe;var tt=et;var rt=function(){this.__data__=new tt,this.size=0};var st=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r};var nt=function(e){return this.__data__.get(e)};var it=function(e){return this.__data__.has(e)};var ot,at=function(e){if(!ze(e))return!1;var t=g(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},ct=i["__core-js_shared__"],ut=(ot=/[^.]+$/.exec(ct&&ct.keys&&ct.keys.IE_PROTO||""))?"Symbol(src)_1."+ot:"";var lt=function(e){return!!ut&&ut in e},ht=Function.prototype.toString;var dt=function(e){if(null!=e){try{return ht.call(e)}catch(e){}try{return e+""}catch(e){}}return""},ft=/^\[object .+?Constructor\]$/,pt=Function.prototype,bt=Object.prototype,vt=pt.toString,gt=bt.hasOwnProperty,mt=RegExp("^"+vt.call(gt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var wt=function(e){return!(!ze(e)||lt(e))&&(at(e)?mt:ft).test(dt(e))};var yt=function(e,t){return null==e?void 0:e[t]};var Ot=function(e,t){var r=yt(e,t);return wt(r)?r:void 0},xt=Ot(i,"Map"),jt=Ot(Object,"create");var _t=function(){this.__data__=jt?jt(null):{},this.size=0};var Et=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},kt=Object.prototype.hasOwnProperty;var At=function(e){var t=this.__data__;if(jt){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return kt.call(t,e)?t[e]:void 0},St=Object.prototype.hasOwnProperty;var Ct=function(e){var t=this.__data__;return jt?void 0!==t[e]:St.call(t,e)};var Rt=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=jt&&void 0===t?"__lodash_hash_undefined__":t,this};function Mt(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])}}Mt.prototype.clear=_t,Mt.prototype.delete=Et,Mt.prototype.get=At,Mt.prototype.has=Ct,Mt.prototype.set=Rt;var zt=Mt;var Ft=function(){this.size=0,this.__data__={hash:new zt,map:new(xt||tt),string:new zt}};var Pt=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var Dt=function(e,t){var r=e.__data__;return Pt(t)?r["string"==typeof t?"string":"hash"]:r.map};var Lt=function(e){var t=Dt(this,e).delete(e);return this.size-=t?1:0,t};var Tt=function(e){return Dt(this,e).get(e)};var Nt=function(e){return Dt(this,e).has(e)};var Ht=function(e,t){var r=Dt(this,e),s=r.size;return r.set(e,t),this.size+=r.size==s?0:1,this};function Vt(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])}}Vt.prototype.clear=Ft,Vt.prototype.delete=Lt,Vt.prototype.get=Tt,Vt.prototype.has=Nt,Vt.prototype.set=Ht;var It=Vt;var Wt=function(e,t){var r=this.__data__;if(r instanceof tt){var s=r.__data__;if(!xt||s.length<199)return s.push([e,t]),this.size=++r.size,this;r=this.__data__=new It(s)}return r.set(e,t),this.size=r.size,this};function qt(e){var t=this.__data__=new tt(e);this.size=t.size}qt.prototype.clear=rt,qt.prototype.delete=st,qt.prototype.get=nt,qt.prototype.has=it,qt.prototype.set=Wt;var Ut=qt;var Bt=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this};var Qt=function(e){return this.__data__.has(e)};function $t(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new It;++t<r;)this.add(e[t])}$t.prototype.add=$t.prototype.push=Bt,$t.prototype.has=Qt;var Gt=$t;var Zt=function(e,t){for(var r=-1,s=null==e?0:e.length;++r<s;)if(t(e[r],r,e))return!0;return!1};var Jt=function(e,t){return e.has(t)};var Yt=function(e,t,r,s,n,i){var o=1&r,a=e.length,c=t.length;if(a!=c&&!(o&&c>a))return!1;var u=i.get(e),l=i.get(t);if(u&&l)return u==t&&l==e;var h=-1,d=!0,f=2&r?new Gt:void 0;for(i.set(e,t),i.set(t,e);++h<a;){var p=e[h],b=t[h];if(s)var v=o?s(b,p,h,t,e,i):s(p,b,h,e,t,i);if(void 0!==v){if(v)continue;d=!1;break}if(f){if(!Zt(t,(function(e,t){if(!Jt(f,t)&&(p===e||n(p,e,r,s,i)))return f.push(t)}))){d=!1;break}}else if(p!==b&&!n(p,b,r,s,i)){d=!1;break}}return i.delete(e),i.delete(t),d},Kt=i.Uint8Array;var Xt=function(e){var t=-1,r=Array(e.size);return e.forEach((function(e,s){r[++t]=[s,e]})),r};var er=function(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r},tr=o?o.prototype:void 0,rr=tr?tr.valueOf:void 0;var sr=function(e,t,r,s,n,i,o){switch(r){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!i(new Kt(e),new Kt(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return $e(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var a=Xt;case"[object Set]":var c=1&s;if(a||(a=er),e.size!=t.size&&!c)return!1;var u=o.get(e);if(u)return u==t;s|=2,o.set(e,t);var l=Yt(a(e),a(t),s,n,i,o);return o.delete(e),l;case"[object Symbol]":if(rr)return rr.call(e)==rr.call(t)}return!1};var nr=function(e,t){for(var r=-1,s=t.length,n=e.length;++r<s;)e[n+r]=t[r];return e};var ir=function(e,t,r){var s=t(e);return c(e)?s:nr(s,r(e))};var or=function(e,t){for(var r=-1,s=null==e?0:e.length,n=0,i=[];++r<s;){var o=e[r];t(o,r,e)&&(i[n++]=o)}return i};var ar=function(){return[]},cr=Object.prototype.propertyIsEnumerable,ur=Object.getOwnPropertySymbols,lr=ur?function(e){return null==e?[]:(e=Object(e),or(ur(e),(function(t){return cr.call(e,t)})))}:ar;var hr=function(e,t){for(var r=-1,s=Array(e);++r<e;)s[r]=t(r);return s};var dr=function(e){return m(e)&&"[object Arguments]"==g(e)},fr=Object.prototype,pr=fr.hasOwnProperty,br=fr.propertyIsEnumerable,vr=dr(function(){return arguments}())?dr:function(e){return m(e)&&pr.call(e,"callee")&&!br.call(e,"callee")};var gr=function(){return!1},mr=r((function(e,t){var r=t&&!t.nodeType&&t,s=r&&e&&!e.nodeType&&e,n=s&&s.exports===r?i.Buffer:void 0,o=(n?n.isBuffer:void 0)||gr;e.exports=o})),wr=/^(?:0|[1-9]\d*)$/;var yr=function(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&wr.test(e))&&e>-1&&e%1==0&&e<t};var Or=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},xr={};xr["[object Float32Array]"]=xr["[object Float64Array]"]=xr["[object Int8Array]"]=xr["[object Int16Array]"]=xr["[object Int32Array]"]=xr["[object Uint8Array]"]=xr["[object Uint8ClampedArray]"]=xr["[object Uint16Array]"]=xr["[object Uint32Array]"]=!0,xr["[object Arguments]"]=xr["[object Array]"]=xr["[object ArrayBuffer]"]=xr["[object Boolean]"]=xr["[object DataView]"]=xr["[object Date]"]=xr["[object Error]"]=xr["[object Function]"]=xr["[object Map]"]=xr["[object Number]"]=xr["[object Object]"]=xr["[object RegExp]"]=xr["[object Set]"]=xr["[object String]"]=xr["[object WeakMap]"]=!1;var jr=function(e){return m(e)&&Or(e.length)&&!!xr[g(e)]};var _r=function(e){return function(t){return e(t)}},Er=r((function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,i=n&&n.exports===r&&s.process,o=function(){try{var e=n&&n.require&&n.require("util").types;return e||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=o})),kr=Er&&Er.isTypedArray,Ar=kr?_r(kr):jr,Sr=Object.prototype.hasOwnProperty;var Cr=function(e,t){var r=c(e),s=!r&&vr(e),n=!r&&!s&&mr(e),i=!r&&!s&&!n&&Ar(e),o=r||s||n||i,a=o?hr(e.length,String):[],u=a.length;for(var l in e)!t&&!Sr.call(e,l)||o&&("length"==l||n&&("offset"==l||"parent"==l)||i&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||yr(l,u))||a.push(l);return a},Rr=Object.prototype;var Mr=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Rr)};var zr=function(e,t){return function(r){return e(t(r))}}(Object.keys,Object),Fr=Object.prototype.hasOwnProperty;var Pr=function(e){if(!Mr(e))return zr(e);var t=[];for(var r in Object(e))Fr.call(e,r)&&"constructor"!=r&&t.push(r);return t};var Dr=function(e){return null!=e&&Or(e.length)&&!at(e)};var Lr=function(e){return Dr(e)?Cr(e):Pr(e)};var Tr=function(e){return ir(e,Lr,lr)},Nr=Object.prototype.hasOwnProperty;var Hr=function(e,t,r,s,n,i){var o=1&r,a=Tr(e),c=a.length;if(c!=Tr(t).length&&!o)return!1;for(var u=c;u--;){var l=a[u];if(!(o?l in t:Nr.call(t,l)))return!1}var h=i.get(e),d=i.get(t);if(h&&d)return h==t&&d==e;var f=!0;i.set(e,t),i.set(t,e);for(var p=o;++u<c;){var b=e[l=a[u]],v=t[l];if(s)var g=o?s(v,b,l,t,e,i):s(b,v,l,e,t,i);if(!(void 0===g?b===v||n(b,v,r,s,i):g)){f=!1;break}p||(p="constructor"==l)}if(f&&!p){var m=e.constructor,w=t.constructor;m==w||!("constructor"in e)||!("constructor"in t)||"function"==typeof m&&m instanceof m&&"function"==typeof w&&w instanceof w||(f=!1)}return i.delete(e),i.delete(t),f},Vr=Ot(i,"DataView"),Ir=Ot(i,"Promise"),Wr=Ot(i,"Set"),qr=Ot(i,"WeakMap"),Ur="[object Map]",Br="[object Promise]",Qr="[object Set]",$r="[object WeakMap]",Gr="[object DataView]",Zr=dt(Vr),Jr=dt(xt),Yr=dt(Ir),Kr=dt(Wr),Xr=dt(qr),es=g;(Vr&&es(new Vr(new ArrayBuffer(1)))!=Gr||xt&&es(new xt)!=Ur||Ir&&es(Ir.resolve())!=Br||Wr&&es(new Wr)!=Qr||qr&&es(new qr)!=$r)&&(es=function(e){var t=g(e),r="[object Object]"==t?e.constructor:void 0,s=r?dt(r):"";if(s)switch(s){case Zr:return Gr;case Jr:return Ur;case Yr:return Br;case Kr:return Qr;case Xr:return $r}return t});var ts=es,rs="[object Arguments]",ss="[object Array]",ns="[object Object]",is=Object.prototype.hasOwnProperty;var os=function(e,t,r,s,n,i){var o=c(e),a=c(t),u=o?ss:ts(e),l=a?ss:ts(t),h=(u=u==rs?ns:u)==ns,d=(l=l==rs?ns:l)==ns,f=u==l;if(f&&mr(e)){if(!mr(t))return!1;o=!0,h=!1}if(f&&!h)return i||(i=new Ut),o||Ar(e)?Yt(e,t,r,s,n,i):sr(e,t,u,r,s,n,i);if(!(1&r)){var p=h&&is.call(e,"__wrapped__"),b=d&&is.call(t,"__wrapped__");if(p||b){var v=p?e.value():e,g=b?t.value():t;return i||(i=new Ut),n(v,g,r,s,i)}}return!!f&&(i||(i=new Ut),Hr(e,t,r,s,n,i))};var as=function e(t,r,s,n,i){return t===r||(null==t||null==r||!m(t)&&!m(r)?t!=t&&r!=r:os(t,r,s,n,e,i))};var cs=function(e,t){return as(e,t)};const us={},ls=e=>({get(t,r){const s=Reflect.get(t,r);return s&&"object"==typeof s?new Proxy(s,ls(e)):s},set:(t,r,s)=>(e.sync(r),Reflect.set(t,r,s)),deleteProperty:(t,r)=>(e.sync(r),Reflect.deleteProperty(t,r))});class hs{constructor(e,t={},r={}){if(this.id=e,us[this.id])throw new Error("ObservableObject "+e+" already exists.");this.bound={},this.data=new Proxy(t,ls(this)),this.options=r,us[this.id]=this}destroy(){delete us[this.id],delete this.data,Object.keys(this.bound).forEach(e=>{Object.keys(this.bound[e]).forEach(t=>{this.unbind(e,t)})})}getBoundData(){return this.data}set(e,t){cs(this.get(e),t)||(this.data[e]=t)}get(e){return this.data[e]}delete(e){delete this.data[e]}syncAll(){Object.keys(this.data||{}).forEach(e=>{this.sync(e)})}bind(e,t,r="*"){this.bound[r]||(this.bound[r]={}),this.bound[r][e]=t,Object.keys(this.data).forEach(e=>{t(this.id,e,this.get(e))})}unbind(e,t="*"){this.bound[t][e]&&delete this.bound[t][e]}observers(){let e=0;for(const t in this.bound)this.bound.hasOwnProperty(t)&&e++;return e}sync(e){Object.keys(this.bound["*"]||{}).forEach(t=>{this.bound["*"][t](this.id,e,this.get(e))}),Object.keys(this.bound[e]||{}).forEach(t=>{this.bound[e][t](this.id,e,this.get(e))})}}let ds,fs,ps,bs,vs,gs;class ms{constructor(e){this.options=e,this.observers=[],this.pendingAnimationFrame=void 0,this.frameQueue=[]}subscribe(e){this.observers.length||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(){}wakeup(){}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]()}}ds=new class extends ms{constructor(e){super(e),this.mutationHandler=Be((e,t)=>{this.observeDOM(e,t)},100,{maxWait:250}),this.mutationObserver=new MutationObserver(this.mutationHandler,!1)}subscribe(e){super.subscribe(e),e.watchDOM()}wakeup(){super.wakeup(),this.mutationObserver.observe(document.body,{childList:!0,subtree:!0})}sleep(){super.sleep(),this.mutationObserver.disconnect()}observeDOM(){this.notifyObservers("watchDOM")}},fs=new class extends ms{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 e=()=>{this.scrollLoop()};this.queueFrame(e)}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(),Me.on("theScrollWatcher",this.scrollElement,"scroll",()=>{this.trigger()})}sleep(){super.sleep(),Me.off("theScrollWatcher",this.scrollElement,"scroll")}inViewPort(e){return Me.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}}},ps=new class extends ms{constructor(e){super(e),this.debounce=Be(()=>{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")}},bs=new class extends ms{constructor(e){super(e),"onorientationchange"in window?Me.addClass(document.body,"have-orientation"):Me.addClass(document.body,"no-orientation"),this.debounce=Be(()=>{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")}},vs=new class extends ms{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()}},gs=new class extends ms{constructor(e){super(e),this.registeredObservableObjects={}}getObservable(e){return this.registeredObservableObjects[e]?this.registeredObservableObjects[e].observable:void 0}observableStart(e,t){const r=(e=>us[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 hs(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){if(!this.registeredObservableObjects[e])throw new Error("ObservableObject notify "+e+" does not exist");this.registeredObservableObjects[e].observers.forEach(n=>{n.observableChanged&&n.observableChanged(e,t,r,s)})}};var ws=je((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()}));let ys=0;const Os=[],xs="customElements"in window,js={},_s=(e,t)=>{if(js[e]=t,xs){const t=`\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.helper = null\n\t\t\t\t}\n\n\t\t\t\tconnectedCallback () {\n\t\t\t\t\tthis.helper = new registeredClasses[this.helperClass](this,{isCustomElement:true})\n\t\t\t\t\tthis.helper.start()\n\t\t\t\t}\n\n\t\t\t\tdisconnectedCallback () {\n\t\t\t\t\tthis.helper.destroy()\n\t\t\t\t\tthis.helper = null // nuke the reference for trash collection\n\t\t\t\t}\n\t\t\t}`;customElements.define("sargasso-"+ws(e),new Function("registeredClasses",t)(js))}},Es=["DOMChanged","didScroll","didResize","didBreakpoint","enterViewport","exitViewport","enterFullscreen","exitFullscreen","newPage","elementEvent"];class ks{constructor(e,t={}){this.uid=++ys,this.element=e,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=Be(()=>{this._render()},100,{maxWait:250})}start(){const e=this.getMetaData("registeredResponsiveControllers")||[];e.push(this),this.setMetaData("registeredResponsiveControllers",e),this.setMetaData(this.constructor.name,this),Os.push(this),this.options.watchDOM&&ds.subscribe(this),(this.options.watchScroll||this.options.watchViewport)&&fs.subscribe(this),(this.options.watchResize||this.options.watchViewport)&&ps.subscribe(this),(this.options.watchOrientation||this.options.watchViewport)&&bs.subscribe(this),this.elementListener=e=>{e.detail&&e.detail.sargassoEvent&&-1!==Es.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.options.watchDOM&&ds.unSubscribe(this),(this.options.watchScroll||this.options.watchViewport)&&fs.unSubscribe(this),(this.options.watchResize||this.options.watchViewport)&&ps.unSubscribe(this),(this.options.watchOrientation||this.options.watchViewport)&&bs.unSubscribe(this),this.element.removeEventListener("sargasso",this.elementListener),Me.offAll(this.element),this.started=!1}DOMChanged(){}didScroll(){}didResize(){}didBreakpoint(){}enterViewport(){}exitViewport(){}enterFullscreen(){}exitFullscreen(){}newPage(e,t){}elementEvent(e){}workerOnMessage(e,t){}observableChanged(e,t,r){this.render()}setMetaData(e,t){Me.setMetaData(this.element,e,t)}getMetaData(e){return Me.getMetaData(this.element,e)}on(e,t,r,s){Me.on(this.constructor.name+"-"+this.uid,this.element,e,t,r,s)}off(e,t){Me.off(this.constructor.name+"-"+this.uid,this.element,e,t)}once(e,t,r,s){Me.once(this.constructor.name+"-"+this.uid,this.element,e,t,r,s)}notifyAll(e,t){if(-1===Es.indexOf(e))throw new Error("invalid event name "+e);for(let r=0;r<Os.length;r++){const s=Os[r];s!==this&&s[e]&&s[e].apply(s,t)}}notifyElement(e,t,r){if(-1===Es.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 Me.hasClass(this.element,e)}addClass(e){Me.addClass(this.element,e)}removeClass(e){Me.removeClass(this.element,e)}setCSS(e){Me.setCSS(this.element,e)}isVisible(){return Me.isVisible(this.element)}workerStart(e,t){return this.workers[e]=vs.registerWorker(e,t),vs.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]}observableStart(e,t){return gs.subscribe(this,e,t),this.observables[e]=gs.getObservable(e),this.observables[e]}observableStop(e){this.observables[e]&&(gs.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.constructor&&"ObservableObject"===e.constructor.name?e.data:e,this.render()}getTemplateArgs(){return JSON.parse(JSON.stringify(this.templateArgs||{}))}_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]&&(vs.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!==Os.indexOf(this)&&Os.splice(Os.indexOf(this),1)}watchDOM(){this.DOMChanged()}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(){fs.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()}}_s("Sargasso",ks);class As extends ks{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(){super.DOMChanged(),this.lazyHandler()}lazyHandler(){const e=document.querySelectorAll("[data-lazy-sargasso-class]");for(let t=0;t<e.length;t++){const r=e[t];if(fs.inViewPort(r)){const s=r.getAttribute("data-lazy-sargasso-class").split(/\s*,\s*/);for(let r=0;r<s.length;r++){new js[s[r]](e[t]).start()}r.removeAttribute("data-lazy-sargasso-class")}}}}_s("LazyInstantiate",As);class Ss extends ks{constructor(e,t={}){super(e,{watchDOM:!0,mortal:!1}),this.lazy=new As(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 js[t[r]](e).start()}catch(e){console.log("error instantiating "+t[r],e,js)}e.removeAttribute("data-sargasso-class")}newPage(){this.doIt()}DOMChanged(){this.doIt()}doIt(){const e=document.querySelectorAll("[data-sargasso-class]");for(const t of e)this.instantiate(t);const t=[];for(let e=0;e<Os.length;e++)Os[e].options.immortal||Os[e].options.isCustomElement||document.body.contains(Os[e].element)||t.push(Os[e]);for(let e=0;e<t.length;e++)t[e].destroy()}}_s("SargassoSupervisor",Ss);var Cs=r((function(e,t){!function(t){if(e.exports=t(),!!0){var r=window.Cookies,s=window.Cookies=t();s.noConflict=function(){return window.Cookies=r,s}}}((function(){function e(){for(var e=0,t={};e<arguments.length;e++){var r=arguments[e];for(var s in r)t[s]=r[s]}return t}function t(e){return e.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}return function r(s){function n(){}function i(t,r,i){if("undefined"!=typeof document){"number"==typeof(i=e({path:"/"},n.defaults,i)).expires&&(i.expires=new Date(1*new Date+864e5*i.expires)),i.expires=i.expires?i.expires.toUTCString():"";try{var o=JSON.stringify(r);/^[\{\[]/.test(o)&&(r=o)}catch(e){}r=s.write?s.write(r,t):encodeURIComponent(String(r)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=encodeURIComponent(String(t)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var a="";for(var c in i)i[c]&&(a+="; "+c,!0!==i[c]&&(a+="="+i[c].split(";")[0]));return document.cookie=t+"="+r+a}}function o(e,r){if("undefined"!=typeof document){for(var n={},i=document.cookie?document.cookie.split("; "):[],o=0;o<i.length;o++){var a=i[o].split("="),c=a.slice(1).join("=");r||'"'!==c.charAt(0)||(c=c.slice(1,-1));try{var u=t(a[0]);if(c=(s.read||s)(c,u)||t(c),r)try{c=JSON.parse(c)}catch(e){}if(n[u]=c,e===u)break}catch(e){}}return e?n[e]:n}}return n.set=i,n.get=function(e){return o(e,!1)},n.getJSON=function(e){return o(e,!0)},n.remove=function(t,r){i(t,"",e(r,{expires:-1}))},n.defaults={},n.withConverter=r,n}((function(){}))}))}));const Rs=[{className:"screen-xs",maxWidth:599},{className:"screen-sm",maxWidth:1023},{className:"screen-md",maxWidth:1439},{className:"screen-lg",maxWidth:1999},{className:"screen-xl",maxWidth:void 0}];class Ms extends ks{constructor(e,t={}){t.watchResize=!0,super(e,t),t.widths?this.options.widths=t.widths:this.options.widths=Rs,this.scale=void 0,this.disabled=!1,this.forceScale=void 0,this.orientation=void 0,this.widths=[],this.classes=[]}start(){super.start();let e=".show-hide{display:none;}\n";this.widths.push(0);for(let t=0;t<this.options.widths.length;t++)this.options.widths[t].maxWidth&&this.widths.push(this.options.widths[t].maxWidth),this.classes.push(this.options.widths[t].className),e+="."+this.options.widths[t].className+" .hidden-"+this.options.widths[t].className+"{display:none;}\n",e+=".not-"+this.options.widths[t].className+" .hidden-not-"+this.options.widths[t].className+"{display:none;}\n",e+="."+this.options.widths[t].className+" .shown-"+this.options.widths[t].className+"{display:block;}\n",e+=".not-"+this.options.widths[t].className+" .shown-not-"+this.options.widths[t].className+"{display:block;}\n";const t=document.createElement("style");t.type="text/css",t.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(t),this.detectGeometry()}didResize(){super.didResize(),this.detectGeometry()}disableResponsive(e){Me.addClass(document.body,"disable-responsive"),this.disabled=!0,this.forceScale=e,this.detectGeometry()}enableResponsive(){Me.removeClass(document.body,"disable-responsive"),this.disabled=!1,this.forceScale="",this.detectGeometry()}detectGeometry(){let e=this.classes[this.widths.length-1];if(this.disabled)e=this.forceScale;else{const t=window.innerWidth;if(window.innerHeight>t){if("portrait"!==this.orientation){const e=()=>{Me.removeClass(document.body,"landscape"),Me.addClass(document.body,"portrait")};this.queueFrame(e),this.orientation="portrait"}}else if("landscape"!==this.orientation){const e=()=>{Me.removeClass(document.body,"portrait"),Me.addClass(document.body,"landscape")};this.queueFrame(e),this.orientation="landscape"}for(let r=0;r<this.widths.length-1;r++)if(t>=this.widths[r]&&t<this.widths[r+1]){e=this.classes[r];break}}let t=0;if(e!==this.scale){++t;const r=()=>{for(let t=0;t<this.classes.length;t++)this.classes[t]!==e?(Me.addClass(document.body,"not-"+this.classes[t]),Me.removeClass(document.body,this.classes[t]),Me.removeClass(document.body,"shown-"+this.classes[t]),Me.removeClass(document.body,"hidden-"+this.classes[t])):Me.removeClass(document.body,"not-"+this.classes[t]);Me.addClass(document.body,e),Me.addClass(document.body,"shown-"+e),Me.addClass(document.body,"hidden-"+e),this.notifyAll("didBreakpoint",[e])};this.queueFrame(r)}this.scale=e,t&&this.setHints()}setHints(){let e="";this.scale&&(e&&(e+=" "),e+=this.scale),e!==this.getCookie("responsive")&&this.setCookie("responsive",e)}getCookie(e){return Cs.get(e)}setCookie(e,t,r){const s={path:"/",domain:this.options.cookieDomain||null,expires:r};Cs.set(e,t,s)}deleteCookie(e){this.setCookie(e,null)}}_s("Breakpoints",Ms);class zs extends ks{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(){super.DOMChanged(),this.hijaxLinks()}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(()=>{Me.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){fs.scrollTop(0),this.mergePage(t.responseText);const e=this.currentPage,r=()=>{this.notifyAll("newPage",[e,location.pathname+location.search]),Me.removeClass(document.body,"hijax-loading")};this.queueFrame(r),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=Fs(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 a=()=>{t.parentNode.replaceChild(i,t),this.options.onEnterPage&&this.options.onEnterPage(),this.hijaxLinks(i)};this.queueFrame(a)}}}_s("HijaxLoader",zs);const Fs=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 Ps={registerSargassoClass:_s,bootSargasso:(t={})=>{if(t.scrollElement&&fs.setOptions(t),t.breakpoints){new Ms(document.body,t.breakpoints).start()}if(t.hijax){const r=new zs(document.body,t.hijax);r.start(),e.loadPageHandler=r.setPage.bind(r)}else e.loadPageHandler=e=>{document.location.href=e};new Ss(document.body,t).start(t)},elementTools:Me},Ds={theDOMWatcher:ds,theScrollWatcher:fs,theResizeWatcher:ps,theOrientationWatcher:bs,theWorkerWatcher:vs,theObservableObjectWatcher:gs};return e.ObservableObject=hs,e.Sargasso=ks,e.services=Ds,e.utils=Ps,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
//# sourceMappingURL=sargasso.iife.min.js.map

@@ -37,44 +37,2 @@ /*

import {
html, render
}
from 'lit-html/lit-html.js'
import {
repeat
}
from 'lit-html/directives/repeat.js'
import {
cache
}
from 'lit-html/directives/cache.js'
import {
classMap
}
from 'lit-html/directives/class-map.js'
import {
ifDefined
}
from 'lit-html/directives/if-defined'
import {
guard
}
from 'lit-html/directives/guard'
import {
styleMap
}
from 'lit-html/directives/style-map.js'
import {
templateContent
}
from 'lit-html/directives/template-content'
import {
unsafeHTML
}
from 'lit-html/directives/unsafe-html.js'
import {
until
}
from 'lit-html/directives/until.js'
const utils = {

@@ -95,18 +53,4 @@ registerSargassoClass: registerSargassoClass,

const lit = {
html: html,
render: render,
repeat: repeat,
cache: cache,
classMap: classMap,
ifDefined: ifDefined,
guard: guard,
styleMap: styleMap,
templateContent: templateContent,
unsafeHTML: unsafeHTML,
until: until
}
export {
Sargasso, utils, loadPageHandler, services, ObservableObject, lit
Sargasso, utils, loadPageHandler, services, ObservableObject
}

@@ -27,7 +27,2 @@ /**

import {
render
}
from 'lit-html/lit-html.js'
let unique = 0 // unique IDs for controllers

@@ -523,2 +518,6 @@ const liveElements = [] // instantiated controllers

setRenderer (renderer) {
this.renderer = renderer
}
setTemplateArgs (args = {}) {

@@ -529,6 +528,10 @@ this.templateArgs = args.constructor && args.constructor.name === 'ObservableObject' ? args.data : args

getTemplateArgs () {
return JSON.parse(JSON.stringify(this.templateArgs || {}))
}
// this.render is a debounced call to this
_render () {
if (this.template) {
render(this.template(JSON.parse(JSON.stringify(this.templateArgs || {}))), this.element)
if (this.template && this.renderer) {
this.renderer(this.template(this.getTemplateArgs()), this.element)
}

@@ -535,0 +538,0 @@ }

{
"name": "@pelagiccreatures/sargasso",
"version": "1.4.1",
"version": "1.4.2",
"description": "Simple, Fast, Reactive, Supervised Javascript controllers for custom html elements.",

@@ -48,3 +48,2 @@ "keywords": [

"js-cookie": "^2.2.1",
"lit-html": "^1.3.0",
"lodash": "^4.17.21"

@@ -51,0 +50,0 @@ },

@@ -233,10 +233,2 @@ # @pelagiccreatures/sargasso

**Utility Methods:**
| method | description |
| ------ | ----------- |
| getMetaData(key) | return sargasso metadata associated with element (weak map) |
| setMetaData(key,value) | set a sargasso metadata property |
| isVisible() | true if element is visible |
| queueFrame(function) | queue a function to execute that changes the DOM |
**CSS Methods**

@@ -250,22 +242,2 @@ | method | description |

**Web Worker Methods**
| method | description |
| ------ | ----------- |
| workerStart(id, codeOrURL) | start a web worker with id. Ignored if worker id already installed. |
| workerPostMessage(id, data {}) | send the worker tagged with `id` a message. the message must be an object which can have any structure you want to pass to the worker |
**Observable Data Methods**
| method | description |
| ------ | ----------- |
| observableStart (id, data) | start watching for changes in observable data. `data` is an optional JS data object |
| observableStop (id) | stop watching for changes in observable data |
| getObservable (id) | get underlying ObservableObject instance for id |
**Templates & Rendering Methods**
| method | description |
| ------ | ----------- |
| setTemplate (template) | set a lit-html template function for rendering |
| setTemplateArgs (args) | set template arguments |
| render () | render template into element |
**Register Event Methods**

@@ -281,9 +253,12 @@ | method | description |

Don't forget you need to let sargasso know about your class:
```registerSargassoClass('MyClass', MyClass)```
**Utility Methods:**
| method | description |
| ------ | ----------- |
| getMetaData(key) | return sargasso metadata associated with element (weak map) |
| setMetaData(key,value) | set a sargasso metadata property |
| isVisible() | true if element is visible |
### Progressive Web App HIJAX Page Load
When HIJAX is enabled, Sargasso automatically captures `<a href="..">` tags and calls the LoadPageHandler instead of allowing the browser load and replace entire pages natively. Usually a web site or app has a boilerplate html wrapper that is the same for every page and well defined content areas that change from page to page. When pages are loaded via HIJAX only the changed content is merged with the current page, replacing elements marked with `data-hijax` leaving heavy weight wrapper elements, persistent javascript, css and sargasso elements intact. You can define as many dynamic elements in the wrapper as needed. Following this scheme allows for deep linking, and search engine discovery while also speeding page load for real browsers.
When HIJAX is enabled, Sargasso automatically captures `<a href="..">` tags and calls the LoadPageHandler instead of allowing the browser load and replace entire pages natively. Usually a web site or app has a boilerplate html wrapper that is the same for every page and well defined content areas that change from page to page. When pages are loaded via HIJAX only the changed content is merged with the current page, replacing containers marked with `data-hijax` leaving heavy weight wrapper elements, persistent javascript, css and sargasso elements intact. You can define as many dynamic elements in the wrapper as needed. Following this scheme allows for deep linking, and search engine discovery while also speeding page load for real browsers.

@@ -294,34 +269,13 @@ The Sargasso supervisor takes care of cleaning up any instantiated Sargasso element controllers in the old content by calling sleep() before the content is removed then sargasso elements in the new content are instantiated and start() is called. That way Sargasso element controllers can be cleanly managed on progressive web app pages without leaving dangling event handlers and memory leaks.

example/example3.html
```html
<!DOCTYPE html>
<html>
<head>
<title>Example Sargasso Element</title>
</head>
<body>
<p>This is static wrapper content which does not change from page to page because it's not in a hijaxed container.</p>
<p>this is static content like header and navigation</p>
<div id="navigation" data-hijax>
<strong><a href="example3.html">Home</a></strong> | <a href="example3-1.html">Page 1</a> | <a href="example3-2.html">Page 2</a>
<div id="content" data-hijax>
<p>This is dynamic - it changes from page to page</p>
</div>
<hr>
<div id="page-body" data-hijax>
<p>Page content for home page</p>
<sargasso-noisy id="content-home" data-log-it="newPage,sleep,stopWorker,destroy"></sargasso-noisy>
</div>
<p>this is also static content such as a site wide footer</p>
<div id="some-other-element" data-hijax>
<p>This content also changes from page to page.</p>
</div>
<hr>
<p>This is also static wrapper content. Maybe a footer.</p>
<sargasso-noisy id="static-home" data-log-it="newPage,sleep,stopWorker,destroy"></sargasso-noisy>
<script src='app-bundle.iife.js'></script>
<script src='https://cdn.jsdelivr.net/npm/@pelagiccreatures/sargasso/dist/sargasso.iife.min.js'></script>
<script defer>

@@ -336,12 +290,11 @@ window.onload = () => {

}
App.utils.bootSargasso(options)
SargassoModule.utils.bootSargasso(options)
}
</script>
</body>
</html>
```
[Try It](https://stackblitz.com/edit/web-platform-5g5tqc)
**Note**: Hijax pages must be served over http/https. In the example directory of this repository is a python script for a simple server. Run `python localhost.py` then connect using a web browser `http://localhost:8000/example3.html` This example has an instrumented Sargasso class which logs events to illustrate the object lifecycle as pages come and go.
**Note:** `data-hijax` elements must have and ID and contain well formed child html elements.
`data-hijax` elements must have and ID and contain well formed child html elements.
```html

@@ -353,5 +306,7 @@ <div id="nope" data-hijax>I'm just text. No child elements. Won't work.</div>

#### Programatic Page Loading
`loadPageHandler(href)` is the utility function for programmatically loading a new page. EG. instead of `location.href= '/home'`, use `LoadPageHandler('/home')` This can be called to reload the page as well.
`SargassoModule.loadPageHandler(href)` is the utility function for programmatically loading a new page. EG. instead of `location.href= '/home'`, use `LoadPageHandler('/home')` This can be called to reload the page as well.
#### Content Merging Fine Control
Set the `data-hijax-skip-unchanged` attribute on the hijax container and the content will remain static unless the markup is changed. This is useful if you have a Sargasso element that should remain instantiated and hold state when traversing several pages in a section.

@@ -375,2 +330,7 @@ ```html

| method | description |
| ------ | ----------- |
| queueFrame(function) | queue a function to execute that changes the DOM |
```javascript

@@ -388,2 +348,8 @@ this.queueFrame(()=>{

| method | description |
| ------ | ----------- |
| observableStart (id, data) | start watching for changes in observable data. `data` is an optional JS data object |
| observableStop (id) | stop watching for changes in observable data |
| getObservable (id) | get underlying ObservableObject instance for id |
```javascript

@@ -425,54 +391,89 @@ let args = {

### Observables, Templates and Rendering
Complete example of an element that renders on data update using an ObservableObject and li-html templates.
### Templates and Rendering
Complete example of an element that renders on data updates using an ObservableObject and li-html templates.
| method | description |
| ------ | ----------- |
| setRenderer (renderer) | set a rendering function for rendering (such as lit-html render) |
| setTemplate (template) | set a template function for rendering (such as a lit-html template function) |
| setTemplateArgs (args) | set template arguments |
| render () | render template into element |
examples/example5.html
```html
window.onload = () => {
<!DOCTYPE html>
<html>
<head>
<title>Example Sargasso Element w/Data Observing &amp; Template rendering</title>
<style>
.red { color: #f00; }
.green { color: #0f0; }
.blue { color: #00f; }
</style>
</head>
<body>
<h3>Example Sargasso Element w/Data Observing &amp; Template rendering</h3>
let args = {
name: 'World!',
cssClass: 'red',
list: [{id:1,name:'one'},{id:2,name:'two'},{id:3,name:'three'}]
}
let observed = new SargassoModule.ObservableObject('shared-data',args)
<sargasso-my-class></sargasso-my-class>
// define MyClass as a subclass of Sargasso
// sargasso will render the template when data in
// observed ObservableObject is changed
class MyClass extends SargassoModule.Sargasso {
start() {
super.start()
<script src="https://cdn.jsdelivr.net/npm/@pelagiccreatures/sargasso/dist/sargasso.iife.min.js"></script>
<script defer type="module">
import {
html,render
} from 'https://unpkg.com/lit-html?module'
// define a template
this.setTemplate((args) => SargassoModule.lit.html`
<p class=${args.cssClass}>Hello ${args.name} (${args.cssClass})</p>
<strong>List</strong>
<ul>
${SargassoModule.lit.repeat(args.list, (item) => item.id, (item, index) => SargassoModule.lit.html`
<li>${index}: ${item.name}</li>
`)}
</ul>
`)
import {
repeat
} from 'https://unpkg.com/lit-html/directives/repeat.js?module'
// hook up observable data
this.setTemplateArgs(this.observableStart('shared-data'))
}
}
window.onload = () => {
// Register MyClass to the Sargasso framework
SargassoModule.utils.registerSargassoClass('MyClass', MyClass)
let args = {
name: 'World!',
cssClass: 'red',
list: [{id:1,name:'one'},{id:2,name:'two'},{id:3,name:'three'}]
}
let observed = new SargassoModule.ObservableObject('shared-data',args)
// Start Sargasso
SargassoModule.utils.bootSargasso()
// define MyClass as a subclass of Sargasso
// sargasso will render the template when data in
// observed ObservableObject is changed
class MyClass extends SargassoModule.Sargasso {
start() {
super.start()
// define a template
this.setRenderer(render)
this.setTemplate((args) => html`
<p class=${args.cssClass}>Hello ${args.name} (${args.cssClass})</p>
<strong>List</strong>
<ul>
${repeat(args.list, (item) => item.id, (item, index) => html`
<li>${index}: ${item.name}</li>
`)}
</ul>
`)
// repeatedly and randomly change the observed data
let classes = ['red','green','blue']
let named = ['Bob','Carol','Ted','Alice']
// hook up observable data
this.setTemplateArgs(this.observableStart('shared-data'))
}
}
setInterval(()=>{
observed.data.cssClass = classes[Math.floor(Math.random() * classes.length)]
observed.data.name = named[Math.floor(Math.random() * named.length)]
},1000)
}
// Register MyClass to the Sargasso framework
SargassoModule.utils.registerSargassoClass('MyClass', MyClass)
// Start Sargasso
SargassoModule.utils.bootSargasso()
// repeatedly and randomly change the observed data
let classes = ['red','green','blue']
let named = ['Bob','Carol','Ted','Alice']
setInterval(()=>{
observed.data.cssClass = classes[Math.floor(Math.random() * classes.length)]
observed.data.name = named[Math.floor(Math.random() * named.length)]
},1000)
}
</script>
</body>
</html>
```

@@ -484,2 +485,7 @@ [Try It](https://jsfiddle.net/PelagicCreatures/gbL5y7xq/11/)

| method | description |
| ------ | ----------- |
| workerStart(id, codeOrURL) | start a web worker with id. Ignored if worker id already installed. |
| workerPostMessage(id, data {}) | send the worker tagged with `id` a message. the message must be an object which can have any structure you want to pass to the worker |
Sargasso controllers have built in managed Web Workers that can be defined in external scripts or inline code blobs simplifying the management of running workers.

@@ -486,0 +492,0 @@

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc