var _____WB$wombat$assign$function_____=function(name){return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name))||self[name];};if(!self.__WB_pmw){self.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}{
let window = _____WB$wombat$assign$function_____("window");
let self = _____WB$wombat$assign$function_____("self");
let document = _____WB$wombat$assign$function_____("document");
let location = _____WB$wombat$assign$function_____("location");
let top = _____WB$wombat$assign$function_____("top");
let parent = _____WB$wombat$assign$function_____("parent");
let frames = _____WB$wombat$assign$function_____("frames");
let opens = _____WB$wombat$assign$function_____("opens");
(self.webpackChunkextract_css=self.webpackChunkextract_css||[]).push([[77751],{418768:function(s,l,u){"use strict";var c=u(80171)},80171:function(s,l,u){"use strict";u.r(l);var c=u(24362),k=u(692576),m=u.n(k),g=u(322838),f=u.n(g),d=u(727325),L=u.n(d);YUI.add("squarespace-simple-liking",function(e){var E=e.config.win.Static;e.Squarespace.SimpleLike={TEXT_LIKE_VERB_NONE:(0,c.t)("No Likes"),TEXT_LIKE_VERB_SINGULAR:(0,c.t)("Like"),TEXT_LIKE_VERB_PLURAL:(0,c.t)("Likes"),TEXT_LIKE_ACTIVATED:(0,c.t)("You like this"),TEXT_LIKE_SUGGEST:(0,c.t)("Click to like"),attached:!1,attach:function(){if(!this.attached){this.attached=!0;var a;try{localStorage&&(a=e.JSON.parse(localStorage.getItem("squarespace-likes")),a||(a={}),localStorage.setItem("squarespace-likes",e.JSON.stringify(a)))}catch(t){a={}}this.eventHandlers=[];var i=e.delegate("click",function(r){var n=r.currentTarget,o=n.getAttribute("data-item-id");if(!!o){for(var p=0;p<5;++p)e.Squarespace.SimpleLike.burst(n);n.hasClass("clicked")||n.hasClass("float")||m().like(o).then(function(_){if(_.commited===!0){if(n&&n.getDOMNode()){var v=parseInt(n.getAttribute("data-like-count"),10);n.setAttribute("data-like-count",v+1),e.Squarespace.SimpleLike.renderLikeCount(n),n.addClass("clicked")}try{localStorage&&(a[o]=!0,localStorage.setItem("squarespace-likes",e.JSON.stringify(a)))}catch(h){console.warn("Unable to save like to local storage: ",h)}}_.error&&(e.Squarespace.Utils.areCookiesEnabled()||e.config.win.alert((0,c.t)("You need to enable cookies to be able to like something.")))}).catch(function(_){})}},"body",".sqs-simple-like");this.eventHandlers.push(i),e.all(".sqs-simple-like").each(function(t){var r=t.getAttribute("data-item-id");!r||(E.SQUARESPACE_CONTEXT.websiteSettings.simpleLikingEnabled||t.remove(),a[r]&&t.addClass("clicked"),m().getLikeCount(r).then(function(o){t.setAttribute("data-like-count",o),e.Squarespace.SimpleLike.renderLikeCount(t)}).catch(function(){e.Squarespace.SimpleLike.renderLikeCount(t)}))})}},detach:function(){this.attached=!1,this.eventHandlers.forEach(function(a){a.detach()})},renderLikeCount:function(i){var t=i&&i.getDOMNode?i.getDOMNode():i;if(!(!t||!t.ownerDocument||!t.ownerDocument.defaultView)){var r=i.getAttribute("data-item-id"),n=i.getAttribute("data-like-count"),o=i.one(".like-count");!r||!o||o.setContent(this.formatLikeText(n))}},formatLikeText:function(a){return a===0?e.Squarespace.SimpleLike.TEXT_LIKE_VERB_NONE:a===1?"1 "+e.Squarespace.SimpleLike.TEXT_LIKE_VERB_SINGULAR:a+" "+e.Squarespace.SimpleLike.TEXT_LIKE_VERB_PLURAL},burst:function(a){var i=a.cloneNode(!0);i.one(".like-count")&&i.one(".like-count").remove();var t=a.one(".like-icon");(!t||t.getStyle("display")==="none")&&(t=a),i.setStyles({position:"absolute",left:t.getX()+"px",top:t.getY()+"px"}),e.one(e.config.doc.body).append(i);var r=new e.Anim({node:i,duration:2,easing:e.Easing.easeOut});r.set("to",{curve:e.Squarespace.SimpleLike.randomCurve(i)}),r.on("end",function(){this.get("node").remove()}),r.run(),i.removeClass("clicked"),i.addClass("float")},randomCurve:function(a){for(var i=[],t=3,r=30,n=Math.floor(Math.random()*2)?1:-1,o=Math.floor(Math.random()*2)?1:-1,p=a.getX(),_=a.getY(),v=0;v<t;++v)p+=Math.floor(Math.random()*r)*n,_+=Math.floor(Math.random()*r)*o,i.push([p,_]);return i}},e.config.win.Squarespace.onInitialize(e,function(){E.SQUARESPACE_CONTEXT.websiteSettings.simpleLikingEnabled&&e.Squarespace.SimpleLike.attach()}),e.config.win.Squarespace.onDestroy(e,function(){e.Squarespace.SimpleLike.attached===!0&&e.Squarespace.SimpleLike.detach()})},"1.0",{requires:["anim","json","node","squarespace-util"]})},727325:function(s){s.exports={}},322838:function(s){s.exports={}},692576:function(s,l,u){"use strict";var c=u(545563);Object.defineProperty(l,"__esModule",{value:!0}),l.default=void 0;var k=c(u(770667)),m=",",g=function(t){return k.default.post("/api/content-items/"+t+"/sentiment/like").then(function(r){var n=r.data;return n})},f=[],d=null,L=function(){var t=f.map(function(r){return r.itemId}).join(m);k.default.get("/api/blog-like-count/".concat(t)).then(function(r){var n=r.data;f.forEach(function(o){if(n.hasOwnProperty(o.itemId)){o.resolve(n[o.itemId]);return}o.reject()}),f=[],d=null})},e=function(t){return new Promise(function(r,n){f.push({itemId:t,resolve:r,reject:n}),d!==null&&clearTimeout(d),d=setTimeout(L,100)})},E=function(t){return e(t)},a={like:g,getLikeCount:E};l.default=a,s.exports=l.default},392338:function(s){"use strict";s.exports=void 0}},function(s){var l=function(c){return s(s.s=c)};s.O(0,[80276,46001],function(){return l(418768)});var u=s.O()}]);
//# sourceMappingURL=https://sourcemaps.squarespace.net/universal/scripts-compressed/simple-liking-2506d026931e84d5eec8e-min.en-US.js.map

}