Google
Edit File: tourdates-0fb5fe4e3faab17f28f7-min.js
webpackJsonp([30],{0:function(u,v,b){b(3413);b(1802);b(557);b(461);b(1442);b(1542)},461:function(u,v){YUI.add("model",function(b,h){function c(){c.superclass.constructor.apply(this,arguments)}var k=YUI.namespace("Env.Model"),m=b.Lang,f=b.Array,a=b.Object,e="error";b.Model=b.extend(c,b.Base,{idAttribute:"id",_allowAdHocAttrs:!0,_isYUIModel:!0,initializer:function(s){this.changed={};this.lastChange={};this.lists=[]},destroy:function(s,a){var e=this;"function"===typeof s&&(a=s,s=null);e.onceAfter("destroy", function(){function c(b){b||f.each(e.lists.concat(),function(a){a.remove(e,s)});a&&a.apply(null,arguments)}s&&(s.remove||s["delete"])?e.sync("delete",s,c):c()});return c.superclass.destroy.call(e)},generateClientId:function(){k.lastId||(k.lastId=0);return this.constructor.NAME+"_"+(k.lastId+=1)},getAsHTML:function(a){a=this.get(a);return b.Escape.html(m.isValue(a)?String(a):"")},getAsURL:function(a){a=this.get(a);return encodeURIComponent(m.isValue(a)?String(a):"")},isModified:function(){return this.isNew()|| !a.isEmpty(this.changed)},isNew:function(){return!m.isValue(this.get("id"))},load:function(a,t){var c=this;"function"===typeof a&&(t=a,a={});a||(a={});c.sync("read",a,function(b,f){var h={options:a,response:f},k;b?(h.error=b,h.src="load",c.fire(e,h)):(c._loadEvent||(c._loadEvent=c.publish("load",{preventable:!1})),k=h.parsed=c._parse(f),c.setAttrs(k,a),c.changed={},c.fire("load",h));t&&t.apply(null,arguments)});return c},parse:function(a){if("string"===typeof a)try{return b.JSON.parse(a)}catch(t){return this.fire(e, {error:t,response:a,src:"parse"}),null}return a},save:function(a,t){var c=this;"function"===typeof a&&(t=a,a={});a||(a={});c._validate(c.toJSON(),function(b){b?t&&t.call(null,b):c.sync(c.isNew()?"create":"update",a,function(b,f){var q={options:a,response:f},h;b?(q.error=b,q.src="save",c.fire(e,q)):(c._saveEvent||(c._saveEvent=c.publish("save",{preventable:!1})),f&&(h=q.parsed=c._parse(f),c.setAttrs(h,a)),c.changed={},c.fire("save",q));t&&t.apply(null,arguments)})});return c},set:function(a,e,c){var b= {};b[a]=e;return this.setAttrs(b,c)},setAttrs:function(e,c){var f=this.idAttribute,q,r,h,k;c=b.merge(c);k=c._transaction={};"id"!==f&&(e=b.merge(e),a.owns(e,f)?e.id=e[f]:a.owns(e,"id")&&(e[f]=e.id));for(r in e)a.owns(e,r)&&this._setAttr(r,e[r],c);if(!a.isEmpty(k)){f=this.changed;h=this.lastChange={};for(r in k)a.owns(k,r)&&(q=k[r],f[r]=q.newVal,h[r]={newVal:q.newVal,prevVal:q.prevVal,src:q.src||null});c.silent||(this._changeEvent||(this._changeEvent=this.publish("change",{preventable:!1})),c.changed= h,this.fire("change",c))}return this},sync:function(){var a=f(arguments,0,!0).pop();"function"===typeof a&&a()},toJSON:function(){var a=this.getAttrs();delete a.clientId;delete a.destroyed;delete a.initialized;"id"!==this.idAttribute&&delete a.id;return a},undo:function(e,c){var b=this.lastChange,q=this.idAttribute,h={},k;e||(e=a.keys(b));f.each(e,function(e){a.owns(b,e)&&(e=e===q?"id":e,k=!0,h[e]=b[e].prevVal)});return k?this.setAttrs(h,c):this},validate:function(a,e){e&&e()},addAttr:function(a, e,b){var f=this.idAttribute,h;f&&a===f&&(f=this._isLazyAttr("id")||this._getAttrCfg("id"),h=e.value===e.defaultValue?null:e.value,m.isValue(h)||(h=f.value===f.defaultValue?null:f.value,m.isValue(h)||(h=m.isValue(e.defaultValue)?e.defaultValue:f.defaultValue)),e.value=h,f.value!==h&&(f.value=h,this._isLazyAttr("id")?this._state.add("id","lazy",f):this._state.add("id","value",h)));return c.superclass.addAttr.apply(this,arguments)},_parse:function(a){return this.parse(a)},_validate:function(a,c){function b(h){m.isValue(h)? (f.fire(e,{attributes:a,error:h,src:"validate"}),c(h)):c()}var f=this;1===f.validate.length?b(f.validate(a,b)):f.validate(a,b)},_setAttrVal:function(a,e,b,f,h,k){var m=c.superclass._setAttrVal.apply(this,arguments),u=h&&h._transaction,v=k&&k.initializing;m&&(u&&!v)&&(u[a]={newVal:this.get(a),prevVal:b,src:h.src||null});return m}},{NAME:"model",ATTRS:{clientId:{valueFn:"generateClientId",readOnly:!0},id:{value:null}}})},"3.17.2",{requires:["base-build","escape","json-parse"]})},557:function(u,v){YUI.add("model-list", function(b,h){function c(){c.superclass.constructor.apply(this,arguments)}var k=b.Attribute.prototype,m=b.Lang,f=b.Array;b.ModelList=b.extend(c,b.Base,{model:b.Model,_isYUIModelList:!0,initializer:function(a){a||(a={});var e=this.model=a.model||this.model;"string"===typeof e&&((this.model=b.Object.getValue(b,e.split(".")))||b.error("ModelList: Model class not found: "+e));this.publish("add",{defaultFn:this._defAddFn});this.publish("reset",{defaultFn:this._defResetFn});this.publish("remove",{defaultFn:this._defRemoveFn}); this.after("*:idChange",this._afterIdChange);this._clear();a.items&&this.add(a.items,{silent:!0})},destructor:function(){this._clear()},add:function(a,e){var c=a._isYUIModelList;return c||m.isArray(a)?f.map(c?a.toArray():a,function(a,c){var s=e||{};"index"in s&&(s=b.merge(s,{index:s.index+c}));return this._add(a,s)},this):this._add(a,e)},create:function(a,e,c){var f=this;"function"===typeof e&&(c=e,e={});e||(e={});a._isYUIModel||(a=new this.model(a));f.fire("create",b.merge(e,{model:a}));return a.save(e, function(b){b||f.add(a,e);c&&c.apply(null,arguments)})},each:function(a,e){var c=this._items.concat(),b,f,h;b=0;for(h=c.length;b<h;b++)f=c[b],a.call(e||f,f,b,this);return this},filter:function(a,e){var c=[],b=this._items,f,h,k;"function"===typeof a&&(e=a,a={});f=0;for(k=b.length;f<k;++f)h=b[f],e.call(this,h,f,this)&&c.push(h);return a.asList?(b=new this.constructor({model:this.model}),c.length&&b.add(c,{silent:!0}),b):c},get:function(a){return this.attrAdded(a)?k.get.apply(this,arguments):this.invoke("get", a)},getAsHTML:function(a){return this.attrAdded(a)?b.Escape.html(k.get.apply(this,arguments)):this.invoke("getAsHTML",a)},getAsURL:function(a){return this.attrAdded(a)?encodeURIComponent(k.get.apply(this,arguments)):this.invoke("getAsURL",a)},getByClientId:function(a){return this._clientIdMap[a]||null},getById:function(a){return this._idMap[a]||null},invoke:function(a){var e=[this._items,a].concat(f(arguments,1,!0));return f.invoke.apply(f,e)},load:function(a,e){var c=this;"function"===typeof a&& (e=a,a={});a||(a={});this.sync("read",a,function(b,f){var h={options:a,response:f},k;b?(h.error=b,h.src="load",c.fire("error",h)):(c._loadEvent||(c._loadEvent=c.publish("load",{preventable:!1})),k=h.parsed=c._parse(f),c.reset(k,a),c.fire("load",h));e&&e.apply(null,arguments)});return this},map:function(a,e){return f.map(this._items,a,e)},parse:function(a){if("string"===typeof a)try{return b.JSON.parse(a)||[]}catch(e){return this.fire("error",{error:e,response:a,src:"parse"}),null}return a||[]},remove:function(a, e){var c=a._isYUIModelList;return c||m.isArray(a)?(a=f.map(c?a.toArray():a,function(a){return m.isNumber(a)?this.item(a):a},this),f.map(a,function(a){return this._remove(a,e)},this)):this._remove(a,e)},reset:function(a,e){a||(a=[]);e||(e={});var c=b.merge({src:"reset"},e);a=a._isYUIModelList?a.toArray():f.map(a,function(a){return a._isYUIModel?a:new this.model(a)},this);c.models=a;e.silent?this._defResetFn(c):(this.comparator&&a.sort(b.bind(this._sort,this)),this.fire("reset",c));return this},some:function(a, e){var c=this._items.concat(),b,f,h;b=0;for(h=c.length;b<h;b++)if(f=c[b],a.call(e||f,f,b,this))return!0;return!1},sort:function(a){if(!this.comparator)return this;var e=this._items.concat();a||(a={});e.sort(b.rbind(this._sort,this,a));e=b.merge(a,{models:e,src:"sort"});a.silent?this._defResetFn(e):this.fire("reset",e);return this},sync:function(){var a=f(arguments,0,!0).pop();"function"===typeof a&&a()},toArray:function(){return this._items.concat()},toJSON:function(){return this.map(function(a){return a.toJSON()})}, _add:function(a,e){var c;e||(e={});a._isYUIModel||(a=new this.model(a));c=a.get("id");if(this._clientIdMap[a.get("clientId")]||m.isValue(c)&&this._idMap[c])this.fire("error",{error:"Model is already in the list.",model:a,src:"add"});else return c=b.merge(e,{index:"index"in e?e.index:this._findIndex(a),model:a}),e.silent?this._defAddFn(c):this.fire("add",c),a},_attachList:function(a){a.lists.push(this);a.addTarget(this)},_clear:function(){f.each(this._items,this._detachList,this);this._clientIdMap= {};this._idMap={};this._items=[]},_compare:function(a,e){return a<e?-1:a>e?1:0},_detachList:function(a){var e=f.indexOf(a.lists,this);-1<e&&(a.lists.splice(e,1),a.removeTarget(this))},_findIndex:function(a){var e=this._items,c=e.length,b=0,f,h;if(!this.comparator||!c)return c;for(h=this.comparator(a);b<c;)f=b+c>>1,a=e[f],0>this._compare(this.comparator(a),h)?b=f+1:c=f;return b},_parse:function(a){return this.parse(a)},_remove:function(a,c){var f;c||(c={});m.isNumber(a)?(f=a,a=this.item(f)):f=this.indexOf(a); if(-1===f||!a)this.fire("error",{error:"Model is not in the list.",index:f,model:a,src:"remove"});else return f=b.merge(c,{index:f,model:a}),c.silent?this._defRemoveFn(f):this.fire("remove",f),a},_sort:function(a,c,f){a=this._compare(this.comparator(a),this.comparator(c));return 0===a?a:f&&f.descending?-a:a},_afterIdChange:function(a){var c=a.newVal,f=a.prevVal;a=a.target;if(m.isValue(f))if(this._idMap[f]===a)delete this._idMap[f];else return;else if(-1===this.indexOf(a))return;m.isValue(c)&&(this._idMap[c]= a)},_defAddFn:function(a){var c=a.model,f=c.get("id");this._clientIdMap[c.get("clientId")]=c;m.isValue(f)&&(this._idMap[f]=c);this._attachList(c);this._items.splice(a.index,0,c)},_defRemoveFn:function(a){var c=a.model,f=c.get("id");this._detachList(c);delete this._clientIdMap[c.get("clientId")];m.isValue(f)&&delete this._idMap[f];this._items.splice(a.index,1)},_defResetFn:function(a){"sort"===a.src?this._items=a.models.concat():(this._clear(),a.models.length&&this.add(a.models,{silent:!0}))}},{NAME:"modelList"}); b.augment(c,b.ArrayList)},"3.17.2",{requires:"array-extras array-invoke arraylist base-build escape json-parse model".split(" ")})},1442:function(u,v){YUI.add("squarespace-hb-compare",function(b){b.Handlebars.registerHelper("if_eq",function(b,c){return b==c.hash.compare?c.fn(this):c.inverse(this)});b.Handlebars.registerHelper("unless_eq",function(b,c){return b==c.hash.compare?c.inverse(this):c.fn(this)});b.Handlebars.registerHelper("if_gt",function(b,c){return b>c.hash.compare?c.fn(this):c.inverse(this)}); b.Handlebars.registerHelper("unless_gt",function(b,c){return b>c.hash.compare?c.inverse(this):c.fn(this)});b.Handlebars.registerHelper("if_lt",function(b,c){return b<c.hash.compare?c.fn(this):c.inverse(this)});b.Handlebars.registerHelper("unless_lt",function(b,c){return b<c.hash.compare?c.inverse(this):c.fn(this)});b.Handlebars.registerHelper("if_gteq",function(b,c){return b>=c.hash.compare?c.fn(this):c.inverse(this)});b.Handlebars.registerHelper("unless_gteq",function(b,c){return b>=c.hash.compare? c.inverse(this):c.fn(this)});b.Handlebars.registerHelper("if_lteq",function(b,c){return b<=c.hash.compare?c.fn(this):c.inverse(this)});b.Handlebars.registerHelper("unless_lteq",function(b,c){return b<=c.hash.compare?c.inverse(this):c.fn(this)})},"1.0",{requires:["handlebars-base"]})},1542:function(u,v){YUI.add("squarespace-tourdates-bandsintown-list-template",function(b){var h=b.Handlebars;(function(){var c=h.template;(h.templates=h.templates||{})["tourdates-bandsintown-list.html"]=c(function(c,b, f,a,e){function h(a,c){var e;return(e=f["if"].call(a,a.errors,{hash:{},inverse:l.program(5,u,c),fn:l.program(3,t,c),data:c}))||0===e?e:""}function t(a,c){return""}function u(a,c){var e="",g,b;if((b=f["if"].call(a,(g=c,null==g||!1===g?g:g.index),{hash:{},inverse:l.noop,fn:l.program(6,q,c),data:c}))||0===b)e+=b;e+='\n {\n "@context": "http://schema.org",\n "@type": "MusicEvent",\n "name": "';(b=f.title)?b=b.call(a,{hash:{},data:c}):(b=a.title,b=typeof b===n?b.apply(a):b);e+=p(b)+'",\n "image": "'+ p((g=(g=(g=a.artists,null==g||!1===g?g:g[0]),null==g||!1===g?g:g.image_url),typeof g===n?g.apply(a):g))+'",\n "startDate": "';(b=f.datetime)?b=b.call(a,{hash:{},data:c}):(b=a.datetime,b=typeof b===n?b.apply(a):b);e+=p(b)+'",\n "url": "';(b=f.ticket_url)?b=b.call(a,{hash:{},data:c}):(b=a.ticket_url,b=typeof b===n?b.apply(a):b);e+=p(b)+'",\n "location": {\n "@type": "Place",\n "name": "'+p((g=(g=a.venue,null==g||!1===g?g:g.name),typeof g===n?g.apply(a):g))+'",\n "address": {\n "@type": "PostalAddress",\n "addressCountry": "'+ p((g=(g=a.venue,null==g||!1===g?g:g.country),typeof g===n?g.apply(a):g))+'",\n "addressLocality": "'+p((g=(g=a.venue,null==g||!1===g?g:g.city),typeof g===n?g.apply(a):g))+'",\n "addressRegion": ""\n },\n "geo": {\n "@type": "GeoCoordinates",\n "latitude": '+p((g=(g=a.venue,null==g||!1===g?g:g.latitude),typeof g===n?g.apply(a):g))+',\n "longitude": '+p((g=(g=a.venue,null==g||!1===g?g:g.longitude),typeof g===n?g.apply(a): g))+'\n }\n },\n "performer": [\n {\n "@type": "MusicGroup",\n "name": "'+p((g=(g=(g=a.artists,null==g||!1===g?g:g[0]),null==g||!1===g?g:g.name),typeof g===n?g.apply(a):g))+'",\n "sameAs": "http://www.bandsintown.com"\n }\n ],\n "offers": [\n {\n "@type": "Offer",\n "url": "';(b=f.ticket_url)?b=b.call(a,{hash:{},data:c}):(b=a.ticket_url,b=typeof b===n?b.apply(a):b);e+=p(b)+'",\n "availability": "'; b={hash:{},inverse:l.noop,fn:l.program(8,r,c),data:c};if((b=(g=f["equals-string"]||a["equals-string"],g?g.call(a,a.ticket_status,"available",b):x.call(a,"equals-string",a.ticket_status,"available",b)))||0===b)e+=b;b={hash:{},inverse:l.noop,fn:l.program(10,v,c),data:c};if((b=(g=f["equals-string"]||a["equals-string"],g?g.call(a,a.ticket_status,"unavailable",b):x.call(a,"equals-string",a.ticket_status,"unavailable",b)))||0===b)e+=b;return e+'",\n "category": "primary"\n }\n ]\n }\n '} function q(a,c){return","}function r(a,c){return"InStock"}function v(a,c){return"SoldOUT"}function z(a,c){var b,g;b="\n\n ";if((g=f["if"].call(a,a.errors,{hash:{},inverse:l.program(17,C,c),fn:l.program(14,A,c),data:c}))||0===g)b+=g;return b+"\n\n "}function A(a,c){var b,g;b="\n\n ";if((g=f.each.call(a,a.errors,{hash:{},inverse:l.noop,fn:l.program(15,B,c),data:c}))||0===g)b+=g;return b+"\n\n "}function B(a,c){var b;return b=""+('\n <li class="tour-item-error">\n <div class="state-message">'+ p(typeof a===n?a.apply(a):a)+"</div>\n </li>\n ")}function C(a,c){var b,g,e;b='\n\n <li class="tour-item">\n\n <div class="tour-timeframe" data-tour-datetime="';(g=f.datetime)?g=g.call(a,{hash:{},data:c}):(g=a.datetime,g=typeof g===n?g.apply(a):g);b+=p(g)+'">\n <div class="tour-date">';e={hash:{format:"date"},data:c};b+=p((g=f["tourdates-bit-datetime"]||a["tourdates-bit-datetime"],g?g.call(a,a.datetime,e):x.call(a,"tourdates-bit-datetime",a.datetime,e)))+'</div>\n <div class="tour-weekday">'; e={hash:{format:"weekday"},data:c};b+=p((g=f["tourdates-bit-datetime"]||a["tourdates-bit-datetime"],g?g.call(a,a.datetime,e):x.call(a,"tourdates-bit-datetime",a.datetime,e)))+'</div>\n </div>\n\n <div class="tour-venue">\n <a href="';(e=f.facebook_rsvp_url)?e=e.call(a,{hash:{},data:c}):(e=a.facebook_rsvp_url,e=typeof e===n?e.apply(a):e);b+=p(e)+'" class="tour-venue-link" target="_blank">\n \n <div class="tour-venue-name">'+p((g=(g=a.venue,null== g||!1===g?g:g.name),typeof g===n?g.apply(a):g))+"</div>\n\n ";e={hash:{compare:1},inverse:l.noop,fn:l.program(18,D,c),data:c};if((e=(g=f.if_gt||a.if_gt,g?g.call(a,(g=a.artists,null==g||!1===g?g:g.length),e):x.call(a,"if_gt",(g=a.artists,null==g||!1===g?g:g.length),e)))||0===e)b+=e;b+='\n\n </a>\n </div>\n\n <div class="tour-location"><a href="';(e=f.facebook_rsvp_url)?e=e.call(a,{hash:{},data:c}):(e=a.facebook_rsvp_url,e=typeof e===n?e.apply(a):e);b+=p(e)+ '" class="tour-location-link" target="_blank">';(e=f.formatted_location)?e=e.call(a,{hash:{},data:c}):(e=a.formatted_location,e=typeof e===n?e.apply(a):e);b+=p(e)+'</a></div>\n\n <div class="tour-actions">\n <a href="';if((e=f["if"].call(a,a.ticket_url,{hash:{},inverse:l.program(24,E,c),fn:l.program(22,F,c),data:c}))||0===e)b+=e;b+='" class="tour-button tour-button--ticket ';e={hash:{},inverse:l.noop,fn:l.program(26,G,c),data:c};if((e=(g=f["equals-string"]||a["equals-string"], g?g.call(a,a.ticket_type,"Sold Out",e):x.call(a,"equals-string",a.ticket_type,"Sold Out",e)))||0===e)b+=e;b+=" ";if((e=f["if"].call(a,a.ticket_url,{hash:{},inverse:l.program(28,H,c),fn:l.program(3,t,c),data:c}))||0===e)b+=e;b+=' sqs-editable-button " target="';if((e=f["if"].call(a,a.ticket_url,{hash:{},inverse:l.program(32,I,c),fn:l.program(30,J,c),data:c}))||0===e)b+=e;b+='">';(e=f.ticket_type)?e=e.call(a,{hash:{},data:c}):(e=a.ticket_type,e=typeof e===n?e.apply(a):e);b+=p(e)+'</a>\n <a href="'; (e=f.facebook_rsvp_url)?e=e.call(a,{hash:{},data:c}):(e=a.facebook_rsvp_url,e=typeof e===n?e.apply(a):e);return b+=p(e)+'" class="tour-button tour-button--rsvp sqs-editable-button" target="_blank"></a>\n </div>\n\n </li>\n \n '}function D(a,c){var b,e;b='\n <div class="tour-lineup">\n ';if((e=f.each.call(a,a.artists,{hash:{},inverse:l.noop,fn:l.program(19,K,c),data:c}))||0===e)b+=e;return b+"\n </div>\n "}function K(a, c){var b,e,h;b="\n ";h={hash:{compare:0},inverse:l.noop,fn:l.program(20,L,c),data:c};if((h=(e=f.if_gt||a.if_gt,e?e.call(a,(e=c,null==e||!1===e?e:e.index),h):x.call(a,"if_gt",(e=c,null==e||!1===e?e:e.index),h)))||0===h)b+=h;return b+"\n "}function L(a,c){var e,b;e='\n <div class="tour-lineup-item">';(b=f.name)?b=b.call(a,{hash:{},data:c}):(b=a.name,b=typeof b===n?b.apply(a):b);return e+=p(b)+"</div>\n "}function F(a,b){var e;(e=f.ticket_url)? e=e.call(a,{hash:{},data:b}):(e=a.ticket_url,e=typeof e===n?e.apply(a):e);return p(e)}function E(a,e){return"#"}function G(a,e){return"tour-button--soldout"}function H(a,e){return"tour-button--disabled"}function J(a,e){return"_blank"}function I(a,e){return"_self"}this.compilerInfo=[4,">= 1.0.0"];f=this.merge(f,c.helpers);e=e||{};var w,l=this,n="function",p=this.escapeExpression,x=f.helperMissing,y=f.blockHelperMissing;c='<script type="application/ld+json">\n';if((a=f["if"].call(b,(w=b.data,null== w||!1===w?w:w.length),{hash:{},inverse:l.noop,fn:l.program(1,function(a,e){var b,c,k;b="\n[\n ";k={hash:{},inverse:l.noop,fn:l.program(2,h,e),data:e};(c=f.data)?c=c.call(a,k):(c=a.data,c=typeof c===n?c.apply(a):c);f.data||(c=y.call(a,c,k));if(c||0===c)b+=c;return b+"\n]\n"},e),data:e}))||0===a)c+=a;c+='\n\x3c/script>\n\n<ul class="tour-list">\n\n ';if((a=f["if"].call(b,(w=b.data,null==w||!1===w?w:w.length),{hash:{},inverse:l.program(34,function(a,e){return'\n\n <li class="tour-item-no-results"></li>\n\n '}, e),fn:l.program(12,function(a,e){var c,b,h;c="\n\n ";h={hash:{},inverse:l.noop,fn:l.program(13,z,e),data:e};(b=f.data)?b=b.call(a,h):(b=a.data,b=typeof b===n?b.apply(a):b);f.data||(b=y.call(a,b,h));if(b||0===b)c+=b;return c+"\n\n "},e),data:e}))||0===a)c+=a;return c+"\n\n</ul>"})})();b.Handlebars.registerPartial("tourdates-bandsintown-list.html".replace("/","."),h.templates["tourdates-bandsintown-list.html"])},"1.0",{requires:["handlebars-base"]})},1802:function(u,v,b){var h=b(1);YUI.add("squarespace-widgets-tourdates-bandsintown", function(b){function k(a,b,c){a+="";b+="";for(var f=a.length;f<c;f++)a=b+a;return a}function m(a){return[a.getFullYear(),k(a.getMonth()+1,0,2),k(a.getDate(),0,2)].join("-")}var f=b.Base.create("bandsInTownTourDatesListModel",b.ModelList,[],{sync:function(a,f,k){if("read"===a){a="squarespace-"+b.Object.getValue(Static,["SQUARESPACE_CONTEXT","website","identifier"]);f=encodeURIComponent(this.get("artistId"));var u=m(new Date(this.get("startDate"))),q=m(new Date(this.get("endDate"))),r;"upcoming"=== this.get("timeframe")?r="upcoming":"dateRange"===this.get("timeframe")&&(r=u+","+q);r="http://api.bandsintown.com/artists/"+f+"/events.json?api_version=2.0&app_id="+a+"&date="+r+"&callback={callback}";k=b.Lang.isFunction(k)?k:function(){};b.jsonp(r,{on:{success:function(a){a.errors&&(a=[a]);k(null,a)},failure:function(){k(h("Request failed!"));console.log("Request failed!")},timeout:function(){k(h("Request timed out."));console.log("Request timed out.")}},timeout:1E4})}else console.warn("Unsupported sync action: "+ a)}},{ATTRS:{artistId:{value:null},timeframe:{value:null},startDate:{value:null},endDate:{value:null}}});b.namespace("Squarespace.Widgets");var a=b.Squarespace.Widgets.BandsInTownTourDatesList=b.Base.create("bandsInTownTourDatesList",b.Squarespace.SSWidget,[],{initializer:function(){var a=this.get("boundingBox"),f=new b.Squarespace.Spinner({size:30,color:"dark",render:a});this._registerEvent(b.on("domready",function(){this.get("modelList").load(b.bind(function(){this.set("loaded",!0);a.addClass("loaded"); f.destroy()},this))},this))},bindUI:function(){a.superclass.bindUI.call(this);this.after("loadedChange",this.renderTemplateAgain,this);this._registerEvent(b.on("windowresize",function(){this.adjustLayout()},b.config.win,this))},adjustLayout:function(){var a=this.get("boundingBox");a.toggleClass("tourblock-has-small-container",450>a.get("offsetWidth"))},renderTemplateAgain:function(){this.adjustLayout();this.get("contentBox").empty().append(this.renderTemplate());this.appendStructuredData()},appendStructuredData:function(){var a= document.createElement("script");a.type="application/ld+json";a.text=this.get("contentBox").one("script").get("innerHTML");b.one("head").append(a)},_getHBTemplateContext:function(){return{data:this.get("modelList").toJSON()}}},{CSS_PREFIX:"sqs-tourdates-bandsintown-list",HANDLEBARS_TEMPLATE:"tourdates-bandsintown-list.html",ATTRS:{artistId:{value:null},timeframe:{value:null},startDate:{value:null},endDate:{value:null},modelList:{valueFn:function(){return new f(this.getAttrs(["artistId","timeframe", "startDate","endDate"]))}},loaded:{value:!1}}});b.Handlebars.registerHelper("tourdates-bit-datetime",function(a,b){var c=a.match(/^(\d{4}\-\d\d\-\d\d([tT][\d:\.]*)?)([zZ]|([+\-])(\d\d):?(\d\d))?$/)[1];d=new Date(c+"Z");var c="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),f="Sun Mon Tue Wed Thu Fri Sat".split(" ");if("date"===b.hash.format)return c[d.getUTCMonth()]+" "+d.getUTCDate();if("weekday"===b.hash.format)return f[d.getUTCDay()]});b.Handlebars.registerHelper("equals-string",function(a, f,h){return b.Handlebars.helpers["if"].call(this,function(){return a==f.toString()},h)})},"1.0",{requires:"jsonp model-list squarespace-hb-compare squarespace-spinner squarespace-ss-widget squarespace-tourdates-bandsintown-list-template".split(" ")})},3413:function(u,v){YUI.add("squarespace-tourdates",function(b){var h;b.config.win.Squarespace.onInitialize(b,function(){h=[];b.all(".sqs-block-tourdates[data-block-json]").each(function(c){var k=JSON.parse(c.getAttribute("data-block-json"));c=(new b.Squarespace.Widgets.BandsInTownTourDatesList({artistId:k.artistId, timeframe:k.timeframe,startDate:k.startDate,endDate:k.endDate})).render(c);h.push(c)})});b.config.win.Squarespace.onDestroy(b,function(){h.forEach(function(b){b.destroy&&b.destroy()});b.all(".sqs-block-tourdates[data-block-json]").each(function(b){b.empty()});h=null})},"1.0",{requires:["squarespace-widgets-tourdates-bandsintown"]})}});