PageSourceSearch

https://untuckit.co.uk/cdn/shop/t/493/assets/shared.js?v=40713580530255243491791210892

js untuckit.co.uk collected 2026-10-07 13:57:24 UTC 30,718 bytes, 2 lines download raw bytes

1!function(){try{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"fab4f8a8d9d1b60190690495a8ee19c997d71654"}}catch(t){}}(),(globalThis.webpackChunk||=[]).push([[804],{8007(t,e,n){function o(t){const e=function(n){n.target.classList.remove("fade-in"),t.removeEventListener("animationend",e)};t.addEventListener("animationend",e),t.classList.remove("hidden"),t.classList.add("fade-in")}function r(t){const e=function(n){const o=n.target;o.classList.remove("fade-out"),o.classList.add("hidden"),t.removeEventListener("animationend",e)};t.addEventListener("animationend",e),t.classList.add("fade-out")}n.r(e),n.d(e,{fadeIn:()=>o,fadeOut:()=>r})},8839(t,e,n){n.r(e),n.d(e,{createCartLineItem:()=>y,createStandardShippingOnlyOrderMessage:()=>m,fetchAdditionalProductVariantInfo:()=>f,hasStandardShippingOnlyLineItems:()=>h,renderCartContents:()=>g});var o=n(2301);function r(t){return`gid://shopify/ProductVariant/${t}`}var i=n(2063),s=n(4019);const a=2e3,c=new Set(["THROTTLED","INTERNAL_SERVER_ERROR"]);function l(t){return new Promise(e=>setTimeout(e,t))}function u(t){return(0,i.isRetryableHttpStatus)(t)||423===t}function d(t){return t.some(t=>c.has(t.extensions?.code??""))}var p=n(2971);async function f(t,e){if(!t.length)return{};const n=t.map(r),c=await async function(t,e){const n=`https://${window.Shopify.shop}/api/${window.UNTUCKitConfig.shopifyStorefrontApiVersion}/graphql`,o={method:"POST",headers:{"Content-Type":"application/json","X-Shopify-Storefront-Access-Token":window.UNTUCKitConfig.shopifyStorefrontApiPublicAccessToken},body:JSON.stringify({query:'\n    query getProductVariants($ids: [ID!]!) {\n      nodes(ids: $ids) {\
1n        ... on ProductVariant {\n          id\n          availableForSale\n          selectedOptions {\n            name\n            value\n          }\n          standardShippingOnly: metafield(namespace: "custom", key: "standard_shipping_only") {\n            value\n          }\n          product {\n            id\n            compareAtPriceRange {\n                minVariantPrice {\n                amount\n              }\n            }\n            tags\n          }\n        }\n      }\n    }\n  ',variables:e})};let r;for(let t=0;t<3;t++){let e=null;try{if(e=await(0,s.fetchWithTimeout)(n,{...o,timeout:1e4}),!e.ok){if(u(e.status)&&t<2){await l((0,i.getRetryDelayMs)(e,t,300,a));continue}return console.error(`Storefront API request failed with status ${e.status}`),null}const r=await e.json();if(r.errors?.length){if(d(r.errors)&&t<2){await l((0,i.getRetryDelayMs)(e,t,300,a));continue}return console.error("Storefront API GraphQL errors:",r.errors),null}return r}catch(n){if(r=n,t<2){await l((0,i.getRetryDelayMs)(e,t,300,a));continue}}}return console.error(r),null}(0,{ids:n});return c?.data?.nodes?c.data.nodes.filter(t=>!!t).reduce((t,n)=>{const r=n.id.split("/"),i=r[r.length-1],s=(0,p.renderProductColorDisplayValue)(n.product);let a=null;const c=n.product.tags.find(t=>t.startsWith(e.badgePrefix)),l=c?c.split(":"):null;l&&window.UNTUCKitConfig?.showProductBadging&&(a=l[l.length-1]);const u=100*+n.product.compareAtPriceRange.minVariantPrice.amount;var d,f,h;return t[i]={availableForSale:n.availableForSale,colorDisplayValue:s,compareAtPrice:u,badgingText:a,selectedOptions:n.selectedOptions,standardShippingOnly:(f=w(n.standardShippingOnly?.value),h=n.product.tags,f||(d=h,d.some(t=>{const e=t.toLowerCase();return o.STANDARD_SHIPPING_ONLY_PRODUCT_TAGS.some(t=>e.includes(t))})))},t},{}):(console.error("Failed to fetch additional product variant info"),{})}function h(t){return t.some(t=>t.standardShippingOnly)}function m(){const t=document.createElement("p");return t.className="cart__standard-shipping-only-message",t.textContent=window.cartUI.standardShippingOnly.orderMessage,t}async function g(t){const e=t.items.map(t=>t.variant_id),n=await f(e,{badgePrefix:"badge-cart:"}),o=t.items.map(t=>{const e=n[t.variant_id];return e?{...t,...e}:t});return document.querySelectorAll(".js-cart-contents").forEach(t=>{t.innerHTML="",h(o)&&t.appendChild(m());const e=o.map((t,e)=>y(t,{lineNumber:e+1,actionsType:"inline-cart",styleClass:"cart-line-item--listed"}));t.append(...e)}),o}function w(t){if(!t)return!1;try{return!!JSON.parse(t)}catch{return"true"===t}}function y(t,e){const n=document.createElement("cart-line-item");n.setAttribute("cart-line-item-data",JSON.stringify(t)),void 0!==e.showQuantity&&n.setAttribute("show-quantity",`${e.showQuantity}`),e.lineNumber&&n.setAttribute("line-number",`${e.lineNumber}`),n.setAttribute("actions-type",e.actionsType);let o=t.badgingText||"";if(["inline-cart","add-to-cart-overlay"].includes(e.actionsType)&&t.line_level_discount_allocations?.length){const e=t.line_level_discount_allocations.filter(t=>t.amount>0&&"discount_code"===t.discount_application.type).map(t=>{const e=t.discount_application;return"discount_code"===e.type?`${e.title} Applied`:e.title}).join("<br/>");e&&(o=e)}return n.setAttribute("badge-text",o),n.setAttribute("compare-at-price",`${t.compareAtPrice}`),n.setAttribute("color-display-value",t.colorDisplayValue||""),void 0!==t.availableForSale&&n.setAttribute("is-available",`${t.availableForSale}`),t.standardShippingOnly&&n.setAttribute("standard-shipping-only","true"),n.classList.add(e.styleClass),n}},2063(t,e,n){n.r(e),n.d(e,{getRetryDelayMs:()=>d,isRetryableHttpStatus:()=>l,retryFetch:()=>p});var o=n(4019);const r=new Set([429,500,502,503,504]),i=3,s=300,a=2e3,c=1e4;function l(t){return r.has(t)}function u(t){return new Promise(e=>setTimeout(e,t))}function d(t,e,n,o){if(429===t?.status){const e=t.headers.get("Retry-After");if(e){const t=Number(e);if(!Number.isNaN(t))return Math.min(1e3*t,o)}}const r=n*Math.pow(2,e),i=.25*r*(2*Math.random()-1);return Math.min(Math.max(r+i,0),o)}async function p(t,e={},n={}){const{maxAttempts:r=i,baseDelayMs:p=s,maxDelayMs:f=a,timeoutMs:h=c,shouldRetryResponse:m=t=>l(t.status)}=n;let g;for(let n=0;n<r;n++)try{const i=await(0,o.fetchWithTimeout)(t,{...e,timeout:h});if(i.ok||!m(i)||n===r-1)return i;await u(d(i,n,p,f))}catch(t){if(g=t,n===r-1)throw t;await u(d(null,n,p,f))}throw g}n.d(e,["RETRYABLE_HTTP_STATUSES",0,r])},2882(t,e,n){function o(t,e){if(t){let n=0;const o=document.querySelector(".header__top-bar");o&&(n+=o.offsetHeight);const r=+(t.getBoundingClientRect().top+window.scrollY-n).toFixed();if(e){const t=function(){+window.scrollY.toFixed()>=r-2&&(window.removeEventListener("scroll",t),e())};t(),window.addEventListener("scroll",t)}window.scrollTo({top:r,left:0,behavior:"smooth"})}else console.error("no element defined; unable to scroll to element")}n.r(e),n.d(e,{scrollTo:()=>o})},1854(t,e,n){function o(t){let e=t;const n=new Set;return{get:()=>e,set(t){e=t;for(const e of[...n])e(t)},subscribe:t=>(n.add(t),t(e),()=>{n.delete(t)})}}function r(t,e,n){return t.subscribe(t=>{e(t)&&n(t)})}function i(t,e){return{subscribe:n=>r(t,e,n)}}function s(t,e){return t.subscribe(t=>{null!==t&&e(t)})}function a(t){return{subscribe:e=>s(t,e)}}function c(t){return{subscribe(e){let n;return t.subscribe(t=>
1{void 0!==t&&(void 0!==n&&t===n||(n=t,e(t)))})}}}n.r(e),n.d(e,{asDistinctDefinedSubscribable:()=>c,asFilteredSubscribable:()=>i,asNonNullSubscribable:()=>a,createState:()=>o,subscribeFiltered:()=>r,subscribeNonNull:()=>s})},4027(t,e,n){function o(t,e){const n=Symbol.for(t);return globalThis[n]??(globalThis[n]=e)}function r(t){console.debug(`${t} loading with instance id: `+Math.random().toString(36).substring(2,15))}n.r(e),n.d(e,{ensureGlobalState:()=>o,logInstanceId:()=>r})},2971(t,e,n){n.r(e),n.d(e,{renderProductColorDisplayValue:()=>i,renderProductPriceCompact:()=>r});var o=n(2404);function r({regularPrice:t,salePrice:e,subMessage:n,productId:r}){const i=window?.UNTUCKitConfig?.cartCurrencySymbol,s=(0,o.toMoney)(t,i,!0),a=e>0&&t>e;var c;return function(t){const e=document.createElement("template");return e.innerHTML=t,e.content.firstElementChild}(`<div class="product-price-v2__container product-price-v2__container--compact"${r?` data-product-id="${r}"`:""}>\n  <div class="product-price-v2__price-container">\n    <div class="product-price-v2__regular-price${a?" product-price-v2__regular-price--on-sale":""}">
1\n      <span class="product-price-v2__money" aria-label="regular price ${s}">${s}</span>\n    </div>\n    ${a?(()=>{const t=(0,o.toMoney)(e,i,!0);return`<div class="product-price-v2__sale-price">\n      <span class="product-price-v2__money" aria-label="sale price ${t}">${t}</span>\n    </div>`})():""}\n  </div>\n  ${n?`<p class="product-price-v2__sub-message">${c=n,c.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}</p>`:""}\n</div>`)}function i(t){let e=t.metafields?.global?.style??t.options_by_name?.color?.values?.[0];for(const n of t.tags)if(n.toLowerCase().includes("description:")){e=n.split(":").pop().trim();break}return e??""}},2404(t,e,n){function o(t){let e=t;if(t&&"string"==typeof t){const n=t.split(".");3===n.length&&(e=`(${n[0]}) ${n[1]}-${n[2]}`)}return e}function r(t){if(t)return t.replace(/[^\d+]/g,"")}function i(t){let e="";return t&&(t.ADDRESS&&(e+=t.ADDRESS),t.ADDRESS2&&(e+=`, ${t.ADDRESS2}`),t.CITY&&(e+=`, ${t.CITY}`),t.STATE&&(e+=`, ${t.STATE}`),t.ZIP&&(e+=" "+t.ZIP)),e}function s(t,e,n=!1){let o=(t/100).toFixed(2);return n||(o=o.replace(".00","")),`${e}${o}`}function a(t){return t?t.charAt(0).toUpperCase()+t.slice(1):t}n.r(e),n.d(e,{capitalizeFirstLetter:()=>a,toMoney:()=>s,toRawPhoneNumber:()=>r,transformStoreAddress:()=>i,transformStorePhone:()=>o})},4019(t,e,n){n.r(e),n.d(e,{addUrlProtocol:()=>N,chunkArr:()=>O,createSrcset:()=>l,debounce:()=>k,fetchWithTimeout:()=>m,getCurrentPosition:()=>P,getElementOrParentByClassName:()=>L,getFutureDate:()=>g,handleize:()=>I,isOnPage:()=>s,removeFalsy:()=>C,showElementPeek:()=>c,showInlineCart:()=>A,syncFloatingIconsPosition:()=>h,updateBodyPaddingTop:()=>T,updateFloatingIconsPosition:()=>f,waitForElements:()=>a,waitForTruthyVal:()=>_,withoutTrailingZeros:()=>R});var o=n(1854),r=n(6624),i=n(7978);function s(...t){const e=document.getElementsByTagName("html")[0].classList[1];let n=!1;return e&&(n=!!t.find(t=>e.indexOf(t)>-1)),n}function a(t,e=document){let n=0;const o=(r,i)=>{if(n++,10===n)console.log(`Reached max attempts waiting for selector: ${t}.`),i();else{const n=e.querySelectorAll(t);n.length?r(n):setTimeout(()=>{o(r,i)},500)}};return new Promise((t,e)=>{o(t,e)})}function c(t){if(t&&t.scrollWidth>t.offsetWidth){const e=window.innerWidth,n=e<500?1/1.5:e<800?.4:1/3.5;for(const e of t.children){const o=t.offsetWidth*n,r=window.getComputedStyle(e).aspectRatio;if(r){const t=r.split("/").map(t=>+t.trim()),n=o*t[1]/+t[0];e.style.minWidth="auto",e.style.width=`${o}px`,e.style.height=`${n}px`}}}}function l(t,e){let n="";if(t&&e){const o=t.includes("?")?"&":"?",r=e.concat(e.map(t=>2*t));n=[...new Set(r)].sort(function(t,e){return t-e}).map(e=>`${t}${o}width=${e} ${e}w`).join(", ")}return n}const u=["#usntA40Toggle","#kustomer-ui-sdk-iframe"];let d=0;function p(){u.forEach(t=>{a(t).then(t=>{!function(t){const e=parseInt(t.dataset.floatingIconBaseBottom||"",10),n=Number.isNaN(e)?parseInt(window.getComputedStyle(t).bottom||"0",10):e;t.dataset.floatingIconBaseBottom||(t.dataset.floatingIconBaseBottom=String(n)),t.style.transition="bottom 0.5s",t.style.bottom=`${n+d}px`}(t[0])}).catch(()=>{})})}function f(t){d+=t,p()}function h(){p()}async function m(t,e={}){const{timeout:n=2e3}=e,o=new AbortController,r=setTimeout(()=>o.abort(),n),i=await fetch(t,{...e,signal:o.signal});return clearTimeout(r),i}function g(t){const e=new Date;return t?e.setTime(e.getTime()+24*t*60*60*1e3):console.error("Unable to get future date; no days defined."),e}const w={passive:!0},y=(0,o.createState)(!1);const b={subscribe:t=>y.subscribe(t)};let S=0;const v=()=>{if(Math.abs(S-window.scrollY)<20)return;const t=window.scrollY>S,e=window.scrollY>180;var n;n=!(!t||!e),y.get()!==n&&y.set(n),S=window.scrollY};function E(){console.log("stopping header transition"),window.removeEventListener("scroll",v,w)}function T(t){const e=parseInt(document.body.style.paddingTop)||0;document.body.style.paddingTop=`${e+t}px`}function _(t,e=100,n=10){let o=0;const r=(i,s)=>{if(o++,o===n)s(`Maximum number of retries (${n}) reached. Did not find a truthy value.`);else{const n=t();n?i(n):setTimeout(()=>{r(i,s)},e)}};return new Promise((t,e)=>{r(t,e)})}function L(t,e){return t.classList.contains(e)?t:t.closest(`.${e}`)}function C(t){return Object.entries(t).filter(t=>{const e=t[1];return null!=e&&""!==e}).reduce((t,e)=>{const[n,o]=e;return t[n]=o,t},{})}function A(){window.dispatchEvent(new CustomEvent(i.INLINE_CART_SHOW))}function O(t,e){return t.reduce((n,o,r)=>(r%e===0&&n.push(t.slice(r,r+e)),n),[])}function P(){return new Promise((t,e)=>{window.navigator.geolocation?window.navigator.geolocation.getCurrentPosition(t,e):e(new Error("Geolocation is not supported by this browser."))})}function I(t){return t?t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,""):""}function N(t){return t?t.startsWith("http")?t:`https://${t}`:""}function k(t,e){let n=null;return function(...o){n&&clearTimeout(n),n=setTimeout(()=>{n=null,t(...o)},e)}}function R(t){return"number"==typeof t&&(t=t.toFixed(2)),t?`${t}`.replace(".00",""):""}window.addEventListener("scroll",v,w),(0,r.preventAnimation)()&&E(),(0,r.accessibilityEnabledListener)().subscribe(()=>{E()}),y.subscribe(t=>{setTimeout(()=>{t||(document.body.style.paddingTop="0px")},0),t?(document.body.classList.add("utk-smaller-header"),document.body.classList.remove("utk-full-header")):(document.body.classList.add("utk-full-header"),document.body.classList.remove("utk-smaller-header"))}),n.d(e,["headerTransition",0,b])},6624(t,e,n){function o(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches||document.querySelector("html").classList.contains("un-assistive")}function r(){return{subscribe(t){const e=e=>{"UsableNetAssistiveEnabled"===e.data&&t()};return window.addEventListener("message",e),()=>window.removeEventListener("message",e)}}}function i(t){const e=document.getElementById("usntA40Toggle");let n;e&&(n="show"===t||"hide"!==t&&"none"===e.style.getPropertyValue("display"),n?e.style.removeProperty("display"):e.style.setProperty("display","none","important"))}n.r(e),n.d(e,{accessibilityEnabledListener:()=>r,preventAnimation:()=>o,toggleAccessibleIcon:()=>i}),n.d(e,["TABBABLE_ELEMENT_SELECTOR",0,"button, input, a, select"])},8367(t,e,n){n.r(e),n.d(e,{attachSessionIdsToCart:()=>a,csqArtificialPageview:()=>p,csqTrackDynamicVariable:()=>d,csqTrackPageEvent:()=>l,dialogStack:()=>r,emitShopifyEvent:()=>s,generateCSQReplayLink:()=>u,getCSQGlobal:()=>c,trackPageView:()=>i});var o=n(1906);const r=new class{items=[];callbacks=[];debounceTimer=null;debounceInterval;pendingOperations=[];constructor(t=100){this.debounceInterval=t}push(t){console.debug("dialogStack pushing item",t),this.pendingOperations.push({type:"push",item:t}),this.triggerCallbacks()}pop(t){console.debug("dialogStack popping itemToRemove",t),this.pendingOperations.push({type:"pop",item:t}),this.triggerCallbacks()}peek(){return this.items[this.items.length-1]}size(){return this.items.length}isEmpty(){return 0===this.items.length}toArray(){return[...this.items]}addListener(t){this.callbacks.push(t)}removeListener(t){const e=this.callbacks.indexOf(t);e>-1&&this.callbacks.splice(e,1)}clear(){this.items.length>0&&(this.items=[],this.pendingOperations=[],this.triggerCallbacks())}processOperations(){if(0===this.pendingOperations.length)return;const t=[...this.pendingOperations];this.pendingOperations=[];let e=0;for(;e<t.length;){const n=t[e],o=t[e+1];if("pop"===n.type&&"push"===o?.type){const t=this.items.findIndex(t=>t===n.item);t>-1?this.items[t]=o.item:this.items.push(o.item),e+=2}else if("push"===n.type)this.items.push(n.item),e+=1;else if("pop"===n.type){const t=this.items.findIndex(t=>t===n.item);t>-1&&this.items.splice(t,1),e+=1}else e+=1}}triggerCallbacks(){this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.processOperations();const t=this.toArray();
1this.callbacks.forEach(e=>{try{e(t)}catch(t){console.error("Error executing stack listener callback:",t)}}),this.debounceTimer=null},this.debounceInterval)}}(100);function i(t){t?window.ga&&(window.ga("set","page",t),window.ga("send","pageview")):console.warn("route not defined; unable to track page view")}function s(t,e={}){console.debug("emitting shopify event",t,e),window.Shopify?.analytics?.publish(t,e)}function a(){const t={},e=()=>{Object.keys(t).length&&function(t){const e=o.cartState.get()?.attributes??{};Object.entries(t).some(([t,n])=>e[t]!==n)&&(0,o.updateCart)({attributes:t})}({...t})};c().push(["getSessionKey",{callback:n=>{n&&(t._csq_session_key=n,e())}}]),c().push(["replay:link:generate",{withTimestamp:!1},n=>{n.replayLink&&(t._csq_session_replay_link=n.replayLink,e())}])}function c(){return window._uxa=window._uxa||[]}function l(t){c().push(["trackPageEvent",t])}function u(t=!0){return new Promise(e=>{c().push(["replay:link:generate",{withTimestamp:t},t=>{e(t.replayLink||null)}])})}function d(t,e){c().push(["trackDynamicVariable",{key:t,value:e}])}function p(t,e){const n=c();console.log("csqArtificialPageview",t,e),"open"===t?(n.push(["setQuery",window.location.search+(window.location.search?"&":"?")+`${e}`,{lifespan:"onNextPageviewOnly"}]),n.push(["trackPageview",window.location.pathname+window.location.hash.replace("#","?__"),{lifespan:"onNextPageviewOnly"}])):n.push(["trackPageview",window.location.pathname+window.location.hash.replace("#","?__")])}r.addListener(t=>{console.log("dialogStack listener",t);const e=t[t.length-1];t.length?p("open",e):p("close",e)})},1906(t,e,n){n.r(e),n.d(e,{CartRequestError:()=>h,ChangeLineItemError:()=>m,addToCart:()=>E,changeLineItem:()=>_,getCart:()=>T,updateCart:()=>v});var o=n(1854),r=n(4027),i=n(2063);(0,r.logInstanceId)("cart.service");const s="tiered-progress-data";function a(){return document.getElementById(s)?s:void 0}const c={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"}},l=(0,r.ensureGlobalState)("untuckit.cart",(0,o.createState)(null)),u=(0,o.asNonNullSubscribable)(l);let d=Promise.resolve();function p(){}function f(t){const e=d.then(t,t);return d=e.then(p,p),e}
1class h extends Error{status;retryable;responseBody;constructor(t,e,n,o){super(t),this.name="CartRequestError",this.status=e,this.retryable=n,this.responseBody=o}}class m extends Error{payload;constructor(t,e){super(t),this.name="ChangeLineItemError",this.payload=e}}function g(t){return t.items=t.items.filter(t=>t.quantity>0)||[],t}function w(t){const e=g(t);return l.set(e),e}async function y(t,e){return(0,i.retryFetch)(`${window.Shopify.routes.root}${t}`,{...c,body:JSON.stringify(e)})}function b(t,e,n,o,r){throw C(t,n,o,r),new h(L(n),e,(0,i.isRetryableHttpStatus)(e),n)}async function S(){const t=a(),e=window.Shopify.routes.root,[n,o]=await Promise.all([(0,i.retryFetch)(`${e}cart.js`),t?(0,i.retryFetch)(`${e}?sections=${t}`):Promise.resolve(null)]),r=await n.json();n.ok||b("Error fetching cart",n.status,r,n.headers,null);const s=g(r);return o?.ok&&(s.sections=await o.json()),l.set(s),s}async function v(t){return f(async()=>{const e=await y("cart/update.js",t),n=await e.json();return e.ok||b("Error updating cart",e.status,n,e.headers,t),w(n)})}async function E(t){return f(async()=>{const e=await y("cart/add.js",t),n=await e.json();return e.ok||b("Error adding item to cart",e.status,n,e.headers,t),await S(),n})}async function T(){return S()}async function _(t){return f(async()=>{const e=await y("cart/change.js",t),n=await e.json();if(!e.ok){C("Error changing line item",n,e.headers,t);let o="GENERIC",r="";if(422===e.status){const t=(n.message||"").toLowerCase();t.includes("sold out")?o="SOLD_OUT":t.includes("due to availability")&&(o="CANNOT_ADD_INVENTORY",r=n.message,await S())}throw new m("",{reason:o,passedthroughServerMessage:r})}return async function(t){const e=a();if(!e)return t;const n=await(0,i.retryFetch)(`${window.Shopify.routes.root}?sections=${e}`);return n.ok&&(t.sections=await n.json(),l.set(g(t))),t}(w(n))})}function L(t){return t?.description||t?.message||"unknown"}function C(t,e,n,o){const r=L(e);console.error(`${t}:`,r);const i=n.get("x-request-id");i&&console.error("cart request id",i,JSON.stringify(o))}n.d(e,["cartState",0,l,"onCartUpdate",0,u])},3752(t,e,n){n.r(e),n.d(e,{createFocusTrap:()=>s});const o=['summary:not([tabindex="-1"]):not([inert]):not([inert] *)','a[href]:not([tabindex="-1"]):not([inert]):not([inert] *)','button:not([disabled]):not([tabindex="-1"]):not([inert]):not([inert] *)','input:not([disabled]):not([type="hidden"]):not([tabindex="-1"]):not([inert]):not([inert] *)','select:not([disabled]):not([tabindex="-1"]):not([inert]):not([inert] *)','textarea:not([disabled]):not([tabindex="-1"]):not([inert]):not([inert] *)','[tabindex]:not([tabindex="-1"]):not([inert]):not([inert] *)'].join(", "),r=t=>{t.focus({preventScroll:!0})},i=t=>"hidden"!==getComputedStyle(t).visibility&&!t.closest("details:not([open])")&&!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length);function s(t,e={}){let n=null,s=null,a=null,c=null,l=null;const u=()=>Array.from(t.querySelectorAll(o)).filter(i),d=t=>{if("Tab"!==t.key)return;const e=u();if(!e.length)return;const n=e[0],o=e[e.length-1];t.shiftKey&&document.activeElement===n?(t.preventDefault(),r(o)):t.shiftKey||document.activeElement!==o||(t.preventDefault(),r(n))},p=e=>{if(!t.contains(e.target)){const t=u();t.length&&r(t[0])}};return{activate(){n=document.activeElement,s=d,a=p,document.addEventListener("keydown",s),document.addEventListener("focusin",a);const o=()=>{(()=>{const{initialFocus:n}=e,o=u();return n&&t.contains(n)&&o.includes(n)?(r(n),!0):!!o.length&&(r(o[0]),!0)})()&&(clearInterval(c),c=null)};l=setTimeout(()=>{l=null,o(),u().length||(c=setInterval(o,300))},0)},deactivate(t,e={}){if(null!==l&&(clearTimeout(l),l=null),s&&(document.removeEventListener("keydown",s),s=null),a&&(document.removeEventListener("focusin",a),a=null),null!==c&&(clearInterval(c),c=null),!1!==e.restoreFocus){const e=t??n;e&&r(e)}n=null}}}},4757(t,e,n){n.r(e),n.d(e,{StoreLookupError:()=>l,extractCollectionHandleFromUrl:()=>_,getInventoryByStoreId:()=>L,getStoreById:()=>T,initSelectedStore:()=>v,isValidationExpired:()=>p,selectStoreManually:()=>E,sharedStoreDataMapping:()=>C});var o=n(1854),r=n(4019),i=n(4027),s=n(6440),a=n(8367);(0,i.logInstanceId)("store.service");const c={"Content-Type":"application/json",Accept:"application/json"};
1class l extends Error{status;constructor(t){super("Error getting store."),this.status=t}}const u=(0,i.ensureGlobalState)("untuckit.selectedStore",(0,o.createState)(null));function d(){return 60*window.UNTUCKitConfig.nearbyToggle.storeValidationTtlHours*60*1e3}function p(t){return Date.now()-t>=d()}function f(t){if(!t)return null;try{const e=JSON.parse(t);return e?.store?.COLLECTION_HANDLE&&e.source&&e.lastValidatedAt?e:null}catch(t){return console.warn("Unable to parse stored store selection",t),null}}function h(){try{const t=f(localStorage.getItem(s.STORE_STORAGE_KEY));return t?t.source!==s.STORE_SELECTION_SOURCES.MANUAL?(g(),null):t:null}catch(t){return console.warn("Unable to read manual store selection",t),null}}function m(t){try{localStorage.setItem(s.STORE_STORAGE_KEY,JSON.stringify({...t,source:s.STORE_SELECTION_SOURCES.MANUAL}))}catch(t){console.warn("Unable to persist manual store selection",t)}}function g(){try{localStorage.removeItem(s.STORE_STORAGE_KEY)}catch(t){console.warn("Unable to clear manual store selection",t)}}function w(){try{return f(sessionStorage.getItem(s.NEAREST_STORE_STORAGE_KEY))}catch(t){return console.warn("Unable to read nearest store selection",t),null}}function y(t){try{sessionStorage.setItem(s.NEAREST_STORE_STORAGE_KEY,JSON.stringify({store:t,source:s.STORE_SELECTION_SOURCES.AUTO,lastValidatedAt:Date.now()}))}catch(t){console.warn("Unable to persist nearest store selection",t)}}function b(t){m({store:t,source:s.STORE_SELECTION_SOURCES.MANUAL,lastValidatedAt:Date.now()}),u.set(t)}function S(t){y(t),u.set(t)}async function v(){const t=await async function(){const t=h();if(!t)return null;if(!p(t.lastValidatedAt))return t.store;try{const e=await T(t.store.COLLECTION_HANDLE);return m({store:e,source:s.STORE_SELECTION_SOURCES.MANUAL,lastValidatedAt:Date.now()}),e}catch(e){return e instanceof l&&404===e.status?(g(),null):(console.warn("Manual store revalidation failed; using cached selection",e),t.store)}}();if(t)return void u.set(t);const e=w();e?u.set(e.store):await async function(){let t=null;if(window.UNTUCKitConfig.nearbyToggle.browserBasedGeolocationToggle)try{t=await(0,r.getCurrentPosition)()}catch(t){console.warn("error getting browser-based geolocation position:",t.message||t)}try{const e=await async function(t,e){const n=t&&e?`?latitude=${t}&longitude=${e}`:"",o=await fetch(`${window.UNTUCKitConfig.nearbyToggle.nearby_lookup_url}${n}`);if(!o.ok)throw new Error("Error when attempting to fetch nearby stores");const r=await o.json();return r?.stores}(t?.coords.latitude,t?.coords.longitude),n=e?.[0];if(!n)return;parseInt(window.UNTUCKitConfig.nearbyToggle.nearby_lookup_max_distance,10)>n.distance?S(n):console.log(`skipping; closest store is ${n.distance}km away`)}catch(t){console.error("error fetching nearby stores:",t.message||t)}}()}async function E(t){const e=await T(t);b(e),(0,a.emitShopifyEvent)(s.STORE_MANUALLY_SELECTED_EVENT,{collection_handle:e.COLLECTION_HANDLE,store_name:e.SHOPIFY_DISPLAY_NAME})}async function T(t){const e=await fetch(`${window.UNTUCKitConfig.storeLookupUrl}/${t}`,{method:"GET",headers:c});if(!e.ok)throw new l(e.status);return await e.json()}function _(t){try{const e=new URL(t,window.location.origin).pathname.match(/\/collections\/([^/?#]+)/i);return e?e[1].toLowerCase():null}catch{return null}}async function L(t){const e=await fetch(`/collections/${t}?view=newstore`);if(!e.ok)throw new Error(`Error getting inventory for store: ${t}`);return await e.json()}function C(t){return{address:t.ADDRESS2.length>0?t.ADDRESS+" "+t.ADDRESS2:t.ADDRESS,city:t.CITY+", "+t.STATE+" "+t.ZIP,storeHref:"/collections/"+t.COLLECTION_HANDLE}}const A={readManualSelection:h,writeManualSelection:m,clearManualSelection:g,readNearestStoreSelection:w,writeNearestStoreSelection:y,clearNearestStoreSelection:function(){try{sessionStorage.removeItem(s.NEAREST_STORE_STORAGE_KEY)}catch(t){console.warn("Unable to clear nearest store selection",t)}},applyManualStoreSelection:b,applyNearestStoreSelection:S,getValidationTtlMs:d,readStoredSelection:h,writeStoredSelection:m,clearStoredSelection:g};n.d(e,["_forTesting",0,A,"selectedStoreState",0,u])},7319(t,e,n){n.r(e),n.d(e,{addProductToWishlist:()=>g,fetchSaveForLaterList:()=>v,initSaveForLater:()=>b,initWishlistEventListeners:()=>T,isProductInWishlist:()=>m,openWishlist:()=>p,refreshWishlistIcons:()=>y,removeProductFromWishlist:()=>w,removeSaveForLaterProducts:()=>E,renderWishlistCounter:()=>f,saveProductsForLater:()=>S,whenWishlistLoaded:()=>h});var o=n(1854),r=n(8839),i=n(8367);(0,n(4027).logInstanceId)("wishlist.service");const s=(0,o.createState)(null);let a=null,c=0;const l=new Set;s.subscribe(async function(t){if(!t)return;const e=++c,n=await async function(t){const e=t.items.map(t=>t.epi);try{const n=await(0,r.fetchAdditionalProductVariantInfo)(e,{badgePrefix:"badge-pdp:"}),o=t;return o.items=t.items.map(t=>{const e=n[t.epi];return e?{...t,...e}:t}),o}catch(t){console.error(t)}}(t);if(e===c&&n){a=n;for(const t of[...l])t(n)}});const u={subscribe:t=>
1(l.add(t),a&&t(a),()=>l.delete(t))};function d(t,e){return e instanceof Error?e:new Error(t,void 0!==e?{cause:e}:void 0)}function p(){_().push(t=>{t.ui.open()})}function f(){_().push(t=>{t.renderWishlistCount&&document.querySelectorAll(".js-wishlist-counter").forEach(e=>{t.renderWishlistCount(e)})})}function h(){return new Promise(t=>{_().push(()=>{console.log("wishlist loaded"),t()})})}function m(t){return new Promise(e=>{_().push(n=>{n.fetchWrtEventTypeET(n=>{const o=!(!n||!n.find(e=>e.empi===t));console.log("wishlist product found?",o),e(o)},4)})})}function g(t){const e=t||window.SwymPageData;return new Promise((t,n)=>{e?(e.et=4,_().push(n=>{n.addToWishList(e,e=>{console.log("product added to wishlist",e),t()})})):(console.error("Unable to add to wishlist; payload is undefined."),n(new Error("Unable to add to wishlist; payload is undefined.")))})}function w(t){return new Promise((e,n)=>{_().push(o=>{o.fetch(o=>{if(o){const r=o.find(e=>e.empi===t);r?_().push(t=>{t.removeFromWishList(r,()=>{e()})}):(console.log(`Unable to remove from wishlist; ${t} doesn't exist in wishlisted products`),n(new Error(`Unable to remove from wishlist; product ${t} is not wishlisted.`)))}})})})}function y(t){_().push(e=>{e.initializeActionButtons(t)})}function b(){return new Promise((t,e)=>{_().push(n=>{n.SaveForLater.init(e=>{console.log("swym save for later init success"),window._saveforLaterListId=e.list.lid,v().catch(t=>{console.error("swym: error fetching save for later list after init",t)}),t(e.list.lid)},t=>{console.error("swym: error creating save for later list",t),e(d("swym: error creating save for later list",t))})})})}function S(t){return new Promise((e,n)=>{_().push(o=>{o.SaveForLater.add(window._saveforLaterListId,t,()=>{v(),e()},t=>{console.error("swym: error saving products to save for later list",t),n(d("swym: error saving products to save for later list",t))})})})}function v(){return new Promise((t,e)=>{_().push(n=>{n.SaveForLater.fetch(window._saveforLaterListId,e=>{s.set(e),t(e)},t=>{console.error("swym: error fetching save for later list",t),e(d("swym: error fetching save for later list",t))})})})}function E(t){return new Promise((e,n)=>{_().push(o=>{o.SaveForLater.remove(window._saveforLaterListId,t,()=>{v(),e()},t=>{console.error("swym: error removing products from save for later list",t),n(d("swym: error removing products from save for later list",t))})})})}function T(){h().then(()=>{window.SwymCallbacks.push(t=>{console.log("swym wishlist event listeners initialized"),t.evtLayer.addEventListener(t.JSEvents.addedToWishlist,t=>{const e=t.detail.d;(0,i.emitShopifyEvent)("untuckit:product_added_to_wishlist",{sku:e.sku})}),t.evtLayer.addEventListener(t.JSEvents.addedToWishlist,function(e){const n=e.detail.d,o=n.empi,r=n.du;t.getProductDetails({empi:o,du:r},t=>{const e=t?.title;setTimeout(()=>{const t=document.querySelector(".swym-notification-wishlist .swym-emphasis");t&&(t.textContent=e)},40)})})})})}function _(){return window.SwymCallbacks=window.SwymCallbacks||[]}n.d(e,["sflData",0,u])}}]);
2//# sourceMappingURL=shared.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.