{"version":3,"file":"refreshedfeaturestabsblock.2e646c7c.js","mappings":"AACIA,OAAOC,YAAcD,OAAOC,aAAe,CAAC,EAC5CD,OAAOC,YAAYC,2BAA6BF,OAAOC,YAAYC,4BAA8B,CAAC,EAClGF,OAAOC,YAAYC,2BAA2BC,KAAO,WACjDC,QAAQC,IAAI,8CACZ,IAYyBC,EACjBC,EACAC,EACAC,EAfJP,EAA6BQ,SAASC,iBAAiB,4BAE3D,GAAIT,EAA2BU,OAC3B,IAAK,IAAIC,EAAM,EAAGA,EAAMX,EAA2BU,OAAQC,IAStCP,EARDJ,EAA2BW,GAAKC,aAAa,0BAS7DP,SACAC,SACAC,SAFAF,EAAcQ,EAAE,0BAA4BT,GAC5CE,EAAaO,EAAE,yBAA2BT,GAC1CG,EAAQM,EAAE,kBAAoBT,GAGlCE,EAAWQ,KAAK,kBAAkBC,SAAS,aAC3CV,EAAYS,KAAK,mBAAmBC,SAAS,aAGlC,IAAIC,WAAWC,KAAKV,EAAO,CAClCW,UAAU,EACVC,gBAAgB,EAChBC,eAAe,IAKnBtB,OAAOC,YAAYC,2BAA2BqB,4BAC1CvB,OAAOC,YAAYC,2BAA2BqB,6BAA+B,CAAC,EAClFvB,OAAOC,YAAYC,2BAA2BqB,4BAA4B,GAADC,OAAIlB,IAAaG,EAKtFS,WAAWO,WAAWC,GAAG,gBASjC,SAA0BjB,GACtBA,EAAMkB,GAAG,SAAS,SAAUC,GACxBb,EAAEa,EAAEC,QAAQC,QAAQ,MAAMC,YAAY,WAC1C,GACJ,CAZQC,CAAiBvB,EAa7B,EACAT,OAAOC,YAAYC,2BAA2B+B,WAAY","sources":["webpack://advanced-web/./UI/js/core/modules/refreshedFeaturesTabsBlock.js"],"sourcesContent":["(function () {\r\n window.oneadvanced = window.oneadvanced || {};\r\n window.oneadvanced.refreshedfeaturestabsblock = window.oneadvanced.refreshedfeaturestabsblock || {};\r\n window.oneadvanced.refreshedfeaturestabsblock.init = function () {\r\n console.log(\"initialising refreshedfeaturestabsblock...\");\r\n var refreshedfeaturestabsblock = document.querySelectorAll('[data-features-block-id]');\r\n\r\n if (refreshedfeaturestabsblock.length) {\r\n for (var ftb = 0; ftb < refreshedfeaturestabsblock.length; ftb++) {\r\n featuresHandler(refreshedfeaturestabsblock[ftb].getAttribute('data-features-block-id'));\r\n }\r\n }\r\n\r\n /**\r\n * Handle the setup for each Features Tabs block on the page\r\n * @param {any} BlockId\r\n */\r\n function featuresHandler(BlockId) {\r\n var $ft_content = $('#features_tabs_content_' + BlockId);\r\n var $ft_titles = $('#features_tabs_titles_' + BlockId);\r\n var $elem = $('#features_tabs_' + BlockId);\r\n\r\n // set first tab content and title to is-active\r\n $ft_titles.find('li:first-child').addClass('is-active');\r\n $ft_content.find('div:first-child').addClass('is-active');\r\n\r\n // initiate Foundation tabs here rather than in the view\r\n let tabs = new Foundation.Tabs($elem, {\r\n deepLink: false,\r\n deepLinkSmudge: false,\r\n updateHistory: false\r\n });\r\n\r\n // store a reference to the initialised tab in a jQuery object\r\n // so that we can call public methods on it later\r\n window.oneadvanced.refreshedfeaturestabsblock.refreshedfeaturestabsblocks =\r\n window.oneadvanced.refreshedfeaturestabsblock.refreshedfeaturestabsblocks || {};\r\n window.oneadvanced.refreshedfeaturestabsblock.refreshedfeaturestabsblocks[`${BlockId}`] = $elem;\r\n\r\n // if mobile\r\n // add functionality to handle\r\n // tabstitles turning into a 'dropdown'\r\n if (Foundation.MediaQuery.is('medium down')) {\r\n makeIntoDropdown($elem);\r\n }\r\n }\r\n\r\n /**\r\n * Turns Foundation Tabs element into a dropdown on mobile\r\n * @param {any} $elem\r\n */\r\n function makeIntoDropdown($elem) {\r\n $elem.on('click', function (e) {\r\n $(e.target).closest('ul').toggleClass('expanded');\r\n });\r\n }\r\n };\r\n window.oneadvanced.refreshedfeaturestabsblock.hasLoaded = true;\r\n})();"],"names":["window","oneadvanced","refreshedfeaturestabsblock","init","console","log","BlockId","$ft_content","$ft_titles","$elem","document","querySelectorAll","length","ftb","getAttribute","$","find","addClass","Foundation","Tabs","deepLink","deepLinkSmudge","updateHistory","refreshedfeaturestabsblocks","concat","MediaQuery","is","on","e","target","closest","toggleClass","makeIntoDropdown","hasLoaded"],"sourceRoot":""}