1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1174,3555,5218,5936,8765,8793,8967],{1550:(e,t,r)=>{"use strict";r.d(t,{A:()=>c});var o=r(8106),a=r(4319),n=r(33843),s=r(15037),i=r(27196);let l=(0,o.v)((0,a.lt)((0,a.kg)({isLoggedIn:!1,userData:void 0},(e,t)=>({setUserData:r=>{!(0,i.isServer)()&&r&&(e(e=>({...e,userData:{...e.userData,...r},isLoggedIn:!0})),localStorage.setItem(s.o0.USER_DATA,JSON.stringify(t().userData)))},getUserData:()=>{if((0,i.isServer)())return;let r=localStorage.getItem(s.o0.USER_DATA);return r?(e(()=>({...JSON.parse(r)})),t().userData):void 0}})),{enabled:!1})),c=(0,n.L)(l)},8967:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>d});var o=r(37876),a=r(97256),n=r(22722),s=r(27196),i=r(71682),l=r(89099),c=r(14232);let d=(0,c.memo)(e=>{let{ifdeci:t=!1,price:d,children:u}=e,{isChromeLighthouse:m}=(0,s.useSafeContext)(n.GlobalContext),p=(0,l.useRouter)(),[h,f]=(0,c.useState)(!1),[y,g]=(0,c.useState)(void 0);return((0,i.Z)(async()=>{if(f(!0),d){d>0&&d<50&&(d=50);let{AffirmRequests:e}=await Promise.all([r.e(8248),r.e(8217),r.e(3555)]).then(r.bind(r,58217)),{offer:t}=await e.getAffirmAlaTermModal(d);if(t){let e=Math.max(...t.terms.reduce((e,t)=>(e.push(t.installment_count),e),[])),r=t.terms.find(t=>t.installment_count===e);r?g(r.installment_amount/100):g(d/12)}else g(d/12)}else g(0);f(!1)},[d]),m||!y)?(0,o.jsx)(o.Fragment,{}):"function"==typeof u?null==u?void 0:u(h&&!p.pathname.includes("checkout")?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(a.a,{portal:!1,size:10,style:{position:"static",left:void 0,right:10,display:"inline-block"}}),"\xa0"]}):t?(0,s.getFormattedCurrency)(y,!0):"$"+Math.ceil(y)):u})},23973:e=>{e.exports={termsContentMain:"SMSTermsConditions_termsContentMain__m_21P"}},25892:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});var o=r(14232);function a(e){let t=(0,o.useRef)(void 0);return(0,o.useEffect)(()=>{t.current=e}),t.current}},34175:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var o=r(37876),a=r(23973),n=r.n(a),s=r(27196);let i=()=>(0,o.jsxs)("div",{className:(0,s.classNames)([n().termsContentMain,"termsContentMain"]),children:[(0,o.jsx)("p",{children:"Effective/Updated Date: March 25, 2025"}),(0,o.jsx)("p",{children:'The Layla mobile message service (the "Service") is operated by Layla Sleep (âLaylaâ, âweâ, or âusâ). Your use of the Service constitutes your agreement to these terms and conditions (âMobile Termsâ). We may modify or cancel the Service or any of its features without notice. To the extent permitted by applicable law, we may also modify these Mobile Terms at any time and your continued use of the Service following the effective date of any such changes shall constitute your acceptance of such changes.'}),(0,o.jsx)("p",{children:"By consenting to Laylaâs SMS/text messaging service, you agree to receive recurring SMS/text messages from and on behalf of Layla through your wireless provider to the mobile number you provided, even if your mobile number is registered on any state or federal Do Not Call list. Text messages may be sent using an automatic telephone dialing system or other technology. Service-related messages may include updates, alerts, and information (e.g., order updates, account alerts, etc.). Promotional messages may include promotions, specials, and other marketing offers (e.g., cart reminders)."}),(0,o.jsx)("p",{children:"You understand that you do not have to sign up for this program in order to make any purchases, and your consent is not a condition of any purchase with Layla. Your participation in this program is completely voluntary."}),(0,o.jsx)("p",{children:"We do not charge for the Service, but you are responsible for all charges and fees associated with text messaging imposed by your wireless provider. Message frequency varies. Message and data rates may apply. Check your mobile plan and contact your wireless provider for details. You are solely responsible for all charges related to SMS/text messages, including charges from your wireless provider."}),(0,o.jsxs)("p",{children:["You may opt-out of the Service at any time. Text the single keyword command STOP to"," ",(0,o.jsx)("a",{href:"tel:8337391320",children:"+18337391320"})," or click the unsubscribe link (where available) in any text message to cancel. You'll receive a one-time opt-out confirmation text message. No further messages will be sent to your mobile device, unless initiated by you. If you have subscribed to other Layla mobile message programs and wish to cancel, except where applicable law requires otherwise, you will need to opt out separately from those programs by following the instructions provided in their respective mobile terms."]}),(0,o.jsxs)("p",{children:["For Service support or assistance, text HELP to ",(0,o.jsx)("a",{href:"tel:8337391320",children:"+18337391320"})," or email"," ",(0,o.jsx)("a",{href:"mailto:[email protected]",children:"[email protected]"}),"."]}),(0,o.jsx)("p",{children:"We may change any short code or telephone number we use to operate the Service at any time and will notify you of these changes. You acknowledge that any messages, including any STOP or HELP requests, you send to a
1short code or telephone number we have changed may not be received and we will not be responsible for honoring requests made in such messages."}),(0,o.jsx)("p",{children:"The wireless carriers supported by the Service are not liable for delayed or undelivered messages. You agree to provide us with a valid mobile number. If you get a new mobile number, you will need to sign up for the program with your new number."}),(0,o.jsx)("p",{children:"To the extent permitted by applicable law, you agree that we will not be liable for failed, delayed, or misdirected delivery of any information sent through the Service, any errors in such information, and/or any action you may or may not take in reliance on the information or Service."}),(0,o.jsxs)("p",{children:["We respect your right to privacy. To see how we collect and use your personal information, please see our ",(0,o.jsx)("a",{href:"/privacy-policy/",children:"Privacy Notice"}),"."]})]})},35218:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>s});var o=r(37876),a=r(27196),n=r(14232);let s=e=>{let{children:t,focusFirst:r=!0}=e,s=(0,n.useRef)(null),i=(0,n.useRef)(!1),l=(0,n.useRef)(document.activeElement);return(0,n.useEffect)(()=>{if(!r||i.current)return;let e=s.current,t=(0,a.focusableElements)(e).at(0);t&&document.activeElement!==t&&(t.focus({preventScroll:!0}),i.current=!0)},[r]),(0,n.useEffect)(()=>{let e=s.current;if(!e)return;let t=t=>{let r=(0,a.focusableElements)(e),o=r.at(0),n=r.at(-1);"Tab"===t.key&&(t.shiftKey?document.activeElement===o&&(null==n||n.focus({preventScroll:!0}),t.preventDefault()):document.activeElement===n&&(null==o||o.focus({preventScroll:!0}),t.preventDefault()))};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)},[]),(0,n.useEffect)(()=>()=>{var e;null==(e=l.current)||e.focus({preventScroll:!0})},[]),(0,o.jsx)("div",{ref:s,tabIndex:-1,style:{height:"100%"},children:t})}},69298:e=>{e.exports={loader:"Loader_loader__xEUdY",spin:"Loader_spin__DzQQl"}},75551:e=>{e.exports={showHideCouponForm:"CouponForm_showHideCouponForm__zLU9o",addPromo:"CouponForm_addPromo__sniHv",promoSec:"CouponForm_promoSec__Z3s36",formInner:"CouponForm_formInner__tZPQx",formInput:"CouponForm_formInput__pO89k",has_error:"CouponForm_has_error__EJTw6",error:"CouponForm_error__7S_hX",success:"CouponForm_success__RLbjh"}},76923:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});var o=r(14232),a=r(46927);let n=e=>{let{children:t}=e;return!function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{autoLock:t=!0,lockTarget:r,widthReflow:n=!0}=e,[s,i]=(0,o.useState)(!1),l=(0,o.useRef)(null),c=(0,o.useRef)(null),d=()=>{if(l.current){let{overflow:e,paddingRight:t}=l.current.style;if(c.current={overflow:e,paddingRight:t},n){let e=l.current===document.body?window.innerWidth:l.current.offsetWidth,t=parseInt(window.getComputedStyle(l.current).paddingRight,10)||0,r=e-l.current.scrollWidth;l.current.style.paddingRight="".concat(r+t,"px")}l.current.style.overflow="hidden",i(!0)}},u=()=>{l.current&&c.current&&(l.current.style.overflow=c.current.overflow,n&&(l.current.style.paddingRight=c.current.paddingRight)),i(!1)};(0,a.E)(()=>(r&&(l.current="string"==typeof r?document.querySelector(r):r),l.current||(l.current=document.body),t&&d(),()=>{u()}),[t,r,n])}(),t}},83555:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Http:()=>n});var o=r(27196),a=function(e){return e.GET="GET",e.POST="POST",e.PATCH="PATCH",e.PUT="PUT",e.DELETE="DELETE",e}(a||{});class n{static objectToQueryString(e){let t=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return(o,a)=>{let n=e[a];a=encodeURIComponent(a);let s=r?"".concat(r,"[").concat(a,"]"):a;return null==n||""===n||("function"==typeof n?o.push("".concat(s,"=")):["number","boolean","string"].includes(typeof n)?o.push("".concat(s,"=").concat(encodeURIComponent(n))):o.push(Object.keys(n).reduce(t(n,s),[]).join("&"))),o}};return void 0!=e&&null!=e&&""!=e?Object.keys(e).reduce(t(e),[]).join("&"):""}static searchParamsToObject(e){return[...new URLSearchParams(e).entries()].reduce((e,t)=>{let[r,o]=t;return Object.prototype.hasOwnProperty.call(e,r)?Array.isArray(e[r])?e[r]=[...e[r],o]:e[r]=[e[r],o]:e[r]=o,e},{})}static buildUrl(e,t){return"".concat(e).concat(n.objectToQueryString(t)?"?".concat(n.objectToQueryString(t)):"")}static prepareOptions(e){let{headers:t,...r}=(null==e?void 0:e.config)||{},a=(0,o.isArray)(null==e?void 0:e.body)||(0,o.isObject)(null==e?void 0:e.body),n=a?JSON.stringify(null==e?void 0:e.body):null==e?void 0:e.body;return{...r,body:n,...a?{headers:{...t,...o.jsonHeader}}:t?{headers:{...t}}:void 0}}static async http(e,t,r,o){let a,n,s=new AbortController,i=setTimeout(()=>
1s.abort(),1e4),l=new Request(this.buildUrl(e,t),{keepalive:!0,signal:(null==o?void 0:o.withAbort)?s.signal:void 0,...r});null==o||o.withLog,(null==o?void 0:o.withBench)&&performance.now();let c=await fetch(l);return(null==o?void 0:o.withBench)&&performance.now(),clearTimeout(i),c}static get(e,t,r){let{headers:o,...a}=(null==t?void 0:t.config)||{},n={...a,method:"GET",headers:{...o}};return this.http(e,null==t?void 0:t.params,n,r)}static post(e,t,r){let o=n.prepareOptions(t||{});return this.http(e,null==t?void 0:t.params,{...o,method:"POST"},r)}static patch(e,t,r){let o=n.prepareOptions(t||{});return this.http(e,null==t?void 0:t.params,{...o,method:"PATCH"},r)}static put(e,t,r){let o=n.prepareOptions(t||{});return this.http(e,null==t?void 0:t.params,{...o,method:"PUT"},r)}static delete(e,t,r){let o=n.prepareOptions(t||{});return this.http(e,null==t?void 0:t.params,{...o,method:"DELETE"},r)}}},89637:e=>{e.exports={showHideCouponForm:"GiftCardForm_showHideCouponForm__oNKNY",addPromo:"GiftCardForm_addPromo__yfn_q",applyCouponForm:"GiftCardForm_applyCouponForm__hrIiq",error:"GiftCardForm_error__VqIWb",succss:"GiftCardForm_succss__Ze38E",formInput:"GiftCardForm_formInput__uhcQS",has_error:"GiftCardForm_has_error__d4Qm_",promoSec:"GiftCardForm_promoSec__V8wPZ",formInner:"GiftCardForm_formInner__F_xzE",success:"GiftCardForm_success__tLRXu"}},91769:(e,t,r)=>{"use strict";r.d(t,{X:()=>m});var o=r(37876),a=r(14232),n=r(75551),s=r.n(n),i=r(88992),l=r(7578),c=r(26166),d=r(27196),u=r(22722);let m=e=>{let{onApplyCoupon:t,billing_email:r}=e,{userData:n}=(0,d.useSafeContext)(u.GlobalContext),m=c.default.use.list(),p=l.A.use.addCoupon(),[h,f]=(0,a.useState)(!1),[y,g]=(0,a.useState)(),{control:v,handleSubmit:b,reset:x,formState:{errors:w},setFocus:_}=(0,i.mN)({shouldFocusError:!0,mode:"onSubmit",defaultValues:{coupon_code:""}}),C=async e=>{var o,a,s,i;try{if(!(null==(o=e.coupon_code.split(",").map(e=>e.trim().toLowerCase()))?void 0:o[0]))return;let i=await p({cart:m,coupon_code:e.coupon_code,type:"COUPON",billing_email:r,manual:"yes",urole:n?n.wp_capabilities:""});i&&i.success?(g(i),await (0,d.delay)(0),null==(a=S.current)||a.focus(),t(),x()):(g({message:(0===m.filter(e=>"ACCIDENTAL_PROTECTION"!=e.product_type).length?"Sorry, this coupon cannot be applied to your cart.":null==i?void 0:i.message)||"Something went wrong! Please try again.",success:!1}),await (0,d.delay)(0),null==(s=S.current)||s.focus())}catch(e){g({message:(0,d.parseError)(e),success:!1}),await (0,d.delay)(0),null==(i=S.current)||i.focus()}};(0,a.useEffect)(()=>{if(h){let e=document.querySelector("#apply-coupon-form input");e instanceof HTMLElement&&e.focus()}},[h]);let S=(0,a.useRef)(null);return(0,o.jsx)(o.Fragment,{children:(0,o.jsx)("div",{className:s().promoSec,children:(0,o.jsxs)("form",{noValidate:!1,onSubmit:b(C),id:"apply-coupon-form",name:"Coupon Form",children:[(0,o.jsxs)("div",{className:s().formInner,children:[(0,o.jsx)(i.xI,{control:v,name:"coupon_code",rules:{required:!0},render:e=>{let{field:{onChange:t,onBlur:r,name:a,value:n,ref:i},fieldState:{error:l}}=e;return(0,o.jsxs)("div",{className:s().formInput,children:[(0,o.jsx)("input",{name:a,type:"text",onChange:e=>{g(void 0),t(e)},onBlur:r,value:n,"aria-label":"Enter Coupon code",placeholder:"Enter Coupon code",className:l&&"required"==l.type?s().has_error:""}),l&&"required"==l.type&&(0,o.jsx)("div",{tabIndex:0,className:s().error,ref:i,children:"Please enter a Coupon code to continue."})]})}}),(0,o.jsxs)("button",{type:"submit",children:["Apply",(0,o.jsx)("span",{className:"sr-only",children:" Coupon"})]})]}),y&&(0,o.jsxs)("div",{tabIndex:0,ref:S,className:y.success?s().success:s().error,children:[(0,o.jsx)("span",{"aria-hidden":!0,children:y.message}),(0,o.jsxs)("span",{className:"sr-only",children:[y.message," Order total updated."]})]})]})})})}},97256:(e,t,r)=>{"use strict";r.d(t,{a:()=>d});var o=r(37876),a=r(14232),n=r(69298),s=r.n(n),i=r(18991),l=r(15037),c=r(27196);let d=(0,a.forwardRef)((e,t)=>{let{size:r=60,zIndex:a=999,tabIndex:n=0,position:d="fixed",portal:u=!0,style:m,accentColor:p="#A73219",borderColor:h="#f3f3f3"}=e;if(!(0,c.isServer)()){let e=(0,o.jsx)("div",{ref:t,"aria-label":"Please wait while we process your request.",style:{position:d,width:r,height:r,zIndex:a,border:"".concat(r/10,"px solid ").concat(h),borderTop:"".concat(r/10,"px solid ").concat(p),top:"calc(50% - ".concat(r/2,"px)"),left:"calc(50% - ".concat(r/2,"px)"),...m},className:s().loader});return(0,o.jsx)(o.Fragment,{children:u?(0,o.jsxs)(i.Z,{location:l.IU.Loader,children:[(0,o.jsx)("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.7)",zIndex:a}}),e]}):e})}return null})},99111:(e,t,r)=>{"use strict";r.d(t,{A:()=>m});var o=r(37876),a=r(14232),n=r(89637),s=r.n(n),i=r(24164),l=r(88992),c=r(1550),d=r(71682),u=r(27196);let m=e=>{var t;let{onApplyGiftCard:n,payableAmount:m,type:p="form",onRemove:h,appliedGiftCards:f,cartCalculating:y}=e,g=i.A.use.addGiftCard(),v=i.A.use.getAllGiftCards(),[b,x]=(0,a.useState)(void 0),{control:w,handleSubmit:_,reset:C}=(0,l.mN)({mode:"onSubmit",shouldFocusError:!0,defaultValues:{gc_code:""}}),[S,j]=(0,a.useState)(!1),E=c.A.use.getUserData(),[T,N]=(0,a.useState)(void 0),I=null==(t=E())?void 0:t.ID;(0,d.Z)(async()=>
1{if(I){let{MyAccountRequests:e}=await Promise.resolve().then(r.bind(r,58217)),t=await e.getUserGiftCards(I);"yes"===t.stat?N(t.redeemedcards):N(void 0)}},[I,f]);let F=async e=>{var t,o,a,s,i,l,c;let{gc_code:d}=e;try{if((await v()).find(e=>e.code.toLowerCase()===d.toLowerCase()))x({stat:"no",msg:"Gift card already applied"}),await (0,u.delay)(50),null==(t=P.current)||t.focus();else switch(p){case"form":{let{CartRequests:e}=await Promise.resolve().then(r.bind(r,58217)),t=await e.checkGiftCard(d);if("yes"===t.stat&&(null==t?void 0:t.carddata)){let e=t.carddata,r=+e.remaining;(new Date().getTime()<1e3*e.expire_date||0==+e.expire_date)&&r>0?(e.applied_amt=r>=m?m:r,e.remaining=r>=m?r-m:0,await g({gc:e}),x(t),await (0,u.delay)(50),null==(o=P.current)||o.focus(),C(),n()):(x({stat:"no",msg:"Can't apply."}),await (0,u.delay)(50),null==(a=P.current)||a.focus())}else x(t),await (0,u.delay)(50),null==(s=P.current)||s.focus();break}case"list":{let e=null==T?void 0:T.find(e=>e.code===d);if(!e)return;let t=+e.remaining;(new Date().getTime()<1e3*e.expire_date||0==+e.expire_date)&&t>0?(e.applied_amt=t>=m?m:t,e.remaining=t>=m?t-m:0,await g({gc:e}),x({msg:"Card Applied.",stat:"yes"}),await (0,u.delay)(50),null==(i=P.current)||i.focus(),C(),n()):(x({stat:"no",msg:"Can't apply."}),await (0,u.delay)(50),null==(l=P.current)||l.focus())}}}catch(e){x({stat:"no",msg:"Something is going wrong, please try again."}),await (0,u.delay)(50),null==(c=P.current)||c.focus()}};(0,a.useEffect)(()=>{if(S){let e=document.querySelector("#apply-gift-card-form input");e instanceof HTMLElement&&e.focus()}},[S]);let P=(0,a.useRef)(null);return"form"===p?(0,o.jsx)(o.Fragment,{children:(0,o.jsxs)("div",{className:s().applyCouponForm,children:[(0,o.jsxs)("form",{className:s().promoSec,onSubmit:_(F),id:"apply-gift-card-form",name:"Gift Card From",children:[(0,o.jsx)(l.xI,{control:w,name:"gc_code",rules:{required:!0},render:e=>{let{field:{onChange:t,onBlur:r,name:a,value:n,ref:i},fieldState:{error:l}}=e;return(0,o.jsxs)("div",{className:s().formInput,children:[(0,o.jsx)("input",{type:"text",onChange:e=>{x(void 0),null==t||t(e)},onBlur:r,value:n,"aria-label":"Enter Gift Card code",placeholder:"Enter Gift Card code",className:l&&"required"==l.type?s().has_error:""}),l&&"required"==l.type&&(0,o.jsx)("div",{tabIndex:0,className:s().error,ref:i,children:"Please enter a Gift Card code to continue."})]})}}),(0,o.jsxs)("button",{type:"submit",children:["Apply",(0,o.jsx)("span",{className:"sr-only",children:" Gift Card"})]})]}),b&&(0,o.jsx)("div",{tabIndex:0,ref:P,className:"no"!==b.stat.toLowerCase()?s().success:s().error,children:b.msg})]})}):"list"===p?T&&T.some(e=>+e.remaining>0)&&(0,o.jsxs)("div",{className:s().promoSec,children:[(0,o.jsx)("li",{tabIndex:0,className:(0,u.classNames)([s().chk,s().gc,s().giftCards]),children:"Active Gift Cards"}),T.filter(e=>+e.remaining>0).map(e=>(0,o.jsxs)("li",{className:(0,u.classNames)([s().chk,s().gcChild]),children:[(0,o.jsx)("span",{tabIndex:0,className:s().title,children:(0,o.jsx)("form",{className:s().promoSec,onSubmit:_(F),id:"apply-gift-card-form",name:"Gift Card From",children:(0,o.jsx)(l.xI,{control:w,name:"gc_code",render:t=>{let{field:{onBlur:r,name:a,value:n,ref:i}}=t;return(0,o.jsxs)("div",{className:s().formInput,children:[(0,o.jsx)("input",{type:"checkbox",name:a+e.code,ref:i,checked:void 0!==f.find(t=>t.code===e.code),onChange:t=>{t.target.checked?F({gc_code:e.code}):(x(void 0),null==h||h(e.code))},onBlur:r,value:n}),"\xa0",e.codename]})}})})}),(0,o.jsx)("span",{tabIndex:0,className:s().amount,children:(0,u.getFormattedCurrency)(+e.remaining,!0)})]},e.code)),b&&(0,o.jsx)("div",{ref:P,tabIndex:0,className:"no"!==b.stat.toLowerCase()?s().success:s().error,children:b.msg})]}):void 0}}}]);
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.