{"version":3,"sources":["webpack:///./src/feature/hero/hero.js","webpack:///./node_modules/core-js/modules/es.object.get-prototype-of.js","webpack:///./node_modules/core-js/modules/es.object.set-prototype-of.js"],"names":["Hero","element","_this","_classCallCheck","this","_possibleConstructorReturn","_getPrototypeOf","call","initDomCache","el","ticking","hero","body","window","features","dom","expandHero","querySelector","heroAsset","heroContent","heroBackground","document","querySelectorAll","heroSlideupContent","addClick","log","BaseFeature","_this2","IntersectionObserver","entries","forEach","entry","classList","toggle","intersectionRatio","root","rootMargin","threshold","observe","addEventListener","yPosContent","pageYOffset","yPosImage","style","top","bottom","elementState","getAttribute","setAttribute","$","__webpack_require__","fails","toObject","nativeGetPrototypeOf","CORRECT_PROTOTYPE_GETTER","target","stat","forced","sham","getPrototypeOf","it","setPrototypeOf"],"mappings":"m+BAEMA,cACL,SAAAA,EAAYC,GAAS,IAAAC,EAAA,mGAAAC,CAAAC,KAAAJ,IACpBE,EAAAG,EAAAD,KAAAE,EAAAN,GAAAO,KAAAH,KAAMH,KAEDO,eAELN,EAAKO,GAAKR,EACVC,EAAKQ,SAAU,EACfR,EAAKS,KAAOT,EAAKO,GACjBP,EAAKU,KAAOC,OAAOC,SAASC,IAAIH,KAChCV,EAAKc,WAAad,EAAKO,GAAGQ,cAAc,0BACxCf,EAAKgB,UAAYhB,EAAKO,GAAGQ,cAAc,yBACvCf,EAAKiB,YAAcjB,EAAKO,GAAGQ,cAAc,2BACzCf,EAAKkB,eAAiBC,SAASC,iBAAiB,kBAChDpB,EAAKqB,mBAAqBrB,EAAKO,GAAGQ,cAAc,kCAChDf,EAAKsB,WACLtB,EAAKuB,MAfevB,wPADHwB,iDAoBP,IAAAC,EAAAvB,KAGJe,EAAcf,KAAKmB,mBAMzB,GAAInB,KAAKmB,mBAAoB,CAOX,IAAIK,qBAZtB,SAAwBC,GACvBA,EAAQC,QAAQ,SAACC,GAChBZ,EAAYa,UAAUC,OAAO,aAAcF,EAAMG,kBAAoB,MAKlC,CACnCC,KAAM,KACNC,WAAY,QACZC,UAAW,IAIHC,QAAQnB,GAIdf,KAAKe,aAAef,KAAKc,WAC5BL,OAAO0B,iBAAiB,SAAU,WAEjC,IAAMC,EAAc,EAAI3B,OAAO4B,YAAc,GACvCC,EAAY,EAAI7B,OAAO4B,YAAc,GAG3Cd,EAAKR,YAAYwB,MAAMC,IAAM,GAAKJ,EAAc,IAChDb,EAAKT,UAAUyB,MAAME,OAAS,EAAIH,EAAY,MAK5CtC,KAAKY,YACRZ,KAAKY,WAAWuB,iBAAiB,QAAS,WACzCZ,EAAKlB,GAAGuB,UAAUC,OAAO,qBAGzB,IAAIa,EAAenB,EAAKX,WAAW+B,aAAa,iBAE/CD,EADoB,SAAjBA,EACY,QAEA,OAEhBnB,EAAKX,WAAWgC,aAAa,gBAAiBF,0CAMnC9C,iCC1Ef,IAAAiD,EAAQC,EAAQ,GAChBC,EAAYD,EAAQ,GACpBE,EAAeF,EAAQ,IACvBG,EAA2BH,EAAQ,IACnCI,EAA+BJ,EAAQ,KAKvCD,EAAA,CAAGM,OAAA,SAAAC,MAAA,EAAAC,OAJHN,EAAA,WAA6CE,EAAA,KAI1CK,MAAAJ,GAA6F,CAChGK,eAAA,SAAAC,GACA,OAAAP,EAAAD,EAAAQ,4BCXQV,EAAQ,EAKhBD,CAAA,CAAGM,OAAA,SAAAC,MAAA,GAA+B,CAClCK,eALqBX,EAAQ","file":"26-0b765a58.pkg.js","sourcesContent":["import BaseFeature from '../../foundation/base/base';\r\n\r\nclass Hero extends BaseFeature {\r\n\tconstructor(element) {\r\n\t\tsuper(element);\r\n\r\n\t\tthis.initDomCache();\r\n\r\n\t\tthis.el = element;\r\n\t\tthis.ticking = false;\r\n\t\tthis.hero = this.el;\r\n\t\tthis.body = window.features.dom.body;\r\n\t\tthis.expandHero = this.el.querySelector('[data-js=\"expandHero\"]');\r\n\t\tthis.heroAsset = this.el.querySelector('[data-js=\"heroAsset\"]');\r\n\t\tthis.heroContent = this.el.querySelector('[data-js=\"heroContent\"]');\r\n\t\tthis.heroBackground = document.querySelectorAll('.m-hero__image');\r\n\t\tthis.heroSlideupContent = this.el.querySelector('[data-js=\"heroSlideupContent\"]');\r\n\t\tthis.addClick();\r\n\t\tthis.log();\r\n\t}\r\n\r\n\r\n\taddClick() {\r\n\t\t// Observe the target\r\n\r\n\t\tconst heroContent = this.heroSlideupContent;\r\n\t\tfunction onIntersection(entries) {\r\n\t\t\tentries.forEach((entry) => {\r\n\t\t\t\theroContent.classList.toggle('is-visible', entry.intersectionRatio > 0);\r\n\t\t\t});\r\n\t\t}\r\n\t\tif (this.heroSlideupContent) {\r\n\t\t\t// configure the observer\r\n\t\t\tconst intersectionObserverOptions = {\r\n\t\t\t\troot: null,\r\n\t\t\t\trootMargin: '150px',\r\n\t\t\t\tthreshold: 1.0\r\n\t\t\t};\r\n\t\t\tconst observer = new IntersectionObserver(onIntersection, intersectionObserverOptions);\r\n\t\t\t// provide the observer with a target\r\n\t\t\tobserver.observe(heroContent);\r\n\t\t}\r\n\r\n\t\t// If both elements are used\r\n\t\tif (this.heroContent && this.heroAsset) {\r\n\t\t\twindow.addEventListener('scroll', () => {\r\n\t\t\t\t// Calculate the speed based on the scroll\r\n\t\t\t\tconst yPosContent = 0 - window.pageYOffset / 30;\r\n\t\t\t\tconst yPosImage = 0 - window.pageYOffset / 30;\r\n\r\n\t\t\t\t// Apply the calculated value\r\n\t\t\t\tthis.heroContent.style.top = 50 + yPosContent + '%';\r\n\t\t\t\tthis.heroAsset.style.bottom = 0 + yPosImage + '%';\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\t// Expand submenu\r\n\t\tif (this.expandHero) {\r\n\t\t\tthis.expandHero.addEventListener('click', () => {\r\n\t\t\t\tthis.el.classList.toggle('is-folded-content');\r\n\r\n\t\t\t\t// Accessibility\r\n\t\t\t\tlet elementState = this.expandHero.getAttribute('aria-expanded');\r\n\t\t\t\tif (elementState === 'true') {\r\n\t\t\t\t\telementState = 'false';\r\n\t\t\t\t} else {\r\n\t\t\t\t\telementState = 'true';\r\n\t\t\t\t}\r\n\t\t\t\tthis.expandHero.setAttribute('aria-expanded', elementState);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport default Hero;\r\n","var $ = require('../internals/export');\nvar fails = require('../internals/fails');\nvar toObject = require('../internals/to-object');\nvar nativeGetPrototypeOf = require('../internals/object-get-prototype-of');\nvar CORRECT_PROTOTYPE_GETTER = require('../internals/correct-prototype-getter');\nvar FAILS_ON_PRIMITIVES = fails(function () { nativeGetPrototypeOf(1); });\n\n// `Object.getPrototypeOf` method\n// https://tc39.github.io/ecma262/#sec-object.getprototypeof\n$({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !CORRECT_PROTOTYPE_GETTER }, {\n getPrototypeOf: function getPrototypeOf(it) {\n return nativeGetPrototypeOf(toObject(it));\n }\n});\n\n","var $ = require('../internals/export');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\n\n// `Object.setPrototypeOf` method\n// https://tc39.github.io/ecma262/#sec-object.setprototypeof\n$({ target: 'Object', stat: true }, {\n setPrototypeOf: setPrototypeOf\n});\n"],"sourceRoot":""}