window.announcekit=(()=>{var t={1244:(t,e,i)=>{"use strict";function s(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}i.d(e,{default:()=>jt});var n=i(6774);class o{constructor(){s(this,"listeners",void 0),this.listeners={}}trigger(t,e){this.listeners[t]?.forEach((t=>t(e))),this.listeners["*"]?.forEach((i=>i({data:e,name:t})))}on(t,e){this.listeners[t]=this.listeners[t]||[],this.listeners[t].push(e)}off(t,e){this.listeners[t]&&(this.listeners[t]=this.listeners[t].filter((t=>t!=e)))}one(t,e){var i=this;let s;s=function(){i.listeners[t]=i.listeners[t].filter((t=>t!=s)),e(...arguments)},this.listeners[t]=this.listeners[t]||[],this.listeners[t].push(s)}offAll(){this.listeners={}}}class r extends o{get state(){return{}}constructor(t){super(),s(this,"destroyed",!1),s(this,"parent",void 0),this.parent=t,this.parent?.on("state",(t=>this.trigger("state",t)))}watchState(t,e){let i=e(this.state);const s=s=>{let o=e(s);n(i,o)||(i=o,t(o))};return this.on("state",s),t(i),()=>this.off("state",s)}destroy(){this.destroyed||(this.destroyed=!0,this.trigger("destroy"),this.offAll())}}class a extends r{constructor(t){super(t)}get state(){return this.parent.state}get frame(){return this.parent.frame}get conf(){return this.parent.conf}get post(){return this.parent.state.boosterPosts?.[this.type]}}function d(t){const e=t.replace(/#/,"");return[.299*parseInt(e.substr(0,2),16),.587*parseInt(e.substr(2,2),16),.114*parseInt(e.substr(4,2),16)].reduce(((t,e)=>t+e))/255}function l(t){let{color:e="#E01E5A",counter:i=0,reset:s=!1}=t,n=document.querySelector("link[rel~='icon']");n||(n=document.createElement("link"),n.setAttribute("rel","icon"),n.setAttribute("href",`${location.protocol}//${location.host}/favicon.ico`),document.head.appendChild(n));const o=n.getAttribute("data-href")||n.getAttribute("href");if(!o)return;const r=n.classList.contains("badge-init");if(s)return r?n.setAttribute("href",o):void 0;if(r)return;n.classList.add("badge-init"),n.setAttribute("data-href",o);const a=new Image;a.crossOrigin="anonymous";try{a.addEventListener("load",(function(){const t=document.createElement("canvas"),s=t.getContext("2d");t.width=a.width,t.height=a.height,s.beginPath(),s.drawImage(a,0,0,a.width,a.height,0,0,t.width,t.height),s.stroke(),s.beginPath(),s.fillStyle=e,s.strokeStyle=e,s.arc(.7*t.width,.7*t.height,t.height/3.5,0,2*Math.PI),s.fill(),s.stroke(),s.closePath(),s.fillStyle="#fff",s.font=`bold ${a.height/2}px sans-serif`,s.textAlign="center",s.textBaseline="middle",s.fillText(String(i),.7*t.width,.74*t.height),n.classList.add("badge-inserted"),n.setAttribute("href",t.toDataURL())})),a.src=o}catch(t){}}function h(t){return t instanceof Element?t:document.querySelector(t)}const c={};function p(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;if(c[`badge-shake-scale${t}`])return c[`badge-shake-scale${t}`];let e=`announcekit-badgeanim-${(new Date).getTime()}-${1e4*Math.random()|0}`;return c[`badge-shake-scale${t}`]=e,m(`\n .${e} {\n position: relative;\n animation-name: kf-${e};\n animation-duration: 2s;\n animation-timing-function: cubic-bezier(0.15, 0.03, 0.06, 0.39);\n animation-iteration-count: infinite;\n animation-fill-mode: forwards;\n opacity: 1;\n }\n\n @keyframes kf-${e} {\n 4%,\n 36% {\n transform: translateX(-1px) ${t?`scale(${t})`:""}\n }\n 8%,\n 32% {\n transform: translateX(1px) ${t?`scale(${t})`:""};\n }\n 12%,\n 20%,\n 28% {\n transform: translateX(-2px) ${t?`scale(${t})`:""};\n }\n 18%,\n 26% {\n transform: translateX(2px) ${t?`scale(${t})`:""};\n }\n 36%,\n 100% {\n transform: translateX(-1px) ${t?`scale(${t})`:""};\n }\n }\n `),e}function u(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"#ff4b4b";if(c[`badge-pulse-${t}`])return c[`badge-pulse-${t}`];let e=`announcekit-badgeanim-${(new Date).getTime()}-${1e4*Math.random()|0}`;return c[`badge-pulse-${t}`]=e,m(`\n .${e} {\n position: relative;\n z-index: 1;\n }\n\n .${e}:after,\n .${e}:before {\n content: "";\n position: absolute;\n background: ${t};\n border-radius: 50%;\n width: 1.75em;\n height: 1.75em;\n animation-name: kf-${e};\n animation-duration: 2s;\n animation-timing-function: ease-out;\n animation-iteration-count: infinite;\n animation-fill-mode: forwards;\n left: 50%;\n top: 50%;\n margin-top: -0.875em;\n margin-left: -0.875em;\n opacity: 0;\n z-index: -1;\n }\n\n .${e}:after {\n animation-delay: 1s;\n }\n\n @keyframes kf-${e} {\n from {\n transform: scale(0.7);\n opacity: 0.6;\n }\n to {\n transform: scale(1.5);\n opacity: 0;\n }\n }\n `),e}function g(){if(c["badge-minimalist"])return c["badge-minimalist"];let t=`announcekit-minimalist-${(new Date).getTime()}-${1e4*Math.random()|0}`;return c["badge-minimalist"]=t,m(`\n .${t} {\n transform: scale(0.5);\n margin-left: -0.3em;\n margin-top: -0.8em;\n }\n\n .announcekit-widget-floating-badge .announcekit-widget-badge.${t} {\n margin-left: auto;\n margin-top: auto;\n }\n `),t}function m(t){const e=document.createElement("style");return e.type="text/css",e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t)),document.getElementsByTagName("head")[0].appendChild(e),e}let b,f,w;!function(t){t.WIDGET="widget",t.NOTIFICATION="notification",t.NPS="nps"}(b||(b={})),function(t){t.SEEN_ONCE="seen_once",t.UNTIL_EXPIRE="until_expire"}(f||(f={})),function(t){t.SUBMIT_RESPONSE="submit_response",t.UNTIL_CLOSE="until_close",t.ONLY_ONCE="only_once"}(w||(w={}));const y="announcekit-booster-bar",v=`\n \n \n \n ×\n`;class x extends a{get type(){return"bar"}constructor(t){super(t),s(this,"bar",void 0),s(this,"label",void 0),s(this,"title",void 0),s(this,"cta",void 0),s(this,"cssid",void 0),s(this,"isNotifyEndUsers",void 0),s(this,"showdelaytimer",void 0),s(this,"hidedelaytimer",void 0),s(this,"_configure",(()=>{this.watchState((t=>{let{disabled:e,sticky:i,bottom:s,color:n,fontSize:o,backgroundColor:r,title:a,url:l,labelName:h,cta:c,showLabel:p,labelColor:u,showunread:g,unread:m,lastRead:w,visibleAt:y,showdelay:v,boostersViewsMap:x}=t;if(e||!a)return this._hide();const $=this.state.boosterPosts.bar.notify_interaction;if(this.isNotifyEndUsers&&$===f.SEEN_ONCE&&x.bar&&x.bar.count>0)return this._hide();if(!this.isNotifyEndUsers&&g&&(!m||new Date(y).getTime()<=Number(w)))return this._hide();document.documentElement.style.setProperty("--announcekit-bar-font-multiplier",o);let k={backgroundColor:`#${r}`,color:`#${n}`};if(k.position=i?"fixed":"absolute",s?k.bottom="0":k.top="0",this.conf.type&&this.conf.type!==b.WIDGET||(h&&p?(this.label.innerText=this.state.locale.$label[h]||h,Object.assign(this.label.style,{backgroundColor:`#${u}`,borderRadius:"3px",padding:"3px 5px",color:d(u)>.5?"black":"white",textTransform:"uppercase",marginRight:"5px",marginLeft:"5px",fontSize:"0.7em",lineHeight:1,display:""})):this.label.style.display="none"),this.title.innerText=this.state.widget.overrideState&&this.state.widget.overrideState.title?this.state.widget.overrideState.title:a,this.state.boosterPosts&&this.state.boosterPosts.bar&&"notification"===this.state.boosterPosts.bar.type){const t=this.state.boosterPosts.bar.redirectUrl;t?(this.bar.href=t,this.bar.target="_blank"):(this.bar.href="#",this.bar.target="_self")}else if(this.state.widget.overrideState){const t=this.state.widget.overrideState.url;t?(this.bar.href=t,this.bar.target="_blank"):(this.bar.href="#",this.bar.target="_self")}else this.bar.href=l,this.bar.target="_blank";let S=screen.width<700;!c||S||this.isNotifyEndUsers?(this.cta.style.display="none",this.cta.innerText=""):(this.cta.innerText=c,this.cta.style.display="block"),Object.assign(this.bar.style,k),this.isNotifyEndUsers&&(v=1),this.conf.landingMode||this.showdelaytimer||(this.state.preview?this._show():this.showdelaytimer=setTimeout(this._show,1e3*v))}),(t=>({disabled:!!t.widget.options["booster-common-disabled"]||!!t.widget.options["booster-bar-disabled"],sticky:!t.widget.options["booster-bar-absolute"],bottom:!!t.widget.options["booster-bar-bottom"],showLabel:!t.widget.options["booster-bar-hide-label"],cta:t.widget.options["booster-bar-cta"],showunread:"unread"==t.widget.options["booster-bar-visibility"],backgroundColor:String(t.widget.options["booster-bar-background-color"]||"5b64af"),color:String(t.widget.options["booster-bar-color"]||"ebf5ff"),fontSize:String(t.widget.options["booster-bar-font-size"]||"1"),showdelay:Number(t.widget.options["booster-bar-show-delay"]),hidedelay:Number(t.widget.options["booster-bar-hide-delay"]),title:t.boosterPosts?.bar?.title,url:t.boosterPosts?.bar?.url,labelName:t.boosterPosts?.bar?.labels?.[0]?.name,labelColor:t.boosterPosts?.bar?.labels?.[0]?.color,visibleAt:t.boosterPosts?.bar?.visible_at||0,overrideState:t.widget.overrideState,notifyState:t.widget.notify,unread:t.ui.unreadCount,lastRead:t.userData?.lastRead||0,boostersViewsMap:t.ui.boostersViewsMap})))})),s(this,"hidetimer",null),s(this,"_show",(()=>{this.hidetimer&&(clearTimeout(this.hidetimer),this.hidetimer=null),document.body.classList.add(`${this.cssid}-body`),this.bar.classList.add(`${this.cssid}-inactive`),setTimeout((()=>{this.bar.classList.remove(`${this.cssid}-inactive`),this.bar.classList.add(`${this.cssid}-active`)}),50);const t=Number(this.state.widget.options["booster-bar-hide-delay"]);t>0&&!this.state.preview&&!this.isNotifyEndUsers&&setTimeout(this._hide,1e3*t),this.parent.sendBeacon({event_type:"widget-booster-show",custom_1:"bar",post_id:Number(this.post?.id)||void 0}),this.parent.trigger("booster-show",{boster:"bar",post_id:this.post?.id,post_title:this.post?.title,post_url:this.post?.url})})),s(this,"show",this._show),s(this,"_hide",(()=>{this.hidetimer||(this.bar.classList.remove(`${this.cssid}-active`),this.bar.classList.add(`${this.cssid}-inactive`),this.hidetimer=setTimeout((()=>{document.body.classList.remove(`${this.cssid}-body`),this.bar.classList.remove(`${this.cssid}-inactive`),this.hidetimer=null}),500))})),s(this,"hide",this._hide),s(this,"_createCSS",(()=>{let t=Math.random().toString(36).substr(2,9).toLowerCase();this.state.preview&&(t="preview");let e=m(`\n .${y}-${t}-body {\n position: static;\n }\n \n .${y}-${t}-body:before {\n margin-top: calc(var(--announcekit-bar-font-multiplier, 1) * 2.5rem);\n content: ' ';\n display: block;\n }\n\n .${y}-${t} {\n position: absolute;\n box-shadow: rgba(0, 0, 0, 0.18) 0px 1px 7px 0px;\n z-index: 2147483000;\n display: none;\n height: calc(var(--announcekit-bar-font-multiplier, 1) * 2.5rem);\n cursor: pointer;\n left: 0px;\n right: 0px;\n width: 100%;\n font-size: calc(var(--announcekit-bar-font-multiplier, 1) * 1rem);\n justify-content: center;\n align-items: center;\n text-decoration: none;\n top: 0;\n transition-property: opacity transform;\n transition-duration: .5s;\n transition-timing-function: cubic-bezier(0, 1, 0.5, 1);\n }\n\n .${y}-${t}-inactive {\n display: flex;\n transform: translateY(-100%);\n opacity: 0;\n }\n\n span.${y}-cta {\n background-color: rgba(255,255,2555, 0.15);\n border-radius: 3px;\n padding: 3px 5px;\n margin-left: 5px;\n font-size: 0.7em;\n display: none;\n transition: 0.1s linear all;\n line-height: 1;\n font-weight: 600;\n }\n\n .${y}-${t} .${y}-title {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n padding: 0 0.5rem;\n text-transform: none !important;\n }\n\n .${y}-${t}:hover span.${y}-cta {\n background-color: rgba(255,255,2555, 0.2);\n }\n\n .${y}-${t} .${y}-close {\n cursor: pointer;\n right: 1rem;\n position:absolute;\n opacity: 0;\n transition: .2s linear opacity;\n }\n\n .${y}-${t}:hover .${y}-close {\n opacity: 1;\n }\n\n .${y}-${t}-active {\n display: flex;\n transform: translateY(0);\n opacity: 1;\n }\n\n @media screen and (max-width: 700px) {\n .${y}-${t} .${y}-close {\n right: 0.75rem;\n opacity: 1;\n }\n\n .${y}-${t} .${y}-title {\n padding-right: 1.5rem;\n }\n }\n `);return this.on("destroy",(()=>{e.parentElement?.removeChild(e)})),`${y}-${t}`})),this.cssid=this._createCSS(),this.bar=document.createElement("a"),this.bar.className=`${this.cssid} ${y}`,this.isNotifyEndUsers=this.state.boosterPosts&&this.state.boosterPosts.bar&&this.state.boosterPosts.bar.type===b.NOTIFICATION,t.state.boosterPosts&&t.state.boosterPosts.bar&&"notification"===t.state.boosterPosts.bar.type?(this.bar.href="#",this.bar.target="_self"):(this.bar.href=t.state.feed.url,this.bar.target="_blank"),this.bar.innerHTML=v,this.label=this.bar.querySelector(`.${y}-label`),this.title=this.bar.querySelector(`.${y}-title`),this.cta=this.bar.querySelector(`.${y}-cta`),document.body.appendChild(this.bar),this.bar.addEventListener("click",(t=>{if(t.target.classList.contains(`${y}-close`))return t.preventDefault(),t.stopImmediatePropagation(),void(this.state.preview||(this._hide(),this.conf.landingMode||this.parent?.setRead()));let e=this.state.widget.options["booster-bar-action"];"widget"==e||"widget-single-post"==e?(t.preventDefault(),this.parent?.open(),this.parent?.showPost(this.post.id,{singular:"widget-single-post"==e})):this.parent?.setRead(),this.parent.sendBeacon({event_type:"widget-booster-click",custom_1:"bar",post_id:Number(this.post?.id)||void 0}),this.parent.trigger("booster-click",{boster:"bar",post_id:this.post?.id,post_title:this.post?.title,post_url:this.post?.url})})),this.on("destroy",(()=>{document.body.removeChild(this.bar)})),this._configure()}}const $="announcekit-booster-modal",k=`\n