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,gBAAgBL,GAAiB7B,GAAW,IAAK,CAAC,cACpF3B,EAAa,KAAM,CACpB,CAACyD,EAAAA,OAAQJ,EAAAA,EAAAA,OAAO3C,GAAkB,MAEpCwC,EAAAA,EAAAA,iBAAgBpD,EAAAA,EAAAA,oBAAoB,IAAK,CACvCR,MAAO,yBACPsE,KAAM,cACNhE,KAAM,SACN2D,QAASR,EAAO,KAAOA,EAAO,IAAKc,EAAAA,EAAAA,gBAAgBL,GAAiB7B,EAAU,IAAK,CAAC,cACnFxB,EAAa,KAAM,CACpB,CAACsD,EAAAA,OAAQJ,EAAAA,EAAAA,OAAO3C,GAAkB,MAEpCZ,EAAAA,EAAAA,oBAAoB,KAAM,CACxBR,MAAO,gBACPwE,MAAO,CAAC,UAAU,KAClBC,UAAWC,oBAAmBX,EAAAA,EAAAA,OAAO7C,KACpC,KAAM,EAAGJ,WAMtB,IC/OA,MAAM6D,EAAc,EAEpB,O","sources":["webpack://familytoday-frontend/./src/components/carousel/Article.vue?6ace","webpack://familytoday-frontend/./src/components/carousel/Article.vue"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, vShow as _vShow, createElementVNode as _createElementVNode, withDirectives as _withDirectives, renderSlot as _renderSlot, withModifiers as _withModifiers } from \"vue\"\n\nconst _hoisted_1 = { id: \"index-lead-wrapper\" }\nconst _hoisted_2 = { class: \"container\" }\nconst _hoisted_3 = { class: \"index-lead-block\" }\nconst _hoisted_4 = {\n id: \"myCarousel\",\n class: \"carousel slide\"\n}\nconst _hoisted_5 = { class: \"carousel-indicators\" }\nconst _hoisted_6 = [\"onClick\"]\nconst _hoisted_7 = {\n id: \"carousel-inner\",\n class: \"carousel-inner\",\n role: \"listbox\"\n}\nconst _hoisted_8 = /*#__PURE__*/_createElementVNode(\"div\", { class: \"arrow\" }, null, -1)\nconst _hoisted_9 = /*#__PURE__*/_createElementVNode(\"span\", { class: \"sr-only\" }, \"Previous\", -1)\nconst _hoisted_10 = [\n _hoisted_8,\n _hoisted_9\n]\nconst _hoisted_11 = /*#__PURE__*/_createElementVNode(\"div\", { class: \"arrow-right\" }, null, -1)\nconst _hoisted_12 = /*#__PURE__*/_createElementVNode(\"span\", { class: \"sr-only\" }, \"Next\", -1)\nconst _hoisted_13 = [\n _hoisted_11,\n _hoisted_12\n]\nconst _hoisted_14 = [\"innerHTML\"]\n\nimport { ref, toRefs } from \"vue\";\nimport { useLogger } from \"vue-logger-plugin\";\n\n// Define Component Input Properties\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'Article',\n props: {\n title: String,\n numberOfSlides: Number,\n},\n setup(__props) {\n\nconst props = __props;\n\n\n\n// get back slide card info\nconst { title, numberOfSlides } = toRefs(props);\nconst maxNumberOfSlides = numberOfSlides?.value;\n\n// logger for information\nconst logger = useLogger();\n// this is what slide we're on\nconst currentActive = ref(0);\nconst leftActive = ref(null);\nconst rightActive = ref(null);\nconst nextActive = ref(null);\nconst prevActive = ref(null);\nconst activelySliding = ref(-1);\n\n// every 8 seconds go to the next slide if there are more slides\nif (numberOfSlides?.value > 1) {\n setInterval(function () {\n nextSlide(1);\n }, 8000);\n}\n\n// resets a single slide\nconst removeSlideClass = function (slide, className) {\n if (slide !== null && slide >= 0 && slide < maxNumberOfSlides) {\n logger.debug(`resetting class for slide ${slide}`);\n const topElement = document.getElementById(\"carousel-inner\");\n topElement.children[slide].classList.remove(className);\n }\n};\n\n// reset all slide back to 0\nconst resetAllSlides = function () {\n logger.debug(\"calling reset all slides classes\");\n const topElement = document.getElementById(\"carousel-inner\");\n for (let idx = 0; idx < maxNumberOfSlides; idx++) {\n topElement.children[idx].classList.remove(\n \"active\",\n \"next\",\n \"prev\",\n \"left\",\n \"right\"\n );\n }\n};\n\n// add class to the inner slide\nconst addSlideClass = function (slide, className, updateActiveSlide = false) {\n if (slide !== null && slide >= 0 && slide < maxNumberOfSlides) {\n if (updateActiveSlide) {\n logger.debug(`updating currentActive slide to ${slide}`);\n // update the currently active slide to this slide\n currentActive.value = slide;\n }\n\n logger.debug(`adding class ${className} to slide ${slide} `);\n // add class to the current slide\n const topElement = document.getElementById(\"carousel-inner\");\n topElement.children[slide].classList.add(className);\n }\n};\n\n// for when the indicator bubbles are clicked go directly to the page in question\nconst onIndicatorClick = function (slide) {\n logger.debug(`indicator clicked for slide ${slide}`);\n resetAllSlides();\n addSlideClass(slide, \"active\", true);\n};\n\n// when next or prev buttons are clicked\nconst nextSlide = function (direction) {\n // do not slide until we're able to\n if (activelySliding.value >= 0) {\n return;\n }\n\n let slide = currentActive.value;\n\n // set that we're actively sliding to the next card\n activelySliding.value = slide;\n\n // positive means going next slide\n if (direction > 0) {\n leftActive.value = slide;\n slide++;\n\n // keep it in bound\n if (slide >= maxNumberOfSlides) {\n slide = 0;\n }\n\n setTimeout(function () {\n // next active is the one we want\n nextActive.value = slide;\n addSlideClass(nextActive.value, \"next\");\n }, 500);\n\n // make slide active and left slide left\n addSlideClass(leftActive.value, \"left\");\n } else {\n rightActive.value = slide;\n slide--;\n\n // keep the slide in bound\n if (slide < 0) {\n slide = maxNumberOfSlides - 1;\n }\n\n setTimeout(function () {\n // previous active is up next\n prevActive.value = slide;\n addSlideClass(prevActive.value, \"prev\");\n }, 500);\n\n // make slide active and right slide right\n addSlideClass(rightActive.value, \"right\");\n }\n\n // this time out sets the current active value so the carousel looks like it is \"sliding\"\n setTimeout(function () {\n // reset the currently active slide before we move\n removeSlideClass(currentActive.value, \"active\");\n\n // reset the next and prev values\n if (nextActive.value != null) {\n currentActive.value = nextActive.value;\n } else {\n currentActive.value = prevActive.value;\n }\n\n // this should already be done but re-do it just in case it got reset in a timer\n addSlideClass(currentActive.value, \"active\");\n\n // reset the other slides\n removeSlideClass(leftActive.value, \"left\");\n removeSlideClass(rightActive.value, \"right\");\n removeSlideClass(prevActive.value, \"prev\");\n removeSlideClass(nextActive.value, \"next\");\n\n // reset all values\n leftActive.value =\n rightActive.value =\n prevActive.value =\n nextActive.value =\n null;\n\n // we're no longer sliding so indicate that\n activelySliding.value = -1;\n }, 1000);\n};\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createElementVNode(\"main\", _hoisted_3, [\n _createElementVNode(\"div\", _hoisted_4, [\n _withDirectives(_createElementVNode(\"ol\", _hoisted_5, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(maxNumberOfSlides), (idx) => {\n return (_openBlock(), _createElementBlock(\"li\", {\n key: idx,\n onClick: ($event: any) => (onIndicatorClick(idx - 1))\n }, null, 8, _hoisted_6))\n }), 128))\n ], 512), [\n [_vShow, _unref(numberOfSlides) > 1]\n ]),\n _createElementVNode(\"div\", _hoisted_7, [\n _renderSlot(_ctx.$slots, \"default\")\n ]),\n _withDirectives(_createElementVNode(\"a\", {\n class: \"left carousel-control\",\n href: \"#myCarousel\",\n role: \"button\",\n onClick: _cache[0] || (_cache[0] = _withModifiers(($event: any) => (nextSlide(-1)), [\"prevent\"]))\n }, _hoisted_10, 512), [\n [_vShow, _unref(numberOfSlides) > 1]\n ]),\n _withDirectives(_createElementVNode(\"a\", {\n class: \"right carousel-control\",\n href: \"#myCarousel\",\n role: \"button\",\n onClick: _cache[1] || (_cache[1] = _withModifiers(($event: any) => (nextSlide(1)), [\"prevent\"]))\n }, _hoisted_13, 512), [\n [_vShow, _unref(numberOfSlides) > 1]\n ]),\n _createElementVNode(\"h1\", {\n class: \"hidden-header\",\n style: {\"z-index\":\"1\"},\n innerHTML: decodeURIComponent(_unref(title))\n }, null, 8, _hoisted_14)\n ])\n ])\n ])\n ]))\n}\n}\n\n})","import script from \"./Article.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./Article.vue?vue&type=script&setup=true&lang=ts\"\n\nconst __exports__ = script;\n\nexport default __exports__"],"names":["_hoisted_1","id","_hoisted_2","class","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","role","_hoisted_8","_createElementVNode","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_defineComponent","__name","props","title","String","numberOfSlides","Number","setup","__props","toRefs","maxNumberOfSlides","value","logger","useLogger","currentActive","ref","leftActive","rightActive","nextActive","prevActive","activelySliding","setInterval","nextSlide","removeSlideClass","slide","className","debug","topElement","document","getElementById","children","classList","remove","resetAllSlides","idx","addSlideClass","updateActiveSlide","add","onIndicatorClick","direction","setTimeout","_ctx","_cache","_openBlock","_createElementBlock","_withDirectives","_Fragment","_renderList","_unref","key","onClick","$event","_vShow","_renderSlot","$slots","href","_withModifiers","style","innerHTML","decodeURIComponent","__exports__"],"sourceRoot":""}