"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[95292],{95292:function(e,t,n){n.r(t),n.d(t,{ScrollableLink:function(){return Q},configureAnchors:function(){return X},default:function(){return K},goToAnchor:function(){return B},goToTop:function(){return V},removeHash:function(){return O},setLinkTags:function(){return P},setMetaTags:function(){return M}});var a=n(51438),o=n(14924),r=n(26042),i=n(69396),c=void 0,s=arguments,l=function(e,t,n){var a;return function(){var o=c,r=s,i=n&&!a;clearTimeout(a),a=setTimeout((function(){a=null,n||e.apply(o,r)}),t),i&&e.apply(o,r)}},h=function(e){var t=e.name,n=e.hash;return"___scroll-section___".concat(t||"","___").concat(n||"")},u=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=Object.keys(e).find((function(n){return e[n].name===t&&!e[n].hash}));return n?e[n]:null},f=n(89380),d=function(e){/MSIE 9/i.test(navigator.userAgent)||/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent)?(0,f.Z)(e.top,{speed:"smooth"===e.behavior?500:0}):window.scrollTo(e)},m=function(){return document.body.scrollTop||document.documentElement.scrollTop},g=function(e){var t=m(),n=e?e.getBoundingClientRect():{top:0,bottom:0},a=n.top,o=n.bottom;return{top:Math.floor(a+t),bottom:Math.floor(o+t)}},v=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=m(),a=g(e).top+t;return n>=a&&na},y=function(e,t){return!!e.contains(t)||!(t.contains(e)||!p(e,t))},w=function(e,t){var n,a;return Object.keys(e).forEach((function(o){var r=e[o].component;v(r,t)&&(a&&!y(a,r)||(a=r,n=o))})),n},b=n(99534),T=n(44622),k=n.n(T),Z=function(e){return e.getAttribute("name")||e.getAttribute("property")},A=function(e){return e.getAttribute("rel")},E=function(e){if("undefined"!==typeof document){var t=document.getElementsByTagName("meta");return k()(t).find((function(t){return Z(t)===e}))}},D=function(e){if("undefined"!==typeof document){var t=document.getElementsByTagName("link");return k()(t).find((function(t){return A(t)===e}))}},M=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.title,n=(0,b.Z)(e,["title"]);t&&(document.title=t),Object.keys(n).forEach((function(e){var t=E(e);if(n[e])if(t)t.setAttribute("content",n[e]);else{var a=document.createElement("meta");a.name=e,a.setAttribute("content",n[e]),document.getElementsByTagName("head")[0].appendChild(a)}else t&&t.parentNode.removeChild(t)}))},P=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.title,n=(0,b.Z)(e,["title"]);t&&(document.title=t),Object.keys(n).forEach((function(e){var t=D(e);if(n[e])if(t)t.setAttribute("rel",e),t.setAttribute("href",n[e]);else{var a=document.createElement("link");a.rel=e,a.setAttribute("href",n[e]),document.getElementsByTagName("head")[0].appendChild(a)}else t&&t.parentNode.removeChild(t)}))},S=function(e){if(e)return e;var t=document.getElementsByTagName("meta");return k()(t).reduce((function(e,t){return(0,i.Z)((0,r.Z)({},e),(0,o.Z)({},Z(t),t.getAttribute("content")))}),{title:document.title})},C=function(e){if(e)return e;var t=document.getElementsByTagName("link");return k()(t).reduce((function(e,t){return(0,i.Z)((0,r.Z)({},e),(0,o.Z)({},A(t),t.getAttribute("href")))}),{title:document.title})},H=n(21227),L=("".concat(window.location.origin).concat(window.location.pathname),function(){return decodeURI(window.location.hash.slice(1))}),N=function(e){var t=e.manager,n=(t.basePath,t.currentArticleData,L());return h({name:name,hash:n})},B=function(e){var t=e.anchor,n=e.affectHistory,a=e.manager,o=t.hash,r=t.name,i=t.meta,c=t.exact,s=t.link,l=t.currentArticleData,h=t.queryString,u=(t.setMeterdPWData,a.basePath),f=n?"pushState":"replaceState",d="".concat(r?"".concat(c?window.location.origin:u,"/").concat(r):u).concat(o?"#".concat(o):"");window.location.href.split("?")[0]!==d&&(window.location.href.split("?")[0].split("-"),h&&(d=d+"?"+h),window.history[f](window.history.state,"",d),l&&setTimeout((function(){(0,H.$2)(l)}),1500)),i?(M(i),s&&P(s)):a.setDefaultMetaTags()},O=function(e){var t=e.manager;window.history.replaceState(void 0,t.defaultMetaTags.title,t?t.basePath:basePath),t.setDefaultMetaTags()},W={affectHistory:!1,debounce:10,keepLastAnchorHash:!0,offset:700,scrollBehaviour:"smooth",scrollDelay:0,scrollOnImagesLoad:!1,onSectionEnter:null,meta:null,link:null,reloadOnGoingBack:!1,currentArticleData:{},queryString:null,setMeterdPWData:null},_="images:loaded",j=function e(){var t=this;(0,a.Z)(this,e),(0,o.Z)(this,"getBasePath",(function(e){var t="".concat(window.location.origin).concat(window.location.pathname).replace(/\/$/,"");return e&&Object.keys(e).forEach((function(n){!e[n].exact&&t.endsWith(e[n].name)&&(t=t.replace("/".concat(e[n].name),""))})),t})),(0,o.Z)(this,"addListeners",(function(){window.addEventListener("scroll",t.scrollHandler,!0),window.addEventListener("hashchange",t.handleHashChange)})),(0,o.Z)(this,"removeListeners",(function(){window.removeEventListener("scroll",t.scrollHandler,!0),window.removeEventListener("hashchange",t.handleHashChange)})),(0,o.Z)(this,"configure",(function(e){t.config=(0,r.Z)({},W,e),t.resetDefaultMetaTags()})),(0,o.Z)(this,"resetDefaultMetaTags",(function(){t.config.meta&&(t.defaultMetaTags=S(t.config.meta),M(t.defaultMetaTags)),t.config.link?(t.defaultMetaTags=C(t.config.link),P(t.defaultMetaTags)):t.defaultMetaTags=S()})),(0,o.Z)(this,"setDefaultMetaTags",(function(){M(t.defaultMetaTags)})),(0,o.Z)(this,"goToTop",(function(){0!==m()&&(t.forcedHash=!0,d({top:0,behavior:t.config.scrollBehaviour}))})),(0,o.Z)(this,"addAnchor",(function(e){var n=e.element,a=e.name,o=e.hash,r=e.id,i=e.meta,c=e.exact,s=e.link,l=e.currentArticleData,h=e.queryString,u=e.setMeterdPWData;0===Object.keys(t.anchors).length&&t.addListeners();var f=a||"",d=o?"#".concat(o):"";window.location.href.endsWith("".concat(f).concat(d))&&t.forceHashUpdate(),window.location.pathname.endsWith("/".concat(f))&&(t.basePathName=t.basePathName.replace("/".concat(f),""),""===t.basePathName&&(t.basePathName="/")),t.anchors[r]={id:r,component:n,name:a,hash:o,meta:i,exact:c,link:s,currentArticleData:l,queryString:h,setMeterdPWData:u},t.basePath=t.getBasePath(t.anchors),t.normalizeMetaTags()})),(0,o.Z)(this,"normalizeMetaTags",(function(){Object.keys(t.anchors).forEach((function(e){var n=t.anchors[e];if(n.hash&&!n.meta)if(n.exact||!n.name)n.meta=t.defaultMetaTags;else if(n.name){var a=u(t.anchors,n.name);a&&(n.meta=a.meta)}}))})),(0,o.Z)(this,"removeAnchor",(function(e){delete t.anchors[e],0===Object.keys(t.anchors).length&&t.removeListeners()})),(0,o.Z)(this,"onSectionChange",(function(e,n){var a=t.config.onSectionEnter,o=function(e){return e.name?e.exact?"/".concat(e.name):"".concat("/"!==t.basePathName?t.basePathName:"","/").concat(e.name):t.basePathName};if("function"===typeof a){var c=e?(0,i.Z)((0,r.Z)({},t.anchors[e]),{id:e}):{};c.path=o(c);var s=n?(0,i.Z)((0,r.Z)({},t.anchors[n]),{id:n}):{};s.path=o(s),a(c,s)}})),(0,o.Z)(this,"handleScroll",(function(){var e=t.config,n=e.offset,a=e.keepLastAnchorHash,o=e.affectHistory,r=w(t.anchors,-n),i=N({manager:t});r&&i!==r?(t.forcedHash=!0,B({anchor:t.anchors[r],affectHistory:o,manager:t}),t.onSectionChange(r,i)):r||a||(O({manager:t}),t.anchors[i]&&t.onSectionChange(null,i))})),(0,o.Z)(this,"handleHashChange",(function(e){if(t.basePath=t.getBasePath(t.anchors),t.forcedHash)t.forcedHash=!1;else{var n=N({manager:t}),a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return t.goToSection(n,e)};t.config.scrollOnImagesLoad&&!t.imagesAreLoaded?window.addEventListener(_,a,!1):a(t.config.scrollDelay)}})),(0,o.Z)(this,"goToSection",(function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=(t.anchors[e]?t.anchors[e].component:null)||document.getElementById(e),o=t.config.offset;a&&setTimeout((function(){a.currentStyle||window.getComputedStyle(a).marginTop.replace(/\D+/g,"");var e=a.getBoundingClientRect().top;d({top:e-o,behavior:t.config.scrollBehaviour})}),n)})),this.anchors={},this.forcedHash=!1,this.config=W,this.scrollHandler=l(this.handleScroll,~~this.config.debounce),this.forceHashUpdate=l(this.handleHashChange,1),this.basePath=this.getBasePath(),this.basePathName=window.location.pathname,this.imagesAreLoaded=!1,this.currentArticleData=this.config.currentArticleData,this.queryString=this.config.queryString,this.setMeterdPWData=this.config.setMeterdPWData,this.resetDefaultMetaTags(),setTimeout((function(){var e=!1,n=function(){if(!e){var t=new Event(_);window.dispatchEvent(t)}e=!0};if(t.config.scrollOnImagesLoad){t.config.scrollOnImagesLoad>1&&setTimeout(n,parseInt(t.config.scrollOnImagesLoad,10));var a=document.images,o=a.length,r=0,i=function(){++r===o&&(t.imagesAreLoaded=!0,n())};[].forEach.call(a,(function(e){e.complete?i():e.addEventListener("load",i,!1)}))}})),window.history&&window.history.pushState&&window.addEventListener("popstate",(function(){t.config.reloadOnGoingBack&&window.location.reload()}))},q=new j,x=n(4111),I=n(52951),U=n(88029),R=n(5950),z=n(85893),G=n(67294),$=n(73935),F=n(45697),J=n.n(F),K=function(e){(0,U.Z)(n,e);var t=(0,R.Z)(n);function n(e){var o;return(0,a.Z)(this,n),(o=t.call(this,e)).name=(e.name||"").replace(/^\//,"")||null,o.hash=(e.hash||"").replace(/^\#/,"")||e.children.ref||null,o.meta=e.meta||null,o.link=e.link||null,o.id=h({name:o.name,hash:o.hash}),o.currentArticleData=e.currentArticleData||null,o.queryString=e.queryString||null,o.setMeterdPWData=e.setMeterdPWData||null,o}return(0,I.Z)(n,[{key:"componentDidMount",value:function(){var e=$.findDOMNode(this.refs[Object.keys(this.refs)[0]]);q.addAnchor({element:e,name:this.name,hash:this.hash,exact:!!this.props.exact,id:this.id,meta:this.meta,link:this.link,currentArticleData:this.currentArticleData,queryString:this.queryString,setMeterdPWData:this.setMeterdPWData})}},{key:"componentWillUnmount",value:function(){q.removeAnchor(this.id)}},{key:"render",value:function(){var e=this.props,t=e.children,n=(e.name,e.hash,e.title,e.formatTitle,(0,b.Z)(e,["children","name","hash","title","formatTitle"]));return Array.isArray(t)?(0,z.jsx)("div",(0,i.Z)((0,r.Z)({ref:this.id},n),{children:G.Children.map(t,(function(e){return G.cloneElement(e,{})}))})):G.cloneElement(t,(0,r.Z)({ref:t.ref||this.id},n))}}]),n}(G.Component);(0,o.Z)(K,"propTypes",{children:J().oneOfType([J().node,J().array]),name:J().string,hash:J().string,onEnter:J().func}),K.defaultProps={};var Q=function(e){(0,U.Z)(n,e);var t=(0,R.Z)(n);function n(e){var o;return(0,a.Z)(this,n),(o=t.call(this,e)).handleClick=o.handleClick.bind((0,x.Z)(o)),o}return(0,I.Z)(n,[{key:"handleClick",value:function(){var e=this.props.href;if(e&&"/"!==e&&"#"!==e){var t=e.split("#"),n=t[0].replace(/^\//,"")||null,a=t[1]||null,o=h({name:n,hash:a});q.anchors[o]&&(B({anchor:q.anchors[o],affectHistory:!1,manager:q}),q.goToSection(o))}else O({manager:q})}},{key:"render",value:function(){var e=this.props.children;return Array.isArray(e)?(0,z.jsx)("span",{onClick:this.handleClick,children:G.Children.map(e,(function(e){return G.cloneElement(e,{})}))}):G.cloneElement(e,{onClick:this.handleClick})}}]),n}(G.Component),V=q.goToTop,X=q.configure}}]);