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");
"use strict";(self.webpackChunkextract_css=self.webpackChunkextract_css||[]).push([["90246"],{214881:function(l){l.exports={}},760924:function(l){l.exports={}},600655:function(l,u,n){var o=n(561680)},561680:function(l,u,n){n.r(u);var o=n(325943),v=n.n(o),m=n(220150),g=n(760924),f=n.n(g),d=n(214881),h=n.n(d),L=n(685857);YUI.add("squarespace-simple-liking",function(t){var k=t.config.win.Static;t.Squarespace.SimpleLike={TEXT_LIKE_VERB_NONE:(0,o.t)("No Likes",null,{project:"scripts-v6-root"}),TEXT_LIKE_VERB_SINGULAR:(0,o.t)("Like",null,{project:"scripts-v6-root"}),TEXT_LIKE_VERB_PLURAL:(0,o.t)("Likes",null,{project:"scripts-v6-root"}),TEXT_LIKE_ACTIVATED:(0,o.t)("You like this",null,{project:"scripts-v6-root"}),TEXT_LIKE_SUGGEST:(0,o.t)("Click to like",null,{project:"scripts-v6-root"}),attached:!1,attach:function(){if(!this.attached){this.attached=!0;var e;try{localStorage&&(e=t.JSON.parse(localStorage.getItem("squarespace-likes")),e||(e={}),localStorage.setItem("squarespace-likes",t.JSON.stringify(e)))}catch(a){e={}}this.eventHandlers=[];var i=t.delegate("click",function(r){var s=r.currentTarget,c=s.getAttribute("data-item-id");if(c){for(var p=0;p<5;++p)t.Squarespace.SimpleLike.burst(s);s.hasClass("clicked")||s.hasClass("float")||m.default.like(c).then(function(_){if(_.commited===!0){if(s&&s.getDOMNode()){var E=parseInt(s.getAttribute("data-like-count"),10);s.setAttribute("data-like-count",E+1),t.Squarespace.SimpleLike.renderLikeCount(s),s.addClass("clicked")}try{localStorage&&(e[c]=!0,localStorage.setItem("squarespace-likes",t.JSON.stringify(e)))}catch(S){console.warn("Unable to save like to local storage: ",S)}}_.error&&((0,L.areCookiesEnabled)()||t.config.win.alert((0,o.t)("You need to enable cookies to be able to like something.",null,{project:"scripts-v6-root"})))}).catch(function(_){})}},"body",".sqs-simple-like");this.eventHandlers.push(i),t.all(".sqs-simple-like").each(function(a){var r=a.getAttribute("data-item-id");r&&(k.SQUARESPACE_CONTEXT.websiteSettings.simpleLikingEnabled||a.remove(),e[r]&&a.addClass("clicked"),m.default.getLikeCount(r).then(function(c){a.setAttribute("data-like-count",c),t.Squarespace.SimpleLike.renderLikeCount(a)}).catch(function(){t.Squarespace.SimpleLike.renderLikeCount(a)}))})}},detach:function(){this.attached=!1,this.eventHandlers.forEach(function(e){e.detach()})},renderLikeCount:function(i){var a=i&&i.getDOMNode?i.getDOMNode():i;if(!(!a||!a.ownerDocument||!a.ownerDocument.defaultView)){var r=i.getAttribute("data-item-id"),s=i.getAttribute("data-like-count"),c=i.one(".like-count");!r||!c||c.setContent(this.formatLikeText(s))}},formatLikeText:function(e){return e===0?t.Squarespace.SimpleLike.TEXT_LIKE_VERB_NONE:e===1?"1 "+t.Squarespace.SimpleLike.TEXT_LIKE_VERB_SINGULAR:e+" "+t.Squarespace.SimpleLike.TEXT_LIKE_VERB_PLURAL},burst:function(e){var i=e.cloneNode(!0);i.one(".like-count")&&i.one(".like-count").remove();var a=e.one(".like-icon");(!a||a.getStyle("display")==="none")&&(a=e),i.setStyles({position:"absolute",left:a.getX()+"px",top:a.getY()+"px"}),t.one(t.config.doc.body).append(i);var r=new t.Anim({node:i,duration:2,easing:t.Easing.easeOut});r.set("to",{curve:t.Squarespace.SimpleLike.randomCurve(i)}),r.on("end",function(){this.get("node").remove()}),r.run(),i.removeClass("clicked"),i.addClass("float")},randomCurve:function(e){for(var i=[],a=3,r=30,s=Math.floor(Math.random()*2)?1:-1,c=Math.floor(Math.random()*2)?1:-1,p=e.getX(),_=e.getY(),E=0;E<a;++E)p+=Math.floor(Math.random()*r)*s,_+=Math.floor(Math.random()*r)*c,i.push([p,_]);return i}},t.config.win.Squarespace.onInitialize(t,function(){k.SQUARESPACE_CONTEXT.websiteSettings.simpleLikingEnabled&&t.Squarespace.SimpleLike.attach()}),t.config.win.Squarespace.onDestroy(t,function(){t.Squarespace.SimpleLike.attached===!0&&t.Squarespace.SimpleLike.detach()})},"1.0",{requires:["anim","json","node","squarespace-util"]})},220150:function(l,u,n){Object.defineProperty(u,"__esModule",{value:!0}),Object.defineProperty(u,"default",{enumerable:!0,get:function(){return k}});var o=v(n(456903));function v(e){return e&&e.__esModule?e:{default:e}}var m=",",g=e=>o.default.post("/api/content-items/"+e+"/sentiment/like").then(i=>{var a=i.data;return a}),f=[],d=null,h=()=>{var e=f.map(i=>i.itemId).join(m);o.default.get("/api/blog-like-count/".concat(e)).then(i=>{var a=i.data;f.forEach(r=>{if(a.hasOwnProperty(r.itemId)){r.resolve(a[r.itemId]);return}r.reject()}),f=[],d=null})},L=e=>new Promise((i,a)=>{f.push({itemId:e,resolve:i,reject:a}),d!==null&&clearTimeout(d),d=setTimeout(h,100)}),t=e=>L(e),k={like:g,getLikeCount:t}},685857:function(l,u){Object.defineProperty(u,"__esModule",{value:!0}),Object.defineProperty(u,"areCookiesEnabled",{enumerable:!0,get:function(){return n}});function n(){try{if(!("cookie"in document))return!1;var o="_testCookieName";return document.cookie=o,document.cookie.includes(o)}catch(v){return!1}}}},function(l){var u=function(o){return l(l.s=o)};l.O(0,["96135","98338"],function(){return u("600655")});var n=l.O()}]);

//# sourceMappingURL=https://sourcemaps.squarespace.net/universal/scripts-compressed/sourcemaps/b4c6f2739146d6e5/simple-liking-b76ae7bcbecc9533-min.en-US.js.map
}