PageSourceSearch

https://assets.wearewild.com/_astro/Drawer.astro_astro_type_script…?dpl=6abe18c284cced0008f91b06

js wearewild.com collected 2026-10-02 04:47:51 UTC 7,486 bytes, 1 lines download raw bytes

1!function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"965f3793445285719ff75f6477fd65c70c5ea2f8"};var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="253ef85b-8690-45dd-892e-425f5a7ab9e2",e._sentryDebugIdIdentifier="sentry-dbid-253ef85b-8690-45dd-892e-425f5a7ab9e2")}catch{}}();import{t as e}from"./module.esm.DD_UvB7c.js?dpl=6abe18c284cced0008f91b06";import{r as t,t as n}from"./product-types.BlEfBvSv.js?dpl=6abe18c284cced0008f91b06";import{t as r}from"./price.ClAK8c0j.js?dpl=6abe18c284cced0008f91b06";import{r as i}from"./subscription.D7KfVtMX.js?dpl=6abe18c284cced0008f91b06";import{n as a,r as o,t as s}from"./mappers.D_H12fK2.js?dpl=6abe18c284cced0008f91b06";import{n as c}from"./shopify.Be9ljlOK.js?dpl=6abe18c284cced0008f91b06";import{C as l,_ as u,d,f,g as p,h as m,m as h,p as g,v as _,w as v,y}from"./cart-attributes.CvioSiBb.js?dpl=6abe18c284cced0008f91b06";import{C as b,u as x}from"./drawer-ids.B8CwkjwC.js?dpl=6abe18c284cced0008f91b06";import{n as S}from"./event-names.BG8qb1Km.js?dpl=6abe18c284cced0008f91b06";import{t as C}from"./analytics.CHct0ztr.js?dpl=6abe18c284cced0008f91b06";import{t as w}from"./base-drawer-events.hYrSRgMr.js?dpl=6abe18c284cced0008f91b06";import{t as T}from"./location.DcKsMECQ.js?dpl=6abe18c284cced0008f91b06";import{i as E}from"./imgix.BDI1auw_.js?dpl=6abe18c284cced0008f91b06";import{t as D}from"./engraving.DJQGDAqA.js?dpl=6abe18c284cced0008f91b06";import{a as O,i as k,o as A,r as j,t as M}from"./constants.CkRdYqmn.js?dpl=6abe18c284cced0008f91b06";import{n as N,t as P}from"./recent-viewed.ChrdwVbx.js?dpl=6abe18c284cced0008f91b06";var F=e=>e.sku?.startsWith(D),I=(e,t)=>({shopify_product_sku:e.sku||"undefined",shopify_product_name:e.name||"undefined",shopify_product_brand:"Wild",shopify_product_category:e.productCategory||"undefined",shopify_product_variant_name:"Default Title",shopify_product_price:void 0===e.pricing?.finalPrice?"undefined":String(e.pricing.finalPrice),quantity:String(e.quantity),list:"puwylo_recently_viewed",shopify_product_product_id:c(e.productId)||"undefined",shopify_product_variant_id:c(e.variantId)||"undefined",shopify_product_compare_at_price:void 0===e.pricing?.originalPrice?"0.0":String(e.pricing.originalPrice),shopify_product_image:e.image?.url||"undefined",shopify_product_type:e.productType||"undefined",storefront_category_name:e.storefrontCategoryName||void 0,headless_url:window.location.origin+t}),L=e=>({event:S,payload:{list:e.pathname,purchaseType:"subscription"===e.purchaseType?"subscription":"one-time",products:e.products.filter(e=>!F(e)).map(t=>I(t,e.pathname))}}),R=e=>e.sellingPlan??("scent"===e.productType?e.upsellPlan:void 0),z=(e,t)=>{let i=e.filter(R);if(0===i.length)return null;let r=i.some(e=>e.sellingPlan)?t:12,d=i[0].categoryId,n=i[0].postPurchaseBundleData,l=window.CommerceEngine.config.categoryBundleProducts[d]?.sellingPlans[r]?.id,u=s(n,l);return{attributes:o(a(u,i.map(e=>({productId:e.productId,variantId:c(e.variantId),quantity:Number(e.quantity),sellingPlan:Number(c(R(e).id))}))),u.handle).flat(),lineIds:new Set(i.map(({variantId:e})=>btoa(e)))}},B="#/recently-viewed",V=e=>{let t=e.products.some(e=>"scent"===e.productType&&e.sellingPlan);return e.products.reduce((e,a)=>a.sellingPlan?e+a.sellingPlan.checkoutPrice*a.quantity:a.pricing?e+("case"===a.productType&&t?.8*a.pricing.finalPrice:a.pricing.finalPrice)*a.quantity:e,0)},H=e=>e?.startsWith(D),U=(e,t,a)=>e.filter(e=>e.engraving).map(e=>({id:t,quantity:1,sku:a,customAttributes:[{key:h,value:e.engraving},{key:f,value:e.variantId}]})),W=(e,a)=>{let{name:i,variantId:r,quantity:s,engraving:o,engravingProductVariantId:c,sku:h,productType:b,productCategory:w,categoryId:P,storefrontCategoryName:C,sellingPlan:T,upsellPlan:k}=e,A=b===t,I=b===n;return{id:btoa(r),quantity:s,engraving:o||null,customAttributes:[{key:g,value:i},{key:y,value:b},{key:_,value:w},{key:u,value:P},...T&&A?[{key:p,value:a.nextRecurringDate}]:[],...k&&A?[{key:v,value:k.id}]:[],...a.postPurchaseAdjustSku&&a.postPurchaseAdjustSku===h?[{key:m,value:a.postPurchaseAdjustQuantity.toString()}]:[],...I&&c?[{key:d,value:c}]:[],{key:f,value:r},{key:l,value:C}],subscriptionId:T?btoa(T.id):null}};e.data("puwyloDrawer",()=>({recentlyViewedItems:[],addToCartText:"Add to cart",addAllToCartText:"Add all to cart",processingRecordPathnames:[],isProcessingAllRecords:!1,wasAddToCartClicked:!1,get allRecordsPrice(){let e=this.recentlyViewedItems.reduce((e,t)=>
1e+V(t),0),t=document.body.dataset.localeCurrencySymbol;return r(t,e)},get footerCTALabel(){return`${this.allRecordsPrice} • ${1===this.recentlyViewedItems.length?this.addToCartText:this.addAllToCartText}`},init(){this.addToCartText=this.$root.dataset.addToCartLabel||this.addToCartText,this.addAllToCartText=this.$root.dataset.addAllToCartLabel||this.addAllToCartText;let e=location.hash===B;P.data.then(t=>{this.recentlyViewedItems=t,e&&(t.length>0?this.$dispatch(w,{id:b,isOpen:!0}):T())}),this.$watch("recentlyViewedItems",(e,t)=>{let a=this.wasAddToCartClicked;0===e.length&&t.length>0&&this.closeDrawer(),a&&this.$dispatch(x,{type:"cart"})}),this.$watch("isOpen",e=>{e?location.hash=B:(this.wasAddToCartClicked=!1,T())}),A.initialise()},async removeRecord(e,t=!0){A.track(k,e),t&&(this.wasAddToCartClicked=!1),this.recentlyViewedItems=await N(e)},async addTransformedDataToCart(e,a=!1){let{products:r,purchaseFrequency:s,title:d,pathname:o,pageSelection:n}=e;this.wasAddToCartClicked=!0,this.processingRecordPathnames.push(o);let c,l=r.filter(e=>e.productType===t),u=l.reduce((e,t)=>e+t.quantity,0),p=0;l.length>0&&u<3&&(c=l[0].sku,p=3-(u-l[0].quantity));let m={nextRecurringDate:i(l),postPurchaseAdjustSku:c,postPurchaseAdjustQuantity:p},h=r.flatMap(e=>H(e.sku)?U(r,e.variantId,e.sku):[W(e,m)]),y=z(r,s),f=y?h.map(e=>y.lineIds.has(e.id)?{...e,customAttributes:[...e.customAttributes,...y.attributes]}:e):h,g={title:d,editURL:`${location.origin}${o}${n?`?selections=${n}`:""}`,PDPBundle:!0,image:r[0].image.url,items:f};await window.CommerceEngine.action({addLines:g}),a?await N(e):await this.removeRecord(e,!1),this.processingRecordPathnames.splice(this.processingRecordPathnames.indexOf(o),1),A.track(j,e),C(L(e)),window.Kameleoon&&window.Kameleoon.API.Goals.processConversion(372151)},async addAllToCart(){this.isProcessingAllRecords=!0,await Promise.all(this.recentlyViewedItems.map(e=>this.addTransformedDataToCart(e,!0))),A.track(M,void 0),this.recentlyViewedItems=await P.data,this.isProcessingAllRecords=!1},closeDrawer(){this.$dispatch(w,{id:b,isOpen:!1})},closeDrawerBtn:{"@click.prevent"(){this.closeDrawer()}},dynamicBannerBindings:{":class"(){return{"puwylo-drawer__footer-banner--visible":this.isOpen}}}})),e.data("puwyloRecentlyViewedItem",e=>({get displayLineItem(){return e.products.filter(e=>!H(e.sku))},get displayOriginalPrice(){let e=this.item.products.reduce((e,t)=>t.pricing?e+t.pricing.originalPrice*t.quantity:e,0),t=document.body.dataset.localeCurrencySymbol;return r(t,e)},get displayFinalPrice(){let e=V(this.item),t=document.body.dataset.localeCurrencySymbol;return r(t,e)},get editProductUrl(){return`${this.item.pathname}${this.item.pageSelection?`?selections=${this.item.pageSelection}`:""}`},get isRecordProcessing(){return this.processingRecordPathnames.includes(this.item.pathname)||this.isProcessingAllRecords},getProxyImageUrl:E,onClickEdit(){A.track(O,this.item),location.href=this.editProductUrl}}));

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.