import{ec as xe,d0 as me,r as pe,b9 as be,j as h,p as ge}from"./index-CNnTZTc7.js";var U={},P={exports:{}},T={exports:{}},w={exports:{}},z;function $(){return z||(z=1,function(t){function n(s){"@babel/helpers - typeof";return t.exports=n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t.exports.__esModule=!0,t.exports.default=t.exports,n(s)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}(w)),w.exports}var I={exports:{}},B;function Se(){return B||(B=1,function(t){var n=$().default;function s(e,o){if(n(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,o||"default");if(n(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(e)}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}(I)),I.exports}var W;function ce(){return W||(W=1,function(t){var n=$().default,s=Se();function e(o){var r=s(o,"string");return n(r)=="symbol"?r:r+""}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports}(T)),T.exports}var F;function Pe(){return F||(F=1,function(t){var n=ce();function s(e,o,r){return(o=n(o))in e?Object.defineProperty(e,o,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[o]=r,e}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}(P)),P.exports}var q={exports:{}},C={exports:{}},A={exports:{}},K;function fe(){return K||(K=1,function(t){function n(s,e){(e==null||e>s.length)&&(e=s.length);for(var o=0,r=Array(e);o<e;o++)r[o]=s[o];return r}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}(A)),A.exports}var G;function Te(){return G||(G=1,function(t){var n=fe();function s(e){if(Array.isArray(e))return n(e)}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}(C)),C.exports}var E={exports:{}},J;function we(){return J||(J=1,function(t){function n(s){if(typeof Symbol<"u"&&s[Symbol.iterator]!=null||s["@@iterator"]!=null)return Array.from(s)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}(E)),E.exports}var O={exports:{}},Q;function Ie(){return Q||(Q=1,function(t){var n=fe();function s(e,o){if(e){if(typeof e=="string")return n(e,o);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,o):void 0}}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}(O)),O.exports}var R={exports:{}},X;function qe(){return X||(X=1,function(t){function n(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}(R)),R.exports}var Y;function Ce(){return Y||(Y=1,function(t){var n=Te(),s=we(),e=Ie(),o=qe();function r(a){return n(a)||s(a)||e(a)||o()}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}(q)),q.exports}var k={exports:{}},Z;function Ae(){return Z||(Z=1,function(t){function n(s,e){if(!(s instanceof e))throw new TypeError("Cannot call a class as a function")}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}(k)),k.exports}var N={exports:{}},j={exports:{}},ee;function de(){return ee||(ee=1,function(t){function n(s){if(s===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return s}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}(j)),j.exports}var te;function Ee(){return te||(te=1,function(t){var n=$().default,s=de();function e(o,r){if(r&&(n(r)=="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return s(o)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports}(N)),N.exports}var M={exports:{}},re;function Oe(){return re||(re=1,function(t){function n(s){return t.exports=n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},t.exports.__esModule=!0,t.exports.default=t.exports,n(s)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}(M)),M.exports}var L={exports:{}},oe;function Re(){return oe||(oe=1,function(t){var n=ce();function s(o,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(o,n(i.key),i)}}function e(o,r,a){return r&&s(o.prototype,r),a&&s(o,a),Object.defineProperty(o,"prototype",{writable:!1}),o}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports}(L)),L.exports}var H={exports:{}},V={exports:{}},se;function ke(){return se||(se=1,function(t){function n(s,e){return t.exports=n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,r){return o.__proto__=r,o},t.exports.__esModule=!0,t.exports.default=t.exports,n(s,e)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}(V)),V.exports}var ne;function Ne(){return ne||(ne=1,function(t){var n=ke();function s(e,o){if(typeof o!="function"&&o!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(o&&o.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),o&&n(e,o)}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}(H)),H.exports}var D={exports:{}};/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */var ae;function je(){return ae||(ae=1,function(t){(function(){var n={}.hasOwnProperty;function s(){for(var r="",a=0;a<arguments.length;a++){var i=arguments[a];i&&(r=o(r,e(i)))}return r}function e(r){if(typeof r=="string"||typeof r=="number")return r;if(typeof r!="object")return"";if(Array.isArray(r))return s.apply(null,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var a="";for(var i in r)n.call(r,i)&&r[i]&&(a=o(a,i));return a}function o(r,a){return a?r?r+" "+a:r+a:r}t.exports?(s.default=s,t.exports=s):window.classNames=s})()}(D)),D.exports}var b={},ie;function Me(){if(ie)return b;ie=1,Object.defineProperty(b,"__esModule",{value:!0}),b.default=void 0;var t=function(e){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:100,r,a;return function(){var i=+new Date,u=!!r&&i<r+o;u?(clearTimeout(a),a=setTimeout(function(){r=i,e()},o)):(r=i,e())}},n=t;return b.default=n,b}var l=be;Object.defineProperty(U,"__esModule",{value:!0});var ye=U.default=void 0,Le=l(xe()),g=l(Pe()),He=l(Ce()),Ve=l(Ae()),De=l(Ee()),Ue=l(Oe()),$e=l(de()),ue=l(Re()),ze=l(Ne()),d=l(me),S=l(pe),le=l(je()),Be=l(Me());function We(t,n){return t.length===n.length&&t.every(function(s,e){return s===n[e]})}var Fe=function(t){(0,ze.default)(n,t),(0,ue.default)(n,null,[{key:"propTypes",get:function(){return{items:d.default.arrayOf(d.default.string).isRequired,currentClassName:d.default.string.isRequired,scrolledPastClassName:d.default.string,style:d.default.object,componentTag:d.default.oneOfType([d.default.string,d.default.elementType]),offset:d.default.number,rootEl:d.default.string,onUpdate:d.default.func}}},{key:"defaultProps",get:function(){return{items:[],currentClassName:"",style:{},componentTag:"ul",offset:0,onUpdate:function(){}}}}]);function n(s){var e;return(0,Ve.default)(this,n),e=(0,De.default)(this,(0,Ue.default)(n).call(this,s)),e.state={targetItems:[],inViewState:[],isScrolledPast:[]},e._handleSpy=e._handleSpy.bind((0,$e.default)(e)),e}return(0,ue.default)(n,[{key:"_initSpyTarget",value:function(e){var o=e.map(function(r){return document.getElementById(r)});return o}},{key:"_fillArray",value:function(e,o){for(var r=[],a=0,i=e.length;a<i;a++)r[a]=o;return r}},{key:"_isScrolled",value:function(){return this._getScrollDimension().scrollTop>0}},{key:"_getScrollDimension",value:function(){var e=document,o=this.props.rootEl,r=o?e.querySelector(o).scrollTop:e.documentElement.scrollTop||e.body.parentNode.scrollTop||e.body.scrollTop,a=o?e.querySelector(o).scrollHeight:e.documentElement.scrollHeight||e.body.parentNode.scrollHeight||e.body.scrollHeight;return{scrollTop:r,scrollHeight:a}}},{key:"_getElemsViewState",value:function(e){for(var o=[],r=[],a=[],i=e||this.state.targetItems,u=!1,c=0,_=i.length;c<_;c++){var p=i[c],y=u?!1:this._isInView(p);y?(u=!0,o.push(p)):r.push(p);var f=c===_-1,x=this._isScrolled(),v=this._isAtBottom()&&this._isInView(p)&&!y&&f&&x;v&&(r.pop(),r.push.apply(r,(0,He.default)(o)),o=[p],a=this._fillArray(a,!1),y=!0),a.push(y)}return{inView:o,outView:r,viewStatusList:a,scrolledPast:this.props.scrolledPastClassName&&this._getScrolledPast(a)}}},{key:"_isInView",value:function(e){if(!e)return!1;var o=this.props,r=o.rootEl,a=o.offset,i;r&&(i=document.querySelector(r).getBoundingClientRect());var u=e.getBoundingClientRect(),c=r?i.height:window.innerHeight,_=this._getScrollDimension(),p=_.scrollTop,y=p+c,f=r?u.top+p-i.top+a:u.top+p+a,x=f+e.offsetHeight;return f<y&&x>p}},{key:"_isAtBottom",value:function(){var e=this.props.rootEl,o=this._getScrollDimension(),r=o.scrollTop,a=o.scrollHeight,i=e?document.querySelector(e).getBoundingClientRect().height:window.innerHeight,u=r+i>=a;return u}},{key:"_getScrolledPast",value:function(e){if(!e.some(function(a){return a}))return e;var o=!1,r=e.map(function(a){return a&&!o?(o=!0,!1):!o});return r}},{key:"_spy",value:function(e){var o=this,r=this._getElemsViewState(e),a=this.state.inViewState;this.setState({inViewState:r.viewStatusList,isScrolledPast:r.scrolledPast},function(){o._update(a)})}},{key:"_update",value:function(e){We(this.state.inViewState,e)||this.props.onUpdate(this.state.targetItems[this.state.inViewState.indexOf(!0)])}},{key:"_handleSpy",value:function(){(0,Be.default)(this._spy(),100)}},{key:"_initFromProps",value:function(){var e=this._initSpyTarget(this.props.items);this.setState({targetItems:e}),this._spy(e)}},{key:"offEvent",value:function(){var e=this.props.rootEl?document.querySelector(this.props.rootEl):window;e.removeEventListener("scroll",this._handleSpy)}},{key:"onEvent",value:function(){var e=this.props.rootEl?document.querySelector(this.props.rootEl):window;e.addEventListener("scroll",this._handleSpy)}},{key:"componentDidMount",value:function(){this._initFromProps(),this.onEvent()}},{key:"componentWillUnmount",value:function(){this.offEvent()}},{key:"UNSAFE_componentWillReceiveProps",value:function(){this._initFromProps()}},{key:"render",value:function(){var e=this,o=this.props.componentTag,r=this.props,a=r.children,i=r.className,u=r.scrolledPastClassName,c=r.style,_=0,p=S.default.Children.map(a,function(f,x){var v;if(!f)return null;var ve=f.type,he=u&&e.state.isScrolledPast[x],_e=(0,le.default)((v={},(0,g.default)(v,"".concat(f.props.className),f.props.className),(0,g.default)(v,"".concat(e.props.currentClassName),e.state.inViewState[x]),(0,g.default)(v,"".concat(e.props.scrolledPastClassName),he),v));return S.default.createElement(ve,(0,Le.default)({},f.props,{className:_e,key:_++}),f.props.children)}),y=(0,le.default)((0,g.default)({},"".concat(i),i));return S.default.createElement(o,{className:y,style:c},p)}}]),n}(S.default.Component);ye=U.default=Fe;const Ke="_sidebarListItem_199bd_88",Ge={sidebarListItem:Ke},Je=({children:t,className:n="",dataGtm:s=""})=>h.jsx("li",{className:`${n} ${Ge.sidebarListItem}`,"data-gtm":s,children:t}),Qe="_inactive_zagyi_88",Xe="_listItem_zagyi_88",Ye="_active_zagyi_100",Ze="_heading4_zagyi_115",et="_sidebarListItems_zagyi_123",m={inactive:Qe,listItem:Xe,active:Ye,heading4:Ze,sidebarListItems:et},rt=({className:t="",dataGtm:n="",items:s=[]})=>{const e=s.reduce((i,u)=>i.push(u.id)&&i,[]),[o,r]=pe.useState(!1),a=()=>{const i=window.matchMedia("(max-width: 1700px)"),u=window.location.href.substring(window.location.href.lastIndexOf("#")+1);if(o&&i.matches){const c=document.getElementById(u);window==null||window.scrollTo({top:c.offsetTop-156,behavior:"smooth"}),r(!1)}};return h.jsx(h.Fragment,{children:h.jsx(ye,{className:`${t} ${m.sidebarListItems}`,currentClassName:m.active,items:e,onUpdate:a,scrolledPastClassName:m.inactive,children:s.map(({id:i,text:u},c)=>h.jsx(Je,{className:m.sidebarListItem,dataGtm:n,children:i!=="plan-details"?h.jsx("a",{className:m.listItem,href:`#${i}`,onClick:()=>r(!0),children:u}):h.jsx(ge,{className:m.heading4,text:u})},i))})})};export{rt as S}; //# sourceMappingURL=index-Ce066G8A.js.map