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AK,CAACzB,MAAM,GAAG,MAAM;MAC5B;IACF,CAAC;IACD,IAAI,CAACD,cAAc,GAAGkD,qBAAqB,CAACH,IAAI,CAAC;EAChD;AACH;AAEA,+DAAelD,sBAAsB","sources":["webpack://Alster/./app/components/expandable-content-large/expandable-content-large.js"],"sourcesContent":["class ExpandableContentLarge {\n\tconstructor(elem) {\n\t\tthis.elem = elem\n\t\tthis.animationFrame;\n\t\tthis.height = 0;\n\t\tthis.duration = 300;\n\n\n\t\tif (this.isSupportingIO()) {\n\t\t\tthis.observer = new IntersectionObserver((entry) => {\n\t\t\t\tif(entry[0].isIntersecting) {\n\t\t\t\t\twindow.addEventListener('resize', () => this.onResize(this.elem))\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\twindow.removeEventListener('resize', () => this.onResize(this.elem))\n\t\t\t\t}\n\t\t\t})\n\t\n\t\t\tthis.observer.observe(this.elem[0])\n\t\t} \n\n\t\tthis.elem.find('.expandable-content-large__title').click(() => {\n\t\t\tthis.eventClick(this.elem)\n\t\t})\n\t}\n\n\tonResize(elem) {\n\t\tif (elem.hasClass('open')) {\n\t\t\tconst content = $(elem.find('.expandable-content-large__content')[0])\n\n\t\t\tif(this.isSupportingIO()) {\n\t\t\t\tcontent.css({'maxHeight': this.getInnerHeight(content)})\n\t\t\t}\n\t\t}\n\t}\n\n\tisSupportingIO() {\n\t\tif ('IntersectionObserver' in window &&\n\t\t\t'IntersectionObserverEntry' in window &&\n\t\t\t'intersectionRatio' in window.IntersectionObserverEntry.prototype) {\n\n\t\t\tif (!('isIntersecting' in window.IntersectionObserverEntry.prototype)) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t}\n\n\teventClick(elem) {\n\t\tconst [content] = elem.find('.expandable-content-large__content');\n\n\t\t\n\t\tif(elem.hasClass('open')) {\n\t\t\tthis.animateContent(content, 0, false, elem)\n\t\t\t\n\t\t} else {\n\t\t\telem.addClass('open')\n\t\t\tthis.height = content.offsetHeight !== 0 ? content.offsetHeight : this.height;\n\t\t\tcontent.style.height = 0;\n\t\t\tthis.animateContent(content, this.height, true, elem)\n\t\t}\n\t}\n\n\tgetInnerHeight(content) {\n\t\tlet innerHeight = 0;\n\t\t\n\t\tcontent.children().toArray().forEach((child, i) => {\n\t\t\tconst style = child.currentStyle || window.getComputedStyle(child);\n\t\t\tinnerHeight += child.scrollHeight + this.parseStyle(style.marginTop, 10) + this.parseStyle(style.marginBottom, 10)\n\t\t})\n\n\t\treturn innerHeight\n\t}\n\n\tparseStyle(style) {\n\t\tif(isNaN(parseInt(style, 10))) {\n\t\t\treturn 0\n\t\t} else {\n\t\t\treturn parseInt(style, 10)\n\t\t}\n\t}\n\n\tanimateContent(element, targetHeight, open, parentElement) {\n\t\tlet currentHeight = element.offsetHeight;\n\t\n\t\tconst speed =\n\t\t (open ? targetHeight : currentHeight) / (this.duration / 16.67);\n\t\n\t\n\t\tconst step = () => {\n\t\t if (currentHeight !== targetHeight) {\n\t\t\tcurrentHeight = open ? currentHeight + speed : currentHeight - speed;\n\t\n\t\t\tif (\n\t\t\t (open && currentHeight + speed > targetHeight) ||\n\t\t\t (!open && currentHeight - speed < targetHeight)\n\t\t\t) {\n\t\t\t currentHeight = targetHeight;\n\t\t\t !open && parentElement.removeClass(\"open\");\n\t\t\t}\n\t\n\t\t\telement.style.height = currentHeight + \"px\";\n\t\t\tthis.animationFrameOpen = requestAnimationFrame(step);\n\t\t } else {\n\t\t\tcancelAnimationFrame(this.animationFrame);\n\t\t\telement.style.height = \"auto\";\n\t\t }\n\t\t};\n\t\tthis.animationFrame = requestAnimationFrame(step);\n\t }\n}\n\nexport default ExpandableContentLarge\n"],"names":["ExpandableContentLarge","constructor","elem","animationFrame","height","duration","isSupportingIO","observer","IntersectionObserver","entry","isIntersecting","window","addEventListener","onResize","removeEventListener","observe","find","click","eventClick","hasClass","content","$","css","getInnerHeight","IntersectionObserverEntry","prototype","animateContent","addClass","offsetHeight","style","innerHeight","children","toArray","forEach","child","i","currentStyle","getComputedStyle","scrollHeight","parseStyle","marginTop","marginBottom","isNaN","parseInt","element","targetHeight","open","parentElement","currentHeight","speed","step","removeClass","animationFrameOpen","requestAnimationFrame","cancelAnimationFrame"],"sourceRoot":""}