UNPKG

eurostat-barcode-generator

Version:

a simplified barcode generator tool with options

1,662 lines (1,400 loc) 184 kB
/*! * Copyright (c) 2020 ~ present Alexander Hepp <alexander.hepp@sword-group.com> * eurostat-barcode-generator project is licensed under the ISC license * * eurostat-barcode-generator, JavaScript chart library * * * @version 1.0.2 */ (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); else if(typeof define === 'function' && define.amd) define("eurostatBarcodeGenerator", [], factory); else if(typeof exports === 'object') exports["eurostatBarcodeGenerator"] = factory(); else root["eurostatBarcodeGenerator"] = factory(); })(this, 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 = 8); /******/ }) /************************************************************************/ /******/ ({ /***/ 10: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, "generateBarcode", function() { return /* binding */ generateBarcode; }); __webpack_require__.d(__webpack_exports__, "version", function() { return /* binding */ version; }); __webpack_require__.d(__webpack_exports__, "instance", function() { return /* binding */ instance; }); // CONCATENATED MODULE: ./node_modules/d3-selection/src/selector.js function none() {} /* harmony default export */ var src_selector = (function (selector) { return selector == null ? none : function () { return this.querySelector(selector); }; }); // CONCATENATED MODULE: ./node_modules/d3-selection/src/selection/select.js /* harmony default export */ var selection_select = (function (select) { if (typeof select !== "function") select = src_selector(select); for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) { for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) { if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) { if ("__data__" in node) subnode.__data__ = node.__data__; subgroup[i] = subnode; } } } return new Selection(subgroups, this._parents); }); // CONCATENATED MODULE: ./node_modules/d3-selection/src/selectorAll.js function selectorAll_empty() { return []; } /* harmony default export */ var selectorAll = (function (selector) { return selector == null ? selectorAll_empty : function () { return this.querySelectorAll(selector); }; }); // CONCATENATED MODULE: ./node_modules/d3-selection/src/selection/selectAll.js /* harmony default export */ var selectAll = (function (select) { if (typeof select !== "function") select = selectorAll(select); for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) { for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) { if (node = group[i]) { subgroups.push(select.call(node, node.__data__, i, group)); parents.push(node); } } } return new Selection(subgroups, parents); }); // CONCATENATED MODULE: ./node_modules/d3-selection/src/matcher.js /* harmony default export */ var matcher = (function (selector) { return function () { return this.matches(selector); }; }); // CONCATENATED MODULE: ./node_modules/d3-selection/src/selection/filter.js /* harmony default export */ var filter = (function (match) { if (typeof match !== "function") match = matcher(match); for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) { for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) { if ((node = group[i]) && match.call(node, node.__data__, i, group)) { subgroup.push(node); } } } return new Selection(subgroups, this._parents); }); // CONCATENATED MODULE: ./node_modules/d3-selection/src/selection/sparse.js /* harmony default export */ var sparse = (function (update) { return new Array(update.length); }); // CONCATENATED MODULE: ./node_modules/d3-selection/src/selection/enter.js /* harmony default export */ var selection_enter = (function () { return new Selection(this._enter || this._groups.map(sparse), this._parents); }); function EnterNode(parent, datum) { this.ownerDocument = parent.ownerDocument; this.namespaceURI = parent.namespaceURI; this._next = null; this._parent = parent; this.__data__ = datum; } EnterNode.prototype = { constructor: EnterNode, appendChild: function appendChild(child) { return this._parent.insertBefore(child, this._next); }, insertBefore: function insertBefore(child, next) { return this._parent.insertBefore(child, next); }, querySelector: function querySelector(selector) { return this._parent.querySelector(selector); }, querySelectorAll: function querySelectorAll(selector) { return this._parent.querySelectorAll(selector); } }; // CONCATENATED MODULE: ./node_modules/d3-selection/src/constant.js /* harmony default export */ var constant = (function (x) { return function () { return x; }; }); // CONCATENATED MODULE: ./node_modules/d3-selection/src/selection/data.js var keyPrefix = "$"; // Protect against keys like “__proto__”. function bindIndex(parent, group, enter, update, exit, data) { var i = 0, node, groupLength = group.length, dataLength = data.length; // Put any non-null nodes that fit into update. // Put any null nodes into enter. // Put any remaining data into enter. for (; i < dataLength; ++i) { if (node = group[i]) { node.__data__ = data[i]; update[i] = node; } else { enter[i] = new EnterNode(parent, data[i]); } } // Put any non-null nodes that don’t fit into exit. for (; i < groupLength; ++i) { if (node = group[i]) { exit[i] = node; } } } function bindKey(parent, group, enter, update, exit, data, key) { var i, node, nodeByKeyValue = {}, groupLength = group.length, dataLength = data.length, keyValues = new Array(groupLength), keyValue; // Compute the key for each node. // If multiple nodes have the same key, the duplicates are added to exit. for (i = 0; i < groupLength; ++i) { if (node = group[i]) { keyValues[i] = keyValue = keyPrefix + key.call(node, node.__data__, i, group); if (keyValue in nodeByKeyValue) { exit[i] = node; } else { nodeByKeyValue[keyValue] = node; } } } // Compute the key for each datum. // If there a node associated with this key, join and add it to update. // If there is not (or the key is a duplicate), add it to enter. for (i = 0; i < dataLength; ++i) { keyValue = keyPrefix + key.call(parent, data[i], i, data); if (node = nodeByKeyValue[keyValue]) { update[i] = node; node.__data__ = data[i]; nodeByKeyValue[keyValue] = null; } else { enter[i] = new EnterNode(parent, data[i]); } } // Add any remaining nodes that were not bound to data to exit. for (i = 0; i < groupLength; ++i) { if ((node = group[i]) && nodeByKeyValue[keyValues[i]] === node) { exit[i] = node; } } } /* harmony default export */ var selection_data = (function (value, key) { if (!value) { data = new Array(this.size()), j = -1; this.each(function (d) { data[++j] = d; }); return data; } var bind = key ? bindKey : bindIndex, parents = this._parents, groups = this._groups; if (typeof value !== "function") value = constant(value); for (var m = groups.length, update = new Array(m), enter = new Array(m), exit = new Array(m), j = 0; j < m; ++j) { var parent = parents[j], group = groups[j], groupLength = group.length, data = value.call(parent, parent && parent.__data__, j, parents), dataLength = data.length, enterGroup = enter[j] = new Array(dataLength), updateGroup = update[j] = new Array(dataLength), exitGroup = exit[j] = new Array(groupLength); bind(parent, group, enterGroup, updateGroup, exitGroup, data, key); // Now connect the enter nodes to their following update node, such that // appendChild can insert the materialized enter node before this node, // rather than at the end of the parent node. for (var i0 = 0, i1 = 0, previous, next; i0 < dataLength; ++i0) { if (previous = enterGroup[i0]) { if (i0 >= i1) i1 = i0 + 1; while (!(next = updateGroup[i1]) && ++i1 < dataLength) { ; } previous._next = next || null; } } } update = new Selection(update, parents); update._enter = enter; update._exit = exit; return update; }); // CONCATENATED MODULE: ./node_modules/d3-selection/src/selection/exit.js /* harmony default export */ var selection_exit = (function () { return new Selection(this._exit || this._groups.map(sparse), this._parents); }); // CONCATENATED MODULE: ./node_modules/d3-selection/src/selection/join.js /* harmony default export */ var join = (function (onenter, onupdate, onexit) { var enter = this.enter(), update = this, exit = this.exit(); enter = typeof onenter === "function" ? onenter(enter) : enter.append(onenter + ""); if (onupdate != null) update = onupdate(update); if (onexit == null) exit.remove();else onexit(exit); return enter && update ? enter.merge(update).order() : update; }); // CONCATENATED MODULE: ./node_modules/d3-selection/src/selection/merge.js /* harmony default export */ var selection_merge = (function (selection) { for (var groups0 = this._groups, groups1 = selection._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) { for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) { if (node = group0[i] || group1[i]) { merge[i] = node; } } } for (; j < m0; ++j) { merges[j] = groups0[j]; } return new Selection(merges, this._parents); }); // CONCATENATED MODULE: ./node_modules/d3-selection/src/selection/order.js /* harmony default export */ var order = (function () { for (var groups = this._groups, j = -1, m = groups.length; ++j < m;) { for (var group = groups[j], i = group.length - 1, next = group[i], node; --i >= 0;) { if (node = group[i]) { if (next && node.compareDocumentPosition(next) ^ 4) next.parentNode.insertBefore(node, next); next = node; } } } return this; }); // CONCATENATED MODULE: ./node_modules/d3-selection/src/selection/sort.js /* harmony default export */ var sort = (function (compare) { if (!compare) compare = ascending; function compareNode(a, b) { return a && b ? compare(a.__data__, b.__data__) : !a - !b; } for (var groups = this._groups, m = groups.length, sortgroups = new Array(m), j = 0; j < m; ++j) { for (var group = groups[j], n = group.length, sortgroup = sortgroups[j] = new Array(n), node, i = 0; i < n; ++i) { if (node = group[i]) { sortgroup[i] = node; } } sortgroup.sort(compareNode); } return new Selection(sortgroups, this._parents).order(); }); function ascending(a, b) { return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN; } // CONCATENATED MODULE: ./node_modules/d3-selection/src/selection/call.js /* harmony default export */ var call = (function () { var callback = arguments[0]; arguments[0] = this; callback.apply(null, arguments); return this; }); // CONCATENATED MODULE: ./node_modules/d3-selection/src/selection/nodes.js /* harmony default export */ var selection_nodes = (function () { var nodes = new Array(this.size()), i = -1; this.each(function () { nodes[++i] = this; }); return nodes; }); // CONCATENATED MODULE: ./node_modules/d3-selection/src/selection/node.js /* harmony default export */ var selection_node = (function () { for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) { for (var group = groups[j], i = 0, n = group.length; i < n; ++i) { var node = group[i]; if (node) return node; } } return null; }); // CONCATENATED MODULE: ./node_modules/d3-selection/src/selection/size.js /* harmony default export */ var selection_size = (function () { var size = 0; this.each(function () { ++size; }); return size; }); // CONCATENATED MODULE: ./node_modules/d3-selection/src/selection/empty.js /* harmony default export */ var selection_empty = (function () { return !this.node(); }); // CONCATENATED MODULE: ./node_modules/d3-selection/src/selection/each.js /* harmony default export */ var each = (function (callback) { for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) { for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) { if (node = group[i]) callback.call(node, node.__data__, i, group); } } return this; }); // CONCATENATED MODULE: ./node_modules/d3-selection/src/namespaces.js var xhtml = "http://www.w3.org/1999/xhtml"; /* harmony default export */ var namespaces = ({ svg: "http://www.w3.org/2000/svg", xhtml: xhtml, xlink: "http://www.w3.org/1999/xlink", xml: "http://www.w3.org/XML/1998/namespace", xmlns: "http://www.w3.org/2000/xmlns/" }); // CONCATENATED MODULE: ./node_modules/d3-selection/src/namespace.js /* harmony default export */ var namespace = (function (name) { var prefix = name += "", i = prefix.indexOf(":"); if (i >= 0 && (prefix = name.slice(0, i)) !== "xmlns") name = name.slice(i + 1); return namespaces.hasOwnProperty(prefix) ? { space: namespaces[prefix], local: name } : name; }); // CONCATENATED MODULE: ./node_modules/d3-selection/src/selection/attr.js function attrRemove(name) { return function () { this.removeAttribute(name); }; } function attrRemoveNS(fullname) { return function () { this.removeAttributeNS(fullname.space, fullname.local); }; } function attrConstant(name, value) { return function () { this.setAttribute(name, value); }; } function attrConstantNS(fullname, value) { return function () { this.setAttributeNS(fullname.space, fullname.local, value); }; } function attrFunction(name, value) { return function () { var v = value.apply(this, arguments); if (v == null) this.removeAttribute(name);else this.setAttribute(name, v); }; } function attrFunctionNS(fullname, value) { return function () { var v = value.apply(this, arguments); if (v == null) this.removeAttributeNS(fullname.space, fullname.local);else this.setAttributeNS(fullname.space, fullname.local, v); }; } /* harmony default export */ var attr = (function (name, value) { var fullname = namespace(name); if (arguments.length < 2) { var node = this.node(); return fullname.local ? node.getAttributeNS(fullname.space, fullname.local) : node.getAttribute(fullname); } return this.each((value == null ? fullname.local ? attrRemoveNS : attrRemove : typeof value === "function" ? fullname.local ? attrFunctionNS : attrFunction : fullname.local ? attrConstantNS : attrConstant)(fullname, value)); }); // CONCATENATED MODULE: ./node_modules/d3-selection/src/window.js /* harmony default export */ var src_window = (function (node) { return node.ownerDocument && node.ownerDocument.defaultView || // node is a Node node.document && node // node is a Window || node.defaultView; // node is a Document }); // CONCATENATED MODULE: ./node_modules/d3-selection/src/selection/style.js function styleRemove(name) { return function () { this.style.removeProperty(name); }; } function styleConstant(name, value, priority) { return function () { this.style.setProperty(name, value, priority); }; } function styleFunction(name, value, priority) { return function () { var v = value.apply(this, arguments); if (v == null) this.style.removeProperty(name);else this.style.setProperty(name, v, priority); }; } /* harmony default export */ var style = (function (name, value, priority) { return arguments.length > 1 ? this.each((value == null ? styleRemove : typeof value === "function" ? styleFunction : styleConstant)(name, value, priority == null ? "" : priority)) : styleValue(this.node(), name); }); function styleValue(node, name) { return node.style.getPropertyValue(name) || src_window(node).getComputedStyle(node, null).getPropertyValue(name); } // CONCATENATED MODULE: ./node_modules/d3-selection/src/selection/property.js function propertyRemove(name) { return function () { delete this[name]; }; } function propertyConstant(name, value) { return function () { this[name] = value; }; } function propertyFunction(name, value) { return function () { var v = value.apply(this, arguments); if (v == null) delete this[name];else this[name] = v; }; } /* harmony default export */ var property = (function (name, value) { return arguments.length > 1 ? this.each((value == null ? propertyRemove : typeof value === "function" ? propertyFunction : propertyConstant)(name, value)) : this.node()[name]; }); // CONCATENATED MODULE: ./node_modules/d3-selection/src/selection/classed.js function classArray(string) { return string.trim().split(/^|\s+/); } function classList(node) { return node.classList || new ClassList(node); } function ClassList(node) { this._node = node; this._names = classArray(node.getAttribute("class") || ""); } ClassList.prototype = { add: function add(name) { var i = this._names.indexOf(name); if (i < 0) { this._names.push(name); this._node.setAttribute("class", this._names.join(" ")); } }, remove: function remove(name) { var i = this._names.indexOf(name); if (i >= 0) { this._names.splice(i, 1); this._node.setAttribute("class", this._names.join(" ")); } }, contains: function contains(name) { return this._names.indexOf(name) >= 0; } }; function classedAdd(node, names) { var list = classList(node), i = -1, n = names.length; while (++i < n) { list.add(names[i]); } } function classedRemove(node, names) { var list = classList(node), i = -1, n = names.length; while (++i < n) { list.remove(names[i]); } } function classedTrue(names) { return function () { classedAdd(this, names); }; } function classedFalse(names) { return function () { classedRemove(this, names); }; } function classedFunction(names, value) { return function () { (value.apply(this, arguments) ? classedAdd : classedRemove)(this, names); }; } /* harmony default export */ var classed = (function (name, value) { var names = classArray(name + ""); if (arguments.length < 2) { var list = classList(this.node()), i = -1, n = names.length; while (++i < n) { if (!list.contains(names[i])) return false; } return true; } return this.each((typeof value === "function" ? classedFunction : value ? classedTrue : classedFalse)(names, value)); }); // CONCATENATED MODULE: ./node_modules/d3-selection/src/selection/text.js function textRemove() { this.textContent = ""; } function textConstant(value) { return function () { this.textContent = value; }; } function textFunction(value) { return function () { var v = value.apply(this, arguments); this.textContent = v == null ? "" : v; }; } /* harmony default export */ var selection_text = (function (value) { return arguments.length ? this.each(value == null ? textRemove : (typeof value === "function" ? textFunction : textConstant)(value)) : this.node().textContent; }); // CONCATENATED MODULE: ./node_modules/d3-selection/src/selection/html.js function htmlRemove() { this.innerHTML = ""; } function htmlConstant(value) { return function () { this.innerHTML = value; }; } function htmlFunction(value) { return function () { var v = value.apply(this, arguments); this.innerHTML = v == null ? "" : v; }; } /* harmony default export */ var html = (function (value) { return arguments.length ? this.each(value == null ? htmlRemove : (typeof value === "function" ? htmlFunction : htmlConstant)(value)) : this.node().innerHTML; }); // CONCATENATED MODULE: ./node_modules/d3-selection/src/selection/raise.js function raise() { if (this.nextSibling) this.parentNode.appendChild(this); } /* harmony default export */ var selection_raise = (function () { return this.each(raise); }); // CONCATENATED MODULE: ./node_modules/d3-selection/src/selection/lower.js function lower() { if (this.previousSibling) this.parentNode.insertBefore(this, this.parentNode.firstChild); } /* harmony default export */ var selection_lower = (function () { return this.each(lower); }); // CONCATENATED MODULE: ./node_modules/d3-selection/src/creator.js function creatorInherit(name) { return function () { var document = this.ownerDocument, uri = this.namespaceURI; return uri === xhtml && document.documentElement.namespaceURI === xhtml ? document.createElement(name) : document.createElementNS(uri, name); }; } function creatorFixed(fullname) { return function () { return this.ownerDocument.createElementNS(fullname.space, fullname.local); }; } /* harmony default export */ var creator = (function (name) { var fullname = namespace(name); return (fullname.local ? creatorFixed : creatorInherit)(fullname); }); // CONCATENATED MODULE: ./node_modules/d3-selection/src/selection/append.js /* harmony default export */ var append = (function (name) { var create = typeof name === "function" ? name : creator(name); return this.select(function () { return this.appendChild(create.apply(this, arguments)); }); }); // CONCATENATED MODULE: ./node_modules/d3-selection/src/selection/insert.js function constantNull() { return null; } /* harmony default export */ var insert = (function (name, before) { var create = typeof name === "function" ? name : creator(name), select = before == null ? constantNull : typeof before === "function" ? before : src_selector(before); return this.select(function () { return this.insertBefore(create.apply(this, arguments), select.apply(this, arguments) || null); }); }); // CONCATENATED MODULE: ./node_modules/d3-selection/src/selection/remove.js function remove_remove() { var parent = this.parentNode; if (parent) parent.removeChild(this); } /* harmony default export */ var selection_remove = (function () { return this.each(remove_remove); }); // CONCATENATED MODULE: ./node_modules/d3-selection/src/selection/clone.js function selection_cloneShallow() { var clone = this.cloneNode(false), parent = this.parentNode; return parent ? parent.insertBefore(clone, this.nextSibling) : clone; } function selection_cloneDeep() { var clone = this.cloneNode(true), parent = this.parentNode; return parent ? parent.insertBefore(clone, this.nextSibling) : clone; } /* harmony default export */ var clone = (function (deep) { return this.select(deep ? selection_cloneDeep : selection_cloneShallow); }); // CONCATENATED MODULE: ./node_modules/d3-selection/src/selection/datum.js /* harmony default export */ var datum = (function (value) { return arguments.length ? this.property("__data__", value) : this.node().__data__; }); // CONCATENATED MODULE: ./node_modules/d3-selection/src/selection/on.js var filterEvents = {}; var on_event = null; if (typeof document !== "undefined") { var on_element = document.documentElement; if (!("onmouseenter" in on_element)) { filterEvents = { mouseenter: "mouseover", mouseleave: "mouseout" }; } } function filterContextListener(listener, index, group) { listener = contextListener(listener, index, group); return function (event) { var related = event.relatedTarget; if (!related || related !== this && !(related.compareDocumentPosition(this) & 8)) { listener.call(this, event); } }; } function contextListener(listener, index, group) { return function (event1) { var event0 = on_event; // Events can be reentrant (e.g., focus). on_event = event1; try { listener.call(this, this.__data__, index, group); } finally { on_event = event0; } }; } function parseTypenames(typenames) { return typenames.trim().split(/^|\s+/).map(function (t) { var name = "", i = t.indexOf("."); if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i); return { type: t, name: name }; }); } function onRemove(typename) { return function () { var on = this.__on; if (!on) return; for (var j = 0, i = -1, m = on.length, o; j < m; ++j) { if (o = on[j], (!typename.type || o.type === typename.type) && o.name === typename.name) { this.removeEventListener(o.type, o.listener, o.capture); } else { on[++i] = o; } } if (++i) on.length = i;else delete this.__on; }; } function onAdd(typename, value, capture) { var wrap = filterEvents.hasOwnProperty(typename.type) ? filterContextListener : contextListener; return function (d, i, group) { var on = this.__on, o, listener = wrap(value, i, group); if (on) for (var j = 0, m = on.length; j < m; ++j) { if ((o = on[j]).type === typename.type && o.name === typename.name) { this.removeEventListener(o.type, o.listener, o.capture); this.addEventListener(o.type, o.listener = listener, o.capture = capture); o.value = value; return; } } this.addEventListener(typename.type, listener, capture); o = { type: typename.type, name: typename.name, value: value, listener: listener, capture: capture }; if (!on) this.__on = [o];else on.push(o); }; } /* harmony default export */ var selection_on = (function (typename, value, capture) { var typenames = parseTypenames(typename + ""), i, n = typenames.length, t; if (arguments.length < 2) { var on = this.node().__on; if (on) for (var j = 0, m = on.length, o; j < m; ++j) { for (i = 0, o = on[j]; i < n; ++i) { if ((t = typenames[i]).type === o.type && t.name === o.name) { return o.value; } } } return; } on = value ? onAdd : onRemove; if (capture == null) capture = false; for (i = 0; i < n; ++i) { this.each(on(typenames[i], value, capture)); } return this; }); function customEvent(event1, listener, that, args) { var event0 = on_event; event1.sourceEvent = on_event; on_event = event1; try { return listener.apply(that, args); } finally { on_event = event0; } } // CONCATENATED MODULE: ./node_modules/d3-selection/src/selection/dispatch.js function dispatchEvent(node, type, params) { var window = src_window(node), event = window.CustomEvent; if (typeof event === "function") { event = new event(type, params); } else { event = window.document.createEvent("Event"); if (params) event.initEvent(type, params.bubbles, params.cancelable), event.detail = params.detail;else event.initEvent(type, false, false); } node.dispatchEvent(event); } function dispatchConstant(type, params) { return function () { return dispatchEvent(this, type, params); }; } function dispatchFunction(type, params) { return function () { return dispatchEvent(this, type, params.apply(this, arguments)); }; } /* harmony default export */ var dispatch = (function (type, params) { return this.each((typeof params === "function" ? dispatchFunction : dispatchConstant)(type, params)); }); // CONCATENATED MODULE: ./node_modules/d3-selection/src/selection/index.js var root = [null]; function Selection(groups, parents) { this._groups = groups; this._parents = parents; } function selection_selection() { return new Selection([[document.documentElement]], root); } Selection.prototype = selection_selection.prototype = { constructor: Selection, select: selection_select, selectAll: selectAll, filter: filter, data: selection_data, enter: selection_enter, exit: selection_exit, join: join, merge: selection_merge, order: order, sort: sort, call: call, nodes: selection_nodes, node: selection_node, size: selection_size, empty: selection_empty, each: each, attr: attr, style: style, property: property, classed: classed, text: selection_text, html: html, raise: selection_raise, lower: selection_lower, append: append, insert: insert, remove: selection_remove, clone: clone, datum: datum, on: selection_on, dispatch: dispatch }; /* harmony default export */ var src_selection = (selection_selection); // CONCATENATED MODULE: ./node_modules/d3-selection/src/select.js /* harmony default export */ var src_select = (function (selector) { return typeof selector === "string" ? new Selection([[document.querySelector(selector)]], [document.documentElement]) : new Selection([[selector]], root); }); // CONCATENATED MODULE: ./node_modules/d3-selection/src/selectAll.js /* harmony default export */ var src_selectAll = (function (selector) { return typeof selector === "string" ? new Selection([document.querySelectorAll(selector)], [document.documentElement]) : new Selection([selector == null ? [] : selector], root); }); // CONCATENATED MODULE: ./node_modules/d3-dispatch/src/dispatch.js var noop = { value: function value() {} }; function dispatch_dispatch() { for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) { if (!(t = arguments[i] + "") || t in _ || /[\s.]/.test(t)) throw new Error("illegal type: " + t); _[t] = []; } return new Dispatch(_); } function Dispatch(_) { this._ = _; } function dispatch_parseTypenames(typenames, types) { return typenames.trim().split(/^|\s+/).map(function (t) { var name = "", i = t.indexOf("."); if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i); if (t && !types.hasOwnProperty(t)) throw new Error("unknown type: " + t); return { type: t, name: name }; }); } Dispatch.prototype = dispatch_dispatch.prototype = { constructor: Dispatch, on: function on(typename, callback) { var _ = this._, T = dispatch_parseTypenames(typename + "", _), t, i = -1, n = T.length; // If no callback was specified, return the callback of the given type and name. if (arguments.length < 2) { while (++i < n) { if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name))) return t; } return; } // If a type was specified, set the callback for the given type and name. // Otherwise, if a null callback was specified, remove callbacks of the given name. if (callback != null && typeof callback !== "function") throw new Error("invalid callback: " + callback); while (++i < n) { if (t = (typename = T[i]).type) _[t] = set(_[t], typename.name, callback);else if (callback == null) for (t in _) { _[t] = set(_[t], typename.name, null); } } return this; }, copy: function copy() { var copy = {}, _ = this._; for (var t in _) { copy[t] = _[t].slice(); } return new Dispatch(copy); }, call: function call(type, that) { if ((n = arguments.length - 2) > 0) for (var args = new Array(n), i = 0, n, t; i < n; ++i) { args[i] = arguments[i + 2]; } if (!this._.hasOwnProperty(type)) throw new Error("unknown type: " + type); for (t = this._[type], i = 0, n = t.length; i < n; ++i) { t[i].value.apply(that, args); } }, apply: function apply(type, that, args) { if (!this._.hasOwnProperty(type)) throw new Error("unknown type: " + type); for (var t = this._[type], i = 0, n = t.length; i < n; ++i) { t[i].value.apply(that, args); } } }; function get(type, name) { for (var i = 0, n = type.length, c; i < n; ++i) { if ((c = type[i]).name === name) { return c.value; } } } function set(type, name, callback) { for (var i = 0, n = type.length; i < n; ++i) { if (type[i].name === name) { type[i] = noop, type = type.slice(0, i).concat(type.slice(i + 1)); break; } } if (callback != null) type.push({ name: name, value: callback }); return type; } /* harmony default export */ var src_dispatch = (dispatch_dispatch); // CONCATENATED MODULE: ./node_modules/d3-timer/src/timer.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); } var timer_frame = 0, // is an animation frame pending? timeout = 0, // is a timeout pending? interval = 0, // are any timers active? pokeDelay = 1000, // how frequently we check for clock skew taskHead, taskTail, clockLast = 0, clockNow = 0, clockSkew = 0, clock = (typeof performance === "undefined" ? "undefined" : _typeof(performance)) === "object" && performance.now ? performance : Date, setFrame = (typeof window === "undefined" ? "undefined" : _typeof(window)) === "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function (f) { setTimeout(f, 17); }; function now() { return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew); } function clearNow() { clockNow = 0; } function Timer() { this._call = this._time = this._next = null; } Timer.prototype = timer.prototype = { constructor: Timer, restart: function restart(callback, delay, time) { if (typeof callback !== "function") throw new TypeError("callback is not a function"); time = (time == null ? now() : +time) + (delay == null ? 0 : +delay); if (!this._next && taskTail !== this) { if (taskTail) taskTail._next = this;else taskHead = this; taskTail = this; } this._call = callback; this._time = time; sleep(); }, stop: function stop() { if (this._call) { this._call = null; this._time = Infinity; sleep(); } } }; function timer(callback, delay, time) { var t = new Timer(); t.restart(callback, delay, time); return t; } function timerFlush() { now(); // Get the current time, if not already set. ++timer_frame; // Pretend we’ve set an alarm, if we haven’t already. var t = taskHead, e; while (t) { if ((e = clockNow - t._time) >= 0) t._call.call(null, e); t = t._next; } --timer_frame; } function wake() { clockNow = (clockLast = clock.now()) + clockSkew; timer_frame = timeout = 0; try { timerFlush(); } finally { timer_frame = 0; nap(); clockNow = 0; } } function poke() { var now = clock.now(), delay = now - clockLast; if (delay > pokeDelay) clockSkew -= delay, clockLast = now; } function nap() { var t0, t1 = taskHead, t2, time = Infinity; while (t1) { if (t1._call) { if (time > t1._time) time = t1._time; t0 = t1, t1 = t1._next; } else { t2 = t1._next, t1._next = null; t1 = t0 ? t0._next = t2 : taskHead = t2; } } taskTail = t0; sleep(time); } function sleep(time) { if (timer_frame) return; // Soonest alarm already set, or will be. if (timeout) timeout = clearTimeout(timeout); var delay = time - clockNow; // Strictly less than if we recomputed clockNow. if (delay > 24) { if (time < Infinity) timeout = setTimeout(wake, time - clock.now() - clockSkew); if (interval) interval = clearInterval(interval); } else { if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay); timer_frame = 1, setFrame(wake); } } // CONCATENATED MODULE: ./node_modules/d3-timer/src/timeout.js /* harmony default export */ var src_timeout = (function (callback, delay, time) { var t = new Timer(); delay = delay == null ? 0 : +delay; t.restart(function (elapsed) { t.stop(); callback(elapsed + delay); }, delay, time); return t; }); // CONCATENATED MODULE: ./node_modules/d3-transition/src/transition/schedule.js var emptyOn = src_dispatch("start", "end", "cancel", "interrupt"); var emptyTween = []; var CREATED = 0; var SCHEDULED = 1; var STARTING = 2; var STARTED = 3; var RUNNING = 4; var ENDING = 5; var ENDED = 6; /* harmony default export */ var transition_schedule = (function (node, name, id, index, group, timing) { var schedules = node.__transition; if (!schedules) node.__transition = {};else if (id in schedules) return; schedule_create(node, id, { name: name, index: index, // For context during callback. group: group, // For context during callback. on: emptyOn, tween: emptyTween, time: timing.time, delay: timing.delay, duration: timing.duration, ease: timing.ease, timer: null, state: CREATED }); }); function schedule_init(node, id) { var schedule = schedule_get(node, id); if (schedule.state > CREATED) throw new Error("too late; already scheduled"); return schedule; } function schedule_set(node, id) { var schedule = schedule_get(node, id); if (schedule.state > STARTED) throw new Error("too late; already running"); return schedule; } function schedule_get(node, id) { var schedule = node.__transition; if (!schedule || !(schedule = schedule[id])) throw new Error("transition not found"); return schedule; } function schedule_create(node, id, self) { var schedules = node.__transition, tween; // Initialize the self timer when the transition is created. // Note the actual delay is not known until the first callback! schedules[id] = self; self.timer = timer(schedule, 0, self.time); function schedule(elapsed) { self.state = SCHEDULED; self.timer.restart(start, self.delay, self.time); // If the elapsed delay is less than our first sleep, start immediately. if (self.delay <= elapsed) start(elapsed - self.delay); } function start(elapsed) { var i, j, n, o; // If the state is not SCHEDULED, then we previously errored on start. if (self.state !== SCHEDULED) return stop(); for (i in schedules) { o = schedules[i]; if (o.name !== self.name) continue; // While this element already has a starting transition during this frame, // defer starting an interrupting transition until that transition has a // chance to tick (and possibly end); see d3/d3-transition#54! if (o.state === STARTED) return src_timeout(start); // Interrupt the active transition, if any. if (o.state === RUNNING) { o.state = ENDED; o.timer.stop(); o.on.call("interrupt", node, node.__data__, o.index, o.group); delete schedules[i]; } // Cancel any pre-empted transitions. else if (+i < id) { o.state = ENDED; o.timer.stop(); o.on.call("cancel", node, node.__data__, o.index, o.group); delete schedules[i]; } } // Defer the first tick to end of the current frame; see d3/d3#1576. // Note the transition may be canceled after start and before the first tick! // Note this must be scheduled before the start event; see d3/d3-transition#16! // Assuming this is successful, subsequent callbacks go straight to tick. src_timeout(function () { if (self.state === STARTED) { self.state = RUNNING; self.timer.restart(tick, self.delay, self.time); tick(elapsed); } }); // Dispatch the start event. // Note this must be done before the tween are initialized. self.state = STARTING; self.on.call("start", node, node.__data__, self.index, self.group); if (self.state !== STARTING) return; // interrupted self.state = STARTED; // Initialize the tween, deleting null tween. tween = new Array(n = self.tween.length); for (i = 0, j = -1; i < n; ++i) { if (o = self.tween[i].value.call(node, node.__data__, self.index, self.group)) { tween[++j] = o; } } tween.length = j + 1; } function tick(elapsed) { var t = elapsed < self.duration ? self.ease.call(null, elapsed / self.duration) : (self.timer.restart(stop), self.state = ENDING, 1), i = -1, n = tween.length; while (++i < n) { tween[i].call(node, t); } // Dispatch the end event. if (self.state === ENDING) { self.on.call("end", node, node.__data__, self.index, self.group); stop(); } } function stop() { self.state = ENDED; self.timer.stop(); delete schedules[id]; for (var i in schedules) { return; } // eslint-disable-line no-unused-vars delete node.__transition; } } // CONCATENATED MODULE: ./node_modules/d3-transition/src/interrupt.js /* harmony default export */ var interrupt = (function (node, name) { var schedules = node.__transition, schedule, active, empty = true, i; if (!schedules) return; name = name == null ? null : name + ""; for (i in schedules) { if ((schedule = schedules[i]).name !== name) { empty = false; continue; } active = schedule.state > STARTING && schedule.state < ENDING; schedule.state = ENDED; schedule.timer.stop(); schedule.on.call(active ? "interrupt" : "cancel", node, node.__data__, schedule.index, schedule.group); delete schedules[i]; } if (empty) delete node.__transition; }); // CONCATENATED MODULE: ./node_modules/d3-transition/src/selection/interrupt.js /* harmony default export */ var selection_interrupt = (function (name) { return this.each(function () { interrupt(this, name); }); }); // CONCATENATED MODULE: ./node_modules/d3-interpolate/src/number.js /* harmony default export */ var number = (function (a, b) { return a = +a, b = +b, function (t) { return a * (1 - t) + b * t; }; }); // CONCATENATED MODULE: ./node_modules/d3-interpolate/src/transform/decompose.js var degrees = 180 / Math.PI; var identity = { translateX: 0, translateY: 0, rotate: 0, skewX: 0, scaleX: 1, scaleY: 1 }; /* harmony default export */ var decompose = (function (a, b, c, d, e, f) { var scaleX, scaleY, skewX; if (scaleX = Math.sqrt(a * a + b * b)) a /= scaleX, b /= scaleX; if (skewX = a * c + b * d) c -= a * skewX, d -= b * skewX; if (scaleY = Math.sqrt(c * c + d * d)) c /= scaleY, d /= scaleY, skewX /= scaleY; if (a * d < b * c) a = -a, b = -b, skewX = -skewX, scaleX = -scaleX; return { translateX: e, translateY: f, rotate: Math.atan2(b, a) * degrees, skewX: Math.atan(skewX) * degrees, scaleX: scaleX, scaleY: scaleY }; }); // CONCATENATED MODULE: ./node_modules/d3-interpolate/src/transform/parse.js var cssNode, cssRoot, cssView, svgNode; function parseCss(value) { if (value === "none") return identity; if (!cssNode) cssNode = document.createElement("DIV"), cssRoot = document.documentElement, cssView = document.defaultView; cssNode.style.transform = value; value = cssView.getComputedStyle(cssRoot.appendChild(cssNode), null).getPropertyValue("transform"); cssRoot.removeChild(cssNode); value = value.slice(7, -1).split(","); return decompose(+value[0], +value[1], +value[2], +value[3], +value[4], +value[5]); } function parseSvg(value) { if (value == null) return identity; if (!svgNode) svgNode = document.createElementNS("http://www.w3.org/2000/svg", "g"); svgNode.setAttribute("transform", value); if (!(value = svgNode.transform.baseVal.consolidate())) return identity; value = value.matrix; return decompose(value.a, value.b, value.c, value.d, value.e, value.f); } // CONCATENATED MODULE: ./node_modules/d3-interpolate/src/transform/index.js function interpolateTransform(parse, pxComma, pxParen, degParen) { function pop(s) { return s.length ? s.pop() + " " : ""; } function translate(xa, ya, xb, yb, s, q) { if (xa !== xb || ya !== yb) { var i = s.push("translate(", null, pxComma, null, pxParen); q.push({ i: i - 4, x: number(xa, xb) }, { i: i - 2, x: number(ya, yb) }); } else if (xb || yb) { s.push("translate(" + xb + pxComma + yb + pxParen); } } function rotate(a, b, s, q) { if (a !== b) { if (a - b > 180) b += 360;else if (b - a > 180) a += 360; // shortest path q.push({ i: s.push(pop(s) + "rotate(", null, degParen) - 2, x: number(a, b) }); } else if (b) { s.push(pop(s) + "rotate(" + b + degParen); } } function skewX(a, b, s, q) { if (a !== b) { q.push({ i: s.push(pop(s) + "skewX(", null, degParen) - 2, x: number(a, b) }); } else if (b) { s.push(pop(s) + "skewX(" + b + degParen); } } function scale(xa, ya, xb, yb, s, q) { if (xa !== xb || ya !== yb) { var i = s.push(pop(s) + "scale(", null, ",", null, ")"); q.push({ i: i - 4, x: number(xa, xb) }, { i: i - 2, x: number(ya, yb) }); } else if (xb !== 1 || yb !== 1) { s.push(pop(s) + "scale(" + xb + "," + yb + ")"); } } return function (a, b) { var s = [], // string constants and placeholders q = []; // number interpolators a = parse(a), b = parse(b); translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q); rotate(a.rotate, b.rotate, s, q); skewX(a.skewX, b.skewX, s, q); scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q); a = b = null; // gc return function (t) { var i = -1, n = q.length, o; while (++i < n) { s[(o = q[i]).i] = o.x(t); } return s.join(""); }; }; } var interpolateTransformCss = interpolateTransform(parseCss, "px, ", "px)", "deg)"); var interpolateTransformSvg = interpolateTransform(parseSvg, ", ", ")", ")"); // CONCATENATED MODULE: ./node_modules/d3-transition/src/transition/tween.js function tweenRemove(id, name) { var tween0, tween1; return function () { var schedule = schedule_set(this, id), tween = schedule.tween; // If this node shared tween with the previous node, // just a