require("./hiro.css");
var $8zHUo$nanoid = require("nanoid");
var $8zHUo$hexcolortocolorname = require("hex-color-to-color-name");
function $parcel$exportWildcard(dest, source) {
Object.keys(source).forEach(function(key) {
if (key === 'default' || key === '__esModule' || Object.prototype.hasOwnProperty.call(dest, key)) {
return;
}
Object.defineProperty(dest, key, {
enumerable: true,
get: function get() {
return source[key];
}
});
});
return dest;
}
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
var $becb3f2fe37b7390$exports = {};
var $8e901f8d0c6ca2d8$exports = {};
$parcel$export($8e901f8d0c6ca2d8$exports, "HiroApp", () => $8e901f8d0c6ca2d8$export$123dbf0530e650a);
function $21d524920a3c60fa$export$ddcec56dc3db7f2c(len = 5) {
// Define the alphabet to use (numbers, uppercase and lowercase letters)
const alphabet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
// Create a nanoid generator with the custom alphabet and desired length
const generateToken = (0, $8zHUo$nanoid.customAlphabet)(alphabet, len);
// Generate a token
return generateToken();
}
function $50b7d60bcb34fba3$export$73bda83cddbc7187(str) {
return str// Handle the start of a new word marked by uppercase letters or non-alphanumeric characters
.replace(/([a-z0-9])([A-Z])|[^a-zA-Z0-9]+/g, "$1-$2")// Convert the entire string to lowercase
.toLowerCase()// Remove any leading or trailing dashes
.replace(/^-|-$/g, "");
}
function $ae1d7a027cf5260a$export$cd380138694d4af6() {
const element = document.querySelector(".ha-sidebar-tab");
if (element.scrollHeight > element.clientHeight) element.style.paddingRight = "10px";
else element.style.paddingRight = "0px";
}
function $7112ed347f5e1a73$export$7a555f0190b038() {
return typeof window["ENV"] !== "undefined" && window["ENV"] === "gallery";
}
function $7112ed347f5e1a73$export$496c68e92eb56578() {
return typeof window["ENV"] !== "undefined" && typeof window["CONSTANTS"] !== "undefined" && window["ENV"] === "asset";
}
function $7112ed347f5e1a73$export$27d7c37b6c928f6c() {
return window["CONSTANTS"];
}
const $8e901f8d0c6ca2d8$var$ROOT_ID_LS_KEY = "artwork-root-Id";
class $8e901f8d0c6ca2d8$export$123dbf0530e650a {
constructor(options){
this.options = options;
this._title = options?.title;
this._description = options?.description;
this._artist = options?.artist;
}
get title() {
return this._title;
}
get artist() {
return this._artist;
}
get description() {
return this._description;
}
/**
* This function must be run first so that
* HiroEngine can make sure the controller section is
* in place and can add controllers to the app.
*
* Puts the Hiro controller section next to the root elements.
* @Param {BootstrapOptions} options options of bootstrap
*/ bootstrap(options) {
// @ts-ignore
if ((0, $7112ed347f5e1a73$export$496c68e92eb56578)()) return;
if (document.querySelector("aside#ha-app-sidebar")) return;
// Create wrapper element
const wrapper = document.createElement("div");
wrapper.id = "ha-app-wrapper";
// Create sidebar element
const sidebar = document.createElement("aside");
sidebar.id = "ha-app-sidebar";
sidebar.innerHTML = `