(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4405],{27693:function(e,n,t){"use strict";t.d(n,{Z:function(){return s}});var i=t(62756),r=t(30420),o=t.n(r),a=t(85893),s=function(){return(0,a.jsx)("div",{className:o().loader,children:(0,a.jsx)(i.Z,{radius:30,stroke:3})})}},53539:function(e,n,t){"use strict";t.r(n),t.d(n,{__N_SSP:function(){return eO},default:function(){return eI}});var i=t(67294),r=t(9008),o=t.n(r),a=t(9473),s=t(11163),c=t(75051),u=t(57347),l=t(93346),d=t(22284),f=t(19554),p=t(61017),h=t(59499),m=t(5152),v=t.n(m),g=t(94184),b=t.n(g),x=t(84483),_=t.n(x),j=t(95823),w=t(34979),y=t(74746),k=t(33609),C=t(85893),P=v()(function(){return Promise.resolve().then(t.bind(t,72132)).then(function(e){return e.ToastContainer})},{ssr:!1,loadableGenerated:{webpack:function(){return[72132]}}}),O=v()(function(){return t.e(354).then(t.bind(t,20354))},{ssr:!1,loadableGenerated:{webpack:function(){return[20354]}}}),I=(0,i.memo)(function(e){var n,t=e.children,r=(0,i.useContext)(c.F).isMobile,o=u.t.bgImage,s=u.t.headerComponentStyle,d=u.t.footerShow,f=(0,a.v9)(function(e){return e.layout.menuBarIsOnTop}),p=(0,a.v9)(function(e){return e.establishment.testModeBlock}),m=(0,a.v9)(function(e){return e.cart.giftBreakpoints}),v=s===l.zl.base;return(0,C.jsxs)("div",{className:_().host,style:o?{backgroundColor:"transparent"}:void 0,children:[p&&(0,C.jsx)("div",{children:(0,C.jsx)(k.Z,{})}),r&&(0,C.jsx)(y.Z,{isOnHead:!0}),v&&(0,C.jsx)(w.Z,{}),t,d&&(0,C.jsx)(O,{}),(0,C.jsx)(P,{className:b()((n={},(0,h.Z)(n,_().notificationInitPagePosition,!f),(0,h.Z)(n,_().noGifts,0===m.length),n)),containerId:j.i.addCart,enableMultiContainer:!0,limit:3,newestOnTop:!0,pauseOnFocusLoss:!1})]})}),N=t(12776),V=t(93549),T=t.n(V),S=t(21106),B=t(70131),M=t(66261),Z=t(70743),A=t.n(Z),E=t(63316),D=t(86172);function L(e){var n=e.category,t=e.items,r=u.t.productListItemView,o=u.t.name,s=(0,i.useContext)(c.F).isDesktop,d=(0,B.YD)({threshold:0,rootMargin:"-50% 0px -50% 0px"}),f=d.ref,p=d.inView,m=o(),v=(0,S.TL)(),g=(0,a.v9)(function(e){return e.productCard});return(0,i.useEffect)(function(){p&&!g.isOpen&&(v((0,E.fQ)(n.id)),requestIdleCallback(function(){window.history.replaceState(null,"","/".concat(n.slag).concat(location.search))}))},[n.id,p]),(0,i.useMemo)(function(){return(0,D.c)(t)?(0,C.jsx)(C.Fragment,{}):(0,C.jsxs)("section",{className:b()(A().host,(0,h.Z)({},A().desktopHost,s)),ref:f,children:[(0,C.jsx)(M.W_,{className:A().anchor,name:n.slag}),(0,C.jsxs)("h2",{className:"products-category-section__heading",id:"category-section_".concat(n.id),children:[n.name.replace(/^.*?\/\/\s*/,""),(0,D.c)(n.description)||"Академия кофе"!==m?null:(0,C.jsx)("span",{className:A().badge,children:n.description})]}),(0,C.jsx)("div",{className:b()(A().itemsList,(0,h.Z)({},A().twoColumn,r===l.XV.cofixOrder)),children:t})]})},[n,t])}var F=t(77885),G=t(4320),H=t(30536),W=t(43049),R=t(71168),Q=t(53756),q=v()(function(){return t.e(1611).then(t.bind(t,11432))},{ssr:!1,loadableGenerated:{webpack:function(){return[11432]}}}),z=(0,i.memo)(function(e){var n,t=e.className,r=e.productClassName,o=void 0===r?"":r,s=e.activeBadge,d=u.t.footerShow,f=u.t.productNotAvailablePopupView,p=(0,i.useContext)(c.F).isDesktop,m=(0,W.QT)(),v=(0,Q.$G)("common").t,g=(0,S.TL)(),x=(0,a.v9)(function(e){return e.products.all}),_=(0,a.v9)(function(e){return e.products.all}),w=S.h.getState().establishment.restaurants,y=(0,a.v9)(function(e){return e.ordering.draftOrderingRestaurantId}),k=(0,a.v9)(function(e){return e.products.notAvailablePopupOpened}),P=(0,a.v9)(function(e){return e.filters.filterByPopular}),O=(0,a.v9)(function(e){return e.filters.filterByPrice}),I=(0,a.v9)(function(e){return e.filters.filterBySorting}),N=(0,a.v9)(function(e){return e.products.categories}),V=(0,i.useMemo)(function(){return N.slice().sort(function(e,n){return e.order-n.order})},[N]),B=(0,i.useMemo)(function(){return s&&s.length?x.filter(function(e){var n;return null===(n=e.category)||void 0===n?void 0:n.name.startsWith(s)}):0!==O.length||P?x.filter(function(e){var n=(0,G.cO)(e.id);return!(O.length>0)||O.includes((null==n?void 0:n.price)||0)&&(null==n?void 0:n.available)}).filter(function(e){return!P||e.badges.map(function(e){return e.name.toLowerCase()}).some(function(e){return j.W0.popular.includes(e)})}):x},[x,P,O,s]),M=(0,i.useMemo)(function(){return B.filter(function(e){var n=(0,G.cO)(e.id);return y?!!u.t.showStopListItems||(null==n?void 0:n.available)&&(null==n?void 0:n.isValidByModifications):!!u.t.showStopListItems||1!==w.length||(null==n?void 0:n.available)})},[B,_,y]),Z=V.map(function(e){var n=M.filter(function(e){var n;return(null===(n=(0,G.cO)(e.id))||void 0===n?void 0:n.itemType)==="product"}).filter(function(n){var t;return(null===(t=n.category)||void 0===t?void 0:t.id)==e.id}),t=n.filter(function(e){var n;return!(null!==(n=e.image)&&void 0!==n&&n.large)}).map(function(e){return e.id}),i=n.sort(function(e,n){return e.order-n.order}).sort(function(e,n){return I===R.dQ.default?0:I===R.dQ.expansiveFirst?(0,G.J5)(n.id)-(0,G.J5)(e.id):I===R.dQ.cheepFirst?(0,G.J5)(e.id)-(0,G.J5)(n.id):1}).map(function(e,i){var r=t.indexOf(e.id),a=(0,G.cO)(e.id);return!a||a.price&&isNaN(a.price)||null===a.price||!a.available&&!u.t.showStopListItems&&y?null:(0,C.jsx)(F.Z,{className:o,index:i,isLast:i===n.length-1,noImageIndex:-1===r?null:r,product:e},[e.id,null==a?void 0:a.id,null==a?void 0:a.available].join("/"))}).filter(function(e){return!(0,D.c)(e)});return n.length>0?(0,C.jsx)(L,{category:e,items:i},e.id):null});return(0,C.jsxs)("main",{className:b()(T().host,void 0===t?"":t,(n={},(0,h.Z)(n,T().desktopHost,p),(0,h.Z)(n,T().noFooter,!d),n)),children:[B.length>0?Z:(0,C.jsx)("h2",{className:T().nothingFoundMessage,children:v("products.title")}),f===l.U1.cofixOrder?(0,C.jsx)(q,{isOpen:k,onClose:function(){return g((0,G.wx)(!1))},children:(0,C.jsxs)("section",{className:T().notAvailablePopup,children:[(0,C.jsx)("h2",{children:m["cofix.mainPage.productWillAvailableSoon"]}),(0,C.jsx)("div",{className:T().notAvailablePopupActions,children:(0,C.jsx)(H.J,{onClick:function(){return g((0,G.wx)(!1))},primary:!0,children:m["common.ok"]})})]})}):null]})}),J=t(49571),U=t(27693),X=v()(function(){return t.e(2485).then(t.bind(t,52485))},{ssr:!1,loadableGenerated:{webpack:function(){return[52485]}}}),K=v()(function(){return Promise.resolve().then(t.bind(t,54981))},{ssr:!1,loadableGenerated:{webpack:function(){return[54981]}}}),Y=v()(function(){return t.e(5147).then(t.bind(t,75147))},{ssr:!1,loadableGenerated:{webpack:function(){return[75147]}}}),$=v()(function(){return t.e(7741).then(t.bind(t,47741))},{ssr:!1,loading:function(){return(0,C.jsx)(U.Z,{})},loadableGenerated:{webpack:function(){return[47741]}}}),ee=v()(function(){return t.e(1837).then(t.bind(t,41837))},{ssr:!1,loadableGenerated:{webpack:function(){return[41837]}}}),en=v()(function(){return t.e(6590).then(t.bind(t,16590))},{ssr:!1,loadableGenerated:{webpack:function(){return[16590]}}}),et=(0,i.memo)(function(){var e=u.t.promotionsAvailable,n=u.t.listingsAvailable,t=u.t.giftScaleAvailable,i=u.t.activeOrderAvailable,r=u.t.mainPageDeliveryTypeEnabled,o=(0,a.v9)(function(e){return e.establishment.deliveryTypes});return(0,C.jsxs)(C.Fragment,{children:[r&&o.length>0&&(0,C.jsx)(X,{}),e&&(0,C.jsx)(N.Bz,{}),i&&(0,C.jsx)(en,{}),n&&(0,C.jsx)(N.lg,{}),(0,C.jsx)(J.Z,{}),(0,C.jsx)(z,{}),(0,C.jsx)(ee,{}),t&&(0,C.jsx)(Y,{}),(0,C.jsx)($,{}),(0,C.jsx)(K,{})]})}),ei=t(16835),er=t(41664),eo=t.n(er),ea=t(59898),es=t.n(ea),ec=t(38586),eu=t(20681),el=t(22696),ed=t(36514),ef=t(87935),ep=t.n(ef);function eh(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function em(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?eh(Object(t),!0).forEach(function(n){(0,h.Z)(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):eh(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var ev=function(e){var n=e.activeBadge,t=e.setActiveBadge,r=(0,a.v9)(function(e){return e.products.categories}),o=(0,i.useState)([]),s=o[0],c=o[1];return(0,i.useEffect)(function(){var e=[],n=[];r.forEach(function(t){var i=t.name.split(" // ")[0];n.includes(i)||(n.push(i),e.push(em(em({},t),{},{name:i})))}),c(e)},[r]),(0,C.jsx)("div",{className:ep().badges,children:s.map(function(e){return(0,C.jsxs)("button",{className:b()(ep().badge,(0,h.Z)({},ep().active,e.name===n)),onClick:function(i){e.name===n?t(void 0):t(e.name)},children:[(0,C.jsx)("div",{className:ep().round,children:(0,C.jsx)("div",{className:ep().roundBody})}),(0,C.jsx)("span",{children:e.name})]},e.name)})})},eg=v()(function(){return t.e(7741).then(t.bind(t,47741))},{ssr:!1,loadableGenerated:{webpack:function(){return[47741]}}}),eb=(0,i.memo)(function(){var e=u.t.headerTitleMainPage,n=u.t.currentPickupPointImg,t=(0,W.QT)(),r=(0,Q.$G)("common").t,o=(0,i.useState)(""),s=o[0],c=o[1],d=(0,W.S)(),p=(0,ei.Z)(d,2),m=(p[0],p[1]),v=(0,i.useState)(!1),g=v[0],x=v[1],_=(0,a.v9)(function(e){return e.products.menu});_&&Array.from((null==_?void 0:_.values())||[]).filter(function(e){return e.available&&"product"===e.itemType}).length;var j=(0,a.v9)(eu.wl.totalCartSumWithSaleSelector),w=(0,a.v9)(function(e){return e.establishment.addresses}),y=(0,a.v9)(function(e){return e.layout.isMenuView}),k=w.find(function(e){var n;return(null===(n=e.id)||void 0===n?void 0:n.toString())===f.aU.getPresetSelfPickupId()});return(0,C.jsxs)("section",{className:b()(es().host,"animate__animated animate__fadeIn"),children:[(0,C.jsx)("header",{className:b()(es().headerTitleView,"animate__animated animate__fadeIn",(0,h.Z)({},es().headerSmaller,!m)),children:(0,C.jsx)("h1",{children:y?t["cofix.mainPage.menu"]:e})}),k&&(0,C.jsx)("div",{className:b()(es().currentPickupPoint,"animate__animated animate__fadeIn"),children:(0,C.jsxs)("div",{className:es().currentPickupPointContent,children:[(0,C.jsx)("img",{alt:"current Pickup Point Img",src:n}),(0,C.jsx)("h4",{className:"animate__animated animate__fadeIn",children:null==k?void 0:k.fullAddress}),(0,C.jsx)("h3",{className:"animate__animated animate__fadeIn",children:null==k?void 0:k.name}),(null==k?void 0:k.comment)&&(0,C.jsxs)("div",{className:b()(es().currentPickupPointTime,"animate__animated animate__fadeIn"),children:[(0,C.jsxs)("svg",{fill:"none",height:"12",viewBox:"0 0 12 12",width:"12",xmlns:"http://www.w3.org/2000/svg",children:[(0,C.jsx)("path",{d:"M6 12C2.69799 12 0 9.30201 0 6C0 2.69799 2.69799 0 6 0C9.30201 0 12 2.69799 12 6C12 9.30201 9.30201 12 6 12ZM6 2.01342C3.80537 2.01342 2.01342 3.80537 2.01342 6C2.01342 8.19463 3.80537 9.98658 6 9.98658C8.19463 9.98658 9.98658 8.19463 9.98658 6C9.98658 3.80537 8.19463 2.01342 6 2.01342Z",fill:"white"}),(0,C.jsx)("path",{d:"M5.17845 8C4.96633 8 4.73064 7.92958 4.54209 7.81221C4.18855 7.60094 4 7.22535 4 6.82629V3H6.3569V4.97183L10.0101 3.25822L11 5.39437L5.6734 7.88263C5.50842 7.95305 5.34343 8 5.17845 8Z",fill:"white"})]}),(0,C.jsx)("p",{children:null==k?void 0:k.comment})]})]})}),(0,C.jsx)(ev,{activeBadge:s,setActiveBadge:c}),(0,C.jsx)(J.Z,{activeBadge:s,filtersClassName:b()(es().menuBarFilters,"animate__animated animate__fadeIn"),linksClassName:b()(es().menuBarLinks,"animate__animated animate__fadeIn"),productListItemView:l.XV.cofixOrder}),(0,C.jsx)(z,{activeBadge:s,className:b()(es().products,"animate__animated animate__fadeIn"),productClassName:b()(es().product,"animate__animated animate__fadeIn")}),!y&&j>0&&(0,C.jsx)("section",{className:b()(es().cartWidget,es().cartWidgetTwoColumnView),children:(0,C.jsx)(eo(),{href:"/cart",legacyBehavior:!0,shallow:!0,children:(0,C.jsxs)(H.J,{className:b()(es().cartWidgetTwoColumnViewHost),onClick:function(){return x(!0)},primary:!0,children:[(0,C.jsx)("div",{children:r("order")}),(0,C.jsx)("div",{className:es().cartWidgetTwoColumnViewDivider}),(0,C.jsx)("div",{children:(0,ec.xG)(j)})]})})}),(0,C.jsx)(eg,{}),g&&(0,C.jsx)("section",{className:b()(es().backdropLoading,"animate__animated animate__fadeIn"),children:(0,C.jsx)(ed.Z,{color:(0,el.y)("--primary-color"),radius:40,stroke:3})})]})}),ex=t(21525),e_=t.n(ex),ej=v()(function(){return t.e(5147).then(t.bind(t,75147))},{ssr:!1,loadableGenerated:{webpack:function(){return[75147]}}}),ew=v()(function(){return t.e(6590).then(t.bind(t,16590))},{ssr:!1,loadableGenerated:{webpack:function(){return[16590]}}}),ey=v()(function(){return Promise.resolve().then(t.bind(t,30047))},{ssr:!1,loadableGenerated:{webpack:function(){return[30047]}}});function ek(){return(0,C.jsxs)("section",{className:e_().desktopHost,children:[(0,C.jsx)(J.Z,{}),(0,C.jsx)(N.Bz,{}),(0,C.jsx)(ew,{}),(0,C.jsx)(N.lg,{}),(0,C.jsx)(z,{}),(0,C.jsx)(ej,{}),(0,C.jsx)(ey,{})]})}var eC=t(4298),eP=t.n(eC),eO=!0;function eI(e){var n=e.origin,t=u.t.mainPageView,r=u.t.seoHomePageDescription,h=u.t.name,m=u.t.seoHomePageTitle,v=u.t.seoHomePageTitleShowBrandName,g=u.t.advCakeCode,b=(0,i.useContext)(c.F),x=b.isDesktop,_=b.isMobile,j=(0,s.useRouter)(),w=j.query,y=(0,a.v9)(function(e){return e.products.all}),k=(0,a.v9)(function(e){return e.products.categories}),P=(0,a.v9)(function(e){return e.establishment.info}),O=(0,a.v9)(function(e){return e.location.availableCities}),N=(0,a.v9)(function(e){return e.location.currentCity}),V=(0,i.useMemo)(function(){if(0===y.length)return{notFoundException:!1,seoTitle:"",seoDescription:"",seoImage:""};var e,t,i=w.index&&w.index[1]?y.find(function(e){return e.url===w.index[1]}):null,o=w.index&&w.index[0]?k.find(function(e){return e.slag===w.index[0]}):null,a=O.length>1,s=v?"| ".concat(h()):"",c=(null==P?void 0:P.seoTitle)||(a&&N?"".concat(m,"  ").concat(s," ").concat(N.name):"".concat(m," ").concat(s)),l=(null==P?void 0:P.seoDescription)||r,d=(null==P?void 0:P.seoImage)||"".concat(n).concat(u.t.logoUrl());return i&&(c=i.seoTitle,l=i.seoDescription,null!==(e=i.image)&&void 0!==e&&e.medium&&(d=null===(t=i.image)||void 0===t?void 0:t.medium)),{notFoundException:!!(w.index&&w.index[0]&&!o||w.index&&w.index[1]&&!i),seoTitle:c,seoDescription:l,seoImage:d}},[y,O.length,k,N,h,n,w.index,r,m,v,null==P?void 0:P.seoDescription,null==P?void 0:P.seoImage,null==P?void 0:P.seoTitle]);return(0,i.useEffect)(function(){d.G||setTimeout(function(){f.yD.mainPageVisit()},2e3)},[]),(0,i.useEffect)(function(){if(!d.G&&0!==y.length){var e=j.query.index&&j.query.index[1],n=j.query.index&&j.query.index[0],t=y.find(function(t){var i;return e&&t.url===e&&n&&(null===(i=t.category)||void 0===i?void 0:i.slag)===n});t&&p.Z.openProductCard(t)}},[y]),(0,C.jsxs)(C.Fragment,{children:[t===l.QH.base&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(o(),{children:[(0,C.jsx)("title",{children:V.seoTitle}),(0,C.jsx)("meta",{content:(null==P?void 0:P.seoDescription)||r,name:"description"}),(0,C.jsx)("meta",{content:V.seoTitle,property:"og:title"}),(0,C.jsx)("meta",{content:V.seoDescription,property:"og:description"}),(0,C.jsx)("meta",{content:V.seoImage,property:"og:image"})]}),(0,C.jsx)(I,{children:(0,C.jsxs)(C.Fragment,{children:[_&&(0,C.jsx)(et,{}),x&&(0,C.jsx)(ek,{}),(0,D.c)(g)?null:(0,C.jsx)(eP(),{async:!0,dangerouslySetInnerHTML:{__html:"\n        window.advcake_data = window.advcake_data || [];window.advcake_data.push({pageType: 1,user: {email: ''}});"},id:"".concat(g,"_index"),strategy:"afterInteractive"})]})})]}),t===l.QH.cofixOrder&&(0,C.jsx)(eb,{})]})}},80862:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/[[...index]]",function(){return t(53539)}])},21525:function(){},70743:function(e){e.exports={host:"T_bpB7",notInView:"_3kJlew",anchor:"_10iRlB",twoColumn:"_2fTS8q",desktopHost:"_2XfQ4M",itemsList:"_1HjFB1",badge:"_2gHIcK"}},30420:function(e){e.exports={loader:"_1BAUtw"}},93549:function(e){e.exports={host:"_3u8-Uw",nothingFoundMessage:"lNOgE9",noFooter:"_1SOVkT",notAvailablePopup:"_2XHrNW",notAvailablePopupActions:"_3NWkh9",desktopHost:"_1AtE31"}},59898:function(e){e.exports={host:"_25mHEm",headerTitleView:"_1zwisa",headerSmaller:"_2lePfR",positionsCount:"x2Xf7V",scaleDivider:"_1iJLGe",menuBarLinks:"gRj_Ig",menuBarFilters:"_3geZjR",products:"_1P4yL1",product:"_3ePPhn",productScale:"_3VVnXd",fadeAll:"T-87x7",cartWidget:"_2zR1Ss",cartWidgetTwoColumnView:"_2BzoYQ",cartWidgetTwoColumnViewHost:"_11iF1r",cartWidgetTwoColumnViewDivider:"_1MhhIe",currentPickupPoint:"_1RCS-h",scaleImg:"_2irc1n",currentPickupPointContent:"_2lteOU",currentPickupPointTime:"_1EqU56",backdropLoading:"_308KKw"}},87935:function(e){e.exports={badge:"_1_Hn0R",active:"_3wQxqg",round:"_1nKEu5",roundBody:"g4PAOE",badges:"_23Lrzb"}},84483:function(e){e.exports={host:"gJ_uxB",notificationInitPagePosition:"_2fy67u",noGifts:"_20Idzk"}},70131:function(e,n,t){"use strict";t.d(n,{YD:function(){return h}});var i=t(67294);function r(){return(r=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e}).apply(this,arguments)}function o(e,n){return(o=Object.setPrototypeOf||function(e,n){return e.__proto__=n,e})(e,n)}var a=new Map,s=new WeakMap,c=0,u=void 0;function l(e,n,t,i){if(void 0===t&&(t={}),void 0===i&&(i=u),void 0===window.IntersectionObserver&&void 0!==i){var r=e.getBoundingClientRect();return n(i,{isIntersecting:i,target:e,intersectionRatio:"number"==typeof t.threshold?t.threshold:0,time:0,boundingClientRect:r,intersectionRect:r,rootBounds:r}),function(){}}var o=function(e){var n=Object.keys(e).sort().filter(function(n){return void 0!==e[n]}).map(function(n){var t;return n+"_"+("root"===n?(t=e.root)?(s.has(t)||(c+=1,s.set(t,c.toString())),s.get(t)):"0":e[n])}).toString(),t=a.get(n);if(!t){var i,r=new Map,o=new IntersectionObserver(function(n){n.forEach(function(n){var t,o=n.isIntersecting&&i.some(function(e){return n.intersectionRatio>=e});e.trackVisibility&&void 0===n.isVisible&&(n.isVisible=o),null==(t=r.get(n.target))||t.forEach(function(e){e(o,n)})})},e);i=o.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),t={id:n,observer:o,elements:r},a.set(n,t)}return t}(t),l=o.id,d=o.observer,f=o.elements,p=f.get(e)||[];return f.has(e)||f.set(e,p),p.push(n),d.observe(e),function(){p.splice(p.indexOf(n),1),0===p.length&&(f.delete(e),d.unobserve(e)),0===f.size&&(d.disconnect(),a.delete(l))}}var d=["children","as","tag","triggerOnce","threshold","root","rootMargin","onChange","skip","trackVisibility","delay","initialInView","fallbackInView"];function f(e){return"function"!=typeof e.children}var p=function(e){function n(n){var t;return(t=e.call(this,n)||this).node=null,t._unobserveCb=null,t.handleNode=function(e){!t.node||(t.unobserve(),e||t.props.triggerOnce||t.props.skip||t.setState({inView:!!t.props.initialInView,entry:void 0})),t.node=e||null,t.observeNode()},t.handleChange=function(e,n){e&&t.props.triggerOnce&&t.unobserve(),f(t.props)||t.setState({inView:e,entry:n}),t.props.onChange&&t.props.onChange(e,n)},t.state={inView:!!n.initialInView,entry:void 0},t}(t=n).prototype=Object.create(e.prototype),t.prototype.constructor=t,o(t,e);var t,a=n.prototype;return a.componentDidUpdate=function(e){(e.rootMargin!==this.props.rootMargin||e.root!==this.props.root||e.threshold!==this.props.threshold||e.skip!==this.props.skip||e.trackVisibility!==this.props.trackVisibility||e.delay!==this.props.delay)&&(this.unobserve(),this.observeNode())},a.componentWillUnmount=function(){this.unobserve(),this.node=null},a.observeNode=function(){if(this.node&&!this.props.skip){var e=this.props,n=e.threshold,t=e.root,i=e.rootMargin,r=e.trackVisibility,o=e.delay,a=e.fallbackInView;this._unobserveCb=l(this.node,this.handleChange,{threshold:n,root:t,rootMargin:i,trackVisibility:r,delay:o},a)}},a.unobserve=function(){this._unobserveCb&&(this._unobserveCb(),this._unobserveCb=null)},a.render=function(){if(!f(this.props)){var e=this.state,n=e.inView,t=e.entry;return this.props.children({inView:n,entry:t,ref:this.handleNode})}var o=this.props,a=o.children,s=o.as,c=o.tag,u=function(e,n){if(null==e)return{};var t,i,r={},o=Object.keys(e);for(i=0;i<o.length;i++)t=o[i],n.indexOf(t)>=0||(r[t]=e[t]);return r}(o,d);return i.createElement(s||c||"div",r({ref:this.handleNode},u),a)},n}(i.Component);function h(e){var n=void 0===e?{}:e,t=n.threshold,r=n.delay,o=n.trackVisibility,a=n.rootMargin,s=n.root,c=n.triggerOnce,u=n.skip,d=n.initialInView,f=n.fallbackInView,p=i.useRef(),h=i.useState({inView:!!d}),m=h[0],v=h[1],g=i.useCallback(function(e){void 0!==p.current&&(p.current(),p.current=void 0),!u&&e&&(p.current=l(e,function(e,n){v({inView:e,entry:n}),n.isIntersecting&&c&&p.current&&(p.current(),p.current=void 0)},{root:s,rootMargin:a,threshold:t,trackVisibility:o,delay:r},f))},[Array.isArray(t)?t.toString():t,s,a,c,u,o,f,r]);(0,i.useEffect)(function(){p.current||!m.entry||c||u||v({inView:!!d})});var b=[g,m.inView,m.entry];return b.ref=b[0],b.inView=b[1],b.entry=b[2],b}p.displayName="InView",p.defaultProps={threshold:0,triggerOnce:!1,initialInView:!1}}},function(e){e.O(0,[1664,8498,6261,9936,4794,7983,2860,3841,9803,9774,2888,179],function(){return e(e.s=80862)}),_N_E=e.O()}]);