(function(){var R=document&&document.currentScript&&document.currentScript.src;(window.webpackJsonpruntime=window.webpackJsonpruntime||[]).push([[16],{"09uc":function(b,S,h){"use strict";h.r(S),h.d(S,"init",function(){return H}),h.d(S,"openPopupWithEvent",function(){return P}),h.d(S,"closePopup",function(){return F});var E=h("yXPU"),D=h.n(E),y=h("J66h"),o=h("NO3N"),v=h("C+iK");function N(a,n,r,c,g){window.dmShowPopupPage(a,n,r,c,g)}function l(a,n){window.dmHidePopup(a,n)}const C=230,s=270,L=300,O=390;class M{constructor({container:n}){this.container=n,this.navigationMonths=0,this._bindMethods(),n.addEventListener("click",this._navigationDispatch),this._loadCurrentMonth()}_bindMethods(){this._loadNewMonth=this._loadNewMonth.bind(this),this._loadCurrentMonth=this._loadCurrentMonth.bind(this),this._buildDataString=this._buildDataString.bind(this),this._fetchAndLoadNewMonth=this._fetchAndLoadNewMonth.bind(this),this._navigationDispatch=this._navigationDispatch.bind(this)}_navigationDispatch(n){const r=n.target.closest("[class*=arrow-container]"),c=n.target.closest(".today-btn-container");r?this._loadNewMonth(r):c&&this._loadCurrentMonth()}_buildDataString(){const n={};return n.commandID="d1_loadNewGoogleCalendar",n["data-public-calendar-id"]=this.container.getAttribute("data-public-calendar-id"),n["data-navigation-months"]="0",n.device=v.getCurrentLayoutDevice(),n["data-week-start-on"]=this.container.getAttribute("data-week-start-on"),n}_loadCurrentMonth(){var n=this;return D()(function*(){const r=n._buildDataString();yield n._fetchAndLoadNewMonth(r,0)})()}_loadNewMonth(n){var r=this;return D()(function*(){const c=r._buildDataString(),u=getComputedStyle(r.container.querySelector(".calendar-container")).getPropertyValue("direction")==="rtl"?-1:1,p=n.classList.contains("left-arrow-container")?-1:1,f=r.navigationMonths+u*p,x=f.toString(10);c["data-navigation-months"]=x,yield r._fetchAndLoadNewMonth(c,f)})()}_fetchAndLoadNewMonth(n,r){var c=this;return D()(function*(){const g=`/_dm/s/rt/api/public/wpl/site/${v.getSiteAlias()}`,u=yield fetch(g,{method:"POST",credentials:"include",body:JSON.stringify(n),headers:{"Content-Type":"application/json"}});if(u.ok){const p=yield u.json();if(p.googleCalendarMarkup){const f=document.createElement("div");f.innerHTML=p.googleCalendarMarkup.toString(),c.container.innerHTML=f.querySelector(".dm-google-calendar").innerHTML,c.container.setAttribute("data-navigation-months",n["data-navigation-months"])}c.navigationMonths=r}})()}}M.displayName="GoogleCalendar";function H(){const a=[];Array.from(document.querySelectorAll(".dm-google-calendar")).forEach(r=>{a[r.id]=new M({container:r})}),I(a)}function P(a){const n=document.createElement("div"),r=a.description?`<div class='event-description dmNewParagraph'>${a.description.replace(/\n/g,"<br>")}</div>`:"",c=`<span>
                        ${a.isAllDayEvent==="true"?a.date:`${a.start} - ${a.end}`}
                        </span>`;n.innerHTML=`
        <div class='event-full-container'>
          <p>
              <span class="event-full-container-title">${a.summary}</span>
              <br/>
              ${c}
              <br/>
          </p> 
          ${r}     
        </div>    
`,n.querySelectorAll(".event-description a").forEach(function(f){f.setAttribute("target","_blank")});const g={dontOverlay:!0,animation:"opened-calendar-popup"},u=v.getCurrentLayoutDevice()===o.b.MOBILE?C:s,p=v.getCurrentLayoutDevice()===o.b.MOBILE?L:O;N(n,"google-calendar-popup-content-container",p,u,g)}function F(){l()}function I(a){a.length?document.addEventListener("click",A):document.removeEventListener("click",A)}function A(a){const n=a.target.closest(".event-container"),r=a.target.closest(".x-more-container"),c=a.target.closest(".monthly-day-card.mobile");n?_(n):r?B(r):c&&B(c,!0)}function _(a){const n=JSON.parse(y.Base64.decode(a.dataset.calendarEvent));!n||P(n)}function B(a,n=!1){const r=a.closest(".monthly-day-card");if(!r.querySelector(".events-container").querySelectorAll(".event-container").length)return;const u=r.cloneNode(!0),p=u.querySelector(".x-more-container");p&&p.remove(),n&&(u.querySelector(".events-container").style.display="block");const f=JSON.parse(y.Base64.decode(r.dataset.dayEvents));let x="";for(const i of f){const d=JSON.parse(y.Base64.decode(i.eventB64));let m="";d.isAllDayEvent==="false"&&(m=`<span class="start"> ${i.start}</span>`),x+=`
            <p class="event-container clickable" data-calendar-event=${y.Base64.encode(JSON.stringify(d))}>
              ${m}
              <span>${d.summary}</span>
              <br/>
            </p>
`}const U=u.querySelector(".events-container");U.innerHTML=x;const $=u,w={dontOverlay:!0,animation:"opened-calendar-popup"},t=v.getCurrentLayoutDevice()===o.b.MOBILE?C:s,e=v.getCurrentLayoutDevice()===o.b.MOBILE?L:O;N($,"google-calendar-popup-content-container",e,t,w)}},J66h:function(b,S,h){(function(E){var D,y;(function(o,v){b.exports=v(o)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof E!="undefined"?E:this,function(o){"use strict";o=o||{};var v=o.Base64,N="2.6.4",l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",C=function(t){for(var e={},i=0,d=t.length;i<d;i++)e[t.charAt(i)]=i;return e}(l),s=String.fromCharCode,L=function(t){if(t.length<2){var e=t.charCodeAt(0);return e<128?t:e<2048?s(192|e>>>6)+s(128|e&63):s(224|e>>>12&15)+s(128|e>>>6&63)+s(128|e&63)}else{var e=65536+(t.charCodeAt(0)-55296)*1024+(t.charCodeAt(1)-56320);return s(240|e>>>18&7)+s(128|e>>>12&63)+s(128|e>>>6&63)+s(128|e&63)}},O=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,M=function(t){return t.replace(O,L)},H=function(t){var e=[0,2,1][t.length%3],i=t.charCodeAt(0)<<16|(t.length>1?t.charCodeAt(1):0)<<8|(t.length>2?t.charCodeAt(2):0),d=[l.charAt(i>>>18),l.charAt(i>>>12&63),e>=2?"=":l.charAt(i>>>6&63),e>=1?"=":l.charAt(i&63)];return d.join("")},P=o.btoa&&typeof o.btoa=="function"?function(t){return o.btoa(t)}:function(t){if(t.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return t.replace(/[\s\S]{1,3}/g,H)},F=function(t){return P(M(String(t)))},I=function(t){return t.replace(/[+\/]/g,function(e){return e=="+"?"-":"_"}).replace(/=/g,"")},A=function(t,e){return e?I(F(t)):F(t)},_=function(t){return A(t,!0)},B;o.Uint8Array&&(B=function(t,e){for(var i="",d=0,m=t.length;d<m;d+=3){var J=t[d],j=t[d+1],W=t[d+2],T=J<<16|j<<8|W;i+=l.charAt(T>>>18)+l.charAt(T>>>12&63)+(typeof j!="undefined"?l.charAt(T>>>6&63):"=")+(typeof W!="undefined"?l.charAt(T&63):"=")}return e?I(i):i});var a=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,n=function(t){switch(t.length){case 4:var e=(7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3),i=e-65536;return s((i>>>10)+55296)+s((i&1023)+56320);case 3:return s((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return s((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},r=function(t){return t.replace(a,n)},c=function(t){var e=t.length,i=e%4,d=(e>0?C[t.charAt(0)]<<18:0)|(e>1?C[t.charAt(1)]<<12:0)|(e>2?C[t.charAt(2)]<<6:0)|(e>3?C[t.charAt(3)]:0),m=[s(d>>>16),s(d>>>8&255),s(d&255)];return m.length-=[0,0,2,1][i],m.join("")},g=o.atob&&typeof o.atob=="function"?function(t){return o.atob(t)}:function(t){return t.replace(/\S{1,4}/g,c)},u=function(t){return g(String(t).replace(/[^A-Za-z0-9\+\/]/g,""))},p=function(t){return r(g(t))},f=function(t){return String(t).replace(/[-_]/g,function(e){return e=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},x=function(t){return p(f(t))},U;o.Uint8Array&&(U=function(t){return Uint8Array.from(u(f(t)),function(e){return e.charCodeAt(0)})});var $=function(){var t=o.Base64;return o.Base64=v,t};if(o.Base64={VERSION:N,atob:u,btoa:P,fromBase64:x,toBase64:A,utob:M,encode:A,encodeURI:_,btou:r,decode:x,noConflict:$,fromUint8Array:B,toUint8Array:U},typeof Object.defineProperty=="function"){var w=function(t){return{value:t,enumerable:!1,writable:!0,configurable:!0}};o.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",w(function(){return x(this)})),Object.defineProperty(String.prototype,"toBase64",w(function(t){return A(this,t)})),Object.defineProperty(String.prototype,"toBase64URI",w(function(){return A(this,!0)}))}}return o.Meteor&&(Base64=o.Base64),b.exports?b.exports.Base64=o.Base64:(D=[],y=function(){return o.Base64}.apply(S,D),y!==void 0&&(b.exports=y)),{Base64:o.Base64}})}).call(this,h("yLpj"))}}])})();
