(function(){var jQuery;var needtoLoad=!1;if(window.jQuery===undefined){needtoLoad=!0}else{version=window.jQuery.fn.jquery.split('.');if(parseInt(version[0])<2){if(parseInt(version[0])<1)needtoLoad=!0;if(parseInt(version[0])==1&&parseInt(version[1])<7)needtoLoad=!0}}
if(needtoLoad){var script_tag=document.createElement('script');script_tag.setAttribute('type','text/javascript');script_tag.setAttribute('src','https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js');if(script_tag.readyState){script_tag.onreadystatechange=function(){if(this.readyState=='complete'||this.readyState=='loaded'){scriptLoadHandler()}}}else{script_tag.onload=scriptLoadHandler}(document.getElementsByTagName('head')[0]||document.documentElement).appendChild(script_tag)}else{jQuery=window.jQuery;main()}
function scriptLoadHandler(){jQuery=window.jQuery.noConflict(!0);main()}
function main(){jQuery(document).ready(function($){if(typeof console==='undefined')console={log:function(){}};var div=document.createElement("div");div.innerHTML="<!--[if lt IE 10]><i></i><![endif]-->";var isIeLessThan10=(div.getElementsByTagName("i").length==1);if(isIeLessThan10){var httpRegEx=/^(https?:)?\/\//i;var getOrPostRegEx=/^get|post$/i;var sameSchemeRegEx=new RegExp('^(\/\/|'+location.protocol+')','i');$.ajaxTransport('* text html xml json',function(options,userOptions,jqXHR){if(!options.crossDomain||!options.async||!getOrPostRegEx.test(options.type)||!httpRegEx.test(options.url)||!sameSchemeRegEx.test(options.url)){return}
var xdr=null;return{send:function(headers,complete){var postData='';var userType=(userOptions.dataType||'').toLowerCase();xdr=new XDomainRequest();if(/^\d+$/.test(userOptions.timeout)){xdr.timeout=userOptions.timeout}
xdr.ontimeout=function(){complete(500,'timeout')};xdr.onload=function(){var allResponseHeaders='Content-Length: '+xdr.responseText.length+'\r\nContent-Type: '+xdr.contentType;var status={code:200,message:'success'};var responses={text:xdr.responseText};try{if(userType==='html'||/text\/html/i.test(xdr.contentType)){responses.html=xdr.responseText}else if(userType==='json'||(userType!=='text'&&/\/json/i.test(xdr.contentType))){try{responses.json=$.parseJSON(xdr.responseText)}catch(e){status.code=500;status.message='parseerror'}}else if(userType==='xml'||(userType!=='text'&&/\/xml/i.test(xdr.contentType))){var doc=new ActiveXObject('Microsoft.XMLDOM');doc.async=!1;try{doc.loadXML(xdr.responseText)}catch(e){doc=undefined}
if(!doc||!doc.documentElement||doc.getElementsByTagName('parsererror').length){status.code=500;status.message='parseerror';throw 'Invalid XML: '+xdr.responseText}
responses.xml=doc}}catch(parseMessage){throw parseMessage}finally{complete(status.code,status.message,responses,allResponseHeaders)}};xdr.onprogress=function(){};xdr.onerror=function(){complete(500,'error',{text:xdr.responseText})};if(userOptions.data){postData=($.type(userOptions.data)==='string')?userOptions.data:$.param(userOptions.data)}
xdr.open(options.type,options.url);xdr.send(postData)},abort:function(){if(xdr){xdr.abort()}}}})}
if(parseInt()==1||parseInt()==1){!function(e){if(!e.hasInitialised){var t={escapeRegExp:function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},hasClass:function(e,t){var i=" ";return 1===e.nodeType&&(i+e.className+i).replace(/[\n\t]/g,i).indexOf(i+t+i)>=0},addClass:function(e,t){e.className+=" "+t},removeClass:function(e,t){var i=new RegExp("\\b"+this.escapeRegExp(t)+"\\b");e.className=e.className.replace(i,"")},interpolateString:function(e,t){return e.replace(/{{([a-z][a-z0-9\-_]*)}}/gi,function(e){return t(arguments[1])||""})},getCookie:function(e){var t=("; "+document.cookie).split("; "+e+"=");return t.length<2?void 0:t.pop().split(";").shift()},setCookie:function(e,t,i,n,o,s){var r=new Date;r.setHours(r.getHours()+24*(i||365));var a=[e+"="+t,"expires="+r.toUTCString(),"path="+(o||"/")];n&&a.push("domain="+n),s&&a.push("secure"),document.cookie=a.join(";")},deepExtend:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(i in e&&this.isPlainObject(e[i])&&this.isPlainObject(t[i])?this.deepExtend(e[i],t[i]):e[i]=t[i]);return e},throttle:function(e,t){var i=!1;return function(){i||(e.apply(this,arguments),i=!0,setTimeout(function(){i=!1},t))}},hash:function(e){var t,i,n=0;if(0===e.length)return n;for(t=0,i=e.length;t<i;++t)n=(n<<5)-n+e.charCodeAt(t),n|=0;return n},normaliseHex:function(e){return"#"==e[0]&&(e=e.substr(1)),3==e.length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),e},getContrast:function(e){return e=this.normaliseHex(e),(299*parseInt(e.substr(0,2),16)+587*parseInt(e.substr(2,2),16)+114*parseInt(e.substr(4,2),16))/1e3>=128?"#000":"#fff"},getLuminance:function(e){var t=parseInt(this.normaliseHex(e),16),i=38+(t>>16),n=38+(t>>8&255),o=38+(255&t);return"#"+(16777216+65536*(i<255?i<1?0:i:255)+256*(n<255?n<1?0:n:255)+(o<255?o<1?0:o:255)).toString(16).slice(1)},isMobile:function(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},isPlainObject:function(e){return"object"==typeof e&&null!==e&&e.constructor==Object},traverseDOMPath:function(e,i){return e&&e.parentNode?t.hasClass(e,i)?e:this.traverseDOMPath(e.parentNode,i):null}};e.status={deny:"deny",allow:"allow",dismiss:"dismiss"},e.transitionEnd=function(){var e=document.createElement("div"),t={t:"transitionend",OT:"oTransitionEnd",msT:"MSTransitionEnd",MozT:"transitionend",WebkitT:"webkitTransitionEnd"};for(var i in t)if(t.hasOwnProperty(i)&&void 0!==e.style[i+"ransition"])return t[i];return""}(),e.hasTransition=!!e.transitionEnd;var i=Object.keys(e.status).map(t.escapeRegExp);e.customStyles={},e.Popup=function(){var n={enabled:!0,container:null,cookie:{name:"cookieconsent_status",path:"/",domain:"",expiryDays:365,secure:!1},onPopupOpen:function(){},onPopupClose:function(){},onInitialise:function(e){},onStatusChange:function(e,t){},onRevokeChoice:function(){},onNoCookieLaw:function(e,t){},content:{header:"Cookies used on the website!",message:"This website uses cookies to ensure you get the best experience on our website.",dismiss:"Got it!",allow:"Allow cookies",deny:"Decline",link:"Learn more",href:"https://www.cookiesandyou.com",close:"&#x274c;",target:"_blank",policy:"Cookie Policy"},elements:{header:'<span class="cc-header">{{header}}</span>&nbsp;',message:'<span id="cookieconsent:desc" class="cc-message">{{message}}</span>',messagelink:'<span id="cookieconsent:desc" class="cc-message">{{message}} <a aria-label="learn more about cookies" role=button tabindex="0" class="cc-link" href="{{href}}" rel="noopener noreferrer nofollow" target="{{target}}">{{link}}</a></span>',dismiss:'<a aria-label="dismiss cookie message" role=button tabindex="0" class="cc-btn cc-dismiss">{{dismiss}}</a>',allow:'<a aria-label="allow cookies" role=button tabindex="0"  class="cc-btn cc-allow">{{allow}}</a>',deny:'<a aria-label="deny cookies" role=button tabindex="0" class="cc-btn cc-deny">{{deny}}</a>',link:'<a aria-label="learn more about cookies" role=button tabindex="0" class="cc-link" href="{{href}}" rel="noopener noreferrer nofollow" target="{{target}}">{{link}}</a>',close:'<span aria-label="dismiss cookie message" role=button tabindex="0" class="cc-close">{{close}}</span>'},window:'<div role="dialog" aria-live="polite" aria-label="cookieconsent" aria-describedby="cookieconsent:desc" class="cc-window {{classes}}">\x3c!--googleoff: all--\x3e{{children}}\x3c!--googleon: all--\x3e</div>',revokeBtn:'<div class="cc-revoke {{classes}}">{{policy}}</div>',compliance:{info:'<div class="cc-compliance">{{dismiss}}</div>',"opt-in":'<div class="cc-compliance cc-highlight">{{deny}}{{allow}}</div>',"opt-out":'<div class="cc-compliance cc-highlight">{{deny}}{{allow}}</div>'},type:"info",layouts:{basic:"{{messagelink}}{{compliance}}","basic-close":"{{messagelink}}{{compliance}}{{close}}","basic-header":"{{header}}{{message}}{{link}}{{compliance}}"},layout:"basic",position:"bottom",theme:"block",static:!1,palette:null,revokable:!1,animateRevokable:!0,showLink:!0,dismissOnScroll:!1,dismissOnTimeout:!1,dismissOnWindowClick:!1,ignoreClicksFrom:["cc-revoke","cc-btn"],autoOpen:!0,autoAttach:!0,whitelistPage:[],blacklistPage:[],overrideHTML:null};function o(){this.initialise.apply(this,arguments)}function s(e){this.openingTimeout=null,t.removeClass(e,"cc-invisible")}function r(t){t.style.display="none",t.removeEventListener(e.transitionEnd,this.afterTransition),this.afterTransition=null}function a(){var e=this.options.position.split("-"),t=[];return e.forEach(function(e){t.push("cc-"+e)}),t}function c(n){var o=this.options,s=document.createElement("div"),r=o.container&&1===o.container.nodeType?o.container:document.body;s.innerHTML=n;var a=s.children[0];return a.style.display="none",t.hasClass(a,"cc-window")&&e.hasTransition&&t.addClass(a,"cc-invisible"),this.onButtonClick=function(n){var o=t.traverseDOMPath(n.target,"cc-btn")||n.target;if(t.hasClass(o,"cc-btn")){var s=o.className.match(new RegExp("\\bcc-("+i.join("|")+")\\b")),r=s&&s[1]||!1;r&&(this.setStatus(r),this.close(!0))}t.hasClass(o,"cc-close")&&(this.setStatus(e.status.dismiss),this.close(!0));t.hasClass(o,"cc-revoke")&&this.revokeChoice()}.bind(this),a.addEventListener("click",this.onButtonClick),o.autoAttach&&(r.firstChild?r.insertBefore(a,r.firstChild):r.appendChild(a)),a}function l(e){return"000000"==(e=t.normaliseHex(e))?"#222":t.getLuminance(e)}function u(e,t){for(var i=0,n=e.length;i<n;++i){var o=e[i];if(o instanceof RegExp&&o.test(t)||"string"==typeof o&&o.length&&o===t)return!0}return!1}return o.prototype.initialise=function(i){this.options&&this.destroy(),t.deepExtend(this.options={},n),t.isPlainObject(i)&&t.deepExtend(this.options,i),function(){var t=this.options.onInitialise.bind(this);if(!window.navigator.cookieEnabled)return t(e.status.deny),!0;if(window.CookiesOK||window.navigator.CookiesOK)return t(e.status.allow),!0;var i=Object.keys(e.status),n=this.getStatus(),o=i.indexOf(n)>=0;o&&t(n);return o}.call(this)&&(this.options.enabled=!1),u(this.options.blacklistPage,location.pathname)&&(this.options.enabled=!1),u(this.options.whitelistPage,location.pathname)&&(this.options.enabled=!0);var o=this.options.window.replace("{{classes}}",function(){var i=this.options,n="top"==i.position||"bottom"==i.position?"banner":"floating";t.isMobile()&&(n="floating");var o=["cc-"+n,"cc-type-"+i.type,"cc-theme-"+i.theme];i.static&&o.push("cc-static");o.push.apply(o,a.call(this));(function(i){var n=t.hash(JSON.stringify(i)),o="cc-color-override-"+n,s=t.isPlainObject(i);this.customStyleSelector=s?o:null,s&&function(i,n,o){if(e.customStyles[i])return void++e.customStyles[i].references;var s={},r=n.popup,a=n.button,c=n.highlight;r&&(r.text=r.text?r.text:t.getContrast(r.background),r.link=r.link?r.link:r.text,s[o+".cc-window"]=["color: "+r.text,"background-color: "+r.background],s[o+".cc-revoke"]=["color: "+r.text,"background-color: "+r.background],s[o+" .cc-link,"+o+" .cc-link:active,"+o+" .cc-link:visited"]=["color: "+r.link],a&&(a.text=a.text?a.text:t.getContrast(a.background),a.border=a.border?a.border:"transparent",s[o+" .cc-btn"]=["color: "+a.text,"border-color: "+a.border,"background-color: "+a.background],a.padding&&s[o+" .cc-btn"].push("padding: "+a.padding),"transparent"!=a.background&&(s[o+" .cc-btn:hover, "+o+" .cc-btn:focus"]=["background-color: "+(a.hover||l(a.background))]),c?(c.text=c.text?c.text:t.getContrast(c.background),c.border=c.border?c.border:"transparent",s[o+" .cc-highlight .cc-btn:first-child"]=["color: "+c.text,"border-color: "+c.border,"background-color: "+c.background]):s[o+" .cc-highlight .cc-btn:first-child"]=["color: "+r.text]));var u=document.createElement("style");document.head.appendChild(u),e.customStyles[i]={references:1,element:u.sheet};var h=-1;for(var p in s)s.hasOwnProperty(p)&&u.sheet.insertRule(p+"{"+s[p].join(";")+"}",++h)}(n,i,"."+o);return s}).call(this,this.options.palette);this.customStyleSelector&&o.push(this.customStyleSelector);return o}.call(this).join(" ")).replace("{{children}}",function(){var e={},i=this.options;i.showLink||(i.elements.link="",i.elements.messagelink=i.elements.message);Object.keys(i.elements).forEach(function(n){e[n]=t.interpolateString(i.elements[n],function(e){var t=i.content[e];return e&&"string"==typeof t&&t.length?t:""})});var n=i.compliance[i.type];n||(n=i.compliance.info);e.compliance=t.interpolateString(n,function(t){return e[t]});var o=i.layouts[i.layout];o||(o=i.layouts.basic);return t.interpolateString(o,function(t){return e[t]})}.call(this)),s=this.options.overrideHTML;if("string"==typeof s&&s.length&&(o=s),this.options.static){var r=c.call(this,'<div class="cc-grower">'+o+"</div>");r.style.display="",this.element=r.firstChild,this.element.style.display="none",t.addClass(this.element,"cc-invisible")}else this.element=c.call(this,o);(function(){var i=this.setStatus.bind(this),n=this.close.bind(this),o=this.options.dismissOnTimeout;"number"==typeof o&&o>=0&&(this.dismissTimeout=window.setTimeout(function(){i(e.status.dismiss),n(!0)},Math.floor(o)));var s=this.options.dismissOnScroll;if("number"==typeof s&&s>=0){var r=function(t){window.pageYOffset>Math.floor(s)&&(i(e.status.dismiss),n(!0),window.removeEventListener("scroll",r),this.onWindowScroll=null)};this.options.enabled&&(this.onWindowScroll=r,window.addEventListener("scroll",r))}var a=this.options.dismissOnWindowClick,c=this.options.ignoreClicksFrom;if(a){var l=function(o){for(var s=!1,r=o.path.length,a=c.length,u=0;u<r;u++)if(!s)for(var h=0;h<a;h++)s||(s=t.hasClass(o.path[u],c[h]));s||(i(e.status.dismiss),n(!0),window.removeEventListener("click",l),window.removeEventListener("touchend",l),this.onWindowClick=null)}.bind(this);this.options.enabled&&(this.onWindowClick=l,window.addEventListener("click",l),window.addEventListener("touchend",l))}}).call(this),function(){"info"!=this.options.type&&(this.options.revokable=!0);t.isMobile()&&(this.options.animateRevokable=!1);if(this.options.revokable){var e=a.call(this);this.options.animateRevokable&&e.push("cc-animate"),this.customStyleSelector&&e.push(this.customStyleSelector);var i=this.options.revokeBtn.replace("{{classes}}",e.join(" ")).replace("{{policy}}",this.options.content.policy);this.revokeBtn=c.call(this,i);var n=this.revokeBtn;if(this.options.animateRevokable){var o=t.throttle(function(e){var i=!1,o=window.innerHeight-20;t.hasClass(n,"cc-top")&&e.clientY<20&&(i=!0),t.hasClass(n,"cc-bottom")&&e.clientY>o&&(i=!0),i?t.hasClass(n,"cc-active")||t.addClass(n,"cc-active"):t.hasClass(n,"cc-active")&&t.removeClass(n,"cc-active")},200);this.onMouseMove=o,window.addEventListener("mousemove",o)}}}.call(this),this.options.autoOpen&&this.autoOpen()},o.prototype.destroy=function(){this.onButtonClick&&this.element&&(this.element.removeEventListener("click",this.onButtonClick),this.onButtonClick=null),this.dismissTimeout&&(clearTimeout(this.dismissTimeout),this.dismissTimeout=null),this.onWindowScroll&&(window.removeEventListener("scroll",this.onWindowScroll),this.onWindowScroll=null),this.onWindowClick&&(window.removeEventListener("click",this.onWindowClick),this.onWindowClick=null),this.onMouseMove&&(window.removeEventListener("mousemove",this.onMouseMove),this.onMouseMove=null),this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.element=null,this.revokeBtn&&this.revokeBtn.parentNode&&this.revokeBtn.parentNode.removeChild(this.revokeBtn),this.revokeBtn=null,function(i){if(t.isPlainObject(i)){var n=t.hash(JSON.stringify(i)),o=e.customStyles[n];if(o&&!--o.references){var s=o.element.ownerNode;s&&s.parentNode&&s.parentNode.removeChild(s),e.customStyles[n]=null}}}(this.options.palette),this.options=null},o.prototype.open=function(t){if(this.element)return this.isOpen()||(e.hasTransition?this.fadeIn():this.element.style.display="",this.options.revokable&&this.toggleRevokeButton(),this.options.onPopupOpen.call(this)),this},o.prototype.close=function(t){if(this.element)return this.isOpen()&&(e.hasTransition?this.fadeOut():this.element.style.display="none",t&&this.options.revokable&&this.toggleRevokeButton(!0),this.options.onPopupClose.call(this)),this},o.prototype.fadeIn=function(){var i=this.element;if(e.hasTransition&&i&&(this.afterTransition&&r.call(this,i),t.hasClass(i,"cc-invisible"))){if(i.style.display="",this.options.static){var n=this.element.clientHeight;this.element.parentNode.style.maxHeight=n+"px"}this.openingTimeout=setTimeout(s.bind(this,i),20)}},o.prototype.fadeOut=function(){var i=this.element;e.hasTransition&&i&&(this.openingTimeout&&(clearTimeout(this.openingTimeout),s.bind(this,i)),t.hasClass(i,"cc-invisible")||(this.options.static&&(this.element.parentNode.style.maxHeight=""),this.afterTransition=r.bind(this,i),i.addEventListener(e.transitionEnd,this.afterTransition),t.addClass(i,"cc-invisible")))},o.prototype.isOpen=function(){return this.element&&""==this.element.style.display&&(!e.hasTransition||!t.hasClass(this.element,"cc-invisible"))},o.prototype.toggleRevokeButton=function(e){this.revokeBtn&&(this.revokeBtn.style.display=e?"":"none")},o.prototype.revokeChoice=function(e){this.options.enabled=!0,this.clearStatus(),this.options.onRevokeChoice.call(this),e||this.autoOpen()},o.prototype.hasAnswered=function(t){return Object.keys(e.status).indexOf(this.getStatus())>=0},o.prototype.hasConsented=function(t){var i=this.getStatus();return i==e.status.allow||i==e.status.dismiss},o.prototype.autoOpen=function(e){!this.hasAnswered()&&this.options.enabled?this.open():this.hasAnswered()&&this.options.revokable&&this.toggleRevokeButton(!0)},o.prototype.setStatus=function(i){var n=this.options.cookie,o=t.getCookie(n.name),s=Object.keys(e.status).indexOf(o)>=0;Object.keys(e.status).indexOf(i)>=0?(t.setCookie(n.name,i,n.expiryDays,n.domain,n.path,n.secure),this.options.onStatusChange.call(this,i,s)):this.clearStatus()},o.prototype.getStatus=function(){return t.getCookie(this.options.cookie.name)},o.prototype.clearStatus=function(){var e=this.options.cookie;t.setCookie(e.name,"",-1,e.domain,e.path)},o}(),e.Location=function(){var e={timeout:5e3,services:["ipinfo"],serviceDefinitions:{ipinfo:function(){return{url:"//ipinfo.io",headers:["Accept: application/json"],callback:function(e,t){try{var i=JSON.parse(t);return i.error?s(i):{code:i.country}}catch(e){return s({error:"Invalid response ("+e+")"})}}}},ipinfodb:function(e){return{url:"//api.ipinfodb.com/v3/ip-country/?key={api_key}&format=json&callback={callback}",isScript:!0,callback:function(e,t){try{var i=JSON.parse(t);return"ERROR"==i.statusCode?s({error:i.statusMessage}):{code:i.countryCode}}catch(e){return s({error:"Invalid response ("+e+")"})}}}},maxmind:function(){return{url:"//js.maxmind.com/js/apis/geoip2/v2.1/geoip2.js",isScript:!0,callback:function(e){window.geoip2?geoip2.country(function(t){try{e({code:t.country.iso_code})}catch(t){e(s(t))}},function(t){e(s(t))}):e(new Error("Unexpected response format. The downloaded script should have exported `geoip2` to the global scope"))}}}}};function i(i){t.deepExtend(this.options={},e),t.isPlainObject(i)&&t.deepExtend(this.options,i),this.currentServiceIndex=-1}function n(e,t,i){var n,o=document.createElement("script");o.type="text/"+(e.type||"javascript"),o.src=e.src||e,o.async=!1,o.onreadystatechange=o.onload=function(){var e=o.readyState;clearTimeout(n),t.done||e&&!/loaded|complete/.test(e)||(t.done=!0,t(),o.onreadystatechange=o.onload=null)},document.body.appendChild(o),n=setTimeout(function(){t.done=!0,t(),o.onreadystatechange=o.onload=null},i)}function o(e,t,i,n,o){var s=new(window.XMLHttpRequest||window.ActiveXObject)("MSXML2.XMLHTTP.3.0");if(s.open(n?"POST":"GET",e,1),s.setRequestHeader("Content-type","application/x-www-form-urlencoded"),Array.isArray(o))for(var r=0,a=o.length;r<a;++r){var c=o[r].split(":",2);s.setRequestHeader(c[0].replace(/^\s+|\s+$/g,""),c[1].replace(/^\s+|\s+$/g,""))}"function"==typeof t&&(s.onreadystatechange=function(){s.readyState>3&&t(s)}),s.send(n)}function s(e){return new Error("Error ["+(e.code||"UNKNOWN")+"]: "+e.error)}return i.prototype.getNextService=function(){var e;do{e=this.getServiceByIdx(++this.currentServiceIndex)}while(this.currentServiceIndex<this.options.services.length&&!e);return e},i.prototype.getServiceByIdx=function(e){var i=this.options.services[e];if("function"==typeof i){var n=i();return n.name&&t.deepExtend(n,this.options.serviceDefinitions[n.name](n)),n}return"string"==typeof i?this.options.serviceDefinitions[i]():t.isPlainObject(i)?this.options.serviceDefinitions[i.name](i):null},i.prototype.locate=function(e,t){var i=this.getNextService();i?(this.callbackComplete=e,this.callbackError=t,this.runService(i,this.runNextServiceOnError.bind(this))):t(new Error("No services to run"))},i.prototype.setupUrl=function(e){var t=this.getCurrentServiceOpts();return e.url.replace(/\{(.*?)\}/g,function(i,n){if("callback"===n){var o="callback"+Date.now();return window[o]=function(t){e.__JSONP_DATA=JSON.stringify(t)},o}if(n in t.interpolateUrl)return t.interpolateUrl[n]})},i.prototype.runService=function(e,t){var i=this;e&&e.url&&e.callback&&(e.isScript?n:o)(this.setupUrl(e),function(n){var o=n?n.responseText:"";e.__JSONP_DATA&&(o=e.__JSONP_DATA,delete e.__JSONP_DATA),i.runServiceCallback.call(i,t,e,o)},this.options.timeout,e.data,e.headers)},i.prototype.runServiceCallback=function(e,t,i){var n=this,o=t.callback(function(t){o||n.onServiceResult.call(n,e,t)},i);o&&this.onServiceResult.call(this,e,o)},i.prototype.onServiceResult=function(e,t){t instanceof Error||t&&t.error?e.call(this,t,null):e.call(this,null,t)},i.prototype.runNextServiceOnError=function(e,t){if(e){this.logError(e);var i=this.getNextService();i?this.runService(i,this.runNextServiceOnError.bind(this)):this.completeService.call(this,this.callbackError,new Error("All services failed"))}else this.completeService.call(this,this.callbackComplete,t)},i.prototype.getCurrentServiceOpts=function(){var e=this.options.services[this.currentServiceIndex];return"string"==typeof e?{name:e}:"function"==typeof e?e():t.isPlainObject(e)?e:{}},i.prototype.completeService=function(e,t){this.currentServiceIndex=-1,e&&e(t)},i.prototype.logError=function(e){var t=this.currentServiceIndex,i=this.getServiceByIdx(t);console.warn("The service["+t+"] ("+i.url+") responded with the following error",e)},i}(),e.Law=function(){var e={regionalLaw:!0,hasLaw:["AT","BE","BG","HR","CZ","CY","DK","EE","FI","FR","DE","EL","HU","IE","IT","LV","LT","LU","MT","NL","PL","PT","SK","ES","SE","GB","UK","GR","EU"],revokable:["HR","CY","DK","EE","FR","DE","LV","LT","NL","PT","ES"],explicitAction:["HR","IT","ES"]};function i(e){this.initialise.apply(this,arguments)}return i.prototype.initialise=function(i){t.deepExtend(this.options={},e),t.isPlainObject(i)&&t.deepExtend(this.options,i)},i.prototype.get=function(e){var t=this.options;return{hasLaw:t.hasLaw.indexOf(e)>=0,revokable:t.revokable.indexOf(e)>=0,explicitAction:t.explicitAction.indexOf(e)>=0}},i.prototype.applyLaw=function(e,t){var i=this.get(t);return i.hasLaw||(e.enabled=!1,"function"==typeof e.onNoCookieLaw&&e.onNoCookieLaw(t,i)),this.options.regionalLaw&&(i.revokable&&(e.revokable=!0),i.explicitAction&&(e.dismissOnScroll=!1,e.dismissOnTimeout=!1)),e},i}(),e.initialise=function(i,n,o){var s=new e.Law(i.law);n||(n=function(){}),o||(o=function(){});var r=Object.keys(e.status),a=t.getCookie("cookieconsent_status");r.indexOf(a)>=0?n(new e.Popup(i)):e.getCountryCode(i,function(t){delete i.law,delete i.location,t.code&&(i=s.applyLaw(i,t.code)),n(new e.Popup(i))},function(t){delete i.law,delete i.location,o(t,new e.Popup(i))})},e.getCountryCode=function(t,i,n){t.law&&t.law.countryCode?i({code:t.law.countryCode}):t.location?new e.Location(t.location).locate(function(e){i(e||{})},n):i({})},e.utils=t,e.hasInitialised=!0,window.cookieconsent=e}}(window.cookieconsent||{});var css_link=jQuery('<link>',{rel:'stylesheet',type:'text/css',href:'https://sme.theappreciationengine.com//themes/appreciationengine22/auth_framework/cookieconsentAE.css'});css_link.appendTo('head')}
$.fn.extend({omniWindow:function(options){options=$.extend(!0,{animationsPriority:{show:['overlay','modal'],hide:['modal','overlay']},overlay:{selector:'.ow-overlay',hideClass:'ow-closed',animations:{show:function(subjects,internalCallback){return internalCallback(subjects)},hide:function(subjects,internalCallback){return internalCallback(subjects)},internal:{show:function(subjects){subjects.overlay.removeClass(options.overlay.hideClass)},hide:function(subjects){subjects.overlay.addClass(options.overlay.hideClass)}}}},modal:{hideClass:'ow-closed',animations:{show:function(subjects,internalCallback){return internalCallback(subjects)},hide:function(subjects,internalCallback){return internalCallback(subjects)},internal:{show:function(subjects){subjects.modal.removeClass(options.modal.hideClass)},hide:function(subjects){subjects.modal.addClass(options.modal.hideClass)}}},internal:{stateAttribute:'ow-active'}},eventsNames:{show:'show.ow',hide:'hide.ow',internal:{overlayClick:'click.ow',keyboardKeyUp:'keyup.ow'}},callbacks:{beforeShow:function(subjects,internalCallback){return internalCallback(subjects)},positioning:function(subjects,internalCallback){return internalCallback(subjects)},afterShow:function(subjects,internalCallback){return internalCallback(subjects)},beforeHide:function(subjects,internalCallback){return internalCallback(subjects)},afterHide:function(subjects,internalCallback){return internalCallback(subjects)},internal:{beforeShow:function(subjects){if(subjects.modal.data(options.modal.internal.stateAttribute)){return!1}else{subjects.modal.data(options.modal.internal.stateAttribute,!0);return!0}},afterShow:function(subjects){$(document).on(options.eventsNames.internal.keyboardKeyUp,function(e){if(e.keyCode===27){subjects.modal.trigger(options.eventsNames.hide);subjects.overlay.css('display','');subjects.modal.css('display','')}});subjects.overlay.on(options.eventsNames.internal.overlayClick,function(){subjects.modal.trigger(options.eventsNames.hide);subjects.overlay.css('display','');subjects.modal.css('display','')})},positioning:function(subjects){subjects.modal.css('margin-left',Math.round(subjects.modal.outerWidth(!1)/-2))},beforeHide:function(subjects){if(subjects.modal.data(options.modal.internal.stateAttribute)){subjects.modal.data(options.modal.internal.stateAttribute,!1);return!0}else{return!1}},afterHide:function(subjects){subjects.overlay.off(options.eventsNames.internal.overlayClick);$(document).off(options.eventsNames.internal.keyboardKeyUp);subjects.overlay.css('display','');subjects.modal.css('display','')}}}},options);var animate=function(process,subjects,callbackName){var first=options.animationsPriority[process][0],second=options.animationsPriority[process][1];options[first].animations[process](subjects,function(subjs){options[first].animations.internal[process](subjs);options[second].animations[process](subjects,function(subjs){options[second].animations.internal[process](subjs);options.callbacks[callbackName](subjects,options.callbacks.internal[callbackName])})})};var showModal=function(subjects){if(!options.callbacks.beforeShow(subjects,options.callbacks.internal.beforeShow)){return}
options.callbacks.positioning(subjects,options.callbacks.internal.positioning);animate('show',subjects,'afterShow')};var hideModal=function(subjects){if(!options.callbacks.beforeHide(subjects,options.callbacks.internal.beforeHide)){return}
animate('hide',subjects,'afterHide')};var $overlay=$(options.overlay.selector);return this.each(function(){var $modal=$(this);var subjects={modal:$modal,overlay:$overlay};$modal.bind(options.eventsNames.show,function(){showModal(subjects)}).bind(options.eventsNames.hide,function(){hideModal(subjects)})})}});$.support.cors
$.ajaxWithCredentials=function(options){options=$.extend(options||{},{crossDomain:!0,xhrFields:{withCredentials:!0}});return $.ajax(options)};$.postWithCredentials=function(url,data,success,dataType){options={type:'POST',url:url,data:data,success:success,dataType:dataType};$.ajaxWithCredentials(options)};$.cachedScript=function(url,options){options=$.extend(options||{},{dataType:'script',cache:!0,url:url});return $.ajax(options)};function delete_cookie(name){document.cookie=name+'=;expires=Thu, 01 Jan 1970 00:00:01 GMT;path=/;'};function reset_consent(cookieText,dataText,privacyLink){delete_cookie('ae_data_use_consent');if(typeof aeJS.cookieconsent!=='undefined'){document.body.removeChild(aeJS.cookieconsent.element)}
if(typeof(cookieText)!=='undefined'&&typeof(dataText)!=='undefined'&&typeof(privacyLink)!=='undefined'){consentOptions.content.message='<h3>Cookies</h3>';consentOptions.content.message+=cookieText.replace(/(?:\r\n|\r|\n)/g,'<br>');consentOptions.content.message+='<h3>Use Of Data</h3>';consentOptions.content.message+=dataText.replace(/(?:\r\n|\r|\n)/g,'<br>');consentOptions.content.href=privacyLink}
aeJS.cookieconsent=new cookieconsent.Popup(consentOptions);document.body.appendChild(aeJS.cookieconsent.element)}
function topZIndex(selector){return Math.max(0,Math.max.apply(null,$.map(((selector||'*')==='*')?$.makeArray(document.getElementsByTagName('*')):$(selector),function(v){return parseFloat($(v).css('z-index'))||null})))}
function GetURLParameter(sParam){var sPageURL=window.location.search.substring(1);var sURLVariables=sPageURL.split('&');for(var i=0;i<sURLVariables.length;i++){var sParameterName=sURLVariables[i].split('=');if(sParameterName[0]==sParam){return sParameterName[1]}}}
function addParam(url,param,value){var a=document.createElement('a'),regex=/[?&]([^=]+)=([^&]*)/g;var match,str=[];a.href=url;value=value||'';while(match=regex.exec(a.search))
if(encodeURIComponent(param)!=match[1])str.push(match[1]+'='+match[2]);str.push(encodeURIComponent(param)+'='+encodeURIComponent(value));a.search=(a.search.substring(0,1)=='?'?'':'?')+str.join('&');return a.href}
function setLinkState(active){}
function nextSteps(auth_state){aeJS.user=typeof auth_state.user!=='undefined'?auth_state.user:{};var login_type=auth_state.registration===!0?'registration':'login';var missing=!1;switch(auth_state.state){case 'close':aeJS.events.onWindow.removeHandler(aeJS.self_destruct);aeJS.modal.window.trigger('hide');if(typeof auth_state.user!=='undefined'&&!$.isEmptyObject(auth_state.user)){if(typeof aeJS.step_triggered!=='undefined'){if(aeJS.step_triggered=='verify-email')aeJS.events.onEmailVerify.callHandler('sent',{'EmailAddress':aeJS.user.data.Email})}else if(typeof auth_state.multipass_token!=='undefined'&&new String(auth_state.multipass_token).length>1){location.href=auth_state.shopify_store_url+'/account/login/multipass/'+auth_state.multipass_token}else{if(isValidLogin())aeJS.events.onLogin.callHandler(auth_state.user,login_type)}}
break;case 'register':var done=!0;aeJS.loggedIn=!1;if(aeJS.settings.extra_fields_screen==='after'){if(login_type==='registration'){missing=extraFields(aeJS.user);if(missing===!1)missing={};if(auth_state.service==='email'&&typeof aeJS.settings.extra_fields!=='undefined'&&typeof aeJS.settings.extra_fields.username!=='undefined'){$.extend(missing,{'username':{required:!0}})}
if($.isEmptyObject(missing))missing=!1}else{missing=extraFields(aeJS.user,!0)}
if(missing!==!1){done=!1;aeJS.settings.extra_fields=missing;aeJS.self_destruct=function(e){if(e.type==='modal'&&e.state==='closed'){if(isValidLogin())aeJS.events.onLogin.callHandler(auth_state.user,login_type);aeJS.events.onWindow.removeHandler(aeJS.self_destruct)}}
aeJS.events.onWindow.addHandler(aeJS.self_destruct);aeJS.flow.step='required-fields';aeJS.flow.auth_url=auth_state.auth_url;aeJS.flow.return=(auth_state.return==='undefined')?aeJS.flow.return:auth_state.return;aeJS.events.onFlow.callHandler(aeJS.flow);break}}
if(JSON.parse(aeJS.settings.verify_email)===!0&&!verifiedEmail()){if(typeof auth_state.verified==='undefined'||JSON.parse(auth_state.verified)!==!0){done=!1;aeJS.flow.step='verify-email';aeJS.flow.return=(auth_state.return==='undefined')?aeJS.flow.return:auth_state.return;aeJS.events.onFlow.callHandler(aeJS.flow);break}}
if(done===!0){auth_state.state='close';if(aeJS.isEmbed){if(self!=top){if(isValidLogin()){if(typeof auth_state.multipass_token!=='undefined'&&new String(auth_state.multipass_token).length>1){location.href=auth_state.shopify_store_url+'/account/login/multipass/'+auth_state.multipass_token}else{aeJS.events.onLogin.callHandler(auth_state.user,login_type)}}else{var reason=isValidLogin(!0);done=!1;aeJS.flow.step=reason;aeJS.flow.return=(auth_state.return==='undefined')?aeJS.flow.return:auth_state.return;aeJS.events.onFlow.callHandler(aeJS.flow,!1);break}}else{parent.postMessage(JSON.stringify(auth_state),auth_state.auth_referer)}}else{aeJS.modal.window.trigger('hide');if(isValidLogin()){if(typeof auth_state.multipass_token!=='undefined'&&new String(auth_state.multipass_token).length>1){location.href=auth_state.shopify_store_url+'/account/login/multipass/'+auth_state.multipass_token}else{aeJS.events.onLogin.callHandler(auth_state.user,login_type)}}else{var reason=isValidLogin(!0);done=!1;aeJS.flow.step=reason;aeJS.flow.return=(auth_state.return==='undefined')?aeJS.flow.return:auth_state.return;aeJS.events.onFlow.callHandler(aeJS.flow,!1);break}}}
break;case 'update':if(aeJS.settings.verify_email===!0&&!verifiedEmail()){aeJS.flow.step='verify-email';aeJS.flow.return=(auth_state.return==='undefined')?aeJS.flow.return:auth_state.return;aeJS.events.onFlow.callHandler(aeJS.flow)}else{auth_state.state='close';if(aeJS.isEmbed){if(self!=top&&isValidLogin())aeJS.events.onLogin.callHandler(auth_state.user,login_type);else parent.postMessage(JSON.stringify(auth_state),auth_state.auth_referer)}else{aeJS.events.onWindow.removeHandler(aeJS.self_destruct);aeJS.modal.window.trigger('hide');aeJS.events.onLogin.callHandler(auth_state.user,login_type)}}
break;case 'token_login':aeJS.loggedIn=!1;if(isValidLogin()){aeJS.events.onLogin.callHandler(auth_state.user,'login')}else{if(isValidSSO()){var sso=SSO()
if(sso!==!1){$.postWithCredentials('https://sme.theappreciationengine.com/framework-v1.8/sso/467',{service_id:sso,domain:'forms.sonymusicfans.com'},function(auth_state){if(typeof auth_state.user!=='undefined')aeJS.user=auth_state.user;if(isValidLogin())aeJS.events.onLogin.callHandler(auth_state.user,'registration',!0)})}}}
break;case 'token_refresh':if(typeof auth_state.error=='undefined'){aeJS.loggedIn=!0;if(isValidLogin()){aeJS.events.onUser.callHandler(auth_state.user,'init')}}else{localStorage.removeItem('ae_refresh_token')}
break;case 'complete':case 'login':auth_state.state='close';aeJS.loggedIn=!1;if(aeJS.isEmbed){if(self!=top){if(isValidLogin()){if(typeof auth_state.multipass_token!=='undefined'&&new String(auth_state.multipass_token).length>1){location.href=auth_state.shopify_store_url+'/account/login/multipass/'+auth_state.multipass_token}else{aeJS.events.onLogin.callHandler(auth_state.user,login_type)}}else{var reason=isValidLogin(!0);done=!1;aeJS.flow.step=reason;aeJS.flow.return=(auth_state.return==='undefined')?aeJS.flow.return:auth_state.return;aeJS.events.onFlow.callHandler(aeJS.flow,!1);break}}else{parent.postMessage(JSON.stringify(auth_state),auth_state.auth_referer)}}else{aeJS.modal.window.trigger('hide');if(isValidLogin()){if(typeof auth_state.multipass_token!=='undefined'&&new String(auth_state.multipass_token).length>1){location.href=auth_state.shopify_store_url+'/account/login/multipass/'+auth_state.multipass_token}else{aeJS.events.onLogin.callHandler(auth_state.user,login_type)}}else{var reason=isValidLogin(!0);done=!1;aeJS.flow.step=reason;aeJS.flow.return=(auth_state.return==='undefined')?aeJS.flow.return:auth_state.return;aeJS.events.onFlow.callHandler(aeJS.flow,!1);break}}
break;case 'auth':auth_state.state='close';if(aeJS.isEmbed){if(self!=top&&isValidLogin())aeJS.events.onLogin.callHandler(auth_state.user,login_type);else parent.postMessage(JSON.stringify(auth_state),auth_state.auth_referer)}else{aeJS.modal.window.trigger('hide');aeJS.events.onUser.callHandler(auth_state.user,'auth')}
break;case 'passthrough':if(typeof auth_state.event!=='undefined'){aeJS.flow=auth_state.event;aeJS.events.onFlow.callHandler(aeJS.flow,!1)}
break;case 'logout':aeJS.events.onLogout.callHandler({});break;case 'error':aeJS.flow.step='error';if(typeof auth_state.error.code!='undefined')aeJS.flow.code=auth_state.error.code;if(typeof auth_state.error.message!='undefined')aeJS.flow.error=auth_state.error.message;aeJS.flow.return=(auth_state.return==='undefined')?aeJS.flow.return:auth_state.return;aeJS.events.onFlow.callHandler(aeJS.flow);break}}
var eventMethod=window.addEventListener?'addEventListener':'attachEvent';var eventer=window[eventMethod];var messageEvent=eventMethod=='attachEvent'?'onmessage':'message';var messageHandled=!1;eventer(messageEvent,function(e){if(e.origin!=='https://sme.theappreciationengine.com'){return}else{var auth_state=JSON.parse(e.data);messageHandled=!0;nextSteps(auth_state)}},!1);var aeJS=aeJS||{};var aeJSPrepped=!1;var createNS=function(namespace){var nsparts=namespace.split('.');var parent=aeJS;if(nsparts[0]==='aeJS'){nsparts=nsparts.slice(1)}
for(var i=0;i<nsparts.length;i++){var partname=nsparts[i];if(typeof parent[partname]==='undefined'){parent[partname]={}}
parent=parent[partname]}
return parent};createNS('aeJS.settings');consentOptions={'cookie':{'name':'ae_data_use_consent'},'container':document.body,'palette':{},'revokeBtn':'<div class=\'cc-revoke {{classes}}\'>Cookies and Data Use</div>','position':'top-right','type':'opt-in','content':{'message':'<h3>Cookies</h3><h3>Use Of Data</h3>','dismiss':'Close','allow':'I Agree to Use of Data','link':'Learn more','href':''},onInitialise:function(status){aeJS.consentStatus=status},onStatusChange:function(status,chosenBefore){aeJS.consentStatus=status}};var default_settings={'mobile_detect':!0,'return_url':location.href,'shopify_brandid':null,'redirect_to_shopify':!0,'shopify_tag_for_latest_activity':null,'close_button':!1,'hide_email_form':!1,'extra_fields':{},'extra_fields_screen':'disabled','display_error_message':!0,'default_flow_handlers':!0,'auth_window':!1,'activity_sharing_enabled':!0,'services':null,'scopes':null,'sso':'application','language':'en_US','extra_info':{},'flow_css':null,'verify_email':!1,'verify_email_for_login':!1,'code':null,'show_latest_activity':null,'show_latest_activity_for':null,'no_email':!1,'social_first':!1,'refresh_demographics':!0,'minimum_age':null,'date_format':'DD-MM-YYYY','profile_link':null,'partner_code':null,'partner_id':null,'help_link':null,'apple_music':{appName:null,icon:null,affiliateToken:null,campaignToken:null,},'flow_text':{error_header:'Sorry, there seems to be a problem',login_header:'Sign In',login_button:'Sign In',login_header_apple:'Sign In With the Account Linked to Your Apple ID',login_button_apple:'Sign In',login_with_button:'Sign in with',register_header:'Sign Up',register_button:'Sign Up',register_header_apple:'Create An Account. Then we\'ll link it to your Apple ID',register_button_apple:'Link Apple Music',register_with_button:'Sign up with',add_info_header:'Additional Information',add_info_button:'Submit',reset_pw_header:'Reset Password',reset_pw_sent:'A verification email will be sent to',reset_pw_instructions:'Please click the link in the email to confirm your address and reset your password.',reset_pw_button:'Verify Email',reset_pw_confirm_header:'Reset Password - Confirm',reset_pw_confirm_button:'Confirm',reset_pw_confirm_instructions:'Please enter a new password',reset_pw_done_header:'Reset Password - Done!',reset_pw_done_message:'Your password has been reset.',reset_pw_done_button:'OK',verify_email_header:'Verify Email',verify_email_sent:'A verification email will be sent to',verify_email_instructions:'Please click the link in the email to confirm your address and continue.',verify_email_retry_button:'Retry',verify_email_success_header:'Success.',verify_email_success_message:'Your email was successfully verified.',verify_email_success_button:'OK',verify_email_error_header:'Sorry.',verify_email_error_message:'That is not a valid activation url, or the url has expired. Please double check your email, or trigger a new activation email.',forgot_password_link:'forgot password?',recover_password_link:'Recover Password',optins_title:'Subscribe to these mailing lists',have_account_link:'Have an account?',need_help_link:'need help?',create_account_link:'create an account'},email_format:{show_header:!0,show_footer:!0,reset_pw_email_subject:'Password Reset For Sony Music Germany',reset_pw_email_message:'Click the following link to verify your email and reset your password',reset_pw_email_link:'Reset Password',verify_email_subject:'Please verify your email address for Sony Music Germany',verify_email_message:'Click the following link to verify your email and continue with your registration',verify_email_link:'Verify Email',}};createNS('aeJS.user');createNS('aeJS.flow');createNS('aeJS.isEmbed');aeJS.loggedIn=!1;aeJS.isEmbed=window!=window.parent;aeJS.omniIncluded=!1;createNS('aeJS.events');aeJS.events.onFlow={name:'onFlow'};aeJS.events.onWindow={name:'onWindow'};aeJS.events.onLogin={name:'onLogin'};aeJS.events.onLogout={name:'onLogout'};aeJS.events.onUser={name:'onUser'};aeJS.events.onMobileDetect={name:'onMobileDetect'};aeJS.events.onServiceRemoved={name:'onServiceRemoved'};aeJS.events.onLoaded={name:'onLoaded'};aeJS.events.onEmailVerify={name:'onEmailVerify'};aeJS.events.onPasswordReset={name:'onPasswordReset'};aeJS.events.onActivitySharing={name:'onActivitySharing'};aeJS.events.onActivitySent={name:'onActivitySent'};aeJS.events.onOptin={name:'onOptin'};aeJS.events.onFollow={name:'onFollow'};var aeEvent=function(){var listeners=[];this.getListeners=function(){return listeners};this.addHandler=function(callback){listeners.push(callback)};this.removeHandler=function(callback){for(var i=0;i<listeners.length;i++){if(listeners[i]===callback){listeners.splice(i,1)}}};this.callHandler=function(){var len=listeners.length;var i;if(this.name=='onLogin'&&aeJS.loggedIn)return;for(i=0;i<len;++i){if(typeof listeners[i]!=='undefined'){listeners[i].apply(null,arguments)}}}};aeEvent.call(aeJS.events.onFlow);aeEvent.call(aeJS.events.onWindow);aeEvent.call(aeJS.events.onLogin);aeEvent.call(aeJS.events.onLogout);aeEvent.call(aeJS.events.onMobileDetect);aeEvent.call(aeJS.events.onUser);aeEvent.call(aeJS.events.onServiceRemoved);aeEvent.call(aeJS.events.onLoaded);aeEvent.call(aeJS.events.onEmailVerify);aeEvent.call(aeJS.events.onActivitySent);aeEvent.call(aeJS.events.onOptin);aeEvent.call(aeJS.events.onPasswordReset);aeEvent.call(aeJS.events.onActivitySharing);aeEvent.call(aeJS.events.onFollow);$.extend(aeJS.events.onFlow,{clickHandler:function(event){if(typeof event.preventDefault!=='undefined')event.preventDefault();if(aeJS.consentStatus!=='allow'&&parseInt()==1){reset_consent();return}
if(aeJSPrepped){aeJS.flow=$.extend({},event.data);if(!aeJS.flow.return&&typeof aeJS.settings.return_url!=='undefined')
aeJS.flow.return=aeJS.settings.return_url;if(aeJS.flow.step!='logout'&&aeJS.flow.step!='remove'){if(aeJS.flow.step=='login'||aeJS.flow.step=='register'){if((JSON.parse(aeJS.settings.auth_window)===!0)&&(!parseInt()||!aeJS.settings.mobile_detect)){safariSessionCheck()}}
if(typeof aeJS.settings.extra_fields_screen_original!=='undefined'){aeJS.settings.extra_fields_screen=aeJS.settings.extra_fields_screen_original}
if(aeJS.flow.step=='login'||aeJS.flow.step=='login-direct'){if(typeof aeJS.settings.extra_fields_screen_original==='undefined'){aeJS.settings=$.extend(aeJS.settings,{'extra_fields_screen_original':aeJS.settings.extra_fields_screen})}
aeJS.settings.extra_fields_screen='disabled'}
if(aeJS.flow.step=='login-direct'||aeJS.flow.step=='register-direct'||aeJS.flow.step=='register-follow'){aeJS.flow.step='authenticate';if(aeJS.settings.extra_fields_screen=='before')aeJS.flow.step='required-fields'}}
aeJS.events.onFlow.callHandler(aeJS.flow)}}});var safariSessionCheck=function(){var isSafari=navigator.vendor&&navigator.vendor.indexOf('Apple')>-1;if(isSafari){openAuthWindow({path:'https://sme.theappreciationengine.com/framework-v1.8/session_start/467',windowOptions:'location=0,status=0,width=1,height=1',callback:function(){window.focus()}})}}
var safariRedirect=function(){var isSafari=navigator.vendor&&navigator.vendor.indexOf('Apple')>-1;if(isSafari){if(typeof GetURLParameter('safari_redirect')=='undefined'){current_url=location.href;location.href='https://sme.theappreciationengine.com/framework-v1.8/session_start/467?safari_redirect=true&uri='+encodeURIComponent(current_url)}}}
var getAuthState=function(memberid){$.ajaxWithCredentials({url:'https://sme.theappreciationengine.com//framework-v1.8/auth_state/467',dataType:'JSONP',type:'GET',data:{'MemberID':memberid},success:function(auth_state){var login_type=auth_state.registration===!0?'registration':'login';aeJS.user=typeof auth_state.user!=='undefined'?auth_state.user:{};if(isValidLogin())aeJS.events.onLogin.callHandler(aeJS.user,login_type)}})}
var openAuthWindow=function(options){messageHandled=!1;options.windowName=options.windowName||'ae_auth_window';options.windowOptions=options.windowOptions||'location=0,status=0,width=600,height=600';options.callback=options.callback||function(){window.location.reload()};options.windowOptions=options.windowOptions+',scrollbars=1'
options.path=addParam(options.path,'auth_method','window');if(typeof aeJS.authInterval!=='undefined')window.clearInterval(aeJS.authInterval);aeJS.auth_window=window.open(options.path,options.windowName,options.windowOptions);if(window.focus&&typeof aeJS.auth_window!=='undefined'&&aeJS.auth_window!==null){aeJS.auth_window.focus()}
aeJS.authInterval=window.setInterval(function(){if(aeJS.auth_window&&aeJS.auth_window.closed){window.clearInterval(aeJS.authInterval);options.callback({'type':'popup','state':'closed','service':aeJS.flow.service})}},1000);options.callback({'type':'popup','state':'opened','service':aeJS.flow.service});return!1};var authenticate=function(auth_url){auth_url=addParam(auth_url,'referer','https://forms.sonymusicfans.com/campaign/en_jmicheljarrexmartingore_brutalismtake2_presave/?fbclid=IwAR1CU5QHCHAlDBAU84x4pWlLr4ultS3iVibrMT-KIYBpdVd0I2q1lndVk6I');pass_settings=$.extend(!0,{},aeJS.settings);delete pass_settings.extra_fields;delete pass_settings.flow_text;auth_url=auth_url.concat('&',$.param(pass_settings));var optins='';$('input[data-ae-optin],input[data-ae-optin-brandid],input[data-ae-optin-segmentid]').each(function(index){var brandid=$(this).data('aeOptinBrandid');var segmentid=$(this).data('aeOptinSegmentid');var label=$(this).data('aeOptin');if($(this).prop('checked')){optins=optins+brandid+':'+segmentid+':'+label+','}
auth_url=addParam(auth_url,'optins',optins)});if((JSON.parse(aeJS.settings.auth_window)===!0)&&(!parseInt()||!aeJS.settings.mobile_detect)){var popupWidth=600;var popupHeight=650;var xPosition=($(window).width()-popupWidth)/2;var yPosition=($(window).height()-popupHeight)/2;openAuthWindow({path:auth_url,windowOptions:'width='+popupWidth+',height='+popupHeight+',left='+xPosition+',top='+yPosition,callback:aeJS.events.onWindow.callHandler})}else{if(aeJS.isEmbed){auth_url=addParam(auth_url,'referer','https://forms.sonymusicfans.com/campaign/en_jmicheljarrexmartingore_brutalismtake2_presave/?fbclid=IwAR1CU5QHCHAlDBAU84x4pWlLr4ultS3iVibrMT-KIYBpdVd0I2q1lndVk6I');auth_url=addParam(auth_url,'return',document.referrer);window.top.location.href=auth_url}else{location.href=auth_url}}};var checkVerifyEmail=function(){if(aeJS.settings.verify_email===!0){var noUserEmail=!1;if(typeof aeJS.user.data==='undefined'||aeJS.user.data.Email===null||typeof aeJS.user.data.Email==='undefined')noUserEmail=!0;if(noUserEmail&&typeof aeJS.settings.extra_fields.email==='undefined'){$.extend(aeJS.settings.extra_fields,{'email':{required:!0}})}
if(aeJS.settings.extra_fields_screen==='disabled'){aeJS.settings.extra_fields_screen='after'}}};var extraFields=function(user,requiredOnly){var is_missing=!1;var missing={};if(typeof requiredOnly==='undefined')requiredOnly=!1;if(typeof aeJS.settings.extra_fields!='undefined'){if(typeof user.data!='undefined'){var key,keys=Object.keys(user.data);var n=keys.length;var user_data_lc={}
while(n--){key=keys[n];user_data_lc[key.toLowerCase()]=user.data[key]}
$.each(aeJS.settings.extra_fields,function(field,properties){var extra_field=aeJS.settings.extra_fields[field];var required=(typeof extra_field.required!=='undefined'&&JSON.parse(extra_field.required)===!0);if(!requiredOnly||(required&&requiredOnly)){if(typeof user_data_lc[field]==='undefined'||user_data_lc[field]==='Unknown'||(!!user_data_lc[field])===!1){is_missing=!0;missing[field]=properties}}})}else{return aeJS.settings.extra_fields}}
if(is_missing)return missing;return is_missing};var initSettings=function(){var temp_settings=$.extend(!0,default_settings,aeJS.settings);aeJS.settings=temp_settings;if(typeof aeJS.settings.extra_fields.password!=='undefined'){aeJS.settings.password_format=aeJS.settings.extra_fields.password;delete aeJS.settings.extra_fields.password}};var verifiedEmail=function(){var verified=!1;if(typeof aeJS.user.data!='undefined'){if(typeof aeJS.user.data.VerifiedEmail!=='undefined'&&aeJS.user.data.VerifiedEmail!==null)verified=!0}
return verified};var validService=function(){var valid_service=!1;if(typeof aeJS.user.services!='undefined'){$.each(aeJS.user.services,function(index,service){if(service.Service=='email'){if(typeof aeJS.settings.no_email==='undefined'||JSON.parse(aeJS.settings.no_email)===!1){if($.inArray('forms.sonymusicfans.com',service.Domains)!==-1||$.inArray('forms.sonymusicfans.com'.replace('www.',''),service.Domains)!==-1){valid_service=!0}}}
if(typeof aeJS.settings.services==='undefined'||aeJS.settings.services===null||aeJS.settings.services.toLowerCase().indexOf(service.Service)!==-1){if($.inArray('forms.sonymusicfans.com',service.Domains)!==-1||$.inArray('forms.sonymusicfans.com'.replace('www.',''),service.Domains)!==-1){valid_service=!0}}})}
return valid_service};var SSO=function(){var sso=!1;var valid_services=[2424,2549,2550,2551,2552,2553,2554,2913,3373];if(typeof aeJS.user.services!='undefined'){$.each(aeJS.user.services,function(index,service){if(sso!==!1)return sso;if($.inArray('forms.sonymusicfans.com',service.Domains)!==-1||$.inArray('forms.sonymusicfans.com'.replace('www.',''),service.Domains)!==-1){return sso}else{if(typeof aeJS.settings.sso==='undefined'||aeJS.settings.sso=='application'){if(service.Service=='email'){if(typeof aeJS.settings.no_email==='undefined'||JSON.parse(aeJS.settings.no_email)===!1){sso=service.ID;return}}
if($.inArray(JSON.parse(service.ServiceID),valid_services)!==-1){if(typeof aeJS.settings.services==='undefined'||aeJS.settings.services===null||aeJS.settings.services.indexOf(service.Service)!==-1){sso=service.ID;return}}}}})}
return sso};var isValidLogin=function(returnStep){if(typeof returnStep==='undefined')returnStep=!1;var valid=!0;if(aeJS.settings.verify_email_for_login===!0){if(!verifiedEmail()){valid='verify-email'}}
missing=extraFields(aeJS.user,!0);if(missing!==!1){valid='required-fields'}
if(!validService()){valid='invalid-service'}
if(returnStep)return valid;return(valid===!0)};var isValidSSO=function(){var valid=!0;if(aeJS.settings.verify_email_for_login===!0){if(!verifiedEmail()){valid=!1}}
missing=extraFields(aeJS.user,!0);if(missing!==!1){valid=!1}
return valid};var absolutePath=function(href){var link=document.createElement('a');link.href=href;var pathname=(link.pathname.charAt(0)=='/')?link.pathname:'/'+link.pathname;return(link.protocol+'//'+link.host+pathname+link.search+link.hash)}
createNS('aeJS.trigger');aeJS.trigger.login=function(token){authUrl='https://sme.theappreciationengine.com//framework-v1.8/auth_state/467/'+token;authUrl=addParam(authUrl,'ae_token_login',1);$.ajaxWithCredentials({url:authUrl,dataType:'JSONP',type:'GET',success:function(auth_state){try{state=JSON.parse(auth_state)}catch(e){state=auth_state}
nextSteps(state)}})}
aeJS.trigger.logout=function(){aeJSPrepped=!1;aeJS.loggedIn=!1;var url='https://sme.theappreciationengine.com/brand/sony-music-germany/logout';url=addParam(url,'ae_appid','60');url=addParam(url,'auth_method','window');$.postWithCredentials(url,aeJS.settings,function(data){flowURL='https://sme.theappreciationengine.com/framework-v1.8/flow/467/prep';var cache_url=addParam(flowURL,'pre_cache',1);cache_url=addParam(cache_url,'from','d7dae646692f1a787c73cb5d45b6717d');cache_url=addParam(cache_url,'segment','1572493');cache_url=addParam(cache_url,'consent',aeJS.consentStatus);if(!aeJS.isEmbed){cache_url=addParam(cache_url,'referring_url',top.document.referrer)}
$.postWithCredentials(cache_url,aeJS.settings,function(data){aeJSPrepped=!0;aeJS.events.onLogout.callHandler({})})})}
aeJS.trigger.remove=function(service,returnURL){var removeURLs={"email":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/remove\/2424","spotify":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/remove\/2549","twitter":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/remove\/2550","deezer":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/remove\/2551","youtube":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/remove\/2552","google":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/remove\/2553","facebook":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/remove\/2554","applemusic":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/remove\/2913","amazonmusic":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/remove\/3373"};var step='remove';if(typeof(returnURL)=='undefined')returnURL=location.href
if(typeof(service)!=='undefined'){url=removeURLs[service];var event=jQuery.Event('click');$.extend(event,{target:{}});$(event.target).attr('data-ae-return',returnURL);$.extend(!0,event,{data:{'step':step,'auth_url':url,'return':returnURL}});aeJS.events.onFlow.clickHandler(event)}}
aeJS.trigger.authenticate=function(service,type,returnURL,scopes){var loginURLs={"email":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/login\/2424","spotify":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/login\/2549","twitter":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/login\/2550","deezer":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/login\/2551","youtube":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/login\/2552","google":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/login\/2553","facebook":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/login\/2554","applemusic":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/login\/2913","amazonmusic":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/login\/3373"};var registerURLs={"email":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/register\/2424","spotify":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/register\/2549","twitter":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/register\/2550","deezer":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/register\/2551","youtube":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/register\/2552","google":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/register\/2553","facebook":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/register\/2554","applemusic":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/register\/2913","amazonmusic":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/register\/3373"};var authURLs={"email":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/auth\/2424","spotify":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/auth\/2549","twitter":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/auth\/2550","deezer":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/auth\/2551","youtube":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/auth\/2552","google":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/auth\/2553","facebook":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/auth\/2554","applemusic":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/auth\/2913","amazonmusic":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/auth\/3373"};var step='';var url='';if(typeof(returnURL)=='undefined')returnURL=location.href
if(typeof(type)==='undefined')type='register';if(type=='login'){step='login-direct';url=loginURLs[service];if(service==='email')step='login-direct-email';if(service==='applemusic')step='login-apple-email'}else if(type=='register'){step='register-direct';url=registerURLs[service];if(service==='email')step='register-direct-email'
if(service==='applemusic')step='register-apple-email'}else if(type=='auth'){step='authenticate';url=authURLs[service];if(service==='email')step='auth-direct-email';if(service==='applemusic')step='auth-apple-email'}
url=addParam(url,'segment','1572493');url=addParam(url,'consent',aeJS.consentStatus);if(typeof(scopes)!='undefined')url=addParam(url,'link-scopes['+service+']',scopes);if(step=='auth-apple-email'){aeJS.musickit.authorize().then(function(musictoken){path=String(url).split('/');clientID=path.pop();linkAppleURL='https://sme.theappreciationengine.com/framework-v1.8/link_apple/467';var data={musictoken:musictoken,clientID:clientID};$.postWithCredentials(linkAppleURL,data,function(auth_state){nextSteps(auth_state)})})}else{var event=jQuery.Event('click');$.extend(event,{target:{}});$(event.target).attr('data-ae-return',returnURL);$.extend(!0,event,{data:{'step':step,'auth_url':url,'return':returnURL,'service':service}});aeJS.events.onFlow.clickHandler(event)}}
aeJS.trigger.flow=function(type,returnURL){if(typeof type==='undefined')type='register';var url='https://sme.theappreciationengine.com/framework-v1.8/flow/467/'+type;var step=type;var returnURL=(typeof returnURL==='undefined')?window.location.href:returnURL;var event=jQuery.Event('click');$.extend(event,{target:{}});$(event.target).attr('data-ae-return',returnURL);$.extend(!0,event,{data:{'step':step,'auth_url':url,'return':returnURL}});aeJS.events.onFlow.clickHandler(event)}
aeJS.trigger.verify_email=function(returnURL){aeJS.trigger.send_verify_email(returnURL,'','','verify-email')}
aeJS.trigger.verify_reset_password=function(returnURL){aeJS.trigger.send_verify_email(returnURL,'','','reset-password')}
aeJS.trigger.send_verify_email=function(returnURL,email,message,step){if(typeof step==='undefined')step='send-email'
if(email!=='')aeJS.settings.email=email;if(message!=='')aeJS.settings.message=message;aeJS.flow.step=step;if(typeof returnURL==='undefined'){if(typeof aeJS.settings.return_url!=='undefined')returnURL=aeJS.settings.return_url;else returnURL=location.href}
aeJS.flow.return=returnURL;if(step==='send-email'){flowURL='https://sme.theappreciationengine.com/framework-v1.8/flow/467/send-email';var cache_url=addParam(flowURL,'pre_cache',1);cache_url=addParam(cache_url,'from','d7dae646692f1a787c73cb5d45b6717d');cache_url=addParam(cache_url,'segment','1572493');cache_url=addParam(cache_url,'consent',aeJS.consentStatus);cache_url=addParam(cache_url,'return',absolutePath(returnURL));$.postWithCredentials(cache_url,aeJS.settings,function(data){if(typeof data.code!=='undefined'){aeJS.events.onEmailVerify.callHandler('error',data)}else{aeJS.events.onEmailVerify.callHandler('sent',{'EmailAddress':aeJS.settings.email,'ActivationCode':data})}})}else{aeJS.step_triggered=step;aeJS.events.onFlow.callHandler(aeJS.flow)}}
aeJS.trigger.send_activity=function(id,data,marker,record){if(typeof record==='undefined')record=!1;activityURL='https://sme.theappreciationengine.com/framework-v1.8/send_activity/467';var data={activity_id:id,data:data,marker:marker,record:record};$.postWithCredentials(activityURL,data,function(response){aeJS.events.onActivitySent.callHandler(response)})}
aeJS.trigger.optin=function(brandid,segmentid,record){if(typeof record==='undefined')record=!1;optinURL='https://sme.theappreciationengine.com/framework-v1.8/optin/467';var data={brandid:brandid,segmentid:segmentid,record:record};$.postWithCredentials(optinURL,data,function(response){responseObj=JSON.parse(response);if(typeof responseObj.data!=='undefined')aeJS.user=responseObj;aeJS.events.onOptin.callHandler(response)})}
aeJS.trigger.activity_sharing=function(serviceid,enable){activitySharingURL='https://sme.theappreciationengine.com/framework-v1.8/activity_sharing/467';$.postWithCredentials(activitySharingURL,{'serviceid':serviceid,'enable':enable},function(response){responseObj=JSON.parse(response);if(typeof responseObj.data!=='undefined')aeJS.user=responseObj;aeJS.events.onActivitySharing.callHandler(response)})}
aeJS.trigger.reset_password=function(service_id,email,password){if(typeof service_id==='undefined')error='missing service id';if(typeof email==='undefined')error='missing email';if(typeof password==='undefined')error='missing password';if(typeof error!=='undefined'){aeJS.events.onPasswordReset.callHandler('error',error);return}
flowURL='https://sme.theappreciationengine.com/framework-v1.8/flow/467/reset-password-ok';var cache_url=addParam(flowURL,'pre_cache',1);cache_url=addParam(cache_url,'from','d7dae646692f1a787c73cb5d45b6717d');cache_url=addParam(cache_url,'segment','1572493');cache_url=addParam(cache_url,'consent',aeJS.consentStatus);$.postWithCredentials(cache_url,{'password':password,'email':email,'member_service_id':service_id},function(data){aeJS.events.onPasswordReset.callHandler('ok')})}
aeJS.trigger.submit=function(form){if($(form).data('aeRegisterForm')!=='undefined'){$(form).submit()}}
aeJS.trigger.popup=function(url,callback){var popupWidth=600;var popupHeight=450;var xPosition=($(window).width()-popupWidth)/2;var yPosition=($(window).height()-popupHeight)/2;openAuthWindow({path:url,windowOptions:'width='+popupWidth+',height='+popupHeight+',left='+xPosition+',top='+yPosition,callback:aeJS.events.onWindow.callHandler})}
aeJS.trigger.reset_consent=function(cookieText,dataText,privacyLink){reset_consent(cookieText,dataText,privacyLink)}
createNS('aeJS.get');aeJS.get.user=function(){return aeJS.user}
aeJS.get.flow=function(){var reason=isValidLogin(!0);if(reason===!0)reason='done';if(typeof aeJS.settings.return_url!=='undefined')returnURL=aeJS.settings.return_url;else returnURL=location.href;aeJS.flow.step=reason;aeJS.flow.return=returnURL;return aeJS.flow}
aeJS.trigger.attach=function(context){$('a[data-ae-login-window]').each(function(index){if(!aeJS.omniIncluded){var css_link=jQuery('<link>',{rel:'stylesheet',type:'text/css',href:'https://sme.theappreciationengine.com//themes/appreciationengine22/auth_framework/jquery.omniwindow.css'});css_link.appendTo('head');aeJS.omniIncluded=!0}
if(typeof context=='undefined'||$(context).is($(this))){var url='https://sme.theappreciationengine.com/framework-v1.8/flow/467/login';var step='login';var returnURL=aeJS.settings.return_url;if($(this).data('aeReturn'))returnURL=$(this).data('aeReturn');$(this).off('click',aeJS.events.onFlow.clickHandler).on('click',{'step':step,'auth_url':url,return:returnURL},aeJS.events.onFlow.clickHandler)}});$('a[data-ae-register-window]').each(function(index){if(!aeJS.omniIncluded){var css_link=jQuery('<link>',{rel:'stylesheet',type:'text/css',href:'https://sme.theappreciationengine.com//themes/appreciationengine22/auth_framework/jquery.omniwindow.css'});css_link.appendTo('head');aeJS.omniIncluded=!0}
if(typeof context=='undefined'||$(context).is($(this))){var url='https://sme.theappreciationengine.com/framework-v1.8/flow/467/register';var step='register';var returnURL=aeJS.settings.return_url;if($(this).data('aeReturn'))returnURL=$(this).data('aeReturn');$(this).off('click',aeJS.events.onFlow.clickHandler).on('click',{'step':step,'auth_url':url,return:returnURL},aeJS.events.onFlow.clickHandler)}});$('a[data-ae-login-link]').each(function(index){if(typeof context=='undefined'||$(context).is($(this))){var loginURLs={"email":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/login\/2424","spotify":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/login\/2549","twitter":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/login\/2550","deezer":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/login\/2551","youtube":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/login\/2552","google":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/login\/2553","facebook":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/login\/2554","applemusic":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/login\/2913","amazonmusic":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/login\/3373"};var service=$(this).data('aeLoginLink');var url=loginURLs[service];url=addParam(url,'segment','1572493');url=addParam(url,'consent',aeJS.consentStatus);var step='login-direct';var returnURL=aeJS.settings.return_url;if(service==='email')step='login-direct-email';if(service==='applemusic')step='login-apple-email';if($(this).data('aeReturn'))returnURL=$(this).data('aeReturn');if($(this).data('aeStep'))step=$(this).data('aeStep');$(this).off('click',aeJS.events.onFlow.clickHandler).on('click',{'step':step,'auth_url':url,'return':returnURL,'service':service},aeJS.events.onFlow.clickHandler)}});$('a[data-ae-register-link]').each(function(index){if(typeof context=='undefined'||$(context).is($(this))){var registerURLs={"email":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/register\/2424","spotify":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/register\/2549","twitter":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/register\/2550","deezer":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/register\/2551","youtube":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/register\/2552","google":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/register\/2553","facebook":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/register\/2554","applemusic":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/register\/2913","amazonmusic":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/register\/3373"};var service=$(this).data('aeRegisterLink');var url=registerURLs[service];url=addParam(url,'segment','1572493');url=addParam(url,'consent',aeJS.consentStatus);var step='register-direct';var returnURL=aeJS.settings.return_url;if(service==='email')step='register-direct-email';if(service==='applemusic')step='register-apple-email';if($(this).data('aeReturn'))returnURL=$(this).data('aeReturn');if($(this).data('aeStep'))step=$(this).data('aeStep');if($(this).data('aeScopes'))url=addParam(url,'link-scopes['+service+']',$(this).data('aeScopes'));$(this).off('click',aeJS.events.onFlow.clickHandler).on('click',{'step':step,'auth_url':url,'return':returnURL,'service':service},aeJS.events.onFlow.clickHandler)}});$('a[data-ae-follow-link]').each(function(index){if(typeof context=='undefined'||$(context).is($(this))){var registerURLs={"email":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/register\/2424","spotify":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/register\/2549","twitter":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/register\/2550","deezer":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/register\/2551","youtube":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/register\/2552","google":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/register\/2553","facebook":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/register\/2554","applemusic":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/register\/2913","amazonmusic":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/register\/3373"};var service=$(this).data('aeFollowLink');var url=registerURLs[service];var follow_id=null;var follow_type=null;if($(this).data('aeArtistId')){follow_id=$(this).data('aeArtistId');follow_type='artist'}else if($(this).data('aeTrackId')){follow_id=$(this).data('aeTrackId');follow_type='track'}else if($(this).data('aeAlbumId')){follow_id=$(this).data('aeAlbumId');follow_type='album'}else if($(this).data('aePlaylistId')){follow_id=$(this).data('aePlaylistId');follow_type='playlist'}else if($(this).data('aeUserId')){follow_id=$(this).data('aeUserId');follow_type='user'}
url=addParam(url,'segment','1572493');url=addParam(url,'consent',aeJS.consentStatus);url=addParam(url,'follow_type',follow_type);url=addParam(url,'follow_id',follow_id);var step='register-follow';var returnURL=aeJS.settings.return_url;if($(this).data('aeReturn'))returnURL=$(this).data('aeReturn');if($(this).data('aeStep'))step=$(this).data('aeStep');$(this).off('click',aeJS.events.onFlow.clickHandler).on('click',{'step':step,'auth_url':url,'return':returnURL,'service':service,'follow_type':follow_type,'follow_id':follow_id},aeJS.events.onFlow.clickHandler)}});$('a[data-ae-logout-link]').each(function(index){if(typeof context=='undefined'||$(context).is($(this))){var step='logout';var returnURL=aeJS.settings.return_url;var url='https://sme.theappreciationengine.com/brand/sony-music-germany/logout';if($(this).data('aeReturn'))returnURL=$(this).data('aeReturn');$(this).off('click',aeJS.events.onFlow.clickHandler).on('click',{'step':step,'auth_url':url,return:returnURL},aeJS.events.onFlow.clickHandler)}});$('a[data-ae-auth-link]').each(function(index){if(typeof context=='undefined'||$(context).is($(this))){var authURLs={"email":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/auth\/2424","spotify":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/auth\/2549","twitter":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/auth\/2550","deezer":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/auth\/2551","youtube":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/auth\/2552","google":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/auth\/2553","facebook":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/auth\/2554","applemusic":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/auth\/2913","amazonmusic":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/auth\/3373"};var service=$(this).data('aeAuthLink');var url=authURLs[service];var step='authenticate';var returnURL=aeJS.settings.return_url;if(service==='email')step='auth-direct-email';if(service==='applemusic')step='auth-apple-email';if($(this).data('aeReturn'))returnURL=$(this).data('aeReturn');if($(this).data('aeStep'))step=$(this).data('aeStep');$(this).off('click',aeJS.events.onFlow.clickHandler).on('click',{'step':step,'auth_url':url,'return':returnURL,'service':service},aeJS.events.onFlow.clickHandler)}});$('a[data-ae-remove-link]').each(function(index){if(typeof context=='undefined'||$(context).is($(this))){var removeURLs={"email":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/remove\/2424","spotify":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/remove\/2549","twitter":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/remove\/2550","deezer":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/remove\/2551","youtube":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/remove\/2552","google":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/remove\/2553","facebook":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/remove\/2554","applemusic":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/remove\/2913","amazonmusic":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/remove\/3373"};var service=$(this).data('aeRemoveLink');var url=removeURLs[service];var step='remove';var returnURL=aeJS.settings.return_url;if($(this).data('aeReturn'))returnURL=$(this).data('aeReturn');if($(this).data('aeStep'))step=$(this).data('aeStep');$(this).off('click',aeJS.events.onFlow.clickHandler).on('click',{'step':step,'auth_url':url,'return':returnURL,'service':service},aeJS.events.onFlow.clickHandler)}});$('a[data-ae-link]').each(function(index){if(typeof context=='undefined'||$(context).is($(this))){var step=$(this).data('aeLink');var url='https://sme.theappreciationengine.com/framework-v1.8/flow/467/'+step;if($(this).data('aeReturn'))returnURL=$(this).data('aeReturn');else returnURL=aeJS.settings.return_url;$(this).off('click',aeJS.events.onFlow.clickHandler).on('click',{'step':step,'auth_url':url,return:returnURL},aeJS.events.onFlow.clickHandler)}});$('a[data-ae-shopify-multipass-link]').each(function(index){if(typeof context=='undefined'||$(context).is($(this))){var multipassURL='https://sme.theappreciationengine.com/brand/sony-music-germany/multipass';var brandid=$(this).data('aeShopifyMultipassLink');var url=multipassURL+'/'+brandid;url=addParam(url,'return_to',$(this).attr('href'));$(this).attr('href',url)}});$('input[data-ae-optin],input[data-ae-optin-brandid],input[data-ae-optin-segmentid]').each(function(index){if($(this).data('aeOptin'))$(this).after('<label class=\'ae-optin-label\'>'+$(this).data('aeOptin')+'</label>')});var firstExecution=0;var interval=2000;$('form[data-ae-register-form]').each(function(index){if(typeof context=='undefined'||$(context).is($(this))){$(this).off('submit.aeJS');aeJS.formSubmit=function(event){event.preventDefault();safariSessionCheck();var date=new Date();var milliseconds=date.getTime();if((milliseconds-firstExecution)>interval){firstExecution=milliseconds}else{return!1}
if(parseInt()===1&&aeJS.settings.mobile_detect)aeJS.settings.auth_window=!1;var loginType='register';if($(this).data('aeType'))loginType=$(this).data('aeType');if(loginType=='registration')loginType='register';var service=$(this).attr('data-ae-register-form');if(loginType=='register'){var registerURLs={"email":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/register\/2424","spotify":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/register\/2549","twitter":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/register\/2550","deezer":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/register\/2551","youtube":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/register\/2552","google":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/register\/2553","facebook":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/register\/2554","applemusic":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/register\/2913","amazonmusic":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/register\/3373"};var url=registerURLs[service];var step='register-direct'}else{var loginURLs={"email":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/login\/2424","spotify":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/login\/2549","twitter":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/login\/2550","deezer":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/login\/2551","youtube":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/login\/2552","google":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/login\/2553","facebook":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/login\/2554","applemusic":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/login\/2913","amazonmusic":"https:\/\/sme.theappreciationengine.com\/brand\/sony-music-germany\/login\/3373"};var url=loginURLs[service];var step='login-direct'}
var returnURL=aeJS.settings.return_url;var update=!1;var first_time_login=!1;if($(this).data('aeReturn'))returnURL=$(this).data('aeReturn');$(this).attr('action',url);if(typeof aeJS.user.data!=='undefined'&&typeof $(this).data('aeType')=='undefined'){url=url.replace(/register|login|auth/gi,'update');update=!0}
var this_form=$(this);var method=aeJS.settings.auth_window===!0?'window':'direct';if(!$(this).data('aeReturn')&&typeof aeJS.settings.return_url!=='undefined')
returnURL=aeJS.settings.return_url;aeJS.flow.return=returnURL;flowURL=addParam('https://sme.theappreciationengine.com/framework-v1.8/flow/467/prep','auth_url',url);flowURL=addParam(flowURL,'return',absolutePath(returnURL));flowURL=addParam(flowURL,'auth_method',method);if(!aeJS.isEmbed){flowURL=addParam(flowURL,'referring_url',top.document.referrer)}
var optins='';$('input[data-ae-optin],input[data-ae-optin-brandid],input[data-ae-optin-segmentid]').each(function(index){var brandid=$(this).data('aeOptinBrandid');var segmentid=$(this).data('aeOptinSegmentid');var label=$(this).data('aeOptin');if($(this).prop('checked')){optins=optins+brandid+':'+segmentid+':'+label+','}});if(update){if(typeof aeJS.user.data!='undefined'){var input=$('<input>').attr('type','hidden').attr('name','MemberID').val(aeJS.user.data.ID);$(this).append($(input))}
$.postWithCredentials('https://sme.theappreciationengine.com/framework-v1.8/auth_state/467',$(this).serialize(),function(auth_state){aeJS.user=auth_state.user;if(isValidLogin()){var login_type=auth_state.registration===!0?'registration':'login';if(aeJS.loggedIn){aeJS.events.onUser.callHandler(auth_state.user,'update')}else{aeJS.events.onLogin.callHandler(auth_state.user,login_type)}}else{var reason=isValidLogin(!0);aeJS.flow.step=reason;aeJS.flow.return=(auth_state.return==='undefined')?aeJS.flow.return:auth_state.return;aeJS.events.onFlow.callHandler(aeJS.flow,!1)}})}else{aeJS.loggedIn=!1;if(service=='email'){if(aeJS.settings.auth_window===!0){var email_reg_url=addParam('https://sme.theappreciationengine.com/framework-v1.8/email_ajax_register/467','return',absolutePath(returnURL));email_url=addParam(email_reg_url,'auth_method',method);email_url=addParam(email_reg_url,'type',loginType);email_url=addParam(email_url,'optins',optins);email_url=addParam(email_url,'segment','1572493');$.postWithCredentials(email_url,$(this).serialize(),function(auth_state){nextSteps(auth_state)})}else{var input=$('<input>').attr('type','hidden').attr('name','return').val(absolutePath(returnURL));$(this).append($(input));var cache_url=addParam(flowURL,'pre_cache',1);cache_url=addParam(cache_url,'optins',optins);cache_url=addParam(cache_url,'segment','1572493');$.postWithCredentials(cache_url,aeJS.settings,function(data){this_form.off('submit.aeJS');this_form.submit();this_form.on('submit.aeJS',aeJS.formSubmit)})}}else{if(aeJS.settings.auth_window===!0){aeJS.trigger.popup('about:blank');$(this).prop('target',aeJS.auth_window.name)}
var input=$('<input>').attr('type','hidden').attr('name','return').val(absolutePath(returnURL));$(this).append($(input));var cache_url=addParam(flowURL,'pre_cache',1);cache_url=addParam(cache_url,'optins',optins);$.postWithCredentials(cache_url,aeJS.settings,function(data){this_form.off('submit.aeJS');this_form.submit();this_form.on('submit.aeJS',aeJS.formSubmit)})}}};$(this).on('submit.aeJS',aeJS.formSubmit)}})}
if(!aeJS.isEmbed){createNS('aeJS.modal');aeJS.modal.overlay=$('<div/>');aeJS.modal.overlay.attr('id','ae-modal-overlay');aeJS.modal.overlay.attr('class','ae-modal-overlay ae-modal-overlay-closed');$('body').append(aeJS.modal.overlay);aeJS.modal.window=$('<div/>');aeJS.modal.window.attr('id','ae-modal');aeJS.modal.window.attr('class','ae-modal ae-modal-closed');$('body').append(aeJS.modal.window);aeJS.modal.window.omniWindow({overlay:{selector:'.ae-modal-overlay',hideClass:'ae-modal-overlay-closed'},modal:{hideClass:'ae-modal-closed'},callbacks:{afterHide:function(subjects,internalCallback){$('#ae-flow-frame').remove();aeJS.events.onWindow.callHandler({'type':'modal','state':'closed'});if(typeof aeJS.step_triggered!=='undefined'){if(aeJS.step_triggered=='verify-email')aeJS.events.onEmailVerify.callHandler('sent',{'EmailAddress':aeJS.user.data.Email})}
return internalCallback(subjects)},afterShow:function(subjects,internalCallback){aeJS.events.onWindow.callHandler({'type':'modal','state':'opened'})
return internalCallback(subjects)}}});aeJS.modal.window.show=function(flowURL,data){aeJS.modal.overlay.css('z-index',function(index){return topZIndex()+1});aeJS.modal.window.css('z-index',function(index){return topZIndex()+1});flowURL=addParam(flowURL,'pre_cache',1);$.postWithCredentials(flowURL,data,function(data){flowURL=addParam(flowURL,'cache_key',data);aeJS.modal.window.append('<iframe id=\'ae-flow-frame\' name=\'ae-flow-frame\' src=\''+flowURL+'\' seamless=\'seamless\'/>');aeJS.modal.window.trigger('show')})}}
$('[data-ae-extra-info]').each(function(index){$(this).hide();var insert=$(this).data('aeExtraInfo');var position=($(this).data('aeExtraInfoPosition')==='undefined')?'top':$(this).data('aeExtraInfoPosition');default_settings.extra_info[insert]={};default_settings.extra_info[insert][position]={};default_settings.extra_info[insert][position].title=$(this).children('h3').text();default_settings.extra_info[insert][position].text=$(this).children('div').html()});aeJS.trigger.attach();if(typeof GetURLParameter('accessToken')!=='undefined'){token=GetURLParameter('accessToken');if(typeof GetURLParameter('init_token_login')!=='undefined')init_token_login=GetURLParameter('init_token_login')}else if(typeof localStorage.getItem('ae_refresh_token')!=='undefined'){token=localStorage.getItem('ae_refresh_token');init_token_login='refresh'}
if(typeof token!=='undefined'&&token!==null){authUrl='https://sme.theappreciationengine.com//framework-v1.8/auth_state/467/'+token;if(typeof GetURLParameter('ae_session')!=='undefined'){session=GetURLParameter('ae_session');authUrl=addParam(authUrl,'session',session)}
if(typeof init_token_login!=='undefined'){if(init_token_login=='true')authUrl=addParam(authUrl,'ae_token_login',1);if(init_token_login=='refresh')authUrl=addParam(authUrl,'ae_token_login',2)}
$.ajaxWithCredentials({url:authUrl,dataType:'JSONP',type:'GET',success:function(auth_state){if(typeof auth_state==='string'||auth_state instanceof String){state=JSON.parse(auth_state)}else{state=auth_state}
nextSteps(state)}})};if(typeof(window.AEJSReady)=='function'){aeJS.musickit;musicKitLoaded=function(MusicKit){MusicKit.configure({developerToken:'eyJhbGciOiJFUzI1NiIsImtpZCI6IjhOQUxONU5IUDcifQ.eyJpc3MiOiJQWUhKTjlaNlcyIiwiaWF0IjoxNzU2OTIzMjkxLCJleHAiOjE3NTk1MTUyOTF9.pH2O4qCRJB0otMlu1PgcS7gHhYfBB51wPDnJBqLjOAgWTcvxarRD2dwofRRWvmUkPATQbbpDVFVPBM81uZmg1g',affiliateToken:aeJS.settings.apple_music.affiliateToken,campaignToken:aeJS.settings.apple_music.campaignToken,app:{name:aeJS.settings.apple_music.appName,icon:aeJS.settings.apple_music.icon}});aeJS.musickit=MusicKit.getInstance()}
if(typeof define==='function'&&define.amd){require(['https://js-cdn.music.apple.com/musickit/v1/musickit.js'],function(MusicKit){musicKitLoaded(MusicKit)})}else{$.cachedScript('https://js-cdn.music.apple.com/musickit/v1/musickit.js').done(function(script,textStatus){document.addEventListener('musickitloaded',function(){musicKitLoaded(MusicKit)})}).fail(function(jqxhr,settings,exception){console.log('Apple MusicKit load fail')})}
window.AEJSReady(aeJS);initSettings();aeJS.events.onWindow.addHandler(function(data){if(data.state==='closed'&&data.type=='popup'){if(!aeJS.isEmbed&&!messageHandled){$.ajaxWithCredentials({url:'https://sme.theappreciationengine.com//framework-v1.8/auth_state/467',dataType:'JSONP',type:'GET',success:function(auth_state){nextSteps(auth_state)}})}}});aeJS.events.onLogin.addHandler(function(data,type){setLinkState(!0);aeJS.user=data;aeJS.loggedIn=!0;localStorage.setItem('ae_refresh_token',aeJS.user.data.AccessToken)});aeJS.events.onUser.addHandler(function(data,state){setLinkState(!0);aeJS.user=data;aeJS.loggedIn=!0;localStorage.setItem('ae_refresh_token',aeJS.user.data.AccessToken)});aeJS.events.onLogout.addHandler(function(data){setLinkState(!1);aeJS.user=data;aeJS.loggedIn=!1;localStorage.removeItem('ae_refresh_token')});aeJS.events.onMobileDetect.addHandler(function(data){});aeJS.events.onServiceRemoved.addHandler(function(service,user){});aeJS.events.onLoaded.addHandler(function(service,user){});aeJS.events.onEmailVerify.addHandler(function(service,user){});aeJS.events.onActivitySent.addHandler(function(response){});aeJS.events.onOptin.addHandler(function(response){});aeJS.events.onPasswordReset.addHandler(function(service,user){});aeJS.events.onActivitySharing.addHandler(function(service,user){});aeJS.events.onFollow.addHandler(function(service,user){});aeJS.events.onFlow.addHandler(function(data,include_default){if(include_default!==!1){var url=aeJS.flow.auth_url;var missing;var flowURL;var div=document.createElement('div');div.innerHTML='<!--[if lt IE 10]><i></i><![endif]-->';var isIeLessThan10=(div.getElementsByTagName('i').length==1);if(isIeLessThan10){aeJS.settings.auth_window=!1}
if(parseInt()===1&&aeJS.settings.mobile_detect)aeJS.settings.auth_window=!1;if(aeJS.flow.step==='authenticate'){aeJS.loggedIn=!1;url=addParam(url,'return',absolutePath(aeJS.flow.return));if(JSON.parse(aeJS.settings.auth_window)!==!0)url=addParam(url,'auth_method','direct');if(!aeJS.isEmbed)url=addParam(url,'auth_referer','https://forms.sonymusicfans.com');authenticate(url)}else if(aeJS.flow.step==='auth-apple-email'){aeJS.trigger.authenticate('applemusic','auth')}else if(aeJS.flow.step==='remove'){if(JSON.parse(aeJS.settings.auth_window)===!0&&!aeJS.isEmbed){url=addParam(url,'ae_appid','60');url=addParam(url,'auth_method','window');$.postWithCredentials(url,aeJS.settings,function(auth_state){aeJS.user=auth_state.user;aeJS.events.onServiceRemoved.callHandler(auth_state.service,auth_state.user)})}else{url=addParam(url,'auth_method','direct');url=addParam(url,'return',absolutePath(aeJS.flow.return));location.href=url}}else if(aeJS.flow.step==='logout'){if(JSON.parse(aeJS.settings.auth_window)===!0&&!aeJS.isEmbed){aeJS.trigger.logout()}else{aeJS.events.onLogout.callHandler({});url=addParam(url,'auth_method','direct');url=addParam(url,'return',absolutePath(aeJS.flow.return));location.href=url}}else{if(aeJS.flow.step==='error'&&aeJS.settings.display_error_message===!1)return;if(aeJS.settings.default_flow_handlers===!1)return;flowURL=addParam('https://sme.theappreciationengine.com/framework-v1.8/flow/467/'+aeJS.flow.step,'auth_url',url);flowURL=addParam(flowURL,'return',absolutePath(aeJS.flow.return));if(!aeJS.isEmbed)flowURL=addParam(flowURL,'auth_referer','https://forms.sonymusicfans.com');if(JSON.parse(aeJS.settings.auth_window)===!0||aeJS.isEmbed)flowURL=addParam(flowURL,'auth_method','window');pass_settings=$.extend(!0,{},aeJS.settings);delete pass_settings.extra_fields;delete pass_settings.flow_text;flowURL=flowURL.concat('&',$.param(pass_settings));if(aeJS.flow.step==='error'){aeJS.settings.error={};aeJS.settings.error.code=aeJS.flow.code
aeJS.settings.error.message=aeJS.flow.error}
if(JSON.parse(aeJS.settings.auth_window)===!0&&!aeJS.isEmbed){aeJS.modal.window.show(flowURL,aeJS.settings)}else{var cache_url=addParam(flowURL,'pre_cache',1);if(aeJS.isEmbed){cache_url=addParam(cache_url,'auth_method','window')}else{cache_url=addParam(cache_url,'auth_method','direct')}
$.postWithCredentials(cache_url,aeJS.settings,function(data){flowURL=addParam(flowURL,'cache_key',data);location.href=flowURL})}}}});if(aeJS.settings.auth_window&&(aeJS.settings.default_flow_handlers||aeJS.settings.display_error_message)){var css_link=jQuery('<link>',{rel:'stylesheet',type:'text/css',href:'https://sme.theappreciationengine.com//themes/appreciationengine22/auth_framework/jquery.omniwindow.css'});css_link.appendTo('head');aeJS.omniIncluded=!0}
if(!aeJS.isEmbed){checkVerifyEmail();flowURL='https://sme.theappreciationengine.com/framework-v1.8/flow/467/prep';var cache_url=addParam(flowURL,'pre_cache',1);cache_url=addParam(cache_url,'from','d7dae646692f1a787c73cb5d45b6717d');cache_url=addParam(cache_url,'segment','1572493');cache_url=addParam(cache_url,'consent',aeJS.consentStatus);cache_url=addParam(cache_url,'referring_url',top.document.referrer);$.postWithCredentials(cache_url,aeJS.settings,function(data){aeJSPrepped=!0;aeJS.events.onLoaded.callHandler(aeJS)})}else{aeJSPrepped=!0;aeJS.events.onLoaded.callHandler(aeJS)}
if(typeof GetURLParameter('step')!=='undefined'){switch(GetURLParameter('step')){case 'error':nextSteps({'state':'error','error':{'code':GetURLParameter('code'),'message':GetURLParameter('message')}});break;case 'verify-email-ok':aeJS.self_destruct=function(e){if(e.type==='modal'&&e.state==='closed'){getAuthState();aeJS.events.onWindow.removeHandler(aeJS.self_destruct)}}
aeJS.events.onWindow.addHandler(aeJS.self_destruct);aeJS.settings.code=GetURLParameter('code');aeJS.flow.step='verify-email-ok';aeJS.events.onFlow.callHandler(aeJS.flow);break;case 'reset-password-ok':aeJS.self_destruct=function(e){if(e.type==='modal'&&e.state==='closed'){getAuthState();aeJS.events.onWindow.removeHandler(aeJS.self_destruct)}}
aeJS.events.onWindow.addHandler(aeJS.self_destruct);aeJS.settings.code=GetURLParameter('code');aeJS.flow.step='reset-password-ok';aeJS.events.onFlow.callHandler(aeJS.flow);break;case 'send-email-ok':aeJS.settings.code=GetURLParameter('code');flowURL='https://sme.theappreciationengine.com/framework-v1.8/flow/467/send-email-ok';var cache_url=addParam(flowURL,'pre_cache',1);cache_url=addParam(cache_url,'from','d7dae646692f1a787c73cb5d45b6717d');cache_url=addParam(cache_url,'segment','1572493');cache_url=addParam(cache_url,'consent',aeJS.consentStatus);$.postWithCredentials(cache_url,aeJS.settings,function(auth_state){if(typeof auth_state.code!=='undefined'){aeJS.events.onEmailVerify.callHandler('error',auth_state)}else{auth_state=JSON.parse(auth_state);aeJS.events.onEmailVerify.callHandler('verified',auth_state.verified);getAuthState()}});break;case 'remove-service':var service=GetURLParameter('service');aeJS.events.onServiceRemoved.callHandler(service,aeJS.user);break}}}})}})()