Socket
Socket
Sign inDemoInstall

@reecem/h-bar

Package Overview
Dependencies
0
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.0-rc1 to 2.0.1

.vscode/settings.json

31

CHANGELOG.md
# Changelog
All notable changes to `h-bar` will be documented in this file.
## [Unreleased]
# 1.1.0 - 2020-05-15
## [2.0.1] - 2022-12-21
### Added
- Templating for custom styles.
- Move the original default banner to separate class
### Changed
- Initializing the class has changed in the values passed
- Changed to make banner optional #31 @mariusa
# [1.1.0] - 2020-05-15
***Changes***

@@ -17,3 +27,3 @@

# 1.0.1 - 2020-04-09
# [1.0.1] - 2020-04-09

@@ -24,3 +34,3 @@ __FIX__

# 1.0.0 - 2020-03-13
# [1.0.0] - 2020-03-13

@@ -33,3 +43,3 @@ First initial major version of h-bar :)

# 0.3.0 - 2020-03-13
# [0.3.0] - 2020-03-13

@@ -48,3 +58,3 @@ ***FEATURE***

## 0.2.0 - 2020-02-23
## [0.2.0] - 2020-02-23

@@ -61,3 +71,3 @@ This has a fix for the fact I mixed up the values compared in the wordpress passer.

## 0.1.0 - 2020-02-18
## [0.1.0] - 2020-02-18

@@ -77,1 +87,10 @@ ***Features***

Before this the documented changes are vague cause it was the initial flesh of the package.
[Unreleased]: https://github.com/reecem/h-bar/compare/v2.0.1...HEAD
[2.0.1]: https://github.com/reecem/h-bar/compare/v1.0.1...v2.0.1
[1.1.0]: https://github.com/reecem/h-bar/compare/v1.0.1...v1.1.0
[1.0.1]: https://github.com/reecem/h-bar/compare/v0.3.0...v1.0.1
[0.3.0]: https://github.com/reecem/h-bar/compare/v0.2.1...v0.3.0
[0.2.1]: https://github.com/reecem/h-bar/compare/v0.2.0...v0.2.1
[0.2.0]: https://github.com/reecem/h-bar/compare/v0.1.0...v0.2.0
[0.1.0]: https://github.com/reecem/h-bar/releases/tag/v0.1.0

980

dist/hBar.js

