1import{r as k}from"./mod-b9964399-BK24JYno.js";import{f as V}from"./mod-a4d26868-CJyUk__N.js";const K="GTM-5V728N6Z",ee="https://sgtm.sees.com/gtm.js",te={development:{auth:"1ZdVuLuPbv0uDLsgIRnIGw",preview:"env-3"},staging:{auth:"NLvXw0HUPEdMLqO__zQWrA",preview:"env-4"},production:{auth:"",preview:""}},D="See's Candies",L=["add_payment_info","add_shipping_info","add_to_cart","begin_checkout","checkout","login","select_promotion","view_promotion","purchase","search","search_content","select_content","sign_up","share","view_cart","view_item","view_item_list","remove_from_cart","select_item"],u={"/":"homepage","/cart":"cart","/checkout":"checkout","/contact":"checkout","/track-order":"track-order","/login":"account","/register":"account","/account":"account","/orders":"orders","/order-details/*":"order-details","/subscriptions":"subscriptions","/addressbook":"addressbook","/wallet":"wallet","/profile":"profile","/preferences":"preferences","/search":"searchresults","/404":"error","*build-a-box*":"custom-mix","*.html":"product","*":null};let W=0;function h(){return`${Date.now()}-${++W}`}class G{queue;commerceEventTypes;constructor(t){this.queue=void 0,this.commerceEventTypes=t}pushToQueue(t){const n=new Promise(r=>{const o={...t,eventCallback:()=>r(),eventTimeout:2e3};if(window.dataLayerStatus==="ready")window.dataLayer?.push(o);else{const s=window.onDataLayerReady;window.onDataLayerReady=()=>{s?.(),window.dataLayer?.push(o)}}t.event||r()}),i=this.queue=(this.queue??Promise.resolve()).then(()=>n);return i.then(()=>{this.queue===i&&(this.queue=void 0)})}push(t){const n=[];return t.event&&this.commerceEventTypes.includes(t.event)&&n.push(this.pushToQueue({event_id:h(),ecommerce:null})),n.push(this.pushToQueue({event_id:h(),...t})),n.length===1?n[0]:n[0].then(()=>n[1])}}const _=new G(L);function ne(e){return _.push({event:"checkout",category:e.category,...e.action&&{action:e.action},...e.value&&{detail:e.value},...e.label&&{label:e.label}})}const C=/^not[_\s-]?set/i,F=e=>!!e&&C.test(e);function ie(e){const t=e?.shippingMethod?.id;return t?!F(t):!1}function re(e){return e?.id??e?.name}function g(e){const t=e;return!!(t?.c_fromStoreId||t?.shippingAddress?.c_storeId)}function oe(e){return e?.c_shipnow?.preferedMethod?.ID}function se(e){return e?.c_shipnow?.messages??[]}const m={"Delivery is not currently available for this address":{key:"shippingOptions.shipnow.unavailable",defaultValue:"Delivery is not currently available for this address"},"We're sorry! Delivery is not currently available for this AFO/APO address.":{key:"shippingOptions.shipnow.apofpo",defaultValue:"We're sorry! Delivery is not currently available for this AFO/APO address."},"We were not able to find a shipping option for this zip code.":{key:"shippingOptions.shipnow.postal",defaultValue:"We were not able to find a shipping option for this zip code."},"Shipping is not currently available for P.O. Boxes":{key:"shippingOptions.shipnow.pobox",defaultValue:"Shipping is not currently available for P.O. Boxes"},"Shipping is not available for P.O. Boxes during warm weather periods.":{key:"shippingOptions.shipnow.poboxWwp",defaultValue:"Shipping is not available for P.O. Boxes during warm weather periods."},"We're sorry! Delivery is not available for AFO/APO addresses during warm weather periods.":{key:"shippingOptions.shipnow.apofpoWwp",defaultValue:"We're sorry! Delivery is not available for AFO/APO addresses during warm weather periods."},"shipping.shipnow.unavailable.wwp":{key:"shippingOptions.shipnow.wwp",defaultValue:"This item is not available for delivery because of warm weather time period."}},q="The previously selected delivery options are no longer available";function ae(e){return e.trim().startsWith(q)}function ce(e){if(!e)return null;const t=e.trim();return Object.hasOwn(m,t)?m[t]:(k("shipNowMessage",t),null)}function ue(e,t){const n=B(e);for(const i of R(n)){if(i in u){const r=u[i];if(r)return r}for(const[r,o]of Object.entries(u))if(r!=="*"&&x(i,r)&&o)return o}return t?.routePageType?t.routePageType:u["*"]}function B(e){const t=e.split(/[?#]/)[0]||"/";return t.startsWith("/")?t:`/${t}`}
1function R(e){const t=e.split("/").filter(Boolean),n=new Set([e]);for(let i=1;i<=Math.min(2,t.length-1);i+=1)n.add(`/${t.slice(i).join("/")}`);return[...n]}function x(e,t){return t==="*"?!0:t.startsWith("*")&&t.endsWith("*")?e.includes(t.slice(1,-1)):t.startsWith("*")?e.endsWith(t.slice(1)):t.endsWith("/*")?e.startsWith(t.slice(0,-1)):e===t}function j({productId:e,productName:t,price:n,standardPrice:i,salePrice:r,brand:o,categoryPath:s,variationValues:c,quantity:b=1,index:p,isFundraisingPrice:w=!1,listId:P,listName:I}){const l=i??n??0,d=r??l,f=!w&&l>d?Number((l-d).toFixed(2)):0,S=c?Object.values(c).map(Q).join(" "):"",T=s?.replace(/\/\d+\.html$/,"").split("/").filter(Boolean)??[],[E,O,N,A,M]=T;return{item_id:e,item_name:t,affiliation:"N/A",coupon:"",...f>0&&{discount:f},...typeof p=="number"&&{index:p},item_brand:o??D,item_category:E??"",item_category2:O??"",item_category3:N??"",item_category4:A??"",item_category5:M??"",item_list_id:P??"N/A",item_list_name:I??"N/A",item_variant:S,location_id:"N/A",price:d,quantity:b}}function U(e){return!!e&&Object.keys(e).length>0}function y(e,t){if(!(typeof e!="number"&&typeof t!="number"))return(typeof e=="number"?e:0)+(typeof t=="number"?t:0)}function le(e){const t=new Map,n=[];for(const i of e){if(!i.productId){n.push(i);continue}const r=t.get(i.productId);if(!r){const o={...i};t.set(i.productId,o),n.push(o);continue}r.quantity=(a(r.quantity)||1)+(a(i.quantity)||1),r.price=y(r.price,i.price),r.priceAfterItemDiscount=y(r.priceAfterItemDiscount,i.priceAfterItemDiscount)}return n}function de(e,t={}){const n=t.quantityOverride||a(e.quantity)||1,i=a(e.quantity)||n,r=t.standardPrice??$(e,i),o=t.salePrice??H(e,i);return j({productId:e.productId??"",productName:e.productName??e.itemText??"",price:o??r,standardPrice:r,salePrice:o,brand:e.brand,categoryPath:t.categoryPath,variationValues:U(e.variationValues)?e.variationValues:t.fallbackVariationValues,quantity:n,index:t.index,isFundraisingPrice:t.isFundraisingPrice??z(e),listId:t.listId,listName:t.listName})}function $(e,t){const n=e.tieredPrices?.map(s=>a(s.price)).filter(s=>typeof s=="number").reduce((s,c)=>s===void 0||c>s?c:s,void 0),i=a(e.basePrice),r=a(e.price),o=typeof r=="number"?r/t:void 0;return[n,i,o].filter(s=>typeof s=="number").reduce((s,c)=>s===void 0||c>s?c:s,void 0)}function H(e,t){const n=a(e.c_discountPrice);if(typeof n=="number")return n;const i=a(e.priceAfterItemDiscount);if(typeof i=="number")return i/t;const r=a(e.price);return typeof r=="number"?r/t:a(e.basePrice)}function a(e){return typeof e=="number"&&Number.isFinite(e)&&e>=0?e:void 0}function Q(e){if(typeof e=="string")return e;if(e&&typeof e=="object"){const t=e,n=t.value??t.name;return typeof n=="string"?n:""}return""}function z(e){return!!(e.c_isFundraisingPrice??e.c_isFundraising??e.c_fundraisingPrice??e.c_fundraising??e.isFundraisingPrice)}function pe(e){const t=(e??[]).map(n=>n.paymentMethodId).filter(n=>!!n);return t.length>0?t.join(","):void 0}function fe(e){const t=e.some(g),n=e.filter(i=>!g(i)&&!V(i)).length;return t&&n>0?"mixed":t?"bopis":n>1?"multi_shipping":"standard_shipping"}function v(e){if(!e)return;let t;try{t=e.startsWith("http")?new URL(e).pathname:e}catch{return}const n=t.split("/").filter(Boolean);if(!(n.length<3||!n[n.length-1].endsWith(".html")))return n.slice(0,-2).join("/")||void 0}function Y(e,t){const n=e.primaryCategoryId?.trim()||void 0,i=n?t?.[n]:void 0;if(i)return i.replace(/^\/|\/$/g,"")||void 0;const r=e.c_productSlugUrl?.trim().replace(/^\/|\/$/g,"");if(r){const s=r.split("/").filter(Boolean);if(s.length>1)return s.slice(0,-1).join("/")}const o=v(e.slugUrl)??v(e.c_canonicalUrl);return o||n}function he(e){const t=e.variants??[];if(t.length===0)return;const n=typeof e.c_defaultVariantId=="string"?e.c_defaultVariantId.trim():"";return((n?t.find(o=>o.productId===n):void 0)??(t.length===1?t[0]:void 0))?.variationValues}function ge(e,t){const n=e.c_gtmCategoryPath?.trim();return n||Y(e,t)}function me(e,t){return{category:"payment",action:"express_payment_selected",value:e,label:`page:${t}`}}function ye(e){if(!e||typeof document>"u"||!e.includes("&"))return e;const t=document.createElement("textarea");return t.innerHTML=e,t.value}function X(e){let t=e.target;for(;t&&t!==e.currentTarget;){const n=t.getAttribute("data-gtm-label");if(n)return n;t=t.parentElement}return t?.getAttribute("data-gtm-label")??""}function ve(e,t){return e.stopPropagation(),_.push({event:"cta",category:sessionStorage.getItem("gtm_page_type")??"Other",action:t.action,label:X(e),...t.value&&{detail:t.value}})}export{te as G,ue as a,X as b,he as c,ye as d,K as e,ee as f,_ as g,me as h,de as i,se as j,ae as k,ce as l,le as m,re as n,ie as o,ne as p,g as q,ge as r,ve as s,j as t,F as u,oe as v,pe as w,fe as x};
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.