/*! @version pwa-studio: 14.1.0, @magento/venia-ui: ~11.5.0, @magento/pwa-theme-venia: ~2.4.0, @magento/pwa-buildpack: ~11.5.3, @magento/peregrine: ~14.4.1, @magento/pagebuilder: ~9.3.2, @magento/eslint-config: ~1.5.0, @magento/babel-preset-peregrine: ~1.3.3, @apollo/client: ~3.5.0 */
(window.webpackJsonp=window.webpackJsonp||[]).push([[115],{ANGM:function(e,t,n){"use strict"
n.r(t),n.d(t,"default",function(){return B})
var r=n("ERkP"),a=n.n(r),c=n("aWzz"),s=n("KgAZ"),l=n("kQwz"),u=n("31Ou"),p=n("X5qW"),g=n("nQjY"),d=n("ddV6"),b=n.n(d),m=n("8aoe"),h=n("P7m1"),_=n("Lgxs"),y=n("VhC9"),v=n("SRwh"),O=n("cbiG"),w=n.n(O)
function _regenerator(){var e,t,o="function"==typeof Symbol?Symbol:{},n=o.iterator||"@@iterator",r=o.toStringTag||"@@toStringTag"
function i(o,n,r,i){var c=n&&n.prototype instanceof Generator?n:Generator,s=Object.create(c.prototype)
return _regeneratorDefine2(s,"_invoke",function(o,n,r){var i,c,s,l=0,u=r||[],p=!1,g={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function d(t,o){return i=t,c=0,s=e,g.n=o,a}}
function d(o,n){for(c=o,s=n,t=0;!p&&l&&!r&&t<u.length;t++){var r,i=u[t],d=g.p,f=i[2]
o>3?(r=f===n)&&(s=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=d&&((r=o<2&&d<i[1])?(c=0,g.v=n,g.n=i[1]):d<f&&(r=o<3||i[0]>n||n>f)&&(i[4]=o,i[5]=n,g.n=f,c=0))}if(r||o>1)return a
throw p=!0,n}return function(r,u,f){if(l>1)throw TypeError("Generator is already running")
for(p&&1===u&&d(u,f),c=u,s=f;(t=c<2?e:s)||!p;){i||(c?c<3?(c>1&&(g.n=-1),d(c,s)):g.n=s:g.v=s)
try{if(l=2,i){if(c||(r="next"),t=i[r]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object")
if(!t.done)return t
s=t.value,c<2&&(c=0)}else 1===c&&(t=i.return)&&t.call(i),c<2&&(s=TypeError("The iterator does not provide a '"+r+"' method"),c=1)
i=e}else if((t=(p=g.n<0)?s:o.call(n,g))!==a)break}catch(t){i=e,c=1,s=t}finally{l=1}}return{value:t,done:p}}}(o,r,i),!0),s}var a={}
function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}t=Object.getPrototypeOf
var c=[][n]?t(t([][n]())):(_regeneratorDefine2(t={},n,function(){return this}),t),s=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(c)
function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,GeneratorFunctionPrototype):(e.__proto__=GeneratorFunctionPrototype,_regeneratorDefine2(e,r,"GeneratorFunction")),e.prototype=Object.create(s),e}return GeneratorFunction.prototype=GeneratorFunctionPrototype,_regeneratorDefine2(s,"constructor",GeneratorFunctionPrototype),_regeneratorDefine2(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName="GeneratorFunction",_regeneratorDefine2(GeneratorFunctionPrototype,r,"GeneratorFunction"),_regeneratorDefine2(s),_regeneratorDefine2(s,r,"Generator"),_regeneratorDefine2(s,n,function(){return this}),_regeneratorDefine2(s,"toString",function(){return"[object Generator]"}),(_regenerator=function _regenerator(){return{w:i,m:f}})()}function _regeneratorDefine2(e,t,n,r){var a=Object.defineProperty
try{a({},"",{})}catch(e){a=0}(_regeneratorDefine2=function _regeneratorDefine(e,t,n,r){function o(t,o){_regeneratorDefine2(e,t,function(e){return this._invoke(t,o,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))})(e,t,n,r)}var j="/api/geo-country",L="geo_detected_country",P="PL",N=6e3
function _detectUserCountry(){return(_detectUserCountry=w()(_regenerator().m(function _callee(){var e,t,o,n,r,a,i,c,s,l,u,p
return _regenerator().w(function(g){for(;;)switch(g.p=g.n){case 0:if(globalThis.document){g.n=1
break}return g.a(2,P)
case 1:if(g.p=1,!(e=new URLSearchParams(globalThis.location.search).get("geo"))||!/^[A-Z]{2}$/i.test(e)){g.n=2
break}t=e.toUpperCase()
try{globalThis.sessionStorage.removeItem(L),globalThis.sessionStorage.setItem(L,t)}catch(e){}return g.a(2,t)
case 2:g.n=4
break
case 3:g.p=3,g.v
case 4:if(g.p=4,!(o=globalThis.sessionStorage.getItem(L))){g.n=5
break}return g.a(2,o)
case 5:g.n=7
break
case 6:g.p=6,g.v
case 7:return g.p=7,n=new AbortController,r=setTimeout(function(){return n.abort()},N),g.n=8,fetch(j,{method:"GET",headers:{Accept:"application/json"},signal:n.signal})
case 8:if(a=g.v,clearTimeout(r),!a.ok){g.n=10
break}return g.n=9,a.json()
case 9:if(i=g.v,!(c=i.countryCode)||!/^[A-Z]{2}$/i.test(c)){g.n=10
break}s=c.toUpperCase()
try{globalThis.sessionStorage.setItem(L,s)}catch(e){}return g.a(2,s)
case 10:g.n=12
break
case 11:g.p=11,g.v
case 12:if(g.p=12,null==(u=globalThis.navigator.language||(null===(l=globalThis.navigator.languages)||void 0===l?void 0:l[0]))||!u.includes("-")){g.n=13
break}if(p=u.split("-")[1].toUpperCase(),!/^[A-Z]{2}$/.test(p)){g.n=13
break}try{globalThis.sessionStorage.setItem(L,p)}catch(e){}return g.a(2,p)
case 13:g.n=15
break
case 14:g.p=14,g.v
case 15:return g.a(2,P)}},_callee,null,[[12,14],[7,11],[4,6],[1,3]])}))).apply(this,arguments)}var S=n("KEM+"),x=n.n(S),E=n("0DP7")
function ownKeys(e,t){var o=Object.keys(e)
if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e)
t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),o.push.apply(o,n)}return o}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{}
t%2?ownKeys(Object(o),!0).forEach(function(t){x()(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):ownKeys(Object(o)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))})}return e}var C={DIRECT_MATCH:"DIRECT_MATCH",GLOBAL_FALLBACK:"GLOBAL_FALLBACK",UNKNOWN:"UNKNOWN",NONE:"NONE"},T="us_four_fstore_com",k="USD"
var G=n("gFMt"),D="geo_location_popup_dismissed",I=new _.a,M=function useGeoLocationPopup(){var e=Object(r.useState)(null),t=b()(e,2),o=t[0],n=t[1],a=Object(r.useState)(!1),i=b()(a,2),c=i[0],s=i[1],u=Object(h.a)(),p=u.availableStores,g=u.currentStore,d=u.handleSwitchStore,f=Object(y.b)().openStoreSwitcher,_=Object(m.b)(),O=b()(_,2)[1].toggleDrawer,w=Object(v.a)().isMobile,j=Object(l.a)(),L=j.formatDisplayName,P=j.formatMessage,N=Object(r.useState)(function(){return!!I.getItem(D)}),S=b()(N,1)[0],x=Object(r.useMemo)(function(){if(!o)return null
try{var e=L(o,{type:"region"})
return e&&e!==o?e:null}catch(e){return null}},[o,L]),M=Object(r.useMemo)(function(){return function resolveRecommendedStore(e,t,o){if(!e||!t||0===t.size)return{path:C.NONE,recommendedStore:null}
var n=E.a[e]
if(n){if(n===o)return{path:C.NONE,recommendedStore:null}
var r=t.get(n)
if(r)return{path:C.DIRECT_MATCH,recommendedStore:r}}var a=E.b[e]
if(a){var i=a.storeCode,c=a.currency
if(i===o)return{path:C.NONE,recommendedStore:null}
var s=t.get(i)
if(s)return{path:C.GLOBAL_FALLBACK,recommendedStore:_objectSpread(_objectSpread({},s),{},{currency:c||s.currency})}}var l=t.get(T)
return l?T===o?{path:C.NONE,recommendedStore:null}:{path:C.UNKNOWN,recommendedStore:_objectSpread(_objectSpread({},l),{},{currency:k})}:{path:C.NONE,recommendedStore:null}}(o,p,null==g?void 0:g.storeCode)},[o,p,g]),A=M.path,F=M.recommendedStore,B=P(Object(G.a)(null==F?void 0:F.storeCode)),U=Object(r.useCallback)(function(){I.setItem(D,"1",31536e3),s(!1)},[]),K=Object(r.useCallback)(function(){U(),null!=F&&F.storeCode&&d(F.storeCode)},[U,d,F]),R=Object(r.useCallback)(function(){U(),f(),w&&O("nav")},[U,f,O,w]),z=Object(r.useCallback)(function(){I.setItem(D,"1",604800),s(!1)},[])
return Object(r.useEffect)(function(){if(!S){var e=!1
return function detectUserCountry(){return _detectUserCountry.apply(this,arguments)}().then(function(t){!e&&t&&n(t)}),function(){e=!0}}},[S]),Object(r.useEffect)(function(){if(!S&&A!==C.NONE&&F){var e=setTimeout(function(){return s(!0)},1e3)
return function(){return clearTimeout(e)}}},[S,A,F]),{isOpen:c,path:A,recommendedStore:F,countryCode:o,countryDisplayName:x,languageName:B,handleConfirm:K,handleOpenSelector:R,handleDismiss:z}},A={root:"geoLocationPopup-root-0qn fixed inset-0 z-dialog pointer-events-none lg_top-auto lg_bottom-0 lg_left-0 lg_right-0",backdrop:"geoLocationPopup-backdrop-9-3 absolute inset-0 bg-black opacity-0 pointer-events-auto",panel:"geoLocationPopup-panel-wW2 absolute bottom-0 left-0 right-0 bg-white rounded-t-2xl px-4 pt-12 pb-6 pointer-events-auto border-t border-t-light-grey lg_relative lg_rounded-none lg_p-8",content:"geoLocationPopup-content-3Ln flex flex-col gap-4 mx-auto lg_flex-row lg_items-center lg_justify-center lg_gap-8",text:"geoLocationPopup-text-zeT flex flex-col gap-2 text-center lg_text-left",title:"geoLocationPopup-title-7Rx font-bold text-sm lg_text-base lg_leading-heading lg_whitespace-nowrap lg_overflow-hidden lg_text-ellipsis",description:"geoLocationPopup-description-n-N text-xs lg_text-sm lg_whitespace-nowrap lg_overflow-hidden lg_text-ellipsis",actions:"geoLocationPopup-actions-FUm flex flex-col gap-2 lg_flex-row lg_items-center lg_gap-4",switchButton:"geoLocationPopup-switchButton-OyL button-root_highPrioritySize_medium-V71 button-root_highPriority-zsL button-root-Ojt cursor-pointer inline-flex relative items-center w-full justify-center leading-body tracking-body pointer-events-auto text-center disabled_border-disabled-element disabled_pointer-events-none focus-visible_outline focus-visible_outline-2 focus-visible_outline-offset-2 focus-visible_outline-black hover_disabled_pointer-events-none font-bold bg-black text-white fill-white active_text-white active_bg-black disabled_bg-disabled disabled_fill-disabled-element disabled_text-disabled-element hover_opacity-70 contrast-more_border contrast-more_border-[CanvasText] text-md min-w-[2.1875rem] min-h-[2.1875rem] p-2 !min-w-auto",switchButtonInner:"geoLocationPopup-switchButtonInner-68N flex items-center gap-2",switchLabel:"geoLocationPopup-switchLabel-E1J font-bold whitespace-nowrap",mapIcon:"geoLocationPopup-mapIcon-oQc flex items-center justify-center rounded-full w-5 h-5 shrink-0",switchTarget:"geoLocationPopup-switchTarget-qIl font-bold",closeButton:"geoLocationPopup-closeButton-6ue absolute right-0 top-0",closeIcon:"geoLocationPopup-closeIcon-gA6 w-6 h-6 m-3",detectedLocation:"geoLocationPopup-detectedLocation-BEs text-xs text-center lg_text-left lg_text-sm"},F=function GeoLocationPopup(e){var t=Object(u.a)(A,e.classes),o=Object(l.a)().formatMessage,n=M(),i=n.isOpen,c=n.path,d=n.recommendedStore,f=n.handleConfirm,b=n.handleOpenSelector,m=n.handleDismiss,h=n.countryDisplayName,_=n.languageName,y=c===C.DIRECT_MATCH,v=Object(r.useMemo)(function(){return h?o({id:"geoLocationPopup.detectedLocation",defaultMessage:"We detected your location: {country}"},{country:h}):null},[h,o]),O=Object(r.useMemo)(function(){return o({id:"geoLocationPopup.secondary",defaultMessage:"Select another country"})},[o]),w=Object(r.useMemo)(function(){return o({id:"geoLocationPopup.closeAria",defaultMessage:"Close"})},[o]),j=Object(r.useMemo)(function(){return o(y?{id:"geoLocationPopup.title",defaultMessage:"A version of the website matching your location is available!"}:{id:"geoLocationPopup.titleGlobal",defaultMessage:"You can switch to the English version of the site for easier browsing and shopping."})},[y,o]),L=Object(r.useMemo)(function(){return y?o({id:"geoLocationPopup.description",defaultMessage:"To shop more conveniently, switch to the appropriate language version of the site"}):null},[y,o]),P=o({id:"geoLocationPopup.changeTo",defaultMessage:"Change to:"})
if(!d||c===C.NONE)return null
if(!i)return null
var N=d.storeCode,S=d.currency,x=Object(G.b)(N)
return a.a.createElement("div",{className:t.root},null,a.a.createElement("div",{className:t.panel},a.a.createElement(g.a,{className:t.closeButton,action:m,"aria-label":w},a.a.createElement(s.m,{className:t.closeIcon})),a.a.createElement("div",{className:t.content},a.a.createElement("div",{className:t.text},!y&&v&&a.a.createElement("span",{className:t.detectedLocation},v),a.a.createElement("strong",{className:t.title},j),y?a.a.createElement("span",{className:t.description},L):null),a.a.createElement("div",{className:t.actions},a.a.createElement(p.a,{priority:"high",onClick:f,className:t.switchButton},a.a.createElement("span",{className:t.switchButtonInner},a.a.createElement("span",{className:t.switchLabel},P),x&&a.a.createElement(x,{className:t.mapIcon}),a.a.createElement("span",{className:t.switchTarget},_,"/",S))),a.a.createElement(p.a,{priority:"normal",onClick:b},O)))))}
F.propTypes={classes:Object(c.shape)({root:c.string,backdrop:c.string,panel:c.string,closeButton:c.string,closeIcon:c.string,content:c.string,text:c.string,detectedLocation:c.string,title:c.string,description:c.string,actions:c.string,switchButton:c.string,switchButtonInner:c.string,switchLabel:c.string,mapIcon:c.string,switchTarget:c.string})}
var B=F}}])
//# sourceMappingURL=115.bb149e3036fbad6a8b3b.js.map