From 481a4fbc223c555e7a983ab27ebf5d1383e6aac9 Mon Sep 17 00:00:00 2001 From: Cavell Blood Date: Thu, 23 Sep 2021 16:25:05 -0500 Subject: [PATCH 1/2] Add build files --- dist/assets/sunset-to-sunset-legacy.min.js | 2 +- dist/assets/sunset-to-sunset.min.js | 2 +- dist/assets/test-legacy.min.js | 2 +- dist/assets/test.css | 2 +- dist/tests/index.html | 14 ++++++++++---- 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/dist/assets/sunset-to-sunset-legacy.min.js b/dist/assets/sunset-to-sunset-legacy.min.js index 8a5f26c..cc56a27 100644 --- a/dist/assets/sunset-to-sunset-legacy.min.js +++ b/dist/assets/sunset-to-sunset-legacy.min.js @@ -1,2 +1,2 @@ -!function(){var t=document.createElement("style");t.innerHTML='.sts-banner{--tw-bg-opacity: 1;background-color:rgba(251,191,36,var(--tw-bg-opacity));position:relative;padding:.75rem;text-align:center;font-family:Inter var,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"}.sts-banner .sts-closing-time,.sts-banner .sts-opening-time{font-weight:600}html.sts-during-sabbath,html.sts-during-sabbath body{overflow:hidden}html.sts-during-sabbath body{max-height:100vh}.sts-full-message__container{top:0px;right:0px;bottom:0px;left:0px;position:absolute;--tw-bg-opacity: 1;background-color:rgba(255,255,255,var(--tw-bg-opacity));pointer-events:auto;overflow-y:scroll;z-index:500}.sts-full-message__heading{margin-bottom:1rem;font-size:3rem;font-weight:600}.sts-layout{display:flex;flex-wrap:wrap;margin-left:-.5rem;margin-right:-.5rem}.sts-layout .sts-layout__item{padding-left:.5rem;padding-right:.5rem}.sts-modal{width:90%;margin-left:auto;margin-right:auto;margin-top:7%;max-width:640px;justify-content:center}.sts-message-area{font-size:1rem;line-height:1.5rem;width:100%;text-align:center;padding-bottom:1rem}.sts-time-area{width:100%;text-align:center;border-top:1px solid lightgrey;padding-top:1rem}\n',document.head.appendChild(t),System.register([],(function(){"use strict";return{execute:function(){const t=(t,e)=>Object.assign(t,e),e=(t,e)=>{const n="cccc, LLLL d 'at' h:mm a ZZZZ";for(let o=0;o{console.log("Intializing Sunset to Sunset...");const n=luxon.DateTime,o=luxon.Duration,s=n.now();let a={};a["Current Time"]={Date:s.toLocaleString(n.DATE_FULL),Time:s.toLocaleString(n.TIME_WITH_SHORT_OFFSET)};const i=5==s.weekday||6==s.weekday,l=document.getElementsByTagName("html")[0];i&&l.classList.add("hidden");const r=document.querySelector("template#sts-settings");let c=null!=r?JSON.parse(r.dataset.settings):{};c=t(t({},{guardDuration:{minutes:30},messageDuration:{minutes:60},location:{lat:0,long:0},simulateTime:!1,debug:!1}),c),c.simulateTime&&console.warn("%cThe `simulateTime` option is enabled for the Sunset to Sunset plugin. Remember to disable this option once you are done verifying the settings.","font-size: 16px"),c.debug&&(console.group("Sunset to Sunset intialized with the following options:"),console.dir(c),console.groupEnd());const m=()=>c.location,d=async t=>{const e=t.split("T")[0],o=await fetch("https://api.sunrise-sunset.org/json?&lat="+m().lat+"&lng="+m().long+"&date="+e+"&formatted=0"),s=await o.json();return n.fromISO(s.results.sunset)},u=()=>{let t;t=c.simulateTime?0:5-s.weekday;const e=n.fromISO(s.plus({days:t})).toString();return d(e)},g=()=>{let t;t=c.simulateTime?1:6-s.weekday;const e=n.fromISO(s.plus({days:t})).toString();return d(e)},p=()=>c.guardDuration,b=t=>t.minus(o.fromObject(c.messageDuration)),h=(t,e)=>{let n;return"closing"==e&&(n=t.minus(p())),"opening"==e&&(n=t.plus(p())),n};i||c.simulateTime?(async()=>{const t=Promise.all([u(),g()]);return await t})().then((([t,o])=>{const i=h(t,"closing"),r=h(o,"opening");let m=!1,d=!1,u=!1,g=!1;if(c.simulateTime)switch(c.simulateTime){case"preparation-day":m=!0;break;case"banner-up":d=!0;break;case"during-sabbath":u=!0;break;case"after-sabbath":g=!0}else m=sb(i)&&s=i&&s<=r&&s.weekday>=5,g=s>r&&s>=6;if(m){const t=b(i).diff(s,"milliseconds").toObject();t.milliseconds>=0&&setTimeout((()=>{location.reload()}),t.milliseconds)}if(d){((t,n)=>{const o=document.querySelector("template#sts-banner-template");let s;if(o)s=o;else{let t=document.createElement("template");t.innerHTML='\n\t\t\t
\n\t\t\t\tBecause of religious beliefs our store will be closed over the Sabbath hours.\n\t\t\t\tClosing on and will re-open on .\n\t\t\t
\n\t\t',s=t}const a=s.content.cloneNode(!0),i=a.querySelectorAll(".sts-closing-time");e(i,t);const l=a.querySelectorAll(".sts-opening-time");e(l,n),document.body.insertBefore(a,document.body.firstChild)})(i,r);const t=i.diff(s,"milliseconds").toObject();t.milliseconds>=0&&setTimeout((()=>{location.reload()}),t.milliseconds)}if(u){(t=>{const n=document.querySelector("template#sts-message-template");let o;if(n)o=n;else{let t=document.createElement("template");t.innerHTML='\n\t\t\t
\n\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t

Sabbath

\n\t\t\t\t\t\t

\n\t\t\t\t\t\t\tIn a world that seems to be spinning faster every day, we choose to stop \n\t\t\t\t\t\t\tand rest every Sabbath (Saturday). It’s a day for us to relax, refresh, \n\t\t\t\t\t\t\trefocus and worship; worship a God who loved us so much that He built a \n\t\t\t\t\t\t\tday of rest into Creation week and then commanded us to keep it \n\t\t\t\t\t\t\t(knowing we probably wouldn’t do it otherwise—even though it is for \n\t\t\t\t\t\t\tour best good).\n\t\t\t\t\t\t

\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t

\n\t\t\t\t\t\t\tWe will re-open on .\n\t\t\t\t\t\t

\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\n\t\t\t
\n\t\t',o=t}const s=o.content.cloneNode(!0),a=s.querySelectorAll(".sts-opening-time");e(a,t),document.getElementsByTagName("html")[0].classList.add("sts-during-sabbath"),document.body.insertBefore(s,document.body.firstChild)})(r);const t=r.diff(s,"milliseconds").toObject();t.milliseconds>=0&&setTimeout((()=>{location.reload()}),t.milliseconds)}if(l.classList.remove("hidden"),c.debug){let e={Enabled:{"Preparation day":m,"Banner up":d,"During the Sabbath":u,"After Sabbath":g}};console.group("Sunset to Sunset time checks"),console.table(e),console.groupEnd(),a["Banner up"]={Date:b(i).toLocaleString(n.DATE_FULL),Time:b(i).toLocaleString(n.TIME_WITH_SHORT_OFFSET)},a["Closing guard"]={Date:i.toLocaleString(n.DATE_FULL),Time:i.toLocaleString(n.TIME_WITH_SHORT_OFFSET)},a["Closing sunset"]={Date:t.toLocaleString(n.DATE_FULL),Time:t.toLocaleString(n.TIME_WITH_SHORT_OFFSET)},a["Opening sunset"]={Date:o.toLocaleString(n.DATE_FULL),Time:o.toLocaleString(n.TIME_WITH_SHORT_OFFSET)},a["Opening guard"]={Date:r.toLocaleString(n.DATE_FULL),Time:r.toLocaleString(n.TIME_WITH_SHORT_OFFSET)},console.group("Sunset to Sunset times"),console.table(a),console.groupEnd()}})):console.log("Sunset to Sunset: Exiting because today is not closing day")})()}}}))}(); +!function(){var t=document.createElement("style");t.innerHTML='.sts-banner{--tw-bg-opacity: 1;background-color:rgba(251,191,36,var(--tw-bg-opacity));position:relative;padding:.75rem;text-align:center;font-family:Inter var,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"}.sts-banner .sts-closing-time,.sts-banner .sts-opening-time{font-weight:600}html.sts-during-sabbath,html.sts-during-sabbath body{overflow:hidden}html.sts-during-sabbath body{max-height:100vh}.sts-full-message__container{top:0px;right:0px;bottom:0px;left:0px;position:absolute;--tw-bg-opacity: 1;background-color:rgba(255,255,255,var(--tw-bg-opacity));pointer-events:auto;overflow-y:scroll;z-index:500}.sts-full-message__heading{margin-bottom:1rem;font-size:3rem;font-weight:600}.sts-layout{display:flex;flex-wrap:wrap;margin-left:-.5rem;margin-right:-.5rem}.sts-layout .sts-layout__item{padding-left:.5rem;padding-right:.5rem}.sts-modal{width:90%;margin-left:auto;margin-right:auto;margin-top:7%;max-width:640px;justify-content:center}.sts-message-area{font-size:1rem;line-height:1.5rem;width:100%;text-align:center;padding-bottom:1rem}.sts-time-area{width:100%;text-align:center;border-top:1px solid lightgrey;padding-top:1rem}\n',document.head.appendChild(t),System.register([],(function(){"use strict";return{execute:function(){const t=(t,e)=>Object.assign(t,e),e=(t,e)=>{const s="cccc, LLLL d 'at' h:mm a ZZZZ";for(let n=0;n{console.log("Intializing Sunset to Sunset...");const s=luxon.DateTime,n=luxon.Duration,o=s.now();let i={};i["Current Time"]={Date:o.toLocaleString(s.DATE_FULL),Time:o.toLocaleString(s.TIME_WITH_SHORT_OFFSET)};const a=5==o.weekday||6==o.weekday,l=document.getElementsByTagName("html")[0];a&&l.classList.add("hidden");const r=document.querySelector("template#sts-settings");let c=null!=r?JSON.parse(r.dataset.settings):{};c=t(t({},{guardDuration:{minutes:30},messageDuration:{minutes:60},location:{lat:0,long:0},simulateTime:!1,debug:!1}),c),c.simulateTime&&console.warn("%cThe `simulateTime` option is enabled for the Sunset to Sunset plugin. Remember to disable this option once you are done verifying the settings.","font-size: 16px"),c.debug&&(console.group("Sunset to Sunset intialized with the following options:"),console.dir(c),console.groupEnd());const m=()=>c.location,d=async t=>{const e=t.split("T")[0],n=await fetch("https://api.sunrise-sunset.org/json?&lat="+m().lat+"&lng="+m().long+"&date="+e+"&formatted=0"),o=await n.json();return s.fromISO(o.results.sunset)},u=()=>{let t;t=c.simulateTime?0:5-o.weekday;const e=s.fromISO(o.plus({days:t})).toString();return d(e)},g=()=>{let t;t=c.simulateTime?1:6-o.weekday;const e=s.fromISO(o.plus({days:t})).toString();return d(e)},p=()=>c.guardDuration,h=t=>t.minus(n.fromObject(c.messageDuration)),b=(t,e)=>{let s;return"closing"==e&&(s=t.minus(p())),"opening"==e&&(s=t.plus(p())),s};a||c.simulateTime?(async()=>{const t=Promise.all([u(),g()]);return await t})().then((([t,n])=>{const a=b(t,"closing"),r=b(n,"opening");let m=!1,d=!1,u=!1,g=!1;if(c.simulateTime)switch(c.simulateTime){case"preparation-day":m=!0;break;case"banner-up":d=!0;break;case"during-sabbath":u=!0;break;case"after-sabbath":g=!0}else m=oh(a)&&o=a&&o<=r&&o.weekday>=5,g=o>r&&o>=6;if(m){const t=h(a).diff(o,"milliseconds").toObject();t.milliseconds>=0&&setTimeout((()=>{location.reload()}),t.milliseconds)}if(d){((t,s)=>{const n=document.querySelector("template#sts-banner-template");let o;if(n)o=n;else{let t=document.createElement("template");t.innerHTML='\n\t\t\t
\n\t\t\t\tBecause of religious beliefs our store will be closed over the Sabbath hours.\n\t\t\t\tClosing on and will re-open on .\n\t\t\t
\n\t\t',o=t}const i=o.content.cloneNode(!0),a=i.querySelectorAll(".sts-closing-time");e(a,t);const l=i.querySelectorAll(".sts-opening-time");e(l,s),document.body.insertBefore(i,document.body.firstChild)})(a,r);const t=a.diff(o,"milliseconds").toObject();t.milliseconds>=0&&setTimeout((()=>{location.reload()}),t.milliseconds)}if(u){(t=>{const s=document.querySelector("template#sts-full-message-template"),n=document.querySelector("template#sts-message-template"),o=s||n;let i;if(o)i=o.content.cloneNode(!0),i=i.firstElementChild;else{let t=document.createElement("div");t.innerHTML="\n\t\t\t

\n\t\t\t\tIn a world that seems to be spinning faster every day, we choose to stop \n\t\t\t\tand rest every Sabbath (Saturday). It’s a day for us to relax, refresh, \n\t\t\t\trefocus and worship; worship a God who loved us so much that He built a \n\t\t\t\tday of rest into Creation week and then commanded us to keep it \n\t\t\t\t(knowing we probably wouldn’t do it otherwise—even though it is for \n\t\t\t\tour best good).\n\t\t\t

\n\t\t",i=t}let a=document.createElement("template");a.innerHTML='\n\t\t
\n\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t

Sabbath

\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t

\n\t\t\t\t\t\tWe will re-open on .\n\t\t\t\t\t

\n\t\t\t\t
\n\t\t\t
\n\t\t\n\t\t
\n\t';const l=a.content.cloneNode(!0),r=l.querySelectorAll(".sts-opening-time");if(e(r,t),s){console.log("full user template");let t=l.querySelector(".sts-full-message__container");for(;t.firstElementChild;)t.removeChild(t.firstChild);t.insertBefore(i,null)}else n&&(console.log("simple user template"),l.querySelector(".sts-message-area").insertBefore(i,null));document.getElementsByTagName("html")[0].classList.add("sts-during-sabbath"),document.body.insertBefore(l,document.body.firstChild)})(r);const t=r.diff(o,"milliseconds").toObject();t.milliseconds>=0&&setTimeout((()=>{location.reload()}),t.milliseconds)}if(l.classList.remove("hidden"),c.debug){let e={Enabled:{"Preparation day":m,"Banner up":d,"During the Sabbath":u,"After Sabbath":g}};console.group("Sunset to Sunset time checks"),console.table(e),console.groupEnd(),i["Banner up"]={Date:h(a).toLocaleString(s.DATE_FULL),Time:h(a).toLocaleString(s.TIME_WITH_SHORT_OFFSET)},i["Closing guard"]={Date:a.toLocaleString(s.DATE_FULL),Time:a.toLocaleString(s.TIME_WITH_SHORT_OFFSET)},i["Closing sunset"]={Date:t.toLocaleString(s.DATE_FULL),Time:t.toLocaleString(s.TIME_WITH_SHORT_OFFSET)},i["Opening sunset"]={Date:n.toLocaleString(s.DATE_FULL),Time:n.toLocaleString(s.TIME_WITH_SHORT_OFFSET)},i["Opening guard"]={Date:r.toLocaleString(s.DATE_FULL),Time:r.toLocaleString(s.TIME_WITH_SHORT_OFFSET)},console.group("Sunset to Sunset times"),console.table(i),console.groupEnd()}})):console.log("Sunset to Sunset: Exiting because today is not closing day")})()}}}))}(); //# sourceMappingURL=sunset-to-sunset-legacy.min.js.map diff --git a/dist/assets/sunset-to-sunset.min.js b/dist/assets/sunset-to-sunset.min.js index ad4faaa..a02c2ca 100644 --- a/dist/assets/sunset-to-sunset.min.js +++ b/dist/assets/sunset-to-sunset.min.js @@ -1,2 +1,2 @@ -export function __vite_legacy_guard(){import("data:text/javascript,")}const t=(t,e)=>Object.assign(t,e),e=(t,e)=>{const n="cccc, LLLL d 'at' h:mm a ZZZZ";for(let s=0;s{console.log("Intializing Sunset to Sunset...");const n=luxon.DateTime,s=luxon.Duration,o=n.now();let a={};a["Current Time"]={Date:o.toLocaleString(n.DATE_FULL),Time:o.toLocaleString(n.TIME_WITH_SHORT_OFFSET)};const i=5==o.weekday||6==o.weekday,l=document.getElementsByTagName("html")[0];i&&l.classList.add("hidden");const r=document.querySelector("template#sts-settings");let c=null!=r?JSON.parse(r.dataset.settings):{};c=t(t({},{guardDuration:{minutes:30},messageDuration:{minutes:60},location:{lat:0,long:0},simulateTime:!1,debug:!1}),c),c.simulateTime&&console.warn("%cThe `simulateTime` option is enabled for the Sunset to Sunset plugin. Remember to disable this option once you are done verifying the settings.","font-size: 16px"),c.debug&&(console.group("Sunset to Sunset intialized with the following options:"),console.dir(c),console.groupEnd());const u=()=>c.location,d=async t=>{const e=t.split("T")[0],s=await fetch("https://api.sunrise-sunset.org/json?&lat="+u().lat+"&lng="+u().long+"&date="+e+"&formatted=0"),o=await s.json();return n.fromISO(o.results.sunset)},m=()=>{let t;t=c.simulateTime?0:5-o.weekday;const e=n.fromISO(o.plus({days:t})).toString();return d(e)},g=()=>{let t;t=c.simulateTime?1:6-o.weekday;const e=n.fromISO(o.plus({days:t})).toString();return d(e)},p=()=>c.guardDuration,S=t=>t.minus(s.fromObject(c.messageDuration)),T=(t,e)=>{let n;return"closing"==e&&(n=t.minus(p())),"opening"==e&&(n=t.plus(p())),n};i||c.simulateTime?(async()=>{const t=Promise.all([m(),g()]);return await t})().then((([t,s])=>{const i=T(t,"closing"),r=T(s,"opening");let u=!1,d=!1,m=!1,g=!1;if(c.simulateTime)switch(c.simulateTime){case"preparation-day":u=!0;break;case"banner-up":d=!0;break;case"during-sabbath":m=!0;break;case"after-sabbath":g=!0}else u=oS(i)&&o=i&&o<=r&&o.weekday>=5,g=o>r&&o>=6;if(u){const t=S(i).diff(o,"milliseconds").toObject();t.milliseconds>=0&&setTimeout((()=>{location.reload()}),t.milliseconds)}if(d){((t,n)=>{const s=document.querySelector("template#sts-banner-template");let o;if(s)o=s;else{let t=document.createElement("template");t.innerHTML='\n\t\t\t
\n\t\t\t\tBecause of religious beliefs our store will be closed over the Sabbath hours.\n\t\t\t\tClosing on and will re-open on .\n\t\t\t
\n\t\t',o=t}const a=o.content.cloneNode(!0),i=a.querySelectorAll(".sts-closing-time");e(i,t);const l=a.querySelectorAll(".sts-opening-time");e(l,n),document.body.insertBefore(a,document.body.firstChild)})(i,r);const t=i.diff(o,"milliseconds").toObject();t.milliseconds>=0&&setTimeout((()=>{location.reload()}),t.milliseconds)}if(m){(t=>{const n=document.querySelector("template#sts-message-template");let s;if(n)s=n;else{let t=document.createElement("template");t.innerHTML='\n\t\t\t
\n\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t

Sabbath

\n\t\t\t\t\t\t

\n\t\t\t\t\t\t\tIn a world that seems to be spinning faster every day, we choose to stop \n\t\t\t\t\t\t\tand rest every Sabbath (Saturday). It’s a day for us to relax, refresh, \n\t\t\t\t\t\t\trefocus and worship; worship a God who loved us so much that He built a \n\t\t\t\t\t\t\tday of rest into Creation week and then commanded us to keep it \n\t\t\t\t\t\t\t(knowing we probably wouldn’t do it otherwise—even though it is for \n\t\t\t\t\t\t\tour best good).\n\t\t\t\t\t\t

\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t

\n\t\t\t\t\t\t\tWe will re-open on .\n\t\t\t\t\t\t

\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\n\t\t\t
\n\t\t',s=t}const o=s.content.cloneNode(!0),a=o.querySelectorAll(".sts-opening-time");e(a,t),document.getElementsByTagName("html")[0].classList.add("sts-during-sabbath"),document.body.insertBefore(o,document.body.firstChild)})(r);const t=r.diff(o,"milliseconds").toObject();t.milliseconds>=0&&setTimeout((()=>{location.reload()}),t.milliseconds)}if(l.classList.remove("hidden"),c.debug){let e={Enabled:{"Preparation day":u,"Banner up":d,"During the Sabbath":m,"After Sabbath":g}};console.group("Sunset to Sunset time checks"),console.table(e),console.groupEnd(),a["Banner up"]={Date:S(i).toLocaleString(n.DATE_FULL),Time:S(i).toLocaleString(n.TIME_WITH_SHORT_OFFSET)},a["Closing guard"]={Date:i.toLocaleString(n.DATE_FULL),Time:i.toLocaleString(n.TIME_WITH_SHORT_OFFSET)},a["Closing sunset"]={Date:t.toLocaleString(n.DATE_FULL),Time:t.toLocaleString(n.TIME_WITH_SHORT_OFFSET)},a["Opening sunset"]={Date:s.toLocaleString(n.DATE_FULL),Time:s.toLocaleString(n.TIME_WITH_SHORT_OFFSET)},a["Opening guard"]={Date:r.toLocaleString(n.DATE_FULL),Time:r.toLocaleString(n.TIME_WITH_SHORT_OFFSET)},console.group("Sunset to Sunset times"),console.table(a),console.groupEnd()}})):console.log("Sunset to Sunset: Exiting because today is not closing day")})(); +export function __vite_legacy_guard(){import("data:text/javascript,")}const t=(t,e)=>Object.assign(t,e),e=(t,e)=>{const s="cccc, LLLL d 'at' h:mm a ZZZZ";for(let n=0;n{console.log("Intializing Sunset to Sunset...");const s=luxon.DateTime,n=luxon.Duration,o=s.now();let a={};a["Current Time"]={Date:o.toLocaleString(s.DATE_FULL),Time:o.toLocaleString(s.TIME_WITH_SHORT_OFFSET)};const i=5==o.weekday||6==o.weekday,l=document.getElementsByTagName("html")[0];i&&l.classList.add("hidden");const r=document.querySelector("template#sts-settings");let c=null!=r?JSON.parse(r.dataset.settings):{};c=t(t({},{guardDuration:{minutes:30},messageDuration:{minutes:60},location:{lat:0,long:0},simulateTime:!1,debug:!1}),c),c.simulateTime&&console.warn("%cThe `simulateTime` option is enabled for the Sunset to Sunset plugin. Remember to disable this option once you are done verifying the settings.","font-size: 16px"),c.debug&&(console.group("Sunset to Sunset intialized with the following options:"),console.dir(c),console.groupEnd());const u=()=>c.location,m=async t=>{const e=t.split("T")[0],n=await fetch("https://api.sunrise-sunset.org/json?&lat="+u().lat+"&lng="+u().long+"&date="+e+"&formatted=0"),o=await n.json();return s.fromISO(o.results.sunset)},d=()=>{let t;t=c.simulateTime?0:5-o.weekday;const e=s.fromISO(o.plus({days:t})).toString();return m(e)},g=()=>{let t;t=c.simulateTime?1:6-o.weekday;const e=s.fromISO(o.plus({days:t})).toString();return m(e)},p=()=>c.guardDuration,S=t=>t.minus(n.fromObject(c.messageDuration)),T=(t,e)=>{let s;return"closing"==e&&(s=t.minus(p())),"opening"==e&&(s=t.plus(p())),s};i||c.simulateTime?(async()=>{const t=Promise.all([d(),g()]);return await t})().then((([t,n])=>{const i=T(t,"closing"),r=T(n,"opening");let u=!1,m=!1,d=!1,g=!1;if(c.simulateTime)switch(c.simulateTime){case"preparation-day":u=!0;break;case"banner-up":m=!0;break;case"during-sabbath":d=!0;break;case"after-sabbath":g=!0}else u=oS(i)&&o=i&&o<=r&&o.weekday>=5,g=o>r&&o>=6;if(u){const t=S(i).diff(o,"milliseconds").toObject();t.milliseconds>=0&&setTimeout((()=>{location.reload()}),t.milliseconds)}if(m){((t,s)=>{const n=document.querySelector("template#sts-banner-template");let o;if(n)o=n;else{let t=document.createElement("template");t.innerHTML='\n\t\t\t
\n\t\t\t\tBecause of religious beliefs our store will be closed over the Sabbath hours.\n\t\t\t\tClosing on and will re-open on .\n\t\t\t
\n\t\t',o=t}const a=o.content.cloneNode(!0),i=a.querySelectorAll(".sts-closing-time");e(i,t);const l=a.querySelectorAll(".sts-opening-time");e(l,s),document.body.insertBefore(a,document.body.firstChild)})(i,r);const t=i.diff(o,"milliseconds").toObject();t.milliseconds>=0&&setTimeout((()=>{location.reload()}),t.milliseconds)}if(d){(t=>{const s=document.querySelector("template#sts-full-message-template"),n=document.querySelector("template#sts-message-template"),o=s||n;let a;if(o)a=o.content.cloneNode(!0),a=a.firstElementChild;else{let t=document.createElement("div");t.innerHTML="\n\t\t\t

\n\t\t\t\tIn a world that seems to be spinning faster every day, we choose to stop \n\t\t\t\tand rest every Sabbath (Saturday). It’s a day for us to relax, refresh, \n\t\t\t\trefocus and worship; worship a God who loved us so much that He built a \n\t\t\t\tday of rest into Creation week and then commanded us to keep it \n\t\t\t\t(knowing we probably wouldn’t do it otherwise—even though it is for \n\t\t\t\tour best good).\n\t\t\t

\n\t\t",a=t}let i=document.createElement("template");i.innerHTML='\n\t\t
\n\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t

Sabbath

\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t

\n\t\t\t\t\t\tWe will re-open on .\n\t\t\t\t\t

\n\t\t\t\t
\n\t\t\t
\n\t\t\n\t\t
\n\t';const l=i.content.cloneNode(!0),r=l.querySelectorAll(".sts-opening-time");if(e(r,t),s){console.log("full user template");let t=l.querySelector(".sts-full-message__container");for(;t.firstElementChild;)t.removeChild(t.firstChild);t.insertBefore(a,null)}else n&&(console.log("simple user template"),l.querySelector(".sts-message-area").insertBefore(a,null));document.getElementsByTagName("html")[0].classList.add("sts-during-sabbath"),document.body.insertBefore(l,document.body.firstChild)})(r);const t=r.diff(o,"milliseconds").toObject();t.milliseconds>=0&&setTimeout((()=>{location.reload()}),t.milliseconds)}if(l.classList.remove("hidden"),c.debug){let e={Enabled:{"Preparation day":u,"Banner up":m,"During the Sabbath":d,"After Sabbath":g}};console.group("Sunset to Sunset time checks"),console.table(e),console.groupEnd(),a["Banner up"]={Date:S(i).toLocaleString(s.DATE_FULL),Time:S(i).toLocaleString(s.TIME_WITH_SHORT_OFFSET)},a["Closing guard"]={Date:i.toLocaleString(s.DATE_FULL),Time:i.toLocaleString(s.TIME_WITH_SHORT_OFFSET)},a["Closing sunset"]={Date:t.toLocaleString(s.DATE_FULL),Time:t.toLocaleString(s.TIME_WITH_SHORT_OFFSET)},a["Opening sunset"]={Date:n.toLocaleString(s.DATE_FULL),Time:n.toLocaleString(s.TIME_WITH_SHORT_OFFSET)},a["Opening guard"]={Date:r.toLocaleString(s.DATE_FULL),Time:r.toLocaleString(s.TIME_WITH_SHORT_OFFSET)},console.group("Sunset to Sunset times"),console.table(a),console.groupEnd()}})):console.log("Sunset to Sunset: Exiting because today is not closing day")})(); //# sourceMappingURL=sunset-to-sunset.min.js.map diff --git a/dist/assets/test-legacy.min.js b/dist/assets/test-legacy.min.js index 75372c6..3ede64f 100644 --- a/dist/assets/test-legacy.min.js +++ b/dist/assets/test-legacy.min.js @@ -1,2 +1,2 @@ -!function(){var e=document.createElement("style");e.innerHTML='*,:before,:after{box-sizing:border-box}html{-moz-tab-size:4;-o-tab-size:4;tab-size:4}html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}body{font-family:system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"}hr{height:0;color:inherit}abbr[title]{-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,select{text-transform:none}button{-webkit-appearance:button}legend{padding:0}progress{vertical-align:baseline}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}button{background-color:transparent;background-image:none}fieldset{margin:0;padding:0}ol,ul{list-style:none;margin:0;padding:0}html{font-family:Inter var,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";line-height:1.5}body{font-family:inherit;line-height:inherit}*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:currentColor}hr{border-top-width:1px}img{border-style:solid}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#a1a1aa}input:-ms-input-placeholder,textarea:-ms-input-placeholder{opacity:1;color:#a1a1aa}input::placeholder,textarea::placeholder{opacity:1;color:#a1a1aa}button{cursor:pointer}table{border-collapse:collapse}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}button,input,optgroup,select,textarea{padding:0;line-height:inherit;color:inherit}pre,code,kbd,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-opacity: 1;border-color:rgba(228,228,231,var(--tw-border-opacity))}.table{display:table}.hidden{display:none}@-webkit-keyframes spin{to{transform:rotate(360deg)}}@keyframes spin{to{transform:rotate(360deg)}}@-webkit-keyframes ping{75%,to{transform:scale(2);opacity:0}}@keyframes ping{75%,to{transform:scale(2);opacity:0}}@-webkit-keyframes pulse{50%{opacity:.5}}@keyframes pulse{50%{opacity:.5}}@-webkit-keyframes bounce{0%,to{transform:translateY(-25%);-webkit-animation-timing-function:cubic-bezier(.8,0,1,1);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;-webkit-animation-timing-function:cubic-bezier(0,0,.2,1);animation-timing-function:cubic-bezier(0,0,.2,1)}}@keyframes bounce{0%,to{transform:translateY(-25%);-webkit-animation-timing-function:cubic-bezier(.8,0,1,1);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;-webkit-animation-timing-function:cubic-bezier(0,0,.2,1);animation-timing-function:cubic-bezier(0,0,.2,1)}}*,:before,:after{--tw-shadow: 0 0 #0000}*,:before,:after{--tw-ring-inset: var(--tw-empty, );--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgba(59, 130, 246, .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000}\n',document.head.appendChild(e),System.register(["./sunset-to-sunset-legacy.min.js"],(function(){"use strict";return{setters:[function(){}],execute:function(){}}}))}(); +!function(){var e=document.createElement("style");e.innerHTML='*,:before,:after{box-sizing:border-box}html{-moz-tab-size:4;-o-tab-size:4;tab-size:4}html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}body{font-family:system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"}hr{height:0;color:inherit}abbr[title]{-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,select{text-transform:none}button{-webkit-appearance:button}legend{padding:0}progress{vertical-align:baseline}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}button{background-color:transparent;background-image:none}fieldset{margin:0;padding:0}ol,ul{list-style:none;margin:0;padding:0}html{font-family:Inter var,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";line-height:1.5}body{font-family:inherit;line-height:inherit}*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:currentColor}hr{border-top-width:1px}img{border-style:solid}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#a1a1aa}input:-ms-input-placeholder,textarea:-ms-input-placeholder{opacity:1;color:#a1a1aa}input::placeholder,textarea::placeholder{opacity:1;color:#a1a1aa}button{cursor:pointer}table{border-collapse:collapse}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}button,input,optgroup,select,textarea{padding:0;line-height:inherit;color:inherit}pre,code,kbd,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-opacity: 1;border-color:rgba(228,228,231,var(--tw-border-opacity))}.relative{position:relative}.table{display:table}.hidden{display:none}@-webkit-keyframes spin{to{transform:rotate(360deg)}}@keyframes spin{to{transform:rotate(360deg)}}@-webkit-keyframes ping{75%,to{transform:scale(2);opacity:0}}@keyframes ping{75%,to{transform:scale(2);opacity:0}}@-webkit-keyframes pulse{50%{opacity:.5}}@keyframes pulse{50%{opacity:.5}}@-webkit-keyframes bounce{0%,to{transform:translateY(-25%);-webkit-animation-timing-function:cubic-bezier(.8,0,1,1);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;-webkit-animation-timing-function:cubic-bezier(0,0,.2,1);animation-timing-function:cubic-bezier(0,0,.2,1)}}@keyframes bounce{0%,to{transform:translateY(-25%);-webkit-animation-timing-function:cubic-bezier(.8,0,1,1);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;-webkit-animation-timing-function:cubic-bezier(0,0,.2,1);animation-timing-function:cubic-bezier(0,0,.2,1)}}*,:before,:after{--tw-shadow: 0 0 #0000}*,:before,:after{--tw-ring-inset: var(--tw-empty, );--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgba(59, 130, 246, .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000}\n',document.head.appendChild(e),System.register(["./sunset-to-sunset-legacy.min.js"],(function(){"use strict";return{setters:[function(){}],execute:function(){}}}))}(); //# sourceMappingURL=test-legacy.min.js.map diff --git a/dist/assets/test.css b/dist/assets/test.css index 6e4f889..46f2ab9 100644 --- a/dist/assets/test.css +++ b/dist/assets/test.css @@ -1 +1 @@ -*,:before,:after{box-sizing:border-box}html{-moz-tab-size:4;-o-tab-size:4;tab-size:4}html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}body{font-family:system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"}hr{height:0;color:inherit}abbr[title]{-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,select{text-transform:none}button{-webkit-appearance:button}legend{padding:0}progress{vertical-align:baseline}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}button{background-color:transparent;background-image:none}fieldset{margin:0;padding:0}ol,ul{list-style:none;margin:0;padding:0}html{font-family:Inter var,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";line-height:1.5}body{font-family:inherit;line-height:inherit}*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:currentColor}hr{border-top-width:1px}img{border-style:solid}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#a1a1aa}input:-ms-input-placeholder,textarea:-ms-input-placeholder{opacity:1;color:#a1a1aa}input::placeholder,textarea::placeholder{opacity:1;color:#a1a1aa}button{cursor:pointer}table{border-collapse:collapse}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}button,input,optgroup,select,textarea{padding:0;line-height:inherit;color:inherit}pre,code,kbd,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-opacity: 1;border-color:rgba(228,228,231,var(--tw-border-opacity))}.table{display:table}.hidden{display:none}@-webkit-keyframes spin{to{transform:rotate(360deg)}}@keyframes spin{to{transform:rotate(360deg)}}@-webkit-keyframes ping{75%,to{transform:scale(2);opacity:0}}@keyframes ping{75%,to{transform:scale(2);opacity:0}}@-webkit-keyframes pulse{50%{opacity:.5}}@keyframes pulse{50%{opacity:.5}}@-webkit-keyframes bounce{0%,to{transform:translateY(-25%);-webkit-animation-timing-function:cubic-bezier(.8,0,1,1);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;-webkit-animation-timing-function:cubic-bezier(0,0,.2,1);animation-timing-function:cubic-bezier(0,0,.2,1)}}@keyframes bounce{0%,to{transform:translateY(-25%);-webkit-animation-timing-function:cubic-bezier(.8,0,1,1);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;-webkit-animation-timing-function:cubic-bezier(0,0,.2,1);animation-timing-function:cubic-bezier(0,0,.2,1)}}*,:before,:after{--tw-shadow: 0 0 #0000}*,:before,:after{--tw-ring-inset: var(--tw-empty, );--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgba(59, 130, 246, .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000} +*,:before,:after{box-sizing:border-box}html{-moz-tab-size:4;-o-tab-size:4;tab-size:4}html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}body{font-family:system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"}hr{height:0;color:inherit}abbr[title]{-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,select{text-transform:none}button{-webkit-appearance:button}legend{padding:0}progress{vertical-align:baseline}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}button{background-color:transparent;background-image:none}fieldset{margin:0;padding:0}ol,ul{list-style:none;margin:0;padding:0}html{font-family:Inter var,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";line-height:1.5}body{font-family:inherit;line-height:inherit}*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:currentColor}hr{border-top-width:1px}img{border-style:solid}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#a1a1aa}input:-ms-input-placeholder,textarea:-ms-input-placeholder{opacity:1;color:#a1a1aa}input::placeholder,textarea::placeholder{opacity:1;color:#a1a1aa}button{cursor:pointer}table{border-collapse:collapse}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}button,input,optgroup,select,textarea{padding:0;line-height:inherit;color:inherit}pre,code,kbd,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-opacity: 1;border-color:rgba(228,228,231,var(--tw-border-opacity))}.relative{position:relative}.table{display:table}.hidden{display:none}@-webkit-keyframes spin{to{transform:rotate(360deg)}}@keyframes spin{to{transform:rotate(360deg)}}@-webkit-keyframes ping{75%,to{transform:scale(2);opacity:0}}@keyframes ping{75%,to{transform:scale(2);opacity:0}}@-webkit-keyframes pulse{50%{opacity:.5}}@keyframes pulse{50%{opacity:.5}}@-webkit-keyframes bounce{0%,to{transform:translateY(-25%);-webkit-animation-timing-function:cubic-bezier(.8,0,1,1);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;-webkit-animation-timing-function:cubic-bezier(0,0,.2,1);animation-timing-function:cubic-bezier(0,0,.2,1)}}@keyframes bounce{0%,to{transform:translateY(-25%);-webkit-animation-timing-function:cubic-bezier(.8,0,1,1);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;-webkit-animation-timing-function:cubic-bezier(0,0,.2,1);animation-timing-function:cubic-bezier(0,0,.2,1)}}*,:before,:after{--tw-shadow: 0 0 #0000}*,:before,:after{--tw-ring-inset: var(--tw-empty, );--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgba(59, 130, 246, .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000} diff --git a/dist/tests/index.html b/dist/tests/index.html index cb7c25c..fb759e0 100644 --- a/dist/tests/index.html +++ b/dist/tests/index.html @@ -910,10 +910,16 @@

-