!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict"; /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */function e(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function u(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}s((r=r.apply(e,t||[])).next())}))}function t(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&o[3]>i[1])){a.label=i[1];break}if(6===i[0]&&o[1]>a.label){a.label=o[1],o=i;break}if(o&&o[2]>a.label){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}var n,r=new Uint8Array(16);function o(){if(!n&&!(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(r)}var i=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function a(e){return"string"==typeof e&&i.test(e)}for(var u=[],s=0;256>s;++s)u.push((s+256).toString(16).substr(1));function c(e,t,n){var r=(e=e||{}).random||(e.rng||o)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var i=0;16>i;++i)t[n+i]=r[i];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(u[e[t+0]]+u[e[t+1]]+u[e[t+2]]+u[e[t+3]]+"-"+u[e[t+4]]+u[e[t+5]]+"-"+u[e[t+6]]+u[e[t+7]]+"-"+u[e[t+8]]+u[e[t+9]]+"-"+u[e[t+10]]+u[e[t+11]]+u[e[t+12]]+u[e[t+13]]+u[e[t+14]]+u[e[t+15]]).toLowerCase();if(!a(n))throw TypeError("Stringified UUID is invalid");return n}(r)}var l=function(){return{get:function(e){var t=("; "+document.cookie).split("; "+e+"=");if(2===t.length)return t.pop().split(";").shift()}}},d=function(e){return{get:function(t){return e.getItem(t)},set:function(t,n){e.setItem(t,n)},remove:function(t){e.removeItem(t)},clear:function(){e.clear()}}},p=function(e){return e.includes("allbirds")?6048e5:864e5},f=function(){var e={};return window.location.search.replace(/[?&]+([^=&]+)=([^&]*)/gi,(function(t,n,r){return e[n.toLowerCase()]=r,""})),e},m=function(e){return!!e&&(e.includes("/cart/add")||e.includes("/cart/change")||e.includes("/cart/update"))};function g(e,t,n,r){void 0===r&&(r=1e3);var o=t.map((function(t){return e.get(t)}));setInterval((function(){var r,i,a=t.map((function(t){return e.get(t)}));if(i=a,!(Array.isArray(r=o)&&Array.isArray(i)&&(null==r?void 0:r.length)===(null==i?void 0:i.length)&&(null==r?void 0:r.every((function(e,t){return e===(null==i?void 0:i[t])})))))try{n()}finally{o=a}}),r)}var v=function(e){try{return JSON.parse(e)}catch(e){return console.warn(e),{}}},y="the-sculpt-society-11.myshopify.com",h=function(n,r,o,i){return e(void 0,void 0,void 0,(function(){var e,a,u,s,c;return t(this,(function(t){switch(t.label){case 0:e=""+(i||"https://prod-consumer-app.integrations-itbl.co")+n,t.label=1;case 1:return t.trys.push([1,7,,8]),[4,fetch(e,r)];case 2:if(a=t.sent(),u=a.status,s=a.statusText,a.ok)return[3,3];throw Error("An error has occured when making request to "+e+". Response status is "+u+" "+s);case 3:return t.trys.push([3,5,,6]),[4,a.json()];case 4:return function(e){try{JSON.parse(JSON.stringify(e))}catch(e){return!1}return!0}(c=t.sent())&&"function"==typeof o&&o(c),[3,6];case 5:return t.sent(),[3,6];case 6:return[3,8];case 7:return t.sent(),[3,8];case 8:return[2]}}))}))},b=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,w=function(e){return b.test((e+"").toLowerCase())},S="login",I="logout",k="productView",T=function(e){return null==e},_=function(n,r,o){var i=o.currentUrl,a=o.customerId,u={updateSession:function(){var e=n.get("session_id"),t={marketingFields:u.getMarketingValues(),shop:y,createdAt:Date.now()};T(a)||a+""===n.get("customerId")||(n.set("customerId",a),t.customerId=a+""),T(e)||h("/sessions/"+e,{method:"PUT",body:JSON.stringify(t)})},createEvent:function(e){var t={type:e,source:y,sessionId:n.get("session_id"),payload:{url:i,marketingFields:u.getMarketingValues()}};h("/events/custom",{method:"POST",body:JSON.stringify(t)})},getMarketingValues:function(){for(var e=["iterableEmailCampaignId","iterableEndUserId","iterableMessageId","iterableTemplateId"],t={},n=e.length,o=0;n>o;o++)t[e[o]]=r.get(e[o]);return r.get("iterableTemplateIdTemp")&&(t.iterableTemplateId=r.get("iterableTemplateIdTemp")),r.get("iterableEmailCampaignIdTemp")&&(t.iterableEmailCampaignId=r.get("iterableEmailCampaignIdTemp")),t},logout:function(){u.createEvent(I),n.set("session_id",c()),u.checkCartToken()},login:function(r){return e(this,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return n.get("session_id")?[3,2]:(n.set("session_id",c()),[4,u.checkCartToken()]);case 1:t.sent(),t.label=2;case 2:return e={type:S,source:y,sessionId:n.get("session_id"),payload:{email:r,url:window.location.href}},h("/events/custom",{method:"POST",body:JSON.stringify(e)}),[2]}}))}))},setSessionAlias:function(){var e=n.get("session_id"),t=n.get("cart_token")||r.get("cart");t&&(t!==r.get("cart")&&t!==n.get("cart_token")||(t=function(e){var t=decodeURIComponent(e),n=t.indexOf("?key=");return-1!==n?t.substring(0,n):t}(t)),h("/sessions/"+e+"/alias",{method:"POST",body:JSON.stringify({alias:t,shop:y})}))},checkCartToken:function(){return e(this,void 0,void 0,(function(){var r=this;return t(this,(function(o){switch(o.label){case 0:return[4,h("/cart.js",{method:"GET"},(function(o){return e(r,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return o.item_count>0?(n.set("cart_token",o.token),[4,u.setSessionAlias()]):[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))}),"https://"+window.location.hostname)];case 1:return o.sent(),[2]}}))}))}};return u},C=function(){var n,r,o;console.log("Tracking script 1.0.16 - July 2, 2025 11:29:23");var i=null;"undefined"!=typeof customer_id?i=customer_id:(console.warn("Iterable Connector: customer_id is not defined."),i=null===(o=null===(r=null===(n=window.ShopifyAnalytics)||void 0===n?void 0:n.meta)||void 0===r?void 0:r.page)||void 0===o?void 0:o.customerId);var a=window.location.href,u=f(),s=u.iterable_campaign,h=/^campaign_\d*$/.test(u.utm_campaign)?(u.utm_campaign||"").split("_")[1]:"",b=u.iterable_template,S=u.utm_userid,I=new Date;I.setTime(I.getTime()+p(y));var T="expires="+I.toUTCString();b&&(document.cookie="iterableTemplateIdTemp="+b+"; path=/;"+T);var C=s||h;C&&(document.cookie="iterableEmailCampaignIdTemp="+C+"; path=/;"+T),S&&(document.cookie="iterableUserId="+S+"; path=/;"+T);var E=d(localStorage),q=l();E.get("session_id")||E.set("session_id",c());var A=_(E,q,{currentUrl:a,customerId:i});q.get("cart")&&E.get("session_id")&&A.setSessionAlias(),A.updateSession();g(q,["iterableEmailCampaignId","iterableEmailCampaignIdTemp","iterableEndUserId","iterableMessageId","iterableTemplateId","iterableTemplateIdTemp"],A.updateSession),setTimeout((function(){var e,t=null===(e=null==a?void 0:a.split("?"))||void 0===e?void 0:e[0];(null==t?void 0:t.includes("/products/"))&&A.createEvent(k)}),1e3);var U=window.fetch;window.fetch=function(){for(var n=[],r=0;arguments.length>r;r++)n[r]=arguments[r];return e(void 0,void 0,void 0,(function(){var e,r,o,i,a,u,s,c;return t(this,(function(t){switch(t.label){case 0:return r=n[1],i=(null==(o="string"==typeof(e=n[0])?e:(null==e?void 0:e.url)||"")?void 0:o.includes("/identity/sign-in"))||(null==o?void 0:o.includes("/identity/create")),a="",i&&"string"==typeof(null==r?void 0:r.body)&&"object"==typeof(u=v((null==r?void 0:r.body)||"{}"))&&null!==u&&(a=u.email),[4,U(e,r)];case 1:return s=t.sent(),(c=s.ok)&&m(o)&&A.checkCartToken(),c&&i&&a&&w(a)&&A.login(a),c&&(null==o?void 0:o.includes("/identity/sign-out"))&&A.logout(),[2,s]}}))}))},XMLHttpRequest.prototype.realSend=XMLHttpRequest.prototype.send,XMLHttpRequest.prototype.send=function(e){this.addEventListener("load",(function(){m(this.responseURL)&&A.checkCartToken()}),!1),this.realSend(e)};var O=document.querySelector('a[href="/account/logout"]');O&&O.addEventListener("click",A.logout);var R=function(e){var t=e.target.querySelector("input#CustomerEmail")||e.target.querySelector("input#customer_email")||e.target.querySelector('input[name="customer[email]"]')||e.target.querySelector('input[type="email"]'),n=t?t.value:"";n&&w(n)&&A.login(n)};(function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;i>o;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))})([],document.querySelectorAll("form"),!0).forEach((function(e){var t=e.querySelector("input#CustomerEmail")||e.querySelector("input#customer_email")||e.querySelector('input[name="customer[email]"]')||e.querySelector('input[type="email"]'),n=e.querySelector("input#CustomerPassword")||e.querySelector("input#customer_password")||e.querySelector('input[name="customer[password]"]')||e.querySelector('input[type="password"]');t&&n&&e.addEventListener("submit",R)}))};"loading"!==document.readyState?C():document.onreadystatechange=function(){"interactive"===document.readyState&&C()}}));