@@ -10,163 +10,137 @@ (function webpackUniversalModuleDefinition(root, factory) {

root["hBar"] = factory();
})(window, function() {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 4);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports, __webpack_require__) {
})(self, () => {
return /******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ({
var api = __webpack_require__(1);
var content = __webpack_require__(2);
/***/ 363:
/***/ ((module, __webpack_exports__, __webpack_require__) => {
content = content.__esModule ? content.default : content;
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81);
/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(645);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports
if (typeof content === 'string') {
content = [[module.i, content, '']];
}
var options = {};
var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, "*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 transparent;--tw-ring-shadow:0 0 transparent;--tw-shadow:0 0 transparent;--tw-shadow-colored:0 0 transparent;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 transparent;--tw-ring-shadow:0 0 transparent;--tw-shadow:0 0 transparent;--tw-shadow-colored:0 0 transparent;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.hb-mx-2{margin-left:.5rem;margin-right:.5rem}.hb-mx-5{margin-left:1.25rem;margin-right:1.25rem}.hb--mr-2{margin-right:-.5rem}.hb-flex{display:flex}.hb-inline-flex{display:inline-flex}.hb-h-3{height:.75rem}.hb-h-4{height:1rem}.hb-w-3{width:.75rem}.hb-w-4{width:1rem}.hb-w-full{width:100%}.hb-cursor-pointer{cursor:pointer}.hb-items-center{align-items:center}.hb-justify-between{justify-content:space-between}.hb-rounded-md{border-radius:.375rem}.hb-rounded-full{border-radius:9999px}.hb-bg-gray-900{--tw-bg-opacity:1;background-color:rgba(17,24,39,var(--tw-bg-opacity))}.hb-bg-white{--tw-bg-opacity:1;background-color:rgba(255,255,255,var(--tw-bg-opacity))}.hb-bg-gray-400{--tw-bg-opacity:1;background-color:rgba(156,163,175,var(--tw-bg-opacity))}.hb-bg-blue-900{--tw-bg-opacity:1;background-color:rgba(30,58,138,var(--tw-bg-opacity))}.hb-bg-blue-100{--tw-bg-opacity:1;background-color:rgba(219,234,254,var(--tw-bg-opacity))}.hb-bg-green-600{--tw-bg-opacity:1;background-color:rgba(22,163,74,var(--tw-bg-opacity))}.hb-bg-green-100{--tw-bg-opacity:1;background-color:rgba(220,252,231,var(--tw-bg-opacity))}.hb-bg-indigo-800{--tw-bg-opacity:1;background-color:rgba(55,48,163,var(--tw-bg-opacity))}.hb-bg-indigo-100{--tw-bg-opacity:1;background-color:rgba(224,231,255,var(--tw-bg-opacity))}.hb-bg-orange-300{--tw-bg-opacity:1;background-color:rgba(253,186,116,var(--tw-bg-opacity))}.hb-bg-orange-800{--tw-bg-opacity:1;background-color:rgba(154,52,18,var(--tw-bg-opacity))}.hb-bg-yellow-300{--tw-bg-opacity:1;background-color:rgba(253,224,71,var(--tw-bg-opacity))}.hb-bg-yellow-100{--tw-bg-opacity:1;background-color:rgba(254,249,195,var(--tw-bg-opacity))}.hb-bg-teal-500{--tw-bg-opacity:1;background-color:rgba(20,184,166,var(--tw-bg-opacity))}.hb-bg-teal-900{--tw-bg-opacity:1;background-color:rgba(19,78,74,var(--tw-bg-opacity))}.hb-bg-red-400{--tw-bg-opacity:1;background-color:rgba(248,113,113,var(--tw-bg-opacity))}.hb-bg-red-100{--tw-bg-opacity:1;background-color:rgba(254,226,226,var(--tw-bg-opacity))}.hb-p-1{padding:.25rem}.hb-py-2{padding-bottom:.5rem;padding-top:.5rem}.hb-px-1{padding-left:.25rem;padding-right:.25rem}.hb-px-2{padding-left:.5rem;padding-right:.5rem}.hb-text-sm{font-size:.875rem;line-height:1.25rem}.hb-text-xs{font-size:.75rem;line-height:1rem}.hb-font-semibold{font-weight:600}.hb-uppercase{text-transform:uppercase}.hb-leading-relaxed{line-height:1.625}.hb-tracking-wider{letter-spacing:.05em}.hb-text-gray-100{--tw-text-opacity:1;color:rgba(243,244,246,var(--tw-text-opacity))}.hb-text-gray-900{--tw-text-opacity:1;color:rgba(17,24,39,var(--tw-text-opacity))}.hb-text-gray-800{--tw-text-opacity:1;color:rgba(31,41,55,var(--tw-text-opacity))}.hb-text-blue-100{--tw-text-opacity:1;color:rgba(219,234,254,var(--tw-text-opacity))}.hb-text-blue-900{--tw-text-opacity:1;color:rgba(30,58,138,var(--tw-text-opacity))}.hb-text-green-100{--tw-text-opacity:1;color:rgba(220,252,231,var(--tw-text-opacity))}.hb-text-green-900{--tw-text-opacity:1;color:rgba(20,83,45,var(--tw-text-opacity))}.hb-text-indigo-100{--tw-text-opacity:1;color:rgba(224,231,255,var(--tw-text-opacity))}.hb-text-indigo-900{--tw-text-opacity:1;color:rgba(49,46,129,var(--tw-text-opacity))}.hb-text-orange-900{--tw-text-opacity:1;color:rgba(124,45,18,var(--tw-text-opacity))}.hb-text-orange-100{--tw-text-opacity:1;color:rgba(255,237,213,var(--tw-text-opacity))}.hb-text-yellow-900{--tw-text-opacity:1;color:rgba(113,63,18,var(--tw-text-opacity))}.hb-text-teal-100{--tw-text-opacity:1;color:rgba(204,251,241,var(--tw-text-opacity))}.hb-text-red-900{--tw-text-opacity:1;color:rgba(127,29,29,var(--tw-text-opacity))}a{background-color:transparent;color:inherit;text-decoration:inherit}*,:after,:before{border:0 solid #e2e8f0;box-sizing:border-box}.fade-in-top{animation:fade-in-top .8s cubic-bezier(.39,.575,.565,1)}@keyframes fade-in-top{0%{opacity:0;transform:translateY(-50px)}to{opacity:1;transform:translateY(0)}}.hover\\:hb-bg-gray-800:hover{--tw-bg-opacity:1;background-color:rgba(31,41,55,var(--tw-bg-opacity))}.hover\\:hb-text-white:hover{--tw-text-opacity:1;color:rgba(255,255,255,var(--tw-text-opacity))}.hover\\:hb-text-gray-300:hover{--tw-text-opacity:1;color:rgba(209,213,219,var(--tw-text-opacity))}.hover\\:hb-text-gray-600:hover{--tw-text-opacity:1;color:rgba(75,85,99,var(--tw-text-opacity))}.hover\\:hb-text-blue-300:hover{--tw-text-opacity:1;color:rgba(147,197,253,var(--tw-text-opacity))}.hover\\:hb-text-green-300:hover{--tw-text-opacity:1;color:rgba(134,239,172,var(--tw-text-opacity))}.hover\\:hb-text-indigo-300:hover{--tw-text-opacity:1;color:rgba(165,180,252,var(--tw-text-opacity))}.hover\\:hb-text-orange-700:hover{--tw-text-opacity:1;color:rgba(194,65,12,var(--tw-text-opacity))}.hover\\:hb-text-yellow-700:hover{--tw-text-opacity:1;color:rgba(161,98,7,var(--tw-text-opacity))}.hover\\:hb-text-teal-300:hover{--tw-text-opacity:1;color:rgba(94,234,212,var(--tw-text-opacity))}.hover\\:hb-text-red-100:hover{--tw-text-opacity:1;color:rgba(254,226,226,var(--tw-text-opacity))}.hover\\:hb-underline:hover{text-decoration-line:underline}.focus\\:hb-bg-gray-800:focus{--tw-bg-opacity:1;background-color:rgba(31,41,55,var(--tw-bg-opacity))}.focus\\:hb-outline-none:focus{outline:2px solid transparent;outline-offset:2px}@media (min-width:768px){.md\\:hb-flex-row{flex-direction:row}.md\\:hb-px-20{padding-left:5rem;padding-right:5rem}}", ""]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
options.insert = "head";
options.singleton = false;
var update = api(content, options);
/***/ }),
var exported = content.locals ? content.locals : {};
/***/ 645:
/***/ ((module) => {
module.exports = exported;
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
module.exports = function (cssWithMappingToString) {
var list = [];
// return the list of modules as css string
list.toString = function toString() {
return this.map(function (item) {
var content = "";
var needLayer = typeof item[5] !== "undefined";
if (item[4]) {
content += "@supports (".concat(item[4], ") {");
}
if (item[2]) {
content += "@media ".concat(item[2], " {");
}
if (needLayer) {
content += "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {");
}
content += cssWithMappingToString(item);
if (needLayer) {
content += "}";
}
if (item[2]) {
content += "}";
}
if (item[4]) {
content += "}";
}
return content;
}).join("");
};
// import a list of modules into the list
list.i = function i(modules, media, dedupe, supports, layer) {
if (typeof modules === "string") {
modules = [[null, modules, undefined]];
}
var alreadyImportedModules = {};
if (dedupe) {
for (var k = 0; k < this.length; k++) {
var id = this[k][0];
if (id != null) {
alreadyImportedModules[id] = true;
}
}
}
for (var _k = 0; _k < modules.length; _k++) {
var item = [].concat(modules[_k]);
if (dedupe && alreadyImportedModules[item[0]]) {
continue;
}
if (typeof layer !== "undefined") {
if (typeof item[5] === "undefined") {
item[5] = layer;
} else {
item[1] = "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {").concat(item[1], "}");
item[5] = layer;
}
}
if (media) {
if (!item[2]) {
item[2] = media;
} else {
item[1] = "@media ".concat(item[2], " {").concat(item[1], "}");
item[2] = media;
}
}
if (supports) {
if (!item[4]) {
item[4] = "".concat(supports);
} else {
item[1] = "@supports (".concat(item[4], ") {").concat(item[1], "}");
item[4] = supports;
}
}
list.push(item);
}
};
return list;
};
/***/ }),
/* 1 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/***/ 81:
/***/ ((module) => {
var isOldIE = function isOldIE() {
var memo;
return function memorize() {
if (typeof memo === 'undefined') {
// Test for IE <= 9 as proposed by Browserhacks
// @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805
// Tests for existence of standard globals is to allow style-loader
// to operate correctly into non-standard environments
// @see https://github.com/webpack-contrib/style-loader/issues/177
memo = Boolean(window && document && document.all && !window.atob);
}
return memo;
};
}();
module.exports = function (i) {
return i[1];
};
var getTarget = function getTarget() {
var memo = {};
return function memorize(target) {
if (typeof memo[target] === 'undefined') {
var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself
/***/ }),
if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
try {
// This will throw an exception if access to iframe is blocked
// due to cross-origin restrictions
styleTarget = styleTarget.contentDocument.head;
} catch (e) {
// istanbul ignore next
styleTarget = null;
}
}
/***/ 379:
/***/ ((module) => {
memo[target] = styleTarget;
}
return memo[target];
};
}();
var stylesInDom = [];
var stylesInDOM = [];

@@ -176,4 +150,4 @@ function getIndexByIdentifier(identifier) {

for (var i = 0; i < stylesInDom.length; i++) {
if (stylesInDom[i].identifier === identifier) {
for (var i = 0; i < stylesInDOM.length; i++) {
if (stylesInDOM[i].identifier === identifier) {
result = i;

@@ -197,16 +171,20 @@ break;

idCountMap[id] = count + 1;
var index = getIndexByIdentifier(identifier);
var indexByIdentifier = getIndexByIdentifier(identifier);
var obj = {
css: item[1],
media: item[2],
sourceMap: item[3]
sourceMap: item[3],
supports: item[4],
layer: item[5]
};
if (index !== -1) {
stylesInDom[index].references++;
stylesInDom[index].updater(obj);
if (indexByIdentifier !== -1) {
stylesInDOM[indexByIdentifier].references++;
stylesInDOM[indexByIdentifier].updater(obj);
} else {
stylesInDom.push({
var updater = addElementStyle(obj, options);
options.byIndex = i;
stylesInDOM.splice(i, 0, {
identifier: identifier,
updater: addStyle(obj, options),
updater: updater,
references: 1

@@ -222,306 +200,353 @@ });

function insertStyleElement(options) {
var style = document.createElement('style');
var attributes = options.attributes || {};
function addElementStyle(obj, options) {
var api = options.domAPI(options);
api.update(obj);
if (typeof attributes.nonce === 'undefined') {
var nonce = true ? __webpack_require__.nc : undefined;
var updater = function updater(newObj) {
if (newObj) {
if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap && newObj.supports === obj.supports && newObj.layer === obj.layer) {
return;
}
if (nonce) {
attributes.nonce = nonce;
api.update(obj = newObj);
} else {
api.remove();
}
}
};
Object.keys(attributes).forEach(function (key) {
style.setAttribute(key, attributes[key]);
});
return updater;
}
if (typeof options.insert === 'function') {
options.insert(style);
} else {
var target = getTarget(options.insert || 'head');
module.exports = function (list, options) {
options = options || {};
list = list || [];
var lastIdentifiers = modulesToDom(list, options);
return function update(newList) {
newList = newList || [];
if (!target) {
throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");
for (var i = 0; i < lastIdentifiers.length; i++) {
var identifier = lastIdentifiers[i];
var index = getIndexByIdentifier(identifier);
stylesInDOM[index].references--;
}
target.appendChild(style);
}
var newLastIdentifiers = modulesToDom(newList, options);
return style;
}
for (var _i = 0; _i < lastIdentifiers.length; _i++) {
var _identifier = lastIdentifiers[_i];
function removeStyleElement(style) {
// istanbul ignore if
if (style.parentNode === null) {
return false;
}
var _index = getIndexByIdentifier(_identifier);
style.parentNode.removeChild(style);
}
/* istanbul ignore next */
if (stylesInDOM[_index].references === 0) {
stylesInDOM[_index].updater();
stylesInDOM.splice(_index, 1);
}
}
var replaceText = function replaceText() {
var textStore = [];
return function replace(index, replacement) {
textStore[index] = replacement;
return textStore.filter(Boolean).join('\n');
lastIdentifiers = newLastIdentifiers;
};
}();
};
function applyToSingletonTag(style, index, remove, obj) {
var css = remove ? '' : obj.media ? "@media ".concat(obj.media, " {").concat(obj.css, "}") : obj.css; // For old IE
/***/ }),
/* istanbul ignore if */
/***/ 569:
/***/ ((module) => {
if (style.styleSheet) {
style.styleSheet.cssText = replaceText(index, css);
} else {
var cssNode = document.createTextNode(css);
var childNodes = style.childNodes;
if (childNodes[index]) {
style.removeChild(childNodes[index]);
var memo = {};
/* istanbul ignore next */
function getTarget(target) {
if (typeof memo[target] === "undefined") {
var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself
if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
try {
// This will throw an exception if access to iframe is blocked
// due to cross-origin restrictions
styleTarget = styleTarget.contentDocument.head;
} catch (e) {
// istanbul ignore next
styleTarget = null;
}
}
if (childNodes.length) {
style.insertBefore(cssNode, childNodes[index]);
} else {
style.appendChild(cssNode);
}
memo[target] = styleTarget;
}
return memo[target];
}
/* istanbul ignore next */
function applyToTag(style, options, obj) {
var css = obj.css;
var media = obj.media;
var sourceMap = obj.sourceMap;
if (media) {
style.setAttribute('media', media);
} else {
style.removeAttribute('media');
function insertBySelector(insert, style) {
var target = getTarget(insert);
if (!target) {
throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");
}
if (sourceMap && btoa) {
css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */");
} // For old IE
target.appendChild(style);
}
/* istanbul ignore if */
module.exports = insertBySelector;
/***/ }),
if (style.styleSheet) {
style.styleSheet.cssText = css;
} else {
while (style.firstChild) {
style.removeChild(style.firstChild);
}
/***/ 216:
/***/ ((module) => {
style.appendChild(document.createTextNode(css));
}
/* istanbul ignore next */
function insertStyleElement(options) {
var element = document.createElement("style");
options.setAttributes(element, options.attributes);
options.insert(element, options.options);
return element;
}
var singleton = null;
var singletonCounter = 0;
module.exports = insertStyleElement;
function addStyle(obj, options) {
var style;
var update;
var remove;
/***/ }),
if (options.singleton) {
var styleIndex = singletonCounter++;
style = singleton || (singleton = insertStyleElement(options));
update = applyToSingletonTag.bind(null, style, styleIndex, false);
remove = applyToSingletonTag.bind(null, style, styleIndex, true);
} else {
style = insertStyleElement(options);
update = applyToTag.bind(null, style, options);
/***/ 565:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
remove = function remove() {
removeStyleElement(style);
};
}
update(obj);
return function updateStyle(newObj) {
if (newObj) {
if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) {
return;
}
update(obj = newObj);
} else {
remove();
}
};
/* istanbul ignore next */
function setAttributesWithoutAttributes(styleElement) {
var nonce = true ? __webpack_require__.nc : 0;
if (nonce) {
styleElement.setAttribute("nonce", nonce);
}
}
module.exports = function (list, options) {
options = options || {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
// tags it will allow on a page
module.exports = setAttributesWithoutAttributes;
if (!options.singleton && typeof options.singleton !== 'boolean') {
options.singleton = isOldIE();
}
/***/ }),
list = list || [];
var lastIdentifiers = modulesToDom(list, options);
return function update(newList) {
newList = newList || [];
/***/ 795:
/***/ ((module) => {
if (Object.prototype.toString.call(newList) !== '[object Array]') {
return;
}
for (var i = 0; i < lastIdentifiers.length; i++) {
var identifier = lastIdentifiers[i];
var index = getIndexByIdentifier(identifier);
stylesInDom[index].references--;
}
var newLastIdentifiers = modulesToDom(newList, options);
/* istanbul ignore next */
function apply(styleElement, options, obj) {
var css = "";
for (var _i = 0; _i < lastIdentifiers.length; _i++) {
var _identifier = lastIdentifiers[_i];
if (obj.supports) {
css += "@supports (".concat(obj.supports, ") {");
}
var _index = getIndexByIdentifier(_identifier);
if (obj.media) {
css += "@media ".concat(obj.media, " {");
}
if (stylesInDom[_index].references === 0) {
stylesInDom[_index].updater();
var needLayer = typeof obj.layer !== "undefined";
stylesInDom.splice(_index, 1);
}
}
if (needLayer) {
css += "@layer".concat(obj.layer.length > 0 ? " ".concat(obj.layer) : "", " {");
}
lastIdentifiers = newLastIdentifiers;
};
};
css += obj.css;
/***/ }),
/* 2 */
/***/ (function(module, exports, __webpack_require__) {
if (needLayer) {
css += "}";
}
// Imports
var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(3);
exports = ___CSS_LOADER_API_IMPORT___(false);
// Module
exports.push([module.i, ".hb-bg-white{background-color:#fff}.hb-bg-gray-400{background-color:#cbd5e0}.hb-bg-gray-900{background-color:#1a202c}.hb-bg-red-100{background-color:#fff5f5}.hb-bg-red-400{background-color:#fc8181}.hb-bg-orange-300{background-color:#fbd38d}.hb-bg-orange-800{background-color:#9c4221}.hb-bg-yellow-100{background-color:ivory}.hb-bg-yellow-300{background-color:#faf089}.hb-bg-green-100{background-color:#f0fff4}.hb-bg-green-600{background-color:#38a169}.hb-bg-teal-500{background-color:#38b2ac}.hb-bg-teal-900{background-color:#234e52}.hb-bg-blue-100{background-color:#ebf8ff}.hb-bg-blue-900{background-color:#2a4365}.hb-bg-indigo-100{background-color:#ebf4ff}.hb-bg-indigo-800{background-color:#434190}.hover\\:hb-bg-gray-800:hover{background-color:#2d3748}.focus\\:hb-bg-gray-800:focus{background-color:#2d3748}.hb-rounded-md{border-radius:.375rem}.hb-rounded-full{border-radius:9999px}.hb-cursor-pointer{cursor:pointer}.hb-flex{display:flex}.hb-inline-flex{display:inline-flex}.hb-items-center{align-items:center}.hb-justify-between{justify-content:space-between}.hb-font-semibold{font-weight:600}.hb-h-3{height:.75rem}.hb-h-4{height:1rem}.hb-leading-relaxed{line-height:1.625}.hb-mx-2{margin-left:.5rem;margin-right:.5rem}.hb-mx-5{margin-left:1.25rem;margin-right:1.25rem}.hb--mr-2{margin-right:-.5rem}.focus\\:hb-outline-none:focus{outline:0}.hb-p-1{padding:.25rem}.hb-px-1{padding-left:.25rem;padding-right:.25rem}.hb-py-2{padding-top:.5rem;padding-bottom:.5rem}.hb-px-2{padding-left:.5rem;padding-right:.5rem}.hb-text-gray-100{color:#f7fafc}.hb-text-gray-800{color:#2d3748}.hb-text-gray-900{color:#1a202c}.hb-text-red-900{color:#742a2a}.hb-text-orange-100{color:#fffaf0}.hb-text-orange-900{color:#7b341e}.hb-text-yellow-900{color:#744210}.hb-text-green-100{color:#f0fff4}.hb-text-green-900{color:#22543d}.hb-text-teal-100{color:#e6fffa}.hb-text-blue-100{color:#ebf8ff}.hb-text-blue-900{color:#2a4365}.hb-text-indigo-100{color:#ebf4ff}.hb-text-indigo-900{color:#3c366b}.hover\\:hb-text-white:hover{color:#fff}.hover\\:hb-text-gray-300:hover{color:#e2e8f0}.hover\\:hb-text-gray-600:hover{color:#718096}.hover\\:hb-text-red-100:hover{color:#fff5f5}.hover\\:hb-text-orange-700:hover{color:#c05621}.hover\\:hb-text-yellow-700:hover{color:#b7791f}.hover\\:hb-text-green-300:hover{color:#9ae6b4}.hover\\:hb-text-teal-300:hover{color:#81e6d9}.hover\\:hb-text-blue-300:hover{color:#90cdf4}.hover\\:hb-text-indigo-300:hover{color:#a3bffa}.hb-text-xs{font-size:.75rem}.hb-text-sm{font-size:.875rem}.hb-uppercase{text-transform:uppercase}.hover\\:hb-underline:hover{text-decoration:underline}.hb-tracking-wider{letter-spacing:.05em}.hb-w-3{width:.75rem}.hb-w-4{width:1rem}.hb-w-full{width:100%}a{color:inherit;text-decoration:inherit;background-color:transparent}*{box-sizing:border-box;border:0 solid #e2e8f0}.fade-in-top{-webkit-animation:fade-in-top .8s cubic-bezier(.39,.575,.565,1);animation:fade-in-top .8s cubic-bezier(.39,.575,.565,1)}@-webkit-keyframes fade-in-top{to{transform:translateY(0);opacity:1}}@keyframes fade-in-top{0%{transform:translateY(-50px);opacity:0}to{transform:translateY(0);opacity:1}}@media (min-width:768px){.md\\:hb-flex-row{flex-direction:row}.md\\:hb-px-20{padding-left:5rem;padding-right:5rem}}", ""]);
// Exports
module.exports = exports;
if (obj.media) {
css += "}";
}
if (obj.supports) {
css += "}";
}
/***/ }),
/* 3 */
/***/ (function(module, exports, __webpack_require__) {
var sourceMap = obj.sourceMap;
"use strict";
if (sourceMap && typeof btoa !== "undefined") {
css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */");
} // For old IE
/* istanbul ignore if */
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
// css base code, injected by the css-loader
// eslint-disable-next-line func-names
module.exports = function (useSourceMap) {
var list = []; // return the list of modules as css string
list.toString = function toString() {
return this.map(function (item) {
var content = cssWithMappingToString(item, useSourceMap);
options.styleTagTransform(css, styleElement, options.options);
}
if (item[2]) {
return "@media ".concat(item[2], " {").concat(content, "}");
}
function removeStyleElement(styleElement) {
// istanbul ignore if
if (styleElement.parentNode === null) {
return false;
}
return content;
}).join('');
}; // import a list of modules into the list
// eslint-disable-next-line func-names
styleElement.parentNode.removeChild(styleElement);
}
/* istanbul ignore next */
list.i = function (modules, mediaQuery, dedupe) {
if (typeof modules === 'string') {
// eslint-disable-next-line no-param-reassign
modules = [[null, modules, '']];
function domAPI(options) {
var styleElement = options.insertStyleElement(options);
return {
update: function update(obj) {
apply(styleElement, options, obj);
},
remove: function remove() {
removeStyleElement(styleElement);
}
};
}
var alreadyImportedModules = {};
module.exports = domAPI;
if (dedupe) {
for (var i = 0; i < this.length; i++) {
// eslint-disable-next-line prefer-destructuring
var id = this[i][0];
/***/ }),
if (id != null) {
alreadyImportedModules[id] = true;
}
}
/***/ 589:
/***/ ((module) => {
/* istanbul ignore next */
function styleTagTransform(css, styleElement) {
if (styleElement.styleSheet) {
styleElement.styleSheet.cssText = css;
} else {
while (styleElement.firstChild) {
styleElement.removeChild(styleElement.firstChild);
}
for (var _i = 0; _i < modules.length; _i++) {
var item = [].concat(modules[_i]);
styleElement.appendChild(document.createTextNode(css));
}
}
if (dedupe && alreadyImportedModules[item[0]]) {
// eslint-disable-next-line no-continue
continue;
}
module.exports = styleTagTransform;
if (mediaQuery) {
if (!item[2]) {
item[2] = mediaQuery;
} else {
item[2] = "".concat(mediaQuery, " and ").concat(item[2]);
}
}
/***/ })
list.push(item);
}
};
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ id: moduleId,
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/compat get default export */
/******/ (() => {
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = (module) => {
/******/ var getter = module && module.__esModule ?
/******/ () => (module['default']) :
/******/ () => (module);
/******/ __webpack_require__.d(getter, { a: getter });
/******/ return getter;
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/nonce */
/******/ (() => {
/******/ __webpack_require__.nc = undefined;
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
(() => {
return list;
};
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
"default": () => (/* binding */ src)
});
function cssWithMappingToString(item, useSourceMap) {
var content = item[1] || ''; // eslint-disable-next-line prefer-destructuring
// EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(379);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(795);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(569);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(565);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(216);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(589);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!./node_modules/postcss-loader/dist/cjs.js!./src/styles.css
var styles = __webpack_require__(363);
;// CONCATENATED MODULE: ./src/styles.css
var cssMapping = item[3];
if (!cssMapping) {
return content;
}
var options = {};
if (useSourceMap && typeof btoa === 'function') {
var sourceMapping = toComment(cssMapping);
var sourceURLs = cssMapping.sources.map(function (source) {
return "/*# sourceURL=".concat(cssMapping.sourceRoot || '').concat(source, " */");
});
return [content].concat(sourceURLs).concat([sourceMapping]).join('\n');
}
options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());
return [content].join('\n');
} // Adapted from convert-source-map (MIT)
options.insert = insertBySelector_default().bind(null, "head");
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());
var update = injectStylesIntoStyleTag_default()(styles/* default */.Z, options);
function toComment(sourceMap) {
// eslint-disable-next-line no-undef
var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));
var data = "sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(base64);
return "/*# ".concat(data, " */");
}
/***/ }),
/* 4 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXTERNAL MODULE: ./src/styles.css
var styles = __webpack_require__(0);
/* harmony default export */ const src_styles = (styles/* default */.Z && styles/* default.locals */.Z.locals ? styles/* default.locals */.Z.locals : undefined);
// CONCATENATED MODULE: ./src/banner/styling.js
;// CONCATENATED MODULE: ./src/banner/styling.js
/**

@@ -541,2 +566,3 @@ * The class styling configurations.

};
/**

@@ -547,3 +573,2 @@ * THe themes for the bars

*/
var themes = {

@@ -623,3 +648,3 @@ gray: {

};
// CONCATENATED MODULE: ./src/config/config.js
;// CONCATENATED MODULE: ./src/config/config.js
/**

@@ -642,6 +667,5 @@ * The default configuration for the package

redirect: 'follow' // manual, *follow, error
}
};
// CONCATENATED MODULE: ./src/functions/normalise.js
;// CONCATENATED MODULE: ./src/functions/normalise.js
/**

@@ -662,9 +686,7 @@ * Gets the normal format of the returned API data

var _data$ = data[0],
rendered = _data$.title.rendered,
link = _data$.link;
rendered = _data$.title.rendered,
link = _data$.link;
if (rendered == undefined) {
console.error("WP-json response doesn't have real values %o", data[0]);
}
return {

@@ -675,8 +697,8 @@ title: rendered,

}
/**
* Default normaliser parser assignment.
*/
var normaliseParser = wpJsonParser;
var normaliseParser = wpJsonParser;
/**

@@ -687,3 +709,2 @@ * Sets the parser for the data normaliser.

*/
function initNormalise(parser) {

@@ -694,2 +715,3 @@ // if the parser is a function set it

}
/**

@@ -700,3 +722,2 @@ * Uses the defined parser to normalise the data that comes out.

*/
function normaliser(data) {

@@ -711,3 +732,2 @@ return new Promise(function (resolve, reject) {

}
reject({

@@ -719,6 +739,7 @@ "error": "No Data",

}
// CONCATENATED MODULE: ./src/functions/init.js
;// CONCATENATED MODULE: ./src/functions/init.js
/**

@@ -743,3 +764,2 @@ * Set all the configuration options for the hBar library

*/
function init_init() {

@@ -749,26 +769,23 @@ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

configuration.$el = options.el;
configuration.url = options.url; // if the user has dompurify installed. It can be optional
configuration.url = options.url;
// if the user has dompurify installed. It can be optional
configuration.DOMPurify = options.DOMPurify || null;
configuration.theme = themes[options.theme] || 'grey';
configuration.badge = options.badge || 'New'; // we will default to false for configuration
configuration.badge = options.badge || null;
// we will default to false for configuration
configuration.dismissible = options.dismissible || false;
configuration.dismissFor = options.dismissFor || false;
configuration.secondaryLinks = options.secondaryLinks || [];
/**
* These will be the fallbacks if something isn't found.
*/
configuration.title = options.title || null;
configuration.link = options.link || null;
configuration.onCompleted = options.onCompleted || function () {};
configuration.onFailure = options.onFailure || function () {};
if (typeof options.fetch == 'function') {
configuration.fetch = options.fetch;
}
configuration.fetchOptions = config.fetchOptions;

@@ -779,15 +796,9 @@ configuration.fetchOptions.headers = Object.assign(config.fetchOptions.headers, options.headers);

}
// CONCATENATED MODULE: ./src/utils.js
;// CONCATENATED MODULE: ./src/utils.js
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
// Thanks @stimulus: and I got it from @alpinejs

@@ -804,2 +815,3 @@ // https://github.com/stimulusjs/stimulus/blob/master/packages/%40stimulus/core/src/application.ts

}
/**

@@ -814,13 +826,9 @@ * Create a new document element

*/
function newElement(element, _ref) {
var children = _ref.children,
classes = _ref.classes;
classes = _ref.classes;
var parent = document.createElement(element);
var documentFragment = document.createDocumentFragment();
addClasses(parent, classes || '');
if (children)
/*run*/
{
if (children) /*run*/{
children.forEach(function (child) {

@@ -836,3 +844,2 @@ if (Array.isArray(child)) {

}
parent.appendChild(documentFragment);

@@ -843,10 +850,8 @@ return parent;

var _element$classList;
var classes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
var splitClasses = classes.trim().split(' ');
(_element$classList = element.classList).add.apply(_element$classList, _toConsumableArray(splitClasses));
return element;
}
/**

@@ -858,10 +863,7 @@ * Binds all the methods on a JS Class to the `this` context of the class.

*/
function autoBind(self) {
var keys = Object.getOwnPropertyNames(self.constructor.prototype);
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
var val = self[key];
if (key !== 'constructor' && typeof val === 'function') {

@@ -871,5 +873,5 @@ self[key] = val.bind(self);

}
return self;
}
/**

@@ -881,3 +883,2 @@ * Gets the data-* values that area related to the config of the template options.

*/
function getElementOptions(element) {

@@ -890,2 +891,3 @@ return {

}
/**

@@ -896,14 +898,10 @@ * Determines if the banner has been dismissed.

*/
function isDismissed() {
if (localStorage) {
var dismissDate = localStorage.getItem('h-bar_dismiss_for');
if (!dismissDate) {
return false;
}
dismissDate = dismissDate;
var ourDate = new Date().getTime();
if (ourDate <= dismissDate) {

@@ -913,12 +911,11 @@ return true;

}
return false;
}
// CONCATENATED MODULE: ./src/functions/renderer.js
;// CONCATENATED MODULE: ./src/functions/renderer.js
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
var Renderer = /*#__PURE__*/function () {

@@ -934,7 +931,5 @@ /**

_classCallCheck(this, Renderer);
this.template = document.querySelector(el);
this.DOMPurify = DOMPurify;
}
_createClass(Renderer, [{

@@ -944,12 +939,10 @@ key: "resolve",

var _this = this;
var templateHTML = this.template.innerHTML;
var templateHTML = this.template.innerHTML;
/**
* Don't do anything if there is a no content
*/
if (templateHTML == undefined) {
return null;
}
Object.keys(data).forEach(function (key) {

@@ -960,13 +953,11 @@ // skip any array things.

var regex = _this.regex(key);
templateHTML = templateHTML.replace(regex, data[key]);
}
});
if (this.DOMPurify) {
return this.DOMPurify.sanitize(templateHTML);
}
return templateHTML;
}
/**

@@ -978,3 +969,2 @@ * Create the matching regex for the template tags

*/
}, {

@@ -987,18 +977,15 @@ key: "regex",

}]);
return Renderer;
}();
// CONCATENATED MODULE: ./src/banner/banner.js
;// CONCATENATED MODULE: ./src/banner/banner.js
function banner_typeof(obj) { "@babel/helpers - typeof"; return banner_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, banner_typeof(obj); }
function banner_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function banner_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, banner_toPropertyKey(descriptor.key), descriptor); } }
function banner_createClass(Constructor, protoProps, staticProps) { if (protoProps) banner_defineProperties(Constructor.prototype, protoProps); if (staticProps) banner_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function banner_toPropertyKey(arg) { var key = banner_toPrimitive(arg, "string"); return banner_typeof(key) === "symbol" ? key : String(key); }
function banner_toPrimitive(input, hint) { if (banner_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (banner_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
function banner_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function banner_createClass(Constructor, protoProps, staticProps) { if (protoProps) banner_defineProperties(Constructor.prototype, protoProps); if (staticProps) banner_defineProperties(Constructor, staticProps); return Constructor; }
var banner_Banner = /*#__PURE__*/function () {
var Banner = /*#__PURE__*/function () {
/**

@@ -1010,9 +997,7 @@ *

var $el = _ref.$el,
dismissible = _ref.dismissible,
dismissFor = _ref.dismissFor,
theme = _ref.theme,
badge = _ref.badge;
dismissible = _ref.dismissible,
dismissFor = _ref.dismissFor,
theme = _ref.theme,
badge = _ref.badge;
banner_classCallCheck(this, Banner);
this.$el = $el;

@@ -1024,7 +1009,6 @@ this.dismissible = dismissible;

}
/**
* Render the element.
*/
banner_createClass(Banner, [{

@@ -1034,6 +1018,5 @@ key: "resolve",

var _this = this;
var title = _ref2.title,
link = _ref2.link,
secondaryLinks = _ref2.secondaryLinks;
link = _ref2.link,
secondaryLinks = _ref2.secondaryLinks;
if (isDismissed()) return;

@@ -1045,8 +1028,5 @@ domReady().then(function () {

}
var secondaryElement = null;
if (!_this.dismissible) {
var secondaryLinkList = _this.createSecondaryLinks(secondaryLinks);
secondaryElement = newElement('div', {

@@ -1059,18 +1039,23 @@ children: secondaryLinkList,

}
var badgeElement = newElement('span', {
classes: "".concat(styling.badge, " ").concat(_this.theme.badge)
});
var badgeElement = null;
if (_this.badge) {
badgeElement = newElement('span', {
classes: "".concat(styling.badge, " ").concat(_this.theme.badge)
});
badgeElement.innerText = _this.badge;
}
var postLink = newElement('a', {
classes: "".concat(styling.postTitle, " ").concat(_this.theme.postTitle)
});
badgeElement.innerText = _this.badge;
postLink.href = link;
postLink.innerText = title;
postLink.innerHTML += "\n <svg class=\"hb-h-3 hb-w-3\" viewBox=\"0 0 20 20\" fill=\"currentColor\">\n <path fill-rule=\"evenodd\" d=\"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z\" clip-rule=\"evenodd\"/>\n </svg>\n ";
var postChildren = [postLink];
if (badgeElement) {
postChildren.unshift(badgeElement);
}
var postElement = newElement('div', {
classes: "".concat(styling.linkWrapper, " ").concat(_this.theme.linkWrapper),
children: [badgeElement, postLink]
children: postChildren
});
var _hbar = newElement('div', {

@@ -1080,3 +1065,2 @@ classes: "".concat(styling.wrapper, " ").concat(_this.theme.wrapper),

});
var container = document.querySelector(_this.$el);

@@ -1087,2 +1071,3 @@ container.innerHTML = "";

}
/**

@@ -1094,3 +1079,2 @@ * Removes the element in the case of it having issues.

*/
}, {

@@ -1106,5 +1090,5 @@ key: "destroy",

}
return false;
}
/**

@@ -1115,3 +1099,2 @@ * Creates the HTML node for a dismissible button.

*/
}, {

@@ -1121,3 +1104,2 @@ key: "dismissibleButton",

var _this2 = this;
var dismiss = newElement('button', {

@@ -1127,21 +1109,18 @@ classes: "hb--mr-2 hb-flex hb-p-1 hb-rounded-md ".concat(this.theme.dismiss, " hover:hb-text-white hover:hb-bg-gray-800 focus:hb-outline-none focus:hb-bg-gray-800")

dismiss.innerHTML = "<svg class=\"hb-h-4 hb-w-4\" stroke=\"currentColor\" fill=\"none\" viewBox=\"0 0 24 24\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M6 18L18 6M6 6l12 12\"></path>\n </svg>";
dismiss.onclick = function (e) {
e.preventDefault(); // just do it early if we not logging time.
e.preventDefault();
// just do it early if we not logging time.
if (!_this2.dismissFor) return _this2.destroy();
if (localStorage) {
localStorage.setItem('h-bar_dismiss_for', _this2.dismissFor.getTime());
}
return _this2.destroy();
};
return dismiss;
}
/**
* Creates the secondary links for the bar.
*/
}, {

@@ -1151,7 +1130,6 @@ key: "createSecondaryLinks",

var _this3 = this;
if (!secondaryLinks) return [];
return secondaryLinks.map(function (_ref3) {
var title = _ref3.title,
link = _ref3.link;
link = _ref3.link;
var style = "".concat(styling.secondaryLink, " ").concat(_this3.theme.secondaryLink);

@@ -1167,10 +1145,7 @@ var butter = newElement('a', {

}]);
return Banner;
}();
// CONCATENATED MODULE: ./src/index.js
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
;// CONCATENATED MODULE: ./src/index.js
function src_typeof(obj) { "@babel/helpers - typeof"; return src_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, src_typeof(obj); }
/**

@@ -1189,2 +1164,3 @@ * h-bar banner and dynamic announcement library

/**

@@ -1209,3 +1185,2 @@ * Set all the configuration options for the hBar library

*/
var hBar = {

@@ -1216,3 +1191,2 @@ version: "2.0.0",

usingBanner: true,
/**

@@ -1239,3 +1213,2 @@ * Set all the configuration options for the hBar library

this.$elementOpt = getElementOptions(document.querySelector(this.$el));
if (this.$elementOpt.template) {

@@ -1249,5 +1222,4 @@ this.renderer = new Renderer(this.$elementOpt.template, this.DOMPurify);

} else {
this.renderer = new banner_Banner(this);
this.renderer = new Banner(this);
}
Object.defineProperties(this, {

@@ -1260,3 +1232,2 @@ 'renderer': {

},
/**

@@ -1271,11 +1242,8 @@ * Gets the data from the url endpoint.

}
fetch.toString = function () {
return _fetch.toString();
};
return fetch;
}(function () {
var _this = this;
if (this.rendered) return;

@@ -1287,3 +1255,3 @@ if (isDismissed()) return;

}).then(function (json) {
if (_typeof(json) == "object") {
if (src_typeof(json) == "object") {
_this.render(json);

@@ -1293,3 +1261,2 @@ } else {

}
_this.fetching = false;

@@ -1302,3 +1269,2 @@ })["catch"](function (error) {

}),
/**

@@ -1311,3 +1277,2 @@ * Render the response to the actual message

var _this2 = this;
normaliser(result).then(function (result) {

@@ -1318,3 +1283,2 @@ var element = document.querySelector(_this2.$el);

_this2.rendered = true;
_this2.onCompleted({

@@ -1326,8 +1290,5 @@ __hbar__: _this2,

console.error(error);
_this2.destroy();
_this2.fetching = false;
_this2.rendered = false;
_this2.onFailure({

@@ -1338,3 +1299,2 @@ __hbar__: _this2

},
/**

@@ -1354,3 +1314,2 @@ * Removes the element in the case of it having issues.

}
return false;

@@ -1376,6 +1335,9 @@ }

});
/* harmony default export */ var src = __webpack_exports__["default"] = (hBar);
/* harmony default export */ const src = (hBar);
})();
/***/ })
/******/ ])["default"];
__webpack_exports__ = __webpack_exports__["default"];
/******/ return __webpack_exports__;
/******/ })()
;
});

@@ -1,8 +0,2 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.hBar=t():e.hBar=t()}(window,function(){return n={},o.m=r=[function(e,t,r){var n=r(1),o=r(2);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var i={insert:"head",singleton:!1},a=(n(o,i),o.locals?o.locals:{});e.exports=a},function(e,t,i){"use strict";var r,n,o=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},a=(n={},function(e){if(void 0===n[e]){var t=document.querySelector(e);if(window.HTMLIFrameElement&&t instanceof window.HTMLIFrameElement)try{t=t.contentDocument.head}catch(e){t=null}n[e]=t}return n[e]}),b=[];function d(e){for(var t=-1,r=0;r<b.length;r++)if(b[r].identifier===e){t=r;break}return t}function l(e,t){for(var r={},n=[],o=0;o<e.length;o++){var i=e[o],a=t.base?i[0]+t.base:i[0],c=r[a]||0,l="".concat(a," ").concat(c);r[a]=c+1;var s=d(l),h={css:i[1],media:i[2],sourceMap:i[3]};-1!==s?(b[s].references++,b[s].updater(h)):b.push({identifier:l,updater:p(h,t),references:1}),n.push(l)}return n}function c(e){var t=document.createElement("style"),r=e.attributes||{};if(void 0===r.nonce){var n=i.nc;n&&(r.nonce=n)}if(Object.keys(r).forEach(function(e){t.setAttribute(e,r[e])}),"function"==typeof e.insert)e.insert(t);else{var o=a(e.insert||"head");if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(t)}return t}var s,h=(s=[],function(e,t){return s[e]=t,s.filter(Boolean).join("\n")});function u(e,t,r,n){var o=r?"":n.media?"@media ".concat(n.media," {").concat(n.css,"}"):n.css;if(e.styleSheet)e.styleSheet.cssText=h(t,o);else{var i=document.createTextNode(o),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(i,a[t]):e.appendChild(i)}}var f=null,g=0;function p(t,e){var r,n,o;if(e.singleton){var i=g++;r=f=f||c(e),n=u.bind(null,r,i,!1),o=u.bind(null,r,i,!0)}else r=c(e),n=function(e,t,r){var n=r.css,o=r.media,i=r.sourceMap;if(o?e.setAttribute("media",o):e.removeAttribute("media"),i&&btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}.bind(null,r,e),o=function(){var e;null!==(e=r).parentNode&&e.parentNode.removeChild(e)};return n(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;n(t=e)}else o()}}e.exports=function(e,a){(a=a||{}).singleton||"boolean"==typeof a.singleton||(a.singleton=o());var c=l(e=e||[],a);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var t=0;t<c.length;t++){var r=d(c[t]);b[r].references--}for(var n=l(e,a),o=0;o<c.length;o++){var i=d(c[o]);0===b[i].references&&(b[i].updater(),b.splice(i,1))}c=n}}}},function(e,t,r){(t=r(3)(!1)).push([e.i,".hb-bg-white{background-color:#fff}.hb-bg-gray-400{background-color:#cbd5e0}.hb-bg-gray-900{background-color:#1a202c}.hb-bg-red-100{background-color:#fff5f5}.hb-bg-red-400{background-color:#fc8181}.hb-bg-orange-300{background-color:#fbd38d}.hb-bg-orange-800{background-color:#9c4221}.hb-bg-yellow-100{background-color:ivory}.hb-bg-yellow-300{background-color:#faf089}.hb-bg-green-100{background-color:#f0fff4}.hb-bg-green-600{background-color:#38a169}.hb-bg-teal-500{background-color:#38b2ac}.hb-bg-teal-900{background-color:#234e52}.hb-bg-blue-100{background-color:#ebf8ff}.hb-bg-blue-900{background-color:#2a4365}.hb-bg-indigo-100{background-color:#ebf4ff}.hb-bg-indigo-800{background-color:#434190}.hover\\:hb-bg-gray-800:hover{background-color:#2d3748}.focus\\:hb-bg-gray-800:focus{background-color:#2d3748}.hb-rounded-md{border-radius:.375rem}.hb-rounded-full{border-radius:9999px}.hb-cursor-pointer{cursor:pointer}.hb-flex{display:flex}.hb-inline-flex{display:inline-flex}.hb-items-center{align-items:center}.hb-justify-between{justify-content:space-between}.hb-font-semibold{font-weight:600}.hb-h-3{height:.75rem}.hb-h-4{height:1rem}.hb-leading-relaxed{line-height:1.625}.hb-mx-2{margin-left:.5rem;margin-right:.5rem}.hb-mx-5{margin-left:1.25rem;margin-right:1.25rem}.hb--mr-2{margin-right:-.5rem}.focus\\:hb-outline-none:focus{outline:0}.hb-p-1{padding:.25rem}.hb-px-1{padding-left:.25rem;padding-right:.25rem}.hb-py-2{padding-top:.5rem;padding-bottom:.5rem}.hb-px-2{padding-left:.5rem;padding-right:.5rem}.hb-text-gray-100{color:#f7fafc}.hb-text-gray-800{color:#2d3748}.hb-text-gray-900{color:#1a202c}.hb-text-red-900{color:#742a2a}.hb-text-orange-100{color:#fffaf0}.hb-text-orange-900{color:#7b341e}.hb-text-yellow-900{color:#744210}.hb-text-green-100{color:#f0fff4}.hb-text-green-900{color:#22543d}.hb-text-teal-100{color:#e6fffa}.hb-text-blue-100{color:#ebf8ff}.hb-text-blue-900{color:#2a4365}.hb-text-indigo-100{color:#ebf4ff}.hb-text-indigo-900{color:#3c366b}.hover\\:hb-text-white:hover{color:#fff}.hover\\:hb-text-gray-300:hover{color:#e2e8f0}.hover\\:hb-text-gray-600:hover{color:#718096}.hover\\:hb-text-red-100:hover{color:#fff5f5}.hover\\:hb-text-orange-700:hover{color:#c05621}.hover\\:hb-text-yellow-700:hover{color:#b7791f}.hover\\:hb-text-green-300:hover{color:#9ae6b4}.hover\\:hb-text-teal-300:hover{color:#81e6d9}.hover\\:hb-text-blue-300:hover{color:#90cdf4}.hover\\:hb-text-indigo-300:hover{color:#a3bffa}.hb-text-xs{font-size:.75rem}.hb-text-sm{font-size:.875rem}.hb-uppercase{text-transform:uppercase}.hover\\:hb-underline:hover{text-decoration:underline}.hb-tracking-wider{letter-spacing:.05em}.hb-w-3{width:.75rem}.hb-w-4{width:1rem}.hb-w-full{width:100%}a{color:inherit;text-decoration:inherit;background-color:transparent}*{box-sizing:border-box;border:0 solid #e2e8f0}.fade-in-top{-webkit-animation:fade-in-top .8s cubic-bezier(.39,.575,.565,1);animation:fade-in-top .8s cubic-bezier(.39,.575,.565,1)}@-webkit-keyframes fade-in-top{to{transform:translateY(0);opacity:1}}@keyframes fade-in-top{0%{transform:translateY(-50px);opacity:0}to{transform:translateY(0);opacity:1}}@media (min-width:768px){.md\\:hb-flex-row{flex-direction:row}.md\\:hb-px-20{padding-left:5rem;padding-right:5rem}}",""]),e.exports=t},function(e,t,r){"use strict";e.exports=function(r){var l=[];return l.toString=function(){return this.map(function(e){var t=function(e,t){var r=e[1]||"",n=e[3];if(!n)return r;if(t&&"function"==typeof btoa){var o=function(e){var t=btoa(unescape(encodeURIComponent(JSON.stringify(e)))),r="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(t);return"/*# ".concat(r," */")}(n),i=n.sources.map(function(e){return"/*# sourceURL=".concat(n.sourceRoot||"").concat(e," */")});return[r].concat(i).concat([o]).join("\n")}return[r].join("\n")}(e,r);return e[2]?"@media ".concat(e[2]," {").concat(t,"}"):t}).join("")},l.i=function(e,t,r){"string"==typeof e&&(e=[[null,e,""]]);var n={};if(r)for(var o=0;o<this.length;o++){var i=this[o][0];null!=i&&(n[i]=!0)}for(var a=0;a<e.length;a++){var c=[].concat(e[a]);r&&n[c[0]]||(t&&(c[2]?c[2]="".concat(t," and ").concat(c[2]):c[2]=t),l.push(c))}},l}},function(e,t,r){"use strict";r.r(t);r(0);var h="hb-flex hb-w-full hd-flex-col md:hb-flex-row hb-text-sm hb-py-2 md:hb-px-20 hb-px-1 hb-items-center hb-justify-between",b="hb-flex hb-items-center",d="hb-px-2 hb-mx-2 hb-leading-relaxed hb-tracking-wider hb-uppercase hb-font-semibold hb-rounded-full hb-text-xs",u="hover:hb-underline hb-inline-flex hb-items-center",i="hb-mx-5 hb-cursor-pointer hover:hb-underline",o={gray:{wrapper:"hb-bg-gray-900 hb-text-gray-100",linkWrapper:"",badge:"hb-bg-white hb-text-gray-900",postTitle:"hover:hb-text-gray-300",secondaryLink:"hover:hb-text-gray-300",dismiss:"hb-text-gray-800"},lightGray:{wrapper:"hb-bg-gray-400 hb-text-gray-900",linkWrapper:"",badge:"hb-bg-white hb-text-gray-900 shadow",postTitle:"hover:hb-text-gray-600",secondaryLink:"hover:hb-text-gray-600",dismiss:"hb-text-gray-800"},blue:{wrapper:"hb-bg-blue-900 hb-text-blue-100",linkWrapper:"",badge:"hb-bg-blue-100 hb-text-blue-900 shadow",postTitle:"hover:hb-text-blue-300",secondaryLink:"hover:hb-text-blue-300",dismiss:"hb-text-gray-800"},green:{wrapper:"hb-bg-green-600 hb-text-green-100",linkWrapper:"",badge:"hb-bg-green-100 hb-text-green-900",postTitle:"hover:hb-text-green-300",secondaryLink:"hover:hb-text-green-300",dismiss:"hb-text-gray-800"},indigo:{wrapper:"hb-bg-indigo-800 hb-text-indigo-100",linkWrapper:"",badge:"hb-bg-indigo-100 hb-text-indigo-900 shadow",postTitle:"hover:hb-text-indigo-300",secondaryLink:"hover:hb-text-indigo-300",dismiss:"hb-text-gray-800"},orange:{wrapper:"hb-bg-orange-300 hb-text-orange-900",linkWrapper:"",badge:"hb-bg-orange-800 hb-text-orange-100 shadow",postTitle:"hover:hb-text-orange-700",secondaryLink:"hover:hb-text-orange-700",dismiss:"hb-text-gray-800"},yellow:{wrapper:"hb-bg-yellow-300 hb-text-yellow-900",linkWrapper:"",badge:"hb-bg-yellow-100 hb-text-yellow-900 shadow",postTitle:"hover:hb-text-yellow-700",secondaryLink:"hover:hb-text-yellow-700",dismiss:"hb-text-gray-800"},teal:{wrapper:"hb-bg-teal-500 hb-text-teal-100",linkWrapper:"",badge:"hb-bg-teal-900 hb-text-teal-100 shadow",postTitle:"hover:hb-text-teal-300",secondaryLink:"hover:hb-text-teal-300",dismiss:"hb-text-gray-800"},red:{wrapper:"hb-bg-red-400 hb-text-red-900",linkWrapper:"",badge:"hb-bg-red-100 hb-text-red-900 shadow",postTitle:"hover:hb-text-red-100",secondaryLink:"hover:hb-text-red-100",dismiss:"hb-text-gray-800"}},a={method:"GET",mode:"cors",cache:"no-cache",headers:{Accept:"application/json"},redirect:"follow"};function c(e){var t=e[0],r=t.title.rendered,n=t.link;return null==r&&console.error("WP-json response doesn't have real values %o",e[0]),{title:r,link:n}}var l=c;function n(e){var t,r=0<arguments.length&&void 0!==e?e:{},n={};return n.$el=r.el,n.url=r.url,n.DOMPurify=r.DOMPurify||null,n.theme=o[r.theme]||"grey",n.badge=r.badge||"New",n.dismissible=r.dismissible||!1,n.dismissFor=r.dismissFor||!1,n.secondaryLinks=r.secondaryLinks||[],n.title=r.title||null,n.link=r.link||null,n.onCompleted=r.onCompleted||function(){},n.onFailure=r.onFailure||function(){},"function"==typeof r.fetch&&(n.fetch=r.fetch),n.fetchOptions=a,n.fetchOptions.headers=Object.assign(a.headers,r.headers),t=r.parser||null,l="function"==typeof t?t:c,n}function s(e){return function(e){if(Array.isArray(e))return f(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return f(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return f(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function g(e,t){var r=t.children,n=t.classes,o=document.createElement(e),i=document.createDocumentFragment();return function(e){var t,r=(1<arguments.length&&void 0!==arguments[1]?arguments[1]:"").trim().split(" ");(t=e.classList).add.apply(t,s(r))}(o,n||""),r&&r.forEach(function(e){Array.isArray(e)?e.forEach(function(e){return i.appendChild(e)}):i.appendChild(e)}),o.appendChild(i),o}function p(){if(localStorage){var e=localStorage.getItem("h-bar_dismiss_for");if(!e)return;if(e=e,(new Date).getTime()<=e)return 1}}function m(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var y=function(){function r(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),this.template=document.querySelector(e),this.DOMPurify=t}var e,t,n;return e=r,(t=[{key:"resolve",value:function(r){var n=this,o=this.template.innerHTML;return null==o?null:(Object.keys(r).forEach(function(e){if(!Array.isArray(r[e])){var t=n.regex(e);o=o.replace(t,r[e])}}),this.DOMPurify?this.DOMPurify.sanitize(o):o)}},{key:"regex",value:function(e){return new RegExp("({%\\s*(".concat(e,")\\s*%})"),"g")}}])&&m(e.prototype,t),n&&m(e,n),r}();function v(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var x=function(){function a(e){var t=e.$el,r=e.dismissible,n=e.dismissFor,o=e.theme,i=e.badge;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),this.$el=t,this.dismissible=r,this.dismissFor=n,this.badge=i,this.theme=o}var e,t,r;return e=a,(t=[{key:"resolve",value:function(e){var a=this,c=e.title,l=e.link,s=e.secondaryLinks;p()||new Promise(function(e){"loading"==document.readyState?document.addEventListener("DOMContentLoaded",e):e()}).then(function(){if(c){var e=null;if(a.dismissible)e=a.dismissibleButton();else e=g("div",{children:a.createSecondaryLinks(s),classes:"".concat(b," ").concat(a.theme.linkWrapper)});var t=g("span",{classes:"".concat(d," ").concat(a.theme.badge)}),r=g("a",{classes:"".concat(u," ").concat(a.theme.postTitle)});t.innerText=a.badge,r.href=l,r.innerText=c,r.innerHTML+='\n <svg class="hb-h-3 hb-w-3" viewBox="0 0 20 20" fill="currentColor">\n <path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd"/>\n </svg>\n ';var n=g("div",{classes:"".concat(b," ").concat(a.theme.linkWrapper),children:[t,r]}),o=g("div",{classes:"".concat(h," ").concat(a.theme.wrapper),children:[n,e]}),i=document.querySelector(a.$el);i.innerHTML="",i.appendChild(o)}else console.error("[h-bar] no post data, unable to render")})}},{key:"destroy",value:function(){try{return!(document.querySelector(this.$el).innerHTML="")}catch(e){console.error("Unable to destroy the h-bar wrapper"),console.error(e)}return!1}},{key:"dismissibleButton",value:function(){var t=this,e=g("button",{classes:"hb--mr-2 hb-flex hb-p-1 hb-rounded-md ".concat(this.theme.dismiss," hover:hb-text-white hover:hb-bg-gray-800 focus:hb-outline-none focus:hb-bg-gray-800")});return e.innerHTML='<svg class="hb-h-4 hb-w-4" stroke="currentColor" fill="none" viewBox="0 0 24 24">\n <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path>\n </svg>',e.onclick=function(e){return e.preventDefault(),t.dismissFor&&localStorage&&localStorage.setItem("h-bar_dismiss_for",t.dismissFor.getTime()),t.destroy()},e}},{key:"createSecondaryLinks",value:function(e){var o=this;return e?e.map(function(e){var t=e.title,r=e.link,n=g("a",{classes:"".concat(i," ").concat(o.theme.secondaryLink)});return n.href=r,n.innerText=t,n},this):[]}}])&&v(e.prototype,t),r&&v(e,r),a}();function w(e){return(w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}
/**
* h-bar banner and dynamic announcement library
*
* @version 2.0.0
* @license MIT
* @copyright @ReeceM
*/var k,j={version:"2.0.0",rendered:!1,fetching:!1,usingBanner:!0,init:function(e){var t,r=0<arguments.length&&void 0!==e?e:{};Object.assign(this,n(r)),this.$elementOpt={template:(t=document.querySelector(this.$el)).dataset.template,html:""==t.getAttribute("has-html"),dismissFor:t.dataset.dismissFor||null},this.$elementOpt.template?this.renderer=new y(this.$elementOpt.template,this.DOMPurify):r.renderer?this.renderer=new r.renderer(this):this.renderer=new x(this),Object.defineProperties(this,{renderer:{configurable:!1,writable:!1}})},fetch:(k=function(){var t=this;this.rendered||p()||(this.fetching=!0,fetch(this.url,this.fetchOptions).then(function(e){return e.json()}).then(function(e){"object"==w(e)?t.render(e):console.error("".concat(t.url," Did not return an object")),t.fetching=!1}).catch(function(e){console.error(e),t.fetching=!1,t.rendered=!1}))},S.toString=function(){return k.toString()},S),render:function(e){var r,n=this;r=e,new Promise(function(e,t){if(r)try{e(l(r))}catch(e){t(e)}t({error:"No Data",data:r})}).then(function(e){var t=document.querySelector(n.$el);t.innerHTML=n.renderer.resolve(e),(t.__hbar__=n).rendered=!0,n.onCompleted({__hbar__:n,result:t})}).catch(function(e){console.error(e),n.destroy(),n.fetching=!1,n.rendered=!1,n.onFailure({__hbar__:n})})},destroy:function(){try{return!(document.querySelector(this.$el).innerHTML="")}catch(e){console.error("Unable to destroy the h-bar wrapper"),console.error(e)}return!1}};function S(){return k.apply(this,arguments)}Object.defineProperties(j,{init:{writable:!1,configurable:!1},destroy:{writable:!1,configurable:!1},fetch:{writable:!1,configurable:!1}});t.default=j}],o.c=n,o.d=function(e,t,r){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)o.d(r,n,function(e){return t[e]}.bind(null,n));return r},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=4).default;function o(e){if(n[e])return n[e].exports;var t=n[e]={i:e,l:!1,exports:{}};return r[e].call(t.exports,t,t.exports,o),t.l=!0,t.exports}var r,n});
/*! For license information please see hBar.min.js.LICENSE.txt */
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.hBar=e():t.hBar=e()}(self,(()=>(()=>{"use strict";var t={363:(t,e,r)=>{r.d(e,{Z:()=>c});var o=r(81),n=r.n(o),a=r(645),i=r.n(a)()(n());i.push([t.id,"*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 transparent;--tw-ring-shadow:0 0 transparent;--tw-shadow:0 0 transparent;--tw-shadow-colored:0 0 transparent;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 transparent;--tw-ring-shadow:0 0 transparent;--tw-shadow:0 0 transparent;--tw-shadow-colored:0 0 transparent;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.hb-mx-2{margin-left:.5rem;margin-right:.5rem}.hb-mx-5{margin-left:1.25rem;margin-right:1.25rem}.hb--mr-2{margin-right:-.5rem}.hb-flex{display:flex}.hb-inline-flex{display:inline-flex}.hb-h-3{height:.75rem}.hb-h-4{height:1rem}.hb-w-3{width:.75rem}.hb-w-4{width:1rem}.hb-w-full{width:100%}.hb-cursor-pointer{cursor:pointer}.hb-items-center{align-items:center}.hb-justify-between{justify-content:space-between}.hb-rounded-md{border-radius:.375rem}.hb-rounded-full{border-radius:9999px}.hb-bg-gray-900{--tw-bg-opacity:1;background-color:rgba(17,24,39,var(--tw-bg-opacity))}.hb-bg-white{--tw-bg-opacity:1;background-color:rgba(255,255,255,var(--tw-bg-opacity))}.hb-bg-gray-400{--tw-bg-opacity:1;background-color:rgba(156,163,175,var(--tw-bg-opacity))}.hb-bg-blue-900{--tw-bg-opacity:1;background-color:rgba(30,58,138,var(--tw-bg-opacity))}.hb-bg-blue-100{--tw-bg-opacity:1;background-color:rgba(219,234,254,var(--tw-bg-opacity))}.hb-bg-green-600{--tw-bg-opacity:1;background-color:rgba(22,163,74,var(--tw-bg-opacity))}.hb-bg-green-100{--tw-bg-opacity:1;background-color:rgba(220,252,231,var(--tw-bg-opacity))}.hb-bg-indigo-800{--tw-bg-opacity:1;background-color:rgba(55,48,163,var(--tw-bg-opacity))}.hb-bg-indigo-100{--tw-bg-opacity:1;background-color:rgba(224,231,255,var(--tw-bg-opacity))}.hb-bg-orange-300{--tw-bg-opacity:1;background-color:rgba(253,186,116,var(--tw-bg-opacity))}.hb-bg-orange-800{--tw-bg-opacity:1;background-color:rgba(154,52,18,var(--tw-bg-opacity))}.hb-bg-yellow-300{--tw-bg-opacity:1;background-color:rgba(253,224,71,var(--tw-bg-opacity))}.hb-bg-yellow-100{--tw-bg-opacity:1;background-color:rgba(254,249,195,var(--tw-bg-opacity))}.hb-bg-teal-500{--tw-bg-opacity:1;background-color:rgba(20,184,166,var(--tw-bg-opacity))}.hb-bg-teal-900{--tw-bg-opacity:1;background-color:rgba(19,78,74,var(--tw-bg-opacity))}.hb-bg-red-400{--tw-bg-opacity:1;background-color:rgba(248,113,113,var(--tw-bg-opacity))}.hb-bg-red-100{--tw-bg-opacity:1;background-color:rgba(254,226,226,var(--tw-bg-opacity))}.hb-p-1{padding:.25rem}.hb-py-2{padding-bottom:.5rem;padding-top:.5rem}.hb-px-1{padding-left:.25rem;padding-right:.25rem}.hb-px-2{padding-left:.5rem;padding-right:.5rem}.hb-text-sm{font-size:.875rem;line-height:1.25rem}.hb-text-xs{font-size:.75rem;line-height:1rem}.hb-font-semibold{font-weight:600}.hb-uppercase{text-transform:uppercase}.hb-leading-relaxed{line-height:1.625}.hb-tracking-wider{letter-spacing:.05em}.hb-text-gray-100{--tw-text-opacity:1;color:rgba(243,244,246,var(--tw-text-opacity))}.hb-text-gray-900{--tw-text-opacity:1;color:rgba(17,24,39,var(--tw-text-opacity))}.hb-text-gray-800{--tw-text-opacity:1;color:rgba(31,41,55,var(--tw-text-opacity))}.hb-text-blue-100{--tw-text-opacity:1;color:rgba(219,234,254,var(--tw-text-opacity))}.hb-text-blue-900{--tw-text-opacity:1;color:rgba(30,58,138,var(--tw-text-opacity))}.hb-text-green-100{--tw-text-opacity:1;color:rgba(220,252,231,var(--tw-text-opacity))}.hb-text-green-900{--tw-text-opacity:1;color:rgba(20,83,45,var(--tw-text-opacity))}.hb-text-indigo-100{--tw-text-opacity:1;color:rgba(224,231,255,var(--tw-text-opacity))}.hb-text-indigo-900{--tw-text-opacity:1;color:rgba(49,46,129,var(--tw-text-opacity))}.hb-text-orange-900{--tw-text-opacity:1;color:rgba(124,45,18,var(--tw-text-opacity))}.hb-text-orange-100{--tw-text-opacity:1;color:rgba(255,237,213,var(--tw-text-opacity))}.hb-text-yellow-900{--tw-text-opacity:1;color:rgba(113,63,18,var(--tw-text-opacity))}.hb-text-teal-100{--tw-text-opacity:1;color:rgba(204,251,241,var(--tw-text-opacity))}.hb-text-red-900{--tw-text-opacity:1;color:rgba(127,29,29,var(--tw-text-opacity))}a{background-color:transparent;color:inherit;text-decoration:inherit}*,:after,:before{border:0 solid #e2e8f0;box-sizing:border-box}.fade-in-top{animation:fade-in-top .8s cubic-bezier(.39,.575,.565,1)}@keyframes fade-in-top{0%{opacity:0;transform:translateY(-50px)}to{opacity:1;transform:translateY(0)}}.hover\\:hb-bg-gray-800:hover{--tw-bg-opacity:1;background-color:rgba(31,41,55,var(--tw-bg-opacity))}.hover\\:hb-text-white:hover{--tw-text-opacity:1;color:rgba(255,255,255,var(--tw-text-opacity))}.hover\\:hb-text-gray-300:hover{--tw-text-opacity:1;color:rgba(209,213,219,var(--tw-text-opacity))}.hover\\:hb-text-gray-600:hover{--tw-text-opacity:1;color:rgba(75,85,99,var(--tw-text-opacity))}.hover\\:hb-text-blue-300:hover{--tw-text-opacity:1;color:rgba(147,197,253,var(--tw-text-opacity))}.hover\\:hb-text-green-300:hover{--tw-text-opacity:1;color:rgba(134,239,172,var(--tw-text-opacity))}.hover\\:hb-text-indigo-300:hover{--tw-text-opacity:1;color:rgba(165,180,252,var(--tw-text-opacity))}.hover\\:hb-text-orange-700:hover{--tw-text-opacity:1;color:rgba(194,65,12,var(--tw-text-opacity))}.hover\\:hb-text-yellow-700:hover{--tw-text-opacity:1;color:rgba(161,98,7,var(--tw-text-opacity))}.hover\\:hb-text-teal-300:hover{--tw-text-opacity:1;color:rgba(94,234,212,var(--tw-text-opacity))}.hover\\:hb-text-red-100:hover{--tw-text-opacity:1;color:rgba(254,226,226,var(--tw-text-opacity))}.hover\\:hb-underline:hover{text-decoration-line:underline}.focus\\:hb-bg-gray-800:focus{--tw-bg-opacity:1;background-color:rgba(31,41,55,var(--tw-bg-opacity))}.focus\\:hb-outline-none:focus{outline:2px solid transparent;outline-offset:2px}@media (min-width:768px){.md\\:hb-flex-row{flex-direction:row}.md\\:hb-px-20{padding-left:5rem;padding-right:5rem}}",""]);const c=i},645:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var r="",o=void 0!==e[5];return e[4]&&(r+="@supports (".concat(e[4],") {")),e[2]&&(r+="@media ".concat(e[2]," {")),o&&(r+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),r+=t(e),o&&(r+="}"),e[2]&&(r+="}"),e[4]&&(r+="}"),r})).join("")},e.i=function(t,r,o,n,a){"string"==typeof t&&(t=[[null,t,void 0]]);var i={};if(o)for(var c=0;c<this.length;c++){var s=this[c][0];null!=s&&(i[s]=!0)}for(var l=0;l<t.length;l++){var b=[].concat(t[l]);o&&i[b[0]]||(void 0!==a&&(void 0===b[5]||(b[1]="@layer".concat(b[5].length>0?" ".concat(b[5]):""," {").concat(b[1],"}")),b[5]=a),r&&(b[2]?(b[1]="@media ".concat(b[2]," {").concat(b[1],"}"),b[2]=r):b[2]=r),n&&(b[4]?(b[1]="@supports (".concat(b[4],") {").concat(b[1],"}"),b[4]=n):b[4]="".concat(n)),e.push(b))}},e}},81:t=>{t.exports=function(t){return t[1]}},379:t=>{var e=[];function r(t){for(var r=-1,o=0;o<e.length;o++)if(e[o].identifier===t){r=o;break}return r}function o(t,o){for(var a={},i=[],c=0;c<t.length;c++){var s=t[c],l=o.base?s[0]+o.base:s[0],b=a[l]||0,h="".concat(l," ").concat(b);a[l]=b+1;var p=r(h),d={css:s[1],media:s[2],sourceMap:s[3],supports:s[4],layer:s[5]};if(-1!==p)e[p].references++,e[p].updater(d);else{var u=n(d,o);o.byIndex=c,e.splice(c,0,{identifier:h,updater:u,references:1})}i.push(h)}return i}function n(t,e){var r=e.domAPI(e);r.update(t);return function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;r.update(t=e)}else r.remove()}}t.exports=function(t,n){var a=o(t=t||[],n=n||{});return function(t){t=t||[];for(var i=0;i<a.length;i++){var c=r(a[i]);e[c].references--}for(var s=o(t,n),l=0;l<a.length;l++){var b=r(a[l]);0===e[b].references&&(e[b].updater(),e.splice(b,1))}a=s}}},569:t=>{var e={};t.exports=function(t,r){var o=function(t){if(void 0===e[t]){var r=document.querySelector(t);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(t){r=null}e[t]=r}return e[t]}(t);if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(r)}},216:t=>{t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},565:(t,e,r)=>{t.exports=function(t){var e=r.nc;e&&t.setAttribute("nonce",e)}},795:t=>{t.exports=function(t){var e=t.insertStyleElement(t);return{update:function(r){!function(t,e,r){var o="";r.supports&&(o+="@supports (".concat(r.supports,") {")),r.media&&(o+="@media ".concat(r.media," {"));var n=void 0!==r.layer;n&&(o+="@layer".concat(r.layer.length>0?" ".concat(r.layer):""," {")),o+=r.css,n&&(o+="}"),r.media&&(o+="}"),r.supports&&(o+="}");var a=r.sourceMap;a&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),e.styleTagTransform(o,t,e.options)}(e,t,r)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},589:t=>{t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}}},e={};function r(o){var n=e[o];if(void 0!==n)return n.exports;var a=e[o]={id:o,exports:{}};return t[o](a,a.exports,r),a.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var o in e)r.o(e,o)&&!r.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.nc=void 0;var o={};return(()=>{r.d(o,{default:()=>H});var t=r(379),e=r.n(t),n=r(795),a=r.n(n),i=r(569),c=r.n(i),s=r(565),l=r.n(s),b=r(216),h=r.n(b),p=r(589),d=r.n(p),u=r(363),g={};g.styleTagTransform=d(),g.setAttributes=l(),g.insert=c().bind(null,"head"),g.domAPI=a(),g.insertStyleElement=h();e()(u.Z,g);u.Z&&u.Z.locals&&u.Z.locals;var y="hb-flex hb-w-full hd-flex-col md:hb-flex-row hb-text-sm hb-py-2 md:hb-px-20 hb-px-1 hb-items-center hb-justify-between",f="hb-flex hb-items-center",w="hb-px-2 hb-mx-2 hb-leading-relaxed hb-tracking-wider hb-uppercase hb-font-semibold hb-rounded-full hb-text-xs",m="hover:hb-underline hb-inline-flex hb-items-center",v="hb-mx-5 hb-cursor-pointer hover:hb-underline",x={gray:{wrapper:"hb-bg-gray-900 hb-text-gray-100",linkWrapper:"",badge:"hb-bg-white hb-text-gray-900",postTitle:"hover:hb-text-gray-300",secondaryLink:"hover:hb-text-gray-300",dismiss:"hb-text-gray-800"},lightGray:{wrapper:"hb-bg-gray-400 hb-text-gray-900",linkWrapper:"",badge:"hb-bg-white hb-text-gray-900 shadow",postTitle:"hover:hb-text-gray-600",secondaryLink:"hover:hb-text-gray-600",dismiss:"hb-text-gray-800"},blue:{wrapper:"hb-bg-blue-900 hb-text-blue-100",linkWrapper:"",badge:"hb-bg-blue-100 hb-text-blue-900 shadow",postTitle:"hover:hb-text-blue-300",secondaryLink:"hover:hb-text-blue-300",dismiss:"hb-text-gray-800"},green:{wrapper:"hb-bg-green-600 hb-text-green-100",linkWrapper:"",badge:"hb-bg-green-100 hb-text-green-900",postTitle:"hover:hb-text-green-300",secondaryLink:"hover:hb-text-green-300",dismiss:"hb-text-gray-800"},indigo:{wrapper:"hb-bg-indigo-800 hb-text-indigo-100",linkWrapper:"",badge:"hb-bg-indigo-100 hb-text-indigo-900 shadow",postTitle:"hover:hb-text-indigo-300",secondaryLink:"hover:hb-text-indigo-300",dismiss:"hb-text-gray-800"},orange:{wrapper:"hb-bg-orange-300 hb-text-orange-900",linkWrapper:"",badge:"hb-bg-orange-800 hb-text-orange-100 shadow",postTitle:"hover:hb-text-orange-700",secondaryLink:"hover:hb-text-orange-700",dismiss:"hb-text-gray-800"},yellow:{wrapper:"hb-bg-yellow-300 hb-text-yellow-900",linkWrapper:"",badge:"hb-bg-yellow-100 hb-text-yellow-900 shadow",postTitle:"hover:hb-text-yellow-700",secondaryLink:"hover:hb-text-yellow-700",dismiss:"hb-text-gray-800"},teal:{wrapper:"hb-bg-teal-500 hb-text-teal-100",linkWrapper:"",badge:"hb-bg-teal-900 hb-text-teal-100 shadow",postTitle:"hover:hb-text-teal-300",secondaryLink:"hover:hb-text-teal-300",dismiss:"hb-text-gray-800"},red:{wrapper:"hb-bg-red-400 hb-text-red-900",linkWrapper:"",badge:"hb-bg-red-100 hb-text-red-900 shadow",postTitle:"hover:hb-text-red-100",secondaryLink:"hover:hb-text-red-100",dismiss:"hb-text-gray-800"}},k={method:"GET",mode:"cors",cache:"no-cache",headers:{Accept:"application/json"},redirect:"follow"};function S(t){var e=t[0],r=e.title.rendered,o=e.link;return null==r&&console.error("WP-json response doesn't have real values %o",t[0]),{title:r,link:o}}var T=S;function j(t){T="function"==typeof t?t:S}function L(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e={};return e.$el=t.el,e.url=t.url,e.DOMPurify=t.DOMPurify||null,e.theme=x[t.theme]||"grey",e.badge=t.badge||null,e.dismissible=t.dismissible||!1,e.dismissFor=t.dismissFor||!1,e.secondaryLinks=t.secondaryLinks||[],e.title=t.title||null,e.link=t.link||null,e.onCompleted=t.onCompleted||function(){},e.onFailure=t.onFailure||function(){},"function"==typeof t.fetch&&(e.fetch=t.fetch),e.fetchOptions=k,e.fetchOptions.headers=Object.assign(k.headers,t.headers),j(t.parser||null),e}function O(t){return function(t){if(Array.isArray(t))return M(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return M(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return M(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function M(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,o=new Array(e);r<e;r++)o[r]=t[r];return o}function P(t,e){var r=e.children,o=e.classes,n=document.createElement(t),a=document.createDocumentFragment();return function(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=r.trim().split(" ");(e=t.classList).add.apply(e,O(o))}(n,o||""),r&&r.forEach((function(t){Array.isArray(t)?t.forEach((function(t){return a.appendChild(t)})):a.appendChild(t)})),n.appendChild(a),n}function C(t){return{template:t.dataset.template,html:""==t.getAttribute("has-html"),dismissFor:t.dataset.dismissFor||null}}function A(){if(localStorage){var t=localStorage.getItem("h-bar_dismiss_for");if(!t)return!1;if((new Date).getTime()<=t)return!0}return!1}function E(t){return E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},E(t)}function _(t,e){for(var r=0;r<e.length;r++){var o=e[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,(n=o.key,a=void 0,a=function(t,e){if("object"!==E(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,e||"default");if("object"!==E(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(n,"string"),"symbol"===E(a)?a:String(a)),o)}var n,a}var F=function(){function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.template=document.querySelector(e),this.DOMPurify=r}var e,r,o;return e=t,(r=[{key:"resolve",value:function(t){var e=this,r=this.template.innerHTML;return null==r?null:(Object.keys(t).forEach((function(o){if(!Array.isArray(t[o])){var n=e.regex(o);r=r.replace(n,t[o])}})),this.DOMPurify?this.DOMPurify.sanitize(r):r)}},{key:"regex",value:function(t){return new RegExp("({%\\s*(".concat(t,")\\s*%})"),"g")}}])&&_(e.prototype,r),o&&_(e,o),Object.defineProperty(e,"prototype",{writable:!1}),t}();function D(t){return D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},D(t)}function W(t,e){for(var r=0;r<e.length;r++){var o=e[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,(n=o.key,a=void 0,a=function(t,e){if("object"!==D(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,e||"default");if("object"!==D(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(n,"string"),"symbol"===D(a)?a:String(a)),o)}var n,a}var $=function(){function t(e){var r=e.$el,o=e.dismissible,n=e.dismissFor,a=e.theme,i=e.badge;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.$el=r,this.dismissible=o,this.dismissFor=n,this.badge=i,this.theme=a}var e,r,o;return e=t,(r=[{key:"resolve",value:function(t){var e=this,r=t.title,o=t.link,n=t.secondaryLinks;A()||new Promise((function(t){"loading"==document.readyState?document.addEventListener("DOMContentLoaded",t):t()})).then((function(){if(r){var t=null;t=e.dismissible?e.dismissibleButton():P("div",{children:e.createSecondaryLinks(n),classes:"".concat(f," ").concat(e.theme.linkWrapper)});var a=null;e.badge&&((a=P("span",{classes:"".concat(w," ").concat(e.theme.badge)})).innerText=e.badge);var i=P("a",{classes:"".concat(m," ").concat(e.theme.postTitle)});i.href=o,i.innerText=r,i.innerHTML+='\n <svg class="hb-h-3 hb-w-3" viewBox="0 0 20 20" fill="currentColor">\n <path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd"/>\n </svg>\n ';var c=[i];a&&c.unshift(a);var s=P("div",{classes:"".concat(f," ").concat(e.theme.linkWrapper),children:c}),l=P("div",{classes:"".concat(y," ").concat(e.theme.wrapper),children:[s,t]}),b=document.querySelector(e.$el);b.innerHTML="",b.appendChild(l)}else console.error("[h-bar] no post data, unable to render")}))}},{key:"destroy",value:function(){try{return document.querySelector(this.$el).innerHTML="",!0}catch(t){console.error("Unable to destroy the h-bar wrapper"),console.error(t)}return!1}},{key:"dismissibleButton",value:function(){var t=this,e=P("button",{classes:"hb--mr-2 hb-flex hb-p-1 hb-rounded-md ".concat(this.theme.dismiss," hover:hb-text-white hover:hb-bg-gray-800 focus:hb-outline-none focus:hb-bg-gray-800")});return e.innerHTML='<svg class="hb-h-4 hb-w-4" stroke="currentColor" fill="none" viewBox="0 0 24 24">\n <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path>\n </svg>',e.onclick=function(e){return e.preventDefault(),t.dismissFor?(localStorage&&localStorage.setItem("h-bar_dismiss_for",t.dismissFor.getTime()),t.destroy()):t.destroy()},e}},{key:"createSecondaryLinks",value:function(t){var e=this;return t?t.map((function(t){var r=t.title,o=t.link,n=P("a",{classes:"".concat(v," ").concat(e.theme.secondaryLink)});return n.href=o,n.innerText=r,n}),this):[]}}])&&W(e.prototype,r),o&&W(e,o),Object.defineProperty(e,"prototype",{writable:!1}),t}();function I(t){return I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},I(t)}var z={version:"2.0.0",rendered:!1,fetching:!1,usingBanner:!0,init:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.assign(this,L(t)),this.$elementOpt=C(document.querySelector(this.$el)),this.$elementOpt.template?this.renderer=new F(this.$elementOpt.template,this.DOMPurify):t.renderer?this.renderer=new t.renderer(this):this.renderer=new $(this),Object.defineProperties(this,{renderer:{configurable:!1,writable:!1}})},fetch:function(t){function e(){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(){var t=this;this.rendered||A()||(this.fetching=!0,fetch(this.url,this.fetchOptions).then((function(t){return t.json()})).then((function(e){"object"==I(e)?t.render(e):console.error("".concat(t.url," Did not return an object")),t.fetching=!1})).catch((function(e){console.error(e),t.fetching=!1,t.rendered=!1})))})),render:function(t){var e,r=this;(e=t,new Promise((function(t,r){if(e)try{t(T(e))}catch(t){r(t)}r({error:"No Data",data:e})}))).then((function(t){var e=document.querySelector(r.$el);e.innerHTML=r.renderer.resolve(t),e.__hbar__=r,r.rendered=!0,r.onCompleted({__hbar__:r,result:e})})).catch((function(t){console.error(t),r.destroy(),r.fetching=!1,r.rendered=!1,r.onFailure({__hbar__:r})}))},destroy:function(){try{return document.querySelector(this.$el).innerHTML="",!0}catch(t){console.error("Unable to destroy the h-bar wrapper"),console.error(t)}return!1}};Object.defineProperties(z,{init:{writable:!1,configurable:!1},destroy:{writable:!1,configurable:!1},fetch:{writable:!1,configurable:!1}});const H=z})(),o=o.default})()));
{
"name": "@reecem/h-bar",
"version": "2.0.0-rc1",
"version": "2.0.1",
"description": "Lightweight Announcement Bar",

@@ -31,16 +31,17 @@ "main": "dist/hBar.min.js",

"@babel/preset-env": "^7.9.5",
"@fullhuman/postcss-purgecss": "^2.1.2",
"@fullhuman/postcss-purgecss": "^5.0.0",
"autoprefixer": "^9.7.6",
"babel-loader": "^8.1.0",
"cross-env": "^7.0.2",
"css-loader": "^3.5.1",
"cssnano": "^4.1.10",
"postcss-cli": "^7.1.0",
"postcss-loader": "^3.0.0",
"style-loader": "^1.1.3",
"tailwindcss": "^1.2.0",
"uglifyjs-webpack-plugin": "^2.2.0",
"webpack": "^4.42.1",
"webpack-cli": "^3.3.11"
"css-loader": "^6.7.3",
"cssnano": "^5.1.14",
"postcss": "^8.4.20",
"postcss-cli": "^10.1.0",
"postcss-loader": "^7.0.2",
"postcss-preset-env": "^7.8.3",
"style-loader": "^3.3.1",
"tailwindcss": "^3.2.4",
"webpack": "^5.75.0",
"webpack-cli": "^5.0.1"
}
}

@@ -5,4 +5,4 @@ # h-bar lightweight announcement bar

[![Latest Version on npm](https://img.shields.io/npm/v/@reecem/h-bar.svg?style=flat-square)](https://www.npmjs.com/package/@reecem/h-bar)
[![Total Downloads](https://img.shields.io/npm/dt/@reecem/h-bar.svg?style=flat-square)](https://www.npmjs.com/package/@reecem/h-bar)
[![npm version](https://badge.fury.io/js/%40reecem%2Fh-bar.svg)](https://www.npmjs.com/package/@reecem/h-bar)
[![Total Downloads](https://img.shields.io/npm/dt/@reecem/h-bar.svg )](https://www.npmjs.com/package/@reecem/h-bar)
![npm bundle size](https://img.shields.io/bundlephobia/minzip/@reecem/h-bar)

@@ -51,3 +51,3 @@

...
<script src"https://cdn.jsdelivr.net/npm/@reecem/h-bar@latest/dist/hBar.min.js"></script>
<script src="https://unpkg.com/@reecem/h-bar?umd"></script>
...

@@ -65,3 +65,3 @@ ```

<!-- or -->
<script src"https://cdn.jsdelivr.net/npm/@reecem/h-bar@latest/dist/hBar.min.js" defer></script>
<script src="https://unpkg.com/@reecem/h-bar?umd" defer></script>
<script>

@@ -68,0 +68,0 @@ hBar.init({

@@ -12,2 +12,3 @@ # Security Policy

| ------- | ------------------ |
| 2.x | :white_check_mark: |
| 1.0.x | :white_check_mark: |

@@ -14,0 +15,0 @@ | < 0.3 | :x: |

const path = require('path')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const TerserPlugin = require("terser-webpack-plugin");

@@ -43,3 +43,3 @@ module.exports = {

minimize: true,
minimizer: [new UglifyJsPlugin({
minimizer: [new TerserPlugin({
include: /\.min\.js$/

@@ -46,0 +46,0 @@ })]

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc