PageSourceSearch

https://www.merckconnect.com/wp-content/themes/cex-wpvip-mhh-merck…/accordion/js/frontend.js?ver=1790326624

js merckconnect.com collected 2026-10-10 02:01:02 UTC 10,480 bytes, 100 lines download raw bytes

vendor: 3,638 bytes, lines 1-88
1/******/ (function(modules) { // webpackBootstrap
2/******/ 	// The module cache
3/******/ 	var installedModules = {};
4/******/
5/******/ 	// The require function
6/******/ 	function __webpack_require__(moduleId) {
7/******/
8/******/ 		// Check if module is in cache
9/******/ 		if(installedModules[moduleId]) {
10/******/ 			return installedModules[moduleId].exports;
11/******/ 		}
12/******/ 		// Create a new module (and put it into the cache)
13/******/ 		var module = installedModules[moduleId] = {
14/******/ 			i: moduleId,
15/******/ 			l: false,
16/******/ 			exports: {}
17/******/ 		};
18/******/
19/******/ 		// Execute the module function
20/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
21/******/
22/******/ 		// Flag the module as loaded
23/******/ 		module.l = true;
24/******/
25/******/ 		// Return the exports of the module
26/******/ 		return module.exports;
27/******/ 	}
28/******/
29/******/
30/******/ 	// expose the modules object (__webpack_modules__)
31/******/ 	__webpack_require__.m = modules;
32/******/
33/******/ 	// expose the module cache
34/******/ 	__webpack_require__.c = installedModules;
35/******/
36/******/ 	// define getter function for harmony exports
37/******/ 	__webpack_require__.d = function(exports, name, getter) {
38/******/ 		if(!__webpack_require__.o(exports, name)) {
39/******/ 			Object.defineProperty(exports, name, { enumerable: true, get: getter });
40/******/ 		}
41/******/ 	};
42/******/
43/******/ 	// define __esModule on exports
44/******/ 	__webpack_require__.r = function(exports) {
45/******/ 		if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
46/******/ 			Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
47/******/ 		}
48/******/ 		Object.defineProperty(exports, '__esModule', { value: true });
49/******/ 	};
50/******/
51/******/ 	// create a fake namespace object
52/******/ 	// mode & 1: value is a module id, require it
53/******/ 	// mode & 2: merge all properties of value into the ns
54/******/ 	// mode & 4: return value when already ns object
55/******/ 	// mode & 8|1: behave like require
56/******/ 	__webpack_require__.t = function(value, mode) {
57/******/ 		if(mode & 1) value = __webpack_require__(value);
58/******/ 		if(mode & 8) return value;
59/******/ 		if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
60/******/ 		var ns = Object.create(null);
61/******/ 		__webpack_require__.r(ns);
62/******/ 		Object.defineProperty(ns, 'default', { enumerable: true, value: value });
63/******/ 		if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
64/******/ 		return ns;
65/******/ 	};
66/******/
67/******/ 	// getDefaultExport function for compatibility with non-harmony modules
68/******/ 	__webpack_require__.n = function(module) {
69/******/ 		var getter = module && module.__esModule ?
70/******/ 			function getDefault() { return module['default']; } :
71/******/ 			function getModuleExports() { return module; };
72/******/ 		__webpack_require__.d(getter, 'a', getter);
73/******/ 		return getter;
74/******/ 	};
75/******/
76/******/ 	// Object.prototype.hasOwnProperty.call
77/******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
78/******/
79/******/ 	// __webpack_public_path__
80/******/ 	__webpack_require__.p = "";
81/******/
82/******/
83/******/ 	// Load entry module and return exports
84/******/ 	return __webpack_require__(__webpack_require__.s = "./resources/blocks/accordion/js/frontend.js");
85/******/ })
86/************************************************************************/
87/******/ ({
88
89/***/ "./resources/blocks/accordion/js/frontend.js":
90/*!***************************************************!*\
91  !*** ./resources/blocks/accordion/js/frontend.js ***!
92  \***************************************************/
93/*! no static exports found */
94/***/ (function(module, exports) {
95
96eval("//tab content load functionality\nwindow.addEventListener(\"load\", function () {\n  accordionFocus();\n  getAnalytics();\n  accrdionOnFocus();\n});\nwindow.addEventListener(\"hashchange\", function () {\n  accordionFocus();\n  accrdionOnFocus();\n});\n\n//3166 - making accordion to be in open state while navigating using deep linking\nfunction accordionFocus() {\n  var hash = window.location.hash;\n  if (!hash) return;\n  var accordionId = hash.replace(\"#\", \"\");\n  // id is on summary; details is parent\n  var summary = document.getElementById(accordionId);\n  if (summary) {\n    var details = summary.closest(\".vivid360-block-accordion-details\");\n    if (details) {\n      setTimeout(function () {\n        details.open = false;\n        details.open = true;\n      }, 100);\n    }\n  }\n}\n\n//3166 - adding event listener because hashchange is not triggering\ndocument.addEventListener(\"DOMContentLoaded\", function () {\n  document.querySelectorAll('a[href^=\"#\"]').forEach(function (link) {\n    link.addEventListener(\"click\", function (event) {\n      setTimeout(accordionFocus, 50);\n    });\n  });\n});\nfunction getAnalytics() {\n  var accordions = document.querySelectorAll(\".wp-block-vivid360-accordion\");\n  accordions.forEach(function (accordion) {\n    var details = accordion.querySelector(\".vivid360-block-accordion-details\");\n    if (!details) return;\n    var summary = details.querySelector(\".vivid360-block-accordion-title-section\");\n    if (!summary) return;\n    var titleEl = summary.querySelector(\".vivid360-block-accordion-title\");\n    var title = ((titleEl === null || titleEl === void 0 ? void 0 : titleEl.textContent) || \"\").trim();\n    var isFAQ = accordion.classList.contains(\"faq-accordion\");\n    summary.setAttribute(\"data-event-name\", \"accordion_click\");\n    summary.setAttribute(\"data-design-module\", isFAQ ? \"faq\" : \"accordion\");\n    var setLabel = function setLabel() {\n      summary.setAttribute(\"data-design-label\", details.open ? \"\".concat(title, \"_collapse\") : \"\".concat(title, \"_expand\"));\n    };\n\n    // initial label\n    setLabel();\n\n    // update label whenever open/close changes (click, keyboard, deep-link, script)\n    details.addEventListener(\"toggle\", setLabel);\n  });\n}\nfunction accrdionOnFocus() {\n  var accordionArr = document.querySelectorAll(\".wp-block-vivid360-accordion\");\n  var summaryObj = document.getElementsByClassName(\"vivid360-block-accordion-title-section\");\n  var _loop = function _loop(i) {\n    var block = summaryObj[i];\n    block.addEventListener(\"click\", function () {\n      accordionArr[i].classList.remove(\"focus-summary\");\n    });\n    block.addEventListener(\"focus\", function () {\n      setTimeout(function () {\n        accordionArr[i].classList.add(\"focus-summary\");\n      }, 200);\n    });\n    block.addEventListener(\"focusout\", function () {\n      accordionArr[i].classList.remove(\"focus-summary\");\n    });\n  };\n  for (var i = 0; i < accordionArr.length; i++) {\n    _loop(i);\n  }\n}\n\n//function for collapsing the accordions\nfunction collapseAccordions() {\n  var accordion = document.querySelectorAll(\".vivid360-block-accordion-details\");\n  accordion.forEach(function (element) {\n    element.addEventListener(\"click\", function () {\n      // Clicking on the new Accordion\n      if (!element.hasAttribute(\"open\")) {\n        // NOTE: all color manipulation removed.\n        // Keep existing \"collapse others\" behavior.\n        accordion.forEach(function (otherElement) {\n          //collapsing rest all accordions except the clicked accordion\n          if (otherElement !== element) {\n            if (otherElement.hasAttribute(\"open\")) {\n              otherElement.removeAttribute(\"open\");\n              var summaryOfOtherElement = otherElement.querySelector(\".vivid360-block-accordion-title-section\");\n              var title = summaryOfOtherElement.querySelector(\".vivid360-block-accordion-title\").textContent;\n              summaryOfOtherElement === null || summaryOfOtherElement === void 0 || summaryOfOtherElement.setAttribute(\"data-design-label\", title + \"_exp
96and\");\n            }\n          }\n        });\n      }\n      //clicking on the same accordion\n      else {\n        // NOTE: all color manipulation removed.\n        // No additional behavior required here beyond the native <details> toggle.\n      }\n    });\n  });\n}\n\n//Function call if we enable collapse accordion functionality in page level settings\nvar collapseAccordion = document.querySelector(\".collapseAccordionsEnabled\");\nif (collapseAccordion) {\n  collapseAccordions();\n}\ndocument.addEventListener(\"DOMContentLoaded\", function () {\n  accordionAnalytics();\n});\n\n// Adding Analytics for all links and buttons in the accordion and faq\nfunction accordionAnalytics() {\n  var accordion = document.querySelectorAll(\".wp-block-vivid360-accordion\");\n  accordion.forEach(function (e) {\n    if (e.classList.contains(\"faq-accordion\")) {\n      // Analytics for FAQ\n      var links = e.querySelectorAll(\"a\");\n      links.forEach(function (el) {\n        el === null || el === void 0 || el.setAttribute(\"data-event-name\", \"element_click\");\n        el === null || el === void 0 || el.setAttribute(\"data-design-module\", \"faq\");\n        el === null || el === void 0 || el.setAttribute(\"data-design-label\", el.textContent);\n        if (el.classList.contains(\"btn\")) {\n          el === null || el === void 0 || el.setAttribute(\"data-design-category\", \"button\");\n        } else {\n          el === null || el === void 0 || el.setAttribute(\"data-design-category\", \"link\");\n        }\n      });\n    } else {\n      var links = e.querySelectorAll(\"a\");\n      links.forEach(function (ee) {\n        // Analytics for Accordion\n        ee === null || ee === void 0 || ee.setAttribute(\"data-event-name\", \"element_click\");\n        ee === null || ee === void 0 || ee.setAttribute(\"data-design-module\", \"accordion\");\n        ee === null || ee === void 0 || ee.setAttribute(\"data-design-label\", ee.textContent);\n        if (ee.classList.contains(\"btn\")) {\n          ee === null || ee === void 0 || ee.setAttribute(\"data-design-category\", \"button\");\n        } else {\n          ee === null || ee === void 0 || ee.setAttribute(\"data-design-category\", \"link\");\n        }\n      });\n    }\n  });\n}\n\n//# sourceURL=webpack:///./resources/blocks/accordion/js/frontend.js?"
vendor: 26 bytes, lines 96-100
96);
97
98/***/ })
99
100/******/ });

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.