text
stringlengths
2
1.05M
'use strict'; angular.module("ngLocale", [], ["$provide", function($provide) { var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; function getDecimals(n) { n = n + ''; var i = n.indexOf('.'); return (i == -1) ? 0 : n.length - i - 1; } function getVF(n, opt_precision) { var v = opt_precision; if (undefined === v) { v = Math.min(getDecimals(n), 3); } var base = Math.pow(10, v); var f = ((n * base) | 0) % base; return {v: v, f: f}; } $provide.value("$locale", { "DATETIME_FORMATS": { "AMPMS": [ "AM", "PM" ], "DAY": [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ], "ERANAMES": [ "Before Christ", "Anno Domini" ], "ERAS": [ "BC", "AD" ], "FIRSTDAYOFWEEK": 0, "MONTH": [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ], "SHORTDAY": [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ], "SHORTMONTH": [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ], "STANDALONEMONTH": [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ], "WEEKENDRANGE": [ 5, 6 ], "fullDate": "EEEE, d MMMM y", "longDate": "d MMMM y", "medium": "d MMM y HH:mm:ss", "mediumDate": "d MMM y", "mediumTime": "HH:mm:ss", "short": "dd/MM/y HH:mm", "shortDate": "dd/MM/y", "shortTime": "HH:mm" }, "NUMBER_FORMATS": { "CURRENCY_SYM": "\u00a3", "DECIMAL_SEP": ".", "GROUP_SEP": ",", "PATTERNS": [ { "gSize": 3, "lgSize": 3, "maxFrac": 3, "minFrac": 0, "minInt": 1, "negPre": "-", "negSuf": "", "posPre": "", "posSuf": "" }, { "gSize": 3, "lgSize": 3, "maxFrac": 2, "minFrac": 2, "minInt": 1, "negPre": "-\u00a4", "negSuf": "", "posPre": "\u00a4", "posSuf": "" } ] }, "id": "en-fk", "localeID": "en_FK", "pluralCat": function(n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (i == 1 && vf.v == 0) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;} }); }]);
import React from 'react'; import { defaultSkinColor, defaultClothesColor, } from '../../constants'; import Character from '../Character'; import MaxWidthWrapper from '../MaxWidthWrapper'; import ControlPane from '../ControlPane'; import { bodyOptions, headOptions, faceOptions, accessoryOptions, skinColorOptions, clothesColorOptions, } from './CharacterEditor.helpers'; import styles from './CharacterEditor.module.css'; function App() { const [body, setBody] = React.useState(0); const [head, setHead] = React.useState(0); const [face, setFace] = React.useState(0); const [accessory, setAccessory] = React.useState(0); const [skinColor, setSkinColor] = React.useState(defaultSkinColor); const [clothesColor, setClothesColor] = React.useState( defaultClothesColor ); return ( <main className={styles.characterEditor}> <div className={styles.lightGrayBar}></div> <MaxWidthWrapper className={styles.maxWidthWrapper}> <header className={styles.header}> <h1 className={styles.title}>Create your Character</h1> <p className={styles.description}> Customize your character's look and style using the controls below. What sort of adventure will you embark on?{' '} </p> </header> <div className={styles.controlColumn}> <ControlPane title="Bodies" options={bodyOptions} currentOption={body} handleSelectOption={setBody} /> <ControlPane title="Heads" options={headOptions} currentOption={head} handleSelectOption={setHead} /> <ControlPane title="Faces" options={faceOptions} currentOption={face} handleSelectOption={setFace} /> <ControlPane title="Accessories" options={accessoryOptions} currentOption={accessory} handleSelectOption={setAccessory} /> <ControlPane title="Skin Color" options={skinColorOptions} currentOption={skinColor} handleSelectOption={setSkinColor} /> <ControlPane title="Clothing Color" options={clothesColorOptions} currentOption={clothesColor} handleSelectOption={setClothesColor} /> </div> </MaxWidthWrapper> <div className={styles.characterWrapper}> <Character body={body} head={head} face={face} accessory={accessory} skinColor={skinColor} clothesColor={clothesColor} /> </div> </main> ); } export default App;
import $$$ from '../../interface/global'; import $S from "../../interface/stack.js"; import Template from "./Template"; // var requestId = $S.getRequestId(); var Config = {}; var basepathname = $$$.basepathname; var baseApi = $$$.baseApi; var loginUserDetailsApi = $$$.loginUserDetailsApi; Config.basepathname = basepathname; Config.baseApi = baseApi; Config.appVersion = $$$.appVersion; Config.forceLogin = $$$.forceLogin; Config.gtag = $$$.gtag; Config.JQ = $$$.JQ; Config.appControlDataPath = $$$.appControlDataPath; Config.validAppControl = $$$.validAppControl; var headingJson = $$$.headingJson; var appControlDataApi = $$$.appControlDataApi; try { headingJson = JSON.parse(headingJson); Template["heading"][1].text = headingJson; } catch(e) {} var pageData = {}; var pages = { "dataDisplay": basepathname+"/" }; Config.pages = pages; Config.dataDisplay = "dataDisplay"; Template["heading"][1].text = headingJson; Config.dateSelectionRequired = ["dataDisplay"]; Config.defaultPageFields = []; Config.dateSelection = [ {"name": "Single file", "value": "single-file"}, {"name": "All file", "value": "all-file"} ]; Config.goBackLinkData = []; var apiMapping = {}; apiMapping["getLoginUserDetails"] = loginUserDetailsApi; apiMapping["appControlData"] = appControlDataApi; apiMapping["dataPathApi"] = "/api/get_files_info_by_filename_pattern?"; apiMapping["loginRedirectUrl"] = "/login"; Config.getApiUrl = function(key, defaultValue, addBaseUrl) { if ($S.isString(apiMapping[key])) { if ($S.isBooleanTrue(addBaseUrl)) { return baseApi + apiMapping[key]; } else { // used for redirect return apiMapping[key]; } } return defaultValue; }; Config.getPageData = function(key, defaultValue) { if ($S.isString(pageData[key])) { return pageData[key]; } return defaultValue; }; export default Config;
const container = document.querySelector(".container"); const newBookBtn = document.querySelector(".new-book-btn"); const addBookBtn = document.querySelector(".add-book-btn"); const cancelBtn = document.querySelector(".cancel"); const formDiv = document.querySelector(".new-book-form"); const newBookForm = document.querySelector(".form"); let myLibrary = []; class Book { constructor(title, author, pages, read) { this.title = title; this.author = author; this.pages = pages; this.read = read; } info() { let readResult = ""; if (read) { readResult = "read"; } else readResult = "not read yet"; return `${title} by ${autor}, ${pages} pages, ${readResult}`; } } const theHobbit = new Book("The Hobbit", "J.R.R. Tolkien", 295, true); const theLotr = new Book("The Lord of the Rings", "J.R.R. Tolkien", 500, false); function addBookToLibrary(bookObj) { myLibrary.push(bookObj); } addBookToLibrary(theHobbit); addBookToLibrary(theLotr); function displayBook(book) { const bookDiv = document.createElement("div"); const bookInfoDiv = document.createElement("div"); const bookReadBtnDiv = document.createElement("div"); const bookTitle = document.createElement("h2"); const removeBookBtn = document.createElement("span"); const bookAuthor = document.createElement("p"); const bookPages = document.createElement("p"); const bookReadBtn = document.createElement("button"); const bookReadIcon = document.createElement("i"); bookDiv.classList.add("book"); bookInfoDiv.classList.add("book-info-container"); bookReadBtn.classList.add("btn-read"); bookReadIcon.classList.add("far"); removeBookBtn.classList.add("btn-remove"); bookReadBtnDiv.classList.add("book-read-btn-container"); bookReadBtn.textContent = "Read: "; removeBookBtn.textContent = "×"; bookTitle.textContent = `${book.title}`; bookAuthor.textContent = `Author: ${book.author}`; bookPages.textContent = `Pages: ${book.pages}`; if (book.read === true) { bookReadIcon.classList.add("fa-check-circle"); } else { bookReadIcon.classList.add("fa-times-circle"); } container.appendChild(bookDiv); bookDiv.appendChild(bookInfoDiv); bookInfoDiv.appendChild(removeBookBtn); bookInfoDiv.appendChild(bookTitle); bookInfoDiv.appendChild(bookAuthor); bookInfoDiv.appendChild(bookPages); bookInfoDiv.appendChild(bookReadBtnDiv); bookReadBtnDiv.appendChild(bookReadBtn); bookReadBtn.appendChild(bookReadIcon); changeReadStatusOnClick(bookReadBtn, book); removeBookOnClick(removeBookBtn, book); } function displayLibrary() { myLibrary.forEach((book) => { displayBook(book); }); } function openForm() { formDiv.style.display = "block"; } function closeForm() { formDiv.style.display = "none"; } function changeReadStatusOnClick(btn, bookObj) { btn.addEventListener("click", () => { btn.querySelector("i").classList.toggle("fa-check-circle"); btn.querySelector("i").classList.toggle("fa-times-circle"); if (bookObj.read) { bookObj.read = false; } else { bookObj.read = true; } console.log(bookObj.read); }); } function removeBookOnClick(btn, bookObj) { btn.addEventListener("click", () => { if (confirm("Are you sure you want to delete this book from Library?")) { console.log(bookObj); const bookIndex = myLibrary.indexOf(bookObj); console.log(bookIndex); myLibrary.splice(myLibrary.indexOf(bookObj), 1); const divBooks = document.querySelectorAll(".book"); console.log(divBooks[bookIndex]); divBooks[bookIndex].remove(); console.log(myLibrary); } }); } function addNewBookByUser(event) { const newBook = new Book( newBookForm.elements.title.value, newBookForm.elements.author.value, newBookForm.elements.pages.value, newBookForm.elements.read.checked ); addBookToLibrary(newBook); event.preventDefault(); newBookForm.reset(); closeForm(); displayBook(newBook); console.log(myLibrary); } newBookBtn.addEventListener("click", openForm); cancelBtn.addEventListener("click", closeForm); window.addEventListener("click", (event) => { if (event.target == formDiv) { formDiv.style.display = "none"; newBookForm.reset(); } }); newBookForm.addEventListener("submit", (event) => { for (let i = 0; i < myLibrary.length; i++) { if ( newBookForm.elements.title.value == myLibrary[i].title && newBookForm.elements.author.value == myLibrary[i].author ) { alert("Book is already in the Library!"); event.preventDefault(); return; } } addNewBookByUser(event); }); displayLibrary();
const debug = require('debug')('drachtio:sbc-rtpengine-sidecar'); module.exports = ({logger}) => { return (req, res) => { /* TODO: build this out with your logic */ debug(req.uri, 'got incoming OPTIONS'); res.send(200, { headers: { 'User-agent': 'sbc-rtpengine-sidecar' } }); }; };
'use strict'; const Renderer = require('./Renderer'); module.exports = class BooleanRenderer extends Renderer { getName() { return 'boolean'; } render({ context, value, label, decoration, }) { context.renderDecoration({label, decoration, close: true}); context.print(this.decorate(context, value, 'text')); } }
import { NgModule } from '@angular/core'; import { KendoDraggableDirective } from './common/draggable'; import { CommonModule } from '@angular/common'; import { CldrIntlService, IntlService } from '@progress/kendo-angular-intl'; /** * @hidden */ var DraggableModule = /** @class */ (function () { function DraggableModule() { } DraggableModule.decorators = [ { type: NgModule, args: [{ declarations: [KendoDraggableDirective], exports: [KendoDraggableDirective], imports: [CommonModule], providers: [ { provide: IntlService, useClass: CldrIntlService } ] },] }, ]; /** @nocollapse */ DraggableModule.ctorParameters = function () { return []; }; return DraggableModule; }()); export { DraggableModule };
/** * @type {Map} */ const LISTENERS = new Map(); /** * Get the value of a key. * * @param {String} key * @param {Object} opts * @return {Promise} */ export function get(key, {sync = false} = {}) { const area = sync ? chrome.storage.sync : chrome.storage.local; return new Promise((resolve, reject) => area.get(key, item => { if (chrome.runtime.lastError) { return reject(new Error(chrome.runtime.lastError.message)); } resolve(item[key]); })); } /** * Set the value of a key. * * @param {String} key * @param {String} value * @param {Object} opts * @return {Promise} */ export function set(key, value, {sync = false} = {}) { const area = sync ? chrome.storage.sync : chrome.storage.local; return new Promise((resolve, reject) => area.set({[key]: value}, () => { if (chrome.runtime.lastError) { return reject(new Error(chrome.runtime.lastError.message)); } resolve(value); })); } /** * Remove all keys from storage. * * @param {Object} opts * @return {Promise} */ export function clear({sync = false} = {}) { const area = sync ? chrome.storage.sync : chrome.storage.local; return new Promise((resolve, reject) => area.clear(() => { if (chrome.runtime.lastError) { return reject(new Error(chrome.runtime.lastError.message)); } resolve(); })); } /** * Attach an event listener. * * @param {String} event * @param {Object} [opts] * @param {Function} listener */ export function on(event, opts, listener) { if (!listener) { listener = opts; opts = {}; } if (!event || !listener || listener.constructor !== Function) { return; } const {sync = true, local = true} = opts; if (!LISTENERS.has(event)) { LISTENERS.set(event, new Map()); } LISTENERS.get(event).set(listener, {sync, local}); } /** * Attach an event listener that is at most invoked once. * * @param {String} event * @param {Object} [opts] * @param {Function} listener * @return {Promise} */ export function once(event, opts, listener) { if (!listener) { listener = opts; opts = {}; } if (!event) { return; } const wrapped = (payload, sender) => { listener(payload, sender); off(event, wrapped); }; if (listener && listener.constructor === Function) { on(event, opts, wrapped); } else { return new Promise(resolve => { listener = resolve; on(event, opts, wrapped); }); } } /** * Detach an event listener. * * @param {String} event * @param {Function} listener */ export function off(event, listener) { if (!event || !listener || listener.constructor !== Function) { return; } if (LISTENERS.has(event)) { LISTENERS.get(event).delete(listener); } } chrome.storage.onChanged.addListener( /** * @param {Object} changes * @param {String} area */ (changes, area) => { const event = 'changed'; if (!LISTENERS.has(event)) { return; } const keys = Object.keys(changes); for (const [listener, {sync, local}] of LISTENERS.get(event)) { if ((area === 'sync' && !sync) || (area === 'local' && !local)) { continue; } for (const key of keys) { const {oldValue, newValue} = changes[key]; listener(key, oldValue, newValue); } } } );
goog.provide('plugin.im.action.feature.ui.StyleConfigCtrl'); goog.provide('plugin.im.action.feature.ui.styleConfigDirective'); goog.require('goog.color'); goog.require('os.color'); goog.require('os.object'); goog.require('os.style'); goog.require('os.ui.Module'); goog.require('os.ui.file.kml'); goog.require('os.ui.icon.IconPickerEventType'); goog.require('os.ui.im.action.EventType'); goog.require('os.ui.layer.iconStyleControlsDirective'); goog.require('os.ui.layer.vectorStyleControlsDirective'); goog.require('os.ui.uiSwitchDirective'); goog.require('plugin.im.action.feature.StyleAction'); goog.require('plugin.im.action.feature.ui.ActionConfigCtrl'); /** * Directive to configure a feature style action. * * @return {angular.Directive} */ plugin.im.action.feature.ui.styleConfigDirective = function() { return { restrict: 'E', replace: true, template: '<div><vectorstylecontrols color="color" opacity="opacity" size="size" line-dash="lineDash"' + 'icon="icon" center-icon="centerIcon" icon-set="ctrl.iconSet" icon-src="ctrl.iconSrc" ' + 'shape="shape" shapes="shapes" center-shape="centerShape" center-shapes="centerShapes" ' + 'show-color-reset="true" fill-color="fillColor" fill-opacity="fillOpacity"></vectorstylecontrols>' + '<iconstylecontrols ng-show="ctrl.showRotationOption()" columns="columns" show-rotation="showRotation" ' + 'rotation-column="rotationColumn"></iconstylecontrols></div>', controller: plugin.im.action.feature.ui.StyleConfigCtrl, controllerAs: 'ctrl' }; }; /** * Add the directive to the module. */ os.ui.Module.directive(plugin.im.action.feature.StyleAction.CONFIG_UI, [plugin.im.action.feature.ui.styleConfigDirective]); /** * Controller for setting a feature style. * * @param {!angular.Scope} $scope The Angular scope. * @param {!angular.JQLite} $element The root DOM element. * @extends {plugin.im.action.feature.ui.ActionConfigCtrl<plugin.im.action.feature.StyleAction>} * @constructor * @ngInject */ plugin.im.action.feature.ui.StyleConfigCtrl = function($scope, $element) { plugin.im.action.feature.ui.StyleConfigCtrl.base(this, 'constructor', $scope, $element); /** * Icons available to the icon picker. * @type {!Array<!osx.icon.Icon>} */ this['iconSet'] = os.ui.file.kml.GOOGLE_EARTH_ICON_SET; /** * Function to translate image sources from the icon set. * @type {function(string):string} */ this['iconSrc'] = os.ui.file.kml.replaceGoogleUri; /** * The action style config. * @type {Object} * @protected */ this.styleConfig = /** @type {!Object} */ (os.object.unsafeClone(os.style.DEFAULT_VECTOR_CONFIG)); /** * The original style color, for the Reset button. * @type {string|undefined} * @protected */ this.initialColor = undefined; if (this.action && this.action.styleConfig) { os.style.mergeConfig(this.action.styleConfig, this.styleConfig); } $scope.$on('color.change', this.onColorChange.bind(this)); $scope.$on('color.reset', this.onColorReset.bind(this)); $scope.$on('fillColor.change', this.onFillColorChange.bind(this)); $scope.$on('fillColor.reset', this.onFillColorReset.bind(this)); $scope.$on('opacity.slidestop', this.onOpacityChange.bind(this)); $scope.$on('fillOpacity.slidestop', this.onOpacityChange.bind(this)); $scope.$on('size.slidestop', this.onSizeChange.bind(this)); $scope.$on(os.ui.layer.VectorStyleControlsEventType.LINE_DASH_CHANGE, this.onLineDashChange.bind(this)); $scope.$on(os.ui.icon.IconPickerEventType.CHANGE, this.onIconChange.bind(this)); $scope.$on(os.ui.layer.VectorStyleControlsEventType.SHAPE_CHANGE, this.onShapeChange.bind(this)); $scope.$on(os.ui.layer.VectorStyleControlsEventType.CENTER_SHAPE_CHANGE, this.onCenterShapeChange.bind(this)); $scope.$on(os.ui.layer.VectorStyleControlsEventType.SHOW_ROTATION_CHANGE, this.onShowRotationChange_.bind(this)); $scope.$on(os.ui.layer.VectorStyleControlsEventType.ROTATION_COLUMN_CHANGE, this.onRotationColumnChange_.bind(this)); this.initialize(); }; goog.inherits(plugin.im.action.feature.ui.StyleConfigCtrl, plugin.im.action.feature.ui.ActionConfigCtrl); /** * @inheritDoc */ plugin.im.action.feature.ui.StyleConfigCtrl.prototype.initialize = function() { if (this.styleConfig) { var color = /** @type {Array<number>} */ (os.style.getConfigColor(this.styleConfig, true, os.style.StyleField.STROKE)); if (!color) { color = os.style.getConfigColor(this.styleConfig, true); } if (color) { this.scope['color'] = this.initialColor = os.color.toHexString(color); if (color.length < 4) { color[3] = os.style.DEFAULT_ALPHA; } this.scope['opacity'] = color[3]; } else { this.scope['color'] = os.color.toHexString(os.style.DEFAULT_LAYER_COLOR); this.scope['opacity'] = os.style.DEFAULT_ALPHA; color = os.color.toRgbArray(this.scope['color']); color[3] = this.scope['opacity']; } var fill = /** @type {Array<number>} */ (os.style.getConfigColor(this.styleConfig, true, os.style.StyleField.FILL)); if (fill) { this.scope['fillColor'] = os.color.toHexString(fill); if (fill.length < 4) { fill[3] = os.style.DEFAULT_FILL_ALPHA; } this.scope['fillOpacity'] = fill[3]; } else { this.scope['fillColor'] = os.color.toHexString(color || os.style.DEFAULT_FILL_COLOR); this.scope['fillOpacity'] = os.style.DEFAULT_FILL_ALPHA; fill = os.color.toRgbArray(this.scope['fillColor']); fill[3] = this.scope['fillOpacity']; } // Standardize the stroke color var strokeColor = os.style.toRgbaString(color); os.style.setConfigColor(this.styleConfig, strokeColor); // If we have a fill color, set that to our style config os.style.setFillColor(this.styleConfig, os.style.toRgbaString(fill)); this.scope['size'] = os.style.getConfigSize(this.styleConfig); this.scope['lineDash'] = os.style.getConfigLineDash(this.styleConfig); this.scope['shape'] = this.styleConfig[os.style.StyleField.SHAPE] || os.style.DEFAULT_SHAPE; this.updateIcon_(); this.scope['centerShape'] = this.styleConfig[os.style.StyleField.CENTER_SHAPE] || os.style.DEFAULT_CENTER_SHAPE; this.updateCenterIcon_(); this.scope['showRotation'] = this.styleConfig[os.style.StyleField.SHOW_ROTATION] || false; this.scope['rotationColumn'] = this.styleConfig[os.style.StyleField.ROTATION_COLUMN] || ''; if (this.type) { var dm = os.data.DataManager.getInstance(); var source = dm.getSource(this.type); if (os.instanceOf(source, os.source.Vector.NAME)) { source = /** @type {!os.source.Vector} */ (source); var shapes = goog.object.getKeys(os.style.SHAPES); this.scope['shapes'] = goog.array.filter(shapes, source.supportsShape, source); this.scope['centerShapes'] = goog.array.filter(shapes, source.isNotEllipseOrLOBOrDefault, source); this.scope['columns'] = os.ui.layer.getColumnsFromSource(source); // autodetect if (goog.string.isEmptyOrWhitespace(this.scope['rotationColumn']) && source.hasColumn(os.Fields.BEARING)) { this.scope['rotationColumn'] = os.Fields.BEARING; this.onRotationColumnChange_(undefined, this.scope['rotationColumn']); } } } } plugin.im.action.feature.ui.StyleConfigCtrl.base(this, 'initialize'); }; /** * @inheritDoc */ plugin.im.action.feature.ui.StyleConfigCtrl.prototype.saveAction = function() { if (this.action && this.styleConfig) { this.action.styleConfig = this.styleConfig; // send a message indicating an update occurred os.dispatcher.dispatchEvent(os.ui.im.action.EventType.UPDATE); } }; /** * Handle color change. * * @param {?angular.Scope.Event} event The Angular event. * @param {string|undefined} value The new color value. * @protected */ plugin.im.action.feature.ui.StyleConfigCtrl.prototype.onColorChange = function(event, value) { if (event) { event.stopPropagation(); } if (this.styleConfig) { var color = value ? os.style.toRgbaString(value) : os.style.DEFAULT_LAYER_COLOR; // update the color with the correct opacity var colorArr = os.color.toRgbArray(color); var opacity = /** @type {number|undefined} */ (this.scope['opacity']); if (colorArr && opacity != null) { colorArr[3] = opacity; color = os.style.toRgbaString(colorArr); } // update the fill color with the correct opacity var fillColor = value ? os.style.toRgbaString(value) : os.style.DEFAULT_FILL_COLOR; var fillOpacity = /** @type {number|undefined} */ (this.scope['fillOpacity']); var fillColorArr = os.color.toRgbArray(fillColor); if (fillColorArr && fillOpacity != null) { fillColorArr[3] = fillOpacity; fillColor = os.style.toRgbaString(fillColorArr); } // Determine if we are changing both stroke and fill entirely, or keeping opacities separate, or only affecting stroke var strokeColorHex = os.color.toHexString(this.scope['color']); var fillColorHex = os.color.toHexString(this.scope['fillColor']); var strokeColorOpacity = this.scope['opacity']; var fillColorOpacity = this.scope['fillOpacity']; if (strokeColorHex == fillColorHex && strokeColorOpacity == fillColorOpacity) { // change both to be the same os.style.setConfigColor(this.styleConfig, color); this.scope['color'] = os.color.toHexString(color); this.scope['fillColor'] = os.color.toHexString(color); } else if (strokeColorHex == fillColorHex) { // change the color, but not the opacity, of each one separately os.style.setConfigColor(this.styleConfig, color); this.scope['color'] = os.color.toHexString(color); // Only change the fill color without changing the image fill color too os.style.setFillColor(this.styleConfig, fillColor); this.scope['fillColor'] = os.color.toHexString(fillColor); } else { // change just the stroke color os.style.setConfigColor(this.styleConfig, color); this.scope['color'] = os.color.toHexString(color); } } }; /** * Handle fill color change. * * @param {?angular.Scope.Event} event The Angular event. * @param {string|undefined} value The new color value. * @protected */ plugin.im.action.feature.ui.StyleConfigCtrl.prototype.onFillColorChange = function(event, value) { if (event) { event.stopPropagation(); } if (this.styleConfig) { var color = value ? os.style.toRgbaString(value) : os.style.DEFAULT_FILL_COLOR; // update the color with the correct opacity var colorArr = os.color.toRgbArray(color); var opacity = /** @type {number|undefined} */ (this.scope['fillOpacity']); if (colorArr && opacity != null) { colorArr[3] = opacity; color = os.style.toRgbaString(colorArr); } // Only change the fill color without changing the image fill color too os.style.setFillColor(this.styleConfig, color); this.scope['fillColor'] = os.color.toHexString(color); } }; /** * Handle color reset. * * @param {?angular.Scope.Event} event The Angular event. * @protected */ plugin.im.action.feature.ui.StyleConfigCtrl.prototype.onColorReset = function(event) { if (event) { event.stopPropagation(); } // reset the color to the initial value this.onColorChange(event, this.initialColor); }; /** * Handle fill color reset. * * @param {?angular.Scope.Event} event The Angular event. * @protected */ plugin.im.action.feature.ui.StyleConfigCtrl.prototype.onFillColorReset = function(event) { if (event) { event.stopPropagation(); } // reset the color to the initial value this.onFillColorChange(event, os.style.DEFAULT_FILL_COLOR); }; /** * Handle icon change. * * @param {?angular.Scope.Event} event The Angular event. * @param {osx.icon.Icon} value The new value. * @protected */ plugin.im.action.feature.ui.StyleConfigCtrl.prototype.onIconChange = function(event, value) { if (event) { event.stopPropagation(); } if (this.styleConfig && value) { os.style.setConfigIcon(this.styleConfig, value); } }; /** * Handle changes to opacity. * * @param {?angular.Scope.Event} event The Angular event. * @param {number} value * @protected */ plugin.im.action.feature.ui.StyleConfigCtrl.prototype.onOpacityChange = function(event, value) { if (event) { event.stopPropagation(); } var color; if (event.name == 'fillOpacity.slidestop') { color = os.style.getConfigColor(this.styleConfig, true, os.style.StyleField.FILL); color[3] = value; // Only change the fill color without changing the image fill color too os.style.setFillColor(this.styleConfig, color); this.scope['fillOpacity'] = value; } else { var strokeColorHex = os.color.toHexString(this.scope['color']); var fillColorHex = os.color.toHexString(this.scope['fillColor']); var strokeColorOpacity = this.scope['opacity']; var fillColorOpacity = this.scope['fillOpacity']; if (strokeColorHex == fillColorHex && strokeColorOpacity == fillColorOpacity) { color = os.style.getConfigColor(this.styleConfig, true); color[3] = value; os.style.setConfigColor(this.styleConfig, color); this.scope['opacity'] = value; this.scope['fillOpacity'] = value; } else { color = os.style.getConfigColor(this.styleConfig, true, os.style.StyleField.STROKE); color[3] = value; os.style.setConfigColor(this.styleConfig, color); if (this.scope['fillColor']) { os.style.setFillColor(this.styleConfig, this.styleConfig['fillColor']); } this.scope['opacity'] = value; } } }; /** * Handle changes to size. * * @param {?angular.Scope.Event} event The Angular event. * @param {number} value * @protected */ plugin.im.action.feature.ui.StyleConfigCtrl.prototype.onSizeChange = function(event, value) { if (event) { event.stopPropagation(); } if (this.styleConfig && value != null) { os.style.setConfigSize(this.styleConfig, value); } }; /** * Handle changes to line dash. * * @param {?angular.Scope.Event} event The Angular event. * @param {Array<number>} value * @protected */ plugin.im.action.feature.ui.StyleConfigCtrl.prototype.onLineDashChange = function(event, value) { if (event) { event.stopPropagation(); } if (this.styleConfig && value != null) { os.style.setConfigLineDash(this.styleConfig, value); } }; /** * Handle changes to the shape. * * @param {?angular.Scope.Event} event The Angular event. * @param {string} value The new value. * @protected */ plugin.im.action.feature.ui.StyleConfigCtrl.prototype.onShapeChange = function(event, value) { if (event) { event.stopPropagation(); } if (this.styleConfig) { this.styleConfig[os.style.StyleField.SHAPE] = value; } this.updateIcon_(); }; /** * Handle changes to the shape. * * @param {?angular.Scope.Event} event The Angular event. * @param {string} value The new value. * @protected */ plugin.im.action.feature.ui.StyleConfigCtrl.prototype.onCenterShapeChange = function(event, value) { if (event) { event.stopPropagation(); } if (this.styleConfig) { this.styleConfig[os.style.StyleField.CENTER_SHAPE] = value; } this.updateCenterIcon_(); }; /** * Update the displayed icon. * * @private */ plugin.im.action.feature.ui.StyleConfigCtrl.prototype.updateIcon_ = function() { if (this.styleConfig && this.styleConfig[os.style.StyleField.SHAPE] == os.style.ShapeType.ICON) { this.scope['icon'] = os.style.getConfigIcon(this.styleConfig) || os.ui.file.kml.getDefaultIcon(); } else { this.scope['icon'] = null; } this.onIconChange(null, this.scope['icon']); }; /** * Update the displayed icon. * * @private */ plugin.im.action.feature.ui.StyleConfigCtrl.prototype.updateCenterIcon_ = function() { if (this.styleConfig && this.styleConfig[os.style.StyleField.CENTER_SHAPE] == os.style.ShapeType.ICON) { this.scope['centerIcon'] = os.style.getConfigIcon(this.styleConfig) || os.ui.file.kml.getDefaultIcon(); } else { this.scope['centerIcon'] = null; } this.onIconChange(null, this.scope['centerIcon']); }; /** * When to show the icon rotation option * * @return {boolean} * @export */ plugin.im.action.feature.ui.StyleConfigCtrl.prototype.showRotationOption = function() { if (this.scope != null) { var shape = this.scope['shape'] || ''; var center = this.scope['centerShape'] || ''; return shape == os.style.ShapeType.ICON || ((os.style.ELLIPSE_REGEXP.test(shape) || os.style.LOB_REGEXP.test(shape)) && center == os.style.ShapeType.ICON); } return false; }; /** * Handle changes to the Show Rotation option. * * @param {angular.Scope.Event} event * @param {boolean} value * @private */ plugin.im.action.feature.ui.StyleConfigCtrl.prototype.onShowRotationChange_ = function(event, value) { if (event) { event.stopPropagation(); } if (this.styleConfig) { this.styleConfig[os.style.StyleField.SHOW_ROTATION] = value; } }; /** * Handles column changes to the rotation * * @param {angular.Scope.Event=} opt_event * @param {string=} opt_value * @private */ plugin.im.action.feature.ui.StyleConfigCtrl.prototype.onRotationColumnChange_ = function(opt_event, opt_value) { if (opt_event) { opt_event.stopPropagation(); } if (opt_value && this.styleConfig) { this.styleConfig[os.style.StyleField.ROTATION_COLUMN] = opt_value; } };
exports.level = { "goalTreeString": "{\"branches\":{\"master\":{\"target\":\"C6\",\"id\":\"master\",\"remoteTrackingBranchID\":\"o/master\"},\"foo\":{\"target\":\"C7\",\"id\":\"foo\",\"remoteTrackingBranchID\":\"o/foo\"},\"o/master\":{\"target\":\"C1\",\"id\":\"o/master\",\"remoteTrackingBranchID\":null},\"o/foo\":{\"target\":\"C1\",\"id\":\"o/foo\",\"remoteTrackingBranchID\":null}},\"commits\":{\"C0\":{\"parents\":[],\"id\":\"C0\",\"rootCommit\":true},\"C1\":{\"parents\":[\"C0\"],\"id\":\"C1\"},\"C2\":{\"parents\":[\"C1\"],\"id\":\"C2\"},\"C3\":{\"parents\":[\"C2\"],\"id\":\"C3\"},\"C5\":{\"parents\":[\"C1\"],\"id\":\"C5\"},\"C6\":{\"parents\":[\"C5\"],\"id\":\"C6\"},\"C7\":{\"parents\":[\"C3\",\"C6\"],\"id\":\"C7\"}},\"HEAD\":{\"target\":\"foo\",\"id\":\"HEAD\"},\"originTree\":{\"branches\":{\"master\":{\"target\":\"C4\",\"id\":\"master\",\"remoteTrackingBranchID\":null},\"foo\":{\"target\":\"C6\",\"id\":\"foo\",\"remoteTrackingBranchID\":null}},\"commits\":{\"C0\":{\"parents\":[],\"id\":\"C0\",\"rootCommit\":true},\"C1\":{\"parents\":[\"C0\"],\"id\":\"C1\"},\"C2\":{\"parents\":[\"C1\"],\"id\":\"C2\"},\"C3\":{\"parents\":[\"C2\"],\"id\":\"C3\"},\"C4\":{\"parents\":[\"C3\"],\"id\":\"C4\"},\"C5\":{\"parents\":[\"C1\"],\"id\":\"C5\"},\"C6\":{\"parents\":[\"C5\"],\"id\":\"C6\"}},\"HEAD\":{\"target\":\"foo\",\"id\":\"HEAD\"}}}", "solutionCommand": "git fetch origin master~1:foo;git fetch origin foo:master;git checkout foo;git merge master", "startTree": "{\"branches\":{\"master\":{\"target\":\"C1\",\"id\":\"master\",\"remoteTrackingBranchID\":\"o/master\"},\"foo\":{\"target\":\"C1\",\"id\":\"foo\",\"remoteTrackingBranchID\":\"o/foo\"},\"o/master\":{\"target\":\"C1\",\"id\":\"o/master\",\"remoteTrackingBranchID\":null},\"o/foo\":{\"target\":\"C1\",\"id\":\"o/foo\",\"remoteTrackingBranchID\":null}},\"commits\":{\"C0\":{\"parents\":[],\"id\":\"C0\",\"rootCommit\":true},\"C1\":{\"parents\":[\"C0\"],\"id\":\"C1\"}},\"HEAD\":{\"target\":\"C1\",\"id\":\"HEAD\"},\"originTree\":{\"branches\":{\"master\":{\"target\":\"C4\",\"id\":\"master\",\"remoteTrackingBranchID\":null},\"foo\":{\"target\":\"C6\",\"id\":\"foo\",\"remoteTrackingBranchID\":null}},\"commits\":{\"C0\":{\"parents\":[],\"id\":\"C0\",\"rootCommit\":true},\"C1\":{\"parents\":[\"C0\"],\"id\":\"C1\"},\"C2\":{\"parents\":[\"C1\"],\"id\":\"C2\"},\"C3\":{\"parents\":[\"C2\"],\"id\":\"C3\"},\"C4\":{\"parents\":[\"C3\"],\"id\":\"C4\"},\"C5\":{\"parents\":[\"C1\"],\"id\":\"C5\"},\"C6\":{\"parents\":[\"C5\"],\"id\":\"C6\"}},\"HEAD\":{\"target\":\"foo\",\"id\":\"HEAD\"}}}", "name": { "en_US": "Fetch arguments", "fr_FR": "Arguments de fetch", "zh_CN": "Fetch 的参数", "zh_TW": "fetch 的參數", "es_AR": "Parámetros de fetch", "pt_BR": "Parâmetros do fetch", "de_DE": "Optionen für Fetch", "ja" : "Fetchの引数", "ru_RU": "Аргументы для fetch", "ko" : "Fetch의 인자들", "uk" : "Аргументи для fetch" }, "hint": { "en_US": "Pay attention how the commit ids may have swapped! You can read slides again with \"help level\"", "fr_FR": "Faites attention à la façon dont les ids des commits ont été intervertis ! Vous pouvez lire une nouvelle fois les slides avec \"help level\"", "zh_CN": "注意下提交对象的 id 是如何交换的! 你可以通过 `help level` 再次切到幻灯片!", "zh_TW": "注意 commit 的 id 是怎麼被交換的!你可以透過 `help level` 來閱讀對話視窗!", "es_AR": "¡Prestá atención a cómo podrían haberse invertido los ids de los commits! Podés volver a leer toda la lección usando \"help level\"", "pt_BR": "Preste atenção em como os identificadores dos commits podem ter trocado! Você pode ler os slides novamente com \"help level\"", "de_DE": "Beachte wie die Commit IDs getauscht wurden! Du kannst den Einführungsdialog mit \"help level\" erneut anzeigen", "ja" : "コミットIDの入れ替わりに注意!スライドを復習するには`help level`を実行", "ru_RU": "Обратите внимание на то, как номера коммитов могут меняться! Вы можете прочесть слайды вновь, воспользовавшись командой \"help level\"", "ko" : "커밋 ID가 바뀔수도있으니 주의하세요! \"help level\"을 입력하면 슬라이드들을 다시 읽어볼수 있습니다.", "uk" : "Зверни увагу на те, що номери комітів можуть мінятися! Слайди уроку можна переглянути ще раз командою \"help level\"" }, "startDialog": { "en_US": { "childViews": [ { "type": "ModalAlert", "options": { "markdowns": [ "## Git fetch arguments", "", "So we've just learned all about git push arguments, this cool `<place>` parameter, and even colon refspecs (`<source>:<destination>`). Can we use all this knowledge for `git fetch` as well?", "", "You betcha! The arguments for `git fetch` are actually *very, very* similar to those for `git push`. It's the same type of concepts but just applied in the opposite direction (since now you are downloading commits rather than uploading).", "", "Let's go over the concepts one at a time..." ] } }, { "type": "ModalAlert", "options": { "markdowns": [ "### The `<place>` parameter", "", "If you specify a place with git fetch like in the following command:", "", "`git fetch origin foo`", "", "Git will go to the `foo` branch on the remote, grab all the commits that aren't present locally, and then plop them down onto the `o/foo` branch locally.", "", "Let's see this in action (just as a refresher)." ] } }, { "type": "GitDemonstrationView", "options": { "beforeMarkdowns": [ "By specifying a place..." ], "afterMarkdowns": [ "We download only the commits from `foo` and place them on `o/foo`" ], "command": "git fetch origin foo", "beforeCommand": "git branch foo; git clone; git fakeTeamwork foo 2" } }, { "type": "ModalAlert", "options": { "markdowns": [ "You might be wondering -- why did git plop those commits onto the `o/foo` remote branch rather than just plopping them onto my local `foo` branch? I thought the `<place>` parameter is a place that exists both locally and on the remote?", "", "Well git makes a special exception in this case because you might have work on the `foo` branch that you don't want to mess up!! This ties into the earlier lesson on `git fetch` -- it doesn't update your local non-remote branches, it only downloads the commits (so you can inspect / merge them later).", "" ] } }, { "type": "ModalAlert", "options": { "markdowns": [ "\"Well in that case, what happens if I explicitly define both the source and destination with `<source>:<destination>`?\"", "", "If you feel passionate enough to fetch commits *directly* onto a local branch, then yes you can specify that with a colon refspec. You can't fetch commits onto a branch that is checked out, but otherwise git will allow this.", "", "Here is the only catch though -- `<source>` is now a place on the *remote* and `<destination>` is a *local* place to put those commits. It's the exact opposite of git push, and that makes sense since we are transferring data in the opposite direction!", "", "That being said, developers rarely do this in practice. I'm introducing it mainly as a way to conceptualize how `fetch` and `push` are quite similar, just in opposite directions." ] } }, { "type": "GitDemonstrationView", "options": { "beforeMarkdowns": [ "Let's see this craziness in action:" ], "afterMarkdowns": [ "Wow! See, git resolved `foo~1` as a place on the origin and then downloaded those commits to `bar` (which was a local branch). Notice how `foo` and `o/foo` were not updated since we specified a destination." ], "command": "git fetch origin foo~1:bar", "beforeCommand": "git branch foo; git clone; git branch bar; git fakeTeamwork foo 2" } }, { "type": "GitDemonstrationView", "options": { "beforeMarkdowns": [ "What if the destination doesn't exist before I run the command? Let's see the last slide but without `bar` existing beforehand." ], "afterMarkdowns": [ "See, it's JUST like git push. Git made the destination locally before fetching, just like git will make the destination on remote before pushing (if it doesn't exist)." ], "command": "git fetch origin foo~1:bar", "beforeCommand": "git branch foo; git clone; git fakeTeamwork foo 2" } }, { "type": "GitDemonstrationView", "options": { "beforeMarkdowns": [ "No args?", "", "If `git fetch` receives no arguments, it just downloads all the commits from the remote onto all the remote branches..." ], "afterMarkdowns": [ "Pretty simple, but worth going over just once." ], "command": "git fetch", "beforeCommand": "git branch foo; git clone; git fakeTeamwork foo; git fakeTeamwork master" } }, { "type": "ModalAlert", "options": { "markdowns": [ "Ok, enough talking! To finish this level, fetch just the specified commits in the goal visualization. Get fancy with those commands!", "", "You will have to specify the source and destination for both fetch commands. Pay attention to the goal visualization since the IDs may be switched around!" ] } } ] }, "fr_FR": { "childViews": [ { "type": "ModalAlert", "options": { "markdowns": [ "## Les arguments de git fetch", "", "Nous savons maintenant tout ce qu'il y a à savoir sur les arguments de git push, y compris le paramètre `<place>` et la ponctuation pour refspecs (`<source>:<destination>`). Pouvons-nous utiliser ces connaissances avec `git fetch` également ?", "", "Bien sûr ! Les arguments de `git fetch` sont en fait *très, très* similaires à ceux de `git push`. Il s'agit des mêmes concepts mais simplement appliqués dans le sens opposé (puisque maintenant vous récupérez des commits plutôt que de les envoyer).", "", "Voyons ces concepts un par un..." ] } }, { "type": "ModalAlert", "options": { "markdowns": [ "### Le paramètre `<place>`", "", "Si vous spécifiez un emplacement à git fetch, comme dans la commande suivante :", "", "`git fetch origin foo`", "", "Git va aller à la branche distante `foo`, récupérer tous les commits qui ne sont pas présents localement, puis les rapatrier dans la branche locale `o/foo`.", "", "Voyons cela en action (juste pour réviser)." ] } }, { "type": "GitDemonstrationView", "options": { "beforeMarkdowns": [ "En spécifiant un emplacement..." ], "afterMarkdowns": [ "Nous téléchargeons uniquement les commits de `foo` et les plaçons dans `o/foo`." ], "command": "git fetch origin foo", "beforeCommand": "git branch foo; git clone; git fakeTeamwork foo 2" } }, { "type": "ModalAlert", "options": { "markdowns": [ "Vous vous posez peut-être la question : pourquoi git a-t-il fait apparaître ces commits dans la branche distante `o/foo` plutôt que les placer directement dans ma branche locale `foo` ? Je croyais que le paramètre `<place>` était un emplacement qui existait à la fois localement et sur le dépôt distant ?", "", "En fait git fait une exception dans ce cas parce que vous pourriez avoir du travail en cours dans la branche `foo` que vous ne voulez pas écraser !! Cela provient de ce que nous avions vu dans la leçon précédente sur `git fetch` : cette commande ne met pas à jour vos branches locales, elle télécharge uniquement les commits (pour que vous puissiez les inspecter et/ou les fusionner plus tard).", "" ] } }, { "type": "ModalAlert", "options": { "markdowns": [ "\"Bon, mais dans ce cas, que ce passe-t-il si je spécifie explicitement la source et la destination avec `<source>:<destination>` ?\"", "", "Si vous vous sentez assez déterminé pour rapatrier (fetch) des commits *directement* dans votre branche locale, alors oui vous pouvez préciser cela avec la notation refspec. Vous ne pouvez cependant pas rapatrier les commits dans la branche courante.", "", "Il y a un petit piège cependant : dans ce cas précis `<source>` est l'emplacement sur le dépôt *distant* et `<destination>` l'emplacement sur le dépôt *local* où seront placés ces commits. C'est l'exact opposé de git push, et cela se tient puisque nous transférons des données dans le sens opposée !", "", "Cela dit, les développeurs utilisent rarement cette syntaxe en pratique. Je l'introduis principalement pour concrétiser le fait que `fetch` et `push` sont très similaires, fonctionnant simplement dans des sens opposées." ] } }, { "type": "GitDemonstrationView", "options": { "beforeMarkdowns": [ "Voyons ce délire en action :" ], "afterMarkdowns": [ "Wow ! Vous voyez, git a résolu `foo~1` comme un emplacement sur origin et a ensuite téléchargé les commits dans `bar` (qui était une branche locale). Remarquez aussi que `foo` et `o/foo` n'ont pas été mises à jour puisque nous avons spécifié une destination." ], "command": "git fetch origin foo~1:bar", "beforeCommand": "git branch foo; git clone; git branch bar; git fakeTeamwork foo 2" } }, { "type": "GitDemonstrationView", "options": { "beforeMarkdowns": [ "Que se passe-t-il si l'emplacement n'existe pas avant que j'exécute la commande ? Voyons cela dans ce dernier slide, en nous mettant dans la situation où `bar` n'existe pas encore." ], "afterMarkdowns": [ "Vous voyez, c'est COMME un git push. Git a créé la destination localement avant le fetch, exactement comme avec push il crée au préalable la destination sur le dépôt distant (si elle n'existe pas)." ], "command": "git fetch origin foo~1:bar", "beforeCommand": "git branch foo; git clone; git fakeTeamwork foo 2" } }, { "type": "GitDemonstrationView", "options": { "beforeMarkdowns": [ "Pas d'arguments ?", "", "Si `git fetch` ne reçoit pas d'arguments, cela télécharge simplement tous les commits du dépôt distant au sein de toutes les branches distantes..." ], "afterMarkdowns": [ "Assez simple, mais ce n'était pas inutile de voir en action." ], "command": "git fetch", "beforeCommand": "git branch foo; git clone; git fakeTeamwork foo; git fakeTeamwork master" } }, { "type": "ModalAlert", "options": { "markdowns": [ "Ok, assez parlé ! Pour finir ce niveau, faites simplement un fetch des commits indiqués dans la fenêtre de visualisation de l'objectif. Faites-vous plaisir !", "", "Vous devrez préciser la source et la destination pour les deux commandes fetch. Faites attention à l'objectif puisque les IDs peuvent avoir été intervertis !" ] } } ] }, "es_AR": { "childViews": [ { "type": "ModalAlert", "options": { "markdowns": [ "## Parámetros de git fetch", "", "Entonces, recién aprendimos todo sobre los parámetros de push, este parámetro `<lugar>` copado, e incluso las referencias separadas por dos puntos (`<origen>:<destino>`). ¿Podremos usar todo ese conocimiento para `git fetch`, también?", "", "¡Dalo por hecho! Los parámetros para `git fetch` son realmente *muy, muy* similares a los de `git push`. Es el mismo tipo de conceptos, pero aplicados en la dirección opuesta (dado que ahora estás bajando commits en lugar de subirlos).", "", "Veamos los conceptos de a uno a la vez..." ] } }, { "type": "ModalAlert", "options": { "markdowns": [ "### El parámetro `<lugar>`", "", "Si especificás un lugar con git fetch como en el comando siguiente:", "", "`git fetch origin foo`", "", "Git va a ir a la rama `foo` en el remoto, va a traer todos los commits que no estén presentes localmente, y luego los aplicará sobre la rama `o/foo` localmente.", "", "Veámoslo en acción (refresquemos el concepto)." ] } }, { "type": "GitDemonstrationView", "options": { "beforeMarkdowns": [ "Especificando un lugar..." ], "afterMarkdowns": [ "Sólo bajamos los commits de `foo` y los ubicamos en `o/foo`" ], "command": "git fetch origin foo", "beforeCommand": "git branch foo; git clone; git fakeTeamwork foo 2" } }, { "type": "ModalAlert", "options": { "markdowns": [ "Te podrás estar preguntando \"¿Por qué git aplicó esos commits sobre la rama `origin/foo` en lugar de aplicarlos sobre la rama `foo` local? Pensé que el parámetro `<lugar>` era un lugar que existía tanto local como remotamente\"", "", "Bueno, git hace una excepción especial en este caso, porque vos podrías tener trabajo en la rama `foo` que no quieras mezclar. Esto refiere a la lección anterior sobre `git fetch` - no actualiza tus ramas locales no-remotas, sólo descarga los commits (para que pueadas verlos o mergearlos después).", "" ] } }, { "type": "ModalAlert", "options": { "markdowns": [ "\"Bueno, y, en ese caso, ¿qué pasa si explícitamente defino el origen y destino con `<origen>:<destino>`?\"", "", "Si te sentís lo suficientemente seguro como para traer commits *directamente* a una rama local, entonces, sí, podés especificarlo usando una referencia con dos puntos. No podés traer commits a una rama que tengas checkouteada, pero en cualquier otro caso git te lo va a permitir.", "", "Este es el único problemita, igual: `<origen>` es ahora un lugar en el *remoto*, y `<destino>` es un lugar *local* en donde poner esos commits. Es exactamente lo opuesto a git push, y eso tiene sentido dado que ¡estamos transfiriendo los datos en la dirección opuesta!", "", "Habiendo dicho esto, dificilmente alguien use esto en la práctica. Lo estoy presentando principalmente como un modo de conceptualizar que `fetch` y `push` son bastante similares, sólo que en direcciones opuestas." ] } }, { "type": "GitDemonstrationView", "options": { "beforeMarkdowns": [ "Veamos esta locura en acción:" ], "afterMarkdowns": [ "¡Wow! Mirá: git resolvió `foo~1` como un lugar en el origin y bajó esos commits a `bar` (que era una rama local). Notá como `foo` y `o/foo` no fueron actualizados, dado que especificamos un destino." ], "command": "git fetch origin foo~1:bar", "beforeCommand": "git branch foo; git clone; git branch bar; git fakeTeamwork foo 2" } }, { "type": "GitDemonstrationView", "options": { "beforeMarkdowns": [ "¿Qué pasa si el destino no existe antes de que corra este comando? Veamos el último ejemplo pero sin que `bar` exista de antemano." ], "afterMarkdowns": [ "Mirá: es IGUAL que git push. Git creó el destino localmente antes de hacer el fetch, tal como git creará el destino en el remoto antes de pushear (si no existiera)." ], "command": "git fetch origin foo~1:bar", "beforeCommand": "git branch foo; git clone; git fakeTeamwork foo 2" } }, { "type": "GitDemonstrationView", "options": { "beforeMarkdowns": [ "¿Sin argumentos?", "", "Si `git fetch` no recibe ningún argumento, simplemente descarga todos los commits del remoto a todas las ramas remotas..." ], "afterMarkdowns": [ "Bastante simple, pero vale la pena verlo al menos una vez." ], "command": "git fetch", "beforeCommand": "git branch foo; git clone; git fakeTeamwork foo; git fakeTeamwork master" } }, { "type": "ModalAlert", "options": { "markdowns": [ "Bueno, demasiada charla. Para completar este nivel, fetcheáte sólo los commits especificados en la visualización del objetivo. ¡Amigate con esos comandos!", "", "Vas a tener que especificar el origen y el destino para ambos comandos fetch. Prestá atención al objetivo dado que ¡los IDs pueden estar invertidos!" ] } } ] }, "pt_BR": { "childViews": [ { "type": "ModalAlert", "options": { "markdowns": [ "## Parâmetros do git fetch", "", "Então acabamos de aprender tudo sobre os parâmetros do git push, inclusive sobre esse parâmetro bacana chamado `<lugar>`, e até mesmo sobre colon refspecs (`<origem>:<destino>`). Será que poderíamos aplicar todo esse conhecimento também ao `git fetch`?", "", "Você adivinhou! Os parâmetros do `git fetch` são na verdade *muito, muito* similares aos do `git push`. Trata-se do mesmo tipo de conceito, só que aplicado na direção oposta (já que agora é um download em vez de um upload).", "", "Vamos aos conceitos um por vez..." ] } }, { "type": "ModalAlert", "options": { "markdowns": [ "### O parâmetro `<lugar>`", "", "Se você passar um lugar ao git fetch, como no seguinte comando:", "", "`git fetch origin foo`", "", "O Git vai ao ramo remoto `foo` e pega todos os commits que não estão presentes localmente, jogando-os no ramo local `o/foo`.", "", "Vejamo-lo em ação (só para refrescar a memória)." ] } }, { "type": "GitDemonstrationView", "options": { "beforeMarkdowns": [ "Especificando um lugar..." ], "afterMarkdowns": [ "Baixamos só os commits de `foo` e colocamos em `o/foo`" ], "command": "git fetch origin foo", "beforeCommand": "git branch foo; git clone; git fakeTeamwork foo 2" } }, { "type": "ModalAlert", "options": { "markdowns": [ "Você pode estar se perguntando -- por que o Git colocou os commits no ramo remoto `o/foo` em vez de simplesmente jogá-los no meu ramo local `foo`? Eu pensei que o parâmetro fosse um `<lugar>` que existisse tanto no repositório local como no remoto?", "", "Bem, o Git tem uma exceção especial neste caso, porque pode ser que exista trabalho seu no ramo local `foo` que você não queira bagunçar!! Esse fato é relacionado com o abordado na lição anterior sobre o `git fetch` -- ele não atualiza ramos locais não-remotos, ele apenas baixa os commits (de forma que você possa inspecioná-los e/ou realizar um merge posteriormente).", "" ] } }, { "type": "ModalAlert", "options": { "markdowns": [ "\"Bem, neste caso, o que acontece se eu definir explicitamente tanto a origem como o destino, com `<origem>:<destino>`?\"", "", "Se você estiver apaixonado o suficiente para baixar commits *diretamente* em um ramo local, então sim, você pode especificar esse comportamento com um colon refspec. Você só não pode baixar commits em um ramo que esteja atualmente em checkout, mas se não estiver, o Git permitirá o fetch.", "", "Aqui está o único detalhe -- `<origem>` agora é uma referência *remota* e `<destino>` é uma referência *local* de onde colocar esses commits. É exatamente o oposto do git push, e realmente faz sentido, já que estamos transferindo os dados na direção oposta!", "", "Tendo dito isto, desenvolvedores raramente fazem isso na prática. Estou introduzindo essa informação mais como uma forma de conceitualizar a forma como `fetch` e `push` são tão similares, apenas em direções opostas." ] } }, { "type": "GitDemonstrationView", "options": { "beforeMarkdowns": [ "Vejamos essa loucura em ação:" ], "afterMarkdowns": [ "Wow! Viu, o Git entendeu o `foo~1` como um lugar de origin e baixou os commits para o ramo local `bar`. Veja como `foo` e `o/foo` não foram atualizados, já que especificamos outro destino." ], "command": "git fetch origin foo~1:bar", "beforeCommand": "git branch foo; git clone; git branch bar; git fakeTeamwork foo 2" } }, { "type": "GitDemonstrationView", "options": { "beforeMarkdowns": [ "E se o destino não existir antes de eu executar o comando? Vamos rever o último slide, mas em uma situação na qual o `bar` não existe de antemão." ], "afterMarkdowns": [ "Viu? Funciona EXATAMENTE como o git push. O Git criou o destino localmente antes do fetch, da mesma forma como o Git cria o destino (se ele não existir) no repositório remoto durante um push." ], "command": "git fetch origin foo~1:bar", "beforeCommand": "git branch foo; git clone; git fakeTeamwork foo 2" } }, { "type": "GitDemonstrationView", "options": { "beforeMarkdowns": [ "Sem parâmetros?", "", "Se o `git fetch` não receber argumentos, ele simplesmente baixa todos os commits do repositório remoto em todos os ramos remotos..." ], "afterMarkdowns": [ "Bastante simples, mas importante de rever ao menos uma vez." ], "command": "git fetch", "beforeCommand": "git branch foo; git clone; git fakeTeamwork foo; git fakeTeamwork master" } }, { "type": "ModalAlert", "options": { "markdowns": [ "Ok, chega de conversa! Para completar este nível, faça fetch apenas dos commits especificados na visualização do objetivo. Capriche nos comandos!", "", "Você terá de especificar tanto a origem como o destino em ambos os comandos de fetch. Preste atenção na janela de visualização, já que os identificadores podem trocar!" ] } } ] }, "zh_TW": { "childViews": [ { "type": "ModalAlert", "options": { "markdowns": [ "## git fetch 的參數", "", "我們剛學到了所有關於 git push 的參數,有非常棒的 `<place>` 參數,甚至是 colon refspecs(`<source>:<destination>`),我們可不可以也同樣套用到 `git fetch` 上面?", "", "你猜對了!`git fetch` 的參數*非常非常*類似 `git push`,一樣的概念,但方向不同(因為你在下載 commit,而不是在上傳 commit)。", "", "讓我們一次講一個概念..." ] } }, { "type": "ModalAlert", "options": { "markdowns": [ "###`<place>` 參數", "", "對於 `git fetch`,如果你特別指定了一個 `<place>`:", "", "`git fetch origin foo`", "", "git 會到 remote 上的 `foo` branch,抓下所有不在 local 上的 commit,然後將它們放到 local 的 `o/foo` branch。", "", "讓我們實際看一下(就只是一個*更新*的方法)。" ] } }, { "type": "GitDemonstrationView", "options": { "beforeMarkdowns": [ "指定一個 `<place>`..." ], "afterMarkdowns": [ "我們只下載了 `foo` 上的 commit,並且把它們放到 `o/foo`。" ], "command": "git fetch origin foo", "beforeCommand": "git branch foo; git clone; git fakeTeamwork foo 2" } }, { "type": "ModalAlert", "options": { "markdowns": [ "你也許會感到奇怪,為什麼 git 是把這些 commit 放到 `o/foo` branch 而不是放到我的 local 的 `foo` branch? 我認為,`<place>` 參數是表示一個位置,這個位置同時存在 local 跟 remote 上?", "", "因為你可能已經 checkout 到 `foo` branch 上,而且你不想要打亂上面的 commit,因此 git 才會特別這樣做!!這就又回到之前的 `git fetch` 的課程,它並不會放到你的 local 上的 branch (該 branch 沒有對應到任何的 remote branch),它只會下載 commit 到 local 上且表示 remote 的 branch(所以你之後可以觀察或者 merge 它們)。", "" ] } }, { "type": "ModalAlert", "options": { "markdowns": [ "\"在該例子當中,如果我特別透過 `<source>:<destination>` 來指定 source 以及 destination,會發生什麼事情?\"", "", "如果你很想要把 fetch 回來的 commit *直接*放到 local branch,那麼你就可以利用一個 colon refspec 來做到。你不能夠把 fetch 回來的 commit 放到你目前正 checkout 的 branch,如果不是的話,git 就會允許你這麼做。", "", "這裡只有一個重點,`<source>` 現在是一個在 *remote* 上的 branch,而且 `<destination>` 是一個放置這些 commit 的 *local* 的位置。它剛好就是 `git push` 的相反,而且因為我們在相反方向傳遞資料,所以這也很合理!", "", "其實,程式設計師很少會想要做這個,我主要是強調 `fetch` 以及 `push` 的概念是很類似的,就只是方向相反而已。" ] } }, { "type": "GitDemonstrationView", "options": { "beforeMarkdowns": [ "讓我們來實際看一下這個瘋狂的事情:" ], "afterMarkdowns": [ "哇!看到了吧,git 把 `foo~1` 解讀成一個在 origin 上的位置,而且把該位置上面的 commit 下載到 `bar`(這是一個 local branch)上面,注意,因為我們有指定目的地,因此 `foo` 跟 `o/foo` 並沒有被更新。" ], "command": "git fetch origin foo~1:bar", "beforeCommand": "git branch foo; git clone; git branch bar; git fakeTeamwork foo 2" } }, { "type": "GitDemonstrationView", "options": { "beforeMarkdowns": [ "如果我在執行這個指令之前,destination 不存在的話會怎樣?我們回到上一個例子,但這一次事前並沒有 `bar` 這個 branch 的存在。" ], "afterMarkdowns": [ "看到了吧,這就像是 `git push`,在 fetch 之前,git 會自己建立 destination,就好像是在 push 之前, git 會建立 remote 上的 destination 一樣(如果它不存在的話)。" ], "command": "git fetch origin foo~1:bar", "beforeCommand": "git branch foo; git clone; git fakeTeamwork foo 2" } }, { "type": "GitDemonstrationView", "options": { "beforeMarkdowns": [ "沒有參數的情況?", "", "如果使用 `git fetch` 的時候,沒有指定任何的參數,那就相當於它會下載 remote 上面的所有的 commit,並且把這些 commit 放到 local 上面所有對應到 remote 的 branch..." ], "afterMarkdowns": [ "超簡單,但是所有的更新只做一次,很值得。" ], "command": "git fetch", "beforeCommand": "git branch foo; git clone; git fakeTeamwork foo; git fakeTeamwork master" } }, { "type": "ModalAlert", "options": { "markdowns": [ "好的,講了好多!要完成這一關,fetch 視覺化的目標所指定的 commit,好好玩這些指令吧!", "", "對於兩個 fetch 的指令,你必須要指定 source 以及 destination,注意一下視覺化的目標,因為 commit 的 id 可以被交換!" ] } } ] }, "zh_CN": { "childViews": [ { "type": "ModalAlert", "options": { "markdowns": [ "## Git fetch arguments", "", "我们刚学习了 git push 的参数, 特别是 `<place>` 参数, 更特别的冒号分隔(`<source>:<destination>`). 这些参数可以用于 `git fetch` 吗?", "", "你猜中了! git fetch 的参数和 git push 相当相似. 都是相同的概念, 但是方向相反(因为现在你是下载 而非上传)", "", "让我们逐个讨论下这些概念.." ] } }, { "type": "ModalAlert", "options": { "markdowns": [ "### `<place>` 参数", "", "你可以像如下命令这样为 git fetch 设置 <place>", "", "`git fetch origin foo`", "", "Git 会来到远端的 `foo` 分支, 然后抓取所有不在本地的新提交, 放到本地的分支 `o/foo`", "", "我们看看这个动作(这像是更新器) " ] } }, { "type": "GitDemonstrationView", "options": { "beforeMarkdowns": [ "通过指定 place..." ], "afterMarkdowns": [ "我们只下载更新了 o/foo" ], "command": "git fetch origin foo", "beforeCommand": "git branch foo; git clone; git fakeTeamwork foo 2" } }, { "type": "ModalAlert", "options": { "markdowns": [ "你可能会好奇 -- 为何 Git 会将新提交压入到 o/foo 而不是压入到我本地的 foo. 我想 <place> 参数就是同时存在于本地和远端的 <place> ", "", "好吧, 本例中 Git 有个特殊例外, 因为你可能位于 foo 分支, 你也不想弄乱它. 这得联系之前的课程 -- 它不会更新你的本地工作, 它只是下载提交(这样, 稍后你可以检查或者合并之). ", "" ] } }, { "type": "ModalAlert", "options": { "markdowns": [ "如果我们设定了 `<source>:<destination>` 会发生什么呢?", "", "如果你觉得直接更新本地分支很爽, 那你就用冒号 refspec 吧. 不过, 你不能在检出的分支上干这个事.", "", "这里只有一个特点 -- `source` 是远端的位置, 而 `<destination>` 是要放置提交的本地位置, 这真是有趣 -- 这也是传送数据的对立方向! ", "", "话虽如此, 开发者很少这么做. 我已经介绍了, 概念上 fetch/push 很相似, 只是它们方向相反. " ] } }, { "type": "GitDemonstrationView", "options": { "beforeMarkdowns": [ "我们看看更疯狂的例子:" ], "afterMarkdowns": [ "哇! 看见了吧, Git 将 `foo~1` 解析成一个 origin 的位置, 然后下载到了本地 `bar`. 注意 foo 和 o/foo 都没有得到更新 (因为我们指定了 destination)." ], "command": "git fetch origin foo~1:bar", "beforeCommand": "git branch foo; git clone; git branch bar; git fakeTeamwork foo 2" } }, { "type": "GitDemonstrationView", "options": { "beforeMarkdowns": [ "如果 destination 不存在呢? 我们看看上个幻灯片(不含 bar)! " ], "afterMarkdowns": [ "看见了吧, 它就像是 git push. Git 会在 fetch 前自己确立本地 destination, 就像是 Git 在 push 时, 会自己在 remote 确立 destination (如果它不存在的话)一样" ], "command": "git fetch origin foo~1", "beforeCommand": "git branch foo; git clone; git fakeTeamwork foo 2" } }, { "type": "GitDemonstrationView", "options": { "beforeMarkdowns": [ "没有参数呢?", "", "如果 `git fetch` 没有参数, 它会下载所有远端分支.." ], "afterMarkdowns": [ "相当简单, 但是仅需更新一次,很值!" ], "command": "git fetch", "beforeCommand": "git branch foo; git clone; git fakeTeamwork foo; git fakeTeamwork master" } }, { "type": "ModalAlert", "options": { "markdowns": [ "好, 说得太多了! 要完成本节, 抓取可视窗口指定的提交, 使用这些魔幻的命令吧.", "", "使用 fetch 时, 你必须指定 source/destination. 注意一下可视窗口, 因为提交对象的 id 可以会被切换哦!" ] } } ] }, "de_DE": { "childViews": [ { "type": "ModalAlert", "options": { "markdowns": [ "## Git Fetch Optionen", "", "Nun haben wir also alles über `git push` Optionen gelernt, diesen coolen `<Ort>`-Parameter, and sogar über mit Doppelpunkt getrennte Ref-Spezifikationen (`<Quelle>:<Ziel>`). Können wir all dieses neu erworbene Wissen auch auf `git fetch` anwenden?", "", "Jede Wette! Die Optionen für `git fetch` sind wirklicht *sehr, sehr* ähnlich denen von `git push`. Es sind dieselben Verfahren, nur in die andere Richtung angewendet (da man bei `fetch` herunterlädt anstatt hochzuladen).", "", "Gehen wir die verschiedenen Verfahrensweise mal eine nach der anderen durch ..." ] } }, { "type": "ModalAlert", "options": { "markdowns": [ "### Der Parameter `<Ort>`", "", "Wenn du, wie folgt, einen \"Ort\" bei `git fetch` angibst:", "", "`git fetch origin foo`", "", "wird Git zum Branch `foo` auf dem Remote gehen, dort alle Änderungen holen, die es lokal noch nicht gibt, und sie an den lokalen Branch `o/foo` anhängen.", "", "Schauen wir uns das mal live an (nur zur Wiederholung)" ] } }, { "type": "GitDemonstrationView", "options": { "beforeMarkdowns": [ "Durch Angabe eines Ortes ..." ], "afterMarkdowns": [ "... laden wir die fehlenden Commits von `foo` und packen sie auf `o/foo` drauf." ], "command": "git fetch origin foo", "beforeCommand": "git branch foo; git clone; git fakeTeamwork foo 2" } }, { "type": "ModalAlert", "options": { "markdowns": [ "Du wunderst dich vielleicht warum Git diese Commits auf den `o/foo` Branch gepacht hat, anstatt einfach direkt auf den lokalen Branch `foo`? Zeigt der Parameter `<Ort>` nicht einen Ort an, der sowohl lokal als auch entfernt existiert?", "", "Nun ja, Git geht diesen Schritt weil du auf `foo` ja noch Commits haben könntest, die nicht auf dem Server sind, und da will es nichts durcheinander bringen. Ähnlich wie beim früheren Level zu `git fetch` -- es aktualisiert nicht deine lokalen Arbeits-Branches, es lädt die Commits nur in die `o` (bzw. `origin`) Branches, damit du sie dir in Ruhe anschauen und integrieren kannst.", "" ] } }, { "type": "ModalAlert", "options": { "markdowns": [ "Wenn das so ist, was passiert dann wenn ich explizit Quelle und Ziel im Ort angebe?", "", "Wenn du Commits wirklich per `fetch` *direkt* auf einen lokalen Branch holen willst, dann, ja, kannst du das mit einer Ref-Spezifikation erreichen. Das funktioniert nicht mit deinem gerade ausgecheckten Branch, aber davon abgesehen lässt Git es zu.", "", "Nur ein Haken -- `<Quelle>` bezeichnet jetzt einen Ort auf dem *entfernten* Server und `<Ziel>` ist ein *lokaler* Ort, wo die Commits hin sollen. Es ist genau umgekehrt wie bei `git push` und das ist logisch, denn wir übertragen die Daten ja auch in die umgekehrte Richtung!", "", "Davon abgesehen benutzt man das in der Praxis kaum. Ich zeige das vor allem um zu verdeutlichen, wie `fetch` und `push` sehr ähnlich sind, nur in entgegengesetzten Richtungen." ] } }, { "type": "GitDemonstrationView", "options": { "beforeMarkdowns": [ "Schauen wir uns den Quatsch mal in Aktion an:" ], "afterMarkdowns": [ "Wow! Siehst du, git löst `foo~1` als Ort auf dem Server `origin` auf und lädt dessen Commits herunter in `bar` hinein. Beachte wie `foo` und `o/foo` *nicht* aktualisiert wurden, da wir ein Ziel angegeben haben." ], "command": "git fetch origin foo~1:bar", "beforeCommand": "git branch foo; git clone; git branch bar; git fakeTeamwork foo 2" } }, { "type": "GitDemonstrationView", "options": { "beforeMarkdowns": [ "Was ist denn wenn das Ziel nicht existiert, für das ich den Befehl ausführe? Schauen wir uns das letzte Beispiel noch mal an, nur dass `bar` jetzt noch nicht existiert." ], "afterMarkdowns": [ "Siehst du, es ist *genau* wie `git push`. Git erstellt das Ziel lokal bevor es den `fetch` ausführt, genauso wie Git erst das Ziel auf dem Remote erstellt, befor es pusht (falls das Ziel nicht existiert)." ], "command": "git fetch origin foo~1:bar", "beforeCommand": "git branch foo; git clone; git fakeTeamwork foo 2" } }, { "type": "GitDemonstrationView", "options": { "beforeMarkdowns": [ "Keine Optionen?", "", "Wenn bei `git fetch` keine Optionen angegeben werden, lädt es einfach alle Commits vom Remote auf die lokalen Abbildungen aller Remote Branches ..." ], "afterMarkdowns": [ "Ziemlich einfach, aber man sollte es mal gesehen haben." ], "command": "git fetch", "beforeCommand": "git branch foo; git clone; git fakeTeamwork foo; git fakeTeamwork master" } }, { "type": "ModalAlert", "options": { "markdowns": [ "Ok, genug gelabert! Um den Level zu schaffen musst du nur die im Zielbild angegebenen Commits per `fetch` holen. Sei kreativ mit den Befehlen!", "", "Du wirst Quelle und Ziel bei beiden `fetch` Befehlen angeben müssen. Schau dir das Zielbild gut an, da die IDs vertauscht sein könnten!" ] } } ] }, "ru_RU": { "childViews": [ { "type": "ModalAlert", "options": { "markdowns": [ "## Аргументы git fetch", "", "Итак, мы только что изучили всё, что касается аргументов git push, мы узнали о параметре `<пункт назначения>`, и даже об аргументе, задающем отдельно источник и получатель коммитов (`<источник>:<получатель>`). Можем ли мы применить все эти полученные знания для команды `git fetch` ?", "", "Ещё бы! Аргументы для команды `git fetch` на самом деле *очень, очень* похожи на те, что мы использовали в `git push`. В данном случае применяется тот же подход, только в противоположном направлении (так как теперь вы скачиваете коммиты, а не закачиваете их).", "", "Давайте ознакомимся с принципами один за одним..." ] } }, { "type": "ModalAlert", "options": { "markdowns": [ "### Параметр `<пункт назначения>`", "", "Если вы указываете пункт назначения в команде git fetch, например так, как в следующем примере:", "", "`git fetch origin foo`", "", "Git отправится в ветку `foo` на удалённом репозитории, соберёт с собой все коммиты, которые не присутствуют локально, и затем поместит их в локальную ветку под названием `o/foo`.", "", "Давайте взглянем на всё это в действии (чтобы освежить в памяти)." ] } }, { "type": "GitDemonstrationView", "options": { "beforeMarkdowns": [ "Указывая пункт назначения..." ], "afterMarkdowns": [ "мы скачиваем только коммиты с ветки `foo` и помещаем их в `o/foo`" ], "command": "git fetch origin foo", "beforeCommand": "git branch foo; git clone; git fakeTeamwork foo 2" } }, { "type": "ModalAlert", "options": { "markdowns": [ "Вы, должно быть, спрашиваете себя — зачем git поместил эти коммиты в ветку `o/foo` вместо того, чтобы разместить из в локальной ветке `foo` ? Ведь я думал о параметре `<пункт назначения>`, как о месте, ветке, которая существует в обоих - локальном и удалённом репозитории. Верно?", "", "На самом деле, в данном случае git делает исключение, потому что вы, возможно, работаете над веткой `foo`, которую не хотите привести в беспорядок!! Об этом упоминалось в ранних уроках по `git fetch` - эта команда не обновляет ваши локальные 'не удалённые', она лишь скачивает коммиты (соответственно, вы можете инспектировать / объединять их позже).", "" ] } }, { "type": "ModalAlert", "options": { "markdowns": [ "\"Что же тогда произойдёт, если я явно укажу оба параметра: и источник и получатель, пользуясь синтаксисом `<источник>:<получатель>` ?\"", "", "Если вы уверены в том, что хотите закачать коммиты *прямиком* в вашу локальную ветку, тогда да, вы можете явно указать источник и получатель через двоеточние. Вы можете воспользоваться таким приёмом лишь для ветки, на которой вы не находитесь в настоящий момент `checkout`.", "", "Теперь у нас `<источник>` - это место на *удалённом репозитории*, а `<получатель>` - место в *локальном* репозитории, в который следует помещать коммиты. Аргументы в точности до наоборот повторяют git push, и немудрено, ведь теперь мы переносим данные в обратном направлении!", "", "Как уже было сказано, разработчики редко используют такой подход на практике. Целью демонстрации этой возможности было показать, насколько схожи концептуально `fetch` и `push`. Их отличие лишь в направлении переноса данных." ] } }, { "type": "GitDemonstrationView", "options": { "beforeMarkdowns": [ "Давайте взглянем на всё это в действии:" ], "afterMarkdowns": [ "Ого! Видите, git распознал `foo~1` как место в origin и затем скачал эти коммиты в `bar`, которая является локальной веткой. Обратите внимание, что ветки `foo` и `o/foo` не изменились, так как в аргументах мы явно указали получателя." ], "command": "git fetch origin foo~1:bar", "beforeCommand": "git branch foo; git clone; git branch bar; git fakeTeamwork foo 2" } }, { "type": "GitDemonstrationView", "options": { "beforeMarkdowns": [ "А что, если ветка-получатель не существует на момент запуска команды? Давайте ещё раз взглянем на предыдущий слайд, но на этот раз ветки `bar` ещё не существует." ], "afterMarkdowns": [ "Видите, поведение совсем такое же, как и у git push. Git создал ветку-получатель локально прежде чем скачивать данные. Всё как и в случае, когда git создаёт получателя в удалённом репозитории, когда мы закачиваем изменения (если получатель не существует)." ], "command": "git fetch origin foo~1:bar", "beforeCommand": "git branch foo; git clone; git fakeTeamwork foo 2" } }, { "type": "GitDemonstrationView", "options": { "beforeMarkdowns": [ "А если вообще без аргументов ?", "", "Если команда `git fetch` выполняется без аргументов, она скачивает все-все коммиты с удалённого репозитория и помещает их в соответствующие удалённо-локальные ветки в локальном репозитории..." ], "afterMarkdowns": [ "Достаточно просто, после того как мы пережили все эти технические тонкости." ], "command": "git fetch", "beforeCommand": "git branch foo; git clone; git fakeTeamwork foo; git fakeTeamwork master" } }, { "type": "ModalAlert", "options": { "markdowns": [ "Ладно, достаточно болтовни! Чтобы выполнить этот уровень, скачайте лишь определённые коммиты так, как представлено в визуализации цели. Пофантазируйте с этими командами!", "", "Вам следует явно указывать источник и получателя для обеих команд fetch. Обратите внимание на визуализацию цели, так как ID-шники могут меняться!" ] } } ] }, "ko": { "childViews": [ { "type": "ModalAlert", "options": { "markdowns": [ "## Git fetch 인자들", "", "여태까지 우리는 git push 인자들에 대해 배워봤습니다. 이 멋진 `<place>` 인자 그리고 콜론 참조스펙도 말이죠(`<source>:<destination>`). 우리가 알아낸 이 지식을 `git fetch`에도 적용 할 수 있으려나요?", "", "당연하죠! `git fetch`에 넘기는 인자들은 사실 `git push`의 그것들과 *아주 아주* 비슷합니다. 같은 컨셉으로 적용되지만 방향이 반대일 뿐이죠(커밋을 업로드하는게 아니라 다운받는것이니까요).", "", "하나씩 차근차근 알아봅시다..." ] } }, { "type": "ModalAlert", "options": { "markdowns": [ "### `<place>` 인자", "", "git fetch에 다음 명령어와 같이 place를 지정해주면:", "", "`git fetch origin foo`", "", "Git은 원격 저장소의 `foo` 브랜치로 가서 현재 로컬에 없는 커밋들을 가져와 로컬의 'o/foo' 브랜치 아래에 추가 할 것입니다.", "", "직접 확인해봅시다(상기해보죠)." ] } }, { "type": "GitDemonstrationView", "options": { "beforeMarkdowns": [ "place를 지정해주면..." ], "afterMarkdowns": [ "커밋들을 `foo`브랜치에서만 내려받은 후 로컬의 `o/foo`브랜치에만 적용합니다." ], "command": "git fetch origin foo", "beforeCommand": "git branch foo; git clone; git fakeTeamwork foo 2" } }, { "type": "ModalAlert", "options": { "markdowns": [ "여러분은 분명 궁금할거에요 -- 왜 로컬의 `foo`에 그냥 커밋을 추가하지 않고 로컬의 원격 브랜치 `o/foo`에 커밋들을 추가한거지? <place> 인자는 로컬하고 원격 저장소 모두에 똑같이 있는 곳을 의미한게 아니였나?", "", "음, git이 이번 상황은 특별히 예외적으로 처리하기 때문입니다. 여러분이 `foo`브랜치에 작업을 했을지도 모르는데 이 명령으로 망쳐서 건드릴지도 모르니까요! 이전에 했던 강의 `git fetch`를 떠올려보면 왜 그런지 느낌이 올겁니다 -- `git fetch`는 로컬의 원격 브랜치가 아닌 브랜치는 갱신하지 않습니다, 커밋들을 내려받기만 합니다(여러분이 확인해보고 나중에 병합할 수 있도록 말이죠).", "" ] } }, { "type": "ModalAlert", "options": { "markdowns": [ "\"그렇다면, 이전 강의처럼 source와 destination를 모두 직접 지정해주면 어떻게될까요? 이 명령어로 말이죠 `<source>:<destination>`\"", "", "여러분이 커밋을 *직접* 로컬 브랜치로 fetch할 열의가 있다면, 네 콜론 참조스펙으로 지정해서 할 수 있습니다. 하지만 체크아웃된 브랜치에 fetch할 수 는 없고 체크아웃되지 않은 브랜치만 가능합니다.", "", "주의 할점이 하나 있는데 -- `<source>`는 이제 받아올 커밋이 있는 *원격*에 있는 place를 넣어줘야하고 `<destination>`은 그 커밋들을 받아올 *local*의 place를 인자로 넣어줘야 합니다. git push와 정반대로 하는거죠, 데이터를 반대의 방향으로 옮기는 작업이니 이게 더 납득이 갑니다.", "", "언급한 것 처럼, 실제로 이것을 하는 개발자들은 많지 않습니다. 이것을 소개하는것은 `fetch`와 `push`가 방향이 반대일뿐 컨셉이 비슷하다는것을 표현하기 위해서입니다." ] } }, { "type": "GitDemonstrationView", "options": { "beforeMarkdowns": [ "자 이 해괴한 작업을 직접 확인해봅시다:" ], "afterMarkdowns": [ "이야! 보셨습니까, git이 `foo~1`을 origin의 place로 지정하고 커밋들을 내려받아 `bar`(로컬 브랜치)에 추가했습니다. `foo`와 `o/foo`는 갱신되지 않는게 확인되나요? destination을 지정해줬기 때문입니다." ], "command": "git fetch origin foo~1:bar", "beforeCommand": "git branch foo; git clone; git branch bar; git fakeTeamwork foo 2" } }, { "type": "GitDemonstrationView", "options": { "beforeMarkdowns": [ "만약 destination이 될 브랜치가 없는 없는 상태에서 명령을 수행하면 어떻게 될까요? 방금의 슬라이드에서 `bar`브랜치가 없는 상태에서 수행해봅시다." ], "afterMarkdowns": [ "보이나요, git push 와 똑같습니다. Git이 fetch를 수행하기전에 destination을 로컬에 만들었습니다. git이 push를 수행하기 전에 원격저장소에 destination을 만드는것과 똑같습니다(없을경우에)." ], "command": "git fetch origin foo~1:bar", "beforeCommand": "git branch foo; git clone; git fakeTeamwork foo 2" } }, { "type": "GitDemonstrationView", "options": { "beforeMarkdowns": [ "인자 없이는?", "", "만약 `git fetch`를 인자없이 수행하면 원격저장소에서 모든 원격 브랜치들로 커밋들을 내려받습니다..." ], "afterMarkdowns": [ "간단하지만, 짚고 넘어갑시다." ], "command": "git fetch", "beforeCommand": "git branch foo; git clone; git fakeTeamwork foo; git fakeTeamwork master" } }, { "type": "ModalAlert", "options": { "markdowns": [ "좋습니다, 설명은 이정도로 하고! 이번 레벨을 끝내기위해서는 시각화된 골처럼 커밋들을 fetch하면 됩니다. 명령어로 멋지게 해내봅시다!", "", "fetch 명령에 source와 destination을 모두 지정해줘야 할겁니다. 골 시각화를 잘 보세요 fetch를 하다보면 커밋들의 ID가 바뀔수도있어요!" ] } } ] }, "uk": { "childViews": [ { "type": "ModalAlert", "options": { "markdowns": [ "## Аргументи git fetch", "", "Отже, ми вже вивчили все про аргументи git push, про корисний параметр `<place>` і про формат запису з двокрапкою (`<source>:<destination>`). Чи знадобляться нам ці зання про вивченні `git fetch`?", "", "Ще б пак! Аргументи для `git fetch` насправді *дуже, дуже* схожі на `git push`. Принцип той самий, з точністю до напрямку (бо ми скачуєм коміти, а не закачуєм).", "", "Розглянемо це крок за кроком..." ] } }, { "type": "ModalAlert", "options": { "markdowns": [ "### Параметр `<place>`", "", "Якщо вказати параметр `<place>` для команди git fetch наприклад так:", "", "`git fetch origin foo`", "", "git піде у віддалену гілку `foo`, візьме всі коміти, яких немає локально і закине в локальну гілку `o/foo`.", "", "Давайте подивимось на це в дії (просто щоб пригадати)." ] } }, { "type": "GitDemonstrationView", "options": { "beforeMarkdowns": [ "Вказуючи `<place>`..." ], "afterMarkdowns": [ "Ми скачуєм коміти лише з `foo` і кладемо їх в `o/foo`" ], "command": "git fetch origin foo", "beforeCommand": "git branch foo; git clone; git fakeTeamwork foo 2" } }, { "type": "ModalAlert", "options": { "markdowns": [ "Ти можеш подумати, чому git закинув ці коміти в гілку `o/foo` замість того, що покласти їх відразу в локальну гілку `foo`? Я думав, що параметр `<place>` одночасно вказує місце звідки взяти і куди поставити?", "", "Ну, git робить невеликий вийняток в цьому випадку, оскільки ти, ймовірно, маєш якусь роботу в `foo` і не хочеш там нічого зіпсувати! Пригадай з попереднього уроку про `git fetch` -- він не оновлює твої локальні (не віддалені -- без `o/`) гілки, він тільки скачує коміти (так щоб їх можна було переглянути/змерджити пізніше).", "" ] } }, { "type": "ModalAlert", "options": { "markdowns": [ "\"Ну, в такому разі, що буде, якщо якно вказати і джерело і призначення `<source>:<destination>`?\"", "", "Якщо ти почуваєшся достатньо впевненим і хочеш скачати віддалені коміти *прямо* в свою локальну гілку, тоді - так, ти можеш так написати використавши синтаксис з двокрапкою. Єдиний вийняток - таким способом не можна витягувати зміни в поточну локальну гілку, в будь-яку іншу - без проблем.", "", "Тепер в нас `<source>` вказує на *віддалений репозиторій*, а `<destination>` - *локальне* місце кути скачаються коміти. Це повна протилежність тому, як було в git push, що з рештою має сенс оскільки ми передаємо дані у протилежному напрямку!", "", "Насправді, розробники рідко використовують такий спосіб на практиці. І він показаний тут лише для повноти описання наскільки `fetch` і `push` схожі, відрізняючись лише напрямом дії." ] } }, { "type": "GitDemonstrationView", "options": { "beforeMarkdowns": [ "Давайте подивимось на це божевілля в дії:" ], "afterMarkdowns": [ "Ого! Дивись, git прийняв `foo~1` як джерело скачав коміти в `bar` (локальна гілка). Зауваж, що `foo` і `o/foo` не оновлювались, оскільки ми явно вказали звідки і куди передавати коміти." ], "command": "git fetch origin foo~1:bar", "beforeCommand": "git branch foo; git clone; git branch bar; git fakeTeamwork foo 2" } }, { "type": "GitDemonstrationView", "options": { "beforeMarkdowns": [ "А якщо вказаного місця призначення не існує на момент виконання команди? Давайте подивимось на попередній слайд але без гілки `bar`." ], "afterMarkdowns": [ "Бачиш, все як і в випадку з git push. Git створив локальну гілку-призначення перед скачуванням, так само як створить гілку-призначення на віддаленій стороні перед пушем (якщо її не існувало, звичайно)." ], "command": "git fetch origin foo~1:bar", "beforeCommand": "git branch foo; git clone; git fakeTeamwork foo 2" } }, { "type": "GitDemonstrationView", "options": { "beforeMarkdowns": [ "Без аргументів?", "", "Якщо `git fetch` запущено без аргументів, він просто скачає всі коміти з віддаленого репозиторія в віддалені (`o/`) гілки..." ], "afterMarkdowns": [ "Все дуже просто, але варто було згадати ще раз." ], "command": "git fetch", "beforeCommand": "git branch foo; git clone; git fakeTeamwork foo; git fakeTeamwork master" } }, { "type": "ModalAlert", "options": { "markdowns": [ "OК, досить розмов! Щоб пройти цей рівень, скачай лише вказані на візуалізації коміти. Прояви фантазію підбираючи команди!", "", "Тобі потрібно вказати і джерело і призначення для обох fetch-команд. Слідкуй за змінами на візуалізації, ID комітів можуть змінюватися!" ] } } ] } } };
/*! * Start Bootstrap - SB Admin 2 v4.0.7 (https://startbootstrap.com/template-overviews/sb-admin-2) * Copyright 2013-2019 Start Bootstrap * Licensed under MIT (https://github.com/BlackrockDigital/startbootstrap-sb-admin-2/blob/master/LICENSE) */ // Set new default font family and font color to mimic Bootstrap's default styling Chart.defaults.global.defaultFontFamily = 'Nunito', '-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif'; Chart.defaults.global.defaultFontColor = '#858796'; counties_dict = {'apache': {'Sidalcea neomexicana': 12, 'Opuntia polyacantha var.': 8, 'Erigeron formosissimus': 7, 'Parryella filifolia': 6, 'Mertensia franciscana': 6}, 'cochise': {'Agave palmeri': 51, 'Heliopsis parvifolia': 18, 'Eriogonum abertianum': 16, 'Agave parryi var. huachucensis': 15, 'Monarda citriodora subsp. austromontana': 14}, 'coconino': {'Opuntia phaeacantha': 122, 'Yucca elata': 91, 'Nolina microcarpa': 79, 'Yucca utahensis': 79, 'Opuntia basilaris var.': 79}, 'gila': {'Agave chrysantha': 154, 'Agave delamateri': 109, 'Agave palmeri': 58, 'Yucca baccata': 27, 'Agave': 21}, 'graham': {'Agave palmeri': 33, 'Grusonia emoryi': 8, 'Opuntia macrocentra': 7, 'Ferocactus wislizeni': 6, 'Penstemon superbus': 5}, 'greenlee': {'Agave palmeri': 24, 'Penstemon superbus': 4, 'Opuntia engelmannii var. engelmannii': 4, 'Layia glandulosa': 4, 'Allium bigelovii': 3}, 'la paz': {'Cylindropuntia echinocarpa': 18, 'Hesperocallis undulata': 12, 'Cryptantha': 12, 'Malacothrix glabrata': 12, 'Cirsium': 12}, 'maricopa': {'Ferocactus cylindraceus': 83, 'Cylindropuntia acanthocarpa': 80, 'Cryptantha barbigera': 56, 'Larrea tridentata': 53, 'Phacelia distans': 53}, 'mohave': {'Yucca jaegeriana': 42, 'Ferocactus cylindraceus': 33, 'Opuntia basilaris var. basilaris': 28, 'Agave mckelveyana': 26, 'Salazaria mexicana': 26}, 'navajo': {'Yucca utahensis': 6, 'Lemna minor': 4, 'Cirsium arizonicum var.': 4, 'Eriogonum racemosum': 4, 'Opuntia polyacantha var. ': 4}, 'pima': {'Agave palmeri': 53, 'Agave x ajoensis': 35, 'Cylindropuntia versicolor': 28, 'Ferocactus wislizeni': 23, 'Agave chrysantha': 21}, 'pinal': {'Ferocactus wislizeni': 41, 'Cylindropuntia x kelvinensis': 29, 'Cryptantha barbigera': 27, 'Cylindropuntia acanthocarpa': 26, 'Plagiobothrys arizonicus': 24}, 'santa cruz': {'Agave palmeri': 33, 'Manihot angustiloba': 16, 'Amoreuxia palmatifida': 15, 'Evolvulus arizonicus': 15, 'Gomphrena sonorae': 14}, 'yavapai': {'Agave chrysantha': 231, 'Agave verdensis': 162, 'Agave phillipsiana': 93, 'Agave yavapaiensis': 88, 'Agave delamateri': 73}, 'yuma': {'Rhus kearneyi': 22, 'Cylindropuntia echinocarpa': 17, 'Geraea canescens': 13, 'Cylindropuntia acanthocarpa': 13, 'Hesperocallis undulata': 12} }; counties_len = [13958, 9576, 6286, 4343, 3891, 3593, 2952, 2564, 1980, 1006, 986, 963, 612, 470, 334]; counties_list = ['coconino', 'maricopa', 'yavapai', 'mohave', 'gila', 'pima', 'pinal', 'cochise', 'santa cruz', 'apache', 'yuma', 'la paz', 'graham', 'navajo', 'greenlee']; counties_list2 = ['coconino2', 'maricopa2', 'yavapai', 'mohave', 'gila', 'pima', 'pinal', 'cochise', 'santa cruz', 'apache', 'yuma', 'la paz', 'graham', 'navajo', 'greenlee']; function number_format(number, decimals, dec_point, thousands_sep) { // * example: number_format(1234.56, 2, ',', ' '); // * return: '1 234,56' number = (number + '').replace(',', '').replace(' ', ''); var n = !isFinite(+number) ? 0 : +number, prec = !isFinite(+decimals) ? 0 : Math.abs(decimals), sep = (typeof thousands_sep === 'undefined') ? ',' : thousands_sep, dec = (typeof dec_point === 'undefined') ? '.' : dec_point, s = '', toFixedFix = function(n, prec) { var k = Math.pow(10, prec); return '' + Math.round(n * k) / k; }; // Fix for IE parseFloat(0.55).toFixed(0) = 0; s = (prec ? toFixedFix(n, prec) : '' + Math.round(n)).split('.'); if (s[0].length > 3) { s[0] = s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, sep); } if ((s[1] || '').length < prec) { s[1] = s[1] || ''; s[1] += new Array(prec - s[1].length + 1).join('0'); } return s.join(dec); } // Bar Chart Example var ctx = document.getElementById("myBarChart"); var ctx2 = document.getElementById("myBarChart2"); var tablediv = document.getElementById("tablediv"); var tableheading = document.getElementById("tabletext"); var responsiveDiv = document.getElementById("responsiveDiv"); var tableMain = document.getElementById("tableMain"); var tbodyItem = document.getElementById("tbody"); var myBarChart = new Chart(ctx, { type: 'bar', data: { labels: counties_list, datasets: [{ label: "Revenue", backgroundColor: "#4e73df", hoverBackgroundColor: "#2e59d9", borderColor: "#4e73df", data: counties_len, }], }, options: { maintainAspectRatio: false, layout: { padding: { left: 10, right: 25, top: 25, bottom: 0 } }, scales: { xAxes: [{ time: { unit: 'month' }, gridLines: { display: false, drawBorder: false }, ticks: { maxTicksLimit: 20 }, maxBarThickness: 25, }], yAxes: [{ ticks: { min: 0, max: 16000, maxTicksLimit: 10, padding: 10, // Include a dollar sign in the ticks callback: function(value, index, values) { return number_format(value); } }, gridLines: { color: "rgb(234, 236, 244)", zeroLineColor: "rgb(234, 236, 244)", drawBorder: false, borderDash: [2], zeroLineBorderDash: [2] } }], }, legend: { display: false }, tooltips: { titleMarginBottom: 10, titleFontColor: '#6e707e', titleFontSize: 14, backgroundColor: "rgb(255,255,255)", bodyFontColor: "#858796", borderColor: '#dddfeb', borderWidth: 1, xPadding: 15, yPadding: 15, displayColors: false, caretPadding: 10, callbacks: { label: function(tooltipItem, chart) { var datasetLabel = chart.datasets[tooltipItem.datasetIndex].label || ''; var county_json = counties_dict[tooltipItem.xLabel]; //console.log(county_json); var keys_county = Object.keys(county_json); var values_county = []; for ( var i = 0; i < keys_county.length; i++ ) { //console.log( keys_county[i]); values_county.push(county_json[keys_county[i]]); //console.log(county_json[keys_county[i]]); } var max_of_array = Math.max.apply(Math, values_county); max_of_array = Math.floor(max_of_array/10); max_of_array = max_of_array * 20; console.log(max_of_array); console.log(tooltipItem.xLabel); tablediv.setAttribute("style","display: block;"); document.getElementById("tabletext").innerHTML = "Top 5 plants in " + tooltipItem.xLabel; tbodyItem.innerHTML = ""; for ( var x1 = 0; x1 < keys_county.length; x1++ ) { var trelement = document.createElement("tr"); var tdelement = document.createElement("td"); var textNode = document.createTextNode(keys_county[x1]); tdelement.appendChild(textNode); trelement.appendChild(tdelement); var textNode2 = document.createTextNode(values_county[x1]); var tdelement2 = document.createElement("td"); tdelement2.appendChild(textNode2); trelement.appendChild(tdelement2); tbodyItem.appendChild(trelement); // var tableMain = document.createElement("table"); // tableMain.setAttribute("class", "table table-bordered" ); // tableMain.setAttribute("width", "100%" ); // tableMain.setAttribute("cellspacing", "0") // tableMain.appendChild(tbodyItem); // responsiveDiv.appendChild(tableMain); } //tableMain.appendChild(tbodyItem); return "No of plants discovered" + ': ' + number_format(tooltipItem.yLabel); } } }, } });
document.addEventListener("DOMContentLoaded", () => { // Selecting couple elements const users_posts = document.querySelectorAll(".post-update") const modal = document.getElementById("modal") const close_button = document.getElementById("close_button") // Adding a callback function for each post when the "click" event is triggered users_posts.forEach(post => { post.addEventListener("click", () => { insert_data_on_form(post) title_panel_char_count() post_content_char_count() modal.classList.add("modal-active") setTimeout(() => { document.getElementById("title").focus() }, 0500) // Giving focus to the title field }) }) // Adding a callback function for the cancel button when the "click" event is triggered close_button.addEventListener("click", () => { modal.classList.remove("modal-active") }) }) const insert_data_on_form = post => { /* This function will get the data that was already fetched from the database and insert it into the form fields. That way, the user will remember the stuff it typed there and what needs to be changed/updated. */ // Selecting couple elements const title = document.getElementById("title") const content = document.getElementById("post_content") const post_id = document.getElementById("post_id") // Changing their values based on which post the user clicked title.value = post.children[0].innerHTML content.value = post.children[1].innerHTML post_id.value = post.children[3].getAttribute("value") }
const path = require("path") const { createFilePath } = require("gatsby-source-filesystem") exports.createPages = async ({ actions, graphql, reporter }) => { const { createPage } = actions const result = await graphql(` { allContentfulPost { nodes { slug } } } `) if (result.errors) { reporter.panic("Error loading posts", JSON.stringify(result.errors)) return } const posts = result.data.allContentfulPost.nodes const postsPerPage = 6 const numPages = Math.ceil(posts.length / postsPerPage) Array.from({ length: numPages }).forEach((_, i) => { createPage({ path: i === 0 ? `/blog` : `/blog/${i + 1}`, component: path.resolve("./src/templates/posts.js"), context: { limit: postsPerPage, skip: i * postsPerPage, numPages, currentPage: i + 1, }, }) }) result.data.allContentfulPost.nodes.forEach(post => { actions.createPage({ path: `/${post.slug}/`, component: require.resolve("./src/templates/blogPost.js"), context: { slug: post.slug, }, }) }) }
import axios from 'axios' import { MessageBox, Message } from 'element-ui' import store from '@/store' import { getToken } from '@/utils/auth' // create an axios instance const service = axios.create({ baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url // withCredentials: true, // send cookies when cross-domain requests timeout: 5000 // request timeout }) // request interceptor service.interceptors.request.use( config => { // do something before request is sent if (store.getters.token) { // let each request carry token // ['X-Token'] is a custom headers key // please modify it according to the actual situation config.headers['X-Token'] = getToken() } return config }, error => { // do something with request error console.log(error) // for debug return Promise.reject(error) } ) // response interceptor service.interceptors.response.use( /** * If you want to get http information such as headers or status * Please return response => response */ /** * Determine the request status by custom code * Here is just an example * You can also judge the status by HTTP Status Code */ response => { const res = response.data // debugger // if the custom code is not 20000, it is judged as an error. if (res.code !== 20000) { Message({ message: res.message || 'Error', type: 'error', duration: 5 * 1000 }) // 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired; if (res.code === 50008 || res.code === 50012 || res.code === 50014) { // to re-login MessageBox.confirm('You have been logged out, you can cancel to stay on this page, or log in again', 'Confirm logout', { confirmButtonText: 'Re-Login', cancelButtonText: 'Cancel', type: 'warning' }).then(() => { store.dispatch('user/resetToken').then(() => { location.reload() }) }) } return Promise.reject(new Error(res.message || 'Error')) } else { return res } }, error => { console.log('err' + error) // for debug Message({ message: error.message, type: 'error', duration: 5 * 1000 }) return Promise.reject(error) } ) export default service
(function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(require("react"), require("react-dom")); else if(typeof define === 'function' && define.amd) define(["react", "react-dom"], factory); else if(typeof exports === 'object') exports["rc-drawer"] = factory(require("react"), require("react-dom")); else root["rc-drawer"] = factory(root["React"], root["ReactDOM"]); })(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE_46__, __WEBPACK_EXTERNAL_MODULE_47__) { 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, { /******/ configurable: false, /******/ enumerable: true, /******/ get: getter /******/ }); /******/ } /******/ }; /******/ /******/ // 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 = 50); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, exports) { // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 var global = module.exports = typeof window != 'undefined' && window.Math == Math ? window : typeof self != 'undefined' && self.Math == Math ? self // eslint-disable-next-line no-new-func : Function('return this')(); if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef /***/ }), /* 1 */ /***/ (function(module, exports) { var core = module.exports = { version: '2.6.5' }; if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef /***/ }), /* 2 */ /***/ (function(module, exports, __webpack_require__) { var anObject = __webpack_require__(10); var IE8_DOM_DEFINE = __webpack_require__(32); var toPrimitive = __webpack_require__(16); var dP = Object.defineProperty; exports.f = __webpack_require__(3) ? Object.defineProperty : function defineProperty(O, P, Attributes) { anObject(O); P = toPrimitive(P, true); anObject(Attributes); if (IE8_DOM_DEFINE) try { return dP(O, P, Attributes); } catch (e) { /* empty */ } if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!'); if ('value' in Attributes) O[P] = Attributes.value; return O; }; /***/ }), /* 3 */ /***/ (function(module, exports, __webpack_require__) { // Thank's IE8 for his funny defineProperty module.exports = !__webpack_require__(12)(function () { return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; }); /***/ }), /* 4 */ /***/ (function(module, exports) { var hasOwnProperty = {}.hasOwnProperty; module.exports = function (it, key) { return hasOwnProperty.call(it, key); }; /***/ }), /* 5 */ /***/ (function(module, exports, __webpack_require__) { var dP = __webpack_require__(2); var createDesc = __webpack_require__(13); module.exports = __webpack_require__(3) ? function (object, key, value) { return dP.f(object, key, createDesc(1, value)); } : function (object, key, value) { object[key] = value; return object; }; /***/ }), /* 6 */ /***/ (function(module, exports) { module.exports = function (it) { return typeof it === 'object' ? it !== null : typeof it === 'function'; }; /***/ }), /* 7 */ /***/ (function(module, exports, __webpack_require__) { // to indexed object, toObject with fallback for non-array-like ES3 strings var IObject = __webpack_require__(64); var defined = __webpack_require__(18); module.exports = function (it) { return IObject(defined(it)); }; /***/ }), /* 8 */ /***/ (function(module, exports, __webpack_require__) { var store = __webpack_require__(23)('wks'); var uid = __webpack_require__(15); var Symbol = __webpack_require__(0).Symbol; var USE_SYMBOL = typeof Symbol == 'function'; var $exports = module.exports = function (name) { return store[name] || (store[name] = USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name)); }; $exports.store = store; /***/ }), /* 9 */ /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__(0); var core = __webpack_require__(1); var ctx = __webpack_require__(31); var hide = __webpack_require__(5); var has = __webpack_require__(4); var PROTOTYPE = 'prototype'; var $export = function (type, name, source) { var IS_FORCED = type & $export.F; var IS_GLOBAL = type & $export.G; var IS_STATIC = type & $export.S; var IS_PROTO = type & $export.P; var IS_BIND = type & $export.B; var IS_WRAP = type & $export.W; var exports = IS_GLOBAL ? core : core[name] || (core[name] = {}); var expProto = exports[PROTOTYPE]; var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE]; var key, own, out; if (IS_GLOBAL) source = name; for (key in source) { // contains in native own = !IS_FORCED && target && target[key] !== undefined; if (own && has(exports, key)) continue; // export native or passed out = own ? target[key] : source[key]; // prevent global pollution for namespaces exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key] // bind timers to global for call from export context : IS_BIND && own ? ctx(out, global) // wrap global constructors for prevent change them in library : IS_WRAP && target[key] == out ? (function (C) { var F = function (a, b, c) { if (this instanceof C) { switch (arguments.length) { case 0: return new C(); case 1: return new C(a); case 2: return new C(a, b); } return new C(a, b, c); } return C.apply(this, arguments); }; F[PROTOTYPE] = C[PROTOTYPE]; return F; // make static versions for prototype methods })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; // export proto methods to core.%CONSTRUCTOR%.methods.%NAME% if (IS_PROTO) { (exports.virtual || (exports.virtual = {}))[key] = out; // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME% if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out); } } }; // type bitmap $export.F = 1; // forced $export.G = 2; // global $export.S = 4; // static $export.P = 8; // proto $export.B = 16; // bind $export.W = 32; // wrap $export.U = 64; // safe $export.R = 128; // real proto method for `library` module.exports = $export; /***/ }), /* 10 */ /***/ (function(module, exports, __webpack_require__) { var isObject = __webpack_require__(6); module.exports = function (it) { if (!isObject(it)) throw TypeError(it + ' is not an object!'); return it; }; /***/ }), /* 11 */ /***/ (function(module, exports) { // shim for using process in browser var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it // don't break things. But we need to wrap it in a try catch in case it is // wrapped in strict mode code which doesn't define any globals. It's inside a // function because try/catches deoptimize in certain engines. var cachedSetTimeout; var cachedClearTimeout; function defaultSetTimout() { throw new Error('setTimeout has not been defined'); } function defaultClearTimeout () { throw new Error('clearTimeout has not been defined'); } (function () { try { if (typeof setTimeout === 'function') { cachedSetTimeout = setTimeout; } else { cachedSetTimeout = defaultSetTimout; } } catch (e) { cachedSetTimeout = defaultSetTimout; } try { if (typeof clearTimeout === 'function') { cachedClearTimeout = clearTimeout; } else { cachedClearTimeout = defaultClearTimeout; } } catch (e) { cachedClearTimeout = defaultClearTimeout; } } ()) function runTimeout(fun) { if (cachedSetTimeout === setTimeout) { //normal enviroments in sane situations return setTimeout(fun, 0); } // if setTimeout wasn't available but was latter defined if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { cachedSetTimeout = setTimeout; return setTimeout(fun, 0); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedSetTimeout(fun, 0); } catch(e){ try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedSetTimeout.call(null, fun, 0); } catch(e){ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error return cachedSetTimeout.call(this, fun, 0); } } } function runClearTimeout(marker) { if (cachedClearTimeout === clearTimeout) { //normal enviroments in sane situations return clearTimeout(marker); } // if clearTimeout wasn't available but was latter defined if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { cachedClearTimeout = clearTimeout; return clearTimeout(marker); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedClearTimeout(marker); } catch (e){ try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedClearTimeout.call(null, marker); } catch (e){ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. // Some versions of I.E. have different rules for clearTimeout vs setTimeout return cachedClearTimeout.call(this, marker); } } } var queue = []; var draining = false; var currentQueue; var queueIndex = -1; function cleanUpNextTick() { if (!draining || !currentQueue) { return; } draining = false; if (currentQueue.length) { queue = currentQueue.concat(queue); } else { queueIndex = -1; } if (queue.length) { drainQueue(); } } function drainQueue() { if (draining) { return; } var timeout = runTimeout(cleanUpNextTick); draining = true; var len = queue.length; while(len) { currentQueue = queue; queue = []; while (++queueIndex < len) { if (currentQueue) { currentQueue[queueIndex].run(); } } queueIndex = -1; len = queue.length; } currentQueue = null; draining = false; runClearTimeout(timeout); } process.nextTick = function (fun) { var args = new Array(arguments.length - 1); if (arguments.length > 1) { for (var i = 1; i < arguments.length; i++) { args[i - 1] = arguments[i]; } } queue.push(new Item(fun, args)); if (queue.length === 1 && !draining) { runTimeout(drainQueue); } }; // v8 likes predictible objects function Item(fun, array) { this.fun = fun; this.array = array; } Item.prototype.run = function () { this.fun.apply(null, this.array); }; process.title = 'browser'; process.browser = true; process.env = {}; process.argv = []; process.version = ''; // empty string to avoid regexp issues process.versions = {}; function noop() {} process.on = noop; process.addListener = noop; process.once = noop; process.off = noop; process.removeListener = noop; process.removeAllListeners = noop; process.emit = noop; process.prependListener = noop; process.prependOnceListener = noop; process.listeners = function (name) { return [] } process.binding = function (name) { throw new Error('process.binding is not supported'); }; process.cwd = function () { return '/' }; process.chdir = function (dir) { throw new Error('process.chdir is not supported'); }; process.umask = function() { return 0; }; /***/ }), /* 12 */ /***/ (function(module, exports) { module.exports = function (exec) { try { return !!exec(); } catch (e) { return true; } }; /***/ }), /* 13 */ /***/ (function(module, exports) { module.exports = function (bitmap, value) { return { enumerable: !(bitmap & 1), configurable: !(bitmap & 2), writable: !(bitmap & 4), value: value }; }; /***/ }), /* 14 */ /***/ (function(module, exports) { module.exports = true; /***/ }), /* 15 */ /***/ (function(module, exports) { var id = 0; var px = Math.random(); module.exports = function (key) { return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); }; /***/ }), /* 16 */ /***/ (function(module, exports, __webpack_require__) { // 7.1.1 ToPrimitive(input [, PreferredType]) var isObject = __webpack_require__(6); // instead of the ES6 spec version, we didn't implement @@toPrimitive case // and the second argument - flag - preferred type is a string module.exports = function (it, S) { if (!isObject(it)) return it; var fn, val; if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val; if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; throw TypeError("Can't convert object to primitive value"); }; /***/ }), /* 17 */ /***/ (function(module, exports) { // 7.1.4 ToInteger var ceil = Math.ceil; var floor = Math.floor; module.exports = function (it) { return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); }; /***/ }), /* 18 */ /***/ (function(module, exports) { // 7.2.1 RequireObjectCoercible(argument) module.exports = function (it) { if (it == undefined) throw TypeError("Can't call method on " + it); return it; }; /***/ }), /* 19 */ /***/ (function(module, exports) { module.exports = {}; /***/ }), /* 20 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) var anObject = __webpack_require__(10); var dPs = __webpack_require__(63); var enumBugKeys = __webpack_require__(24); var IE_PROTO = __webpack_require__(22)('IE_PROTO'); var Empty = function () { /* empty */ }; var PROTOTYPE = 'prototype'; // Create object with fake `null` prototype: use iframe Object with cleared prototype var createDict = function () { // Thrash, waste and sodomy: IE GC bug var iframe = __webpack_require__(33)('iframe'); var i = enumBugKeys.length; var lt = '<'; var gt = '>'; var iframeDocument; iframe.style.display = 'none'; __webpack_require__(68).appendChild(iframe); iframe.src = 'javascript:'; // eslint-disable-line no-script-url // createDict = iframe.contentWindow.Object; // html.removeChild(iframe); iframeDocument = iframe.contentWindow.document; iframeDocument.open(); iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); iframeDocument.close(); createDict = iframeDocument.F; while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]]; return createDict(); }; module.exports = Object.create || function create(O, Properties) { var result; if (O !== null) { Empty[PROTOTYPE] = anObject(O); result = new Empty(); Empty[PROTOTYPE] = null; // add "__proto__" for Object.getPrototypeOf polyfill result[IE_PROTO] = O; } else result = createDict(); return Properties === undefined ? result : dPs(result, Properties); }; /***/ }), /* 21 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.2.14 / 15.2.3.14 Object.keys(O) var $keys = __webpack_require__(40); var enumBugKeys = __webpack_require__(24); module.exports = Object.keys || function keys(O) { return $keys(O, enumBugKeys); }; /***/ }), /* 22 */ /***/ (function(module, exports, __webpack_require__) { var shared = __webpack_require__(23)('keys'); var uid = __webpack_require__(15); module.exports = function (key) { return shared[key] || (shared[key] = uid(key)); }; /***/ }), /* 23 */ /***/ (function(module, exports, __webpack_require__) { var core = __webpack_require__(1); var global = __webpack_require__(0); var SHARED = '__core-js_shared__'; var store = global[SHARED] || (global[SHARED] = {}); (module.exports = function (key, value) { return store[key] || (store[key] = value !== undefined ? value : {}); })('versions', []).push({ version: core.version, mode: __webpack_require__(14) ? 'pure' : 'global', copyright: '© 2019 Denis Pushkarev (zloirock.ru)' }); /***/ }), /* 24 */ /***/ (function(module, exports) { // IE 8- don't enum bug keys module.exports = ( 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' ).split(','); /***/ }), /* 25 */ /***/ (function(module, exports, __webpack_require__) { var def = __webpack_require__(2).f; var has = __webpack_require__(4); var TAG = __webpack_require__(8)('toStringTag'); module.exports = function (it, tag, stat) { if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag }); }; /***/ }), /* 26 */ /***/ (function(module, exports, __webpack_require__) { exports.f = __webpack_require__(8); /***/ }), /* 27 */ /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__(0); var core = __webpack_require__(1); var LIBRARY = __webpack_require__(14); var wksExt = __webpack_require__(26); var defineProperty = __webpack_require__(2).f; module.exports = function (name) { var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {}); if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) }); }; /***/ }), /* 28 */ /***/ (function(module, exports) { exports.f = {}.propertyIsEnumerable; /***/ }), /* 29 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; module.exports = ReactPropTypesSecret; /***/ }), /* 30 */ /***/ (function(module, exports, __webpack_require__) { module.exports = { "default": __webpack_require__(55), __esModule: true }; /***/ }), /* 31 */ /***/ (function(module, exports, __webpack_require__) { // optional / simple context binding var aFunction = __webpack_require__(57); module.exports = function (fn, that, length) { aFunction(fn); if (that === undefined) return fn; switch (length) { case 1: return function (a) { return fn.call(that, a); }; case 2: return function (a, b) { return fn.call(that, a, b); }; case 3: return function (a, b, c) { return fn.call(that, a, b, c); }; } return function (/* ...args */) { return fn.apply(that, arguments); }; }; /***/ }), /* 32 */ /***/ (function(module, exports, __webpack_require__) { module.exports = !__webpack_require__(3) && !__webpack_require__(12)(function () { return Object.defineProperty(__webpack_require__(33)('div'), 'a', { get: function () { return 7; } }).a != 7; }); /***/ }), /* 33 */ /***/ (function(module, exports, __webpack_require__) { var isObject = __webpack_require__(6); var document = __webpack_require__(0).document; // typeof document.createElement is 'object' in old IE var is = isObject(document) && isObject(document.createElement); module.exports = function (it) { return is ? document.createElement(it) : {}; }; /***/ }), /* 34 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; exports.default = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; /***/ }), /* 35 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; var _defineProperty = __webpack_require__(30); var _defineProperty2 = _interopRequireDefault(_defineProperty); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.default = 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; (0, _defineProperty2.default)(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /***/ }), /* 36 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; var _typeof2 = __webpack_require__(37); var _typeof3 = _interopRequireDefault(_typeof2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.default = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && ((typeof call === "undefined" ? "undefined" : (0, _typeof3.default)(call)) === "object" || typeof call === "function") ? call : self; }; /***/ }), /* 37 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; var _iterator = __webpack_require__(58); var _iterator2 = _interopRequireDefault(_iterator); var _symbol = __webpack_require__(75); var _symbol2 = _interopRequireDefault(_symbol); var _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) { return typeof obj === "undefined" ? "undefined" : _typeof(obj); } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj); }; /***/ }), /* 38 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var LIBRARY = __webpack_require__(14); var $export = __webpack_require__(9); var redefine = __webpack_require__(39); var hide = __webpack_require__(5); var Iterators = __webpack_require__(19); var $iterCreate = __webpack_require__(62); var setToStringTag = __webpack_require__(25); var getPrototypeOf = __webpack_require__(69); var ITERATOR = __webpack_require__(8)('iterator'); var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next` var FF_ITERATOR = '@@iterator'; var KEYS = 'keys'; var VALUES = 'values'; var returnThis = function () { return this; }; module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) { $iterCreate(Constructor, NAME, next); var getMethod = function (kind) { if (!BUGGY && kind in proto) return proto[kind]; switch (kind) { case KEYS: return function keys() { return new Constructor(this, kind); }; case VALUES: return function values() { return new Constructor(this, kind); }; } return function entries() { return new Constructor(this, kind); }; }; var TAG = NAME + ' Iterator'; var DEF_VALUES = DEFAULT == VALUES; var VALUES_BUG = false; var proto = Base.prototype; var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]; var $default = $native || getMethod(DEFAULT); var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined; var $anyNative = NAME == 'Array' ? proto.entries || $native : $native; var methods, key, IteratorPrototype; // Fix native if ($anyNative) { IteratorPrototype = getPrototypeOf($anyNative.call(new Base())); if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) { // Set @@toStringTag to native iterators setToStringTag(IteratorPrototype, TAG, true); // fix for some old engines if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis); } } // fix Array#{values, @@iterator}.name in V8 / FF if (DEF_VALUES && $native && $native.name !== VALUES) { VALUES_BUG = true; $default = function values() { return $native.call(this); }; } // Define iterator if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) { hide(proto, ITERATOR, $default); } // Plug for library Iterators[NAME] = $default; Iterators[TAG] = returnThis; if (DEFAULT) { methods = { values: DEF_VALUES ? $default : getMethod(VALUES), keys: IS_SET ? $default : getMethod(KEYS), entries: $entries }; if (FORCED) for (key in methods) { if (!(key in proto)) redefine(proto, key, methods[key]); } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); } return methods; }; /***/ }), /* 39 */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__(5); /***/ }), /* 40 */ /***/ (function(module, exports, __webpack_require__) { var has = __webpack_require__(4); var toIObject = __webpack_require__(7); var arrayIndexOf = __webpack_require__(65)(false); var IE_PROTO = __webpack_require__(22)('IE_PROTO'); module.exports = function (object, names) { var O = toIObject(object); var i = 0; var result = []; var key; for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key); // Don't enum bug & hidden keys while (names.length > i) if (has(O, key = names[i++])) { ~arrayIndexOf(result, key) || result.push(key); } return result; }; /***/ }), /* 41 */ /***/ (function(module, exports) { var toString = {}.toString; module.exports = function (it) { return toString.call(it).slice(8, -1); }; /***/ }), /* 42 */ /***/ (function(module, exports) { exports.f = Object.getOwnPropertySymbols; /***/ }), /* 43 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) var $keys = __webpack_require__(40); var hiddenKeys = __webpack_require__(24).concat('length', 'prototype'); exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { return $keys(O, hiddenKeys); }; /***/ }), /* 44 */ /***/ (function(module, exports, __webpack_require__) { var pIE = __webpack_require__(28); var createDesc = __webpack_require__(13); var toIObject = __webpack_require__(7); var toPrimitive = __webpack_require__(16); var has = __webpack_require__(4); var IE8_DOM_DEFINE = __webpack_require__(32); var gOPD = Object.getOwnPropertyDescriptor; exports.f = __webpack_require__(3) ? gOPD : function getOwnPropertyDescriptor(O, P) { O = toIObject(O); P = toPrimitive(P, true); if (IE8_DOM_DEFINE) try { return gOPD(O, P); } catch (e) { /* empty */ } if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]); }; /***/ }), /* 45 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; var _setPrototypeOf = __webpack_require__(85); var _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf); var _create = __webpack_require__(89); var _create2 = _interopRequireDefault(_create); var _typeof2 = __webpack_require__(37); var _typeof3 = _interopRequireDefault(_typeof2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.default = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : (0, _typeof3.default)(superClass))); } subClass.prototype = (0, _create2.default)(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) _setPrototypeOf2.default ? (0, _setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass; }; /***/ }), /* 46 */ /***/ (function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_46__; /***/ }), /* 47 */ /***/ (function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_47__; /***/ }), /* 48 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ if (process.env.NODE_ENV !== 'production') { var ReactIs = __webpack_require__(49); // By explicitly using `prop-types` you are opting into new development behavior. // http://fb.me/prop-types-in-prod var throwOnDirectAccess = true; module.exports = __webpack_require__(94)(ReactIs.isElement, throwOnDirectAccess); } else { // By explicitly using `prop-types` you are opting into new production behavior. // http://fb.me/prop-types-in-prod module.exports = __webpack_require__(97)(); } /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11))) /***/ }), /* 49 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(process) { if (process.env.NODE_ENV === 'production') { module.exports = __webpack_require__(92); } else { module.exports = __webpack_require__(93); } /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11))) /***/ }), /* 50 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(51); module.exports = __webpack_require__(52); /***/ }), /* 51 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 52 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Drawer__ = __webpack_require__(53); // export this package's api /* harmony default export */ __webpack_exports__["default"] = (__WEBPACK_IMPORTED_MODULE_0__Drawer__["a" /* default */]); /***/ }), /* 53 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_defineProperty__ = __webpack_require__(54); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_defineProperty___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_defineProperty__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck__ = __webpack_require__(34); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_createClass__ = __webpack_require__(35); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_createClass___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_createClass__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(36); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__ = __webpack_require__(45); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_react__ = __webpack_require__(46); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_react__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react_dom__ = __webpack_require__(47); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react_dom___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_react_dom__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_prop_types__ = __webpack_require__(48); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_prop_types__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_classnames__ = __webpack_require__(98); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_classnames__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_rc_util_es_ContainerRender__ = __webpack_require__(99); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_rc_util_es_getScrollBarSize__ = __webpack_require__(100); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__utils__ = __webpack_require__(101); var IS_REACT_16 = 'createPortal' in __WEBPACK_IMPORTED_MODULE_6_react_dom___default.a; var currentDrawer = {}; var windowIsUndefined = !(typeof window !== 'undefined' && window.document && window.document.createElement); var Drawer = function (_React$PureComponent) { __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default()(Drawer, _React$PureComponent); function Drawer(props) { __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck___default()(this, Drawer); var _this = __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default()(this, (Drawer.__proto__ || Object.getPrototypeOf(Drawer)).call(this, props)); _initialiseProps.call(_this); _this.levelDom = []; _this.contentDom = null; _this.maskDom = null; _this.handlerDom = null; _this.firstEnter = props.firstEnter; // 记录首次进入. _this.timeout = null; _this.drawerId = Number((Date.now() + Math.random()).toString().replace('.', Math.round(Math.random() * 9))).toString(16); var open = props.open !== undefined ? props.open : !!props.defaultOpen; currentDrawer[_this.drawerId] = open; _this.state = { open: open }; return _this; } __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_createClass___default()(Drawer, [{ key: 'componentDidMount', value: function componentDidMount() { if (!windowIsUndefined) { var passiveSupported = false; window.addEventListener('test', null, Object.defineProperty({}, 'passive', { get: function get() { passiveSupported = true; return null; } })); this.passive = passiveSupported ? { passive: false } : false; } var open = this.getOpen(); if (this.props.handler || open || this.firstEnter) { this.getDefault(this.props); if (open) { this.isOpenChange = true; } this.forceUpdate(); } } }, { key: 'componentWillReceiveProps', value: function componentWillReceiveProps(nextProps) { var open = nextProps.open, placement = nextProps.placement, getContainer = nextProps.getContainer; if (open !== undefined && open !== this.props.open) { this.isOpenChange = true; // 没渲染 dom 时,获取默认数据; if (!this.container || this.props.getContainer !== getContainer) { this.getDefault(nextProps); } this.setState({ open: open }); } if (placement !== this.props.placement) { // test 的 bug, 有动画过场,删除 dom this.contentDom = null; } if (this.props.level !== nextProps.level) { this.getParentAndLevelDom(nextProps); } } }, { key: 'componentDidUpdate', value: function componentDidUpdate() { // dom 没渲染时,重走一遍。 if (!this.firstEnter && this.container) { this.forceUpdate(); this.firstEnter = true; } } }, { key: 'componentWillUnmount', value: function componentWillUnmount() { delete currentDrawer[this.drawerId]; delete this.isOpenChange; if (this.container) { if (this.state.open) { this.setLevelDomTransform(false, true); } document.body.style.overflow = ''; // 拦不住。。直接删除; if (this.props.getContainer) { this.container.parentNode.removeChild(this.container); } } this.firstEnter = false; clearTimeout(this.timeout); // suppport react15 // 需要 didmount 后也会渲染,直接 unmount 将不会渲染,加上判断. if (this.renderComponent && !IS_REACT_16) { this.renderComponent({ afterClose: this.removeContainer, onClose: function onClose() {}, visible: false }); } } }, { key: 'render', value: function render() { var _this2 = this; var _props = this.props, getContainer = _props.getContainer, wrapperClassName = _props.wrapperClassName; var open = this.getOpen(); currentDrawer[this.drawerId] = open ? this.container : open; var children = this.getChildToRender(this.firstEnter ? open : false); if (!getContainer) { return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement( 'div', { className: wrapperClassName, ref: function ref(c) { if (_this2.props.getContainer) { return; } _this2.container = c; } }, children ); } if (!this.container || !open && !this.firstEnter) { return null; } // suppport react15 if (!IS_REACT_16) { return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement( __WEBPACK_IMPORTED_MODULE_9_rc_util_es_ContainerRender__["a" /* default */], { parent: this, visible: true, autoMount: true, autoDestroy: false, getComponent: function getComponent() { return children; }, getContainer: this.getContainer }, function (_ref) { var renderComponent = _ref.renderComponent, removeContainer = _ref.removeContainer; _this2.renderComponent = renderComponent; _this2.removeContainer = removeContainer; return null; } ); } return __WEBPACK_IMPORTED_MODULE_6_react_dom___default.a.createPortal(children, this.container); } }]); return Drawer; }(__WEBPACK_IMPORTED_MODULE_5_react___default.a.PureComponent); Drawer.propTypes = { wrapperClassName: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.string, className: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.string, children: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.node, style: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.object, width: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.any, height: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.any, defaultOpen: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool, firstEnter: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool, open: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool, prefixCls: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.string, placement: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.string, level: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.array]), levelMove: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.number, __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.array]), ease: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.string, duration: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.string, getContainer: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.object, __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool]), handler: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.any, onChange: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.func, afterVisibleChange: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.func, onMaskClick: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.func, onHandleClick: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.func, showMask: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool, maskStyle: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.object }; Drawer.defaultProps = { prefixCls: 'drawer', placement: 'left', getContainer: 'body', level: 'all', duration: '.3s', ease: 'cubic-bezier(0.78, 0.14, 0.15, 0.86)', onChange: function onChange() {}, afterVisibleChange: function afterVisibleChange() {}, onMaskClick: function onMaskClick() {}, onHandleClick: function onHandleClick() {}, handler: __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement( 'div', { className: 'drawer-handle' }, __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement('i', { className: 'drawer-handle-icon' }) ), firstEnter: false, showMask: true, maskStyle: {}, wrapperClassName: '', className: '' }; var _initialiseProps = function _initialiseProps() { var _this3 = this; this.onMaskTouchEnd = function (e) { _this3.props.onMaskClick(e); _this3.onTouchEnd(e, true); }; this.onIconTouchEnd = function (e) { _this3.props.onHandleClick(e); _this3.onTouchEnd(e); }; this.onTouchEnd = function (e, close) { if (_this3.props.open !== undefined) { return; } var open = close || _this3.state.open; _this3.isOpenChange = true; _this3.setState({ open: !open }); }; this.onWrapperTransitionEnd = function (e) { if (e.target === _this3.contentWrapper) { _this3.dom.style.transition = ''; if (!_this3.state.open && _this3.getCurrentDrawerSome()) { document.body.style.overflowX = ''; if (_this3.maskDom) { _this3.maskDom.style.left = ''; _this3.maskDom.style.width = ''; } } var afterVisibleChange = _this3.props.afterVisibleChange; var open = _this3.state.open; afterVisibleChange(open); } }; this.getDefault = function (props) { _this3.getParentAndLevelDom(props); if (props.getContainer || props.parent) { _this3.container = _this3.defaultGetContainer(); } }; this.getCurrentDrawerSome = function () { return !Object.keys(currentDrawer).some(function (key) { return currentDrawer[key]; }); }; this.getContainer = function () { return _this3.container; }; this.getParentAndLevelDom = function (props) { if (windowIsUndefined) { return; } var level = props.level, getContainer = props.getContainer; _this3.levelDom = []; if (getContainer) { if (typeof getContainer === 'string') { var dom = document.querySelectorAll(getContainer)[0]; _this3.parent = dom; } if (typeof getContainer === 'function') { _this3.parent = getContainer(); } if (typeof getContainer === 'object' && getContainer instanceof window.HTMLElement) { _this3.parent = getContainer; } } if (!getContainer && _this3.container) { _this3.parent = _this3.container.parentNode; } if (level === 'all') { var children = Array.prototype.slice.call(_this3.parent.children); children.forEach(function (child) { if (child.nodeName !== 'SCRIPT' && child.nodeName !== 'STYLE' && child.nodeName !== 'LINK' && child !== _this3.container) { _this3.levelDom.push(child); } }); } else if (level) { Object(__WEBPACK_IMPORTED_MODULE_11__utils__["b" /* dataToArray */])(level).forEach(function (key) { document.querySelectorAll(key).forEach(function (item) { _this3.levelDom.push(item); }); }); } }; this.setLevelDomTransform = function (open, openTransition, placementName, value) { var _props2 = _this3.props, placement = _props2.placement, levelMove = _props2.levelMove, duration = _props2.duration, ease = _props2.ease, onChange = _props2.onChange, getContainer = _props2.getContainer, showMask = _props2.showMask; if (!windowIsUndefined) { _this3.levelDom.forEach(function (dom) { if (_this3.isOpenChange || openTransition) { /* eslint no-param-reassign: "error" */ dom.style.transition = 'transform ' + duration + ' ' + ease; Object(__WEBPACK_IMPORTED_MODULE_11__utils__["a" /* addEventListener */])(dom, __WEBPACK_IMPORTED_MODULE_11__utils__["f" /* transitionEnd */], _this3.transitionEnd); var levelValue = open ? value : 0; if (levelMove) { var $levelMove = Object(__WEBPACK_IMPORTED_MODULE_11__utils__["e" /* transformArguments */])(levelMove, { target: dom, open: open }); levelValue = open ? $levelMove[0] : $levelMove[1] || 0; } var $value = typeof levelValue === 'number' ? levelValue + 'px' : levelValue; var placementPos = placement === 'left' || placement === 'top' ? $value : '-' + $value; dom.style.transform = levelValue ? placementName + '(' + placementPos + ')' : ''; dom.style.msTransform = levelValue ? placementName + '(' + placementPos + ')' : ''; } }); // 处理 body 滚动 if (getContainer === 'body' && showMask) { var eventArray = ['touchstart']; var domArray = [document.body, _this3.maskDom, _this3.handlerDom, _this3.contentDom]; var right = document.body.scrollHeight > (window.innerHeight || document.documentElement.clientHeight) && window.innerWidth > document.body.offsetWidth ? Object(__WEBPACK_IMPORTED_MODULE_10_rc_util_es_getScrollBarSize__["a" /* default */])(1) : 0; var widthTransition = 'width ' + duration + ' ' + ease; var transformTransition = 'transform ' + duration + ' ' + ease; if (open && document.body.style.overflow !== 'hidden') { document.body.style.overflow = 'hidden'; if (right) { document.body.style.position = 'relative'; document.body.style.width = 'calc(100% - ' + right + 'px)'; _this3.dom.style.transition = 'none'; switch (placement) { case 'right': _this3.dom.style.transform = 'translateX(-' + right + 'px)'; _this3.dom.style.msTransform = 'translateX(-' + right + 'px)'; break; case 'top': case 'bottom': _this3.dom.style.width = 'calc(100% - ' + right + 'px)'; _this3.dom.style.transform = 'translateZ(0)'; break; default: break; } clearTimeout(_this3.timeout); _this3.timeout = setTimeout(function () { _this3.dom.style.transition = transformTransition + ',' + widthTransition; _this3.dom.style.width = ''; _this3.dom.style.transform = ''; _this3.dom.style.msTransform = ''; }); } // 手机禁滚 domArray.forEach(function (item, i) { if (!item) { return; } Object(__WEBPACK_IMPORTED_MODULE_11__utils__["a" /* addEventListener */])(item, eventArray[i] || 'touchmove', i ? _this3.removeMoveHandler : _this3.removeStartHandler, _this3.passive); }); } else if (_this3.getCurrentDrawerSome()) { document.body.style.overflow = ''; if ((_this3.isOpenChange || openTransition) && right) { document.body.style.position = ''; document.body.style.width = ''; if (__WEBPACK_IMPORTED_MODULE_11__utils__["g" /* transitionStr */]) { document.body.style.overflowX = 'hidden'; } _this3.dom.style.transition = 'none'; var heightTransition = void 0; switch (placement) { case 'right': { _this3.dom.style.transform = 'translateX(' + right + 'px)'; _this3.dom.style.msTransform = 'translateX(' + right + 'px)'; _this3.dom.style.width = '100%'; widthTransition = 'width 0s ' + ease + ' ' + duration; if (_this3.maskDom) { _this3.maskDom.style.left = '-' + right + 'px'; _this3.maskDom.style.width = 'calc(100% + ' + right + 'px)'; } break; } case 'top': case 'bottom': { _this3.dom.style.width = 'calc(100% + ' + right + 'px)'; _this3.dom.style.height = '100%'; _this3.dom.style.transform = 'translateZ(0)'; heightTransition = 'height 0s ' + ease + ' ' + duration; break; } default: break; } clearTimeout(_this3.timeout); _this3.timeout = setTimeout(function () { _this3.dom.style.transition = transformTransition + ',' + (heightTransition ? heightTransition + ',' : '') + widthTransition; _this3.dom.style.transform = ''; _this3.dom.style.msTransform = ''; _this3.dom.style.width = ''; _this3.dom.style.height = ''; }); } domArray.forEach(function (item, i) { if (!item) { return; } Object(__WEBPACK_IMPORTED_MODULE_11__utils__["d" /* removeEventListener */])(item, eventArray[i] || 'touchmove', i ? _this3.removeMoveHandler : _this3.removeStartHandler, _this3.passive); }); } } } if (_this3.isOpenChange && _this3.firstEnter) { onChange(open); _this3.isOpenChange = false; } }; this.getChildToRender = function (open) { var _classnames; var _props3 = _this3.props, className = _props3.className, prefixCls = _props3.prefixCls, style = _props3.style, placement = _props3.placement, children = _props3.children, handler = _props3.handler, showMask = _props3.showMask, maskStyle = _props3.maskStyle, width = _props3.width, height = _props3.height; var wrapperClassName = __WEBPACK_IMPORTED_MODULE_8_classnames___default()(prefixCls, (_classnames = {}, __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_defineProperty___default()(_classnames, prefixCls + '-' + placement, true), __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_defineProperty___default()(_classnames, prefixCls + '-open', open), __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_defineProperty___default()(_classnames, className, !!className), _classnames)); var isOpenChange = _this3.isOpenChange; var isHorizontal = placement === 'left' || placement === 'right'; var placementName = 'translate' + (isHorizontal ? 'X' : 'Y'); // 百分比与像素动画不同步,第一次打用后全用像素动画。 // const defaultValue = !this.contentDom || !level ? '100%' : `${value}px`; var placementPos = placement === 'left' || placement === 'top' ? '-100%' : '100%'; var transform = open ? '' : placementName + '(' + placementPos + ')'; if (isOpenChange === undefined || isOpenChange) { var contentValue = _this3.contentDom ? _this3.contentDom.getBoundingClientRect()[isHorizontal ? 'width' : 'height'] : 0; var value = (isHorizontal ? width : height) || contentValue; _this3.setLevelDomTransform(open, false, placementName, value); } var handlerChildren = handler && __WEBPACK_IMPORTED_MODULE_5_react___default.a.cloneElement(handler, { onClick: function onClick(e) { if (handler.props.onClick) { handler.props.onClick(); } _this3.onIconTouchEnd(e); }, ref: function ref(c) { _this3.handlerDom = c; } }); return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement( 'div', { className: wrapperClassName, style: style, ref: function ref(c) { _this3.dom = c; }, onTransitionEnd: _this3.onWrapperTransitionEnd }, showMask && __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement('div', { className: prefixCls + '-mask', onClick: _this3.onMaskTouchEnd, style: maskStyle, ref: function ref(c) { _this3.maskDom = c; } }), __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement( 'div', { className: prefixCls + '-content-wrapper', style: { transform: transform, msTransform: transform, width: Object(__WEBPACK_IMPORTED_MODULE_11__utils__["c" /* isNumeric */])(width) ? width + 'px' : width, height: Object(__WEBPACK_IMPORTED_MODULE_11__utils__["c" /* isNumeric */])(height) ? height + 'px' : height }, ref: function ref(c) { _this3.contentWrapper = c; } }, __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement( 'div', { className: prefixCls + '-content', ref: function ref(c) { _this3.contentDom = c; }, onTouchStart: open && showMask ? _this3.removeStartHandler : null // 跑用例用 , onTouchMove: open && showMask ? _this3.removeMoveHandler : null // 跑用例用 }, children ), handlerChildren ) ); }; this.getOpen = function () { return _this3.props.open !== undefined ? _this3.props.open : _this3.state.open; }; this.getTouchParentScroll = function (root, currentTarget, differX, differY) { if (!currentTarget || currentTarget === document) { return false; } // root 为 drawer-content 设定了 overflow, 判断为 root 的 parent 时结束滚动; if (currentTarget === root.parentNode) { return true; } var isY = Math.max(Math.abs(differX), Math.abs(differY)) === Math.abs(differY); var isX = Math.max(Math.abs(differX), Math.abs(differY)) === Math.abs(differX); var scrollY = currentTarget.scrollHeight - currentTarget.clientHeight; var scrollX = currentTarget.scrollWidth - currentTarget.clientWidth; /** * <div style="height: 300px"> * <div style="height: 900px"></div> * </div> * 在没设定 overflow: auto 或 scroll 时,currentTarget 里获取不到 scrollTop 或 scrollLeft, * 预先用 scrollTo 来滚动,如果取出的值跟滚动前取出不同,则 currnetTarget 被设定了 overflow; 否则就是上面这种。 */ var t = currentTarget.scrollTop; var l = currentTarget.scrollLeft; if (currentTarget.scrollTo) { currentTarget.scrollTo(currentTarget.scrollLeft + 1, currentTarget.scrollTop + 1); } var currentT = currentTarget.scrollTop; var currentL = currentTarget.scrollLeft; if (currentTarget.scrollTo) { currentTarget.scrollTo(currentTarget.scrollLeft - 1, currentTarget.scrollTop - 1); } if (isY && (!scrollY || !(currentT - t) || scrollY && (currentTarget.scrollTop >= scrollY && differY < 0 || currentTarget.scrollTop <= 0 && differY > 0)) || isX && (!scrollX || !(currentL - l) || scrollX && (currentTarget.scrollLeft >= scrollX && differX < 0 || currentTarget.scrollLeft <= 0 && differX > 0))) { return _this3.getTouchParentScroll(root, currentTarget.parentNode, differX, differY); } return false; }; this.removeStartHandler = function (e) { if (e.touches.length > 1) { return; } _this3.startPos = { x: e.touches[0].clientX, y: e.touches[0].clientY }; }; this.removeMoveHandler = function (e) { if (e.changedTouches.length > 1) { return; } var currentTarget = e.currentTarget; var differX = e.changedTouches[0].clientX - _this3.startPos.x; var differY = e.changedTouches[0].clientY - _this3.startPos.y; if (currentTarget === _this3.maskDom || currentTarget === _this3.handlerDom || currentTarget === _this3.contentDom && _this3.getTouchParentScroll(currentTarget, e.target, differX, differY)) { e.preventDefault(); } }; this.transitionEnd = function (e) { Object(__WEBPACK_IMPORTED_MODULE_11__utils__["d" /* removeEventListener */])(e.target, __WEBPACK_IMPORTED_MODULE_11__utils__["f" /* transitionEnd */], _this3.transitionEnd); e.target.style.transition = ''; }; this.defaultGetContainer = function () { if (windowIsUndefined) { return null; } var container = document.createElement('div'); _this3.parent.appendChild(container); if (_this3.props.wrapperClassName) { container.className = _this3.props.wrapperClassName; } return container; }; }; /* harmony default export */ __webpack_exports__["a"] = (Drawer); /***/ }), /* 54 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; var _defineProperty = __webpack_require__(30); var _defineProperty2 = _interopRequireDefault(_defineProperty); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.default = function (obj, key, value) { if (key in obj) { (0, _defineProperty2.default)(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }; /***/ }), /* 55 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(56); var $Object = __webpack_require__(1).Object; module.exports = function defineProperty(it, key, desc) { return $Object.defineProperty(it, key, desc); }; /***/ }), /* 56 */ /***/ (function(module, exports, __webpack_require__) { var $export = __webpack_require__(9); // 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) $export($export.S + $export.F * !__webpack_require__(3), 'Object', { defineProperty: __webpack_require__(2).f }); /***/ }), /* 57 */ /***/ (function(module, exports) { module.exports = function (it) { if (typeof it != 'function') throw TypeError(it + ' is not a function!'); return it; }; /***/ }), /* 58 */ /***/ (function(module, exports, __webpack_require__) { module.exports = { "default": __webpack_require__(59), __esModule: true }; /***/ }), /* 59 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(60); __webpack_require__(71); module.exports = __webpack_require__(26).f('iterator'); /***/ }), /* 60 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $at = __webpack_require__(61)(true); // 21.1.3.27 String.prototype[@@iterator]() __webpack_require__(38)(String, 'String', function (iterated) { this._t = String(iterated); // target this._i = 0; // next index // 21.1.5.2.1 %StringIteratorPrototype%.next() }, function () { var O = this._t; var index = this._i; var point; if (index >= O.length) return { value: undefined, done: true }; point = $at(O, index); this._i += point.length; return { value: point, done: false }; }); /***/ }), /* 61 */ /***/ (function(module, exports, __webpack_require__) { var toInteger = __webpack_require__(17); var defined = __webpack_require__(18); // true -> String#at // false -> String#codePointAt module.exports = function (TO_STRING) { return function (that, pos) { var s = String(defined(that)); var i = toInteger(pos); var l = s.length; var a, b; if (i < 0 || i >= l) return TO_STRING ? '' : undefined; a = s.charCodeAt(i); return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff ? TO_STRING ? s.charAt(i) : a : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; }; }; /***/ }), /* 62 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var create = __webpack_require__(20); var descriptor = __webpack_require__(13); var setToStringTag = __webpack_require__(25); var IteratorPrototype = {}; // 25.1.2.1.1 %IteratorPrototype%[@@iterator]() __webpack_require__(5)(IteratorPrototype, __webpack_require__(8)('iterator'), function () { return this; }); module.exports = function (Constructor, NAME, next) { Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) }); setToStringTag(Constructor, NAME + ' Iterator'); }; /***/ }), /* 63 */ /***/ (function(module, exports, __webpack_require__) { var dP = __webpack_require__(2); var anObject = __webpack_require__(10); var getKeys = __webpack_require__(21); module.exports = __webpack_require__(3) ? Object.defineProperties : function defineProperties(O, Properties) { anObject(O); var keys = getKeys(Properties); var length = keys.length; var i = 0; var P; while (length > i) dP.f(O, P = keys[i++], Properties[P]); return O; }; /***/ }), /* 64 */ /***/ (function(module, exports, __webpack_require__) { // fallback for non-array-like ES3 and non-enumerable old V8 strings var cof = __webpack_require__(41); // eslint-disable-next-line no-prototype-builtins module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) { return cof(it) == 'String' ? it.split('') : Object(it); }; /***/ }), /* 65 */ /***/ (function(module, exports, __webpack_require__) { // false -> Array#indexOf // true -> Array#includes var toIObject = __webpack_require__(7); var toLength = __webpack_require__(66); var toAbsoluteIndex = __webpack_require__(67); module.exports = function (IS_INCLUDES) { return function ($this, el, fromIndex) { var O = toIObject($this); var length = toLength(O.length); var index = toAbsoluteIndex(fromIndex, length); var value; // Array#includes uses SameValueZero equality algorithm // eslint-disable-next-line no-self-compare if (IS_INCLUDES && el != el) while (length > index) { value = O[index++]; // eslint-disable-next-line no-self-compare if (value != value) return true; // Array#indexOf ignores holes, Array#includes - not } else for (;length > index; index++) if (IS_INCLUDES || index in O) { if (O[index] === el) return IS_INCLUDES || index || 0; } return !IS_INCLUDES && -1; }; }; /***/ }), /* 66 */ /***/ (function(module, exports, __webpack_require__) { // 7.1.15 ToLength var toInteger = __webpack_require__(17); var min = Math.min; module.exports = function (it) { return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 }; /***/ }), /* 67 */ /***/ (function(module, exports, __webpack_require__) { var toInteger = __webpack_require__(17); var max = Math.max; var min = Math.min; module.exports = function (index, length) { index = toInteger(index); return index < 0 ? max(index + length, 0) : min(index, length); }; /***/ }), /* 68 */ /***/ (function(module, exports, __webpack_require__) { var document = __webpack_require__(0).document; module.exports = document && document.documentElement; /***/ }), /* 69 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) var has = __webpack_require__(4); var toObject = __webpack_require__(70); var IE_PROTO = __webpack_require__(22)('IE_PROTO'); var ObjectProto = Object.prototype; module.exports = Object.getPrototypeOf || function (O) { O = toObject(O); if (has(O, IE_PROTO)) return O[IE_PROTO]; if (typeof O.constructor == 'function' && O instanceof O.constructor) { return O.constructor.prototype; } return O instanceof Object ? ObjectProto : null; }; /***/ }), /* 70 */ /***/ (function(module, exports, __webpack_require__) { // 7.1.13 ToObject(argument) var defined = __webpack_require__(18); module.exports = function (it) { return Object(defined(it)); }; /***/ }), /* 71 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(72); var global = __webpack_require__(0); var hide = __webpack_require__(5); var Iterators = __webpack_require__(19); var TO_STRING_TAG = __webpack_require__(8)('toStringTag'); var DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' + 'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' + 'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' + 'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' + 'TextTrackList,TouchList').split(','); for (var i = 0; i < DOMIterables.length; i++) { var NAME = DOMIterables[i]; var Collection = global[NAME]; var proto = Collection && Collection.prototype; if (proto && !proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME); Iterators[NAME] = Iterators.Array; } /***/ }), /* 72 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var addToUnscopables = __webpack_require__(73); var step = __webpack_require__(74); var Iterators = __webpack_require__(19); var toIObject = __webpack_require__(7); // 22.1.3.4 Array.prototype.entries() // 22.1.3.13 Array.prototype.keys() // 22.1.3.29 Array.prototype.values() // 22.1.3.30 Array.prototype[@@iterator]() module.exports = __webpack_require__(38)(Array, 'Array', function (iterated, kind) { this._t = toIObject(iterated); // target this._i = 0; // next index this._k = kind; // kind // 22.1.5.2.1 %ArrayIteratorPrototype%.next() }, function () { var O = this._t; var kind = this._k; var index = this._i++; if (!O || index >= O.length) { this._t = undefined; return step(1); } if (kind == 'keys') return step(0, index); if (kind == 'values') return step(0, O[index]); return step(0, [index, O[index]]); }, 'values'); // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) Iterators.Arguments = Iterators.Array; addToUnscopables('keys'); addToUnscopables('values'); addToUnscopables('entries'); /***/ }), /* 73 */ /***/ (function(module, exports) { module.exports = function () { /* empty */ }; /***/ }), /* 74 */ /***/ (function(module, exports) { module.exports = function (done, value) { return { value: value, done: !!done }; }; /***/ }), /* 75 */ /***/ (function(module, exports, __webpack_require__) { module.exports = { "default": __webpack_require__(76), __esModule: true }; /***/ }), /* 76 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(77); __webpack_require__(82); __webpack_require__(83); __webpack_require__(84); module.exports = __webpack_require__(1).Symbol; /***/ }), /* 77 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // ECMAScript 6 symbols shim var global = __webpack_require__(0); var has = __webpack_require__(4); var DESCRIPTORS = __webpack_require__(3); var $export = __webpack_require__(9); var redefine = __webpack_require__(39); var META = __webpack_require__(78).KEY; var $fails = __webpack_require__(12); var shared = __webpack_require__(23); var setToStringTag = __webpack_require__(25); var uid = __webpack_require__(15); var wks = __webpack_require__(8); var wksExt = __webpack_require__(26); var wksDefine = __webpack_require__(27); var enumKeys = __webpack_require__(79); var isArray = __webpack_require__(80); var anObject = __webpack_require__(10); var isObject = __webpack_require__(6); var toIObject = __webpack_require__(7); var toPrimitive = __webpack_require__(16); var createDesc = __webpack_require__(13); var _create = __webpack_require__(20); var gOPNExt = __webpack_require__(81); var $GOPD = __webpack_require__(44); var $DP = __webpack_require__(2); var $keys = __webpack_require__(21); var gOPD = $GOPD.f; var dP = $DP.f; var gOPN = gOPNExt.f; var $Symbol = global.Symbol; var $JSON = global.JSON; var _stringify = $JSON && $JSON.stringify; var PROTOTYPE = 'prototype'; var HIDDEN = wks('_hidden'); var TO_PRIMITIVE = wks('toPrimitive'); var isEnum = {}.propertyIsEnumerable; var SymbolRegistry = shared('symbol-registry'); var AllSymbols = shared('symbols'); var OPSymbols = shared('op-symbols'); var ObjectProto = Object[PROTOTYPE]; var USE_NATIVE = typeof $Symbol == 'function'; var QObject = global.QObject; // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 var setSymbolDesc = DESCRIPTORS && $fails(function () { return _create(dP({}, 'a', { get: function () { return dP(this, 'a', { value: 7 }).a; } })).a != 7; }) ? function (it, key, D) { var protoDesc = gOPD(ObjectProto, key); if (protoDesc) delete ObjectProto[key]; dP(it, key, D); if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc); } : dP; var wrap = function (tag) { var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]); sym._k = tag; return sym; }; var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) { return typeof it == 'symbol'; } : function (it) { return it instanceof $Symbol; }; var $defineProperty = function defineProperty(it, key, D) { if (it === ObjectProto) $defineProperty(OPSymbols, key, D); anObject(it); key = toPrimitive(key, true); anObject(D); if (has(AllSymbols, key)) { if (!D.enumerable) { if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {})); it[HIDDEN][key] = true; } else { if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false; D = _create(D, { enumerable: createDesc(0, false) }); } return setSymbolDesc(it, key, D); } return dP(it, key, D); }; var $defineProperties = function defineProperties(it, P) { anObject(it); var keys = enumKeys(P = toIObject(P)); var i = 0; var l = keys.length; var key; while (l > i) $defineProperty(it, key = keys[i++], P[key]); return it; }; var $create = function create(it, P) { return P === undefined ? _create(it) : $defineProperties(_create(it), P); }; var $propertyIsEnumerable = function propertyIsEnumerable(key) { var E = isEnum.call(this, key = toPrimitive(key, true)); if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false; return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true; }; var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) { it = toIObject(it); key = toPrimitive(key, true); if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return; var D = gOPD(it, key); if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true; return D; }; var $getOwnPropertyNames = function getOwnPropertyNames(it) { var names = gOPN(toIObject(it)); var result = []; var i = 0; var key; while (names.length > i) { if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key); } return result; }; var $getOwnPropertySymbols = function getOwnPropertySymbols(it) { var IS_OP = it === ObjectProto; var names = gOPN(IS_OP ? OPSymbols : toIObject(it)); var result = []; var i = 0; var key; while (names.length > i) { if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]); } return result; }; // 19.4.1.1 Symbol([description]) if (!USE_NATIVE) { $Symbol = function Symbol() { if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!'); var tag = uid(arguments.length > 0 ? arguments[0] : undefined); var $set = function (value) { if (this === ObjectProto) $set.call(OPSymbols, value); if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false; setSymbolDesc(this, tag, createDesc(1, value)); }; if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set }); return wrap(tag); }; redefine($Symbol[PROTOTYPE], 'toString', function toString() { return this._k; }); $GOPD.f = $getOwnPropertyDescriptor; $DP.f = $defineProperty; __webpack_require__(43).f = gOPNExt.f = $getOwnPropertyNames; __webpack_require__(28).f = $propertyIsEnumerable; __webpack_require__(42).f = $getOwnPropertySymbols; if (DESCRIPTORS && !__webpack_require__(14)) { redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true); } wksExt.f = function (name) { return wrap(wks(name)); }; } $export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol }); for (var es6Symbols = ( // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables' ).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]); for (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]); $export($export.S + $export.F * !USE_NATIVE, 'Symbol', { // 19.4.2.1 Symbol.for(key) 'for': function (key) { return has(SymbolRegistry, key += '') ? SymbolRegistry[key] : SymbolRegistry[key] = $Symbol(key); }, // 19.4.2.5 Symbol.keyFor(sym) keyFor: function keyFor(sym) { if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!'); for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key; }, useSetter: function () { setter = true; }, useSimple: function () { setter = false; } }); $export($export.S + $export.F * !USE_NATIVE, 'Object', { // 19.1.2.2 Object.create(O [, Properties]) create: $create, // 19.1.2.4 Object.defineProperty(O, P, Attributes) defineProperty: $defineProperty, // 19.1.2.3 Object.defineProperties(O, Properties) defineProperties: $defineProperties, // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) getOwnPropertyDescriptor: $getOwnPropertyDescriptor, // 19.1.2.7 Object.getOwnPropertyNames(O) getOwnPropertyNames: $getOwnPropertyNames, // 19.1.2.8 Object.getOwnPropertySymbols(O) getOwnPropertySymbols: $getOwnPropertySymbols }); // 24.3.2 JSON.stringify(value [, replacer [, space]]) $JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () { var S = $Symbol(); // MS Edge converts symbol values to JSON as {} // WebKit converts symbol values to JSON as null // V8 throws on boxed symbols return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}'; })), 'JSON', { stringify: function stringify(it) { var args = [it]; var i = 1; var replacer, $replacer; while (arguments.length > i) args.push(arguments[i++]); $replacer = replacer = args[1]; if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined if (!isArray(replacer)) replacer = function (key, value) { if (typeof $replacer == 'function') value = $replacer.call(this, key, value); if (!isSymbol(value)) return value; }; args[1] = replacer; return _stringify.apply($JSON, args); } }); // 19.4.3.4 Symbol.prototype[@@toPrimitive](hint) $Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(5)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf); // 19.4.3.5 Symbol.prototype[@@toStringTag] setToStringTag($Symbol, 'Symbol'); // 20.2.1.9 Math[@@toStringTag] setToStringTag(Math, 'Math', true); // 24.3.3 JSON[@@toStringTag] setToStringTag(global.JSON, 'JSON', true); /***/ }), /* 78 */ /***/ (function(module, exports, __webpack_require__) { var META = __webpack_require__(15)('meta'); var isObject = __webpack_require__(6); var has = __webpack_require__(4); var setDesc = __webpack_require__(2).f; var id = 0; var isExtensible = Object.isExtensible || function () { return true; }; var FREEZE = !__webpack_require__(12)(function () { return isExtensible(Object.preventExtensions({})); }); var setMeta = function (it) { setDesc(it, META, { value: { i: 'O' + ++id, // object ID w: {} // weak collections IDs } }); }; var fastKey = function (it, create) { // return primitive with prefix if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; if (!has(it, META)) { // can't set metadata to uncaught frozen object if (!isExtensible(it)) return 'F'; // not necessary to add metadata if (!create) return 'E'; // add missing metadata setMeta(it); // return object ID } return it[META].i; }; var getWeak = function (it, create) { if (!has(it, META)) { // can't set metadata to uncaught frozen object if (!isExtensible(it)) return true; // not necessary to add metadata if (!create) return false; // add missing metadata setMeta(it); // return hash weak collections IDs } return it[META].w; }; // add metadata on freeze-family methods calling var onFreeze = function (it) { if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it); return it; }; var meta = module.exports = { KEY: META, NEED: false, fastKey: fastKey, getWeak: getWeak, onFreeze: onFreeze }; /***/ }), /* 79 */ /***/ (function(module, exports, __webpack_require__) { // all enumerable object keys, includes symbols var getKeys = __webpack_require__(21); var gOPS = __webpack_require__(42); var pIE = __webpack_require__(28); module.exports = function (it) { var result = getKeys(it); var getSymbols = gOPS.f; if (getSymbols) { var symbols = getSymbols(it); var isEnum = pIE.f; var i = 0; var key; while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key); } return result; }; /***/ }), /* 80 */ /***/ (function(module, exports, __webpack_require__) { // 7.2.2 IsArray(argument) var cof = __webpack_require__(41); module.exports = Array.isArray || function isArray(arg) { return cof(arg) == 'Array'; }; /***/ }), /* 81 */ /***/ (function(module, exports, __webpack_require__) { // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window var toIObject = __webpack_require__(7); var gOPN = __webpack_require__(43).f; var toString = {}.toString; var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : []; var getWindowNames = function (it) { try { return gOPN(it); } catch (e) { return windowNames.slice(); } }; module.exports.f = function getOwnPropertyNames(it) { return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it)); }; /***/ }), /* 82 */ /***/ (function(module, exports) { /***/ }), /* 83 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(27)('asyncIterator'); /***/ }), /* 84 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(27)('observable'); /***/ }), /* 85 */ /***/ (function(module, exports, __webpack_require__) { module.exports = { "default": __webpack_require__(86), __esModule: true }; /***/ }), /* 86 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(87); module.exports = __webpack_require__(1).Object.setPrototypeOf; /***/ }), /* 87 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.3.19 Object.setPrototypeOf(O, proto) var $export = __webpack_require__(9); $export($export.S, 'Object', { setPrototypeOf: __webpack_require__(88).set }); /***/ }), /* 88 */ /***/ (function(module, exports, __webpack_require__) { // Works with __proto__ only. Old v8 can't work with null proto objects. /* eslint-disable no-proto */ var isObject = __webpack_require__(6); var anObject = __webpack_require__(10); var check = function (O, proto) { anObject(O); if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!"); }; module.exports = { set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line function (test, buggy, set) { try { set = __webpack_require__(31)(Function.call, __webpack_require__(44).f(Object.prototype, '__proto__').set, 2); set(test, []); buggy = !(test instanceof Array); } catch (e) { buggy = true; } return function setPrototypeOf(O, proto) { check(O, proto); if (buggy) O.__proto__ = proto; else set(O, proto); return O; }; }({}, false) : undefined), check: check }; /***/ }), /* 89 */ /***/ (function(module, exports, __webpack_require__) { module.exports = { "default": __webpack_require__(90), __esModule: true }; /***/ }), /* 90 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(91); var $Object = __webpack_require__(1).Object; module.exports = function create(P, D) { return $Object.create(P, D); }; /***/ }), /* 91 */ /***/ (function(module, exports, __webpack_require__) { var $export = __webpack_require__(9); // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) $export($export.S, 'Object', { create: __webpack_require__(20) }); /***/ }), /* 92 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** @license React v16.8.6 * react-is.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ Object.defineProperty(exports,"__esModule",{value:!0}); var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?Symbol.for("react.memo"): 60115,r=b?Symbol.for("react.lazy"):60116;function t(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case h:return a;default:return u}}case r:case q:case d:return u}}}function v(a){return t(a)===m}exports.typeOf=t;exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n; exports.Fragment=e;exports.Lazy=r;exports.Memo=q;exports.Portal=d;exports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||"object"===typeof a&&null!==a&&(a.$$typeof===r||a.$$typeof===q||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n)};exports.isAsyncMode=function(a){return v(a)||t(a)===l};exports.isConcurrentMode=v;exports.isContextConsumer=function(a){return t(a)===k}; exports.isContextProvider=function(a){return t(a)===h};exports.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return t(a)===n};exports.isFragment=function(a){return t(a)===e};exports.isLazy=function(a){return t(a)===r};exports.isMemo=function(a){return t(a)===q};exports.isPortal=function(a){return t(a)===d};exports.isProfiler=function(a){return t(a)===g};exports.isStrictMode=function(a){return t(a)===f}; exports.isSuspense=function(a){return t(a)===p}; /***/ }), /* 93 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(process) {/** @license React v16.8.6 * react-is.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ if (process.env.NODE_ENV !== "production") { (function() { 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); // The Symbol used to tag the ReactElement-like types. If there is no native Symbol // nor polyfill, then a plain number is used for performance. var hasSymbol = typeof Symbol === 'function' && Symbol.for; var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7; var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca; var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb; var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc; var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2; var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd; var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf; var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf; var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0; var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1; var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3; var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4; function isValidElementType(type) { return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE); } /** * Forked from fbjs/warning: * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js * * Only change is we use console.warn instead of console.error, * and do nothing when 'console' is not supported. * This really simplifies the code. * --- * Similar to invariant but only logs a warning if the condition is not met. * This can be used to log issues in development environments in critical * paths. Removing the logging code for production environments will keep the * same logic and follow the same code paths. */ var lowPriorityWarning = function () {}; { var printWarning = function (format) { for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } var argIndex = 0; var message = 'Warning: ' + format.replace(/%s/g, function () { return args[argIndex++]; }); if (typeof console !== 'undefined') { console.warn(message); } try { // --- Welcome to debugging React --- // This error was thrown as a convenience so that you can use this stack // to find the callsite that caused this warning to fire. throw new Error(message); } catch (x) {} }; lowPriorityWarning = function (condition, format) { if (format === undefined) { throw new Error('`lowPriorityWarning(condition, format, ...args)` requires a warning ' + 'message argument'); } if (!condition) { for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { args[_key2 - 2] = arguments[_key2]; } printWarning.apply(undefined, [format].concat(args)); } }; } var lowPriorityWarning$1 = lowPriorityWarning; function typeOf(object) { if (typeof object === 'object' && object !== null) { var $$typeof = object.$$typeof; switch ($$typeof) { case REACT_ELEMENT_TYPE: var type = object.type; switch (type) { case REACT_ASYNC_MODE_TYPE: case REACT_CONCURRENT_MODE_TYPE: case REACT_FRAGMENT_TYPE: case REACT_PROFILER_TYPE: case REACT_STRICT_MODE_TYPE: case REACT_SUSPENSE_TYPE: return type; default: var $$typeofType = type && type.$$typeof; switch ($$typeofType) { case REACT_CONTEXT_TYPE: case REACT_FORWARD_REF_TYPE: case REACT_PROVIDER_TYPE: return $$typeofType; default: return $$typeof; } } case REACT_LAZY_TYPE: case REACT_MEMO_TYPE: case REACT_PORTAL_TYPE: return $$typeof; } } return undefined; } // AsyncMode is deprecated along with isAsyncMode var AsyncMode = REACT_ASYNC_MODE_TYPE; var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE; var ContextConsumer = REACT_CONTEXT_TYPE; var ContextProvider = REACT_PROVIDER_TYPE; var Element = REACT_ELEMENT_TYPE; var ForwardRef = REACT_FORWARD_REF_TYPE; var Fragment = REACT_FRAGMENT_TYPE; var Lazy = REACT_LAZY_TYPE; var Memo = REACT_MEMO_TYPE; var Portal = REACT_PORTAL_TYPE; var Profiler = REACT_PROFILER_TYPE; var StrictMode = REACT_STRICT_MODE_TYPE; var Suspense = REACT_SUSPENSE_TYPE; var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated function isAsyncMode(object) { { if (!hasWarnedAboutDeprecatedIsAsyncMode) { hasWarnedAboutDeprecatedIsAsyncMode = true; lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.'); } } return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE; } function isConcurrentMode(object) { return typeOf(object) === REACT_CONCURRENT_MODE_TYPE; } function isContextConsumer(object) { return typeOf(object) === REACT_CONTEXT_TYPE; } function isContextProvider(object) { return typeOf(object) === REACT_PROVIDER_TYPE; } function isElement(object) { return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; } function isForwardRef(object) { return typeOf(object) === REACT_FORWARD_REF_TYPE; } function isFragment(object) { return typeOf(object) === REACT_FRAGMENT_TYPE; } function isLazy(object) { return typeOf(object) === REACT_LAZY_TYPE; } function isMemo(object) { return typeOf(object) === REACT_MEMO_TYPE; } function isPortal(object) { return typeOf(object) === REACT_PORTAL_TYPE; } function isProfiler(object) { return typeOf(object) === REACT_PROFILER_TYPE; } function isStrictMode(object) { return typeOf(object) === REACT_STRICT_MODE_TYPE; } function isSuspense(object) { return typeOf(object) === REACT_SUSPENSE_TYPE; } exports.typeOf = typeOf; exports.AsyncMode = AsyncMode; exports.ConcurrentMode = ConcurrentMode; exports.ContextConsumer = ContextConsumer; exports.ContextProvider = ContextProvider; exports.Element = Element; exports.ForwardRef = ForwardRef; exports.Fragment = Fragment; exports.Lazy = Lazy; exports.Memo = Memo; exports.Portal = Portal; exports.Profiler = Profiler; exports.StrictMode = StrictMode; exports.Suspense = Suspense; exports.isValidElementType = isValidElementType; exports.isAsyncMode = isAsyncMode; exports.isConcurrentMode = isConcurrentMode; exports.isContextConsumer = isContextConsumer; exports.isContextProvider = isContextProvider; exports.isElement = isElement; exports.isForwardRef = isForwardRef; exports.isFragment = isFragment; exports.isLazy = isLazy; exports.isMemo = isMemo; exports.isPortal = isPortal; exports.isProfiler = isProfiler; exports.isStrictMode = isStrictMode; exports.isSuspense = isSuspense; })(); } /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11))) /***/ }), /* 94 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(process) {/** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var ReactIs = __webpack_require__(49); var assign = __webpack_require__(95); var ReactPropTypesSecret = __webpack_require__(29); var checkPropTypes = __webpack_require__(96); var has = Function.call.bind(Object.prototype.hasOwnProperty); var printWarning = function() {}; if (process.env.NODE_ENV !== 'production') { printWarning = function(text) { var message = 'Warning: ' + text; if (typeof console !== 'undefined') { console.error(message); } try { // --- Welcome to debugging React --- // This error was thrown as a convenience so that you can use this stack // to find the callsite that caused this warning to fire. throw new Error(message); } catch (x) {} }; } function emptyFunctionThatReturnsNull() { return null; } module.exports = function(isValidElement, throwOnDirectAccess) { /* global Symbol */ var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. /** * Returns the iterator method function contained on the iterable object. * * Be sure to invoke the function with the iterable as context: * * var iteratorFn = getIteratorFn(myIterable); * if (iteratorFn) { * var iterator = iteratorFn.call(myIterable); * ... * } * * @param {?object} maybeIterable * @return {?function} */ function getIteratorFn(maybeIterable) { var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); if (typeof iteratorFn === 'function') { return iteratorFn; } } /** * Collection of methods that allow declaration and validation of props that are * supplied to React components. Example usage: * * var Props = require('ReactPropTypes'); * var MyArticle = React.createClass({ * propTypes: { * // An optional string prop named "description". * description: Props.string, * * // A required enum prop named "category". * category: Props.oneOf(['News','Photos']).isRequired, * * // A prop named "dialog" that requires an instance of Dialog. * dialog: Props.instanceOf(Dialog).isRequired * }, * render: function() { ... } * }); * * A more formal specification of how these methods are used: * * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) * decl := ReactPropTypes.{type}(.isRequired)? * * Each and every declaration produces a function with the same signature. This * allows the creation of custom validation functions. For example: * * var MyLink = React.createClass({ * propTypes: { * // An optional string or URI prop named "href". * href: function(props, propName, componentName) { * var propValue = props[propName]; * if (propValue != null && typeof propValue !== 'string' && * !(propValue instanceof URI)) { * return new Error( * 'Expected a string or an URI for ' + propName + ' in ' + * componentName * ); * } * } * }, * render: function() {...} * }); * * @internal */ var ANONYMOUS = '<<anonymous>>'; // Important! // Keep this list in sync with production version in `./factoryWithThrowingShims.js`. var ReactPropTypes = { array: createPrimitiveTypeChecker('array'), bool: createPrimitiveTypeChecker('boolean'), func: createPrimitiveTypeChecker('function'), number: createPrimitiveTypeChecker('number'), object: createPrimitiveTypeChecker('object'), string: createPrimitiveTypeChecker('string'), symbol: createPrimitiveTypeChecker('symbol'), any: createAnyTypeChecker(), arrayOf: createArrayOfTypeChecker, element: createElementTypeChecker(), elementType: createElementTypeTypeChecker(), instanceOf: createInstanceTypeChecker, node: createNodeChecker(), objectOf: createObjectOfTypeChecker, oneOf: createEnumTypeChecker, oneOfType: createUnionTypeChecker, shape: createShapeTypeChecker, exact: createStrictShapeTypeChecker, }; /** * inlined Object.is polyfill to avoid requiring consumers ship their own * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is */ /*eslint-disable no-self-compare*/ function is(x, y) { // SameValue algorithm if (x === y) { // Steps 1-5, 7-10 // Steps 6.b-6.e: +0 != -0 return x !== 0 || 1 / x === 1 / y; } else { // Step 6.a: NaN == NaN return x !== x && y !== y; } } /*eslint-enable no-self-compare*/ /** * We use an Error-like object for backward compatibility as people may call * PropTypes directly and inspect their output. However, we don't use real * Errors anymore. We don't inspect their stack anyway, and creating them * is prohibitively expensive if they are created too often, such as what * happens in oneOfType() for any type before the one that matched. */ function PropTypeError(message) { this.message = message; this.stack = ''; } // Make `instanceof Error` still work for returned errors. PropTypeError.prototype = Error.prototype; function createChainableTypeChecker(validate) { if (process.env.NODE_ENV !== 'production') { var manualPropTypeCallCache = {}; var manualPropTypeWarningCount = 0; } function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { componentName = componentName || ANONYMOUS; propFullName = propFullName || propName; if (secret !== ReactPropTypesSecret) { if (throwOnDirectAccess) { // New behavior only for users of `prop-types` package var err = new Error( 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use `PropTypes.checkPropTypes()` to call them. ' + 'Read more at http://fb.me/use-check-prop-types' ); err.name = 'Invariant Violation'; throw err; } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') { // Old behavior for people using React.PropTypes var cacheKey = componentName + ':' + propName; if ( !manualPropTypeCallCache[cacheKey] && // Avoid spamming the console because they are often not actionable except for lib authors manualPropTypeWarningCount < 3 ) { printWarning( 'You are manually calling a React.PropTypes validation ' + 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' + 'and will throw in the standalone `prop-types` package. ' + 'You may be seeing this warning due to a third-party PropTypes ' + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.' ); manualPropTypeCallCache[cacheKey] = true; manualPropTypeWarningCount++; } } } if (props[propName] == null) { if (isRequired) { if (props[propName] === null) { return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.')); } return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.')); } return null; } else { return validate(props, propName, componentName, location, propFullName); } } var chainedCheckType = checkType.bind(null, false); chainedCheckType.isRequired = checkType.bind(null, true); return chainedCheckType; } function createPrimitiveTypeChecker(expectedType) { function validate(props, propName, componentName, location, propFullName, secret) { var propValue = props[propName]; var propType = getPropType(propValue); if (propType !== expectedType) { // `propValue` being instance of, say, date/regexp, pass the 'object' // check, but we can offer a more precise error message here rather than // 'of type `object`'. var preciseType = getPreciseType(propValue); return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.')); } return null; } return createChainableTypeChecker(validate); } function createAnyTypeChecker() { return createChainableTypeChecker(emptyFunctionThatReturnsNull); } function createArrayOfTypeChecker(typeChecker) { function validate(props, propName, componentName, location, propFullName) { if (typeof typeChecker !== 'function') { return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.'); } var propValue = props[propName]; if (!Array.isArray(propValue)) { var propType = getPropType(propValue); return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.')); } for (var i = 0; i < propValue.length; i++) { var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret); if (error instanceof Error) { return error; } } return null; } return createChainableTypeChecker(validate); } function createElementTypeChecker() { function validate(props, propName, componentName, location, propFullName) { var propValue = props[propName]; if (!isValidElement(propValue)) { var propType = getPropType(propValue); return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.')); } return null; } return createChainableTypeChecker(validate); } function createElementTypeTypeChecker() { function validate(props, propName, componentName, location, propFullName) { var propValue = props[propName]; if (!ReactIs.isValidElementType(propValue)) { var propType = getPropType(propValue); return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.')); } return null; } return createChainableTypeChecker(validate); } function createInstanceTypeChecker(expectedClass) { function validate(props, propName, componentName, location, propFullName) { if (!(props[propName] instanceof expectedClass)) { var expectedClassName = expectedClass.name || ANONYMOUS; var actualClassName = getClassName(props[propName]); return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.')); } return null; } return createChainableTypeChecker(validate); } function createEnumTypeChecker(expectedValues) { if (!Array.isArray(expectedValues)) { if (process.env.NODE_ENV !== 'production') { if (arguments.length > 1) { printWarning( 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' + 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).' ); } else { printWarning('Invalid argument supplied to oneOf, expected an array.'); } } return emptyFunctionThatReturnsNull; } function validate(props, propName, componentName, location, propFullName) { var propValue = props[propName]; for (var i = 0; i < expectedValues.length; i++) { if (is(propValue, expectedValues[i])) { return null; } } var valuesString = JSON.stringify(expectedValues, function replacer(key, value) { var type = getPreciseType(value); if (type === 'symbol') { return String(value); } return value; }); return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); } return createChainableTypeChecker(validate); } function createObjectOfTypeChecker(typeChecker) { function validate(props, propName, componentName, location, propFullName) { if (typeof typeChecker !== 'function') { return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); } var propValue = props[propName]; var propType = getPropType(propValue); if (propType !== 'object') { return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); } for (var key in propValue) { if (has(propValue, key)) { var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); if (error instanceof Error) { return error; } } } return null; } return createChainableTypeChecker(validate); } function createUnionTypeChecker(arrayOfTypeCheckers) { if (!Array.isArray(arrayOfTypeCheckers)) { process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0; return emptyFunctionThatReturnsNull; } for (var i = 0; i < arrayOfTypeCheckers.length; i++) { var checker = arrayOfTypeCheckers[i]; if (typeof checker !== 'function') { printWarning( 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.' ); return emptyFunctionThatReturnsNull; } } function validate(props, propName, componentName, location, propFullName) { for (var i = 0; i < arrayOfTypeCheckers.length; i++) { var checker = arrayOfTypeCheckers[i]; if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) { return null; } } return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.')); } return createChainableTypeChecker(validate); } function createNodeChecker() { function validate(props, propName, componentName, location, propFullName) { if (!isNode(props[propName])) { return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); } return null; } return createChainableTypeChecker(validate); } function createShapeTypeChecker(shapeTypes) { function validate(props, propName, componentName, location, propFullName) { var propValue = props[propName]; var propType = getPropType(propValue); if (propType !== 'object') { return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); } for (var key in shapeTypes) { var checker = shapeTypes[key]; if (!checker) { continue; } var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); if (error) { return error; } } return null; } return createChainableTypeChecker(validate); } function createStrictShapeTypeChecker(shapeTypes) { function validate(props, propName, componentName, location, propFullName) { var propValue = props[propName]; var propType = getPropType(propValue); if (propType !== 'object') { return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); } // We need to check all keys in case some are required but missing from // props. var allKeys = assign({}, props[propName], shapeTypes); for (var key in allKeys) { var checker = shapeTypes[key]; if (!checker) { return new PropTypeError( 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ') ); } var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); if (error) { return error; } } return null; } return createChainableTypeChecker(validate); } function isNode(propValue) { switch (typeof propValue) { case 'number': case 'string': case 'undefined': return true; case 'boolean': return !propValue; case 'object': if (Array.isArray(propValue)) { return propValue.every(isNode); } if (propValue === null || isValidElement(propValue)) { return true; } var iteratorFn = getIteratorFn(propValue); if (iteratorFn) { var iterator = iteratorFn.call(propValue); var step; if (iteratorFn !== propValue.entries) { while (!(step = iterator.next()).done) { if (!isNode(step.value)) { return false; } } } else { // Iterator will provide entry [k,v] tuples rather than values. while (!(step = iterator.next()).done) { var entry = step.value; if (entry) { if (!isNode(entry[1])) { return false; } } } } } else { return false; } return true; default: return false; } } function isSymbol(propType, propValue) { // Native Symbol. if (propType === 'symbol') { return true; } // falsy value can't be a Symbol if (!propValue) { return false; } // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' if (propValue['@@toStringTag'] === 'Symbol') { return true; } // Fallback for non-spec compliant Symbols which are polyfilled. if (typeof Symbol === 'function' && propValue instanceof Symbol) { return true; } return false; } // Equivalent of `typeof` but with special handling for array and regexp. function getPropType(propValue) { var propType = typeof propValue; if (Array.isArray(propValue)) { return 'array'; } if (propValue instanceof RegExp) { // Old webkits (at least until Android 4.0) return 'function' rather than // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ // passes PropTypes.object. return 'object'; } if (isSymbol(propType, propValue)) { return 'symbol'; } return propType; } // This handles more types than `getPropType`. Only used for error messages. // See `createPrimitiveTypeChecker`. function getPreciseType(propValue) { if (typeof propValue === 'undefined' || propValue === null) { return '' + propValue; } var propType = getPropType(propValue); if (propType === 'object') { if (propValue instanceof Date) { return 'date'; } else if (propValue instanceof RegExp) { return 'regexp'; } } return propType; } // Returns a string that is postfixed to a warning about an invalid type. // For example, "undefined" or "of type array" function getPostfixForTypeWarning(value) { var type = getPreciseType(value); switch (type) { case 'array': case 'object': return 'an ' + type; case 'boolean': case 'date': case 'regexp': return 'a ' + type; default: return type; } } // Returns class name of the object, if any. function getClassName(propValue) { if (!propValue.constructor || !propValue.constructor.name) { return ANONYMOUS; } return propValue.constructor.name; } ReactPropTypes.checkPropTypes = checkPropTypes; ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache; ReactPropTypes.PropTypes = ReactPropTypes; return ReactPropTypes; }; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11))) /***/ }), /* 95 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* object-assign (c) Sindre Sorhus @license MIT */ /* eslint-disable no-unused-vars */ var getOwnPropertySymbols = Object.getOwnPropertySymbols; var hasOwnProperty = Object.prototype.hasOwnProperty; var propIsEnumerable = Object.prototype.propertyIsEnumerable; function toObject(val) { if (val === null || val === undefined) { throw new TypeError('Object.assign cannot be called with null or undefined'); } return Object(val); } function shouldUseNative() { try { if (!Object.assign) { return false; } // Detect buggy property enumeration order in older V8 versions. // https://bugs.chromium.org/p/v8/issues/detail?id=4118 var test1 = new String('abc'); // eslint-disable-line no-new-wrappers test1[5] = 'de'; if (Object.getOwnPropertyNames(test1)[0] === '5') { return false; } // https://bugs.chromium.org/p/v8/issues/detail?id=3056 var test2 = {}; for (var i = 0; i < 10; i++) { test2['_' + String.fromCharCode(i)] = i; } var order2 = Object.getOwnPropertyNames(test2).map(function (n) { return test2[n]; }); if (order2.join('') !== '0123456789') { return false; } // https://bugs.chromium.org/p/v8/issues/detail?id=3056 var test3 = {}; 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { test3[letter] = letter; }); if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') { return false; } return true; } catch (err) { // We don't expect any of the above to throw, but better to be safe. return false; } } module.exports = shouldUseNative() ? Object.assign : function (target, source) { var from; var to = toObject(target); var symbols; for (var s = 1; s < arguments.length; s++) { from = Object(arguments[s]); for (var key in from) { if (hasOwnProperty.call(from, key)) { to[key] = from[key]; } } if (getOwnPropertySymbols) { symbols = getOwnPropertySymbols(from); for (var i = 0; i < symbols.length; i++) { if (propIsEnumerable.call(from, symbols[i])) { to[symbols[i]] = from[symbols[i]]; } } } } return to; }; /***/ }), /* 96 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(process) {/** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var printWarning = function() {}; if (process.env.NODE_ENV !== 'production') { var ReactPropTypesSecret = __webpack_require__(29); var loggedTypeFailures = {}; var has = Function.call.bind(Object.prototype.hasOwnProperty); printWarning = function(text) { var message = 'Warning: ' + text; if (typeof console !== 'undefined') { console.error(message); } try { // --- Welcome to debugging React --- // This error was thrown as a convenience so that you can use this stack // to find the callsite that caused this warning to fire. throw new Error(message); } catch (x) {} }; } /** * Assert that the values match with the type specs. * Error messages are memorized and will only be shown once. * * @param {object} typeSpecs Map of name to a ReactPropType * @param {object} values Runtime values that need to be type-checked * @param {string} location e.g. "prop", "context", "child context" * @param {string} componentName Name of the component for error messages. * @param {?Function} getStack Returns the component stack. * @private */ function checkPropTypes(typeSpecs, values, location, componentName, getStack) { if (process.env.NODE_ENV !== 'production') { for (var typeSpecName in typeSpecs) { if (has(typeSpecs, typeSpecName)) { var error; // Prop type validation may throw. In case they do, we don't want to // fail the render phase where it didn't fail before. So we log it. // After these have been cleaned up, we'll let them throw. try { // This is intentionally an invariant that gets caught. It's the same // behavior as without this statement except with a better message. if (typeof typeSpecs[typeSpecName] !== 'function') { var err = Error( (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' ); err.name = 'Invariant Violation'; throw err; } error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); } catch (ex) { error = ex; } if (error && !(error instanceof Error)) { printWarning( (componentName || 'React class') + ': type specification of ' + location + ' `' + typeSpecName + '` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).' ); } if (error instanceof Error && !(error.message in loggedTypeFailures)) { // Only monitor this failure once because there tends to be a lot of the // same error. loggedTypeFailures[error.message] = true; var stack = getStack ? getStack() : ''; printWarning( 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '') ); } } } } } /** * Resets warning cache when testing. * * @private */ checkPropTypes.resetWarningCache = function() { if (process.env.NODE_ENV !== 'production') { loggedTypeFailures = {}; } } module.exports = checkPropTypes; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11))) /***/ }), /* 97 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var ReactPropTypesSecret = __webpack_require__(29); function emptyFunction() {} function emptyFunctionWithReset() {} emptyFunctionWithReset.resetWarningCache = emptyFunction; module.exports = function() { function shim(props, propName, componentName, location, propFullName, secret) { if (secret === ReactPropTypesSecret) { // It is still safe when called from React. return; } var err = new Error( 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use PropTypes.checkPropTypes() to call them. ' + 'Read more at http://fb.me/use-check-prop-types' ); err.name = 'Invariant Violation'; throw err; }; shim.isRequired = shim; function getShim() { return shim; }; // Important! // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`. var ReactPropTypes = { array: shim, bool: shim, func: shim, number: shim, object: shim, string: shim, symbol: shim, any: shim, arrayOf: getShim, element: shim, elementType: shim, instanceOf: getShim, node: shim, objectOf: getShim, oneOf: getShim, oneOfType: getShim, shape: getShim, exact: getShim, checkPropTypes: emptyFunctionWithReset, resetWarningCache: emptyFunction }; ReactPropTypes.PropTypes = ReactPropTypes; return ReactPropTypes; }; /***/ }), /* 98 */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! Copyright (c) 2017 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */ /* global define */ (function () { 'use strict'; var hasOwn = {}.hasOwnProperty; function classNames () { var classes = []; for (var i = 0; i < arguments.length; i++) { var arg = arguments[i]; if (!arg) continue; var argType = typeof arg; if (argType === 'string' || argType === 'number') { classes.push(arg); } else if (Array.isArray(arg) && arg.length) { var inner = classNames.apply(null, arg); if (inner) { classes.push(inner); } } else if (argType === 'object') { for (var key in arg) { if (hasOwn.call(arg, key) && arg[key]) { classes.push(key); } } } } return classes.join(' '); } if (typeof module !== 'undefined' && module.exports) { classNames.default = classNames; module.exports = classNames; } else if (true) { // register as 'classnames', consistent with npm package name !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { return classNames; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else { window.classNames = classNames; } }()); /***/ }), /* 99 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck__ = __webpack_require__(34); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_createClass__ = __webpack_require__(35); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_createClass___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_createClass__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(36); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits__ = __webpack_require__(45); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_react__ = __webpack_require__(46); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_react__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_react_dom__ = __webpack_require__(47); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_react_dom___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_react_dom__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_prop_types__ = __webpack_require__(48); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_prop_types__); var ContainerRender = function (_React$Component) { __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits___default()(ContainerRender, _React$Component); function ContainerRender() { var _ref; var _temp, _this, _ret; __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck___default()(this, ContainerRender); for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return _ret = (_temp = (_this = __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn___default()(this, (_ref = ContainerRender.__proto__ || Object.getPrototypeOf(ContainerRender)).call.apply(_ref, [this].concat(args))), _this), _this.removeContainer = function () { if (_this.container) { __WEBPACK_IMPORTED_MODULE_5_react_dom___default.a.unmountComponentAtNode(_this.container); _this.container.parentNode.removeChild(_this.container); _this.container = null; } }, _this.renderComponent = function (props, ready) { var _this$props = _this.props, visible = _this$props.visible, getComponent = _this$props.getComponent, forceRender = _this$props.forceRender, getContainer = _this$props.getContainer, parent = _this$props.parent; if (visible || parent._component || forceRender) { if (!_this.container) { _this.container = getContainer(); } __WEBPACK_IMPORTED_MODULE_5_react_dom___default.a.unstable_renderSubtreeIntoContainer(parent, getComponent(props), _this.container, function callback() { if (ready) { ready.call(this); } }); } }, _temp), __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn___default()(_this, _ret); } __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_createClass___default()(ContainerRender, [{ key: 'componentDidMount', value: function componentDidMount() { if (this.props.autoMount) { this.renderComponent(); } } }, { key: 'componentDidUpdate', value: function componentDidUpdate() { if (this.props.autoMount) { this.renderComponent(); } } }, { key: 'componentWillUnmount', value: function componentWillUnmount() { if (this.props.autoDestroy) { this.removeContainer(); } } }, { key: 'render', value: function render() { return this.props.children({ renderComponent: this.renderComponent, removeContainer: this.removeContainer }); } }]); return ContainerRender; }(__WEBPACK_IMPORTED_MODULE_4_react___default.a.Component); ContainerRender.propTypes = { autoMount: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.bool, autoDestroy: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.bool, visible: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.bool, forceRender: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.bool, parent: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.any, getComponent: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.func.isRequired, getContainer: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.func.isRequired, children: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.func.isRequired }; ContainerRender.defaultProps = { autoMount: true, autoDestroy: true, forceRender: false }; /* harmony default export */ __webpack_exports__["a"] = (ContainerRender); /***/ }), /* 100 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = getScrollBarSize; var cached = void 0; function getScrollBarSize(fresh) { if (fresh || cached === undefined) { var inner = document.createElement('div'); inner.style.width = '100%'; inner.style.height = '200px'; var outer = document.createElement('div'); var outerStyle = outer.style; outerStyle.position = 'absolute'; outerStyle.top = 0; outerStyle.left = 0; outerStyle.pointerEvents = 'none'; outerStyle.visibility = 'hidden'; outerStyle.width = '200px'; outerStyle.height = '150px'; outerStyle.overflow = 'hidden'; outer.appendChild(inner); document.body.appendChild(outer); var widthContained = inner.offsetWidth; outer.style.overflow = 'scroll'; var widthScroll = inner.offsetWidth; if (widthContained === widthScroll) { widthScroll = outer.clientWidth; } document.body.removeChild(outer); cached = widthContained - widthScroll; } return cached; } /***/ }), /* 101 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["b"] = dataToArray; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return transitionStr; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return transitionEnd; }); /* harmony export (immutable) */ __webpack_exports__["a"] = addEventListener; /* harmony export (immutable) */ __webpack_exports__["d"] = removeEventListener; /* harmony export (immutable) */ __webpack_exports__["e"] = transformArguments; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return isNumeric; }); function dataToArray(vars) { if (Array.isArray(vars)) { return vars; } return [vars]; } var transitionEndObject = { transition: 'transitionend', WebkitTransition: 'webkitTransitionEnd', MozTransition: 'transitionend', OTransition: 'oTransitionEnd otransitionend' }; var transitionStr = Object.keys(transitionEndObject).filter(function (key) { if (typeof document === 'undefined') { return false; } var html = document.getElementsByTagName('html')[0]; return key in (html ? html.style : {}); })[0]; var transitionEnd = transitionEndObject[transitionStr]; function addEventListener(target, eventType, callback, options) { if (target.addEventListener) { target.addEventListener(eventType, callback, options); } else if (target.attachEvent) { target.attachEvent('on' + eventType, callback); } } function removeEventListener(target, eventType, callback, options) { if (target.removeEventListener) { target.removeEventListener(eventType, callback, options); } else if (target.attachEvent) { target.detachEvent('on' + eventType, callback); } } function transformArguments(arg, cb) { var result = void 0; if (typeof arg === 'function') { result = arg(cb); } else { result = arg; } if (Array.isArray(result)) { if (result.length === 2) { return result; } return [result[0], result[1]]; } return [result]; } var isNumeric = function isNumeric(value) { return !isNaN(parseFloat(value)) && isFinite(value); // eslint-disable-line }; /***/ }) /******/ ])["default"]; }); //# sourceMappingURL=rc-drawer.js.map
import _curry3 from './internal/_curry3.js'; import always from './always.js'; import over from './over.js'; /** * Returns the result of "setting" the portion of the given data structure * focused by the given lens to the given value. * * @func * @memberOf R * @since v0.16.0 * @category Object * @typedefn Lens s a = Functor f => (a -> f a) -> s -> f s * @sig Lens s a -> a -> s -> s * @param {Lens} lens * @param {*} v * @param {*} x * @return {*} * @see R.view, R.over, R.lens, R.lensIndex, R.lensProp, R.lensPath * @example * * const xLens = R.lensProp('x'); * * R.set(xLens, 4, {x: 1, y: 2}); //=> {x: 4, y: 2} * R.set(xLens, 8, {x: 1, y: 2}); //=> {x: 8, y: 2} */ var set = _curry3(function set(lens, v, x) { return over(lens, always(v), x); }); export default set;
import '@brightspace-ui/core/components/button/button.js'; import '@brightspace-ui/core/components/button/button-icon.js'; import '@brightspace-ui/core/components/dialog/dialog'; import '@brightspace-ui/core/components/dialog/dialog-confirm.js'; import '@brightspace-ui/core/components/tooltip/tooltip'; import '@brightspace-ui/core/components/inputs/input-text.js'; import '@brightspace-ui-labs/file-uploader/d2l-file-uploader'; import './attachment-dialog.js'; import { css, html, LitElement } from 'lit-element/lit-element'; import { BaseMixin } from '../mixins/base-mixin'; import { convertToDateString } from '../helpers'; const YES = 'yes'; class AwardIconLibrary extends BaseMixin(LitElement) { static get properties() { return { icons: { type: Array }, iconDetails: { type: Object }, infoDialogOpened: { type: Boolean }, deleteOpened: { type: Boolean }, uploadOpened: { type: Boolean }, isValidIconName: { type: Boolean }, isValidImage: { type: Boolean }, attachment: { type: Object } }; } static get styles() { return [ css` :host { display: inline-block; } :host([hidden]) { display: none; } .d2l-button--pad-bottom { padding-bottom: 12px; } .upload-dialog__d2l-button{ padding-bottom: 12px; margin-top: 48px; } .icon-library { display: grid; grid-template-columns: repeat(6, 1fr); column-gap: 12px; row-gap: 12px; } .icon-library__card { justify-self: center; display: flex; flex-direction: column; box-shadow: 0 0 3px #cccccc; border-radius: 3px; width: 100%; padding-top: 6px; padding-bottom: 6px; } .icon-library__img { width: 75px; height: 75px; margin: auto; object-fit: contain; } .icon-library__d2l-button-icon { margin: auto; margin-top: 6px; } .icon-library__button-bar{ margin: auto; } .info-dialog__column{ display: flex; flex-direction: column; } .info-dialog__img { align-self: center; padding: 20px 0px; } ` ]; } constructor() { super(); this.icons = []; this.uploadOpened = false; this._reset(); } connectedCallback() { super.connectedCallback(); this._fetchData(); } async _fetchData() { window.AwardService.getIcons().then(data => this.icons = data.icons); } _uploadButtonClicked() { this.uploadOpened = true; } _renderHeader() { return html` <d2l-button class="d2l-button--pad-bottom" @click=${this._uploadButtonClicked} description=${this.localize('icon-library-upload-button-description')} primary aria-haspopup="true" > ${this.localize('icon-library-upload-button-text')} </d2l-button> `; } _openInfoDialog(iconId) { return () => { this.iconDetails = this.icons.find(icon => icon.Id === iconId); this.infoDialogOpened = true; }; } _openDeleteDialog(iconId) { return () => { this.iconDetails = this.icons.find(icon => icon.Id === iconId); this.deleteOpened = true; }; } _renderIcons() { return html` <div class="icon-library"> ${this.icons.map(icon => html` <div id="icon-${icon.Id}" class="icon-library__card"> <img class="icon-library__img" src=${icon.Path} > <div class="icon-library__button-bar"> <d2l-button-icon class="icon-library__d2l-button-icon" text=${this.localize('icon-library-more-info-button-text')} icon="tier1:more" aria-haspopup="true" aria-label=${this.localize('icon-library-more-info-button-text')} @click='${this._openInfoDialog(icon.Id)}' > </d2l-button-icon> <d2l-button-icon class="icon-library__d2l-button-icon" text=${this.localize('delete-action')} icon="tier1:delete" aria-haspopup="true" aria-label=${this.localize('icon-library-delete-button-label')} @click='${this._openDeleteDialog(icon.Id)}' > </d2l-button-icon> </div> </div> <d2l-tooltip for="icon-${icon.Id}" offset="10"> ${icon.Name} </d2l-tooltip> `)} </div> `; } _infoDialogClose() { this.infoDialogOpened = false; } _renderInfoDialog() { return this.infoDialogOpened ? html` <d2l-dialog title-text=${this.iconDetails.Name} ?opened=${this.infoDialogOpened} @d2l-dialog-close=${this._infoDialogClose} > <div class="info-dialog__column"> <img class="info-dialog__img" src=${this.iconDetails.Path} /> <div><b>${this.localize('award-icon-library-icon-name-colon')}</b> ${this.iconDetails.Name}</div> <div><b>${this.localize('award-icon-library-icon-creation-date-colon')}</b> ${convertToDateString(this.iconDetails.CreatedDate)}</div> ${this.iconDetails.UsedBy.length ? html` <div><b>${this.localize('award-icon-library-icon-used-by-colon')}</b></div> ` : html``} <d2l-list separators="between"> ${this.iconDetails.UsedBy.map(award => html` <d2l-list-item> ${award} </d2l-list-item> `)} </d2l-list> </div> <d2l-button slot="footer" primary data-dialog-action > ${this.localize('close-action')} </d2l-button> </d2l-dialog> ` : html``; } _deleteClosed(e) { this.deleteOpened = false; if (e.detail.action === YES) { console.log('Deleting icon...'); } } _renderDeleteDialog() { return this.deleteOpened ? html` <d2l-dialog-confirm title-text=${this.localize('icon-library-confirm-delete-title')} text=${this.localize('icon-library-confirm-delete-title', {name: this.iconDetails.Name})} ?opened=${this.deleteOpened} @d2l-dialog-close=${this._deleteClosed} > <d2l-button slot="footer" primary data-dialog-action=${YES} > ${this.localize('yes-action')} </d2l-button> <d2l-button slot="footer" data-dialog-action > ${this.localize('no-action')} </d2l-button> </d2l-dialog-confirm> ` : html``; } _reset() { this.iconDetails = null; this.infoDialogOpened = false; this.deleteOpened = false; this.uploadOpened = false; } _createIcon({ detail: { name, attachment } }) { console.log(`Creating icon with name ${name} and filename ${attachment.name}`); //send in image and name this._reset(); } _handleUploadDialogClosed() { this.uploadOpened = false; this._reset(); } _renderUploadDialog() { console.log(`AWARD ICON LIBRARY: ${this.uploadOpened}`); return html` <d2l-attachment-dialog title=${this.localize('icon-library-dialog-upload-button-text')} name-label=${this.localize('icon-library-icon-name-label')} name-placeholder=${this.localize('icon-library-icon-name-placeholder')} ?opened=${this.uploadOpened} @d2l-dialog-close=${this._handleUploadDialogClosed} @d2l-attachment-created=${this._createIcon} > </d2l-attachment-dialog>`; } render() { return html` ${this._renderHeader()} ${this._renderIcons()} ${this._renderInfoDialog()} ${this._renderDeleteDialog()} ${this._renderUploadDialog()} `; } } customElements.define('d2l-award-icon-library', AwardIconLibrary);
var fs = require("fs"); module.exports = function() { let now = new Date(); let night = new Date( now.getFullYear(), now.getMonth(), now.getDate(), global.backup.time[0], global.backup.time[1], global.backup.time[2] ); let update = night.getTime() - now.getTime(); // milliseconds if (Math.sign(update) == -1) { night = new Date( now.getFullYear(), now.getMonth(), now.getDate() + 1, global.backup.time[0], global.backup.time[1], global.backup.time[2] ); update = night.getTime() - now.getTime(); // milliseconds } global.log("Next backup shall be made at: "+ global.pZ(global.backup.time[0], 2)+":"+ global.pZ(global.backup.time[1], 2)+":"+ global.pZ(global.backup.time[2], 2)+" ("+global.backup.dir+")" ); setTimeout(function() { fs.writeFileSync(global.backup.dir+"/users_"+moment().format("DD-MM-YY")+".json", fs.readFileSync(global.__dirname+"/users.json")); global.log("Backup successfully made in: "+global.backup.dir+"/users_"+moment().format("DD-MM-YY")+".json"); module.exports(); }, update); }
import assert from 'assert'; import { errors } from 'arsenal'; import withV4 from '../support/withV4'; import BucketUtility from '../../lib/utility/bucket-util'; const bucketName = 'alexbucketnottaken'; const objectName = 'someObject'; function checkNoError(err) { assert.equal(err, null, `Expected success, got error ${JSON.stringify(err)}`); } function checkError(err, code) { assert.notEqual(err, null, 'Expected failure but got success'); assert.strictEqual(err.code, code); } function dateFromNow(diff) { const d = new Date(); d.setHours(d.getHours() + diff); return d.toISOString(); } function dateConvert(d) { return (new Date(d)).toISOString(); } describe('HEAD object, conditions', () => { withV4(sigCfg => { let bucketUtil; let s3; let etag; let etagTrim; let lastModified; before(() => { bucketUtil = new BucketUtility('default', sigCfg); s3 = bucketUtil.s3; return bucketUtil.empty(bucketName).then(() => bucketUtil.deleteOne(bucketName) ) .catch(err => { if (err.code !== 'NoSuchBucket') { process.stdout.write(`${err}\n`); throw err; } }) .then(() => bucketUtil.createOne(bucketName)); }); function requestHead(fields, cb) { s3.headObject(Object.assign({ Bucket: bucketName, Key: objectName, }, fields), cb); } beforeEach(() => s3.putObjectAsync({ Bucket: bucketName, Key: objectName, Body: 'I am the best content ever', }).then(res => { etag = res.ETag; etagTrim = etag.substring(1, etag.length - 1); return s3.headObjectAsync({ Bucket: bucketName, Key: objectName }); }).then(res => { lastModified = res.LastModified; })); afterEach(() => bucketUtil.empty(bucketName)); after(() => bucketUtil.deleteOne(bucketName)); it('If-Match: returns no error when ETag match, with double quotes ' + 'around ETag', done => { requestHead({ IfMatch: etag }, err => { checkNoError(err); done(); }); }); it('If-Match: returns no error when one of ETags match, with double ' + 'quotes around ETag', done => { requestHead({ IfMatch: `non-matching,${etag}` }, err => { checkNoError(err); done(); }); }); it('If-Match: returns no error when ETag match, without double ' + 'quotes around ETag', done => { requestHead({ IfMatch: etagTrim }, err => { checkNoError(err); done(); }); }); it('If-Match: returns no error when one of ETags match, without ' + 'double quotes around ETag', done => { requestHead({ IfMatch: `non-matching,${etagTrim}` }, err => { checkNoError(err); done(); }); }); it('If-Match: returns no error when ETag match with *', done => { requestHead({ IfMatch: '*' }, err => { checkNoError(err); done(); }); }); it('If-Match: returns PreconditionFailed when ETag does not match', done => { requestHead({ IfMatch: 'non-matching ETag' }, err => { checkError(err, errors.PreconditionFailed.code); done(); }); }); it('If-None-Match: returns no error when ETag does not match', done => { requestHead({ IfNoneMatch: 'non-matching' }, err => { checkNoError(err); done(); }); }); it('If-None-Match: returns no error when all ETags do not match', done => { requestHead({ IfNoneMatch: 'non-matching,non-matching-either', }, err => { checkNoError(err); done(); }); }); it('If-None-Match: returns NotModified when ETag match, with double ' + 'quotes around ETag', done => { requestHead({ IfNoneMatch: etag }, err => { checkError(err, 'NotModified'); done(); }); }); it('If-None-Match: returns NotModified when one of ETags match, with ' + 'double quotes around ETag', done => { requestHead({ IfNoneMatch: `non-matching,${etag}`, }, err => { checkError(err, 'NotModified'); done(); }); }); it('If-None-Match: returns NotModified when ETag match, without ' + 'double quotes around ETag', done => { requestHead({ IfNoneMatch: etagTrim }, err => { checkError(err, 'NotModified'); done(); }); }); it('If-None-Match: returns NotModified when one of ETags match, ' + 'without double quotes around ETag', done => { requestHead({ IfNoneMatch: `non-matching,${etagTrim}`, }, err => { checkError(err, 'NotModified'); done(); }); }); it('If-Modified-Since: returns no error if Last modified date is ' + 'greater', done => { requestHead({ IfModifiedSince: dateFromNow(-1) }, err => { checkNoError(err); done(); }); }); // Skipping this test, because real AWS does not provide error as // expected it.skip('If-Modified-Since: returns NotModified if Last modified ' + 'date is lesser', done => { requestHead({ IfModifiedSince: dateFromNow(1) }, err => { checkError(err, 'NotModified'); done(); }); }); it('If-Modified-Since: returns NotModified if Last modified ' + 'date is equal', done => { requestHead({ IfModifiedSince: dateConvert(lastModified) }, err => { checkError(err, 'NotModified'); done(); }); }); it('If-Unmodified-Since: returns no error when lastModified date is ' + 'greater', done => { requestHead({ IfUnmodifiedSince: dateFromNow(1) }, err => { checkNoError(err); done(); }); }); it('If-Unmodified-Since: returns no error when lastModified ' + 'date is equal', done => { requestHead({ IfUnmodifiedSince: dateConvert(lastModified) }, err => { checkNoError(err); done(); }); }); it('If-Unmodified-Since: returns PreconditionFailed when ' + 'lastModified date is lesser', done => { requestHead({ IfUnmodifiedSince: dateFromNow(-1) }, err => { checkError(err, errors.PreconditionFailed.code); done(); }); }); it('If-Match & If-Unmodified-Since: returns no error when match Etag ' + 'and lastModified is greater', done => { requestHead({ IfMatch: etagTrim, IfUnmodifiedSince: dateFromNow(-1), }, err => { checkNoError(err); done(); }); }); it('If-Match match & If-Unmodified-Since match', done => { requestHead({ IfMatch: etagTrim, IfUnmodifiedSince: dateFromNow(1), }, err => { checkNoError(err); done(); }); }); it('If-Match not match & If-Unmodified-Since not match', done => { requestHead({ IfMatch: 'non-matching', IfUnmodifiedSince: dateFromNow(-1), }, err => { checkError(err, errors.PreconditionFailed.code); done(); }); }); it('If-Match not match & If-Unmodified-Since match', done => { requestHead({ IfMatch: 'non-matching', IfUnmodifiedSince: dateFromNow(1), }, err => { checkError(err, errors.PreconditionFailed.code); done(); }); }); // Skipping this test, because real AWS does not provide error as // expected it.skip('If-Match match & If-Modified-Since not match', done => { requestHead({ IfMatch: etagTrim, IfModifiedSince: dateFromNow(1), }, err => { checkNoError(err); done(); }); }); it('If-Match match & If-Modified-Since match', done => { requestHead({ IfMatch: etagTrim, IfModifiedSince: dateFromNow(-1), }, err => { checkNoError(err); done(); }); }); it('If-Match not match & If-Modified-Since not match', done => { requestHead({ IfMatch: 'non-matching', IfModifiedSince: dateFromNow(1), }, err => { checkError(err, errors.PreconditionFailed.code); done(); }); }); it('If-Match not match & If-Modified-Since match', done => { requestHead({ IfMatch: 'non-matching', IfModifiedSince: dateFromNow(-1), }, err => { checkError(err, errors.PreconditionFailed.code); done(); }); }); it('If-None-Match & If-Modified-Since: returns NotModified when Etag ' + 'does not match and lastModified is greater', done => { requestHead({ IfNoneMatch: etagTrim, IfModifiedSince: dateFromNow(-1), }, err => { checkError(err, 'NotModified'); done(); }); }); it('If-None-Match not match & If-Modified-Since not match', done => { requestHead({ IfNoneMatch: etagTrim, IfModifiedSince: dateFromNow(1), }, err => { checkError(err, 'NotModified'); done(); }); }); it('If-None-Match match & If-Modified-Since match', done => { requestHead({ IfNoneMatch: 'non-matching', IfModifiedSince: dateFromNow(-1), }, err => { checkNoError(err); done(); }); }); // Skipping this test, because real AWS does not provide error as // expected it.skip('If-None-Match match & If-Modified-Since not match', done => { requestHead({ IfNoneMatch: 'non-matching', IfModifiedSince: dateFromNow(1), }, err => { checkError(err, 'NotModified'); done(); }); }); it('If-None-Match match & If-Unmodified-Since match', done => { requestHead({ IfNoneMatch: 'non-matching', IfUnmodifiedSince: dateFromNow(1), }, err => { checkNoError(err); done(); }); }); it('If-None-Match match & If-Unmodified-Since not match', done => { requestHead({ IfNoneMatch: 'non-matching', IfUnmodifiedSince: dateFromNow(-1), }, err => { checkError(err, errors.PreconditionFailed.code); done(); }); }); it('If-None-Match not match & If-Unmodified-Since match', done => { requestHead({ IfNoneMatch: etagTrim, IfUnmodifiedSince: dateFromNow(1), }, err => { checkError(err, 'NotModified'); done(); }); }); it('If-None-Match not match & If-Unmodified-Since not match', done => { requestHead({ IfNoneMatch: etagTrim, IfUnmodifiedSince: dateFromNow(-1), }, err => { checkError(err, errors.PreconditionFailed.code); done(); }); }); }); });
window.hjSiteSettings = window.hjSiteSettings || {"features":["settings.billing_v2","recordings.page_content_ws"],"site_id":930919,"integrations":{"optimizely":{"tag_recordings":false}},"privacy_policy_url":"https:\/\/web.archive.org\/web\/20200415170500\/https:\/\/www.health.govt.nz\/about-site\/privacy-and-security","deferred_page_contents":[{"targeting":[{"negate":false,"pattern":"https:\/\/web.archive.org\/web\/20200415170500\/https:\/\/www.health.govt.nz\/our-work\/diseases-and-conditions\/covid-19-novel-coronavirus\/covid-19-novel-coronavirus-information-specific-audiences\/covid-19-information-disabled-people-and-their-family-and-whanau\/covid-19-getting-disability-support\/covid-19-paying-resident-family-0","match_operation":"simple","component":"url"},{"negate":false,"pattern":"tablet","match_operation":"exact","component":"device"}],"id":18243060},{"targeting":[{"negate":false,"pattern":"https:\/\/web.archive.org\/web\/20200415170500\/https:\/\/www.health.govt.nz\/our-work\/diseases-and-conditions\/covid-19-novel-coronavirus\/covid-19-novel-coronavirus-information-specific-audiences\/covid-19-information-disabled-people-and-their-family-and-whanau\/covid-19-getting-disability-support\/covid-19-paying-resident-family-0","match_operation":"simple","component":"url"},{"negate":false,"pattern":"phone","match_operation":"exact","component":"device"}],"id":18243059},{"targeting":[{"negate":false,"pattern":"https:\/\/web.archive.org\/web\/20200415170500\/https:\/\/www.health.govt.nz\/our-work\/diseases-and-conditions\/covid-19-novel-coronavirus\/covid-19-novel-coronavirus-information-specific-audiences\/covid-19-information-disabled-people-and-their-family-and-whanau\/alert-level-4-disabled-people","match_operation":"simple","component":"url"},{"negate":false,"pattern":"desktop","match_operation":"exact","component":"device"}],"id":18243025}],"surveys":[],"feedback_widgets":[],"anonymize_digits":false,"forms":[],"state_change_listen_mode":"automatic","legal_name":"Ministry of Health, New Zealand","recording_capture_keystrokes":false,"rec_value":1.0,"suppress_text":null,"suppress_location":false,"record_targeting_rules":[{"negate":false,"pattern":"https:\/\/web.archive.org\/web\/20200415170500\/https:\/\/www.health.govt.nz\/our-work\/diseases-and-conditions\/covid-19-novel-coronavirus","match_operation":"starts_with","component":"url"}],"heatmaps":[{"created_epoch_time":1586927096,"targeting":[{"negate":false,"pattern":"https:\/\/web.archive.org\/web\/20200415170500\/https:\/\/www.health.govt.nz\/our-work\/diseases-and-conditions\/covid-19-novel-coronavirus\/covid-19-novel-coronavirus-information-specific-audiences\/covid-19-information-disabled-people-and-their-family-and-whanau\/covid-19-getting-disability-support\/covid-19-paying-resident-family-0","match_operation":"simple","component":"url"}],"id":5779740,"selector_version":2},{"created_epoch_time":1586927064,"targeting":[{"negate":false,"pattern":"https:\/\/web.archive.org\/web\/20200415170500\/https:\/\/www.health.govt.nz\/our-work\/diseases-and-conditions\/covid-19-novel-coronavirus\/covid-19-novel-coronavirus-information-specific-audiences\/covid-19-information-disabled-people-and-their-family-and-whanau\/covid-19-getting-disability-support","match_operation":"simple","component":"url"}],"id":5779737,"selector_version":2},{"created_epoch_time":1586927016,"targeting":[{"negate":false,"pattern":"https:\/\/web.archive.org\/web\/20200415170500\/https:\/\/www.health.govt.nz\/our-work\/diseases-and-conditions\/covid-19-novel-coronavirus\/covid-19-novel-coronavirus-information-specific-audiences\/covid-19-information-disabled-people-and-their-family-and-whanau\/covid-19-easy-read-information","match_operation":"simple","component":"url"}],"id":5779732,"selector_version":2},{"created_epoch_time":1586926987,"targeting":[{"negate":false,"pattern":"https:\/\/web.archive.org\/web\/20200415170500\/https:\/\/www.health.govt.nz\/our-work\/diseases-and-conditions\/covid-19-novel-coronavirus\/covid-19-novel-coronavirus-information-specific-audiences\/covid-19-information-disabled-people-and-their-family-and-whanau\/alert-level-4-disabled-people","match_operation":"simple","component":"url"}],"id":5779728,"selector_version":2},{"created_epoch_time":1586926931,"targeting":[{"negate":false,"pattern":"https:\/\/web.archive.org\/web\/20200415170500\/https:\/\/www.health.govt.nz\/our-work\/diseases-and-conditions\/covid-19-novel-coronavirus\/covid-19-novel-coronavirus-information-specific-audiences\/covid-19-information-disabled-people-and-their-family-and-whanau","match_operation":"simple","component":"url"}],"id":5779720,"selector_version":2},{"created_epoch_time":1586926828,"targeting":[{"negate":false,"pattern":"https:\/\/web.archive.org\/web\/20200415170500\/https:\/\/www.health.govt.nz\/our-work\/diseases-and-conditions\/covid-19-novel-coronavirus\/covid-19-novel-coronavirus-information-specific-audiences\/covid-19-disability-and-aged-care-providers","match_operation":"simple","component":"url"}],"id":5779713,"selector_version":2},{"created_epoch_time":1586917169,"targeting":[{"negate":false,"pattern":"https:\/\/web.archive.org\/web\/20200415170500\/https:\/\/www.health.govt.nz\/our-work\/diseases-and-conditions\/covid-19-novel-coronavirus","match_operation":"simple","component":"url"}],"id":5779489,"selector_version":2},{"created_epoch_time":1585878927,"targeting":[{"negate":false,"pattern":"https:\/\/web.archive.org\/web\/20200415170500\/https:\/\/www.health.govt.nz\/our-work\/diseases-and-conditions\/covid-19-novel-coronavirus\/covid-19-novel-coronavirus-information-specific-audiences\/covid-19-advice-older-people","match_operation":"simple","component":"url"}],"id":5726407,"selector_version":2},{"created_epoch_time":1585709692,"targeting":[{"negate":false,"pattern":"https:\/\/web.archive.org\/web\/20200415170500\/https:\/\/www.health.govt.nz\/our-work\/diseases-and-conditions\/covid-19-novel-coronavirus\/covid-19-novel-coronavirus-information-specific-audiences\/covid-19-information-disabled-people-and-their-family-and-whanau","match_operation":"simple","component":"url"}],"id":5713191,"selector_version":2},{"created_epoch_time":1585703832,"targeting":[{"negate":false,"pattern":"https:\/\/web.archive.org\/web\/20200415170500\/https:\/\/www.health.govt.nz\/our-work\/diseases-and-conditions\/covid-19-novel-coronavirus\/covid-19-novel-coronavirus-information-specific-audiences\/covid-19-personal-protective-equipment-essential-workers\/personal-protective-equipment-use-non-health-essential-workers","match_operation":"simple","component":"url"}],"id":5713039,"selector_version":2},{"created_epoch_time":1585195402,"targeting":[{"negate":false,"pattern":"https:\/\/web.archive.org\/web\/20200415170500\/https:\/\/www.health.govt.nz\/our-work\/diseases-and-conditions\/covid-19-novel-coronavirus\/covid-19-epidemic-notice","match_operation":"simple","component":"url"}],"id":5683398,"selector_version":2},{"created_epoch_time":1585195255,"targeting":[{"negate":false,"pattern":"https:\/\/web.archive.org\/web\/20200415170500\/https:\/\/www.health.govt.nz\/our-work\/diseases-and-conditions\/covid-19-novel-coronavirus\/covid-19-information-other-languages","match_operation":"simple","component":"url"}],"id":5683390,"selector_version":2},{"created_epoch_time":1559184256,"targeting":[{"negate":false,"pattern":"https:\/\/web.archive.org\/web\/20200415170500\/https:\/\/www.health.govt.nz\/our-work\/mental-health-and-addictions\/government-inquiry-mental-health-and-addiction","match_operation":"simple","component":"url"}],"id":4232348,"selector_version":2},{"created_epoch_time":1559184188,"targeting":[{"negate":false,"pattern":"https:\/\/web.archive.org\/web\/20200415170500\/https:\/\/www.health.govt.nz\/about-ministry\/what-we-do\/budget-2019-vote-health","match_operation":"simple","component":"url"}],"id":4232343,"selector_version":2}],"polls":[{"persist_condition":"once","targeting":[{"rule_type":null,"name":null,"pattern":"https:\/\/web.archive.org\/web\/20200415170500\/https:\/\/www.health.govt.nz\/our-work\/diseases-and-conditions\/covid-19-novel-coronavirus\/covid-19-resources-health-professionals","component":"url","negate":false,"match_operation":"starts_with"},{"rule_type":null,"name":null,"pattern":"phone","component":"device","negate":false,"match_operation":"exact"},{"rule_type":null,"name":null,"pattern":"tablet","component":"device","negate":false,"match_operation":"exact"},{"rule_type":null,"name":null,"pattern":"desktop","component":"device","negate":false,"match_operation":"exact"}],"language":"en","created_epoch_time":1586144888,"targeting_percentage":100,"display_condition":"delay","display_delay":15,"content":{"thankyou":"Thanks \u2013 your feedback is appreciated","questions":[{"nextByAnswer":["byOrder","thankYou"],"uuid":"1543e0ff-b3ee-43ff-ae7a-fbb2b3b19d86","text":"We're making improvements to our COVID-19 information for health professionals \u2013 would you like to help us by answering a few questions?","required":true,"answers":[{"text":"Yes","comments":false},{"text":"No","comments":false}],"next":"byAnswer","type":"single-close-ended","randomize_answer_order":true},{"uuid":"7089544d-cce6-423a-b66c-0b0d7d3ac788","text":"Are you a health professional?","required":true,"answers":[{"text":"Yes","comments":false},{"text":"No","comments":false}],"next":"byOrder","type":"single-close-ended","randomize_answer_order":true},{"text":"What are the top three things you need to know right now?","required":true,"type":"single-open-ended-multiple-line","uuid":"de7f126e-8e78-4cbc-b1b2-a2203c94eadd","next":"byOrder"}]},"question_signatures":{"de7f126e-8e78-4cbc-b1b2-a2203c94eadd":"NTSSarX5tZo7SwyK2MhyKzCm-uY","1543e0ff-b3ee-43ff-ae7a-fbb2b3b19d86":"lOBGSJSw77MU5LgWrW4m0I3IyXE","7089544d-cce6-423a-b66c-0b0d7d3ac788":"uD3A4IooGKTccdwBZ-1Q5LE2Tyc"},"effective_show_branding":false,"ask_for_consent":false,"background":"#333333","skin":"dark","position":"right","show_legal":true,"id":494148},{"persist_condition":"once","targeting":[{"rule_type":null,"name":null,"pattern":"desktop","component":"device","negate":false,"match_operation":"exact"},{"rule_type":null,"name":null,"pattern":"tablet","component":"device","negate":false,"match_operation":"exact"},{"rule_type":null,"name":null,"pattern":"phone","component":"device","negate":false,"match_operation":"exact"},{"rule_type":null,"name":null,"pattern":"https:\/\/web.archive.org\/web\/20200415170500\/https:\/\/www.health.govt.nz\/our-work\/diseases-and-conditions\/covid-19-novel-coronavirus","component":"url","negate":false,"match_operation":"starts_with"},{"rule_type":null,"name":null,"pattern":"https:\/\/web.archive.org\/web\/20200415170500\/https:\/\/www.health.govt.nz\/our-work\/diseases-and-conditions\/covid-19-novel-coronavirus\/covid-19-resources-health-professionals","component":"url","negate":true,"match_operation":"starts_with"}],"language":"en","created_epoch_time":1585254650,"targeting_percentage":100,"display_condition":"delay","display_delay":15,"content":{"thankyou":"Thanks \u2013 your feedback is appreciated","questions":[{"uuid":"c577d4c7-1adc-4abd-9ecf-6f55216d470f","text":"Did this page provide the information you were looking for?","required":true,"answers":[{"text":"Yes","comments":false},{"text":"No (tell us why not)","comments":true}],"next":"byOrder","type":"single-close-ended","randomize_answer_order":true}]},"question_signatures":{"c577d4c7-1adc-4abd-9ecf-6f55216d470f":"vVieMuUe0DrDZDx1Ll1BzR4zeAw"},"effective_show_branding":false,"ask_for_consent":false,"background":"#333333","skin":"dark","position":"right","show_legal":true,"id":491782}],"user_attributes_enabled":false,"record":false,"r":0.5623031939,"suppress_all":false,"anonymize_emails":true}; !function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=223)}({223:function(e,t){window.hjBootstrap=window.hjBootstrap||function(e,t,n){var o=window.navigator||{userAgent:"unknown"},r=o.userAgent?o.userAgent:"unknown";if(/bot|headless|google|baidu|bing|msn|duckduckbot|teoma|slurp|yandex|phantomjs|ahrefsbot/i.test(r))console.warn("Hotjar not launching due to suspicious userAgent:",r);else{var a=function(e,t,n){window.hjBootstrapCalled=(window.hjBootstrapCalled||[]).concat(n),window.hj&&window.hj._init&&window.hj._init._verifyInstallation&&hj._init._verifyInstallation()};a(0,0,n);var i,s,d,u,l=window.document,c=l.head||l.getElementsByTagName("head")[0];l.addEventListener&&(hj.scriptDomain=e,(i=l.createElement("script")).async=1,i.src=hj.scriptDomain+t,i.charset="utf-8",c.appendChild(i),u=["iframe#_hjRemoteVarsFrame {","display: none !important; width: 1px !important; height: 1px !important; opacity: 0 !important; pointer-events: none !important;","}"],(s=l.createElement("style")).type="text/css",s.styleSheet?s.styleSheet.cssText=u.join(""):s.appendChild(l.createTextNode(u.join(""))),c.appendChild(s),(d=l.createElement("iframe")).style.cssText=u[1],d.name="_hjRemoteVarsFrame",d.title="_hjRemoteVarsFrame",d.id="_hjRemoteVarsFrame",d.src="https://"+(window._hjSettings.varsHost||"vars.hotjar.com")+"/box-469cf41adb11dc78be68c1ae7f9457a4.html",d.onload=function(){a.varsLoaded=!0,"undefined"!=typeof hj&&hj.event&&hj.event.signal("varsLoaded")},a.varsJar=d,"interactive"===l.readyState||"complete"===l.readyState||"loaded"===l.readyState?p():l.addEventListener("DOMContentLoaded",p),a.revision="53177281e76193fe80e1b5f61b400a5e90debaa8",window.hjBootstrap=a)}function p(){setTimeout(function(){l.body.appendChild(d)},50)}},window.hjBootstrap("https://web.archive.org/web/20200415170500/https://script.hotjar.com/","modules.17c272f546b25eb77ecc.js","930919")}}); //# sourceMappingURL=hotjar.js.map /* FILE ARCHIVED ON 17:05:00 Apr 15, 2020 AND RETRIEVED FROM THE INTERNET ARCHIVE ON 02:11:09 May 11, 2020. JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE. ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C. SECTION 108(a)(3)). */ /* playback timings (ms): RedisCDXSource: 47.014 PetaboxLoader3.resolve: 219.82 (2) PetaboxLoader3.datanode: 79.714 (4) esindex: 0.01 captures_list: 1219.328 exclusion.robots: 78.284 load_resource: 192.001 CDXLines.iter: 16.16 (3) exclusion.robots.policy: 77.984 LoadShardBlock: 991.291 (3) xauthn.chkprivs: 0.034 xauthn.identify: 77.472 */
// Template by http://github.com/jackdougherty/leaflet-map/ // See Leaflet tutorial links in README.md // set up the map center and zoom level var map = L.map('map', { center: [31.15, -26.33], // [41.5, -72.7] for Connecticut; [41.76, -72.67] for Hartford county or city zoom: 13, // zoom 9 for Connecticut; 10 for Hartford county, 12 for Hartford city zoomControl: false, // add later to reposition scrollWheelZoom: false }); // optional : customize link to view source code; add your own GitHub repository map.attributionControl .setPrefix('View <a href="http://github.com/jackdougherty/leaflet-map">code on GitHub</a>, created with <a href="http://leafletjs.com" title="A JS library for interactive maps">Leaflet</a>'); // Get your own free Mapzen search API key and see geocoder options at https://github.com/mapzen/leaflet-geocoder L.control.geocoder('search-jBPBt5y').addTo(map); L.control.scale().addTo(map); // Reposition zoom control other than default topleft L.control.zoom({position: "topright"}).addTo(map); // optional: add legend to toggle any baselayers and/or overlays // global variable with (null, null) allows indiv layers to be added inside functions below var controlLayers = L.control.layers( null, null, { position: "bottomright", // suggested: bottomright for CT (in Long Island Sound); topleft for Hartford region collapsed: false // false = open by default }).addTo(map); // REMOVE AFTER MAP CONSTRUCTION: optional Zoom Label (also in index.html) L.control.zoomLabel().addTo(map); // REMOVE AFTER MAP CONSTRUCTION: optional Coordinate Control (also in index.html) var c = new L.Control.Coordinates(); c.addTo(map); map.on('click', function(e) { c.setCoordinates(e); }); /* BASELAYERS */ // use common baselayers below, delete, or add more with plain JavaScript from http://leaflet-extras.github.io/leaflet-providers/preview/ // .addTo(map); -- suffix displays baselayer by default // controlLayers.addBaseLayer (variableName, 'label'); -- adds baselayer and label to legend; omit if only one baselayer with no toggle desired var lightAll = new L.tileLayer('https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png', { attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, &copy; <a href="http://cartodb.com/attributions">CartoDB</a>' }).addTo(map); // adds layer by default controlLayers.addBaseLayer(lightAll, 'CartoDB LightAll'); var lightNoLabels = new L.tileLayer('https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_nolabels/{z}/{x}/{y}.png', { attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, &copy; <a href="http://cartodb.com/attributions">CartoDB</a>' }); controlLayers.addBaseLayer(lightNoLabels, 'CartoDB Light no labels'); var darkAll = new L.tileLayer('https://cartodb-basemaps-{s}.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png', { attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, &copy; <a href="http://cartodb.com/attributions">CartoDB</a>' }); controlLayers.addBaseLayer(darkAll, 'CartoDB DarkAll'); var darkNoLabels = new L.tileLayer('https://cartodb-basemaps-{s}.global.ssl.fastly.net/dark_nolabels/{z}/{x}/{y}.png', { attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, &copy; <a href="http://cartodb.com/attributions">CartoDB</a>' }); controlLayers.addBaseLayer(darkNoLabels, 'CartoDB Dark no labels'); // Esri satellite map from http://leaflet-extras.github.io/leaflet-providers/preview/ // OR use esri-leaflet plugin and esri basemap name https://esri.github.io/esri-leaflet/examples/switching-basemaps.html var Esri_WorldImagery = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', { attribution: 'Tiles &copy; Esri &mdash; Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community' }); controlLayers.addBaseLayer(Esri_WorldImagery, 'Esri World Imagery'); // tileLayer.WMS as a baselayer - see http://leafletjs.com/reference.html#tilelayer-wms // UConn MAGIC WMS settings (currently http, not https) - see http://geoserver.lib.uconn.edu:8080/geoserver/web/?wicket:bookmarkablePage=:org.geoserver.web.demo.MapPreviewPage var aerial1934 = new L.tileLayer.wms("http://geoserver.lib.uconn.edu:8080/geoserver/MAGIC/wms?", { layers: 'MAGIC:1934 Connecticut Aerial Photography', attribution: '1934 <a href="http://magic.library.uconn.edu">MAGIC UConn</a> and <a href="http://cslib.org">CSL</a>' }); controlLayers.addBaseLayer(aerial1934, 'CT Aerial 1934'); // tileLayer.WMS as a baselayer - see http://leafletjs.com/reference.html#tilelayer-wms // UConn MAGIC WMS settings (currently http, not https) - see http://geoserver.lib.uconn.edu:8080/geoserver/web/?wicket:bookmarkablePage=:org.geoserver.web.demo.MapPreviewPage var hartfordCounty1855 = new L.tileLayer.wms("http://geoserver.lib.uconn.edu:8080/geoserver/MAGIC/wms?", { layers: 'MAGIC:HartfordCounty_Woodford_1855', attribution: '1855 <a href="http://magic.library.uconn.edu">MAGIC UConn</a>' }); controlLayers.addBaseLayer(hartfordCounty1855, 'Hartford County 1855'); var map1842wms = new L.tileLayer.wms("http://maps.nypl.org/warper/maps/wms/7363?", { attribution: '1842 <a href="http://maps.nypl.org/warper/">NYPL Map Warper</a>' }); controlLayers.addBaseLayer(map1842wms, '1842 NYPL WMS'); var map1842tile = new L.tileLayer("http://mapwarper.net/maps/tile/14781/{z}/{x}/{y}.png", { attribution: '1842 <a href="http://maps.nypl.org/warper/">NYPL Map Warper</a>' }); controlLayers.addBaseLayer(map1842tile, '1842 NYPL Tile'); /* POINT OVERLAYS */ // ways to load point map data from different sources: coordinates in the code, GeoJSON in local directory, remote GeoJSON and JSON // load one point from coordinates in code, icon from local directory, no interactive legend button // places a star on state capital of Hartford, CT // * TO DO: test whether placement of this code affects its display order, on top of other icons? var starIcon = L.icon({ iconUrl: 'src/star-18.png', iconRetinaUrl: 'src/star-18@2x.png', iconSize: [18, 18] }); L.marker([41.7646, -72.6823], {icon: starIcon}).addTo(map); // load point geojson data from local directory, using jQuery function (symbolized by $) // modify icon source and styling // modify pointToLayer marker bindPopup function to display GeoJSON data in info window // option to insert '.addTo(map)' to display layer by default // insert controlLayers.addOverlay(geoJsonLayer, 'InsertYourTitle') to add to legend // load GeoJSON point data and clickable circles from local directory $.getJSON("src/points.geojson", function (data){ var geoJsonLayer = L.geoJson(data, { pointToLayer: function( feature, latlng) { var circle = L.circleMarker(latlng, { radius: 8, fillColor: "#ccccff", color: "#0000cc", weight: 2, opacity: 1, fillOpacity: 0.7 }); circle.bindPopup(feature.properties.Location); // replace 'Location' with properties data label from your GeoJSON file return circle; } }); // insert ".addTo(map)" to display layer by default controlLayers.addOverlay(geoJsonLayer, 'Circles'); }); // load GeoJSON point data and clickable icons from local directory, using jQuery function (symbolized by $) $.getJSON("src/points.geojson", function (data){ var iconStyle = L.icon({ iconUrl: "src/hospital-18.png", iconRetinaUrl: 'src/hospital-18@2x.png', iconSize: [18, 18] }); var geoJsonLayer = L.geoJson(data, { pointToLayer: function( feature, latlng) { var marker = L.marker(latlng,{icon: iconStyle}); marker.bindPopup(feature.properties.Location); // replace 'Location' with properties data label from your GeoJSON file return marker; } }); // insert ".addTo(map)" to display layer by default controlLayers.addOverlay(geoJsonLayer, 'Hospitals'); }); // Flickr photo overlay from remote JSON API feed, such as all Flickr public photos OR only from your account // Obtain and insert your own flickr API key // https://www.flickr.com/services/apps/create/ // Use Flickr API explorer to obtain correct endpoint // https://www.flickr.com/services/api/explore/?method=flickr.photos.search // Example shows photos.search of georeferenced images using keyword tags // https://www.flickr.com/services/api/explore/flickr.photos.search // Define flickrURL endpoint with API explorer: insert your key, and tags= or text= to filter results var flickrURL = "https://api.flickr.com/services/rest/?method=flickr.photos.search&api_key=25dcc9a8c7410551dcb0af48c778bde5&user_id=56513965%40N06&tags=bikemap&extras=geo%2Curl_t%2Curl_s%2Curl_m%2Ctitle&format=json&nojsoncallback=1"; // Define the flickr popup display // ** TO DO: Rewrite link to view original source photo directly on Flickr // ** POSSIBLY include this code directly in the functions below for easier sequencing by novices var popupHTML = function(photo){ var result = ""; result = '<strong>'+photo.title+'</strong><br>'; result += '<a href="'+photo.url_m+'" target="_blank">'; result += '<img src="'+photo.url_s+'"></a>'; //was url_t; want url_s; can change to url_m if desired, but frame needs work result += '<br/><small>click image to enlarge in new tab</small>'; return result; } // Load photos from flickr JSON feed (insert your flickrURL above), display with clickable blue markers $.getJSON(flickrURL, function (data) { // Create new layerGroup for the markers, with option to append ".addTo(map);" to display by default var layerGroup = new L.LayerGroup(); // Add layerGroup to your layer control and insert your label to appear in legend controlLayers.addOverlay(layerGroup, 'Flickr photo blue markers'); // Insert your own legend label // Start a loop to insert flickr photo data into photoContent for (var i = 0; i < data.photos.photo.length; i++) { var photoContent = data.photos.photo[i]; var marker = new L.marker([photoContent.latitude, photoContent.longitude]); marker.bindPopup(popupHTML(photoContent)); // Add the marker to the layerGroup marker.addTo(layerGroup); } }); // Load photos from flickr JSON (insert your flickrURL above), display with clickable photo thumbnails $.getJSON(flickrURL, function (data) { // Create new layerGroup for the markers, with option to append ".addTo(map);" to display by default var layerGroup = new L.LayerGroup().addTo(map); // Add layerGroup to your layer control and insert your label to appear in legend controlLayers.addOverlay(layerGroup, 'Flickr photo thumbnail icons'); // Start a loop to insert flickr photo data into photoContent for (var i = 0; i < data.photos.photo.length; i++) { var photoContent = data.photos.photo[i]; var photoIcon = L.icon( {iconUrl: photoContent.url_t, iconSize: [photoContent.width_t * 0.5, photoContent.height_t * 0.5]} //reduces thumbnails 50% ); var marker = new L.marker([photoContent.latitude, photoContent.longitude], {icon: photoIcon}); marker.bindPopup(popupHTML(photoContent)); // Add the marker to the layerGroup marker.addTo(layerGroup); } }); /* POLYGON and POLYLINE OVERLAYS */ // Ways to load geoJSON polygon layers from local directory or remote server // Different options for styling and interactivity $.getJSON("src/lines.geojson", function (data){ var geoJsonLayer = L.geoJson(data, { style: function (feature) { return { 'color': 'green', 'weight': 4, } }, onEachFeature: function( feature, layer) { layer.bindPopup(feature.properties.name) // change to match your geojson property labels } }); // insert ".addTo(map)" to display layer by default controlLayers.addOverlay(geoJsonLayer, 'Lines'); // insert your 'Title' to add to legend }); $.getJSON("src/parks.geojson", function (data){ var geoJsonLayer = L.geoJson(data, { style: function (feature) { return { 'color': 'purple', 'weight': 2, } }, onEachFeature: function( feature, layer) { layer.bindPopup(feature.properties.PARK_NAME) // change to match your geojson property labels } }); // insert ".addTo(map)" to display layer by default controlLayers.addOverlay(geoJsonLayer, 'Parks'); // insert your 'Title' to add to legend }); // load GeoJSON polyline data $.getJSON("src/bus-routes.geojson", function (data){ var geoJsonLayer = L.geoJson(data, { style: function (feature) { return { 'color': 'red', 'weight': 2, } }, onEachFeature: function( feature, layer) { layer.bindPopup(feature.properties.LineName) // change to match your geojson property labels } }); // insert ".addTo(map)" to display layer by default controlLayers.addOverlay(geoJsonLayer, 'Bus Routes'); // insert your 'Title' to add to legend }); // load polygon data with clickable features from local directory $.getJSON("src/polygons.geojson", function (data) { // insert pathname to your local directory file var geoJsonLayer = L.geoJson(data, { style: function (feature) { return { 'color': 'red', 'weight': 2, 'fillColor': '#fff', 'fillOpacity': 0 } }, onEachFeature: function( feature, layer) { layer.bindPopup(feature.properties.Town) // change 'Town' to match your geojson property labels } }).addTo(map); // insert ".addTo(map)" to display layer by default controlLayers.addOverlay(geoJsonLayer, 'Polygons (CT towns)'); // insert your 'Title' to add to legend }); // load polygon geojson, using data to define fillColor, from local directory // *TO DO* rebuild file for pop density // *TO DO* change from click to hover, and add legend to display colors and hover data $.getJSON("src/polygons.geojson", function (data) { // insert pathname to your local directory file var geoJsonLayer = L.geoJson(data, { style: function (feature) { var fillColor, population = feature.properties.Pop2010; if (population > 100000) fillColor = "#006837"; else if (population > 50000) fillColor ="#31a354"; else if (population > 15000) fillColor ="#78c679"; else if (population > 5000) fillColor ="#c2e699"; else if (population > 0) fillColor ="#ffffcc"; else fillColor = "#f7f7f7"; // no data return { 'color': 'red', 'weight': 2, 'fillColor': fillColor, // sorts by method above 'fillOpacity': 0.8 } }, onEachFeature: function( feature, layer) { var popupText = "<b>" + feature.properties.Town + "</b>" // replace labels with those from your own geojson + "<br>Population 2010: " + "<br>" + feature.properties.Pop2010; layer.bindPopup(popupText); } }); // insert ".addTo(map)" to display layer by default controlLayers.addOverlay(geoJsonLayer, 'Polygons filled (CT Pop 2010)'); // insert your 'Title' to add to legend });
import produce from 'immer'; export const initialState = {}; /* eslint-disable no-param-reassign */ const About = (state = initialState, action) => produce(state, (draft) => { switch (action.type) { default: break; } }); export default About;
const gulp = require('gulp') const plugins = require('gulp-load-plugins')() const $ = plugins.configly(__dirname, 'package.json') gulp.task('build', ['build:js', 'build:json']) gulp.task('build:js', () => { return gulp.src($.sources.js) .pipe(plugins.sourcemaps.init()) .pipe(plugins.debug($.debug.js)) .pipe(plugins.babel($.plugins.babel)) .pipe(plugins.sourcemaps.write()) .pipe(gulp.dest($.destination.lib)) }) gulp.task('build:json', () => { return gulp.src($.sources.json) .pipe(plugins.debug($.debug.json)) .pipe(gulp.dest($.destination.lib)) }) gulp.task('clean', () => { return gulp.src($.sources.clean) .pipe(plugins.debug()) .pipe(plugins.clean()) }) gulp.task('test', ['build'], () => { return gulp.src($.sources.tests) .pipe(plugins.mocha($.plugins.mocha)) }) gulp.task('default', ['build'])
export const c_modal_box = { ".pf-c-modal-box": { "c_modal_box_BackgroundColor": { "name": "--pf-c-modal-box--BackgroundColor", "value": "#fff", "values": [ "--pf-global--BackgroundColor--100", "$pf-global--BackgroundColor--100", "$pf-color-white", "#fff" ] }, "c_modal_box_BoxShadow": { "name": "--pf-c-modal-box--BoxShadow", "value": "0 1rem 2rem 0 rgba(3, 3, 3, 0.16), 0 0 0.5rem 0 rgba(3, 3, 3, 0.1)", "values": [ "--pf-global--BoxShadow--xl", "$pf-global--BoxShadow--xl", "0 pf-size-prem(16px) pf-size-prem(32px) 0 rgba($pf-color-black-1000, .16), 0 0 pf-size-prem(8px) 0 rgba($pf-color-black-1000, .1)", "0 pf-size-prem(16px) pf-size-prem(32px) 0 rgba(#030303, .16), 0 0 pf-size-prem(8px) 0 rgba(#030303, .1)", "0 1rem 2rem 0 rgba(3, 3, 3, 0.16), 0 0 0.5rem 0 rgba(3, 3, 3, 0.1)" ] }, "c_modal_box_ZIndex": { "name": "--pf-c-modal-box--ZIndex", "value": "500", "values": [ "--pf-global--ZIndex--xl", "$pf-global--ZIndex--xl", "500" ] }, "c_modal_box_Width": { "name": "--pf-c-modal-box--Width", "value": "100%" }, "c_modal_box_MaxWidth": { "name": "--pf-c-modal-box--MaxWidth", "value": "calc(100% - 2rem)", "values": [ "calc(100% - --pf-global--spacer--xl)", "calc(100% - $pf-global--spacer--xl)", "calc(100% - pf-size-prem(32px))", "calc(100% - 2rem)" ] }, "c_modal_box_m_sm_sm_MaxWidth": { "name": "--pf-c-modal-box--m-sm--sm--MaxWidth", "value": "35rem" }, "c_modal_box_m_md_Width": { "name": "--pf-c-modal-box--m-md--Width", "value": "52.5rem" }, "c_modal_box_m_lg_lg_MaxWidth": { "name": "--pf-c-modal-box--m-lg--lg--MaxWidth", "value": "70rem" }, "c_modal_box_MaxHeight": { "name": "--pf-c-modal-box--MaxHeight", "value": "calc(100% - 3rem)", "values": [ "calc(100% - --pf-global--spacer--2xl)", "calc(100% - $pf-global--spacer--2xl)", "calc(100% - pf-size-prem(48px))", "calc(100% - 3rem)" ] }, "c_modal_box_m_align_top_spacer": { "name": "--pf-c-modal-box--m-align-top--spacer", "value": "0.5rem", "values": [ "--pf-global--spacer--sm", "$pf-global--spacer--sm", "pf-size-prem(8px)", "0.5rem" ] }, "c_modal_box_m_align_top_xl_spacer": { "name": "--pf-c-modal-box--m-align-top--xl--spacer", "value": "2rem", "values": [ "--pf-global--spacer--xl", "$pf-global--spacer--xl", "pf-size-prem(32px)", "2rem" ] }, "c_modal_box_m_align_top_MarginTop": { "name": "--pf-c-modal-box--m-align-top--MarginTop", "value": "0.5rem", "values": [ "--pf-c-modal-box--m-align-top--spacer", "--pf-global--spacer--sm", "$pf-global--spacer--sm", "pf-size-prem(8px)", "0.5rem" ] }, "c_modal_box_m_align_top_MaxHeight": { "name": "--pf-c-modal-box--m-align-top--MaxHeight", "value": "calc(100% - min(0.5rem, 3rem) - 0.5rem)", "values": [ "calc(100% - min(--pf-c-modal-box--m-align-top--spacer, --pf-global--spacer--2xl) - --pf-c-modal-box--m-align-top--spacer)", "calc(100% - min(--pf-global--spacer--sm, $pf-global--spacer--2xl) - --pf-global--spacer--sm)", "calc(100% - min($pf-global--spacer--sm, $pf-global--spacer--2xl) - $pf-global--spacer--sm)", "calc(100% - min(pf-size-prem(8px), pf-size-prem(48px)) - pf-size-prem(8px))", "calc(100% - min(0.5rem, 3rem) - 0.5rem)" ] }, "c_modal_box_m_align_top_MaxWidth": { "name": "--pf-c-modal-box--m-align-top--MaxWidth", "value": "calc(100% - min(0.5rem * 2, 2rem))", "values": [ "calc(100% - min(--pf-c-modal-box--m-align-top--spacer * 2, --pf-global--spacer--xl))", "calc(100% - min(--pf-global--spacer--sm * 2, $pf-global--spacer--xl))", "calc(100% - min($pf-global--spacer--sm * 2, $pf-global--spacer--xl))", "calc(100% - min(pf-size-prem(8px) * 2, pf-size-prem(32px)))", "calc(100% - min(0.5rem * 2, 2rem))" ] }, "c_modal_box_m_danger__title_icon_Color": { "name": "--pf-c-modal-box--m-danger__title-icon--Color", "value": "#c9190b", "values": [ "--pf-global--danger-color--100", "$pf-global--danger-color--100", "$pf-color-red-100", "#c9190b" ] }, "c_modal_box_m_warning__title_icon_Color": { "name": "--pf-c-modal-box--m-warning__title-icon--Color", "value": "#f0ab00", "values": [ "--pf-global--warning-color--100", "$pf-global--warning-color--100", "$pf-color-gold-400", "#f0ab00" ] }, "c_modal_box_m_success__title_icon_Color": { "name": "--pf-c-modal-box--m-success__title-icon--Color", "value": "#3e8635", "values": [ "--pf-global--success-color--100", "$pf-global--success-color--100", "$pf-color-green-500", "#3e8635" ] }, "c_modal_box_m_info__title_icon_Color": { "name": "--pf-c-modal-box--m-info__title-icon--Color", "value": "#2b9af3", "values": [ "--pf-global--info-color--100", "$pf-global--info-color--100", "$pf-color-blue-300", "#2b9af3" ] }, "c_modal_box_m_default__title_icon_Color": { "name": "--pf-c-modal-box--m-default__title-icon--Color", "value": "#009596", "values": [ "--pf-global--default-color--200", "$pf-global--default-color--200", "$pf-color-cyan-300", "#009596" ] }, "c_modal_box__header_PaddingTop": { "name": "--pf-c-modal-box__header--PaddingTop", "value": "1.5rem", "values": [ "--pf-global--spacer--lg", "$pf-global--spacer--lg", "pf-size-prem(24px)", "1.5rem" ] }, "c_modal_box__header_PaddingRight": { "name": "--pf-c-modal-box__header--PaddingRight", "value": "1.5rem", "values": [ "--pf-global--spacer--lg", "$pf-global--spacer--lg", "pf-size-prem(24px)", "1.5rem" ] }, "c_modal_box__header_PaddingLeft": { "name": "--pf-c-modal-box__header--PaddingLeft", "value": "1.5rem", "values": [ "--pf-global--spacer--lg", "$pf-global--spacer--lg", "pf-size-prem(24px)", "1.5rem" ] }, "c_modal_box__header_last_child_PaddingBottom": { "name": "--pf-c-modal-box__header--last-child--PaddingBottom", "value": "1.5rem", "values": [ "--pf-global--spacer--lg", "$pf-global--spacer--lg", "pf-size-prem(24px)", "1.5rem" ] }, "c_modal_box__title_LineHeight": { "name": "--pf-c-modal-box__title--LineHeight", "value": "1.3", "values": [ "--pf-global--LineHeight--sm", "$pf-global--LineHeight--sm", "1.3" ] }, "c_modal_box__title_FontFamily": { "name": "--pf-c-modal-box__title--FontFamily", "value": "'\"RedHatDisplay\", \"Overpass\", overpass, helvetica, arial, sans-serif'", "values": [ "--pf-global--FontFamily--heading--sans-serif", "$pf-global--FontFamily--heading--sans-serif", "'\"RedHatDisplay\", \"Overpass\", overpass, helvetica, arial, sans-serif'" ] }, "c_modal_box__title_FontSize": { "name": "--pf-c-modal-box__title--FontSize", "value": "1.5rem", "values": [ "--pf-global--FontSize--2xl", "$pf-global--FontSize--2xl", "pf-font-prem(24px)", "1.5rem" ] }, "c_modal_box__title_icon_MarginRight": { "name": "--pf-c-modal-box__title-icon--MarginRight", "value": "0.5rem", "values": [ "--pf-global--spacer--sm", "$pf-global--spacer--sm", "pf-size-prem(8px)", "0.5rem" ] }, "c_modal_box__title_icon_Color": { "name": "--pf-c-modal-box__title-icon--Color", "value": "#151515", "values": [ "--pf-global--Color--100", "$pf-global--Color--100", "$pf-color-black-900", "#151515" ] }, "c_modal_box__description_PaddingTop": { "name": "--pf-c-modal-box__description--PaddingTop", "value": "0.25rem", "values": [ "--pf-global--spacer--xs", "$pf-global--spacer--xs", "pf-size-prem(4px)", "0.25rem" ] }, "c_modal_box__body_MinHeight": { "name": "--pf-c-modal-box__body--MinHeight", "value": "calc(1rem * 1.5)", "values": [ "calc(--pf-global--FontSize--md * --pf-global--LineHeight--md)", "calc($pf-global--FontSize--md * $pf-global--LineHeight--md)", "calc(pf-font-prem(16px) * 1.5)", "calc(1rem * 1.5)" ] }, "c_modal_box__body_PaddingTop": { "name": "--pf-c-modal-box__body--PaddingTop", "value": "1.5rem", "values": [ "--pf-global--spacer--lg", "$pf-global--spacer--lg", "pf-size-prem(24px)", "1.5rem" ] }, "c_modal_box__body_PaddingRight": { "name": "--pf-c-modal-box__body--PaddingRight", "value": "1.5rem", "values": [ "--pf-global--spacer--lg", "$pf-global--spacer--lg", "pf-size-prem(24px)", "1.5rem" ] }, "c_modal_box__body_PaddingLeft": { "name": "--pf-c-modal-box__body--PaddingLeft", "value": "1.5rem", "values": [ "--pf-global--spacer--lg", "$pf-global--spacer--lg", "pf-size-prem(24px)", "1.5rem" ] }, "c_modal_box__body_last_child_PaddingBottom": { "name": "--pf-c-modal-box__body--last-child--PaddingBottom", "value": "1.5rem", "values": [ "--pf-global--spacer--lg", "$pf-global--spacer--lg", "pf-size-prem(24px)", "1.5rem" ] }, "c_modal_box__header_body_PaddingTop": { "name": "--pf-c-modal-box__header--body--PaddingTop", "value": "1rem", "values": [ "--pf-global--spacer--md", "$pf-global--spacer--md", "pf-size-prem(16px)", "1rem" ] }, "c_modal_box_c_button_Top": { "name": "--pf-c-modal-box--c-button--Top", "value": "calc(1.5rem)", "values": [ "calc(--pf-global--spacer--lg)", "calc($pf-global--spacer--lg)", "calc(pf-size-prem(24px))", "calc(1.5rem)" ] }, "c_modal_box_c_button_Right": { "name": "--pf-c-modal-box--c-button--Right", "value": "1rem", "values": [ "--pf-global--spacer--md", "$pf-global--spacer--md", "pf-size-prem(16px)", "1rem" ] }, "c_modal_box_c_button_sibling_MarginRight": { "name": "--pf-c-modal-box--c-button--sibling--MarginRight", "value": "calc(2rem + 0.5rem)", "values": [ "calc(--pf-global--spacer--xl + --pf-global--spacer--sm)", "calc($pf-global--spacer--xl + $pf-global--spacer--sm)", "calc(pf-size-prem(32px) + pf-size-prem(8px))", "calc(2rem + 0.5rem)" ] }, "c_modal_box__footer_PaddingTop": { "name": "--pf-c-modal-box__footer--PaddingTop", "value": "1.5rem", "values": [ "--pf-global--spacer--lg", "$pf-global--spacer--lg", "pf-size-prem(24px)", "1.5rem" ] }, "c_modal_box__footer_PaddingRight": { "name": "--pf-c-modal-box__footer--PaddingRight", "value": "1.5rem", "values": [ "--pf-global--spacer--lg", "$pf-global--spacer--lg", "pf-size-prem(24px)", "1.5rem" ] }, "c_modal_box__footer_PaddingBottom": { "name": "--pf-c-modal-box__footer--PaddingBottom", "value": "1.5rem", "values": [ "--pf-global--spacer--lg", "$pf-global--spacer--lg", "pf-size-prem(24px)", "1.5rem" ] }, "c_modal_box__footer_PaddingLeft": { "name": "--pf-c-modal-box__footer--PaddingLeft", "value": "1.5rem", "values": [ "--pf-global--spacer--lg", "$pf-global--spacer--lg", "pf-size-prem(24px)", "1.5rem" ] }, "c_modal_box__footer_c_button_MarginRight": { "name": "--pf-c-modal-box__footer--c-button--MarginRight", "value": "1rem", "values": [ "--pf-global--spacer--md", "$pf-global--spacer--md", "pf-size-prem(16px)", "1rem" ] }, "c_modal_box__footer_c_button_sm_MarginRight": { "name": "--pf-c-modal-box__footer--c-button--sm--MarginRight", "value": "calc(1rem / 2)", "values": [ "calc(--pf-c-modal-box__footer--c-button--MarginRight / 2)", "calc(--pf-global--spacer--md / 2)", "calc($pf-global--spacer--md / 2)", "calc(pf-size-prem(16px) / 2)", "calc(1rem / 2)" ] } }, ".pf-c-modal-box.pf-m-sm": { "c_modal_box_Width": { "name": "--pf-c-modal-box--Width", "value": "35rem", "values": [ "--pf-c-modal-box--m-sm--sm--MaxWidth", "35rem" ] } }, ".pf-c-modal-box.pf-m-md": { "c_modal_box_Width": { "name": "--pf-c-modal-box--Width", "value": "52.5rem", "values": [ "--pf-c-modal-box--m-md--Width", "52.5rem" ] } }, ".pf-c-modal-box.pf-m-lg": { "c_modal_box_Width": { "name": "--pf-c-modal-box--Width", "value": "70rem", "values": [ "--pf-c-modal-box--m-lg--lg--MaxWidth", "70rem" ] } }, ".pf-c-modal-box.pf-m-danger": { "c_modal_box__title_icon_Color": { "name": "--pf-c-modal-box__title-icon--Color", "value": "#c9190b", "values": [ "--pf-c-modal-box--m-danger__title-icon--Color", "--pf-global--danger-color--100", "$pf-global--danger-color--100", "$pf-color-red-100", "#c9190b" ] } }, ".pf-c-modal-box.pf-m-warning": { "c_modal_box__title_icon_Color": { "name": "--pf-c-modal-box__title-icon--Color", "value": "#f0ab00", "values": [ "--pf-c-modal-box--m-warning__title-icon--Color", "--pf-global--warning-color--100", "$pf-global--warning-color--100", "$pf-color-gold-400", "#f0ab00" ] } }, ".pf-c-modal-box.pf-m-success": { "c_modal_box__title_icon_Color": { "name": "--pf-c-modal-box__title-icon--Color", "value": "#3e8635", "values": [ "--pf-c-modal-box--m-success__title-icon--Color", "--pf-global--success-color--100", "$pf-global--success-color--100", "$pf-color-green-500", "#3e8635" ] } }, ".pf-c-modal-box.pf-m-default": { "c_modal_box__title_icon_Color": { "name": "--pf-c-modal-box__title-icon--Color", "value": "#009596", "values": [ "--pf-c-modal-box--m-default__title-icon--Color", "--pf-global--default-color--200", "$pf-global--default-color--200", "$pf-color-cyan-300", "#009596" ] } }, ".pf-c-modal-box.pf-m-info": { "c_modal_box__title_icon_Color": { "name": "--pf-c-modal-box__title-icon--Color", "value": "#2b9af3", "values": [ "--pf-c-modal-box--m-info__title-icon--Color", "--pf-global--info-color--100", "$pf-global--info-color--100", "$pf-color-blue-300", "#2b9af3" ] } }, ".pf-c-modal-box__header + .pf-c-modal-box__body": { "c_modal_box__body_PaddingTop": { "name": "--pf-c-modal-box__body--PaddingTop", "value": "1rem", "values": [ "--pf-c-modal-box__header--body--PaddingTop", "--pf-global--spacer--md", "$pf-global--spacer--md", "pf-size-prem(16px)", "1rem" ] } } }; export default c_modal_box;
import vector from './utils/vector' import matrix, { R } from './utils/matrix' // x_d = x_c - t_d export const fromDocumentToContainer = ({ container_document }, vector_document) => ( vector.sub(vector_document, container_document) ) // x_c = x_d + t_d export const fromContainerToDocument = ({ container_document }, vector_container) => ( vector.add(vector_container, container_document) ) // x_c = z*R*x_w + t_c export const fromWorldToContainer = ({ scale, theta, world_container }, vector_world) => ( vector.add( vector.scale(scale, matrix.product(R(theta), vector_world)), world_container ) ) // x_w = 1/z*(R^-1)(x_c - t_c) export const fromContainerToWorld = ({ scale, theta, world_container }, vector_container) => ( vector.scale( 1 / scale, matrix.product( R(-theta), vector.sub(vector_container, world_container) ) ) ) export const fromWorldToDocument = (state, vector_world) => { const vector_container = fromWorldToContainer(state, vector_world); return fromContainerToDocument(state, vector_container); } export const fromDocumentToWorld = (state, vector_document) => { const vector_container = fromDocumentToContainer(state, vector_document); return fromContainerToWorld(state, vector_container); }
/* -------------------------------------------------------------------------- */ /* Copyright 2002-2020, OpenNebula Project, OpenNebula Systems */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); you may */ /* not use this file except in compliance with the License. You may obtain */ /* a copy of the License at */ /* */ /* http://www.apache.org/licenses/LICENSE-2.0 */ /* */ /* Unless required by applicable law or agreed to in writing, software */ /* distributed under the License is distributed on an "AS IS" BASIS, */ /* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ /* See the License for the specific language governing permissions and */ /* limitations under the License. */ /* -------------------------------------------------------------------------- */ define(function(require) { var Locale = require('utils/locale'); var Buttons = require('./datastores-tab/buttons'); var Actions = require('./datastores-tab/actions'); var Table = require('./datastores-tab/datatable'); var TAB_ID = require('./datastores-tab/tabId'); var DATATABLE_ID = "dataTableDatastores"; var _dialogs = [ ]; var _formPanels = [ require('./datastores-tab/form-panels/create'), require('./datastores-tab/form-panels/import') ]; var _panels = [ require('./datastores-tab/panels/info'), require('./datastores-tab/panels/images'), require('./datastores-tab/panels/clusters') ]; var _panelsHooks = [ require('../utils/hooks/header') ]; var DatastoresTab = { tabId: TAB_ID, title: Locale.tr("Datastores"), icon: 'fa-folder-open', tabClass: "subTab", parentTab: "storage-top-tab", listHeader: Locale.tr("Datastores"), infoHeader: Locale.tr("Datastore"), lockable: false, subheader: '<span class="total_ds"/> <small>'+Locale.tr("TOTAL")+'</small>&emsp;\ <span class="total_on"/> <small>'+Locale.tr("ON")+'</small>&emsp;\ <span class="total_off"/> <small>'+Locale.tr("OFF")+'</small>', resource: 'Datastore', buttons: Buttons, actions: Actions, dataTable: new Table(DATATABLE_ID, {actions: true, info: true}), panels: _panels, panelsHooks: _panelsHooks, formPanels: _formPanels, dialogs: _dialogs }; return DatastoresTab; });
import { expect } from 'chai' import { mapType, toGraphQL } from '../../src/typeMapper' import JSONType from '../../src/types/jsonType' import DateType from '../../src/types/dateType' import Sequelize from 'sequelize' const { BOOLEAN, ENUM, FLOAT, REAL, CHAR, DECIMAL, DOUBLE, INTEGER, BIGINT, STRING, TEXT, UUID, UUIDV4, DATE, DATEONLY, TIME, ARRAY, VIRTUAL, JSON, JSONB, } = Sequelize import { GraphQLString, GraphQLInt, GraphQLBoolean, GraphQLFloat, GraphQLEnumType, GraphQLList, } from 'graphql' describe('typeMapper', () => { describe('ARRAY', function () { it('should map to instance of GraphQLList', function () { expect(toGraphQL(new ARRAY(STRING), Sequelize)).to.instanceof(GraphQLList) }) }) describe('BIGINT', function () { it('should map to GraphQLString', function () { expect(toGraphQL(new BIGINT(), Sequelize)).to.equal(GraphQLString) }) }) describe('BOOLEAN', function () { it('should map to GraphQLBoolean', function () { expect(toGraphQL(new BOOLEAN(), Sequelize)).to.equal(GraphQLBoolean) }) }) describe('CHAR', function () { it('should map to GraphQLString', function () { expect(toGraphQL(new CHAR(), Sequelize)).to.equal(GraphQLString) }) }) describe('CUSTOM', function () { before(function () { // setup mapping mapType((type) => { if (type instanceof BOOLEAN) { return GraphQLString } if (type instanceof FLOAT) { return false } }) }) it('should fallback to default types if it returns false', function () { expect(toGraphQL(new FLOAT(), Sequelize)).to.equal(GraphQLFloat) }) it('should allow the user to map types to anything', function () { expect(toGraphQL(new BOOLEAN(), Sequelize)).to.equal(GraphQLString) }) // reset mapType after(function () { mapType(null) }) }) describe('DATE', function () { it('should map to DateType', function () { expect(toGraphQL(new DATE(), Sequelize)).to.equal(DateType) }) }) describe('DATEONLY', function () { it('should map to GraphQLString', function () { expect(toGraphQL(new DATEONLY(), Sequelize)).to.equal(GraphQLString) }) }) describe('DECIMAL', function () { it('should map to GraphQLString', function () { expect(toGraphQL(new DECIMAL(), Sequelize)).to.equal(GraphQLString) }) }) describe('DOUBLE', function () { it('should map to GraphQLFloat', function () { expect(toGraphQL(new DOUBLE(), Sequelize)).to.equal(GraphQLFloat) }) }) describe('ENUM', function () { it('should map to instance of GraphQLEnumType', function () { expect( toGraphQL( new ENUM( 'value', 'another value', 'two--specials', '25.8', '¼', '¼½', '¼ ½', '¼_½', ' ¼--½_¾ - ' ), Sequelize ) ).to.instanceof(GraphQLEnumType) }) }) describe('FLOAT', function () { it('should map to GraphQLFloat', function () { expect(toGraphQL(new FLOAT(), Sequelize)).to.equal(GraphQLFloat) }) }) describe('REAL', function () { it('should map to GraphQLFloat', function () { expect(toGraphQL(new REAL(), Sequelize)).to.equal(GraphQLFloat) }) }) describe('INTEGER', function () { it('should map to GraphQLInt', function () { expect(toGraphQL(new INTEGER(), Sequelize)).to.equal(GraphQLInt) }) }) describe('STRING', function () { it('should map to GraphQLString', function () { expect(toGraphQL(new STRING(), Sequelize)).to.equal(GraphQLString) }) }) describe('TEXT', function () { it('should map to GraphQLString', function () { expect(toGraphQL(new TEXT(), Sequelize)).to.equal(GraphQLString) }) }) describe('TIME', function () { it('should map to GraphQLString', function () { expect(toGraphQL(new TIME(), Sequelize)).to.equal(GraphQLString) }) }) describe('UUID', function () { it('should map to GraphQLString', function () { expect(toGraphQL(new UUID(), Sequelize)).to.equal(GraphQLString) }) }) describe('UUIDV4', function () { it('should map to GraphQLString', function () { expect(toGraphQL(new UUIDV4(), Sequelize)).to.equal(GraphQLString) }) }) describe('VIRTUAL', function () { it('should map to the sequelize return type', function () { expect( toGraphQL(new VIRTUAL(BOOLEAN, ['createdAt']), Sequelize) ).to.equal(GraphQLBoolean) }) it('should default to a GraphQLString is a return type is not provided', function () { expect(toGraphQL(new VIRTUAL(), Sequelize)).to.equal(GraphQLString) }) }) describe('JSON', function () { it('should map to JSONType', function () { expect(toGraphQL(new JSON(), Sequelize)).to.equal(JSONType) // eslint-disable-line }) }) describe('JSONB', function () { it('should map to JSONType', function () { expect(toGraphQL(new JSONB(), Sequelize)).to.equal(JSONType) }) }) })
var net = require('net'); var TCProtocol = require('./tcprotocol.js'); var buddyManager = require('./buddyManager.js'); var conf = require('../conf/torchat-node.js'); var bunyan = require('bunyan'); var cliGUI = require('./cliGUI.js') var log = bunyan.createLogger({ name: 'torchat-node', streams: [{ level: 'info', path: conf.logPath + '/torchat-node.log' }, { level: 'error', path: conf.logPath + '/torchat-node-errors.log' }] }); var TCListener = function(options) { var module = {}, _host = '127.0.0.1', _port = (conf.servicePort) ? conf.servicePort : '11009', _server = null; var tcProtocol = new TCProtocol({ listener: null, buddyManager: buddyManager, conf: conf, logger: log }); var gui = new cliGUI({ buddyManager: buddyManager }); gui.showMainMenu(); // @TODO clean this up using command pattern. // Done to simple test event mapping from tcprotocol var protocolResponseRouter = function(buddy, command, encoded) { if (buddy) { if (command === 'status') { buddy.status = encoded; return; } else if (command === 'ping' || command === 'pong') { // ignore for now return; } else if (command === 'message') { gui.showMessage(buddy, encoded); } else if (command === 'client') { buddy.client.name = encoded; } else if (command === 'version') { buddy.client.version = encoded; } else if (command === 'profile_name') { buddy.profile.name = encoded; } else if (command === 'profile_text') { buddy.profile.description = encoded; } else if (command === 'add_me') { // Add to buddy list } else { console.log("Something happened. Dont' know " + command); } } }; /** * Starts the TorChat listener * @param {Function} callback - fn(err, duplex stream) */ module.listen = function(callback) { var _server = net.createServer(function(listener) { var that = this; log.info("Listener created "); listener.on('readable', function() { var chunk; while (null !== (chunk = listener.read())) { log.info("Chunky:", chunk); var buffedString = chunk.toString('utf8'); tcProtocol.commandRouter(buffedString, listener); } }); listener.on('connection', function() { // When a connection is received we wait for 15 seconds for a ping // if no ping is received we close it down log.info("Connection received by " + that.listener.remoteAddress); listener.setTimeout(15000); }); listener.on('timeout', function() { log.info("You aren't talking so we are walking"); listener.end(); }); listener.on('end', function() { log.info("listening connection dropped"); }); tcProtocol.on('buddyData', protocolResponseRouter); }); _server.listen(_port, function() { log.info("TorChat server listening on port " + _port); }); }; return module; }; module.exports = TCListener;
YUI.add('loader-base', function (Y, NAME) { /** * The YUI loader core * @module loader * @submodule loader-base */ if (!YUI.Env[Y.version]) { (function() { var VERSION = Y.version, BUILD = '/build/', ROOT = VERSION + '/', CDN_BASE = Y.Env.base, GALLERY_VERSION = 'gallery-2013.05.29-23-38', TNT = '2in3', TNT_VERSION = '4', YUI2_VERSION = '2.9.0', COMBO_BASE = CDN_BASE + 'combo?', META = { version: VERSION, root: ROOT, base: Y.Env.base, comboBase: COMBO_BASE, skin: { defaultSkin: 'sam', base: 'assets/skins/', path: 'skin.css', after: ['cssreset', 'cssfonts', 'cssgrids', 'cssbase', 'cssreset-context', 'cssfonts-context']}, groups: {}, patterns: {} }, groups = META.groups, yui2Update = function(tnt, yui2, config) { var root = TNT + '.' + (tnt || TNT_VERSION) + '/' + (yui2 || YUI2_VERSION) + BUILD, base = (config && config.base) ? config.base : CDN_BASE, combo = (config && config.comboBase) ? config.comboBase : COMBO_BASE; groups.yui2.base = base + root; groups.yui2.root = root; groups.yui2.comboBase = combo; }, galleryUpdate = function(tag, config) { var root = (tag || GALLERY_VERSION) + BUILD, base = (config && config.base) ? config.base : CDN_BASE, combo = (config && config.comboBase) ? config.comboBase : COMBO_BASE; groups.gallery.base = base + root; groups.gallery.root = root; groups.gallery.comboBase = combo; }; groups[VERSION] = {}; groups.gallery = { ext: false, combine: true, comboBase: COMBO_BASE, update: galleryUpdate, patterns: { 'gallery-': { }, 'lang/gallery-': {}, 'gallerycss-': { type: 'css' } } }; groups.yui2 = { combine: true, ext: false, comboBase: COMBO_BASE, update: yui2Update, patterns: { 'yui2-': { configFn: function(me) { if (/-skin|reset|fonts|grids|base/.test(me.name)) { me.type = 'css'; me.path = me.path.replace(/\.js/, '.css'); // this makes skins in builds earlier than // 2.6.0 work as long as combine is false me.path = me.path.replace(/\/yui2-skin/, '/assets/skins/sam/yui2-skin'); } } } } }; galleryUpdate(); yui2Update(); YUI.Env[VERSION] = META; }()); } /*jslint forin: true, maxlen: 350 */ /** * Loader dynamically loads script and css files. It includes the dependency * information for the version of the library in use, and will automatically pull in * dependencies for the modules requested. It can also load the * files from the Yahoo! CDN, and it can utilize the combo service provided on * this network to reduce the number of http connections required to download * YUI files. * * @module loader * @main loader * @submodule loader-base */ var NOT_FOUND = {}, NO_REQUIREMENTS = [], MAX_URL_LENGTH = 1024, GLOBAL_ENV = YUI.Env, GLOBAL_LOADED = GLOBAL_ENV._loaded, CSS = 'css', JS = 'js', INTL = 'intl', DEFAULT_SKIN = 'sam', VERSION = Y.version, ROOT_LANG = '', YObject = Y.Object, oeach = YObject.each, yArray = Y.Array, _queue = GLOBAL_ENV._loaderQueue, META = GLOBAL_ENV[VERSION], SKIN_PREFIX = 'skin-', L = Y.Lang, ON_PAGE = GLOBAL_ENV.mods, modulekey, _path = function(dir, file, type, nomin) { var path = dir + '/' + file; if (!nomin) { path += '-min'; } path += '.' + (type || CSS); return path; }; if (!YUI.Env._cssLoaded) { YUI.Env._cssLoaded = {}; } /** * The component metadata is stored in Y.Env.meta. * Part of the loader module. * @property meta * @for YUI */ Y.Env.meta = META; /** * Loader dynamically loads script and css files. It includes the dependency * info for the version of the library in use, and will automatically pull in * dependencies for the modules requested. It can load the * files from the Yahoo! CDN, and it can utilize the combo service provided on * this network to reduce the number of http connections required to download * YUI files. You can also specify an external, custom combo service to host * your modules as well. var Y = YUI(); var loader = new Y.Loader({ filter: 'debug', base: '../../', root: 'build/', combine: true, require: ['node', 'dd', 'console'] }); var out = loader.resolve(true); * @constructor * @class Loader * @param {Object} config an optional set of configuration options. * @param {String} config.base The base dir which to fetch this module from * @param {String} config.comboBase The Combo service base path. Ex: `http://yui.yahooapis.com/combo?` * @param {String} config.root The root path to prepend to module names for the combo service. Ex: `2.5.2/build/` * @param {String|Object} config.filter A filter to apply to result urls. <a href="#property_filter">See filter property</a> * @param {Object} config.filters Per-component filter specification. If specified for a given component, this overrides the filter config. * @param {Boolean} config.combine Use a combo service to reduce the number of http connections required to load your dependencies * @param {Boolean} [config.async=true] Fetch files in async * @param {Array} config.ignore: A list of modules that should never be dynamically loaded * @param {Array} config.force A list of modules that should always be loaded when required, even if already present on the page * @param {HTMLElement|String} config.insertBefore Node or id for a node that should be used as the insertion point for new nodes * @param {Object} config.jsAttributes Object literal containing attributes to add to script nodes * @param {Object} config.cssAttributes Object literal containing attributes to add to link nodes * @param {Number} config.timeout The number of milliseconds before a timeout occurs when dynamically loading nodes. If not set, there is no timeout * @param {Object} config.context Execution context for all callbacks * @param {Function} config.onSuccess Callback for the 'success' event * @param {Function} config.onFailure Callback for the 'failure' event * @param {Function} config.onCSS Callback for the 'CSSComplete' event. When loading YUI components with CSS the CSS is loaded first, then the script. This provides a moment you can tie into to improve the presentation of the page while the script is loading. * @param {Function} config.onTimeout Callback for the 'timeout' event * @param {Function} config.onProgress Callback executed each time a script or css file is loaded * @param {Object} config.modules A list of module definitions. See <a href="#method_addModule">Loader.addModule</a> for the supported module metadata * @param {Object} config.groups A list of group definitions. Each group can contain specific definitions for `base`, `comboBase`, `combine`, and accepts a list of `modules`. * @param {String} config.2in3 The version of the YUI 2 in 3 wrapper to use. The intrinsic support for YUI 2 modules in YUI 3 relies on versions of the YUI 2 components inside YUI 3 module wrappers. These wrappers change over time to accomodate the issues that arise from running YUI 2 in a YUI 3 sandbox. * @param {String} config.yui2 When using the 2in3 project, you can select the version of YUI 2 to use. Valid values are `2.2.2`, `2.3.1`, `2.4.1`, `2.5.2`, `2.6.0`, `2.7.0`, `2.8.0`, `2.8.1` and `2.9.0` [default] -- plus all versions of YUI 2 going forward. */ Y.Loader = function(o) { var self = this; //Catch no config passed. o = o || {}; modulekey = META.md5; /** * Internal callback to handle multiple internal insert() calls * so that css is inserted prior to js * @property _internalCallback * @private */ // self._internalCallback = null; /** * Callback that will be executed when the loader is finished * with an insert * @method onSuccess * @type function */ // self.onSuccess = null; /** * Callback that will be executed if there is a failure * @method onFailure * @type function */ // self.onFailure = null; /** * Callback for the 'CSSComplete' event. When loading YUI components * with CSS the CSS is loaded first, then the script. This provides * a moment you can tie into to improve the presentation of the page * while the script is loading. * @method onCSS * @type function */ // self.onCSS = null; /** * Callback executed each time a script or css file is loaded * @method onProgress * @type function */ // self.onProgress = null; /** * Callback that will be executed if a timeout occurs * @method onTimeout * @type function */ // self.onTimeout = null; /** * The execution context for all callbacks * @property context * @default {YUI} the YUI instance */ self.context = Y; /** * Data that is passed to all callbacks * @property data */ // self.data = null; /** * Node reference or id where new nodes should be inserted before * @property insertBefore * @type string|HTMLElement */ // self.insertBefore = null; /** * The charset attribute for inserted nodes * @property charset * @type string * @deprecated , use cssAttributes or jsAttributes. */ // self.charset = null; /** * An object literal containing attributes to add to link nodes * @property cssAttributes * @type object */ // self.cssAttributes = null; /** * An object literal containing attributes to add to script nodes * @property jsAttributes * @type object */ // self.jsAttributes = null; /** * The base directory. * @property base * @type string * @default http://yui.yahooapis.com/[YUI VERSION]/build/ */ self.base = Y.Env.meta.base + Y.Env.meta.root; /** * Base path for the combo service * @property comboBase * @type string * @default http://yui.yahooapis.com/combo? */ self.comboBase = Y.Env.meta.comboBase; /* * Base path for language packs. */ // self.langBase = Y.Env.meta.langBase; // self.lang = ""; /** * If configured, the loader will attempt to use the combo * service for YUI resources and configured external resources. * @property combine * @type boolean * @default true if a base dir isn't in the config */ self.combine = o.base && (o.base.indexOf(self.comboBase.substr(0, 20)) > -1); /** * The default seperator to use between files in a combo URL * @property comboSep * @type {String} * @default Ampersand */ self.comboSep = '&'; /** * Max url length for combo urls. The default is 1024. This is the URL * limit for the Yahoo! hosted combo servers. If consuming * a different combo service that has a different URL limit * it is possible to override this default by supplying * the maxURLLength config option. The config option will * only take effect if lower than the default. * * @property maxURLLength * @type int */ self.maxURLLength = MAX_URL_LENGTH; /** * Ignore modules registered on the YUI global * @property ignoreRegistered * @default false */ self.ignoreRegistered = o.ignoreRegistered; /** * Root path to prepend to module path for the combo * service * @property root * @type string * @default [YUI VERSION]/build/ */ self.root = Y.Env.meta.root; /** * Timeout value in milliseconds. If set, self value will be used by * the get utility. the timeout event will fire if * a timeout occurs. * @property timeout * @type int */ self.timeout = 0; /** * A list of modules that should not be loaded, even if * they turn up in the dependency tree * @property ignore * @type string[] */ // self.ignore = null; /** * A list of modules that should always be loaded, even * if they have already been inserted into the page. * @property force * @type string[] */ // self.force = null; self.forceMap = {}; /** * Should we allow rollups * @property allowRollup * @type boolean * @default false */ self.allowRollup = false; /** * A filter to apply to result urls. This filter will modify the default * path for all modules. The default path for the YUI library is the * minified version of the files (e.g., event-min.js). The filter property * can be a predefined filter or a custom filter. The valid predefined * filters are: * <dl> * <dt>DEBUG</dt> * <dd>Selects the debug versions of the library (e.g., event-debug.js). * This option will automatically include the Logger widget</dd> * <dt>RAW</dt> * <dd>Selects the non-minified version of the library (e.g., event.js). * </dd> * </dl> * You can also define a custom filter, which must be an object literal * containing a search expression and a replace string: * * myFilter: { * 'searchExp': "-min\\.js", * 'replaceStr': "-debug.js" * } * * @property filter * @type string| {searchExp: string, replaceStr: string} */ // self.filter = null; /** * per-component filter specification. If specified for a given * component, this overrides the filter config. * @property filters * @type object */ self.filters = {}; /** * The list of requested modules * @property required * @type {string: boolean} */ self.required = {}; /** * If a module name is predefined when requested, it is checked againsts * the patterns provided in this property. If there is a match, the * module is added with the default configuration. * * At the moment only supporting module prefixes, but anticipate * supporting at least regular expressions. * @property patterns * @type Object */ // self.patterns = Y.merge(Y.Env.meta.patterns); self.patterns = {}; /** * The library metadata * @property moduleInfo */ // self.moduleInfo = Y.merge(Y.Env.meta.moduleInfo); self.moduleInfo = {}; self.groups = Y.merge(Y.Env.meta.groups); /** * Provides the information used to skin the skinnable components. * The following skin definition would result in 'skin1' and 'skin2' * being loaded for calendar (if calendar was requested), and * 'sam' for all other skinnable components: * * skin: { * // The default skin, which is automatically applied if not * // overriden by a component-specific skin definition. * // Change this in to apply a different skin globally * defaultSkin: 'sam', * * // This is combined with the loader base property to get * // the default root directory for a skin. ex: * // http://yui.yahooapis.com/2.3.0/build/assets/skins/sam/ * base: 'assets/skins/', * * // Any component-specific overrides can be specified here, * // making it possible to load different skins for different * // components. It is possible to load more than one skin * // for a given component as well. * overrides: { * calendar: ['skin1', 'skin2'] * } * } * @property skin * @type {Object} */ self.skin = Y.merge(Y.Env.meta.skin); /* * Map of conditional modules * @since 3.2.0 */ self.conditions = {}; // map of modules with a hash of modules that meet the requirement // self.provides = {}; self.config = o; self._internal = true; self._populateCache(); /** * Set when beginning to compute the dependency tree. * Composed of what YUI reports to be loaded combined * with what has been loaded by any instance on the page * with the version number specified in the metadata. * @property loaded * @type {string: boolean} */ self.loaded = GLOBAL_LOADED[VERSION]; /** * Should Loader fetch scripts in `async`, defaults to `true` * @property async */ self.async = true; self._inspectPage(); self._internal = false; self._config(o); self.forceMap = (self.force) ? Y.Array.hash(self.force) : {}; self.testresults = null; if (Y.config.tests) { self.testresults = Y.config.tests; } /** * List of rollup files found in the library metadata * @property rollups */ // self.rollups = null; /** * Whether or not to load optional dependencies for * the requested modules * @property loadOptional * @type boolean * @default false */ // self.loadOptional = false; /** * All of the derived dependencies in sorted order, which * will be populated when either calculate() or insert() * is called * @property sorted * @type string[] */ self.sorted = []; /* * A list of modules to attach to the YUI instance when complete. * If not supplied, the sorted list of dependencies are applied. * @property attaching */ // self.attaching = null; /** * Flag to indicate the dependency tree needs to be recomputed * if insert is called again. * @property dirty * @type boolean * @default true */ self.dirty = true; /** * List of modules inserted by the utility * @property inserted * @type {string: boolean} */ self.inserted = {}; /** * List of skipped modules during insert() because the module * was not defined * @property skipped */ self.skipped = {}; // Y.on('yui:load', self.loadNext, self); self.tested = {}; /* * Cached sorted calculate results * @property results * @since 3.2.0 */ //self.results = {}; if (self.ignoreRegistered) { //Clear inpage already processed modules. self._resetModules(); } }; Y.Loader.prototype = { /** * Checks the cache for modules and conditions, if they do not exist * process the default metadata and populate the local moduleInfo hash. * @method _populateCache * @private */ _populateCache: function() { var self = this, defaults = META.modules, cache = GLOBAL_ENV._renderedMods, i; if (cache && !self.ignoreRegistered) { for (i in cache) { if (cache.hasOwnProperty(i)) { self.moduleInfo[i] = Y.merge(cache[i]); } } cache = GLOBAL_ENV._conditions; for (i in cache) { if (cache.hasOwnProperty(i)) { self.conditions[i] = Y.merge(cache[i]); } } } else { for (i in defaults) { if (defaults.hasOwnProperty(i)) { self.addModule(defaults[i], i); } } } }, /** * Reset modules in the module cache to a pre-processed state so additional * computations with a different skin or language will work as expected. * @method _resetModules * @private */ _resetModules: function() { var self = this, i, o, mod, name, details; for (i in self.moduleInfo) { if (self.moduleInfo.hasOwnProperty(i)) { mod = self.moduleInfo[i]; name = mod.name; details = (YUI.Env.mods[name] ? YUI.Env.mods[name].details : null); if (details) { self.moduleInfo[name]._reset = true; self.moduleInfo[name].requires = details.requires || []; self.moduleInfo[name].optional = details.optional || []; self.moduleInfo[name].supersedes = details.supercedes || []; } if (mod.defaults) { for (o in mod.defaults) { if (mod.defaults.hasOwnProperty(o)) { if (mod[o]) { mod[o] = mod.defaults[o]; } } } } delete mod.langCache; delete mod.skinCache; if (mod.skinnable) { self._addSkin(self.skin.defaultSkin, mod.name); } } } }, /** Regex that matches a CSS URL. Used to guess the file type when it's not specified. @property REGEX_CSS @type RegExp @final @protected @since 3.5.0 **/ REGEX_CSS: /\.css(?:[?;].*)?$/i, /** * Default filters for raw and debug * @property FILTER_DEFS * @type Object * @final * @protected */ FILTER_DEFS: { RAW: { 'searchExp': '-min\\.js', 'replaceStr': '.js' }, DEBUG: { 'searchExp': '-min\\.js', 'replaceStr': '-debug.js' }, COVERAGE: { 'searchExp': '-min\\.js', 'replaceStr': '-coverage.js' } }, /* * Check the pages meta-data and cache the result. * @method _inspectPage * @private */ _inspectPage: function() { var self = this, v, m, req, mr, i; //Inspect the page for CSS only modules and mark them as loaded. for (i in self.moduleInfo) { if (self.moduleInfo.hasOwnProperty(i)) { v = self.moduleInfo[i]; if (v.type && v.type === CSS) { if (self.isCSSLoaded(v.name)) { self.loaded[i] = true; } } } } for (i in ON_PAGE) { if (ON_PAGE.hasOwnProperty(i)) { v = ON_PAGE[i]; if (v.details) { m = self.moduleInfo[v.name]; req = v.details.requires; mr = m && m.requires; if (m) { if (!m._inspected && req && mr.length !== req.length) { // console.log('deleting ' + m.name); delete m.expanded; } } else { m = self.addModule(v.details, i); } m._inspected = true; } } } }, /* * returns true if b is not loaded, and is required directly or by means of modules it supersedes. * @private * @method _requires * @param {String} mod1 The first module to compare * @param {String} mod2 The second module to compare */ _requires: function(mod1, mod2) { var i, rm, after_map, s, info = this.moduleInfo, m = info[mod1], other = info[mod2]; if (!m || !other) { return false; } rm = m.expanded_map; after_map = m.after_map; // check if this module should be sorted after the other // do this first to short circut circular deps if (after_map && (mod2 in after_map)) { return true; } after_map = other.after_map; // and vis-versa if (after_map && (mod1 in after_map)) { return false; } // check if this module requires one the other supersedes s = info[mod2] && info[mod2].supersedes; if (s) { for (i = 0; i < s.length; i++) { if (this._requires(mod1, s[i])) { return true; } } } s = info[mod1] && info[mod1].supersedes; if (s) { for (i = 0; i < s.length; i++) { if (this._requires(mod2, s[i])) { return false; } } } // check if this module requires the other directly // if (r && yArray.indexOf(r, mod2) > -1) { if (rm && (mod2 in rm)) { return true; } // external css files should be sorted below yui css if (m.ext && m.type === CSS && !other.ext && other.type === CSS) { return true; } return false; }, /** * Apply a new config to the Loader instance * @method _config * @private * @param {Object} o The new configuration */ _config: function(o) { var i, j, val, a, f, group, groupName, self = this, mods = [], mod; // apply config values if (o) { for (i in o) { if (o.hasOwnProperty(i)) { val = o[i]; //TODO This should be a case if (i === 'require') { self.require(val); } else if (i === 'skin') { //If the config.skin is a string, format to the expected object if (typeof val === 'string') { self.skin.defaultSkin = o.skin; val = { defaultSkin: val }; } Y.mix(self.skin, val, true); } else if (i === 'groups') { for (j in val) { if (val.hasOwnProperty(j)) { groupName = j; group = val[j]; self.addGroup(group, groupName); if (group.aliases) { for (a in group.aliases) { if (group.aliases.hasOwnProperty(a)) { self.addAlias(group.aliases[a], a); } } } } } } else if (i === 'modules') { // add a hash of module definitions for (j in val) { if (val.hasOwnProperty(j)) { self.addModule(val[j], j); } } } else if (i === 'aliases') { for (j in val) { if (val.hasOwnProperty(j)) { self.addAlias(val[j], j); } } } else if (i === 'gallery') { if (this.groups.gallery.update) { this.groups.gallery.update(val, o); } } else if (i === 'yui2' || i === '2in3') { if (this.groups.yui2.update) { this.groups.yui2.update(o['2in3'], o.yui2, o); } } else { self[i] = val; } } } } // fix filter f = self.filter; if (L.isString(f)) { f = f.toUpperCase(); self.filterName = f; self.filter = self.FILTER_DEFS[f]; if (f === 'DEBUG') { self.require('yui-log', 'dump'); } } if (self.filterName && self.coverage) { if (self.filterName === 'COVERAGE' && L.isArray(self.coverage) && self.coverage.length) { for (i = 0; i < self.coverage.length; i++) { mod = self.coverage[i]; if (self.moduleInfo[mod] && self.moduleInfo[mod].use) { mods = [].concat(mods, self.moduleInfo[mod].use); } else { mods.push(mod); } } self.filters = self.filters || {}; Y.Array.each(mods, function(mod) { self.filters[mod] = self.FILTER_DEFS.COVERAGE; }); self.filterName = 'RAW'; self.filter = self.FILTER_DEFS[self.filterName]; } } }, /** * Returns the skin module name for the specified skin name. If a * module name is supplied, the returned skin module name is * specific to the module passed in. * @method formatSkin * @param {string} skin the name of the skin. * @param {string} mod optional: the name of a module to skin. * @return {string} the full skin module name. */ formatSkin: function(skin, mod) { var s = SKIN_PREFIX + skin; if (mod) { s = s + '-' + mod; } return s; }, /** * Adds the skin def to the module info * @method _addSkin * @param {string} skin the name of the skin. * @param {string} mod the name of the module. * @param {string} parent parent module if this is a skin of a * submodule or plugin. * @return {string} the module name for the skin. * @private */ _addSkin: function(skin, mod, parent) { var mdef, pkg, name, nmod, info = this.moduleInfo, sinf = this.skin, ext = info[mod] && info[mod].ext; // Add a module definition for the module-specific skin css if (mod) { name = this.formatSkin(skin, mod); if (!info[name]) { mdef = info[mod]; pkg = mdef.pkg || mod; nmod = { skin: true, name: name, group: mdef.group, type: 'css', after: sinf.after, path: (parent || pkg) + '/' + sinf.base + skin + '/' + mod + '.css', ext: ext }; if (mdef.base) { nmod.base = mdef.base; } if (mdef.configFn) { nmod.configFn = mdef.configFn; } this.addModule(nmod, name); } } return name; }, /** * Adds an alias module to the system * @method addAlias * @param {Array} use An array of modules that makes up this alias * @param {String} name The name of the alias * @example * var loader = new Y.Loader({}); * loader.addAlias([ 'node', 'yql' ], 'davglass'); * loader.require(['davglass']); * var out = loader.resolve(true); * * //out.js will contain Node and YQL modules */ addAlias: function(use, name) { YUI.Env.aliases[name] = use; this.addModule({ name: name, use: use }); }, /** * Add a new module group * @method addGroup * @param {Object} config An object containing the group configuration data * @param {String} config.name required, the group name * @param {String} config.base The base directory for this module group * @param {String} config.root The root path to add to each combo resource path * @param {Boolean} config.combine Should the request be combined * @param {String} config.comboBase Combo service base path * @param {Object} config.modules The group of modules * @param {String} name the group name. * @example * var loader = new Y.Loader({}); * loader.addGroup({ * name: 'davglass', * combine: true, * comboBase: '/combo?', * root: '', * modules: { * //Module List here * } * }, 'davglass'); */ addGroup: function(o, name) { var mods = o.modules, self = this, i, v; name = name || o.name; o.name = name; self.groups[name] = o; if (o.patterns) { for (i in o.patterns) { if (o.patterns.hasOwnProperty(i)) { o.patterns[i].group = name; self.patterns[i] = o.patterns[i]; } } } if (mods) { for (i in mods) { if (mods.hasOwnProperty(i)) { v = mods[i]; if (typeof v === 'string') { v = { name: i, fullpath: v }; } v.group = name; self.addModule(v, i); } } } }, /** * Add a new module to the component metadata. * @method addModule * @param {Object} config An object containing the module data. * @param {String} config.name Required, the component name * @param {String} config.type Required, the component type (js or css) * @param {String} config.path Required, the path to the script from `base` * @param {Array} config.requires Array of modules required by this component * @param {Array} [config.optional] Array of optional modules for this component * @param {Array} [config.supersedes] Array of the modules this component replaces * @param {Array} [config.after] Array of modules the components which, if present, should be sorted above this one * @param {Object} [config.after_map] Faster alternative to 'after' -- supply a hash instead of an array * @param {Number} [config.rollup] The number of superseded modules required for automatic rollup * @param {String} [config.fullpath] If `fullpath` is specified, this is used instead of the configured `base + path` * @param {Boolean} [config.skinnable] Flag to determine if skin assets should automatically be pulled in * @param {Object} [config.submodules] Hash of submodules * @param {String} [config.group] The group the module belongs to -- this is set automatically when it is added as part of a group configuration. * @param {Array} [config.lang] Array of BCP 47 language tags of languages for which this module has localized resource bundles, e.g., `["en-GB", "zh-Hans-CN"]` * @param {Object} [config.condition] Specifies that the module should be loaded automatically if a condition is met. This is an object with up to four fields: * @param {String} [config.condition.trigger] The name of a module that can trigger the auto-load * @param {Function} [config.condition.test] A function that returns true when the module is to be loaded. * @param {String} [config.condition.ua] The UA name of <a href="UA.html">Y.UA</a> object that returns true when the module is to be loaded. e.g., `"ie"`, `"nodejs"`. * @param {String} [config.condition.when] Specifies the load order of the conditional module * with regard to the position of the trigger module. * This should be one of three values: `before`, `after`, or `instead`. The default is `after`. * @param {Object} [config.testresults] A hash of test results from `Y.Features.all()` * @param {Function} [config.configFn] A function to exectute when configuring this module * @param {Object} config.configFn.mod The module config, modifying this object will modify it's config. Returning false will delete the module's config. * @param {String} [name] The module name, required if not in the module data. * @return {Object} the module definition or null if the object passed in did not provide all required attributes. */ addModule: function(o, name) { name = name || o.name; if (typeof o === 'string') { o = { name: name, fullpath: o }; } var subs, i, l, t, sup, s, smod, plugins, plug, j, langs, packName, supName, flatSup, flatLang, lang, ret, overrides, skinname, when, g, p, conditions = this.conditions, trigger; //Only merge this data if the temp flag is set //from an earlier pass from a pattern or else //an override module (YUI_config) can not be used to //replace a default module. if (this.moduleInfo[name] && this.moduleInfo[name].temp) { //This catches temp modules loaded via a pattern // The module will be added twice, once from the pattern and // Once from the actual add call, this ensures that properties // that were added to the module the first time around (group: gallery) // are also added the second time around too. o = Y.merge(this.moduleInfo[name], o); } o.name = name; if (!o || !o.name) { return null; } if (!o.type) { //Always assume it's javascript unless the CSS pattern is matched. o.type = JS; p = o.path || o.fullpath; if (p && this.REGEX_CSS.test(p)) { o.type = CSS; } } if (!o.path && !o.fullpath) { o.path = _path(name, name, o.type); } o.supersedes = o.supersedes || o.use; o.ext = ('ext' in o) ? o.ext : (this._internal) ? false : true; // Handle submodule logic subs = o.submodules; this.moduleInfo[name] = o; o.requires = o.requires || []; /* Only allowing the cascade of requires information, since optional and supersedes are far more fine grained than a blanket requires is. */ if (this.requires) { for (i = 0; i < this.requires.length; i++) { o.requires.push(this.requires[i]); } } if (o.group && this.groups && this.groups[o.group]) { g = this.groups[o.group]; if (g.requires) { for (i = 0; i < g.requires.length; i++) { o.requires.push(g.requires[i]); } } } if (!o.defaults) { o.defaults = { requires: o.requires ? [].concat(o.requires) : null, supersedes: o.supersedes ? [].concat(o.supersedes) : null, optional: o.optional ? [].concat(o.optional) : null }; } if (o.skinnable && o.ext && o.temp) { skinname = this._addSkin(this.skin.defaultSkin, name); o.requires.unshift(skinname); } if (o.requires.length) { o.requires = this.filterRequires(o.requires) || []; } if (!o.langPack && o.lang) { langs = yArray(o.lang); for (j = 0; j < langs.length; j++) { lang = langs[j]; packName = this.getLangPackName(lang, name); smod = this.moduleInfo[packName]; if (!smod) { smod = this._addLangPack(lang, o, packName); } } } if (subs) { sup = o.supersedes || []; l = 0; for (i in subs) { if (subs.hasOwnProperty(i)) { s = subs[i]; s.path = s.path || _path(name, i, o.type); s.pkg = name; s.group = o.group; if (s.supersedes) { sup = sup.concat(s.supersedes); } smod = this.addModule(s, i); sup.push(i); if (smod.skinnable) { o.skinnable = true; overrides = this.skin.overrides; if (overrides && overrides[i]) { for (j = 0; j < overrides[i].length; j++) { skinname = this._addSkin(overrides[i][j], i, name); sup.push(skinname); } } skinname = this._addSkin(this.skin.defaultSkin, i, name); sup.push(skinname); } // looks like we are expected to work out the metadata // for the parent module language packs from what is // specified in the child modules. if (s.lang && s.lang.length) { langs = yArray(s.lang); for (j = 0; j < langs.length; j++) { lang = langs[j]; packName = this.getLangPackName(lang, name); supName = this.getLangPackName(lang, i); smod = this.moduleInfo[packName]; if (!smod) { smod = this._addLangPack(lang, o, packName); } flatSup = flatSup || yArray.hash(smod.supersedes); if (!(supName in flatSup)) { smod.supersedes.push(supName); } o.lang = o.lang || []; flatLang = flatLang || yArray.hash(o.lang); if (!(lang in flatLang)) { o.lang.push(lang); } // Add rollup file, need to add to supersedes list too // default packages packName = this.getLangPackName(ROOT_LANG, name); supName = this.getLangPackName(ROOT_LANG, i); smod = this.moduleInfo[packName]; if (!smod) { smod = this._addLangPack(lang, o, packName); } if (!(supName in flatSup)) { smod.supersedes.push(supName); } // Add rollup file, need to add to supersedes list too } } l++; } } //o.supersedes = YObject.keys(yArray.hash(sup)); o.supersedes = yArray.dedupe(sup); if (this.allowRollup) { o.rollup = (l < 4) ? l : Math.min(l - 1, 4); } } plugins = o.plugins; if (plugins) { for (i in plugins) { if (plugins.hasOwnProperty(i)) { plug = plugins[i]; plug.pkg = name; plug.path = plug.path || _path(name, i, o.type); plug.requires = plug.requires || []; plug.group = o.group; this.addModule(plug, i); if (o.skinnable) { this._addSkin(this.skin.defaultSkin, i, name); } } } } if (o.condition) { t = o.condition.trigger; if (YUI.Env.aliases[t]) { t = YUI.Env.aliases[t]; } if (!Y.Lang.isArray(t)) { t = [t]; } for (i = 0; i < t.length; i++) { trigger = t[i]; when = o.condition.when; conditions[trigger] = conditions[trigger] || {}; conditions[trigger][name] = o.condition; // the 'when' attribute can be 'before', 'after', or 'instead' // the default is after. if (when && when !== 'after') { if (when === 'instead') { // replace the trigger o.supersedes = o.supersedes || []; o.supersedes.push(trigger); } // before the trigger // the trigger requires the conditional mod, // so it should appear before the conditional // mod if we do not intersede. } else { // after the trigger o.after = o.after || []; o.after.push(trigger); } } } if (o.supersedes) { o.supersedes = this.filterRequires(o.supersedes); } if (o.after) { o.after = this.filterRequires(o.after); o.after_map = yArray.hash(o.after); } // this.dirty = true; if (o.configFn) { ret = o.configFn(o); if (ret === false) { delete this.moduleInfo[name]; delete GLOBAL_ENV._renderedMods[name]; o = null; } } //Add to global cache if (o) { if (!GLOBAL_ENV._renderedMods) { GLOBAL_ENV._renderedMods = {}; } GLOBAL_ENV._renderedMods[name] = Y.mix(GLOBAL_ENV._renderedMods[name] || {}, o); GLOBAL_ENV._conditions = conditions; } return o; }, /** * Add a requirement for one or more module * @method require * @param {string[] | string*} what the modules to load. */ require: function(what) { var a = (typeof what === 'string') ? yArray(arguments) : what; this.dirty = true; this.required = Y.merge(this.required, yArray.hash(this.filterRequires(a))); this._explodeRollups(); }, /** * Grab all the items that were asked for, check to see if the Loader * meta-data contains a "use" array. If it doesm remove the asked item and replace it with * the content of the "use". * This will make asking for: "dd" * Actually ask for: "dd-ddm-base,dd-ddm,dd-ddm-drop,dd-drag,dd-proxy,dd-constrain,dd-drop,dd-scroll,dd-drop-plugin" * @private * @method _explodeRollups */ _explodeRollups: function() { var self = this, m, m2, i, a, v, len, len2, r = self.required; if (!self.allowRollup) { for (i in r) { if (r.hasOwnProperty(i)) { m = self.getModule(i); if (m && m.use) { len = m.use.length; for (a = 0; a < len; a++) { m2 = self.getModule(m.use[a]); if (m2 && m2.use) { len2 = m2.use.length; for (v = 0; v < len2; v++) { r[m2.use[v]] = true; } } else { r[m.use[a]] = true; } } } } } self.required = r; } }, /** * Explodes the required array to remove aliases and replace them with real modules * @method filterRequires * @param {Array} r The original requires array * @return {Array} The new array of exploded requirements */ filterRequires: function(r) { if (r) { if (!Y.Lang.isArray(r)) { r = [r]; } r = Y.Array(r); var c = [], i, mod, o, m; for (i = 0; i < r.length; i++) { mod = this.getModule(r[i]); if (mod && mod.use) { for (o = 0; o < mod.use.length; o++) { //Must walk the other modules in case a module is a rollup of rollups (datatype) m = this.getModule(mod.use[o]); if (m && m.use && (m.name !== mod.name)) { c = Y.Array.dedupe([].concat(c, this.filterRequires(m.use))); } else { c.push(mod.use[o]); } } } else { c.push(r[i]); } } r = c; } return r; }, /** * Returns an object containing properties for all modules required * in order to load the requested module * @method getRequires * @param {object} mod The module definition from moduleInfo. * @return {array} the expanded requirement list. */ getRequires: function(mod) { if (!mod) { //console.log('returning no reqs for ' + mod.name); return NO_REQUIREMENTS; } if (mod._parsed) { //console.log('returning requires for ' + mod.name, mod.requires); return mod.expanded || NO_REQUIREMENTS; } //TODO add modue cache here out of scope.. var i, m, j, add, packName, lang, testresults = this.testresults, name = mod.name, cond, adddef = ON_PAGE[name] && ON_PAGE[name].details, d, go, def, r, old_mod, o, skinmod, skindef, skinpar, skinname, intl = mod.lang || mod.intl, info = this.moduleInfo, ftests = Y.Features && Y.Features.tests.load, hash, reparse; // console.log(name); // pattern match leaves module stub that needs to be filled out if (mod.temp && adddef) { old_mod = mod; mod = this.addModule(adddef, name); mod.group = old_mod.group; mod.pkg = old_mod.pkg; delete mod.expanded; } // console.log('cache: ' + mod.langCache + ' == ' + this.lang); //If a skin or a lang is different, reparse.. reparse = !((!this.lang || mod.langCache === this.lang) && (mod.skinCache === this.skin.defaultSkin)); if (mod.expanded && !reparse) { return mod.expanded; } d = []; hash = {}; r = this.filterRequires(mod.requires); if (mod.lang) { //If a module has a lang attribute, auto add the intl requirement. d.unshift('intl'); r.unshift('intl'); intl = true; } o = this.filterRequires(mod.optional); mod._parsed = true; mod.langCache = this.lang; mod.skinCache = this.skin.defaultSkin; for (i = 0; i < r.length; i++) { if (!hash[r[i]]) { d.push(r[i]); hash[r[i]] = true; m = this.getModule(r[i]); if (m) { add = this.getRequires(m); intl = intl || (m.expanded_map && (INTL in m.expanded_map)); for (j = 0; j < add.length; j++) { d.push(add[j]); } } } } // get the requirements from superseded modules, if any r = this.filterRequires(mod.supersedes); if (r) { for (i = 0; i < r.length; i++) { if (!hash[r[i]]) { // if this module has submodules, the requirements list is // expanded to include the submodules. This is so we can // prevent dups when a submodule is already loaded and the // parent is requested. if (mod.submodules) { d.push(r[i]); } hash[r[i]] = true; m = this.getModule(r[i]); if (m) { add = this.getRequires(m); intl = intl || (m.expanded_map && (INTL in m.expanded_map)); for (j = 0; j < add.length; j++) { d.push(add[j]); } } } } } if (o && this.loadOptional) { for (i = 0; i < o.length; i++) { if (!hash[o[i]]) { d.push(o[i]); hash[o[i]] = true; m = info[o[i]]; if (m) { add = this.getRequires(m); intl = intl || (m.expanded_map && (INTL in m.expanded_map)); for (j = 0; j < add.length; j++) { d.push(add[j]); } } } } } cond = this.conditions[name]; if (cond) { //Set the module to not parsed since we have conditionals and this could change the dependency tree. mod._parsed = false; if (testresults && ftests) { oeach(testresults, function(result, id) { var condmod = ftests[id].name; if (!hash[condmod] && ftests[id].trigger === name) { if (result && ftests[id]) { hash[condmod] = true; d.push(condmod); } } }); } else { for (i in cond) { if (cond.hasOwnProperty(i)) { if (!hash[i]) { def = cond[i]; //first see if they've specfied a ua check //then see if they've got a test fn & if it returns true //otherwise just having a condition block is enough go = def && ((!def.ua && !def.test) || (def.ua && Y.UA[def.ua]) || (def.test && def.test(Y, r))); if (go) { hash[i] = true; d.push(i); m = this.getModule(i); if (m) { add = this.getRequires(m); for (j = 0; j < add.length; j++) { d.push(add[j]); } } } } } } } } // Create skin modules if (mod.skinnable) { skindef = this.skin.overrides; for (i in YUI.Env.aliases) { if (YUI.Env.aliases.hasOwnProperty(i)) { if (Y.Array.indexOf(YUI.Env.aliases[i], name) > -1) { skinpar = i; } } } if (skindef && (skindef[name] || (skinpar && skindef[skinpar]))) { skinname = name; if (skindef[skinpar]) { skinname = skinpar; } for (i = 0; i < skindef[skinname].length; i++) { skinmod = this._addSkin(skindef[skinname][i], name); if (!this.isCSSLoaded(skinmod, this._boot)) { d.push(skinmod); } } } else { skinmod = this._addSkin(this.skin.defaultSkin, name); if (!this.isCSSLoaded(skinmod, this._boot)) { d.push(skinmod); } } } mod._parsed = false; if (intl) { if (mod.lang && !mod.langPack && Y.Intl) { lang = Y.Intl.lookupBestLang(this.lang || ROOT_LANG, mod.lang); packName = this.getLangPackName(lang, name); if (packName) { d.unshift(packName); } } d.unshift(INTL); } mod.expanded_map = yArray.hash(d); mod.expanded = YObject.keys(mod.expanded_map); return mod.expanded; }, /** * Check to see if named css module is already loaded on the page * @method isCSSLoaded * @param {String} name The name of the css file * @return Boolean */ isCSSLoaded: function(name, skip) { //TODO - Make this call a batching call with name being an array if (!name || !YUI.Env.cssStampEl || (!skip && this.ignoreRegistered)) { return false; } var el = YUI.Env.cssStampEl, ret = false, mod = YUI.Env._cssLoaded[name], style = el.currentStyle; //IE if (mod !== undefined) { return mod; } //Add the classname to the element el.className = name; if (!style) { style = Y.config.doc.defaultView.getComputedStyle(el, null); } if (style && style.display === 'none') { ret = true; } el.className = ''; //Reset the classname to '' YUI.Env._cssLoaded[name] = ret; return ret; }, /** * Returns a hash of module names the supplied module satisfies. * @method getProvides * @param {string} name The name of the module. * @return {object} what this module provides. */ getProvides: function(name) { var m = this.getModule(name), o, s; // supmap = this.provides; if (!m) { return NOT_FOUND; } if (m && !m.provides) { o = {}; s = m.supersedes; if (s) { yArray.each(s, function(v) { Y.mix(o, this.getProvides(v)); }, this); } o[name] = true; m.provides = o; } return m.provides; }, /** * Calculates the dependency tree, the result is stored in the sorted * property. * @method calculate * @param {object} o optional options object. * @param {string} type optional argument to prune modules. */ calculate: function(o, type) { if (o || type || this.dirty) { if (o) { this._config(o); } if (!this._init) { this._setup(); } this._explode(); if (this.allowRollup) { this._rollup(); } else { this._explodeRollups(); } this._reduce(); this._sort(); } }, /** * Creates a "psuedo" package for languages provided in the lang array * @method _addLangPack * @private * @param {String} lang The language to create * @param {Object} m The module definition to create the language pack around * @param {String} packName The name of the package (e.g: lang/datatype-date-en-US) * @return {Object} The module definition */ _addLangPack: function(lang, m, packName) { var name = m.name, packPath, conf, existing = this.moduleInfo[packName]; if (!existing) { packPath = _path((m.pkg || name), packName, JS, true); conf = { path: packPath, intl: true, langPack: true, ext: m.ext, group: m.group, supersedes: [] }; if (m.root) { conf.root = m.root; } if (m.base) { conf.base = m.base; } if (m.configFn) { conf.configFn = m.configFn; } this.addModule(conf, packName); if (lang) { Y.Env.lang = Y.Env.lang || {}; Y.Env.lang[lang] = Y.Env.lang[lang] || {}; Y.Env.lang[lang][name] = true; } } return this.moduleInfo[packName]; }, /** * Investigates the current YUI configuration on the page. By default, * modules already detected will not be loaded again unless a force * option is encountered. Called by calculate() * @method _setup * @private */ _setup: function() { var info = this.moduleInfo, name, i, j, m, l, packName; for (name in info) { if (info.hasOwnProperty(name)) { m = info[name]; if (m) { // remove dups //m.requires = YObject.keys(yArray.hash(m.requires)); m.requires = yArray.dedupe(m.requires); // Create lang pack modules //if (m.lang && m.lang.length) { if (m.lang) { // Setup root package if the module has lang defined, // it needs to provide a root language pack packName = this.getLangPackName(ROOT_LANG, name); this._addLangPack(null, m, packName); } } } } //l = Y.merge(this.inserted); l = {}; // available modules if (!this.ignoreRegistered) { Y.mix(l, GLOBAL_ENV.mods); } // add the ignore list to the list of loaded packages if (this.ignore) { Y.mix(l, yArray.hash(this.ignore)); } // expand the list to include superseded modules for (j in l) { if (l.hasOwnProperty(j)) { Y.mix(l, this.getProvides(j)); } } // remove modules on the force list from the loaded list if (this.force) { for (i = 0; i < this.force.length; i++) { if (this.force[i] in l) { delete l[this.force[i]]; } } } Y.mix(this.loaded, l); this._init = true; }, /** * Builds a module name for a language pack * @method getLangPackName * @param {string} lang the language code. * @param {string} mname the module to build it for. * @return {string} the language pack module name. */ getLangPackName: function(lang, mname) { return ('lang/' + mname + ((lang) ? '_' + lang : '')); }, /** * Inspects the required modules list looking for additional * dependencies. Expands the required list to include all * required modules. Called by calculate() * @method _explode * @private */ _explode: function() { //TODO Move done out of scope var r = this.required, m, reqs, done = {}, self = this, name, expound; // the setup phase is over, all modules have been created self.dirty = false; self._explodeRollups(); r = self.required; for (name in r) { if (r.hasOwnProperty(name)) { if (!done[name]) { done[name] = true; m = self.getModule(name); if (m) { expound = m.expound; if (expound) { r[expound] = self.getModule(expound); reqs = self.getRequires(r[expound]); Y.mix(r, yArray.hash(reqs)); } reqs = self.getRequires(m); Y.mix(r, yArray.hash(reqs)); } } } } }, /** * The default method used to test a module against a pattern * @method _patternTest * @private * @param {String} mname The module being tested * @param {String} pname The pattern to match */ _patternTest: function(mname, pname) { return (mname.indexOf(pname) > -1); }, /** * Get's the loader meta data for the requested module * @method getModule * @param {String} mname The module name to get * @return {Object} The module metadata */ getModule: function(mname) { //TODO: Remove name check - it's a quick hack to fix pattern WIP if (!mname) { return null; } var p, found, pname, m = this.moduleInfo[mname], patterns = this.patterns; // check the patterns library to see if we should automatically add // the module with defaults if (!m || (m && m.ext)) { for (pname in patterns) { if (patterns.hasOwnProperty(pname)) { p = patterns[pname]; //There is no test method, create a default one that tests // the pattern against the mod name if (!p.test) { p.test = this._patternTest; } if (p.test(mname, pname)) { // use the metadata supplied for the pattern // as the module definition. found = p; break; } } } } if (!m) { if (found) { if (p.action) { p.action.call(this, mname, pname); } else { // ext true or false? m = this.addModule(Y.merge(found), mname); if (found.configFn) { m.configFn = found.configFn; } m.temp = true; } } } else { if (found && m && found.configFn && !m.configFn) { m.configFn = found.configFn; m.configFn(m); } } return m; }, // impl in rollup submodule _rollup: function() { }, /** * Remove superceded modules and loaded modules. Called by * calculate() after we have the mega list of all dependencies * @method _reduce * @return {object} the reduced dependency hash. * @private */ _reduce: function(r) { r = r || this.required; var i, j, s, m, type = this.loadType, ignore = this.ignore ? yArray.hash(this.ignore) : false; for (i in r) { if (r.hasOwnProperty(i)) { m = this.getModule(i); // remove if already loaded if (((this.loaded[i] || ON_PAGE[i]) && !this.forceMap[i] && !this.ignoreRegistered) || (type && m && m.type !== type)) { delete r[i]; } if (ignore && ignore[i]) { delete r[i]; } // remove anything this module supersedes s = m && m.supersedes; if (s) { for (j = 0; j < s.length; j++) { if (s[j] in r) { delete r[s[j]]; } } } } } return r; }, /** * Handles the queue when a module has been loaded for all cases * @method _finish * @private * @param {String} msg The message from Loader * @param {Boolean} success A boolean denoting success or failure */ _finish: function(msg, success) { _queue.running = false; var onEnd = this.onEnd; if (onEnd) { onEnd.call(this.context, { msg: msg, data: this.data, success: success }); } this._continue(); }, /** * The default Loader onSuccess handler, calls this.onSuccess with a payload * @method _onSuccess * @private */ _onSuccess: function() { var self = this, skipped = Y.merge(self.skipped), fn, failed = [], rreg = self.requireRegistration, success, msg, i, mod; for (i in skipped) { if (skipped.hasOwnProperty(i)) { delete self.inserted[i]; } } self.skipped = {}; for (i in self.inserted) { if (self.inserted.hasOwnProperty(i)) { mod = self.getModule(i); if (mod && rreg && mod.type === JS && !(i in YUI.Env.mods)) { failed.push(i); } else { Y.mix(self.loaded, self.getProvides(i)); } } } fn = self.onSuccess; msg = (failed.length) ? 'notregistered' : 'success'; success = !(failed.length); if (fn) { fn.call(self.context, { msg: msg, data: self.data, success: success, failed: failed, skipped: skipped }); } self._finish(msg, success); }, /** * The default Loader onProgress handler, calls this.onProgress with a payload * @method _onProgress * @private */ _onProgress: function(e) { var self = this, i; //set the internal cache to what just came in. if (e.data && e.data.length) { for (i = 0; i < e.data.length; i++) { e.data[i] = self.getModule(e.data[i].name); } } if (self.onProgress) { self.onProgress.call(self.context, { name: e.url, data: e.data }); } }, /** * The default Loader onFailure handler, calls this.onFailure with a payload * @method _onFailure * @private */ _onFailure: function(o) { var f = this.onFailure, msg = [], i = 0, len = o.errors.length; for (i; i < len; i++) { msg.push(o.errors[i].error); } msg = msg.join(','); if (f) { f.call(this.context, { msg: msg, data: this.data, success: false }); } this._finish(msg, false); }, /** * The default Loader onTimeout handler, calls this.onTimeout with a payload * @method _onTimeout * @param {Get.Transaction} transaction The Transaction object from `Y.Get` * @private */ _onTimeout: function(transaction) { var f = this.onTimeout; if (f) { f.call(this.context, { msg: 'timeout', data: this.data, success: false, transaction: transaction }); } }, /** * Sorts the dependency tree. The last step of calculate() * @method _sort * @private */ _sort: function() { // create an indexed list var s = YObject.keys(this.required), // loaded = this.loaded, //TODO Move this out of scope done = {}, p = 0, l, a, b, j, k, moved, doneKey; // keep going until we make a pass without moving anything for (;;) { l = s.length; moved = false; // start the loop after items that are already sorted for (j = p; j < l; j++) { // check the next module on the list to see if its // dependencies have been met a = s[j]; // check everything below current item and move if we // find a requirement for the current item for (k = j + 1; k < l; k++) { doneKey = a + s[k]; if (!done[doneKey] && this._requires(a, s[k])) { // extract the dependency so we can move it up b = s.splice(k, 1); // insert the dependency above the item that // requires it s.splice(j, 0, b[0]); // only swap two dependencies once to short circut // circular dependencies done[doneKey] = true; // keep working moved = true; break; } } // jump out of loop if we moved something if (moved) { break; // this item is sorted, move our pointer and keep going } else { p++; } } // when we make it here and moved is false, we are // finished sorting if (!moved) { break; } } this.sorted = s; }, /** * Handles the actual insertion of script/link tags * @method _insert * @private * @param {Object} source The YUI instance the request came from * @param {Object} o The metadata to include * @param {String} type JS or CSS * @param {Boolean} [skipcalc=false] Do a Loader.calculate on the meta */ _insert: function(source, o, type, skipcalc) { // restore the state at the time of the request if (source) { this._config(source); } // build the dependency list // don't include type so we can process CSS and script in // one pass when the type is not specified. var modules = this.resolve(!skipcalc), self = this, comp = 0, actions = 0, mods = {}, deps, complete; self._refetch = []; if (type) { //Filter out the opposite type and reset the array so the checks later work modules[((type === JS) ? CSS : JS)] = []; } if (!self.fetchCSS) { modules.css = []; } if (modules.js.length) { comp++; } if (modules.css.length) { comp++; } //console.log('Resolved Modules: ', modules); complete = function(d) { actions++; var errs = {}, i = 0, o = 0, u = '', fn, modName, resMods; if (d && d.errors) { for (i = 0; i < d.errors.length; i++) { if (d.errors[i].request) { u = d.errors[i].request.url; } else { u = d.errors[i]; } errs[u] = u; } } if (d && d.data && d.data.length && (d.type === 'success')) { for (i = 0; i < d.data.length; i++) { self.inserted[d.data[i].name] = true; //If the external module has a skin or a lang, reprocess it if (d.data[i].lang || d.data[i].skinnable) { delete self.inserted[d.data[i].name]; self._refetch.push(d.data[i].name); } } } if (actions === comp) { self._loading = null; if (self._refetch.length) { //Get the deps for the new meta-data and reprocess for (i = 0; i < self._refetch.length; i++) { deps = self.getRequires(self.getModule(self._refetch[i])); for (o = 0; o < deps.length; o++) { if (!self.inserted[deps[o]]) { //We wouldn't be to this point without the module being here mods[deps[o]] = deps[o]; } } } mods = Y.Object.keys(mods); if (mods.length) { self.require(mods); resMods = self.resolve(true); if (resMods.cssMods.length) { for (i=0; i < resMods.cssMods.length; i++) { modName = resMods.cssMods[i].name; delete YUI.Env._cssLoaded[modName]; if (self.isCSSLoaded(modName)) { self.inserted[modName] = true; delete self.required[modName]; } } self.sorted = []; self._sort(); } d = null; //bail self._insert(); //insert the new deps } } if (d && d.fn) { fn = d.fn; delete d.fn; fn.call(self, d); } } }; this._loading = true; if (!modules.js.length && !modules.css.length) { actions = -1; complete({ fn: self._onSuccess }); return; } if (modules.css.length) { //Load CSS first Y.Get.css(modules.css, { data: modules.cssMods, attributes: self.cssAttributes, insertBefore: self.insertBefore, charset: self.charset, timeout: self.timeout, context: self, onProgress: function(e) { self._onProgress.call(self, e); }, onTimeout: function(d) { self._onTimeout.call(self, d); }, onSuccess: function(d) { d.type = 'success'; d.fn = self._onSuccess; complete.call(self, d); }, onFailure: function(d) { d.type = 'failure'; d.fn = self._onFailure; complete.call(self, d); } }); } if (modules.js.length) { Y.Get.js(modules.js, { data: modules.jsMods, insertBefore: self.insertBefore, attributes: self.jsAttributes, charset: self.charset, timeout: self.timeout, autopurge: false, context: self, async: self.async, onProgress: function(e) { self._onProgress.call(self, e); }, onTimeout: function(d) { self._onTimeout.call(self, d); }, onSuccess: function(d) { d.type = 'success'; d.fn = self._onSuccess; complete.call(self, d); }, onFailure: function(d) { d.type = 'failure'; d.fn = self._onFailure; complete.call(self, d); } }); } }, /** * Once a loader operation is completely finished, process any additional queued items. * @method _continue * @private */ _continue: function() { if (!(_queue.running) && _queue.size() > 0) { _queue.running = true; _queue.next()(); } }, /** * inserts the requested modules and their dependencies. * <code>type</code> can be "js" or "css". Both script and * css are inserted if type is not provided. * @method insert * @param {object} o optional options object. * @param {string} type the type of dependency to insert. */ insert: function(o, type, skipsort) { var self = this, copy = Y.merge(this); delete copy.require; delete copy.dirty; _queue.add(function() { self._insert(copy, o, type, skipsort); }); this._continue(); }, /** * Executed every time a module is loaded, and if we are in a load * cycle, we attempt to load the next script. Public so that it * is possible to call this if using a method other than * Y.register to determine when scripts are fully loaded * @method loadNext * @deprecated * @param {string} mname optional the name of the module that has * been loaded (which is usually why it is time to load the next * one). */ loadNext: function() { return; }, /** * Apply filter defined for this instance to a url/path * @method _filter * @param {string} u the string to filter. * @param {string} name the name of the module, if we are processing * a single module as opposed to a combined url. * @return {string} the filtered string. * @private */ _filter: function(u, name, group) { var f = this.filter, hasFilter = name && (name in this.filters), modFilter = hasFilter && this.filters[name], groupName = group || (this.moduleInfo[name] ? this.moduleInfo[name].group : null); if (groupName && this.groups[groupName] && this.groups[groupName].filter) { modFilter = this.groups[groupName].filter; hasFilter = true; } if (u) { if (hasFilter) { f = (L.isString(modFilter)) ? this.FILTER_DEFS[modFilter.toUpperCase()] || null : modFilter; } if (f) { u = u.replace(new RegExp(f.searchExp, 'g'), f.replaceStr); } } return u; }, /** * Generates the full url for a module * @method _url * @param {string} path the path fragment. * @param {String} name The name of the module * @param {String} [base=self.base] The base url to use * @return {string} the full url. * @private */ _url: function(path, name, base) { return this._filter((base || this.base || '') + path, name); }, /** * Returns an Object hash of file arrays built from `loader.sorted` or from an arbitrary list of sorted modules. * @method resolve * @param {Boolean} [calc=false] Perform a loader.calculate() before anything else * @param {Array} [s=loader.sorted] An override for the loader.sorted array * @return {Object} Object hash (js and css) of two arrays of file lists * @example This method can be used as an off-line dep calculator * * var Y = YUI(); * var loader = new Y.Loader({ * filter: 'debug', * base: '../../', * root: 'build/', * combine: true, * require: ['node', 'dd', 'console'] * }); * var out = loader.resolve(true); * */ resolve: function(calc, s) { var len, i, m, url, group, groupName, j, frag, comboSource, comboSources, mods, comboBase, base, urls, u = [], tmpBase, baseLen, resCombos = {}, self = this, comboSep, maxURLLength, inserted = (self.ignoreRegistered) ? {} : self.inserted, resolved = { js: [], jsMods: [], css: [], cssMods: [] }, type = self.loadType || 'js', addSingle; if (self.skin.overrides || self.skin.defaultSkin !== DEFAULT_SKIN || self.ignoreRegistered) { self._resetModules(); } if (calc) { self.calculate(); } s = s || self.sorted; addSingle = function(m) { if (m) { group = (m.group && self.groups[m.group]) || NOT_FOUND; //Always assume it's async if (group.async === false) { m.async = group.async; } url = (m.fullpath) ? self._filter(m.fullpath, s[i]) : self._url(m.path, s[i], group.base || m.base); if (m.attributes || m.async === false) { url = { url: url, async: m.async }; if (m.attributes) { url.attributes = m.attributes; } } resolved[m.type].push(url); resolved[m.type + 'Mods'].push(m); } else { } }; len = s.length; // the default combo base comboBase = self.comboBase; url = comboBase; comboSources = {}; for (i = 0; i < len; i++) { comboSource = comboBase; m = self.getModule(s[i]); groupName = m && m.group; group = self.groups[groupName]; if (groupName && group) { if (!group.combine || m.fullpath) { //This is not a combo module, skip it and load it singly later. addSingle(m); continue; } m.combine = true; if (group.comboBase) { comboSource = group.comboBase; } if ("root" in group && L.isValue(group.root)) { m.root = group.root; } m.comboSep = group.comboSep || self.comboSep; m.maxURLLength = group.maxURLLength || self.maxURLLength; } else { if (!self.combine) { //This is not a combo module, skip it and load it singly later. addSingle(m); continue; } } comboSources[comboSource] = comboSources[comboSource] || []; comboSources[comboSource].push(m); } for (j in comboSources) { if (comboSources.hasOwnProperty(j)) { resCombos[j] = resCombos[j] || { js: [], jsMods: [], css: [], cssMods: [] }; url = j; mods = comboSources[j]; len = mods.length; if (len) { for (i = 0; i < len; i++) { if (inserted[mods[i]]) { continue; } m = mods[i]; // Do not try to combine non-yui JS unless combo def // is found if (m && (m.combine || !m.ext)) { resCombos[j].comboSep = m.comboSep; resCombos[j].group = m.group; resCombos[j].maxURLLength = m.maxURLLength; frag = ((L.isValue(m.root)) ? m.root : self.root) + (m.path || m.fullpath); frag = self._filter(frag, m.name); resCombos[j][m.type].push(frag); resCombos[j][m.type + 'Mods'].push(m); } else { //Add them to the next process.. if (mods[i]) { addSingle(mods[i]); } } } } } } for (j in resCombos) { if (resCombos.hasOwnProperty(j)) { base = j; comboSep = resCombos[base].comboSep || self.comboSep; maxURLLength = resCombos[base].maxURLLength || self.maxURLLength; for (type in resCombos[base]) { if (type === JS || type === CSS) { urls = resCombos[base][type]; mods = resCombos[base][type + 'Mods']; len = urls.length; tmpBase = base + urls.join(comboSep); baseLen = tmpBase.length; if (maxURLLength <= base.length) { maxURLLength = MAX_URL_LENGTH; } if (len) { if (baseLen > maxURLLength) { u = []; for (s = 0; s < len; s++) { u.push(urls[s]); tmpBase = base + u.join(comboSep); if (tmpBase.length > maxURLLength) { m = u.pop(); tmpBase = base + u.join(comboSep); resolved[type].push(self._filter(tmpBase, null, resCombos[base].group)); u = []; if (m) { u.push(m); } } } if (u.length) { tmpBase = base + u.join(comboSep); resolved[type].push(self._filter(tmpBase, null, resCombos[base].group)); } } else { resolved[type].push(self._filter(tmpBase, null, resCombos[base].group)); } } resolved[type + 'Mods'] = resolved[type + 'Mods'].concat(mods); } } } } resCombos = null; return resolved; }, /** Shortcut to calculate, resolve and load all modules. var loader = new Y.Loader({ ignoreRegistered: true, modules: { mod: { path: 'mod.js' } }, requires: [ 'mod' ] }); loader.load(function() { console.log('All modules have loaded..'); }); @method load @param {Callback} cb Executed after all load operations are complete */ load: function(cb) { if (!cb) { return; } var self = this, out = self.resolve(true); self.data = out; self.onEnd = function() { cb.apply(self.context || self, arguments); }; self.insert(); } }; }, '@VERSION@', {"requires": ["get", "features"]}); YUI.add('loader-rollup', function (Y, NAME) { /** * Optional automatic rollup logic for reducing http connections * when not using a combo service. * @module loader * @submodule rollup */ /** * Look for rollup packages to determine if all of the modules a * rollup supersedes are required. If so, include the rollup to * help reduce the total number of connections required. Called * by calculate(). This is an optional feature, and requires the * appropriate submodule to function. * @method _rollup * @for Loader * @private */ Y.Loader.prototype._rollup = function() { var i, j, m, s, r = this.required, roll, info = this.moduleInfo, rolled, c, smod; // find and cache rollup modules if (this.dirty || !this.rollups) { this.rollups = {}; for (i in info) { if (info.hasOwnProperty(i)) { m = this.getModule(i); // if (m && m.rollup && m.supersedes) { if (m && m.rollup) { this.rollups[i] = m; } } } } // make as many passes as needed to pick up rollup rollups for (;;) { rolled = false; // go through the rollup candidates for (i in this.rollups) { if (this.rollups.hasOwnProperty(i)) { // there can be only one, unless forced if (!r[i] && ((!this.loaded[i]) || this.forceMap[i])) { m = this.getModule(i); s = m.supersedes || []; roll = false; // @TODO remove continue if (!m.rollup) { continue; } c = 0; // check the threshold for (j = 0; j < s.length; j++) { smod = info[s[j]]; // if the superseded module is loaded, we can't // load the rollup unless it has been forced. if (this.loaded[s[j]] && !this.forceMap[s[j]]) { roll = false; break; // increment the counter if this module is required. // if we are beyond the rollup threshold, we will // use the rollup module } else if (r[s[j]] && m.type === smod.type) { c++; roll = (c >= m.rollup); if (roll) { break; } } } if (roll) { // add the rollup r[i] = true; rolled = true; // expand the rollup's dependencies this.getRequires(m); } } } } // if we made it here w/o rolling up something, we are done if (!rolled) { break; } } }; }, '@VERSION@', {"requires": ["loader-base"]}); YUI.add('loader-yui3', function (Y, NAME) { /* This file is auto-generated by (yogi loader --yes --mix --start ../) */ /*jshint maxlen:900, eqeqeq: false */ /** * YUI 3 module metadata * @module loader * @submodule loader-yui3 */ YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || {}; Y.mix(YUI.Env[Y.version].modules, { "align-plugin": { "requires": [ "node-screen", "node-pluginhost" ] }, "anim": { "use": [ "anim-base", "anim-color", "anim-curve", "anim-easing", "anim-node-plugin", "anim-scroll", "anim-xy" ] }, "anim-base": { "requires": [ "base-base", "node-style" ] }, "anim-color": { "requires": [ "anim-base" ] }, "anim-curve": { "requires": [ "anim-xy" ] }, "anim-easing": { "requires": [ "anim-base" ] }, "anim-node-plugin": { "requires": [ "node-pluginhost", "anim-base" ] }, "anim-scroll": { "requires": [ "anim-base" ] }, "anim-shape": { "requires": [ "anim-base", "anim-easing", "anim-color", "matrix" ] }, "anim-shape-transform": { "use": [ "anim-shape" ] }, "anim-xy": { "requires": [ "anim-base", "node-screen" ] }, "app": { "use": [ "app-base", "app-content", "app-transitions", "lazy-model-list", "model", "model-list", "model-sync-rest", "router", "view", "view-node-map" ] }, "app-base": { "requires": [ "classnamemanager", "pjax-base", "router", "view" ] }, "app-content": { "requires": [ "app-base", "pjax-content" ] }, "app-transitions": { "requires": [ "app-base" ] }, "app-transitions-css": { "type": "css" }, "app-transitions-native": { "condition": { "name": "app-transitions-native", "test": function (Y) { var doc = Y.config.doc, node = doc ? doc.documentElement : null; if (node && node.style) { return ('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style); } return false; }, "trigger": "app-transitions" }, "requires": [ "app-transitions", "app-transitions-css", "parallel", "transition" ] }, "array-extras": { "requires": [ "yui-base" ] }, "array-invoke": { "requires": [ "yui-base" ] }, "arraylist": { "requires": [ "yui-base" ] }, "arraylist-add": { "requires": [ "arraylist" ] }, "arraylist-filter": { "requires": [ "arraylist" ] }, "arraysort": { "requires": [ "yui-base" ] }, "async-queue": { "requires": [ "event-custom" ] }, "attribute": { "use": [ "attribute-base", "attribute-complex" ] }, "attribute-base": { "requires": [ "attribute-core", "attribute-observable", "attribute-extras" ] }, "attribute-complex": { "requires": [ "attribute-base" ] }, "attribute-core": { "requires": [ "oop" ] }, "attribute-events": { "use": [ "attribute-observable" ] }, "attribute-extras": { "requires": [ "oop" ] }, "attribute-observable": { "requires": [ "event-custom" ] }, "autocomplete": { "use": [ "autocomplete-base", "autocomplete-sources", "autocomplete-list", "autocomplete-plugin" ] }, "autocomplete-base": { "optional": [ "autocomplete-sources" ], "requires": [ "array-extras", "base-build", "escape", "event-valuechange", "node-base" ] }, "autocomplete-filters": { "requires": [ "array-extras", "text-wordbreak" ] }, "autocomplete-filters-accentfold": { "requires": [ "array-extras", "text-accentfold", "text-wordbreak" ] }, "autocomplete-highlighters": { "requires": [ "array-extras", "highlight-base" ] }, "autocomplete-highlighters-accentfold": { "requires": [ "array-extras", "highlight-accentfold" ] }, "autocomplete-list": { "after": [ "autocomplete-sources" ], "lang": [ "en", "es", "it" ], "requires": [ "autocomplete-base", "event-resize", "node-screen", "selector-css3", "shim-plugin", "widget", "widget-position", "widget-position-align" ], "skinnable": true }, "autocomplete-list-keys": { "condition": { "name": "autocomplete-list-keys", "test": function (Y) { // Only add keyboard support to autocomplete-list if this doesn't appear to // be an iOS or Android-based mobile device. // // There's currently no feasible way to actually detect whether a device has // a hardware keyboard, so this sniff will have to do. It can easily be // overridden by manually loading the autocomplete-list-keys module. // // Worth noting: even though iOS supports bluetooth keyboards, Mobile Safari // doesn't fire the keyboard events used by AutoCompleteList, so there's // no point loading the -keys module even when a bluetooth keyboard may be // available. return !(Y.UA.ios || Y.UA.android); }, "trigger": "autocomplete-list" }, "requires": [ "autocomplete-list", "base-build" ] }, "autocomplete-plugin": { "requires": [ "autocomplete-list", "node-pluginhost" ] }, "autocomplete-sources": { "optional": [ "io-base", "json-parse", "jsonp", "yql" ], "requires": [ "autocomplete-base" ] }, "axes": { "use": [ "axis-numeric", "axis-category", "axis-time", "axis-stacked" ] }, "axes-base": { "use": [ "axis-numeric-base", "axis-category-base", "axis-time-base", "axis-stacked-base" ] }, "axis": { "requires": [ "dom", "widget", "widget-position", "widget-stack", "graphics", "axis-base" ] }, "axis-base": { "requires": [ "classnamemanager", "datatype-number", "datatype-date", "base", "event-custom" ] }, "axis-category": { "requires": [ "axis", "axis-category-base" ] }, "axis-category-base": { "requires": [ "axis-base" ] }, "axis-numeric": { "requires": [ "axis", "axis-numeric-base" ] }, "axis-numeric-base": { "requires": [ "axis-base" ] }, "axis-stacked": { "requires": [ "axis-numeric", "axis-stacked-base" ] }, "axis-stacked-base": { "requires": [ "axis-numeric-base" ] }, "axis-time": { "requires": [ "axis", "axis-time-base" ] }, "axis-time-base": { "requires": [ "axis-base" ] }, "base": { "use": [ "base-base", "base-pluginhost", "base-build" ] }, "base-base": { "requires": [ "attribute-base", "base-core", "base-observable" ] }, "base-build": { "requires": [ "base-base" ] }, "base-core": { "requires": [ "attribute-core" ] }, "base-observable": { "requires": [ "attribute-observable" ] }, "base-pluginhost": { "requires": [ "base-base", "pluginhost" ] }, "button": { "requires": [ "button-core", "cssbutton", "widget" ] }, "button-core": { "requires": [ "attribute-core", "classnamemanager", "node-base" ] }, "button-group": { "requires": [ "button-plugin", "cssbutton", "widget" ] }, "button-plugin": { "requires": [ "button-core", "cssbutton", "node-pluginhost" ] }, "cache": { "use": [ "cache-base", "cache-offline", "cache-plugin" ] }, "cache-base": { "requires": [ "base" ] }, "cache-offline": { "requires": [ "cache-base", "json" ] }, "cache-plugin": { "requires": [ "plugin", "cache-base" ] }, "calendar": { "lang": [ "de", "en", "es", "es-AR", "fr", "it", "ja", "nb-NO", "nl", "pt-BR", "ru", "zh-HANT-TW" ], "requires": [ "calendar-base", "calendarnavigator" ], "skinnable": true }, "calendar-base": { "lang": [ "de", "en", "es", "es-AR", "fr", "it", "ja", "nb-NO", "nl", "pt-BR", "ru", "zh-HANT-TW" ], "requires": [ "widget", "datatype-date", "datatype-date-math", "cssgrids" ], "skinnable": true }, "calendarnavigator": { "requires": [ "plugin", "classnamemanager", "datatype-date", "node" ], "skinnable": true }, "charts": { "use": [ "charts-base" ] }, "charts-base": { "requires": [ "dom", "event-mouseenter", "event-touch", "graphics-group", "axes", "series-pie", "series-line", "series-marker", "series-area", "series-spline", "series-column", "series-bar", "series-areaspline", "series-combo", "series-combospline", "series-line-stacked", "series-marker-stacked", "series-area-stacked", "series-spline-stacked", "series-column-stacked", "series-bar-stacked", "series-areaspline-stacked", "series-combo-stacked", "series-combospline-stacked" ] }, "charts-legend": { "requires": [ "charts-base" ] }, "classnamemanager": { "requires": [ "yui-base" ] }, "clickable-rail": { "requires": [ "slider-base" ] }, "collection": { "use": [ "array-extras", "arraylist", "arraylist-add", "arraylist-filter", "array-invoke" ] }, "color": { "use": [ "color-base", "color-hsl", "color-harmony" ] }, "color-base": { "requires": [ "yui-base" ] }, "color-harmony": { "requires": [ "color-hsl" ] }, "color-hsl": { "requires": [ "color-base" ] }, "color-hsv": { "requires": [ "color-base" ] }, "console": { "lang": [ "en", "es", "it", "ja" ], "requires": [ "yui-log", "widget" ], "skinnable": true }, "console-filters": { "requires": [ "plugin", "console" ], "skinnable": true }, "controller": { "use": [ "router" ] }, "cookie": { "requires": [ "yui-base" ] }, "createlink-base": { "requires": [ "editor-base" ] }, "cssbase": { "after": [ "cssreset", "cssfonts", "cssgrids", "cssreset-context", "cssfonts-context", "cssgrids-context" ], "type": "css" }, "cssbase-context": { "after": [ "cssreset", "cssfonts", "cssgrids", "cssreset-context", "cssfonts-context", "cssgrids-context" ], "type": "css" }, "cssbutton": { "type": "css" }, "cssfonts": { "type": "css" }, "cssfonts-context": { "type": "css" }, "cssgrids": { "optional": [ "cssreset", "cssfonts" ], "type": "css" }, "cssgrids-base": { "optional": [ "cssreset", "cssfonts" ], "type": "css" }, "cssgrids-responsive": { "optional": [ "cssreset", "cssfonts" ], "requires": [ "cssgrids", "cssgrids-responsive-base" ], "type": "css" }, "cssgrids-units": { "optional": [ "cssreset", "cssfonts" ], "requires": [ "cssgrids-base" ], "type": "css" }, "cssnormalize": { "type": "css" }, "cssnormalize-context": { "type": "css" }, "cssreset": { "type": "css" }, "cssreset-context": { "type": "css" }, "dataschema": { "use": [ "dataschema-base", "dataschema-json", "dataschema-xml", "dataschema-array", "dataschema-text" ] }, "dataschema-array": { "requires": [ "dataschema-base" ] }, "dataschema-base": { "requires": [ "base" ] }, "dataschema-json": { "requires": [ "dataschema-base", "json" ] }, "dataschema-text": { "requires": [ "dataschema-base" ] }, "dataschema-xml": { "requires": [ "dataschema-base" ] }, "datasource": { "use": [ "datasource-local", "datasource-io", "datasource-get", "datasource-function", "datasource-cache", "datasource-jsonschema", "datasource-xmlschema", "datasource-arrayschema", "datasource-textschema", "datasource-polling" ] }, "datasource-arrayschema": { "requires": [ "datasource-local", "plugin", "dataschema-array" ] }, "datasource-cache": { "requires": [ "datasource-local", "plugin", "cache-base" ] }, "datasource-function": { "requires": [ "datasource-local" ] }, "datasource-get": { "requires": [ "datasource-local", "get" ] }, "datasource-io": { "requires": [ "datasource-local", "io-base" ] }, "datasource-jsonschema": { "requires": [ "datasource-local", "plugin", "dataschema-json" ] }, "datasource-local": { "requires": [ "base" ] }, "datasource-polling": { "requires": [ "datasource-local" ] }, "datasource-textschema": { "requires": [ "datasource-local", "plugin", "dataschema-text" ] }, "datasource-xmlschema": { "requires": [ "datasource-local", "plugin", "datatype-xml", "dataschema-xml" ] }, "datatable": { "use": [ "datatable-core", "datatable-table", "datatable-head", "datatable-body", "datatable-base", "datatable-column-widths", "datatable-message", "datatable-mutable", "datatable-sort", "datatable-datasource" ] }, "datatable-base": { "requires": [ "datatable-core", "datatable-table", "datatable-head", "datatable-body", "base-build", "widget" ], "skinnable": true }, "datatable-body": { "requires": [ "datatable-core", "view", "classnamemanager" ] }, "datatable-column-widths": { "requires": [ "datatable-base" ] }, "datatable-core": { "requires": [ "escape", "model-list", "node-event-delegate" ] }, "datatable-datasource": { "requires": [ "datatable-base", "plugin", "datasource-local" ] }, "datatable-formatters": { "requires": [ "datatable-body", "datatype-number-format", "datatype-date-format", "escape" ] }, "datatable-head": { "requires": [ "datatable-core", "view", "classnamemanager" ] }, "datatable-message": { "lang": [ "en", "fr", "es", "it" ], "requires": [ "datatable-base" ], "skinnable": true }, "datatable-mutable": { "requires": [ "datatable-base" ] }, "datatable-scroll": { "requires": [ "datatable-base", "datatable-column-widths", "dom-screen" ], "skinnable": true }, "datatable-sort": { "lang": [ "en", "fr", "es" ], "requires": [ "datatable-base" ], "skinnable": true }, "datatable-table": { "requires": [ "datatable-core", "datatable-head", "datatable-body", "view", "classnamemanager" ] }, "datatype": { "use": [ "datatype-date", "datatype-number", "datatype-xml" ] }, "datatype-date": { "use": [ "datatype-date-parse", "datatype-date-format", "datatype-date-math" ] }, "datatype-date-format": { "lang": [ "ar", "ar-JO", "ca", "ca-ES", "da", "da-DK", "de", "de-AT", "de-DE", "el", "el-GR", "en", "en-AU", "en-CA", "en-GB", "en-IE", "en-IN", "en-JO", "en-MY", "en-NZ", "en-PH", "en-SG", "en-US", "es", "es-AR", "es-BO", "es-CL", "es-CO", "es-EC", "es-ES", "es-MX", "es-PE", "es-PY", "es-US", "es-UY", "es-VE", "fi", "fi-FI", "fr", "fr-BE", "fr-CA", "fr-FR", "hi", "hi-IN", "id", "id-ID", "it", "it-IT", "ja", "ja-JP", "ko", "ko-KR", "ms", "ms-MY", "nb", "nb-NO", "nl", "nl-BE", "nl-NL", "pl", "pl-PL", "pt", "pt-BR", "ro", "ro-RO", "ru", "ru-RU", "sv", "sv-SE", "th", "th-TH", "tr", "tr-TR", "vi", "vi-VN", "zh-Hans", "zh-Hans-CN", "zh-Hant", "zh-Hant-HK", "zh-Hant-TW" ] }, "datatype-date-math": { "requires": [ "yui-base" ] }, "datatype-date-parse": {}, "datatype-number": { "use": [ "datatype-number-parse", "datatype-number-format" ] }, "datatype-number-format": {}, "datatype-number-parse": {}, "datatype-xml": { "use": [ "datatype-xml-parse", "datatype-xml-format" ] }, "datatype-xml-format": {}, "datatype-xml-parse": {}, "dd": { "use": [ "dd-ddm-base", "dd-ddm", "dd-ddm-drop", "dd-drag", "dd-proxy", "dd-constrain", "dd-drop", "dd-scroll", "dd-delegate" ] }, "dd-constrain": { "requires": [ "dd-drag" ] }, "dd-ddm": { "requires": [ "dd-ddm-base", "event-resize" ] }, "dd-ddm-base": { "requires": [ "node", "base", "yui-throttle", "classnamemanager" ] }, "dd-ddm-drop": { "requires": [ "dd-ddm" ] }, "dd-delegate": { "requires": [ "dd-drag", "dd-drop-plugin", "event-mouseenter" ] }, "dd-drag": { "requires": [ "dd-ddm-base" ] }, "dd-drop": { "requires": [ "dd-drag", "dd-ddm-drop" ] }, "dd-drop-plugin": { "requires": [ "dd-drop" ] }, "dd-gestures": { "condition": { "name": "dd-gestures", "trigger": "dd-drag", "ua": "touchEnabled" }, "requires": [ "dd-drag", "event-synthetic", "event-gestures" ] }, "dd-plugin": { "optional": [ "dd-constrain", "dd-proxy" ], "requires": [ "dd-drag" ] }, "dd-proxy": { "requires": [ "dd-drag" ] }, "dd-scroll": { "requires": [ "dd-drag" ] }, "dial": { "lang": [ "en", "es" ], "requires": [ "widget", "dd-drag", "event-mouseenter", "event-move", "event-key", "transition", "intl" ], "skinnable": true }, "dom": { "use": [ "dom-base", "dom-screen", "dom-style", "selector-native", "selector" ] }, "dom-base": { "requires": [ "dom-core" ] }, "dom-core": { "requires": [ "oop", "features" ] }, "dom-deprecated": { "requires": [ "dom-base" ] }, "dom-screen": { "requires": [ "dom-base", "dom-style" ] }, "dom-style": { "requires": [ "dom-base", "color-base" ] }, "dom-style-ie": { "condition": { "name": "dom-style-ie", "test": function (Y) { var testFeature = Y.Features.test, addFeature = Y.Features.add, WINDOW = Y.config.win, DOCUMENT = Y.config.doc, DOCUMENT_ELEMENT = 'documentElement', ret = false; addFeature('style', 'computedStyle', { test: function() { return WINDOW && 'getComputedStyle' in WINDOW; } }); addFeature('style', 'opacity', { test: function() { return DOCUMENT && 'opacity' in DOCUMENT[DOCUMENT_ELEMENT].style; } }); ret = (!testFeature('style', 'opacity') && !testFeature('style', 'computedStyle')); return ret; }, "trigger": "dom-style" }, "requires": [ "dom-style" ] }, "dump": { "requires": [ "yui-base" ] }, "editor": { "use": [ "frame", "editor-selection", "exec-command", "editor-base", "editor-para", "editor-br", "editor-bidi", "editor-tab", "createlink-base" ] }, "editor-base": { "requires": [ "base", "frame", "node", "exec-command", "editor-selection" ] }, "editor-bidi": { "requires": [ "editor-base" ] }, "editor-br": { "requires": [ "editor-base" ] }, "editor-lists": { "requires": [ "editor-base" ] }, "editor-para": { "requires": [ "editor-para-base" ] }, "editor-para-base": { "requires": [ "editor-base" ] }, "editor-para-ie": { "condition": { "name": "editor-para-ie", "trigger": "editor-para", "ua": "ie", "when": "instead" }, "requires": [ "editor-para-base" ] }, "editor-selection": { "requires": [ "node" ] }, "editor-tab": { "requires": [ "editor-base" ] }, "escape": { "requires": [ "yui-base" ] }, "event": { "after": [ "node-base" ], "use": [ "event-base", "event-delegate", "event-synthetic", "event-mousewheel", "event-mouseenter", "event-key", "event-focus", "event-resize", "event-hover", "event-outside", "event-touch", "event-move", "event-flick", "event-valuechange", "event-tap" ] }, "event-base": { "after": [ "node-base" ], "requires": [ "event-custom-base" ] }, "event-base-ie": { "after": [ "event-base" ], "condition": { "name": "event-base-ie", "test": function(Y) { var imp = Y.config.doc && Y.config.doc.implementation; return (imp && (!imp.hasFeature('Events', '2.0'))); }, "trigger": "node-base" }, "requires": [ "node-base" ] }, "event-contextmenu": { "requires": [ "event-synthetic", "dom-screen" ] }, "event-custom": { "use": [ "event-custom-base", "event-custom-complex" ] }, "event-custom-base": { "requires": [ "oop" ] }, "event-custom-complex": { "requires": [ "event-custom-base" ] }, "event-delegate": { "requires": [ "node-base" ] }, "event-flick": { "requires": [ "node-base", "event-touch", "event-synthetic" ] }, "event-focus": { "requires": [ "event-synthetic" ] }, "event-gestures": { "use": [ "event-flick", "event-move" ] }, "event-hover": { "requires": [ "event-mouseenter" ] }, "event-key": { "requires": [ "event-synthetic" ] }, "event-mouseenter": { "requires": [ "event-synthetic" ] }, "event-mousewheel": { "requires": [ "node-base" ] }, "event-move": { "requires": [ "node-base", "event-touch", "event-synthetic" ] }, "event-outside": { "requires": [ "event-synthetic" ] }, "event-resize": { "requires": [ "node-base", "event-synthetic" ] }, "event-simulate": { "requires": [ "event-base" ] }, "event-synthetic": { "requires": [ "node-base", "event-custom-complex" ] }, "event-tap": { "requires": [ "node-base", "event-base", "event-touch", "event-synthetic" ] }, "event-touch": { "requires": [ "node-base" ] }, "event-valuechange": { "requires": [ "event-focus", "event-synthetic" ] }, "exec-command": { "requires": [ "frame" ] }, "features": { "requires": [ "yui-base" ] }, "file": { "requires": [ "file-flash", "file-html5" ] }, "file-flash": { "requires": [ "base" ] }, "file-html5": { "requires": [ "base" ] }, "frame": { "requires": [ "base", "node", "selector-css3", "yui-throttle" ] }, "gesture-simulate": { "requires": [ "async-queue", "event-simulate", "node-screen" ] }, "get": { "requires": [ "yui-base" ] }, "graphics": { "requires": [ "node", "event-custom", "pluginhost", "matrix", "classnamemanager" ] }, "graphics-canvas": { "condition": { "name": "graphics-canvas", "test": function(Y) { var DOCUMENT = Y.config.doc, useCanvas = Y.config.defaultGraphicEngine && Y.config.defaultGraphicEngine == "canvas", canvas = DOCUMENT && DOCUMENT.createElement("canvas"), svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1")); return (!svg || useCanvas) && (canvas && canvas.getContext && canvas.getContext("2d")); }, "trigger": "graphics" }, "requires": [ "graphics" ] }, "graphics-canvas-default": { "condition": { "name": "graphics-canvas-default", "test": function(Y) { var DOCUMENT = Y.config.doc, useCanvas = Y.config.defaultGraphicEngine && Y.config.defaultGraphicEngine == "canvas", canvas = DOCUMENT && DOCUMENT.createElement("canvas"), svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1")); return (!svg || useCanvas) && (canvas && canvas.getContext && canvas.getContext("2d")); }, "trigger": "graphics" } }, "graphics-group": { "requires": [ "graphics" ] }, "graphics-svg": { "condition": { "name": "graphics-svg", "test": function(Y) { var DOCUMENT = Y.config.doc, useSVG = !Y.config.defaultGraphicEngine || Y.config.defaultGraphicEngine != "canvas", canvas = DOCUMENT && DOCUMENT.createElement("canvas"), svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1")); return svg && (useSVG || !canvas); }, "trigger": "graphics" }, "requires": [ "graphics" ] }, "graphics-svg-default": { "condition": { "name": "graphics-svg-default", "test": function(Y) { var DOCUMENT = Y.config.doc, useSVG = !Y.config.defaultGraphicEngine || Y.config.defaultGraphicEngine != "canvas", canvas = DOCUMENT && DOCUMENT.createElement("canvas"), svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1")); return svg && (useSVG || !canvas); }, "trigger": "graphics" } }, "graphics-vml": { "condition": { "name": "graphics-vml", "test": function(Y) { var DOCUMENT = Y.config.doc, canvas = DOCUMENT && DOCUMENT.createElement("canvas"); return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (!canvas || !canvas.getContext || !canvas.getContext("2d"))); }, "trigger": "graphics" }, "requires": [ "graphics" ] }, "graphics-vml-default": { "condition": { "name": "graphics-vml-default", "test": function(Y) { var DOCUMENT = Y.config.doc, canvas = DOCUMENT && DOCUMENT.createElement("canvas"); return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (!canvas || !canvas.getContext || !canvas.getContext("2d"))); }, "trigger": "graphics" } }, "handlebars": { "use": [ "handlebars-compiler" ] }, "handlebars-base": { "requires": [] }, "handlebars-compiler": { "requires": [ "handlebars-base" ] }, "highlight": { "use": [ "highlight-base", "highlight-accentfold" ] }, "highlight-accentfold": { "requires": [ "highlight-base", "text-accentfold" ] }, "highlight-base": { "requires": [ "array-extras", "classnamemanager", "escape", "text-wordbreak" ] }, "history": { "use": [ "history-base", "history-hash", "history-hash-ie", "history-html5" ] }, "history-base": { "requires": [ "event-custom-complex" ] }, "history-hash": { "after": [ "history-html5" ], "requires": [ "event-synthetic", "history-base", "yui-later" ] }, "history-hash-ie": { "condition": { "name": "history-hash-ie", "test": function (Y) { var docMode = Y.config.doc && Y.config.doc.documentMode; return Y.UA.ie && (!('onhashchange' in Y.config.win) || !docMode || docMode < 8); }, "trigger": "history-hash" }, "requires": [ "history-hash", "node-base" ] }, "history-html5": { "optional": [ "json" ], "requires": [ "event-base", "history-base", "node-base" ] }, "imageloader": { "requires": [ "base-base", "node-style", "node-screen" ] }, "intl": { "requires": [ "intl-base", "event-custom" ] }, "intl-base": { "requires": [ "yui-base" ] }, "io": { "use": [ "io-base", "io-xdr", "io-form", "io-upload-iframe", "io-queue" ] }, "io-base": { "requires": [ "event-custom-base", "querystring-stringify-simple" ] }, "io-form": { "requires": [ "io-base", "node-base" ] }, "io-nodejs": { "condition": { "name": "io-nodejs", "trigger": "io-base", "ua": "nodejs" }, "requires": [ "io-base" ] }, "io-queue": { "requires": [ "io-base", "queue-promote" ] }, "io-upload-iframe": { "requires": [ "io-base", "node-base" ] }, "io-xdr": { "requires": [ "io-base", "datatype-xml-parse" ] }, "json": { "use": [ "json-parse", "json-stringify" ] }, "json-parse": { "requires": [ "yui-base" ] }, "json-parse-shim": { "condition": { "name": "json-parse-shim", "test": function (Y) { var _JSON = Y.config.global.JSON, Native = Object.prototype.toString.call(_JSON) === '[object JSON]' && _JSON, nativeSupport = Y.config.useNativeJSONParse !== false && !!Native; function workingNative( k, v ) { return k === "ok" ? true : v; } // Double check basic functionality. This is mainly to catch early broken // implementations of the JSON API in Firefox 3.1 beta1 and beta2 if ( nativeSupport ) { try { nativeSupport = ( Native.parse( '{"ok":false}', workingNative ) ).ok; } catch ( e ) { nativeSupport = false; } } return !nativeSupport; }, "trigger": "json-parse" }, "requires": [ "json-parse" ] }, "json-stringify": { "requires": [ "yui-base" ] }, "json-stringify-shim": { "condition": { "name": "json-stringify-shim", "test": function (Y) { var _JSON = Y.config.global.JSON, Native = Object.prototype.toString.call(_JSON) === '[object JSON]' && _JSON, nativeSupport = Y.config.useNativeJSONStringify !== false && !!Native; // Double check basic native functionality. This is primarily to catch broken // early JSON API implementations in Firefox 3.1 beta1 and beta2. if ( nativeSupport ) { try { nativeSupport = ( '0' === Native.stringify(0) ); } catch ( e ) { nativeSupport = false; } } return !nativeSupport; }, "trigger": "json-stringify" }, "requires": [ "json-stringify" ] }, "jsonp": { "requires": [ "get", "oop" ] }, "jsonp-url": { "requires": [ "jsonp" ] }, "lazy-model-list": { "requires": [ "model-list" ] }, "loader": { "use": [ "loader-base", "loader-rollup", "loader-yui3" ] }, "loader-base": { "requires": [ "get", "features" ] }, "loader-rollup": { "requires": [ "loader-base" ] }, "loader-yui3": { "requires": [ "loader-base" ] }, "matrix": { "requires": [ "yui-base" ] }, "model": { "requires": [ "base-build", "escape", "json-parse" ] }, "model-list": { "requires": [ "array-extras", "array-invoke", "arraylist", "base-build", "escape", "json-parse", "model" ] }, "model-sync-rest": { "requires": [ "model", "io-base", "json-stringify" ] }, "node": { "use": [ "node-base", "node-event-delegate", "node-pluginhost", "node-screen", "node-style" ] }, "node-base": { "requires": [ "event-base", "node-core", "dom-base" ] }, "node-core": { "requires": [ "dom-core", "selector" ] }, "node-deprecated": { "requires": [ "node-base" ] }, "node-event-delegate": { "requires": [ "node-base", "event-delegate" ] }, "node-event-html5": { "requires": [ "node-base" ] }, "node-event-simulate": { "requires": [ "node-base", "event-simulate", "gesture-simulate" ] }, "node-flick": { "requires": [ "classnamemanager", "transition", "event-flick", "plugin" ], "skinnable": true }, "node-focusmanager": { "requires": [ "attribute", "node", "plugin", "node-event-simulate", "event-key", "event-focus" ] }, "node-load": { "requires": [ "node-base", "io-base" ] }, "node-menunav": { "requires": [ "node", "classnamemanager", "plugin", "node-focusmanager" ], "skinnable": true }, "node-pluginhost": { "requires": [ "node-base", "pluginhost" ] }, "node-screen": { "requires": [ "dom-screen", "node-base" ] }, "node-scroll-info": { "requires": [ "base-build", "dom-screen", "event-resize", "node-pluginhost", "plugin" ] }, "node-style": { "requires": [ "dom-style", "node-base" ] }, "oop": { "requires": [ "yui-base" ] }, "overlay": { "requires": [ "widget", "widget-stdmod", "widget-position", "widget-position-align", "widget-stack", "widget-position-constrain" ], "skinnable": true }, "panel": { "requires": [ "widget", "widget-autohide", "widget-buttons", "widget-modality", "widget-position", "widget-position-align", "widget-position-constrain", "widget-stack", "widget-stdmod" ], "skinnable": true }, "parallel": { "requires": [ "yui-base" ] }, "pjax": { "requires": [ "pjax-base", "pjax-content" ] }, "pjax-base": { "requires": [ "classnamemanager", "node-event-delegate", "router" ] }, "pjax-content": { "requires": [ "io-base", "node-base", "router" ] }, "pjax-plugin": { "requires": [ "node-pluginhost", "pjax", "plugin" ] }, "plugin": { "requires": [ "base-base" ] }, "pluginhost": { "use": [ "pluginhost-base", "pluginhost-config" ] }, "pluginhost-base": { "requires": [ "yui-base" ] }, "pluginhost-config": { "requires": [ "pluginhost-base" ] }, "promise": { "requires": [ "timers" ] }, "querystring": { "use": [ "querystring-parse", "querystring-stringify" ] }, "querystring-parse": { "requires": [ "yui-base", "array-extras" ] }, "querystring-parse-simple": { "requires": [ "yui-base" ] }, "querystring-stringify": { "requires": [ "yui-base" ] }, "querystring-stringify-simple": { "requires": [ "yui-base" ] }, "queue-promote": { "requires": [ "yui-base" ] }, "range-slider": { "requires": [ "slider-base", "slider-value-range", "clickable-rail" ] }, "recordset": { "use": [ "recordset-base", "recordset-sort", "recordset-filter", "recordset-indexer" ] }, "recordset-base": { "requires": [ "base", "arraylist" ] }, "recordset-filter": { "requires": [ "recordset-base", "array-extras", "plugin" ] }, "recordset-indexer": { "requires": [ "recordset-base", "plugin" ] }, "recordset-sort": { "requires": [ "arraysort", "recordset-base", "plugin" ] }, "resize": { "use": [ "resize-base", "resize-proxy", "resize-constrain" ] }, "resize-base": { "requires": [ "base", "widget", "event", "oop", "dd-drag", "dd-delegate", "dd-drop" ], "skinnable": true }, "resize-constrain": { "requires": [ "plugin", "resize-base" ] }, "resize-plugin": { "optional": [ "resize-constrain" ], "requires": [ "resize-base", "plugin" ] }, "resize-proxy": { "requires": [ "plugin", "resize-base" ] }, "router": { "optional": [ "querystring-parse" ], "requires": [ "array-extras", "base-build", "history" ] }, "scrollview": { "requires": [ "scrollview-base", "scrollview-scrollbars" ] }, "scrollview-base": { "requires": [ "widget", "event-gestures", "event-mousewheel", "transition" ], "skinnable": true }, "scrollview-base-ie": { "condition": { "name": "scrollview-base-ie", "trigger": "scrollview-base", "ua": "ie" }, "requires": [ "scrollview-base" ] }, "scrollview-list": { "requires": [ "plugin", "classnamemanager" ], "skinnable": true }, "scrollview-paginator": { "requires": [ "plugin", "classnamemanager" ] }, "scrollview-scrollbars": { "requires": [ "classnamemanager", "transition", "plugin" ], "skinnable": true }, "selector": { "requires": [ "selector-native" ] }, "selector-css2": { "condition": { "name": "selector-css2", "test": function (Y) { var DOCUMENT = Y.config.doc, ret = DOCUMENT && !('querySelectorAll' in DOCUMENT); return ret; }, "trigger": "selector" }, "requires": [ "selector-native" ] }, "selector-css3": { "requires": [ "selector-native", "selector-css2" ] }, "selector-native": { "requires": [ "dom-base" ] }, "series-area": { "requires": [ "series-cartesian", "series-fill-util" ] }, "series-area-stacked": { "requires": [ "series-stacked", "series-area" ] }, "series-areaspline": { "requires": [ "series-area", "series-curve-util" ] }, "series-areaspline-stacked": { "requires": [ "series-stacked", "series-areaspline" ] }, "series-bar": { "requires": [ "series-marker", "series-histogram-base" ] }, "series-bar-stacked": { "requires": [ "series-stacked", "series-bar" ] }, "series-base": { "requires": [ "graphics", "axis-base" ] }, "series-candlestick": { "requires": [ "series-range" ] }, "series-cartesian": { "requires": [ "series-base" ] }, "series-column": { "requires": [ "series-marker", "series-histogram-base" ] }, "series-column-stacked": { "requires": [ "series-stacked", "series-column" ] }, "series-combo": { "requires": [ "series-cartesian", "series-line-util", "series-plot-util", "series-fill-util" ] }, "series-combo-stacked": { "requires": [ "series-stacked", "series-combo" ] }, "series-combospline": { "requires": [ "series-combo", "series-curve-util" ] }, "series-combospline-stacked": { "requires": [ "series-combo-stacked", "series-curve-util" ] }, "series-curve-util": {}, "series-fill-util": {}, "series-histogram-base": { "requires": [ "series-cartesian", "series-plot-util" ] }, "series-line": { "requires": [ "series-cartesian", "series-line-util" ] }, "series-line-stacked": { "requires": [ "series-stacked", "series-line" ] }, "series-line-util": {}, "series-marker": { "requires": [ "series-cartesian", "series-plot-util" ] }, "series-marker-stacked": { "requires": [ "series-stacked", "series-marker" ] }, "series-ohlc": { "requires": [ "series-range" ] }, "series-pie": { "requires": [ "series-base", "series-plot-util" ] }, "series-plot-util": {}, "series-range": { "requires": [ "series-cartesian" ] }, "series-spline": { "requires": [ "series-line", "series-curve-util" ] }, "series-spline-stacked": { "requires": [ "series-stacked", "series-spline" ] }, "series-stacked": { "requires": [ "axis-stacked" ] }, "shim-plugin": { "requires": [ "node-style", "node-pluginhost" ] }, "slider": { "use": [ "slider-base", "slider-value-range", "clickable-rail", "range-slider" ] }, "slider-base": { "requires": [ "widget", "dd-constrain", "event-key" ], "skinnable": true }, "slider-value-range": { "requires": [ "slider-base" ] }, "sortable": { "requires": [ "dd-delegate", "dd-drop-plugin", "dd-proxy" ] }, "sortable-scroll": { "requires": [ "dd-scroll", "sortable" ] }, "stylesheet": { "requires": [ "yui-base" ] }, "substitute": { "optional": [ "dump" ], "requires": [ "yui-base" ] }, "swf": { "requires": [ "event-custom", "node", "swfdetect", "escape" ] }, "swfdetect": { "requires": [ "yui-base" ] }, "tabview": { "requires": [ "widget", "widget-parent", "widget-child", "tabview-base", "node-pluginhost", "node-focusmanager" ], "skinnable": true }, "tabview-base": { "requires": [ "node-event-delegate", "classnamemanager" ] }, "tabview-plugin": { "requires": [ "tabview-base" ] }, "template": { "use": [ "template-base", "template-micro" ] }, "template-base": { "requires": [ "yui-base" ] }, "template-micro": { "requires": [ "escape" ] }, "test": { "requires": [ "event-simulate", "event-custom", "json-stringify" ] }, "test-console": { "requires": [ "console-filters", "test", "array-extras" ], "skinnable": true }, "text": { "use": [ "text-accentfold", "text-wordbreak" ] }, "text-accentfold": { "requires": [ "array-extras", "text-data-accentfold" ] }, "text-data-accentfold": { "requires": [ "yui-base" ] }, "text-data-wordbreak": { "requires": [ "yui-base" ] }, "text-wordbreak": { "requires": [ "array-extras", "text-data-wordbreak" ] }, "timers": { "requires": [ "yui-base" ] }, "transition": { "requires": [ "node-style" ] }, "transition-timer": { "condition": { "name": "transition-timer", "test": function (Y) { var DOCUMENT = Y.config.doc, node = (DOCUMENT) ? DOCUMENT.documentElement: null, ret = true; if (node && node.style) { ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style); } return ret; }, "trigger": "transition" }, "requires": [ "transition" ] }, "tree": { "requires": [ "base-build", "tree-node" ] }, "tree-labelable": { "requires": [ "tree" ] }, "tree-lazy": { "requires": [ "base-pluginhost", "plugin", "tree" ] }, "tree-node": {}, "tree-openable": { "requires": [ "tree" ] }, "tree-selectable": { "requires": [ "tree" ] }, "tree-sortable": { "requires": [ "tree" ] }, "uploader": { "requires": [ "uploader-html5", "uploader-flash" ] }, "uploader-flash": { "requires": [ "swf", "widget", "base", "cssbutton", "node", "event-custom", "file-flash", "uploader-queue" ] }, "uploader-html5": { "requires": [ "widget", "node-event-simulate", "file-html5", "uploader-queue" ] }, "uploader-queue": { "requires": [ "base" ] }, "view": { "requires": [ "base-build", "node-event-delegate" ] }, "view-node-map": { "requires": [ "view" ] }, "widget": { "use": [ "widget-base", "widget-htmlparser", "widget-skin", "widget-uievents" ] }, "widget-anim": { "requires": [ "anim-base", "plugin", "widget" ] }, "widget-autohide": { "requires": [ "base-build", "event-key", "event-outside", "widget" ] }, "widget-base": { "requires": [ "attribute", "base-base", "base-pluginhost", "classnamemanager", "event-focus", "node-base", "node-style" ], "skinnable": true }, "widget-base-ie": { "condition": { "name": "widget-base-ie", "trigger": "widget-base", "ua": "ie" }, "requires": [ "widget-base" ] }, "widget-buttons": { "requires": [ "button-plugin", "cssbutton", "widget-stdmod" ] }, "widget-child": { "requires": [ "base-build", "widget" ] }, "widget-htmlparser": { "requires": [ "widget-base" ] }, "widget-locale": { "requires": [ "widget-base" ] }, "widget-modality": { "requires": [ "base-build", "event-outside", "widget" ], "skinnable": true }, "widget-parent": { "requires": [ "arraylist", "base-build", "widget" ] }, "widget-position": { "requires": [ "base-build", "node-screen", "widget" ] }, "widget-position-align": { "requires": [ "widget-position" ] }, "widget-position-constrain": { "requires": [ "widget-position" ] }, "widget-skin": { "requires": [ "widget-base" ] }, "widget-stack": { "requires": [ "base-build", "widget" ], "skinnable": true }, "widget-stdmod": { "requires": [ "base-build", "widget" ] }, "widget-uievents": { "requires": [ "node-event-delegate", "widget-base" ] }, "yql": { "requires": [ "oop" ] }, "yql-jsonp": { "condition": { "name": "yql-jsonp", "test": function (Y) { /* Only load the JSONP module when not in nodejs or winjs TODO Make the winjs module a CORS module */ return (!Y.UA.nodejs && !Y.UA.winjs); }, "trigger": "yql", "when": "after" }, "requires": [ "jsonp", "jsonp-url" ] }, "yql-nodejs": { "condition": { "name": "yql-nodejs", "trigger": "yql", "ua": "nodejs", "when": "after" } }, "yql-winjs": { "condition": { "name": "yql-winjs", "trigger": "yql", "ua": "winjs", "when": "after" } }, "yui": {}, "yui-base": {}, "yui-later": { "requires": [ "yui-base" ] }, "yui-log": { "requires": [ "yui-base" ] }, "yui-throttle": { "requires": [ "yui-base" ] } }); YUI.Env[Y.version].md5 = 'd7ced98e3907d3c3c0655a93c6ac6867'; }, '@VERSION@', {"requires": ["loader-base"]}); YUI.add('loader', function (Y, NAME) {}, '@VERSION@', {"use": ["loader-base", "loader-rollup", "loader-yui3"]});
"use strict"; meta.load = function() { meta.preloadTextures("bg-tile", "assets/images"); meta.preloadTextures(MatchGame.Cfg.gems, "assets/images"); var intro = meta.getView("intro"); intro.register("Intro"); var game = meta.getView("game"); game.register("MatchGame"); meta.setView("intro"); };
var http = require("http"); var path = require("path"); var express = require("express"); var bodyParser = require('body-parser'); var formidable = require('formidable'); var fs = require('fs'); var app = express(); // parse application/x-www-form-urlencoded app.use(bodyParser.urlencoded({ extended: false })) // parse application/json app.use(bodyParser.json()) app.use(express.static(__dirname + '/dist/adil-chat-app')); app.get('/*', function (req, res) { res.sendFile(path.join(__dirname + '/dist/adil-chat-app/index.html')); }); // Express CORS setup app.use(function (req, res, next) { // Website you wish to allow to connect res.setHeader('Access-Control-Allow-Origin', 'http://localhost:4200'); // Request methods you wish to allow res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, PATCH, DELETE'); // Request headers you wish to allow res.setHeader('Access-Control-Allow-Headers', 'X-Requested-With,content-type'); // Set to true if you need the website to include cookies in the requests sent // to the API (e.g. in case you use sessions) res.setHeader('Access-Control-Allow-Credentials', true); // Pass to next layer of middleware next(); }); var server = app.listen(process.env.PORT || 8080); var io = require('socket.io').listen(server); //var path = __dirname + '/views/'; var usersCollection = []; // Express routes app.set("view engine", "vash"); app.use("/Uploads", express.static(path.join(__dirname, 'Uploads'))); app.get("*", function (req, res) { res.render("index"); }); app.post("/listFriends", function (req, res) { var clonedArray = usersCollection.slice(); // Getting the userId from the request body as this is just a demo // Ideally in a production application you would change this to a session value or something else var i = usersCollection.findIndex(x => x.participant.id == req.body.userId); clonedArray.splice(i, 1); res.json(clonedArray); }); app.post('/uploadFile', function (req, res) { let form = new formidable.IncomingForm(); let ngChatDestinataryUserId; if (!fs.existsSync("/Uploads")) { fs.mkdirSync("/Uploads"); } form.parse(req) .on('field', function (name, field) { // You must always validate this with your backend logic if (name === 'ng-chat-participant-id') ngChatDestinataryUserId = field; }) .on('fileBegin', function (name, file) { file.path = `${__dirname}/Uploads/${file.name}`; }) .on('file', function (name, file) { console.log('Uploaded ' + file.name); // Push socket IO status let message = { type: 2, // MessageType.File = 2 //fromId: ngChatSenderUserId, fromId will be set by the angular component after receiving the http response toId: ngChatDestinataryUserId, message: file.name, mimeType: file.type, fileSizeInBytes: file.size, downloadUrl: `http://localhost:3000/Uploads/${file.name}` }; console.log("Returning file message:"); console.log(message); res.status(200); res.json(message); }); }); // Socket.io operations io.on('connection', function (socket) { console.log('A user has connected to the server.'); socket.on('join', function (username) { // Same contract as ng-chat.User usersCollection.push({ participant: { id: socket.id, // Assigning the socket ID as the user ID in this example displayName: username, status: 0, // ng-chat UserStatus.Online, avatar: null } }); socket.broadcast.emit("friendsListChanged", usersCollection); console.log(username + " has joined the chat room."); // This is the user's unique ID to be used on ng-chat as the connected user. socket.emit("generatedUserId", socket.id); // On disconnect remove this socket client from the users collection socket.on('disconnect', function () { console.log('User disconnected!'); var i = usersCollection.findIndex(x => x.participant.id == socket.id); usersCollection.splice(i, 1); socket.broadcast.emit("friendsListChanged", usersCollection); }); }); socket.on("sendMessage", function (message) { console.log("Message received:"); console.log(message); console.log(usersCollection.find(x => x.participant.id == message.fromId)); io.to(message.toId).emit("messageReceived", { user: usersCollection.find(x => x.participant.id == message.fromId).participant, message: message }); console.log("Message dispatched."); }); });
var Cancel = axios.Cancel; var CancelToken = axios.CancelToken; var _AbortController = require('abortcontroller-polyfill/dist/cjs-ponyfill.js').AbortController; var AbortController = typeof AbortController === 'function' ? AbortController : _AbortController; describe('cancel', function() { beforeEach(function() { jasmine.Ajax.install(); }); afterEach(function() { jasmine.Ajax.uninstall(); }); describe('when called before sending request', function() { it('rejects Promise with a Cancel object', function(done) { var source = CancelToken.source(); source.cancel('Operation has been canceled.'); axios.get('/foo', { cancelToken: source.token }).catch(function(thrown) { expect(thrown).toEqual(jasmine.any(Cancel)); expect(thrown.message).toBe('Operation has been canceled.'); done(); }); }); }); describe('when called after request has been sent', function() { it('rejects Promise with a Cancel object', function(done) { var source = CancelToken.source(); axios.get('/foo/bar', { cancelToken: source.token }).catch(function(thrown) { expect(thrown).toEqual(jasmine.any(Cancel)); expect(thrown.message).toBe('Operation has been canceled.'); done(); }); getAjaxRequest().then(function(request) { // call cancel() when the request has been sent, but a response has not been received source.cancel('Operation has been canceled.'); request.respondWith({ status: 200, responseText: 'OK' }); }); }); it('calls abort on request object', function(done) { var source = CancelToken.source(); var request; axios.get('/foo/bar', { cancelToken: source.token }).catch(function() { // jasmine-ajax sets statusText to 'abort' when request.abort() is called expect(request.statusText).toBe('abort'); done(); }); getAjaxRequest().then(function(req) { // call cancel() when the request has been sent, but a response has not been received source.cancel(); request = req; }); }); }); describe('when called after response has been received', function() { // https://github.com/axios/axios/issues/482 it('does not cause unhandled rejection', function(done) { var source = CancelToken.source(); axios.get('/foo', { cancelToken: source.token }).then(function() { window.addEventListener('unhandledrejection', function() { done.fail('Unhandled rejection.'); }); source.cancel(); setTimeout(done, 100); }); getAjaxRequest().then(function(request) { request.respondWith({ status: 200, responseText: 'OK' }); }); }); }); it('it should support cancellation using AbortController signal', function(done) { var controller = new AbortController(); axios.get('/foo/bar', { signal: controller.signal }).then(function() { done.fail('Has not been canceled'); }, function(thrown) { expect(thrown).toEqual(jasmine.any(Cancel)); done(); } ); getAjaxRequest().then(function (request) { // call cancel() when the request has been sent, but a response has not been received controller.abort(); setTimeout(function(){ request.respondWith({ status: 200, responseText: 'OK' }); }, 0); }); }); });
import consts from 'consts/const_global'; import Serialization from "common/utils/Serialization"; import BufferExtended from 'common/utils/BufferExtended'; import InterfaceSatoshminDB from 'common/satoshmindb/Interface-SatoshminDB'; class PoolData { constructor(databaseName) { this._db = new InterfaceSatoshminDB(databaseName ? databaseName : consts.DATABASE_NAMES.POOL_DATABASE); this._statsBufferSize = consts.MINING_POOL.WINDOW_SIZE; this._currentBlockPos = 0; this._minersList = []; this._blocksMiningInfo = []; } /** * @param minerAddress * @returns miner or null if it doesn't exist */ getMiner(minerAddress){ for (let i = 0; i < this._minersList.length; ++i) if (this._minersList[i].address === minerAddress) return {index: i, miner: this._minersList[i]}; return null; } /** * Insert a new miner if not exists. Synchronizes with DB. * @param minerAddress * @param minerReward * @returns true/false */ async setMiner(minerAddress, minerReward = 0){ if (this.getMiner(minerAddress) === null) { this._minersList.push( {address: minerAddress, reward: minerReward} ); return (await this.saveMinersList()); } return false; //miner already exists } /** * Remove a miner if exists. Synchronizes with DB. * @param minerAddress * @returns true/false */ async removeMiner(minerAddress){ let response = this.getMiner(minerAddress); if (response === null) return false; //miner doesn't exists let index = response.index; this._minersList[index] = this._minersList[this._minersList.length - 1]; this._minersList.pop(); return (await this.saveMinersList()); } /** * Set the list of active miners */ setMinersList(minersList) { this._minersList = minersList; } /** * @returns the list with active miners */ getMinersList() { return this._minersList; } /** * Set the list with statistics for the last X mined blocks */ setBlocksMiningInfo(blocksMiningInfo) { this._blocksMiningInfo = blocksMiningInfo; } /** * @returns the list with statistics for the last X mined blocks */ getBlocksMiningInfo() { return this._blocksMiningInfo; } /** * Add a new mined block statistics to _blocksMiningInfo circular buffer * @param newStatistic */ addMinedBlockStatistics(newStatistic) { this._blocksMiningInfo[this._currentBlockPos++] = newStatistic; if (this._currentBlockPos === this._statsBufferSize) this._currentBlockPos = 0; } /** * Set miners reward to 0. Synchronizes with DB. * @returns {Promise<*>} */ async resetRewards() { for (let i = 0; i < this._minersList.length; ++i) this._minersList[i].reward = 0; return (await this.saveMinersList()); } /** * Set new reward for miner if it exists * @param minerAddress * @returns miner reward or 0 if it doesn't exist */ getMinerReward(minerAddress) { let response = this.getMiner(minerAddress); if (response === null) return 0; return response.miner.reward; } /** * Set new reward for miner if it exists * @param minerAddress * @param reward * @returns {boolean} true/false if miner exists or not */ setMinerReward(minerAddress, reward){ let response = this.getMiner(minerAddress); if (response === null) return false; response.miner.reward = reward; return true; } /** * @param minerAddress * @param reward */ increaseMinerReward(minerAddress, reward) { for (let i = 0; i < this._minersList.length; ++i) { if (this._minersList[i].address === minerAddress){ this._minersList[i].reward += reward; break; } } } /** * @param id * @param reward */ increaseMinerRewardById(id, reward) { this._minersList[id].reward += reward; } _serializeMiners() { let list = [Serialization.serializeNumber2Bytes(this._minersList.length)]; for (let i = 0; i < this._minersList.length; ++i) { list.push( Serialization.serializeNumber1Byte(BufferExtended.fromBase(this._minersList[i].address).length) ); list.push( BufferExtended.fromBase(this._minersList[i].address) ); list.push ( Serialization.serializeNumber7Bytes(this._minersList[i].reward) ); } return Buffer.concat(list); } _deserializeMiners(buffer, offset = 0) { try { let numMiners = Serialization.deserializeNumber2Bytes( buffer, offset ); offset += 2; this._minersList = []; for (let i = 0; i < numMiners; ++i) { let len = Serialization.deserializeNumber1Bytes( buffer, offset ); offset += 1; let minerAddress = BufferExtended.toBase( BufferExtended.substr(buffer, offset, len) ); offset += len; let minerReward = Serialization.deserializeNumber7Bytes(buffer, offset); offset += 7; this._minersList.push( {address: minerAddress, reward: minerReward} ); } return true; } catch (exception){ console.log("Error deserialize minersList. ", exception); throw exception; } } /** * Load _minersList from database * @returns {boolean} true is success, otherwise false */ async loadMinersList() { try{ let buffer = await this._db.get("minersList"); let response = this._deserializeMiners(buffer); if (response !== true){ console.log('Unable to load _minersList from DB'); return false; } return true; } catch (exception){ console.log('ERROR loading _minersList from BD: ', exception); return false; } } /** * Save _minersList to database * @returns {boolean} true is success, otherwise false */ async saveMinersList() { try{ let buffer = this._serializeMiners(); let response = await this._db.save("minersList", buffer); if (response !== true) { console.log('Unable to save _minersList to DB'); return false; } return true; } catch (exception){ console.log('ERROR saving _minersList in DB: ', exception); return false; } } /** * @param minersList * @returns {boolean} true if this._minersList === minersList */ compareMinersList(minersList) { if (minersList.length !== this._minersList.length) return true; for (let i = 0; i < this._minersList; ++i){ if (this._minersList[i].address !== minersList[i].address) return true; } return false; } /** * @param miner1 * @param miner2 * @returns {boolean} true if miners are equal */ static compareMiners(miner1, miner2) { return !( typeof miner1 === typeof miner2 && miner1.address === miner2.address && miner1.reward === miner2.reward); } } export default PoolData;
rtInherits = function(aSubClass, aBaseClass) { function rtInheritance() { } rtInheritance.prototype = aBaseClass.prototype; aSubClass.prototype = new rtInheritance(); aSubClass.prototype.constructor = aSubClass; aSubClass.baseConstructor = aBaseClass; aSubClass.superClass = aBaseClass.prototype; } HexToRGBA = function(aHexColor,aAlpha) { //HexColor = #rrggbb if(aHexColor==undefined) return aHexColor; var lHexStr = aHexColor; if(lHexStr.charAt(0)=="#") lHexStr = lHexStr.substring(1); if(lHexStr.length<6) return aHexColor; var lR = parseInt(lHexStr.substring(0,2),16); var lG = parseInt(lHexStr.substring(2,4),16); var lB = parseInt(lHexStr.substring(4,6),16); var lRGBA = "rgba("+lR+","+lG+","+lB+","+aAlpha+")"; return lRGBA; } RuntimeDialogSeparator = function(aParent, aXPos, aYPos) { this.m_parent = aParent; this.m_XPos = aXPos; this.m_YPos = aYPos; this.m_color = "#000000"; this.m_alpha = 0.5; this.m_size = 10; this.m_strokeWidth = 2; //Shadow this.m_shadowColor = "#FFFFFF"; this.m_shadowAlpha = 0.65; this.m_shadowAngle = 270; this.m_shadowBlur = 2; this.m_shadowDistance = 1; } RuntimeDialogSeparator.prototype = { setColor:function(aVal) { this.m_color = aVal; }, setAlpha:function(aVal) { this.m_alpha = aVal; }, setSize:function(aVal) { this.m_size = aVal; }, setShadowColor:function(aColor) { this.m_shadowColor = aColor; }, getComponentDiv:function() { var lSepElement = document.createElement("div"); lSepElement.style.height = this.m_strokeWidth+"px"; lSepElement.style.backgroundColor = this.m_color; lSepElement.style.opacity = this.m_alpha; lSepElement.style.position = "relative"; lSepElement.style.marginLeft = this.m_XPos+"px"; lSepElement.style.marginRight = this.m_XPos+"px"; lSepElement.style.top = this.m_YPos+"px"; //Shadow if("webkitBoxShadow" in lSepElement.style) lSepElement.style.webkitBoxShadow = this.m_shadowDistance + "px " + this.m_shadowDistance + "px " + this.m_shadowBlur + "px " + this.m_shadowColor ; else if("MozBoxShadow" in lSepElement.style) lSepElement.style.MozBoxShadow = this.m_shadowDistance + "px " + this.m_shadowDistance + "px " + this.m_shadowBlur + "px " + this.m_shadowColor; else lSepElement.style.boxShadow = this.m_shadowDistance + "px " + this.m_shadowDistance + "px " + this.m_shadowBlur + "px " + this.m_shadowColor; return lSepElement; } } RuntimeDialogText = function(aParent,aXPos,aYPos) { this.m_parent = aParent; this.m_fontName = "Myriad Pro"; this.m_XPos = aXPos; this.m_YPos = aYPos; this.m_fontSize = 14; this.m_fontColor = "#ff0000"; this.m_text = "Sample Text"; this.m_multiline = false; this.m_maxWidth = 400; this.m_maxHeight = 80; //Shadow this.m_shadowColor = "#FFFFFF"; this.m_shadowAlpha = 0.35; this.m_shadowAngle = 270; this.m_shadowBlur = 2; this.m_shadowDistance = 1; } RuntimeDialogText.prototype = { setFontName:function(aVal) { this.m_fontName = aVal; }, setFontSize:function(aVal) { this.m_fontSize = aVal; }, setFontColor:function(aVal) { this.m_fontColor = aVal; }, setText:function(aVal) { this.m_text = aVal; }, setMultiline:function(aVal) { this.m_multiline = aVal; }, setMaxWidth:function(aVal) { this.m_maxWidth = aVal; }, setShadowColor:function(aColor) { this.m_shadowColor = aColor; }, getTruncatedText:function(aMaxWidth) { if(aMaxWidth == undefined) return this.m_text; var lWidth = this.getMaxPossibleWidth(this.m_text); if(lWidth <= aMaxWidth) return this.m_text; var lEllipses = "..."; var lTruncatedText = this.m_text; var lText = lTruncatedText+lEllipses; lWidth = this.getMaxPossibleWidth(lText); while((lText.length > 0) && (lWidth > aMaxWidth)) { lTruncatedText = lTruncatedText.substring(0,lTruncatedText.length-1); lText = lTruncatedText+lEllipses; lWidth = this.getMaxPossibleWidth(lText); } return lText; }, getMaxPossibleWidth:function(aText) { var lTextElement = document.createElement("div"); lTextElement.style.color = this.m_fontColor; lTextElement.style.fontFamily = this.m_fontName; lTextElement.style.fontSize = this.m_fontSize + 'px'; lTextElement.style.width = "auto"; lTextElement.style.height= "auto"; lTextElement.style.position = "absolute"; lTextElement.style.visibilty= "hidden"; lTextElement.innerHTML = aText; document.body.appendChild(lTextElement); var lMaxWidth = lTextElement.clientWidth + 4; //4 is extra padding document.body.removeChild(lTextElement); return lMaxWidth; }, getComponentDiv:function() { var lTextElement = document.createElement("div"); lTextElement.style.color = this.m_fontColor; lTextElement.style.fontFamily = this.m_fontName; lTextElement.style.fontSize = this.m_fontSize + 'px'; lTextElement.style.textAlign = "left"; lTextElement.style.left = this.m_XPos+"px"; lTextElement.style.top = this.m_YPos+"px"; lTextElement.style.position = "relative"; lTextElement.style.opacity = 1; //Note: TextShadow will work in all major browsers except for IE(we find out alternate solution for that) var lColor = HexToRGBA(this.m_shadowColor,this.m_shadowAlpha); lTextElement.style.textShadow =this.m_shadowDistance + "px " + this.m_shadowDistance + "px " + this.m_shadowBlur + "px " + lColor; lTextElement.innerHTML = this.m_text; return lTextElement; } } RuntimeDialogPanel = function(aParent,aXPos,aYPos,aWidth, aHeight) { this.m_parent = aParent; this.m_fillColor = "#CCCCCC"; this.m_alpha = 0.5; this.m_strokeColor = "#666666"; this.m_XPos = aXPos; this.m_YPos = aYPos; this.m_strokeWidth = 1; this.m_width = aWidth; this.m_height = aHeight; this.m_roundness = 20; this.m_minWidth = 100; this.m_minHeight = 100; this.m_maxWidth = 493; this.m_maxHeight = 219; //Shadow this.m_showShadow = false; this.m_shadowColor = "#000000"; this.m_shadowAlpha = 0.65; this.m_shadowAngle = 270; this.m_shadowBlur = 2; this.m_shadowDistance = 2; } RuntimeDialogPanel.prototype = { setFillColor:function(aVal) { this.m_fillColor = aVal; }, setAlpha:function(aVal) { this.m_alpha = aVal; }, setStrokeColor:function(aVal) { this.m_strokeColor = aVal; }, setStrokeWidth:function(aVal) { this.m_strokeWidth = aVal; }, setWidth:function(aVal) { this.m_width = aVal; }, getWidth:function() { var lWidth = this.m_width; if(lWidth < this.m_minWidth) lWidth = this.m_minWidth; if(lWidth > this.m_maxWidth) lWidth = this.m_maxWidth; return lWidth; }, setHeight:function(aVal) { this.m_height = aVal; }, setMinWidth:function(aVal) { if(aVal < this.m_maxWidth) this.m_minWidth = aVal; }, setMinHeight:function(aVal) { if(aVal < this.m_maxHeight) this.m_minHeight = aVal; }, setMaxWidth:function(aVal) { if(aVal > this.m_minWidth) this.m_maxWidth = aVal; }, setMaxHeight:function(aVal) { if(aVal > this.m_minHeight) this.m_maxHeight = aVal; }, setRoundness:function(aVal) { this.m_roundness = aVal; }, showShadow:function(aVal) { this.m_showShadow = aVal; }, setShadowColor:function(aColor) { this.m_shadowColor = aColor; }, getComponentDiv:function() { var lWidth = this.m_width; var lHeight = this.m_height; if(lWidth < this.m_minWidth) lWidth = this.m_minWidth; if(lWidth > this.m_maxWidth) lWidth = this.m_maxWidth; if(lHeight < this.m_minHeight) lHeight = this.m_minHeight; if(lHeight > this.m_maxHeight) lHeight = this.m_maxHeight; var lPanelElement = document.createElement("div"); lPanelElement.style.width = lWidth + "px" lPanelElement.style.height = lHeight + "px"; //lPanelElement.style.margin = "100px auto"; lPanelElement.style.background = HexToRGBA(this.m_fillColor,this.m_alpha); lPanelElement.style.border = this.m_strokeWidth + "px solid "+this.m_strokeColor; lPanelElement.style.borderRadius = this.m_roundness + "px"; lPanelElement.style.left = this.m_XPos+"px"; lPanelElement.style.top = this.m_YPos+"px"; if(this.m_showShadow) { if("webkitBoxShadow" in lPanelElement.style) lPanelElement.style.webkitBoxShadow = this.m_shadowDistance + "px " + this.m_shadowDistance + "px " + this.m_shadowBlur + "px " + this.m_shadowColor ; else if("MozBoxShadow" in lPanelElement.style) lPanelElement.style.MozBoxShadow = this.m_shadowDistance + "px " + this.m_shadowDistance + "px " + this.m_shadowBlur + "px " + this.m_shadowColor; else lPanelElement.style.boxShadow = this.m_shadowDistance + "px " + this.m_shadowDistance + "px " + this.m_shadowBlur + "px " + this.m_shadowColor; } return lPanelElement; } } RuntimeDialogButton = function(aParent,aXPos,aYPos,aWidth,aHeight) { RuntimeDialogButton.baseConstructor.call(this,aParent,aXPos,aYPos,aWidth,aHeight); this.m_label = undefined; this.m_labelText = "OK"; this.m_labelFontName = "Myriad Pro"; this.m_labelFontSize = 16; this.m_labelFontColor = "#000000"; this.m_labelShadowColor = "#FFFFFF"; this.BUTTON_LABEL_LEFT_PADDING = 5; this.BUTTON_LABEL_TOP_PADDING = 5; this.m_fillColor = "#CDCDCD"; this.m_alpha = 0.3; this.m_strokeColor = "#000000"; this.m_strokeWidth = 1; this.m_maxWidth = 230; this.m_minWidth = 40; this.m_minHeight = m_maxHeight = 25; this.m_roundness = 10; } rtInherits(RuntimeDialogButton, RuntimeDialogPanel); { //RuntimeDialogButton Functions RuntimeDialogButton.prototype.setButtonLabel = function(aVal) { this.m_labelText = aVal; } RuntimeDialogButton.prototype.setButtonLabelFontName = function(aVal) { this.m_labelFontName = aVal; } RuntimeDialogButton.prototype.setButtonLabelFontSize = function(aVal) { this.m_labelFontSize = aVal; } RuntimeDialogButton.prototype.setButtonLabelFontColor = function(aVal) { this.m_labelFontColor = aVal; } RuntimeDialogButton.prototype.setButtonLabelShadowColor = function(aVal) { this.m_labelShadowColor = aVal; } RuntimeDialogButton.prototype.setHandler = function(aHandler) { this.m_handler = aHandler; } RuntimeDialogButton.prototype.getComponentDiv = function() { var lButtonElement = RuntimeDialogButton.superClass.getComponentDiv.call(this); lButtonElement.style.position = "absolute"; lButtonElement.style.cursor = "pointer"; var lFillColor = this.m_fillColor; var lAlpha = this.m_alpha; lButtonElement.onmouseover = function(e){ lButtonElement.style.background = HexToRGBA(lFillColor,0.1);} lButtonElement.onmouseout = function(e) { lButtonElement.style.background = HexToRGBA(lFillColor,lAlpha);} lButtonElement.onclick = this.m_handler; //AddButtonLabel var lText = new RuntimeDialogText(lButtonElement,0,5); lText.setText(this.m_labelText); lText.setFontName(this.m_labelFontName); lText.setFontColor(this.m_labelFontColor); lText.setFontSize(this.m_labelFontSize); lText.setShadowColor(this.m_labelShadowColor); lText.setMaxWidth(this.m_maxWidth - this.BUTTON_LABEL_LEFT_PADDING*2); var lTextElement = lText.getComponentDiv(); lTextElement.style.textAlign = "center"; var lTextWidth = lText.getMaxPossibleWidth(this.m_labelText); if(lTextWidth > this.m_width) { if(lTextWidth > this.m_maxWidth) { lTextWidth = this.m_maxWidth; lTextElement.innerHTML = lText.getTruncatedText(this.m_maxWidth); } lButtonElement.style.width = lTextWidth +"px"; } lButtonElement.appendChild(lTextElement); return lButtonElement; } } RuntimeMessageBox = function(aParent,aNumberOfButtons,aFGFillColor,aFGStrokeColor, aBtnFillColor,aBtnStrokeColor,aSeparatorColor, aTextColor,aTextShadowColor,aTextFontName) { this.m_parent = aParent; this.m_MessageBoxElement = undefined; this.m_id = "CPRuntimeMsgBox_ID"; this.m_titleText = "Adobe Captivate"; this.m_messageText = "This is Adobe Captivate Run Time Message Dialog"; this.m_firstButtonText = "OK"; this.m_secondButtonText = "CANCEL"; this.m_ChkBoxText = "Don't ask me again"; this.m_numberOfButtons = aNumberOfButtons; this.m_firstButtonHandler = undefined; this.m_secondButtonHandler = undefined; this.m_DontAskMe = false; this.m_foregroundFillColor = aFGFillColor; this.m_foregroundStrokeColor = aFGStrokeColor; this.m_buttonFillColor = aBtnFillColor; this.m_buttonStrokeColor = aBtnStrokeColor; this.m_separatorColor = aSeparatorColor; this.m_textColor = aTextColor; this.m_textShadowColor = aTextShadowColor; this.m_textFontName = aTextFontName; this.TITLE_DEFAULT_LEFT_OFFSET = 10; this.SEPARATOR_DEFAULT_LEFT_OFFSET = 10; this.MESSAGE_DEFAULT_LEFT_OFFSET = 10; this.TITLE_DEFAULT_TOP_OFFSET = 10; this.SEPARATOR_DEFAULT_TOP_OFFSET = 20; this.MESSAGE_DEFAULT_TOP_OFFSET = 30; this.BUTTON_BOTTOM_OFFSET = 10; this.BG_DEFAULT_WIDTH = 493; this.BG_DEFAULT_HEIGHT = 219; this.FG_DEFAULT_WIDTH = 478; this.FG_DEFAULT_HEIGHT = 198; this.BUTTON_DEFAULT_WIDTH = 100; this.BUTTON_DEFAULT_HEIGHT = 33; this.INTER_BUTTON_OFFSET = 15; } RuntimeMessageBox.prototype = { getDontAskMeInput : function(val) { if(this.m_DontAskMe) { var inputElement = document.getElementById("dont_ask_me_chk"); if(inputElement) return inputElement.checked; } return false; }, setDontAskMe : function(val) { this.m_DontAskMe = val; }, setDontAskMeText : function(val) { this.m_ChkBoxText = val; }, setTitleText:function(aVal) { this.m_titleText = aVal; }, setCheckBoxText:function(aVal) { this.m_ChkBoxText = aVal; }, setMessageText:function(aVal) { this.m_messageText = aVal; }, setFirstButtonText:function(aVal) { this.m_firstButtonText = aVal; }, setSecondButtonText:function(aVal) { this.m_secondButtonText = aVal; }, registerFirstButtonHandler:function(aHandler) { if(aHandler!=undefined) this.m_firstButtonHandler = aHandler; }, registerSecondButtonHandler:function(aHandler) { if(aHandler!=undefined) this.m_secondButtonHandler = aHandler; }, isVisible:function() { var lVisible = false; if((this.m_MessageBoxElement != undefined) && (this.m_MessageBoxElement.style.visibility == "visible")) lVisible = true; return lVisible; }, hide:function() { var cpDocumentElement = document.getElementById("cpDocument"); var cpMsgBoxElement = document.getElementById("CPRuntimeMsgBox_ID"); if(cpMsgBoxElement!=undefined) cpDocumentElement.removeChild(cpMsgBoxElement); }, show:function() { //remove dialog if already there this.hide(); this.m_MessageBoxElement = document.createElement("div"); this.m_MessageBoxElement.id = this.m_id; //Background var lBackgroundPanel = new RuntimeDialogPanel(this.m_parent,0,0,this.BG_DEFAULT_WIDTH,this.BG_DEFAULT_HEIGHT); lBackgroundPanel.showShadow(true); var lBackgroundPanelDivElem = lBackgroundPanel.getComponentDiv(); lBackgroundPanelDivElem.style.margin = "100px auto"; this.m_MessageBoxElement.appendChild(lBackgroundPanelDivElem); //Foreground var lForegroundPanelXPos = (this.BG_DEFAULT_WIDTH - this.FG_DEFAULT_WIDTH)/2; var lForegroundPanelYPos = (this.BG_DEFAULT_HEIGHT - this.FG_DEFAULT_HEIGHT)/2; var lForegroundPanel = new RuntimeDialogPanel(lBackgroundPanelDivElem,lForegroundPanelXPos,lForegroundPanelYPos,this.FG_DEFAULT_WIDTH,this.FG_DEFAULT_HEIGHT); lForegroundPanel.setFillColor(this.m_foregroundFillColor); lForegroundPanel.setAlpha(1); lForegroundPanel.setStrokeColor(this.m_foregroundStrokeColor); var lForegroundPanelDivElem = lForegroundPanel.getComponentDiv(); lForegroundPanelDivElem.style.position = "relative"; lBackgroundPanelDivElem.appendChild(lForegroundPanelDivElem); //Title var lTitle = new RuntimeDialogText(lForegroundPanelDivElem,this.TITLE_DEFAULT_LEFT_OFFSET,this.TITLE_DEFAULT_TOP_OFFSET); lTitle.setText(this.m_titleText); lTitle.setFontSize(18); lTitle.setFontColor(this.m_textColor); lTitle.setFontName(this.m_textFontName); lTitle.setShadowColor(this.m_textShadowColor); var lTitleDivElem = lTitle.getComponentDiv(); lForegroundPanelDivElem.appendChild(lTitleDivElem); //Separator var lSeparator = new RuntimeDialogSeparator(lForegroundPanelDivElem,this.SEPARATOR_DEFAULT_LEFT_OFFSET,this.SEPARATOR_DEFAULT_TOP_OFFSET); //lSeparator.setSize(this.FG_DEFAULT_WIDTH - 2*this.SEPARATOR_DEFAULT_LEFT_OFFSET); lSeparator.setColor(this.m_separatorColor); var lSeparatorDivElem = lSeparator.getComponentDiv(); lForegroundPanelDivElem.appendChild(lSeparatorDivElem); //Message var lMessage = new RuntimeDialogText(lForegroundPanelDivElem,this.MESSAGE_DEFAULT_LEFT_OFFSET,this.MESSAGE_DEFAULT_TOP_OFFSET); lMessage.setText(this.m_messageText); lMessage.setFontColor(this.m_textColor); lMessage.setFontName(this.m_textFontName); lMessage.setShadowColor(this.m_textShadowColor); lMessage.setFontSize(14); lMessage.setMultiline(true); var lMessageDivElem = lMessage.getComponentDiv(); lForegroundPanelDivElem.appendChild(lMessageDivElem); if(this.m_DontAskMe) { var lCheckBoxText = new RuntimeDialogText(lForegroundPanelDivElem,this.MESSAGE_DEFAULT_LEFT_OFFSET,this.MESSAGE_DEFAULT_TOP_OFFSET); lCheckBoxText.setText(this.m_ChkBoxText); lCheckBoxText.setFontColor(this.m_textColor); lCheckBoxText.setFontName(this.m_textFontName); lCheckBoxText.setShadowColor(this.m_textShadowColor); lCheckBoxText.setFontSize(14); lCheckBoxText.setMultiline(false); var lCheckBoxTextDivElem = lCheckBoxText.getComponentDiv(); lForegroundPanelDivElem.innerHTML += '<input type="checkbox" id="dont_ask_me_chk" style="left:10px; bottom: 70px;width:20px; height:20px;position:absolute">'; lForegroundPanelDivElem.appendChild(lCheckBoxTextDivElem); lCheckBoxTextDivElem.style.position = 'absolute'; lCheckBoxTextDivElem.style.top = ''; lCheckBoxTextDivElem.style.bottom = '75px'; lCheckBoxTextDivElem.style.left = '40px'; } //FirstButton var lFirstButton = new RuntimeDialogButton(lForegroundPanelDivElem,0,0,this.BUTTON_DEFAULT_WIDTH,this.BUTTON_DEFAULT_HEIGHT); lFirstButton.setFillColor(this.m_buttonFillColor); lFirstButton.setStrokeColor(this.m_buttonStrokeColor); lFirstButton.setButtonLabel(this.m_firstButtonText); lFirstButton.setButtonLabelFontSize(16); lFirstButton.setButtonLabelFontColor(this.m_textColor); lFirstButton.setButtonLabelFontName(this.m_textFontName); lFirstButton.setButtonLabelShadowColor(this.m_textShadowColor); lFirstButton.setHandler(this.m_firstButtonHandler); var lFirstButtonDivElem = lFirstButton.getComponentDiv(); lFirstButtonDivElem.style.top = "auto"; lFirstButtonDivElem.style.bottom = this.BUTTON_BOTTOM_OFFSET+"px"; lForegroundPanelDivElem.appendChild(lFirstButtonDivElem); //Second Button var lSecondButtonDivElem = undefined; if(this.m_numberOfButtons == 2) { lSecondButton = new RuntimeDialogButton(lForegroundPanelDivElem,0,0,this.BUTTON_DEFAULT_WIDTH,this.BUTTON_DEFAULT_HEIGHT); lSecondButton.setFillColor(this.m_buttonFillColor); lSecondButton.setStrokeColor(this.m_buttonStrokeColor); lSecondButton.setButtonLabel(this.m_secondButtonText); lSecondButton.setButtonLabelFontSize(16); lSecondButton.setButtonLabelFontColor(this.m_textColor); lSecondButton.setButtonLabelFontName(this.m_textFontName); lSecondButton.setButtonLabelShadowColor(this.m_textShadowColor); lSecondButton.setHandler(this.m_secondButtonHandler); lSecondButtonDivElem = lSecondButton.getComponentDiv(); lSecondButtonDivElem.style.top = "auto"; lSecondButtonDivElem.style.bottom = this.BUTTON_BOTTOM_OFFSET+"px"; lForegroundPanelDivElem.appendChild(lSecondButtonDivElem); } //Place MessageBox this.m_parent.appendChild(this.m_MessageBoxElement); this.m_MessageBoxElement.style.visibility = "visible"; this.m_MessageBoxElement.style.position = "absolute"; this.m_MessageBoxElement.style.left = "0px"; this.m_MessageBoxElement.style.top = "0px"; this.m_MessageBoxElement.style.width = "100%"; this.m_MessageBoxElement.style.height = "100%"; this.m_MessageBoxElement.style.textAlign = "center"; this.m_MessageBoxElement.style.zIndex = "1000"; this.m_MessageBoxElement.style.background = "rgba(240,240,240,0.2)"; //Update Button Positions var lXPos = lForegroundPanelDivElem.clientWidth - lFirstButtonDivElem.clientWidth; if(lSecondButtonDivElem) lXPos = lXPos -this.INTER_BUTTON_OFFSET - lSecondButtonDivElem.clientWidth; lXPos = lXPos/2; lFirstButtonDivElem.style.left = lXPos+"px"; if(lSecondButtonDivElem) lSecondButtonDivElem.style.left = lXPos + lFirstButtonDivElem.clientWidth + this.INTER_BUTTON_OFFSET+"px"; }, close:function() { var cpDocumentElement = document.getElementById("cpDocument"); var cpMsgBoxElement = document.getElementById("CPRuntimeMsgBox_ID"); cpDocumentElement.removeChild(cpMsgBoxElement); cpMsgBoxElement = undefined; } }
var cpx = require("cpx");
/** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ import { NgModule } from '@angular/core'; import { OptimumComponentsComponent } from './optimum-components.component'; import { TextAreaInputComponent } from './text-area-input/text-area-input.component'; import { TextInputComponent } from './text-input/text-input.component'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { CommonModule } from "@angular/common"; import { PhoneInputComponent } from './phone-input/phone-input.component'; import { RadioInputComponent } from './radio-input/radio-input.component'; import { DropdownInputComponent } from './dropdown-input/dropdown-input.component'; import { OptimumSubmitComponent } from './optimum-submit/optimum-submit.component'; import { FormTextInputComponent } from './form-text-input/form-text-input.component'; var OptimumComponentsModule = /** @class */ (function () { function OptimumComponentsModule() { } OptimumComponentsModule.decorators = [ { type: NgModule, args: [{ declarations: [ OptimumComponentsComponent, TextAreaInputComponent, TextInputComponent, PhoneInputComponent, RadioInputComponent, DropdownInputComponent, OptimumSubmitComponent, FormTextInputComponent ], imports: [ FormsModule, CommonModule, ReactiveFormsModule ], exports: [ OptimumComponentsComponent, TextAreaInputComponent, TextInputComponent, PhoneInputComponent, RadioInputComponent, DropdownInputComponent, OptimumSubmitComponent, FormTextInputComponent ] },] } ]; return OptimumComponentsModule; }()); export { OptimumComponentsModule }; //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3B0aW11bS1jb21wb25lbnRzLm1vZHVsZS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL29wdGltdW0tY29tcG9uZW50cy8iLCJzb3VyY2VzIjpbImxpYi9vcHRpbXVtLWNvbXBvbmVudHMubW9kdWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7QUFBQSxPQUFPLEVBQUUsUUFBUSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQ3pDLE9BQU8sRUFBRSwwQkFBMEIsRUFBRSxNQUFNLGdDQUFnQyxDQUFDO0FBQzVFLE9BQU8sRUFBRSxzQkFBc0IsRUFBRSxNQUFNLDZDQUE2QyxDQUFDO0FBQ3JGLE9BQU8sRUFBRSxrQkFBa0IsRUFBRSxNQUFNLG1DQUFtQyxDQUFDO0FBQ3ZFLE9BQU8sRUFBRSxXQUFXLEVBQUUsbUJBQW1CLEVBQUUsTUFBTSxnQkFBZ0IsQ0FBQztBQUNsRSxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0saUJBQWlCLENBQUM7QUFDL0MsT0FBTyxFQUFFLG1CQUFtQixFQUFFLE1BQU0scUNBQXFDLENBQUM7QUFDMUUsT0FBTyxFQUFFLG1CQUFtQixFQUFFLE1BQU0scUNBQXFDLENBQUM7QUFDMUUsT0FBTyxFQUFFLHNCQUFzQixFQUFFLE1BQU0sMkNBQTJDLENBQUM7QUFDbkYsT0FBTyxFQUFFLHNCQUFzQixFQUFFLE1BQU0sMkNBQTJDLENBQUM7QUFDbkYsT0FBTyxFQUFFLHNCQUFzQixFQUFFLE1BQU0sNkNBQTZDLENBQUE7QUFFcEY7SUFBQTtJQTJCdUMsQ0FBQzs7Z0JBM0J2QyxRQUFRLFNBQUM7b0JBQ1IsWUFBWSxFQUFDO3dCQUNWLDBCQUEwQjt3QkFDMUIsc0JBQXNCO3dCQUN0QixrQkFBa0I7d0JBQ2xCLG1CQUFtQjt3QkFDbkIsbUJBQW1CO3dCQUNuQixzQkFBc0I7d0JBQ3RCLHNCQUFzQjt3QkFDdEIsc0JBQXNCO3FCQUN4QjtvQkFDRCxPQUFPLEVBQUM7d0JBQ0wsV0FBVzt3QkFDWCxZQUFZO3dCQUNaLG1CQUFtQjtxQkFDckI7b0JBQ0QsT0FBTyxFQUFDO3dCQUNMLDBCQUEwQjt3QkFDMUIsc0JBQXNCO3dCQUN0QixrQkFBa0I7d0JBQ2xCLG1CQUFtQjt3QkFDbkIsbUJBQW1CO3dCQUNuQixzQkFBc0I7d0JBQ3RCLHNCQUFzQjt3QkFDdEIsc0JBQXNCO3FCQUN4QjtpQkFDRjs7SUFDc0MsOEJBQUM7Q0FBQSxBQTNCeEMsSUEyQndDO1NBQTNCLHVCQUF1QiIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IE5nTW9kdWxlIH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XHJcbmltcG9ydCB7IE9wdGltdW1Db21wb25lbnRzQ29tcG9uZW50IH0gZnJvbSAnLi9vcHRpbXVtLWNvbXBvbmVudHMuY29tcG9uZW50JztcclxuaW1wb3J0IHsgVGV4dEFyZWFJbnB1dENvbXBvbmVudCB9IGZyb20gJy4vdGV4dC1hcmVhLWlucHV0L3RleHQtYXJlYS1pbnB1dC5jb21wb25lbnQnO1xyXG5pbXBvcnQgeyBUZXh0SW5wdXRDb21wb25lbnQgfSBmcm9tICcuL3RleHQtaW5wdXQvdGV4dC1pbnB1dC5jb21wb25lbnQnO1xyXG5pbXBvcnQgeyBGb3Jtc01vZHVsZSwgUmVhY3RpdmVGb3Jtc01vZHVsZSB9IGZyb20gJ0Bhbmd1bGFyL2Zvcm1zJztcclxuaW1wb3J0IHsgQ29tbW9uTW9kdWxlIH0gZnJvbSBcIkBhbmd1bGFyL2NvbW1vblwiO1xyXG5pbXBvcnQgeyBQaG9uZUlucHV0Q29tcG9uZW50IH0gZnJvbSAnLi9waG9uZS1pbnB1dC9waG9uZS1pbnB1dC5jb21wb25lbnQnO1xyXG5pbXBvcnQgeyBSYWRpb0lucHV0Q29tcG9uZW50IH0gZnJvbSAnLi9yYWRpby1pbnB1dC9yYWRpby1pbnB1dC5jb21wb25lbnQnO1xyXG5pbXBvcnQgeyBEcm9wZG93bklucHV0Q29tcG9uZW50IH0gZnJvbSAnLi9kcm9wZG93bi1pbnB1dC9kcm9wZG93bi1pbnB1dC5jb21wb25lbnQnO1xyXG5pbXBvcnQgeyBPcHRpbXVtU3VibWl0Q29tcG9uZW50IH0gZnJvbSAnLi9vcHRpbXVtLXN1Ym1pdC9vcHRpbXVtLXN1Ym1pdC5jb21wb25lbnQnO1xyXG5pbXBvcnQgeyBGb3JtVGV4dElucHV0Q29tcG9uZW50IH0gZnJvbSAnLi9mb3JtLXRleHQtaW5wdXQvZm9ybS10ZXh0LWlucHV0LmNvbXBvbmVudCdcclxuXHJcbkBOZ01vZHVsZSh7ICBcclxuICBkZWNsYXJhdGlvbnM6WyAgXHJcbiAgICAgT3B0aW11bUNvbXBvbmVudHNDb21wb25lbnQsXHJcbiAgICAgVGV4dEFyZWFJbnB1dENvbXBvbmVudCxcclxuICAgICBUZXh0SW5wdXRDb21wb25lbnQsXHJcbiAgICAgUGhvbmVJbnB1dENvbXBvbmVudCxcclxuICAgICBSYWRpb0lucHV0Q29tcG9uZW50LFxyXG4gICAgIERyb3Bkb3duSW5wdXRDb21wb25lbnQsXHJcbiAgICAgT3B0aW11bVN1Ym1pdENvbXBvbmVudCxcclxuICAgICBGb3JtVGV4dElucHV0Q29tcG9uZW50XHJcbiAgXSxcclxuICBpbXBvcnRzOlsgIFxyXG4gICAgIEZvcm1zTW9kdWxlLFxyXG4gICAgIENvbW1vbk1vZHVsZSxcclxuICAgICBSZWFjdGl2ZUZvcm1zTW9kdWxlXHJcbiAgXSxcclxuICBleHBvcnRzOlsgIFxyXG4gICAgIE9wdGltdW1Db21wb25lbnRzQ29tcG9uZW50LFxyXG4gICAgIFRleHRBcmVhSW5wdXRDb21wb25lbnQsXHJcbiAgICAgVGV4dElucHV0Q29tcG9uZW50LFxyXG4gICAgIFBob25lSW5wdXRDb21wb25lbnQsXHJcbiAgICAgUmFkaW9JbnB1dENvbXBvbmVudCxcclxuICAgICBEcm9wZG93bklucHV0Q29tcG9uZW50LFxyXG4gICAgIE9wdGltdW1TdWJtaXRDb21wb25lbnQsXHJcbiAgICAgRm9ybVRleHRJbnB1dENvbXBvbmVudFxyXG4gIF1cclxufSlcclxuZXhwb3J0IGNsYXNzIE9wdGltdW1Db21wb25lbnRzTW9kdWxlIHsgfVxyXG4iXX0=
typeSearchIndex = [{"p":"org.apache.qpid.protonj2.codec.decoders.primitives","l":"AbstractArrayTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.decoders.primitives","l":"AbstractBinaryTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders","l":"AbstractDescribedListTypeEncoder"},{"p":"org.apache.qpid.protonj2.codec.encoders","l":"AbstractDescribedMapTypeEncoder"},{"p":"org.apache.qpid.protonj2.codec.decoders","l":"AbstractDescribedTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders","l":"AbstractDescribedTypeEncoder"},{"p":"org.apache.qpid.protonj2.codec.decoders.primitives","l":"AbstractListTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.decoders.primitives","l":"AbstractMapTypeDecoder"},{"p":"org.apache.qpid.protonj2.engine.sasl.client","l":"AbstractMechanism"},{"p":"org.apache.qpid.protonj2.codec.decoders","l":"AbstractPrimitiveTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders","l":"AbstractPrimitiveTypeEncoder"},{"p":"org.apache.qpid.protonj2.codec.decoders.primitives","l":"AbstractStringTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.decoders.primitives","l":"AbstractSymbolTypeDecoder"},{"p":"org.apache.qpid.protonj2.types.messaging","l":"Accepted"},{"p":"org.apache.qpid.protonj2.codec.decoders.messaging","l":"AcceptedTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.messaging","l":"AcceptedTypeEncoder"},{"p":"org.apache.qpid.protonj2.client","l":"AdvancedMessage"},{"l":"All Classes","url":"allclasses-index.html"},{"p":"org.apache.qpid.protonj2.types.transport","l":"AmqpError"},{"p":"org.apache.qpid.protonj2.types.transport","l":"AMQPHeader"},{"p":"org.apache.qpid.protonj2.engine","l":"AMQPPerformativeEnvelopePool"},{"p":"org.apache.qpid.protonj2.types.messaging","l":"AmqpSequence"},{"p":"org.apache.qpid.protonj2.codec.decoders.messaging","l":"AmqpSequenceTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.messaging","l":"AmqpSequenceTypeEncoder"},{"p":"org.apache.qpid.protonj2.types.messaging","l":"AmqpValue"},{"p":"org.apache.qpid.protonj2.codec.decoders.messaging","l":"AmqpValueTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.messaging","l":"AmqpValueTypeEncoder"},{"p":"org.apache.qpid.protonj2.engine.sasl.client","l":"AnonymousMechanism"},{"p":"org.apache.qpid.protonj2.types.messaging","l":"ApplicationProperties"},{"p":"org.apache.qpid.protonj2.codec.decoders.messaging","l":"ApplicationPropertiesTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.messaging","l":"ApplicationPropertiesTypeEncoder"},{"p":"org.apache.qpid.protonj2.codec.decoders.primitives","l":"Array32TypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.decoders.primitives","l":"Array8TypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.primitives","l":"ArrayTypeEncoder"},{"p":"org.apache.qpid.protonj2.client.futures","l":"AsyncResult"},{"p":"org.apache.qpid.protonj2.types.transport","l":"Attach"},{"p":"org.apache.qpid.protonj2.engine","l":"Attachments"},{"p":"org.apache.qpid.protonj2.codec.decoders.transport","l":"AttachTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.transport","l":"AttachTypeEncoder"},{"p":"org.apache.qpid.protonj2.client.futures","l":"BalancedClientFuture"},{"p":"org.apache.qpid.protonj2.types.transport","l":"Begin"},{"p":"org.apache.qpid.protonj2.codec.decoders.transport","l":"BeginTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.transport","l":"BeginTypeEncoder"},{"p":"org.apache.qpid.protonj2.types","l":"Binary"},{"p":"org.apache.qpid.protonj2.codec.decoders.primitives","l":"Binary32TypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.decoders.primitives","l":"Binary8TypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.decoders.primitives","l":"BinaryTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.primitives","l":"BinaryTypeEncoder"},{"p":"org.apache.qpid.protonj2.codec.decoders.primitives","l":"BooleanFalseTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.decoders.primitives","l":"BooleanTrueTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.decoders.primitives","l":"BooleanTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.primitives","l":"BooleanTypeEncoder"},{"p":"org.apache.qpid.protonj2.engine.impl","l":"ProtonDeliveryTagGenerator.BUILTIN"},{"p":"org.apache.qpid.protonj2.codec.decoders.primitives","l":"ByteTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.primitives","l":"ByteTypeEncoder"},{"p":"org.apache.qpid.protonj2.codec.decoders.primitives","l":"CharacterTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.primitives","l":"CharacterTypeEncoder"},{"p":"org.apache.qpid.protonj2.client","l":"Client"},{"p":"org.apache.qpid.protonj2.client.impl","l":"ClientDeliveryState.ClientAccepted"},{"p":"org.apache.qpid.protonj2.client.impl","l":"ClientConnection"},{"p":"org.apache.qpid.protonj2.client.impl","l":"ClientConnectionCapabilities"},{"p":"org.apache.qpid.protonj2.client.exceptions","l":"ClientConnectionRedirectedException"},{"p":"org.apache.qpid.protonj2.client.exceptions","l":"ClientConnectionRemotelyClosedException"},{"p":"org.apache.qpid.protonj2.client.exceptions","l":"ClientConnectionSecurityException"},{"p":"org.apache.qpid.protonj2.client.exceptions","l":"ClientConnectionSecuritySaslException"},{"p":"org.apache.qpid.protonj2.client.impl","l":"ClientConstants"},{"p":"org.apache.qpid.protonj2.client.impl","l":"ClientDelivery"},{"p":"org.apache.qpid.protonj2.client.exceptions","l":"ClientDeliveryAbortedException"},{"p":"org.apache.qpid.protonj2.client.exceptions","l":"ClientDeliveryIsPartialException"},{"p":"org.apache.qpid.protonj2.client.impl","l":"ClientDeliveryState"},{"p":"org.apache.qpid.protonj2.client.exceptions","l":"ClientDeliveryStateException"},{"p":"org.apache.qpid.protonj2.client.impl","l":"ClientErrorCondition"},{"p":"org.apache.qpid.protonj2.client.exceptions","l":"ClientException"},{"p":"org.apache.qpid.protonj2.client.futures","l":"ClientFuture"},{"p":"org.apache.qpid.protonj2.client.futures","l":"ClientFutureFactory"},{"p":"org.apache.qpid.protonj2.client.exceptions","l":"ClientIdleTimeoutException"},{"p":"org.apache.qpid.protonj2.client.exceptions","l":"ClientIllegalStateException"},{"p":"org.apache.qpid.protonj2.client.impl","l":"ClientInstance"},{"p":"org.apache.qpid.protonj2.client.exceptions","l":"ClientIOException"},{"p":"org.apache.qpid.protonj2.client.exceptions","l":"ClientLinkRedirectedException"},{"p":"org.apache.qpid.protonj2.client.exceptions","l":"ClientLinkRemotelyClosedException"},{"p":"org.apache.qpid.protonj2.client.impl","l":"ClientMessage"},{"p":"org.apache.qpid.protonj2.client.exceptions","l":"ClientMessageFormatViolationException"},{"p":"org.apache.qpid.protonj2.client.impl","l":"ClientMessageSupport"},{"p":"org.apache.qpid.protonj2.client.impl","l":"ClientDeliveryState.ClientModified"},{"p":"org.apache.qpid.protonj2.client.impl","l":"ClientNoOpStreamTracker"},{"p":"org.apache.qpid.protonj2.client.impl","l":"ClientNoOpTracker"},{"p":"org.apache.qpid.protonj2.client.exceptions","l":"ClientOperationTimedOutException"},{"p":"org.apache.qpid.protonj2.client","l":"ClientOptions"},{"p":"org.apache.qpid.protonj2.client.impl","l":"ClientOutgoingEnvelope"},{"p":"org.apache.qpid.protonj2.client.impl","l":"ClientReceiver"},{"p":"org.apache.qpid.protonj2.client.impl","l":"ClientRedirect"},{"p":"org.apache.qpid.protonj2.client.impl","l":"ClientDeliveryState.ClientRejected"},{"p":"org.apache.qpid.protonj2.client.impl","l":"ClientDeliveryState.ClientReleased"},{"p":"org.apache.qpid.protonj2.client.exceptions","l":"ClientResourceRemotelyClosedException"},{"p":"org.apache.qpid.protonj2.client.exceptions","l":"ClientSendTimedOutException"},{"p":"org.apache.qpid.protonj2.client.impl","l":"ClientSession"},{"p":"org.apache.qpid.protonj2.client.exceptions","l":"ClientSessionRemotelyClosedException"},{"p":"org.apache.qpid.protonj2.client.impl","l":"ClientStreamDelivery"},{"p":"org.apache.qpid.protonj2.client.impl","l":"ClientStreamReceiver"},{"p":"org.apache.qpid.protonj2.client.impl","l":"ClientStreamReceiverMessage"},{"p":"org.apache.qpid.protonj2.client.impl","l":"ClientStreamSender"},{"p":"org.apache.qpid.protonj2.client.impl","l":"ClientStreamSession"},{"p":"org.apache.qpid.protonj2.client.impl","l":"ClientStreamTracker"},{"p":"org.apache.qpid.protonj2.client.futures","l":"ClientSynchronization"},{"p":"org.apache.qpid.protonj2.client.impl","l":"ClientDeliveryState.ClientTransactional"},{"p":"org.apache.qpid.protonj2.client.impl","l":"ClientTransactionContext"},{"p":"org.apache.qpid.protonj2.client.exceptions","l":"ClientTransactionDeclarationException"},{"p":"org.apache.qpid.protonj2.client.exceptions","l":"ClientTransactionInDoubtException"},{"p":"org.apache.qpid.protonj2.client.exceptions","l":"ClientTransactionNotActiveException"},{"p":"org.apache.qpid.protonj2.client.exceptions","l":"ClientTransactionRolledBackException"},{"p":"org.apache.qpid.protonj2.client.exceptions","l":"ClientUnsupportedOperationException"},{"p":"org.apache.qpid.protonj2.types.transport","l":"Close"},{"p":"org.apache.qpid.protonj2.codec.decoders.transport","l":"CloseTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.transport","l":"CloseTypeEncoder"},{"p":"org.apache.qpid.protonj2.codec","l":"CodecFactory"},{"p":"org.apache.qpid.protonj2.client","l":"Connection"},{"p":"org.apache.qpid.protonj2.engine","l":"Connection"},{"p":"org.apache.qpid.protonj2.types.transport","l":"ConnectionError"},{"p":"org.apache.qpid.protonj2.client","l":"ConnectionEvent"},{"p":"org.apache.qpid.protonj2.client","l":"ConnectionOptions"},{"p":"org.apache.qpid.protonj2.engine","l":"ConnectionState"},{"p":"org.apache.qpid.protonj2.client.futures","l":"ConservativeClientFuture"},{"p":"org.apache.qpid.protonj2.types.transactions","l":"Coordinator"},{"p":"org.apache.qpid.protonj2.codec.decoders.transactions","l":"CoordinatorTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.transactions","l":"CoordinatorTypeEncoder"},{"p":"org.apache.qpid.protonj2.engine.sasl.client","l":"CramMD5Mechanism"},{"p":"org.apache.qpid.protonj2.types.messaging","l":"Data"},{"p":"org.apache.qpid.protonj2.codec.decoders.messaging","l":"DataTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.messaging","l":"DataTypeEncoder"},{"p":"org.apache.qpid.protonj2.types","l":"Decimal128"},{"p":"org.apache.qpid.protonj2.codec.decoders.primitives","l":"Decimal128TypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.primitives","l":"Decimal128TypeEncoder"},{"p":"org.apache.qpid.protonj2.types","l":"Decimal32"},{"p":"org.apache.qpid.protonj2.codec.decoders.primitives","l":"Decimal32TypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.primitives","l":"Decimal32TypeEncoder"},{"p":"org.apache.qpid.protonj2.types","l":"Decimal64"},{"p":"org.apache.qpid.protonj2.codec.decoders.primitives","l":"Decimal64TypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.primitives","l":"Decimal64TypeEncoder"},{"p":"org.apache.qpid.protonj2.types.transactions","l":"Declare"},{"p":"org.apache.qpid.protonj2.types.transactions","l":"Declared"},{"p":"org.apache.qpid.protonj2.codec.decoders.transactions","l":"DeclaredTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.transactions","l":"DeclaredTypeEncoder"},{"p":"org.apache.qpid.protonj2.codec.decoders.transactions","l":"DeclareTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.transactions","l":"DeclareTypeEncoder"},{"p":"org.apache.qpid.protonj2.codec","l":"DecodeEOFException"},{"p":"org.apache.qpid.protonj2.codec","l":"DecodeException"},{"p":"org.apache.qpid.protonj2.codec","l":"Decoder"},{"p":"org.apache.qpid.protonj2.codec","l":"DecoderState"},{"p":"org.apache.qpid.protonj2.types.messaging","l":"DeleteOnClose"},{"p":"org.apache.qpid.protonj2.codec.decoders.messaging","l":"DeleteOnCloseTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.messaging","l":"DeleteOnCloseTypeEncoder"},{"p":"org.apache.qpid.protonj2.types.messaging","l":"DeleteOnNoLinks"},{"p":"org.apache.qpid.protonj2.types.messaging","l":"DeleteOnNoLinksOrMessages"},{"p":"org.apache.qpid.protonj2.codec.decoders.messaging","l":"DeleteOnNoLinksOrMessagesTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.messaging","l":"DeleteOnNoLinksOrMessagesTypeEncoder"},{"p":"org.apache.qpid.protonj2.codec.decoders.messaging","l":"DeleteOnNoLinksTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.messaging","l":"DeleteOnNoLinksTypeEncoder"},{"p":"org.apache.qpid.protonj2.types.messaging","l":"DeleteOnNoMessages"},{"p":"org.apache.qpid.protonj2.codec.decoders.messaging","l":"DeleteOnNoMessagesTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.messaging","l":"DeleteOnNoMessagesTypeEncoder"},{"p":"org.apache.qpid.protonj2.client","l":"Delivery"},{"p":"org.apache.qpid.protonj2.types.messaging","l":"DeliveryAnnotations"},{"p":"org.apache.qpid.protonj2.codec.decoders.messaging","l":"DeliveryAnnotationsTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.messaging","l":"DeliveryAnnotationsTypeEncoder"},{"p":"org.apache.qpid.protonj2.engine.util","l":"DeliveryIdTracker"},{"p":"org.apache.qpid.protonj2.client","l":"DeliveryMode"},{"p":"org.apache.qpid.protonj2.client.util","l":"DeliveryQueue"},{"p":"org.apache.qpid.protonj2.client","l":"DeliveryState"},{"p":"org.apache.qpid.protonj2.types.transport","l":"DeliveryState"},{"p":"org.apache.qpid.protonj2.types.transport","l":"DeliveryState.DeliveryStateType"},{"p":"org.apache.qpid.protonj2.types","l":"DeliveryTag"},{"p":"org.apache.qpid.protonj2.codec.encoders","l":"DeliveryTagEncoder"},{"p":"org.apache.qpid.protonj2.engine","l":"DeliveryTagGenerator"},{"p":"org.apache.qpid.protonj2.types","l":"DescribedType"},{"p":"org.apache.qpid.protonj2.codec","l":"DescribedTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec","l":"DescribedTypeEncoder"},{"p":"org.apache.qpid.protonj2.types.transport","l":"Detach"},{"p":"org.apache.qpid.protonj2.codec.decoders.transport","l":"DetachTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.transport","l":"DetachTypeEncoder"},{"p":"org.apache.qpid.protonj2.types.transactions","l":"Discharge"},{"p":"org.apache.qpid.protonj2.engine","l":"Transaction.DischargeState"},{"p":"org.apache.qpid.protonj2.codec.decoders.transactions","l":"DischargeTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.transactions","l":"DischargeTypeEncoder"},{"p":"org.apache.qpid.protonj2.client","l":"DisconnectionEvent"},{"p":"org.apache.qpid.protonj2.types.transport","l":"Disposition"},{"p":"org.apache.qpid.protonj2.codec.decoders.transport","l":"DispositionTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.transport","l":"DispositionTypeEncoder"},{"p":"org.apache.qpid.protonj2.client","l":"DistributionMode"},{"p":"org.apache.qpid.protonj2.codec.decoders.primitives","l":"DoubleTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.primitives","l":"DoubleTypeEncoder"},{"p":"org.apache.qpid.protonj2.client","l":"DurabilityMode"},{"p":"org.apache.qpid.protonj2.engine","l":"EmptyEnvelope"},{"p":"org.apache.qpid.protonj2.codec","l":"EncodeException"},{"p":"org.apache.qpid.protonj2.codec","l":"Encoder"},{"p":"org.apache.qpid.protonj2.codec","l":"EncoderState"},{"p":"org.apache.qpid.protonj2.codec","l":"EncodingCodes"},{"p":"org.apache.qpid.protonj2.types.transport","l":"End"},{"p":"org.apache.qpid.protonj2.engine","l":"Endpoint"},{"p":"org.apache.qpid.protonj2.codec.decoders.transport","l":"EndTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.transport","l":"EndTypeEncoder"},{"p":"org.apache.qpid.protonj2.engine","l":"Engine"},{"p":"org.apache.qpid.protonj2.engine","l":"EngineConfiguration"},{"p":"org.apache.qpid.protonj2.engine","l":"EngineFactory"},{"p":"org.apache.qpid.protonj2.engine.exceptions","l":"EngineFailedException"},{"p":"org.apache.qpid.protonj2.engine","l":"EngineHandler"},{"p":"org.apache.qpid.protonj2.engine","l":"EngineHandlerContext"},{"p":"org.apache.qpid.protonj2.engine.exceptions","l":"EngineNotStartedException"},{"p":"org.apache.qpid.protonj2.engine.exceptions","l":"EngineNotWritableException"},{"p":"org.apache.qpid.protonj2.engine","l":"EnginePipeline"},{"p":"org.apache.qpid.protonj2.engine","l":"EngineSaslDriver"},{"p":"org.apache.qpid.protonj2.engine.exceptions","l":"EngineShutdownException"},{"p":"org.apache.qpid.protonj2.engine.exceptions","l":"EngineStartedException"},{"p":"org.apache.qpid.protonj2.engine","l":"EngineState"},{"p":"org.apache.qpid.protonj2.engine.exceptions","l":"EngineStateException"},{"p":"org.apache.qpid.protonj2.client.transport","l":"EpollSupport"},{"p":"org.apache.qpid.protonj2.client","l":"ErrorCondition"},{"p":"org.apache.qpid.protonj2.types.transport","l":"ErrorCondition"},{"p":"org.apache.qpid.protonj2.codec.decoders.transport","l":"ErrorConditionTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.transport","l":"ErrorConditionTypeEncoder"},{"p":"org.apache.qpid.protonj2.engine","l":"EventHandler"},{"p":"org.apache.qpid.protonj2.client","l":"ExpiryPolicy"},{"p":"org.apache.qpid.protonj2.engine.sasl.client","l":"ExternalMechanism"},{"p":"org.apache.qpid.protonj2.client.util","l":"FifoDeliveryQueue"},{"p":"org.apache.qpid.protonj2.codec.decoders.primitives","l":"FloatTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.primitives","l":"FloatTypeEncoder"},{"p":"org.apache.qpid.protonj2.types.transport","l":"Flow"},{"p":"org.apache.qpid.protonj2.codec.decoders.transport","l":"FlowTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.transport","l":"FlowTypeEncoder"},{"p":"org.apache.qpid.protonj2.types.messaging","l":"Footer"},{"p":"org.apache.qpid.protonj2.codec.decoders.messaging","l":"FooterTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.messaging","l":"FooterTypeEncoder"},{"p":"org.apache.qpid.protonj2.engine.exceptions","l":"FrameDecodingException"},{"p":"org.apache.qpid.protonj2.engine.exceptions","l":"FrameEncodingException"},{"p":"org.apache.qpid.protonj2.types.transactions","l":"GlobalTxId"},{"p":"org.apache.qpid.protonj2.types.messaging","l":"Header"},{"p":"org.apache.qpid.protonj2.engine","l":"HeaderEnvelope"},{"p":"org.apache.qpid.protonj2.types.transport","l":"AMQPHeader.HeaderHandler"},{"p":"org.apache.qpid.protonj2.codec.decoders.messaging","l":"HeaderTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.messaging","l":"HeaderTypeEncoder"},{"p":"org.apache.qpid.protonj2.client.util","l":"IdGenerator"},{"p":"org.apache.qpid.protonj2.engine.exceptions","l":"IdleTimeoutException"},{"p":"org.apache.qpid.protonj2.engine.util","l":"SplayMap.ImmutableSplayMapEntry"},{"p":"org.apache.qpid.protonj2.engine","l":"IncomingAMQPEnvelope"},{"p":"org.apache.qpid.protonj2.engine","l":"IncomingDelivery"},{"p":"org.apache.qpid.protonj2.codec.decoders.primitives","l":"Integer32TypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.decoders.primitives","l":"Integer8TypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.primitives","l":"IntegerTypeEncoder"},{"p":"org.apache.qpid.protonj2.client.util","l":"IOExceptionSupport"},{"p":"org.apache.qpid.protonj2.client.transport","l":"IOUringSupport"},{"p":"org.apache.qpid.protonj2.client.transport","l":"KQueueSupport"},{"p":"org.apache.qpid.protonj2.types.messaging","l":"LifetimePolicy"},{"p":"org.apache.qpid.protonj2.engine","l":"Link"},{"p":"org.apache.qpid.protonj2.engine","l":"LinkCreditState"},{"p":"org.apache.qpid.protonj2.engine.util","l":"LinkedSplayMap"},{"p":"org.apache.qpid.protonj2.types.transport","l":"LinkError"},{"p":"org.apache.qpid.protonj2.engine","l":"LinkState"},{"p":"org.apache.qpid.protonj2.codec.decoders.primitives","l":"List0TypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.decoders.primitives","l":"List32TypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.decoders.primitives","l":"List8TypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.decoders.primitives","l":"ListTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.primitives","l":"ListTypeEncoder"},{"p":"org.apache.qpid.protonj2.codec.decoders.primitives","l":"Long8TypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.decoders.primitives","l":"LongTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.primitives","l":"LongTypeEncoder"},{"p":"org.apache.qpid.protonj2.engine.exceptions","l":"MalformedAMQPHeaderException"},{"p":"org.apache.qpid.protonj2.codec.decoders.primitives","l":"Map32TypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.decoders.primitives","l":"Map8TypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.decoders.primitives","l":"MapTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.primitives","l":"MapTypeEncoder"},{"p":"org.apache.qpid.protonj2.engine.sasl.client","l":"Mechanism"},{"p":"org.apache.qpid.protonj2.engine.sasl","l":"MechanismMismatchException"},{"p":"org.apache.qpid.protonj2.client","l":"Message"},{"p":"org.apache.qpid.protonj2.types.messaging","l":"MessageAnnotations"},{"p":"org.apache.qpid.protonj2.codec.decoders.messaging","l":"MessageAnnotationsTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.messaging","l":"MessageAnnotationsTypeEncoder"},{"p":"org.apache.qpid.protonj2.types.messaging","l":"Modified"},{"p":"org.apache.qpid.protonj2.codec.decoders.messaging","l":"ModifiedTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.messaging","l":"ModifiedTypeEncoder"},{"p":"org.apache.qpid.protonj2.client.transport","l":"TcpTransport.NettyDefaultHandler"},{"p":"org.apache.qpid.protonj2.client.transport","l":"NettyIOContext"},{"p":"org.apache.qpid.protonj2.client.transport","l":"TcpTransport.NettyTcpTransportHandler"},{"p":"org.apache.qpid.protonj2.client.futures","l":"NoOpAsyncResult"},{"p":"org.apache.qpid.protonj2.logging","l":"NoOpProtonLogger"},{"p":"org.apache.qpid.protonj2.logging","l":"NoOpProtonLoggerFactory"},{"p":"org.apache.qpid.protonj2.codec.decoders.primitives","l":"NullTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.primitives","l":"NullTypeEncoder"},{"p":"org.apache.qpid.protonj2.types.transport","l":"Open"},{"p":"org.apache.qpid.protonj2.codec.decoders.transport","l":"OpenTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.transport","l":"OpenTypeEncoder"},{"p":"org.apache.qpid.protonj2.types.messaging","l":"Outcome"},{"p":"org.apache.qpid.protonj2.engine","l":"OutgoingAMQPEnvelope"},{"p":"org.apache.qpid.protonj2.engine","l":"OutgoingDelivery"},{"p":"org.apache.qpid.protonj2.client","l":"OutputStreamOptions"},{"p":"org.apache.qpid.protonj2.types.transport","l":"Performative"},{"p":"org.apache.qpid.protonj2.engine","l":"PerformativeEnvelope"},{"p":"org.apache.qpid.protonj2.types.transport","l":"Performative.PerformativeHandler"},{"p":"org.apache.qpid.protonj2.types.transport","l":"Performative.PerformativeType"},{"p":"org.apache.qpid.protonj2.engine.sasl.client","l":"PlainMechanism"},{"p":"org.apache.qpid.protonj2.codec.decoders","l":"PrimitiveArrayTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.decoders","l":"PrimitiveTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders","l":"PrimitiveTypeEncoder"},{"p":"org.apache.qpid.protonj2.client.futures","l":"ProgressiveClientFuture"},{"p":"org.apache.qpid.protonj2.types.messaging","l":"Properties"},{"p":"org.apache.qpid.protonj2.codec.decoders.messaging","l":"PropertiesTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.messaging","l":"PropertiesTypeEncoder"},{"p":"org.apache.qpid.protonj2.engine.exceptions","l":"ProtocolViolationException"},{"p":"org.apache.qpid.protonj2.buffer","l":"ProtonAbstractBuffer"},{"p":"org.apache.qpid.protonj2.engine.impl","l":"ProtonAttachments"},{"p":"org.apache.qpid.protonj2.buffer","l":"ProtonBuffer"},{"p":"org.apache.qpid.protonj2.buffer","l":"ProtonBufferAllocator"},{"p":"org.apache.qpid.protonj2.buffer","l":"ProtonBufferInputStream"},{"p":"org.apache.qpid.protonj2.buffer","l":"ProtonBufferOutputStream"},{"p":"org.apache.qpid.protonj2.buffer","l":"ProtonByteBuffer"},{"p":"org.apache.qpid.protonj2.buffer","l":"ProtonByteBufferAllocator"},{"p":"org.apache.qpid.protonj2.buffer","l":"ProtonByteUtils"},{"p":"org.apache.qpid.protonj2.buffer","l":"ProtonCompositeBuffer"},{"p":"org.apache.qpid.protonj2.engine.impl","l":"ProtonConnection"},{"p":"org.apache.qpid.protonj2.engine.impl","l":"ProtonConstants"},{"p":"org.apache.qpid.protonj2.codec.decoders","l":"ProtonDecoder"},{"p":"org.apache.qpid.protonj2.codec.decoders","l":"ProtonDecoderFactory"},{"p":"org.apache.qpid.protonj2.codec.decoders","l":"ProtonDecoderState"},{"p":"org.apache.qpid.protonj2.types","l":"DeliveryTag.ProtonDeliveryTag"},{"p":"org.apache.qpid.protonj2.engine.impl","l":"ProtonDeliveryTagGenerator"},{"p":"org.apache.qpid.protonj2.buffer","l":"ProtonDuplicatedBuffer"},{"p":"org.apache.qpid.protonj2.codec.encoders","l":"ProtonEncoder"},{"p":"org.apache.qpid.protonj2.codec.encoders","l":"ProtonEncoderFactory"},{"p":"org.apache.qpid.protonj2.codec.encoders","l":"ProtonEncoderState"},{"p":"org.apache.qpid.protonj2.engine.impl","l":"ProtonEndpoint"},{"p":"org.apache.qpid.protonj2.engine.impl","l":"ProtonEngine"},{"p":"org.apache.qpid.protonj2.engine.impl","l":"ProtonEngineConfiguration"},{"p":"org.apache.qpid.protonj2.engine.impl","l":"ProtonEngineFactory"},{"p":"org.apache.qpid.protonj2.engine.impl","l":"ProtonEngineHandlerContext"},{"p":"org.apache.qpid.protonj2.engine.impl","l":"ProtonEngineNoOpSaslDriver"},{"p":"org.apache.qpid.protonj2.engine.impl","l":"ProtonEnginePipeline"},{"p":"org.apache.qpid.protonj2.engine.impl","l":"ProtonEnginePipelineProxy"},{"p":"org.apache.qpid.protonj2.engine.exceptions","l":"ProtonException"},{"p":"org.apache.qpid.protonj2.engine.exceptions","l":"ProtonExceptionSupport"},{"p":"org.apache.qpid.protonj2.engine.impl","l":"ProtonFrameDecodingHandler"},{"p":"org.apache.qpid.protonj2.engine.impl","l":"ProtonFrameEncodingHandler"},{"p":"org.apache.qpid.protonj2.engine.impl","l":"ProtonFrameLoggingHandler"},{"p":"org.apache.qpid.protonj2.engine.impl","l":"ProtonIncomingDelivery"},{"p":"org.apache.qpid.protonj2.engine.exceptions","l":"ProtonIOException"},{"p":"org.apache.qpid.protonj2.engine.impl","l":"ProtonLink"},{"p":"org.apache.qpid.protonj2.engine.impl","l":"ProtonLinkCreditState"},{"p":"org.apache.qpid.protonj2.logging","l":"ProtonLogger"},{"p":"org.apache.qpid.protonj2.logging","l":"ProtonLoggerFactory"},{"p":"org.apache.qpid.protonj2.buffer","l":"ProtonNettyByteBuffer"},{"p":"org.apache.qpid.protonj2.buffer","l":"ProtonNettyByteBufferAllocator"},{"p":"org.apache.qpid.protonj2.buffer","l":"ProtonNioByteBuffer"},{"p":"org.apache.qpid.protonj2.engine.impl","l":"ProtonSequentialTagGenerator.ProtonNumericDeliveryTag"},{"p":"org.apache.qpid.protonj2.engine.impl","l":"ProtonOutgoingDelivery"},{"p":"org.apache.qpid.protonj2.engine.impl","l":"ProtonPerformativeHandler"},{"p":"org.apache.qpid.protonj2.engine.impl","l":"ProtonPooledTagGenerator"},{"p":"org.apache.qpid.protonj2.engine.impl","l":"ProtonReceiver"},{"p":"org.apache.qpid.protonj2.engine.impl.sasl","l":"ProtonSaslHandler"},{"p":"org.apache.qpid.protonj2.engine.impl","l":"ProtonSender"},{"p":"org.apache.qpid.protonj2.engine.impl","l":"ProtonSequentialTagGenerator"},{"p":"org.apache.qpid.protonj2.engine.impl","l":"ProtonSession"},{"p":"org.apache.qpid.protonj2.engine.impl","l":"ProtonSessionIncomingWindow"},{"p":"org.apache.qpid.protonj2.engine.impl","l":"ProtonSessionOutgoingWindow"},{"p":"org.apache.qpid.protonj2.buffer","l":"ProtonSlicedBuffer"},{"p":"org.apache.qpid.protonj2.codec.decoders","l":"ProtonStreamDecoder"},{"p":"org.apache.qpid.protonj2.codec.decoders","l":"ProtonStreamDecoderFactory"},{"p":"org.apache.qpid.protonj2.codec.decoders","l":"ProtonStreamDecoderState"},{"p":"org.apache.qpid.protonj2.codec.decoders","l":"ProtonStreamUtils"},{"p":"org.apache.qpid.protonj2.engine.impl","l":"ProtonTransaction"},{"p":"org.apache.qpid.protonj2.engine.impl","l":"ProtonTransactionController"},{"p":"org.apache.qpid.protonj2.engine.impl","l":"ProtonTransactionManager"},{"p":"org.apache.qpid.protonj2.engine.impl","l":"ProtonUuidTagGenerator"},{"p":"org.apache.qpid.protonj2.types.messaging","l":"Received"},{"p":"org.apache.qpid.protonj2.codec.decoders.messaging","l":"ReceivedTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.messaging","l":"ReceivedTypeEncoder"},{"p":"org.apache.qpid.protonj2.client","l":"Receiver"},{"p":"org.apache.qpid.protonj2.engine","l":"Receiver"},{"p":"org.apache.qpid.protonj2.client","l":"ReceiverOptions"},{"p":"org.apache.qpid.protonj2.types.transport","l":"ReceiverSettleMode"},{"p":"org.apache.qpid.protonj2.client","l":"ReconnectLocation"},{"p":"org.apache.qpid.protonj2.client.util","l":"ReconnectLocationPool"},{"p":"org.apache.qpid.protonj2.client","l":"ReconnectOptions"},{"p":"org.apache.qpid.protonj2.types.messaging","l":"Rejected"},{"p":"org.apache.qpid.protonj2.codec.decoders.messaging","l":"RejectedTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.messaging","l":"RejectedTypeEncoder"},{"p":"org.apache.qpid.protonj2.types.messaging","l":"Released"},{"p":"org.apache.qpid.protonj2.codec.decoders.messaging","l":"ReleasedTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.messaging","l":"ReleasedTypeEncoder"},{"p":"org.apache.qpid.protonj2.engine.util","l":"RingQueue"},{"p":"org.apache.qpid.protonj2.engine.sasl","l":"SaslContext.Role"},{"p":"org.apache.qpid.protonj2.types.transport","l":"Role"},{"p":"org.apache.qpid.protonj2.engine.sasl.client","l":"SaslAuthenticator"},{"p":"org.apache.qpid.protonj2.types.security","l":"SaslChallenge"},{"p":"org.apache.qpid.protonj2.codec.decoders.security","l":"SaslChallengeTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.security","l":"SaslChallengeTypeEncoder"},{"p":"org.apache.qpid.protonj2.engine.sasl","l":"SaslClientContext"},{"p":"org.apache.qpid.protonj2.engine.sasl","l":"SaslClientListener"},{"p":"org.apache.qpid.protonj2.types.security","l":"SaslCode"},{"p":"org.apache.qpid.protonj2.engine.sasl","l":"SaslContext"},{"p":"org.apache.qpid.protonj2.engine.sasl.client","l":"SaslCredentialsProvider"},{"p":"org.apache.qpid.protonj2.engine","l":"SASLEnvelope"},{"p":"org.apache.qpid.protonj2.types.security","l":"SaslInit"},{"p":"org.apache.qpid.protonj2.codec.decoders.security","l":"SaslInitTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.security","l":"SaslInitTypeEncoder"},{"p":"org.apache.qpid.protonj2.engine.sasl.client","l":"SaslMechanisms"},{"p":"org.apache.qpid.protonj2.types.security","l":"SaslMechanisms"},{"p":"org.apache.qpid.protonj2.engine.sasl.client","l":"SaslMechanismSelector"},{"p":"org.apache.qpid.protonj2.codec.decoders.security","l":"SaslMechanismsTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.security","l":"SaslMechanismsTypeEncoder"},{"p":"org.apache.qpid.protonj2.client","l":"SaslOptions"},{"p":"org.apache.qpid.protonj2.engine.sasl","l":"SaslOutcome"},{"p":"org.apache.qpid.protonj2.types.security","l":"SaslOutcome"},{"p":"org.apache.qpid.protonj2.codec.decoders.security","l":"SaslOutcomeTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.security","l":"SaslOutcomeTypeEncoder"},{"p":"org.apache.qpid.protonj2.types.security","l":"SaslPerformative"},{"p":"org.apache.qpid.protonj2.types.security","l":"SaslPerformative.SaslPerformativeHandler"},{"p":"org.apache.qpid.protonj2.types.security","l":"SaslPerformative.SaslPerformativeType"},{"p":"org.apache.qpid.protonj2.types.security","l":"SaslResponse"},{"p":"org.apache.qpid.protonj2.codec.decoders.security","l":"SaslResponseTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.security","l":"SaslResponseTypeEncoder"},{"p":"org.apache.qpid.protonj2.engine.sasl","l":"SaslServerContext"},{"p":"org.apache.qpid.protonj2.engine.sasl","l":"SaslServerListener"},{"p":"org.apache.qpid.protonj2.engine","l":"EngineSaslDriver.SaslState"},{"p":"org.apache.qpid.protonj2.engine.sasl","l":"SaslSystemException"},{"p":"org.apache.qpid.protonj2.engine.sasl.client","l":"ScramSHA1Mechanism"},{"p":"org.apache.qpid.protonj2.engine.sasl.client","l":"ScramSHA256Mechanism"},{"p":"org.apache.qpid.protonj2.engine.sasl.client","l":"ScramSHA512Mechanism"},{"p":"org.apache.qpid.protonj2.types.messaging","l":"Section"},{"p":"org.apache.qpid.protonj2.types.messaging","l":"Section.SectionType"},{"p":"org.apache.qpid.protonj2.client","l":"Sender"},{"p":"org.apache.qpid.protonj2.engine","l":"Sender"},{"p":"org.apache.qpid.protonj2.client","l":"SenderOptions"},{"p":"org.apache.qpid.protonj2.types.transport","l":"SenderSettleMode"},{"p":"org.apache.qpid.protonj2.engine.util","l":"SequenceNumber"},{"p":"org.apache.qpid.protonj2.client","l":"Session"},{"p":"org.apache.qpid.protonj2.engine","l":"Session"},{"p":"org.apache.qpid.protonj2.types.transport","l":"SessionError"},{"p":"org.apache.qpid.protonj2.client","l":"SessionOptions"},{"p":"org.apache.qpid.protonj2.engine","l":"SessionState"},{"p":"org.apache.qpid.protonj2.codec.decoders.primitives","l":"ShortTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.primitives","l":"ShortTypeEncoder"},{"p":"org.apache.qpid.protonj2.logging","l":"Slf4JLoggerFactory"},{"p":"org.apache.qpid.protonj2.logging","l":"Slf4JLoggerWrapper"},{"p":"org.apache.qpid.protonj2.client","l":"Source"},{"p":"org.apache.qpid.protonj2.types.messaging","l":"Source"},{"p":"org.apache.qpid.protonj2.client","l":"SourceOptions"},{"p":"org.apache.qpid.protonj2.codec.decoders.messaging","l":"SourceTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.messaging","l":"SourceTypeEncoder"},{"p":"org.apache.qpid.protonj2.engine.util","l":"SplayMap.SplayedEntry"},{"p":"org.apache.qpid.protonj2.engine.util","l":"SplayMap"},{"p":"org.apache.qpid.protonj2.client","l":"SslOptions"},{"p":"org.apache.qpid.protonj2.client.transport","l":"SslSupport"},{"p":"org.apache.qpid.protonj2.client.util","l":"StopWatch"},{"p":"org.apache.qpid.protonj2.codec","l":"StreamDecoder"},{"p":"org.apache.qpid.protonj2.codec","l":"StreamDecoderState"},{"p":"org.apache.qpid.protonj2.client","l":"StreamDelivery"},{"p":"org.apache.qpid.protonj2.codec","l":"StreamDescribedTypeDecoder"},{"p":"org.apache.qpid.protonj2.client","l":"StreamReceiver"},{"p":"org.apache.qpid.protonj2.client","l":"StreamReceiverMessage"},{"p":"org.apache.qpid.protonj2.client","l":"StreamReceiverOptions"},{"p":"org.apache.qpid.protonj2.client","l":"StreamSender"},{"p":"org.apache.qpid.protonj2.client","l":"StreamSenderMessage"},{"p":"org.apache.qpid.protonj2.client","l":"StreamSenderOptions"},{"p":"org.apache.qpid.protonj2.client","l":"StreamTracker"},{"p":"org.apache.qpid.protonj2.codec","l":"StreamTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.decoders.primitives","l":"String32TypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.decoders.primitives","l":"String8TypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.decoders.primitives","l":"StringTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.primitives","l":"StringTypeEncoder"},{"p":"org.apache.qpid.protonj2.engine.util","l":"StringUtils"},{"p":"org.apache.qpid.protonj2.types","l":"Symbol"},{"p":"org.apache.qpid.protonj2.codec.decoders.primitives","l":"Symbol32TypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.decoders.primitives","l":"Symbol8TypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.decoders.primitives","l":"SymbolTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.primitives","l":"SymbolTypeEncoder"},{"p":"org.apache.qpid.protonj2.client","l":"Target"},{"p":"org.apache.qpid.protonj2.types.messaging","l":"Target"},{"p":"org.apache.qpid.protonj2.client","l":"TargetOptions"},{"p":"org.apache.qpid.protonj2.codec.decoders.messaging","l":"TargetTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.messaging","l":"TargetTypeEncoder"},{"p":"org.apache.qpid.protonj2.client.transport","l":"TcpTransport"},{"p":"org.apache.qpid.protonj2.types.messaging","l":"Terminus"},{"p":"org.apache.qpid.protonj2.types.messaging","l":"TerminusDurability"},{"p":"org.apache.qpid.protonj2.types.messaging","l":"TerminusExpiryPolicy"},{"p":"org.apache.qpid.protonj2.client","l":"TerminusOptions"},{"p":"org.apache.qpid.protonj2.client.util","l":"ThreadPoolUtils"},{"p":"org.apache.qpid.protonj2.codec.decoders.primitives","l":"TimestampTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.primitives","l":"TimestampTypeEncoder"},{"p":"org.apache.qpid.protonj2.client.util","l":"TimeUtils"},{"p":"org.apache.qpid.protonj2.client.util","l":"TrackableThreadFactory"},{"p":"org.apache.qpid.protonj2.client","l":"Tracker"},{"p":"org.apache.qpid.protonj2.engine","l":"Transaction"},{"p":"org.apache.qpid.protonj2.types.transactions","l":"TransactionalState"},{"p":"org.apache.qpid.protonj2.engine","l":"TransactionController"},{"p":"org.apache.qpid.protonj2.types.transactions","l":"TransactionErrors"},{"p":"org.apache.qpid.protonj2.engine","l":"TransactionManager"},{"p":"org.apache.qpid.protonj2.engine","l":"TransactionState"},{"p":"org.apache.qpid.protonj2.codec.decoders.transactions","l":"TransactionStateTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.transactions","l":"TransactionStateTypeEncoder"},{"p":"org.apache.qpid.protonj2.types.transport","l":"Transfer"},{"p":"org.apache.qpid.protonj2.codec.decoders.transport","l":"TransferTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.transport","l":"TransferTypeEncoder"},{"p":"org.apache.qpid.protonj2.client.transport","l":"Transport"},{"p":"org.apache.qpid.protonj2.client.transport","l":"TransportListener"},{"p":"org.apache.qpid.protonj2.client","l":"TransportOptions"},{"p":"org.apache.qpid.protonj2.types.transactions","l":"TxnCapability"},{"p":"org.apache.qpid.protonj2.client","l":"DeliveryState.Type"},{"p":"org.apache.qpid.protonj2.codec","l":"TypeDecoder"},{"p":"org.apache.qpid.protonj2.codec","l":"TypeEncoder"},{"p":"org.apache.qpid.protonj2.types","l":"UnknownDescribedType"},{"p":"org.apache.qpid.protonj2.codec.decoders","l":"UnknownDescribedTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders","l":"UnknownDescribedTypeEncoder"},{"p":"org.apache.qpid.protonj2.types","l":"UnsignedByte"},{"p":"org.apache.qpid.protonj2.codec.decoders.primitives","l":"UnsignedByteTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.primitives","l":"UnsignedByteTypeEncoder"},{"p":"org.apache.qpid.protonj2.types","l":"UnsignedInteger"},{"p":"org.apache.qpid.protonj2.codec.decoders.primitives","l":"UnsignedInteger0TypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.decoders.primitives","l":"UnsignedInteger32TypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.decoders.primitives","l":"UnsignedInteger8TypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.primitives","l":"UnsignedIntegerTypeEncoder"},{"p":"org.apache.qpid.protonj2.types","l":"UnsignedLong"},{"p":"org.apache.qpid.protonj2.codec.decoders.primitives","l":"UnsignedLong0TypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.decoders.primitives","l":"UnsignedLong64TypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.decoders.primitives","l":"UnsignedLong8TypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.primitives","l":"UnsignedLongTypeEncoder"},{"p":"org.apache.qpid.protonj2.types","l":"UnsignedShort"},{"p":"org.apache.qpid.protonj2.codec.decoders.primitives","l":"UnsignedShortTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.primitives","l":"UnsignedShortTypeEncoder"},{"p":"org.apache.qpid.protonj2.codec.decoders","l":"UTF8Decoder"},{"p":"org.apache.qpid.protonj2.codec.encoders","l":"UTF8Encoder"},{"p":"org.apache.qpid.protonj2.codec.decoders","l":"UTF8StreamDecoder"},{"p":"org.apache.qpid.protonj2.codec.decoders.primitives","l":"UUIDTypeDecoder"},{"p":"org.apache.qpid.protonj2.codec.encoders.primitives","l":"UUIDTypeEncoder"},{"p":"org.apache.qpid.protonj2.client.transport","l":"WebSocketTransport"},{"p":"org.apache.qpid.protonj2.client.transport","l":"X509AliasKeyManager"},{"p":"org.apache.qpid.protonj2.engine.sasl.client","l":"XOauth2Mechanism"}]
import React from 'react' import Layout from 'components/layout' import { Link } from 'gatsby' const NationalDePage = () => ( <Layout> <main> <div className="container px-5 region-content"> <h1 className="page-title">National Demonstration Project</h1> <p> After exploring during 1997 the feasibility and desirability of establishing new Teachers Institutes at other locations, the Teachers Institute undertook a National Demonstration Project to demonstrate the potential for adapting at other sites the approach to teacher professional development that had been followed for more than two decades by the Yale-New Haven Teachers Institute. </p> <div className="row mt-4"> <div className="col-sm-8 left-panel"> <ul> <li> <strong> <Link to="/ndp/NDP.html"> A National Demonstration Project: Aims and Current Accomplishments, 2000{' '} </Link> </strong> <br /> <a target='_blank' href="/pdfs/ndp/NDP.pdf"> (pdf version with photos) </a> <p> The report describes the establishment of four new Teachers Institutes serving urban school systems that enroll students who are mainly from low-income and minority communities. It sets forth the basic principles that had been developed by the Yale-New Haven Teachers Institute that became the guiding principle for each of the new Teachers Institutes.{' '} </p> </li> <li> <strong> <Link to="/ndp/ndp1999.html"> A National Demonstration Project, 1999 </Link> </strong> <br /> <a target='_blank' href="/pdfs/ndp/ndp1999.pdf"> (pdf version with photos) </a> <p> The report describes the establishment and purposes of a National Demonstration Project including the site visits that resulted in a proposal for a 4-year project that would constitute a major step toward the nationwide establishment of Teachers Institutes following the approach developed originally in New Haven.{' '} </p> </li> </ul> </div> <div className="row" /> </div> </div> </main> </Layout> ) export default NationalDePage
/*global require, console, __dirname, JSON*/ var TextAdapter = require('./textadapter'); var q = require('json-query'); var fs = require('fs'); var path = require('path'); var startDate = new Date("Sun Apr 16 2017"); var dataDir = path.join(__dirname, 'data'); var adapter; function afterLoaded() { console.log("data loaded.."); console.log("Number of rows: " + adapter.dataTable.length); var dataTable = adapter.dataTable; //var result = q('[[*0=2017-04-16T18:12:00.000Z]]', dataTable); //fs.writeFileSync("result.json", JSON.stringify(result, null, 4)); var routeAggregateByDay = adapter.routeAggregateByDay(); var routes7day = adapter.routeSum(7); fs.writeFileSync("dataTable.json", JSON.stringify(dataTable, null, 4)); fs.writeFileSync("routeAggregateByDay.json", JSON.stringify(routeAggregateByDay, null, 4)); fs.writeFileSync("routes7day.json", JSON.stringify(routes7day, null, 4)); //console.log("Number of visitors found: " + routes7day.rows.length); } adapter = new TextAdapter(dataDir, startDate, afterLoaded);
/*: * @plugindesc This plugin provides a function that would not turn off the screen during the game on Android * @author biud436 * @help * var pointer; * WakeLock.getScreenWidth(pointer); * WakeLock.getScreenHeight(pointer); * WakeLock.getScreenDestiny(pointer); */ var Imported = Imported || {}; Imported.RS_WakeLock = true; (function () { if(!Utils.isMobileDevice() || (!!window.WakeLock) === false) { Imported.RS_WakeLock = undefined; return false; } if(!!navigator.userAgent.match(/Android/)) { WakeLock.init(); } })();
import { createApp } from 'vue' import { Router } from './router.js' import { Auth } from './auth.js' import App from './App.vue' import 'bootstrap/dist/css/bootstrap.min.css' const app = createApp(App) app.use(Router) // Make auth object global to access from anywhere app.config.globalProperties.$auth = Auth Auth .initialize() .then(() => {}) .catch(console.error) .finally(() => { app.mount('#app') })
'use strict'; const autoprefixer = require('autoprefixer'); const path = require('path'); const webpack = require('webpack'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin'); const InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin'); const WatchMissingNodeModulesPlugin = require('react-dev-utils/WatchMissingNodeModulesPlugin'); const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin'); const getClientEnvironment = require('./env'); const paths = require('./paths'); // Webpack uses `publicPath` to determine where the app is being served from. // In development, we always serve from the root. This makes config easier. const publicPath = '/'; // `publicUrl` is just like `publicPath`, but we will provide it to our app // as %PUBLIC_URL% in `index.html` and `process.env.PUBLIC_URL` in JavaScript. // Omit trailing slash as %PUBLIC_PATH%/xyz looks better than %PUBLIC_PATH%xyz. const publicUrl = ''; // Get environment variables to inject into our app. const env = getClientEnvironment(publicUrl); // This is the development configuration. // It is focused on developer experience and fast rebuilds. // The production configuration is different and lives in a separate file. module.exports = { // You may want 'eval' instead if you prefer to see the compiled output in DevTools. // See the discussion in https://github.com/facebookincubator/create-react-app/issues/343. devtool: 'cheap-module-source-map', // These are the "entry points" to our application. // This means they will be the "root" imports that are included in JS bundle. // The first two entry points enable "hot" CSS and auto-refreshes for JS. entry: [ // We ship a few polyfills by default: require.resolve('./polyfills'), // Include an alternative client for WebpackDevServer. A client's job is to // connect to WebpackDevServer by a socket and get notified about changes. // When you save a file, the client will either apply hot updates (in case // of CSS changes), or refresh the page (in case of JS changes). When you // make a syntax error, this client will display a syntax error overlay. // Note: instead of the default WebpackDevServer client, we use a custom one // to bring better experience for Create React App users. You can replace // the line below with these two lines if you prefer the stock client: // require.resolve('webpack-dev-server/client') + '?/', // require.resolve('webpack/hot/dev-server'), require.resolve('react-dev-utils/webpackHotDevClient'), // Finally, this is your app's code: paths.appIndexJs, // We include the app code last so that if there is a runtime error during // initialization, it doesn't blow up the WebpackDevServer client, and // changing JS code would still trigger a refresh. ], output: { // Next line is not used in dev but WebpackDevServer crashes without it: path: paths.appBuild, // Add /* filename */ comments to generated require()s in the output. pathinfo: true, // This does not produce a real file. It's just the virtual path that is // served by WebpackDevServer in development. This is the JS bundle // containing code from all our entry points, and the Webpack runtime. filename: 'static/js/bundle.js', // There are also additional JS chunk files if you use code splitting. chunkFilename: 'static/js/[name].chunk.js', // This is the URL that app is served from. We use "/" in development. publicPath: publicPath, // Point sourcemap entries to original disk location (format as URL on Windows) devtoolModuleFilenameTemplate: info => path.resolve(info.absoluteResourcePath).replace(/\\/g, '/'), }, resolve: { // This allows you to set a fallback for where Webpack should look for modules. // We placed these paths second because we want `node_modules` to "win" // if there are any conflicts. This matches Node resolution mechanism. // https://github.com/facebookincubator/create-react-app/issues/253 modules: ['node_modules', paths.appNodeModules].concat( // It is guaranteed to exist because we tweak it in `env.js` process.env.NODE_PATH.split(path.delimiter).filter(Boolean) ), // These are the reasonable defaults supported by the Node ecosystem. // We also include JSX as a common component filename extension to support // some tools, although we do not recommend using it, see: // https://github.com/facebookincubator/create-react-app/issues/290 // `web` extension prefixes have been added for better support // for React Native Web. extensions: [ '.web.ts', '.ts', '.web.tsx', '.tsx', '.web.js', '.js', '.json', '.web.jsx', '.jsx', ], alias: { // Support React Native Web // https://www.smashingmagazine.com/2016/08/a-glimpse-into-the-future-with-react-native-for-web/ 'react-native': 'react-native-web', }, plugins: [ // Prevents users from importing files from outside of src/ (or node_modules/). // This often causes confusion because we only process files within src/ with babel. // To fix this, we prevent you from importing files out of src/ -- if you'd like to, // please link the files into your node_modules/ and let module-resolution kick in. // Make sure your source files are compiled, as they will not be processed in any way. new ModuleScopePlugin(paths.appSrc, [paths.appPackageJson]), ], }, module: { strictExportPresence: true, rules: [ // TODO: Disable require.ensure as it's not a standard language feature. // We are waiting for https://github.com/facebookincubator/create-react-app/issues/2176. // { parser: { requireEnsure: false } }, // First, run the linter. // It's important to do this before Babel processes the JS. { test: /\.(ts|tsx)$/, loader: require.resolve('tslint-loader'), enforce: 'pre', include: paths.appSrc, }, { test: /\.js$/, loader: require.resolve('source-map-loader'), enforce: 'pre', include: paths.appSrc, }, { // "oneOf" will traverse all following loaders until one will // match the requirements. When no loader matches it will fall // back to the "file" loader at the end of the loader list. oneOf: [ // "url" loader works like "file" loader except that it embeds assets // smaller than specified limit in bytes as data URLs to avoid requests. // A missing `test` is equivalent to a match. { test: [/\.bmp$/, /\.gif$/, /\.jpe?g$/, /\.png$/, /\.svg$/], loader: require.resolve('url-loader'), options: { limit: 10000, name: 'static/media/[name].[hash:8].[ext]', }, }, // Compile .tsx? { test: /\.(ts|tsx)$/, include: paths.appSrc, loader: require.resolve('ts-loader'), }, // "postcss" loader applies autoprefixer to our CSS. // "css" loader resolves paths in CSS and adds assets as dependencies. // "style" loader turns CSS into JS modules that inject <style> tags. // In production, we use a plugin to extract that CSS to a file, but // in development "style" loader enables hot editing of CSS. { test: /\.css$/, use: [ require.resolve('style-loader'), { loader: require.resolve('css-loader'), options: { importLoaders: 1, }, }, { loader: require.resolve('postcss-loader'), options: { // Necessary for external CSS imports to work // https://github.com/facebookincubator/create-react-app/issues/2677 ident: 'postcss', plugins: () => [ require('postcss-flexbugs-fixes'), autoprefixer({ browsers: [ '>1%', 'last 4 versions', 'Firefox ESR', 'not ie < 9', // React doesn't support IE8 anyway ], flexbox: 'no-2009', }), ], }, }, ], }, // "file" loader makes sure those assets get served by WebpackDevServer. // When you `import` an asset, you get its (virtual) filename. // In production, they would get copied to the `build` folder. // This loader don't uses a "test" so it will catch all modules // that fall through the other loaders. { // Exclude `js` files to keep "css" loader working as it injects // it's runtime that would otherwise processed through "file" loader. // Also exclude `html` and `json` extensions so they get processed // by webpacks internal loaders. exclude: [/\.js$/, /\.html$/, /\.json$/], loader: require.resolve('file-loader'), options: { name: 'static/media/[name].[hash:8].[ext]', }, }, ], }, // ** STOP ** Are you adding a new loader? // Make sure to add the new loader(s) before the "file" loader. ], }, plugins: [ // Makes some environment variables available in index.html. // The public URL is available as %PUBLIC_URL% in index.html, e.g.: // <link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico"> // In development, this will be an empty string. new InterpolateHtmlPlugin(env.raw), // Generates an `index.html` file with the <script> injected. new HtmlWebpackPlugin({ inject: true, template: paths.appHtml, }), // Add module names to factory functions so they appear in browser profiler. new webpack.NamedModulesPlugin(), // Makes some environment variables available to the JS code, for example: // if (process.env.NODE_ENV === 'development') { ... }. See `./env.js`. new webpack.DefinePlugin(env.stringified), // This is necessary to emit hot updates (currently CSS only): new webpack.HotModuleReplacementPlugin(), // Watcher doesn't work well if you mistype casing in a path so we use // a plugin that prints an error when you attempt to do this. // See https://github.com/facebookincubator/create-react-app/issues/240 new CaseSensitivePathsPlugin(), // If you require a missing module and then `npm install` it, you still have // to restart the development server for Webpack to discover it. This plugin // makes the discovery automatic so you don't have to restart. // See https://github.com/facebookincubator/create-react-app/issues/186 new WatchMissingNodeModulesPlugin(paths.appNodeModules), // Moment.js is an extremely popular library that bundles large locale files // by default due to how Webpack interprets its code. This is a practical // solution that requires the user to opt into importing specific locales. // https://github.com/jmblog/how-to-optimize-momentjs-with-webpack // You can remove this if you don't use Moment.js: new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/), ], // Some libraries import Node modules but don't use them in the browser. // Tell Webpack to provide empty mocks for them so importing them works. node: { dgram: 'empty', fs: 'empty', net: 'empty', tls: 'empty', child_process: 'empty', }, // Turn off performance hints during development because we don't do any // splitting or minification in interest of speed. These warnings become // cumbersome. performance: { hints: false, }, };
import boardsRepository from "./../../repositories/boardsRepository"; import itemsRepository from "./../../repositories/itemsRepository"; import EmojiIcons from "./../../assets/emojiIcons"; import {tryConsumeQueue} from "../../repositories/syncRepository"; const state = { activeBoard: {}, addItemEmoji: { search: "", icons: EmojiIcons, activeIndex: 0 }, boardItems: [], boardsList: [], findItem: { itemText: "" }, isSubmittingNewItem: false, rawBoards: [] }; const mutations = { SET_ACTIVE_BOARD(state, board) { const activeBoard = state.boardsList.find((b) => b.id === board.id); state.activeBoard = activeBoard; }, SET_BOARD_ITEMS(state, items) { state.boardItems = items; }, SET_BOARDS(state, boardsArray) { state.boardsList = boardsArray; }, SET_FIND_ITEM_TEXT(state, val) { state.findItem.itemText = val; }, SET_IS_SUBMITTING_NEW_ITEM(state, val) { state.isSubmittingNewItem = val; }, SET_RAW_BOARDS(state, boards) { state.rawBoards = boards; }, SWITCH_PREPEND_NEW_ITEM(state, {prependNewItem}) { state.activeBoard.prependNewItem = prependNewItem; }, SWITCH_SHOW_DONE(state, {showDone}) { state.activeBoard.showDone = showDone; }, SWITCH_SHOW_PROGRESS(state, val) { state.activeBoard.showProgress = val; } }; const actions = { addItem({state, rootState}, {boardId, newItem}) { const activeBoard = state.boardsList.find((board) => board.id === boardId); if (activeBoard.prependNewItem === true) { const res = boardsRepository.addItemToBegin(boardId, newItem); tryConsumeQueue(rootState.settings.username, rootState.settings.token); return res; } else { const res = boardsRepository.addItemToEnd(boardId, newItem); tryConsumeQueue(rootState.settings.username, rootState.settings.token); return res; } }, changeBoardsOrder({rootState}, moved) { boardsRepository.changeBoardsOrder(moved); tryConsumeQueue(rootState.settings.username, rootState.settings.token); }, changeFindItem({commit}, val) { commit("SET_FIND_ITEM_TEXT", val); }, changeIsDone({rootState}, {boardId, itemId, newVal}) { itemsRepository.switchIsDone(boardId, itemId, newVal); tryConsumeQueue(rootState.settings.username, rootState.settings.token); }, changeItemVal({rootState}, {boardId, itemId, newVal}) { itemsRepository.changeItemValue(boardId, itemId, newVal); tryConsumeQueue(rootState.settings.username, rootState.settings.token); }, fetchActiveBoard({commit}) { const board = boardsRepository.getBoardById(boardsRepository.getActiveBoard()); commit("SET_ACTIVE_BOARD", board); }, fetchBoardItems({commit}, boardId) { commit("SET_BOARD_ITEMS", boardsRepository.getBoardItems(boardId)); }, fetchBoards({commit}) { commit("SET_BOARDS", boardsRepository.getList()); }, fetchRawBoards({commit}) { commit("SET_RAW_BOARDS", boardsRepository.getRawBoards()); }, itemsOrderChanged({rootState}, {moved, boardId}) { boardsRepository.changeItemsOrder(boardId, moved); tryConsumeQueue(rootState.settings.username, rootState.settings.token); }, moveItemToBoard({commit, rootState}, {srcBoardId, dstBoardId, itemId}) { boardsRepository.moveItemToBoard(srcBoardId, dstBoardId, itemId); actions.fetchBoards({commit}); tryConsumeQueue(rootState.settings.username, rootState.settings.token); }, moveItemToBottom({rootState}, {boardId, itemId}) { boardsRepository.moveItemToBottom(boardId, itemId); tryConsumeQueue(rootState.settings.username, rootState.settings.token); }, moveItemToTop({rootState}, {boardId, itemId}) { boardsRepository.moveItemToTop(boardId, itemId); tryConsumeQueue(rootState.settings.username, rootState.settings.token); }, removeBoard({rootState}, boardId) { boardsRepository.removeBoard(boardId); tryConsumeQueue(rootState.settings.username, rootState.settings.token); }, removeItem({commit, rootState}, {boardId, itemId}) { itemsRepository.removeItem(boardId, itemId); actions.fetchBoards({commit}); tryConsumeQueue(rootState.settings.username, rootState.settings.token); }, renameBoard({rootState}, {boardId, newName}) { boardsRepository.renameBoard(boardId, newName); tryConsumeQueue(rootState.settings.username, rootState.settings.token); }, saveNewBoard({commit, rootState}, boardName) { const savedBoard = boardsRepository.addNewBoard(boardName, rootState.settings); actions.fetchBoards({commit}); commit("SET_ACTIVE_BOARD", savedBoard); tryConsumeQueue(rootState.settings.username, rootState.settings.token); return savedBoard.id; }, setActiveBoard({commit}, boardId) { boardsRepository.setActiveBoard(boardId); const board = boardsRepository.getBoardById(boardId); commit("SET_ACTIVE_BOARD", board); }, setFirstBoardAsActiveBoard({commit}) { const activeBoard = boardsRepository.getFirstBoard(); boardsRepository.setActiveBoard(activeBoard.id); commit("SET_ACTIVE_BOARD", activeBoard); return activeBoard.id; }, setIsSubmittingNewItem({commit}, val) { commit("SET_IS_SUBMITTING_NEW_ITEM", val); }, switchPrependNewItem({commit}, {boardId, prependNewItem}) { itemsRepository.switchPrependNewItem(boardId, prependNewItem); commit("SWITCH_PREPEND_NEW_ITEM", {boardId, prependNewItem}); }, switchShowDone({commit}, {boardId, showDone}) { boardsRepository.switchShowDone(boardId, showDone); commit("SWITCH_SHOW_DONE", {boardId, showDone}); }, switchShowProgress({commit}, {boardId, val}) { itemsRepository.switchShowProgress(boardId, val); commit("SWITCH_SHOW_PROGRESS", val); }, syncBoardsDone({dispatch}, boards) { boardsRepository.saveBoardsArray(boards); dispatch("fetchBoards"); dispatch("fetchRawBoards"); } }; export default { state, mutations, actions };
importScripts("/_nuxt/workbox.4c4f5ca6.js"); workbox.precaching.precacheAndRoute( [ { url: "/_nuxt/0d3770bae32970ad6934.js", revision: "83bac57f046fc33ae546b19c710d5cc8" }, { url: "/_nuxt/18807efb12aada0ab34f.js", revision: "4027d9d69a0305914a15dd6391d1a59c" }, { url: "/_nuxt/3e66a98f0421c0167477.js", revision: "da710719f74ff5f4d7b73ec1fc82043c" }, { url: "/_nuxt/464d25bf588bfbac2841.css", revision: "49a73f71935b878ccb7f81c876cee4fb" }, { url: "/_nuxt/6fa1026982a3d5d35dab.css", revision: "4d61ce0f807eb249d9600559a368085b" }, { url: "/_nuxt/82bca42ae6ee8c428782.js", revision: "c7fb5ace94805441ba4e07361582e40d" }, { url: "/_nuxt/8fca9af8096d1a9031df.js", revision: "ca7e15efeac469e4acd5e97a4d45fbea" }, { url: "/_nuxt/9c1d434a2678603a4f6f.js", revision: "9e1655120481b75f93c5e137ce375098" }, { url: "/_nuxt/aab61bd5a81363c77283.js", revision: "8291e599bc7df3cf37704e637b1a9760" }, { url: "/_nuxt/ba6d249f2547e84fc5d1.js", revision: "f503570c2d23e27032b432444d1e0508" }, { url: "/_nuxt/e0dca7bd9a503e0f43b4.css", revision: "191959581356062d4ec655049c4b82a3" }, { url: "/_nuxt/f8e5a9ea397a826b43da.js", revision: "4088225a46e32aba10ff84aa2be1764c" }, { url: "/_nuxt/fc6cde20c5726c9b67dc.css", revision: "570a46bcac73e9592d39654829f3ca8a" } ], { cacheId: "bael-cms-template", directoryIndex: "/", cleanUrls: false } ); workbox.clientsClaim(); workbox.skipWaiting(); workbox.routing.registerRoute( new RegExp("/_nuxt/.*"), workbox.strategies.cacheFirst({}), "GET" ); workbox.routing.registerRoute( new RegExp("/.*"), workbox.strategies.networkFirst({}), "GET" ); workbox.routing.registerRoute( new RegExp("/images/uploads/.*"), workbox.strategies.cacheFirst({ cacheName: "image-cache", cacheExpiration: { maxEntries: 100, maxAgeSeconds: 86400 } }), "GET" );
class Camera {}; export default Camera;
module.exports = { title: 'Vue component library', description: 'Vue component library documentation', themeConfig: { repo: 'frederikwagner/vue-component-library', sidebarDepth: 2, sidebar: [ ['/', 'Home'], ['/inspiration', 'Inspiration'], { title: 'Creating your own library', collapsable: false, children: [ ['/create/getting-started', 'Getting started'], ['/create/development', 'Development'], ['/create/project-structure', 'Project structure'], ['/create/deployment', 'Deployment'] ] }, { title: 'Using the standard library', collapsable: false, children: [ ['/use/getting-started', 'Getting started'], ['/use/global-styles', 'Global styles'] ] }, { title: 'Standard components', collapsable: false, children: [ ['/components/component-types', 'Component types'], ['/components/BaseButton', '<base-button>'] ] } ] } }
//------------------------------------------------------------------------------------------------------- // Copyright (C) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. //------------------------------------------------------------------------------------------------------- function write(v) { WScript.Echo(v + ""); } var errorCount = 0; // global var globalList = [ ["eval",1], ["parseInt",2], ["parseFloat",1], ["isNaN",1], ["isFinite",1], ["decodeURI",1], ["encodeURI",1], ["decodeURIComponent",1], ["encodeURIComponent",1], ["Object",0], ["Function",1], ["Array",1], ["String",1], ["Boolean",1], ["Number",1], ["Date",7], ["RegExp",2], ["Error",1], ["EvalError",1], ["RangeError",1], ["ReferenceError",1], ["SyntaxError",1], ["TypeError",1], ["URIError",1] ] // Object var objList = [ //TODO ["constructor",0], ["toString",0], ["toLocaleString",0], ["valueOf",0], ["hasOwnProperty",1] , ["isPrototypeOf",1] , ["propertyIsEnumerable",1] ] // Function var funcList = [ ["constructor",1], ["toString",0], ["apply",2 ], ["call", 1] ] // Array var arrList = [ // FuncName, length ["constructor",1], ["toString",0], ["toLocaleString", 0], ["concat", 1], ["join",1], ["pop",0], ["push",1], ["reverse",0], ["shift",0], ["slice",2], ["sort",1], ["splice",2], ["unshift",1] ]; // String var stringList = [ ["constructor",1], ["toString",0], ["valueOf",0], ["charAt",1], ["charCodeAt",1], ["concat",1], ["indexOf",2], ["lastIndexOf",2], ["localeCompare",1], ["match",1], ["replace",1], ["search",0], ["slice",0], ["split",2], ["substring",2], ["toLowerCase",0], ["toLocaleLowerCase",0], ["toUpperCase",0], ["toLocaleUpperCase",0], // not in ECMA spec ["anchor",1], ["big",0], ["blink",0], ["bold",0], ["fixed",0], ["fontcolor",1], ["fontsize",1], ["italics",0], ["link",1], ["small",0], ["strike",0], ["sub",0], ["sup",0], ["substr",2] ] var stringList2 = [ ["fromCharCode", 0] ]; // Boolean var boolList = [ ["constructor",1], ["toString",0], ["valueOf",0] ] //Number var numberList = [ ["constructor",1], ["toString",1], ["toLocaleString",0], ["valueOf",0], ["toFixed",1], ["toExponential",1], ["toPrecision",1] ] // Math object is a single object - 18 var mathList = [ ["abs",1], ["acos",1], ["asin",1], ["atan",1], ["atan2",2], ["ceil",1], ["cos",1], ["exp",1], ["floor",1], ["log",1], ["max",2], ["min",2], ["pow",2], ["random",0], ["round",1], ["sin",1], ["sqrt",1], ["tan",1] ] // Date Prototype object var dateList = [ ["constructor",7], ["toString",0], ["toDateString",0], ["toTimeString",0], ["toLocaleString",0], ["toLocaleDateString",0], ["valueOf",0], ["getTime",0], ["getFullYear",0], ["getUTCFullYear",0], ["getMonth",0], ["getUTCMonth",0], ["getDate",0], ["getUTCDate",0], ["getDay",0], ["getUTCDay",0], ["getHours",0], ["getUTCHours",0], ["getMinutes",0], ["getUTCMinutes",0], ["getSeconds",0], ["getUTCSeconds",0], ["getMilliseconds",0], ["getUTCMilliseconds",0], ["getTimezoneOffset",0], ["setTime",1], ["setMilliseconds",1], ["setUTCMilliseconds",1], ["setSeconds",2], ["setUTCSeconds",2], ["setMinutes",3], ["setUTCMinutes",3], ["setHours",4], ["setUTCHours",4], ["setDate",1], ["setUTCDate",1], ["setMonth",2], ["setUTCMonth",2], ["setFullYear",3], ["setUTCFullYear",3], ["toUTCString",0], // not in ECMA spec ["toGMTString",0], ["toLocaleTimeString",0 ], ["toUTCString",0], ["setYear",1], ["getYear",0] // TODO ["getVarDate",0] ] // static date functions var dateList2 = [ ["parse",1], ["UTC",7] ] // RegExp object var regxpList = [ ["constructor",2], ["exec",1], ["test",1], ["toString",0] //, // not in ECMA spec // TODO ["compile",2] ] // Error object var errorList = [ ["constructor",1], ["name",5], ["message",0], ["toString",0] ] function doEval(scen) { try { var res = eval(scen); write(res); } catch (e) { write(" Exception: " + scen + ". :: " + e.message); } } var somevar = 0; function TestToString(list, str) { for (var i=0; i<list.length; i++) { var fname = list[i][0]; var fullStr = str+fname+".toString()"; doEval(fullStr); } } TestToString(globalList,""); TestToString(objList, "Object.prototype."); TestToString(funcList, "Function.prototype."); TestToString(arrList, "Array.prototype."); TestToString(stringList, "String.prototype."); TestToString(stringList2, "String."); TestToString(boolList, "Boolean.prototype."); TestToString(numberList, "Number.prototype."); TestToString(mathList, "Math."); TestToString(dateList, "Date.prototype."); TestToString(dateList2,"Date."); TestToString(regxpList, "RegExp.prototype."); TestToString(errorList, "Error.prototype."); if ( errorCount > 0 ) { throw Error(errorCount + " Test(s) Failed"); }
// This is a manifest file that'll be compiled into application.js, which will include all the files // listed below. // // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. // // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the // the compiled file. // // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD // GO AFTER THE REQUIRES BELOW. // //= require jquery //= require jquery_ujs //= require bootstrap //= require social-share-button //= require rails-ujs //= require turbolinks //= require activestorage //= require landing-page/script //= require feedlists //= require rails-timeago $(document).ready(function(){ $('.dropdown-toggle').dropdown(); });
/** * =========================== * Agency Webpack-Mix Config * A capable website/webapp config built for the modern web agency. * https://github.com/ben-rogerson/agency-webpack-mix-config * =========================== * * Contents * * 🎚️ Settings * 🏠 Templates * 🎨 Styles * 🎨 Styles: CriticalCSS * 🎨 Styles: PostCSS * 🎨 Styles: Polyfills * 🎨 Styles: Vendor * 🎨 Styles: Other * 📑 Scripts * 📑 Scripts: Polyfills * 📑 Scripts: Auto import libraries * 📑 Scripts: Linting * 🗂️ Static * 🚧 Webpack-dev-server */ require('dotenv').config() // 🎚️ Base config const config = { // Dev domain to proxy devProxyDomain: process.env.BASE_URL || "http://site.test", // Paths to observe for changes then trigger a full page reload devWatchPaths: ["templates"], // Port to use with webpack-dev-server devServerPort: 8080, // Build a static site from the src/template files buildStaticSite: false, // Urls for CriticalCss to look for "above the fold" Css criticalCssUrls: [ // { urlPath: "/", label: "homepage"}, // { urlPath: "/", label: "index" }, // { urlPath: "/about", label: "about" }, ], // Folder served to users publicFolder: "web", // Foldername for built src assets (publicFolder base) publicBuildFolder: "/dist", } // 🎚️ Imports const mix = require("laravel-mix") const path = require("path") const globby = require("globby") // 🎚️ Source folders const source = { icons: path.resolve("src/icons"), images: path.resolve("src/images"), scripts: path.resolve("src/scripts"), styles: path.resolve("src/styles"), static: path.resolve("src/static"), templates: path.resolve("templates"), } // 🎚️ Misc mix.setPublicPath(config.publicFolder) mix.disableNotifications() mix.webpackConfig({ resolve: { alias: source }, stats: { children: true } }) !mix.inProduction() && mix.sourceMaps() /** * 🏠 Templates (for static sites) * Convert Twig files to Html * https://github.com/ben-rogerson/laravel-mix-twig-to-html */ if (config.buildStaticSite && source.templates) { require("laravel-mix-twig-to-html") mix.twigToHtml({ files: [ { template: path.resolve( __dirname, source.templates, "**/*.{twig,html}" ), minify: { collapseWhitespace: mix.inProduction(), removeComments: mix.inProduction(), }, }, ], fileBase: source.templates, twigOptions: { data: require(path.join(source.templates, "_data", "data.js")), }, }) } /** * 🎭 Hashing (for non-static sites) * Mix has querystring hashing by default, eg: main.css?id=abcd1234 * This script converts it to filename hashing, eg: main.abcd1234.css * https://github.com/JeffreyWay/laravel-mix/issues/1022#issuecomment-379168021 */ if (mix.inProduction() && !config.buildStaticSite) { // Allow versioning in production mix.version() // Get the manifest filepath for filehash conversion const manifestPath = path.join(config.publicFolder, "mix-manifest.json") // Run after mix finishes mix.then(() => { const convertToFileHash = require("laravel-mix-make-file-hash") convertToFileHash({ publicPath: config.publicFolder, manifestFilePath: manifestPath, }) }) } /** * 🎨 Styles: Main * Uses PostCSS to preproccess */ mix.postCss( './src/styles/site.css', path.join(config.publicFolder, config.publicBuildFolder) ) /** * 🎨 Styles: CriticalCSS * https://github.com/addyosmani/critical#options */ const criticalDomain = config.devProxyDomain if (criticalDomain && config.criticalCssUrls && config.criticalCssUrls.length) { require("laravel-mix-criticalcss") mix.criticalCss({ enabled: true, paths: { base: criticalDomain, templates: '../templates/_critical/', //Where css files need to be written, all these paths are relative to /public suffix: '_critical.min' }, urls: config.criticalCssUrls, //Now using https://github.com/addyosmani/critical v4.0.1 options: { //It's important to note here you should NOT set inline:true, this will break the whole system. width: 1200, height: 1200, penthouse:{ timeout:1200000 } }, }) } /** * 🎨 Styles: PostCSS * Extend Css with plugins * https://laravel-mix.com/docs/4.0/css-preprocessors#postcss-plugins */ const postCssPlugins = [ /** * 🎨 Styles: Polyfills * Postcss preset env lets you use pre-implemented css features * See https://cssdb.org/ for supported features * https://github.com/csstools/postcss-preset-env#readme */ require('postcss-easy-import')(), require('tailwindcss/nesting'), require('tailwindcss'), // require('postcss-object-fit-images'), require('postcss-preset-env')({ stage: 1, autoprefixer: { grid: false }, features: { 'focus-within-pseudo-class': false } }), ] mix.options({ postCss: postCssPlugins }) /** * 🎨 Styles: Other * https://laravel-mix.com/docs/4.0/options */ mix.options({ // postcss-preset-env already processes our css with Autoprefixer, so we don't // need mix to do it twice. autoprefixer: false, // Disable processing css urls for speed // https://laravel-mix.com/docs/4.0/css-preprocessors#css-url-rewriting processCssUrls: false, }) /** * 📑 Scripts: Main * Script files are transpiled to vanilla JavaScript * https://laravel-mix.com/docs/4.0/mixjs */ const scriptFiles = globby.sync(`${source.scripts}/*.{js,mjs,ts,tsx}`) scriptFiles.forEach(scriptFile => { mix.js(scriptFile, config.publicBuildFolder) }) /** * 📑 Scripts: Polyfills * Automatically add polyfills for target browsers with core-js@3 * See "browserslist" in package.json for your targets * https://github.com/zloirock/core-js/blob/master/docs/2019-03-19-core-js-3-babel-and-a-look-into-the-future.md * https://github.com/scottcharlesworth/laravel-mix-polyfill#options */ require("laravel-mix-polyfill") mix.polyfill({ enabled: mix.inProduction(), useBuiltIns: "usage", // Only add a polyfill when a feature is used targets: false, // "false" makes the config use browserslist targets in package.json corejs: 3, debug: false, // "true" to check which polyfills are being used }) /** * 📑 Scripts: Auto import libraries * Make JavaScript libraries available without an import * https://laravel-mix.com/docs/4.0/autoloading */ mix.autoload({ // jquery: ["$", "jQuery", "window.jQuery"], }) /** * 📑 Scripts: Vendor * Separate the JavaScript code imported from node_modules * https://laravel-mix.com/docs/4.0/extract * Without mix.extract you'll see an annoying js error after * launching the dev server - this should be fixed in webpack 5 */ mix.extract([]) // Empty params = separate all node_modules // mix.extract(['jquery']) // Specify packages to add to the vendor file /** * 📑 Scripts: Linting */ if (!mix.inProduction()) { require("laravel-mix-eslint") mix.eslint() } /** * 🏞 Images * Images are copied to the build directory */ // mix.copy('src/static/fonts/icons', './vendor/dolphiq/iconpicker/src/resources-shared/fonts') /** * 🗂️ Static * Additional folders with no transform requirements are copied to your build folders */ mix.copyDirectory( source.static, path.join(config.publicFolder, config.publicBuildFolder) ) /** * 🚧 Webpack-dev-server * https://webpack.js.org/configuration/dev-server/ */ mix.webpackConfig({ devServer: { clientLogLevel: "none", // Hide console feedback so eslint can take over open: true, overlay: true, port: config.devServerPort, public: `localhost:${config.devServerPort}`, host: "0.0.0.0", // Allows access from network https: config.devProxyDomain.includes("https://"), contentBase: config.devWatchPaths.length ? config.devWatchPaths : undefined, watchContentBase: config.devWatchPaths.length > 0, watchOptions: { aggregateTimeout: 200, poll: 200, // Lower for faster reloads (more cpu intensive) ignored: ["storage", "node_modules", "vendor"], }, disableHostCheck: true, // Fixes "Invalid Host header error" on assets headers: { "Access-Control-Allow-Origin": "*", }, proxy: { "**": { target: config.devProxyDomain, changeOrigin: true, secure: false, }, }, publicPath: "/", }, }) mix.options({ hmrOptions: { host: 'localhost', port: config.devServerPort }, })
const net = require('net'); const { spawn } = require('child_process'); var server = null; var hazelcastServer = null; function startUnresponsiveServer(port) { server = net.createServer(function (socket) { //no-response }); server.listen(port); } function stopUnresponsiveServer() { if (server) server.close(); server = null; } function startHazelcastMember() { hazelcastServer = spawn('startCluster.bat'); hazelcastServer.stdout.on('data', (data) => { console.log(`stdout: ${data}`); }); hazelcastServer.stderr.on('data', (data) => { console.log(`stderr: ${data}`); }); hazelcastServer.on('close', (code) => { console.log(`child process exited with code ${code}`); }); } function stopHazelcastMember() { if (hazelcastServer) hazelcastServer.kill(); hazelcastServer = null; } module.exports = { startUnresponsiveServer:startUnresponsiveServer, stopUnresponsiveServer:stopUnresponsiveServer, startHazelcastMember: startHazelcastMember, stopHazelcastMember: stopHazelcastMember };
const karmaConfig = require('./karma.conf.js'); const lernaJson = require('./lerna.json'); module.exports = function(config) { karmaConfig(config); config.plugins.push('karma-coverage'); config.set({ browserify: { debug: true, transform: [ [ 'babelify', { plugins: ['istanbul'], presets: ['env'], }, ], ], insertGlobalVars: { METAL_VERSION: function() { return '\'' + lernaJson.version + '\''; }, }, }, coverageReporter: { reporters: [ { type: 'lcov', subdir: 'lcov', }, { type: 'text-summary', }, ], }, reporters: ['coverage', 'progress'], }); };
/* eslint-disable prettier/prettier */ import Operation from '../../../backend/Operation'; /** * @summary Description */ const opn = new Operation(); opn.setDescription( 'Extract the salt used by the LDAP password encryption algorithm for' + 'a specific password. Uses standard SSHA encryption alogrithm. Used for testing purposes' ); opn.defineOptions({ password: 'SSHA1 encrpyted password, format {SSHA}longhashhere123456431232', }); // LDAP pwd gen. algorithm: base64encode( SHA1(password + salt) + salt). // salt extraction: base64decode(pwd) -> remove 1st 20 bytes -> base64encode() for visibility async function exec() { if (!opn.options.password || opn.options.password === '') opn.error('field password cannot be null'); const trimPasswd = opn.options.password.slice(6, opn.options.password.length); // encode const buf = Buffer.from(trimPasswd, 'base64'); const salt = buf.slice(20, buf.length); return salt.toString('base64'); } // (must do), set the execution function opn.set(exec); // (mustdo) export the Operation instance export default opn;
(function(d){d['sv']=Object.assign(d['sv']||{},{a:"Kan inte ladda upp fil:",b:"Table toolbar",c:"Image toolbar",d:"Kursiv",e:"Blockcitat",f:"Fet",g:"image widget",h:"Insert image or file",i:"Välj rubrik",j:"Rubrik",k:"Bild i full storlek",l:"Kantbild",m:"Vänsterjusterad bild",n:"Centrerad bild",o:"Högerjusterad bild",p:"Increase indent",q:"Decrease indent",r:"Lägg in tabell",s:"Header column",t:"Insert column left",u:"Insert column right",v:"Ta bort kolumn",w:"Kolumn",x:"Header row",y:"Insert row below",z:"Insert row above",aa:"Ta bort rad",ab:"Rad",ac:"Merge cell up",ad:"Merge cell right",ae:"Merge cell down",af:"Merge cell left",ag:"Split cell vertically",ah:"Split cell horizontally",ai:"Merge cells",aj:"Numrerad lista",ak:"Punktlista",al:"Infoga bild",am:"Fyll i bildtext",an:"media widget",ao:"Uppladdning misslyckades",ap:"Lägg in media",aq:"The URL must not be empty.",ar:"This media URL is not supported.",as:"Upload in progress",at:"Länk",au:"Widget toolbar",av:"Ändra bildens alternativa text",aw:"Could not obtain resized image URL.",ax:"Selecting resized image failed",ay:"Could not insert image at the current position.",az:"Inserting image failed",ba:"Paragraf",bb:"Rubrik 1",bc:"Rubrik 2",bd:"Rubrik 3",be:"Rubrik 4",bf:"Rubrik 5",bg:"Rubrik 6",bh:"Spara",bi:"Avbryt",bj:"Paste the media URL in the input.",bk:"Tip: Paste the URL into the content to embed faster.",bl:"Media URL",bm:"Rich Text-editor, %0",bn:"Rich Text-editor",bo:"Ta bort länk",bp:"Redigera länk",bq:"Öppna länk i ny flik",br:"Denna länk saknar URL",bs:"Dropdown toolbar",bt:"Editor toolbar",bu:"Show more items",bv:"Ångra",bw:"Gör om",bx:"Länkens URL",by:"%0 of %1",bz:"Previous",ca:"Next",cb:"Alternativ text",cc:"Open in a new tab",cd:"Downloadable"})})(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
'use strict'; var hapi = require('hapi'); var minimist = require('minimist'); var _ = require('lodash'); var argv = minimist(process.argv.slice(2)); var server = new hapi.Server(); var connectionOptions = { port: argv['p'] || 3080 }; server.connection(connectionOptions); server.route({ method: '*', path: '/{path*}', handler: function(request, reply) { var body = JSON.stringify({ message: 'success', warning: null }); setTimeout(_.partial(reply, body), 1000); } }); server.start(function(err) { if (err) { console.error(err); } else { console.log(server.info.uri); } });
(function() { 'use strict'; angular .module('app.core', [ 'blocks.logger', 'blocks.router' ]); })();
import { moduleFor, test } from 'ember-qunit'; moduleFor('controller:new-platform-super-simple-contact-list-contact-l', 'Unit | Controller | new-platform-super-simple-contact-list-contact-l', { // Specify the other units that are required for this test. needs: [ 'controller:advlimit-dialog', 'controller:colsconfig-dialog', 'controller:filters-dialog', 'service:objectlistview-events', 'service:user-settings', 'service:app-state', 'service:adv-limit', ], }); // Replace this with your real tests. test('it exists', function(assert) { let controller = this.subject(); assert.ok(controller); });
import React, { Component } from "react"; import { Image, TextInput, TouchableWithoutFeedback, TouchableOpacity, View, Text } from "react-native"; import PropTypes from "prop-types"; import Country from "./country"; import Flags from "./resources/flags"; import PhoneNumber from "./phoneNumber"; import styles from "./styles"; import CountryPicker from "./countryPicker"; export default class PhoneInput extends Component { static setCustomCountriesData(json) { Country.setCustomCountriesData(json); } constructor(props, context) { super(props, context); this.onChangePhoneNumber = this.onChangePhoneNumber.bind(this); this.onPressFlag = this.onPressFlag.bind(this); this.selectCountry = this.selectCountry.bind(this); this.getFlag = this.getFlag.bind(this); this.getISOCode = this.getISOCode.bind(this); const { countriesList, disabled, initialCountry } = this.props; if (countriesList) { Country.setCustomCountriesData(countriesList); } const countryData = PhoneNumber.getCountryDataByCode(initialCountry); this.state = { iso2: initialCountry, disabled, formattedNumber: countryData ? `+${countryData.dialCode}` : "", value: null, inputValue: "", }; } componentDidMount() { if (this.props.value) { this.updateFlagAndFormatNumber(this.props.value); } } componentWillReceiveProps(nextProps) { const { value, disabled } = nextProps; this.setState({ disabled }); if (value && value !== this.state.value) { this.setState({ value }); this.updateFlagAndFormatNumber(value); } } onChangePhoneNumber(number) { const actionAfterSetState = this.props.onChangePhoneNumber ? () => { this.props.onChangePhoneNumber(number); } : null; this.updateFlagAndFormatNumber(number, actionAfterSetState); } onPressFlag() { if (this.props.onPressFlag) { this.props.onPressFlag(); } else { if (this.state.iso2) this.picker.selectCountry(this.state.iso2); this.picker.show(); } } getPickerData() { return PhoneNumber.getAllCountries().map((country, index) => ({ key: index, image: Flags.get(country.iso2), label: country.name, dialCode: `+${country.dialCode}`, iso2: country.iso2 })); } getCountryCode() { const countryData = PhoneNumber.getCountryDataByCode(this.state.iso2); return countryData ? countryData.dialCode : null; } getAllCountries() { return PhoneNumber.getAllCountries(); } getFlag(iso2) { return Flags.get(iso2); } getDialCode() { return PhoneNumber.getDialCode(this.state.formattedNumber); } getValue() { return this.state.formattedNumber.replace(/\s/g,''); } getNumberType() { return PhoneNumber.getNumberType( this.state.formattedNumber, this.state.iso2 ); } getISOCode() { return this.state.iso2; } selectCountry(iso2) { if (this.state.iso2 !== iso2) { const countryData = PhoneNumber.getCountryDataByCode(iso2); if (countryData) { this.setState( { iso2, formattedNumber: `+${countryData.dialCode}` }, () => { this.updateFlagAndFormatNumber(this.state.inputValue) if (this.props.onSelectCountry) this.props.onSelectCountry(iso2); } ); } } } isValidNumber() { if (this.state.inputValue.length < 3) return false; return PhoneNumber.isValidNumber( this.state.formattedNumber, this.state.iso2 ); } format(text) { return this.props.autoFormat ? PhoneNumber.format(text, this.state.iso2) : text; } updateFlagAndFormatNumber(number, actionAfterSetState = null) { const { allowZeroAfterCountryCode, initialCountry } = this.props; let iso2 = this.getISOCode() || initialCountry; let formattedPhoneNumber = number; if (number) { const countryCode = this.getCountryCode(); if (formattedPhoneNumber[0] !== "+" && countryCode !== null) { formattedPhoneNumber = '+' + countryCode.toString() + formattedPhoneNumber.toString(); } formattedPhoneNumber = allowZeroAfterCountryCode ? formattedPhoneNumber : this.possiblyEliminateZeroAfterCountryCode(formattedPhoneNumber); iso2 = PhoneNumber.getCountryCodeOfNumber(formattedPhoneNumber); } this.setState({ iso2, formattedNumber: formattedPhoneNumber, inputValue: number }, actionAfterSetState); } possiblyEliminateZeroAfterCountryCode(number) { const dialCode = PhoneNumber.getDialCode(number); return number.startsWith(`${dialCode}0`) ? dialCode + number.substr(dialCode.length + 1) : number; } focus() { this.inputPhone.focus(); } blur() { this.inputPhone.blur(); } render() { const { iso2, inputValue, disabled } = this.state; const TextComponent = this.props.textComponent || TextInput; const countryData = PhoneNumber.getCountryDataByCode(iso2); return ( <View style={[styles.container, this.props.style]}> <TouchableOpacity onPress={this.onPressFlag} disabled={disabled} style={styles.btn} > <View style={styles.code}> <Text style={styles.codeTextCountry} numberOfLines={1}>{countryData.name}</Text> <Text style={styles.codeText}> (+{countryData.dialCode})</Text> </View> </TouchableOpacity> <CountryPicker ref={ref => { this.picker = ref; }} selectedCountry={iso2} onSubmit={this.selectCountry} buttonColor={this.props.pickerButtonColor} buttonTextStyle={this.props.pickerButtonTextStyle} cancelText={this.props.cancelText} cancelTextStyle={this.props.cancelTextStyle} confirmText={this.props.confirmText} confirmTextStyle={this.props.confirmTextStyle} pickerBackgroundColor={this.props.pickerBackgroundColor} itemStyle={this.props.pickerItemStyle} onPressCancel={this.props.onPressCancel} onPressConfirm={this.props.onPressConfirm} /> </View> ); } } const styleType = PropTypes.oneOfType([PropTypes.object, PropTypes.number]); PhoneInput.propTypes = { textComponent: PropTypes.func, initialCountry: PropTypes.string, onChangePhoneNumber: PropTypes.func, value: PropTypes.string, style: styleType, flagStyle: styleType, textStyle: styleType, offset: PropTypes.number, textProps: PropTypes.object, onSelectCountry: PropTypes.func, onPressCancel: PropTypes.func, onPressConfirm: PropTypes.func, pickerButtonColor: PropTypes.string, pickerBackgroundColor: PropTypes.string, pickerItemStyle: styleType, countriesList: PropTypes.arrayOf( PropTypes.shape({ name: PropTypes.string, iso2: PropTypes.string, dialCode: PropTypes.string, priority: PropTypes.number, areaCodes: PropTypes.arrayOf(PropTypes.string) }) ), cancelText: PropTypes.string, cancelTextStyle: styleType, confirmText: PropTypes.string, confirmTextTextStyle: styleType, disabled: PropTypes.bool, allowZeroAfterCountryCode: PropTypes.bool }; PhoneInput.defaultProps = { initialCountry: "us", disabled: false, allowZeroAfterCountryCode: true };
(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global.ReactHorizontalCarousel = factory()); }(this, (function () { 'use strict'; function createCommonjsModule(fn, module) { return module = { exports: {} }, fn(module, module.exports), module.exports; } /* object-assign (c) Sindre Sorhus @license MIT */ /* eslint-disable no-unused-vars */ var getOwnPropertySymbols = Object.getOwnPropertySymbols; var hasOwnProperty = Object.prototype.hasOwnProperty; var propIsEnumerable = Object.prototype.propertyIsEnumerable; function toObject(val) { if (val === null || val === undefined) { throw new TypeError('Object.assign cannot be called with null or undefined'); } return Object(val); } function shouldUseNative() { try { if (!Object.assign) { return false; } // Detect buggy property enumeration order in older V8 versions. // https://bugs.chromium.org/p/v8/issues/detail?id=4118 var test1 = new String('abc'); // eslint-disable-line no-new-wrappers test1[5] = 'de'; if (Object.getOwnPropertyNames(test1)[0] === '5') { return false; } // https://bugs.chromium.org/p/v8/issues/detail?id=3056 var test2 = {}; for (var i = 0; i < 10; i++) { test2['_' + String.fromCharCode(i)] = i; } var order2 = Object.getOwnPropertyNames(test2).map(function (n) { return test2[n]; }); if (order2.join('') !== '0123456789') { return false; } // https://bugs.chromium.org/p/v8/issues/detail?id=3056 var test3 = {}; 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { test3[letter] = letter; }); if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') { return false; } return true; } catch (err) { // We don't expect any of the above to throw, but better to be safe. return false; } } var objectAssign = shouldUseNative() ? Object.assign : function (target, source) { var from; var to = toObject(target); var symbols; for (var s = 1; s < arguments.length; s++) { from = Object(arguments[s]); for (var key in from) { if (hasOwnProperty.call(from, key)) { to[key] = from[key]; } } if (getOwnPropertySymbols) { symbols = getOwnPropertySymbols(from); for (var i = 0; i < symbols.length; i++) { if (propIsEnumerable.call(from, symbols[i])) { to[symbols[i]] = from[symbols[i]]; } } } } return to; }; /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * */ var emptyObject = {}; { Object.freeze(emptyObject); } var emptyObject_1 = emptyObject; /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * */ function makeEmptyFunction(arg) { return function () { return arg; }; } /** * This function accepts and discards inputs; it has no side effects. This is * primarily useful idiomatically for overridable function endpoints which * always need to be callable, since JS lacks a null-call idiom ala Cocoa. */ var emptyFunction = function emptyFunction() {}; emptyFunction.thatReturns = makeEmptyFunction; emptyFunction.thatReturnsFalse = makeEmptyFunction(false); emptyFunction.thatReturnsTrue = makeEmptyFunction(true); emptyFunction.thatReturnsNull = makeEmptyFunction(null); emptyFunction.thatReturnsThis = function () { return this; }; emptyFunction.thatReturnsArgument = function (arg) { return arg; }; var emptyFunction_1 = emptyFunction; var q="function"===typeof Symbol&&Symbol["for"]; var r=q?Symbol["for"]("react.element"):60103; var t=q?Symbol["for"]("react.portal"):60106; var u=q?Symbol["for"]("react.fragment"):60107; var v=q?Symbol["for"]("react.strict_mode"):60108; var w=q?Symbol["for"]("react.provider"):60109; var x=q?Symbol["for"]("react.context"):60110; var y=q?Symbol["for"]("react.async_mode"):60111; var z=q?Symbol["for"]("react.forward_ref"):60112; var A="function"=== typeof Symbol&&Symbol.iterator;function B(a){for(var b=arguments.length-1,e="Minified React error #"+a+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant\x3d"+a,c=0;c<b;c++)e+="\x26args[]\x3d"+encodeURIComponent(arguments[c+1]);b=Error(e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.");b.name="Invariant Violation";b.framesToPop=1;throw b;} var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}};function D(a,b,e){this.props=a;this.context=b;this.refs=emptyObject_1;this.updater=e||C;}D.prototype.isReactComponent={};D.prototype.setState=function(a,b){"object"!==typeof a&&"function"!==typeof a&&null!=a?B("85"):void 0;this.updater.enqueueSetState(this,a,b,"setState");};D.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,"forceUpdate");};function E(){} E.prototype=D.prototype;function F(a,b,e){this.props=a;this.context=b;this.refs=emptyObject_1;this.updater=e||C;}var G=F.prototype=new E;G.constructor=F;objectAssign(G,D.prototype);G.isPureReactComponent=!0;var H={current:null}; var I=Object.prototype.hasOwnProperty; var J={key:!0,ref:!0,__self:!0,__source:!0}; function K(a,b,e){var c=void 0,d={},g=null,h=null;if(null!=b)for(c in void 0!==b.ref&&(h=b.ref), void 0!==b.key&&(g=""+b.key), b)I.call(b,c)&&!J.hasOwnProperty(c)&&(d[c]=b[c]);var f=arguments.length-2;if(1===f)d.children=e;else if(1<f){for(var k=Array(f),l=0;l<f;l++)k[l]=arguments[l+2];d.children=k;}if(a&&a.defaultProps)for(c in f=a.defaultProps, f)void 0===d[c]&&(d[c]=f[c]);return{$$typeof:r,type:a,key:g,ref:h,props:d,_owner:H.current}} function L(a){return"object"===typeof a&&null!==a&&a.$$typeof===r}function escape(a){var b={"\x3d":"\x3d0",":":"\x3d2"};return"$"+(""+a).replace(/[=:]/g,function(a){return b[a]})}var M=/\/+/g; var N=[];function O(a,b,e,c){if(N.length){var d=N.pop();d.result=a;d.keyPrefix=b;d.func=e;d.context=c;d.count=0;return d}return{result:a,keyPrefix:b,func:e,context:c,count:0}}function P(a){a.result=null;a.keyPrefix=null;a.func=null;a.context=null;a.count=0;10>N.length&&N.push(a);} function Q(a,b,e,c){var d=typeof a;if("undefined"===d||"boolean"===d)a=null;var g=!1;if(null===a)g=!0;else switch(d){case "string":case "number":g=!0;break;case "object":switch(a.$$typeof){case r:case t:g=!0;}}if(g)return e(c,a,""===b?"."+R(a,0):b), 1;g=0;b=""===b?".":b+":";if(Array.isArray(a))for(var h=0;h<a.length;h++){d=a[h];var f=b+R(d,h);g+=Q(d,f,e,c);}else if(null===a||"undefined"===typeof a?f=null:(f=A&&a[A]||a["@@iterator"], f="function"===typeof f?f:null), "function"===typeof f)for(a=f.call(a), h=0;!(d=a.next()).done;)d=d.value, f=b+R(d,h++), g+=Q(d,f,e,c);else"object"===d&&(e=""+a, B("31","[object Object]"===e?"object with keys {"+Object.keys(a).join(", ")+"}":e,""));return g}function R(a,b){return"object"===typeof a&&null!==a&&null!=a.key?escape(a.key):b.toString(36)}function S(a,b){a.func.call(a.context,b,a.count++);} function T(a,b,e){var c=a.result,d=a.keyPrefix;a=a.func.call(a.context,b,a.count++);Array.isArray(a)?U(a,c,e,emptyFunction_1.thatReturnsArgument):null!=a&&(L(a)&&(b=d+(!a.key||b&&b.key===a.key?"":(""+a.key).replace(M,"$\x26/")+"/")+e, a={$$typeof:r,type:a.type,key:b,ref:a.ref,props:a.props,_owner:a._owner}), c.push(a));}function U(a,b,e,c,d){var g="";null!=e&&(g=(""+e).replace(M,"$\x26/")+"/");b=O(b,g,c,d);null==a||Q(a,"",T,b);P(b);} var V={Children:{map:function(a,b,e){if(null==a)return a;var c=[];U(a,c,null,b,e);return c},forEach:function(a,b,e){if(null==a)return a;b=O(null,null,b,e);null==a||Q(a,"",S,b);P(b);},count:function(a){return null==a?0:Q(a,"",emptyFunction_1.thatReturnsNull,null)},toArray:function(a){var b=[];U(a,b,null,emptyFunction_1.thatReturnsArgument);return b},only:function(a){L(a)?void 0:B("143");return a}},createRef:function(){return{current:null}},Component:D,PureComponent:F,createContext:function(a,b){void 0===b&&(b=null);a={$$typeof:x, _calculateChangedBits:b,_defaultValue:a,_currentValue:a,_changedBits:0,Provider:null,Consumer:null};a.Provider={$$typeof:w,_context:a};return a.Consumer=a},forwardRef:function(a){return{$$typeof:z,render:a}},Fragment:u,StrictMode:v,unstable_AsyncMode:y,createElement:K,cloneElement:function(a,b,e){var c=void 0,d=objectAssign({},a.props),g=a.key,h=a.ref,f=a._owner;if(null!=b){void 0!==b.ref&&(h=b.ref, f=H.current);void 0!==b.key&&(g=""+b.key);var k=void 0;a.type&&a.type.defaultProps&&(k=a.type.defaultProps);for(c in b)I.call(b, c)&&!J.hasOwnProperty(c)&&(d[c]=void 0===b[c]&&void 0!==k?k[c]:b[c]);}c=arguments.length-2;if(1===c)d.children=e;else if(1<c){k=Array(c);for(var l=0;l<c;l++)k[l]=arguments[l+2];d.children=k;}return{$$typeof:r,type:a.type,key:g,ref:h,props:d,_owner:f}},createFactory:function(a){var b=K.bind(null,a);b.type=a;return b},isValidElement:L,version:"16.3.1",__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentOwner:H,assign:objectAssign}}; var W=Object.freeze({default:V}); var X=W&&V||W; var react_production_min=X["default"]?X["default"]:X; /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * */ /** * Use invariant() to assert state which your program assumes to be true. * * Provide sprintf-style format (only %s is supported) and arguments * to provide information about what broke and what you were * expecting. * * The invariant message will be stripped in production, but the invariant * will remain to ensure logic does not differ in production. */ var validateFormat = function validateFormat(format) {}; { validateFormat = function validateFormat(format) { if (format === undefined) { throw new Error('invariant requires an error message argument'); } }; } function invariant(condition, format, a, b, c, d, e, f) { validateFormat(format); if (!condition) { var error; if (format === undefined) { error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.'); } else { var args = [a, b, c, d, e, f]; var argIndex = 0; error = new Error(format.replace(/%s/g, function () { return args[argIndex++]; })); error.name = 'Invariant Violation'; } error.framesToPop = 1; // we don't care about invariant's own frame throw error; } } var invariant_1 = invariant; /** * Similar to invariant but only logs a warning if the condition is not met. * This can be used to log issues in development environments in critical * paths. Removing the logging code for production environments will keep the * same logic and follow the same code paths. */ var warning = emptyFunction_1; { var printWarning = function printWarning(format) { for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } var argIndex = 0; var message = 'Warning: ' + format.replace(/%s/g, function () { return args[argIndex++]; }); if (typeof console !== 'undefined') { console.error(message); } try { // --- Welcome to debugging React --- // This error was thrown as a convenience so that you can use this stack // to find the callsite that caused this warning to fire. throw new Error(message); } catch (x) {} }; warning = function warning(condition, format) { if (format === undefined) { throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument'); } if (format.indexOf('Failed Composite propType: ') === 0) { return; // Ignore CompositeComponent proptype check. } if (!condition) { for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { args[_key2 - 2] = arguments[_key2]; } printWarning.apply(undefined, [format].concat(args)); } }; } var warning_1 = warning; /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var ReactPropTypesSecret$1 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; var ReactPropTypesSecret_1 = ReactPropTypesSecret$1; { var invariant$1 = invariant_1; var warning$1 = warning_1; var ReactPropTypesSecret = ReactPropTypesSecret_1; var loggedTypeFailures = {}; } /** * Assert that the values match with the type specs. * Error messages are memorized and will only be shown once. * * @param {object} typeSpecs Map of name to a ReactPropType * @param {object} values Runtime values that need to be type-checked * @param {string} location e.g. "prop", "context", "child context" * @param {string} componentName Name of the component for error messages. * @param {?Function} getStack Returns the component stack. * @private */ function checkPropTypes(typeSpecs, values, location, componentName, getStack) { { for (var typeSpecName in typeSpecs) { if (typeSpecs.hasOwnProperty(typeSpecName)) { var error; // Prop type validation may throw. In case they do, we don't want to // fail the render phase where it didn't fail before. So we log it. // After these have been cleaned up, we'll let them throw. try { // This is intentionally an invariant that gets caught. It's the same // behavior as without this statement except with a better message. invariant$1(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'the `prop-types` package, but received `%s`.', componentName || 'React class', location, typeSpecName, typeof typeSpecs[typeSpecName]); error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); } catch (ex) { error = ex; } warning$1(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error); if (error instanceof Error && !(error.message in loggedTypeFailures)) { // Only monitor this failure once because there tends to be a lot of the // same error. loggedTypeFailures[error.message] = true; var stack = getStack ? getStack() : ''; warning$1(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : ''); } } } } } var checkPropTypes_1 = checkPropTypes; var react_development = createCommonjsModule(function (module) { /** @license React v16.3.1 * react.development.js * * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ { (function() { var _assign = objectAssign; var emptyObject = emptyObject_1; var invariant = invariant_1; var warning = warning_1; var emptyFunction = emptyFunction_1; var checkPropTypes = checkPropTypes_1; // TODO: this is special because it gets imported during build. var ReactVersion = '16.3.1'; // The Symbol used to tag the ReactElement-like types. If there is no native Symbol // nor polyfill, then a plain number is used for performance. var hasSymbol = typeof Symbol === 'function' && Symbol['for']; var REACT_ELEMENT_TYPE = hasSymbol ? Symbol['for']('react.element') : 0xeac7; var REACT_CALL_TYPE = hasSymbol ? Symbol['for']('react.call') : 0xeac8; var REACT_RETURN_TYPE = hasSymbol ? Symbol['for']('react.return') : 0xeac9; var REACT_PORTAL_TYPE = hasSymbol ? Symbol['for']('react.portal') : 0xeaca; var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol['for']('react.fragment') : 0xeacb; var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol['for']('react.strict_mode') : 0xeacc; var REACT_PROVIDER_TYPE = hasSymbol ? Symbol['for']('react.provider') : 0xeacd; var REACT_CONTEXT_TYPE = hasSymbol ? Symbol['for']('react.context') : 0xeace; var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol['for']('react.async_mode') : 0xeacf; var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol['for']('react.forward_ref') : 0xead0; var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; var FAUX_ITERATOR_SYMBOL = '@@iterator'; function getIteratorFn(maybeIterable) { if (maybeIterable === null || typeof maybeIterable === 'undefined') { return null; } var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; if (typeof maybeIterator === 'function') { return maybeIterator; } return null; } /** * WARNING: DO NOT manually require this module. * This is a replacement for `invariant(...)` used by the error code system * and will _only_ be required by the corresponding babel pass. * It always throws. */ /** * Forked from fbjs/warning: * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js * * Only change is we use console.warn instead of console.error, * and do nothing when 'console' is not supported. * This really simplifies the code. * --- * Similar to invariant but only logs a warning if the condition is not met. * This can be used to log issues in development environments in critical * paths. Removing the logging code for production environments will keep the * same logic and follow the same code paths. */ var lowPriorityWarning = function () {}; { var printWarning = function (format) { for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } var argIndex = 0; var message = 'Warning: ' + format.replace(/%s/g, function () { return args[argIndex++]; }); if (typeof console !== 'undefined') { console.warn(message); } try { // --- Welcome to debugging React --- // This error was thrown as a convenience so that you can use this stack // to find the callsite that caused this warning to fire. throw new Error(message); } catch (x) {} }; lowPriorityWarning = function (condition, format) { if (format === undefined) { throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument'); } if (!condition) { for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { args[_key2 - 2] = arguments[_key2]; } printWarning.apply(undefined, [format].concat(args)); } }; } var lowPriorityWarning$1 = lowPriorityWarning; var didWarnStateUpdateForUnmountedComponent = {}; function warnNoop(publicInstance, callerName) { { var _constructor = publicInstance.constructor; var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass'; var warningKey = componentName + '.' + callerName; if (didWarnStateUpdateForUnmountedComponent[warningKey]) { return; } warning(false, "Can't call %s on a component that is not yet mounted. " + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName); didWarnStateUpdateForUnmountedComponent[warningKey] = true; } } /** * This is the abstract API for an update queue. */ var ReactNoopUpdateQueue = { /** * Checks whether or not this composite component is mounted. * @param {ReactClass} publicInstance The instance we want to test. * @return {boolean} True if mounted, false otherwise. * @protected * @final */ isMounted: function (publicInstance) { return false; }, /** * Forces an update. This should only be invoked when it is known with * certainty that we are **not** in a DOM transaction. * * You may want to call this when you know that some deeper aspect of the * component's state has changed but `setState` was not called. * * This will not invoke `shouldComponentUpdate`, but it will invoke * `componentWillUpdate` and `componentDidUpdate`. * * @param {ReactClass} publicInstance The instance that should rerender. * @param {?function} callback Called after component is updated. * @param {?string} callerName name of the calling function in the public API. * @internal */ enqueueForceUpdate: function (publicInstance, callback, callerName) { warnNoop(publicInstance, 'forceUpdate'); }, /** * Replaces all of the state. Always use this or `setState` to mutate state. * You should treat `this.state` as immutable. * * There is no guarantee that `this.state` will be immediately updated, so * accessing `this.state` after calling this method may return the old value. * * @param {ReactClass} publicInstance The instance that should rerender. * @param {object} completeState Next state. * @param {?function} callback Called after component is updated. * @param {?string} callerName name of the calling function in the public API. * @internal */ enqueueReplaceState: function (publicInstance, completeState, callback, callerName) { warnNoop(publicInstance, 'replaceState'); }, /** * Sets a subset of the state. This only exists because _pendingState is * internal. This provides a merging strategy that is not available to deep * properties which is confusing. TODO: Expose pendingState or don't use it * during the merge. * * @param {ReactClass} publicInstance The instance that should rerender. * @param {object} partialState Next partial state to be merged with state. * @param {?function} callback Called after component is updated. * @param {?string} Name of the calling function in the public API. * @internal */ enqueueSetState: function (publicInstance, partialState, callback, callerName) { warnNoop(publicInstance, 'setState'); } }; /** * Base class helpers for the updating state of a component. */ function Component(props, context, updater) { this.props = props; this.context = context; this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the // renderer. this.updater = updater || ReactNoopUpdateQueue; } Component.prototype.isReactComponent = {}; /** * Sets a subset of the state. Always use this to mutate * state. You should treat `this.state` as immutable. * * There is no guarantee that `this.state` will be immediately updated, so * accessing `this.state` after calling this method may return the old value. * * There is no guarantee that calls to `setState` will run synchronously, * as they may eventually be batched together. You can provide an optional * callback that will be executed when the call to setState is actually * completed. * * When a function is provided to setState, it will be called at some point in * the future (not synchronously). It will be called with the up to date * component arguments (state, props, context). These values can be different * from this.* because your function may be called after receiveProps but before * shouldComponentUpdate, and this new state, props, and context will not yet be * assigned to this. * * @param {object|function} partialState Next partial state or function to * produce next partial state to be merged with current state. * @param {?function} callback Called after state is updated. * @final * @protected */ Component.prototype.setState = function (partialState, callback) { !(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null) ? invariant(false, 'setState(...): takes an object of state variables to update or a function which returns an object of state variables.') : void 0; this.updater.enqueueSetState(this, partialState, callback, 'setState'); }; /** * Forces an update. This should only be invoked when it is known with * certainty that we are **not** in a DOM transaction. * * You may want to call this when you know that some deeper aspect of the * component's state has changed but `setState` was not called. * * This will not invoke `shouldComponentUpdate`, but it will invoke * `componentWillUpdate` and `componentDidUpdate`. * * @param {?function} callback Called after update is complete. * @final * @protected */ Component.prototype.forceUpdate = function (callback) { this.updater.enqueueForceUpdate(this, callback, 'forceUpdate'); }; /** * Deprecated APIs. These APIs used to exist on classic React classes but since * we would like to deprecate them, we're not going to move them over to this * modern base class. Instead, we define a getter that warns if it's accessed. */ { var deprecatedAPIs = { isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'], replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).'] }; var defineDeprecationWarning = function (methodName, info) { Object.defineProperty(Component.prototype, methodName, { get: function () { lowPriorityWarning$1(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]); return undefined; } }); }; for (var fnName in deprecatedAPIs) { if (deprecatedAPIs.hasOwnProperty(fnName)) { defineDeprecationWarning(fnName, deprecatedAPIs[fnName]); } } } function ComponentDummy() {} ComponentDummy.prototype = Component.prototype; /** * Convenience component with default shallow equality check for sCU. */ function PureComponent(props, context, updater) { this.props = props; this.context = context; this.refs = emptyObject; this.updater = updater || ReactNoopUpdateQueue; } var pureComponentPrototype = PureComponent.prototype = new ComponentDummy(); pureComponentPrototype.constructor = PureComponent; // Avoid an extra prototype jump for these methods. _assign(pureComponentPrototype, Component.prototype); pureComponentPrototype.isPureReactComponent = true; // an immutable object with a single mutable value function createRef() { var refObject = { current: null }; { Object.seal(refObject); } return refObject; } /** * Keeps track of the current owner. * * The current owner is the component who should own any components that are * currently being constructed. */ var ReactCurrentOwner = { /** * @internal * @type {ReactComponent} */ current: null }; var hasOwnProperty = Object.prototype.hasOwnProperty; var RESERVED_PROPS = { key: true, ref: true, __self: true, __source: true }; var specialPropKeyWarningShown = void 0; var specialPropRefWarningShown = void 0; function hasValidRef(config) { { if (hasOwnProperty.call(config, 'ref')) { var getter = Object.getOwnPropertyDescriptor(config, 'ref').get; if (getter && getter.isReactWarning) { return false; } } } return config.ref !== undefined; } function hasValidKey(config) { { if (hasOwnProperty.call(config, 'key')) { var getter = Object.getOwnPropertyDescriptor(config, 'key').get; if (getter && getter.isReactWarning) { return false; } } } return config.key !== undefined; } function defineKeyPropWarningGetter(props, displayName) { var warnAboutAccessingKey = function () { if (!specialPropKeyWarningShown) { specialPropKeyWarningShown = true; warning(false, '%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName); } }; warnAboutAccessingKey.isReactWarning = true; Object.defineProperty(props, 'key', { get: warnAboutAccessingKey, configurable: true }); } function defineRefPropWarningGetter(props, displayName) { var warnAboutAccessingRef = function () { if (!specialPropRefWarningShown) { specialPropRefWarningShown = true; warning(false, '%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName); } }; warnAboutAccessingRef.isReactWarning = true; Object.defineProperty(props, 'ref', { get: warnAboutAccessingRef, configurable: true }); } /** * Factory method to create a new React element. This no longer adheres to * the class pattern, so do not use new to call it. Also, no instanceof check * will work. Instead test $$typeof field against Symbol.for('react.element') to check * if something is a React Element. * * @param {*} type * @param {*} key * @param {string|object} ref * @param {*} self A *temporary* helper to detect places where `this` is * different from the `owner` when React.createElement is called, so that we * can warn. We want to get rid of owner and replace string `ref`s with arrow * functions, and as long as `this` and owner are the same, there will be no * change in behavior. * @param {*} source An annotation object (added by a transpiler or otherwise) * indicating filename, line number, and/or other information. * @param {*} owner * @param {*} props * @internal */ var ReactElement = function (type, key, ref, self, source, owner, props) { var element = { // This tag allows us to uniquely identify this as a React Element $$typeof: REACT_ELEMENT_TYPE, // Built-in properties that belong on the element type: type, key: key, ref: ref, props: props, // Record the component responsible for creating this element. _owner: owner }; { // The validation flag is currently mutative. We put it on // an external backing store so that we can freeze the whole object. // This can be replaced with a WeakMap once they are implemented in // commonly used development environments. element._store = {}; // To make comparing ReactElements easier for testing purposes, we make // the validation flag non-enumerable (where possible, which should // include every environment we run tests in), so the test framework // ignores it. Object.defineProperty(element._store, 'validated', { configurable: false, enumerable: false, writable: true, value: false }); // self and source are DEV only properties. Object.defineProperty(element, '_self', { configurable: false, enumerable: false, writable: false, value: self }); // Two elements created in two different places should be considered // equal for testing purposes and therefore we hide it from enumeration. Object.defineProperty(element, '_source', { configurable: false, enumerable: false, writable: false, value: source }); if (Object.freeze) { Object.freeze(element.props); Object.freeze(element); } } return element; }; /** * Create and return a new ReactElement of the given type. * See https://reactjs.org/docs/react-api.html#createelement */ function createElement(type, config, children) { var propName = void 0; // Reserved names are extracted var props = {}; var key = null; var ref = null; var self = null; var source = null; if (config != null) { if (hasValidRef(config)) { ref = config.ref; } if (hasValidKey(config)) { key = '' + config.key; } self = config.__self === undefined ? null : config.__self; source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object for (propName in config) { if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { props[propName] = config[propName]; } } } // Children can be more than one argument, and those are transferred onto // the newly allocated props object. var childrenLength = arguments.length - 2; if (childrenLength === 1) { props.children = children; } else if (childrenLength > 1) { var childArray = Array(childrenLength); for (var i = 0; i < childrenLength; i++) { childArray[i] = arguments[i + 2]; } { if (Object.freeze) { Object.freeze(childArray); } } props.children = childArray; } // Resolve default props if (type && type.defaultProps) { var defaultProps = type.defaultProps; for (propName in defaultProps) { if (props[propName] === undefined) { props[propName] = defaultProps[propName]; } } } { if (key || ref) { if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) { var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type; if (key) { defineKeyPropWarningGetter(props, displayName); } if (ref) { defineRefPropWarningGetter(props, displayName); } } } } return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props); } /** * Return a function that produces ReactElements of a given type. * See https://reactjs.org/docs/react-api.html#createfactory */ function cloneAndReplaceKey(oldElement, newKey) { var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props); return newElement; } /** * Clone and return a new ReactElement using element as the starting point. * See https://reactjs.org/docs/react-api.html#cloneelement */ function cloneElement(element, config, children) { var propName = void 0; // Original props are copied var props = _assign({}, element.props); // Reserved names are extracted var key = element.key; var ref = element.ref; // Self is preserved since the owner is preserved. var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a // transpiler, and the original source is probably a better indicator of the // true owner. var source = element._source; // Owner will be preserved, unless ref is overridden var owner = element._owner; if (config != null) { if (hasValidRef(config)) { // Silently steal the ref from the parent. ref = config.ref; owner = ReactCurrentOwner.current; } if (hasValidKey(config)) { key = '' + config.key; } // Remaining properties override existing props var defaultProps = void 0; if (element.type && element.type.defaultProps) { defaultProps = element.type.defaultProps; } for (propName in config) { if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { if (config[propName] === undefined && defaultProps !== undefined) { // Resolve default props props[propName] = defaultProps[propName]; } else { props[propName] = config[propName]; } } } } // Children can be more than one argument, and those are transferred onto // the newly allocated props object. var childrenLength = arguments.length - 2; if (childrenLength === 1) { props.children = children; } else if (childrenLength > 1) { var childArray = Array(childrenLength); for (var i = 0; i < childrenLength; i++) { childArray[i] = arguments[i + 2]; } props.children = childArray; } return ReactElement(element.type, key, ref, self, source, owner, props); } /** * Verifies the object is a ReactElement. * See https://reactjs.org/docs/react-api.html#isvalidelement * @param {?object} object * @return {boolean} True if `object` is a valid component. * @final */ function isValidElement(object) { return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; } var ReactDebugCurrentFrame = {}; { // Component that is being worked on ReactDebugCurrentFrame.getCurrentStack = null; ReactDebugCurrentFrame.getStackAddendum = function () { var impl = ReactDebugCurrentFrame.getCurrentStack; if (impl) { return impl(); } return null; }; } var SEPARATOR = '.'; var SUBSEPARATOR = ':'; /** * Escape and wrap key so it is safe to use as a reactid * * @param {string} key to be escaped. * @return {string} the escaped key. */ function escape(key) { var escapeRegex = /[=:]/g; var escaperLookup = { '=': '=0', ':': '=2' }; var escapedString = ('' + key).replace(escapeRegex, function (match) { return escaperLookup[match]; }); return '$' + escapedString; } /** * TODO: Test that a single child and an array with one item have the same key * pattern. */ var didWarnAboutMaps = false; var userProvidedKeyEscapeRegex = /\/+/g; function escapeUserProvidedKey(text) { return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/'); } var POOL_SIZE = 10; var traverseContextPool = []; function getPooledTraverseContext(mapResult, keyPrefix, mapFunction, mapContext) { if (traverseContextPool.length) { var traverseContext = traverseContextPool.pop(); traverseContext.result = mapResult; traverseContext.keyPrefix = keyPrefix; traverseContext.func = mapFunction; traverseContext.context = mapContext; traverseContext.count = 0; return traverseContext; } else { return { result: mapResult, keyPrefix: keyPrefix, func: mapFunction, context: mapContext, count: 0 }; } } function releaseTraverseContext(traverseContext) { traverseContext.result = null; traverseContext.keyPrefix = null; traverseContext.func = null; traverseContext.context = null; traverseContext.count = 0; if (traverseContextPool.length < POOL_SIZE) { traverseContextPool.push(traverseContext); } } /** * @param {?*} children Children tree container. * @param {!string} nameSoFar Name of the key path so far. * @param {!function} callback Callback to invoke with each child found. * @param {?*} traverseContext Used to pass information throughout the traversal * process. * @return {!number} The number of children in this subtree. */ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) { var type = typeof children; if (type === 'undefined' || type === 'boolean') { // All of the above are perceived as null. children = null; } var invokeCallback = false; if (children === null) { invokeCallback = true; } else { switch (type) { case 'string': case 'number': invokeCallback = true; break; case 'object': switch (children.$$typeof) { case REACT_ELEMENT_TYPE: case REACT_PORTAL_TYPE: invokeCallback = true; } } } if (invokeCallback) { callback(traverseContext, children, // If it's the only child, treat the name as if it was wrapped in an array // so that it's consistent if the number of children grows. nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar); return 1; } var child = void 0; var nextName = void 0; var subtreeCount = 0; // Count of children found in the current subtree. var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR; if (Array.isArray(children)) { for (var i = 0; i < children.length; i++) { child = children[i]; nextName = nextNamePrefix + getComponentKey(child, i); subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext); } } else { var iteratorFn = getIteratorFn(children); if (typeof iteratorFn === 'function') { { // Warn about using Maps as children if (iteratorFn === children.entries) { warning(didWarnAboutMaps, 'Using Maps as children is unsupported and will likely yield ' + 'unexpected results. Convert it to a sequence/iterable of keyed ' + 'ReactElements instead.%s', ReactDebugCurrentFrame.getStackAddendum()); didWarnAboutMaps = true; } } var iterator = iteratorFn.call(children); var step = void 0; var ii = 0; while (!(step = iterator.next()).done) { child = step.value; nextName = nextNamePrefix + getComponentKey(child, ii++); subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext); } } else if (type === 'object') { var addendum = ''; { addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + ReactDebugCurrentFrame.getStackAddendum(); } var childrenString = '' + children; invariant(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum); } } return subtreeCount; } /** * Traverses children that are typically specified as `props.children`, but * might also be specified through attributes: * * - `traverseAllChildren(this.props.children, ...)` * - `traverseAllChildren(this.props.leftPanelChildren, ...)` * * The `traverseContext` is an optional argument that is passed through the * entire traversal. It can be used to store accumulations or anything else that * the callback might find relevant. * * @param {?*} children Children tree object. * @param {!function} callback To invoke upon traversing each child. * @param {?*} traverseContext Context for traversal. * @return {!number} The number of children in this subtree. */ function traverseAllChildren(children, callback, traverseContext) { if (children == null) { return 0; } return traverseAllChildrenImpl(children, '', callback, traverseContext); } /** * Generate a key string that identifies a component within a set. * * @param {*} component A component that could contain a manual key. * @param {number} index Index that is used if a manual key is not provided. * @return {string} */ function getComponentKey(component, index) { // Do some typechecking here since we call this blindly. We want to ensure // that we don't block potential future ES APIs. if (typeof component === 'object' && component !== null && component.key != null) { // Explicit key return escape(component.key); } // Implicit key determined by the index in the set return index.toString(36); } function forEachSingleChild(bookKeeping, child, name) { var func = bookKeeping.func, context = bookKeeping.context; func.call(context, child, bookKeeping.count++); } /** * Iterates through children that are typically specified as `props.children`. * * See https://reactjs.org/docs/react-api.html#react.children.foreach * * The provided forEachFunc(child, index) will be called for each * leaf child. * * @param {?*} children Children tree container. * @param {function(*, int)} forEachFunc * @param {*} forEachContext Context for forEachContext. */ function forEachChildren(children, forEachFunc, forEachContext) { if (children == null) { return children; } var traverseContext = getPooledTraverseContext(null, null, forEachFunc, forEachContext); traverseAllChildren(children, forEachSingleChild, traverseContext); releaseTraverseContext(traverseContext); } function mapSingleChildIntoContext(bookKeeping, child, childKey) { var result = bookKeeping.result, keyPrefix = bookKeeping.keyPrefix, func = bookKeeping.func, context = bookKeeping.context; var mappedChild = func.call(context, child, bookKeeping.count++); if (Array.isArray(mappedChild)) { mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction.thatReturnsArgument); } else if (mappedChild != null) { if (isValidElement(mappedChild)) { mappedChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as // traverseAllChildren used to do for objects as children keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey); } result.push(mappedChild); } } function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) { var escapedPrefix = ''; if (prefix != null) { escapedPrefix = escapeUserProvidedKey(prefix) + '/'; } var traverseContext = getPooledTraverseContext(array, escapedPrefix, func, context); traverseAllChildren(children, mapSingleChildIntoContext, traverseContext); releaseTraverseContext(traverseContext); } /** * Maps children that are typically specified as `props.children`. * * See https://reactjs.org/docs/react-api.html#react.children.map * * The provided mapFunction(child, key, index) will be called for each * leaf child. * * @param {?*} children Children tree container. * @param {function(*, int)} func The map function. * @param {*} context Context for mapFunction. * @return {object} Object containing the ordered map of results. */ function mapChildren(children, func, context) { if (children == null) { return children; } var result = []; mapIntoWithKeyPrefixInternal(children, result, null, func, context); return result; } /** * Count the number of children that are typically specified as * `props.children`. * * See https://reactjs.org/docs/react-api.html#react.children.count * * @param {?*} children Children tree container. * @return {number} The number of children. */ function countChildren(children, context) { return traverseAllChildren(children, emptyFunction.thatReturnsNull, null); } /** * Flatten a children object (typically specified as `props.children`) and * return an array with appropriately re-keyed children. * * See https://reactjs.org/docs/react-api.html#react.children.toarray */ function toArray(children) { var result = []; mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument); return result; } /** * Returns the first child in a collection of children and verifies that there * is only one child in the collection. * * See https://reactjs.org/docs/react-api.html#react.children.only * * The current implementation of this function assumes that a single child gets * passed without a wrapper, but the purpose of this helper function is to * abstract away the particular structure of children. * * @param {?object} children Child collection structure. * @return {ReactElement} The first and only `ReactElement` contained in the * structure. */ function onlyChild(children) { !isValidElement(children) ? invariant(false, 'React.Children.only expected to receive a single React element child.') : void 0; return children; } function createContext(defaultValue, calculateChangedBits) { if (calculateChangedBits === undefined) { calculateChangedBits = null; } else { { warning(calculateChangedBits === null || typeof calculateChangedBits === 'function', 'createContext: Expected the optional second argument to be a ' + 'function. Instead received: %s', calculateChangedBits); } } var context = { $$typeof: REACT_CONTEXT_TYPE, _calculateChangedBits: calculateChangedBits, _defaultValue: defaultValue, _currentValue: defaultValue, _changedBits: 0, // These are circular Provider: null, Consumer: null }; context.Provider = { $$typeof: REACT_PROVIDER_TYPE, _context: context }; context.Consumer = context; { context._currentRenderer = null; } return context; } function forwardRef(render) { { warning(typeof render === 'function', 'forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render); } return { $$typeof: REACT_FORWARD_REF_TYPE, render: render }; } var describeComponentFrame = function (name, source, ownerName) { return '\n in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : ''); }; function isValidElementType(type) { return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. type === REACT_FRAGMENT_TYPE || type === REACT_ASYNC_MODE_TYPE || type === REACT_STRICT_MODE_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE); } function getComponentName(fiber) { var type = fiber.type; if (typeof type === 'function') { return type.displayName || type.name; } if (typeof type === 'string') { return type; } switch (type) { case REACT_FRAGMENT_TYPE: return 'ReactFragment'; case REACT_PORTAL_TYPE: return 'ReactPortal'; case REACT_CALL_TYPE: return 'ReactCall'; case REACT_RETURN_TYPE: return 'ReactReturn'; } return null; } /** * ReactElementValidator provides a wrapper around a element factory * which validates the props passed to the element. This is intended to be * used only in DEV and could be replaced by a static type checker for languages * that support it. */ var currentlyValidatingElement = void 0; var propTypesMisspellWarningShown = void 0; var getDisplayName = function () {}; var getStackAddendum = function () {}; { currentlyValidatingElement = null; propTypesMisspellWarningShown = false; getDisplayName = function (element) { if (element == null) { return '#empty'; } else if (typeof element === 'string' || typeof element === 'number') { return '#text'; } else if (typeof element.type === 'string') { return element.type; } else if (element.type === REACT_FRAGMENT_TYPE) { return 'React.Fragment'; } else { return element.type.displayName || element.type.name || 'Unknown'; } }; getStackAddendum = function () { var stack = ''; if (currentlyValidatingElement) { var name = getDisplayName(currentlyValidatingElement); var owner = currentlyValidatingElement._owner; stack += describeComponentFrame(name, currentlyValidatingElement._source, owner && getComponentName(owner)); } stack += ReactDebugCurrentFrame.getStackAddendum() || ''; return stack; }; } function getDeclarationErrorAddendum() { if (ReactCurrentOwner.current) { var name = getComponentName(ReactCurrentOwner.current); if (name) { return '\n\nCheck the render method of `' + name + '`.'; } } return ''; } function getSourceInfoErrorAddendum(elementProps) { if (elementProps !== null && elementProps !== undefined && elementProps.__source !== undefined) { var source = elementProps.__source; var fileName = source.fileName.replace(/^.*[\\\/]/, ''); var lineNumber = source.lineNumber; return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.'; } return ''; } /** * Warn if there's no key explicitly set on dynamic arrays of children or * object keys are not valid. This allows us to keep track of children between * updates. */ var ownerHasKeyUseWarning = {}; function getCurrentComponentErrorInfo(parentType) { var info = getDeclarationErrorAddendum(); if (!info) { var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name; if (parentName) { info = '\n\nCheck the top-level render call using <' + parentName + '>.'; } } return info; } /** * Warn if the element doesn't have an explicit key assigned to it. * This element is in an array. The array could grow and shrink or be * reordered. All children that haven't already been validated are required to * have a "key" property assigned to it. Error statuses are cached so a warning * will only be shown once. * * @internal * @param {ReactElement} element Element that requires a key. * @param {*} parentType element's parent's type. */ function validateExplicitKey(element, parentType) { if (!element._store || element._store.validated || element.key != null) { return; } element._store.validated = true; var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType); if (ownerHasKeyUseWarning[currentComponentErrorInfo]) { return; } ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a // property, it may be the creator of the child that's responsible for // assigning it a key. var childOwner = ''; if (element && element._owner && element._owner !== ReactCurrentOwner.current) { // Give the component that originally created this child. childOwner = ' It was passed a child from ' + getComponentName(element._owner) + '.'; } currentlyValidatingElement = element; { warning(false, 'Each child in an array or iterator should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.%s', currentComponentErrorInfo, childOwner, getStackAddendum()); } currentlyValidatingElement = null; } /** * Ensure that every element either is passed in a static location, in an * array with an explicit keys property defined, or in an object literal * with valid key property. * * @internal * @param {ReactNode} node Statically passed child of any type. * @param {*} parentType node's parent's type. */ function validateChildKeys(node, parentType) { if (typeof node !== 'object') { return; } if (Array.isArray(node)) { for (var i = 0; i < node.length; i++) { var child = node[i]; if (isValidElement(child)) { validateExplicitKey(child, parentType); } } } else if (isValidElement(node)) { // This element was passed in a valid location. if (node._store) { node._store.validated = true; } } else if (node) { var iteratorFn = getIteratorFn(node); if (typeof iteratorFn === 'function') { // Entry iterators used to provide implicit keys, // but now we print a separate warning for them later. if (iteratorFn !== node.entries) { var iterator = iteratorFn.call(node); var step = void 0; while (!(step = iterator.next()).done) { if (isValidElement(step.value)) { validateExplicitKey(step.value, parentType); } } } } } } /** * Given an element, validate that its props follow the propTypes definition, * provided by the type. * * @param {ReactElement} element */ function validatePropTypes(element) { var componentClass = element.type; if (typeof componentClass !== 'function') { return; } var name = componentClass.displayName || componentClass.name; var propTypes = componentClass.propTypes; if (propTypes) { currentlyValidatingElement = element; checkPropTypes(propTypes, element.props, 'prop', name, getStackAddendum); currentlyValidatingElement = null; } else if (componentClass.PropTypes !== undefined && !propTypesMisspellWarningShown) { propTypesMisspellWarningShown = true; warning(false, 'Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', name || 'Unknown'); } if (typeof componentClass.getDefaultProps === 'function') { warning(componentClass.getDefaultProps.isReactClassApproved, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.'); } } /** * Given a fragment, validate that it can only be provided with fragment props * @param {ReactElement} fragment */ function validateFragmentProps(fragment) { currentlyValidatingElement = fragment; var keys = Object.keys(fragment.props); for (var i = 0; i < keys.length; i++) { var key = keys[i]; if (key !== 'children' && key !== 'key') { warning(false, 'Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.%s', key, getStackAddendum()); break; } } if (fragment.ref !== null) { warning(false, 'Invalid attribute `ref` supplied to `React.Fragment`.%s', getStackAddendum()); } currentlyValidatingElement = null; } function createElementWithValidation(type, props, children) { var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to // succeed and there will likely be errors in render. if (!validType) { var info = ''; if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) { info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports."; } var sourceInfo = getSourceInfoErrorAddendum(props); if (sourceInfo) { info += sourceInfo; } else { info += getDeclarationErrorAddendum(); } info += getStackAddendum() || ''; var typeString = void 0; if (type === null) { typeString = 'null'; } else if (Array.isArray(type)) { typeString = 'array'; } else { typeString = typeof type; } warning(false, 'React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info); } var element = createElement.apply(this, arguments); // The result can be nullish if a mock or a custom function is used. // TODO: Drop this when these are no longer allowed as the type argument. if (element == null) { return element; } // Skip key warning if the type isn't valid since our key validation logic // doesn't expect a non-string/function type and can throw confusing errors. // We don't want exception behavior to differ between dev and prod. // (Rendering will throw with a helpful message and as soon as the type is // fixed, the key warnings will appear.) if (validType) { for (var i = 2; i < arguments.length; i++) { validateChildKeys(arguments[i], type); } } if (type === REACT_FRAGMENT_TYPE) { validateFragmentProps(element); } else { validatePropTypes(element); } return element; } function createFactoryWithValidation(type) { var validatedFactory = createElementWithValidation.bind(null, type); validatedFactory.type = type; // Legacy hook: remove it { Object.defineProperty(validatedFactory, 'type', { enumerable: false, get: function () { lowPriorityWarning$1(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.'); Object.defineProperty(this, 'type', { value: type }); return type; } }); } return validatedFactory; } function cloneElementWithValidation(element, props, children) { var newElement = cloneElement.apply(this, arguments); for (var i = 2; i < arguments.length; i++) { validateChildKeys(arguments[i], newElement.type); } validatePropTypes(newElement); return newElement; } var React = { Children: { map: mapChildren, forEach: forEachChildren, count: countChildren, toArray: toArray, only: onlyChild }, createRef: createRef, Component: Component, PureComponent: PureComponent, createContext: createContext, forwardRef: forwardRef, Fragment: REACT_FRAGMENT_TYPE, StrictMode: REACT_STRICT_MODE_TYPE, unstable_AsyncMode: REACT_ASYNC_MODE_TYPE, createElement: createElementWithValidation, cloneElement: cloneElementWithValidation, createFactory: createFactoryWithValidation, isValidElement: isValidElement, version: ReactVersion, __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: { ReactCurrentOwner: ReactCurrentOwner, // Used by renderers to avoid bundling object-assign twice in UMD bundles: assign: _assign } }; { _assign(React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, { // These should not be included in production. ReactDebugCurrentFrame: ReactDebugCurrentFrame, // Shim for React DOM 16.0.0 which still destructured (but not used) this. // TODO: remove in React 17.0. ReactComponentTreeHook: {} }); } var React$2 = Object.freeze({ default: React }); var React$3 = ( React$2 && React ) || React$2; // TODO: decide on the top-level export form. // This is hacky but makes it work with both Rollup and Jest. var react = React$3['default'] ? React$3['default'] : React$3; module.exports = react; })(); } }); var react = createCommonjsModule(function (module) { { module.exports = react_development; } }); var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) { /* global Symbol */ var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. /** * Returns the iterator method function contained on the iterable object. * * Be sure to invoke the function with the iterable as context: * * var iteratorFn = getIteratorFn(myIterable); * if (iteratorFn) { * var iterator = iteratorFn.call(myIterable); * ... * } * * @param {?object} maybeIterable * @return {?function} */ function getIteratorFn(maybeIterable) { var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); if (typeof iteratorFn === 'function') { return iteratorFn; } } /** * Collection of methods that allow declaration and validation of props that are * supplied to React components. Example usage: * * var Props = require('ReactPropTypes'); * var MyArticle = React.createClass({ * propTypes: { * // An optional string prop named "description". * description: Props.string, * * // A required enum prop named "category". * category: Props.oneOf(['News','Photos']).isRequired, * * // A prop named "dialog" that requires an instance of Dialog. * dialog: Props.instanceOf(Dialog).isRequired * }, * render: function() { ... } * }); * * A more formal specification of how these methods are used: * * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) * decl := ReactPropTypes.{type}(.isRequired)? * * Each and every declaration produces a function with the same signature. This * allows the creation of custom validation functions. For example: * * var MyLink = React.createClass({ * propTypes: { * // An optional string or URI prop named "href". * href: function(props, propName, componentName) { * var propValue = props[propName]; * if (propValue != null && typeof propValue !== 'string' && * !(propValue instanceof URI)) { * return new Error( * 'Expected a string or an URI for ' + propName + ' in ' + * componentName * ); * } * } * }, * render: function() {...} * }); * * @internal */ var ANONYMOUS = '<<anonymous>>'; // Important! // Keep this list in sync with production version in `./factoryWithThrowingShims.js`. var ReactPropTypes = { array: createPrimitiveTypeChecker('array'), bool: createPrimitiveTypeChecker('boolean'), func: createPrimitiveTypeChecker('function'), number: createPrimitiveTypeChecker('number'), object: createPrimitiveTypeChecker('object'), string: createPrimitiveTypeChecker('string'), symbol: createPrimitiveTypeChecker('symbol'), any: createAnyTypeChecker(), arrayOf: createArrayOfTypeChecker, element: createElementTypeChecker(), instanceOf: createInstanceTypeChecker, node: createNodeChecker(), objectOf: createObjectOfTypeChecker, oneOf: createEnumTypeChecker, oneOfType: createUnionTypeChecker, shape: createShapeTypeChecker, exact: createStrictShapeTypeChecker, }; /** * inlined Object.is polyfill to avoid requiring consumers ship their own * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is */ /*eslint-disable no-self-compare*/ function is(x, y) { // SameValue algorithm if (x === y) { // Steps 1-5, 7-10 // Steps 6.b-6.e: +0 != -0 return x !== 0 || 1 / x === 1 / y; } else { // Step 6.a: NaN == NaN return x !== x && y !== y; } } /*eslint-enable no-self-compare*/ /** * We use an Error-like object for backward compatibility as people may call * PropTypes directly and inspect their output. However, we don't use real * Errors anymore. We don't inspect their stack anyway, and creating them * is prohibitively expensive if they are created too often, such as what * happens in oneOfType() for any type before the one that matched. */ function PropTypeError(message) { this.message = message; this.stack = ''; } // Make `instanceof Error` still work for returned errors. PropTypeError.prototype = Error.prototype; function createChainableTypeChecker(validate) { { var manualPropTypeCallCache = {}; var manualPropTypeWarningCount = 0; } function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { componentName = componentName || ANONYMOUS; propFullName = propFullName || propName; if (secret !== ReactPropTypesSecret_1) { if (throwOnDirectAccess) { // New behavior only for users of `prop-types` package invariant_1( false, 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use `PropTypes.checkPropTypes()` to call them. ' + 'Read more at http://fb.me/use-check-prop-types' ); } else if ("development" !== 'production' && typeof console !== 'undefined') { // Old behavior for people using React.PropTypes var cacheKey = componentName + ':' + propName; if ( !manualPropTypeCallCache[cacheKey] && // Avoid spamming the console because they are often not actionable except for lib authors manualPropTypeWarningCount < 3 ) { warning_1( false, 'You are manually calling a React.PropTypes validation ' + 'function for the `%s` prop on `%s`. This is deprecated ' + 'and will throw in the standalone `prop-types` package. ' + 'You may be seeing this warning due to a third-party PropTypes ' + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.', propFullName, componentName ); manualPropTypeCallCache[cacheKey] = true; manualPropTypeWarningCount++; } } } if (props[propName] == null) { if (isRequired) { if (props[propName] === null) { return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.')); } return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.')); } return null; } else { return validate(props, propName, componentName, location, propFullName); } } var chainedCheckType = checkType.bind(null, false); chainedCheckType.isRequired = checkType.bind(null, true); return chainedCheckType; } function createPrimitiveTypeChecker(expectedType) { function validate(props, propName, componentName, location, propFullName, secret) { var propValue = props[propName]; var propType = getPropType(propValue); if (propType !== expectedType) { // `propValue` being instance of, say, date/regexp, pass the 'object' // check, but we can offer a more precise error message here rather than // 'of type `object`'. var preciseType = getPreciseType(propValue); return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.')); } return null; } return createChainableTypeChecker(validate); } function createAnyTypeChecker() { return createChainableTypeChecker(emptyFunction_1.thatReturnsNull); } function createArrayOfTypeChecker(typeChecker) { function validate(props, propName, componentName, location, propFullName) { if (typeof typeChecker !== 'function') { return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.'); } var propValue = props[propName]; if (!Array.isArray(propValue)) { var propType = getPropType(propValue); return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.')); } for (var i = 0; i < propValue.length; i++) { var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret_1); if (error instanceof Error) { return error; } } return null; } return createChainableTypeChecker(validate); } function createElementTypeChecker() { function validate(props, propName, componentName, location, propFullName) { var propValue = props[propName]; if (!isValidElement(propValue)) { var propType = getPropType(propValue); return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.')); } return null; } return createChainableTypeChecker(validate); } function createInstanceTypeChecker(expectedClass) { function validate(props, propName, componentName, location, propFullName) { if (!(props[propName] instanceof expectedClass)) { var expectedClassName = expectedClass.name || ANONYMOUS; var actualClassName = getClassName(props[propName]); return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.')); } return null; } return createChainableTypeChecker(validate); } function createEnumTypeChecker(expectedValues) { if (!Array.isArray(expectedValues)) { warning_1(false, 'Invalid argument supplied to oneOf, expected an instance of array.'); return emptyFunction_1.thatReturnsNull; } function validate(props, propName, componentName, location, propFullName) { var propValue = props[propName]; for (var i = 0; i < expectedValues.length; i++) { if (is(propValue, expectedValues[i])) { return null; } } var valuesString = JSON.stringify(expectedValues); return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); } return createChainableTypeChecker(validate); } function createObjectOfTypeChecker(typeChecker) { function validate(props, propName, componentName, location, propFullName) { if (typeof typeChecker !== 'function') { return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); } var propValue = props[propName]; var propType = getPropType(propValue); if (propType !== 'object') { return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); } for (var key in propValue) { if (propValue.hasOwnProperty(key)) { var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1); if (error instanceof Error) { return error; } } } return null; } return createChainableTypeChecker(validate); } function createUnionTypeChecker(arrayOfTypeCheckers) { if (!Array.isArray(arrayOfTypeCheckers)) { warning_1(false, 'Invalid argument supplied to oneOfType, expected an instance of array.'); return emptyFunction_1.thatReturnsNull; } for (var i = 0; i < arrayOfTypeCheckers.length; i++) { var checker = arrayOfTypeCheckers[i]; if (typeof checker !== 'function') { warning_1( false, 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + 'received %s at index %s.', getPostfixForTypeWarning(checker), i ); return emptyFunction_1.thatReturnsNull; } } function validate(props, propName, componentName, location, propFullName) { for (var i = 0; i < arrayOfTypeCheckers.length; i++) { var checker = arrayOfTypeCheckers[i]; if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret_1) == null) { return null; } } return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.')); } return createChainableTypeChecker(validate); } function createNodeChecker() { function validate(props, propName, componentName, location, propFullName) { if (!isNode(props[propName])) { return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); } return null; } return createChainableTypeChecker(validate); } function createShapeTypeChecker(shapeTypes) { function validate(props, propName, componentName, location, propFullName) { var propValue = props[propName]; var propType = getPropType(propValue); if (propType !== 'object') { return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); } for (var key in shapeTypes) { var checker = shapeTypes[key]; if (!checker) { continue; } var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1); if (error) { return error; } } return null; } return createChainableTypeChecker(validate); } function createStrictShapeTypeChecker(shapeTypes) { function validate(props, propName, componentName, location, propFullName) { var propValue = props[propName]; var propType = getPropType(propValue); if (propType !== 'object') { return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); } // We need to check all keys in case some are required but missing from // props. var allKeys = objectAssign({}, props[propName], shapeTypes); for (var key in allKeys) { var checker = shapeTypes[key]; if (!checker) { return new PropTypeError( 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ') ); } var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1); if (error) { return error; } } return null; } return createChainableTypeChecker(validate); } function isNode(propValue) { switch (typeof propValue) { case 'number': case 'string': case 'undefined': return true; case 'boolean': return !propValue; case 'object': if (Array.isArray(propValue)) { return propValue.every(isNode); } if (propValue === null || isValidElement(propValue)) { return true; } var iteratorFn = getIteratorFn(propValue); if (iteratorFn) { var iterator = iteratorFn.call(propValue); var step; if (iteratorFn !== propValue.entries) { while (!(step = iterator.next()).done) { if (!isNode(step.value)) { return false; } } } else { // Iterator will provide entry [k,v] tuples rather than values. while (!(step = iterator.next()).done) { var entry = step.value; if (entry) { if (!isNode(entry[1])) { return false; } } } } } else { return false; } return true; default: return false; } } function isSymbol(propType, propValue) { // Native Symbol. if (propType === 'symbol') { return true; } // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' if (propValue['@@toStringTag'] === 'Symbol') { return true; } // Fallback for non-spec compliant Symbols which are polyfilled. if (typeof Symbol === 'function' && propValue instanceof Symbol) { return true; } return false; } // Equivalent of `typeof` but with special handling for array and regexp. function getPropType(propValue) { var propType = typeof propValue; if (Array.isArray(propValue)) { return 'array'; } if (propValue instanceof RegExp) { // Old webkits (at least until Android 4.0) return 'function' rather than // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ // passes PropTypes.object. return 'object'; } if (isSymbol(propType, propValue)) { return 'symbol'; } return propType; } // This handles more types than `getPropType`. Only used for error messages. // See `createPrimitiveTypeChecker`. function getPreciseType(propValue) { if (typeof propValue === 'undefined' || propValue === null) { return '' + propValue; } var propType = getPropType(propValue); if (propType === 'object') { if (propValue instanceof Date) { return 'date'; } else if (propValue instanceof RegExp) { return 'regexp'; } } return propType; } // Returns a string that is postfixed to a warning about an invalid type. // For example, "undefined" or "of type array" function getPostfixForTypeWarning(value) { var type = getPreciseType(value); switch (type) { case 'array': case 'object': return 'an ' + type; case 'boolean': case 'date': case 'regexp': return 'a ' + type; default: return type; } } // Returns class name of the object, if any. function getClassName(propValue) { if (!propValue.constructor || !propValue.constructor.name) { return ANONYMOUS; } return propValue.constructor.name; } ReactPropTypes.checkPropTypes = checkPropTypes_1; ReactPropTypes.PropTypes = ReactPropTypes; return ReactPropTypes; }; var propTypes = createCommonjsModule(function (module) { /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ { var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' && Symbol.for && Symbol.for('react.element')) || 0xeac7; var isValidElement = function(object) { return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; }; // By explicitly using `prop-types` you are opting into new development behavior. // http://fb.me/prop-types-in-prod var throwOnDirectAccess = true; module.exports = factoryWithTypeCheckers(isValidElement, throwOnDirectAccess); } }); function noop() {} function unwrapArray(arg, defaultValue) { arg = Array.isArray(arg) ? arg[0] : arg; if (!arg && defaultValue) { return defaultValue; } else { return arg; } } function composeEventHandlers() { for (var _len = arguments.length, fns = Array(_len), _key = 0; _key < _len; _key++) { fns[_key] = arguments[_key]; } return function (event) { for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { args[_key2 - 1] = arguments[_key2]; } fns.forEach(function (fn) { fn && fn.apply(undefined, [event].concat(args)); }); }; } var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; var objectWithoutProperties = function (obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }; var possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; var clock = (typeof performance === 'undefined' ? 'undefined' : _typeof(performance)) === 'object' && performance.now ? performance : Date; var Carousel$1 = function (_React$Component) { inherits(Carousel, _React$Component); function Carousel(props) { classCallCheck(this, Carousel); var _this = possibleConstructorReturn(this, _React$Component.call(this, props)); _this.calculateSizes = function () { _this.setState({ windowWidth: _this._windowRef.offsetWidth, trackWidth: _this._windowRef.offsetWidth * 3 }); }; _this.play = function () { if (_this.state.focused) { _this.timeout = setTimeout(function () { _this.goToSlide(_this.nextIndex(_this.state.currentIndex)); }, _this.props.slideDuration); } }; _this.pause = function () { clearTimeout(_this.timeout); }; _this.resize = function () { if (_this.running) { return; } _this.running = true; window.requestAnimationFrame(function () { _this.calculateSizes(); _this.running = false; }); }; _this.handleVisibilityChange = function () { _this.setState({ focused: !document.hidden }, function () { document.hidden ? _this.pause() : _this.props.autoPlay && _this.play(); }); }; _this.keydown = function (e) { if (e.keyCode === 37) { // previous _this.goToSlide(_this.prevIndex(_this.state.currentIndex), true); } if (e.keyCode === 39) { // next _this.goToSlide(_this.nextIndex(_this.state.currentIndex), true); } }; _this.commitUpdate = function () { _this.setState({ finalPrevIndex: _this.state.prevIndex, finalCurrentIndex: _this.state.currentIndex, finalNextIndex: _this.state.nextIndex }); }; _this.goToSlide = function (index) { var jump = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; _this.pause(); _this.now = clock.now(); var transitionDirection = 1; if (index === _this.props.slideCount - 1) { if (_this.state.currentIndex === 0) { transitionDirection = 0; } else { transitionDirection = 2; } } else if (index === 0) { if (_this.state.currentIndex === _this.props.slideCount - 1) { transitionDirection = 2; } else { transitionDirection = 0; } } else { if (index > _this.state.currentIndex) { transitionDirection = 2; } else if (index < _this.state.currentIndex) { transitionDirection = 0; } } var animationMS = Math.abs(_this.state.windowWidth + _this.state.dragOffset - _this.state.windowWidth * transitionDirection) * _this.props.animationDuration / _this.state.windowWidth; if (_this.props.animationDuration <= 0) { _this.commitUpdate(); } var prevIndex = _this.prevIndex(index); var nextIndex = _this.nextIndex(index); if (jump) { switch (transitionDirection) { case 0: _this.setState({ finalPrevIndex: index }); break; case 2: _this.setState({ finalNextIndex: index }); break; } } _this.setState({ transitionDirection: transitionDirection, animationMS: animationMS, prevIndex: prevIndex, currentIndex: index, nextIndex: nextIndex }, function () { if (_this.props.autoPlay) { _this.play(); } }); }; _this.prevIndex = function (index) { return index > 0 ? index - 1 : _this.props.slideCount - 1; }; _this.nextIndex = function (index) { return index < _this.props.slideCount - 1 ? index + 1 : 0; }; _this.getRootProps = function () { var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var rest = objectWithoutProperties(_ref, []); return _extends({}, rest); }; _this.windowRef = function (node) { return _this._windowRef = node; }; _this.getWindowProps = function () { var _babelHelpers$extends; var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var _ref2$refKey = _ref2.refKey, refKey = _ref2$refKey === undefined ? 'ref' : _ref2$refKey, rest = objectWithoutProperties(_ref2, ['refKey']); return _extends((_babelHelpers$extends = {}, _babelHelpers$extends[refKey] = _this.windowRef, _babelHelpers$extends), rest); }; _this.trackRef = function (node) { return _this._trackRef = node; }; _this.track_handleTransitionEnd = function () { _this.commitUpdate(); _this.setState({ animationMS: 0, transitionDirection: 1 }); }; _this.getTrackProps = function () { var _babelHelpers$extends2; var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var _ref3$refKey = _ref3.refKey, refKey = _ref3$refKey === undefined ? 'ref' : _ref3$refKey, onTransitionEnd = _ref3.onTransitionEnd, style = _ref3.style, rest = objectWithoutProperties(_ref3, ['refKey', 'onTransitionEnd', 'style']); return _extends((_babelHelpers$extends2 = {}, _babelHelpers$extends2[refKey] = _this.trackRef, _babelHelpers$extends2.style = _extends({}, style, { width: _this.state.trackWidth, transition: _this.state.animationMS > 0 ? 'transform ' + (_this.state.transitionDirection === 1 ? _this.state.animationMS * 2 : _this.state.animationMS) + 'ms ' + (_this.state.transitionDirection === 1 ? 'cubic-bezier(0.68, -0.55, 0.265, 1.55)' : 'ease-out') : null, transform: 'translate3d(-' + (_this.state.windowWidth * _this.state.transitionDirection + _this.state.dragOffset) + 'px, 0px, 0px)' }), _babelHelpers$extends2.onTransitionEnd = composeEventHandlers(onTransitionEnd, _this.track_handleTransitionEnd), _babelHelpers$extends2), rest); }; _this.slide_handleSwipeStart = function (e) { var posX = e.touches !== undefined ? e.touches[0].pageX : e.clientX; _this.setState({ dragging: true, touchObject: { startX: posX, curX: posX } }); }; _this.slide_handleSwipeMove = function (e) { var touchObject = _this.state.touchObject; touchObject.curX = e.touches ? e.touches[0].pageX : e.clientX; var dragOffset = Math.round(Math.sqrt(Math.pow(touchObject.curX - touchObject.startX, 2))) * (touchObject.curX > touchObject.startX ? -1 : 1); _this.setState({ dragOffset: dragOffset, touchObject: touchObject }); }; _this.slide_handleSwipeEnd = function () { if (_this.state.dragOffset > (_this.state.windowWidth > 1280 ? 250 : 100)) { _this.goToSlide(_this.nextIndex(_this.state.currentIndex)); } else if (_this.state.dragOffset < (_this.state.windowWidth > 1280 ? -250 : -100)) { _this.goToSlide(_this.prevIndex(_this.state.currentIndex)); } else if (_this.state.dragOffset !== 0) { _this.goToSlide(_this.state.currentIndex); } _this.setState({ dragging: false, dragOffset: 0, touchObject: { startX: 0, curX: 0 } }); }; _this.getNextSlideProps = function () { var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var style = _ref4.style, rest = objectWithoutProperties(_ref4, ['style']); return _extends({ key: _this.state.finalNextIndex, 'data-index': _this.state.finalNextIndex, style: _extends({}, style, { width: _this.state.windowWidth }) }, rest); }; _this.getCurrentSlideProps = function () { var _ref5 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var onMouseDown = _ref5.onMouseDown, onMouseMove = _ref5.onMouseMove, onMouseUp = _ref5.onMouseUp, onMouseLeave = _ref5.onMouseLeave, onTouchStart = _ref5.onTouchStart, onTouchMove = _ref5.onTouchMove, onTouchEnd = _ref5.onTouchEnd, onTouchCancel = _ref5.onTouchCancel, style = _ref5.style, rest = objectWithoutProperties(_ref5, ['onMouseDown', 'onMouseMove', 'onMouseUp', 'onMouseLeave', 'onTouchStart', 'onTouchMove', 'onTouchEnd', 'onTouchCancel', 'style']); return _extends({ key: _this.state.finalCurrentIndex, 'data-index': _this.state.finalCurrentIndex, onTouchStart: composeEventHandlers(_this.slide_handleSwipeStart, onTouchStart), onTouchMove: composeEventHandlers(_this.state.dragging ? _this.slide_handleSwipeMove : null, onTouchMove), onTouchEnd: composeEventHandlers(_this.slide_handleSwipeEnd, onTouchEnd), onTouchCancel: composeEventHandlers(_this.state.dragging ? _this.slide_handleSwipeEnd : null, onTouchCancel), onMouseDown: composeEventHandlers(_this.slide_handleSwipeStart, onMouseDown), onMouseMove: composeEventHandlers(_this.state.dragging ? _this.slide_handleSwipeMove : null, onMouseMove), onMouseUp: composeEventHandlers(_this.slide_handleSwipeEnd, onMouseUp), onMouseLeave: composeEventHandlers(_this.state.dragging ? _this.slide_handleSwipeEnd : null, onMouseLeave), style: _extends({}, style, { width: _this.state.windowWidth }) }, rest); }; _this.getPrevSlideProps = function () { var _ref6 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var style = _ref6.style, rest = objectWithoutProperties(_ref6, ['style']); return _extends({ key: _this.state.finalPrevIndex, 'data-index': _this.state.finalPrevIndex, style: _extends({}, style, { width: _this.state.windowWidth }) }, rest); }; _this.prevButton_handleClick = function () { _this.goToSlide(_this.prevIndex(_this.state.currentIndex)); }; _this.getPrevButtonProps = function () { var _ref7 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var onClick = _ref7.onClick, rest = objectWithoutProperties(_ref7, ['onClick']); return _extends({ type: 'button', 'data-role': 'none', onClick: composeEventHandlers(onClick, _this.prevButton_handleClick) }, rest); }; _this.nextButton_handleClick = function () { _this.goToSlide(_this.nextIndex(_this.state.currentIndex)); }; _this.getNextButtonProps = function () { var _ref8 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var onClick = _ref8.onClick, rest = objectWithoutProperties(_ref8, ['onClick']); return _extends({ type: 'button', 'data-role': 'none', onClick: composeEventHandlers(onClick, _this.nextButton_handleClick) }, rest); }; _this.getIndicatorListProps = function () { var _ref9 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var rest = objectWithoutProperties(_ref9, []); return _extends({}, rest); }; _this.indicator_makeHandleClick = function (idx) { return function () { _this.goToSlide(idx, true); }; }; _this.getIndicatorProps = function () { var _ref10 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var onClick = _ref10.onClick, index = _ref10.index, rest = objectWithoutProperties(_ref10, ['onClick', 'index']); return _extends({ tabindex: index === _this.state.currentIndex ? '-1' : null, onClick: composeEventHandlers(onClick, _this.indicator_makeHandleClick(index)) }, rest); }; _this.state = { focused: true, prevIndex: _this.props.slideCount - 1, currentIndex: 0, nextIndex: 1, finalPrevIndex: _this.props.slideCount - 1, finalCurrentIndex: 0, finalNextIndex: 1, windowWidth: 0, trackWidth: 0, dragOffset: 0, transitionDirection: 1 }; _this.running = false; return _this; } Carousel.prototype.componentDidMount = function componentDidMount() { this.calculateSizes(); window.addEventListener('resize', this.resize, false); document.addEventListener('visibilitychange', this.handleVisibilityChange, false); document.addEventListener('keydown', this.keydown, false); if (this.props.autoPlay) { this.now = clock.now(); this.play(); } }; Carousel.prototype.componentWillUnmount = function componentWillUnmount() { window.removeEventListener('resize', this.resize, false); document.removeEventListener('visibilitychange', this.handleVisibilityChange, false); document.removeEventListener('keydown', this.keydown, false); }; Carousel.prototype.getStateAndHelpers = function getStateAndHelpers() { var getRootProps = this.getRootProps, getWindowProps = this.getWindowProps, getTrackProps = this.getTrackProps, getPrevSlideProps = this.getPrevSlideProps, getCurrentSlideProps = this.getCurrentSlideProps, getNextSlideProps = this.getNextSlideProps, getPrevButtonProps = this.getPrevButtonProps, getNextButtonProps = this.getNextButtonProps, getIndicatorListProps = this.getIndicatorListProps, getIndicatorProps = this.getIndicatorProps, goToSlide = this.goToSlide, nextIndex = this.nextIndex, prevIndex = this.prevIndex; return { // props getRootProps: getRootProps, getWindowProps: getWindowProps, getTrackProps: getTrackProps, getPrevSlideProps: getPrevSlideProps, getCurrentSlideProps: getCurrentSlideProps, getNextSlideProps: getNextSlideProps, getPrevButtonProps: getPrevButtonProps, getNextButtonProps: getNextButtonProps, getIndicatorListProps: getIndicatorListProps, getIndicatorProps: getIndicatorProps, // fnunctional helpers goToSlide: goToSlide, getNextIndex: nextIndex, getPrevIndex: prevIndex, // state helpers dragOffset: this.state.dragOffset, slideCount: this.props.slideCount, finalPrevIndex: this.state.finalPrevIndex, finalCurrentIndex: this.state.finalCurrentIndex, finalNextIndex: this.state.finalNextIndex, prevIndex: this.state.prevIndex, currentIndex: this.state.currentIndex, nextIndex: this.state.nextIndex, // can be used by indicators to show progress startTime: this.now }; }; Carousel.prototype.render = function render() { var children = unwrapArray(this.props.render || this.props.children, noop); var element = unwrapArray(children(this.getStateAndHelpers())); if (!element) { return null; } return element; }; return Carousel; }(react.Component); Carousel$1.defaultProps = { animationDuration: 250, slideDuration: 0, calculateWidth: function calculateWidth(context) { return context._windowRef.offsetWidth; }, dynamicSizes: false, autoPlay: true }; Carousel$1.propTypes = { children: propTypes.func, render: propTypes.func, animationDuration: propTypes.number, calculateWidth: propTypes.func, dynamicSizes: propTypes.bool, slideDuration: propTypes.number, slideCount: propTypes.number.isRequired, autoPlay: propTypes.bool }; Carousel$1.default = Carousel$1; return Carousel$1; }))); //# sourceMappingURL=react-horizontal-carousel.umd.js.map
const express = require('express'); const status = require('http-status'); module.exports = function(messages){ var router = express.Router(); router.get('/:id',function(req,res){ messages.read(req.params.id,function(err,doc){ if(err) return res.sendStatus(status.BAD_REQUEST); if(doc) return res.send(doc); else return res.sendStatus(status.NOT_FOUND); }); }); return router; };
export { default } from 'ember-paper-react/components/r-paper-dialog-content-text';
/** * Copyright 2015 Telerik AD * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ (function(f, define){ define([], f); })(function(){ (function( window, undefined ) { var kendo = window.kendo || (window.kendo = { cultures: {} }); kendo.cultures["hi"] = { name: "hi", numberFormat: { pattern: ["-n"], decimals: 2, ",": ",", ".": ".", groupSize: [3,2], percent: { pattern: ["-n %","n %"], decimals: 2, ",": ",", ".": ".", groupSize: [3,2], symbol: "%" }, currency: { pattern: ["$ -n","$ n"], decimals: 2, ",": ",", ".": ".", groupSize: [3,2], symbol: "₹" } }, calendars: { standard: { days: { names: ["रविवार","सोमवार","मंगलवार","बुधवार","गुरुवार","शुक्रवार","शनिवार"], namesAbbr: ["रवि.","सोम.","मंगल.","बुध.","गुरु.","शुक्र.","शनि."], namesShort: ["र","स","म","ब","ग","श","श"] }, months: { names: ["जनवरी","फरवरी","मार्च","अप्रैल","मई","जून","जुलाई","अगस्त","सितम्बर","अक्तूबर","नवम्बर","दिसम्बर",""], namesAbbr: ["जनवरी","फरवरी","मार्च","अप्रैल","मई","जून","जुलाई","अगस्त","सितम्बर","अक्तूबर","नवम्बर","दिसम्बर",""] }, AM: ["पूर्वाह्न","पूर्वाह्न","पूर्वाह्न"], PM: ["अपराह्न","अपराह्न","अपराह्न"], patterns: { d: "dd-MM-yyyy", D: "dd MMMM yyyy", F: "dd MMMM yyyy HH:mm:ss", g: "dd-MM-yyyy HH:mm", G: "dd-MM-yyyy HH:mm:ss", m: "dd MMMM", M: "dd MMMM", s: "yyyy'-'MM'-'dd'T'HH':'mm':'ss", t: "HH:mm", T: "HH:mm:ss", u: "yyyy'-'MM'-'dd HH':'mm':'ss'Z'", y: "MMMM, yyyy", Y: "MMMM, yyyy" }, "/": "-", ":": ":", firstDay: 1 } } } })(this); return window.kendo; }, typeof define == 'function' && define.amd ? define : function(_, f){ f(); });
// Action Cable provides the framework to deal with WebSockets in Rails. // You can generate new channels where WebSocket features live using the `rails generate channel` command. // //= require action_cable //= require_self (function() { this.App || (this.App = {}); App.cable = ActionCable.createConsumer(); }).call(this);
/** * @license * Visual Blocks Language * * Copyright 2012 Google Inc. * https://blockly.googlecode.com/ * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @fileoverview Generating cake for loop blocks. * @author fraser@google.com (Neil Fraser) */ 'use strict'; goog.provide('Blockly.cake.loops'); goog.require('Blockly.cake'); Blockly.cake['controls_whileUntil'] = function(block) { // Do while/until loop. var until = block.getFieldValue('MODE') == 'UNTIL'; var argument0 = Blockly.cake.valueToCode(block, 'BOOL', until ? Blockly.cake.ORDER_LOGICAL_NOT : Blockly.cake.ORDER_NONE) || '0'; var branch = Blockly.cake.statementToCode(block, 'DO'); branch = Blockly.cake.addLoopTrap(branch, block.id); if (until) { argument0 = '!' + argument0; } return 'while (' + argument0 + ') {\n' + branch + '}\n'; }; Blockly.cake['controls_doWhile'] = function(block) { // Do while/until loop. var until = block.getFieldValue('MODE') == 'UNTIL'; var argument0 = Blockly.cake.valueToCode(block, 'BOOL', until ? Blockly.cake.ORDER_LOGICAL_NOT : Blockly.cake.ORDER_NONE) || '0'; var branch = Blockly.cake.statementToCode(block, 'DO'); branch = Blockly.cake.addLoopTrap(branch, block.id); if (until) { argument0 = '!' + argument0; } return 'do {\n' + branch + '} while (' + argument0 + ');\n'; }; Blockly.cake['controls_for'] = function(block) { // For loop. var variable0 = Blockly.cake.variableDB_.getName( block.getFieldValue('VAR'), Blockly.Variables.NAME_TYPE); if(variable0 == '___EC_84_A0_ED_83_9D__' || variable0 == '--Select--'){ variable0 = 'unselected'; } var argument0 = Blockly.cake.valueToCode(block, 'FROM', Blockly.cake.ORDER_ASSIGNMENT) || '0'; var argument1 = Blockly.cake.valueToCode(block, 'TO', Blockly.cake.ORDER_ASSIGNMENT) || '0'; var increment = Blockly.cake.valueToCode(block, 'BY', Blockly.cake.ORDER_ASSIGNMENT) || '1'; var branch = Blockly.cake.statementToCode(block, 'DO'); branch = Blockly.cake.addLoopTrap(branch, block.id); var code; // All arguments are simple numbers. code = 'for (' + variable0 + ' = ' + argument0 + '; ' + variable0 + '<' + argument1 + '; ' + variable0; var up = increment >= 0; var step = Math.abs(parseFloat(increment)); if (step == 1) { code += up ? '++' : '--'; } else { code += (up ? ' += ' : ' -= ') + step; } code += ') {\n' + branch + '}\n'; return code; }; Blockly.cake['controls_flow_statements'] = function(block) { // Flow statements: continue, break. switch (block.getFieldValue('FLOW')) { case 'BREAK': return 'break;\n'; case 'CONTINUE': return 'continue;\n'; } throw 'Unknown flow statement.'; };
var $NODE = 0; /** Object for the GameOfLife. */ function GameOfLife(cols, rows) { this.cols = cols; this.rows = rows; this.cells = cols*rows; this.board = []; this.adjacent = {}; var that = this; var xyToNum = function(x, y) { var result = (x + y * that.cols); //console.log("For x " + x + " y " + y + " cols " + that.cols + " returning " + result); return result; }; this.randomize = function() { for (var i = 0; i < this.board.length; i++) { var randNum = Math.floor(Math.random() * 100); this.board[i] = randNum % 2 === 0 ? true : false; } }; this.clear = function() { for (var i = 0; i < this.board.length; i++) { this.board[i] = false; } }; this.getRow = function(row) { var coord = xyToNum(0, row); return this.board.slice(coord, coord + this.cols); }; this.setXY = function(x, y, val) { var coord = xyToNum(x, y); this.board[coord] = val; }; this.getXY = function(x,y) { var coord = xyToNum(x, y); //console.log("Returning " + this.board[coord]); return this.board[coord]; }; this.getX = function(coord) { if (coord < this.cells) { return coord % this.cols; } else { console.error("coord " + coord + " out of bounds."); } }; this.getY = function(coord) { if (coord < this.cells) { return Math.floor(coord / this.cols); } else { console.error("coord " + coord + " out of bounds."); } }; this.getAdjacentAlive = function(coord) { var adjacent = this.adjacent[coord]; var res = 0; for (var i = 0; i < adjacent.length; i++) { if (this.board[adjacent[i]] === true) { ++res; } } return res; }; /** Generates all adjacent squares for given coordinated. This method has a * lot of border cases so it's rather lengthy. * */ this.getAdjacent = function(coord) { var adjacent = []; var x = this.getX(coord); var y = this.getY(coord); // Special cases: // Row 0 // and col 0 // and col 'last' // Row 'last' // and col 0 // and col 'last' // // Col 0 // Col 'last' var nextRow = coord + this.cols; var prevRow = coord - this.cols; if (x !== 0) { // not first col adjacent.push(coord - 1); if(y !== 0) adjacent.push(prevRow - 1); if(y !== this.rows - 1) adjacent.push(nextRow - 1); } if (x !== this.cols - 1) { adjacent.push(coord + 1); if(y !== 0) adjacent.push(prevRow + 1); if(y !== this.rows - 1) adjacent.push(nextRow + 1); } if (y !== 0) adjacent.push(prevRow); if (y !== this.rows - 1) adjacent.push(nextRow); return adjacent; }; for (var i = 0; i < this.cells; i++) { this.board.push(false); this.adjacent[i] = this.getAdjacent(i); } /** Given current cell value, and number of adjacent cells alive, returns * the next state for the cell. */ this.nextCellState = function(currVal, numAlive) { if (numAlive < 2) return false; if (numAlive === 2) return currVal; if (numAlive === 3) return true; return false; }; /** Advances the game to the next state.*/ this.nextState = function() { var nextBoard = []; for (var i = 0; i < this.board.length; i++) { var numAlive = this.getAdjacentAlive(i); nextBoard.push(this.nextCellState(this.board[i], numAlive)); } this.board = nextBoard; }; this.print = function() { }; } if ($NODE) { module.exports = GameOfLife; }
/** * Auto-generated action file for "AWS MediaConnect" API. * * Generated at: 2019-05-07T14:35:57.217Z * Mass generator version: 1.1.0 * * flowground :- Telekom iPaaS / amazonaws-com-mediaconnect-connector * Copyright © 2019, Deutsche Telekom AG * contact: flowground@telekom.de * * All files of this connector are licensed under the Apache 2.0 License. For details * see the file LICENSE on the toplevel directory. * * * Operation: 'UpdateFlowSource' * Endpoint Path: '/v1/flows/{flowArn}/source/{sourceArn}' * Method: 'put' * */ const Swagger = require('swagger-client'); const processWrapper = require('../services/process-wrapper'); const spec = require('../spec.json'); // this wrapers offers a simplified emitData(data) function module.exports.process = processWrapper(processAction); // parameter names for this call const PARAMETERS = [ "flowArn", "sourceArn", "X-Amz-Content-Sha256", "X-Amz-Date", "X-Amz-Algorithm", "X-Amz-Credential", "X-Amz-Security-Token", "X-Amz-Signature", "X-Amz-SignedHeaders" ]; // mappings from connector field names to API field names const FIELD_MAP = { "flowArn": "flowArn", "sourceArn": "sourceArn", "X_Amz_Content_Sha256": "X-Amz-Content-Sha256", "X_Amz_Date": "X-Amz-Date", "X_Amz_Algorithm": "X-Amz-Algorithm", "X_Amz_Credential": "X-Amz-Credential", "X_Amz_Security_Token": "X-Amz-Security-Token", "X_Amz_Signature": "X-Amz-Signature", "X_Amz_SignedHeaders": "X-Amz-SignedHeaders", "Algorithm": "Algorithm", "KeyType": "KeyType", "RoleArn": "RoleArn", "SecretArn": "SecretArn", "Decryption": "Decryption", "Description": "Description", "EntitlementArn": "EntitlementArn", "IngestPort": "IngestPort", "MaxBitrate": "MaxBitrate", "MaxLatency": "MaxLatency", "Protocol": "Protocol", "StreamId": "StreamId", "WhitelistCidr": "WhitelistCidr", "requestBody": "requestBody" }; function processAction(msg, cfg) { var isVerbose = process.env.debug || cfg.verbose; if (isVerbose) { console.log(`---MSG: ${JSON.stringify(msg)}`); console.log(`---CFG: ${JSON.stringify(cfg)}`); console.log(`---ENV: ${JSON.stringify(process.env)}`); } const contentType = 'application/json'; const body = msg.body; mapFieldNames(body); let parameters = {}; for(let param of PARAMETERS) { parameters[param] = body[param]; } // credentials for this operation let securities = {}; securities['hmac'] = cfg['hmac']; let callParams = { spec: spec, operationId: 'UpdateFlowSource', pathName: '/v1/flows/{flowArn}/source/{sourceArn}', method: 'put', parameters: parameters, requestContentType: contentType, requestBody: body.requestBody, securities: {authorized: securities}, server: spec.servers[cfg.server] || cfg.otherServer, }; if (isVerbose) { let out = Object.assign({}, callParams); out.spec = '[omitted]'; console.log(`--SWAGGER CALL: ${JSON.stringify(out)}`); } // Call operation via Swagger client return Swagger.execute(callParams).then(data => { // emit a single message with data this.emitData(data); // if the response contains an array of entities, you can emit them one by one: // data.obj.someItems.forEach((item) => { // this.emitData(item); // } }); } function mapFieldNames(obj) { if(Array.isArray(obj)) { obj.forEach(mapFieldNames); } else if(typeof obj === 'object' && obj) { Object.keys(obj).forEach(key => { mapFieldNames(obj[key]); let goodKey = FIELD_MAP[key]; if(goodKey && goodKey !== key) { obj[goodKey] = obj[key]; delete obj[key]; } }); } }
import template from './rmVideo.html'; import controller from './rmVideo.controller'; import './rmVideo.scss'; let rmVideoComponent = { restrict: 'E', bindings: {}, template, controller, controllerAs: 'vm' }; export default rmVideoComponent;
/* Make a CLI that concatenates all the strings given with the given delimiter E.g node concatenate.js ; string1 string2 string3 node concatenate.js delimiter ...strings (this means any amount of arguments) string1;string2;string3 */ const args = process.argv.slice(2); // We need minimum 3 arguments, delimiter and 2 strings if (args.length < 3) { console.error( "Error: Program requires at least 3 arguments: delimiter string1 string2" ); process.exit(9); } /* The following syntax means: Put the first element in the array args in the const variable "delimiter" Put the rest of elements of the array args (from index 1 until the end) in the variable strings */ const [delimiter, ...strings] = args; /* The .join method of an array puts all elements of the array together in one string joined by the string passed. In this case we pass the "delimiter" */ console.log(strings.join(delimiter));
/*! * Bootstrap-select v1.7.4 (http://silviomoreto.github.io/bootstrap-select) * * Copyright 2013-2015 bootstrap-select * Licensed under MIT (https://github.com/silviomoreto/bootstrap-select/blob/master/LICENSE) */ (function (root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module unless amdModuleId is set define(["jquery"], function (a0) { return (factory(a0)); }); } else if (typeof exports === 'object') { // Node. Does not work with strict CommonJS, but // only CommonJS-like environments that support module.exports, // like Node. module.exports = factory(require("jquery")); } else { factory(jQuery); } }(this, function (jQuery) { (function ($) { $.fn.selectpicker.defaults = { noneSelectedText: 'Hiçbiri seçilmedi', noneResultsText: 'Hiçbir sonuç bulunamadı {0}', countSelectedText: function (numSelected, numTotal) { return (numSelected == 1) ? "{0} öğe seçildi" : "{0} öğe seçildi"; }, maxOptionsText: function (numAll, numGroup) { return [ (numAll == 1) ? 'Limit aşıldı (maksimum {n} sayıda öğe )' : 'Limit aşıldı (maksimum {n} sayıda öğe)', (numGroup == 1) ? 'Grup limiti aşıldı (maksimum {n} sayıda öğe)' : 'Grup limiti aşıldı (maksimum {n} sayıda öğe)' ]; }, selectAllText: 'Tümünü Seç', deselectAllText: 'Seçiniz', multipleSeparator: ', ' }; })(jQuery); }));
export { default } from 'ember-data-visualizations/components/pie-chart/component';
(function (app) { let Check = function (id) { if (!id) { throw "Check的id不能为空" } this.ID = id this.Level = 0 this.Command = "" this.IntervalParam = "" this.LastID = "" } Check.prototype.WithLevel = function (level) { this.Level = level return this } Check.prototype.WithCommand = function (command) { this.Command = command return this } Check.prototype.WithIntervalParam = function (param) { this.IntervalParam = param return this } Check.prototype.WithLastID = function (id) { this.LastID = id return this } Check.prototype.Execute = function (force) { if (!force) { if (this.IntervalParam && this.LastID) { if (!After(app.Data[this.LastID], app.GetNumberParam(this.IntervalParam))) { return false } } } app.Send(this.Command) return true } Check.prototype.Callback = function () { let self=this return function (data) { if (self.Level < data.Level) { return false } if (data.ID) { if (data.ID == this.ID) { return self.Execute(true) } return false } return self.Execute(false) } } return Check })(App)
/*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ function e(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))}function t(e,t){return"string"!=typeof e?(console.warn("Trying to test a non string variable"),!1):0===e.indexOf(t)}var r;!function(e){e.blockcypher="blockcypher",e.blockstream="blockstream",e.etherscan="etherscan"}(r||(r={}));var n;function i(e){return e===n.V3_0_alpha}!function(e){e.V1_1="1.1",e.V1_2="1.2",e.V2_0="2.0",e.V3_0_alpha="3.0-alpha"}(n||(n={}));var o=n;const a={formatValidation:{label:"Format validation",labelPending:"Validating format",subSteps:[]},hashComparison:{label:"Hash comparison",labelPending:"Comparing hash",subSteps:[]},statusCheck:{label:"Status check",labelPending:"Checking record status",subSteps:[]}};var s=Object.freeze({__proto__:null,final:"final",formatValidation:"formatValidation",hashComparison:"hashComparison",statusCheck:"statusCheck",language:a}),c={"en-US":{steps:{formatValidationLabel:"Format validation",formatValidationLabelPending:"Validating format",hashComparisonLabel:"Hash comparison",hashComparisonLabelPending:"Comparing hash",statusCheckLabel:"Status check",statusCheckLabelPending:"Checking record status"},subSteps:{getTransactionIdLabel:"Get transaction ID",getTransactionIdLabelPending:"Getting transaction ID",computeLocalHashLabel:"Compute local hash",computeLocalHashLabelPending:"Computing local hash",fetchRemoteHashLabel:"Fetch remote hash",fetchRemoteHashLabelPending:"Fetching remote hash",getIssuerProfileLabel:"Get issuer profile",getIssuerProfileLabelPending:"Getting issuer profile",parseIssuerKeysLabel:"Parse issuer keys",parseIssuerKeysLabelPending:"Parsing issuer keys",compareHashesLabel:"Compare hashes",compareHashesLabelPending:"Comparing hashes",checkMerkleRootLabel:"Check Merkle Root",checkMerkleRootLabelPending:"Checking Merkle Root",checkReceiptLabel:"Check Receipt",checkReceiptLabelPending:"Checking Receipt",checkIssuerSignatureLabel:"Check Issuer Signature",checkIssuerSignatureLabelPending:"Checking Issuer Signature",checkAuthenticityLabel:"Check Authenticity",checkAuthenticityLabelPending:"Checking Authenticity",checkRevokedStatusLabel:"Check Revoked Status",checkRevokedStatusLabelPending:"Checking Revoked Status",checkExpiresDateLabel:"Check Expiration Date",checkExpiresDateLabelPending:"Checking Expiration Date"},revocation:{preReason:"Reason given:",reason:"This certificate has been revoked by the issuer."},success:{mocknet:{label:"This Mocknet credential passed all checks",description:"Mocknet credentials are used for test purposes only. They are not recorded on a blockchain, and they should not be considered verified Blockcerts."},blockchain:{label:"Verified",description:"This is a valid ${chain} certificate.",linkText:"View transaction link"}},errors:{certificateNotValid:"This is not a valid certificate",checkEtherScanConfirmations:"Number of transaction confirmations were less than the minimum required, according to EtherScan API",couldNotConfirmTx:"Could not confirm the transaction",ensureHashesEqual:"Computed hash does not match remote hash",ensureIssuerSignature:"Issuer key does not match derived address.",ensureMerkleRootEqual:"Merkle root does not match remote hash.",ensureNotExpired:"This certificate has expired.",ensureValidReceipt:"The receipt is malformed. There was a problem navigating the merkle tree in the receipt.",failedJsonLdNormalization:"Failed JSON-LD normalization",foundUnmappedFields:"Found unmapped fields during JSON-LD normalization",getCaseInsensitiveKey:"Transaction occurred at time when issuing address was not considered valid.",getChain:"Didn't recognize chain value",getIssuerProfile:"Unable to get issuer profile",getRevokedAssertions:"Unable to get revocation assertions",getTransactionId:"Cannot verify this certificate without a transaction ID to compare against.",invalidMerkleReceipt:"Invalid Merkle Receipt. Proof hash did not match Merkle root",invalidMerkleVersion:"Merkle version used for signature is incompatible with Blockcerts version.",isTransactionIdValid:"Cannot verify this certificate without a transaction ID to compare against.",issuerProfileNotSet:"no issuer address given",issuerProfileInvalid:"retrieved file does not seem to be a valid profile",lookForTxCouldNotConfirm:"Could not confirm the transaction. No blockchain apis returned a response. This could be because of rate limiting.",lookForTxDifferentAddresses:"Issuing addresses returned by the blockchain APIs were different",lookForTxDifferentRemoteHashes:"Remote hashes returned by the blockchain APIs were different",lookForTxInvalidAppConfig:"Invalid application configuration; check the CONFIG.MinimumBlockchainExplorers configuration value",lookForTxInvalidChain:"Invalid chain; does not map to known BlockchainExplorers.",parseBlockCypherResponse:"Number of transaction confirmations were less than the minimum required, according to Blockcypher API",parseBlockstreamResponse:"Number of transaction confirmations were less than the minimum required, according to Blockstream API",parseIssuerKeys:"Unable to parse JSON out of issuer identification data.",unableToGetRemoteHash:"Unable to get remote hash"}},fr:{steps:{formatValidationLabel:"Validation du format",formatValidationLabelPending:"Validation du format",hashComparisonLabel:"Comparaison du hash",hashComparisonLabelPending:"Comparaison du hash",statusCheckLabel:"Vérification du status",statusCheckLabelPending:"Vérification du status"},subSteps:{getTransactionIdLabel:"Obtention de l'identifiant de transaction",getTransactionIdLabelPending:"Obtention de l'identifiant de transaction",computeLocalHashLabel:"Calcul du hash local",computeLocalHashLabelPending:"Calcul du hash local",fetchRemoteHashLabel:"Récupération du hash distant",fetchRemoteHashLabelPending:"Récupération du hash distant",getIssuerProfileLabel:"Obtention du profil de l'émetteur",getIssuerProfileLabelPending:"Obtention du profil de l'émetteur",parseIssuerKeysLabel:"Traitement des clés de l'émetteur",parseIssuerKeysLabelPending:"Traitement des clés de l'émetteur",compareHashesLabel:"Comparaison des hash",compareHashesLabelPending:"Comparaison des hashs",checkMerkleRootLabel:"Vérification du Merkle Root",checkMerkleRootLabelPending:"Vérification du Merkle Root",checkReceiptLabel:"Vérification du reçu",checkReceiptLabelPending:"Vérification du reçu",checkIssuerSignatureLabel:"Vérification de la signature de l'émetteur",checkIssuerSignatureLabelPending:"Vérification de la signature de l'émetteur",checkAuthenticityLabel:"Vérification de l'authenticité",checkAuthenticityLabelPending:"Vérification de l'authenticité",checkRevokedStatusLabel:"Vérification du status de révocation",checkRevokedStatusLabelPending:"Vérification du status de révocation",checkExpiresDateLabel:"Vérification de la date d'expiration",checkExpiresDateLabelPending:"Vérification de la date d'expiration"},revocation:{preReason:"Raison :",reason:"Ce certificat a été révoqué par l'émetteur."},success:{mocknet:{label:"Cet enregistrement Mocknet a été vérifié",description:"Le mode Mocknet est utilisé à des fins de tests uniquement. Ce Blockcert n'a pas été enregistré sur une blockchain, et en tant que tel ne peut pas être considéré un Blockcert valide."},blockchain:{label:"Vérifié",description:"Ceci est un certificat ${chain} valide.",linkText:"Voir la transaction"}},errors:{certificateNotValid:"Certificat invalide",checkEtherScanConfirmations:"Le nombre de confirmations de transaction n'atteint pas le minimum requis, d'après l'API EtherScan",couldNotConfirmTx:"Impossible de confirmer la transaction",ensureHashesEqual:"Calcul du hash local différent du hash distant",ensureIssuerSignature:"La clé de l'émetteur ne correspond pas à l'adresse dérivée",ensureMerkleRootEqual:"Le Merkle root ne correspond pas au hash distant",ensureNotExpired:"Certificat expiré",ensureValidReceipt:"Erreur d'écriture du reçu. Un problème est survenu lors de la navigation de l'arbre Merkle du reçu.",failedJsonLdNormalization:"Erreur de normalisation JSON-LD",foundUnmappedFields:"Champs non liés découverts durant la normalisation JSON-LD",getCaseInsensitiveKey:"Transaction émise lorsque l'adresse de l'émetteur était considérée invalide",getChain:"Valeur de chaine non reconnue",getIssuerProfile:"Profil de l'émetteur indisponible",getRevokedAssertions:"Impossible d'obtenir les raisons de revocation",getTransactionId:"Impossible de vérifier ce certificat sans un identifiant de transaction valide",invalidMerkleReceipt:"Reçu Merkle invalide. Hash de preuve différent du Merkle root",invalidMerkleVersion:"La version du Merkle utilisé est incompatible avec la version Blockcerts.",isTransactionIdValid:"Impossible de vérifier ce certificat sans un identifiant de transaction valide",issuerProfileNotSet:"l'URL de l'émetteur n'est pas définie",issuerProfileInvalid:"le document distant ne semble pas être un profil d'émetteur valide",lookForTxCouldNotConfirm:"Impossible de confirmer la transaction. Aucune API blockchain n'a répondu. Potentiellement dû à une limite de débit réseau.",lookForTxDifferentAddresses:"Les adresses d'émission reçues de l'API blockchain ne concordent pas",lookForTxDifferentRemoteHashes:"Les hashs distants reçus de l'API blockchain ne concordent pas",lookForTxInvalidAppConfig:"Configuration de l'application invalide : vérifiez la valeur de configuration de CONFIG.MinimumBlockchainExplorers",lookForTxInvalidChain:"Chaine invalide : non liée à un BlockchainExplorers connu",parseBlockCypherResponse:"Le nombre de confirmations de transaction n'atteint pas le minimum requis, d'après l'API Blockcypher",parseBlockstreamResponse:"Le nombre de confirmations de transaction n'atteint pas le minimum requis, d'après l'API Blockstream",parseIssuerKeys:"Impossible de lire le JSON d'identification de l'émetteur",unableToGetRemoteHash:"Impossible d'obtenir le hash distant"}},es:{steps:{formatValidationLabel:"Validación de formato",formatValidationLabelPending:"Validando el formato",hashComparisonLabel:"Comparación de cadena binaria",hashComparisonLabelPending:"Comparando cadena binaria",statusCheckLabel:"Estado de Verificación",statusCheckLabelPending:"Verificando Estado de Grabación"},subSteps:{getTransactionIdLabel:"Obtener Identificación de Transacción",getTransactionIdLabelPending:"Obteniendo Identificación de Transacción",computeLocalHashLabel:"Calcular cadena binaria local",computeLocalHashLabelPending:"Calculando cadena binaria local",fetchRemoteHashLabel:"Obtener cadena binaria remota",fetchRemoteHashLabelPending:"Obeniendo cadena binaria remota",getIssuerProfileLabel:"Obtener perfil de emisor",getIssuerProfileLabelPending:"Obteniendo perfil de emisor",parseIssuerKeysLabel:"Analizar claves del emisor",parseIssuerKeysLabelPending:"Analizando claves del emisor",compareHashesLabel:"Comparar cadenas binarias",compareHashesLabelPending:"Comparando cadenas binarias",checkMerkleRootLabel:"Verificar Merkle Root",checkMerkleRootLabelPending:"Verificando Merkle Root",checkReceiptLabel:"Verificar Recibo",checkReceiptLabelPending:"Verificando Recibo",checkIssuerSignatureLabel:"Verificar Firma del Emisor",checkIssuerSignatureLabelPending:"Verificando Firma del Emisor",checkAuthenticityLabel:"Verificar Autenticidad",checkAuthenticityLabelPending:"Verificando Autenticidad",checkRevokedStatusLabel:"Verificar Estado de Revocación",checkRevokedStatusLabelPending:"Verificando Estado de Revocación",checkExpiresDateLabel:"Verificar Fechas de Expiración",checkExpiresDateLabelPending:"Verificando Fechas de Expiración"},revocation:{preReason:"Razón dada:",reason:"Este certificado ha sido revocado por el emisor"},success:{mocknet:{label:"Esta credencial de Mocknet pasó todas las comprobaciones",description:"Las credenciales de Mocknet se usan solo con fines de prueba. No se graban en una cadena de bloques, y no se deben considerar Blockcerts Verificados."},blockchain:{label:"Verificado",description:"Este es un certificado válido de ${chain}.",linkText:"Ver enlace de transacción"}},errors:{certificateNotValid:"Este no es un certificado válido",checkEtherScanConfirmations:"El número de transacciones confirmadas son menores que el mínimo requerido, de acuerdo al API EtherScan",couldNotConfirmTx:"No se ha podido confirmar la transacción",ensureHashesEqual:"La cadena binaria calculada no corresponde con la cadena binaria remota",ensureIssuerSignature:"La llave del emisor no corresponde con la dirección obtenida",ensureMerkleRootEqual:"La raíz Merkle no corresponde con la cadena binaria remota",ensureNotExpired:"Este certificado ha expirado",ensureValidReceipt:"El recibo está malformado. Hubo un problema navegando el árbol Merkle en el recibo",failedJsonLdNormalization:"La normalización del JSON-LD ha fallado",foundUnmappedFields:"Se han encontrado campos no mapeados durante la normalización de JSON-LD",getCaseInsensitiveKey:"La dirección emisora no era considerada válida cuando la transacción ocurrió",getChain:"Valor de cadena no reconocido",getIssuerProfile:"No se ha podido obtener el perfil del emisor",getRevokedAssertions:"No se ha podido obtener aseveraciones de revocación",getTransactionId:"No se puede verificar este certificado sin una identificación de transacción que sirva como comparación",invalidMerkleReceipt:"Recibo Merkle inválido. La cadena binaria de prueba no corresponde con la raíz Merkle",invalidMerkleVersion:"Merkle version used for signature is incompatible with Blockcerts version.",isTransactionIdValid:"No se puede verificar este certificado sin una identificación de transacción que sirva como comparación",issuerProfileNotSet:"URL del emisor no definido",issuerProfileInvalid:"el documento recogido no parece ser un perfil de emisor valido",lookForTxCouldNotConfirm:"No se ha podido confirmar la transacción. Ninguna del las APIs de blockchain generó una respuesta. Esto puede ser causado por limitaciones de tasa.",lookForTxDifferentAddresses:"Las direcciones emisoras generadas por las APIs del blockchain son distintas",lookForTxDifferentRemoteHashes:"Las cadenas binarias remotas generadas por las APIs del blockchain son distintas",lookForTxInvalidAppConfig:"Configuración de aplicación inválida; cheque el valor de configuración CONFIG.MinimumBlockchainExplorers",lookForTxInvalidChain:"Cadena inválida; no corresponde a BlockchainExplorers reconocidos",parseBlockCypherResponse:"El número de transacciones confirmadas son menores que el mínimo requerido, de acuerdo al API Blockcypher",parseBlockstreamResponse:"El número de transacciones confirmadas son menores que el mínimo requerido, de acuerdo al API Blockstream",parseIssuerKeys:"No se ha podido analizar el JSON de la información de identificación del emisor",unableToGetRemoteHash:"No se ha podido obtener la cadena binaria remota"}},mt:{steps:{formatValidationLabel:"Validazzjoni tal-format",formatValidationLabelPending:"Il-format qed jiġi vvalidat",hashComparisonLabel:"Paragun tal-Hash",hashComparisonLabelPending:"Il-hash qed jiġi pparagunat",statusCheckLabel:"Status check",statusCheckLabelPending:"Ir-record status qed jiġi ċċekkjat"},subSteps:{getTransactionIdLabel:"Ikseb l-ID ta' tranżazzjoni",getTransactionIdLabelPending:"L-ID ta' tranżazzjoni qed tiġi mniżżla",computeLocalHashLabel:"Ikkalkula l-hash lokali",computeLocalHashLabelPending:"Il-hash lokali qed jiġi kkalkulat",fetchRemoteHashLabel:"Fittex ir-remote hash",fetchRemoteHashLabelPending:"Ir-remote hash qed jiġi mfittex",getIssuerProfileLabel:"Ikseb il-profil tal-emittent",getIssuerProfileLabelPending:"Il-profil tal-emittent qed jiġi mniżżel",parseIssuerKeysLabel:"Estratta ċ-ċwievet tal-emittent",parseIssuerKeysLabelPending:"Iċ-ċwievet tal-emittent qed jiġu estratti",compareHashesLabel:"Ikkumpara l-hashes",compareHashesLabelPending:"Il-hashes qed jiġu kkomparati",checkMerkleRootLabel:"Iċċekkja l-Merkle Root",checkMerkleRootLabelPending:"Il-Merkle Root Qed Tiġi Ċċekkjata",checkReceiptLabel:"Iċċekkja l-Irċevuta",checkReceiptLabelPending:"L-Irċevuta Qed Tiġi Ċċekkjata",checkIssuerSignatureLabel:"Iċċekkja l-Firma tal-Emittent",checkIssuerSignatureLabelPending:"Il-Firma tal-Emittent Qed Tiġi Ċċekkjata",checkAuthenticityLabel:"Iċċekkja l-Awtentiċità",checkAuthenticityLabelPending:"L-Awtentiċità Qed Tiġi Ċċekkjata",checkRevokedStatusLabel:"Iċċekkja l-Istatus Revokat",checkRevokedStatusLabelPending:"L-Istatus Revokat Qed Jiġi Ċċekkjat",checkExpiresDateLabel:"Iċċekkja d-Data ta' Skadenza",checkExpiresDateLabelPending:"Id-Data ta' Skadenza Qed Tiġi Ċċekkjata"},revocation:{preReason:"Raġuni mogħtija:",reason:"Dan iċ-ċertifikat ġie revokat mill-emittent."},success:{mocknet:{label:"Din il-kredenzjali tal-Mocknet għaddiet il-kontrolli kollha",description:"Il-kredenzjali tal-Mocknet jintużaw biss għal skopijiet ta 'ttestjar. Dawn mhumiex irreġistrati fuq blockchain, u ma għandhomx jiġu kkunsidrati bħala blockcerts verifikati."},blockchain:{label:"Ivverifikat",description:"Dan huwa ċertifikat ${chain} huwa validu.",linkText:"Ara l-link tat-transazzjoni"}},errors:{certificateNotValid:"Dan mhux ċertifikat validu",checkEtherScanConfirmations:"In-numru ta' konfermi tat-tranżazzjonijiet kienu inqas mill-minimu meħtieġ, skont EtherScan API",couldNotConfirmTx:"Ma setgħetx tiġi kkonfermata t-tranżazzjoni",ensureHashesEqual:"Il-hash ikkalkulat ma jikkorrispondix mar-remote hash",ensureIssuerSignature:"Iċ-ċavetta tal-emittent ma taqbilx mal-indirizz derivat",ensureMerkleRootEqual:"Merkle root ma taqbilx mar-remote hash",ensureNotExpired:"Dan iċ-ċertifikat skada",ensureValidReceipt:"L-irċevuta hija malformata. Kien hemm problema fin-navigazzjoni tal-merkle tree fl-irċevuta",failedJsonLdNormalization:"In-normalizzazzjoni ta' JSON-LD ma rnexxietx",foundUnmappedFields:"Instabu unmapped fields matul in-normalizzazzjoni JSON-LD",getCaseInsensitiveKey:"It-tranżazzjoni seħħet fi żmiem meta l-indirizz tal-ħruġ ma tqiesx validu",getChain:"Iċ-chain value ma ntgħarafx",getIssuerProfile:"Mhux possibbli jinkiseb il-profil tal-emittent",getRevokedAssertions:"Mhux possibbli jinkisbu dikjarazzjonijiet revokati",getTransactionId:"Dan iċ-ċertifikat ma jistax jiġi vverifikat mingħajr ID ta' tranżazzjoni mqabbla miegħu",invalidMerkleReceipt:"Irċevuta Merkle invalida. Il-proof hash ma kienx jaqbel mal-Merkle root",invalidMerkleVersion:"Merkle version used for signature is incompatible with Blockcerts version.",isTransactionIdValid:"Dan iċ-ċertifikat ma jistax jiġi vverifikat mingħajr ID ta' tranżazzjoni mqabbla miegħu",issuerProfileNotSet:"no issuer address given",issuerProfileInvalid:"retrieved file does not seem to be a valid profile",lookForTxCouldNotConfirm:"It-tranżazzjoni ma setgħetx tiġi kkonferma. L-ebda blockchain apis ma rritorna rispons. Dan jista' jkun minħabba limitazzjoni tar-rata",lookForTxDifferentAddresses:"L-indirizzi tal-ħruġ mibgħuta lura mill-blockchain APIs kienu differenti",lookForTxDifferentRemoteHashes:"Ir-remote hashes mibgħuta lura mill-blockchain APIs kienu differenti",lookForTxInvalidAppConfig:"Konfigurazzjoni tal-applikazzjoni invalida; Iċċekkja l-valur konfigurattiv f' CONFIG.MinimumBlockchainExplorers",lookForTxInvalidChain:"Chain invalidu; BlockchainExplorers mhux qed isib chain magħrufa",parseBlockCypherResponse:"In-numru ta' konfermi tat-tranżazzjonijiet kienu inqas mill-minimu meħtieġ, skont Blockcypher API",parseBlockstreamResponse:"In-numru ta' konfermi tat-tranżazzjonijiet kienu inqas mill-minimu meħtieġ, skont Blockstream API",parseIssuerKeys:"Ma jistax jiġi estratt JSON mid-data tal-identifikazzjoni tal-emittent",unableToGetRemoteHash:"Mhux possibbli jinkiseb ir-remote hash"}},"it-IT":{steps:{formatValidationLabel:"Convalidare formato",formatValidationLabelPending:"Convalida formato",hashComparisonLabel:"Confrontare hash",hashComparisonLabelPending:"Confronta hash",statusCheckLabel:"Verificare stato",statusCheckLabelPending:"Verifica stato del record"},subSteps:{getTransactionIdLabel:"Ottenere ID transazione",getTransactionIdLabelPending:"Ottieni ID transazione",computeLocalHashLabel:"Calcolare hash locale",computeLocalHashLabelPending:"Calcola hash locale",fetchRemoteHashLabel:"Recuperare hash remoto",fetchRemoteHashLabelPending:"Recupera hash remoto",getIssuerProfileLabel:"Ottenere profilo issuer",getIssuerProfileLabelPending:"Ottieni profilo issuer",parseIssuerKeysLabel:"Analizzare chiavi issuer",parseIssuerKeysLabelPending:"Analizza chiavi issuer",compareHashesLabel:"Confrontare gli hash",compareHashesLabelPending:"Confronto hash",checkMerkleRootLabel:"Controllare radice di Merkle",checkMerkleRootLabelPending:"Controllo radice di Merkle",checkReceiptLabel:"Verificare ricevuta",checkReceiptLabelPending:"Verifica ricevuta",checkIssuerSignatureLabel:"Verificare firma Issuer",checkIssuerSignatureLabelPending:"Verifica firma Issuer",checkAuthenticityLabel:"Verificare autenticità",checkAuthenticityLabelPending:"Verifica autenticità",checkRevokedStatusLabel:"Verificare stato revocato",checkRevokedStatusLabelPending:"Verifica stato revocato",checkExpiresDateLabel:"Verificare data di scadenza",checkExpiresDateLabelPending:"Verifica data di scadenza"},revocation:{preReason:"Motivo indicato:",reason:"Questo certificato è stato revocato dall'emittente."},success:{mocknet:{label:"Questo Blockcert simulato ha superato tutti i controlli.",description:"La modalità Mocknet è utilizzata solo dagli emittenti per testare il loro flusso di lavoro localmente. Questo Blockcert non è stato registrato su una blockchain e non dovrebbe essere considerato un Blockcert verificato."},blockchain:{label:"Verificato",description:"Questo è un certificato ${chain} valido.",linkText:"Vedi la transazione"}},errors:{certificateNotValid:"Questo non è un certificato valido",checkEtherScanConfirmations:"Il numero di conferme delle transazioni era inferiore al minimo richiesto, secondo l'API EtherScan",couldNotConfirmTx:"Impossibile confermare la transazione",ensureHashesEqual:"L'hash calcolato non corrisponde all'hash remoto",ensureIssuerSignature:"La chiave dell'issuer non corrisponde all'indirizzo derivato.",ensureMerkleRootEqual:"La radice di Merkle non corrisponde all'hash remoto.",ensureNotExpired:"Questo certificato è scaduto.",ensureValidReceipt:"La ricevuta è malformata. C'è stato un problema nella navigazione dell'albero di Merkle nella ricevuta.",failedJsonLdNormalization:"Normalizzazione JSON-LD fallita",foundUnmappedFields:"Campi non mappati trovati durante la normalizzazione JSON-LD",getCaseInsensitiveKey:"La transazione è avvenuta nel momento in cui l'indirizzo di emissione non era considerato valido.",getChain:"Il valore della catena non è stato riconosciuto",getIssuerProfile:"Impossibile ottenere il profilo dell'emittente",getRevokedAssertions:"Impossibile ottenere le asserzioni di revoca",getTransactionId:"Impossibile verificare questo certificato senza un ID transazione da confrontare.",invalidMerkleReceipt:"Ricevuta Merkle non valida. L'hash di prova non corrisponde alla radice di Merkle",invalidMerkleVersion:"Merkle version used for signature is incompatible with Blockcerts version.",isTransactionIdValid:"Impossibile verificare questo certificato senza un ID transazione da confrontare.",issuerProfileNotSet:"no issuer address given",issuerProfileInvalid:"retrieved file does not seem to be a valid profile",lookForTxCouldNotConfirm:"Impossibile confermare la transazione. Nessuna API blockchain ha risposto. Potrebbe essere a causa della limitazione della velocità.",lookForTxDifferentAddresses:"Gli indirizzi di emissione restituiti dalle API blockchain erano diversi",lookForTxDifferentRemoteHashes:"Gli hash remoti restituiti dalle API blockchain erano diversi",lookForTxInvalidAppConfig:"Configurazione dell'applicazione non valida, verificare il valore di configurazione di CONFIG.MinimumBlockchainExplorers",lookForTxInvalidChain:"Catena non valida; non mappa BlockchainExplorers noti.",parseBlockCypherResponse:"Il numero di conferme delle transazioni era inferiore al minimo richiesto, secondo l'API Blockcypher",parseBlockstreamResponse:"Il numero di conferme delle transazioni era inferiore al minimo richiesto, secondo l'API Blockstream",parseIssuerKeys:"Impossibile analizzare JSON dai dati di identificazione dell'emittente.",unableToGetRemoteHash:"Impossibile ottenere l'hash remoto"}},ja:{steps:{formatValidationLabel:"フォーマットの検証",formatValidationLabelPending:"フォーマットを検証しています",hashComparisonLabel:"ハッシュの照合",hashComparisonLabelPending:"ハッシュを照合しています",statusCheckLabel:"ステータスの確認",statusCheckLabelPending:"ステータスを確認しています"},subSteps:{getTransactionIdLabel:"取引IDの取得",getTransactionIdLabelPending:"取引IDを取得しています",computeLocalHashLabel:"ローカルハッシュの算出",computeLocalHashLabelPending:"ローカルハッシュを算出しています",fetchRemoteHashLabel:"リモートハッシュのフェッチ",fetchRemoteHashLabelPending:"リモートハッシュをフェッチしています",getIssuerProfileLabel:"発行者プロフィールの取得",getIssuerProfileLabelPending:"発行者プロフィールを取得しています",parseIssuerKeysLabel:"発行者の鍵のパース",parseIssuerKeysLabelPending:"発行者の鍵をパースしています",compareHashesLabel:"ハッシュの照合",compareHashesLabelPending:"ハッシュを照合しています",checkMerkleRootLabel:"Merkle Rootの確認",checkMerkleRootLabelPending:"Merkle Rootを確認しています",checkReceiptLabel:"レシートの確認",checkReceiptLabelPending:"レシートを確認しています",checkIssuerSignatureLabel:"発行者の署名の確認",checkIssuerSignatureLabelPending:"発行者の署名を確認しています",checkAuthenticityLabel:"真正性の確認",checkAuthenticityLabelPending:"真正性を確認しています",checkRevokedStatusLabel:"取消ステータスの確認",checkRevokedStatusLabelPending:"取消ステータスを確認しています",checkExpiresDateLabel:"有効期限の確認",checkExpiresDateLabelPending:"有効期限を確認しています"},revocation:{preReason:"理由:",reason:"この証明書は発行者によって取り消されました。"},success:{mocknet:{label:"このMocknetの証明書は全てのチェックを通過しました。",description:"Mocknetの証明書はテスト用のものです。ブロックチェーンに記録されませんし、認証済みのBlockcertとして扱われません。"},blockchain:{label:"認証されました",description:"この証明書は有効な${chain}証明書です。",linkText:"取引を確認する"}},errors:{certificateNotValid:"この証明書は有効ではありません",checkEtherScanConfirmations:"EtherScan APIによると、必要最小限の取引確認の数に達しませんでした",couldNotConfirmTx:"取引を確認できませんでした",ensureHashesEqual:"算出されたハッシュがリモートハッシュと一致しませんでした",ensureIssuerSignature:"発行者の鍵が得られたアドレスと一致しませんでした",ensureMerkleRootEqual:"Merkle rootがリモートハッシュと一致しませんでした",ensureNotExpired:"この証明書の有効期限が切れています",ensureValidReceipt:"レシートが異常です。レシート内のMerkle treeを辿る際に問題が発生しました。",failedJsonLdNormalization:"JSON-LDの正規化に失敗しました",foundUnmappedFields:"JSON-LDの正規化時にマップされていないフィールドを検出しました",getCaseInsensitiveKey:"取引が発行アドレスの有効期間外に行われました",getChain:"チェーンの値を認識できませんでした",getIssuerProfile:"発行者プロフィールを取得できません",getRevokedAssertions:"取消assertionsを取得できません",getTransactionId:"照合のための取引IDがないため、この証明書を認証できません。",invalidMerkleReceipt:"Merkleレシートが無効です。証明ハッシュがMerkle rootと一致しませんでした。",invalidMerkleVersion:"Merkle version used for signature is incompatible with Blockcerts version.",isTransactionIdValid:"照合するための取引IDがないため、この証明書を認証できません。",issuerProfileNotSet:"no issuer address given",issuerProfileInvalid:"retrieved file does not seem to be a valid profile",lookForTxCouldNotConfirm:"取引を確認できませんでした。全てのブロックチェーンAPIが返信しませんでした。 レート制限が原因になっている可能性があります。",lookForTxDifferentAddresses:"ブロックチェーンAPIから返された発行者アドレスが異なっていました",lookForTxDifferentRemoteHashes:"ブロックチェーンAPIから返されたリモートハッシュが異なっていました",lookForTxInvalidAppConfig:"アプリケーション設定が無効です。CONFIG.MinimumBlockchainExplorersの設定値を確認して下さい。",lookForTxInvalidChain:"チェーンが無効です。既知のBlockchainExplorersにマップできません。",parseBlockCypherResponse:"Blockcypher APIによると、必要最小限の取引確認の数に達しませんでした",parseBlockstreamResponse:"Blockstream APIによると、必要最小限の取引確認の数に達しませんでした",parseIssuerKeys:"発行者識別データからJSONをパースできません",unableToGetRemoteHash:"リモートハッシュを取得できません"}}};const u="fetchRemoteHash";function l(e,t){return c["en-US"].subSteps[`${e}${t}`]}const f={formatValidation:["getTransactionId","computeLocalHash",u,"getIssuerProfile","parseIssuerKeys"],hashComparison:["compareHashes","checkMerkleRoot","checkReceipt"],statusCheck:["checkIssuerSignature","checkAuthenticity","checkRevokedStatus","checkExpiresDate"]};const h=Object.keys(f).reduce((e,t)=>{return Object.assign(e,f[r=t].reduce((e,t)=>(e[t]={code:t,label:l(t,"Label"),labelPending:l(t,"LabelPending"),parentStep:r},e),{}));var r},{});var d=Object.freeze({__proto__:null,getTransactionId:"getTransactionId",computeLocalHash:"computeLocalHash",fetchRemoteHash:u,getIssuerProfile:"getIssuerProfile",parseIssuerKeys:"parseIssuerKeys",compareHashes:"compareHashes",checkMerkleRoot:"checkMerkleRoot",checkReceipt:"checkReceipt",checkIssuerSignature:"checkIssuerSignature",checkAuthenticity:"checkAuthenticity",checkRevokedStatus:"checkRevokedStatus",checkExpiresDate:"checkExpiresDate",language:h});var p,m=Object.freeze({__proto__:null,FAILURE:"failure",STARTING:"starting",SUCCESS:"success"});!function(e){e.Bitcoin="bitcoin",e.Ethmain="ethmain",e.Ethropst="ethropst",e.Ethrinkeby="ethrinkeby",e.Mocknet="mocknet",e.Regtest="regtest",e.Testnet="testnet"}(p||(p={}));const g={[p.Bitcoin]:{code:p.Bitcoin,name:"Bitcoin",prefixes:["6a20","OP_RETURN "],signatureValue:"bitcoinMainnet",transactionTemplates:{full:"https://blockchain.info/tx/{transaction_id}",raw:"https://blockchain.info/rawtx/{transaction_id}"}},[p.Ethmain]:{code:p.Ethmain,name:"Ethereum",prefixes:["0x"],signatureValue:"ethereumMainnet",transactionTemplates:{full:"https://etherscan.io/tx/{transaction_id}",raw:"https://etherscan.io/tx/{transaction_id}"}},[p.Ethropst]:{code:p.Ethropst,name:"Ethereum Testnet",signatureValue:"ethereumRopsten",transactionTemplates:{full:"https://ropsten.etherscan.io/tx/{transaction_id}&apikey=FJ3CZWH8PQBV8W5U6JR8TMKAYDHBKQ3B1D",raw:"https://ropsten.etherscan.io/getRawTx?tx={transaction_id}&apikey=FJ3CZWH8PQBV8W5U6JR8TMKAYDHBKQ3B1D"}},[p.Ethrinkeby]:{code:p.Ethrinkeby,name:"Ethereum Testnet",signatureValue:"ethereumRinkeby",transactionTemplates:{full:"https://rinkeby.etherscan.io/tx/{transaction_id}",raw:"https://rinkeby.etherscan.io/getRawTx?tx={transaction_id}"}},[p.Mocknet]:{code:p.Mocknet,name:"Mocknet",test:!0,signatureValue:"mockchain",transactionTemplates:{full:"",raw:""}},[p.Regtest]:{code:p.Regtest,name:"Mocknet",test:!0,signatureValue:"bitcoinRegtest",transactionTemplates:{full:"",raw:""}},[p.Testnet]:{code:p.Testnet,name:"Bitcoin Testnet",signatureValue:"bitcoinTestnet",transactionTemplates:{full:"https://testnet.blockchain.info/tx/{transaction_id}",raw:"https://testnet.blockchain.info/rawtx/{transaction_id}"}}};function v(e){return e!==g.bitcoin.code&&e!==g.ethmain.code}const y="mainnet",b="testnet";var w=1,_=1,S=!0,E="ecdsa-koblitz-pubkey:1";const x={locale:"en-US"};var I=Object.freeze({__proto__:null,isMainnet:function(e){return t(e,"1")||t(e,E)}});var k={locale:"en-US"};function P(e,t){return e&&t?c[k.locale]?c[k.locale][e]?c[k.locale][e][t]?c[k.locale][e][t]||"":"[missing locale item data]":"[missing locale group data]":"[missing locale data]":""}function O(){return Object.keys(c)}var A=Object.freeze({__proto__:null,detectLocale:function(){return navigator.language||navigator.userLanguage||navigator.browserLanguage||x.locale},ensureIsSupported:function(e){let t;const r=wi.i18n.getSupportedLanguages().map(e=>e.toLowerCase());if(t=r.indexOf(e.toLowerCase())>-1,!t){const n=e.substr(0,2).toLowerCase(),i=r.map(e=>e.split("-")[0]).indexOf(n);t=i>-1,t&&(e=r[i])}return t||(e=x.locale),function(e){const t=e.split("-");return t.length>1?`${t[0].toLowerCase()}-${t[1].toUpperCase()}`:t[0].toLowerCase()}(e)},getText:P,getSupportedLanguages:O});function T(e=""){return I.isMainnet(e)?g.bitcoin:g.testnet}function C(e){const t=Object.keys(g).map(e=>g[e]).find(t=>t.signatureValue===e);if(void 0===t)throw new Error(P("errors","getChain"));return t}class N{constructor(e,t,r,n){this.publicKey=e,this.created=t,this.revoked=r,this.expires=n}}class R{constructor(e,t,r){this.image=e,this.jobTitle=t,this.name=r}}class M extends Error{constructor(e,t){super(t),this.stepCode=e}}var L=Object.freeze({__proto__:null,isMockChain:function(e){if(e){const t="string"==typeof e?e:e.code;return!!Object.keys(g).some(e=>e===t)&&!!g[t].test}return!1}});function j(e){return JSON.parse(JSON.stringify(e))}const D={[y]:["getTransactionId","computeLocalHash",u,"getIssuerProfile","parseIssuerKeys","compareHashes","checkMerkleRoot","checkReceipt","checkRevokedStatus","checkAuthenticity","checkExpiresDate"],[b]:["computeLocalHash","compareHashes","checkReceipt","checkExpiresDate"]};function B(e){const t=function(e){const t=j(a);return e.forEach(e=>t[e.parentStep].subSteps.push(e)),t}(e.map(e=>({...Object.assign({},h[e]),label:P("subSteps",e+"Label"),labelPending:P("subSteps",e+"LabelPending")})));return r=t,Object.keys(r).map(e=>({...r[e],code:e,label:P("steps",e+"Label"),labelPending:P("steps",e+"LabelPending")}));var r}var U=Object.freeze({__proto__:null,getChain:function(e,t=null){const r=t||{};if(r.anchors){const e=r.anchors[0];if(e.chain){return C(e.chain)}if("string"==typeof e)return function(e){const t={btc:{chainName:g.bitcoin.name},eth:{chainName:g.ethmain.name}},r=e.split(":"),n=r.findIndex(e=>Object.keys(t).includes(e));if(n>-1){const e=r[n],i=r[n+1];return C(t[e].chainName.toLowerCase()+function(e){const t=e.substr(0,1),r=e.substr(1,e.length-1);return t.toUpperCase()+r.toLowerCase()}(i))}return T()}(e)}return T(e)},generateRevocationReason:function(e){return e=(e=e.trim()).length>0?` ${P("revocation","preReason")} ${e}${"."!==e.slice(-1)?".":""}`:"",`${P("revocation","reason")}${e}`},getTransactionId:function(e={}){try{const{anchors:t}=e,r=t[0];if(r.sourceId)return r.sourceId;if("string"==typeof r){return r.split(":").pop()}}catch(e){throw new M("",P("errors","getTransactionId"))}},getTransactionLink:function(e,t,r=!1){return e&&t?t.transactionTemplates[r?"raw":"full"].replace("{transaction_id}",e):""},getVerificationMap:function(e,t){if(!e)return[];const r=L.isMockChain(e)?b:y,n=Object.assign(D);if(i(t)){const e=n[r].findIndex(e=>"getIssuerProfile"===e);delete n[r][e]}return B(n[r])}});var F=Object.freeze({__proto__:null,ensureValidity:function(e=[]){if(0===e.length)return!1;if(e.some(e=>!function(e){return e.priority>=0}(e)))throw new Error("One or more of your custom explorer APIs has a priority set below zero");if(e.some(e=>!function(e){return"function"==typeof e.parsingFunction}(e)))throw new Error("One or more of your custom explorer APIs does not have a parsing function");return!0}}),H="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},V=[],z=[],q="undefined"!=typeof Uint8Array?Uint8Array:Array,K=!1;function $(){K=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,r=e.length;t<r;++t)V[t]=e[t],z[e.charCodeAt(t)]=t;z["-".charCodeAt(0)]=62,z["_".charCodeAt(0)]=63}function G(e,t,r){for(var n,i,o=[],a=t;a<r;a+=3)n=(e[a]<<16)+(e[a+1]<<8)+e[a+2],o.push(V[(i=n)>>18&63]+V[i>>12&63]+V[i>>6&63]+V[63&i]);return o.join("")}function J(e){var t;K||$();for(var r=e.length,n=r%3,i="",o=[],a=16383,s=0,c=r-n;s<c;s+=a)o.push(G(e,s,s+a>c?c:s+a));return 1===n?(t=e[r-1],i+=V[t>>2],i+=V[t<<4&63],i+="=="):2===n&&(t=(e[r-2]<<8)+e[r-1],i+=V[t>>10],i+=V[t>>4&63],i+=V[t<<2&63],i+="="),o.push(i),o.join("")}function W(e,t,r,n,i){var o,a,s=8*i-n-1,c=(1<<s)-1,u=c>>1,l=-7,f=r?i-1:0,h=r?-1:1,d=e[t+f];for(f+=h,o=d&(1<<-l)-1,d>>=-l,l+=s;l>0;o=256*o+e[t+f],f+=h,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=n;l>0;a=256*a+e[t+f],f+=h,l-=8);if(0===o)o=1-u;else{if(o===c)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),o-=u}return(d?-1:1)*a*Math.pow(2,o-n)}function X(e,t,r,n,i,o){var a,s,c,u=8*o-i-1,l=(1<<u)-1,f=l>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+f>=1?h/c:h*Math.pow(2,1-f))*c>=2&&(a++,c/=2),a+f>=l?(s=0,a=l):a+f>=1?(s=(t*c-1)*Math.pow(2,i),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;e[r+d]=255&s,d+=p,s/=256,i-=8);for(a=a<<i|s,u+=i;u>0;e[r+d]=255&a,d+=p,a/=256,u-=8);e[r+d-p]|=128*m}var Q={}.toString,Y=Array.isArray||function(e){return"[object Array]"==Q.call(e)};re.TYPED_ARRAY_SUPPORT=void 0===H.TYPED_ARRAY_SUPPORT||H.TYPED_ARRAY_SUPPORT;var Z=ee();function ee(){return re.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function te(e,t){if(ee()<t)throw new RangeError("Invalid typed array length");return re.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=re.prototype:(null===e&&(e=new re(t)),e.length=t),e}function re(e,t,r){if(!(re.TYPED_ARRAY_SUPPORT||this instanceof re))return new re(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return oe(this,e)}return ne(this,e,t,r)}function ne(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n);re.TYPED_ARRAY_SUPPORT?(e=t).__proto__=re.prototype:e=ae(e,t);return e}(e,t,r,n):"string"==typeof t?function(e,t,r){"string"==typeof r&&""!==r||(r="utf8");if(!re.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|ue(t,r),i=(e=te(e,n)).write(t,r);i!==n&&(e=e.slice(0,i));return e}(e,t,r):function(e,t){if(ce(t)){var r=0|se(t.length);return 0===(e=te(e,r)).length||t.copy(e,0,0,r),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?te(e,0):ae(e,t);if("Buffer"===t.type&&Y(t.data))return ae(e,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function ie(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function oe(e,t){if(ie(t),e=te(e,t<0?0:0|se(t)),!re.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function ae(e,t){var r=t.length<0?0:0|se(t.length);e=te(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function se(e){if(e>=ee())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ee().toString(16)+" bytes");return 0|e}function ce(e){return!(null==e||!e._isBuffer)}function ue(e,t){if(ce(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return Le(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return je(e).length;default:if(n)return Le(e).length;t=(""+t).toLowerCase(),n=!0}}function le(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return xe(this,t,r);case"utf8":case"utf-8":return _e(this,t,r);case"ascii":return Se(this,t,r);case"latin1":case"binary":return Ee(this,t,r);case"base64":return we(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ie(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function fe(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function he(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=re.from(t,n)),ce(t))return 0===t.length?-1:de(e,t,r,n,i);if("number"==typeof t)return t&=255,re.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):de(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function de(e,t,r,n,i){var o,a=1,s=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,c/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var l=-1;for(o=r;o<s;o++)if(u(e,o)===u(t,-1===l?0:o-l)){if(-1===l&&(l=o),o-l+1===c)return l*a}else-1!==l&&(o-=o-l),l=-1}else for(r+c>s&&(r=s-c),o=r;o>=0;o--){for(var f=!0,h=0;h<c;h++)if(u(e,o+h)!==u(t,h)){f=!1;break}if(f)return o}return-1}function pe(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))return a;e[r+a]=s}return a}function me(e,t,r,n){return De(Le(t,e.length-r),e,r,n)}function ge(e,t,r,n){return De(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function ve(e,t,r,n){return ge(e,t,r,n)}function ye(e,t,r,n){return De(je(t),e,r,n)}function be(e,t,r,n){return De(function(e,t){for(var r,n,i,o=[],a=0;a<e.length&&!((t-=2)<0);++a)n=(r=e.charCodeAt(a))>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function we(e,t,r){return 0===t&&r===e.length?J(e):J(e.slice(t,r))}function _e(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o,a,s,c,u=e[i],l=null,f=u>239?4:u>223?3:u>191?2:1;if(i+f<=r)switch(f){case 1:u<128&&(l=u);break;case 2:128==(192&(o=e[i+1]))&&(c=(31&u)<<6|63&o)>127&&(l=c);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(c=(15&u)<<12|(63&o)<<6|63&a)>2047&&(c<55296||c>57343)&&(l=c);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(c=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&c<1114112&&(l=c)}null===l?(l=65533,f=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),i+=f}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=4096));return r}(n)}re.poolSize=8192,re._augment=function(e){return e.__proto__=re.prototype,e},re.from=function(e,t,r){return ne(null,e,t,r)},re.TYPED_ARRAY_SUPPORT&&(re.prototype.__proto__=Uint8Array.prototype,re.__proto__=Uint8Array),re.alloc=function(e,t,r){return function(e,t,r,n){return ie(t),t<=0?te(e,t):void 0!==r?"string"==typeof n?te(e,t).fill(r,n):te(e,t).fill(r):te(e,t)}(null,e,t,r)},re.allocUnsafe=function(e){return oe(null,e)},re.allocUnsafeSlow=function(e){return oe(null,e)},re.isBuffer=Be,re.compare=function(e,t){if(!ce(e)||!ce(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},re.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},re.concat=function(e,t){if(!Y(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return re.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=re.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var o=e[r];if(!ce(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},re.byteLength=ue,re.prototype._isBuffer=!0,re.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)fe(this,t,t+1);return this},re.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)fe(this,t,t+3),fe(this,t+1,t+2);return this},re.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)fe(this,t,t+7),fe(this,t+1,t+6),fe(this,t+2,t+5),fe(this,t+3,t+4);return this},re.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?_e(this,0,e):le.apply(this,arguments)},re.prototype.equals=function(e){if(!ce(e))throw new TypeError("Argument must be a Buffer");return this===e||0===re.compare(this,e)},re.prototype.inspect=function(){var e="";return this.length>0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),"<Buffer "+e+">"},re.prototype.compare=function(e,t,r,n,i){if(!ce(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),c=this.slice(n,i),u=e.slice(t,r),l=0;l<s;++l)if(c[l]!==u[l]){o=c[l],a=u[l];break}return o<a?-1:a<o?1:0},re.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},re.prototype.indexOf=function(e,t,r){return he(this,e,t,r,!0)},re.prototype.lastIndexOf=function(e,t,r){return he(this,e,t,r,!1)},re.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return pe(this,e,t,r);case"utf8":case"utf-8":return me(this,e,t,r);case"ascii":return ge(this,e,t,r);case"latin1":case"binary":return ve(this,e,t,r);case"base64":return ye(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return be(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},re.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Se(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function Ee(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function xe(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o<r;++o)i+=Me(e[o]);return i}function Ie(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function ke(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function Pe(e,t,r,n,i,o){if(!ce(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function Oe(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i<o;++i)e[r+i]=(t&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function Ae(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i<o;++i)e[r+i]=t>>>8*(n?i:3-i)&255}function Te(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Ce(e,t,r,n,i){return i||Te(e,0,r,4),X(e,t,r,n,23,4),r+4}function Ne(e,t,r,n,i){return i||Te(e,0,r,8),X(e,t,r,n,52,8),r+8}re.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),re.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=re.prototype;else{var i=t-e;r=new re(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+e]}return r},re.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||ke(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n},re.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||ke(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},re.prototype.readUInt8=function(e,t){return t||ke(e,1,this.length),this[e]},re.prototype.readUInt16LE=function(e,t){return t||ke(e,2,this.length),this[e]|this[e+1]<<8},re.prototype.readUInt16BE=function(e,t){return t||ke(e,2,this.length),this[e]<<8|this[e+1]},re.prototype.readUInt32LE=function(e,t){return t||ke(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},re.prototype.readUInt32BE=function(e,t){return t||ke(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},re.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||ke(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},re.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||ke(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},re.prototype.readInt8=function(e,t){return t||ke(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},re.prototype.readInt16LE=function(e,t){t||ke(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},re.prototype.readInt16BE=function(e,t){t||ke(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},re.prototype.readInt32LE=function(e,t){return t||ke(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},re.prototype.readInt32BE=function(e,t){return t||ke(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},re.prototype.readFloatLE=function(e,t){return t||ke(e,4,this.length),W(this,e,!0,23,4)},re.prototype.readFloatBE=function(e,t){return t||ke(e,4,this.length),W(this,e,!1,23,4)},re.prototype.readDoubleLE=function(e,t){return t||ke(e,8,this.length),W(this,e,!0,52,8)},re.prototype.readDoubleBE=function(e,t){return t||ke(e,8,this.length),W(this,e,!1,52,8)},re.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||Pe(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},re.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||Pe(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},re.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||Pe(this,e,t,1,255,0),re.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},re.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||Pe(this,e,t,2,65535,0),re.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Oe(this,e,t,!0),t+2},re.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||Pe(this,e,t,2,65535,0),re.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Oe(this,e,t,!1),t+2},re.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||Pe(this,e,t,4,4294967295,0),re.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):Ae(this,e,t,!0),t+4},re.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||Pe(this,e,t,4,4294967295,0),re.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Ae(this,e,t,!1),t+4},re.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);Pe(this,e,t,r,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o<r&&(a*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},re.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);Pe(this,e,t,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},re.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||Pe(this,e,t,1,127,-128),re.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},re.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||Pe(this,e,t,2,32767,-32768),re.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Oe(this,e,t,!0),t+2},re.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||Pe(this,e,t,2,32767,-32768),re.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Oe(this,e,t,!1),t+2},re.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||Pe(this,e,t,4,2147483647,-2147483648),re.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):Ae(this,e,t,!0),t+4},re.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||Pe(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),re.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Ae(this,e,t,!1),t+4},re.prototype.writeFloatLE=function(e,t,r){return Ce(this,e,t,!0,r)},re.prototype.writeFloatBE=function(e,t,r){return Ce(this,e,t,!1,r)},re.prototype.writeDoubleLE=function(e,t,r){return Ne(this,e,t,!0,r)},re.prototype.writeDoubleBE=function(e,t,r){return Ne(this,e,t,!1,r)},re.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i,o=n-r;if(this===e&&r<t&&t<n)for(i=o-1;i>=0;--i)e[i+t]=this[i+r];else if(o<1e3||!re.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+o),t);return o},re.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!re.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{var a=ce(e)?e:Le(new re(e,n).toString()),s=a.length;for(o=0;o<r-t;++o)this[o+t]=a[o%s]}return this};var Re=/[^+\/0-9A-Za-z-_]/g;function Me(e){return e<16?"0"+e.toString(16):e.toString(16)}function Le(e,t){var r;t=t||1/0;for(var n=e.length,i=null,o=[],a=0;a<n;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function je(e){return function(e){var t,r,n,i,o,a;K||$();var s=e.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===e[s-2]?2:"="===e[s-1]?1:0,a=new q(3*s/4-o),n=o>0?s-4:s;var c=0;for(t=0,r=0;t<n;t+=4,r+=3)i=z[e.charCodeAt(t)]<<18|z[e.charCodeAt(t+1)]<<12|z[e.charCodeAt(t+2)]<<6|z[e.charCodeAt(t+3)],a[c++]=i>>16&255,a[c++]=i>>8&255,a[c++]=255&i;return 2===o?(i=z[e.charCodeAt(t)]<<2|z[e.charCodeAt(t+1)]>>4,a[c++]=255&i):1===o&&(i=z[e.charCodeAt(t)]<<10|z[e.charCodeAt(t+1)]<<4|z[e.charCodeAt(t+2)]>>2,a[c++]=i>>8&255,a[c++]=255&i),a}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(Re,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function De(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function Be(e){return null!=e&&(!!e._isBuffer||Ue(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&Ue(e.slice(0,0))}(e))}function Ue(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var Fe=Object.freeze({__proto__:null,INSPECT_MAX_BYTES:50,kMaxLength:Z,Buffer:re,SlowBuffer:function(e){return+e!=e&&(e=0),re.alloc(+e)},isBuffer:Be});function He(){throw new Error("setTimeout has not been defined")}function Ve(){throw new Error("clearTimeout has not been defined")}var ze=He,qe=Ve;function Ke(e){if(ze===setTimeout)return setTimeout(e,0);if((ze===He||!ze)&&setTimeout)return ze=setTimeout,setTimeout(e,0);try{return ze(e,0)}catch(t){try{return ze.call(null,e,0)}catch(t){return ze.call(this,e,0)}}}"function"==typeof H.setTimeout&&(ze=setTimeout),"function"==typeof H.clearTimeout&&(qe=clearTimeout);var $e,Ge=[],Je=!1,We=-1;function Xe(){Je&&$e&&(Je=!1,$e.length?Ge=$e.concat(Ge):We=-1,Ge.length&&Qe())}function Qe(){if(!Je){var e=Ke(Xe);Je=!0;for(var t=Ge.length;t;){for($e=Ge,Ge=[];++We<t;)$e&&$e[We].run();We=-1,t=Ge.length}$e=null,Je=!1,function(e){if(qe===clearTimeout)return clearTimeout(e);if((qe===Ve||!qe)&&clearTimeout)return qe=clearTimeout,clearTimeout(e);try{qe(e)}catch(t){try{return qe.call(null,e)}catch(t){return qe.call(this,e)}}}(e)}}function Ye(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];Ge.push(new Ze(e,t)),1!==Ge.length||Je||Ke(Qe)}function Ze(e,t){this.fun=e,this.array=t}Ze.prototype.run=function(){this.fun.apply(null,this.array)};function et(){}var tt=et,rt=et,nt=et,it=et,ot=et,at=et,st=et;var ct=H.performance||{},ut=ct.now||ct.mozNow||ct.msNow||ct.oNow||ct.webkitNow||function(){return(new Date).getTime()};var lt=new Date;var ft={nextTick:Ye,title:"browser",browser:!0,env:{},argv:[],version:"11.0.0",versions:{},on:tt,addListener:rt,once:nt,off:it,removeListener:ot,removeAllListeners:at,emit:st,binding:function(e){throw new Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(e){throw new Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(e){var t=.001*ut.call(ct),r=Math.floor(t),n=Math.floor(t%1*1e9);return e&&(r-=e[0],(n-=e[1])<0&&(r--,n+=1e9)),[r,n]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-lt)/1e3}},ht=/[^\x20-\x7E]/,dt=/[\x2E\u3002\uFF0E\uFF61]/g,pt={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},mt=Math.floor,gt=String.fromCharCode; /*! https://mths.be/punycode v1.4.1 by @mathias */function vt(e){throw new RangeError(pt[e])}function yt(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function bt(e,t,r){var n=0;for(e=r?mt(e/700):e>>1,e+=mt(e/t);e>455;n+=36)e=mt(e/35);return mt(n+36*e/(e+38))}function wt(e){return function(e,t){var r=e.split("@"),n="";r.length>1&&(n=r[0]+"@",e=r[1]);var i=function(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}((e=e.replace(dt,".")).split("."),t).join(".");return n+i}(e,(function(e){return ht.test(e)?"xn--"+function(e){var t,r,n,i,o,a,s,c,u,l,f,h,d,p,m,g=[];for(h=(e=function(e){for(var t,r,n=[],i=0,o=e.length;i<o;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<o?56320==(64512&(r=e.charCodeAt(i++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),i--):n.push(t);return n}(e)).length,t=128,r=0,o=72,a=0;a<h;++a)(f=e[a])<128&&g.push(gt(f));for(n=i=g.length,i&&g.push("-");n<h;){for(s=2147483647,a=0;a<h;++a)(f=e[a])>=t&&f<s&&(s=f);for(s-t>mt((2147483647-r)/(d=n+1))&&vt("overflow"),r+=(s-t)*d,t=s,a=0;a<h;++a)if((f=e[a])<t&&++r>2147483647&&vt("overflow"),f==t){for(c=r,u=36;!(c<(l=u<=o?1:u>=o+26?26:u-o));u+=36)m=c-l,p=36-l,g.push(gt(yt(l+m%p,0))),c=mt(m/p);g.push(gt(yt(c,0))),o=bt(r,d,n==i),r=0,++n}++r,++t}return g.join("")}(e):e}))}var _t="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e},St=/%[sdj%]/g;function Et(e){if(!Ut(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(Ot(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,i=n.length,o=String(e).replace(St,(function(e){if("%%"===e)return"%";if(r>=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}})),a=n[r];r<i;a=n[++r])jt(a)||!Vt(a)?o+=" "+a:o+=" "+Ot(a);return o}function xt(e,t){if(Ft(H.process))return function(){return xt(e,t).apply(this,arguments)};var r=!1;return function(){return r||(console.error(t),r=!0),e.apply(this,arguments)}}var It,kt={};function Pt(e){if(Ft(It)&&(It=""),e=e.toUpperCase(),!kt[e])if(new RegExp("\\b"+e+"\\b","i").test(It)){kt[e]=function(){var t=Et.apply(null,arguments);console.error("%s %d: %s",e,0,t)}}else kt[e]=function(){};return kt[e]}function Ot(e,t){var r={seen:[],stylize:Tt};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),Lt(t)?r.showHidden=t:t&&Xt(r,t),Ft(r.showHidden)&&(r.showHidden=!1),Ft(r.depth)&&(r.depth=2),Ft(r.colors)&&(r.colors=!1),Ft(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=At),Ct(r,e,r.depth)}function At(e,t){var r=Ot.styles[t];return r?"["+Ot.colors[r][0]+"m"+e+"["+Ot.colors[r][1]+"m":e}function Tt(e,t){return e}function Ct(e,t,r){if(e.customInspect&&t&&Kt(t.inspect)&&t.inspect!==Ot&&(!t.constructor||t.constructor.prototype!==t)){var n=t.inspect(r,e);return Ut(n)||(n=Ct(e,n,r)),n}var i=function(e,t){if(Ft(t))return e.stylize("undefined","undefined");if(Ut(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(Bt(t))return e.stylize(""+t,"number");if(Lt(t))return e.stylize(""+t,"boolean");if(jt(t))return e.stylize("null","null")}(e,t);if(i)return i;var o=Object.keys(t),a=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(t)),qt(t)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return Nt(t);if(0===o.length){if(Kt(t)){var s=t.name?": "+t.name:"";return e.stylize("[Function"+s+"]","special")}if(Ht(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(zt(t))return e.stylize(Date.prototype.toString.call(t),"date");if(qt(t))return Nt(t)}var c,u="",l=!1,f=["{","}"];(Mt(t)&&(l=!0,f=["[","]"]),Kt(t))&&(u=" [Function"+(t.name?": "+t.name:"")+"]");return Ht(t)&&(u=" "+RegExp.prototype.toString.call(t)),zt(t)&&(u=" "+Date.prototype.toUTCString.call(t)),qt(t)&&(u=" "+Nt(t)),0!==o.length||l&&0!=t.length?r<0?Ht(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),c=l?function(e,t,r,n,i){for(var o=[],a=0,s=t.length;a<s;++a)Qt(t,String(a))?o.push(Rt(e,t,r,n,String(a),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(Rt(e,t,r,n,i,!0))})),o}(e,t,r,a,o):o.map((function(n){return Rt(e,t,r,a,n,l)})),e.seen.pop(),function(e,t,r){if(e.reduce((function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(c,u,f)):f[0]+u+f[1]}function Nt(e){return"["+Error.prototype.toString.call(e)+"]"}function Rt(e,t,r,n,i,o){var a,s,c;if((c=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(s=e.stylize("[Setter]","special")),Qt(n,i)||(a="["+i+"]"),s||(e.seen.indexOf(c.value)<0?(s=jt(r)?Ct(e,c.value,null):Ct(e,c.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),Ft(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function Mt(e){return Array.isArray(e)}function Lt(e){return"boolean"==typeof e}function jt(e){return null===e}function Dt(e){return null==e}function Bt(e){return"number"==typeof e}function Ut(e){return"string"==typeof e}function Ft(e){return void 0===e}function Ht(e){return Vt(e)&&"[object RegExp]"===$t(e)}function Vt(e){return"object"==typeof e&&null!==e}function zt(e){return Vt(e)&&"[object Date]"===$t(e)}function qt(e){return Vt(e)&&("[object Error]"===$t(e)||e instanceof Error)}function Kt(e){return"function"==typeof e}function $t(e){return Object.prototype.toString.call(e)}function Gt(e){return e<10?"0"+e.toString(10):e.toString(10)}Ot.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},Ot.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};var Jt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Wt(){var e=new Date,t=[Gt(e.getHours()),Gt(e.getMinutes()),Gt(e.getSeconds())].join(":");return[e.getDate(),Jt[e.getMonth()],t].join(" ")}function Xt(e,t){if(!t||!Vt(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}function Qt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var Yt={inherits:_t,_extend:Xt,log:function(){console.log("%s - %s",Wt(),Et.apply(null,arguments))},isBuffer:function(e){return Be(e)},isPrimitive:function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},isFunction:Kt,isError:qt,isDate:zt,isObject:Vt,isRegExp:Ht,isUndefined:Ft,isSymbol:function(e){return"symbol"==typeof e},isString:Ut,isNumber:Bt,isNullOrUndefined:Dt,isNull:jt,isBoolean:Lt,isArray:Mt,inspect:Ot,deprecate:xt,format:Et,debuglog:Pt},Zt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function er(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function tr(e,t){return e(t={exports:{}},t.exports),t.exports}function rr(e){return e&&e.default||e}function nr(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var ir=function(e,t,r,n){t=t||"&",r=r||"=";var i={};if("string"!=typeof e||0===e.length)return i;var o=/\+/g;e=e.split(t);var a=1e3;n&&"number"==typeof n.maxKeys&&(a=n.maxKeys);var s=e.length;a>0&&s>a&&(s=a);for(var c=0;c<s;++c){var u,l,f,h,d=e[c].replace(o,"%20"),p=d.indexOf(r);p>=0?(u=d.substr(0,p),l=d.substr(p+1)):(u=d,l=""),f=decodeURIComponent(u),h=decodeURIComponent(l),nr(i,f)?Array.isArray(i[f])?i[f].push(h):i[f]=[i[f],h]:i[f]=h}return i},or=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}},ar=function(e,t,r,n){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map((function(n){var i=encodeURIComponent(or(n))+r;return Array.isArray(e[n])?e[n].map((function(e){return i+encodeURIComponent(or(e))})).join(t):i+encodeURIComponent(or(e[n]))})).join(t):n?encodeURIComponent(or(n))+r+encodeURIComponent(or(e)):""},sr=tr((function(e,t){t.decode=t.parse=ir,t.encode=t.stringify=ar})),cr=(sr.decode,sr.parse),ur=(sr.encode,sr.stringify),lr={parse:xr,resolve:function(e,t){return xr(e,!1,!0).resolve(t)},resolveObject:function(e,t){return e?xr(e,!1,!0).resolveObject(t):t},format:function(e){Ut(e)&&(e=Ir({},e));return kr(e)},Url:fr};function fr(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var hr=/^([a-z0-9.+-]+:)/i,dr=/:[0-9]*$/,pr=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,mr=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),gr=["'"].concat(mr),vr=["%","/","?",";","#"].concat(gr),yr=["/","?","#"],br=/^[+a-z0-9A-Z_-]{0,63}$/,wr=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,_r={javascript:!0,"javascript:":!0},Sr={javascript:!0,"javascript:":!0},Er={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function xr(e,t,r){if(e&&Vt(e)&&e instanceof fr)return e;var n=new fr;return n.parse(e,t,r),n}function Ir(e,t,r,n){if(!Ut(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),o=-1!==i&&i<t.indexOf("#")?"?":"#",a=t.split(o);a[0]=a[0].replace(/\\/g,"/");var s=t=a.join(o);if(s=s.trim(),!n&&1===t.split("#").length){var c=pr.exec(s);if(c)return e.path=s,e.href=s,e.pathname=c[1],c[2]?(e.search=c[2],e.query=r?cr(e.search.substr(1)):e.search.substr(1)):r&&(e.search="",e.query={}),e}var u,l,f,h,d=hr.exec(s);if(d){var p=(d=d[0]).toLowerCase();e.protocol=p,s=s.substr(d.length)}if(n||d||s.match(/^\/\/[^@\/]+@[^@\/]+/)){var m="//"===s.substr(0,2);!m||d&&Sr[d]||(s=s.substr(2),e.slashes=!0)}if(!Sr[d]&&(m||d&&!Er[d])){var g,v,y=-1;for(u=0;u<yr.length;u++)-1!==(l=s.indexOf(yr[u]))&&(-1===y||l<y)&&(y=l);for(-1!==(v=-1===y?s.lastIndexOf("@"):s.lastIndexOf("@",y))&&(g=s.slice(0,v),s=s.slice(v+1),e.auth=decodeURIComponent(g)),y=-1,u=0;u<vr.length;u++)-1!==(l=s.indexOf(vr[u]))&&(-1===y||l<y)&&(y=l);-1===y&&(y=s.length),e.host=s.slice(0,y),s=s.slice(y),Pr(e),e.hostname=e.hostname||"";var b="["===e.hostname[0]&&"]"===e.hostname[e.hostname.length-1];if(!b){var w=e.hostname.split(/\./);for(u=0,f=w.length;u<f;u++){var _=w[u];if(_&&!_.match(br)){for(var S="",E=0,x=_.length;E<x;E++)_.charCodeAt(E)>127?S+="x":S+=_[E];if(!S.match(br)){var I=w.slice(0,u),k=w.slice(u+1),P=_.match(wr);P&&(I.push(P[1]),k.unshift(P[2])),k.length&&(s="/"+k.join(".")+s),e.hostname=I.join(".");break}}}}e.hostname.length>255?e.hostname="":e.hostname=e.hostname.toLowerCase(),b||(e.hostname=wt(e.hostname)),h=e.port?":"+e.port:"";var O=e.hostname||"";e.host=O+h,e.href+=e.host,b&&(e.hostname=e.hostname.substr(1,e.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!_r[p])for(u=0,f=gr.length;u<f;u++){var A=gr[u];if(-1!==s.indexOf(A)){var T=encodeURIComponent(A);T===A&&(T=escape(A)),s=s.split(A).join(T)}}var C=s.indexOf("#");-1!==C&&(e.hash=s.substr(C),s=s.slice(0,C));var N=s.indexOf("?");if(-1!==N?(e.search=s.substr(N),e.query=s.substr(N+1),r&&(e.query=cr(e.query)),s=s.slice(0,N)):r&&(e.search="",e.query={}),s&&(e.pathname=s),Er[p]&&e.hostname&&!e.pathname&&(e.pathname="/"),e.pathname||e.search){h=e.pathname||"";var R=e.search||"";e.path=h+R}return e.href=kr(e),e}function kr(e){var t=e.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var r=e.protocol||"",n=e.pathname||"",i=e.hash||"",o=!1,a="";e.host?o=t+e.host:e.hostname&&(o=t+(-1===e.hostname.indexOf(":")?e.hostname:"["+this.hostname+"]"),e.port&&(o+=":"+e.port)),e.query&&Vt(e.query)&&Object.keys(e.query).length&&(a=ur(e.query));var s=e.search||a&&"?"+a||"";return r&&":"!==r.substr(-1)&&(r+=":"),e.slashes||(!r||Er[r])&&!1!==o?(o="//"+(o||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):o||(o=""),i&&"#"!==i.charAt(0)&&(i="#"+i),s&&"?"!==s.charAt(0)&&(s="?"+s),r+o+(n=n.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})))+(s=s.replace("#","%23"))+i}function Pr(e){var t=e.host,r=dr.exec(t);r&&(":"!==(r=r[0])&&(e.port=r.substr(1)),t=t.substr(0,t.length-r.length)),t&&(e.hostname=t)}fr.prototype.parse=function(e,t,r){return Ir(this,e,t,r)},fr.prototype.format=function(){return kr(this)},fr.prototype.resolve=function(e){return this.resolveObject(xr(e,!1,!0)).format()},fr.prototype.resolveObject=function(e){if(Ut(e)){var t=new fr;t.parse(e,!1,!0),e=t}for(var r,n=new fr,i=Object.keys(this),o=0;o<i.length;o++){var a=i[o];n[a]=this[a]}if(n.hash=e.hash,""===e.href)return n.href=n.format(),n;if(e.slashes&&!e.protocol){for(var s=Object.keys(e),c=0;c<s.length;c++){var u=s[c];"protocol"!==u&&(n[u]=e[u])}return Er[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n}if(e.protocol&&e.protocol!==n.protocol){if(!Er[e.protocol]){for(var l=Object.keys(e),f=0;f<l.length;f++){var h=l[f];n[h]=e[h]}return n.href=n.format(),n}if(n.protocol=e.protocol,e.host||Sr[e.protocol])n.pathname=e.pathname;else{for(r=(e.pathname||"").split("/");r.length&&!(e.host=r.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==r[0]&&r.unshift(""),r.length<2&&r.unshift(""),n.pathname=r.join("/")}if(n.search=e.search,n.query=e.query,n.host=e.host||"",n.auth=e.auth,n.hostname=e.hostname||e.host,n.port=e.port,n.pathname||n.search){var d=n.pathname||"",p=n.search||"";n.path=d+p}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var m,g=n.pathname&&"/"===n.pathname.charAt(0),v=e.host||e.pathname&&"/"===e.pathname.charAt(0),y=v||g||n.host&&e.pathname,b=y,w=n.pathname&&n.pathname.split("/")||[],_=n.protocol&&!Er[n.protocol];if(r=e.pathname&&e.pathname.split("/")||[],_&&(n.hostname="",n.port=null,n.host&&(""===w[0]?w[0]=n.host:w.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===r[0]?r[0]=e.host:r.unshift(e.host)),e.host=null),y=y&&(""===r[0]||""===w[0])),v)n.host=e.host||""===e.host?e.host:n.host,n.hostname=e.hostname||""===e.hostname?e.hostname:n.hostname,n.search=e.search,n.query=e.query,w=r;else if(r.length)w||(w=[]),w.pop(),w=w.concat(r),n.search=e.search,n.query=e.query;else if(!Dt(e.search))return _&&(n.hostname=n.host=w.shift(),(m=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=m.shift(),n.host=n.hostname=m.shift())),n.search=e.search,n.query=e.query,jt(n.pathname)&&jt(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n;if(!w.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var S=w.slice(-1)[0],E=(n.host||e.host||w.length>1)&&("."===S||".."===S)||""===S,x=0,I=w.length;I>=0;I--)"."===(S=w[I])?w.splice(I,1):".."===S?(w.splice(I,1),x++):x&&(w.splice(I,1),x--);if(!y&&!b)for(;x--;x)w.unshift("..");!y||""===w[0]||w[0]&&"/"===w[0].charAt(0)||w.unshift(""),E&&"/"!==w.join("/").substr(-1)&&w.push("");var k=""===w[0]||w[0]&&"/"===w[0].charAt(0);return _&&(n.hostname=n.host=k?"":w.length?w.shift():"",(m=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=m.shift(),n.host=n.hostname=m.shift())),(y=y||n.host&&w.length)&&!k&&w.unshift(""),w.length?n.pathname=w.join("/"):(n.pathname=null,n.path=null),jt(n.pathname)&&jt(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},fr.prototype.parseHost=function(){return Pr(this)};var Or,Ar,Tr={},Cr=Fr(H.fetch)&&Fr(H.ReadableStream);function Nr(e){Ar||(Ar=new H.XMLHttpRequest).open("GET",H.location.host?"/":"https://example.com");try{return Ar.responseType=e,Ar.responseType===e}catch(e){return!1}}var Rr=void 0!==H.ArrayBuffer,Mr=Rr&&Fr(H.ArrayBuffer.prototype.slice),Lr=Rr&&Nr("arraybuffer"),jr=!Cr&&Mr&&Nr("ms-stream"),Dr=!Cr&&Rr&&Nr("moz-chunked-arraybuffer"),Br=Fr(Ar.overrideMimeType),Ur=Fr(H.VBArray);function Fr(e){return"function"==typeof e}function Hr(){}function Vr(){Vr.init.call(this)}function zr(e){return void 0===e._maxListeners?Vr.defaultMaxListeners:e._maxListeners}function qr(e,t,r){if(t)e.call(r);else for(var n=e.length,i=Yr(e,n),o=0;o<n;++o)i[o].call(r)}function Kr(e,t,r,n){if(t)e.call(r,n);else for(var i=e.length,o=Yr(e,i),a=0;a<i;++a)o[a].call(r,n)}function $r(e,t,r,n,i){if(t)e.call(r,n,i);else for(var o=e.length,a=Yr(e,o),s=0;s<o;++s)a[s].call(r,n,i)}function Gr(e,t,r,n,i,o){if(t)e.call(r,n,i,o);else for(var a=e.length,s=Yr(e,a),c=0;c<a;++c)s[c].call(r,n,i,o)}function Jr(e,t,r,n){if(t)e.apply(r,n);else for(var i=e.length,o=Yr(e,i),a=0;a<i;++a)o[a].apply(r,n)}function Wr(e,t,r,n){var i,o,a,s;if("function"!=typeof r)throw new TypeError('"listener" argument must be a function');if((o=e._events)?(o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),a=o[t]):(o=e._events=new Hr,e._eventsCount=0),a){if("function"==typeof a?a=o[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),!a.warned&&(i=zr(e))&&i>0&&a.length>i){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=a.length,s=c,"function"==typeof console.warn?console.warn(s):console.log(s)}}else a=o[t]=r,++e._eventsCount;return e}function Xr(e,t,r){var n=!1;function i(){e.removeListener(t,i),n||(n=!0,r.apply(e,arguments))}return i.listener=r,i}function Qr(e){var t=this._events;if(t){var r=t[e];if("function"==typeof r)return 1;if(r)return r.length}return 0}function Yr(e,t){for(var r=new Array(t);t--;)r[t]=e[t];return r}function Zr(){this.head=null,this.tail=null,this.length=0}Ar=null,Hr.prototype=Object.create(null),Vr.EventEmitter=Vr,Vr.usingDomains=!1,Vr.prototype.domain=void 0,Vr.prototype._events=void 0,Vr.prototype._maxListeners=void 0,Vr.defaultMaxListeners=10,Vr.init=function(){this.domain=null,Vr.usingDomains&&undefined.active,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new Hr,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Vr.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},Vr.prototype.getMaxListeners=function(){return zr(this)},Vr.prototype.emit=function(e){var t,r,n,i,o,a,s,c="error"===e;if(a=this._events)c=c&&null==a.error;else if(!c)return!1;if(s=this.domain,c){if(t=arguments[1],!s){if(t instanceof Error)throw t;var u=new Error('Uncaught, unspecified "error" event. ('+t+")");throw u.context=t,u}return t||(t=new Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=s,t.domainThrown=!1,s.emit("error",t),!1}if(!(r=a[e]))return!1;var l="function"==typeof r;switch(n=arguments.length){case 1:qr(r,l,this);break;case 2:Kr(r,l,this,arguments[1]);break;case 3:$r(r,l,this,arguments[1],arguments[2]);break;case 4:Gr(r,l,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=new Array(n-1),o=1;o<n;o++)i[o-1]=arguments[o];Jr(r,l,this,i)}return!0},Vr.prototype.addListener=function(e,t){return Wr(this,e,t,!1)},Vr.prototype.on=Vr.prototype.addListener,Vr.prototype.prependListener=function(e,t){return Wr(this,e,t,!0)},Vr.prototype.once=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.on(e,Xr(this,e,t)),this},Vr.prototype.prependOnceListener=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.prependListener(e,Xr(this,e,t)),this},Vr.prototype.removeListener=function(e,t){var r,n,i,o,a;if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');if(!(n=this._events))return this;if(!(r=n[e]))return this;if(r===t||r.listener&&r.listener===t)0==--this._eventsCount?this._events=new Hr:(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length;o-- >0;)if(r[o]===t||r[o].listener&&r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;if(1===r.length){if(r[0]=void 0,0==--this._eventsCount)return this._events=new Hr,this;delete n[e]}else!function(e,t){for(var r=t,n=r+1,i=e.length;n<i;r+=1,n+=1)e[r]=e[n];e.pop()}(r,i);n.removeListener&&this.emit("removeListener",e,a||t)}return this},Vr.prototype.removeAllListeners=function(e){var t,r;if(!(r=this._events))return this;if(!r.removeListener)return 0===arguments.length?(this._events=new Hr,this._eventsCount=0):r[e]&&(0==--this._eventsCount?this._events=new Hr:delete r[e]),this;if(0===arguments.length){for(var n,i=Object.keys(r),o=0;o<i.length;++o)"removeListener"!==(n=i[o])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=new Hr,this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(t)do{this.removeListener(e,t[t.length-1])}while(t[0]);return this},Vr.prototype.listeners=function(e){var t,r=this._events;return r&&(t=r[e])?"function"==typeof t?[t.listener||t]:function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(t):[]},Vr.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):Qr.call(e,t)},Vr.prototype.listenerCount=Qr,Vr.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]},Zr.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},Zr.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},Zr.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},Zr.prototype.clear=function(){this.head=this.tail=null,this.length=0},Zr.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},Zr.prototype.concat=function(e){if(0===this.length)return re.alloc(0);if(1===this.length)return this.head.data;for(var t=re.allocUnsafe(e>>>0),r=this.head,n=0;r;)r.data.copy(t,n),n+=r.data.length,r=r.next;return t};var en=re.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function tn(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!en(e))throw new Error("Unknown encoding: "+e)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=nn;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=on;break;default:return void(this.write=rn)}this.charBuffer=new re(6),this.charReceived=0,this.charLength=0}function rn(e){return e.toString(this.encoding)}function nn(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function on(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}tn.prototype.write=function(e){for(var t="";this.charLength;){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived<this.charLength)return"";if(e=e.slice(r,e.length),!((i=(t=this.charBuffer.slice(0,this.charLength).toString(this.encoding)).charCodeAt(t.length-1))>=55296&&i<=56319)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var n=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,n),n-=this.charReceived);var i;n=(t+=e.toString(this.encoding,0,n)).length-1;if((i=t.charCodeAt(n))>=55296&&i<=56319){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),e.copy(this.charBuffer,0,0,o),t.substring(0,n)}return t},tn.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var r=e[e.length-t];if(1==t&&r>>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t},tn.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var r=this.charReceived,n=this.charBuffer,i=this.encoding;t+=n.slice(0,r).toString(i)}return t};var an=Object.freeze({__proto__:null,StringDecoder:tn});un.ReadableState=cn;var sn=Pt("stream");function cn(e,t){e=e||{},this.objectMode=!!e.objectMode,t instanceof jn&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var r=e.highWaterMark,n=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:n,this.highWaterMark=~~this.highWaterMark,this.buffer=new Zr,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(this.decoder=new tn(e.encoding),this.encoding=e.encoding)}function un(e){if(!(this instanceof un))return new un(e);this._readableState=new cn(e,this),this.readable=!0,e&&"function"==typeof e.read&&(this._read=e.read),Vr.call(this)}function ln(e,t,r,n,i){var o=function(e,t){var r=null;Be(t)||"string"==typeof t||null==t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));return r}(t,r);if(o)e.emit("error",o);else if(null===r)t.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,hn(e)}(e,t);else if(t.objectMode||r&&r.length>0)if(t.ended&&!i){var a=new Error("stream.push() after EOF");e.emit("error",a)}else if(t.endEmitted&&i){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{var c;!t.decoder||i||n||(r=t.decoder.write(r),c=!t.objectMode&&0===r.length),i||(t.reading=!1),c||(t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,i?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&hn(e))),function(e,t){t.readingMore||(t.readingMore=!0,Ye(pn,e,t))}(e,t)}else i||(t.reading=!1);return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(t)}_t(un,Vr),un.prototype.push=function(e,t){var r=this._readableState;return r.objectMode||"string"!=typeof e||(t=t||r.defaultEncoding)!==r.encoding&&(e=re.from(e,t),t=""),ln(this,r,e,t,!1)},un.prototype.unshift=function(e){return ln(this,this._readableState,e,"",!0)},un.prototype.isPaused=function(){return!1===this._readableState.flowing},un.prototype.setEncoding=function(e){return this._readableState.decoder=new tn(e),this._readableState.encoding=e,this};function fn(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=8388608?e=8388608:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function hn(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(sn("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?Ye(dn,e):dn(e))}function dn(e){sn("emit readable"),e.emit("readable"),vn(e)}function pn(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(sn("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}function mn(e){sn("readable nexttick read 0"),e.read(0)}function gn(e,t){t.reading||(sn("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),vn(e),t.flowing&&!t.reading&&e.read(0)}function vn(e){var t=e._readableState;for(sn("flow",t.flowing);t.flowing&&null!==e.read(););}function yn(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;e<t.head.data.length?(n=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):n=e===t.head.data.length?t.shift():r?function(e,t){var r=t.head,n=1,i=r.data;e-=i.length;for(;r=r.next;){var o=r.data,a=e>o.length?o.length:e;if(a===o.length?i+=o:i+=o.slice(0,e),0===(e-=a)){a===o.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(a));break}++n}return t.length-=n,i}(e,t):function(e,t){var r=re.allocUnsafe(e),n=t.head,i=1;n.data.copy(r),e-=n.data.length;for(;n=n.next;){var o=n.data,a=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,a),0===(e-=a)){a===o.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(a));break}++i}return t.length-=i,r}(e,t);return n}(e,t.buffer,t.decoder),r);var r}function bn(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,Ye(wn,t,e))}function wn(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function _n(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}function Sn(){}function En(e,t,r){this.chunk=e,this.encoding=t,this.callback=r,this.next=null}function xn(e,t){Object.defineProperty(this,"buffer",{get:xt((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")}),e=e||{},this.objectMode=!!e.objectMode,t instanceof jn&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var r=e.highWaterMark,n=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:n,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var i=!1===e.decodeStrings;this.decodeStrings=!i,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){--t.pendingcb,r?Ye(i,n):i(n);e._writableState.errorEmitted=!0,e.emit("error",n)}(e,r,n,t,i);else{var o=An(r);o||r.corked||r.bufferProcessing||!r.bufferedRequest||On(e,r),n?Ye(Pn,e,r,o,i):Pn(e,r,o,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new Nn(this)}function In(e){if(!(this instanceof In||this instanceof jn))return new In(e);this._writableState=new xn(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev)),Vr.call(this)}function kn(e,t,r,n,i,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function Pn(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),Cn(e,t)}function On(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),o=t.corkedRequestsFree;o.entry=r;for(var a=0;r;)i[a]=r,r=r.next,a+=1;kn(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new Nn(t)}else{for(;r;){var s=r.chunk,c=r.encoding,u=r.callback;if(kn(e,t,!1,t.objectMode?1:s.length,s,c,u),r=r.next,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequestCount=0,t.bufferedRequest=r,t.bufferProcessing=!1}function An(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function Tn(e,t){t.prefinished||(t.prefinished=!0,e.emit("prefinish"))}function Cn(e,t){var r=An(t);return r&&(0===t.pendingcb?(Tn(e,t),t.finished=!0,e.emit("finish")):Tn(e,t)),r}function Nn(e){var t=this;this.next=null,this.entry=null,this.finish=function(r){var n=t.entry;for(t.entry=null;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}}un.prototype.read=function(e){sn("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return sn("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?bn(this):hn(this),null;if(0===(e=fn(e,t))&&t.ended)return 0===t.length&&bn(this),null;var n,i=t.needReadable;return sn("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&sn("length less than watermark",i=!0),t.ended||t.reading?sn("reading or ended",i=!1):i&&(sn("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=fn(r,t))),null===(n=e>0?yn(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&bn(this)),null!==n&&this.emit("data",n),n},un.prototype._read=function(e){this.emit("error",new Error("not implemented"))},un.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,sn("pipe count=%d opts=%j",n.pipesCount,t);var i=!t||!1!==t.end?a:u;function o(e){sn("onunpipe"),e===r&&u()}function a(){sn("onend"),e.end()}n.endEmitted?Ye(i):r.once("end",i),e.on("unpipe",o);var s=function(e){return function(){var t=e._readableState;sn("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&e.listeners("data").length&&(t.flowing=!0,vn(e))}}(r);e.on("drain",s);var c=!1;function u(){sn("cleanup"),e.removeListener("close",d),e.removeListener("finish",p),e.removeListener("drain",s),e.removeListener("error",h),e.removeListener("unpipe",o),r.removeListener("end",a),r.removeListener("end",u),r.removeListener("data",f),c=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||s()}var l=!1;function f(t){sn("ondata"),l=!1,!1!==e.write(t)||l||((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==_n(n.pipes,e))&&!c&&(sn("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,l=!0),r.pause())}function h(t){sn("onerror",t),m(),e.removeListener("error",h),0===function(e,t){return e.listeners(t).length}(e,"error")&&e.emit("error",t)}function d(){e.removeListener("finish",p),m()}function p(){sn("onfinish"),e.removeListener("close",d),m()}function m(){sn("unpipe"),r.unpipe(e)}return r.on("data",f),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",h),e.once("close",d),e.once("finish",p),e.emit("pipe",r),n.flowing||(sn("pipe resume"),r.resume()),e},un.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this)),this;if(!e){var r=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<n;i++)r[i].emit("unpipe",this);return this}var o=_n(t.pipes,e);return-1===o||(t.pipes.splice(o,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this)),this},un.prototype.on=function(e,t){var r=Vr.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var n=this._readableState;n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&hn(this):Ye(mn,this))}return r},un.prototype.addListener=un.prototype.on,un.prototype.resume=function(){var e=this._readableState;return e.flowing||(sn("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,Ye(gn,e,t))}(this,e)),this},un.prototype.pause=function(){return sn("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(sn("pause"),this._readableState.flowing=!1,this.emit("pause")),this},un.prototype.wrap=function(e){var t=this._readableState,r=!1,n=this;for(var i in e.on("end",(function(){if(sn("wrapped end"),t.decoder&&!t.ended){var e=t.decoder.end();e&&e.length&&n.push(e)}n.push(null)})),e.on("data",(function(i){(sn("wrapped data"),t.decoder&&(i=t.decoder.write(i)),t.objectMode&&null==i)||(t.objectMode||i&&i.length)&&(n.push(i)||(r=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));return function(e,t){for(var r=0,n=e.length;r<n;r++)t(e[r],r)}(["error","close","destroy","pause","resume"],(function(t){e.on(t,n.emit.bind(n,t))})),n._read=function(t){sn("wrapped _read",t),r&&(r=!1,e.resume())},n},un._fromList=yn,In.WritableState=xn,_t(In,Vr),xn.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},In.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},In.prototype.write=function(e,t,r){var n=this._writableState,i=!1;return"function"==typeof t&&(r=t,t=null),re.isBuffer(e)?t="buffer":t||(t=n.defaultEncoding),"function"!=typeof r&&(r=Sn),n.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),Ye(t,r)}(this,r):function(e,t,r,n){var i=!0,o=!1;return null===r?o=new TypeError("May not write null values to stream"):re.isBuffer(r)||"string"==typeof r||void 0===r||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),Ye(n,o),i=!1),i}(this,n,e,r)&&(n.pendingcb++,i=function(e,t,r,n,i){r=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=re.from(t,r));return t}(t,r,n),re.isBuffer(r)&&(n="buffer");var o=t.objectMode?1:r.length;t.length+=o;var a=t.length<t.highWaterMark;a||(t.needDrain=!0);if(t.writing||t.corked){var s=t.lastBufferedRequest;t.lastBufferedRequest=new En(r,n,i),s?s.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else kn(e,t,!1,o,r,n,i);return a}(this,n,e,t,r)),i},In.prototype.cork=function(){this._writableState.corked++},In.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||On(this,e))},In.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},In.prototype._write=function(e,t,r){r(new Error("not implemented"))},In.prototype._writev=null,In.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(e,t,r){t.ending=!0,Cn(e,t),r&&(t.finished?Ye(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r)},_t(jn,un);for(var Rn=Object.keys(In.prototype),Mn=0;Mn<Rn.length;Mn++){var Ln=Rn[Mn];jn.prototype[Ln]||(jn.prototype[Ln]=In.prototype[Ln])}function jn(e){if(!(this instanceof jn))return new jn(e);un.call(this,e),In.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",Dn)}function Dn(){this.allowHalfOpen||this._writableState.ended||Ye(Bn,this)}function Bn(e){e.end()}function Un(e){this.afterTransform=function(t,r){return function(e,t,r){var n=e._transformState;n.transforming=!1;var i=n.writecb;if(!i)return e.emit("error",new Error("no writecb in Transform class"));n.writechunk=null,n.writecb=null,null!=r&&e.push(r);i(t);var o=e._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&e._read(o.highWaterMark)}(e,t,r)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null,this.writeencoding=null}function Fn(e){if(!(this instanceof Fn))return new Fn(e);jn.call(this,e),this._transformState=new Un(this);var t=this;this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.once("prefinish",(function(){"function"==typeof this._flush?this._flush((function(e){Hn(t,e)})):Hn(t)}))}function Hn(e,t){if(t)return e.emit("error",t);var r=e._writableState,n=e._transformState;if(r.length)throw new Error("Calling transform done when ws.length != 0");if(n.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}function Vn(e){if(!(this instanceof Vn))return new Vn(e);Fn.call(this,e)}function zn(){Vr.call(this)}_t(Fn,jn),Fn.prototype.push=function(e,t){return this._transformState.needTransform=!1,jn.prototype.push.call(this,e,t)},Fn.prototype._transform=function(e,t,r){throw new Error("Not implemented")},Fn.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},Fn.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},_t(Vn,Fn),Vn.prototype._transform=function(e,t,r){r(null,e)},_t(zn,Vr),zn.Readable=un,zn.Writable=In,zn.Duplex=jn,zn.Transform=Fn,zn.PassThrough=Vn,zn.Stream=zn,zn.prototype.pipe=function(e,t){var r=this;function n(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function i(){r.readable&&r.resume&&r.resume()}r.on("data",n),e.on("drain",i),e._isStdio||t&&!1===t.end||(r.on("end",a),r.on("close",s));var o=!1;function a(){o||(o=!0,e.end())}function s(){o||(o=!0,"function"==typeof e.destroy&&e.destroy())}function c(e){if(u(),0===Vr.listenerCount(this,"error"))throw e}function u(){r.removeListener("data",n),e.removeListener("drain",i),r.removeListener("end",a),r.removeListener("close",s),r.removeListener("error",c),e.removeListener("error",c),r.removeListener("end",u),r.removeListener("close",u),e.removeListener("close",u)}return r.on("error",c),e.on("error",c),r.on("end",u),r.on("close",u),e.on("close",u),e.emit("pipe",r),e};var qn=3,Kn=4;function $n(e,t,r){var n,i=this;if(un.call(i),i._mode=r,i.headers={},i.rawHeaders=[],i.trailers={},i.rawTrailers=[],i.on("end",(function(){Ye((function(){i.emit("close")}))})),"fetch"===r){i._fetchResponse=t,i.url=t.url,i.statusCode=t.status,i.statusMessage=t.statusText;for(var o,a,s=t.headers[Symbol.iterator]();o=(a=s.next()).value,!a.done;)i.headers[o[0].toLowerCase()]=o[1],i.rawHeaders.push(o[0],o[1]);var c=t.body.getReader();(n=function(){c.read().then((function(e){i._destroyed||(e.done?i.push(null):(i.push(new re(e.value)),n()))}))})()}else{if(i._xhr=e,i._pos=0,i.url=e.responseURL,i.statusCode=e.status,i.statusMessage=e.statusText,e.getAllResponseHeaders().split(/\r?\n/).forEach((function(e){var t=e.match(/^([^:]+):\s*(.*)/);if(t){var r=t[1].toLowerCase();"set-cookie"===r?(void 0===i.headers[r]&&(i.headers[r]=[]),i.headers[r].push(t[2])):void 0!==i.headers[r]?i.headers[r]+=", "+t[2]:i.headers[r]=t[2],i.rawHeaders.push(t[1],t[2])}})),i._charset="x-user-defined",!Br){var u=i.rawHeaders["mime-type"];if(u){var l=u.match(/;\s*charset=([^;])(;|$)/);l&&(i._charset=l[1].toLowerCase())}i._charset||(i._charset="utf-8")}}}function Gn(e){var t,r=this;In.call(r),r._opts=e,r._body=[],r._headers={},e.auth&&r.setHeader("Authorization","Basic "+new re(e.auth).toString("base64")),Object.keys(e.headers).forEach((function(t){r.setHeader(t,e.headers[t])}));var n=!0;if("disable-fetch"===e.mode)n=!1,t=!0;else if("prefer-streaming"===e.mode)t=!1;else if("allow-wrong-content-type"===e.mode)t=!Br;else{if(e.mode&&"default"!==e.mode&&"prefer-fast"!==e.mode)throw new Error("Invalid value for opts.mode");t=!0}r._mode=function(e,t){return Cr&&t?"fetch":Dr?"moz-chunked-arraybuffer":jr?"ms-stream":Lr&&e?"arraybuffer":Ur&&e?"text:vbarray":"text"}(t,n),r.on("finish",(function(){r._onFinish()}))}_t($n,un),$n.prototype._read=function(){},$n.prototype._onXHRProgress=function(){var e=this,t=e._xhr,r=null;switch(e._mode){case"text:vbarray":if(t.readyState!==Kn)break;try{r=new H.VBArray(t.responseBody).toArray()}catch(e){}if(null!==r){e.push(new re(r));break}case"text":try{r=t.responseText}catch(t){e._mode="text:vbarray";break}if(r.length>e._pos){var n=r.substr(e._pos);if("x-user-defined"===e._charset){for(var i=new re(n.length),o=0;o<n.length;o++)i[o]=255&n.charCodeAt(o);e.push(i)}else e.push(n,e._charset);e._pos=r.length}break;case"arraybuffer":if(t.readyState!==Kn||!t.response)break;r=t.response,e.push(new re(new Uint8Array(r)));break;case"moz-chunked-arraybuffer":if(r=t.response,t.readyState!==qn||!r)break;e.push(new re(new Uint8Array(r)));break;case"ms-stream":if(r=t.response,t.readyState!==qn)break;var a=new H.MSStreamReader;a.onprogress=function(){a.result.byteLength>e._pos&&(e.push(new re(new Uint8Array(a.result.slice(e._pos)))),e._pos=a.result.byteLength)},a.onload=function(){e.push(null)},a.readAsArrayBuffer(r)}e._xhr.readyState===Kn&&"ms-stream"!==e._mode&&e.push(null)},_t(Gn,In);var Jn=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"];function Wn(e,t){"string"==typeof e&&(e=xr(e));var r=-1===H.location.protocol.search(/^https?:$/)?"http:":"",n=e.protocol||r,i=e.hostname||e.host,o=e.port,a=e.path||"/";i&&-1!==i.indexOf(":")&&(i="["+i+"]"),e.url=(i?n+"//"+i:"")+(o?":"+o:"")+a,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var s=new Gn(e);return t&&s.on("response",t),s}function Xn(){}Gn.prototype.setHeader=function(e,t){var r=e.toLowerCase();-1===Jn.indexOf(r)&&(this._headers[r]={name:e,value:t})},Gn.prototype.getHeader=function(e){return this._headers[e.toLowerCase()].value},Gn.prototype.removeHeader=function(e){delete this._headers[e.toLowerCase()]},Gn.prototype._onFinish=function(){var e=this;if(!e._destroyed){var t,r=e._opts,n=e._headers;if("POST"!==r.method&&"PUT"!==r.method&&"PATCH"!==r.method||(t=function(){if(void 0!==Or)return Or;try{new H.Blob([new ArrayBuffer(1)]),Or=!0}catch(e){Or=!1}return Or}()?new H.Blob(e._body.map((function(e){return function(e){if(e instanceof Uint8Array){if(0===e.byteOffset&&e.byteLength===e.buffer.byteLength)return e.buffer;if("function"==typeof e.buffer.slice)return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}if(Be(e)){for(var t=new Uint8Array(e.length),r=e.length,n=0;n<r;n++)t[n]=e[n];return t.buffer}throw new Error("Argument must be a Buffer")}(e)})),{type:(n["content-type"]||{}).value||""}):re.concat(e._body).toString()),"fetch"===e._mode){var i=Object.keys(n).map((function(e){return[n[e].name,n[e].value]}));H.fetch(e._opts.url,{method:e._opts.method,headers:i,body:t,mode:"cors",credentials:r.withCredentials?"include":"same-origin"}).then((function(t){e._fetchResponse=t,e._connect()}),(function(t){e.emit("error",t)}))}else{var o=e._xhr=new H.XMLHttpRequest;try{o.open(e._opts.method,e._opts.url,!0)}catch(t){return void Ye((function(){e.emit("error",t)}))}"responseType"in o&&(o.responseType=e._mode.split(":")[0]),"withCredentials"in o&&(o.withCredentials=!!r.withCredentials),"text"===e._mode&&"overrideMimeType"in o&&o.overrideMimeType("text/plain; charset=x-user-defined"),Object.keys(n).forEach((function(e){o.setRequestHeader(n[e].name,n[e].value)})),e._response=null,o.onreadystatechange=function(){switch(o.readyState){case qn:case Kn:e._onXHRProgress()}},"moz-chunked-arraybuffer"===e._mode&&(o.onprogress=function(){e._onXHRProgress()}),o.onerror=function(){e._destroyed||e.emit("error",new Error("XHR error"))};try{o.send(t)}catch(t){return void Ye((function(){e.emit("error",t)}))}}}},Gn.prototype._onXHRProgress=function(){var e=this;(function(e){try{var t=e.status;return null!==t&&0!==t}catch(e){return!1}})(e._xhr)&&!e._destroyed&&(e._response||e._connect(),e._response._onXHRProgress())},Gn.prototype._connect=function(){var e=this;e._destroyed||(e._response=new $n(e._xhr,e._fetchResponse,e._mode),e.emit("response",e._response))},Gn.prototype._write=function(e,t,r){this._body.push(e),r()},Gn.prototype.abort=Gn.prototype.destroy=function(){var e=this;e._destroyed=!0,e._response&&(e._response._destroyed=!0),e._xhr&&e._xhr.abort()},Gn.prototype.end=function(e,t,r){"function"==typeof e&&(r=e,e=void 0),In.prototype.end.call(this,e,t,r)},Gn.prototype.flushHeaders=function(){},Gn.prototype.setTimeout=function(){},Gn.prototype.setNoDelay=function(){},Gn.prototype.setSocketKeepAlive=function(){},Xn.defaultMaxSockets=4;var Qn={request:Wn,get:function(e,t){var r=Wn(e,t);return r.end(),r},Agent:Xn,METHODS:["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"],STATUS_CODES:{100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Time-out",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Large",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Time-out",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},Yn=Tr.spawn,Zn=function(){var e,t,r=this,n=Qn,i=Qn,o={},a=!1,s={"User-Agent":"node-XMLHttpRequest",Accept:"*/*"},c={},u={},l=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","content-transfer-encoding","cookie","cookie2","date","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"],f=["TRACE","TRACK","CONNECT"],h=!1,d=!1,p={};this.UNSENT=0,this.OPENED=1,this.HEADERS_RECEIVED=2,this.LOADING=3,this.DONE=4,this.readyState=this.UNSENT,this.onreadystatechange=null,this.responseText="",this.responseXML="",this.status=null,this.statusText=null,this.withCredentials=!1;this.open=function(e,t,r,n,i){if(this.abort(),d=!1,!function(e){return e&&-1===f.indexOf(e)}(e))throw new Error("SecurityError: Request method not allowed");o={method:e,url:t.toString(),async:"boolean"!=typeof r||r,user:n||null,password:i||null},m(this.OPENED)},this.setDisableHeaderCheck=function(e){a=e},this.setRequestHeader=function(e,t){if(this.readyState!==this.OPENED)throw new Error("INVALID_STATE_ERR: setRequestHeader can only be called when state is OPEN");if(function(e){return a||e&&-1===l.indexOf(e.toLowerCase())}(e)){if(h)throw new Error("INVALID_STATE_ERR: send flag is true");e=u[e.toLowerCase()]||e,u[e.toLowerCase()]=e,c[e]=c[e]?c[e]+", "+t:t}else console.warn('Refused to set unsafe header "'+e+'"')},this.getResponseHeader=function(e){return"string"==typeof e&&this.readyState>this.OPENED&&t&&t.headers&&t.headers[e.toLowerCase()]&&!d?t.headers[e.toLowerCase()]:null},this.getAllResponseHeaders=function(){if(this.readyState<this.HEADERS_RECEIVED||d)return"";var e="";for(var r in t.headers)"set-cookie"!==r&&"set-cookie2"!==r&&(e+=r+": "+t.headers[r]+"\r\n");return e.substr(0,e.length-2)},this.getRequestHeader=function(e){return"string"==typeof e&&u[e.toLowerCase()]?c[u[e.toLowerCase()]]:""},this.send=function(a){if(this.readyState!==this.OPENED)throw new Error("INVALID_STATE_ERR: connection must be opened before send() is called");if(h)throw new Error("INVALID_STATE_ERR: send has already been called");var l,f=!1,p=!1,g=lr.parse(o.url);switch(g.protocol){case"https:":f=!0;case"http:":l=g.hostname;break;case"file:":p=!0;break;case void 0:case null:case"":l="localhost";break;default:throw new Error("Protocol not supported.")}if(p){if("GET"!==o.method)throw new Error("XMLHttpRequest: Only GET method is supported");if(o.async)Tr.readFile(g.pathname,"utf8",(function(e,t){e?r.handleError(e):(r.status=200,r.responseText=t,m(r.DONE))}));else try{this.responseText=Tr.readFileSync(g.pathname,"utf8"),this.status=200,m(r.DONE)}catch(e){this.handleError(e)}}else{var v=g.port||(f?443:80),y=g.pathname+(g.search?g.search:"");for(var b in s)u[b.toLowerCase()]||(c[b]=s[b]);if(c.Host=l,f&&443===v||80===v||(c.Host+=":"+g.port),o.user){void 0===o.password&&(o.password="");var w=new re(o.user+":"+o.password);c.Authorization="Basic "+w.toString("base64")}"GET"===o.method||"HEAD"===o.method?a=null:a?(c["Content-Length"]=Be(a)?a.length:re.byteLength(a),c["Content-Type"]||(c["Content-Type"]="text/plain;charset=UTF-8")):"POST"===o.method&&(c["Content-Length"]=0);var _={host:l,port:v,path:y,method:o.method,headers:c,agent:!1,withCredentials:r.withCredentials};if(d=!1,o.async){var S=f?i.request:n.request;h=!0,r.dispatchEvent("readystatechange");var E=function(e){r.handleError(e)};e=S(_,(function n(i){if(301!==(t=i).statusCode&&302!==t.statusCode&&303!==t.statusCode&&307!==t.statusCode)t.setEncoding("utf8"),m(r.HEADERS_RECEIVED),r.status=t.statusCode,t.on("data",(function(e){e&&(r.responseText+=e),h&&m(r.LOADING)})),t.on("end",(function(){h&&(m(r.DONE),h=!1)})),t.on("error",(function(e){r.handleError(e)}));else{o.url=t.headers.location;var a=lr.parse(o.url);l=a.hostname;var s={hostname:a.hostname,port:a.port,path:a.path,method:303===t.statusCode?"GET":o.method,headers:c,withCredentials:r.withCredentials};(e=S(s,n).on("error",E)).end()}})).on("error",E),a&&e.write(a),e.end(),r.dispatchEvent("loadstart")}else{var x=".node-xmlhttprequest-content-"+ft.pid,I=".node-xmlhttprequest-sync-"+ft.pid;Tr.writeFileSync(I,"","utf8");for(var k="var http = require('http'), https = require('https'), fs = require('fs');var doRequest = http"+(f?"s":"")+".request;var options = "+JSON.stringify(_)+";var responseText = '';var req = doRequest(options, function(response) {response.setEncoding('utf8');response.on('data', function(chunk) { responseText += chunk;});response.on('end', function() {fs.writeFileSync('"+x+"', JSON.stringify({err: null, data: {statusCode: response.statusCode, headers: response.headers, text: responseText}}), 'utf8');fs.unlinkSync('"+I+"');});response.on('error', function(error) {fs.writeFileSync('"+x+"', JSON.stringify({err: error}), 'utf8');fs.unlinkSync('"+I+"');});}).on('error', function(error) {fs.writeFileSync('"+x+"', JSON.stringify({err: error}), 'utf8');fs.unlinkSync('"+I+"');});"+(a?"req.write('"+JSON.stringify(a).slice(1,-1).replace(/'/g,"\\'")+"');":"")+"req.end();",P=Yn(ft.argv[0],["-e",k]);Tr.existsSync(I););var O=JSON.parse(Tr.readFileSync(x,"utf8"));P.stdin.end(),Tr.unlinkSync(x),O.err?r.handleError(O.err):(t=O.data,r.status=O.data.statusCode,r.responseText=O.data.text,m(r.DONE))}}},this.handleError=function(e){this.status=0,this.statusText=e,this.responseText=e.stack,d=!0,m(this.DONE),this.dispatchEvent("error")},this.abort=function(){e&&(e.abort(),e=null),c=s,this.status=0,this.responseText="",this.responseXML="",d=!0,this.readyState===this.UNSENT||this.readyState===this.OPENED&&!h||this.readyState===this.DONE||(h=!1,m(this.DONE)),this.readyState=this.UNSENT,this.dispatchEvent("abort")},this.addEventListener=function(e,t){e in p||(p[e]=[]),p[e].push(t)},this.removeEventListener=function(e,t){e in p&&(p[e]=p[e].filter((function(e){return e!==t})))},this.dispatchEvent=function(e){if("function"==typeof r["on"+e]&&r["on"+e](),e in p)for(var t=0,n=p[e].length;t<n;t++)p[e][t].call(r)};var m=function(e){e!=r.LOADING&&r.readyState===e||(r.readyState=e,(o.async||r.readyState<r.OPENED||r.readyState===r.DONE)&&r.dispatchEvent("readystatechange"),r.readyState!==r.DONE||d||(r.dispatchEvent("load"),r.dispatchEvent("loadend")))}},ei=1e3,ti=60*ei,ri=60*ti,ni=24*ri,ii=7*ni,oi=365.25*ni,ai=function(e,t){t=t||{};var r=typeof e;if("string"===r&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var r=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return r*oi;case"weeks":case"week":case"w":return r*ii;case"days":case"day":case"d":return r*ni;case"hours":case"hour":case"hrs":case"hr":case"h":return r*ri;case"minutes":case"minute":case"mins":case"min":case"m":return r*ti;case"seconds":case"second":case"secs":case"sec":case"s":return r*ei;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}(e);if("number"===r&&isFinite(e))return t.long?function(e){var t=Math.abs(e);if(t>=ni)return si(e,t,ni,"day");if(t>=ri)return si(e,t,ri,"hour");if(t>=ti)return si(e,t,ti,"minute");if(t>=ei)return si(e,t,ei,"second");return e+" ms"}(e):function(e){var t=Math.abs(e);if(t>=ni)return Math.round(e/ni)+"d";if(t>=ri)return Math.round(e/ri)+"h";if(t>=ti)return Math.round(e/ti)+"m";if(t>=ei)return Math.round(e/ei)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function si(e,t,r,n){var i=t>=1.5*r;return Math.round(e/r)+" "+n+(i?"s":"")}var ci=function(e){function t(e){let n,i=null;function o(...e){if(!o.enabled)return;const r=o,i=Number(new Date),a=i-(n||i);r.diff=a,r.prev=n,r.curr=i,n=i,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(n,i)=>{if("%%"===n)return"%";s++;const o=t.formatters[i];if("function"==typeof o){const t=e[s];n=o.call(r,t),e.splice(s,1),s--}return n}),t.formatArgs.call(r,e);(r.log||t.log).apply(r,e)}return o.namespace=e,o.useColors=t.useColors(),o.color=t.selectColor(e),o.extend=r,o.destroy=t.destroy,Object.defineProperty(o,"enabled",{enumerable:!0,configurable:!1,get:()=>null===i?t.enabled(e):i,set:e=>{i=e}}),"function"==typeof t.init&&t.init(o),o}function r(e,r){const n=t(this.namespace+(void 0===r?":":r)+e);return n.log=this.log,n}function n(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(n),...t.skips.map(n).map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){let r;t.save(e),t.names=[],t.skips=[];const n=("string"==typeof e?e:"").split(/[\s,]+/),i=n.length;for(r=0;r<i;r++)n[r]&&("-"===(e=n[r].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let r,n;for(r=0,n=t.skips.length;r<n;r++)if(t.skips[r].test(e))return!1;for(r=0,n=t.names.length;r<n;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=ai,t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(r=>{t[r]=e[r]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t},ui=tr((function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,i=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(n++,"%c"===e&&(i=n))}),t.splice(i,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}!e&&void 0!==ft&&"env"in ft&&(e=ft.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=ci(t);const{formatters:r}=e.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}));ui.formatArgs,ui.save,ui.load,ui.useColors,ui.storage,ui.destroy,ui.colors,ui.log;const li=ui("request");function fi(e){return new Promise((t,r)=>{const n=e.url;n||r(new Error("URL is missing"));const i=new("undefined"==typeof XMLHttpRequest?Zn:XMLHttpRequest);i.onload=()=>{if(i.status>=200&&i.status<300)console.log({requestResponseText:JSON.parse(i.responseText),url:n}),t(i.responseText);else{const e=`Error fetching url:${n}; status code:${i.status}`;r(new Error(e))}},i.ontimeout=e=>{console.log("ontimeout",e)},i.onreadystatechange=()=>{404===i.status&&r(new Error(`Error fetching url:${n}; status code:${i.status}`))},i.onerror=()=>{li("Request failed with error "+i.responseText),r(new Error(i.responseText))},i.open(e.method||"GET",n),e.body?i.send(JSON.stringify(e.body)):i.send()})}function hi(e,t,r){const n=e.includes("?")?"&":"?";return`${e}${n}${t}=${r}`}const di=ui("blockchainConnectors");function pi(e,t,r){if(function(e){return e===n.V1_1||e===n.V1_2}(t))return r.v1;switch(e){case g[p.Bitcoin].code:case g[p.Regtest].code:case g[p.Testnet].code:case g[p.Mocknet].code:return r.bitcoin;case g[p.Ethmain].code:case g[p.Ethropst].code:case g[p.Ethrinkeby].code:return r.ethereum}throw new M(u,P("errors","lookForTxInvalidChain"))}function mi(t){return e(this,void 0,void 0,(function*(){let e;try{e=yield function e(t,r,n=[]){if((t=Array.from(t)).length<r)return Promise.reject(new M(u,P("errors","couldNotConfirmTx")));const i=t.map((e,t)=>e.then(()=>t).catch(e=>{throw di(e),t}));return Promise.race(i).then(i=>(t.splice(i,1)[0].then(e=>n.push(e)),1===r?n:e(t,r-1,n))).catch(i=>(t.splice(i,1),e(t,r,n)))}(t,_)}catch(e){throw new M(u,e.message)}if(!e||0===e.length)throw new M(u,P("errors","lookForTxCouldNotConfirm"));const r=e[0];for(let t=1;t<e.length;t++){const n=e[t];if(r.issuingAddress!==n.issuingAddress)throw new M(u,P("errors","lookForTxDifferentAddresses"));if(r.remoteHash!==n.remoteHash)throw new M(u,P("errors","lookForTxDifferentRemoteHashes"))}return r}))}function gi(t,r,n,i){return e(this,void 0,void 0,(function*(){try{const e=function(e,t,r){if(_>e.length)throw new M(u,P("errors","lookForTxInvalidAppConfig"));const n=[];console.log({promises:n});const i=e.length;for(let o=0;o<i;o++)n.push(e[o].getTxData(t,r));return console.log({queue0GetTxData:e[0].getTxData(t,r)}),console.log({queue1GetTxData:e[1].getTxData(t,r)}),n}(t[r],n,i);return console.log({race:e}),yield mi(e)}catch(e){if(r<t.length-1)return r++,yield gi(t,r,n,i);throw e}}))}function vi(e){const t=Date.parse(e);if(t)return new Date(t);const r=function(e){let t=e.slice(0,-5).split(/\D/).map((function(e){return parseInt(e,10)||0}));t[1]-=1,t=new Date(Date.UTC.apply(Date,t));const r=e.slice(-5);let n=parseInt(r,10)/100;return"+"===r.slice(0,1)&&(n*=-1),t.setHours(t.getHours()+n),t.getTime()}(e);return r||function(e){let t,r;const n=/^(\d{4}\-\d\d\-\d\d([tT][\d:\.]*)?)([zZ]|([+\-])(\d\d):?(\d\d))?$/.exec(e)||[];return n[1]?(t=n[1].split(/\D/).map((function(e){return parseInt(e,10)||0})),t[1]-=1,t=new Date(Date.UTC.apply(Date,t)),t.getDate()?(n[5]&&(r=parseInt(n[5],10)/100*60,n[6]&&(r+=parseInt(n[6],10)),"+"===n[4]&&(r*=-1),r&&t.setUTCMinutes(t.getUTCMinutes()+r)),t):null):null}(e)}function yi(e){return""===e?"":vi(""+e)}function bi(e,t=null){const r=e.created?yi(e.created):null,n=e.revoked?yi(e.revoked):null,i=e.expires?yi(e.expires):null;let o=t;if(!t){o=(e.id||e.publicKey).replace("ecdsa-koblitz-pubkey:","")}return new N(o,r,n,i)}var wi={addresses:I,certificates:U,chains:L,explorerAPIs:F,i18n:A,verifier:Object.freeze({__proto__:null,getIssuerProfile:async function(e){const t=P("errors","getIssuerProfile");if(!e)throw new M("getIssuerProfile",`${t} - ${P("errors","issuerProfileNotSet")}`);if("object"==typeof e&&(e=e.id),!function(e){return/^(ftp|http|https):\/\/[^ "]+$/.test(e)}(e))throw new M("getIssuerProfile",`${t} - ${P("errors","issuerProfileNotSet")}`);let r=await fi({url:e}).catch(()=>{throw new M("getIssuerProfile",t)});if(r=JSON.parse(r),!function(e){const t=["issuer","profile"],{type:r}=e;return!!r&&(Array.isArray(r)?r.some(e=>t.indexOf(e.toLowerCase())>-1):t.indexOf(r.toLowerCase())>-1)}(r)&&!function(e){const{issuer_key:t,revocation_key:r,issuerKeys:n,revocationKeys:i}=e;return!(!t||!r)||!(!n||!i)}(r))throw new M("getIssuerProfile",`${t} - ${P("errors","issuerProfileInvalid")}`);return r},getRevokedAssertions:function(t,r){var n;return e(this,void 0,void 0,(function*(){if(!t)return[];const e=P("errors","getRevokedAssertions");r&&(t=hi(t,"assertionId",encodeURIComponent(r)));const i=yield fi({url:t}).catch(()=>{throw new M("parseIssuerKeys",e)}),o=JSON.parse(i);return null!==(n=o.revokedAssertions)&&void 0!==n?n:[]}))},lookForTx:function({transactionId:t,chain:r,certificateVersion:n,explorerAPIs:i}){return e(this,void 0,void 0,(function*(){const e=function({defaultAPIs:e,customAPIs:t}){const r=[e];if(null==t?void 0:t.length){const e=t[0].priority;r.splice(e,0,t)}const n=e.concat(t).length;if(_>n)throw new M(u,P("errors","lookForTxInvalidAppConfig"));return r}({defaultAPIs:pi(r,n,i),customAPIs:i.custom});console.log({chain:r,certificateVersion:n,explorerAPIs:i}),console.log({lookupQueues:e});return yield gi(e,0,t,r)}))},parseIssuerKeys:function(e){try{const t={};if("@context"in e){const r=e.publicKey||e.publicKeys;for(let e=0;e<r.length;e++){const n=bi(r[e]);t[n.publicKey]=n}}else{const r=bi({},(e.issuerKeys||[])[0].key);t[r.publicKey]=r}return t}catch(e){throw new M("parseIssuerKeys",P("errors","parseIssuerKeys"))}},parseRevocationKey:function(e){return e&&Object.prototype.hasOwnProperty.call(e,"revocationKeys")&&e.revocationKeys.length>0?e.revocationKeys[0].key:null}})},_i=["merkleRoot","targetHash","anchors"],Si={merkleRoot:{type:"string",minLength:64,maxLength:64},targetHash:{type:"string",minLength:64,maxLength:64},anchors:{type:"array",minLength:1,items:{type:"string"}}},Ei={type:"object",required:_i,properties:Si},xi=Object.freeze({__proto__:null,type:"object",required:_i,properties:Si,default:Ei}),Ii=tr((function(e,t){ /** @license URI.js v4.2.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */ !function(e){function t(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];if(t.length>1){t[0]=t[0].slice(0,-1);for(var n=t.length-1,i=1;i<n;++i)t[i]=t[i].slice(1,-1);return t[n]=t[n].slice(1),t.join("")}return t[0]}function r(e){return"(?:"+e+")"}function n(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function i(e){return e.toUpperCase()}function o(e){return null!=e?e instanceof Array?e:"number"!=typeof e.length||e.split||e.setInterval||e.call?[e]:Array.prototype.slice.call(e):[]}function a(e,t){var r=e;if(t)for(var n in t)r[n]=t[n];return r}function s(e){var n="[A-Za-z]",i="[0-9]",o=t(i,"[A-Fa-f]"),a=r(r("%[EFef]"+o+"%"+o+o+"%"+o+o)+"|"+r("%[89A-Fa-f]"+o+"%"+o+o)+"|"+r("%"+o+o)),s="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",c=t("[\\:\\/\\?\\#\\[\\]\\@]",s),u=e?"[\\uE000-\\uF8FF]":"[]",l=t(n,i,"[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]"),f=(r(n+t(n,i,"[\\+\\-\\.]")+"*"),r(r(a+"|"+t(l,s,"[\\:]"))+"*"),r(r("25[0-5]")+"|"+r("2[0-4]"+i)+"|"+r("1"+i+i)+"|"+r("0?[1-9]"+i)+"|0?0?"+i)),h=r(f+"\\."+f+"\\."+f+"\\."+f),d=r(o+"{1,4}"),p=r(r(d+"\\:"+d)+"|"+h),m=r(r(d+"\\:")+"{6}"+p),g=r("\\:\\:"+r(d+"\\:")+"{5}"+p),v=r(r(d)+"?\\:\\:"+r(d+"\\:")+"{4}"+p),y=r(r(r(d+"\\:")+"{0,1}"+d)+"?\\:\\:"+r(d+"\\:")+"{3}"+p),b=r(r(r(d+"\\:")+"{0,2}"+d)+"?\\:\\:"+r(d+"\\:")+"{2}"+p),w=r(r(r(d+"\\:")+"{0,3}"+d)+"?\\:\\:"+d+"\\:"+p),_=r(r(r(d+"\\:")+"{0,4}"+d)+"?\\:\\:"+p),S=r(r(r(d+"\\:")+"{0,5}"+d)+"?\\:\\:"+d),E=r(r(r(d+"\\:")+"{0,6}"+d)+"?\\:\\:"),x=r([m,g,v,y,b,w,_,S,E].join("|")),I=r(r(l+"|"+a)+"+"),k=(r("[vV]"+o+"+\\."+t(l,s,"[\\:]")+"+"),r(r(a+"|"+t(l,s))+"*"),r(a+"|"+t(l,s,"[\\:\\@]")));return r(r(a+"|"+t(l,s,"[\\@]"))+"+"),r(r(k+"|"+t("[\\/\\?]",u))+"*"),{NOT_SCHEME:new RegExp(t("[^]",n,i,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(t("[^\\%\\:]",l,s),"g"),NOT_HOST:new RegExp(t("[^\\%\\[\\]\\:]",l,s),"g"),NOT_PATH:new RegExp(t("[^\\%\\/\\:\\@]",l,s),"g"),NOT_PATH_NOSCHEME:new RegExp(t("[^\\%\\/\\@]",l,s),"g"),NOT_QUERY:new RegExp(t("[^\\%]",l,s,"[\\:\\@\\/\\?]",u),"g"),NOT_FRAGMENT:new RegExp(t("[^\\%]",l,s,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(t("[^]",l,s),"g"),UNRESERVED:new RegExp(l,"g"),OTHER_CHARS:new RegExp(t("[^\\%]",l,c),"g"),PCT_ENCODED:new RegExp(a,"g"),IPV4ADDRESS:new RegExp("^("+h+")$"),IPV6ADDRESS:new RegExp("^\\[?("+x+")"+r(r("\\%25|\\%(?!"+o+"{2})")+"("+I+")")+"?\\]?$")}}var c=s(!1),u=s(!0),l=function(){function e(e,t){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{!n&&s.return&&s.return()}finally{if(i)throw o}}return r}return function(t,r){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),f=function(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)},h=2147483647,d=36,p=1,m=26,g=38,v=700,y=72,b=128,w="-",_=/^xn--/,S=/[^\0-\x7E]/,E=/[\x2E\u3002\uFF0E\uFF61]/g,x={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},I=d-p,k=Math.floor,P=String.fromCharCode;function O(e){throw new RangeError(x[e])}function A(e,t){for(var r=[],n=e.length;n--;)r[n]=t(e[n]);return r}function T(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+A((e=e.replace(E,".")).split("."),t).join(".")}function C(e){for(var t=[],r=0,n=e.length;r<n;){var i=e.charCodeAt(r++);if(i>=55296&&i<=56319&&r<n){var o=e.charCodeAt(r++);56320==(64512&o)?t.push(((1023&i)<<10)+(1023&o)+65536):(t.push(i),r--)}else t.push(i)}return t}var N=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:d},R=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},M=function(e,t,r){var n=0;for(e=r?k(e/v):e>>1,e+=k(e/t);e>I*m>>1;n+=d)e=k(e/I);return k(n+(I+1)*e/(e+g))},L=function(e){var t=[],r=e.length,n=0,i=b,o=y,a=e.lastIndexOf(w);a<0&&(a=0);for(var s=0;s<a;++s)e.charCodeAt(s)>=128&&O("not-basic"),t.push(e.charCodeAt(s));for(var c=a>0?a+1:0;c<r;){for(var u=n,l=1,f=d;;f+=d){c>=r&&O("invalid-input");var g=N(e.charCodeAt(c++));(g>=d||g>k((h-n)/l))&&O("overflow"),n+=g*l;var v=f<=o?p:f>=o+m?m:f-o;if(g<v)break;var _=d-v;l>k(h/_)&&O("overflow"),l*=_}var S=t.length+1;o=M(n-u,S,0==u),k(n/S)>h-i&&O("overflow"),i+=k(n/S),n%=S,t.splice(n++,0,i)}return String.fromCodePoint.apply(String,t)},j=function(e){var t=[],r=(e=C(e)).length,n=b,i=0,o=y,a=!0,s=!1,c=void 0;try{for(var u,l=e[Symbol.iterator]();!(a=(u=l.next()).done);a=!0){var f=u.value;f<128&&t.push(P(f))}}catch(e){s=!0,c=e}finally{try{!a&&l.return&&l.return()}finally{if(s)throw c}}var g=t.length,v=g;for(g&&t.push(w);v<r;){var _=h,S=!0,E=!1,x=void 0;try{for(var I,A=e[Symbol.iterator]();!(S=(I=A.next()).done);S=!0){var T=I.value;T>=n&&T<_&&(_=T)}}catch(e){E=!0,x=e}finally{try{!S&&A.return&&A.return()}finally{if(E)throw x}}var N=v+1;_-n>k((h-i)/N)&&O("overflow"),i+=(_-n)*N,n=_;var L=!0,j=!1,D=void 0;try{for(var B,U=e[Symbol.iterator]();!(L=(B=U.next()).done);L=!0){var F=B.value;if(F<n&&++i>h&&O("overflow"),F==n){for(var H=i,V=d;;V+=d){var z=V<=o?p:V>=o+m?m:V-o;if(H<z)break;var q=H-z,K=d-z;t.push(P(R(z+q%K,0))),H=k(q/K)}t.push(P(R(H,0))),o=M(i,N,v==g),i=0,++v}}}catch(e){j=!0,D=e}finally{try{!L&&U.return&&U.return()}finally{if(j)throw D}}++i,++n}return t.join("")},D=function(e){return T(e,(function(e){return _.test(e)?L(e.slice(4).toLowerCase()):e}))},B=function(e){return T(e,(function(e){return S.test(e)?"xn--"+j(e):e}))},U={version:"2.1.0",ucs2:{decode:C,encode:function(e){return String.fromCodePoint.apply(String,f(e))}},decode:L,encode:j,toASCII:B,toUnicode:D},F={};function H(e){var t=e.charCodeAt(0);return t<16?"%0"+t.toString(16).toUpperCase():t<128?"%"+t.toString(16).toUpperCase():t<2048?"%"+(t>>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function V(e){for(var t="",r=0,n=e.length;r<n;){var i=parseInt(e.substr(r+1,2),16);if(i<128)t+=String.fromCharCode(i),r+=3;else if(i>=194&&i<224){if(n-r>=6){var o=parseInt(e.substr(r+4,2),16);t+=String.fromCharCode((31&i)<<6|63&o)}else t+=e.substr(r,6);r+=6}else if(i>=224){if(n-r>=9){var a=parseInt(e.substr(r+4,2),16),s=parseInt(e.substr(r+7,2),16);t+=String.fromCharCode((15&i)<<12|(63&a)<<6|63&s)}else t+=e.substr(r,9);r+=9}else t+=e.substr(r,3),r+=3}return t}function z(e,t){function r(e){var r=V(e);return r.match(t.UNRESERVED)?r:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,r).replace(t.NOT_USERINFO,H).replace(t.PCT_ENCODED,i)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_HOST,H).replace(t.PCT_ENCODED,i)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,r).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,H).replace(t.PCT_ENCODED,i)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,r).replace(t.NOT_QUERY,H).replace(t.PCT_ENCODED,i)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,r).replace(t.NOT_FRAGMENT,H).replace(t.PCT_ENCODED,i)),e}function q(e){return e.replace(/^0*(.*)/,"$1")||"0"}function K(e,t){var r=e.match(t.IPV4ADDRESS)||[],n=l(r,2)[1];return n?n.split(".").map(q).join("."):e}function $(e,t){var r=e.match(t.IPV6ADDRESS)||[],n=l(r,3),i=n[1],o=n[2];if(i){for(var a=i.toLowerCase().split("::").reverse(),s=l(a,2),c=s[0],u=s[1],f=u?u.split(":").map(q):[],h=c.split(":").map(q),d=t.IPV4ADDRESS.test(h[h.length-1]),p=d?7:8,m=h.length-p,g=Array(p),v=0;v<p;++v)g[v]=f[v]||h[m+v]||"";d&&(g[p-1]=K(g[p-1],t));var y=g.reduce((function(e,t,r){if(!t||"0"===t){var n=e[e.length-1];n&&n.index+n.length===r?n.length++:e.push({index:r,length:1})}return e}),[]).sort((function(e,t){return t.length-e.length}))[0],b=void 0;if(y&&y.length>1){var w=g.slice(0,y.index),_=g.slice(y.index+y.length);b=w.join(":")+"::"+_.join(":")}else b=g.join(":");return o&&(b+="%"+o),b}return e}var G=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,J=void 0==="".match(/(){0}/)[1];function W(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={},n=!1!==t.iri?u:c;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var i=e.match(G);if(i){J?(r.scheme=i[1],r.userinfo=i[3],r.host=i[4],r.port=parseInt(i[5],10),r.path=i[6]||"",r.query=i[7],r.fragment=i[8],isNaN(r.port)&&(r.port=i[5])):(r.scheme=i[1]||void 0,r.userinfo=-1!==e.indexOf("@")?i[3]:void 0,r.host=-1!==e.indexOf("//")?i[4]:void 0,r.port=parseInt(i[5],10),r.path=i[6]||"",r.query=-1!==e.indexOf("?")?i[7]:void 0,r.fragment=-1!==e.indexOf("#")?i[8]:void 0,isNaN(r.port)&&(r.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?i[4]:void 0)),r.host&&(r.host=$(K(r.host,n),n)),void 0!==r.scheme||void 0!==r.userinfo||void 0!==r.host||void 0!==r.port||r.path||void 0!==r.query?void 0===r.scheme?r.reference="relative":void 0===r.fragment?r.reference="absolute":r.reference="uri":r.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==r.reference&&(r.error=r.error||"URI is not a "+t.reference+" reference.");var o=F[(t.scheme||r.scheme||"").toLowerCase()];if(t.unicodeSupport||o&&o.unicodeSupport)z(r,n);else{if(r.host&&(t.domainHost||o&&o.domainHost))try{r.host=U.toASCII(r.host.replace(n.PCT_ENCODED,V).toLowerCase())}catch(e){r.error=r.error||"Host's domain name can not be converted to ASCII via punycode: "+e}z(r,c)}o&&o.parse&&o.parse(r,t)}else r.error=r.error||"URI can not be parsed.";return r}function X(e,t){var r=!1!==t.iri?u:c,n=[];return void 0!==e.userinfo&&(n.push(e.userinfo),n.push("@")),void 0!==e.host&&n.push($(K(String(e.host),r),r).replace(r.IPV6ADDRESS,(function(e,t,r){return"["+t+(r?"%25"+r:"")+"]"}))),"number"==typeof e.port&&(n.push(":"),n.push(e.port.toString(10))),n.length?n.join(""):void 0}var Q=/^\.\.?\//,Y=/^\/\.(\/|$)/,Z=/^\/\.\.(\/|$)/,ee=/^\/?(?:.|\n)*?(?=\/|$)/;function te(e){for(var t=[];e.length;)if(e.match(Q))e=e.replace(Q,"");else if(e.match(Y))e=e.replace(Y,"/");else if(e.match(Z))e=e.replace(Z,"/"),t.pop();else if("."===e||".."===e)e="";else{var r=e.match(ee);if(!r)throw new Error("Unexpected dot segment condition");var n=r[0];e=e.slice(n.length),t.push(n)}return t.join("")}function re(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.iri?u:c,n=[],i=F[(t.scheme||e.scheme||"").toLowerCase()];if(i&&i.serialize&&i.serialize(e,t),e.host)if(r.IPV6ADDRESS.test(e.host));else if(t.domainHost||i&&i.domainHost)try{e.host=t.iri?U.toUnicode(e.host):U.toASCII(e.host.replace(r.PCT_ENCODED,V).toLowerCase())}catch(r){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+r}z(e,r),"suffix"!==t.reference&&e.scheme&&(n.push(e.scheme),n.push(":"));var o=X(e,t);if(void 0!==o&&("suffix"!==t.reference&&n.push("//"),n.push(o),e.path&&"/"!==e.path.charAt(0)&&n.push("/")),void 0!==e.path){var a=e.path;t.absolutePath||i&&i.absolutePath||(a=te(a)),void 0===o&&(a=a.replace(/^\/\//,"/%2F")),n.push(a)}return void 0!==e.query&&(n.push("?"),n.push(e.query)),void 0!==e.fragment&&(n.push("#"),n.push(e.fragment)),n.join("")}function ne(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={};return arguments[3]||(e=W(re(e,r),r),t=W(re(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(n.scheme=t.scheme,n.userinfo=t.userinfo,n.host=t.host,n.port=t.port,n.path=te(t.path||""),n.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(n.userinfo=t.userinfo,n.host=t.host,n.port=t.port,n.path=te(t.path||""),n.query=t.query):(t.path?("/"===t.path.charAt(0)?n.path=te(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?n.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:n.path=t.path:n.path="/"+t.path,n.path=te(n.path)),n.query=t.query):(n.path=e.path,void 0!==t.query?n.query=t.query:n.query=e.query),n.userinfo=e.userinfo,n.host=e.host,n.port=e.port),n.scheme=e.scheme),n.fragment=t.fragment,n}function ie(e,t,r){var n=a({scheme:"null"},r);return re(ne(W(e,n),W(t,n),n,!0),n)}function oe(e,t){return"string"==typeof e?e=re(W(e,t),t):"object"===n(e)&&(e=W(re(e,t),t)),e}function ae(e,t,r){return"string"==typeof e?e=re(W(e,r),r):"object"===n(e)&&(e=re(e,r)),"string"==typeof t?t=re(W(t,r),r):"object"===n(t)&&(t=re(t,r)),e===t}function se(e,t){return e&&e.toString().replace(t&&t.iri?u.ESCAPE:c.ESCAPE,H)}function ce(e,t){return e&&e.toString().replace(t&&t.iri?u.PCT_ENCODED:c.PCT_ENCODED,V)}var ue={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){return e.port!==("https"!==String(e.scheme).toLowerCase()?80:443)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},le={scheme:"https",domainHost:ue.domainHost,parse:ue.parse,serialize:ue.serialize},fe={},he="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",de="[0-9A-Fa-f]",pe=r(r("%[EFef]"+de+"%"+de+de+"%"+de+de)+"|"+r("%[89A-Fa-f]"+de+"%"+de+de)+"|"+r("%"+de+de)),me="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",ge=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),ve="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",ye=new RegExp(he,"g"),be=new RegExp(pe,"g"),we=new RegExp(t("[^]",me,"[\\.]",'[\\"]',ge),"g"),_e=new RegExp(t("[^]",he,ve),"g"),Se=_e;function Ee(e){var t=V(e);return t.match(ye)?t:e}var xe={scheme:"mailto",parse:function(e,t){var r=e,n=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var i=!1,o={},a=r.query.split("&"),s=0,c=a.length;s<c;++s){var u=a[s].split("=");switch(u[0]){case"to":for(var l=u[1].split(","),f=0,h=l.length;f<h;++f)n.push(l[f]);break;case"subject":r.subject=ce(u[1],t);break;case"body":r.body=ce(u[1],t);break;default:i=!0,o[ce(u[0],t)]=ce(u[1],t)}}i&&(r.headers=o)}r.query=void 0;for(var d=0,p=n.length;d<p;++d){var m=n[d].split("@");if(m[0]=ce(m[0]),t.unicodeSupport)m[1]=ce(m[1],t).toLowerCase();else try{m[1]=U.toASCII(ce(m[1],t).toLowerCase())}catch(e){r.error=r.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}n[d]=m.join("@")}return r},serialize:function(e,t){var r=e,n=o(e.to);if(n){for(var a=0,s=n.length;a<s;++a){var c=String(n[a]),u=c.lastIndexOf("@"),l=c.slice(0,u).replace(be,Ee).replace(be,i).replace(we,H),f=c.slice(u+1);try{f=t.iri?U.toUnicode(f):U.toASCII(ce(f,t).toLowerCase())}catch(e){r.error=r.error||"Email address's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+e}n[a]=l+"@"+f}r.path=n.join(",")}var h=e.headers=e.headers||{};e.subject&&(h.subject=e.subject),e.body&&(h.body=e.body);var d=[];for(var p in h)h[p]!==fe[p]&&d.push(p.replace(be,Ee).replace(be,i).replace(_e,H)+"="+h[p].replace(be,Ee).replace(be,i).replace(Se,H));return d.length&&(r.query=d.join("&")),r}},Ie=/^([^\:]+)\:(.*)/,ke={scheme:"urn",parse:function(e,t){var r=e.path&&e.path.match(Ie),n=e;if(r){var i=t.scheme||n.scheme||"urn",o=r[1].toLowerCase(),a=r[2],s=i+":"+(t.nid||o),c=F[s];n.nid=o,n.nss=a,n.path=void 0,c&&(n=c.parse(n,t))}else n.error=n.error||"URN can not be parsed.";return n},serialize:function(e,t){var r=t.scheme||e.scheme||"urn",n=e.nid,i=r+":"+(t.nid||n),o=F[i];o&&(e=o.serialize(e,t));var a=e,s=e.nss;return a.path=(n||t.nid)+":"+s,a}},Pe=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,Oe={scheme:"urn:uuid",parse:function(e,t){var r=e;return r.uuid=r.nss,r.nss=void 0,t.tolerant||r.uuid&&r.uuid.match(Pe)||(r.error=r.error||"UUID is not valid."),r},serialize:function(e,t){var r=e;return r.nss=(e.uuid||"").toLowerCase(),r}};F[ue.scheme]=ue,F[le.scheme]=le,F[xe.scheme]=xe,F[ke.scheme]=ke,F[Oe.scheme]=Oe,e.SCHEMES=F,e.pctEncChar=H,e.pctDecChars=V,e.parse=W,e.removeDotSegments=te,e.serialize=re,e.resolveComponents=ne,e.resolve=ie,e.normalize=oe,e.equal=ae,e.escapeComponent=se,e.unescapeComponent=ce,Object.defineProperty(e,"__esModule",{value:!0})}(t)}));er(Ii);var ki=Array.isArray,Pi=Object.keys,Oi=Object.prototype.hasOwnProperty,Ai=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){var n,i,o,a=ki(t),s=ki(r);if(a&&s){if((i=t.length)!=r.length)return!1;for(n=i;0!=n--;)if(!e(t[n],r[n]))return!1;return!0}if(a!=s)return!1;var c=t instanceof Date,u=r instanceof Date;if(c!=u)return!1;if(c&&u)return t.getTime()==r.getTime();var l=t instanceof RegExp,f=r instanceof RegExp;if(l!=f)return!1;if(l&&f)return t.toString()==r.toString();var h=Pi(t);if((i=h.length)!==Pi(r).length)return!1;for(n=i;0!=n--;)if(!Oi.call(r,h[n]))return!1;for(n=i;0!=n--;)if(!e(t[o=h[n]],r[o]))return!1;return!0}return t!=t&&r!=r},Ti={copy:function(e,t){for(var r in t=t||{},e)t[r]=e[r];return t},checkDataType:Ci,checkDataTypes:function(e,t){switch(e.length){case 1:return Ci(e[0],t,!0);default:var r="",n=Ri(e);for(var i in n.array&&n.object&&(r=n.null?"(":"(!"+t+" || ",r+="typeof "+t+' !== "object")',delete n.null,delete n.array,delete n.object),n.number&&delete n.integer,n)r+=(r?" && ":"")+Ci(i,t,!0);return r}},coerceToTypes:function(e,t){if(Array.isArray(t)){for(var r=[],n=0;n<t.length;n++){var i=t[n];(Ni[i]||"array"===e&&"array"===i)&&(r[r.length]=i)}if(r.length)return r}else{if(Ni[t])return[t];if("array"===e&&"array"===t)return["array"]}},toHash:Ri,getProperty:ji,escapeQuotes:Di,equal:Ai,ucs2length:function(e){for(var t,r=0,n=e.length,i=0;i<n;)r++,(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<n&&56320==(64512&(t=e.charCodeAt(i)))&&i++;return r},varOccurences:function(e,t){t+="[^0-9]";var r=e.match(new RegExp(t,"g"));return r?r.length:0},varReplace:function(e,t,r){return t+="([^0-9])",r=r.replace(/\$/g,"$$$$"),e.replace(new RegExp(t,"g"),r+"$1")},cleanUpCode:function(e){return e.replace(Bi,"").replace(Ui,"").replace(Fi,"if (!($1))")},finalCleanUpCode:function(e,t){var r=e.match(Hi);r&&2==r.length&&(e=t?e.replace(zi,"").replace(qi,"return data;"):e.replace(Vi,"").replace("return errors === 0;","validate.errors = null; return true;"));return(r=e.match(Ki))&&3===r.length?e.replace($i,""):e},schemaHasRules:function(e,t){if("boolean"==typeof e)return!e;for(var r in e)if(t[r])return!0},schemaHasRulesExcept:function(e,t,r){if("boolean"==typeof e)return!e&&"not"!=r;for(var n in e)if(n!=r&&t[n])return!0},schemaUnknownRules:function(e,t){if("boolean"==typeof e)return;for(var r in e)if(!t[r])return r},toQuotedString:Gi,getPathExpr:function(e,t,r,n){return Xi(e,r?"'/' + "+t+(n?"":".replace(/~/g, '~0').replace(/\\//g, '~1')"):n?"'[' + "+t+" + ']'":"'[\\'' + "+t+" + '\\']'")},getPath:function(e,t,r){var n=Gi(r?"/"+Qi(t):ji(t));return Xi(e,n)},getData:function(e,t,r){var n,i,o,a;if(""===e)return"rootData";if("/"==e[0]){if(!Ji.test(e))throw new Error("Invalid JSON-pointer: "+e);i=e,o="rootData"}else{if(!(a=e.match(Wi)))throw new Error("Invalid JSON-pointer: "+e);if(n=+a[1],"#"==(i=a[2])){if(n>=t)throw new Error("Cannot access property/index "+n+" levels up, current level is "+t);return r[t-n]}if(n>t)throw new Error("Cannot access data "+n+" levels up, current level is "+t);if(o="data"+(t-n||""),!i)return o}for(var s=o,c=i.split("/"),u=0;u<c.length;u++){var l=c[u];l&&(o+=ji(Yi(l)),s+=" && "+o)}return s},unescapeFragment:function(e){return Yi(decodeURIComponent(e))},unescapeJsonPointer:Yi,escapeFragment:function(e){return encodeURIComponent(Qi(e))},escapeJsonPointer:Qi};function Ci(e,t,r){var n=r?" !== ":" === ",i=r?" || ":" && ",o=r?"!":"",a=r?"":"!";switch(e){case"null":return t+n+"null";case"array":return o+"Array.isArray("+t+")";case"object":return"("+o+t+i+"typeof "+t+n+'"object"'+i+a+"Array.isArray("+t+"))";case"integer":return"(typeof "+t+n+'"number"'+i+a+"("+t+" % 1)"+i+t+n+t+")";default:return"typeof "+t+n+'"'+e+'"'}}var Ni=Ri(["string","number","integer","boolean","null"]);function Ri(e){for(var t={},r=0;r<e.length;r++)t[e[r]]=!0;return t}var Mi=/^[a-z$_][a-z$_0-9]*$/i,Li=/'|\\/g;function ji(e){return"number"==typeof e?"["+e+"]":Mi.test(e)?"."+e:"['"+Di(e)+"']"}function Di(e){return e.replace(Li,"\\$&").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\f/g,"\\f").replace(/\t/g,"\\t")}var Bi=/else\s*{\s*}/g,Ui=/if\s*\([^)]+\)\s*\{\s*\}(?!\s*else)/g,Fi=/if\s*\(([^)]+)\)\s*\{\s*\}\s*else(?!\s*if)/g;var Hi=/[^v.]errors/g,Vi=/var errors = 0;|var vErrors = null;|validate.errors = vErrors;/g,zi=/var errors = 0;|var vErrors = null;/g,qi=/if \(errors === 0\) return data;\s*else throw new ValidationError\(vErrors\);/,Ki=/[^A-Za-z_$]rootData[^A-Za-z0-9_$]/g,$i=/if \(rootData === undefined\) rootData = data;/;function Gi(e){return"'"+Di(e)+"'"}var Ji=/^\/(?:[^~]|~0|~1)*$/,Wi=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Xi(e,t){return'""'==e?t:(e+" + "+t).replace(/' \+ '/g,"")}function Qi(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function Yi(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}var Zi=function(e){Ti.copy(e,this)};var eo=tr((function(e){var t=e.exports=function(e,n,i){"function"==typeof n&&(i=n,n={}),function e(n,i,o,a,s,c,u,l,f,h){if(a&&"object"==typeof a&&!Array.isArray(a)){for(var d in i(a,s,c,u,l,f,h),a){var p=a[d];if(Array.isArray(p)){if(d in t.arrayKeywords)for(var m=0;m<p.length;m++)e(n,i,o,p[m],s+"/"+d+"/"+m,c,s,d,a,m)}else if(d in t.propsKeywords){if(p&&"object"==typeof p)for(var g in p)e(n,i,o,p[g],s+"/"+d+"/"+r(g),c,s,d,a,g)}else(d in t.keywords||n.allKeys&&!(d in t.skipKeywords))&&e(n,i,o,p,s+"/"+d,c,s,d,a)}o(a,s,c,u,l,f,h)}}(n,"function"==typeof(i=n.cb||i)?i:i.pre||function(){},i.post||function(){},e,"",e)};function r(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}t.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0},t.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},t.propsKeywords={definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},t.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0}})),to=ro;function ro(e,t,r){var n=this._refs[r];if("string"==typeof n){if(!this._refs[n])return ro.call(this,e,t,n);n=this._refs[n]}if((n=n||this._schemas[r])instanceof Zi)return co(n.schema,this._opts.inlineRefs)?n.schema:n.validate||this._compile(n);var i,o,a,s=no.call(this,t,r);return s&&(i=s.schema,t=s.root,a=s.baseId),i instanceof Zi?o=i.validate||e.call(this,i.schema,t,void 0,a):void 0!==i&&(o=co(i,this._opts.inlineRefs)?i:e.call(this,i,t,void 0,a)),o}function no(e,t){var r=Ii.parse(t),n=lo(r),i=uo(this._getId(e.schema));if(0===Object.keys(e.schema).length||n!==i){var o=ho(n),a=this._refs[o];if("string"==typeof a)return io.call(this,e,a,r);if(a instanceof Zi)a.validate||this._compile(a),e=a;else{if(!((a=this._schemas[o])instanceof Zi))return;if(a.validate||this._compile(a),o==ho(t))return{schema:a,root:e,baseId:i};e=a}if(!e.schema)return;i=uo(this._getId(e.schema))}return ao.call(this,r,i,e.schema,e)}function io(e,t,r){var n=no.call(this,e,t);if(n){var i=n.schema,o=n.baseId;e=n.root;var a=this._getId(i);return a&&(o=po(o,a)),ao.call(this,r,o,i,e)}}ro.normalizeId=ho,ro.fullPath=uo,ro.url=po,ro.ids=function(e){var t=ho(this._getId(e)),r={"":t},n={"":uo(t,!1)},i={},o=this;return eo(e,{allKeys:!0},(function(e,t,a,s,c,u,l){if(""!==t){var f=o._getId(e),h=r[s],d=n[s]+"/"+c;if(void 0!==l&&(d+="/"+("number"==typeof l?l:Ti.escapeFragment(l))),"string"==typeof f){f=h=ho(h?Ii.resolve(h,f):f);var p=o._refs[f];if("string"==typeof p&&(p=o._refs[p]),p&&p.schema){if(!Ai(e,p.schema))throw new Error('id "'+f+'" resolves to more than one schema')}else if(f!=ho(d))if("#"==f[0]){if(i[f]&&!Ai(e,i[f]))throw new Error('id "'+f+'" resolves to more than one schema');i[f]=e}else o._refs[f]=d}r[t]=h,n[t]=d}})),i},ro.inlineRef=co,ro.schema=no;var oo=Ti.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function ao(e,t,r,n){if(e.fragment=e.fragment||"","/"==e.fragment.slice(0,1)){for(var i=e.fragment.split("/"),o=1;o<i.length;o++){var a=i[o];if(a){if(void 0===(r=r[a=Ti.unescapeFragment(a)]))break;var s;if(!oo[a]&&((s=this._getId(r))&&(t=po(t,s)),r.$ref)){var c=po(t,r.$ref),u=no.call(this,n,c);u&&(r=u.schema,n=u.root,t=u.baseId)}}}return void 0!==r&&r!==n.schema?{schema:r,root:n,baseId:t}:void 0}}var so=Ti.toHash(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum"]);function co(e,t){return!1!==t&&(void 0===t||!0===t?function e(t){var r;if(Array.isArray(t)){for(var n=0;n<t.length;n++)if("object"==typeof(r=t[n])&&!e(r))return!1}else for(var i in t){if("$ref"==i)return!1;if("object"==typeof(r=t[i])&&!e(r))return!1}return!0}(e):t?function e(t){var r,n=0;if(Array.isArray(t)){for(var i=0;i<t.length;i++)if("object"==typeof(r=t[i])&&(n+=e(r)),n==1/0)return 1/0}else for(var o in t){if("$ref"==o)return 1/0;if(so[o])n++;else if("object"==typeof(r=t[o])&&(n+=e(r)+1),n==1/0)return 1/0}return n}(e)<=t:void 0)}function uo(e,t){return!1!==t&&(e=ho(e)),lo(Ii.parse(e))}function lo(e){return Ii.serialize(e).split("#")[0]+"#"}var fo=/#\/?$/;function ho(e){return e?e.replace(fo,""):""}function po(e,t){return t=ho(t),Ii.resolve(e,t)}var mo={Validation:vo((function(e){this.message="validation failed",this.errors=e,this.ajv=this.validation=!0})),MissingRef:vo(go)};function go(e,t,r){this.message=r||go.message(e,t),this.missingRef=to.url(e,t),this.missingSchema=to.normalizeId(to.fullPath(this.missingRef))}function vo(e){return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}go.message=function(e,t){return"can't resolve reference "+t+" from id "+e};var yo=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var r="boolean"==typeof t.cycles&&t.cycles,n=t.cmp&&function(e){return function(t){return function(r,n){var i={key:r,value:t[r]},o={key:n,value:t[n]};return e(i,o)}}}(t.cmp),i=[];return function e(t){if(t&&t.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0!==t){if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);var o,a;if(Array.isArray(t)){for(a="[",o=0;o<t.length;o++)o&&(a+=","),a+=e(t[o])||"null";return a+"]"}if(null===t)return"null";if(-1!==i.indexOf(t)){if(r)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var s=i.push(t)-1,c=Object.keys(t).sort(n&&n(t));for(a="",o=0;o<c.length;o++){var u=c[o],l=e(t[u]);l&&(a&&(a+=","),a+=JSON.stringify(u)+":"+l)}return i.splice(s,1),"{"+a+"}"}}(e)},bo=function(e,t,r){var n="",i=!0===e.schema.$async,o=e.util.schemaHasRulesExcept(e.schema,e.RULES.all,"$ref"),a=e.self._getId(e.schema);if(e.opts.strictKeywords){var s=e.util.schemaUnknownRules(e.schema,e.RULES.keywords);if(s){var c="unknown keyword: "+s;if("log"!==e.opts.strictKeywords)throw new Error(c);e.logger.warn(c)}}if(e.isTop&&(n+=" var validate = ",i&&(e.async=!0,n+="async "),n+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",a&&(e.opts.sourceCode||e.opts.processCode)&&(n+=" /*# sourceURL="+a+" */ ")),"boolean"==typeof e.schema||!o&&!e.schema.$ref){t="false schema";var u=e.level,l=e.dataLevel,f=e.schema[t],h=e.schemaPath+e.util.getProperty(t),d=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,m="data"+(l||""),g="valid"+u;if(!1===e.schema){e.isTop?p=!0:n+=" var "+g+" = false; ",(Q=Q||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'false schema' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: 'boolean schema is false' "),e.opts.verbose&&(n+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),n+=" } "):n+=" {} ";var v=n;n=Q.pop(),!e.compositeRule&&p?e.async?n+=" throw new ValidationError(["+v+"]); ":n+=" validate.errors = ["+v+"]; return false; ":n+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else e.isTop?n+=i?" return data; ":" validate.errors = null; return true; ":n+=" var "+g+" = true; ";return e.isTop&&(n+=" }; return validate; "),n}if(e.isTop){var y=e.isTop;u=e.level=0,l=e.dataLevel=0,m="data";if(e.rootId=e.resolve.fullPath(e.self._getId(e.root.schema)),e.baseId=e.baseId||e.rootId,delete e.isTop,e.dataPathArr=[void 0],void 0!==e.schema.default&&e.opts.useDefaults&&e.opts.strictDefaults){var b="default is ignored in the schema root";if("log"!==e.opts.strictDefaults)throw new Error(b);e.logger.warn(b)}n+=" var vErrors = null; ",n+=" var errors = 0; ",n+=" if (rootData === undefined) rootData = data; "}else{u=e.level,m="data"+((l=e.dataLevel)||"");if(a&&(e.baseId=e.resolve.url(e.baseId,a)),i&&!e.async)throw new Error("async schema in sync schema");n+=" var errs_"+u+" = errors;"}g="valid"+u,p=!e.opts.allErrors;var w="",_="",S=e.schema.type,E=Array.isArray(S);if(S&&e.opts.nullable&&!0===e.schema.nullable&&(E?-1==S.indexOf("null")&&(S=S.concat("null")):"null"!=S&&(S=[S,"null"],E=!0)),E&&1==S.length&&(S=S[0],E=!1),e.schema.$ref&&o){if("fail"==e.opts.extendRefs)throw new Error('$ref: validation keywords used in schema at path "'+e.errSchemaPath+'" (see option extendRefs)');!0!==e.opts.extendRefs&&(o=!1,e.logger.warn('$ref: keywords ignored in schema at path "'+e.errSchemaPath+'"'))}if(e.schema.$comment&&e.opts.$comment&&(n+=" "+e.RULES.all.$comment.code(e,"$comment")),S){if(e.opts.coerceTypes)var x=e.util.coerceToTypes(e.opts.coerceTypes,S);var I=e.RULES.types[S];if(x||E||!0===I||I&&!Y(I)){h=e.schemaPath+".type",d=e.errSchemaPath+"/type",h=e.schemaPath+".type",d=e.errSchemaPath+"/type";var k=E?"checkDataTypes":"checkDataType";if(n+=" if ("+e.util[k](S,m,!0)+") { ",x){var P="dataType"+u,O="coerced"+u;n+=" var "+P+" = typeof "+m+"; ","array"==e.opts.coerceTypes&&(n+=" if ("+P+" == 'object' && Array.isArray("+m+")) "+P+" = 'array'; "),n+=" var "+O+" = undefined; ";var A="",T=x;if(T)for(var C,N=-1,R=T.length-1;N<R;)C=T[N+=1],N&&(n+=" if ("+O+" === undefined) { ",A+="}"),"array"==e.opts.coerceTypes&&"array"!=C&&(n+=" if ("+P+" == 'array' && "+m+".length == 1) { "+O+" = "+m+" = "+m+"[0]; "+P+" = typeof "+m+"; } "),"string"==C?n+=" if ("+P+" == 'number' || "+P+" == 'boolean') "+O+" = '' + "+m+"; else if ("+m+" === null) "+O+" = ''; ":"number"==C||"integer"==C?(n+=" if ("+P+" == 'boolean' || "+m+" === null || ("+P+" == 'string' && "+m+" && "+m+" == +"+m+" ","integer"==C&&(n+=" && !("+m+" % 1)"),n+=")) "+O+" = +"+m+"; "):"boolean"==C?n+=" if ("+m+" === 'false' || "+m+" === 0 || "+m+" === null) "+O+" = false; else if ("+m+" === 'true' || "+m+" === 1) "+O+" = true; ":"null"==C?n+=" if ("+m+" === '' || "+m+" === 0 || "+m+" === false) "+O+" = null; ":"array"==e.opts.coerceTypes&&"array"==C&&(n+=" if ("+P+" == 'string' || "+P+" == 'number' || "+P+" == 'boolean' || "+m+" == null) "+O+" = ["+m+"]; ");n+=" "+A+" if ("+O+" === undefined) { ",(Q=Q||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'type' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { type: '",n+=E?""+S.join(","):""+S,n+="' } ",!1!==e.opts.messages&&(n+=" , message: 'should be ",n+=E?""+S.join(","):""+S,n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+h+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),n+=" } "):n+=" {} ";v=n;n=Q.pop(),!e.compositeRule&&p?e.async?n+=" throw new ValidationError(["+v+"]); ":n+=" validate.errors = ["+v+"]; return false; ":n+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else { ";var M=l?"data"+(l-1||""):"parentData";n+=" "+m+" = "+O+"; ",l||(n+="if ("+M+" !== undefined)"),n+=" "+M+"["+(l?e.dataPathArr[l]:"parentDataProperty")+"] = "+O+"; } "}else{(Q=Q||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'type' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { type: '",n+=E?""+S.join(","):""+S,n+="' } ",!1!==e.opts.messages&&(n+=" , message: 'should be ",n+=E?""+S.join(","):""+S,n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+h+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),n+=" } "):n+=" {} ";v=n;n=Q.pop(),!e.compositeRule&&p?e.async?n+=" throw new ValidationError(["+v+"]); ":n+=" validate.errors = ["+v+"]; return false; ":n+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}n+=" } "}}if(e.schema.$ref&&!o)n+=" "+e.RULES.all.$ref.code(e,"$ref")+" ",p&&(n+=" } if (errors === ",n+=y?"0":"errs_"+u,n+=") { ",_+="}");else{var L=e.RULES;if(L)for(var j=-1,D=L.length-1;j<D;)if(Y(I=L[j+=1])){if(I.type&&(n+=" if ("+e.util.checkDataType(I.type,m)+") { "),e.opts.useDefaults)if("object"==I.type&&e.schema.properties){f=e.schema.properties;var B=Object.keys(f);if(B)for(var U,F=-1,H=B.length-1;F<H;){if(void 0!==(q=f[U=B[F+=1]]).default){var V=m+e.util.getProperty(U);if(e.compositeRule){if(e.opts.strictDefaults){b="default is ignored for: "+V;if("log"!==e.opts.strictDefaults)throw new Error(b);e.logger.warn(b)}}else n+=" if ("+V+" === undefined ","empty"==e.opts.useDefaults&&(n+=" || "+V+" === null || "+V+" === '' "),n+=" ) "+V+" = ","shared"==e.opts.useDefaults?n+=" "+e.useDefault(q.default)+" ":n+=" "+JSON.stringify(q.default)+" ",n+="; "}}}else if("array"==I.type&&Array.isArray(e.schema.items)){var z=e.schema.items;if(z){N=-1;for(var q,K=z.length-1;N<K;)if(void 0!==(q=z[N+=1]).default){V=m+"["+N+"]";if(e.compositeRule){if(e.opts.strictDefaults){b="default is ignored for: "+V;if("log"!==e.opts.strictDefaults)throw new Error(b);e.logger.warn(b)}}else n+=" if ("+V+" === undefined ","empty"==e.opts.useDefaults&&(n+=" || "+V+" === null || "+V+" === '' "),n+=" ) "+V+" = ","shared"==e.opts.useDefaults?n+=" "+e.useDefault(q.default)+" ":n+=" "+JSON.stringify(q.default)+" ",n+="; "}}}var $=I.rules;if($)for(var G,J=-1,W=$.length-1;J<W;)if(Z(G=$[J+=1])){var X=G.code(e,G.keyword,I.type);X&&(n+=" "+X+" ",p&&(w+="}"))}if(p&&(n+=" "+w+" ",w=""),I.type&&(n+=" } ",S&&S===I.type&&!x)){n+=" else { ";var Q;h=e.schemaPath+".type",d=e.errSchemaPath+"/type";(Q=Q||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'type' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { type: '",n+=E?""+S.join(","):""+S,n+="' } ",!1!==e.opts.messages&&(n+=" , message: 'should be ",n+=E?""+S.join(","):""+S,n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+h+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),n+=" } "):n+=" {} ";v=n;n=Q.pop(),!e.compositeRule&&p?e.async?n+=" throw new ValidationError(["+v+"]); ":n+=" validate.errors = ["+v+"]; return false; ":n+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } "}p&&(n+=" if (errors === ",n+=y?"0":"errs_"+u,n+=") { ",_+="}")}}function Y(e){for(var t=e.rules,r=0;r<t.length;r++)if(Z(t[r]))return!0}function Z(t){return void 0!==e.schema[t.keyword]||t.implements&&function(t){for(var r=t.implements,n=0;n<r.length;n++)if(void 0!==e.schema[r[n]])return!0}(t)}return p&&(n+=" "+_+" "),y?(i?(n+=" if (errors === 0) return data; ",n+=" else throw new ValidationError(vErrors); "):(n+=" validate.errors = vErrors; ",n+=" return errors === 0; "),n+=" }; return validate;"):n+=" var "+g+" = errors === errs_"+u+";",n=e.util.cleanUpCode(n),y&&(n=e.util.finalCleanUpCode(n,i)),n},wo=Ti.ucs2length,_o=mo.Validation,So=function e(t,r,n,i){var o=this,a=this._opts,s=[void 0],c={},u=[],l={},f=[],h={},d=[];r=r||{schema:t,refVal:s,refs:c};var p=Eo.call(this,t,r,i),m=this._compilations[p.index];if(p.compiling)return m.callValidate=function e(){var t=m.validate,r=t.apply(this,arguments);return e.errors=t.errors,r};var g=this._formats,v=this.RULES;try{var y=w(t,r,n,i);m.validate=y;var b=m.callValidate;return b&&(b.schema=y.schema,b.errors=null,b.refs=y.refs,b.refVal=y.refVal,b.root=y.root,b.$async=y.$async,a.sourceCode&&(b.source=y.source)),y}finally{xo.call(this,t,r,i)}function w(t,n,i,l){var h=!n||n&&n.schema==t;if(n.schema!=r.schema)return e.call(o,t,n,i,l);var p,m=!0===t.$async,y=bo({isTop:!0,schema:t,isRoot:h,baseId:l,root:n,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:mo.MissingRef,RULES:v,validate:bo,util:Ti,resolve:to,resolveRef:_,usePattern:x,useDefault:I,useCustomRule:k,opts:a,formats:g,logger:o.logger,self:o});y=To(s,Oo)+To(u,ko)+To(f,Po)+To(d,Ao)+y,a.processCode&&(y=a.processCode(y));try{p=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",y)(o,v,g,r,s,f,d,Ai,wo,_o),s[0]=p}catch(e){throw o.logger.error("Error compiling schema, function code:",y),e}return p.schema=t,p.errors=null,p.refs=c,p.refVal=s,p.root=h?p:n,m&&(p.$async=!0),!0===a.sourceCode&&(p.source={code:y,patterns:u,defaults:f}),p}function _(t,i,u){i=to.url(t,i);var l,f,h=c[i];if(void 0!==h)return E(l=s[h],f="refVal["+h+"]");if(!u&&r.refs){var d=r.refs[i];if(void 0!==d)return E(l=r.refVal[d],f=S(i,l))}f=S(i);var p=to.call(o,w,r,i);if(void 0===p){var m=n&&n[i];m&&(p=to.inlineRef(m,a.inlineRefs)?m:e.call(o,m,r,n,t))}if(void 0!==p)return function(e,t){var r=c[e];s[r]=t}(i,p),E(p,f);!function(e){delete c[e]}(i)}function S(e,t){var r=s.length;return s[r]=t,c[e]=r,"refVal"+r}function E(e,t){return"object"==typeof e||"boolean"==typeof e?{code:t,schema:e,inline:!0}:{code:t,$async:e&&!!e.$async}}function x(e){var t=l[e];return void 0===t&&(t=l[e]=u.length,u[t]=e),"pattern"+t}function I(e){switch(typeof e){case"boolean":case"number":return""+e;case"string":return Ti.toQuotedString(e);case"object":if(null===e)return"null";var t=yo(e),r=h[t];return void 0===r&&(r=h[t]=f.length,f[r]=e),"default"+r}}function k(e,t,r,n){if(!1!==o._opts.validateSchema){var i=e.definition.dependencies;if(i&&!i.every((function(e){return Object.prototype.hasOwnProperty.call(r,e)})))throw new Error("parent schema must have all required keywords: "+i.join(","));var s=e.definition.validateSchema;if(s)if(!s(t)){var c="keyword schema is invalid: "+o.errorsText(s.errors);if("log"!=o._opts.validateSchema)throw new Error(c);o.logger.error(c)}}var u,l=e.definition.compile,f=e.definition.inline,h=e.definition.macro;if(l)u=l.call(o,t,r,n);else if(h)u=h.call(o,t,r,n),!1!==a.validateSchema&&o.validateSchema(u,!0);else if(f)u=f.call(o,n,e.keyword,t,r);else if(!(u=e.definition.validate))return;if(void 0===u)throw new Error('custom keyword "'+e.keyword+'"failed to compile');var p=d.length;return d[p]=u,{code:"customRule"+p,validate:u}}};function Eo(e,t,r){var n=Io.call(this,e,t,r);return n>=0?{index:n,compiling:!0}:(n=this._compilations.length,this._compilations[n]={schema:e,root:t,baseId:r},{index:n,compiling:!1})}function xo(e,t,r){var n=Io.call(this,e,t,r);n>=0&&this._compilations.splice(n,1)}function Io(e,t,r){for(var n=0;n<this._compilations.length;n++){var i=this._compilations[n];if(i.schema==e&&i.root==t&&i.baseId==r)return n}return-1}function ko(e,t){return"var pattern"+e+" = new RegExp("+Ti.toQuotedString(t[e])+");"}function Po(e){return"var default"+e+" = defaults["+e+"];"}function Oo(e,t){return void 0===t[e]?"":"var refVal"+e+" = refVal["+e+"];"}function Ao(e){return"var customRule"+e+" = customRules["+e+"];"}function To(e,t){if(!e.length)return"";for(var r="",n=0;n<e.length;n++)r+=t(n,e);return r}var Co=tr((function(e){var t=e.exports=function(){this._cache={}};t.prototype.put=function(e,t){this._cache[e]=t},t.prototype.get=function(e){return this._cache[e]},t.prototype.del=function(e){delete this._cache[e]},t.prototype.clear=function(){this._cache={}}})),No=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Ro=[0,31,28,31,30,31,30,31,31,30,31,30,31],Mo=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d:\d\d)?$/i,Lo=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*$/i,jo=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,Do=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,Bo=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,Uo=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,Fo=/^(?:\/(?:[^~/]|~0|~1)*)*$/,Ho=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,Vo=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,zo=qo;function qo(e){return e="full"==e?"full":"fast",Ti.copy(qo[e])}function Ko(e){var t=e.match(No);if(!t)return!1;var r=+t[1],n=+t[2],i=+t[3];return n>=1&&n<=12&&i>=1&&i<=(2==n&&function(e){return e%4==0&&(e%100!=0||e%400==0)}(r)?29:Ro[n])}function $o(e,t){var r=e.match(Mo);if(!r)return!1;var n=r[1],i=r[2],o=r[3],a=r[5];return(n<=23&&i<=59&&o<=59||23==n&&59==i&&60==o)&&(!t||a)}qo.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)$/i,uri:/^(?:[a-z][a-z0-9+-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":Do,url:Bo,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:Lo,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:Xo,uuid:Uo,"json-pointer":Fo,"json-pointer-uri-fragment":Ho,"relative-json-pointer":Vo},qo.full={date:Ko,time:$o,"date-time":function(e){var t=e.split(Go);return 2==t.length&&Ko(t[0])&&$o(t[1],!0)},uri:function(e){return Jo.test(e)&&jo.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":Do,url:Bo,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:function(e){return e.length<=255&&Lo.test(e)},ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:Xo,uuid:Uo,"json-pointer":Fo,"json-pointer-uri-fragment":Ho,"relative-json-pointer":Vo};var Go=/t|\s/i;var Jo=/\/|:/;var Wo=/[^\\]\\Z/;function Xo(e){if(Wo.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}var Qo=function(e,t,r){var n,i=" ",o=e.level,a=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,f="data"+(a||""),h=e.opts.$data&&s&&s.$data;h?(i+=" var schema"+o+" = "+e.util.getData(s.$data,a,e.dataPathArr)+"; ",n="schema"+o):n=s;var d="maximum"==t,p=d?"exclusiveMaximum":"exclusiveMinimum",m=e.schema[p],g=e.opts.$data&&m&&m.$data,v=d?"<":">",y=d?">":"<",b=void 0;if(g){var w=e.util.getData(m.$data,a,e.dataPathArr),_="exclusive"+o,S="exclType"+o,E="exclIsNumber"+o,x="' + "+(P="op"+o)+" + '";i+=" var schemaExcl"+o+" = "+w+"; ",i+=" var "+_+"; var "+S+" = typeof "+(w="schemaExcl"+o)+"; if ("+S+" != 'boolean' && "+S+" != 'undefined' && "+S+" != 'number') { ";var I;b=p;(I=I||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: '"+(b||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: '"+p+" should be boolean' "),e.opts.verbose&&(i+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var k=i;i=I.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+k+"]); ":i+=" validate.errors = ["+k+"]; return false; ":i+=" var err = "+k+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else if ( ",h&&(i+=" ("+n+" !== undefined && typeof "+n+" != 'number') || "),i+=" "+S+" == 'number' ? ( ("+_+" = "+n+" === undefined || "+w+" "+v+"= "+n+") ? "+f+" "+y+"= "+w+" : "+f+" "+y+" "+n+" ) : ( ("+_+" = "+w+" === true) ? "+f+" "+y+"= "+n+" : "+f+" "+y+" "+n+" ) || "+f+" !== "+f+") { var op"+o+" = "+_+" ? '"+v+"' : '"+v+"='; ",void 0===s&&(b=p,u=e.errSchemaPath+"/"+p,n=w,h=g)}else{x=v;if((E="number"==typeof m)&&h){var P="'"+x+"'";i+=" if ( ",h&&(i+=" ("+n+" !== undefined && typeof "+n+" != 'number') || "),i+=" ( "+n+" === undefined || "+m+" "+v+"= "+n+" ? "+f+" "+y+"= "+m+" : "+f+" "+y+" "+n+" ) || "+f+" !== "+f+") { "}else{E&&void 0===s?(_=!0,b=p,u=e.errSchemaPath+"/"+p,n=m,y+="="):(E&&(n=Math[d?"min":"max"](m,s)),m===(!E||n)?(_=!0,b=p,u=e.errSchemaPath+"/"+p,y+="="):(_=!1,x+="="));P="'"+x+"'";i+=" if ( ",h&&(i+=" ("+n+" !== undefined && typeof "+n+" != 'number') || "),i+=" "+f+" "+y+" "+n+" || "+f+" !== "+f+") { "}}b=b||t,(I=I||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: '"+(b||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { comparison: "+P+", limit: "+n+", exclusive: "+_+" } ",!1!==e.opts.messages&&(i+=" , message: 'should be "+x+" ",i+=h?"' + "+n:n+"'"),e.opts.verbose&&(i+=" , schema: ",i+=h?"validate.schema"+c:""+s,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";k=i;return i=I.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+k+"]); ":i+=" validate.errors = ["+k+"]; return false; ":i+=" var err = "+k+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",l&&(i+=" else { "),i},Yo=function(e,t,r){var n,i=" ",o=e.level,a=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,f="data"+(a||""),h=e.opts.$data&&s&&s.$data;h?(i+=" var schema"+o+" = "+e.util.getData(s.$data,a,e.dataPathArr)+"; ",n="schema"+o):n=s,i+="if ( ",h&&(i+=" ("+n+" !== undefined && typeof "+n+" != 'number') || "),i+=" "+f+".length "+("maxItems"==t?">":"<")+" "+n+") { ";var d=t,p=p||[];p.push(i),i="",!1!==e.createErrors?(i+=" { keyword: '"+(d||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+n+" } ",!1!==e.opts.messages&&(i+=" , message: 'should NOT have ",i+="maxItems"==t?"more":"fewer",i+=" than ",i+=h?"' + "+n+" + '":""+s,i+=" items' "),e.opts.verbose&&(i+=" , schema: ",i+=h?"validate.schema"+c:""+s,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var m=i;return i=p.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+m+"]); ":i+=" validate.errors = ["+m+"]; return false; ":i+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",l&&(i+=" else { "),i},Zo=function(e,t,r){var n,i=" ",o=e.level,a=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,f="data"+(a||""),h=e.opts.$data&&s&&s.$data;h?(i+=" var schema"+o+" = "+e.util.getData(s.$data,a,e.dataPathArr)+"; ",n="schema"+o):n=s;var d="maxLength"==t?">":"<";i+="if ( ",h&&(i+=" ("+n+" !== undefined && typeof "+n+" != 'number') || "),!1===e.opts.unicode?i+=" "+f+".length ":i+=" ucs2length("+f+") ",i+=" "+d+" "+n+") { ";var p=t,m=m||[];m.push(i),i="",!1!==e.createErrors?(i+=" { keyword: '"+(p||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+n+" } ",!1!==e.opts.messages&&(i+=" , message: 'should NOT be ",i+="maxLength"==t?"longer":"shorter",i+=" than ",i+=h?"' + "+n+" + '":""+s,i+=" characters' "),e.opts.verbose&&(i+=" , schema: ",i+=h?"validate.schema"+c:""+s,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var g=i;return i=m.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+g+"]); ":i+=" validate.errors = ["+g+"]; return false; ":i+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",l&&(i+=" else { "),i},ea=function(e,t,r){var n,i=" ",o=e.level,a=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,f="data"+(a||""),h=e.opts.$data&&s&&s.$data;h?(i+=" var schema"+o+" = "+e.util.getData(s.$data,a,e.dataPathArr)+"; ",n="schema"+o):n=s,i+="if ( ",h&&(i+=" ("+n+" !== undefined && typeof "+n+" != 'number') || "),i+=" Object.keys("+f+").length "+("maxProperties"==t?">":"<")+" "+n+") { ";var d=t,p=p||[];p.push(i),i="",!1!==e.createErrors?(i+=" { keyword: '"+(d||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+n+" } ",!1!==e.opts.messages&&(i+=" , message: 'should NOT have ",i+="maxProperties"==t?"more":"fewer",i+=" than ",i+=h?"' + "+n+" + '":""+s,i+=" properties' "),e.opts.verbose&&(i+=" , schema: ",i+=h?"validate.schema"+c:""+s,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var m=i;return i=p.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+m+"]); ":i+=" validate.errors = ["+m+"]; return false; ":i+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",l&&(i+=" else { "),i},ta={$ref:function(e,t,r){var n,i,o=" ",a=e.level,s=e.dataLevel,c=e.schema[t],u=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,f="data"+(s||""),h="valid"+a;if("#"==c||"#/"==c)e.isRoot?(n=e.async,i="validate"):(n=!0===e.root.schema.$async,i="root.refVal[0]");else{var d=e.resolveRef(e.baseId,c,e.isRoot);if(void 0===d){var p=e.MissingRefError.message(e.baseId,c);if("fail"==e.opts.missingRefs){e.logger.error(p),(y=y||[]).push(o),o="",!1!==e.createErrors?(o+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { ref: '"+e.util.escapeQuotes(c)+"' } ",!1!==e.opts.messages&&(o+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(c)+"' "),e.opts.verbose&&(o+=" , schema: "+e.util.toQuotedString(c)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),o+=" } "):o+=" {} ";var m=o;o=y.pop(),!e.compositeRule&&l?e.async?o+=" throw new ValidationError(["+m+"]); ":o+=" validate.errors = ["+m+"]; return false; ":o+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",l&&(o+=" if (false) { ")}else{if("ignore"!=e.opts.missingRefs)throw new e.MissingRefError(e.baseId,c,p);e.logger.warn(p),l&&(o+=" if (true) { ")}}else if(d.inline){var g=e.util.copy(e);g.level++;var v="valid"+g.level;g.schema=d.schema,g.schemaPath="",g.errSchemaPath=c,o+=" "+e.validate(g).replace(/validate\.schema/g,d.code)+" ",l&&(o+=" if ("+v+") { ")}else n=!0===d.$async||e.async&&!1!==d.$async,i=d.code}if(i){var y;(y=y||[]).push(o),o="",e.opts.passContext?o+=" "+i+".call(this, ":o+=" "+i+"( ",o+=" "+f+", (dataPath || '')",'""'!=e.errorPath&&(o+=" + "+e.errorPath);var b=o+=" , "+(s?"data"+(s-1||""):"parentData")+" , "+(s?e.dataPathArr[s]:"parentDataProperty")+", rootData) ";if(o=y.pop(),n){if(!e.async)throw new Error("async schema referenced by sync schema");l&&(o+=" var "+h+"; "),o+=" try { await "+b+"; ",l&&(o+=" "+h+" = true; "),o+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",l&&(o+=" "+h+" = false; "),o+=" } ",l&&(o+=" if ("+h+") { ")}else o+=" if (!"+b+") { if (vErrors === null) vErrors = "+i+".errors; else vErrors = vErrors.concat("+i+".errors); errors = vErrors.length; } ",l&&(o+=" else { ")}return o},allOf:function(e,t,r){var n=" ",i=e.schema[t],o=e.schemaPath+e.util.getProperty(t),a=e.errSchemaPath+"/"+t,s=!e.opts.allErrors,c=e.util.copy(e),u="";c.level++;var l="valid"+c.level,f=c.baseId,h=!0,d=i;if(d)for(var p,m=-1,g=d.length-1;m<g;)p=d[m+=1],(e.opts.strictKeywords?"object"==typeof p&&Object.keys(p).length>0:e.util.schemaHasRules(p,e.RULES.all))&&(h=!1,c.schema=p,c.schemaPath=o+"["+m+"]",c.errSchemaPath=a+"/"+m,n+=" "+e.validate(c)+" ",c.baseId=f,s&&(n+=" if ("+l+") { ",u+="}"));return s&&(n+=h?" if (true) { ":" "+u.slice(0,-1)+" "),n=e.util.cleanUpCode(n)},anyOf:function(e,t,r){var n=" ",i=e.level,o=e.dataLevel,a=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,l="data"+(o||""),f="valid"+i,h="errs__"+i,d=e.util.copy(e),p="";d.level++;var m="valid"+d.level;if(a.every((function(t){return e.opts.strictKeywords?"object"==typeof t&&Object.keys(t).length>0:e.util.schemaHasRules(t,e.RULES.all)}))){var g=d.baseId;n+=" var "+h+" = errors; var "+f+" = false; ";var v=e.compositeRule;e.compositeRule=d.compositeRule=!0;var y=a;if(y)for(var b,w=-1,_=y.length-1;w<_;)b=y[w+=1],d.schema=b,d.schemaPath=s+"["+w+"]",d.errSchemaPath=c+"/"+w,n+=" "+e.validate(d)+" ",d.baseId=g,n+=" "+f+" = "+f+" || "+m+"; if (!"+f+") { ",p+="}";e.compositeRule=d.compositeRule=v,n+=" "+p+" if (!"+f+") { var err = ",!1!==e.createErrors?(n+=" { keyword: 'anyOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: 'should match some schema in anyOf' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&u&&(e.async?n+=" throw new ValidationError(vErrors); ":n+=" validate.errors = vErrors; return false; "),n+=" } else { errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } ",e.opts.allErrors&&(n+=" } "),n=e.util.cleanUpCode(n)}else u&&(n+=" if (true) { ");return n},$comment:function(e,t,r){var n=" ",i=e.schema[t],o=e.errSchemaPath+"/"+t,a=(e.opts.allErrors,e.util.toQuotedString(i));return!0===e.opts.$comment?n+=" console.log("+a+");":"function"==typeof e.opts.$comment&&(n+=" self._opts.$comment("+a+", "+e.util.toQuotedString(o)+", validate.root.schema);"),n},const:function(e,t,r){var n=" ",i=e.level,o=e.dataLevel,a=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,l="data"+(o||""),f="valid"+i,h=e.opts.$data&&a&&a.$data;h&&(n+=" var schema"+i+" = "+e.util.getData(a.$data,o,e.dataPathArr)+"; "),h||(n+=" var schema"+i+" = validate.schema"+s+";"),n+="var "+f+" = equal("+l+", schema"+i+"); if (!"+f+") { ";var d=d||[];d.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'const' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { allowedValue: schema"+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be equal to constant' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var p=n;return n=d.pop(),!e.compositeRule&&u?e.async?n+=" throw new ValidationError(["+p+"]); ":n+=" validate.errors = ["+p+"]; return false; ":n+=" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" }",u&&(n+=" else { "),n},contains:function(e,t,r){var n=" ",i=e.level,o=e.dataLevel,a=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,l="data"+(o||""),f="valid"+i,h="errs__"+i,d=e.util.copy(e);d.level++;var p="valid"+d.level,m="i"+i,g=d.dataLevel=e.dataLevel+1,v="data"+g,y=e.baseId,b=e.opts.strictKeywords?"object"==typeof a&&Object.keys(a).length>0:e.util.schemaHasRules(a,e.RULES.all);if(n+="var "+h+" = errors;var "+f+";",b){var w=e.compositeRule;e.compositeRule=d.compositeRule=!0,d.schema=a,d.schemaPath=s,d.errSchemaPath=c,n+=" var "+p+" = false; for (var "+m+" = 0; "+m+" < "+l+".length; "+m+"++) { ",d.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers,!0);var _=l+"["+m+"]";d.dataPathArr[g]=m;var S=e.validate(d);d.baseId=y,e.util.varOccurences(S,v)<2?n+=" "+e.util.varReplace(S,v,_)+" ":n+=" var "+v+" = "+_+"; "+S+" ",n+=" if ("+p+") break; } ",e.compositeRule=d.compositeRule=w,n+=" if (!"+p+") {"}else n+=" if ("+l+".length == 0) {";var E=E||[];E.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: 'should contain a valid item' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var x=n;return n=E.pop(),!e.compositeRule&&u?e.async?n+=" throw new ValidationError(["+x+"]); ":n+=" validate.errors = ["+x+"]; return false; ":n+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else { ",b&&(n+=" errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } "),e.opts.allErrors&&(n+=" } "),n=e.util.cleanUpCode(n)},dependencies:function(e,t,r){var n=" ",i=e.level,o=e.dataLevel,a=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,l="data"+(o||""),f="errs__"+i,h=e.util.copy(e),d="";h.level++;var p="valid"+h.level,m={},g={},v=e.opts.ownProperties;for(_ in a){var y=a[_],b=Array.isArray(y)?g:m;b[_]=y}n+="var "+f+" = errors;";var w=e.errorPath;for(var _ in n+="var missing"+i+";",g)if((b=g[_]).length){if(n+=" if ( "+l+e.util.getProperty(_)+" !== undefined ",v&&(n+=" && Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(_)+"') "),u){n+=" && ( ";var S=b;if(S)for(var E=-1,x=S.length-1;E<x;){T=S[E+=1],E&&(n+=" || "),n+=" ( ( "+(M=l+(R=e.util.getProperty(T)))+" === undefined ",v&&(n+=" || ! Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(T)+"') "),n+=") && (missing"+i+" = "+e.util.toQuotedString(e.opts.jsonPointers?T:R)+") ) "}n+=")) { ";var I="missing"+i,k="' + "+I+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(w,I,!0):w+" + "+I);var P=P||[];P.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { property: '"+e.util.escapeQuotes(_)+"', missingProperty: '"+k+"', depsCount: "+b.length+", deps: '"+e.util.escapeQuotes(1==b.length?b[0]:b.join(", "))+"' } ",!1!==e.opts.messages&&(n+=" , message: 'should have ",1==b.length?n+="property "+e.util.escapeQuotes(b[0]):n+="properties "+e.util.escapeQuotes(b.join(", ")),n+=" when property "+e.util.escapeQuotes(_)+" is present' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var O=n;n=P.pop(),!e.compositeRule&&u?e.async?n+=" throw new ValidationError(["+O+"]); ":n+=" validate.errors = ["+O+"]; return false; ":n+=" var err = "+O+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else{n+=" ) { ";var A=b;if(A)for(var T,C=-1,N=A.length-1;C<N;){T=A[C+=1];var R=e.util.getProperty(T),M=(k=e.util.escapeQuotes(T),l+R);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(w,T,e.opts.jsonPointers)),n+=" if ( "+M+" === undefined ",v&&(n+=" || ! Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(T)+"') "),n+=") { var err = ",!1!==e.createErrors?(n+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { property: '"+e.util.escapeQuotes(_)+"', missingProperty: '"+k+"', depsCount: "+b.length+", deps: '"+e.util.escapeQuotes(1==b.length?b[0]:b.join(", "))+"' } ",!1!==e.opts.messages&&(n+=" , message: 'should have ",1==b.length?n+="property "+e.util.escapeQuotes(b[0]):n+="properties "+e.util.escapeQuotes(b.join(", ")),n+=" when property "+e.util.escapeQuotes(_)+" is present' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}n+=" } ",u&&(d+="}",n+=" else { ")}e.errorPath=w;var L=h.baseId;for(var _ in m){y=m[_];(e.opts.strictKeywords?"object"==typeof y&&Object.keys(y).length>0:e.util.schemaHasRules(y,e.RULES.all))&&(n+=" "+p+" = true; if ( "+l+e.util.getProperty(_)+" !== undefined ",v&&(n+=" && Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(_)+"') "),n+=") { ",h.schema=y,h.schemaPath=s+e.util.getProperty(_),h.errSchemaPath=c+"/"+e.util.escapeFragment(_),n+=" "+e.validate(h)+" ",h.baseId=L,n+=" } ",u&&(n+=" if ("+p+") { ",d+="}"))}return u&&(n+=" "+d+" if ("+f+" == errors) {"),n=e.util.cleanUpCode(n)},enum:function(e,t,r){var n=" ",i=e.level,o=e.dataLevel,a=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,l="data"+(o||""),f="valid"+i,h=e.opts.$data&&a&&a.$data;h&&(n+=" var schema"+i+" = "+e.util.getData(a.$data,o,e.dataPathArr)+"; ");var d="i"+i,p="schema"+i;h||(n+=" var "+p+" = validate.schema"+s+";"),n+="var "+f+";",h&&(n+=" if (schema"+i+" === undefined) "+f+" = true; else if (!Array.isArray(schema"+i+")) "+f+" = false; else {"),n+=f+" = false;for (var "+d+"=0; "+d+"<"+p+".length; "+d+"++) if (equal("+l+", "+p+"["+d+"])) { "+f+" = true; break; }",h&&(n+=" } "),n+=" if (!"+f+") { ";var m=m||[];m.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { allowedValues: schema"+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var g=n;return n=m.pop(),!e.compositeRule&&u?e.async?n+=" throw new ValidationError(["+g+"]); ":n+=" validate.errors = ["+g+"]; return false; ":n+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" }",u&&(n+=" else { "),n},format:function(e,t,r){var n=" ",i=e.level,o=e.dataLevel,a=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,l="data"+(o||"");if(!1===e.opts.format)return u&&(n+=" if (true) { "),n;var f,h=e.opts.$data&&a&&a.$data;h?(n+=" var schema"+i+" = "+e.util.getData(a.$data,o,e.dataPathArr)+"; ",f="schema"+i):f=a;var d=e.opts.unknownFormats,p=Array.isArray(d);if(h){n+=" var "+(m="format"+i)+" = formats["+f+"]; var "+(g="isObject"+i)+" = typeof "+m+" == 'object' && !("+m+" instanceof RegExp) && "+m+".validate; var "+(v="formatType"+i)+" = "+g+" && "+m+".type || 'string'; if ("+g+") { ",e.async&&(n+=" var async"+i+" = "+m+".async; "),n+=" "+m+" = "+m+".validate; } if ( ",h&&(n+=" ("+f+" !== undefined && typeof "+f+" != 'string') || "),n+=" (","ignore"!=d&&(n+=" ("+f+" && !"+m+" ",p&&(n+=" && self._opts.unknownFormats.indexOf("+f+") == -1 "),n+=") || "),n+=" ("+m+" && "+v+" == '"+r+"' && !(typeof "+m+" == 'function' ? ",e.async?n+=" (async"+i+" ? await "+m+"("+l+") : "+m+"("+l+")) ":n+=" "+m+"("+l+") ",n+=" : "+m+".test("+l+"))))) {"}else{var m;if(!(m=e.formats[a])){if("ignore"==d)return e.logger.warn('unknown format "'+a+'" ignored in schema at path "'+e.errSchemaPath+'"'),u&&(n+=" if (true) { "),n;if(p&&d.indexOf(a)>=0)return u&&(n+=" if (true) { "),n;throw new Error('unknown format "'+a+'" is used in schema at path "'+e.errSchemaPath+'"')}var g,v=(g="object"==typeof m&&!(m instanceof RegExp)&&m.validate)&&m.type||"string";if(g){var y=!0===m.async;m=m.validate}if(v!=r)return u&&(n+=" if (true) { "),n;if(y){if(!e.async)throw new Error("async format in sync schema");n+=" if (!(await "+(b="formats"+e.util.getProperty(a)+".validate")+"("+l+"))) { "}else{n+=" if (! ";var b="formats"+e.util.getProperty(a);g&&(b+=".validate"),n+="function"==typeof m?" "+b+"("+l+") ":" "+b+".test("+l+") ",n+=") { "}}var w=w||[];w.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { format: ",n+=h?""+f:""+e.util.toQuotedString(a),n+=" } ",!1!==e.opts.messages&&(n+=" , message: 'should match format \"",n+=h?"' + "+f+" + '":""+e.util.escapeQuotes(a),n+="\"' "),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+s:""+e.util.toQuotedString(a),n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var _=n;return n=w.pop(),!e.compositeRule&&u?e.async?n+=" throw new ValidationError(["+_+"]); ":n+=" validate.errors = ["+_+"]; return false; ":n+=" var err = "+_+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",u&&(n+=" else { "),n},if:function(e,t,r){var n=" ",i=e.level,o=e.dataLevel,a=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,l="data"+(o||""),f="valid"+i,h="errs__"+i,d=e.util.copy(e);d.level++;var p="valid"+d.level,m=e.schema.then,g=e.schema.else,v=void 0!==m&&(e.opts.strictKeywords?"object"==typeof m&&Object.keys(m).length>0:e.util.schemaHasRules(m,e.RULES.all)),y=void 0!==g&&(e.opts.strictKeywords?"object"==typeof g&&Object.keys(g).length>0:e.util.schemaHasRules(g,e.RULES.all)),b=d.baseId;if(v||y){var w;d.createErrors=!1,d.schema=a,d.schemaPath=s,d.errSchemaPath=c,n+=" var "+h+" = errors; var "+f+" = true; ";var _=e.compositeRule;e.compositeRule=d.compositeRule=!0,n+=" "+e.validate(d)+" ",d.baseId=b,d.createErrors=!0,n+=" errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } ",e.compositeRule=d.compositeRule=_,v?(n+=" if ("+p+") { ",d.schema=e.schema.then,d.schemaPath=e.schemaPath+".then",d.errSchemaPath=e.errSchemaPath+"/then",n+=" "+e.validate(d)+" ",d.baseId=b,n+=" "+f+" = "+p+"; ",v&&y?n+=" var "+(w="ifClause"+i)+" = 'then'; ":w="'then'",n+=" } ",y&&(n+=" else { ")):n+=" if (!"+p+") { ",y&&(d.schema=e.schema.else,d.schemaPath=e.schemaPath+".else",d.errSchemaPath=e.errSchemaPath+"/else",n+=" "+e.validate(d)+" ",d.baseId=b,n+=" "+f+" = "+p+"; ",v&&y?n+=" var "+(w="ifClause"+i)+" = 'else'; ":w="'else'",n+=" } "),n+=" if (!"+f+") { var err = ",!1!==e.createErrors?(n+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { failingKeyword: "+w+" } ",!1!==e.opts.messages&&(n+=" , message: 'should match \"' + "+w+" + '\" schema' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&u&&(e.async?n+=" throw new ValidationError(vErrors); ":n+=" validate.errors = vErrors; return false; "),n+=" } ",u&&(n+=" else { "),n=e.util.cleanUpCode(n)}else u&&(n+=" if (true) { ");return n},items:function(e,t,r){var n=" ",i=e.level,o=e.dataLevel,a=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,l="data"+(o||""),f="valid"+i,h="errs__"+i,d=e.util.copy(e),p="";d.level++;var m="valid"+d.level,g="i"+i,v=d.dataLevel=e.dataLevel+1,y="data"+v,b=e.baseId;if(n+="var "+h+" = errors;var "+f+";",Array.isArray(a)){var w=e.schema.additionalItems;if(!1===w){n+=" "+f+" = "+l+".length <= "+a.length+"; ";var _=c;c=e.errSchemaPath+"/additionalItems",n+=" if (!"+f+") { ";var S=S||[];S.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+a.length+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have more than "+a.length+" items' "),e.opts.verbose&&(n+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var E=n;n=S.pop(),!e.compositeRule&&u?e.async?n+=" throw new ValidationError(["+E+"]); ":n+=" validate.errors = ["+E+"]; return false; ":n+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",c=_,u&&(p+="}",n+=" else { ")}var x=a;if(x)for(var I,k=-1,P=x.length-1;k<P;)if(I=x[k+=1],e.opts.strictKeywords?"object"==typeof I&&Object.keys(I).length>0:e.util.schemaHasRules(I,e.RULES.all)){n+=" "+m+" = true; if ("+l+".length > "+k+") { ";var O=l+"["+k+"]";d.schema=I,d.schemaPath=s+"["+k+"]",d.errSchemaPath=c+"/"+k,d.errorPath=e.util.getPathExpr(e.errorPath,k,e.opts.jsonPointers,!0),d.dataPathArr[v]=k;var A=e.validate(d);d.baseId=b,e.util.varOccurences(A,y)<2?n+=" "+e.util.varReplace(A,y,O)+" ":n+=" var "+y+" = "+O+"; "+A+" ",n+=" } ",u&&(n+=" if ("+m+") { ",p+="}")}if("object"==typeof w&&(e.opts.strictKeywords?"object"==typeof w&&Object.keys(w).length>0:e.util.schemaHasRules(w,e.RULES.all))){d.schema=w,d.schemaPath=e.schemaPath+".additionalItems",d.errSchemaPath=e.errSchemaPath+"/additionalItems",n+=" "+m+" = true; if ("+l+".length > "+a.length+") { for (var "+g+" = "+a.length+"; "+g+" < "+l+".length; "+g+"++) { ",d.errorPath=e.util.getPathExpr(e.errorPath,g,e.opts.jsonPointers,!0);O=l+"["+g+"]";d.dataPathArr[v]=g;A=e.validate(d);d.baseId=b,e.util.varOccurences(A,y)<2?n+=" "+e.util.varReplace(A,y,O)+" ":n+=" var "+y+" = "+O+"; "+A+" ",u&&(n+=" if (!"+m+") break; "),n+=" } } ",u&&(n+=" if ("+m+") { ",p+="}")}}else if(e.opts.strictKeywords?"object"==typeof a&&Object.keys(a).length>0:e.util.schemaHasRules(a,e.RULES.all)){d.schema=a,d.schemaPath=s,d.errSchemaPath=c,n+=" for (var "+g+" = 0; "+g+" < "+l+".length; "+g+"++) { ",d.errorPath=e.util.getPathExpr(e.errorPath,g,e.opts.jsonPointers,!0);O=l+"["+g+"]";d.dataPathArr[v]=g;A=e.validate(d);d.baseId=b,e.util.varOccurences(A,y)<2?n+=" "+e.util.varReplace(A,y,O)+" ":n+=" var "+y+" = "+O+"; "+A+" ",u&&(n+=" if (!"+m+") break; "),n+=" }"}return u&&(n+=" "+p+" if ("+h+" == errors) {"),n=e.util.cleanUpCode(n)},maximum:Qo,minimum:Qo,maxItems:Yo,minItems:Yo,maxLength:Zo,minLength:Zo,maxProperties:ea,minProperties:ea,multipleOf:function(e,t,r){var n,i=" ",o=e.level,a=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,f="data"+(a||""),h=e.opts.$data&&s&&s.$data;h?(i+=" var schema"+o+" = "+e.util.getData(s.$data,a,e.dataPathArr)+"; ",n="schema"+o):n=s,i+="var division"+o+";if (",h&&(i+=" "+n+" !== undefined && ( typeof "+n+" != 'number' || "),i+=" (division"+o+" = "+f+" / "+n+", ",e.opts.multipleOfPrecision?i+=" Math.abs(Math.round(division"+o+") - division"+o+") > 1e-"+e.opts.multipleOfPrecision+" ":i+=" division"+o+" !== parseInt(division"+o+") ",i+=" ) ",h&&(i+=" ) "),i+=" ) { ";var d=d||[];d.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { multipleOf: "+n+" } ",!1!==e.opts.messages&&(i+=" , message: 'should be multiple of ",i+=h?"' + "+n:n+"'"),e.opts.verbose&&(i+=" , schema: ",i+=h?"validate.schema"+c:""+s,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var p=i;return i=d.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+p+"]); ":i+=" validate.errors = ["+p+"]; return false; ":i+=" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",l&&(i+=" else { "),i},not:function(e,t,r){var n=" ",i=e.level,o=e.dataLevel,a=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,l="data"+(o||""),f="errs__"+i,h=e.util.copy(e);h.level++;var d="valid"+h.level;if(e.opts.strictKeywords?"object"==typeof a&&Object.keys(a).length>0:e.util.schemaHasRules(a,e.RULES.all)){h.schema=a,h.schemaPath=s,h.errSchemaPath=c,n+=" var "+f+" = errors; ";var p,m=e.compositeRule;e.compositeRule=h.compositeRule=!0,h.createErrors=!1,h.opts.allErrors&&(p=h.opts.allErrors,h.opts.allErrors=!1),n+=" "+e.validate(h)+" ",h.createErrors=!0,p&&(h.opts.allErrors=p),e.compositeRule=h.compositeRule=m,n+=" if ("+d+") { ";var g=g||[];g.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: 'should NOT be valid' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var v=n;n=g.pop(),!e.compositeRule&&u?e.async?n+=" throw new ValidationError(["+v+"]); ":n+=" validate.errors = ["+v+"]; return false; ":n+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else { errors = "+f+"; if (vErrors !== null) { if ("+f+") vErrors.length = "+f+"; else vErrors = null; } ",e.opts.allErrors&&(n+=" } ")}else n+=" var err = ",!1!==e.createErrors?(n+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: 'should NOT be valid' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u&&(n+=" if (false) { ");return n},oneOf:function(e,t,r){var n=" ",i=e.level,o=e.dataLevel,a=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,l="data"+(o||""),f="valid"+i,h="errs__"+i,d=e.util.copy(e),p="";d.level++;var m="valid"+d.level,g=d.baseId,v="prevValid"+i,y="passingSchemas"+i;n+="var "+h+" = errors , "+v+" = false , "+f+" = false , "+y+" = null; ";var b=e.compositeRule;e.compositeRule=d.compositeRule=!0;var w=a;if(w)for(var _,S=-1,E=w.length-1;S<E;)_=w[S+=1],(e.opts.strictKeywords?"object"==typeof _&&Object.keys(_).length>0:e.util.schemaHasRules(_,e.RULES.all))?(d.schema=_,d.schemaPath=s+"["+S+"]",d.errSchemaPath=c+"/"+S,n+=" "+e.validate(d)+" ",d.baseId=g):n+=" var "+m+" = true; ",S&&(n+=" if ("+m+" && "+v+") { "+f+" = false; "+y+" = ["+y+", "+S+"]; } else { ",p+="}"),n+=" if ("+m+") { "+f+" = "+v+" = true; "+y+" = "+S+"; }";return e.compositeRule=d.compositeRule=b,n+=p+"if (!"+f+") { var err = ",!1!==e.createErrors?(n+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { passingSchemas: "+y+" } ",!1!==e.opts.messages&&(n+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&u&&(e.async?n+=" throw new ValidationError(vErrors); ":n+=" validate.errors = vErrors; return false; "),n+="} else { errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; }",e.opts.allErrors&&(n+=" } "),n},pattern:function(e,t,r){var n,i=" ",o=e.level,a=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,f="data"+(a||""),h=e.opts.$data&&s&&s.$data;h?(i+=" var schema"+o+" = "+e.util.getData(s.$data,a,e.dataPathArr)+"; ",n="schema"+o):n=s,i+="if ( ",h&&(i+=" ("+n+" !== undefined && typeof "+n+" != 'string') || "),i+=" !"+(h?"(new RegExp("+n+"))":e.usePattern(s))+".test("+f+") ) { ";var d=d||[];d.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { pattern: ",i+=h?""+n:""+e.util.toQuotedString(s),i+=" } ",!1!==e.opts.messages&&(i+=" , message: 'should match pattern \"",i+=h?"' + "+n+" + '":""+e.util.escapeQuotes(s),i+="\"' "),e.opts.verbose&&(i+=" , schema: ",i+=h?"validate.schema"+c:""+e.util.toQuotedString(s),i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var p=i;return i=d.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+p+"]); ":i+=" validate.errors = ["+p+"]; return false; ":i+=" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",l&&(i+=" else { "),i},properties:function(e,t,r){var n=" ",i=e.level,o=e.dataLevel,a=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,l="data"+(o||""),f="errs__"+i,h=e.util.copy(e),d="";h.level++;var p="valid"+h.level,m="key"+i,g="idx"+i,v=h.dataLevel=e.dataLevel+1,y="data"+v,b="dataProperties"+i,w=Object.keys(a||{}),_=e.schema.patternProperties||{},S=Object.keys(_),E=e.schema.additionalProperties,x=w.length||S.length,I=!1===E,k="object"==typeof E&&Object.keys(E).length,P=e.opts.removeAdditional,O=I||k||P,A=e.opts.ownProperties,T=e.baseId,C=e.schema.required;if(C&&(!e.opts.$data||!C.$data)&&C.length<e.opts.loopRequired)var N=e.util.toHash(C);if(n+="var "+f+" = errors;var "+p+" = true;",A&&(n+=" var "+b+" = undefined;"),O){if(n+=A?" "+b+" = "+b+" || Object.keys("+l+"); for (var "+g+"=0; "+g+"<"+b+".length; "+g+"++) { var "+m+" = "+b+"["+g+"]; ":" for (var "+m+" in "+l+") { ",x){if(n+=" var isAdditional"+i+" = !(false ",w.length)if(w.length>8)n+=" || validate.schema"+s+".hasOwnProperty("+m+") ";else{var R=w;if(R)for(var M=-1,L=R.length-1;M<L;)J=R[M+=1],n+=" || "+m+" == "+e.util.toQuotedString(J)+" "}if(S.length){var j=S;if(j)for(var D=-1,B=j.length-1;D<B;)ie=j[D+=1],n+=" || "+e.usePattern(ie)+".test("+m+") "}n+=" ); if (isAdditional"+i+") { "}if("all"==P)n+=" delete "+l+"["+m+"]; ";else{var U=e.errorPath,F="' + "+m+" + '";if(e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers)),I)if(P)n+=" delete "+l+"["+m+"]; ";else{n+=" "+p+" = false; ";var H=c;c=e.errSchemaPath+"/additionalProperties",(te=te||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'additionalProperties' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { additionalProperty: '"+F+"' } ",!1!==e.opts.messages&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is an invalid additional property":n+="should NOT have additional properties",n+="' "),e.opts.verbose&&(n+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var V=n;n=te.pop(),!e.compositeRule&&u?e.async?n+=" throw new ValidationError(["+V+"]); ":n+=" validate.errors = ["+V+"]; return false; ":n+=" var err = "+V+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c=H,u&&(n+=" break; ")}else if(k)if("failing"==P){n+=" var "+f+" = errors; ";var z=e.compositeRule;e.compositeRule=h.compositeRule=!0,h.schema=E,h.schemaPath=e.schemaPath+".additionalProperties",h.errSchemaPath=e.errSchemaPath+"/additionalProperties",h.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers);var q=l+"["+m+"]";h.dataPathArr[v]=m;var K=e.validate(h);h.baseId=T,e.util.varOccurences(K,y)<2?n+=" "+e.util.varReplace(K,y,q)+" ":n+=" var "+y+" = "+q+"; "+K+" ",n+=" if (!"+p+") { errors = "+f+"; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete "+l+"["+m+"]; } ",e.compositeRule=h.compositeRule=z}else{h.schema=E,h.schemaPath=e.schemaPath+".additionalProperties",h.errSchemaPath=e.errSchemaPath+"/additionalProperties",h.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers);q=l+"["+m+"]";h.dataPathArr[v]=m;K=e.validate(h);h.baseId=T,e.util.varOccurences(K,y)<2?n+=" "+e.util.varReplace(K,y,q)+" ":n+=" var "+y+" = "+q+"; "+K+" ",u&&(n+=" if (!"+p+") break; ")}e.errorPath=U}x&&(n+=" } "),n+=" } ",u&&(n+=" if ("+p+") { ",d+="}")}var $=e.opts.useDefaults&&!e.compositeRule;if(w.length){var G=w;if(G)for(var J,W=-1,X=G.length-1;W<X;){var Q=a[J=G[W+=1]];if(e.opts.strictKeywords?"object"==typeof Q&&Object.keys(Q).length>0:e.util.schemaHasRules(Q,e.RULES.all)){var Y=e.util.getProperty(J),Z=(q=l+Y,$&&void 0!==Q.default);h.schema=Q,h.schemaPath=s+Y,h.errSchemaPath=c+"/"+e.util.escapeFragment(J),h.errorPath=e.util.getPath(e.errorPath,J,e.opts.jsonPointers),h.dataPathArr[v]=e.util.toQuotedString(J);K=e.validate(h);if(h.baseId=T,e.util.varOccurences(K,y)<2){K=e.util.varReplace(K,y,q);var ee=q}else{ee=y;n+=" var "+y+" = "+q+"; "}if(Z)n+=" "+K+" ";else{if(N&&N[J]){n+=" if ( "+ee+" === undefined ",A&&(n+=" || ! Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(J)+"') "),n+=") { "+p+" = false; ";U=e.errorPath,H=c;var te,re=e.util.escapeQuotes(J);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(U,J,e.opts.jsonPointers)),c=e.errSchemaPath+"/required",(te=te||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+re+"' } ",!1!==e.opts.messages&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+re+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";V=n;n=te.pop(),!e.compositeRule&&u?e.async?n+=" throw new ValidationError(["+V+"]); ":n+=" validate.errors = ["+V+"]; return false; ":n+=" var err = "+V+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c=H,e.errorPath=U,n+=" } else { "}else u?(n+=" if ( "+ee+" === undefined ",A&&(n+=" || ! Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(J)+"') "),n+=") { "+p+" = true; } else { "):(n+=" if ("+ee+" !== undefined ",A&&(n+=" && Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(J)+"') "),n+=" ) { ");n+=" "+K+" } "}}u&&(n+=" if ("+p+") { ",d+="}")}}if(S.length){var ne=S;if(ne)for(var ie,oe=-1,ae=ne.length-1;oe<ae;){Q=_[ie=ne[oe+=1]];if(e.opts.strictKeywords?"object"==typeof Q&&Object.keys(Q).length>0:e.util.schemaHasRules(Q,e.RULES.all)){h.schema=Q,h.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(ie),h.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(ie),n+=A?" "+b+" = "+b+" || Object.keys("+l+"); for (var "+g+"=0; "+g+"<"+b+".length; "+g+"++) { var "+m+" = "+b+"["+g+"]; ":" for (var "+m+" in "+l+") { ",n+=" if ("+e.usePattern(ie)+".test("+m+")) { ",h.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers);q=l+"["+m+"]";h.dataPathArr[v]=m;K=e.validate(h);h.baseId=T,e.util.varOccurences(K,y)<2?n+=" "+e.util.varReplace(K,y,q)+" ":n+=" var "+y+" = "+q+"; "+K+" ",u&&(n+=" if (!"+p+") break; "),n+=" } ",u&&(n+=" else "+p+" = true; "),n+=" } ",u&&(n+=" if ("+p+") { ",d+="}")}}}return u&&(n+=" "+d+" if ("+f+" == errors) {"),n=e.util.cleanUpCode(n)},propertyNames:function(e,t,r){var n=" ",i=e.level,o=e.dataLevel,a=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,l="data"+(o||""),f="errs__"+i,h=e.util.copy(e);h.level++;var d="valid"+h.level;if(n+="var "+f+" = errors;",e.opts.strictKeywords?"object"==typeof a&&Object.keys(a).length>0:e.util.schemaHasRules(a,e.RULES.all)){h.schema=a,h.schemaPath=s,h.errSchemaPath=c;var p="key"+i,m="idx"+i,g="i"+i,v="' + "+p+" + '",y="data"+(h.dataLevel=e.dataLevel+1),b="dataProperties"+i,w=e.opts.ownProperties,_=e.baseId;w&&(n+=" var "+b+" = undefined; "),n+=w?" "+b+" = "+b+" || Object.keys("+l+"); for (var "+m+"=0; "+m+"<"+b+".length; "+m+"++) { var "+p+" = "+b+"["+m+"]; ":" for (var "+p+" in "+l+") { ",n+=" var startErrs"+i+" = errors; ";var S=p,E=e.compositeRule;e.compositeRule=h.compositeRule=!0;var x=e.validate(h);h.baseId=_,e.util.varOccurences(x,y)<2?n+=" "+e.util.varReplace(x,y,S)+" ":n+=" var "+y+" = "+S+"; "+x+" ",e.compositeRule=h.compositeRule=E,n+=" if (!"+d+") { for (var "+g+"=startErrs"+i+"; "+g+"<errors; "+g+"++) { vErrors["+g+"].propertyName = "+p+"; } var err = ",!1!==e.createErrors?(n+=" { keyword: 'propertyNames' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { propertyName: '"+v+"' } ",!1!==e.opts.messages&&(n+=" , message: 'property name \\'"+v+"\\' is invalid' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&u&&(e.async?n+=" throw new ValidationError(vErrors); ":n+=" validate.errors = vErrors; return false; "),u&&(n+=" break; "),n+=" } }"}return u&&(n+=" if ("+f+" == errors) {"),n=e.util.cleanUpCode(n)},required:function(e,t,r){var n=" ",i=e.level,o=e.dataLevel,a=e.schema[t],s=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,l="data"+(o||""),f="valid"+i,h=e.opts.$data&&a&&a.$data;h&&(n+=" var schema"+i+" = "+e.util.getData(a.$data,o,e.dataPathArr)+"; ");var d="schema"+i;if(!h)if(a.length<e.opts.loopRequired&&e.schema.properties&&Object.keys(e.schema.properties).length){var p=[],m=a;if(m)for(var g,v=-1,y=m.length-1;v<y;){g=m[v+=1];var b=e.schema.properties[g];b&&(e.opts.strictKeywords?"object"==typeof b&&Object.keys(b).length>0:e.util.schemaHasRules(b,e.RULES.all))||(p[p.length]=g)}}else p=a;if(h||p.length){var w=e.errorPath,_=h||p.length>=e.opts.loopRequired,S=e.opts.ownProperties;if(u)if(n+=" var missing"+i+"; ",_){h||(n+=" var "+d+" = validate.schema"+s+"; ");var E="' + "+(A="schema"+i+"["+(k="i"+i)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(w,A,e.opts.jsonPointers)),n+=" var "+f+" = true; ",h&&(n+=" if (schema"+i+" === undefined) "+f+" = true; else if (!Array.isArray(schema"+i+")) "+f+" = false; else {"),n+=" for (var "+k+" = 0; "+k+" < "+d+".length; "+k+"++) { "+f+" = "+l+"["+d+"["+k+"]] !== undefined ",S&&(n+=" && Object.prototype.hasOwnProperty.call("+l+", "+d+"["+k+"]) "),n+="; if (!"+f+") break; } ",h&&(n+=" } "),n+=" if (!"+f+") { ",(O=O||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+E+"' } ",!1!==e.opts.messages&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+E+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var x=n;n=O.pop(),!e.compositeRule&&u?e.async?n+=" throw new ValidationError(["+x+"]); ":n+=" validate.errors = ["+x+"]; return false; ":n+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else { "}else{n+=" if ( ";var I=p;if(I)for(var k=-1,P=I.length-1;k<P;){C=I[k+=1],k&&(n+=" || "),n+=" ( ( "+(L=l+(M=e.util.getProperty(C)))+" === undefined ",S&&(n+=" || ! Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(C)+"') "),n+=") && (missing"+i+" = "+e.util.toQuotedString(e.opts.jsonPointers?C:M)+") ) "}n+=") { ";var O;E="' + "+(A="missing"+i)+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(w,A,!0):w+" + "+A),(O=O||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+E+"' } ",!1!==e.opts.messages&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+E+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";x=n;n=O.pop(),!e.compositeRule&&u?e.async?n+=" throw new ValidationError(["+x+"]); ":n+=" validate.errors = ["+x+"]; return false; ":n+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else { "}else if(_){h||(n+=" var "+d+" = validate.schema"+s+"; ");var A;E="' + "+(A="schema"+i+"["+(k="i"+i)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(w,A,e.opts.jsonPointers)),h&&(n+=" if ("+d+" && !Array.isArray("+d+")) { var err = ",!1!==e.createErrors?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+E+"' } ",!1!==e.opts.messages&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+E+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+d+" !== undefined) { "),n+=" for (var "+k+" = 0; "+k+" < "+d+".length; "+k+"++) { if ("+l+"["+d+"["+k+"]] === undefined ",S&&(n+=" || ! Object.prototype.hasOwnProperty.call("+l+", "+d+"["+k+"]) "),n+=") { var err = ",!1!==e.createErrors?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+E+"' } ",!1!==e.opts.messages&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+E+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",h&&(n+=" } ")}else{var T=p;if(T)for(var C,N=-1,R=T.length-1;N<R;){C=T[N+=1];var M=e.util.getProperty(C),L=(E=e.util.escapeQuotes(C),l+M);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(w,C,e.opts.jsonPointers)),n+=" if ( "+L+" === undefined ",S&&(n+=" || ! Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(C)+"') "),n+=") { var err = ",!1!==e.createErrors?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+E+"' } ",!1!==e.opts.messages&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+E+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}e.errorPath=w}else u&&(n+=" if (true) {");return n},uniqueItems:function(e,t,r){var n,i=" ",o=e.level,a=e.dataLevel,s=e.schema[t],c=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,f="data"+(a||""),h="valid"+o,d=e.opts.$data&&s&&s.$data;if(d?(i+=" var schema"+o+" = "+e.util.getData(s.$data,a,e.dataPathArr)+"; ",n="schema"+o):n=s,(s||d)&&!1!==e.opts.uniqueItems){d&&(i+=" var "+h+"; if ("+n+" === false || "+n+" === undefined) "+h+" = true; else if (typeof "+n+" != 'boolean') "+h+" = false; else { "),i+=" var i = "+f+".length , "+h+" = true , j; if (i > 1) { ";var p=e.schema.items&&e.schema.items.type,m=Array.isArray(p);if(!p||"object"==p||"array"==p||m&&(p.indexOf("object")>=0||p.indexOf("array")>=0))i+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+f+"[i], "+f+"[j])) { "+h+" = false; break outer; } } } ";else{i+=" var itemIndices = {}, item; for (;i--;) { var item = "+f+"[i]; ";var g="checkDataType"+(m?"s":"");i+=" if ("+e.util[g](p,"item",!0)+") continue; ",m&&(i+=" if (typeof item == 'string') item = '\"' + item; "),i+=" if (typeof itemIndices[item] == 'number') { "+h+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}i+=" } ",d&&(i+=" } "),i+=" if (!"+h+") { ";var v=v||[];v.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(i+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(i+=" , schema: ",i+=d?"validate.schema"+c:""+s,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var y=i;i=v.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+y+"]); ":i+=" validate.errors = ["+y+"]; return false; ":i+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",l&&(i+=" else { ")}else l&&(i+=" if (true) { ");return i},validate:bo},ra=Ti.toHash,na=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"],ia=function(e,t){for(var r=0;r<t.length;r++){e=JSON.parse(JSON.stringify(e));var n,i=t[r].split("/"),o=e;for(n=1;n<i.length;n++)o=o[i[n]];for(n=0;n<na.length;n++){var a=na[n],s=o[a];s&&(o[a]={anyOf:[s,{$ref:"https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/data.json#"}]})}}return e},oa=mo.MissingRef,aa=function e(t,r,n){var i=this;if("function"!=typeof this._opts.loadSchema)throw new Error("options.loadSchema should be a function");"function"==typeof r&&(n=r,r=void 0);var o=a(t).then((function(){var e=i._addSchema(t,void 0,r);return e.validate||function e(t){try{return i._compile(t)}catch(e){if(e instanceof oa)return n(e);throw e}function n(n){var o=n.missingSchema;if(u(o))throw new Error("Schema "+o+" is loaded but "+n.missingRef+" cannot be resolved");var s=i._loadingSchemas[o];return s||(s=i._loadingSchemas[o]=i._opts.loadSchema(o)).then(c,c),s.then((function(e){if(!u(o))return a(e).then((function(){u(o)||i.addSchema(e,o,void 0,r)}))})).then((function(){return e(t)}));function c(){delete i._loadingSchemas[o]}function u(e){return i._refs[e]||i._schemas[e]}}}(e)}));n&&o.then((function(e){n(null,e)}),n);return o;function a(t){var r=t.$schema;return r&&!i.getSchema(r)?e.call(i,{$ref:r},!0):Promise.resolve()}};var sa=function(e,t,r){var n,i,o=" ",a=e.level,s=e.dataLevel,c=e.schema[t],u=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,h="data"+(s||""),d="valid"+a,p="errs__"+a,m=e.opts.$data&&c&&c.$data;m?(o+=" var schema"+a+" = "+e.util.getData(c.$data,s,e.dataPathArr)+"; ",i="schema"+a):i=c;var g,v,y,b,w,_=this,S="definition"+a,E=_.definition,x="";if(m&&E.$data){w="keywordValidate"+a;var I=E.validateSchema;o+=" var "+S+" = RULES.custom['"+t+"'].definition; var "+w+" = "+S+".validate;"}else{if(!(b=e.useCustomRule(_,c,e.schema,e)))return;i="validate.schema"+u,w=b.code,g=E.compile,v=E.inline,y=E.macro}var k=w+".errors",P="i"+a,O="ruleErr"+a,A=E.async;if(A&&!e.async)throw new Error("async keyword in sync schema");if(v||y||(o+=k+" = null;"),o+="var "+p+" = errors;var "+d+";",m&&E.$data&&(x+="}",o+=" if ("+i+" === undefined) { "+d+" = true; } else { ",I&&(x+="}",o+=" "+d+" = "+S+".validateSchema("+i+"); if ("+d+") { ")),v)E.statements?o+=" "+b.validate+" ":o+=" "+d+" = "+b.validate+"; ";else if(y){var T=e.util.copy(e);x="";T.level++;var C="valid"+T.level;T.schema=b.validate,T.schemaPath="";var N=e.compositeRule;e.compositeRule=T.compositeRule=!0;var R=e.validate(T).replace(/validate\.schema/g,w);e.compositeRule=T.compositeRule=N,o+=" "+R}else{(D=D||[]).push(o),o="",o+=" "+w+".call( ",e.opts.passContext?o+="this":o+="self",g||!1===E.schema?o+=" , "+h+" ":o+=" , "+i+" , "+h+" , validate.schema"+e.schemaPath+" ",o+=" , (dataPath || '')",'""'!=e.errorPath&&(o+=" + "+e.errorPath);var M=s?"data"+(s-1||""):"parentData",L=s?e.dataPathArr[s]:"parentDataProperty",j=o+=" , "+M+" , "+L+" , rootData ) ";o=D.pop(),!1===E.errors?(o+=" "+d+" = ",A&&(o+="await "),o+=j+"; "):o+=A?" var "+(k="customErrors"+a)+" = null; try { "+d+" = await "+j+"; } catch (e) { "+d+" = false; if (e instanceof ValidationError) "+k+" = e.errors; else throw e; } ":" "+k+" = null; "+d+" = "+j+"; "}if(E.modifying&&(o+=" if ("+M+") "+h+" = "+M+"["+L+"];"),o+=""+x,E.valid)f&&(o+=" if (true) { ");else{var D;o+=" if ( ",void 0===E.valid?(o+=" !",o+=y?""+C:""+d):o+=" "+!E.valid+" ",o+=") { ",n=_.keyword,(D=D||[]).push(o),o="",(D=D||[]).push(o),o="",!1!==e.createErrors?(o+=" { keyword: '"+(n||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { keyword: '"+_.keyword+"' } ",!1!==e.opts.messages&&(o+=" , message: 'should pass \""+_.keyword+"\" keyword validation' "),e.opts.verbose&&(o+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),o+=" } "):o+=" {} ";var B=o;o=D.pop(),!e.compositeRule&&f?e.async?o+=" throw new ValidationError(["+B+"]); ":o+=" validate.errors = ["+B+"]; return false; ":o+=" var err = "+B+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var U=o;o=D.pop(),v?E.errors?"full"!=E.errors&&(o+=" for (var "+P+"="+p+"; "+P+"<errors; "+P+"++) { var "+O+" = vErrors["+P+"]; if ("+O+".dataPath === undefined) "+O+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+O+".schemaPath === undefined) { "+O+'.schemaPath = "'+l+'"; } ',e.opts.verbose&&(o+=" "+O+".schema = "+i+"; "+O+".data = "+h+"; "),o+=" } "):!1===E.errors?o+=" "+U+" ":(o+=" if ("+p+" == errors) { "+U+" } else { for (var "+P+"="+p+"; "+P+"<errors; "+P+"++) { var "+O+" = vErrors["+P+"]; if ("+O+".dataPath === undefined) "+O+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+O+".schemaPath === undefined) { "+O+'.schemaPath = "'+l+'"; } ',e.opts.verbose&&(o+=" "+O+".schema = "+i+"; "+O+".data = "+h+"; "),o+=" } } "):y?(o+=" var err = ",!1!==e.createErrors?(o+=" { keyword: '"+(n||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { keyword: '"+_.keyword+"' } ",!1!==e.opts.messages&&(o+=" , message: 'should pass \""+_.keyword+"\" keyword validation' "),e.opts.verbose&&(o+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),o+=" } "):o+=" {} ",o+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&f&&(e.async?o+=" throw new ValidationError(vErrors); ":o+=" validate.errors = vErrors; return false; ")):!1===E.errors?o+=" "+U+" ":(o+=" if (Array.isArray("+k+")) { if (vErrors === null) vErrors = "+k+"; else vErrors = vErrors.concat("+k+"); errors = vErrors.length; for (var "+P+"="+p+"; "+P+"<errors; "+P+"++) { var "+O+" = vErrors["+P+"]; if ("+O+".dataPath === undefined) "+O+".dataPath = (dataPath || '') + "+e.errorPath+"; "+O+'.schemaPath = "'+l+'"; ',e.opts.verbose&&(o+=" "+O+".schema = "+i+"; "+O+".data = "+h+"; "),o+=" } } else { "+U+" } "),o+=" } ",f&&(o+=" else { ")}return o},ca="http://json-schema.org/draft-07/schema#",ua="http://json-schema.org/draft-07/schema#",la="Core schema meta-schema",fa={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},ha=["object","boolean"],da={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},pa={$schema:ca,$id:ua,title:la,definitions:fa,type:ha,properties:da,default:!0},ma=rr(Object.freeze({__proto__:null,$schema:ca,$id:ua,title:la,definitions:fa,type:ha,properties:da,default:pa})),ga={$id:"https://github.com/epoberezkin/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:ma.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:ma.properties.type,schema:{type:"boolean"},statements:{type:"boolean"},dependencies:{type:"array",items:{type:"string"}},metaSchema:{type:"object"},modifying:{type:"boolean"},valid:{type:"boolean"},$data:{type:"boolean"},async:{type:"boolean"},errors:{anyOf:[{type:"boolean"},{const:"full"}]}}},va=/^[a-z_$][a-z0-9_$-]*$/i,ya=function(e,t){var r=this.RULES;if(r.keywords[e])throw new Error("Keyword "+e+" is already defined");if(!va.test(e))throw new Error("Keyword "+e+" is not a valid identifier");if(t){this.validateKeyword(t,!0);var n=t.type;if(Array.isArray(n))for(var i=0;i<n.length;i++)a(e,n[i],t);else a(e,n,t);var o=t.metaSchema;o&&(t.$data&&this._opts.$data&&(o={anyOf:[o,{$ref:"https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/data.json#"}]}),t.validateSchema=this.compile(o,!0))}function a(e,t,n){for(var i,o=0;o<r.length;o++){var a=r[o];if(a.type==t){i=a;break}}i||(i={type:t,rules:[]},r.push(i));var s={keyword:e,definition:n,custom:!0,code:sa,implements:n.implements};i.rules.push(s),r.custom[e]=s}return r.keywords[e]=r.all[e]=!0,this},ba=function(e){var t=this.RULES.custom[e];return t?t.definition:this.RULES.keywords[e]||!1},wa=function(e){var t=this.RULES;delete t.keywords[e],delete t.all[e],delete t.custom[e];for(var r=0;r<t.length;r++)for(var n=t[r].rules,i=0;i<n.length;i++)if(n[i].keyword==e){n.splice(i,1);break}return this},_a=function e(t,r){e.errors=null;var n=this._validateKeyword=this._validateKeyword||this.compile(ga,!0);if(n(t))return!0;if(e.errors=n.errors,r)throw new Error("custom keyword definition is invalid: "+this.errorsText(n.errors));return!1};var Sa="http://json-schema.org/draft-07/schema#",Ea="https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/data.json#",xa="Meta-schema for $data reference (JSON Schema extension proposal)",Ia=["$data"],ka={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},Pa={$schema:Sa,$id:Ea,description:xa,type:"object",required:Ia,properties:ka,additionalProperties:false},Oa=rr(Object.freeze({__proto__:null,$schema:Sa,$id:Ea,description:xa,type:"object",required:Ia,properties:ka,additionalProperties:false,default:Pa})),Aa=Ra;Ra.prototype.validate=function(e,t){var r;if("string"==typeof e){if(!(r=this.getSchema(e)))throw new Error('no schema with key or ref "'+e+'"')}else{var n=this._addSchema(e);r=n.validate||this._compile(n)}var i=r(t);!0!==r.$async&&(this.errors=r.errors);return i},Ra.prototype.compile=function(e,t){var r=this._addSchema(e,void 0,t);return r.validate||this._compile(r)},Ra.prototype.addSchema=function(e,t,r,n){if(Array.isArray(e)){for(var i=0;i<e.length;i++)this.addSchema(e[i],void 0,r,n);return this}var o=this._getId(e);if(void 0!==o&&"string"!=typeof o)throw new Error("schema id must be string");return Ua(this,t=to.normalizeId(t||o)),this._schemas[t]=this._addSchema(e,r,n,!0),this},Ra.prototype.addMetaSchema=function(e,t,r){return this.addSchema(e,t,r,!0),this},Ra.prototype.validateSchema=function(e,t){var r=e.$schema;if(void 0!==r&&"string"!=typeof r)throw new Error("$schema must be a string");if(!(r=r||this._opts.defaultMeta||function(e){var t=e._opts.meta;return e._opts.defaultMeta="object"==typeof t?e._getId(t)||t:e.getSchema(Ta)?Ta:void 0,e._opts.defaultMeta}(this)))return this.logger.warn("meta-schema not available"),this.errors=null,!0;var n=this.validate(r,e);if(!n&&t){var i="schema is invalid: "+this.errorsText();if("log"!=this._opts.validateSchema)throw new Error(i);this.logger.error(i)}return n},Ra.prototype.getSchema=function(e){var t=Ma(this,e);switch(typeof t){case"object":return t.validate||this._compile(t);case"string":return this.getSchema(t);case"undefined":return function(e,t){var r=to.schema.call(e,{schema:{}},t);if(r){var n=r.schema,i=r.root,o=r.baseId,a=So.call(e,n,i,void 0,o);return e._fragments[t]=new Zi({ref:t,fragment:!0,schema:n,root:i,baseId:o,validate:a}),a}}(this,e)}},Ra.prototype.removeSchema=function(e){if(e instanceof RegExp)return La(this,this._schemas,e),La(this,this._refs,e),this;switch(typeof e){case"undefined":return La(this,this._schemas),La(this,this._refs),this._cache.clear(),this;case"string":var t=Ma(this,e);return t&&this._cache.del(t.cacheKey),delete this._schemas[e],delete this._refs[e],this;case"object":var r=this._opts.serialize,n=r?r(e):e;this._cache.del(n);var i=this._getId(e);i&&(i=to.normalizeId(i),delete this._schemas[i],delete this._refs[i])}return this},Ra.prototype.addFormat=function(e,t){"string"==typeof t&&(t=new RegExp(t));return this._formats[e]=t,this},Ra.prototype.errorsText=function(e,t){if(!(e=e||this.errors))return"No errors";for(var r=void 0===(t=t||{}).separator?", ":t.separator,n=void 0===t.dataVar?"data":t.dataVar,i="",o=0;o<e.length;o++){var a=e[o];a&&(i+=n+a.dataPath+" "+a.message+r)}return i.slice(0,-r.length)},Ra.prototype._addSchema=function(e,t,r,n){if("object"!=typeof e&&"boolean"!=typeof e)throw new Error("schema should be object or boolean");var i=this._opts.serialize,o=i?i(e):e,a=this._cache.get(o);if(a)return a;n=n||!1!==this._opts.addUsedSchema;var s=to.normalizeId(this._getId(e));s&&n&&Ua(this,s);var c,u=!1!==this._opts.validateSchema&&!t;u&&!(c=s&&s==to.normalizeId(e.$schema))&&this.validateSchema(e,!0);var l=to.ids.call(this,e),f=new Zi({id:s,schema:e,localRefs:l,cacheKey:o,meta:r});"#"!=s[0]&&n&&(this._refs[s]=f);this._cache.put(o,f),u&&c&&this.validateSchema(e,!0);return f},Ra.prototype._compile=function(e,t){if(e.compiling)return e.validate=i,i.schema=e.schema,i.errors=null,i.root=t||i,!0===e.schema.$async&&(i.$async=!0),i;var r,n;e.compiling=!0,e.meta&&(r=this._opts,this._opts=this._metaOpts);try{n=So.call(this,e.schema,t,e.localRefs)}catch(t){throw delete e.validate,t}finally{e.compiling=!1,e.meta&&(this._opts=r)}return e.validate=n,e.refs=n.refs,e.refVal=n.refVal,e.root=n.root,n;function i(){var t=e.validate,r=t.apply(this,arguments);return i.errors=t.errors,r}},Ra.prototype.compileAsync=aa,Ra.prototype.addKeyword=ya,Ra.prototype.getKeyword=ba,Ra.prototype.removeKeyword=wa,Ra.prototype.validateKeyword=_a,Ra.ValidationError=mo.Validation,Ra.MissingRefError=mo.MissingRef,Ra.$dataMetaSchema=ia;var Ta="http://json-schema.org/draft-07/schema",Ca=["removeAdditional","useDefaults","coerceTypes","strictDefaults"],Na=["/properties"];function Ra(e){if(!(this instanceof Ra))return new Ra(e);var t,r;e=this._opts=Ti.copy(e)||{},function(e){var t=e._opts.logger;if(!1===t)e.logger={log:Fa,warn:Fa,error:Fa};else{if(void 0===t&&(t=console),!("object"==typeof t&&t.log&&t.warn&&t.error))throw new Error("logger must implement log, warn and error methods");e.logger=t}}(this),this._schemas={},this._refs={},this._fragments={},this._formats=zo(e.format),this._cache=e.cache||new Co,this._loadingSchemas={},this._compilations=[],this.RULES=((t=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}]).all=ra(r=["type","$comment"]),t.types=ra(["number","integer","string","array","object","boolean","null"]),t.forEach((function(e){e.rules=e.rules.map((function(e){var n;if("object"==typeof e){var i=Object.keys(e)[0];n=e[i],e=i,n.forEach((function(e){r.push(e),t.all[e]=!0}))}return r.push(e),t.all[e]={keyword:e,code:ta[e],implements:n}})),t.all.$comment={keyword:"$comment",code:ta.$comment},e.type&&(t.types[e.type]=e)})),t.keywords=ra(r.concat(["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"])),t.custom={},t),this._getId=function(e){switch(e.schemaId){case"auto":return Ba;case"id":return ja;default:return Da}}(e),e.loopRequired=e.loopRequired||1/0,"property"==e.errorDataPath&&(e._errorDataPathProperty=!0),void 0===e.serialize&&(e.serialize=yo),this._metaOpts=function(e){for(var t=Ti.copy(e._opts),r=0;r<Ca.length;r++)delete t[Ca[r]];return t}(this),e.formats&&function(e){for(var t in e._opts.formats){var r=e._opts.formats[t];e.addFormat(t,r)}}(this),function(e){var t;e._opts.$data&&(t=Oa,e.addMetaSchema(t,t.$id,!0));if(!1===e._opts.meta)return;var r=ma;e._opts.$data&&(r=ia(r,Na));e.addMetaSchema(r,Ta,!0),e._refs["http://json-schema.org/schema"]=Ta}(this),"object"==typeof e.meta&&this.addMetaSchema(e.meta),e.nullable&&this.addKeyword("nullable",{metaSchema:{type:"boolean"}}),function(e){var t=e._opts.schemas;if(!t)return;if(Array.isArray(t))e.addSchema(t);else for(var r in t)e.addSchema(t[r],r)}(this)}function Ma(e,t){return t=to.normalizeId(t),e._schemas[t]||e._refs[t]||e._fragments[t]}function La(e,t,r){for(var n in t){var i=t[n];i.meta||r&&!r.test(n)||(e._cache.del(i.cacheKey),delete t[n])}}function ja(e){return e.$id&&this.logger.warn("schema $id ignored",e.$id),e.id}function Da(e){return e.id&&this.logger.warn("schema id ignored",e.id),e.$id}function Ba(e){if(e.$id&&e.id&&e.$id!=e.id)throw new Error("schema $id is different from id");return e.$id||e.id}function Ua(e,t){if(e._schemas[t]||e._refs[t])throw new Error('schema with key or id "'+t+'" already exists')}function Fa(){}var Ha=rr(xi);var Va={validate:(new Aa).compile(Ha)};var za={root:{merkleRoot:0,targetHash:1,anchors:2,path:3},path:{left:0,right:1},chain:{btc:{id:0,networks:{mainnet:1,testnet:3}},eth:{id:1,networks:{mainnet:1,ropsten:3,rinkeby:4}},mtc:{id:2,networks:{mainnet:137,mumbai:80001}}}},qa=tr((function(e){!function(t){var r,n=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,i=Math.ceil,o=Math.floor,a="[BigNumber Error] ",s=a+"Number primitive has more than 15 significant digits: ",c=1e14,u=14,l=9007199254740991,f=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],h=1e7,d=1e9;function p(e){var t=0|e;return e>0||e===t?t:t-1}function m(e){for(var t,r,n=1,i=e.length,o=e[0]+"";n<i;){for(t=e[n++]+"",r=u-t.length;r--;t="0"+t);o+=t}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function g(e,t){var r,n,i=e.c,o=t.c,a=e.s,s=t.s,c=e.e,u=t.e;if(!a||!s)return null;if(r=i&&!i[0],n=o&&!o[0],r||n)return r?n?0:-s:a;if(a!=s)return a;if(r=a<0,n=c==u,!i||!o)return n?0:!i^r?1:-1;if(!n)return c>u^r?1:-1;for(s=(c=i.length)<(u=o.length)?c:u,a=0;a<s;a++)if(i[a]!=o[a])return i[a]>o[a]^r?1:-1;return c==u?0:c>u^r?1:-1}function v(e,t,r,n){if(e<t||e>r||e!==o(e))throw Error(a+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function y(e){var t=e.c.length-1;return p(e.e/u)==t&&e.c[t]%2!=0}function b(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function w(e,t,r){var n,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(++t>(n=e.length)){for(i=r,t-=n;--t;i+=r);e+=i}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}(r=function e(t){var r,_,S,E,x,I,k,P,O,A,T=z.prototype={constructor:z,toString:null,valueOf:null},C=new z(1),N=20,R=4,M=-7,L=21,j=-1e7,D=1e7,B=!1,U=1,F=0,H={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},V="0123456789abcdefghijklmnopqrstuvwxyz";function z(e,t){var r,i,a,c,f,h,d,p,m=this;if(!(m instanceof z))return new z(e,t);if(null==t){if(e&&!0===e._isBigNumber)return m.s=e.s,void(!e.c||e.e>D?m.c=m.e=null:e.e<j?m.c=[m.e=0]:(m.e=e.e,m.c=e.c.slice()));if((h="number"==typeof e)&&0*e==0){if(m.s=1/e<0?(e=-e,-1):1,e===~~e){for(c=0,f=e;f>=10;f/=10,c++);return void(c>D?m.c=m.e=null:(m.e=c,m.c=[e]))}p=String(e)}else{if(!n.test(p=String(e)))return S(m,p,h);m.s=45==p.charCodeAt(0)?(p=p.slice(1),-1):1}(c=p.indexOf("."))>-1&&(p=p.replace(".","")),(f=p.search(/e/i))>0?(c<0&&(c=f),c+=+p.slice(f+1),p=p.substring(0,f)):c<0&&(c=p.length)}else{if(v(t,2,V.length,"Base"),10==t)return G(m=new z(e),N+m.e+1,R);if(p=String(e),h="number"==typeof e){if(0*e!=0)return S(m,p,h,t);if(m.s=1/e<0?(p=p.slice(1),-1):1,z.DEBUG&&p.replace(/^0\.0*|\./,"").length>15)throw Error(s+e)}else m.s=45===p.charCodeAt(0)?(p=p.slice(1),-1):1;for(r=V.slice(0,t),c=f=0,d=p.length;f<d;f++)if(r.indexOf(i=p.charAt(f))<0){if("."==i){if(f>c){c=d;continue}}else if(!a&&(p==p.toUpperCase()&&(p=p.toLowerCase())||p==p.toLowerCase()&&(p=p.toUpperCase()))){a=!0,f=-1,c=0;continue}return S(m,String(e),h,t)}h=!1,(c=(p=_(p,t,10,m.s)).indexOf("."))>-1?p=p.replace(".",""):c=p.length}for(f=0;48===p.charCodeAt(f);f++);for(d=p.length;48===p.charCodeAt(--d););if(p=p.slice(f,++d)){if(d-=f,h&&z.DEBUG&&d>15&&(e>l||e!==o(e)))throw Error(s+m.s*e);if((c=c-f-1)>D)m.c=m.e=null;else if(c<j)m.c=[m.e=0];else{if(m.e=c,m.c=[],f=(c+1)%u,c<0&&(f+=u),f<d){for(f&&m.c.push(+p.slice(0,f)),d-=u;f<d;)m.c.push(+p.slice(f,f+=u));f=u-(p=p.slice(f)).length}else f-=d;for(;f--;p+="0");m.c.push(+p)}}else m.c=[m.e=0]}function q(e,t,r,n){var i,o,a,s,c;if(null==r?r=R:v(r,0,8),!e.c)return e.toString();if(i=e.c[0],a=e.e,null==t)c=m(e.c),c=1==n||2==n&&(a<=M||a>=L)?b(c,a):w(c,a,"0");else if(o=(e=G(new z(e),t,r)).e,s=(c=m(e.c)).length,1==n||2==n&&(t<=o||o<=M)){for(;s<t;c+="0",s++);c=b(c,o)}else if(t-=a,c=w(c,o,"0"),o+1>s){if(--t>0)for(c+=".";t--;c+="0");}else if((t+=o-s)>0)for(o+1==s&&(c+=".");t--;c+="0");return e.s<0&&i?"-"+c:c}function K(e,t){for(var r,n=1,i=new z(e[0]);n<e.length;n++){if(!(r=new z(e[n])).s){i=r;break}t.call(i,r)&&(i=r)}return i}function $(e,t,r){for(var n=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,n++);return(r=n+r*u-1)>D?e.c=e.e=null:r<j?e.c=[e.e=0]:(e.e=r,e.c=t),e}function G(e,t,r,n){var a,s,l,h,d,p,m,g=e.c,v=f;if(g){e:{for(a=1,h=g[0];h>=10;h/=10,a++);if((s=t-a)<0)s+=u,l=t,m=(d=g[p=0])/v[a-l-1]%10|0;else if((p=i((s+1)/u))>=g.length){if(!n)break e;for(;g.length<=p;g.push(0));d=m=0,a=1,l=(s%=u)-u+1}else{for(d=h=g[p],a=1;h>=10;h/=10,a++);m=(l=(s%=u)-u+a)<0?0:d/v[a-l-1]%10|0}if(n=n||t<0||null!=g[p+1]||(l<0?d:d%v[a-l-1]),n=r<4?(m||n)&&(0==r||r==(e.s<0?3:2)):m>5||5==m&&(4==r||n||6==r&&(s>0?l>0?d/v[a-l]:0:g[p-1])%10&1||r==(e.s<0?8:7)),t<1||!g[0])return g.length=0,n?(t-=e.e+1,g[0]=v[(u-t%u)%u],e.e=-t||0):g[0]=e.e=0,e;if(0==s?(g.length=p,h=1,p--):(g.length=p+1,h=v[u-s],g[p]=l>0?o(d/v[a-l]%v[l])*h:0),n)for(;;){if(0==p){for(s=1,l=g[0];l>=10;l/=10,s++);for(l=g[0]+=h,h=1;l>=10;l/=10,h++);s!=h&&(e.e++,g[0]==c&&(g[0]=1));break}if(g[p]+=h,g[p]!=c)break;g[p--]=0,h=1}for(s=g.length;0===g[--s];g.pop());}e.e>D?e.c=e.e=null:e.e<j&&(e.c=[e.e=0])}return e}function J(e){var t,r=e.e;return null===r?e.toString():(t=m(e.c),t=r<=M||r>=L?b(t,r):w(t,r,"0"),e.s<0?"-"+t:t)}return z.clone=e,z.ROUND_UP=0,z.ROUND_DOWN=1,z.ROUND_CEIL=2,z.ROUND_FLOOR=3,z.ROUND_HALF_UP=4,z.ROUND_HALF_DOWN=5,z.ROUND_HALF_EVEN=6,z.ROUND_HALF_CEIL=7,z.ROUND_HALF_FLOOR=8,z.EUCLID=9,z.config=z.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(a+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(v(r=e[t],0,d,t),N=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(v(r=e[t],0,8,t),R=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(v(r[0],-d,0,t),v(r[1],0,d,t),M=r[0],L=r[1]):(v(r,-d,d,t),M=-(L=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)v(r[0],-d,-1,t),v(r[1],1,d,t),j=r[0],D=r[1];else{if(v(r,-d,d,t),!r)throw Error(a+t+" cannot be zero: "+r);j=-(D=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(a+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw B=!r,Error(a+"crypto unavailable");B=r}else B=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(v(r=e[t],0,9,t),U=r),e.hasOwnProperty(t="POW_PRECISION")&&(v(r=e[t],0,d,t),F=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(a+t+" not an object: "+r);H=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.$|[+-.\s]|(.).*\1/.test(r))throw Error(a+t+" invalid: "+r);V=r}}return{DECIMAL_PLACES:N,ROUNDING_MODE:R,EXPONENTIAL_AT:[M,L],RANGE:[j,D],CRYPTO:B,MODULO_MODE:U,POW_PRECISION:F,FORMAT:H,ALPHABET:V}},z.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!z.DEBUG)return!0;var t,r,n=e.c,i=e.e,s=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===s||-1===s)&&i>=-d&&i<=d&&i===o(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break e}if((t=(i+1)%u)<1&&(t+=u),String(n[0]).length==t){for(t=0;t<n.length;t++)if((r=n[t])<0||r>=c||r!==o(r))break e;if(0!==r)return!0}}}else if(null===n&&null===i&&(null===s||1===s||-1===s))return!0;throw Error(a+"Invalid BigNumber: "+e)},z.maximum=z.max=function(){return K(arguments,T.lt)},z.minimum=z.min=function(){return K(arguments,T.gt)},z.random=(E=9007199254740992,x=Math.random()*E&2097151?function(){return o(Math.random()*E)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,s,c,l=0,h=[],p=new z(C);if(null==e?e=N:v(e,0,d),s=i(e/u),B)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(s*=2));l<s;)(c=131072*t[l]+(t[l+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[l]=r[0],t[l+1]=r[1]):(h.push(c%1e14),l+=2);l=s/2}else{if(!crypto.randomBytes)throw B=!1,Error(a+"crypto unavailable");for(t=crypto.randomBytes(s*=7);l<s;)(c=281474976710656*(31&t[l])+1099511627776*t[l+1]+4294967296*t[l+2]+16777216*t[l+3]+(t[l+4]<<16)+(t[l+5]<<8)+t[l+6])>=9e15?crypto.randomBytes(7).copy(t,l):(h.push(c%1e14),l+=7);l=s/7}if(!B)for(;l<s;)(c=x())<9e15&&(h[l++]=c%1e14);for(s=h[--l],e%=u,s&&e&&(c=f[u-e],h[l]=o(s/c)*c);0===h[l];h.pop(),l--);if(l<0)h=[n=0];else{for(n=-1;0===h[0];h.splice(0,1),n-=u);for(l=1,c=h[0];c>=10;c/=10,l++);l<u&&(n-=u-l)}return p.e=n,p.c=h,p}),z.sum=function(){for(var e=1,t=arguments,r=new z(t[0]);e<t.length;)r=r.plus(t[e++]);return r},_=function(){var e="0123456789";function t(e,t,r,n){for(var i,o,a=[0],s=0,c=e.length;s<c;){for(o=a.length;o--;a[o]*=t);for(a[0]+=n.indexOf(e.charAt(s++)),i=0;i<a.length;i++)a[i]>r-1&&(null==a[i+1]&&(a[i+1]=0),a[i+1]+=a[i]/r|0,a[i]%=r)}return a.reverse()}return function(n,i,o,a,s){var c,u,l,f,h,d,p,g,v=n.indexOf("."),y=N,b=R;for(v>=0&&(f=F,F=0,n=n.replace(".",""),d=(g=new z(i)).pow(n.length-v),F=f,g.c=t(w(m(d.c),d.e,"0"),10,o,e),g.e=g.c.length),l=f=(p=t(n,i,o,s?(c=V,e):(c=e,V))).length;0==p[--f];p.pop());if(!p[0])return c.charAt(0);if(v<0?--l:(d.c=p,d.e=l,d.s=a,p=(d=r(d,g,y,b,o)).c,h=d.r,l=d.e),v=p[u=l+y+1],f=o/2,h=h||u<0||null!=p[u+1],h=b<4?(null!=v||h)&&(0==b||b==(d.s<0?3:2)):v>f||v==f&&(4==b||h||6==b&&1&p[u-1]||b==(d.s<0?8:7)),u<1||!p[0])n=h?w(c.charAt(1),-y,c.charAt(0)):c.charAt(0);else{if(p.length=u,h)for(--o;++p[--u]>o;)p[u]=0,u||(++l,p=[1].concat(p));for(f=p.length;!p[--f];);for(v=0,n="";v<=f;n+=c.charAt(p[v++]));n=w(n,l,c.charAt(0))}return n}}(),r=function(){function e(e,t,r){var n,i,o,a,s=0,c=e.length,u=t%h,l=t/h|0;for(e=e.slice();c--;)s=((i=u*(o=e[c]%h)+(n=l*o+(a=e[c]/h|0)*u)%h*h+s)/r|0)+(n/h|0)+l*a,e[c]=i%r;return s&&(e=[s].concat(e)),e}function t(e,t,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;i<r;i++)if(e[i]!=t[i]){o=e[i]>t[i]?1:-1;break}return o}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]<t[r]?1:0,e[r]=i*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,i,a,s,l){var f,h,d,m,g,v,y,b,w,_,S,E,x,I,k,P,O,A=n.s==i.s?1:-1,T=n.c,C=i.c;if(!(T&&T[0]&&C&&C[0]))return new z(n.s&&i.s&&(T?!C||T[0]!=C[0]:C)?T&&0==T[0]||!C?0*A:A/0:NaN);for(w=(b=new z(A)).c=[],A=a+(h=n.e-i.e)+1,l||(l=c,h=p(n.e/u)-p(i.e/u),A=A/u|0),d=0;C[d]==(T[d]||0);d++);if(C[d]>(T[d]||0)&&h--,A<0)w.push(1),m=!0;else{for(I=T.length,P=C.length,d=0,A+=2,(g=o(l/(C[0]+1)))>1&&(C=e(C,g,l),T=e(T,g,l),P=C.length,I=T.length),x=P,S=(_=T.slice(0,P)).length;S<P;_[S++]=0);O=C.slice(),O=[0].concat(O),k=C[0],C[1]>=l/2&&k++;do{if(g=0,(f=t(C,_,P,S))<0){if(E=_[0],P!=S&&(E=E*l+(_[1]||0)),(g=o(E/k))>1)for(g>=l&&(g=l-1),y=(v=e(C,g,l)).length,S=_.length;1==t(v,_,y,S);)g--,r(v,P<y?O:C,y,l),y=v.length,f=1;else 0==g&&(f=g=1),y=(v=C.slice()).length;if(y<S&&(v=[0].concat(v)),r(_,v,S,l),S=_.length,-1==f)for(;t(C,_,P,S)<1;)g++,r(_,P<S?O:C,S,l),S=_.length}else 0===f&&(g++,_=[0]);w[d++]=g,_[0]?_[S++]=T[x]||0:(_=[T[x]],S=1)}while((x++<I||null!=_[0])&&A--);m=null!=_[0],w[0]||w.splice(0,1)}if(l==c){for(d=1,A=w[0];A>=10;A/=10,d++);G(b,a+(b.e=d+h*u-1)+1,s,m)}else b.e=h,b.r=+m;return b}}(),I=/^(-?)0([xbo])(?=\w[\w.]*$)/i,k=/^([^.]+)\.$/,P=/^\.([^.]+)$/,O=/^-?(Infinity|NaN)$/,A=/^\s*\+(?=[\w.])|^\s+|\s+$/g,S=function(e,t,r,n){var i,o=r?t:t.replace(A,"");if(O.test(o))e.s=isNaN(o)?null:o<0?-1:1;else{if(!r&&(o=o.replace(I,(function(e,t,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?e:t})),n&&(i=n,o=o.replace(k,"$1").replace(P,"0.$1")),t!=o))return new z(o,i);if(z.DEBUG)throw Error(a+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},T.absoluteValue=T.abs=function(){var e=new z(this);return e.s<0&&(e.s=1),e},T.comparedTo=function(e,t){return g(this,new z(e,t))},T.decimalPlaces=T.dp=function(e,t){var r,n,i,o=this;if(null!=e)return v(e,0,d),null==t?t=R:v(t,0,8),G(new z(o),e+o.e+1,t);if(!(r=o.c))return null;if(n=((i=r.length-1)-p(this.e/u))*u,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},T.dividedBy=T.div=function(e,t){return r(this,new z(e,t),N,R)},T.dividedToIntegerBy=T.idiv=function(e,t){return r(this,new z(e,t),0,1)},T.exponentiatedBy=T.pow=function(e,t){var r,n,s,c,l,f,h,d,p=this;if((e=new z(e)).c&&!e.isInteger())throw Error(a+"Exponent not an integer: "+J(e));if(null!=t&&(t=new z(t)),l=e.e>14,!p.c||!p.c[0]||1==p.c[0]&&!p.e&&1==p.c.length||!e.c||!e.c[0])return d=new z(Math.pow(+J(p),l?2-y(e):+J(e))),t?d.mod(t):d;if(f=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new z(NaN);(n=!f&&p.isInteger()&&t.isInteger())&&(p=p.mod(t))}else{if(e.e>9&&(p.e>0||p.e<-1||(0==p.e?p.c[0]>1||l&&p.c[1]>=24e7:p.c[0]<8e13||l&&p.c[0]<=9999975e7)))return c=p.s<0&&y(e)?-0:0,p.e>-1&&(c=1/c),new z(f?1/c:c);F&&(c=i(F/u+2))}for(l?(r=new z(.5),f&&(e.s=1),h=y(e)):h=(s=Math.abs(+J(e)))%2,d=new z(C);;){if(h){if(!(d=d.times(p)).c)break;c?d.c.length>c&&(d.c.length=c):n&&(d=d.mod(t))}if(s){if(0===(s=o(s/2)))break;h=s%2}else if(G(e=e.times(r),e.e+1,1),e.e>14)h=y(e);else{if(0===(s=+J(e)))break;h=s%2}p=p.times(p),c?p.c&&p.c.length>c&&(p.c.length=c):n&&(p=p.mod(t))}return n?d:(f&&(d=C.div(d)),t?d.mod(t):c?G(d,F,R,undefined):d)},T.integerValue=function(e){var t=new z(this);return null==e?e=R:v(e,0,8),G(t,t.e+1,e)},T.isEqualTo=T.eq=function(e,t){return 0===g(this,new z(e,t))},T.isFinite=function(){return!!this.c},T.isGreaterThan=T.gt=function(e,t){return g(this,new z(e,t))>0},T.isGreaterThanOrEqualTo=T.gte=function(e,t){return 1===(t=g(this,new z(e,t)))||0===t},T.isInteger=function(){return!!this.c&&p(this.e/u)>this.c.length-2},T.isLessThan=T.lt=function(e,t){return g(this,new z(e,t))<0},T.isLessThanOrEqualTo=T.lte=function(e,t){return-1===(t=g(this,new z(e,t)))||0===t},T.isNaN=function(){return!this.s},T.isNegative=function(){return this.s<0},T.isPositive=function(){return this.s>0},T.isZero=function(){return!!this.c&&0==this.c[0]},T.minus=function(e,t){var r,n,i,o,a=this,s=a.s;if(t=(e=new z(e,t)).s,!s||!t)return new z(NaN);if(s!=t)return e.s=-t,a.plus(e);var l=a.e/u,f=e.e/u,h=a.c,d=e.c;if(!l||!f){if(!h||!d)return h?(e.s=-t,e):new z(d?a:NaN);if(!h[0]||!d[0])return d[0]?(e.s=-t,e):new z(h[0]?a:3==R?-0:0)}if(l=p(l),f=p(f),h=h.slice(),s=l-f){for((o=s<0)?(s=-s,i=h):(f=l,i=d),i.reverse(),t=s;t--;i.push(0));i.reverse()}else for(n=(o=(s=h.length)<(t=d.length))?s:t,s=t=0;t<n;t++)if(h[t]!=d[t]){o=h[t]<d[t];break}if(o&&(i=h,h=d,d=i,e.s=-e.s),(t=(n=d.length)-(r=h.length))>0)for(;t--;h[r++]=0);for(t=c-1;n>s;){if(h[--n]<d[n]){for(r=n;r&&!h[--r];h[r]=t);--h[r],h[n]+=c}h[n]-=d[n]}for(;0==h[0];h.splice(0,1),--f);return h[0]?$(e,h,f):(e.s=3==R?-1:1,e.c=[e.e=0],e)},T.modulo=T.mod=function(e,t){var n,i,o=this;return e=new z(e,t),!o.c||!e.s||e.c&&!e.c[0]?new z(NaN):!e.c||o.c&&!o.c[0]?new z(o):(9==U?(i=e.s,e.s=1,n=r(o,e,0,3),e.s=i,n.s*=i):n=r(o,e,0,U),(e=o.minus(n.times(e))).c[0]||1!=U||(e.s=o.s),e)},T.multipliedBy=T.times=function(e,t){var r,n,i,o,a,s,l,f,d,m,g,v,y,b,w,_=this,S=_.c,E=(e=new z(e,t)).c;if(!(S&&E&&S[0]&&E[0]))return!_.s||!e.s||S&&!S[0]&&!E||E&&!E[0]&&!S?e.c=e.e=e.s=null:(e.s*=_.s,S&&E?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=p(_.e/u)+p(e.e/u),e.s*=_.s,(l=S.length)<(m=E.length)&&(y=S,S=E,E=y,i=l,l=m,m=i),i=l+m,y=[];i--;y.push(0));for(b=c,w=h,i=m;--i>=0;){for(r=0,g=E[i]%w,v=E[i]/w|0,o=i+(a=l);o>i;)r=((f=g*(f=S[--a]%w)+(s=v*f+(d=S[a]/w|0)*g)%w*w+y[o]+r)/b|0)+(s/w|0)+v*d,y[o--]=f%b;y[o]=r}return r?++n:y.splice(0,1),$(e,y,n)},T.negated=function(){var e=new z(this);return e.s=-e.s||null,e},T.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new z(e,t)).s,!i||!t)return new z(NaN);if(i!=t)return e.s=-t,n.minus(e);var o=n.e/u,a=e.e/u,s=n.c,l=e.c;if(!o||!a){if(!s||!l)return new z(i/0);if(!s[0]||!l[0])return l[0]?e:new z(s[0]?n:0*i)}if(o=p(o),a=p(a),s=s.slice(),i=o-a){for(i>0?(a=o,r=l):(i=-i,r=s),r.reverse();i--;r.push(0));r.reverse()}for((i=s.length)-(t=l.length)<0&&(r=l,l=s,s=r,t=i),i=0;t;)i=(s[--t]=s[t]+l[t]+i)/c|0,s[t]=c===s[t]?0:s[t]%c;return i&&(s=[i].concat(s),++a),$(e,s,a)},T.precision=T.sd=function(e,t){var r,n,i,o=this;if(null!=e&&e!==!!e)return v(e,1,d),null==t?t=R:v(t,0,8),G(new z(o),e,t);if(!(r=o.c))return null;if(n=(i=r.length-1)*u+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return e&&o.e+1>n&&(n=o.e+1),n},T.shiftedBy=function(e){return v(e,-9007199254740991,l),this.times("1e"+e)},T.squareRoot=T.sqrt=function(){var e,t,n,i,o,a=this,s=a.c,c=a.s,u=a.e,l=N+4,f=new z("0.5");if(1!==c||!s||!s[0])return new z(!c||c<0&&(!s||s[0])?NaN:s?a:1/0);if(0==(c=Math.sqrt(+J(a)))||c==1/0?(((t=m(s)).length+u)%2==0&&(t+="0"),c=Math.sqrt(+t),u=p((u+1)/2)-(u<0||u%2),n=new z(t=c==1/0?"1e"+u:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+u)):n=new z(c+""),n.c[0])for((c=(u=n.e)+l)<3&&(c=0);;)if(o=n,n=f.times(o.plus(r(a,o,l,1))),m(o.c).slice(0,c)===(t=m(n.c)).slice(0,c)){if(n.e<u&&--c,"9999"!=(t=t.slice(c-3,c+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(G(n,n.e+N+2,1),e=!n.times(n).eq(a));break}if(!i&&(G(o,o.e+N+2,0),o.times(o).eq(a))){n=o;break}l+=4,c+=4,i=1}return G(n,n.e+N+1,R,e)},T.toExponential=function(e,t){return null!=e&&(v(e,0,d),e++),q(this,e,t,1)},T.toFixed=function(e,t){return null!=e&&(v(e,0,d),e=e+this.e+1),q(this,e,t)},T.toFormat=function(e,t,r){var n,i=this;if(null==r)null!=e&&t&&"object"==typeof t?(r=t,t=null):e&&"object"==typeof e?(r=e,e=t=null):r=H;else if("object"!=typeof r)throw Error(a+"Argument not an object: "+r);if(n=i.toFixed(e,t),i.c){var o,s=n.split("."),c=+r.groupSize,u=+r.secondaryGroupSize,l=r.groupSeparator||"",f=s[0],h=s[1],d=i.s<0,p=d?f.slice(1):f,m=p.length;if(u&&(o=c,c=u,u=o,m-=o),c>0&&m>0){for(o=m%c||c,f=p.substr(0,o);o<m;o+=c)f+=l+p.substr(o,c);u>0&&(f+=l+p.slice(o)),d&&(f="-"+f)}n=h?f+(r.decimalSeparator||"")+((u=+r.fractionGroupSize)?h.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):h):f}return(r.prefix||"")+n+(r.suffix||"")},T.toFraction=function(e){var t,n,i,o,s,c,l,h,d,p,g,v,y=this,b=y.c;if(null!=e&&(!(l=new z(e)).isInteger()&&(l.c||1!==l.s)||l.lt(C)))throw Error(a+"Argument "+(l.isInteger()?"out of range: ":"not an integer: ")+J(l));if(!b)return new z(y);for(t=new z(C),d=n=new z(C),i=h=new z(C),v=m(b),s=t.e=v.length-y.e-1,t.c[0]=f[(c=s%u)<0?u+c:c],e=!e||l.comparedTo(t)>0?s>0?t:d:l,c=D,D=1/0,l=new z(v),h.c[0]=0;p=r(l,t,0,1),1!=(o=n.plus(p.times(i))).comparedTo(e);)n=i,i=o,d=h.plus(p.times(o=d)),h=o,t=l.minus(p.times(o=t)),l=o;return o=r(e.minus(n),i,0,1),h=h.plus(o.times(d)),n=n.plus(o.times(i)),h.s=d.s=y.s,g=r(d,i,s*=2,R).minus(y).abs().comparedTo(r(h,n,s,R).minus(y).abs())<1?[d,i]:[h,n],D=c,g},T.toNumber=function(){return+J(this)},T.toPrecision=function(e,t){return null!=e&&v(e,1,d),q(this,e,t,2)},T.toString=function(e){var t,r=this,n=r.s,i=r.e;return null===i?n?(t="Infinity",n<0&&(t="-"+t)):t="NaN":(null==e?t=i<=M||i>=L?b(m(r.c),i):w(m(r.c),i,"0"):10===e?t=w(m((r=G(new z(r),N+i+1,R)).c),r.e,"0"):(v(e,2,V.length,"Base"),t=_(w(m(r.c),i,"0"),10,e,n,!0)),n<0&&r.c[0]&&(t="-"+t)),t},T.valueOf=T.toJSON=function(){return J(this)},T._isBigNumber=!0,null!=t&&z.set(t),z}()).default=r.BigNumber=r,e.exports?e.exports=r:(t||(t="undefined"!=typeof self&&self?self:window),t.BigNumber=r)}(Zt)})),Ka=tr((function(e,t){const r=qa.BigNumber;t.MT={POS_INT:0,NEG_INT:1,BYTE_STRING:2,UTF8_STRING:3,ARRAY:4,MAP:5,TAG:6,SIMPLE_FLOAT:7},t.TAG={DATE_STRING:0,DATE_EPOCH:1,POS_BIGINT:2,NEG_BIGINT:3,DECIMAL_FRAC:4,BIGFLOAT:5,BASE64URL_EXPECTED:21,BASE64_EXPECTED:22,BASE16_EXPECTED:23,CBOR:24,URI:32,BASE64URL:33,BASE64:34,REGEXP:35,MIME:36},t.NUMBYTES={ZERO:0,ONE:24,TWO:25,FOUR:26,EIGHT:27,INDEFINITE:31},t.SIMPLE={FALSE:20,TRUE:21,NULL:22,UNDEFINED:23},t.SYMS={NULL:Symbol("null"),UNDEFINED:Symbol("undef"),PARENT:Symbol("parent"),BREAK:Symbol("break"),STREAM:Symbol("stream")},t.SHIFT32=4294967296,t.BI={MINUS_ONE:-1,MAXINT32:4294967295,MAXINT64:"0xffffffffffffffff",SHIFT32:t.SHIFT32};const n=new r(-1);t.BN={MINUS_ONE:n,NEG_MAX:n.minus(new r(Number.MAX_SAFE_INTEGER.toString(16),16)),MAXINT:new r("0x20000000000000"),MAXINT32:new r(4294967295),MAXINT64:new r("0xffffffffffffffff"),SHIFT32:new r(t.SHIFT32)}})),$a=(Ka.MT,Ka.TAG,Ka.NUMBYTES,Ka.SIMPLE,Ka.SYMS,Ka.SHIFT32,Ka.BI,Ka.BN,tr((function(e,t){const r=qa.BigNumber,n=Ka.NUMBYTES,i=Ka.SHIFT32;t.hasBigInt="function"==typeof BigInt;const o="function"==typeof TextDecoder?TextDecoder:Yt.TextDecoder;if(o){const e=new o("utf8",{fatal:!0,ignoreBOM:!0});t.utf8=t=>e.decode(t),t.utf8.checksUTF8=!0}else t.utf8=e=>e.toString("utf8"),t.utf8.checksUTF8=!1;t.parseCBORint=function(e,t){switch(e){case n.ONE:return t.readUInt8(0);case n.TWO:return t.readUInt16BE(0);case n.FOUR:return t.readUInt32BE(0);case n.EIGHT:const o=t.readUInt32BE(0),a=t.readUInt32BE(4);return o>2097151?new r(o).times(i).plus(a):o*i+a;default:throw new Error("Invalid additional info for int: "+e)}},t.writeHalf=function(e,t){const r=re.allocUnsafe(4);r.writeFloatBE(t,0);const n=r.readUInt32BE(0);if(0!=(8191&n))return!1;let i=n>>16&32768;const o=n>>23&255,a=8388607&n;if(o>=113&&o<=142)i+=(o-112<<10)+(a>>13);else{if(!(o>=103&&o<113))return!1;if(a&(1<<126-o)-1)return!1;i+=a+8388608>>126-o}return e.writeUInt16BE(i),!0},t.parseHalf=function(e){const t=128&e[0]?-1:1,r=(124&e[0])>>2,n=(3&e[0])<<8|e[1];return r?31===r?t*(n?NaN:Infinity):t*Math.pow(2,r-25)*(1024+n):5.960464477539063e-8*t*n},t.parseCBORfloat=function(e){switch(e.length){case 2:return t.parseHalf(e);case 4:return e.readFloatBE(0);case 8:return e.readDoubleBE(0);default:throw new Error("Invalid float size: "+e.length)}},t.hex=function(e){return re.from(e.replace(/^0x/,""),"hex")},t.bin=function(e){let t=0,r=(e=e.replace(/\s/g,"")).length%8||8;const n=[];for(;r<=e.length;)n.push(parseInt(e.slice(t,r),2)),t=r,r+=8;return re.from(n)},t.extend=function(e={},...t){const r=t.length;for(let n=0;n<r;n++){const r=t[n];for(const t in r){const n=r[t];e[t]=n}}return e},t.arrayEqual=function(e,t){return null==e&&null==t||null!=e&&null!=t&&(e.length===t.length&&e.every((e,r)=>e===t[r]))},t.bufferEqual=function(e,t){if(null==e&&null==t)return!0;if(null==e||null==t)return!1;if(!Be(e)||!Be(t)||e.length!==t.length)return!1;const r=e.length;let n,i,o=!0;for(n=i=0;i<r;n=++i){const r=e[n];o=o&&t[n]===r}return!!o},t.bufferToBignumber=function(e){return new r(e.toString("hex"),16)},t.toBigInt=function(e){return t.hasBigInt?BigInt(e):Number(e)},t.bigIntize=function(e){const r={};for(const n in e)r[n]=t.toBigInt(e[n]);return r},t.bufferToBigInt=function(e){return t.toBigInt("0x"+e.toString("hex"))},t.guessEncoding=function(e){if("string"==typeof e)return"hex";if(!Be(e))throw new Error("Unknown input type")}})));$a.hasBigInt,$a.utf8,$a.parseCBORint,$a.writeHalf,$a.parseHalf,$a.parseCBORfloat,$a.hex,$a.bin,$a.extend,$a.arrayEqual,$a.bufferEqual,$a.bufferToBignumber,$a.toBigInt,$a.bigIntize,$a.bufferToBigInt,$a.guessEncoding;const Ga=Ka.MT,Ja=Ka.SIMPLE,Wa=Ka.SYMS;class Xa{constructor(e){if("number"!=typeof e)throw new Error("Invalid Simple type: "+typeof e);if(e<0||e>255||(0|e)!==e)throw new Error("value must be a small positive integer: "+e);this.value=e}toString(){return"simple("+this.value+")"}[Yt.inspect.custom](e,t){return"simple("+this.value+")"}inspect(e,t){return"simple("+this.value+")"}encodeCBOR(e){return e._pushInt(this.value,Ga.SIMPLE_FLOAT)}static isSimple(e){return e instanceof Xa}static decode(e,t=!0,r=!1){switch(e){case Ja.FALSE:return!1;case Ja.TRUE:return!0;case Ja.NULL:return t?null:Wa.NULL;case Ja.UNDEFINED:return t?void 0:Wa.UNDEFINED;case-1:if(!t||!r)throw new Error("Invalid BREAK");return Wa.BREAK;default:return new Xa(e)}}}var Qa=Xa;class Ya extends zn.Transform{constructor(e,t,r){let n,i;switch(null==r&&(r={}),typeof e){case"object":Be(e)?(n=e,null!=t&&"object"==typeof t&&(r=t)):r=e;break;case"string":n=e,null!=t&&"object"==typeof t?r=t:i=t}null==r&&(r={}),null==n&&(n=r.input),null==i&&(i=r.inputEncoding),delete r.input,delete r.inputEncoding;const o=null==r.watchPipe||r.watchPipe;delete r.watchPipe;const a=!!r.readError;delete r.readError,super(r),this.readError=a,o&&this.on("pipe",e=>{const t=e._readableState.objectMode;if(this.length>0&&t!==this._readableState.objectMode)throw new Error("Do not switch objectMode in the middle of the stream");return this._readableState.objectMode=t,this._writableState.objectMode=t}),null!=n&&this.end(n,i)}static isNoFilter(e){return e instanceof this}static compare(e,t){if(!(e instanceof this))throw new TypeError("Arguments must be NoFilters");return e===t?0:e.compare(t)}static concat(e,t){if(!Array.isArray(e))throw new TypeError("list argument must be an Array of NoFilters");if(0===e.length||0===t)return re.alloc(0);null==t&&(t=e.reduce((e,t)=>{if(!(t instanceof Ya))throw new TypeError("list argument must be an Array of NoFilters");return e+t.length},0));let r=!0,n=!0;const i=e.map(e=>{if(!(e instanceof Ya))throw new TypeError("list argument must be an Array of NoFilters");const t=e.slice();return Be(t)?n=!1:r=!1,t});if(r)return re.concat(i,t);if(n)return[].concat(...i).slice(0,t);throw new Error("Concatenating mixed object and byte streams not supported")}_transform(e,t,r){this._readableState.objectMode||Be(e)||(e=re.from(e,t)),this.push(e),r()}_bufArray(){let e=this._readableState.buffer;if(!Array.isArray(e)){let t=e.head;for(e=[];null!=t;)e.push(t.data),t=t.next}return e}read(e){const t=super.read(e);if(null!=t){if(this.emit("read",t),this.readError&&t.length<e)throw new Error(`Read ${t.length}, wanted ${e}`)}else if(this.readError)throw new Error("No data available, wanted "+e);return t}promise(e){let t=!1;return new Promise((r,n)=>{this.on("finish",()=>{const n=this.read();null==e||t||(t=!0,e(null,n)),r(n)}),this.on("error",r=>{null==e||t||(t=!0,e(r)),n(r)})})}compare(e){if(!(e instanceof Ya))throw new TypeError("Arguments must be NoFilters");if(this===e)return 0;{const t=this.slice(),r=e.slice();if(Be(t)&&Be(r))return t.compare(r);throw new Error("Cannot compare streams in object mode")}}equals(e){return 0===this.compare(e)}slice(e,t){if(this._readableState.objectMode)return this._bufArray().slice(e,t);const r=this._bufArray();switch(r.length){case 0:return re.alloc(0);case 1:return r[0].slice(e,t);default:return re.concat(r).slice(e,t)}}get(e){return this.slice()[e]}toJSON(){const e=this.slice();return Be(e)?e.toJSON():e}toString(e,t,r){const n=this.slice(t,r);if(!Be(n))return JSON.stringify(n);if((!e||"utf8"===e)&&Yt.TextDecoder){return new Yt.TextDecoder("utf8",{fatal:!0,ignoreBOM:!0}).decode(n)}return n.toString(e,t,r)}inspect(e,t){return this[Yt.inspect.custom](e,t)}[Yt.inspect.custom](e,t){const r=this._bufArray().map(e=>Be(e)?(null!=t?t.stylize:void 0)?t.stylize(e.toString("hex"),"string"):e.toString("hex"):Yt.inspect(e,t)).join(", ");return`${this.constructor.name} [${r}]`}get length(){return this._readableState.length}writeBigInt(e){let t=e.toString(16);if(e<0){const r=BigInt(Math.floor(t.length/2));t=(e=(BigInt(1)<<r*BigInt(8))+e).toString(16)}return t.length%2&&(t="0"+t),this.push(re.from(t,"hex"))}readUBigInt(e){const t=this.read(e);return Be(t)?BigInt("0x"+t.toString("hex")):null}readBigInt(e){const t=this.read(e);if(!Be(t))return null;let r=BigInt("0x"+t.toString("hex"));if(128&t[0]){r-=BigInt(1)<<BigInt(t.length)*BigInt(8)}return r}}function Za(e,t){return function(r){const n=this.read(t);return Be(n)?n[e].call(n,0,!0):null}}function es(e,t){return function(r){const n=re.alloc(t);return n[e].call(n,r,0,!0),this.push(n)}}Object.assign(Ya.prototype,{writeUInt8:es("writeUInt8",1),writeUInt16LE:es("writeUInt16LE",2),writeUInt16BE:es("writeUInt16BE",2),writeUInt32LE:es("writeUInt32LE",4),writeUInt32BE:es("writeUInt32BE",4),writeInt8:es("writeInt8",1),writeInt16LE:es("writeInt16LE",2),writeInt16BE:es("writeInt16BE",2),writeInt32LE:es("writeInt32LE",4),writeInt32BE:es("writeInt32BE",4),writeFloatLE:es("writeFloatLE",4),writeFloatBE:es("writeFloatBE",4),writeDoubleLE:es("writeDoubleLE",8),writeDoubleBE:es("writeDoubleBE",8),readUInt8:Za("readUInt8",1),readUInt16LE:Za("readUInt16LE",2),readUInt16BE:Za("readUInt16BE",2),readUInt32LE:Za("readUInt32LE",4),readUInt32BE:Za("readUInt32BE",4),readInt8:Za("readInt8",1),readInt16LE:Za("readInt16LE",2),readInt16BE:Za("readInt16BE",2),readInt32LE:Za("readInt32LE",4),readInt32BE:Za("readInt32BE",4),readFloatLE:Za("readFloatLE",4),readFloatBE:Za("readFloatBE",4),readDoubleLE:Za("readDoubleLE",8),readDoubleBE:Za("readDoubleBE",8)});var ts=Ya;const rs=zn.Transform;var ns=class extends rs{constructor(e){super(e),this._writableState.objectMode=!1,this._readableState.objectMode=!0,this.bs=new ts,this.__restart()}_transform(e,t,r){for(this.bs.write(e);this.bs.length>=this.__needed;){let e;const t=null===this.__needed?void 0:this.bs.read(this.__needed);try{e=this.__parser.next(t)}catch(e){return r(e)}this.__needed&&(this.__fresh=!1),e.done?(this.push(e.value),this.__restart()):this.__needed=e.value||0}return r()}*_parse(){throw new Error("Must be implemented in subclass")}__restart(){this.__needed=null,this.__parser=this._parse(),this.__fresh=!0}_flush(e){e(this.__fresh?null:new Error("unexpected end of input"))}};const is=qa.BigNumber,os=new is(-1),as=new is(10),ss=new is(2);class cs{constructor(e,t,r){if(this.tag=e,this.value=t,this.err=r,"number"!=typeof this.tag)throw new Error("Invalid tag type ("+typeof this.tag+")");if(this.tag<0||(0|this.tag)!==this.tag)throw new Error("Tag must be a positive integer: "+this.tag)}toString(){return`${this.tag}(${JSON.stringify(this.value)})`}encodeCBOR(e){return e._pushTag(this.tag),e.pushAny(this.value)}convert(e){let t=null!=e?e[this.tag]:void 0;if("function"!=typeof t&&(t=cs["_tag_"+this.tag],"function"!=typeof t))return this;try{return t.call(cs,this.value)}catch(e){return this.err=e,this}}static _tag_0(e){return new Date(e)}static _tag_1(e){return new Date(1e3*e)}static _tag_2(e){return $a.bufferToBignumber(e)}static _tag_3(e){return os.minus($a.bufferToBignumber(e))}static _tag_4(e){return as.pow(e[0]).times(e[1])}static _tag_5(e){return ss.pow(e[0]).times(e[1])}static _tag_32(e){return lr.parse(e)}static _tag_35(e){return new RegExp(e)}}var us=cs;const ls=qa.BigNumber,fs=Ka.MT,hs=Ka.NUMBYTES,ds=(Ka.SIMPLE,Ka.SYMS),ps=$a.bigIntize(Ka.BI),ms=Ka.BN,gs=Symbol("count"),vs=Symbol("major type"),ys=Symbol("error"),bs=Symbol("not found");function ws(e,t,r){const n=[];return n[gs]=r,n[ds.PARENT]=e,n[vs]=t,n}function _s(e,t){const r=new ts;return r[gs]=-1,r[ds.PARENT]=e,r[vs]=t,r}function Ss(e){return $a.bufferToBigInt(e)}function Es(e){return ps.MINUS_ONE-$a.bufferToBigInt(e)}class xs extends ns{constructor(e){const t=(e=e||{}).tags;delete e.tags;const r=null!=e.max_depth?e.max_depth:-1;delete e.max_depth;const n=!!$a.hasBigInt&&!!e.bigint;delete e.bigint,super(e),this.running=!0,this.max_depth=r,this.tags=t,n&&(null==this.tags&&(this.tags={}),null==this.tags[2]&&(this.tags[2]=Ss),null==this.tags[3]&&(this.tags[3]=Es))}static nullcheck(e){switch(e){case ds.NULL:return null;case ds.UNDEFINED:return;case bs:throw new Error("Value not found");default:return e}}static decodeFirstSync(e,t){let r,n={};switch(typeof(t=t||{encoding:"hex"})){case"string":r=t;break;case"object":n=$a.extend({},t),r=n.encoding,delete n.encoding}const i=new xs(n),o=e instanceof zn.Readable?e:new ts(e,null!=r?r:$a.guessEncoding(e)),a=i._parse();let s=a.next();for(;!s.done;){const e=o.read(s.value);if(null==e||e.length!==s.value)throw new Error("Insufficient data");s=a.next(e)}const c=xs.nullcheck(s.value);if(o.length>0){const e=o.read(1);o.unshift(e);const t=new Error("Unexpected data: 0x"+e[0].toString(16));throw t.value=c,t}return c}static decodeAllSync(e,t){let r,n={};switch(typeof(t=t||{encoding:"hex"})){case"string":r=t;break;case"object":n=$a.extend({},t),r=n.encoding,delete n.encoding}const i=new xs(n),o=e instanceof zn.Readable?e:new ts(e,null!=r?r:$a.guessEncoding(e)),a=[];for(;o.length>0;){const e=i._parse();let t=e.next();for(;!t.done;){const r=o.read(t.value);if(null==r||r.length!==t.value)throw new Error("Insufficient data");t=e.next(r)}a.push(xs.nullcheck(t.value))}return a}static decodeFirst(e,t,r){let n={},i=!1,o="hex";switch(typeof t){case"function":r=t,o=$a.guessEncoding(e);break;case"string":o=t;break;case"object":n=$a.extend({},t),o=null!=n.encoding?n.encoding:$a.guessEncoding(e),delete n.encoding,i=null!=n.required&&n.required,delete n.required}const a=new xs(n);let s=bs;const c=new Promise((e,t)=>{a.on("data",e=>{s=xs.nullcheck(e),a.close()}),a.once("error",e=>(s!==bs&&(e.value=s),s=ys,a.close(),t(e))),a.once("end",()=>{switch(s){case bs:return i?t(new Error("No CBOR found")):e(s);case ys:return;default:return e(s)}})});return"function"==typeof r&&c.then(e=>r(null,e),r),a.end(e,o),c}static decodeAll(e,t,r){let n={},i="hex";switch(typeof t){case"function":r=t,i=$a.guessEncoding(e);break;case"string":i=t;break;case"object":n=$a.extend({},t),i=null!=n.encoding?n.encoding:$a.guessEncoding(e),delete n.encoding}const o=new xs(n),a=[];o.on("data",e=>a.push(xs.nullcheck(e)));const s=new Promise((e,t)=>{o.on("error",t),o.on("end",()=>e(a))});return"function"==typeof r&&s.then(e=>r(null,e),r),o.end(e,i),s}close(){this.running=!1,this.__fresh=!0}*_parse(){let e=null,t=0,r=null;for(;;){if(this.max_depth>=0&&t>this.max_depth)throw new Error("Maximum depth "+this.max_depth+" exceeded");const n=(yield 1)[0];if(!this.running)throw new Error("Unexpected data: 0x"+n.toString(16));const i=n>>5,o=31&n,a=null!=e?e[vs]:void 0,s=null!=e?e.length:void 0;switch(o){case hs.ONE:this.emit("more-bytes",i,1,a,s),r=(yield 1)[0];break;case hs.TWO:case hs.FOUR:case hs.EIGHT:const e=1<<o-24;this.emit("more-bytes",i,e,a,s);const t=yield e;r=i===fs.SIMPLE_FLOAT?t:$a.parseCBORint(o,t);break;case 28:case 29:case 30:throw this.running=!1,new Error("Additional info not implemented: "+o);case hs.INDEFINITE:switch(i){case fs.POS_INT:case fs.NEG_INT:case fs.TAG:throw new Error("Invalid indefinite encoding for MT "+i)}r=-1;break;default:r=o}switch(i){case fs.POS_INT:break;case fs.NEG_INT:r=r===Number.MAX_SAFE_INTEGER?ms.NEG_MAX:r instanceof ls?ms.MINUS_ONE.minus(r):-1-r;break;case fs.BYTE_STRING:case fs.UTF8_STRING:switch(r){case 0:this.emit("start-string",i,r,a,s),r=i===fs.BYTE_STRING?re.allocUnsafe(0):"";break;case-1:this.emit("start",i,ds.STREAM,a,s),e=_s(e,i),t++;continue;default:this.emit("start-string",i,r,a,s),r=yield r,i===fs.UTF8_STRING&&(r=$a.utf8(r))}break;case fs.ARRAY:case fs.MAP:switch(r){case 0:r=i===fs.MAP?{}:[];break;case-1:this.emit("start",i,ds.STREAM,a,s),e=ws(e,i,-1),t++;continue;default:this.emit("start",i,r,a,s),e=ws(e,i,r*(i-3)),t++;continue}break;case fs.TAG:this.emit("start",i,r,a,s),e=ws(e,i,1),e.push(r),t++;continue;case fs.SIMPLE_FLOAT:if("number"==typeof r){if(o===hs.ONE&&r<32)throw new Error("Invalid two-byte encoding of simple value "+r);const t=null!=e;r=Qa.decode(r,t,t&&e[gs]<0)}else r=$a.parseCBORfloat(r)}this.emit("value",r,a,s,o);let c=!1;for(;null!=e;){switch(!1){case r!==ds.BREAK:e[gs]=1;break;case!Array.isArray(e):e.push(r);break;case!(e instanceof ts):const t=e[vs];if(null!=t&&t!==i)throw this.running=!1,new Error("Invalid major type in indefinite encoding");e.write(r)}if(0!=--e[gs]){c=!0;break}if(--t,delete e[gs],this.emit("stop",e[vs]),Array.isArray(e))switch(e[vs]){case fs.ARRAY:r=e;break;case fs.MAP:let t=!0;if(e.length%2!=0)throw new Error("Invalid map length: "+e.length);for(let r=0,n=e.length;r<n;r+=2)if("string"!=typeof e[r]){t=!1;break}if(t){r={};for(let t=0,n=e.length;t<n;t+=2)r[e[t]]=e[t+1]}else{r=new Map;for(let t=0,n=e.length;t<n;t+=2)r.set(e[t],e[t+1])}break;case fs.TAG:r=new us(e[0],e[1]).convert(this.tags)}else if(e instanceof ts)switch(e[vs]){case fs.BYTE_STRING:r=e.slice();break;case fs.UTF8_STRING:r=e.toString("utf-8")}const n=e;e=e[ds.PARENT],delete n[ds.PARENT],delete n[vs]}if(!c)return r}}}xs.NOT_FOUND=bs;var Is=xs;const ks=qa.BigNumber,Ps=Ka.MT,Os=Ka.NUMBYTES,As=Ka.SYMS;function Ts(e){return e>1?"s":""}class Cs extends zn.Transform{constructor(e){const t=Object.assign({max_depth:10},e,{readableObjectMode:!1,writableObjectMode:!1}),r=t.max_depth;delete t.max_depth,super(t),this.depth=1,this.max_depth=r,this.all=new ts,this.parser=new Is(t),this.parser.on("value",this._on_value.bind(this)),this.parser.on("start",this._on_start.bind(this)),this.parser.on("start-string",this._on_start_string.bind(this)),this.parser.on("stop",this._on_stop.bind(this)),this.parser.on("more-bytes",this._on_more.bind(this)),this.parser.on("error",this._on_error.bind(this)),this.parser.on("data",this._on_data.bind(this)),this.parser.bs.on("read",this._on_read.bind(this))}_transform(e,t,r){this.parser.write(e,t,r)}_flush(e){return this.parser._flush(e)}static comment(e,t,r){if(null==e)throw new Error("input required");let n="string"==typeof e?"hex":void 0,i=10;switch(typeof t){case"function":r=t;break;case"string":n=t;break;case"number":i=t;break;case"object":const e=t.encoding,o=t.max_depth;n=null!=e?e:n,i=null!=o?o:i;break;case"undefined":break;default:throw new Error("Unknown option type")}const o=new ts,a=new Cs({max_depth:i});let s=null;return"function"==typeof r?(a.on("end",()=>{r(null,o.toString("utf8"))}),a.on("error",r)):s=new Promise((e,t)=>(a.on("end",()=>{e(o.toString("utf8"))}),a.on("error",t))),a.pipe(o),a.end(e,n),s}_on_error(e){return this.push("ERROR: ")&&this.push(e.toString())&&this.push("\n")}_on_read(e){this.all.write(e);const t=e.toString("hex");this.push(new Array(this.depth+1).join(" ")),this.push(t);let r=2*(this.max_depth-this.depth);return r-=t.length,r<1&&(r=1),this.push(new Array(r+1).join(" ")),this.push("-- ")}_on_more(e,t,r,n){this.depth++;let i="";switch(e){case Ps.POS_INT:i="Positive number,";break;case Ps.NEG_INT:i="Negative number,";break;case Ps.ARRAY:i="Array, length";break;case Ps.MAP:i="Map, count";break;case Ps.BYTE_STRING:i="Bytes, length";break;case Ps.UTF8_STRING:i="String, length";break;case Ps.SIMPLE_FLOAT:i=1===t?"Simple value,":"Float,"}return this.push(i+" next "+t+" byte"+Ts(t)+"\n")}_on_start_string(e,t,r,n){this.depth++;let i="";switch(e){case Ps.BYTE_STRING:i="Bytes, length: "+t;break;case Ps.UTF8_STRING:i="String, length: "+t.toString()}return this.push(i+"\n")}_on_start(e,t,r,n){if(this.depth++,t!==As.BREAK)switch(r){case Ps.ARRAY:this.push(`[${n}], `);break;case Ps.MAP:n%2?this.push(`{Val:${Math.floor(n/2)}}, `):this.push(`{Key:${Math.floor(n/2)}}, `)}switch(e){case Ps.TAG:this.push("Tag #"+t);break;case Ps.ARRAY:t===As.STREAM?this.push("Array (streaming)"):this.push(`Array, ${t} item${Ts(t)}`);break;case Ps.MAP:t===As.STREAM?this.push("Map (streaming)"):this.push(`Map, ${t} pair${Ts(t)}`);break;case Ps.BYTE_STRING:this.push("Bytes (streaming)");break;case Ps.UTF8_STRING:this.push("String (streaming)")}return this.push("\n")}_on_stop(e){return this.depth--}_on_value(e,t,r,n){if(e!==As.BREAK)switch(t){case Ps.ARRAY:this.push(`[${r}], `);break;case Ps.MAP:r%2?this.push(`{Val:${Math.floor(r/2)}}, `):this.push(`{Key:${Math.floor(r/2)}}, `)}switch(e===As.BREAK?this.push("BREAK\n"):e===As.NULL?this.push("null\n"):e===As.UNDEFINED?this.push("undefined\n"):"string"==typeof e?(this.depth--,e.length>0&&(this.push(JSON.stringify(e)),this.push("\n"))):Be(e)?(this.depth--,e.length>0&&(this.push(e.toString("hex")),this.push("\n"))):e instanceof ks?(this.push(e.toString()),this.push("\n")):(this.push(Yt.inspect(e)),this.push("\n")),n){case Os.ONE:case Os.TWO:case Os.FOUR:case Os.EIGHT:this.depth--}}_on_data(){return this.push("0x"),this.push(this.all.read().toString("hex")),this.push("\n")}}var Ns=Cs;const Rs=qa.BigNumber,Ms=Ka.MT,Ls=Ka.SYMS;class js extends zn.Transform{constructor(e){const t=Object.assign({separator:"\n",stream_errors:!1},e,{readableObjectMode:!1,writableObjectMode:!1}),r=t.separator;delete t.separator;const n=t.stream_errors;delete t.stream_errors,super(t),this.float_bytes=-1,this.separator=r,this.stream_errors=n,this.parser=new Is(t),this.parser.on("more-bytes",this._on_more.bind(this)),this.parser.on("value",this._on_value.bind(this)),this.parser.on("start",this._on_start.bind(this)),this.parser.on("stop",this._on_stop.bind(this)),this.parser.on("data",this._on_data.bind(this)),this.parser.on("error",this._on_error.bind(this))}_transform(e,t,r){return this.parser.write(e,t,r)}_flush(e){return this.parser._flush(t=>this.stream_errors?(t&&this._on_error(t),e()):e(t))}static diagnose(e,t,r){if(null==e)throw new Error("input required");let n={},i="hex";switch(typeof t){case"function":r=t,i=$a.guessEncoding(e);break;case"object":n=$a.extend({},t),i=null!=n.encoding?n.encoding:$a.guessEncoding(e),delete n.encoding;break;default:i=null!=t?t:"hex"}const o=new ts,a=new js(n);let s=null;return"function"==typeof r?(a.on("end",()=>r(null,o.toString("utf8"))),a.on("error",r)):s=new Promise((e,t)=>(a.on("end",()=>e(o.toString("utf8"))),a.on("error",t))),a.pipe(o),a.end(e,i),s}_on_error(e){return this.stream_errors?this.push(e.toString()):this.emit("error",e)}_on_more(e,t,r,n){if(e===Ms.SIMPLE_FLOAT)return this.float_bytes={2:1,4:2,8:3}[t]}_fore(e,t){switch(e){case Ms.BYTE_STRING:case Ms.UTF8_STRING:case Ms.ARRAY:if(t>0)return this.push(", ");break;case Ms.MAP:if(t>0)return t%2?this.push(": "):this.push(", ")}}_on_value(e,t,r){if(e!==Ls.BREAK)return this._fore(t,r),this.push((()=>{switch(!1){case e!==Ls.NULL:return"null";case e!==Ls.UNDEFINED:return"undefined";case"string"!=typeof e:return JSON.stringify(e);case!(this.float_bytes>0):const t=this.float_bytes;return this.float_bytes=-1,Yt.inspect(e)+"_"+t;case!Be(e):return"h'"+e.toString("hex")+"'";case!(e instanceof Rs):return e.toString();default:return Yt.inspect(e)}})())}_on_start(e,t,r,n){switch(this._fore(r,n),e){case Ms.TAG:this.push(t+"(");break;case Ms.ARRAY:this.push("[");break;case Ms.MAP:this.push("{");break;case Ms.BYTE_STRING:case Ms.UTF8_STRING:this.push("(")}if(t===Ls.STREAM)return this.push("_ ")}_on_stop(e){switch(e){case Ms.TAG:return this.push(")");case Ms.ARRAY:return this.push("]");case Ms.MAP:return this.push("}");case Ms.BYTE_STRING:case Ms.UTF8_STRING:return this.push(")")}}_on_data(){return this.push(this.separator)}}var Ds=js;const Bs=qa.BigNumber,Us=Ka.MT,Fs=Ka.NUMBYTES,Hs=Ka.SHIFT32,Vs=Ka.SYMS,zs=Ka.TAG,qs=Ka.MT.SIMPLE_FLOAT<<5|Ka.NUMBYTES.TWO,Ks=Ka.MT.SIMPLE_FLOAT<<5|Ka.NUMBYTES.FOUR,$s=Ka.MT.SIMPLE_FLOAT<<5|Ka.NUMBYTES.EIGHT,Gs=Ka.MT.SIMPLE_FLOAT<<5|Ka.SIMPLE.TRUE,Js=Ka.MT.SIMPLE_FLOAT<<5|Ka.SIMPLE.FALSE,Ws=Ka.MT.SIMPLE_FLOAT<<5|Ka.SIMPLE.UNDEFINED,Xs=Ka.MT.SIMPLE_FLOAT<<5|Ka.SIMPLE.NULL,Qs=$a.bigIntize(Ka.BI),Ys=Ka.BN,Zs=re.from("f97e00","hex"),ec=re.from("f9fc00","hex"),tc=re.from("f97c00","hex"),rc=re.from("f98000","hex"),nc=Symbol("CBOR_LOOP_DETECT");class ic extends zn.Transform{constructor(e){const t=Object.assign({},e,{readableObjectMode:!1,writableObjectMode:!0});super(t),this.canonical=t.canonical,this.encodeUndefined=t.encodeUndefined,this.disallowUndefinedKeys=!!t.disallowUndefinedKeys,this.dateType=null!=t.dateType?t.dateType.toLowerCase():"number",this.collapseBigIntegers=!!t.collapseBigIntegers,"symbol"==typeof t.detectLoops?this.detectLoops=t.detectLoops:this.detectLoops=t.detectLoops?Symbol("CBOR_DETECT"):null,this.semanticTypes=[Array,this._pushArray,Date,this._pushDate,re,this._pushBuffer,Map,this._pushMap,ts,this._pushNoFilter,RegExp,this._pushRegexp,Set,this._pushSet,Bs,this._pushBigNumber,ArrayBuffer,this._pushUint8Array,Uint8ClampedArray,this._pushUint8Array,Uint8Array,this._pushUint8Array,Uint16Array,this._pushArray,Uint32Array,this._pushArray,Int8Array,this._pushArray,Int16Array,this._pushArray,Int32Array,this._pushArray,Float32Array,this._pushFloat32Array,Float64Array,this._pushFloat64Array],lr.Url&&this.semanticTypes.push(lr.Url,this._pushUrl),lr.URL&&this.semanticTypes.push(lr.URL,this._pushURL);const r=t.genTypes||[];for(let e=0,t=r.length;e<t;e+=2)this.addSemanticType(r[e],r[e+1])}_transform(e,t,r){return r(!1===this.pushAny(e)?new Error("Push Error"):void 0)}_flush(e){return e()}addSemanticType(e,t){for(let r=0,n=this.semanticTypes.length;r<n;r+=2){if(this.semanticTypes[r]===e){const e=this.semanticTypes[r+1];return this.semanticTypes[r+1]=t,e}}return this.semanticTypes.push(e,t),null}_pushUInt8(e){const t=re.allocUnsafe(1);return t.writeUInt8(e,0),this.push(t)}_pushUInt16BE(e){const t=re.allocUnsafe(2);return t.writeUInt16BE(e,0),this.push(t)}_pushUInt32BE(e){const t=re.allocUnsafe(4);return t.writeUInt32BE(e,0),this.push(t)}_pushFloatBE(e){const t=re.allocUnsafe(4);return t.writeFloatBE(e,0),this.push(t)}_pushDoubleBE(e){const t=re.allocUnsafe(8);return t.writeDoubleBE(e,0),this.push(t)}_pushNaN(){return this.push(Zs)}_pushInfinity(e){const t=e<0?ec:tc;return this.push(t)}_pushFloat(e){if(this.canonical){const t=re.allocUnsafe(2);if($a.writeHalf(t,e)&&$a.parseHalf(t)===e)return this._pushUInt8(qs)&&this.push(t)}return Math.fround(e)===e?this._pushUInt8(Ks)&&this._pushFloatBE(e):this._pushUInt8($s)&&this._pushDoubleBE(e)}_pushInt(e,t,r){const n=t<<5;switch(!1){case!(e<24):return this._pushUInt8(n|e);case!(e<=255):return this._pushUInt8(n|Fs.ONE)&&this._pushUInt8(e);case!(e<=65535):return this._pushUInt8(n|Fs.TWO)&&this._pushUInt16BE(e);case!(e<=4294967295):return this._pushUInt8(n|Fs.FOUR)&&this._pushUInt32BE(e);case!(e<=Number.MAX_SAFE_INTEGER):return this._pushUInt8(n|Fs.EIGHT)&&this._pushUInt32BE(Math.floor(e/Hs))&&this._pushUInt32BE(e%Hs);default:return t===Us.NEG_INT?this._pushFloat(r):this._pushFloat(e)}}_pushIntNum(e){return Object.is(e,-0)?this.push(rc):e<0?this._pushInt(-e-1,Us.NEG_INT,e):this._pushInt(e,Us.POS_INT)}_pushNumber(e){switch(!1){case!isNaN(e):return this._pushNaN();case isFinite(e):return this._pushInfinity(e);case Math.round(e)!==e:return this._pushIntNum(e);default:return this._pushFloat(e)}}_pushString(e){const t=re.byteLength(e,"utf8");return this._pushInt(t,Us.UTF8_STRING)&&this.push(e,"utf8")}_pushBoolean(e){return this._pushUInt8(e?Gs:Js)}_pushUndefined(e){switch(typeof this.encodeUndefined){case"undefined":return this._pushUInt8(Ws);case"function":return this.pushAny(this.encodeUndefined.call(this,e));case"object":if(Be(this.encodeUndefined))return this.push(this.encodeUndefined)}return this.pushAny(this.encodeUndefined)}_pushNull(e){return this._pushUInt8(Xs)}_pushArray(e,t){const r=t.length;if(!e._pushInt(r,Us.ARRAY))return!1;for(let n=0;n<r;n++)if(!e.pushAny(t[n]))return!1;return!0}_pushTag(e){return this._pushInt(e,Us.TAG)}_pushDate(e,t){switch(e.dateType){case"string":return e._pushTag(zs.DATE_STRING)&&e._pushString(t.toISOString());case"int":case"integer":return e._pushTag(zs.DATE_EPOCH)&&e._pushIntNum(Math.round(t/1e3));case"float":return e._pushTag(zs.DATE_EPOCH)&&e._pushFloat(t/1e3);case"number":default:return e._pushTag(zs.DATE_EPOCH)&&e.pushAny(t/1e3)}}_pushBuffer(e,t){return e._pushInt(t.length,Us.BYTE_STRING)&&e.push(t)}_pushNoFilter(e,t){return e._pushBuffer(e,t.slice())}_pushRegexp(e,t){return e._pushTag(zs.REGEXP)&&e.pushAny(t.source)}_pushSet(e,t){if(!e._pushInt(t.size,Us.ARRAY))return!1;for(const r of t)if(!e.pushAny(r))return!1;return!0}_pushUrl(e,t){return e._pushTag(zs.URI)&&e.pushAny(t.format())}_pushURL(e,t){return e._pushTag(zs.URI)&&e.pushAny(t.toString())}_pushBigint(e){let t=Us.POS_INT,r=zs.POS_BIGINT;if(e.isNegative()&&(e=e.negated().minus(1),t=Us.NEG_INT,r=zs.NEG_BIGINT),this.collapseBigIntegers&&e.lte(Ys.MAXINT64))return e.lte(Ys.MAXINT32)?this._pushInt(e.toNumber(),t):this._pushUInt8(t<<5|Fs.EIGHT)&&this._pushUInt32BE(e.dividedToIntegerBy(Ys.SHIFT32).toNumber())&&this._pushUInt32BE(e.mod(Ys.SHIFT32).toNumber());let n=e.toString(16);n.length%2&&(n="0"+n);const i=re.from(n,"hex");return this._pushTag(r)&&this._pushBuffer(this,i)}_pushJSBigint(e){let t=Us.POS_INT,r=zs.POS_BIGINT;if(e<0&&(e=-e+Qs.MINUS_ONE,t=Us.NEG_INT,r=zs.NEG_BIGINT),this.collapseBigIntegers&&e<=Qs.MAXINT64)return e<=4294967295?this._pushInt(Number(e),t):this._pushUInt8(t<<5|Fs.EIGHT)&&this._pushUInt32BE(Number(e/Qs.SHIFT32))&&this._pushUInt32BE(Number(e%Qs.SHIFT32));let n=e.toString(16);n.length%2&&(n="0"+n);const i=re.from(n,"hex");return this._pushTag(r)&&this._pushBuffer(this,i)}_pushBigNumber(e,t){if(t.isNaN())return e._pushNaN();if(!t.isFinite())return e._pushInfinity(t.isNegative()?-1/0:1/0);if(t.isInteger())return e._pushBigint(t);if(!e._pushTag(zs.DECIMAL_FRAC)||!e._pushInt(2,Us.ARRAY))return!1;const r=t.decimalPlaces(),n=t.times(new Bs(10).pow(r));return!!e._pushIntNum(-r)&&(n.abs().isLessThan(Ys.MAXINT)?e._pushIntNum(n.toNumber()):e._pushBigint(n))}_pushMap(e,t){if(!e._pushInt(t.size,Us.MAP))return!1;if(e.canonical){const r=[...t.entries()],n=new ic(this),i=new ts({highWaterMark:this.readableHighWaterMark});n.pipe(i),r.sort(([e],[t])=>{n.pushAny(e);const r=i.read();n.pushAny(t);const o=i.read();return r.compare(o)});for(const[t,n]of r){if(e.disallowUndefinedKeys&&void 0===t)throw new Error("Invalid Map key: undefined");if(!e.pushAny(t)||!e.pushAny(n))return!1}}else for(const[r,n]of t){if(e.disallowUndefinedKeys&&void 0===r)throw new Error("Invalid Map key: undefined");if(!e.pushAny(r)||!e.pushAny(n))return!1}return!0}_pushUint8Array(e,t){return e._pushBuffer(e,re.from(t))}_pushFloat32Array(e,t){const r=t.length;if(!e._pushInt(r,Us.ARRAY))return!1;for(let n=0;n<r;n++)if(!e._pushUInt8(Ks)||!e._pushFloatBE(t[n]))return!1;return!0}_pushFloat64Array(e,t){const r=t.length;if(!e._pushInt(r,Us.ARRAY))return!1;for(let n=0;n<r;n++)if(!e._pushUInt8($s)||!e._pushDoubleBE(t[n]))return!1;return!0}removeLoopDetectors(e){if(!this.detectLoops||"object"!=typeof e||!e)return!1;const t=e[nc];if(!t||t!==this.detectLoops)return!1;if(delete e[nc],Array.isArray(e))for(const t of e)this.removeLoopDetectors(t);else for(const t in e)this.removeLoopDetectors(e[t]);return!0}_pushObject(e){if(!e)return this._pushNull(e);if(this.detectLoops){if(e[nc]===this.detectLoops)throw new Error("Loop detected while CBOR encoding");e[nc]=this.detectLoops}const t=e.encodeCBOR;if("function"==typeof t)return t.call(e,this);for(let t=0,r=this.semanticTypes.length;t<r;t+=2){if(e instanceof this.semanticTypes[t])return this.semanticTypes[t+1].call(e,this,e)}const r=Object.keys(e),n={};if(this.canonical&&r.sort((e,t)=>{const r=n[e]||(n[e]=ic.encode(e)),i=n[t]||(n[t]=ic.encode(t));return r.compare(i)}),!this._pushInt(r.length,Us.MAP))return!1;let i;for(let t=0,o=r.length;t<o;t++){const o=r[t];if(this.canonical&&(i=n[o])){if(!this.push(i))return!1}else if(!this._pushString(o))return!1;if(!this.pushAny(e[o]))return!1}return!0}pushAny(e){switch(typeof e){case"number":return this._pushNumber(e);case"bigint":return this._pushJSBigint(e);case"string":return this._pushString(e);case"boolean":return this._pushBoolean(e);case"undefined":return this._pushUndefined(e);case"object":return this._pushObject(e);case"symbol":switch(e){case Vs.NULL:return this._pushNull(null);case Vs.UNDEFINED:return this._pushUndefined(void 0);default:throw new Error("Unknown symbol: "+e.toString())}default:throw new Error("Unknown type: "+typeof e+", "+(e?e.toString():""))}}_pushAny(e){return this.pushAny(e)}_encodeAll(e){const t=new ts({highWaterMark:this.readableHighWaterMark});this.pipe(t);for(const t of e)this.pushAny(t);return this.end(),t.read()}static encode(...e){return(new ic)._encodeAll(e)}static encodeCanonical(...e){return new ic({canonical:!0})._encodeAll(e)}static encodeOne(e,t){return new ic(t)._encodeAll([e])}static encodeAsync(e,t){return new Promise((r,n)=>{const i=[],o=new ic(t);o.on("data",e=>i.push(e)),o.on("error",n),o.on("finish",()=>r(re.concat(i))),o.pushAny(e),o.end()})}}var oc=ic;const ac=Ka.MT;class sc extends Map{constructor(e){super(e)}static _encode(e){return oc.encodeCanonical(e).toString("base64")}static _decode(e){return Is.decodeFirstSync(e,"base64")}get(e){return super.get(sc._encode(e))}set(e,t){return super.set(sc._encode(e),t)}delete(e){return super.delete(sc._encode(e))}has(e){return super.has(sc._encode(e))}*keys(){for(const e of super.keys())yield sc._decode(e)}*entries(){for(const e of super.entries())yield[sc._decode(e[0]),e[1]]}[Symbol.iterator](){return this.entries()}forEach(e,t){if("function"!=typeof e)throw new TypeError("Must be function");for(const t of super.entries())e.call(this,t[1],sc._decode(t[0]),this)}encodeCBOR(e){if(!e._pushInt(this.size,ac.MAP))return!1;if(e.canonical){const t=Array.from(super.entries()).map(e=>[re.from(e[0],"base64"),e[1]]);t.sort((e,t)=>e[0].compare(t[0]));for(const r of t)if(!e.push(r[0])||!e.pushAny(r[1]))return!1}else for(const t of super.entries())if(!e.push(re.from(t[0],"base64"))||!e.pushAny(t[1]))return!1;return!0}}var cc=sc,uc=tr((function(e,t){t.Commented=Ns,t.Diagnose=Ds,t.Decoder=Is,t.Encoder=oc,t.Simple=Qa,t.Tagged=us,t.Map=cc,t.comment=t.Commented.comment,t.decodeAll=t.Decoder.decodeAll,t.decodeFirst=t.Decoder.decodeFirst,t.decodeAllSync=t.Decoder.decodeAllSync,t.decodeFirstSync=t.Decoder.decodeFirstSync,t.diagnose=t.Diagnose.diagnose,t.encode=t.Encoder.encode,t.encodeCanonical=t.Encoder.encodeCanonical,t.encodeOne=t.Encoder.encodeOne,t.encodeAsync=t.Encoder.encodeAsync,t.decode=t.Decoder.decodeFirstSync,t.leveldb={decode:t.Decoder.decodeAllSync,encode:t.Encoder.encode,buffer:!0,name:"cbor"},t.hasBigInt=$a.hasBigInt}));uc.Commented,uc.Diagnose,uc.Decoder,uc.Encoder,uc.Simple,uc.Tagged,uc.Map,uc.comment,uc.decodeAll,uc.decodeFirst,uc.decodeAllSync,uc.decodeFirstSync,uc.diagnose,uc.encode,uc.encodeCanonical,uc.encodeOne,uc.encodeAsync,uc.decode,uc.leveldb,uc.hasBigInt;var lc=class{constructor(e,t,r,n){this.name=e,this.code=t,this.alphabet=n,r&&n&&(this.engine=r(n))}encode(e){return this.engine.encode(e)}decode(e){return this.engine.decode(e)}isImplemented(){return this.engine}},fc=tr((function(e,t){var r=Fe.Buffer;function n(e,t){for(var r in e)t[r]=e[r]}function i(e,t,n){return r(e,t,n)}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?e.exports=Fe:(n(Fe,t),t.Buffer=i),i.prototype=Object.create(r.prototype),n(r,i),i.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return r(e,t,n)},i.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=r(e);return void 0!==t?"string"==typeof n?i.fill(t,n):i.fill(t):i.fill(0),i},i.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r(e)},i.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return Fe.SlowBuffer(e)}})),hc=(fc.Buffer,fc.Buffer);var dc=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var n=0;n<e.length;n++){var i=e.charAt(n),o=i.charCodeAt(0);if(255!==t[o])throw new TypeError(i+" is ambiguous");t[o]=n}var a=e.length,s=e.charAt(0),c=Math.log(a)/Math.log(256),u=Math.log(256)/Math.log(a);function l(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return hc.alloc(0);var r=0;if(" "!==e[r]){for(var n=0,i=0;e[r]===s;)n++,r++;for(var o=(e.length-r)*c+1>>>0,u=new Uint8Array(o);e[r];){var l=t[e.charCodeAt(r)];if(255===l)return;for(var f=0,h=o-1;(0!==l||f<i)&&-1!==h;h--,f++)l+=a*u[h]>>>0,u[h]=l%256>>>0,l=l/256>>>0;if(0!==l)throw new Error("Non-zero carry");i=f,r++}if(" "!==e[r]){for(var d=o-i;d!==o&&0===u[d];)d++;var p=hc.allocUnsafe(n+(o-d));p.fill(0,0,n);for(var m=n;d!==o;)p[m++]=u[d++];return p}}}return{encode:function(t){if((Array.isArray(t)||t instanceof Uint8Array)&&(t=hc.from(t)),!hc.isBuffer(t))throw new TypeError("Expected Buffer");if(0===t.length)return"";for(var r=0,n=0,i=0,o=t.length;i!==o&&0===t[i];)i++,r++;for(var c=(o-i)*u+1>>>0,l=new Uint8Array(c);i!==o;){for(var f=t[i],h=0,d=c-1;(0!==f||h<n)&&-1!==d;d--,h++)f+=256*l[d]>>>0,l[d]=f%a>>>0,f=f/a>>>0;if(0!==f)throw new Error("Non-zero carry");n=h,i++}for(var p=c-n;p!==c&&0===l[p];)p++;for(var m=s.repeat(r);p<c;++p)m+=e.charAt(l[p]);return m},decodeUnsafe:l,decode:function(e){var t=l(e);if(t)return t;throw new Error("Non-base"+a+" character")}}};const{Buffer:pc}=Fe;function mc(e,t){const r=e.byteLength,n=new Uint8Array(e),i=t.indexOf("=")===t.length-1;i&&(t=t.substring(0,t.length-1));let o=0,a=0,s="";for(let e=0;e<r;e++)for(a=a<<8|n[e],o+=8;o>=5;)s+=t[a>>>o-5&31],o-=5;if(o>0&&(s+=t[a<<5-o&31]),i)for(;s.length%8!=0;)s+="=";return s}var gc=function(e){return{encode:t=>mc("string"==typeof t?Uint8Array.from(t):t,e),decode(t){for(const r of t)if(e.indexOf(r)<0)throw new Error("invalid base32 character");return function(e,t){const r=(e=e.replace(new RegExp("=","g"),"")).length;let n=0,i=0,o=0;const a=new Uint8Array(5*r/8|0);for(let s=0;s<r;s++)i=i<<5|t.indexOf(e[s]),n+=5,n>=8&&(a[o++]=i>>>n-8&255,n-=8);return a.buffer}(t,e)}}};const{Buffer:vc}=Fe;var yc=function(e){const t=e.indexOf("=")>-1,r=e.indexOf("-")>-1&&e.indexOf("_")>-1;return{encode(e){let n="";n="string"==typeof e?vc.from(e).toString("base64"):e.toString("base64"),r&&(n=n.replace(/\+/g,"-").replace(/\//g,"_"));const i=n.indexOf("=");return i>0&&!t&&(n=n.substring(0,i)),n},decode(t){for(const r of t)if(e.indexOf(r)<0)throw new Error("invalid base64 character");return vc.from(t,"base64")}}};const bc=[["base1","1","","1"],["base2","0",dc,"01"],["base8","7",dc,"01234567"],["base10","9",dc,"0123456789"],["base16","f",function(e){return{encode:e=>"string"==typeof e?pc.from(e).toString("hex"):e.toString("hex"),decode(t){for(const r of t)if(e.indexOf(r)<0)throw new Error("invalid base16 character");return pc.from(t,"hex")}}},"0123456789abcdef"],["base32","b",gc,"abcdefghijklmnopqrstuvwxyz234567"],["base32pad","c",gc,"abcdefghijklmnopqrstuvwxyz234567="],["base32hex","v",gc,"0123456789abcdefghijklmnopqrstuv"],["base32hexpad","t",gc,"0123456789abcdefghijklmnopqrstuv="],["base32z","h",gc,"ybndrfg8ejkmcpqxot1uwisza345h769"],["base58flickr","Z",dc,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base58btc","z",dc,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base64","m",yc,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",yc,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",yc,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",yc,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],wc=bc.reduce((e,t)=>(e[t[0]]=new lc(t[0],t[1],t[2],t[3]),e),{}),_c=bc.reduce((e,t)=>(e[t[1]]=wc[t[0]],e),{});var Sc={names:wc,codes:_c},Ec=tr((function(e,t){const{Buffer:r}=Fe;(t=e.exports=i).encode=function(e,t){const n=o(e);return i(n.name,r.from(n.encode(t)))},t.decode=function(e){r.isBuffer(e)&&(e=e.toString());const t=e.substring(0,1);"string"==typeof(e=e.substring(1,e.length))&&(e=r.from(e));const n=o(t);return r.from(n.decode(e.toString()))},t.isEncoded=function(e){r.isBuffer(e)&&(e=e.toString());if("[object String]"!==Object.prototype.toString.call(e))return!1;const t=e.substring(0,1);try{return o(t).name}catch(e){return!1}},t.names=Object.freeze(Object.keys(Sc.names)),t.codes=Object.freeze(Object.keys(Sc.codes));const n=new Error("Unsupported encoding");function i(e,t){if(!t)throw new Error("requires an encoded buffer");const n=o(e),i=r.from(n.code);return function(e,t){o(e).decode(t.toString())}(n.name,t),r.concat([i,t])}function o(e){let t;if(Sc.names[e])t=Sc.names[e];else{if(!Sc.codes[e])throw n;t=Sc.codes[e]}if(!t.isImplemented())throw new Error("Base "+e+" is not implemented yet");return t}})),xc=(Ec.encode,Ec.decode,Ec.isEncoded,Ec.names,Ec.codes,tr((function(e,t){(function(){var r,n="Expected a function",i="__lodash_hash_undefined__",o="__lodash_placeholder__",a=16,s=32,c=64,u=128,l=256,f=1/0,h=9007199254740991,d=NaN,p=4294967295,m=[["ary",u],["bind",1],["bindKey",2],["curry",8],["curryRight",a],["flip",512],["partial",s],["partialRight",c],["rearg",l]],g="[object Arguments]",v="[object Array]",y="[object Boolean]",b="[object Date]",w="[object Error]",_="[object Function]",S="[object GeneratorFunction]",E="[object Map]",x="[object Number]",I="[object Object]",k="[object Promise]",P="[object RegExp]",O="[object Set]",A="[object String]",T="[object Symbol]",C="[object WeakMap]",N="[object ArrayBuffer]",R="[object DataView]",M="[object Float32Array]",L="[object Float64Array]",j="[object Int8Array]",D="[object Int16Array]",B="[object Int32Array]",U="[object Uint8Array]",F="[object Uint8ClampedArray]",H="[object Uint16Array]",V="[object Uint32Array]",z=/\b__p \+= '';/g,q=/\b(__p \+=) '' \+/g,K=/(__e\(.*?\)|\b__t\)) \+\n'';/g,$=/&(?:amp|lt|gt|quot|#39);/g,G=/[&<>"']/g,J=RegExp($.source),W=RegExp(G.source),X=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,Y=/<%=([\s\S]+?)%>/g,Z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ee=/^\w*$/,te=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,re=/[\\^$.*+?()[\]{}|]/g,ne=RegExp(re.source),ie=/^\s+|\s+$/g,oe=/^\s+/,ae=/\s+$/,se=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ce=/\{\n\/\* \[wrapped with (.+)\] \*/,ue=/,? & /,le=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,fe=/\\(\\)?/g,he=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,de=/\w*$/,pe=/^[-+]0x[0-9a-f]+$/i,me=/^0b[01]+$/i,ge=/^\[object .+?Constructor\]$/,ve=/^0o[0-7]+$/i,ye=/^(?:0|[1-9]\d*)$/,be=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,we=/($^)/,_e=/['\n\r\u2028\u2029\\]/g,Se="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ee="\\u2700-\\u27bf",xe="a-z\\xdf-\\xf6\\xf8-\\xff",Ie="A-Z\\xc0-\\xd6\\xd8-\\xde",ke="\\ufe0e\\ufe0f",Pe="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Oe="['’]",Ae="[\\ud800-\\udfff]",Te="["+Pe+"]",Ce="["+Se+"]",Ne="\\d+",Re="[\\u2700-\\u27bf]",Me="["+xe+"]",Le="[^\\ud800-\\udfff"+Pe+Ne+Ee+xe+Ie+"]",je="\\ud83c[\\udffb-\\udfff]",De="[^\\ud800-\\udfff]",Be="(?:\\ud83c[\\udde6-\\uddff]){2}",Ue="[\\ud800-\\udbff][\\udc00-\\udfff]",Fe="["+Ie+"]",He="(?:"+Me+"|"+Le+")",Ve="(?:"+Fe+"|"+Le+")",ze="(?:['’](?:d|ll|m|re|s|t|ve))?",qe="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ke="(?:"+Ce+"|"+je+")"+"?",$e="[\\ufe0e\\ufe0f]?",Ge=$e+Ke+("(?:\\u200d(?:"+[De,Be,Ue].join("|")+")"+$e+Ke+")*"),Je="(?:"+[Re,Be,Ue].join("|")+")"+Ge,We="(?:"+[De+Ce+"?",Ce,Be,Ue,Ae].join("|")+")",Xe=RegExp(Oe,"g"),Qe=RegExp(Ce,"g"),Ye=RegExp(je+"(?="+je+")|"+We+Ge,"g"),Ze=RegExp([Fe+"?"+Me+"+"+ze+"(?="+[Te,Fe,"$"].join("|")+")",Ve+"+"+qe+"(?="+[Te,Fe+He,"$"].join("|")+")",Fe+"?"+He+"+"+ze,Fe+"+"+qe,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ne,Je].join("|"),"g"),et=RegExp("[\\u200d\\ud800-\\udfff"+Se+ke+"]"),tt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,rt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],nt=-1,it={};it[M]=it[L]=it[j]=it[D]=it[B]=it[U]=it[F]=it[H]=it[V]=!0,it[g]=it[v]=it[N]=it[y]=it[R]=it[b]=it[w]=it[_]=it[E]=it[x]=it[I]=it[P]=it[O]=it[A]=it[C]=!1;var ot={};ot[g]=ot[v]=ot[N]=ot[R]=ot[y]=ot[b]=ot[M]=ot[L]=ot[j]=ot[D]=ot[B]=ot[E]=ot[x]=ot[I]=ot[P]=ot[O]=ot[A]=ot[T]=ot[U]=ot[F]=ot[H]=ot[V]=!0,ot[w]=ot[_]=ot[C]=!1;var at={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},st=parseFloat,ct=parseInt,ut="object"==typeof Zt&&Zt&&Zt.Object===Object&&Zt,lt="object"==typeof self&&self&&self.Object===Object&&self,ft=ut||lt||Function("return this")(),ht=t&&!t.nodeType&&t,dt=ht&&e&&!e.nodeType&&e,pt=dt&&dt.exports===ht,mt=pt&&ut.process,gt=function(){try{var e=dt&&dt.require&&dt.require("util").types;return e||mt&&mt.binding&&mt.binding("util")}catch(e){}}(),vt=gt&&gt.isArrayBuffer,yt=gt&&gt.isDate,bt=gt&&gt.isMap,wt=gt&&gt.isRegExp,_t=gt&&gt.isSet,St=gt&&gt.isTypedArray;function Et(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function xt(e,t,r,n){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(n,a,r(a),e)}return n}function It(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}function kt(e,t){for(var r=null==e?0:e.length;r--&&!1!==t(e[r],r,e););return e}function Pt(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(!t(e[r],r,e))return!1;return!0}function Ot(e,t){for(var r=-1,n=null==e?0:e.length,i=0,o=[];++r<n;){var a=e[r];t(a,r,e)&&(o[i++]=a)}return o}function At(e,t){return!!(null==e?0:e.length)&&Ut(e,t,0)>-1}function Tt(e,t,r){for(var n=-1,i=null==e?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}function Ct(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}function Nt(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}function Rt(e,t,r,n){var i=-1,o=null==e?0:e.length;for(n&&o&&(r=e[++i]);++i<o;)r=t(r,e[i],i,e);return r}function Mt(e,t,r,n){var i=null==e?0:e.length;for(n&&i&&(r=e[--i]);i--;)r=t(r,e[i],i,e);return r}function Lt(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var jt=zt("length");function Dt(e,t,r){var n;return r(e,(function(e,r,i){if(t(e,r,i))return n=r,!1})),n}function Bt(e,t,r,n){for(var i=e.length,o=r+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function Ut(e,t,r){return t==t?function(e,t,r){var n=r-1,i=e.length;for(;++n<i;)if(e[n]===t)return n;return-1}(e,t,r):Bt(e,Ht,r)}function Ft(e,t,r,n){for(var i=r-1,o=e.length;++i<o;)if(n(e[i],t))return i;return-1}function Ht(e){return e!=e}function Vt(e,t){var r=null==e?0:e.length;return r?$t(e,t)/r:d}function zt(e){return function(t){return null==t?r:t[e]}}function qt(e){return function(t){return null==e?r:e[t]}}function Kt(e,t,r,n,i){return i(e,(function(e,i,o){r=n?(n=!1,e):t(r,e,i,o)})),r}function $t(e,t){for(var n,i=-1,o=e.length;++i<o;){var a=t(e[i]);a!==r&&(n=n===r?a:n+a)}return n}function Gt(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function Jt(e){return function(t){return e(t)}}function Wt(e,t){return Ct(t,(function(t){return e[t]}))}function Xt(e,t){return e.has(t)}function Qt(e,t){for(var r=-1,n=e.length;++r<n&&Ut(t,e[r],0)>-1;);return r}function Yt(e,t){for(var r=e.length;r--&&Ut(t,e[r],0)>-1;);return r}function er(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}var tr=qt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),rr=qt({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function nr(e){return"\\"+at[e]}function ir(e){return et.test(e)}function or(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function ar(e,t){return function(r){return e(t(r))}}function sr(e,t){for(var r=-1,n=e.length,i=0,a=[];++r<n;){var s=e[r];s!==t&&s!==o||(e[r]=o,a[i++]=r)}return a}function cr(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}function ur(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=[e,e]})),r}function lr(e){return ir(e)?function(e){var t=Ye.lastIndex=0;for(;Ye.test(e);)++t;return t}(e):jt(e)}function fr(e){return ir(e)?function(e){return e.match(Ye)||[]}(e):function(e){return e.split("")}(e)}var hr=qt({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"});var dr=function e(t){var Se,Ee=(t=null==t?ft:dr.defaults(ft.Object(),t,dr.pick(ft,rt))).Array,xe=t.Date,Ie=t.Error,ke=t.Function,Pe=t.Math,Oe=t.Object,Ae=t.RegExp,Te=t.String,Ce=t.TypeError,Ne=Ee.prototype,Re=ke.prototype,Me=Oe.prototype,Le=t["__core-js_shared__"],je=Re.toString,De=Me.hasOwnProperty,Be=0,Ue=(Se=/[^.]+$/.exec(Le&&Le.keys&&Le.keys.IE_PROTO||""))?"Symbol(src)_1."+Se:"",Fe=Me.toString,He=je.call(Oe),Ve=ft._,ze=Ae("^"+je.call(De).replace(re,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),qe=pt?t.Buffer:r,Ke=t.Symbol,$e=t.Uint8Array,Ge=qe?qe.allocUnsafe:r,Je=ar(Oe.getPrototypeOf,Oe),We=Oe.create,Ye=Me.propertyIsEnumerable,et=Ne.splice,at=Ke?Ke.isConcatSpreadable:r,ut=Ke?Ke.iterator:r,lt=Ke?Ke.toStringTag:r,ht=function(){try{var e=ho(Oe,"defineProperty");return e({},"",{}),e}catch(e){}}(),dt=t.clearTimeout!==ft.clearTimeout&&t.clearTimeout,mt=xe&&xe.now!==ft.Date.now&&xe.now,gt=t.setTimeout!==ft.setTimeout&&t.setTimeout,jt=Pe.ceil,qt=Pe.floor,Zt=Oe.getOwnPropertySymbols,pr=qe?qe.isBuffer:r,mr=t.isFinite,gr=Ne.join,vr=ar(Oe.keys,Oe),yr=Pe.max,br=Pe.min,wr=xe.now,_r=t.parseInt,Sr=Pe.random,Er=Ne.reverse,xr=ho(t,"DataView"),Ir=ho(t,"Map"),kr=ho(t,"Promise"),Pr=ho(t,"Set"),Or=ho(t,"WeakMap"),Ar=ho(Oe,"create"),Tr=Or&&new Or,Cr={},Nr=Fo(xr),Rr=Fo(Ir),Mr=Fo(kr),Lr=Fo(Pr),jr=Fo(Or),Dr=Ke?Ke.prototype:r,Br=Dr?Dr.valueOf:r,Ur=Dr?Dr.toString:r;function Fr(e){if(ns(e)&&!$a(e)&&!(e instanceof qr)){if(e instanceof zr)return e;if(De.call(e,"__wrapped__"))return Ho(e)}return new zr(e)}var Hr=function(){function e(){}return function(t){if(!rs(t))return{};if(We)return We(t);e.prototype=t;var n=new e;return e.prototype=r,n}}();function Vr(){}function zr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=r}function qr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=p,this.__views__=[]}function Kr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function $r(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Gr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Jr(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new Gr;++t<r;)this.add(e[t])}function Wr(e){var t=this.__data__=new $r(e);this.size=t.size}function Xr(e,t){var r=$a(e),n=!r&&Ka(e),i=!r&&!n&&Xa(e),o=!r&&!n&&!i&&fs(e),a=r||n||i||o,s=a?Gt(e.length,Te):[],c=s.length;for(var u in e)!t&&!De.call(e,u)||a&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||wo(u,c))||s.push(u);return s}function Qr(e){var t=e.length;return t?e[Wn(0,t-1)]:r}function Yr(e,t){return Do(Ti(e),cn(t,0,e.length))}function Zr(e){return Do(Ti(e))}function en(e,t,n){(n!==r&&!Va(e[t],n)||n===r&&!(t in e))&&an(e,t,n)}function tn(e,t,n){var i=e[t];De.call(e,t)&&Va(i,n)&&(n!==r||t in e)||an(e,t,n)}function rn(e,t){for(var r=e.length;r--;)if(Va(e[r][0],t))return r;return-1}function nn(e,t,r,n){return dn(e,(function(e,i,o){t(n,e,r(e),o)})),n}function on(e,t){return e&&Ci(t,Rs(t),e)}function an(e,t,r){"__proto__"==t&&ht?ht(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function sn(e,t){for(var n=-1,i=t.length,o=Ee(i),a=null==e;++n<i;)o[n]=a?r:Os(e,t[n]);return o}function cn(e,t,n){return e==e&&(n!==r&&(e=e<=n?e:n),t!==r&&(e=e>=t?e:t)),e}function un(e,t,n,i,o,a){var s,c=1&t,u=2&t,l=4&t;if(n&&(s=o?n(e,i,o,a):n(e)),s!==r)return s;if(!rs(e))return e;var f=$a(e);if(f){if(s=function(e){var t=e.length,r=new e.constructor(t);t&&"string"==typeof e[0]&&De.call(e,"index")&&(r.index=e.index,r.input=e.input);return r}(e),!c)return Ti(e,s)}else{var h=go(e),d=h==_||h==S;if(Xa(e))return xi(e,c);if(h==I||h==g||d&&!o){if(s=u||d?{}:yo(e),!c)return u?function(e,t){return Ci(e,mo(e),t)}(e,function(e,t){return e&&Ci(t,Ms(t),e)}(s,e)):function(e,t){return Ci(e,po(e),t)}(e,on(s,e))}else{if(!ot[h])return o?e:{};s=function(e,t,r){var n=e.constructor;switch(t){case N:return Ii(e);case y:case b:return new n(+e);case R:return function(e,t){var r=t?Ii(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case M:case L:case j:case D:case B:case U:case F:case H:case V:return ki(e,r);case E:return new n;case x:case A:return new n(e);case P:return function(e){var t=new e.constructor(e.source,de.exec(e));return t.lastIndex=e.lastIndex,t}(e);case O:return new n;case T:return i=e,Br?Oe(Br.call(i)):{}}var i}(e,h,c)}}a||(a=new Wr);var p=a.get(e);if(p)return p;a.set(e,s),cs(e)?e.forEach((function(r){s.add(un(r,t,n,r,e,a))})):is(e)&&e.forEach((function(r,i){s.set(i,un(r,t,n,i,e,a))}));var m=f?r:(l?u?oo:io:u?Ms:Rs)(e);return It(m||e,(function(r,i){m&&(r=e[i=r]),tn(s,i,un(r,t,n,i,e,a))})),s}function ln(e,t,n){var i=n.length;if(null==e)return!i;for(e=Oe(e);i--;){var o=n[i],a=t[o],s=e[o];if(s===r&&!(o in e)||!a(s))return!1}return!0}function fn(e,t,i){if("function"!=typeof e)throw new Ce(n);return Ro((function(){e.apply(r,i)}),t)}function hn(e,t,r,n){var i=-1,o=At,a=!0,s=e.length,c=[],u=t.length;if(!s)return c;r&&(t=Ct(t,Jt(r))),n?(o=Tt,a=!1):t.length>=200&&(o=Xt,a=!1,t=new Jr(t));e:for(;++i<s;){var l=e[i],f=null==r?l:r(l);if(l=n||0!==l?l:0,a&&f==f){for(var h=u;h--;)if(t[h]===f)continue e;c.push(l)}else o(t,f,n)||c.push(l)}return c}Fr.templateSettings={escape:X,evaluate:Q,interpolate:Y,variable:"",imports:{_:Fr}},Fr.prototype=Vr.prototype,Fr.prototype.constructor=Fr,zr.prototype=Hr(Vr.prototype),zr.prototype.constructor=zr,qr.prototype=Hr(Vr.prototype),qr.prototype.constructor=qr,Kr.prototype.clear=function(){this.__data__=Ar?Ar(null):{},this.size=0},Kr.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Kr.prototype.get=function(e){var t=this.__data__;if(Ar){var n=t[e];return n===i?r:n}return De.call(t,e)?t[e]:r},Kr.prototype.has=function(e){var t=this.__data__;return Ar?t[e]!==r:De.call(t,e)},Kr.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ar&&t===r?i:t,this},$r.prototype.clear=function(){this.__data__=[],this.size=0},$r.prototype.delete=function(e){var t=this.__data__,r=rn(t,e);return!(r<0)&&(r==t.length-1?t.pop():et.call(t,r,1),--this.size,!0)},$r.prototype.get=function(e){var t=this.__data__,n=rn(t,e);return n<0?r:t[n][1]},$r.prototype.has=function(e){return rn(this.__data__,e)>-1},$r.prototype.set=function(e,t){var r=this.__data__,n=rn(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},Gr.prototype.clear=function(){this.size=0,this.__data__={hash:new Kr,map:new(Ir||$r),string:new Kr}},Gr.prototype.delete=function(e){var t=lo(this,e).delete(e);return this.size-=t?1:0,t},Gr.prototype.get=function(e){return lo(this,e).get(e)},Gr.prototype.has=function(e){return lo(this,e).has(e)},Gr.prototype.set=function(e,t){var r=lo(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},Jr.prototype.add=Jr.prototype.push=function(e){return this.__data__.set(e,i),this},Jr.prototype.has=function(e){return this.__data__.has(e)},Wr.prototype.clear=function(){this.__data__=new $r,this.size=0},Wr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Wr.prototype.get=function(e){return this.__data__.get(e)},Wr.prototype.has=function(e){return this.__data__.has(e)},Wr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof $r){var n=r.__data__;if(!Ir||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Gr(n)}return r.set(e,t),this.size=r.size,this};var dn=Mi(_n),pn=Mi(Sn,!0);function mn(e,t){var r=!0;return dn(e,(function(e,n,i){return r=!!t(e,n,i)})),r}function gn(e,t,n){for(var i=-1,o=e.length;++i<o;){var a=e[i],s=t(a);if(null!=s&&(c===r?s==s&&!ls(s):n(s,c)))var c=s,u=a}return u}function vn(e,t){var r=[];return dn(e,(function(e,n,i){t(e,n,i)&&r.push(e)})),r}function yn(e,t,r,n,i){var o=-1,a=e.length;for(r||(r=bo),i||(i=[]);++o<a;){var s=e[o];t>0&&r(s)?t>1?yn(s,t-1,r,n,i):Nt(i,s):n||(i[i.length]=s)}return i}var bn=Li(),wn=Li(!0);function _n(e,t){return e&&bn(e,t,Rs)}function Sn(e,t){return e&&wn(e,t,Rs)}function En(e,t){return Ot(t,(function(t){return Za(e[t])}))}function xn(e,t){for(var n=0,i=(t=wi(t,e)).length;null!=e&&n<i;)e=e[Uo(t[n++])];return n&&n==i?e:r}function In(e,t,r){var n=t(e);return $a(e)?n:Nt(n,r(e))}function kn(e){return null==e?e===r?"[object Undefined]":"[object Null]":lt&&lt in Oe(e)?function(e){var t=De.call(e,lt),n=e[lt];try{e[lt]=r;var i=!0}catch(e){}var o=Fe.call(e);i&&(t?e[lt]=n:delete e[lt]);return o}(e):function(e){return Fe.call(e)}(e)}function Pn(e,t){return e>t}function On(e,t){return null!=e&&De.call(e,t)}function An(e,t){return null!=e&&t in Oe(e)}function Tn(e,t,n){for(var i=n?Tt:At,o=e[0].length,a=e.length,s=a,c=Ee(a),u=1/0,l=[];s--;){var f=e[s];s&&t&&(f=Ct(f,Jt(t))),u=br(f.length,u),c[s]=!n&&(t||o>=120&&f.length>=120)?new Jr(s&&f):r}f=e[0];var h=-1,d=c[0];e:for(;++h<o&&l.length<u;){var p=f[h],m=t?t(p):p;if(p=n||0!==p?p:0,!(d?Xt(d,m):i(l,m,n))){for(s=a;--s;){var g=c[s];if(!(g?Xt(g,m):i(e[s],m,n)))continue e}d&&d.push(m),l.push(p)}}return l}function Cn(e,t,n){var i=null==(e=Ao(e,t=wi(t,e)))?e:e[Uo(Yo(t))];return null==i?r:Et(i,e,n)}function Nn(e){return ns(e)&&kn(e)==g}function Rn(e,t,n,i,o){return e===t||(null==e||null==t||!ns(e)&&!ns(t)?e!=e&&t!=t:function(e,t,n,i,o,a){var s=$a(e),c=$a(t),u=s?v:go(e),l=c?v:go(t),f=(u=u==g?I:u)==I,h=(l=l==g?I:l)==I,d=u==l;if(d&&Xa(e)){if(!Xa(t))return!1;s=!0,f=!1}if(d&&!f)return a||(a=new Wr),s||fs(e)?ro(e,t,n,i,o,a):function(e,t,r,n,i,o,a){switch(r){case R:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case N:return!(e.byteLength!=t.byteLength||!o(new $e(e),new $e(t)));case y:case b:case x:return Va(+e,+t);case w:return e.name==t.name&&e.message==t.message;case P:case A:return e==t+"";case E:var s=or;case O:var c=1&n;if(s||(s=cr),e.size!=t.size&&!c)return!1;var u=a.get(e);if(u)return u==t;n|=2,a.set(e,t);var l=ro(s(e),s(t),n,i,o,a);return a.delete(e),l;case T:if(Br)return Br.call(e)==Br.call(t)}return!1}(e,t,u,n,i,o,a);if(!(1&n)){var p=f&&De.call(e,"__wrapped__"),m=h&&De.call(t,"__wrapped__");if(p||m){var _=p?e.value():e,S=m?t.value():t;return a||(a=new Wr),o(_,S,n,i,a)}}if(!d)return!1;return a||(a=new Wr),function(e,t,n,i,o,a){var s=1&n,c=io(e),u=c.length,l=io(t).length;if(u!=l&&!s)return!1;var f=u;for(;f--;){var h=c[f];if(!(s?h in t:De.call(t,h)))return!1}var d=a.get(e),p=a.get(t);if(d&&p)return d==t&&p==e;var m=!0;a.set(e,t),a.set(t,e);var g=s;for(;++f<u;){var v=e[h=c[f]],y=t[h];if(i)var b=s?i(y,v,h,t,e,a):i(v,y,h,e,t,a);if(!(b===r?v===y||o(v,y,n,i,a):b)){m=!1;break}g||(g="constructor"==h)}if(m&&!g){var w=e.constructor,_=t.constructor;w==_||!("constructor"in e)||!("constructor"in t)||"function"==typeof w&&w instanceof w&&"function"==typeof _&&_ instanceof _||(m=!1)}return a.delete(e),a.delete(t),m}(e,t,n,i,o,a)}(e,t,n,i,Rn,o))}function Mn(e,t,n,i){var o=n.length,a=o,s=!i;if(null==e)return!a;for(e=Oe(e);o--;){var c=n[o];if(s&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++o<a;){var u=(c=n[o])[0],l=e[u],f=c[1];if(s&&c[2]){if(l===r&&!(u in e))return!1}else{var h=new Wr;if(i)var d=i(l,f,u,e,t,h);if(!(d===r?Rn(f,l,3,i,h):d))return!1}}return!0}function Ln(e){return!(!rs(e)||(t=e,Ue&&Ue in t))&&(Za(e)?ze:ge).test(Fo(e));var t}function jn(e){return"function"==typeof e?e:null==e?oc:"object"==typeof e?$a(e)?Vn(e[0],e[1]):Hn(e):pc(e)}function Dn(e){if(!Io(e))return vr(e);var t=[];for(var r in Oe(e))De.call(e,r)&&"constructor"!=r&&t.push(r);return t}function Bn(e){if(!rs(e))return function(e){var t=[];if(null!=e)for(var r in Oe(e))t.push(r);return t}(e);var t=Io(e),r=[];for(var n in e)("constructor"!=n||!t&&De.call(e,n))&&r.push(n);return r}function Un(e,t){return e<t}function Fn(e,t){var r=-1,n=Ja(e)?Ee(e.length):[];return dn(e,(function(e,i,o){n[++r]=t(e,i,o)})),n}function Hn(e){var t=fo(e);return 1==t.length&&t[0][2]?Po(t[0][0],t[0][1]):function(r){return r===e||Mn(r,e,t)}}function Vn(e,t){return So(e)&&ko(t)?Po(Uo(e),t):function(n){var i=Os(n,e);return i===r&&i===t?As(n,e):Rn(t,i,3)}}function zn(e,t,n,i,o){e!==t&&bn(t,(function(a,s){if(o||(o=new Wr),rs(a))!function(e,t,n,i,o,a,s){var c=Co(e,n),u=Co(t,n),l=s.get(u);if(l)return void en(e,n,l);var f=a?a(c,u,n+"",e,t,s):r,h=f===r;if(h){var d=$a(u),p=!d&&Xa(u),m=!d&&!p&&fs(u);f=u,d||p||m?$a(c)?f=c:Wa(c)?f=Ti(c):p?(h=!1,f=xi(u,!0)):m?(h=!1,f=ki(u,!0)):f=[]:as(u)||Ka(u)?(f=c,Ka(c)?f=bs(c):rs(c)&&!Za(c)||(f=yo(u))):h=!1}h&&(s.set(u,f),o(f,u,i,a,s),s.delete(u));en(e,n,f)}(e,t,s,n,zn,i,o);else{var c=i?i(Co(e,s),a,s+"",e,t,o):r;c===r&&(c=a),en(e,s,c)}}),Ms)}function qn(e,t){var n=e.length;if(n)return wo(t+=t<0?n:0,n)?e[t]:r}function Kn(e,t,r){t=t.length?Ct(t,(function(e){return $a(e)?function(t){return xn(t,1===e.length?e[0]:e)}:e})):[oc];var n=-1;return t=Ct(t,Jt(uo())),function(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}(Fn(e,(function(e,r,i){return{criteria:Ct(t,(function(t){return t(e)})),index:++n,value:e}})),(function(e,t){return function(e,t,r){var n=-1,i=e.criteria,o=t.criteria,a=i.length,s=r.length;for(;++n<a;){var c=Pi(i[n],o[n]);if(c)return n>=s?c:c*("desc"==r[n]?-1:1)}return e.index-t.index}(e,t,r)}))}function $n(e,t,r){for(var n=-1,i=t.length,o={};++n<i;){var a=t[n],s=xn(e,a);r(s,a)&&ei(o,wi(a,e),s)}return o}function Gn(e,t,r,n){var i=n?Ft:Ut,o=-1,a=t.length,s=e;for(e===t&&(t=Ti(t)),r&&(s=Ct(e,Jt(r)));++o<a;)for(var c=0,u=t[o],l=r?r(u):u;(c=i(s,l,c,n))>-1;)s!==e&&et.call(s,c,1),et.call(e,c,1);return e}function Jn(e,t){for(var r=e?t.length:0,n=r-1;r--;){var i=t[r];if(r==n||i!==o){var o=i;wo(i)?et.call(e,i,1):hi(e,i)}}return e}function Wn(e,t){return e+qt(Sr()*(t-e+1))}function Xn(e,t){var r="";if(!e||t<1||t>h)return r;do{t%2&&(r+=e),(t=qt(t/2))&&(e+=e)}while(t);return r}function Qn(e,t){return Mo(Oo(e,t,oc),e+"")}function Yn(e){return Qr(Vs(e))}function Zn(e,t){var r=Vs(e);return Do(r,cn(t,0,r.length))}function ei(e,t,n,i){if(!rs(e))return e;for(var o=-1,a=(t=wi(t,e)).length,s=a-1,c=e;null!=c&&++o<a;){var u=Uo(t[o]),l=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(o!=s){var f=c[u];(l=i?i(f,u,c):r)===r&&(l=rs(f)?f:wo(t[o+1])?[]:{})}tn(c,u,l),c=c[u]}return e}var ti=Tr?function(e,t){return Tr.set(e,t),e}:oc,ri=ht?function(e,t){return ht(e,"toString",{configurable:!0,enumerable:!1,value:rc(t),writable:!0})}:oc;function ni(e){return Do(Vs(e))}function ii(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var o=Ee(i);++n<i;)o[n]=e[n+t];return o}function oi(e,t){var r;return dn(e,(function(e,n,i){return!(r=t(e,n,i))})),!!r}function ai(e,t,r){var n=0,i=null==e?n:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;n<i;){var o=n+i>>>1,a=e[o];null!==a&&!ls(a)&&(r?a<=t:a<t)?n=o+1:i=o}return i}return si(e,t,oc,r)}function si(e,t,n,i){var o=0,a=null==e?0:e.length;if(0===a)return 0;for(var s=(t=n(t))!=t,c=null===t,u=ls(t),l=t===r;o<a;){var f=qt((o+a)/2),h=n(e[f]),d=h!==r,p=null===h,m=h==h,g=ls(h);if(s)var v=i||m;else v=l?m&&(i||d):c?m&&d&&(i||!p):u?m&&d&&!p&&(i||!g):!p&&!g&&(i?h<=t:h<t);v?o=f+1:a=f}return br(a,4294967294)}function ci(e,t){for(var r=-1,n=e.length,i=0,o=[];++r<n;){var a=e[r],s=t?t(a):a;if(!r||!Va(s,c)){var c=s;o[i++]=0===a?0:a}}return o}function ui(e){return"number"==typeof e?e:ls(e)?d:+e}function li(e){if("string"==typeof e)return e;if($a(e))return Ct(e,li)+"";if(ls(e))return Ur?Ur.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function fi(e,t,r){var n=-1,i=At,o=e.length,a=!0,s=[],c=s;if(r)a=!1,i=Tt;else if(o>=200){var u=t?null:Xi(e);if(u)return cr(u);a=!1,i=Xt,c=new Jr}else c=t?[]:s;e:for(;++n<o;){var l=e[n],f=t?t(l):l;if(l=r||0!==l?l:0,a&&f==f){for(var h=c.length;h--;)if(c[h]===f)continue e;t&&c.push(f),s.push(l)}else i(c,f,r)||(c!==s&&c.push(f),s.push(l))}return s}function hi(e,t){return null==(e=Ao(e,t=wi(t,e)))||delete e[Uo(Yo(t))]}function di(e,t,r,n){return ei(e,t,r(xn(e,t)),n)}function pi(e,t,r,n){for(var i=e.length,o=n?i:-1;(n?o--:++o<i)&&t(e[o],o,e););return r?ii(e,n?0:o,n?o+1:i):ii(e,n?o+1:0,n?i:o)}function mi(e,t){var r=e;return r instanceof qr&&(r=r.value()),Rt(t,(function(e,t){return t.func.apply(t.thisArg,Nt([e],t.args))}),r)}function gi(e,t,r){var n=e.length;if(n<2)return n?fi(e[0]):[];for(var i=-1,o=Ee(n);++i<n;)for(var a=e[i],s=-1;++s<n;)s!=i&&(o[i]=hn(o[i]||a,e[s],t,r));return fi(yn(o,1),t,r)}function vi(e,t,n){for(var i=-1,o=e.length,a=t.length,s={};++i<o;){var c=i<a?t[i]:r;n(s,e[i],c)}return s}function yi(e){return Wa(e)?e:[]}function bi(e){return"function"==typeof e?e:oc}function wi(e,t){return $a(e)?e:So(e,t)?[e]:Bo(ws(e))}var _i=Qn;function Si(e,t,n){var i=e.length;return n=n===r?i:n,!t&&n>=i?e:ii(e,t,n)}var Ei=dt||function(e){return ft.clearTimeout(e)};function xi(e,t){if(t)return e.slice();var r=e.length,n=Ge?Ge(r):new e.constructor(r);return e.copy(n),n}function Ii(e){var t=new e.constructor(e.byteLength);return new $e(t).set(new $e(e)),t}function ki(e,t){var r=t?Ii(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function Pi(e,t){if(e!==t){var n=e!==r,i=null===e,o=e==e,a=ls(e),s=t!==r,c=null===t,u=t==t,l=ls(t);if(!c&&!l&&!a&&e>t||a&&s&&u&&!c&&!l||i&&s&&u||!n&&u||!o)return 1;if(!i&&!a&&!l&&e<t||l&&n&&o&&!i&&!a||c&&n&&o||!s&&o||!u)return-1}return 0}function Oi(e,t,r,n){for(var i=-1,o=e.length,a=r.length,s=-1,c=t.length,u=yr(o-a,0),l=Ee(c+u),f=!n;++s<c;)l[s]=t[s];for(;++i<a;)(f||i<o)&&(l[r[i]]=e[i]);for(;u--;)l[s++]=e[i++];return l}function Ai(e,t,r,n){for(var i=-1,o=e.length,a=-1,s=r.length,c=-1,u=t.length,l=yr(o-s,0),f=Ee(l+u),h=!n;++i<l;)f[i]=e[i];for(var d=i;++c<u;)f[d+c]=t[c];for(;++a<s;)(h||i<o)&&(f[d+r[a]]=e[i++]);return f}function Ti(e,t){var r=-1,n=e.length;for(t||(t=Ee(n));++r<n;)t[r]=e[r];return t}function Ci(e,t,n,i){var o=!n;n||(n={});for(var a=-1,s=t.length;++a<s;){var c=t[a],u=i?i(n[c],e[c],c,n,e):r;u===r&&(u=e[c]),o?an(n,c,u):tn(n,c,u)}return n}function Ni(e,t){return function(r,n){var i=$a(r)?xt:nn,o=t?t():{};return i(r,e,uo(n,2),o)}}function Ri(e){return Qn((function(t,n){var i=-1,o=n.length,a=o>1?n[o-1]:r,s=o>2?n[2]:r;for(a=e.length>3&&"function"==typeof a?(o--,a):r,s&&_o(n[0],n[1],s)&&(a=o<3?r:a,o=1),t=Oe(t);++i<o;){var c=n[i];c&&e(t,c,i,a)}return t}))}function Mi(e,t){return function(r,n){if(null==r)return r;if(!Ja(r))return e(r,n);for(var i=r.length,o=t?i:-1,a=Oe(r);(t?o--:++o<i)&&!1!==n(a[o],o,a););return r}}function Li(e){return function(t,r,n){for(var i=-1,o=Oe(t),a=n(t),s=a.length;s--;){var c=a[e?s:++i];if(!1===r(o[c],c,o))break}return t}}function ji(e){return function(t){var n=ir(t=ws(t))?fr(t):r,i=n?n[0]:t.charAt(0),o=n?Si(n,1).join(""):t.slice(1);return i[e]()+o}}function Di(e){return function(t){return Rt(Zs(Ks(t).replace(Xe,"")),e,"")}}function Bi(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=Hr(e.prototype),n=e.apply(r,t);return rs(n)?n:r}}function Ui(e){return function(t,n,i){var o=Oe(t);if(!Ja(t)){var a=uo(n,3);t=Rs(t),n=function(e){return a(o[e],e,o)}}var s=e(t,n,i);return s>-1?o[a?t[s]:s]:r}}function Fi(e){return no((function(t){var i=t.length,o=i,a=zr.prototype.thru;for(e&&t.reverse();o--;){var s=t[o];if("function"!=typeof s)throw new Ce(n);if(a&&!c&&"wrapper"==so(s))var c=new zr([],!0)}for(o=c?o:i;++o<i;){var u=so(s=t[o]),l="wrapper"==u?ao(s):r;c=l&&Eo(l[0])&&424==l[1]&&!l[4].length&&1==l[9]?c[so(l[0])].apply(c,l[3]):1==s.length&&Eo(s)?c[u]():c.thru(s)}return function(){var e=arguments,r=e[0];if(c&&1==e.length&&$a(r))return c.plant(r).value();for(var n=0,o=i?t[n].apply(this,e):r;++n<i;)o=t[n].call(this,o);return o}}))}function Hi(e,t,n,i,o,a,s,c,l,f){var h=t&u,d=1&t,p=2&t,m=24&t,g=512&t,v=p?r:Bi(e);return function r(){for(var u=arguments.length,y=Ee(u),b=u;b--;)y[b]=arguments[b];if(m)var w=co(r),_=er(y,w);if(i&&(y=Oi(y,i,o,m)),a&&(y=Ai(y,a,s,m)),u-=_,m&&u<f){var S=sr(y,w);return Ji(e,t,Hi,r.placeholder,n,y,S,c,l,f-u)}var E=d?n:this,x=p?E[e]:e;return u=y.length,c?y=To(y,c):g&&u>1&&y.reverse(),h&&l<u&&(y.length=l),this&&this!==ft&&this instanceof r&&(x=v||Bi(x)),x.apply(E,y)}}function Vi(e,t){return function(r,n){return function(e,t,r,n){return _n(e,(function(e,i,o){t(n,r(e),i,o)})),n}(r,e,t(n),{})}}function zi(e,t){return function(n,i){var o;if(n===r&&i===r)return t;if(n!==r&&(o=n),i!==r){if(o===r)return i;"string"==typeof n||"string"==typeof i?(n=li(n),i=li(i)):(n=ui(n),i=ui(i)),o=e(n,i)}return o}}function qi(e){return no((function(t){return t=Ct(t,Jt(uo())),Qn((function(r){var n=this;return e(t,(function(e){return Et(e,n,r)}))}))}))}function Ki(e,t){var n=(t=t===r?" ":li(t)).length;if(n<2)return n?Xn(t,e):t;var i=Xn(t,jt(e/lr(t)));return ir(t)?Si(fr(i),0,e).join(""):i.slice(0,e)}function $i(e){return function(t,n,i){return i&&"number"!=typeof i&&_o(t,n,i)&&(n=i=r),t=ms(t),n===r?(n=t,t=0):n=ms(n),function(e,t,r,n){for(var i=-1,o=yr(jt((t-e)/(r||1)),0),a=Ee(o);o--;)a[n?o:++i]=e,e+=r;return a}(t,n,i=i===r?t<n?1:-1:ms(i),e)}}function Gi(e){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=ys(t),r=ys(r)),e(t,r)}}function Ji(e,t,n,i,o,a,u,l,f,h){var d=8&t;t|=d?s:c,4&(t&=~(d?c:s))||(t&=-4);var p=[e,t,o,d?a:r,d?u:r,d?r:a,d?r:u,l,f,h],m=n.apply(r,p);return Eo(e)&&No(m,p),m.placeholder=i,Lo(m,e,t)}function Wi(e){var t=Pe[e];return function(e,r){if(e=ys(e),(r=null==r?0:br(gs(r),292))&&mr(e)){var n=(ws(e)+"e").split("e");return+((n=(ws(t(n[0]+"e"+(+n[1]+r)))+"e").split("e"))[0]+"e"+(+n[1]-r))}return t(e)}}var Xi=Pr&&1/cr(new Pr([,-0]))[1]==f?function(e){return new Pr(e)}:lc;function Qi(e){return function(t){var r=go(t);return r==E?or(t):r==O?ur(t):function(e,t){return Ct(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function Yi(e,t,i,f,h,d,p,m){var g=2&t;if(!g&&"function"!=typeof e)throw new Ce(n);var v=f?f.length:0;if(v||(t&=-97,f=h=r),p=p===r?p:yr(gs(p),0),m=m===r?m:gs(m),v-=h?h.length:0,t&c){var y=f,b=h;f=h=r}var w=g?r:ao(e),_=[e,t,i,f,h,y,b,d,p,m];if(w&&function(e,t){var r=e[1],n=t[1],i=r|n,a=i<131,s=n==u&&8==r||n==u&&r==l&&e[7].length<=t[8]||384==n&&t[7].length<=t[8]&&8==r;if(!a&&!s)return e;1&n&&(e[2]=t[2],i|=1&r?0:4);var c=t[3];if(c){var f=e[3];e[3]=f?Oi(f,c,t[4]):c,e[4]=f?sr(e[3],o):t[4]}(c=t[5])&&(f=e[5],e[5]=f?Ai(f,c,t[6]):c,e[6]=f?sr(e[5],o):t[6]);(c=t[7])&&(e[7]=c);n&u&&(e[8]=null==e[8]?t[8]:br(e[8],t[8]));null==e[9]&&(e[9]=t[9]);e[0]=t[0],e[1]=i}(_,w),e=_[0],t=_[1],i=_[2],f=_[3],h=_[4],!(m=_[9]=_[9]===r?g?0:e.length:yr(_[9]-v,0))&&24&t&&(t&=-25),t&&1!=t)S=8==t||t==a?function(e,t,n){var i=Bi(e);return function o(){for(var a=arguments.length,s=Ee(a),c=a,u=co(o);c--;)s[c]=arguments[c];var l=a<3&&s[0]!==u&&s[a-1]!==u?[]:sr(s,u);return(a-=l.length)<n?Ji(e,t,Hi,o.placeholder,r,s,l,r,r,n-a):Et(this&&this!==ft&&this instanceof o?i:e,this,s)}}(e,t,m):t!=s&&33!=t||h.length?Hi.apply(r,_):function(e,t,r,n){var i=1&t,o=Bi(e);return function t(){for(var a=-1,s=arguments.length,c=-1,u=n.length,l=Ee(u+s),f=this&&this!==ft&&this instanceof t?o:e;++c<u;)l[c]=n[c];for(;s--;)l[c++]=arguments[++a];return Et(f,i?r:this,l)}}(e,t,i,f);else var S=function(e,t,r){var n=1&t,i=Bi(e);return function t(){return(this&&this!==ft&&this instanceof t?i:e).apply(n?r:this,arguments)}}(e,t,i);return Lo((w?ti:No)(S,_),e,t)}function Zi(e,t,n,i){return e===r||Va(e,Me[n])&&!De.call(i,n)?t:e}function eo(e,t,n,i,o,a){return rs(e)&&rs(t)&&(a.set(t,e),zn(e,t,r,eo,a),a.delete(t)),e}function to(e){return as(e)?r:e}function ro(e,t,n,i,o,a){var s=1&n,c=e.length,u=t.length;if(c!=u&&!(s&&u>c))return!1;var l=a.get(e),f=a.get(t);if(l&&f)return l==t&&f==e;var h=-1,d=!0,p=2&n?new Jr:r;for(a.set(e,t),a.set(t,e);++h<c;){var m=e[h],g=t[h];if(i)var v=s?i(g,m,h,t,e,a):i(m,g,h,e,t,a);if(v!==r){if(v)continue;d=!1;break}if(p){if(!Lt(t,(function(e,t){if(!Xt(p,t)&&(m===e||o(m,e,n,i,a)))return p.push(t)}))){d=!1;break}}else if(m!==g&&!o(m,g,n,i,a)){d=!1;break}}return a.delete(e),a.delete(t),d}function no(e){return Mo(Oo(e,r,Go),e+"")}function io(e){return In(e,Rs,po)}function oo(e){return In(e,Ms,mo)}var ao=Tr?function(e){return Tr.get(e)}:lc;function so(e){for(var t=e.name+"",r=Cr[t],n=De.call(Cr,t)?r.length:0;n--;){var i=r[n],o=i.func;if(null==o||o==e)return i.name}return t}function co(e){return(De.call(Fr,"placeholder")?Fr:e).placeholder}function uo(){var e=Fr.iteratee||ac;return e=e===ac?jn:e,arguments.length?e(arguments[0],arguments[1]):e}function lo(e,t){var r=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?r["string"==typeof t?"string":"hash"]:r.map}function fo(e){for(var t=Rs(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,ko(i)]}return t}function ho(e,t){var n=function(e,t){return null==e?r:e[t]}(e,t);return Ln(n)?n:r}var po=Zt?function(e){return null==e?[]:(e=Oe(e),Ot(Zt(e),(function(t){return Ye.call(e,t)})))}:vc,mo=Zt?function(e){for(var t=[];e;)Nt(t,po(e)),e=Je(e);return t}:vc,go=kn;function vo(e,t,r){for(var n=-1,i=(t=wi(t,e)).length,o=!1;++n<i;){var a=Uo(t[n]);if(!(o=null!=e&&r(e,a)))break;e=e[a]}return o||++n!=i?o:!!(i=null==e?0:e.length)&&ts(i)&&wo(a,i)&&($a(e)||Ka(e))}function yo(e){return"function"!=typeof e.constructor||Io(e)?{}:Hr(Je(e))}function bo(e){return $a(e)||Ka(e)||!!(at&&e&&e[at])}function wo(e,t){var r=typeof e;return!!(t=null==t?h:t)&&("number"==r||"symbol"!=r&&ye.test(e))&&e>-1&&e%1==0&&e<t}function _o(e,t,r){if(!rs(r))return!1;var n=typeof t;return!!("number"==n?Ja(r)&&wo(t,r.length):"string"==n&&t in r)&&Va(r[t],e)}function So(e,t){if($a(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!ls(e))||(ee.test(e)||!Z.test(e)||null!=t&&e in Oe(t))}function Eo(e){var t=so(e),r=Fr[t];if("function"!=typeof r||!(t in qr.prototype))return!1;if(e===r)return!0;var n=ao(r);return!!n&&e===n[0]}(xr&&go(new xr(new ArrayBuffer(1)))!=R||Ir&&go(new Ir)!=E||kr&&go(kr.resolve())!=k||Pr&&go(new Pr)!=O||Or&&go(new Or)!=C)&&(go=function(e){var t=kn(e),n=t==I?e.constructor:r,i=n?Fo(n):"";if(i)switch(i){case Nr:return R;case Rr:return E;case Mr:return k;case Lr:return O;case jr:return C}return t});var xo=Le?Za:yc;function Io(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Me)}function ko(e){return e==e&&!rs(e)}function Po(e,t){return function(n){return null!=n&&(n[e]===t&&(t!==r||e in Oe(n)))}}function Oo(e,t,n){return t=yr(t===r?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=yr(r.length-t,0),a=Ee(o);++i<o;)a[i]=r[t+i];i=-1;for(var s=Ee(t+1);++i<t;)s[i]=r[i];return s[t]=n(a),Et(e,this,s)}}function Ao(e,t){return t.length<2?e:xn(e,ii(t,0,-1))}function To(e,t){for(var n=e.length,i=br(t.length,n),o=Ti(e);i--;){var a=t[i];e[i]=wo(a,n)?o[a]:r}return e}function Co(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var No=jo(ti),Ro=gt||function(e,t){return ft.setTimeout(e,t)},Mo=jo(ri);function Lo(e,t,r){var n=t+"";return Mo(e,function(e,t){var r=t.length;if(!r)return e;var n=r-1;return t[n]=(r>1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(se,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return It(m,(function(r){var n="_."+r[0];t&r[1]&&!At(e,n)&&e.push(n)})),e.sort()}(function(e){var t=e.match(ce);return t?t[1].split(ue):[]}(n),r)))}function jo(e){var t=0,n=0;return function(){var i=wr(),o=16-(i-n);if(n=i,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(r,arguments)}}function Do(e,t){var n=-1,i=e.length,o=i-1;for(t=t===r?i:t;++n<t;){var a=Wn(n,o),s=e[a];e[a]=e[n],e[n]=s}return e.length=t,e}var Bo=function(e){var t=ja(e,(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(te,(function(e,r,n,i){t.push(n?i.replace(fe,"$1"):r||e)})),t}));function Uo(e){if("string"==typeof e||ls(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Fo(e){if(null!=e){try{return je.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Ho(e){if(e instanceof qr)return e.clone();var t=new zr(e.__wrapped__,e.__chain__);return t.__actions__=Ti(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Vo=Qn((function(e,t){return Wa(e)?hn(e,yn(t,1,Wa,!0)):[]})),zo=Qn((function(e,t){var n=Yo(t);return Wa(n)&&(n=r),Wa(e)?hn(e,yn(t,1,Wa,!0),uo(n,2)):[]})),qo=Qn((function(e,t){var n=Yo(t);return Wa(n)&&(n=r),Wa(e)?hn(e,yn(t,1,Wa,!0),r,n):[]}));function Ko(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:gs(r);return i<0&&(i=yr(n+i,0)),Bt(e,uo(t,3),i)}function $o(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var o=i-1;return n!==r&&(o=gs(n),o=n<0?yr(i+o,0):br(o,i-1)),Bt(e,uo(t,3),o,!0)}function Go(e){return(null==e?0:e.length)?yn(e,1):[]}function Jo(e){return e&&e.length?e[0]:r}var Wo=Qn((function(e){var t=Ct(e,yi);return t.length&&t[0]===e[0]?Tn(t):[]})),Xo=Qn((function(e){var t=Yo(e),n=Ct(e,yi);return t===Yo(n)?t=r:n.pop(),n.length&&n[0]===e[0]?Tn(n,uo(t,2)):[]})),Qo=Qn((function(e){var t=Yo(e),n=Ct(e,yi);return(t="function"==typeof t?t:r)&&n.pop(),n.length&&n[0]===e[0]?Tn(n,r,t):[]}));function Yo(e){var t=null==e?0:e.length;return t?e[t-1]:r}var Zo=Qn(ea);function ea(e,t){return e&&e.length&&t&&t.length?Gn(e,t):e}var ta=no((function(e,t){var r=null==e?0:e.length,n=sn(e,t);return Jn(e,Ct(t,(function(e){return wo(e,r)?+e:e})).sort(Pi)),n}));function ra(e){return null==e?e:Er.call(e)}var na=Qn((function(e){return fi(yn(e,1,Wa,!0))})),ia=Qn((function(e){var t=Yo(e);return Wa(t)&&(t=r),fi(yn(e,1,Wa,!0),uo(t,2))})),oa=Qn((function(e){var t=Yo(e);return t="function"==typeof t?t:r,fi(yn(e,1,Wa,!0),r,t)}));function aa(e){if(!e||!e.length)return[];var t=0;return e=Ot(e,(function(e){if(Wa(e))return t=yr(e.length,t),!0})),Gt(t,(function(t){return Ct(e,zt(t))}))}function sa(e,t){if(!e||!e.length)return[];var n=aa(e);return null==t?n:Ct(n,(function(e){return Et(t,r,e)}))}var ca=Qn((function(e,t){return Wa(e)?hn(e,t):[]})),ua=Qn((function(e){return gi(Ot(e,Wa))})),la=Qn((function(e){var t=Yo(e);return Wa(t)&&(t=r),gi(Ot(e,Wa),uo(t,2))})),fa=Qn((function(e){var t=Yo(e);return t="function"==typeof t?t:r,gi(Ot(e,Wa),r,t)})),ha=Qn(aa);var da=Qn((function(e){var t=e.length,n=t>1?e[t-1]:r;return n="function"==typeof n?(e.pop(),n):r,sa(e,n)}));function pa(e){var t=Fr(e);return t.__chain__=!0,t}function ma(e,t){return t(e)}var ga=no((function(e){var t=e.length,n=t?e[0]:0,i=this.__wrapped__,o=function(t){return sn(t,e)};return!(t>1||this.__actions__.length)&&i instanceof qr&&wo(n)?((i=i.slice(n,+n+(t?1:0))).__actions__.push({func:ma,args:[o],thisArg:r}),new zr(i,this.__chain__).thru((function(e){return t&&!e.length&&e.push(r),e}))):this.thru(o)}));var va=Ni((function(e,t,r){De.call(e,r)?++e[r]:an(e,r,1)}));var ya=Ui(Ko),ba=Ui($o);function wa(e,t){return($a(e)?It:dn)(e,uo(t,3))}function _a(e,t){return($a(e)?kt:pn)(e,uo(t,3))}var Sa=Ni((function(e,t,r){De.call(e,r)?e[r].push(t):an(e,r,[t])}));var Ea=Qn((function(e,t,r){var n=-1,i="function"==typeof t,o=Ja(e)?Ee(e.length):[];return dn(e,(function(e){o[++n]=i?Et(t,e,r):Cn(e,t,r)})),o})),xa=Ni((function(e,t,r){an(e,r,t)}));function Ia(e,t){return($a(e)?Ct:Fn)(e,uo(t,3))}var ka=Ni((function(e,t,r){e[r?0:1].push(t)}),(function(){return[[],[]]}));var Pa=Qn((function(e,t){if(null==e)return[];var r=t.length;return r>1&&_o(e,t[0],t[1])?t=[]:r>2&&_o(t[0],t[1],t[2])&&(t=[t[0]]),Kn(e,yn(t,1),[])})),Oa=mt||function(){return ft.Date.now()};function Aa(e,t,n){return t=n?r:t,t=e&&null==t?e.length:t,Yi(e,u,r,r,r,r,t)}function Ta(e,t){var i;if("function"!=typeof t)throw new Ce(n);return e=gs(e),function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=r),i}}var Ca=Qn((function(e,t,r){var n=1;if(r.length){var i=sr(r,co(Ca));n|=s}return Yi(e,n,t,r,i)})),Na=Qn((function(e,t,r){var n=3;if(r.length){var i=sr(r,co(Na));n|=s}return Yi(t,n,e,r,i)}));function Ra(e,t,i){var o,a,s,c,u,l,f=0,h=!1,d=!1,p=!0;if("function"!=typeof e)throw new Ce(n);function m(t){var n=o,i=a;return o=a=r,f=t,c=e.apply(i,n)}function g(e){return f=e,u=Ro(y,t),h?m(e):c}function v(e){var n=e-l;return l===r||n>=t||n<0||d&&e-f>=s}function y(){var e=Oa();if(v(e))return b(e);u=Ro(y,function(e){var r=t-(e-l);return d?br(r,s-(e-f)):r}(e))}function b(e){return u=r,p&&o?m(e):(o=a=r,c)}function w(){var e=Oa(),n=v(e);if(o=arguments,a=this,l=e,n){if(u===r)return g(l);if(d)return Ei(u),u=Ro(y,t),m(l)}return u===r&&(u=Ro(y,t)),c}return t=ys(t)||0,rs(i)&&(h=!!i.leading,s=(d="maxWait"in i)?yr(ys(i.maxWait)||0,t):s,p="trailing"in i?!!i.trailing:p),w.cancel=function(){u!==r&&Ei(u),f=0,o=l=a=u=r},w.flush=function(){return u===r?c:b(Oa())},w}var Ma=Qn((function(e,t){return fn(e,1,t)})),La=Qn((function(e,t,r){return fn(e,ys(t)||0,r)}));function ja(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ce(n);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return r.cache=o.set(i,a)||o,a};return r.cache=new(ja.Cache||Gr),r}function Da(e){if("function"!=typeof e)throw new Ce(n);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}ja.Cache=Gr;var Ba=_i((function(e,t){var r=(t=1==t.length&&$a(t[0])?Ct(t[0],Jt(uo())):Ct(yn(t,1),Jt(uo()))).length;return Qn((function(n){for(var i=-1,o=br(n.length,r);++i<o;)n[i]=t[i].call(this,n[i]);return Et(e,this,n)}))})),Ua=Qn((function(e,t){var n=sr(t,co(Ua));return Yi(e,s,r,t,n)})),Fa=Qn((function(e,t){var n=sr(t,co(Fa));return Yi(e,c,r,t,n)})),Ha=no((function(e,t){return Yi(e,l,r,r,r,t)}));function Va(e,t){return e===t||e!=e&&t!=t}var za=Gi(Pn),qa=Gi((function(e,t){return e>=t})),Ka=Nn(function(){return arguments}())?Nn:function(e){return ns(e)&&De.call(e,"callee")&&!Ye.call(e,"callee")},$a=Ee.isArray,Ga=vt?Jt(vt):function(e){return ns(e)&&kn(e)==N};function Ja(e){return null!=e&&ts(e.length)&&!Za(e)}function Wa(e){return ns(e)&&Ja(e)}var Xa=pr||yc,Qa=yt?Jt(yt):function(e){return ns(e)&&kn(e)==b};function Ya(e){if(!ns(e))return!1;var t=kn(e);return t==w||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!as(e)}function Za(e){if(!rs(e))return!1;var t=kn(e);return t==_||t==S||"[object AsyncFunction]"==t||"[object Proxy]"==t}function es(e){return"number"==typeof e&&e==gs(e)}function ts(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=h}function rs(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ns(e){return null!=e&&"object"==typeof e}var is=bt?Jt(bt):function(e){return ns(e)&&go(e)==E};function os(e){return"number"==typeof e||ns(e)&&kn(e)==x}function as(e){if(!ns(e)||kn(e)!=I)return!1;var t=Je(e);if(null===t)return!0;var r=De.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&je.call(r)==He}var ss=wt?Jt(wt):function(e){return ns(e)&&kn(e)==P};var cs=_t?Jt(_t):function(e){return ns(e)&&go(e)==O};function us(e){return"string"==typeof e||!$a(e)&&ns(e)&&kn(e)==A}function ls(e){return"symbol"==typeof e||ns(e)&&kn(e)==T}var fs=St?Jt(St):function(e){return ns(e)&&ts(e.length)&&!!it[kn(e)]};var hs=Gi(Un),ds=Gi((function(e,t){return e<=t}));function ps(e){if(!e)return[];if(Ja(e))return us(e)?fr(e):Ti(e);if(ut&&e[ut])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[ut]());var t=go(e);return(t==E?or:t==O?cr:Vs)(e)}function ms(e){return e?(e=ys(e))===f||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function gs(e){var t=ms(e),r=t%1;return t==t?r?t-r:t:0}function vs(e){return e?cn(gs(e),0,p):0}function ys(e){if("number"==typeof e)return e;if(ls(e))return d;if(rs(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=rs(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(ie,"");var r=me.test(e);return r||ve.test(e)?ct(e.slice(2),r?2:8):pe.test(e)?d:+e}function bs(e){return Ci(e,Ms(e))}function ws(e){return null==e?"":li(e)}var _s=Ri((function(e,t){if(Io(t)||Ja(t))Ci(t,Rs(t),e);else for(var r in t)De.call(t,r)&&tn(e,r,t[r])})),Ss=Ri((function(e,t){Ci(t,Ms(t),e)})),Es=Ri((function(e,t,r,n){Ci(t,Ms(t),e,n)})),xs=Ri((function(e,t,r,n){Ci(t,Rs(t),e,n)})),Is=no(sn);var ks=Qn((function(e,t){e=Oe(e);var n=-1,i=t.length,o=i>2?t[2]:r;for(o&&_o(t[0],t[1],o)&&(i=1);++n<i;)for(var a=t[n],s=Ms(a),c=-1,u=s.length;++c<u;){var l=s[c],f=e[l];(f===r||Va(f,Me[l])&&!De.call(e,l))&&(e[l]=a[l])}return e})),Ps=Qn((function(e){return e.push(r,eo),Et(js,r,e)}));function Os(e,t,n){var i=null==e?r:xn(e,t);return i===r?n:i}function As(e,t){return null!=e&&vo(e,t,An)}var Ts=Vi((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=Fe.call(t)),e[t]=r}),rc(oc)),Cs=Vi((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=Fe.call(t)),De.call(e,t)?e[t].push(r):e[t]=[r]}),uo),Ns=Qn(Cn);function Rs(e){return Ja(e)?Xr(e):Dn(e)}function Ms(e){return Ja(e)?Xr(e,!0):Bn(e)}var Ls=Ri((function(e,t,r){zn(e,t,r)})),js=Ri((function(e,t,r,n){zn(e,t,r,n)})),Ds=no((function(e,t){var r={};if(null==e)return r;var n=!1;t=Ct(t,(function(t){return t=wi(t,e),n||(n=t.length>1),t})),Ci(e,oo(e),r),n&&(r=un(r,7,to));for(var i=t.length;i--;)hi(r,t[i]);return r}));var Bs=no((function(e,t){return null==e?{}:function(e,t){return $n(e,t,(function(t,r){return As(e,r)}))}(e,t)}));function Us(e,t){if(null==e)return{};var r=Ct(oo(e),(function(e){return[e]}));return t=uo(t),$n(e,r,(function(e,r){return t(e,r[0])}))}var Fs=Qi(Rs),Hs=Qi(Ms);function Vs(e){return null==e?[]:Wt(e,Rs(e))}var zs=Di((function(e,t,r){return t=t.toLowerCase(),e+(r?qs(t):t)}));function qs(e){return Ys(ws(e).toLowerCase())}function Ks(e){return(e=ws(e))&&e.replace(be,tr).replace(Qe,"")}var $s=Di((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})),Gs=Di((function(e,t,r){return e+(r?" ":"")+t.toLowerCase()})),Js=ji("toLowerCase");var Ws=Di((function(e,t,r){return e+(r?"_":"")+t.toLowerCase()}));var Xs=Di((function(e,t,r){return e+(r?" ":"")+Ys(t)}));var Qs=Di((function(e,t,r){return e+(r?" ":"")+t.toUpperCase()})),Ys=ji("toUpperCase");function Zs(e,t,n){return e=ws(e),(t=n?r:t)===r?function(e){return tt.test(e)}(e)?function(e){return e.match(Ze)||[]}(e):function(e){return e.match(le)||[]}(e):e.match(t)||[]}var ec=Qn((function(e,t){try{return Et(e,r,t)}catch(e){return Ya(e)?e:new Ie(e)}})),tc=no((function(e,t){return It(t,(function(t){t=Uo(t),an(e,t,Ca(e[t],e))})),e}));function rc(e){return function(){return e}}var nc=Fi(),ic=Fi(!0);function oc(e){return e}function ac(e){return jn("function"==typeof e?e:un(e,1))}var sc=Qn((function(e,t){return function(r){return Cn(r,e,t)}})),cc=Qn((function(e,t){return function(r){return Cn(e,r,t)}}));function uc(e,t,r){var n=Rs(t),i=En(t,n);null!=r||rs(t)&&(i.length||!n.length)||(r=t,t=e,e=this,i=En(t,Rs(t)));var o=!(rs(r)&&"chain"in r&&!r.chain),a=Za(e);return It(i,(function(r){var n=t[r];e[r]=n,a&&(e.prototype[r]=function(){var t=this.__chain__;if(o||t){var r=e(this.__wrapped__),i=r.__actions__=Ti(this.__actions__);return i.push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,Nt([this.value()],arguments))})})),e}function lc(){}var fc=qi(Ct),hc=qi(Pt),dc=qi(Lt);function pc(e){return So(e)?zt(Uo(e)):function(e){return function(t){return xn(t,e)}}(e)}var mc=$i(),gc=$i(!0);function vc(){return[]}function yc(){return!1}var bc=zi((function(e,t){return e+t}),0),wc=Wi("ceil"),_c=zi((function(e,t){return e/t}),1),Sc=Wi("floor");var Ec,xc=zi((function(e,t){return e*t}),1),Ic=Wi("round"),kc=zi((function(e,t){return e-t}),0);return Fr.after=function(e,t){if("function"!=typeof t)throw new Ce(n);return e=gs(e),function(){if(--e<1)return t.apply(this,arguments)}},Fr.ary=Aa,Fr.assign=_s,Fr.assignIn=Ss,Fr.assignInWith=Es,Fr.assignWith=xs,Fr.at=Is,Fr.before=Ta,Fr.bind=Ca,Fr.bindAll=tc,Fr.bindKey=Na,Fr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return $a(e)?e:[e]},Fr.chain=pa,Fr.chunk=function(e,t,n){t=(n?_o(e,t,n):t===r)?1:yr(gs(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var o=0,a=0,s=Ee(jt(i/t));o<i;)s[a++]=ii(e,o,o+=t);return s},Fr.compact=function(e){for(var t=-1,r=null==e?0:e.length,n=0,i=[];++t<r;){var o=e[t];o&&(i[n++]=o)}return i},Fr.concat=function(){var e=arguments.length;if(!e)return[];for(var t=Ee(e-1),r=arguments[0],n=e;n--;)t[n-1]=arguments[n];return Nt($a(r)?Ti(r):[r],yn(t,1))},Fr.cond=function(e){var t=null==e?0:e.length,r=uo();return e=t?Ct(e,(function(e){if("function"!=typeof e[1])throw new Ce(n);return[r(e[0]),e[1]]})):[],Qn((function(r){for(var n=-1;++n<t;){var i=e[n];if(Et(i[0],this,r))return Et(i[1],this,r)}}))},Fr.conforms=function(e){return function(e){var t=Rs(e);return function(r){return ln(r,e,t)}}(un(e,1))},Fr.constant=rc,Fr.countBy=va,Fr.create=function(e,t){var r=Hr(e);return null==t?r:on(r,t)},Fr.curry=function e(t,n,i){var o=Yi(t,8,r,r,r,r,r,n=i?r:n);return o.placeholder=e.placeholder,o},Fr.curryRight=function e(t,n,i){var o=Yi(t,a,r,r,r,r,r,n=i?r:n);return o.placeholder=e.placeholder,o},Fr.debounce=Ra,Fr.defaults=ks,Fr.defaultsDeep=Ps,Fr.defer=Ma,Fr.delay=La,Fr.difference=Vo,Fr.differenceBy=zo,Fr.differenceWith=qo,Fr.drop=function(e,t,n){var i=null==e?0:e.length;return i?ii(e,(t=n||t===r?1:gs(t))<0?0:t,i):[]},Fr.dropRight=function(e,t,n){var i=null==e?0:e.length;return i?ii(e,0,(t=i-(t=n||t===r?1:gs(t)))<0?0:t):[]},Fr.dropRightWhile=function(e,t){return e&&e.length?pi(e,uo(t,3),!0,!0):[]},Fr.dropWhile=function(e,t){return e&&e.length?pi(e,uo(t,3),!0):[]},Fr.fill=function(e,t,n,i){var o=null==e?0:e.length;return o?(n&&"number"!=typeof n&&_o(e,t,n)&&(n=0,i=o),function(e,t,n,i){var o=e.length;for((n=gs(n))<0&&(n=-n>o?0:o+n),(i=i===r||i>o?o:gs(i))<0&&(i+=o),i=n>i?0:vs(i);n<i;)e[n++]=t;return e}(e,t,n,i)):[]},Fr.filter=function(e,t){return($a(e)?Ot:vn)(e,uo(t,3))},Fr.flatMap=function(e,t){return yn(Ia(e,t),1)},Fr.flatMapDeep=function(e,t){return yn(Ia(e,t),f)},Fr.flatMapDepth=function(e,t,n){return n=n===r?1:gs(n),yn(Ia(e,t),n)},Fr.flatten=Go,Fr.flattenDeep=function(e){return(null==e?0:e.length)?yn(e,f):[]},Fr.flattenDepth=function(e,t){return(null==e?0:e.length)?yn(e,t=t===r?1:gs(t)):[]},Fr.flip=function(e){return Yi(e,512)},Fr.flow=nc,Fr.flowRight=ic,Fr.fromPairs=function(e){for(var t=-1,r=null==e?0:e.length,n={};++t<r;){var i=e[t];n[i[0]]=i[1]}return n},Fr.functions=function(e){return null==e?[]:En(e,Rs(e))},Fr.functionsIn=function(e){return null==e?[]:En(e,Ms(e))},Fr.groupBy=Sa,Fr.initial=function(e){return(null==e?0:e.length)?ii(e,0,-1):[]},Fr.intersection=Wo,Fr.intersectionBy=Xo,Fr.intersectionWith=Qo,Fr.invert=Ts,Fr.invertBy=Cs,Fr.invokeMap=Ea,Fr.iteratee=ac,Fr.keyBy=xa,Fr.keys=Rs,Fr.keysIn=Ms,Fr.map=Ia,Fr.mapKeys=function(e,t){var r={};return t=uo(t,3),_n(e,(function(e,n,i){an(r,t(e,n,i),e)})),r},Fr.mapValues=function(e,t){var r={};return t=uo(t,3),_n(e,(function(e,n,i){an(r,n,t(e,n,i))})),r},Fr.matches=function(e){return Hn(un(e,1))},Fr.matchesProperty=function(e,t){return Vn(e,un(t,1))},Fr.memoize=ja,Fr.merge=Ls,Fr.mergeWith=js,Fr.method=sc,Fr.methodOf=cc,Fr.mixin=uc,Fr.negate=Da,Fr.nthArg=function(e){return e=gs(e),Qn((function(t){return qn(t,e)}))},Fr.omit=Ds,Fr.omitBy=function(e,t){return Us(e,Da(uo(t)))},Fr.once=function(e){return Ta(2,e)},Fr.orderBy=function(e,t,n,i){return null==e?[]:($a(t)||(t=null==t?[]:[t]),$a(n=i?r:n)||(n=null==n?[]:[n]),Kn(e,t,n))},Fr.over=fc,Fr.overArgs=Ba,Fr.overEvery=hc,Fr.overSome=dc,Fr.partial=Ua,Fr.partialRight=Fa,Fr.partition=ka,Fr.pick=Bs,Fr.pickBy=Us,Fr.property=pc,Fr.propertyOf=function(e){return function(t){return null==e?r:xn(e,t)}},Fr.pull=Zo,Fr.pullAll=ea,Fr.pullAllBy=function(e,t,r){return e&&e.length&&t&&t.length?Gn(e,t,uo(r,2)):e},Fr.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Gn(e,t,r,n):e},Fr.pullAt=ta,Fr.range=mc,Fr.rangeRight=gc,Fr.rearg=Ha,Fr.reject=function(e,t){return($a(e)?Ot:vn)(e,Da(uo(t,3)))},Fr.remove=function(e,t){var r=[];if(!e||!e.length)return r;var n=-1,i=[],o=e.length;for(t=uo(t,3);++n<o;){var a=e[n];t(a,n,e)&&(r.push(a),i.push(n))}return Jn(e,i),r},Fr.rest=function(e,t){if("function"!=typeof e)throw new Ce(n);return Qn(e,t=t===r?t:gs(t))},Fr.reverse=ra,Fr.sampleSize=function(e,t,n){return t=(n?_o(e,t,n):t===r)?1:gs(t),($a(e)?Yr:Zn)(e,t)},Fr.set=function(e,t,r){return null==e?e:ei(e,t,r)},Fr.setWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:ei(e,t,n,i)},Fr.shuffle=function(e){return($a(e)?Zr:ni)(e)},Fr.slice=function(e,t,n){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&_o(e,t,n)?(t=0,n=i):(t=null==t?0:gs(t),n=n===r?i:gs(n)),ii(e,t,n)):[]},Fr.sortBy=Pa,Fr.sortedUniq=function(e){return e&&e.length?ci(e):[]},Fr.sortedUniqBy=function(e,t){return e&&e.length?ci(e,uo(t,2)):[]},Fr.split=function(e,t,n){return n&&"number"!=typeof n&&_o(e,t,n)&&(t=n=r),(n=n===r?p:n>>>0)?(e=ws(e))&&("string"==typeof t||null!=t&&!ss(t))&&!(t=li(t))&&ir(e)?Si(fr(e),0,n):e.split(t,n):[]},Fr.spread=function(e,t){if("function"!=typeof e)throw new Ce(n);return t=null==t?0:yr(gs(t),0),Qn((function(r){var n=r[t],i=Si(r,0,t);return n&&Nt(i,n),Et(e,this,i)}))},Fr.tail=function(e){var t=null==e?0:e.length;return t?ii(e,1,t):[]},Fr.take=function(e,t,n){return e&&e.length?ii(e,0,(t=n||t===r?1:gs(t))<0?0:t):[]},Fr.takeRight=function(e,t,n){var i=null==e?0:e.length;return i?ii(e,(t=i-(t=n||t===r?1:gs(t)))<0?0:t,i):[]},Fr.takeRightWhile=function(e,t){return e&&e.length?pi(e,uo(t,3),!1,!0):[]},Fr.takeWhile=function(e,t){return e&&e.length?pi(e,uo(t,3)):[]},Fr.tap=function(e,t){return t(e),e},Fr.throttle=function(e,t,r){var i=!0,o=!0;if("function"!=typeof e)throw new Ce(n);return rs(r)&&(i="leading"in r?!!r.leading:i,o="trailing"in r?!!r.trailing:o),Ra(e,t,{leading:i,maxWait:t,trailing:o})},Fr.thru=ma,Fr.toArray=ps,Fr.toPairs=Fs,Fr.toPairsIn=Hs,Fr.toPath=function(e){return $a(e)?Ct(e,Uo):ls(e)?[e]:Ti(Bo(ws(e)))},Fr.toPlainObject=bs,Fr.transform=function(e,t,r){var n=$a(e),i=n||Xa(e)||fs(e);if(t=uo(t,4),null==r){var o=e&&e.constructor;r=i?n?new o:[]:rs(e)&&Za(o)?Hr(Je(e)):{}}return(i?It:_n)(e,(function(e,n,i){return t(r,e,n,i)})),r},Fr.unary=function(e){return Aa(e,1)},Fr.union=na,Fr.unionBy=ia,Fr.unionWith=oa,Fr.uniq=function(e){return e&&e.length?fi(e):[]},Fr.uniqBy=function(e,t){return e&&e.length?fi(e,uo(t,2)):[]},Fr.uniqWith=function(e,t){return t="function"==typeof t?t:r,e&&e.length?fi(e,r,t):[]},Fr.unset=function(e,t){return null==e||hi(e,t)},Fr.unzip=aa,Fr.unzipWith=sa,Fr.update=function(e,t,r){return null==e?e:di(e,t,bi(r))},Fr.updateWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:di(e,t,bi(n),i)},Fr.values=Vs,Fr.valuesIn=function(e){return null==e?[]:Wt(e,Ms(e))},Fr.without=ca,Fr.words=Zs,Fr.wrap=function(e,t){return Ua(bi(t),e)},Fr.xor=ua,Fr.xorBy=la,Fr.xorWith=fa,Fr.zip=ha,Fr.zipObject=function(e,t){return vi(e||[],t||[],tn)},Fr.zipObjectDeep=function(e,t){return vi(e||[],t||[],ei)},Fr.zipWith=da,Fr.entries=Fs,Fr.entriesIn=Hs,Fr.extend=Ss,Fr.extendWith=Es,uc(Fr,Fr),Fr.add=bc,Fr.attempt=ec,Fr.camelCase=zs,Fr.capitalize=qs,Fr.ceil=wc,Fr.clamp=function(e,t,n){return n===r&&(n=t,t=r),n!==r&&(n=(n=ys(n))==n?n:0),t!==r&&(t=(t=ys(t))==t?t:0),cn(ys(e),t,n)},Fr.clone=function(e){return un(e,4)},Fr.cloneDeep=function(e){return un(e,5)},Fr.cloneDeepWith=function(e,t){return un(e,5,t="function"==typeof t?t:r)},Fr.cloneWith=function(e,t){return un(e,4,t="function"==typeof t?t:r)},Fr.conformsTo=function(e,t){return null==t||ln(e,t,Rs(t))},Fr.deburr=Ks,Fr.defaultTo=function(e,t){return null==e||e!=e?t:e},Fr.divide=_c,Fr.endsWith=function(e,t,n){e=ws(e),t=li(t);var i=e.length,o=n=n===r?i:cn(gs(n),0,i);return(n-=t.length)>=0&&e.slice(n,o)==t},Fr.eq=Va,Fr.escape=function(e){return(e=ws(e))&&W.test(e)?e.replace(G,rr):e},Fr.escapeRegExp=function(e){return(e=ws(e))&&ne.test(e)?e.replace(re,"\\$&"):e},Fr.every=function(e,t,n){var i=$a(e)?Pt:mn;return n&&_o(e,t,n)&&(t=r),i(e,uo(t,3))},Fr.find=ya,Fr.findIndex=Ko,Fr.findKey=function(e,t){return Dt(e,uo(t,3),_n)},Fr.findLast=ba,Fr.findLastIndex=$o,Fr.findLastKey=function(e,t){return Dt(e,uo(t,3),Sn)},Fr.floor=Sc,Fr.forEach=wa,Fr.forEachRight=_a,Fr.forIn=function(e,t){return null==e?e:bn(e,uo(t,3),Ms)},Fr.forInRight=function(e,t){return null==e?e:wn(e,uo(t,3),Ms)},Fr.forOwn=function(e,t){return e&&_n(e,uo(t,3))},Fr.forOwnRight=function(e,t){return e&&Sn(e,uo(t,3))},Fr.get=Os,Fr.gt=za,Fr.gte=qa,Fr.has=function(e,t){return null!=e&&vo(e,t,On)},Fr.hasIn=As,Fr.head=Jo,Fr.identity=oc,Fr.includes=function(e,t,r,n){e=Ja(e)?e:Vs(e),r=r&&!n?gs(r):0;var i=e.length;return r<0&&(r=yr(i+r,0)),us(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&Ut(e,t,r)>-1},Fr.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:gs(r);return i<0&&(i=yr(n+i,0)),Ut(e,t,i)},Fr.inRange=function(e,t,n){return t=ms(t),n===r?(n=t,t=0):n=ms(n),function(e,t,r){return e>=br(t,r)&&e<yr(t,r)}(e=ys(e),t,n)},Fr.invoke=Ns,Fr.isArguments=Ka,Fr.isArray=$a,Fr.isArrayBuffer=Ga,Fr.isArrayLike=Ja,Fr.isArrayLikeObject=Wa,Fr.isBoolean=function(e){return!0===e||!1===e||ns(e)&&kn(e)==y},Fr.isBuffer=Xa,Fr.isDate=Qa,Fr.isElement=function(e){return ns(e)&&1===e.nodeType&&!as(e)},Fr.isEmpty=function(e){if(null==e)return!0;if(Ja(e)&&($a(e)||"string"==typeof e||"function"==typeof e.splice||Xa(e)||fs(e)||Ka(e)))return!e.length;var t=go(e);if(t==E||t==O)return!e.size;if(Io(e))return!Dn(e).length;for(var r in e)if(De.call(e,r))return!1;return!0},Fr.isEqual=function(e,t){return Rn(e,t)},Fr.isEqualWith=function(e,t,n){var i=(n="function"==typeof n?n:r)?n(e,t):r;return i===r?Rn(e,t,r,n):!!i},Fr.isError=Ya,Fr.isFinite=function(e){return"number"==typeof e&&mr(e)},Fr.isFunction=Za,Fr.isInteger=es,Fr.isLength=ts,Fr.isMap=is,Fr.isMatch=function(e,t){return e===t||Mn(e,t,fo(t))},Fr.isMatchWith=function(e,t,n){return n="function"==typeof n?n:r,Mn(e,t,fo(t),n)},Fr.isNaN=function(e){return os(e)&&e!=+e},Fr.isNative=function(e){if(xo(e))throw new Ie("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Ln(e)},Fr.isNil=function(e){return null==e},Fr.isNull=function(e){return null===e},Fr.isNumber=os,Fr.isObject=rs,Fr.isObjectLike=ns,Fr.isPlainObject=as,Fr.isRegExp=ss,Fr.isSafeInteger=function(e){return es(e)&&e>=-9007199254740991&&e<=h},Fr.isSet=cs,Fr.isString=us,Fr.isSymbol=ls,Fr.isTypedArray=fs,Fr.isUndefined=function(e){return e===r},Fr.isWeakMap=function(e){return ns(e)&&go(e)==C},Fr.isWeakSet=function(e){return ns(e)&&"[object WeakSet]"==kn(e)},Fr.join=function(e,t){return null==e?"":gr.call(e,t)},Fr.kebabCase=$s,Fr.last=Yo,Fr.lastIndexOf=function(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var o=i;return n!==r&&(o=(o=gs(n))<0?yr(i+o,0):br(o,i-1)),t==t?function(e,t,r){for(var n=r+1;n--;)if(e[n]===t)return n;return n}(e,t,o):Bt(e,Ht,o,!0)},Fr.lowerCase=Gs,Fr.lowerFirst=Js,Fr.lt=hs,Fr.lte=ds,Fr.max=function(e){return e&&e.length?gn(e,oc,Pn):r},Fr.maxBy=function(e,t){return e&&e.length?gn(e,uo(t,2),Pn):r},Fr.mean=function(e){return Vt(e,oc)},Fr.meanBy=function(e,t){return Vt(e,uo(t,2))},Fr.min=function(e){return e&&e.length?gn(e,oc,Un):r},Fr.minBy=function(e,t){return e&&e.length?gn(e,uo(t,2),Un):r},Fr.stubArray=vc,Fr.stubFalse=yc,Fr.stubObject=function(){return{}},Fr.stubString=function(){return""},Fr.stubTrue=function(){return!0},Fr.multiply=xc,Fr.nth=function(e,t){return e&&e.length?qn(e,gs(t)):r},Fr.noConflict=function(){return ft._===this&&(ft._=Ve),this},Fr.noop=lc,Fr.now=Oa,Fr.pad=function(e,t,r){e=ws(e);var n=(t=gs(t))?lr(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return Ki(qt(i),r)+e+Ki(jt(i),r)},Fr.padEnd=function(e,t,r){e=ws(e);var n=(t=gs(t))?lr(e):0;return t&&n<t?e+Ki(t-n,r):e},Fr.padStart=function(e,t,r){e=ws(e);var n=(t=gs(t))?lr(e):0;return t&&n<t?Ki(t-n,r)+e:e},Fr.parseInt=function(e,t,r){return r||null==t?t=0:t&&(t=+t),_r(ws(e).replace(oe,""),t||0)},Fr.random=function(e,t,n){if(n&&"boolean"!=typeof n&&_o(e,t,n)&&(t=n=r),n===r&&("boolean"==typeof t?(n=t,t=r):"boolean"==typeof e&&(n=e,e=r)),e===r&&t===r?(e=0,t=1):(e=ms(e),t===r?(t=e,e=0):t=ms(t)),e>t){var i=e;e=t,t=i}if(n||e%1||t%1){var o=Sr();return br(e+o*(t-e+st("1e-"+((o+"").length-1))),t)}return Wn(e,t)},Fr.reduce=function(e,t,r){var n=$a(e)?Rt:Kt,i=arguments.length<3;return n(e,uo(t,4),r,i,dn)},Fr.reduceRight=function(e,t,r){var n=$a(e)?Mt:Kt,i=arguments.length<3;return n(e,uo(t,4),r,i,pn)},Fr.repeat=function(e,t,n){return t=(n?_o(e,t,n):t===r)?1:gs(t),Xn(ws(e),t)},Fr.replace=function(){var e=arguments,t=ws(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Fr.result=function(e,t,n){var i=-1,o=(t=wi(t,e)).length;for(o||(o=1,e=r);++i<o;){var a=null==e?r:e[Uo(t[i])];a===r&&(i=o,a=n),e=Za(a)?a.call(e):a}return e},Fr.round=Ic,Fr.runInContext=e,Fr.sample=function(e){return($a(e)?Qr:Yn)(e)},Fr.size=function(e){if(null==e)return 0;if(Ja(e))return us(e)?lr(e):e.length;var t=go(e);return t==E||t==O?e.size:Dn(e).length},Fr.snakeCase=Ws,Fr.some=function(e,t,n){var i=$a(e)?Lt:oi;return n&&_o(e,t,n)&&(t=r),i(e,uo(t,3))},Fr.sortedIndex=function(e,t){return ai(e,t)},Fr.sortedIndexBy=function(e,t,r){return si(e,t,uo(r,2))},Fr.sortedIndexOf=function(e,t){var r=null==e?0:e.length;if(r){var n=ai(e,t);if(n<r&&Va(e[n],t))return n}return-1},Fr.sortedLastIndex=function(e,t){return ai(e,t,!0)},Fr.sortedLastIndexBy=function(e,t,r){return si(e,t,uo(r,2),!0)},Fr.sortedLastIndexOf=function(e,t){if(null==e?0:e.length){var r=ai(e,t,!0)-1;if(Va(e[r],t))return r}return-1},Fr.startCase=Xs,Fr.startsWith=function(e,t,r){return e=ws(e),r=null==r?0:cn(gs(r),0,e.length),t=li(t),e.slice(r,r+t.length)==t},Fr.subtract=kc,Fr.sum=function(e){return e&&e.length?$t(e,oc):0},Fr.sumBy=function(e,t){return e&&e.length?$t(e,uo(t,2)):0},Fr.template=function(e,t,n){var i=Fr.templateSettings;n&&_o(e,t,n)&&(t=r),e=ws(e),t=Es({},t,i,Zi);var o,a,s=Es({},t.imports,i.imports,Zi),c=Rs(s),u=Wt(s,c),l=0,f=t.interpolate||we,h="__p += '",d=Ae((t.escape||we).source+"|"+f.source+"|"+(f===Y?he:we).source+"|"+(t.evaluate||we).source+"|$","g"),p="//# sourceURL="+(De.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++nt+"]")+"\n";e.replace(d,(function(t,r,n,i,s,c){return n||(n=i),h+=e.slice(l,c).replace(_e,nr),r&&(o=!0,h+="' +\n__e("+r+") +\n'"),s&&(a=!0,h+="';\n"+s+";\n__p += '"),n&&(h+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),l=c+t.length,t})),h+="';\n";var m=De.call(t,"variable")&&t.variable;m||(h="with (obj) {\n"+h+"\n}\n"),h=(a?h.replace(z,""):h).replace(q,"$1").replace(K,"$1;"),h="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var g=ec((function(){return ke(c,p+"return "+h).apply(r,u)}));if(g.source=h,Ya(g))throw g;return g},Fr.times=function(e,t){if((e=gs(e))<1||e>h)return[];var r=p,n=br(e,p);t=uo(t),e-=p;for(var i=Gt(n,t);++r<e;)t(r);return i},Fr.toFinite=ms,Fr.toInteger=gs,Fr.toLength=vs,Fr.toLower=function(e){return ws(e).toLowerCase()},Fr.toNumber=ys,Fr.toSafeInteger=function(e){return e?cn(gs(e),-9007199254740991,h):0===e?e:0},Fr.toString=ws,Fr.toUpper=function(e){return ws(e).toUpperCase()},Fr.trim=function(e,t,n){if((e=ws(e))&&(n||t===r))return e.replace(ie,"");if(!e||!(t=li(t)))return e;var i=fr(e),o=fr(t);return Si(i,Qt(i,o),Yt(i,o)+1).join("")},Fr.trimEnd=function(e,t,n){if((e=ws(e))&&(n||t===r))return e.replace(ae,"");if(!e||!(t=li(t)))return e;var i=fr(e);return Si(i,0,Yt(i,fr(t))+1).join("")},Fr.trimStart=function(e,t,n){if((e=ws(e))&&(n||t===r))return e.replace(oe,"");if(!e||!(t=li(t)))return e;var i=fr(e);return Si(i,Qt(i,fr(t))).join("")},Fr.truncate=function(e,t){var n=30,i="...";if(rs(t)){var o="separator"in t?t.separator:o;n="length"in t?gs(t.length):n,i="omission"in t?li(t.omission):i}var a=(e=ws(e)).length;if(ir(e)){var s=fr(e);a=s.length}if(n>=a)return e;var c=n-lr(i);if(c<1)return i;var u=s?Si(s,0,c).join(""):e.slice(0,c);if(o===r)return u+i;if(s&&(c+=u.length-c),ss(o)){if(e.slice(c).search(o)){var l,f=u;for(o.global||(o=Ae(o.source,ws(de.exec(o))+"g")),o.lastIndex=0;l=o.exec(f);)var h=l.index;u=u.slice(0,h===r?c:h)}}else if(e.indexOf(li(o),c)!=c){var d=u.lastIndexOf(o);d>-1&&(u=u.slice(0,d))}return u+i},Fr.unescape=function(e){return(e=ws(e))&&J.test(e)?e.replace($,hr):e},Fr.uniqueId=function(e){var t=++Be;return ws(e)+t},Fr.upperCase=Qs,Fr.upperFirst=Ys,Fr.each=wa,Fr.eachRight=_a,Fr.first=Jo,uc(Fr,(Ec={},_n(Fr,(function(e,t){De.call(Fr.prototype,t)||(Ec[t]=e)})),Ec),{chain:!1}),Fr.VERSION="4.17.20",It(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Fr[e].placeholder=Fr})),It(["drop","take"],(function(e,t){qr.prototype[e]=function(n){n=n===r?1:yr(gs(n),0);var i=this.__filtered__&&!t?new qr(this):this.clone();return i.__filtered__?i.__takeCount__=br(n,i.__takeCount__):i.__views__.push({size:br(n,p),type:e+(i.__dir__<0?"Right":"")}),i},qr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),It(["filter","map","takeWhile"],(function(e,t){var r=t+1,n=1==r||3==r;qr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:uo(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}})),It(["head","last"],(function(e,t){var r="take"+(t?"Right":"");qr.prototype[e]=function(){return this[r](1).value()[0]}})),It(["initial","tail"],(function(e,t){var r="drop"+(t?"":"Right");qr.prototype[e]=function(){return this.__filtered__?new qr(this):this[r](1)}})),qr.prototype.compact=function(){return this.filter(oc)},qr.prototype.find=function(e){return this.filter(e).head()},qr.prototype.findLast=function(e){return this.reverse().find(e)},qr.prototype.invokeMap=Qn((function(e,t){return"function"==typeof e?new qr(this):this.map((function(r){return Cn(r,e,t)}))})),qr.prototype.reject=function(e){return this.filter(Da(uo(e)))},qr.prototype.slice=function(e,t){e=gs(e);var n=this;return n.__filtered__&&(e>0||t<0)?new qr(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==r&&(n=(t=gs(t))<0?n.dropRight(-t):n.take(t-e)),n)},qr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},qr.prototype.toArray=function(){return this.take(p)},_n(qr.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),o=Fr[i?"take"+("last"==t?"Right":""):t],a=i||/^find/.test(t);o&&(Fr.prototype[t]=function(){var t=this.__wrapped__,s=i?[1]:arguments,c=t instanceof qr,u=s[0],l=c||$a(t),f=function(e){var t=o.apply(Fr,Nt([e],s));return i&&h?t[0]:t};l&&n&&"function"==typeof u&&1!=u.length&&(c=l=!1);var h=this.__chain__,d=!!this.__actions__.length,p=a&&!h,m=c&&!d;if(!a&&l){t=m?t:new qr(this);var g=e.apply(t,s);return g.__actions__.push({func:ma,args:[f],thisArg:r}),new zr(g,h)}return p&&m?e.apply(this,s):(g=this.thru(f),p?i?g.value()[0]:g.value():g)})})),It(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Ne[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);Fr.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply($a(i)?i:[],e)}return this[r]((function(r){return t.apply($a(r)?r:[],e)}))}})),_n(qr.prototype,(function(e,t){var r=Fr[t];if(r){var n=r.name+"";De.call(Cr,n)||(Cr[n]=[]),Cr[n].push({name:t,func:r})}})),Cr[Hi(r,2).name]=[{name:"wrapper",func:r}],qr.prototype.clone=function(){var e=new qr(this.__wrapped__);return e.__actions__=Ti(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ti(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ti(this.__views__),e},qr.prototype.reverse=function(){if(this.__filtered__){var e=new qr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},qr.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=$a(e),n=t<0,i=r?e.length:0,o=function(e,t,r){var n=-1,i=r.length;for(;++n<i;){var o=r[n],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=br(t,e+a);break;case"takeRight":e=yr(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=o.start,s=o.end,c=s-a,u=n?s:a-1,l=this.__iteratees__,f=l.length,h=0,d=br(c,this.__takeCount__);if(!r||!n&&i==c&&d==c)return mi(e,this.__actions__);var p=[];e:for(;c--&&h<d;){for(var m=-1,g=e[u+=t];++m<f;){var v=l[m],y=v.iteratee,b=v.type,w=y(g);if(2==b)g=w;else if(!w){if(1==b)continue e;break e}}p[h++]=g}return p},Fr.prototype.at=ga,Fr.prototype.chain=function(){return pa(this)},Fr.prototype.commit=function(){return new zr(this.value(),this.__chain__)},Fr.prototype.next=function(){this.__values__===r&&(this.__values__=ps(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?r:this.__values__[this.__index__++]}},Fr.prototype.plant=function(e){for(var t,n=this;n instanceof Vr;){var i=Ho(n);i.__index__=0,i.__values__=r,t?o.__wrapped__=i:t=i;var o=i;n=n.__wrapped__}return o.__wrapped__=e,t},Fr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof qr){var t=e;return this.__actions__.length&&(t=new qr(this)),(t=t.reverse()).__actions__.push({func:ma,args:[ra],thisArg:r}),new zr(t,this.__chain__)}return this.thru(ra)},Fr.prototype.toJSON=Fr.prototype.valueOf=Fr.prototype.value=function(){return mi(this.__wrapped__,this.__actions__)},Fr.prototype.first=Fr.prototype.head,ut&&(Fr.prototype[ut]=function(){return this}),Fr}();dt?((dt.exports=dr)._=dr,ht._=dr):ft._=dr}).call(Zt)})));const{validate:Ic}=Va;var kc=class{constructor(e){if(!Ic(e))throw new Error("JSON is invalid. Cannot construct Encoder.");this.json=e}constructRootMap(){return Object.keys(this.json).map(e=>{let t=this.json[e];return"string"==typeof t&&(t=uc.encode(re.from(t,"hex"))),t instanceof Array&&("anchors"===e&&(t=this.constructAnchorsMap(t)),"path"===e&&(t=this.constructPathMap(t))),[za.root[e],t]})}constructAnchorsMap(e){return e.map(e=>{let t=e.split(":");return t.shift(),t.map((e,r)=>0===r?[r,za.chain[e].id]:1===r?[r,za.chain[t[r-1]].networks[e]]:[r,uc.encode(re.from(e,"hex"))])})}constructPathMap(e){return xc.flatten(e.map(e=>Object.keys(e).map(t=>[za.path[t],uc.encode(re.from(e[t],"hex"))])))}encode(){const e=this.constructRootMap(),t=uc.encode(e);return Ec.encode("base58btc",t)}};var Pc={Encoder:kc,Decoder:class{constructor(e){if(!Ec.isEncoded(e))throw new Error("Base58 string is invalid. Cannot construct Decoder.");this.base58=e}constructRootJSON(e){const t=xc.invert(za.root);return e.reduce((e,r)=>{const n=t[r[0]];let i=r[1];return i instanceof Array&&("anchors"===n&&(i=this.constructAnchorsJSON(i)),"path"===n&&(i=this.constructPathJSON(i))),i instanceof re&&(i=uc.decode(i).toString("hex")),e[n]=i,e},{})}constructAnchorsJSON(e){const t=xc.invertBy(za.chain,e=>e.id);return e.map(e=>e.reduce((e,r)=>{if(0===r[0])return`${e}:${t[r[1]]}`;if(1===r[0]){const t=e.split(":").pop();return`${e}:${xc.invert(za.chain[t].networks)[r[1]]}`}return`${e}:${uc.decode(r[1]).toString("hex")}`},"blink"))}constructPathJSON(e){const t=xc.invert(za.path);return e.map(e=>({[t[e[0]]]:uc.decode(e[1]).toString("hex")}))}decode(){const e=Ec.decode(this.base58),t=uc.decode(e);return this.constructRootJSON(t)}},Keymap:za}.Decoder;function Oc(e){const{credentialSubject:t}=e;return t.name}function Ac(e,t){const r=[];switch(t){case o.V1_1:case o.V1_2:if(e.constructor===Array)for(const t in e){const n=e[t],i="jobTitle"in n?n.jobTitle:null,o="name"in n?n.name:null,a=new R(n.image,i,o);r.push(a)}else{const t=new R(e,null,null);r.push(t)}break;case o.V2_0:for(const t in e){const n=e[t],i=new R(n.image,n.jobTitle,n.name);r.push(i)}}return r}const Tc={1:function(e){const t=e.certificate||e.document.certificate,r=e.recipient||e.document.recipient,n=e.document.assertion,i=e.receipt,a=void 0===i?o.V1_1:o.V1_2;let{image:s,description:c,issuer:u,subtitle:l}=t;const f=r.publicKey,h=wi.certificates.getChain(f),d=n.expires,p=n.uid,m=n.issuedOn,g=n.metadataJson,v=`${r.givenName} ${r.familyName}`,y=n.id,b=r.revocationKey||null,w=u.image,_=e.document.signature,S=Ac(e.document&&e.document.assertion&&e.document.assertion["image:signature"],a);return"object"==typeof l&&(l=l.display?l.content:""),{certificateImage:s,chain:h,description:c,expires:d,id:p,issuedOn:m,issuer:u,metadataJson:g,name:t.title||t.name,publicKey:f,receipt:i,recipientFullName:v,recordLink:y,revocationKey:b,sealImage:w,signature:_,signatureImage:S,subtitle:l,version:a}},2:function(e){const{id:t,expires:r,signature:n,badge:i}=e,{image:a,name:s,description:c,subtitle:u,issuer:l}=i,f=e.verification.publicKey||e.verification.creator,h=e.recipientProfile||e.recipient.recipientProfile,d=o.V2_0;return{certificateImage:a,chain:wi.certificates.getChain(f,e.signature),description:c,expires:r,id:t,issuedOn:e.issuedOn,issuer:l,metadataJson:e.metadataJson,name:s,publicKey:h.publicKey,receipt:n,recipientFullName:h.name,recordLink:t,revocationKey:null,sealImage:l.image,signature:null,signatureImage:Ac(i.signatureLines,d),subtitle:u,version:d}},3:function(t){return e(this,void 0,void 0,(function*(){const r=function(e){return new Pc(e.proofValue).decode()}(t.proof),{issuer:n,metadataJson:i,issuanceDate:a,id:s,expirationDate:c}=t,u=yield function(t){return e(this,void 0,void 0,(function*(){return yield wi.verifier.getIssuerProfile(t)}))}(n);return{chain:wi.certificates.getChain("",r),expires:c,issuedOn:a,id:s,issuer:u,metadataJson:i,receipt:r,recipientFullName:Oc(t),recordLink:s,version:o.V3_0_alpha}}))}};function Cc(t){return e(this,void 0,void 0,(function*(){try{const e=function(e){"string"==typeof e&&(e=[e]);const t=e.filter(e=>"string"==typeof e).find(e=>e.toLowerCase().indexOf("blockcerts")>0).split("/").filter(e=>""!==e),r=Object.keys(Tc);return parseInt(r.filter(e=>function(e,t){return e.some(e=>e.includes("v"+t)||e.includes(t+"."))}(t,e.toString()))[0],10)}(t["@context"]),r=yield Tc[e](t);return r.isFormatValid=!0,r}catch(e){return{isFormatValid:!1,error:e}}}))}var Nc=tr((function(e,t){var r;t=e.exports=$,r="object"==typeof ft&&ft.env&&ft.env.NODE_DEBUG&&/\bsemver\b/i.test(ft.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:function(){},t.SEMVER_SPEC_VERSION="2.0.0";var n=Number.MAX_SAFE_INTEGER||9007199254740991,i=t.re=[],o=t.src=[],a=0,s=a++;o[s]="0|[1-9]\\d*";var c=a++;o[c]="[0-9]+";var u=a++;o[u]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var l=a++;o[l]="("+o[s]+")\\.("+o[s]+")\\.("+o[s]+")";var f=a++;o[f]="("+o[c]+")\\.("+o[c]+")\\.("+o[c]+")";var h=a++;o[h]="(?:"+o[s]+"|"+o[u]+")";var d=a++;o[d]="(?:"+o[c]+"|"+o[u]+")";var p=a++;o[p]="(?:-("+o[h]+"(?:\\."+o[h]+")*))";var m=a++;o[m]="(?:-?("+o[d]+"(?:\\."+o[d]+")*))";var g=a++;o[g]="[0-9A-Za-z-]+";var v=a++;o[v]="(?:\\+("+o[g]+"(?:\\."+o[g]+")*))";var y=a++,b="v?"+o[l]+o[p]+"?"+o[v]+"?";o[y]="^"+b+"$";var w="[v=\\s]*"+o[f]+o[m]+"?"+o[v]+"?",_=a++;o[_]="^"+w+"$";var S=a++;o[S]="((?:<|>)?=?)";var E=a++;o[E]=o[c]+"|x|X|\\*";var x=a++;o[x]=o[s]+"|x|X|\\*";var I=a++;o[I]="[v=\\s]*("+o[x]+")(?:\\.("+o[x]+")(?:\\.("+o[x]+")(?:"+o[p]+")?"+o[v]+"?)?)?";var k=a++;o[k]="[v=\\s]*("+o[E]+")(?:\\.("+o[E]+")(?:\\.("+o[E]+")(?:"+o[m]+")?"+o[v]+"?)?)?";var P=a++;o[P]="^"+o[S]+"\\s*"+o[I]+"$";var O=a++;o[O]="^"+o[S]+"\\s*"+o[k]+"$";var A=a++;o[A]="(?:^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])";var T=a++;o[T]="(?:~>?)";var C=a++;o[C]="(\\s*)"+o[T]+"\\s+",i[C]=new RegExp(o[C],"g");var N=a++;o[N]="^"+o[T]+o[I]+"$";var R=a++;o[R]="^"+o[T]+o[k]+"$";var M=a++;o[M]="(?:\\^)";var L=a++;o[L]="(\\s*)"+o[M]+"\\s+",i[L]=new RegExp(o[L],"g");var j=a++;o[j]="^"+o[M]+o[I]+"$";var D=a++;o[D]="^"+o[M]+o[k]+"$";var B=a++;o[B]="^"+o[S]+"\\s*("+w+")$|^$";var U=a++;o[U]="^"+o[S]+"\\s*("+b+")$|^$";var F=a++;o[F]="(\\s*)"+o[S]+"\\s*("+w+"|"+o[I]+")",i[F]=new RegExp(o[F],"g");var H=a++;o[H]="^\\s*("+o[I]+")\\s+-\\s+("+o[I]+")\\s*$";var V=a++;o[V]="^\\s*("+o[k]+")\\s+-\\s+("+o[k]+")\\s*$";var z=a++;o[z]="(<|>)?=?\\s*\\*";for(var q=0;q<35;q++)r(q,o[q]),i[q]||(i[q]=new RegExp(o[q]));function K(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof $)return e;if("string"!=typeof e)return null;if(e.length>256)return null;if(!(t.loose?i[_]:i[y]).test(e))return null;try{return new $(e,t)}catch(e){return null}}function $(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof $){if(e.loose===t.loose)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>256)throw new TypeError("version is longer than 256 characters");if(!(this instanceof $))return new $(e,t);r("SemVer",e,t),this.options=t,this.loose=!!t.loose;var o=e.trim().match(t.loose?i[_]:i[y]);if(!o)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+o[1],this.minor=+o[2],this.patch=+o[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");o[4]?this.prerelease=o[4].split(".").map((function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t<n)return t}return e})):this.prerelease=[],this.build=o[5]?o[5].split("."):[],this.format()}t.parse=K,t.valid=function(e,t){var r=K(e,t);return r?r.version:null},t.clean=function(e,t){var r=K(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null},t.SemVer=$,$.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},$.prototype.toString=function(){return this.version},$.prototype.compare=function(e){return r("SemVer.compare",this.version,this.options,e),e instanceof $||(e=new $(e,this.options)),this.compareMain(e)||this.comparePre(e)},$.prototype.compareMain=function(e){return e instanceof $||(e=new $(e,this.options)),J(this.major,e.major)||J(this.minor,e.minor)||J(this.patch,e.patch)},$.prototype.comparePre=function(e){if(e instanceof $||(e=new $(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;var t=0;do{var n=this.prerelease[t],i=e.prerelease[t];if(r("prerelease compare",t,n,i),void 0===n&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===n)return-1;if(n!==i)return J(n,i)}while(++t)},$.prototype.inc=function(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t),this.inc("pre",t);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{for(var r=this.prerelease.length;--r>=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);-1===r&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this},t.inc=function(e,t,r,n){"string"==typeof r&&(n=r,r=void 0);try{return new $(e,r).inc(t,n).version}catch(e){return null}},t.diff=function(e,t){if(Y(e,t))return null;var r=K(e),n=K(t),i="";if(r.prerelease.length||n.prerelease.length){i="pre";var o="prerelease"}for(var a in r)if(("major"===a||"minor"===a||"patch"===a)&&r[a]!==n[a])return i+a;return o},t.compareIdentifiers=J;var G=/^[0-9]+$/;function J(e,t){var r=G.test(e),n=G.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1}function W(e,t,r){return new $(e,r).compare(new $(t,r))}function X(e,t,r){return W(e,t,r)>0}function Q(e,t,r){return W(e,t,r)<0}function Y(e,t,r){return 0===W(e,t,r)}function Z(e,t,r){return 0!==W(e,t,r)}function ee(e,t,r){return W(e,t,r)>=0}function te(e,t,r){return W(e,t,r)<=0}function re(e,t,r,n){switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return Y(e,r,n);case"!=":return Z(e,r,n);case">":return X(e,r,n);case">=":return ee(e,r,n);case"<":return Q(e,r,n);case"<=":return te(e,r,n);default:throw new TypeError("Invalid operator: "+t)}}function ne(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof ne){if(e.loose===!!t.loose)return e;e=e.value}if(!(this instanceof ne))return new ne(e,t);r("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===ie?this.value="":this.value=this.operator+this.semver.version,r("comp",this)}t.rcompareIdentifiers=function(e,t){return J(t,e)},t.major=function(e,t){return new $(e,t).major},t.minor=function(e,t){return new $(e,t).minor},t.patch=function(e,t){return new $(e,t).patch},t.compare=W,t.compareLoose=function(e,t){return W(e,t,!0)},t.rcompare=function(e,t,r){return W(t,e,r)},t.sort=function(e,r){return e.sort((function(e,n){return t.compare(e,n,r)}))},t.rsort=function(e,r){return e.sort((function(e,n){return t.rcompare(e,n,r)}))},t.gt=X,t.lt=Q,t.eq=Y,t.neq=Z,t.gte=ee,t.lte=te,t.cmp=re,t.Comparator=ne;var ie={};function oe(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof oe)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new oe(e.raw,t);if(e instanceof ne)return new oe(e.value,t);if(!(this instanceof oe))return new oe(e,t);if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map((function(e){return this.parseRange(e.trim())}),this).filter((function(e){return e.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);this.format()}function ae(e){return!e||"x"===e.toLowerCase()||"*"===e}function se(e,t,r,n,i,o,a,s,c,u,l,f,h){return((t=ae(r)?"":ae(n)?">="+r+".0.0":ae(i)?">="+r+"."+n+".0":">="+t)+" "+(s=ae(c)?"":ae(u)?"<"+(+c+1)+".0.0":ae(l)?"<"+c+"."+(+u+1)+".0":f?"<="+c+"."+u+"."+l+"-"+f:"<="+s)).trim()}function ce(e,t,n){for(var i=0;i<e.length;i++)if(!e[i].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(i=0;i<e.length;i++)if(r(e[i].semver),e[i].semver!==ie&&e[i].semver.prerelease.length>0){var o=e[i].semver;if(o.major===t.major&&o.minor===t.minor&&o.patch===t.patch)return!0}return!1}return!0}function ue(e,t,r){try{t=new oe(t,r)}catch(e){return!1}return t.test(e)}function le(e,t,r,n){var i,o,a,s,c;switch(e=new $(e,n),t=new oe(t,n),r){case">":i=X,o=te,a=Q,s=">",c=">=";break;case"<":i=Q,o=ee,a=X,s="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(ue(e,t,n))return!1;for(var u=0;u<t.set.length;++u){var l=t.set[u],f=null,h=null;if(l.forEach((function(e){e.semver===ie&&(e=new ne(">=0.0.0")),f=f||e,h=h||e,i(e.semver,f.semver,n)?f=e:a(e.semver,h.semver,n)&&(h=e)})),f.operator===s||f.operator===c)return!1;if((!h.operator||h.operator===s)&&o(e,h.semver))return!1;if(h.operator===c&&a(e,h.semver))return!1}return!0}ne.prototype.parse=function(e){var t=this.options.loose?i[B]:i[U],r=e.match(t);if(!r)throw new TypeError("Invalid comparator: "+e);this.operator=r[1],"="===this.operator&&(this.operator=""),r[2]?this.semver=new $(r[2],this.options.loose):this.semver=ie},ne.prototype.toString=function(){return this.value},ne.prototype.test=function(e){return r("Comparator.test",e,this.options.loose),this.semver===ie||("string"==typeof e&&(e=new $(e,this.options)),re(e,this.operator,this.semver,this.options))},ne.prototype.intersects=function(e,t){if(!(e instanceof ne))throw new TypeError("a Comparator is required");var r;if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return r=new oe(e.value,t),ue(this.value,r,t);if(""===e.operator)return r=new oe(this.value,t),ue(e.semver,r,t);var n=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),i=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),o=this.semver.version===e.semver.version,a=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),s=re(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),c=re(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return n||i||o&&a||s||c},t.Range=oe,oe.prototype.format=function(){return this.range=this.set.map((function(e){return e.join(" ").trim()})).join("||").trim(),this.range},oe.prototype.toString=function(){return this.range},oe.prototype.parseRange=function(e){var t=this.options.loose;e=e.trim();var n=t?i[V]:i[H];e=e.replace(n,se),r("hyphen replace",e),e=e.replace(i[F],"$1$2$3"),r("comparator trim",e,i[F]),e=(e=(e=e.replace(i[C],"$1~")).replace(i[L],"$1^")).split(/\s+/).join(" ");var o=t?i[B]:i[U],a=e.split(" ").map((function(e){return function(e,t){return r("comp",e,t),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){r("caret",e,t);var n=t.loose?i[D]:i[j];return e.replace(n,(function(t,n,i,o,a){var s;return r("caret",e,t,n,i,o,a),ae(n)?s="":ae(i)?s=">="+n+".0.0 <"+(+n+1)+".0.0":ae(o)?s="0"===n?">="+n+"."+i+".0 <"+n+"."+(+i+1)+".0":">="+n+"."+i+".0 <"+(+n+1)+".0.0":a?(r("replaceCaret pr",a),s="0"===n?"0"===i?">="+n+"."+i+"."+o+"-"+a+" <"+n+"."+i+"."+(+o+1):">="+n+"."+i+"."+o+"-"+a+" <"+n+"."+(+i+1)+".0":">="+n+"."+i+"."+o+"-"+a+" <"+(+n+1)+".0.0"):(r("no pr"),s="0"===n?"0"===i?">="+n+"."+i+"."+o+" <"+n+"."+i+"."+(+o+1):">="+n+"."+i+"."+o+" <"+n+"."+(+i+1)+".0":">="+n+"."+i+"."+o+" <"+(+n+1)+".0.0"),r("caret return",s),s}))}(e,t)})).join(" ")}(e,t),r("caret",e),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){var n=t.loose?i[R]:i[N];return e.replace(n,(function(t,n,i,o,a){var s;return r("tilde",e,t,n,i,o,a),ae(n)?s="":ae(i)?s=">="+n+".0.0 <"+(+n+1)+".0.0":ae(o)?s=">="+n+"."+i+".0 <"+n+"."+(+i+1)+".0":a?(r("replaceTilde pr",a),s=">="+n+"."+i+"."+o+"-"+a+" <"+n+"."+(+i+1)+".0"):s=">="+n+"."+i+"."+o+" <"+n+"."+(+i+1)+".0",r("tilde return",s),s}))}(e,t)})).join(" ")}(e,t),r("tildes",e),e=function(e,t){return r("replaceXRanges",e,t),e.split(/\s+/).map((function(e){return function(e,t){e=e.trim();var n=t.loose?i[O]:i[P];return e.replace(n,(function(t,n,i,o,a,s){r("xRange",e,t,n,i,o,a,s);var c=ae(i),u=c||ae(o),l=u||ae(a);return"="===n&&l&&(n=""),c?t=">"===n||"<"===n?"<0.0.0":"*":n&&l?(u&&(o=0),a=0,">"===n?(n=">=",u?(i=+i+1,o=0,a=0):(o=+o+1,a=0)):"<="===n&&(n="<",u?i=+i+1:o=+o+1),t=n+i+"."+o+"."+a):u?t=">="+i+".0.0 <"+(+i+1)+".0.0":l&&(t=">="+i+"."+o+".0 <"+i+"."+(+o+1)+".0"),r("xRange return",t),t}))}(e,t)})).join(" ")}(e,t),r("xrange",e),e=function(e,t){return r("replaceStars",e,t),e.trim().replace(i[z],"")}(e,t),r("stars",e),e}(e,this.options)}),this).join(" ").split(/\s+/);return this.options.loose&&(a=a.filter((function(e){return!!e.match(o)}))),a=a.map((function(e){return new ne(e,this.options)}),this)},oe.prototype.intersects=function(e,t){if(!(e instanceof oe))throw new TypeError("a Range is required");return this.set.some((function(r){return r.every((function(r){return e.set.some((function(e){return e.every((function(e){return r.intersects(e,t)}))}))}))}))},t.toComparators=function(e,t){return new oe(e,t).set.map((function(e){return e.map((function(e){return e.value})).join(" ").trim().split(" ")}))},oe.prototype.test=function(e){if(!e)return!1;"string"==typeof e&&(e=new $(e,this.options));for(var t=0;t<this.set.length;t++)if(ce(this.set[t],e,this.options))return!0;return!1},t.satisfies=ue,t.maxSatisfying=function(e,t,r){var n=null,i=null;try{var o=new oe(t,r)}catch(e){return null}return e.forEach((function(e){o.test(e)&&(n&&-1!==i.compare(e)||(i=new $(n=e,r)))})),n},t.minSatisfying=function(e,t,r){var n=null,i=null;try{var o=new oe(t,r)}catch(e){return null}return e.forEach((function(e){o.test(e)&&(n&&1!==i.compare(e)||(i=new $(n=e,r)))})),n},t.minVersion=function(e,t){e=new oe(e,t);var r=new $("0.0.0");if(e.test(r))return r;if(r=new $("0.0.0-0"),e.test(r))return r;r=null;for(var n=0;n<e.set.length;++n){e.set[n].forEach((function(e){var t=new $(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":r&&!X(r,t)||(r=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}}))}if(r&&e.test(r))return r;return null},t.validRange=function(e,t){try{return new oe(e,t).range||"*"}catch(e){return null}},t.ltr=function(e,t,r){return le(e,t,"<",r)},t.gtr=function(e,t,r){return le(e,t,">",r)},t.outside=le,t.prerelease=function(e,t){var r=K(e,t);return r&&r.prerelease.length?r.prerelease:null},t.intersects=function(e,t,r){return e=new oe(e,r),t=new oe(t,r),e.intersects(t)},t.coerce=function(e){if(e instanceof $)return e;if("string"!=typeof e)return null;var t=e.match(i[A]);if(null==t)return null;return K(t[1]+"."+(t[2]||"0")+"."+(t[3]||"0"))}}));Nc.SEMVER_SPEC_VERSION,Nc.re,Nc.src,Nc.parse,Nc.valid,Nc.clean,Nc.SemVer,Nc.inc,Nc.diff,Nc.compareIdentifiers,Nc.rcompareIdentifiers,Nc.major,Nc.minor,Nc.patch,Nc.compare,Nc.compareLoose,Nc.rcompare,Nc.sort,Nc.rsort,Nc.gt,Nc.lt,Nc.eq,Nc.neq,Nc.gte,Nc.lte,Nc.cmp,Nc.Comparator,Nc.Range,Nc.toComparators,Nc.satisfies,Nc.maxSatisfying,Nc.minSatisfying,Nc.minVersion,Nc.validRange,Nc.ltr,Nc.gtr,Nc.outside,Nc.prerelease,Nc.intersects,Nc.coerce;const Rc={};var Mc=Rc;const Lc="function"==typeof setImmediate&&setImmediate,jc=Lc?e=>Lc(e):e=>setTimeout(e,0);function Dc(e,t,r){try{return e(t,r)}catch(e){Ye(()=>{throw e})}}Rc.nextTick="object"==typeof ft?Ye:jc,Rc.setImmediate=Lc?jc:Rc.nextTick,Rc.clone=function(e){if(e&&"object"==typeof e){let t;if(Array.isArray(e)){t=[];for(let r=0;r<e.length;++r)t[r]=Rc.clone(e[r])}else if(Rc.isObject(e)){t={};for(const r in e)t[r]=Rc.clone(e[r])}else t=e.toString();return t}return e},Rc.isObject=e=>"[object Object]"===Object.prototype.toString.call(e),Rc.isUndefined=e=>void 0===e,Rc.callbackify=e=>async function(...t){const r=t[t.length-1];let n;"function"==typeof r&&t.pop();try{n=await e.apply(null,t)}catch(e){if("function"==typeof r)return Dc(r,e);throw e}return"function"==typeof r?Dc(r,null,n):n};var Bc=class e{constructor(e){this.prefix=e,this.counter=0,this.existing={}}clone(){const t=new e(this.prefix);return t.counter=this.counter,t.existing=Mc.clone(this.existing),t}getId(e){if(e&&e in this.existing)return this.existing[e];const t=this.prefix+this.counter;return this.counter+=1,e&&(this.existing[e]=t),t}hasId(e){return e in this.existing}},Uc={options:{usePureJavaScript:!1}};Uc.md=Uc.md||{};Uc.md.algorithms=Uc.md.algorithms||{};var Fc={},Hc=Fc,Vc={};Fc.encode=function(e,t,r){if("string"!=typeof t)throw new TypeError('"alphabet" must be a string.');if(void 0!==r&&"number"!=typeof r)throw new TypeError('"maxline" must be a number.');var n="";if(e instanceof Uint8Array){var i=0,o=t.length,a=t.charAt(0),s=[0];for(i=0;i<e.length;++i){for(var c=0,u=e[i];c<s.length;++c)u+=s[c]<<8,s[c]=u%o,u=u/o|0;for(;u>0;)s.push(u%o),u=u/o|0}for(i=0;0===e[i]&&i<e.length-1;++i)n+=a;for(i=s.length-1;i>=0;--i)n+=t[s[i]]}else n=function(e,t){var r=0,n=t.length,i=t.charAt(0),o=[0];for(r=0;r<e.length();++r){for(var a=0,s=e.at(r);a<o.length;++a)s+=o[a]<<8,o[a]=s%n,s=s/n|0;for(;s>0;)o.push(s%n),s=s/n|0}var c="";for(r=0;0===e.at(r)&&r<e.length()-1;++r)c+=i;for(r=o.length-1;r>=0;--r)c+=t[o[r]];return c}(e,t);if(r){var l=new RegExp(".{1,"+r+"}","g");n=n.match(l).join("\r\n")}return n},Fc.decode=function(e,t){if("string"!=typeof e)throw new TypeError('"input" must be a string.');if("string"!=typeof t)throw new TypeError('"alphabet" must be a string.');var r=Vc[t];if(!r){r=Vc[t]=[];for(var n=0;n<t.length;++n)r[t.charCodeAt(n)]=n}e=e.replace(/\s/g,"");var i=t.length,o=t.charAt(0),a=[0];for(n=0;n<e.length;n++){var s=r[e.charCodeAt(n)];if(void 0===s)return;for(var c=0,u=s;c<a.length;++c)u+=a[c]*i,a[c]=255&u,u>>=8;for(;u>0;)a.push(255&u),u>>=8}for(var l=0;e[l]===o&&l<e.length-1;++l)a.push(0);return re.from(a.reverse())};tr((function(e){var t=e.exports=Uc.util=Uc.util||{};function r(e){if(8!==e&&16!==e&&24!==e&&32!==e)throw new Error("Only 8, 16, 24, or 32 bits supported: "+e)}function n(e){if(this.data="",this.read=0,"string"==typeof e)this.data=e;else if(t.isArrayBuffer(e)||t.isArrayBufferView(e))if(e instanceof re)this.data=e.toString("binary");else{var r=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,r)}catch(e){for(var i=0;i<r.length;++i)this.putByte(r[i])}}else(e instanceof n||"object"==typeof e&&"string"==typeof e.data&&"number"==typeof e.read)&&(this.data=e.data,this.read=e.read);this._constructedStringLength=0}!function(){if("function"==typeof setImmediate)return t.setImmediate=function(){return setImmediate.apply(void 0,arguments)},void(t.nextTick=function(e){return setImmediate(e)});if(t.setImmediate=function(e){setTimeout(e,0)},"undefined"!=typeof window&&"function"==typeof window.postMessage){var e="forge.setImmediate",r=[];t.setImmediate=function(t){r.push(t),1===r.length&&window.postMessage(e,"*")},window.addEventListener("message",(function(t){if(t.source===window&&t.data===e){t.stopPropagation();var n=r.slice();r.length=0,n.forEach((function(e){e()}))}}),!0)}if("undefined"!=typeof MutationObserver){var n=Date.now(),i=!0,o=document.createElement("div");r=[];new MutationObserver((function(){var e=r.slice();r.length=0,e.forEach((function(e){e()}))})).observe(o,{attributes:!0});var a=t.setImmediate;t.setImmediate=function(e){Date.now()-n>15?(n=Date.now(),a(e)):(r.push(e),1===r.length&&o.setAttribute("a",i=!i))}}t.nextTick=t.setImmediate}(),t.isNodejs=void 0!==ft&&ft.versions&&ft.versions.node,t.globalScope=t.isNodejs?Zt:"undefined"==typeof self?window:self,t.isArray=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},t.isArrayBuffer=function(e){return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer},t.isArrayBufferView=function(e){return e&&t.isArrayBuffer(e.buffer)&&void 0!==e.byteLength},t.ByteBuffer=n,t.ByteStringBuffer=n;t.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},t.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},t.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},t.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))},t.ByteStringBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);for(var r=this.data;t>0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return this.data=r,this._optimizeConstructedString(t),this},t.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this},t.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(t.encodeUtf8(e))},t.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},t.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},t.ByteStringBuffer.prototype.putInt32=function(e){return this.putBytes(String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},t.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255))},t.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))},t.ByteStringBuffer.prototype.putInt32Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>24&255))},t.ByteStringBuffer.prototype.putInt=function(e,t){r(t);var n="";do{t-=8,n+=String.fromCharCode(e>>t&255)}while(t>0);return this.putBytes(n)},t.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<<t-1),this.putInt(e,t)},t.ByteStringBuffer.prototype.putBuffer=function(e){return this.putBytes(e.getBytes())},t.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)},t.ByteStringBuffer.prototype.getInt16=function(){var e=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,e},t.ByteStringBuffer.prototype.getInt24=function(){var e=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,e},t.ByteStringBuffer.prototype.getInt32=function(){var e=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,e},t.ByteStringBuffer.prototype.getInt16Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,e},t.ByteStringBuffer.prototype.getInt24Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,e},t.ByteStringBuffer.prototype.getInt32Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,e},t.ByteStringBuffer.prototype.getInt=function(e){r(e);var t=0;do{t=(t<<8)+this.data.charCodeAt(this.read++),e-=8}while(e>0);return t},t.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t},t.ByteStringBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},t.ByteStringBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},t.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)},t.ByteStringBuffer.prototype.setAt=function(e,t){return this.data=this.data.substr(0,this.read+e)+String.fromCharCode(t)+this.data.substr(this.read+e+1),this},t.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},t.ByteStringBuffer.prototype.copy=function(){var e=t.createBuffer(this.data);return e.read=this.read,e},t.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},t.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},t.ByteStringBuffer.prototype.truncate=function(e){var t=Math.max(0,this.length()-e);return this.data=this.data.substr(this.read,t),this.read=0,this},t.ByteStringBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.length;++t){var r=this.data.charCodeAt(t);r<16&&(e+="0"),e+=r.toString(16)}return e},t.ByteStringBuffer.prototype.toString=function(){return t.decodeUtf8(this.bytes())},t.DataBuffer=function(e,r){r=r||{},this.read=r.readOffset||0,this.growSize=r.growSize||1024;var n=t.isArrayBuffer(e),i=t.isArrayBufferView(e);if(n||i)return this.data=n?new DataView(e):new DataView(e.buffer,e.byteOffset,e.byteLength),void(this.write="writeOffset"in r?r.writeOffset:this.data.byteLength);this.data=new DataView(new ArrayBuffer(0)),this.write=0,null!=e&&this.putBytes(e),"writeOffset"in r&&(this.write=r.writeOffset)},t.DataBuffer.prototype.length=function(){return this.write-this.read},t.DataBuffer.prototype.isEmpty=function(){return this.length()<=0},t.DataBuffer.prototype.accommodate=function(e,t){if(this.length()>=e)return this;t=Math.max(t||this.growSize,e);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+t);return n.set(r),this.data=new DataView(n.buffer),this},t.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this},t.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var r=0;r<t;++r)this.data.setUint8(e);return this},t.DataBuffer.prototype.putBytes=function(e,r){if(t.isArrayBufferView(e)){var n=(i=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)).byteLength-i.byteOffset;return this.accommodate(n),new Uint8Array(this.data.buffer,this.write).set(i),this.write+=n,this}if(t.isArrayBuffer(e)){var i=new Uint8Array(e);return this.accommodate(i.byteLength),new Uint8Array(this.data.buffer).set(i,this.write),this.write+=i.byteLength,this}if(e instanceof t.DataBuffer||"object"==typeof e&&"number"==typeof e.read&&"number"==typeof e.write&&t.isArrayBufferView(e.data)){i=new Uint8Array(e.data.byteLength,e.read,e.length());return this.accommodate(i.byteLength),new Uint8Array(e.data.byteLength,this.write).set(i),this.write+=i.byteLength,this}if(e instanceof t.ByteStringBuffer&&(e=e.data,r="binary"),r=r||"binary","string"==typeof e){var o;if("hex"===r)return this.accommodate(Math.ceil(e.length/2)),o=new Uint8Array(this.data.buffer,this.write),this.write+=t.binary.hex.decode(e,o,this.write),this;if("base64"===r)return this.accommodate(3*Math.ceil(e.length/4)),o=new Uint8Array(this.data.buffer,this.write),this.write+=t.binary.base64.decode(e,o,this.write),this;if("utf8"===r&&(e=t.encodeUtf8(e),r="binary"),"binary"===r||"raw"===r)return this.accommodate(e.length),o=new Uint8Array(this.data.buffer,this.write),this.write+=t.binary.raw.decode(o),this;if("utf16"===r)return this.accommodate(2*e.length),o=new Uint16Array(this.data.buffer,this.write),this.write+=t.text.utf16.encode(o),this;throw new Error("Invalid encoding: "+r)}throw Error("Invalid parameter: "+e)},t.DataBuffer.prototype.putBuffer=function(e){return this.putBytes(e),e.clear(),this},t.DataBuffer.prototype.putString=function(e){return this.putBytes(e,"utf16")},t.DataBuffer.prototype.putInt16=function(e){return this.accommodate(2),this.data.setInt16(this.write,e),this.write+=2,this},t.DataBuffer.prototype.putInt24=function(e){return this.accommodate(3),this.data.setInt16(this.write,e>>8&65535),this.data.setInt8(this.write,e>>16&255),this.write+=3,this},t.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this},t.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this},t.DataBuffer.prototype.putInt24Le=function(e){return this.accommodate(3),this.data.setInt8(this.write,e>>16&255),this.data.setInt16(this.write,e>>8&65535,!0),this.write+=3,this},t.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this},t.DataBuffer.prototype.putInt=function(e,t){r(t),this.accommodate(t/8);do{t-=8,this.data.setInt8(this.write++,e>>t&255)}while(t>0);return this},t.DataBuffer.prototype.putSignedInt=function(e,t){return r(t),this.accommodate(t/8),e<0&&(e+=2<<t-1),this.putInt(e,t)},t.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)},t.DataBuffer.prototype.getInt16=function(){var e=this.data.getInt16(this.read);return this.read+=2,e},t.DataBuffer.prototype.getInt24=function(){var e=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,e},t.DataBuffer.prototype.getInt32=function(){var e=this.data.getInt32(this.read);return this.read+=4,e},t.DataBuffer.prototype.getInt16Le=function(){var e=this.data.getInt16(this.read,!0);return this.read+=2,e},t.DataBuffer.prototype.getInt24Le=function(){var e=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,e},t.DataBuffer.prototype.getInt32Le=function(){var e=this.data.getInt32(this.read,!0);return this.read+=4,e},t.DataBuffer.prototype.getInt=function(e){r(e);var t=0;do{t=(t<<8)+this.data.getInt8(this.read++),e-=8}while(e>0);return t},t.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t},t.DataBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},t.DataBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},t.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)},t.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this},t.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},t.DataBuffer.prototype.copy=function(){return new t.DataBuffer(this)},t.DataBuffer.prototype.compact=function(){if(this.read>0){var e=new Uint8Array(this.data.buffer,this.read),t=new Uint8Array(e.byteLength);t.set(e),this.data=new DataView(t),this.write-=this.read,this.read=0}return this},t.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},t.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this},t.DataBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.byteLength;++t){var r=this.data.getUint8(t);r<16&&(e+="0"),e+=r.toString(16)}return e},t.DataBuffer.prototype.toString=function(e){var r=new Uint8Array(this.data,this.read,this.length());if("binary"===(e=e||"utf8")||"raw"===e)return t.binary.raw.encode(r);if("hex"===e)return t.binary.hex.encode(r);if("base64"===e)return t.binary.base64.encode(r);if("utf8"===e)return t.text.utf8.decode(r);if("utf16"===e)return t.text.utf16.decode(r);throw new Error("Invalid encoding: "+e)},t.createBuffer=function(e,r){return r=r||"raw",void 0!==e&&"utf8"===r&&(e=t.encodeUtf8(e)),new t.ByteBuffer(e)},t.fillString=function(e,t){for(var r="";t>0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return r},t.xorBytes=function(e,t,r){for(var n="",i="",o="",a=0,s=0;r>0;--r,++a)i=e.charCodeAt(a)^t.charCodeAt(a),s>=10&&(n+=o,o="",s=0),o+=String.fromCharCode(i),++s;return n+=o},t.hexToBytes=function(e){var t="",r=0;for(!0&e.length&&(r=1,t+=String.fromCharCode(parseInt(e[0],16)));r<e.length;r+=2)t+=String.fromCharCode(parseInt(e.substr(r,2),16));return t},t.bytesToHex=function(e){return t.createBuffer(e).toHex()},t.int32ToBytes=function(e){return String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e)};var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",o=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],a="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";t.encode64=function(e,t){for(var r,n,o,a="",s="",c=0;c<e.length;)r=e.charCodeAt(c++),n=e.charCodeAt(c++),o=e.charCodeAt(c++),a+=i.charAt(r>>2),a+=i.charAt((3&r)<<4|n>>4),isNaN(n)?a+="==":(a+=i.charAt((15&n)<<2|o>>6),a+=isNaN(o)?"=":i.charAt(63&o)),t&&a.length>t&&(s+=a.substr(0,t)+"\r\n",a=a.substr(t));return s+=a},t.decode64=function(e){e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var t,r,n,i,a="",s=0;s<e.length;)t=o[e.charCodeAt(s++)-43],r=o[e.charCodeAt(s++)-43],n=o[e.charCodeAt(s++)-43],i=o[e.charCodeAt(s++)-43],a+=String.fromCharCode(t<<2|r>>4),64!==n&&(a+=String.fromCharCode((15&r)<<4|n>>2),64!==i&&(a+=String.fromCharCode((3&n)<<6|i)));return a},t.encodeUtf8=function(e){return unescape(encodeURIComponent(e))},t.decodeUtf8=function(e){return decodeURIComponent(escape(e))},t.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:Hc.encode,decode:Hc.decode}},t.binary.raw.encode=function(e){return String.fromCharCode.apply(null,e)},t.binary.raw.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(e.length));for(var i=r=r||0,o=0;o<e.length;++o)n[i++]=e.charCodeAt(o);return t?i-r:n},t.binary.hex.encode=t.bytesToHex,t.binary.hex.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(Math.ceil(e.length/2)));var i=0,o=r=r||0;for(1&e.length&&(i=1,n[o++]=parseInt(e[0],16));i<e.length;i+=2)n[o++]=parseInt(e.substr(i,2),16);return t?o-r:n},t.binary.base64.encode=function(e,t){for(var r,n,o,a="",s="",c=0;c<e.byteLength;)r=e[c++],n=e[c++],o=e[c++],a+=i.charAt(r>>2),a+=i.charAt((3&r)<<4|n>>4),isNaN(n)?a+="==":(a+=i.charAt((15&n)<<2|o>>6),a+=isNaN(o)?"=":i.charAt(63&o)),t&&a.length>t&&(s+=a.substr(0,t)+"\r\n",a=a.substr(t));return s+=a},t.binary.base64.decode=function(e,t,r){var n,i,a,s,c=t;c||(c=new Uint8Array(3*Math.ceil(e.length/4))),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var u=0,l=r=r||0;u<e.length;)n=o[e.charCodeAt(u++)-43],i=o[e.charCodeAt(u++)-43],a=o[e.charCodeAt(u++)-43],s=o[e.charCodeAt(u++)-43],c[l++]=n<<2|i>>4,64!==a&&(c[l++]=(15&i)<<4|a>>2,64!==s&&(c[l++]=(3&a)<<6|s));return t?l-r:c.subarray(0,l)},t.binary.base58.encode=function(e,r){return t.binary.baseN.encode(e,a,r)},t.binary.base58.decode=function(e,r){return t.binary.baseN.decode(e,a,r)},t.text={utf8:{},utf16:{}},t.text.utf8.encode=function(e,r,n){e=t.encodeUtf8(e);var i=r;i||(i=new Uint8Array(e.length));for(var o=n=n||0,a=0;a<e.length;++a)i[o++]=e.charCodeAt(a);return r?o-n:i},t.text.utf8.decode=function(e){return t.decodeUtf8(String.fromCharCode.apply(null,e))},t.text.utf16.encode=function(e,t,r){var n=t;n||(n=new Uint8Array(2*e.length));for(var i=new Uint16Array(n.buffer),o=r=r||0,a=r,s=0;s<e.length;++s)i[a++]=e.charCodeAt(s),o+=2;return t?o-r:n},t.text.utf16.decode=function(e){return String.fromCharCode.apply(null,new Uint16Array(e.buffer))},t.deflate=function(e,r,n){if(r=t.decode64(e.deflate(t.encode64(r)).rval),n){var i=2;32&r.charCodeAt(1)&&(i=6),r=r.substring(i,r.length-4)}return r},t.inflate=function(e,r,n){var i=e.inflate(t.encode64(r)).rval;return null===i?null:t.decode64(i)};var s=function(e,r,n){if(!e)throw new Error("WebStorage not available.");var i;if(null===n?i=e.removeItem(r):(n=t.encode64(JSON.stringify(n)),i=e.setItem(r,n)),void 0!==i&&!0!==i.rval){var o=new Error(i.error.message);throw o.id=i.error.id,o.name=i.error.name,o}},c=function(e,r){if(!e)throw new Error("WebStorage not available.");var n=e.getItem(r);if(e.init)if(null===n.rval){if(n.error){var i=new Error(n.error.message);throw i.id=n.error.id,i.name=n.error.name,i}n=null}else n=n.rval;return null!==n&&(n=JSON.parse(t.decode64(n))),n},u=function(e,t,r,n){var i=c(e,t);null===i&&(i={}),i[r]=n,s(e,t,i)},l=function(e,t,r){var n=c(e,t);return null!==n&&(n=r in n?n[r]:null),n},f=function(e,t,r){var n=c(e,t);if(null!==n&&r in n){delete n[r];var i=!0;for(var o in n){i=!1;break}i&&(n=null),s(e,t,n)}},h=function(e,t){s(e,t,null)},d=function(e,t,r){var n,i=null;void 0===r&&(r=["web","flash"]);var o=!1,a=null;for(var s in r){n=r[s];try{if("flash"===n||"both"===n){if(null===t[0])throw new Error("Flash local storage not available.");i=e.apply(this,t),o="flash"===n}"web"!==n&&"both"!==n||(t[0]=localStorage,i=e.apply(this,t),o=!0)}catch(e){a=e}if(o)break}if(!o)throw a;return i};t.setItem=function(e,t,r,n,i){d(u,arguments,i)},t.getItem=function(e,t,r,n){return d(l,arguments,n)},t.removeItem=function(e,t,r,n){d(f,arguments,n)},t.clearItems=function(e,t,r){d(h,arguments,r)},t.parseUrl=function(e){var t=/^(https?):\/\/([^:&^\/]*):?(\d*)(.*)$/g;t.lastIndex=0;var r=t.exec(e),n=null===r?null:{full:e,scheme:r[1],host:r[2],port:r[3],path:r[4]};return n&&(n.fullHost=n.host,n.port?(80!==n.port&&"http"===n.scheme||443!==n.port&&"https"===n.scheme)&&(n.fullHost+=":"+n.port):"http"===n.scheme?n.port=80:"https"===n.scheme&&(n.port=443),n.full=n.scheme+"://"+n.fullHost),n};var p=null;t.getQueryVariables=function(e){var t,r=function(e){for(var t={},r=e.split("&"),n=0;n<r.length;n++){var i,o,a=r[n].indexOf("=");a>0?(i=r[n].substring(0,a),o=r[n].substring(a+1)):(i=r[n],o=null),i in t||(t[i]=[]),i in Object.prototype||null===o||t[i].push(unescape(o))}return t};return void 0===e?(null===p&&(p="undefined"!=typeof window&&window.location&&window.location.search?r(window.location.search.substring(1)):{}),t=p):t=r(e),t},t.parseFragment=function(e){var r=e,n="",i=e.indexOf("?");i>0&&(r=e.substring(0,i),n=e.substring(i+1));var o=r.split("/");return o.length>0&&""===o[0]&&o.shift(),{pathString:r,queryString:n,path:o,query:""===n?{}:t.getQueryVariables(n)}},t.makeRequest=function(e){var r=t.parseFragment(e),n={path:r.pathString,query:r.queryString,getPath:function(e){return void 0===e?r.path:r.path[e]},getQuery:function(e,t){var n;return void 0===e?n=r.query:(n=r.query[e])&&void 0!==t&&(n=n[t]),n},getQueryLast:function(e,t){var r=n.getQuery(e);return r?r[r.length-1]:t}};return n},t.makeLink=function(e,t,r){e=jQuery.isArray(e)?e.join("/"):e;var n=jQuery.param(t||{});return r=r||"",e+(n.length>0?"?"+n:"")+(r.length>0?"#"+r:"")},t.setPath=function(e,t,r){if("object"==typeof e&&null!==e)for(var n=0,i=t.length;n<i;){var o=t[n++];if(n==i)e[o]=r;else{var a=o in e;(!a||a&&"object"!=typeof e[o]||a&&null===e[o])&&(e[o]={}),e=e[o]}}},t.getPath=function(e,t,r){for(var n=0,i=t.length,o=!0;o&&n<i&&"object"==typeof e&&null!==e;){var a=t[n++];(o=a in e)&&(e=e[a])}return o?e:r},t.deletePath=function(e,t){if("object"==typeof e&&null!==e)for(var r=0,n=t.length;r<n;){var i=t[r++];if(r==n)delete e[i];else{if(!(i in e)||"object"!=typeof e[i]||null===e[i])break;e=e[i]}}},t.isEmpty=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},t.format=function(e){for(var t,r,n=/%./g,i=0,o=[],a=0;t=n.exec(e);){(r=e.substring(a,n.lastIndex-2)).length>0&&o.push(r),a=n.lastIndex;var s=t[0][1];switch(s){case"s":case"o":i<arguments.length?o.push(arguments[1+i++]):o.push("<?>");break;case"%":o.push("%");break;default:o.push("<%"+s+"?>")}}return o.push(e.substring(a)),o.join("")},t.formatNumber=function(e,t,r,n){var i=e,o=isNaN(t=Math.abs(t))?2:t,a=void 0===r?",":r,s=void 0===n?".":n,c=i<0?"-":"",u=parseInt(i=Math.abs(+i||0).toFixed(o),10)+"",l=u.length>3?u.length%3:0;return c+(l?u.substr(0,l)+s:"")+u.substr(l).replace(/(\d{3})(?=\d)/g,"$1"+s)+(o?a+Math.abs(i-u).toFixed(o).slice(2):"")},t.formatSize=function(e){return e=e>=1073741824?t.formatNumber(e/1073741824,2,".","")+" GiB":e>=1048576?t.formatNumber(e/1048576,2,".","")+" MiB":e>=1024?t.formatNumber(e/1024,0)+" KiB":t.formatNumber(e,0)+" bytes"},t.bytesFromIP=function(e){return-1!==e.indexOf(".")?t.bytesFromIPv4(e):-1!==e.indexOf(":")?t.bytesFromIPv6(e):null},t.bytesFromIPv4=function(e){if(4!==(e=e.split(".")).length)return null;for(var r=t.createBuffer(),n=0;n<e.length;++n){var i=parseInt(e[n],10);if(isNaN(i))return null;r.putByte(i)}return r.getBytes()},t.bytesFromIPv6=function(e){for(var r=0,n=2*(8-(e=e.split(":").filter((function(e){return 0===e.length&&++r,!0}))).length+r),i=t.createBuffer(),o=0;o<8;++o)if(e[o]&&0!==e[o].length){var a=t.hexToBytes(e[o]);a.length<2&&i.putByte(0),i.putBytes(a)}else i.fillWithByte(0,n),n=0;return i.getBytes()},t.bytesToIP=function(e){return 4===e.length?t.bytesToIPv4(e):16===e.length?t.bytesToIPv6(e):null},t.bytesToIPv4=function(e){if(4!==e.length)return null;for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t.join(".")},t.bytesToIPv6=function(e){if(16!==e.length)return null;for(var r=[],n=[],i=0,o=0;o<e.length;o+=2){for(var a=t.bytesToHex(e[o]+e[o+1]);"0"===a[0]&&"0"!==a;)a=a.substr(1);if("0"===a){var s=n[n.length-1],c=r.length;s&&c===s.end+1?(s.end=c,s.end-s.start>n[i].end-n[i].start&&(i=n.length-1)):n.push({start:c,end:c})}r.push(a)}if(n.length>0){var u=n[i];u.end-u.start>0&&(r.splice(u.start,u.end-u.start+1,""),0===u.start&&r.unshift(""),7===u.end&&r.push(""))}return r.join(":")},t.estimateCores=function(e,r){if("function"==typeof e&&(r=e,e={}),e=e||{},"cores"in t&&!e.update)return r(null,t.cores);if("undefined"!=typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return t.cores=navigator.hardwareConcurrency,r(null,t.cores);if("undefined"==typeof Worker)return t.cores=1,r(null,t.cores);if("undefined"==typeof Blob)return t.cores=2,r(null,t.cores);var n=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",(function(e){var t=Date.now(),r=t+4;self.postMessage({st:t,et:r})}))}.toString(),")()"],{type:"application/javascript"}));!function e(i,o,a){if(0===o){var s=Math.floor(i.reduce((function(e,t){return e+t}),0)/i.length);return t.cores=Math.max(1,s),URL.revokeObjectURL(n),r(null,t.cores)}!function(e,t){for(var r=[],i=[],o=0;o<e;++o){var a=new Worker(n);a.addEventListener("message",(function(n){if(i.push(n.data),i.length===e){for(var o=0;o<e;++o)r[o].terminate();t(null,i)}})),r.push(a)}for(o=0;o<e;++o)r[o].postMessage(o)}(a,(function(t,r){i.push(function(e,t){for(var r=[],n=0;n<e;++n)for(var i=t[n],o=r[n]=[],a=0;a<e;++a)if(n!==a){var s=t[a];(i.st>s.st&&i.st<s.et||s.st>i.st&&s.st<i.et)&&o.push(a)}return r.reduce((function(e,t){return Math.max(e,t.length)}),0)}(a,r)),e(i,o-1,a)}))}([],5,16)}})),tr((function(e){var t=e.exports=Uc.sha1=Uc.sha1||{};Uc.md.sha1=Uc.md.algorithms.sha1=t,t.create=function(){n||(r=String.fromCharCode(128),r+=Uc.util.fillString(String.fromCharCode(0),64),n=!0);var e=null,t=Uc.util.createBuffer(),o=new Array(80),a={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){a.messageLength=0,a.fullMessageLength=a.messageLength64=[];for(var r=a.messageLengthSize/4,n=0;n<r;++n)a.fullMessageLength.push(0);return t=Uc.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},a}};return a.start(),a.update=function(r,n){"utf8"===n&&(r=Uc.util.encodeUtf8(r));var s=r.length;a.messageLength+=s,s=[s/4294967296>>>0,s>>>0];for(var c=a.fullMessageLength.length-1;c>=0;--c)a.fullMessageLength[c]+=s[1],s[1]=s[0]+(a.fullMessageLength[c]/4294967296>>>0),a.fullMessageLength[c]=a.fullMessageLength[c]>>>0,s[0]=s[1]/4294967296>>>0;return t.putBytes(r),i(e,o,t),(t.read>2048||0===t.length())&&t.compact(),a},a.digest=function(){var n=Uc.util.createBuffer();n.putBytes(t.bytes());var s,c=a.fullMessageLength[a.fullMessageLength.length-1]+a.messageLengthSize&a.blockLength-1;n.putBytes(r.substr(0,a.blockLength-c));for(var u=8*a.fullMessageLength[0],l=0;l<a.fullMessageLength.length-1;++l)u+=(s=8*a.fullMessageLength[l+1])/4294967296>>>0,n.putInt32(u>>>0),u=s>>>0;n.putInt32(u);var f={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};i(f,o,n);var h=Uc.util.createBuffer();return h.putInt32(f.h0),h.putInt32(f.h1),h.putInt32(f.h2),h.putInt32(f.h3),h.putInt32(f.h4),h},a};var r=null,n=!1;function i(e,t,r){for(var n,i,o,a,s,c,u,l=r.length();l>=64;){for(i=e.h0,o=e.h1,a=e.h2,s=e.h3,c=e.h4,u=0;u<16;++u)n=r.getInt32(),t[u]=n,n=(i<<5|i>>>27)+(s^o&(a^s))+c+1518500249+n,c=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=n;for(;u<20;++u)n=(n=t[u-3]^t[u-8]^t[u-14]^t[u-16])<<1|n>>>31,t[u]=n,n=(i<<5|i>>>27)+(s^o&(a^s))+c+1518500249+n,c=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=n;for(;u<32;++u)n=(n=t[u-3]^t[u-8]^t[u-14]^t[u-16])<<1|n>>>31,t[u]=n,n=(i<<5|i>>>27)+(o^a^s)+c+1859775393+n,c=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=n;for(;u<40;++u)n=(n=t[u-6]^t[u-16]^t[u-28]^t[u-32])<<2|n>>>30,t[u]=n,n=(i<<5|i>>>27)+(o^a^s)+c+1859775393+n,c=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=n;for(;u<60;++u)n=(n=t[u-6]^t[u-16]^t[u-28]^t[u-32])<<2|n>>>30,t[u]=n,n=(i<<5|i>>>27)+(o&a|s&(o^a))+c+2400959708+n,c=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=n;for(;u<80;++u)n=(n=t[u-6]^t[u-16]^t[u-28]^t[u-32])<<2|n>>>30,t[u]=n,n=(i<<5|i>>>27)+(o^a^s)+c+3395469782+n,c=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=n;e.h0=e.h0+i|0,e.h1=e.h1+o|0,e.h2=e.h2+a|0,e.h3=e.h3+s|0,e.h4=e.h4+c|0,l-=64}}})),tr((function(e){var t=e.exports=Uc.sha256=Uc.sha256||{};Uc.md.sha256=Uc.md.algorithms.sha256=t,t.create=function(){n||(r=String.fromCharCode(128),r+=Uc.util.fillString(String.fromCharCode(0),64),i=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],n=!0);var e=null,t=Uc.util.createBuffer(),a=new Array(64),s={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){s.messageLength=0,s.fullMessageLength=s.messageLength64=[];for(var r=s.messageLengthSize/4,n=0;n<r;++n)s.fullMessageLength.push(0);return t=Uc.util.createBuffer(),e={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},s}};return s.start(),s.update=function(r,n){"utf8"===n&&(r=Uc.util.encodeUtf8(r));var i=r.length;s.messageLength+=i,i=[i/4294967296>>>0,i>>>0];for(var c=s.fullMessageLength.length-1;c>=0;--c)s.fullMessageLength[c]+=i[1],i[1]=i[0]+(s.fullMessageLength[c]/4294967296>>>0),s.fullMessageLength[c]=s.fullMessageLength[c]>>>0,i[0]=i[1]/4294967296>>>0;return t.putBytes(r),o(e,a,t),(t.read>2048||0===t.length())&&t.compact(),s},s.digest=function(){var n=Uc.util.createBuffer();n.putBytes(t.bytes());var i,c=s.fullMessageLength[s.fullMessageLength.length-1]+s.messageLengthSize&s.blockLength-1;n.putBytes(r.substr(0,s.blockLength-c));for(var u=8*s.fullMessageLength[0],l=0;l<s.fullMessageLength.length-1;++l)u+=(i=8*s.fullMessageLength[l+1])/4294967296>>>0,n.putInt32(u>>>0),u=i>>>0;n.putInt32(u);var f={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4,h5:e.h5,h6:e.h6,h7:e.h7};o(f,a,n);var h=Uc.util.createBuffer();return h.putInt32(f.h0),h.putInt32(f.h1),h.putInt32(f.h2),h.putInt32(f.h3),h.putInt32(f.h4),h.putInt32(f.h5),h.putInt32(f.h6),h.putInt32(f.h7),h},s};var r=null,n=!1,i=null;function o(e,t,r){for(var n,o,a,s,c,u,l,f,h,d,p,m,g,v=r.length();v>=64;){for(c=0;c<16;++c)t[c]=r.getInt32();for(;c<64;++c)n=((n=t[c-2])>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,o=((o=t[c-15])>>>7|o<<25)^(o>>>18|o<<14)^o>>>3,t[c]=n+t[c-7]+o+t[c-16]|0;for(u=e.h0,l=e.h1,f=e.h2,h=e.h3,d=e.h4,p=e.h5,m=e.h6,g=e.h7,c=0;c<64;++c)a=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),s=u&l|f&(u^l),n=g+((d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7))+(m^d&(p^m))+i[c]+t[c],g=m,m=p,p=d,d=h+n>>>0,h=f,f=l,l=u,u=n+(o=a+s)>>>0;e.h0=e.h0+u|0,e.h1=e.h1+l|0,e.h2=e.h2+f|0,e.h3=e.h3+h|0,e.h4=e.h4+d|0,e.h5=e.h5+p|0,e.h6=e.h6+m|0,e.h7=e.h7+g|0,v-=64}}}));var zc=class{constructor(e){this.md=Uc.md[e].create()}update(e){this.md.update(e,"utf8")}digest(){return this.md.digest().toHex()}},qc=class{constructor(e){this.list=e.sort(),this.done=!1,this.left={};for(let t=0;t<e.length;++t)this.left[e[t]]=!0}hasNext(){return!this.done}next(){const e=this.list.slice();let t=null,r=0;const n=this.list.length;for(let e=0;e<n;++e){const i=this.list[e],o=this.left[i];(null===t||i>t)&&(o&&e>0&&i>this.list[e-1]||!o&&e<n-1&&i>this.list[e+1])&&(t=i,r=e)}if(null===t)this.done=!0;else{const e=this.left[t]?r-1:r+1;this.list[r]=this.list[e],this.list[e]=t;for(let e=0;e<n;++e)this.list[e]>t&&(this.left[this.list[e]]=!this.left[this.list[e]])}return e}};const Kc="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",$c="http://www.w3.org/2001/XMLSchema#string",Gc={eoln:/(?:\r\n)|(?:\n)|(?:\r)/g};Gc.empty=new RegExp("^[ \\t]*$"),Gc.quad=new RegExp('^[ \\t]*(?:(?:<([^:]+:[^>]*)>)|(_:(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�_0-9])(?:(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�_0-9-·̀-ͯ‿-⁀.])*(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�_0-9-·̀-ͯ‿-⁀]))?))[ \\t]+(?:<([^:]+:[^>]*)>)[ \\t]+(?:(?:<([^:]+:[^>]*)>)|(_:(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�_0-9])(?:(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�_0-9-·̀-ͯ‿-⁀.])*(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�_0-9-·̀-ͯ‿-⁀]))?)|(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"(?:(?:\\^\\^(?:<([^:]+:[^>]*)>))|(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)))?))[ \\t]*(?:\\.|(?:(?:(?:<([^:]+:[^>]*)>)|(_:(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�_0-9])(?:(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�_0-9-·̀-ͯ‿-⁀.])*(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�_0-9-·̀-ͯ‿-⁀]))?))[ \\t]*\\.))[ \\t]*$');var Jc=class e{static parse(e){const t=[],r={},n=e.split(Gc.eoln);let i=0;for(const e of n){if(i++,Gc.empty.test(e))continue;const n=e.match(Gc.quad);if(null===n)throw new Error("N-Quads parse error on line "+i+".");const o={};if(void 0!==n[1]?o.subject={termType:"NamedNode",value:n[1]}:o.subject={termType:"BlankNode",value:n[2]},o.predicate={termType:"NamedNode",value:n[3]},void 0!==n[4]?o.object={termType:"NamedNode",value:n[4]}:void 0!==n[5]?o.object={termType:"BlankNode",value:n[5]}:(o.object={termType:"Literal",value:void 0,datatype:{termType:"NamedNode"}},void 0!==n[7]?o.object.datatype.value=n[7]:void 0!==n[8]?(o.object.datatype.value=Kc,o.object.language=n[8]):o.object.datatype.value=$c,o.object.value=Yc(n[6])),void 0!==n[9]?o.graph={termType:"NamedNode",value:n[9]}:void 0!==n[10]?o.graph={termType:"BlankNode",value:n[10]}:o.graph={termType:"DefaultGraph",value:""},o.graph.value in r){let e=!0;const n=r[o.graph.value];for(const t of n)if(Wc(t,o)){e=!1;break}e&&(n.push(o),t.push(o))}else r[o.graph.value]=[o],t.push(o)}return t}static serialize(t){Array.isArray(t)||(t=e.legacyDatasetToQuads(t));const r=[];for(const n of t)r.push(e.serializeQuad(n));return r.sort().join("")}static serializeQuad(e){const t=e.subject,r=e.predicate,n=e.object,i=e.graph;let o="";return[t,r].forEach(e=>{"NamedNode"===e.termType?o+="<"+e.value+">":o+=e.value,o+=" "}),"NamedNode"===n.termType?o+="<"+n.value+">":"BlankNode"===n.termType?o+=n.value:(o+='"'+function(e){return e.replace(Xc,(function(e){switch(e){case'"':return'\\"';case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r"}}))}(n.value)+'"',n.datatype.value===Kc?n.language&&(o+="@"+n.language):n.datatype.value!==$c&&(o+="^^<"+n.datatype.value+">")),"NamedNode"===i.termType?o+=" <"+i.value+">":"BlankNode"===i.termType&&(o+=" "+i.value),o+=" .\n",o}static legacyDatasetToQuads(e){const t=[],r={"blank node":"BlankNode",IRI:"NamedNode",literal:"Literal"};for(const n in e){e[n].forEach(e=>{const i={};for(const t in e){const n=e[t],o={termType:r[n.type],value:n.value};"Literal"===o.termType&&(o.datatype={termType:"NamedNode"},"datatype"in n&&(o.datatype.value=n.datatype),"language"in n?("datatype"in n||(o.datatype.value=Kc),o.language=n.language):"datatype"in n||(o.datatype.value=$c)),i[t]=o}i.graph="@default"===n?{termType:"DefaultGraph",value:""}:{termType:n.startsWith("_:")?"BlankNode":"NamedNode",value:n},t.push(i)})}return t}};function Wc(e,t){for(const r in e)if(e[r].termType!==t[r].termType||e[r].value!==t[r].value)return!1;return"Literal"!==e.object.termType||e.object.datatype.termType===t.object.datatype.termType&&e.object.datatype.value===t.object.datatype.value&&e.object.language===t.object.language}const Xc=/["\\\n\r]/g;const Qc=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g;function Yc(e){return e.replace(Qc,(function(e,t,r,n){if(t)switch(t){case"t":return"\t";case"b":return"\b";case"n":return"\n";case"r":return"\r";case"f":return"\f";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(r)return String.fromCharCode(parseInt(r,16));if(n)throw new Error("Unsupported U escape")}))}const Zc={subject:"s",object:"o",graph:"g"};var eu=class extends class{constructor({maxCallStackDepth:e=500,maxTotalCallStackDepth:t=4294967295,timeSlice:r=10}={}){this.schedule={},this.schedule.MAX_DEPTH=e,this.schedule.MAX_TOTAL_DEPTH=t,this.schedule.depth=0,this.schedule.totalDepth=0,this.schedule.timeSlice=r}doWork(e,t){const r=this.schedule;if(r.totalDepth>=r.MAX_TOTAL_DEPTH)return t(new Error("Maximum total call stack depth exceeded; canonicalization aborting."));!function n(){if(r.depth===r.MAX_DEPTH)return r.depth=0,r.running=!1,Mc.nextTick(n);const i=Date.now();if(r.running||(r.start=Date.now(),r.deadline=r.start+r.timeSlice),i<r.deadline)return r.running=!0,r.depth++,r.totalDepth++,e((e,n)=>{r.depth--,r.totalDepth--,t(e,n)});r.depth=0,r.running=!1,Mc.setImmediate(n)}()}forEach(e,t,r){const n=this;let i,o,a=0;if(Array.isArray(e))o=e.length,i=()=>a!==o&&(i.value=e[a++],i.key=a,!0);else{const t=Object.keys(e);o=t.length,i=()=>a!==o&&(i.key=t[a++],i.value=e[i.key],!0)}!function e(o){return o?r(o):i()?n.doWork(()=>t(i.value,i.key,e)):void r()}()}waterfall(e,t){const r=this;r.forEach(e,(e,t,n)=>r.doWork(e,n),t)}whilst(e,t,r){const n=this;!function i(o){return o?r(o):e()?void n.doWork(t,i):r()}()}}{constructor(e){super(e=e||{}),this.name="URDNA2015",this.options=Object.assign({},e),this.blankNodeInfo={},this.hashToBlankNodes={},this.canonicalIssuer=new Bc("_:c14n"),this.hashAlgorithm="sha256",this.quads}main(e,t){const r=this;let n;r.schedule.start=Date.now(),r.quads=e;const i={};r.waterfall([t=>{r.forEach(e,(e,t,n)=>{r.forEachComponent(e,t=>{if("BlankNode"!==t.termType)return;const n=t.value;n in r.blankNodeInfo?r.blankNodeInfo[n].quads.push(e):(i[n]=!0,r.blankNodeInfo[n]={quads:[e]})}),n()},t)},e=>{let t=!0;r.whilst(()=>t,e=>{t=!1,r.hashToBlankNodes={},r.waterfall([e=>{r.forEach(i,(e,t,n)=>{r.hashFirstDegreeQuads(t,(e,i)=>{if(e)return n(e);i in r.hashToBlankNodes?r.hashToBlankNodes[i].push(t):r.hashToBlankNodes[i]=[t],n()})},e)},e=>{const n=Object.keys(r.hashToBlankNodes).sort();r.forEach(n,(e,n,o)=>{const a=r.hashToBlankNodes[e];if(a.length>1)return o();const s=a[0];r.canonicalIssuer.getId(s),delete i[s],delete r.hashToBlankNodes[e],t=!0,o()},e)}],e)},e)},e=>{const t=Object.keys(r.hashToBlankNodes).sort();r.forEach(t,(e,t,n)=>{const i=[],o=r.hashToBlankNodes[e];r.waterfall([e=>{r.forEach(o,(e,t,n)=>{if(r.canonicalIssuer.hasId(e))return n();const o=new Bc("_:b");o.getId(e),r.hashNDegreeQuads(e,o,(e,t)=>{if(e)return n(e);i.push(t),n()})},e)},e=>{i.sort((e,t)=>e.hash<t.hash?-1:e.hash>t.hash?1:0),r.forEach(i,(e,t,n)=>{for(const t in e.issuer.existing)r.canonicalIssuer.getId(t);n()},e)}],n)},e)},e=>{const t=[];r.waterfall([e=>{r.forEach(r.quads,(e,n,i)=>{r.forEachComponent(e,e=>{"BlankNode"!==e.termType||e.value.startsWith(r.canonicalIssuer.prefix)||(e.value=r.canonicalIssuer.getId(e.value))}),t.push(Jc.serializeQuad(e)),i()},e)},e=>(t.sort(),n=t.join(""),e())],e)}],e=>t(e,n))}hashFirstDegreeQuads(e,t){const r=this,n=r.blankNodeInfo[e];if("hash"in n)return t(null,n.hash);const i=[],o=n.quads;r.forEach(o,(t,n,o)=>{const a={predicate:t.predicate};r.forEachComponent(t,(t,n)=>{a[n]=r.modifyFirstDegreeComponent(e,t,n)}),i.push(Jc.serializeQuad(a)),o()},e=>{if(e)return t(e);i.sort();const o=new zc(r.hashAlgorithm);for(let e=0;e<i.length;++e)o.update(i[e]);n.hash=o.digest(),t(null,n.hash)})}hashRelatedBlankNode(e,t,r,n,i){const o=this;let a;o.waterfall([t=>o.canonicalIssuer.hasId(e)?(a=o.canonicalIssuer.getId(e),t()):r.hasId(e)?(a=r.getId(e),t()):void o.hashFirstDegreeQuads(e,(e,r)=>{if(e)return t(e);a=r,t()})],e=>{if(e)return i(e);const r=new zc(o.hashAlgorithm);return r.update(n),"g"!==n&&r.update(o.getRelatedPredicate(t)),r.update(a),i(null,r.digest())})}hashNDegreeQuads(e,t,r){const n=this;let i;const o=new zc(n.hashAlgorithm);n.waterfall([r=>n.createHashToRelated(e,t,(e,t)=>{if(e)return r(e);i=t,r()}),e=>{const r=Object.keys(i).sort();n.forEach(r,(e,r,a)=>{o.update(e);let s,c="";const u=new qc(i[e]);n.whilst(()=>u.hasNext(),e=>{const r=u.next();let i=t.clone(),o="";const a=[];n.waterfall([t=>{n.forEach(r,(t,r,s)=>{if(n.canonicalIssuer.hasId(t)?o+=n.canonicalIssuer.getId(t):(i.hasId(t)||a.push(t),o+=i.getId(t)),0!==c.length&&o>c)return e();s()},t)},t=>{n.forEach(a,(t,r,a)=>{n.hashNDegreeQuads(t,i,(r,n)=>r?a(r):(o+=i.getId(t),o+="<"+n.hash+">",i=n.issuer,0!==c.length&&o>c?e():void a()))},t)},e=>{(0===c.length||o<c)&&(c=o,s=i),e()}],e)},e=>{if(e)return a(e);o.update(c),t=s,a()})},e)}],e=>{r(e,{hash:o.digest(),issuer:t})})}modifyFirstDegreeComponent(e,t){return"BlankNode"!==t.termType||((t=Mc.clone(t)).value=t.value===e?"_:a":"_:z"),t}getRelatedPredicate(e){return"<"+e.predicate.value+">"}createHashToRelated(e,t,r){const n=this,i={},o=n.blankNodeInfo[e].quads;n.forEach(o,(r,o,a)=>{n.forEach(r,(o,a,s)=>{if("predicate"===a||"BlankNode"!==o.termType||o.value===e)return s();const c=o.value,u=Zc[a];n.hashRelatedBlankNode(c,r,t,u,(e,t)=>{if(e)return s(e);t in i?i[t].push(c):i[t]=[c],s()})},a)},e=>r(e,i))}forEachComponent(e,t){for(const r in e)"predicate"!==r&&t(e[r],r,e)}},tu=class extends eu{constructor(e){super(e),this.name="URGNA2012",this.hashAlgorithm="sha1"}modifyFirstDegreeComponent(e,t,r){return"BlankNode"!==t.termType||((t=Mc.clone(t)).value="name"===r?"_:g":t.value===e?"_:a":"_:z"),t}getRelatedPredicate(e){return e.predicate.value}createHashToRelated(e,t,r){const n=this,i={},o=n.blankNodeInfo[e].quads;n.forEach(o,(r,o,a)=>{let s,c;if("BlankNode"===r.subject.termType&&r.subject.value!==e)c=r.subject.value,s="p";else{if("BlankNode"!==r.object.termType||r.object.value===e)return a();c=r.object.value,s="r"}n.hashRelatedBlankNode(c,r,t,s,(e,t)=>{if(e)return a(e);t in i?i[t].push(c):i[t]=[c],a()})},e=>r(e,i))}};const ru={subject:"s",object:"o",graph:"g"};var nu=class{constructor(){this.name="URDNA2015",this.blankNodeInfo={},this.hashToBlankNodes={},this.canonicalIssuer=new Bc("_:c14n"),this.hashAlgorithm="sha256",this.quads}main(e){const t=this;t.quads=e;const r={};for(const n of e)t.forEachComponent(n,e=>{if("BlankNode"!==e.termType)return;const i=e.value;i in t.blankNodeInfo?t.blankNodeInfo[i].quads.push(n):(r[i]=!0,t.blankNodeInfo[i]={quads:[n]})});let n=!0;for(;n;){n=!1,t.hashToBlankNodes={};for(const e in r){const r=t.hashFirstDegreeQuads(e);r in t.hashToBlankNodes?t.hashToBlankNodes[r].push(e):t.hashToBlankNodes[r]=[e]}const e=Object.keys(t.hashToBlankNodes).sort();for(let i=0;i<e.length;++i){const o=e[i],a=t.hashToBlankNodes[o];if(a.length>1)continue;const s=a[0];t.canonicalIssuer.getId(s),delete r[s],delete t.hashToBlankNodes[o],n=!0}}const i=Object.keys(t.hashToBlankNodes).sort();for(let e=0;e<i.length;++e){const r=[],n=i[e],o=t.hashToBlankNodes[n];for(let e=0;e<o.length;++e){const n=o[e];if(t.canonicalIssuer.hasId(n))continue;const i=new Bc("_:b");i.getId(n);const a=t.hashNDegreeQuads(n,i);r.push(a)}r.sort((e,t)=>e.hash<t.hash?-1:e.hash>t.hash?1:0);for(let e=0;e<r.length;++e){const n=r[e];for(const e in n.issuer.existing)t.canonicalIssuer.getId(e)}}const o=[];for(let e=0;e<t.quads.length;++e){const r=t.quads[e];t.forEachComponent(r,e=>{"BlankNode"!==e.termType||e.value.startsWith(t.canonicalIssuer.prefix)||(e.value=t.canonicalIssuer.getId(e.value))}),o.push(Jc.serializeQuad(r))}return o.sort(),o.join("")}hashFirstDegreeQuads(e){const t=this,r=t.blankNodeInfo[e];if("hash"in r)return r.hash;const n=[],i=r.quads;for(let r=0;r<i.length;++r){const o=i[r],a={predicate:o.predicate};t.forEachComponent(o,(r,n)=>{a[n]=t.modifyFirstDegreeComponent(e,r,n)}),n.push(Jc.serializeQuad(a))}n.sort();const o=new zc(t.hashAlgorithm);for(let e=0;e<n.length;++e)o.update(n[e]);return r.hash=o.digest(),r.hash}hashRelatedBlankNode(e,t,r,n){const i=this;let o;o=i.canonicalIssuer.hasId(e)?i.canonicalIssuer.getId(e):r.hasId(e)?r.getId(e):i.hashFirstDegreeQuads(e);const a=new zc(i.hashAlgorithm);return a.update(n),"g"!==n&&a.update(i.getRelatedPredicate(t)),a.update(o),a.digest()}hashNDegreeQuads(e,t){const r=this,n=new zc(r.hashAlgorithm),i=r.createHashToRelated(e,t),o=Object.keys(i).sort();for(let e=0;e<o.length;++e){const a=o[e];n.update(a);let s,c="";const u=new qc(i[a]);for(;u.hasNext();){const e=u.next();let n=t.clone(),i="";const o=[];let a=!1;for(let t=0;t<e.length;++t){const s=e[t];if(r.canonicalIssuer.hasId(s)?i+=r.canonicalIssuer.getId(s):(n.hasId(s)||o.push(s),i+=n.getId(s)),0!==c.length&&i>c){a=!0;break}}if(!a){for(let e=0;e<o.length;++e){const t=o[e],s=r.hashNDegreeQuads(t,n);if(i+=n.getId(t),i+="<"+s.hash+">",n=s.issuer,0!==c.length&&i>c){a=!0;break}}a||(0===c.length||i<c)&&(c=i,s=n)}}n.update(c),t=s}return{hash:n.digest(),issuer:t}}modifyFirstDegreeComponent(e,t){return"BlankNode"!==t.termType||((t=Mc.clone(t)).value=t.value===e?"_:a":"_:z"),t}getRelatedPredicate(e){return"<"+e.predicate.value+">"}createHashToRelated(e,t){const r=this,n={},i=r.blankNodeInfo[e].quads;for(let o=0;o<i.length;++o){const a=i[o];for(const i in a){const o=a[i];if("predicate"===i||"BlankNode"!==o.termType||o.value===e)continue;const s=o.value,c=ru[i],u=r.hashRelatedBlankNode(s,a,t,c);u in n?n[u].push(s):n[u]=[s]}}return n}forEachComponent(e,t){for(const r in e)"predicate"!==r&&t(e[r],r,e)}},iu=class extends nu{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="sha1"}modifyFirstDegreeComponent(e,t,r){return"BlankNode"!==t.termType||((t=Mc.clone(t)).value="name"===r?"_:g":t.value===e?"_:a":"_:z"),t}getRelatedPredicate(e){return e.predicate.value}createHashToRelated(e,t){const r=this,n={},i=r.blankNodeInfo[e].quads;for(let o=0;o<i.length;++o){const a=i[o];let s,c;if("BlankNode"===a.subject.termType&&a.subject.value!==e)c=a.subject.value,s="p";else{if("BlankNode"!==a.object.termType||a.object.value===e)continue;c=a.object.value,s="r"}const u=r.hashRelatedBlankNode(c,a,t,s);u in n?n[u].push(c):n[u]=[c]}return n}},ou=rr(Object.freeze({__proto__:null,default:{}}));let au;try{au=ou}catch(e){}const su={};var cu=su;su.NQuads=Jc,su.IdentifierIssuer=Bc,su._rdfCanonizeNative=function(e){return e&&(au=e),au},su.canonize=Mc.callbackify((async function(e,t){let r;const n=new Promise((e,t)=>{r=(r,n)=>{if(r)return t(r);e(n)}});if(Array.isArray(e)||(e=su.NQuads.legacyDatasetToQuads(e)),t.useNative){if(!au)throw new Error("rdf-canonize-native not available");au.canonize(e,t,r)}else if("URDNA2015"===t.algorithm)new eu(t).main(e,r);else{if("URGNA2012"!==t.algorithm)throw"algorithm"in t?new Error("Invalid RDF Dataset Canonicalization algorithm: "+t.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.");new tu(t).main(e,r)}return n})),su.canonizeSync=function(e,t){if(Array.isArray(e)||(e=su.NQuads.legacyDatasetToQuads(e)),t.useNative){if(au)return au.canonizeSync(e,t);throw new Error("rdf-canonize-native not available")}if("URDNA2015"===t.algorithm)return new nu(t).main(e);if("URGNA2012"===t.algorithm)return new iu(t).main(e);if(!("algorithm"in t))throw new Error("No RDF Dataset Canonicalization algorithm specified.");throw new Error("Invalid RDF Dataset Canonicalization algorithm: "+t.algorithm)};const uu={};var lu=uu;uu.isArray=Array.isArray,uu.isBoolean=e=>"boolean"==typeof e||"[object Boolean]"===Object.prototype.toString.call(e),uu.isDouble=e=>uu.isNumber(e)&&-1!==String(e).indexOf("."),uu.isEmptyObject=e=>uu.isObject(e)&&0===Object.keys(e).length,uu.isNumber=e=>"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e),uu.isNumeric=e=>!isNaN(parseFloat(e))&&isFinite(e),uu.isObject=e=>"[object Object]"===Object.prototype.toString.call(e),uu.isString=e=>"string"==typeof e||"[object String]"===Object.prototype.toString.call(e),uu.isUndefined=e=>void 0===e;const fu={};var hu=fu;fu.isSubject=e=>{if(lu.isObject(e)&&!("@value"in e||"@set"in e||"@list"in e)){return Object.keys(e).length>1||!("@id"in e)}return!1},fu.isSubjectReference=e=>lu.isObject(e)&&1===Object.keys(e).length&&"@id"in e,fu.isValue=e=>lu.isObject(e)&&"@value"in e,fu.isList=e=>lu.isObject(e)&&"@list"in e,fu.isGraph=e=>lu.isObject(e)&&"@graph"in e&&1===Object.keys(e).filter(e=>"@id"!==e&&"@index"!==e).length,fu.isSimpleGraph=e=>fu.isGraph(e)&&!("@id"in e),fu.isBlankNode=e=>!!lu.isObject(e)&&("@id"in e?0===e["@id"].indexOf("_:"):0===Object.keys(e).length||!("@value"in e||"@set"in e||"@list"in e));var du=class extends Error{constructor(e="An unspecified JSON-LD error occurred.",t="jsonld.Error",r={}){super(e),this.name=t,this.message=e,this.details=r}};const pu=cu.IdentifierIssuer,mu=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,gu=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,vu=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,yu={accept:"application/ld+json, application/json"},bu={};var wu=bu;bu.IdentifierIssuer=pu;const _u="function"==typeof setImmediate&&setImmediate,Su=_u?e=>_u(e):e=>setTimeout(e,0);function Eu(e,t,r){bu.nextTick(()=>e(t,r))}bu.nextTick="object"==typeof ft?Ye:Su,bu.setImmediate=_u?Su:bu.nextTick,bu.clone=function(e){if(e&&"object"==typeof e){let t;if(lu.isArray(e)){t=[];for(let r=0;r<e.length;++r)t[r]=bu.clone(e[r])}else if(e instanceof Map){t=new Map;for(const[r,n]of e)t.set(r,bu.clone(n))}else if(e instanceof Set){t=new Set;for(const r of e)t.add(bu.clone(r))}else if(lu.isObject(e)){t={};for(const r in e)t[r]=bu.clone(e[r])}else t=e.toString();return t}return e},bu.asArray=function(e){return Array.isArray(e)?e:[e]},bu.buildHeaders=(e={})=>{if(Object.keys(e).some(e=>"accept"===e.toLowerCase()))throw new RangeError('Accept header may not be specified; only "'+yu.accept+'" is supported.');return Object.assign({Accept:yu.accept},e)},bu.parseLinkHeader=e=>{const t={},r=e.match(mu);for(let e=0;e<r.length;++e){let n=r[e].match(gu);if(!n)continue;const i={target:n[1]},o=n[2];for(;n=vu.exec(o);)i[n[1]]=void 0===n[2]?n[3]:n[2];const a=i.rel||"";Array.isArray(t[a])?t[a].push(i):t.hasOwnProperty(a)?t[a]=[t[a],i]:t[a]=i}return t},bu.validateTypeValue=e=>{if(lu.isString(e)||lu.isEmptyObject(e))return;let t=!1;if(lu.isArray(e)){t=!0;for(let r=0;r<e.length;++r)if(!lu.isString(e[r])){t=!1;break}}if(!t)throw new du('Invalid JSON-LD syntax; "@type" value must a string, an array of strings, or an empty object.',"jsonld.SyntaxError",{code:"invalid type value",value:e})},bu.hasProperty=(e,t)=>{if(e.hasOwnProperty(t)){const r=e[t];return!lu.isArray(r)||r.length>0}return!1},bu.hasValue=(e,t,r)=>{if(bu.hasProperty(e,t)){let n=e[t];const i=hu.isList(n);if(lu.isArray(n)||i){i&&(n=n["@list"]);for(let e=0;e<n.length;++e)if(bu.compareValues(r,n[e]))return!0}else if(!lu.isArray(r))return bu.compareValues(r,n)}return!1},bu.addValue=(e,t,r,n)=>{if("propertyIsArray"in(n=n||{})||(n.propertyIsArray=!1),"valueIsArray"in n||(n.valueIsArray=!1),"allowDuplicate"in n||(n.allowDuplicate=!0),n.valueIsArray)e[t]=r;else if(lu.isArray(r)){0===r.length&&n.propertyIsArray&&!e.hasOwnProperty(t)&&(e[t]=[]);for(let i=0;i<r.length;++i)bu.addValue(e,t,r[i],n)}else if(e.hasOwnProperty(t)){const i=!n.allowDuplicate&&bu.hasValue(e,t,r);lu.isArray(e[t])||i&&!n.propertyIsArray||(e[t]=[e[t]]),i||e[t].push(r)}else e[t]=n.propertyIsArray?[r]:r},bu.getValues=(e,t)=>[].concat(e[t]||[]),bu.removeProperty=(e,t)=>{delete e[t]},bu.removeValue=(e,t,r,n)=>{"propertyIsArray"in(n=n||{})||(n.propertyIsArray=!1);const i=bu.getValues(e,t).filter(e=>!bu.compareValues(e,r));0===i.length?bu.removeProperty(e,t):1!==i.length||n.propertyIsArray?e[t]=i:e[t]=i[0]},bu.relabelBlankNodes=(e,t)=>function e(t,r){if(lu.isArray(r))for(let n=0;n<r.length;++n)r[n]=e(t,r[n]);else if(hu.isList(r))r["@list"]=e(t,r["@list"]);else if(lu.isObject(r)){hu.isBlankNode(r)&&(r["@id"]=t.getId(r["@id"]));const n=Object.keys(r).sort();for(let i=0;i<n.length;++i){const o=n[i];"@id"!==o&&(r[o]=e(t,r[o]))}}return r}((t=t||{}).issuer||new pu("_:b"),e),bu.compareValues=(e,t)=>e===t||(!(!hu.isValue(e)||!hu.isValue(t)||e["@value"]!==t["@value"]||e["@type"]!==t["@type"]||e["@language"]!==t["@language"]||e["@index"]!==t["@index"])||!!(lu.isObject(e)&&"@id"in e&&lu.isObject(t)&&"@id"in t)&&e["@id"]===t["@id"]),bu.compareShortestLeast=(e,t)=>e.length<t.length?-1:t.length<e.length?1:e===t?0:e<t?-1:1,bu.normalizeDocumentLoader=e=>e.length<2?bu.callbackify(e):async function(t){const r=arguments[1];return new Promise((n,i)=>{try{e(t,(e,t)=>{if("function"==typeof r)return Eu(r,e,t);e?i(e):n(t)})}catch(e){if("function"==typeof r)return Eu(r,e);i(e)}})},bu.callbackify=e=>async function(...t){const r=t[t.length-1];let n;"function"==typeof r&&t.pop();try{n=await e.apply(null,t)}catch(e){if("function"==typeof r)return Eu(r,e);throw e}return"function"==typeof r?Eu(r,null,n):n};var xu=cu.NQuads;const Iu="http://www.w3.org/1999/02/22-rdf-syntax-ns#",ku="http://www.w3.org/2001/XMLSchema#";var Pu={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",RDF:Iu,RDF_LIST:Iu+"List",RDF_FIRST:Iu+"first",RDF_REST:Iu+"rest",RDF_NIL:Iu+"nil",RDF_TYPE:Iu+"type",RDF_PLAIN_LITERAL:Iu+"PlainLiteral",RDF_XML_LITERAL:Iu+"XMLLiteral",RDF_JSON_LITERAL:Iu+"JSON",RDF_OBJECT:Iu+"object",RDF_LANGSTRING:Iu+"langString",XSD:ku,XSD_BOOLEAN:ku+"boolean",XSD_DOUBLE:ku+"double",XSD_INTEGER:ku+"integer",XSD_STRING:ku+"string"};const{RDF_LANGSTRING:Ou,RDF_PLAIN_LITERAL:Au,RDF_OBJECT:Tu,RDF_XML_LITERAL:Cu,XSD_STRING:Nu}=Pu;let Ru;Ru="undefined"!=typeof Node?Node:{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12};function Mu(){return"undefined"==typeof XMLSerializer?ou.XMLSerializer:XMLSerializer}const{clone:Lu}=wu;const ju={};var Du=ju;ju.parsers={simple:{keys:["href","scheme","authority","path","query","fragment"],regex:/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/},full:{keys:["href","protocol","scheme","authority","auth","user","password","hostname","port","path","directory","file","query","fragment"],regex:/^(([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},ju.parse=(e,t)=>{const r={},n=ju.parsers[t||"full"],i=n.regex.exec(e);let o=n.keys.length;for(;o--;)r[n.keys[o]]=void 0===i[o]?null:i[o];return("https"===r.scheme&&"443"===r.port||"http"===r.scheme&&"80"===r.port)&&(r.href=r.href.replace(":"+r.port,""),r.authority=r.authority.replace(":"+r.port,""),r.port=null),r.normalizedPath=ju.removeDotSegments(r.path),r},ju.prependBase=(e,t)=>{if(null===e)return t;if(-1!==t.indexOf(":"))return t;lu.isString(e)&&(e=ju.parse(e||""));const r=ju.parse(t),n={protocol:e.protocol||""};if(null!==r.authority)n.authority=r.authority,n.path=r.path,n.query=r.query;else if(n.authority=e.authority,""===r.path)n.path=e.path,null!==r.query?n.query=r.query:n.query=e.query;else{if(0===r.path.indexOf("/"))n.path=r.path;else{let t=e.path;t=t.substr(0,t.lastIndexOf("/")+1),t.length>0&&"/"!==t.substr(-1)&&(t+="/"),t+=r.path,n.path=t}n.query=r.query}""!==r.path&&(n.path=ju.removeDotSegments(n.path));let i=n.protocol;return null!==n.authority&&(i+="//"+n.authority),i+=n.path,null!==n.query&&(i+="?"+n.query),null!==r.fragment&&(i+="#"+r.fragment),""===i&&(i="./"),i},ju.removeBase=(e,t)=>{if(null===e)return t;lu.isString(e)&&(e=ju.parse(e||""));let r="";if(""!==e.href?r+=(e.protocol||"")+"//"+(e.authority||""):t.indexOf("//")&&(r+="//"),0!==t.indexOf(r))return t;const n=ju.parse(t.substr(r.length)),i=e.normalizedPath.split("/"),o=n.normalizedPath.split("/"),a=n.fragment||n.query?0:1;for(;i.length>0&&o.length>a&&i[0]===o[0];)i.shift(),o.shift();let s="";if(i.length>0){i.pop();for(let e=0;e<i.length;++e)s+="../"}return s+=o.join("/"),null!==n.query&&(s+="?"+n.query),null!==n.fragment&&(s+="#"+n.fragment),""===s&&(s="./"),s},ju.removeDotSegments=e=>{if(0===e.length)return"";const t=e.split("/"),r=[];for(;t.length>0;){const e=t.shift(),n=0===t.length;"."!==e?".."!==e?r.push(e):(r.pop(),n&&r.push("")):n&&r.push("")}return r.length>0&&""!==r[0]&&r.unshift(""),1===r.length&&""===r[0]?"/":r.join("/")};const Bu=/^([A-Za-z][A-Za-z0-9+-.]*|_):/;ju.isAbsolute=e=>lu.isString(e)&&Bu.test(e),ju.isRelative=e=>lu.isString(e);const{isArray:Uu,isObject:Fu,isString:Hu,isUndefined:Vu}=lu,{isAbsolute:zu,isRelative:qu,prependBase:Ku,parse:$u}=Du,{asArray:Gu,compareShortestLeast:Ju}=wu,Wu=new Map,Xu={};var Qu=Xu;function Yu(e,t,r,n,i,o){if(null===t||!Hu(t)||Xu.isKeyword(t))return t;if(n&&n.hasOwnProperty(t)&&!0!==i.get(t)&&Xu.createTermDefinition(e,n,t,i,o),e.isPropertyTermScoped&&e.previousContext&&(e=e.previousContext),(r=r||{}).vocab){const r=e.mappings.get(t);if(null===r)return null;if(r)return r["@id"]}const a=t.indexOf(":");if(-1!==a){const r=t.substr(0,a),s=t.substr(a+1);if("_"===r||0===s.indexOf("//"))return t;if(n&&n.hasOwnProperty(r)&&Xu.createTermDefinition(e,n,r,i,o),e.mappings.has(r)){return e.mappings.get(r)["@id"]+s}return t}return r.vocab&&"@vocab"in e?e["@vocab"]+t:r.base?Ku(e["@base"],t):t}function Zu(e,t,r,n){if(Uu(e))for(const i of e)Zu(i,t,r,n);else if(Fu(e))for(const i in e){if("@context"!==i){Zu(e[i],t,r,n);continue}const o=e[i];if(Uu(o)){let e=o.length;for(let i=0;i<e;++i){const a=o[i];if(Hu(a)){const s=Ku(n,a),c=t.get(s);r?Uu(c)?(Array.prototype.splice.apply(o,[i,1].concat(c)),i+=c.length-1,e=o.length):!1!==c&&(o[i]=c):void 0===c&&t.set(s,!1)}else for(const e in a)Fu(a[e])&&Zu(a[e],t,r,n)}}else if(Hu(o)){const a=Ku(n,o),s=t.get(a);r?!1!==s&&(e[i]=s):void 0===s&&t.set(a,!1)}else for(const e in o)Fu(o[e])&&Zu(o[e],t,r,n)}}Xu.cache=new class{constructor(e=100){this.order=[],this.cache=new Map,this.size=e}get(e,t){const r=this.cache.get(e);if(r){const e=JSON.stringify(t);return r.get(e)||null}return null}set(e,t,r){if(this.order.length===this.size){const e=this.order.shift();this.cache.get(e.activeCtx).delete(e.localCtx)}const n=JSON.stringify(t);this.order.push({activeCtx:e,localCtx:n});let i=this.cache.get(e);i||(i=new Map,this.cache.set(e,i)),i.set(n,Lu(r))}},Xu.process=({activeCtx:e,localCtx:t,options:r,isPropertyTermScopedContext:n=!1,isTypeScopedContext:i=!1})=>{Fu(t)&&"@context"in t&&Uu(t["@context"])&&(t=t["@context"]);const o=Gu(t);if(0===o.length)return e;const a=e.previousContext||e;if(n&&e.previousContext)return(e=e.clone()).isPropertyTermScoped=!0,e.previousContext=Xu.process({activeCtx:e.previousContext,localCtx:o,options:r,isPropertyTermScopedContext:n}),e;let s=e;for(let c=0;c<o.length;++c){let u=o[c];if(e=s,null===u){if(!n&&0!==Object.keys(e.protected).length){const n=r&&r.protectedMode||"error";if("error"===n)throw new du("Tried to nullify a context with protected terms outside of a term definition.","jsonld.SyntaxError",{code:"invalid context nullification"});if("warn"===n){console.warn("WARNING: invalid context nullification");const t=e;s=e=Xu.getInitialContext(r).clone();for(const[r,n]of Object.entries(t.protected))n&&(e.mappings[r]=wu.clone(t.mappings[r]));e.protected=wu.clone(t.protected),Xu.cache&&Xu.cache.set(t,u,s);continue}throw new du("Invalid protectedMode.","jsonld.SyntaxError",{code:"invalid protected mode",context:t,protectedMode:n})}s=e=Xu.getInitialContext(r).clone(),i&&(s.previousContext=a.clone());continue}if(Xu.cache){const t=Xu.cache.get(e,u);if(t){s=e=t;continue}}if(Fu(u)&&"@context"in u&&(u=u["@context"]),!Fu(u))throw new du("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:u});s=s.clone();const l=new Map;if("@version"in u){if(1.1!==u["@version"])throw new du("Unsupported JSON-LD version: "+u["@version"],"jsonld.UnsupportedVersion",{code:"invalid @version value",context:u});if(e.processingMode&&"json-ld-1.0"===e.processingMode)throw new du("@version: "+u["@version"]+" not compatible with "+e.processingMode,"jsonld.ProcessingModeConflict",{code:"processing mode conflict",context:u});s.processingMode="json-ld-1.1",s["@version"]=u["@version"],l.set("@version",!0)}if(s.processingMode=s.processingMode||e.processingMode||"json-ld-1.0","@base"in u){let t=u["@base"];if(null===t);else if(zu(t))t=$u(t);else{if(!qu(t))throw new du('Invalid JSON-LD syntax; the value of "@base" in a @context must be an absolute IRI, a relative IRI, or null.',"jsonld.SyntaxError",{code:"invalid base IRI",context:u});t=$u(Ku(e["@base"].href,t))}s["@base"]=t,l.set("@base",!0)}if("@vocab"in u){const e=u["@vocab"];if(null===e)delete s["@vocab"];else{if(!Hu(e))throw new du('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:u});if(!zu(e))throw new du('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be an absolute IRI.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:u});s["@vocab"]=e}l.set("@vocab",!0)}if("@language"in u){const e=u["@language"];if(null===e)delete s["@language"];else{if(!Hu(e))throw new du('Invalid JSON-LD syntax; the value of "@language" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid default language",context:u});s["@language"]=e.toLowerCase()}l.set("@language",!0)}l.set("@protected",u["@protected"]||!1);for(const e in u)Xu.createTermDefinition(s,u,e,l,r,n);i&&!s.previousContext&&(s.previousContext=a.clone()),Xu.cache&&Xu.cache.set(e,u,s)}return s},Xu.createTermDefinition=(e,t,r,n,i,o=!1)=>{if(n.has(r)){if(n.get(r))return;throw new du("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:t,term:r})}if(n.set(r,!1),Xu.isKeyword(r))throw new du("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:t,term:r});if(""===r)throw new du("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:t});const a=e.mappings.get(r);let s;if(e.mappings.has(r)&&e.mappings.delete(r),t.hasOwnProperty(r)&&(s=t[r]),null===s||Fu(s)&&null===s["@id"])return e.mappings.set(r,null),void n.set(r,!0);let c=!1;if(Hu(s)&&(c=!0,s={"@id":s}),!Fu(s))throw new du("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:t});const u={};e.mappings.set(r,u),u.reverse=!1;const l=["@container","@id","@language","@reverse","@type"];Xu.processingMode(e,1.1)&&l.push("@context","@nest","@prefix","@protected");for(const e in s)if(!l.includes(e))throw new du("Invalid JSON-LD syntax; a term definition must not contain "+e,"jsonld.SyntaxError",{code:"invalid term definition",context:t});const f=r.indexOf(":");if(u._termHasColon=-1!==f,"@reverse"in s){if("@id"in s)throw new du("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});if("@nest"in s)throw new du("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});const r=s["@reverse"];if(!Hu(r))throw new du("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});const o=Yu(e,r,{vocab:!0,base:!1},t,n,i);if(!zu(o))throw new du("Invalid JSON-LD syntax; a @context @reverse value must be an absolute IRI or a blank node identifier.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});u["@id"]=o,u.reverse=!0}else if("@id"in s){let o=s["@id"];if(!Hu(o))throw new du("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(o!==r){if(o=Yu(e,o,{vocab:!0,base:!1},t,n,i),!zu(o)&&!Xu.isKeyword(o))throw new du("Invalid JSON-LD syntax; a @context @id value must be an absolute IRI, a blank node identifier, or a keyword.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});u["@id"]=o,u._prefix=!u._termHasColon&&o.match(/[:\/\?#\[\]@]$/)&&(c||Xu.processingMode(e,1))}}if(!("@id"in u))if(u._termHasColon){const o=r.substr(0,f);if(t.hasOwnProperty(o)&&Xu.createTermDefinition(e,t,o,n,i),e.mappings.has(o)){const t=r.substr(f+1);u["@id"]=e.mappings.get(o)["@id"]+t}else u["@id"]=r}else{if(!("@vocab"in e))throw new du("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t,term:r});u["@id"]=e["@vocab"]+r}if((!0===s["@protected"]||!0===n.get("@protected")&&!1!==s["@protected"])&&(e.protected[r]=!0,u.protected=!0),n.set(r,!0),"@type"in s){let r=s["@type"];if(!Hu(r))throw new du("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:t});if("@id"!==r&&"@vocab"!==r&&"@json"!==r){if(r=Yu(e,r,{vocab:!0,base:!1},t,n,i),!zu(r))throw new du("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:t});if(0===r.indexOf("_:"))throw new du("Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:t})}u["@type"]=r}if("@container"in s){const r=Hu(s["@container"])?[s["@container"]]:s["@container"]||[],n=["@list","@set","@index","@language"];let i=!0;const o=r.includes("@set");if(Xu.processingMode(e,1.1))if(n.push("@graph","@id","@type"),r.includes("@list")){if(1!==r.length)throw new du("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:t})}else if(r.includes("@graph")){if(r.some(e=>"@graph"!==e&&"@id"!==e&&"@index"!==e&&"@set"!==e))throw new du("Invalid JSON-LD syntax; @context @container with @graph must have no other values other than @id, @index, and @set","jsonld.SyntaxError",{code:"invalid container mapping",context:t})}else i&=r.length<=(o?2:1);else i&=!Uu(s["@container"]),i&=r.length<=1;if(i&=r.every(e=>n.includes(e)),i&=!(o&&r.includes("@list")),!i)throw new du("Invalid JSON-LD syntax; @context @container value must be one of the following: "+n.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:t});if(u.reverse&&!r.every(e=>["@index","@set"].includes(e)))throw new du("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});u["@container"]=r}if("@context"in s&&(u["@context"]=s["@context"]),"@language"in s&&!("@type"in s)){let e=s["@language"];if(null!==e&&!Hu(e))throw new du("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:t});null!==e&&(e=e.toLowerCase()),u["@language"]=e}if("@prefix"in s){if(u._termHasColon)throw new du("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:t});if("boolean"!=typeof s["@prefix"])throw new du("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:t});u._prefix=!0===s["@prefix"]}if("@nest"in s){const e=s["@nest"];if(!Hu(e)||"@nest"!==e&&0===e.indexOf("@"))throw new du("Invalid JSON-LD syntax; @context @nest value must be a string which is not a keyword other than @nest.","jsonld.SyntaxError",{code:"invalid @nest value",context:t});u["@nest"]=e} // disallow aliasing @context and @preserve const h=u["@id"];if("@context"===h||"@preserve"===h)throw new du("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:t});if(a&&a.protected&&!o&&(e.protected[r]=!0,u.protected=!0,!function e(t,r){if(!t||"object"!=typeof t||!r||"object"!=typeof r)return t===r;const n=Array.isArray(t);if(n!==Array.isArray(r))return!1;if(n){if(t.length!==r.length)return!1;for(let n=0;n<t.length;++n)if(!e(t[n],r[n]))return!1;return!0}const i=Object.keys(t),o=Object.keys(r);if(i.length!==o.length)return!1;for(const n in t){let i=t[n],o=r[n];if("@container"===n&&Array.isArray(i)&&Array.isArray(o)&&(i=i.slice().sort(),o=o.slice().sort()),!e(i,o))return!1}return!0}(a,u))){const e=i&&i.protectedMode||"error";if("error"===e)throw new du("Invalid JSON-LD syntax; tried to redefine a protected term.","jsonld.SyntaxError",{code:"protected term redefinition",context:t,term:r});if("warn"===e)return void console.warn("WARNING: protected term redefinition",{term:r});throw new du("Invalid protectedMode.","jsonld.SyntaxError",{code:"invalid protected mode",context:t,term:r,protectedMode:e})}},Xu.expandIri=(e,t,r,n)=>Yu(e,t,r,void 0,void 0,n),Xu.getInitialContext=e=>{const t=$u(e.base||""),r=JSON.stringify({base:t,processingMode:e.processingMode}),n=Wu.get(r);if(n)return n;const i={"@base":t,processingMode:e.processingMode,mappings:new Map,inverse:null,getInverse:function(){const e=this;if(e.inverse)return e.inverse;const t=e.inverse={},r=e.fastCurieMap={},n={},i=e["@language"]||"@none",s=e.mappings,c=[...s.keys()].sort(Ju);for(const e of c){const o=s.get(e);if(null===o)continue;let c=o["@container"]||"@none";c=[].concat(c).sort().join("");const u=Gu(o["@id"]);for(const s of u){let u=t[s];const l=Xu.isKeyword(s);if(u)l||o._termHasColon||n[s].push(e);else if(t[s]=u={},!l&&!o._termHasColon){n[s]=[e];const t={iri:s,terms:n[s]};s[0]in r?r[s[0]].push(t):r[s[0]]=[t]}if(u[c]||(u[c]={"@language":{},"@type":{},"@any":{}}),u=u[c],a(e,u["@any"],"@none"),o.reverse)a(e,u["@type"],"@reverse");else if("@type"in o)a(e,u["@type"],o["@type"]);else if("@language"in o){const t=o["@language"]||"@null";a(e,u["@language"],t)}else a(e,u["@language"],i),a(e,u["@type"],"@none"),a(e,u["@language"],"@none")}}for(const e in r)o(r,e,1);return t},clone:function(){const e={};e["@base"]=this["@base"],e.mappings=wu.clone(this.mappings),e.clone=this.clone,e.inverse=null,e.getInverse=this.getInverse,e.protected=wu.clone(this.protected),this.previousContext&&(e.isPropertyTermScoped=this.previousContext.isPropertyTermScoped,e.previousContext=this.previousContext.clone());e.revertTypeScopedContext=this.revertTypeScopedContext,"@language"in this&&(e["@language"]=this["@language"]);"@vocab"in this&&(e["@vocab"]=this["@vocab"]);return e},revertTypeScopedContext:function(){if(!this.previousContext)return this;return this.previousContext.clone()},protected:{}};return 1e4===Wu.size&&Wu.clear(),Wu.set(r,i),i;function o(e,t,r){const n=e[t],i=e[t]={};let a,s;for(const e of n)a=e.iri,s=r>=a.length?"":a[r],s in i?i[s].push(e):i[s]=[e];for(const e in i)""!==e&&o(i,e,r+1)}function a(e,t,r){t.hasOwnProperty(r)||(t[r]=e)}},Xu.getContextValue=(e,t,r)=>{if(null===t){if("@context"===r)return;return null}if(e.mappings.has(t)){const n=e.mappings.get(t);if(Vu(r))return n;if(n.hasOwnProperty(r))return n[r]}return"@language"===r&&e.hasOwnProperty(r)?e[r]:"@context"!==r?null:void 0},Xu.getAllContexts=async(e,t)=>async function(e,t){const r=wu.normalizeDocumentLoader(t.documentLoader);return await n(e,new Set,r),e;async function n(e,r,i){if(r.size>10)throw new du("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"loading remote context failed",max:10});const o=new Map;if(Zu(e,o,!1,t.base),0===o.size)return;const a=[...o.keys()].filter(e=>!1===o.get(e));return Promise.all(a.map(async a=>{if(r.has(a))throw new du("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"recursive context inclusion",url:a});const s=new Set(r);let c,u;s.add(a);try{c=await i(a),u=c.document||null,Hu(u)&&(u=JSON.parse(u))}catch(e){throw new du("Dereferencing a URL did not result in a valid JSON-LD object. Possible causes are an inaccessible URL perhaps due to a same-origin policy (ensure the server uses CORS if you are using client-side JavaScript), too many redirects, a non-JSON response, or more than one HTTP Link Header was provided for a remote context.","jsonld.InvalidUrl",{code:"loading remote context failed",url:a,cause:e})}if(!Fu(u))throw new du("Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object.","jsonld.InvalidUrl",{code:"invalid remote context",url:a});u="@context"in u?{"@context":u["@context"]}:{"@context":{}},c.contextUrl&&(Uu(u["@context"])||(u["@context"]=[u["@context"]]),u["@context"].push(c.contextUrl)),await n(u,s,i),o.set(a,u["@context"]),Zu(e,o,!0,t.base)}))}}(e,t),Xu.processingMode=(e,t)=>t.toString()>="1.1"?e.processingMode&&e.processingMode>="json-ld-"+t.toString():!e.processingMode||"json-ld-1.0"===e.processingMode,Xu.isKeyword=e=>{if(!Hu(e))return!1;switch(e){case"@base":case"@container":case"@context":case"@default":case"@embed":case"@explicit":case"@graph":case"@id":case"@index":case"@json":case"@language":case"@list":case"@nest":case"@none":case"@omitDefault":case"@prefix":case"@preserve":case"@protected":case"@requireAll":case"@reverse":case"@set":case"@type":case"@value":case"@version":case"@vocab":return!0}return!1};const{isArray:el,isObject:tl,isEmptyObject:rl,isString:nl,isUndefined:il}=lu,{isList:ol,isValue:al,isGraph:sl}=hu,{expandIri:cl,getContextValue:ul,isKeyword:ll,process:fl,processingMode:hl}=Qu,{isAbsolute:dl}=Du,{addValue:pl,asArray:ml,getValues:gl,validateTypeValue:vl}=wu,yl={};var bl=yl;function wl(e,t,r){const n=[],i=Object.keys(t).sort();for(const o of i){const i=cl(e,o,{vocab:!0},r);let a=t[o];el(a)||(a=[a]);for(const e of a){if(null===e)continue;if(!nl(e))throw new du("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:t});const r={"@value":e};"@none"!==i&&(r["@language"]=o.toLowerCase()),n.push(r)}}return n}function _l({activeCtx:e,options:t,activeProperty:r,value:n,expansionMap:i,asGraph:o,indexKey:a}){const s=[],c=Object.keys(n).sort(),u="@type"===a;for(let l of c){if(u){const r=ul(e,l,"@context");il(r)||(e=fl({activeCtx:e,localCtx:r,isTypeScopedContext:!0,options:t}))}let c=n[l];el(c)||(c=[c]);const f=cl(e,l,{vocab:!0},t);"@id"===a?l=cl(e,l,{base:!0},t):u&&(l=f),c=yl.expand({activeCtx:e,activeProperty:r,element:c,options:t,insideList:!1,insideIndex:!0,expansionMap:i});for(let e of c)o&&!sl(e)&&(e={"@graph":[e]}),"@type"===a?"@none"===f||(e["@type"]?e["@type"]=[l].concat(e["@type"]):e["@type"]=[l]):"@none"===f||a in e||(e[a]=l),s.push(e)}return s}yl.expand=({activeCtx:e,activeProperty:t=null,element:r,options:n={},insideList:i=!1,insideIndex:o=!1,typeScopedContext:a=null,expansionMap:s=(()=>{})})=>{if(null==r)return null;if("@default"===t&&(n=Object.assign({},n,{isFrame:!1})),!el(r)&&!tl(r)){if(!i&&(null===t||"@graph"===cl(e,t,{vocab:!0},n))){const o=s({unmappedValue:r,activeCtx:e,activeProperty:t,options:n,insideList:i});return void 0===o?null:o}return function({activeCtx:e,activeProperty:t,value:r,options:n}){if(null==r)return null;const i=cl(e,t,{vocab:!0},n);if("@id"===i)return cl(e,r,{base:!0},n);if("@type"===i)return cl(e,r,{vocab:!0,base:!0},n);const o=ul(e,t,"@type");if(("@id"===o||"@graph"===i)&&nl(r))return{"@id":cl(e,r,{base:!0},n)};if("@vocab"===o&&nl(r))return{"@id":cl(e,r,{vocab:!0,base:!0},n)};if(ll(i))return r;const a={};if(o&&!["@id","@vocab"].includes(o))a["@type"]=o;else if(nl(r)){const r=ul(e,t,"@language");null!==r&&(a["@language"]=r)}["boolean","number","string"].includes(typeof r)||(r=r.toString());return a["@value"]=r,a}({activeCtx:e,activeProperty:t,value:r,options:n})}if(el(r)){let c=[];const u=ul(e,t,"@container")||[];i=i||u.includes("@list");for(let u=0;u<r.length;++u){let l=yl.expand({activeCtx:e,activeProperty:t,element:r[u],options:n,expansionMap:s,insideIndex:o,typeScopedContext:a});i&&el(l)&&(l={"@list":l}),null===l&&(l=s({unmappedValue:r[u],activeCtx:e,activeProperty:t,parent:r,index:u,options:n,expandedParent:c,insideList:i}),void 0===l)||(el(l)?c=c.concat(l):c.push(l))}return c}const c=cl(e,t,{vocab:!0},n);a=a||(e.previousContext?e:null);let u=Object.keys(r).sort(),l=!o;if(l&&a&&u.length<=2&&!u.includes("@context"))for(const t of u){const r=cl(a,t,{vocab:!0},n);if("@value"===r){l=!1,e=a;break}if("@id"===r&&1===u.length){l=!1;break}}l&&(e=e.revertTypeScopedContext()),"@context"in r&&(e=fl({activeCtx:e,localCtx:r["@context"],options:n}));for(const t of u){if("@type"===cl(e,t,{vocab:!0},n)){const i=r[t],o=Array.isArray(i)?i.length>1?i.slice().sort():i:[i];for(const t of o){const r=ul(e.previousContext||e,t,"@context");il(r)||(e=fl({activeCtx:e,localCtx:r,options:n,isTypeScopedContext:!0}))}}}let f={};!function e({activeCtx:t,activeProperty:r,expandedActiveProperty:n,element:i,expandedParent:o,options:a={},insideList:s,expansionMap:c}){const u=Object.keys(i).sort(),l=[];for(const e of u){let u,f=i[e];if("@context"===e)continue;let h=cl(t,e,{vocab:!0},a);if((null===h||!dl(h)&&!ll(h))&&(h=c({unmappedProperty:e,activeCtx:t,activeProperty:r,parent:i,options:a,insideList:s,value:f,expandedParent:o}),void 0===h))continue;if(ll(h)){if("@reverse"===n)throw new du("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:f});if(h in o)throw new du("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:h})}if("@id"===h){if(!nl(f)){if(!a.isFrame)throw new du('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:f});if(tl(f)){if(!rl(f))throw new du('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:f})}else{if(!el(f))throw new du('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:f});if(!f.every(e=>nl(e)))throw new du('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:f})}}pl(o,"@id",ml(f).map(e=>nl(e)?cl(t,e,{base:!0},a):e),{propertyIsArray:a.isFrame});continue}if("@type"===h){vl(f),pl(o,"@type",ml(f).map(e=>nl(e)?cl(t.previousContext||t,e,{base:!0,vocab:!0},a):e),{propertyIsArray:a.isFrame});continue}if("@graph"===h&&!tl(f)&&!el(f))throw new du('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:f});if("@value"===h){pl(o,"@value",f,{propertyIsArray:a.isFrame});continue}if("@language"===h){if(null===f)continue;if(!nl(f)&&!a.isFrame)throw new du('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:f});f=ml(f).map(e=>nl(e)?e.toLowerCase():e),pl(o,"@language",f,{propertyIsArray:a.isFrame});continue}if("@index"===h){if(!nl(f))throw new du('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:f});pl(o,"@index",f);continue}if("@reverse"===h){if(!tl(f))throw new du('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:f});if(u=yl.expand({activeCtx:t,activeProperty:"@reverse",element:f,options:a,expansionMap:c}),"@reverse"in u)for(const e in u["@reverse"])pl(o,e,u["@reverse"][e],{propertyIsArray:!0});let e=o["@reverse"]||null;for(const t in u){if("@reverse"===t)continue;null===e&&(e=o["@reverse"]={}),pl(e,t,[],{propertyIsArray:!0});const r=u[t];for(let n=0;n<r.length;++n){const i=r[n];if(al(i)||ol(i))throw new du('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:u});pl(e,t,i,{propertyIsArray:!0})}}continue}if("@nest"===h){l.push(e);continue}let d=t;const p=ul(t,e,"@context");il(p)||(d=fl({activeCtx:t,localCtx:p,isPropertyTermScopedContext:!0,options:a}));const m=ul(d,e,"@container")||[];if(m.includes("@language")&&tl(f))u=wl(d,f,a);else if(m.includes("@index")&&tl(f)){const t=m.includes("@graph");u=_l({activeCtx:d,options:a,activeProperty:e,value:f,expansionMap:c,asGraph:t,indexKey:"@index"})}else if(m.includes("@id")&&tl(f)){const t=m.includes("@graph");u=_l({activeCtx:d,options:a,activeProperty:e,value:f,expansionMap:c,asGraph:t,indexKey:"@id"})}else if(m.includes("@type")&&tl(f))u=_l({activeCtx:d.revertTypeScopedContext(),options:a,activeProperty:e,value:f,expansionMap:c,asGraph:!1,indexKey:"@type"});else{const i="@list"===h;if(i||"@set"===h){let e=r;i&&"@graph"===n&&(e=null),u=yl.expand({activeCtx:d,activeProperty:e,element:f,options:a,insideList:i,expansionMap:c})}else u="@json"===ul(t,e,"@type")?{"@type":"@json","@value":f}:yl.expand({activeCtx:d,activeProperty:e,element:f,options:a,insideList:!1,expansionMap:c})}if(null===u&&"@value"!==h&&(u=c({unmappedValue:f,expandedProperty:h,activeCtx:d,activeProperty:r,parent:i,options:a,insideList:s,key:e,expandedParent:o}),void 0===u))continue;if("@list"!==h&&!ol(u)&&m.includes("@list")&&(u={"@list":ml(u)}),m.includes("@graph")&&!m.some(e=>"@id"===e||"@index"===e)&&(u=ml(u).map(e=>sl(e)?e:{"@graph":ml(e)})),d.mappings.has(e)&&d.mappings.get(e).reverse){const e=o["@reverse"]=o["@reverse"]||{};u=ml(u);for(let t=0;t<u.length;++t){const r=u[t];if(al(r)||ol(r))throw new du('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:u});pl(e,h,r,{propertyIsArray:!0})}continue}const g=!["@index","@id","@type","@value","@language"].includes(h);pl(o,h,u,{propertyIsArray:g})}if("@value"in i){const e=i["@value"];if("@json"===i["@type"]&&hl(t,1.1));else if((tl(e)||el(e))&&!a.isFrame)throw new du('Invalid JSON-LD syntax; "@value" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid value object value",value:e})}for(const u of l){const l=el(i[u])?i[u]:[i[u]];for(const i of l){if(!tl(i)||Object.keys(i).some(e=>"@value"===cl(t,e,{vocab:!0},a)))throw new du("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:i});e({activeCtx:t,activeProperty:r,expandedActiveProperty:n,element:i,expandedParent:o,options:a,insideList:s,expansionMap:c})}}}({activeCtx:e,activeProperty:t,expandedActiveProperty:c,element:r,expandedParent:f,options:n,insideList:i,typeScopedContext:a,expansionMap:s}),u=Object.keys(f);let h=u.length;if("@value"in f){if("@type"in f&&"@language"in f)throw new du('Invalid JSON-LD syntax; an element containing "@value" may not contain both "@type" and "@language".',"jsonld.SyntaxError",{code:"invalid value object",element:f});let o=h-1;if("@type"in f&&(o-=1),"@index"in f&&(o-=1),"@language"in f&&(o-=1),0!==o)throw new du('Invalid JSON-LD syntax; an element containing "@value" may only have an "@index" property and at most one other property which can be "@type" or "@language".',"jsonld.SyntaxError",{code:"invalid value object",element:f});const a=null===f["@value"]?[]:ml(f["@value"]),c=gl(f,"@type");if(0===a.length){const o=s({unmappedValue:f,activeCtx:e,activeProperty:t,element:r,options:n,insideList:i});f=void 0!==o?o:null}else{if(!a.every(e=>nl(e)||rl(e))&&"@language"in f)throw new du("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:f});if(hl(e,1.1)&&c.includes("@json")&&1===c.length);else if(!c.every(e=>dl(e)&&!(nl(e)&&0===e.indexOf("_:"))||rl(e)))throw new du('Invalid JSON-LD syntax; an element containing "@value" and "@type" must have an absolute IRI for the value of "@type".',"jsonld.SyntaxError",{code:"invalid typed value",element:f})}}else if("@type"in f&&!el(f["@type"]))f["@type"]=[f["@type"]];else if("@set"in f||"@list"in f){if(h>1&&(2!==h||!("@index"in f)))throw new du('Invalid JSON-LD syntax; if an element has the property "@set" or "@list", then it can have at most one other property that is "@index".',"jsonld.SyntaxError",{code:"invalid set or list object",element:f});"@set"in f&&(f=f["@set"],u=Object.keys(f),h=u.length)}else if(1===h&&"@language"in f){const o=s(f,{unmappedValue:f,activeCtx:e,activeProperty:t,element:r,options:n,insideList:i});f=void 0!==o?o:null}if(tl(f)&&!n.keepFreeFloatingNodes&&!i&&(null===t||"@graph"===c)&&(0===h||"@value"in f||"@list"in f||1===h&&"@id"in f)){const o=s({unmappedValue:f,activeCtx:e,activeProperty:t,element:r,options:n,insideList:i});f=void 0!==o?o:null}return f};const{isKeyword:Sl}=Qu,El={};var xl=El;El.createMergedNodeMap=(e,t)=>{const r=(t=t||{}).issuer||new wu.IdentifierIssuer("_:b"),n={"@default":{}};return El.createNodeMap(e,n,"@default",r),El.mergeNodeMaps(n)},El.createNodeMap=(e,t,r,n,i,o)=>{if(lu.isArray(e)){for(const i of e)El.createNodeMap(i,t,r,n,void 0,o);return}if(!lu.isObject(e))return void(o&&o.push(e));if(hu.isValue(e)){if("@type"in e){let t=e["@type"];0===t.indexOf("_:")&&(e["@type"]=t=n.getId(t))}return void(o&&o.push(e))}if(o&&hu.isList(e)){const a=[];return El.createNodeMap(e["@list"],t,r,n,i,a),void o.push({"@list":a})}if("@type"in e){const t=e["@type"];for(const e of t)0===e.indexOf("_:")&&n.getId(e)}lu.isUndefined(i)&&(i=hu.isBlankNode(e)?n.getId(e["@id"]):e["@id"]),o&&o.push({"@id":i});const a=t[r],s=a[i]=a[i]||{};s["@id"]=i;const c=Object.keys(e).sort();for(let o of c){if("@id"===o)continue;if("@reverse"===o){const o={"@id":i},s=e["@reverse"];for(const e in s){const i=s[e];for(const s of i){let i=s["@id"];hu.isBlankNode(s)&&(i=n.getId(i)),El.createNodeMap(s,t,r,n,i),wu.addValue(a[i],e,o,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===o){i in t||(t[i]={}),El.createNodeMap(e[o],t,i,n);continue}if("@type"!==o&&Sl(o)){if("@index"===o&&o in s&&(e[o]!==s[o]||e[o]["@id"]!==s[o]["@id"]))throw new du("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:s});s[o]=e[o];continue}const c=e[o];if(0===o.indexOf("_:")&&(o=n.getId(o)),0!==c.length)for(let e of c)if("@type"===o&&(e=0===e.indexOf("_:")?n.getId(e):e),hu.isSubject(e)||hu.isSubjectReference(e)){const i=hu.isBlankNode(e)?n.getId(e["@id"]):e["@id"];wu.addValue(s,o,{"@id":i},{propertyIsArray:!0,allowDuplicate:!1}),El.createNodeMap(e,t,r,n,i)}else if(hu.isValue(e))wu.addValue(s,o,e,{propertyIsArray:!0,allowDuplicate:!1});else if(hu.isList(e)){const a=[];El.createNodeMap(e["@list"],t,r,n,i,a),e={"@list":a},wu.addValue(s,o,e,{propertyIsArray:!0,allowDuplicate:!1})}else El.createNodeMap(e,t,r,n,i),wu.addValue(s,o,e,{propertyIsArray:!0,allowDuplicate:!1});else wu.addValue(s,o,[],{propertyIsArray:!0})}},El.mergeNodeMapGraphs=e=>{const t={};for(const r of Object.keys(e).sort())for(const n of Object.keys(e[r]).sort()){const i=e[r][n];n in t||(t[n]={"@id":n});const o=t[n];for(const e of Object.keys(i).sort())if(Sl(e))o[e]=wu.clone(i[e]);else for(const t of i[e])wu.addValue(o,e,wu.clone(t),{propertyIsArray:!0,allowDuplicate:!1})}return t},El.mergeNodeMaps=e=>{const t=e["@default"],r=Object.keys(e).sort();for(const n of r){if("@default"===n)continue;const r=e[n];let i=t[n];i?"@graph"in i||(i["@graph"]=[]):t[n]=i={"@id":n,"@graph":[]};const o=i["@graph"];for(const e of Object.keys(r).sort()){const t=r[e];hu.isSubjectReference(t)||o.push(t)}}return t};const{isSubjectReference:Il}=hu,{createMergedNodeMap:kl}=xl,Pl={};var Ol=Pl;Pl.flatten=e=>{const t=kl(e),r=[],n=Object.keys(t).sort();for(let e=0;e<n.length;++e){const i=t[n[e]];Il(i)||r.push(i)}return r};const{RDF_LIST:Al,RDF_FIRST:Tl,RDF_REST:Cl,RDF_NIL:Nl,RDF_TYPE:Rl,RDF_JSON_LITERAL:Ml,XSD_BOOLEAN:Ll,XSD_DOUBLE:jl,XSD_INTEGER:Dl,XSD_STRING:Bl}=Pu,Ul={};var Fl=Ul;function Hl(e,t){if(e.termType.endsWith("Node"))return{"@id":e.value};const r={"@value":e.value};if(e.language)r["@language"]=e.language;else{let n=e.datatype.value;if(n||(n=Bl),n===Ml){n="@json";try{r["@value"]=JSON.parse(r["@value"])}catch(e){throw new du("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:r["@value"],cause:e})}}if(t){if(n===Ll)"true"===r["@value"]?r["@value"]=!0:"false"===r["@value"]&&(r["@value"]=!1);else if(lu.isNumeric(r["@value"]))if(n===Dl){const e=parseInt(r["@value"],10);e.toFixed(0)===r["@value"]&&(r["@value"]=e)}else n===jl&&(r["@value"]=parseFloat(r["@value"]));[Ll,Dl,jl,Bl].includes(n)||(r["@type"]=n)}else n!==Bl&&(r["@type"]=n)}return r}Ul.fromRDF=async(e,{useRdfType:t=!1,useNativeTypes:r=!1})=>{const n={},i={"@default":n},o={};for(const a of e){const e="DefaultGraph"===a.graph.termType?"@default":a.graph.value;e in i||(i[e]={}),"@default"===e||e in n||(n[e]={"@id":e});const s=i[e],c=a.subject.value,u=a.predicate.value,l=a.object;c in s||(s[c]={"@id":c});const f=s[c],h=l.termType.endsWith("Node");if(h&&!(l.value in s)&&(s[l.value]={"@id":l.value}),u===Rl&&!t&&h){wu.addValue(f,"@type",l.value,{propertyIsArray:!0});continue}const d=Hl(l,r);if(wu.addValue(f,u,d,{propertyIsArray:!0}),h)if(l.value===Nl){const e=s[l.value];"usages"in e||(e.usages=[]),e.usages.push({node:f,property:u,value:d})}else l.value in o?o[l.value]=!1:o[l.value]={node:f,property:u,value:d}}for(const e in i){const t=i[e];if(!(Nl in t))continue;const r=t[Nl];if(r.usages){for(let e of r.usages){let r=e.node,n=e.property,i=e.value;const a=[],s=[];let c=Object.keys(r).length;for(;n===Cl&&lu.isObject(o[r["@id"]])&&lu.isArray(r[Tl])&&1===r[Tl].length&&lu.isArray(r[Cl])&&1===r[Cl].length&&(3===c||4===c&&lu.isArray(r["@type"])&&1===r["@type"].length&&r["@type"][0]===Al)&&(a.push(r[Tl][0]),s.push(r["@id"]),e=o[r["@id"]],r=e.node,n=e.property,i=e.value,c=Object.keys(r).length,hu.isBlankNode(r)););delete i["@id"],i["@list"]=a.reverse();for(const e of s)delete t[e]}delete r.usages}}const a=[],s=Object.keys(n).sort();for(const e of s){const t=n[e];if(e in i){const r=t["@graph"]=[],n=i[e],o=Object.keys(n).sort();for(const e of o){const t=n[e];hu.isSubjectReference(t)||r.push(t)}}hu.isSubjectReference(t)||a.push(t)}return a};var Vl=function(e){return function e(t){if(null===t||"object"!=typeof t||null!=t.toJSON)return JSON.stringify(t);if(Array.isArray(t)&&0===t.length)return"[]";if(Array.isArray(t)&&1===t.length)return"["+e(t[0])+"]";if(Array.isArray(t))return"["+t.reduce((t,r,n)=>(t=1===n?e(t):t)+","+e(r))+"]";const r=Object.keys(t);if(0===r.length)return"{}";if(1===r.length)return"{"+e(r[0])+":"+e(t[r[0]])+"}";return"{"+r.sort().reduce((r,n,i)=>(r=1===i?e(r)+":"+e(t[r]):r)+","+e(n)+":"+e(t[n]))+"}"}(e)};const{createNodeMap:zl}=xl,{isKeyword:ql}=Qu,{RDF_FIRST:Kl,RDF_REST:$l,RDF_NIL:Gl,RDF_TYPE:Jl,RDF_JSON_LITERAL:Wl,RDF_LANGSTRING:Xl,XSD_BOOLEAN:Ql,XSD_DOUBLE:Yl,XSD_INTEGER:Zl,XSD_STRING:ef}=Pu,{isAbsolute:tf}=Du,rf={};var nf=rf;function of(e,t,r,n,i){const o=Object.keys(t).sort();for(const a of o){const o=t[a],s=Object.keys(o).sort();for(let t of s){const s=o[t];if("@type"===t)t=Jl;else if(ql(t))continue;for(const o of s){const s={termType:a.startsWith("_:")?"BlankNode":"NamedNode",value:a};if(!tf(a))continue;const c={termType:t.startsWith("_:")?"BlankNode":"NamedNode",value:t};if(!tf(t))continue;if("BlankNode"===c.termType&&!i.produceGeneralizedRdf)continue;const u=af(o,n,e,r);u&&e.push({subject:s,predicate:c,object:u,graph:r})}}}}function af(e,t,r,n){const i={};if(hu.isValue(e)){i.termType="Literal",i.value=void 0,i.datatype={termType:"NamedNode"};let t=e["@value"];const r=e["@type"]||null;"@json"===r?(i.value=Vl(t),i.datatype.value=Wl):lu.isBoolean(t)?(i.value=t.toString(),i.datatype.value=r||Ql):lu.isDouble(t)||r===Yl?(lu.isDouble(t)||(t=parseFloat(t)),i.value=t.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),i.datatype.value=r||Yl):lu.isNumber(t)?(i.value=t.toFixed(0),i.datatype.value=r||Zl):"@language"in e?(i.value=t,i.datatype.value=r||Xl,i.language=e["@language"]):(i.value=t,i.datatype.value=r||ef)}else if(hu.isList(e)){const o=function(e,t,r,n){const i={termType:"NamedNode",value:Kl},o={termType:"NamedNode",value:$l},a={termType:"NamedNode",value:Gl},s=e.pop(),c=s?{termType:"BlankNode",value:t.getId()}:a;let u=c;for(const a of e){const e=af(a,t,r,n),s={termType:"BlankNode",value:t.getId()};r.push({subject:u,predicate:i,object:e,graph:n}),r.push({subject:u,predicate:o,object:s,graph:n}),u=s}if(s){const e=af(s,t,r,n);r.push({subject:u,predicate:i,object:e,graph:n}),r.push({subject:u,predicate:o,object:a,graph:n})}return c}(e["@list"],t,r,n);i.termType=o.termType,i.value=o.value}else{const t=lu.isObject(e)?e["@id"]:e;i.termType=t.startsWith("_:")?"BlankNode":"NamedNode",i.value=t}return"NamedNode"!==i.termType||tf(i.value)?i:null}rf.toRDF=(e,t)=>{const r=new wu.IdentifierIssuer("_:b"),n={"@default":{}};zl(e,n,"@default",r);const i=[],o=Object.keys(n).sort();for(const e of o){let o;if("@default"===e)o={termType:"DefaultGraph",value:""};else{if(!tf(e))continue;o=e.startsWith("_:")?{termType:"BlankNode"}:{termType:"NamedNode"},o.value=e}of(i,n[e],o,r,t)}return i};const{isKeyword:sf}=Qu,{createNodeMap:cf,mergeNodeMapGraphs:uf}=xl,lf={};var ff=lf;function hf(e){const t={};for(const r in e)void 0!==e[r]&&(t["@"+r]=[e[r]]);return[t]}function df(e,t,r){for(let n=r.length-1;n>=0;--n){const i=r[n];if(i.graph===t&&i.subject["@id"]===e["@id"])return!0}return!1}function pf(e,t,r){const n="@"+r;let i=n in e?e[n][0]:t[r];return"embed"===r&&(!0===i?i="@last":!1===i?i="@never":"@always"!==i&&"@never"!==i&&"@link"!==i&&(i="@last")),i}function mf(e){if(!lu.isArray(e)||1!==e.length||!lu.isObject(e[0]))throw new du("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:e})}function gf(e,t,r,n){let i=!0,o=!1;for(const a in r){let s=!1;const c=wu.getValues(t,a),u=0===wu.getValues(r,a).length;if(sf(a)){if("@id"!==a&&"@type"!==a)continue;if(i=!1,"@id"===a){if(r["@id"].length>=0&&!lu.isEmptyObject(r["@id"][0]))return r["@id"].includes(c[0]);s=!0;continue}if("@type"in r)if(u){if(c.length>0)return!1;s=!0}else{if(1!==r["@type"].length||!lu.isEmptyObject(r["@type"][0])){for(const e of r["@type"])if(c.some(t=>t===e))return!0;return!1}s=c.length>0}}const l=wu.getValues(r,a)[0];let f=!1;if(l&&(mf([l]),f="@default"in l),i=!1,0!==c.length||!f){if(c.length>0&&u)return!1;if(void 0===l){if(c.length>0)return!1;s=!0}else if(lu.isObject(l))s=c.length>0;else if(hu.isValue(l))s=c.some(e=>wf(l,e));else if(hu.isSubject(l)||hu.isSubjectReference(l))s=c.some(t=>bf(e,l,t,n));else if(hu.isList(l)){const t=l["@list"][0];if(hu.isList(c[0])){const r=c[0]["@list"];hu.isValue(t)?s=r.some(e=>wf(t,e)):(hu.isSubject(t)||hu.isSubjectReference(t))&&(s=r.some(r=>bf(e,t,r,n)))}else s=!1}if(!s&&n.requireAll)return!1;o=o||s}}return i||o}function vf(e,t){const r=e.uniqueEmbeds[e.graph],n=r[t],i=n.parent,o=n.property,a={"@id":t};if(lu.isArray(i)){for(let e=0;e<i.length;++e)if(wu.compareValues(i[e],a)){i[e]=a;break}}else{const e=lu.isArray(i[o]);wu.removeValue(i,o,a,{propertyIsArray:e}),wu.addValue(i,o,a,{propertyIsArray:e})}const s=e=>{const t=Object.keys(r);for(const n of t)n in r&&lu.isObject(r[n].parent)&&r[n].parent["@id"]===e&&(delete r[n],s(n))};s(t)}function yf(e,t,r){lu.isObject(e)?wu.addValue(e,t,r,{propertyIsArray:!0}):e.push(r)}function bf(e,t,r,n){if(!("@id"in r))return!1;const i=e.subjects[r["@id"]];return i&&gf(e,i,t,n)}function wf(e,t){const r=t["@value"],n=t["@type"],i=t["@language"],o=e["@value"]?lu.isArray(e["@value"])?e["@value"]:[e["@value"]]:[],a=e["@type"]?lu.isArray(e["@type"])?e["@type"]:[e["@type"]]:[],s=e["@language"]?lu.isArray(e["@language"])?e["@language"]:[e["@language"]]:[];return 0===o.length&&0===a.length&&0===s.length||!(!o.includes(r)&&!lu.isEmptyObject(o[0]))&&(!!(!n&&0===a.length||a.includes(n)||n&&lu.isEmptyObject(a[0]))&&!!(!i&&0===s.length||s.includes(i)||i&&lu.isEmptyObject(s[0])))}lf.frameMergedOrDefault=(e,t,r)=>{const n={options:r,graph:"@default",graphMap:{"@default":{}},graphStack:[],subjectStack:[],link:{},bnodeMap:{}},i=new wu.IdentifierIssuer("_:b");cf(e,n.graphMap,"@default",i),r.merged&&(n.graphMap["@merged"]=uf(n.graphMap),n.graph="@merged"),n.subjects=n.graphMap[n.graph];const o=[];return lf.frame(n,Object.keys(n.subjects).sort(),t,o),r.pruneBlankNodeIdentifiers&&(r.bnodesToClear=Object.keys(n.bnodeMap).filter(e=>1===n.bnodeMap[e].length)),o},lf.frame=(e,t,r,n,i=null)=>{mf(r),r=r[0];const o=e.options,a={embed:pf(r,o,"embed"),explicit:pf(r,o,"explicit"),requireAll:pf(r,o,"requireAll")},s=function(e,t,r,n){const i={};for(const o of t){const t=e.graphMap[e.graph][o];gf(e,t,r,n)&&(i[o]=t)}return i}(e,t,r,a),c=Object.keys(s).sort();for(const t of c){const c=s[t];if("@link"===a.embed&&t in e.link){yf(n,i,e.link[t]);continue}null===i?e.uniqueEmbeds={[e.graph]:{}}:e.uniqueEmbeds[e.graph]=e.uniqueEmbeds[e.graph]||{};const u={};if(u["@id"]=t,0===t.indexOf("_:")&&wu.addValue(e.bnodeMap,t,u,{propertyIsArray:!0}),e.link[t]=u,"@never"===a.embed||df(c,e.graph,e.subjectStack))yf(n,i,u);else{if("@last"===a.embed&&(t in e.uniqueEmbeds[e.graph]&&vf(e,t),e.uniqueEmbeds[e.graph][t]={parent:n,property:i}),e.subjectStack.push({subject:c,graph:e.graph}),t in e.graphMap){let n=!1,i=null;"@graph"in r?(i=r["@graph"][0],lu.isObject(i)||(i={}),n=!("@merged"===t||"@default"===t)):(n="@merged"!==e.graph,i={}),n&&(e.graphStack.push(e.graph),e.graph=t,lf.frame(e,Object.keys(e.graphMap[t]).sort(),[i],u,"@graph"),e.graph=e.graphStack.pop)}for(const t of Object.keys(c).sort())if(sf(t)){if(u[t]=wu.clone(c[t]),"@type"===t)for(const t of c["@type"])0===t.indexOf("_:")&&wu.addValue(e.bnodeMap,t,u,{propertyIsArray:!0})}else if(!a.explicit||t in r)for(let n of c[t]){const i=t in r?r[t]:hf(a);if(hu.isList(n)){const i={"@list":[]};yf(u,t,i);const o=n["@list"];for(const s in o)if(n=o[s],hu.isSubjectReference(n)){const o=t in r?r[t][0]["@list"]:hf(a);lf.frame(e,[n["@id"]],o,i,"@list")}else yf(i,"@list",wu.clone(n))}else hu.isSubjectReference(n)?lf.frame(e,[n["@id"]],i,u,t):wf(i[0],n)&&yf(u,t,wu.clone(n))}for(const e of Object.keys(r).sort()){if(sf(e))continue;const t=r[e][0]||{};if(!pf(t,o,"omitDefault")&&!(e in u)){let r="@null";"@default"in t&&(r=wu.clone(t["@default"])),lu.isArray(r)||(r=[r]),u[e]=[{"@preserve":r}]}}if("@reverse"in r)for(const n of Object.keys(r["@reverse"]).sort()){const o=r["@reverse"][n];for(const r of Object.keys(e.subjects)){wu.getValues(e.subjects[r],n).some(e=>e["@id"]===t)&&(u["@reverse"]=u["@reverse"]||{},wu.addValue(u["@reverse"],n,[],{propertyIsArray:!0}),lf.frame(e,[r],o,u["@reverse"][n],i))}}yf(n,i,u),e.subjectStack.pop()}}};const{isArray:_f,isObject:Sf,isString:Ef,isUndefined:xf}=lu,{isList:If,isValue:kf,isGraph:Pf,isSimpleGraph:Of,isSubjectReference:Af}=hu,{expandIri:Tf,getContextValue:Cf,isKeyword:Nf,process:Rf}=Qu,{removeBase:Mf}=Du,{addValue:Lf,asArray:jf,compareShortestLeast:Df}=wu,Bf={};var Uf=Bf;function Ff(e,t,r){if("@nest"!==Tf(e,t,{vocab:!0},r))throw new du("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}Bf.compact=({activeCtx:e,activeProperty:t=null,element:r,options:n={},compactionMap:i=(()=>{})})=>{if(_f(r)){let o=[];for(let a=0;a<r.length;++a){let s=Bf.compact({activeCtx:e,activeProperty:t,element:r[a],options:n,compactionMap:i});null===s&&(s=i({unmappedValue:r[a],activeCtx:e,activeProperty:t,parent:r,index:a,options:n}),void 0===s)||o.push(s)}if(n.compactArrays&&1===o.length){0===(Cf(e,t,"@container")||[]).length&&(o=o[0])}return o}const o=Cf(e,t,"@context");if(xf(o)||(e=Rf({activeCtx:e,localCtx:o,isPropertyTermScopedContext:!0,options:n})),Sf(r)){if(n.link&&"@id"in r&&n.link.hasOwnProperty(r["@id"])){const e=n.link[r["@id"]];for(let t=0;t<e.length;++t)if(e[t].expanded===r)return e[t].compacted}if(kf(r)||Af(r)){const i=Bf.compactValue({activeCtx:e,activeProperty:t,value:r,options:n});return n.link&&Af(r)&&(n.link.hasOwnProperty(r["@id"])||(n.link[r["@id"]]=[]),n.link[r["@id"]].push({expanded:r,compacted:i})),i}if(If(r)){if((Cf(e,t,"@container")||[]).includes("@list"))return Bf.compact({activeCtx:e,activeProperty:t,element:r["@list"],options:n,compactionMap:i})}const o="@reverse"===t,a={};e=e.revertTypeScopedContext(),n.link&&"@id"in r&&(n.link.hasOwnProperty(r["@id"])||(n.link[r["@id"]]=[]),n.link[r["@id"]].push({expanded:r,compacted:a}));let s=r["@type"]||[];s.length>1&&(s=Array.from(s).sort());const c=e;for(const t of s){const r=Bf.compactIri({activeCtx:c,iri:t,relativeTo:{vocab:!0}}),i=Cf(c,r,"@context");xf(i)||(e=Rf({activeCtx:e,localCtx:i,options:n,isTypeScopedContext:!0}))}const u=Object.keys(r).sort();for(const s of u){const c=r[s];if("@id"!==s&&"@type"!==s)if("@reverse"!==s)if("@preserve"!==s)if("@index"!==s)if("@graph"!==s&&"@list"!==s&&Nf(s)){const t=Bf.compactIri({activeCtx:e,iri:s,relativeTo:{vocab:!0}});Lf(a,t,c)}else{if(!_f(c))throw new du("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(0===c.length){const t=Bf.compactIri({activeCtx:e,iri:s,value:c,relativeTo:{vocab:!0},reverse:o}),r=e.mappings.has(t)?e.mappings.get(t)["@nest"]:null;let i=a;r&&(Ff(e,r,n),Sf(a[r])||(a[r]={}),i=a[r]),Lf(i,t,c,{propertyIsArray:!0})}for(const t of c){const r=Bf.compactIri({activeCtx:e,iri:s,value:t,relativeTo:{vocab:!0},reverse:o}),c=e.mappings.has(r)?e.mappings.get(r)["@nest"]:null;let u=a;c&&(Ff(e,c,n),Sf(a[c])||(a[c]={}),u=a[c]);const l=Cf(e,r,"@container")||[],f=Pf(t),h=If(t);let d;h?d=t["@list"]:f&&(d=t["@graph"]);let p=Bf.compact({activeCtx:e,activeProperty:r,element:h||f?d:t,options:n,compactionMap:i});if(h){if(_f(p)||(p=[p]),l.includes("@list")){Lf(u,r,p,{valueIsArray:!0,allowDuplicate:!0});continue}p={[Bf.compactIri({activeCtx:e,iri:"@list",relativeTo:{vocab:!0}})]:p},"@index"in t&&(p[Bf.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=t["@index"])}if(f)if(l.includes("@graph")&&(l.includes("@id")||l.includes("@index")&&Of(t))){let i;u.hasOwnProperty(r)?i=u[r]:u[r]=i={};const o=(l.includes("@id")?t["@id"]:t["@index"])||Bf.compactIri({activeCtx:e,iri:"@none",vocab:!0});Lf(i,o,p,{propertyIsArray:!n.compactArrays||l.includes("@set")})}else l.includes("@graph")&&Of(t)||(_f(p)&&1===p.length&&n.compactArrays&&(p=p[0]),p={[Bf.compactIri({activeCtx:e,iri:"@graph",relativeTo:{vocab:!0}})]:p},"@id"in t&&(p[Bf.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]=t["@id"]),"@index"in t&&(p[Bf.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=t["@index"])),Lf(u,r,p,{propertyIsArray:!n.compactArrays||l.includes("@set")});else if(l.includes("@language")||l.includes("@index")||l.includes("@id")||l.includes("@type")){let n,i;if(u.hasOwnProperty(r)?n=u[r]:u[r]=n={},l.includes("@language"))kf(p)&&(p=p["@value"]),i=t["@language"];else if(l.includes("@index"))i=t["@index"];else if(l.includes("@id")){const t=Bf.compactIri({activeCtx:e,iri:"@id",vocab:!0});i=p[t],delete p[t]}else if(l.includes("@type")){const t=Bf.compactIri({activeCtx:e,iri:"@type",vocab:!0});let r;switch([i,...r]=jf(p[t]||[]),r.length){case 0:delete p[t];break;case 1:p[t]=r[0];break;default:p[t]=r}}i||(i=Bf.compactIri({activeCtx:e,iri:"@none",vocab:!0})),Lf(n,i,p,{propertyIsArray:l.includes("@set")})}else{const e=!n.compactArrays||l.includes("@set")||l.includes("@list")||_f(p)&&0===p.length||"@list"===s||"@graph"===s;Lf(u,r,p,{propertyIsArray:e})}}}else{if((Cf(e,t,"@container")||[]).includes("@index"))continue;const r=Bf.compactIri({activeCtx:e,iri:s,relativeTo:{vocab:!0}});Lf(a,r,c)}else{const r=Bf.compact({activeCtx:e,activeProperty:t,element:c,options:n,compactionMap:i});_f(r)&&0===r.length||Lf(a,s,r)}else{const t=Bf.compact({activeCtx:e,activeProperty:"@reverse",element:c,options:n,compactionMap:i});for(const r in t)if(e.mappings.has(r)&&e.mappings.get(r).reverse){const i=t[r],o=(Cf(e,r,"@container")||[]).includes("@set")||!n.compactArrays;Lf(a,r,i,{propertyIsArray:o}),delete t[r]}if(Object.keys(t).length>0){const r=Bf.compactIri({activeCtx:e,iri:s,relativeTo:{vocab:!0}});Lf(a,r,t)}}else{const t="@type"===s,r=t&&e.previousContext||e;let n=jf(c).map(e=>Bf.compactIri({activeCtx:r,iri:e,relativeTo:{vocab:t}}));1===n.length&&(n=n[0]);const i=Bf.compactIri({activeCtx:e,iri:s,relativeTo:{vocab:!0}}),o=_f(n)&&0===c.length;Lf(a,i,n,{propertyIsArray:o})}}return a}return r},Bf.compactIri=({activeCtx:e,iri:t,value:r=null,relativeTo:n={vocab:!1},reverse:i=!1})=>{if(null===t)return t;e.isPropertyTermScoped&&e.previousContext&&(e=e.previousContext);const o=e.getInverse();if(Nf(t)&&t in o&&"@none"in o[t]&&"@type"in o[t]["@none"]&&"@none"in o[t]["@none"]["@type"])return o[t]["@none"]["@type"]["@none"];if(n.vocab&&t in o){const n=e["@language"]||"@none",o=[];Sf(r)&&"@index"in r&&!("@graph"in r)&&o.push("@index","@index@set"),Sf(r)&&"@preserve"in r&&(r=r["@preserve"][0]),Pf(r)?("@index"in r&&o.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in r&&o.push("@graph@id","@graph@id@set"),o.push("@graph","@graph@set","@set"),"@index"in r||o.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in r||o.push("@graph@id","@graph@id@set")):Sf(r)&&!kf(r)&&o.push("@id","@id@set","@type","@set@type");let a="@language",s="@null";if(i)a="@type",s="@reverse",o.push("@set");else if(If(r)){"@index"in r||o.push("@list");const e=r["@list"];if(0===e.length)a="@any",s="@none";else{let t=0===e.length?n:null,r=null;for(let n=0;n<e.length;++n){const i=e[n];let o="@none",a="@none";if(kf(i)?"@language"in i?o=i["@language"]:"@type"in i?a=i["@type"]:o="@null":a="@id",null===t?t=o:o!==t&&kf(i)&&(t="@none"),null===r?r=a:a!==r&&(r="@none"),"@none"===t&&"@none"===r)break}t=t||"@none",r=r||"@none","@none"!==r?(a="@type",s=r):s=t}}else kf(r)?"@language"in r&&!("@index"in r)?(o.push("@language","@language@set"),s=r["@language"]):"@type"in r&&(a="@type",s=r["@type"]):(a="@type",s="@id"),o.push("@set");o.push("@none"),Sf(r)&&!("@index"in r)&&o.push("@index","@index@set"),kf(r)&&1===Object.keys(r).length&&o.push("@language","@language@set");const c=function(e,t,r,n,i,o){null===o&&(o="@null");const a=[];if("@id"!==o&&"@reverse"!==o||!Af(r))a.push(o);else{"@reverse"===o&&a.push("@reverse");const t=Bf.compactIri({activeCtx:e,iri:r["@id"],relativeTo:{vocab:!0}});e.mappings.has(t)&&e.mappings.get(t)&&e.mappings.get(t)["@id"]===r["@id"]?a.push.apply(a,["@vocab","@id"]):a.push.apply(a,["@id","@vocab"])}a.push("@none");const s=e.inverse[t];for(let e=0;e<n.length;++e){const t=n[e];if(!(t in s))continue;const r=s[t][i];for(let e=0;e<a.length;++e){const t=a[e];if(t in r)return r[t]}}return null}(e,t,r,o,a,s);if(null!==c)return c}if(n.vocab&&"@vocab"in e){const r=e["@vocab"];if(0===t.indexOf(r)&&t!==r){const n=t.substr(r.length);if(!e.mappings.has(n))return n}}let a=null;const s=[];let c=e.fastCurieMap;const u=t.length-1;for(let e=0;e<u&&t[e]in c;++e)c=c[t[e]],""in c&&s.push(c[""][0]);for(let n=s.length-1;n>=0;--n){const i=s[n],o=i.terms;for(const n of o){const o=n+":"+t.substr(i.iri.length);e.mappings.get(n)._prefix&&(!e.mappings.has(o)||null===r&&e.mappings.get(o)["@id"]===t)&&(null===a||Df(o,a)<0)&&(a=o)}}return null!==a?a:n.vocab?t:Mf(e["@base"],t)},Bf.compactValue=({activeCtx:e,activeProperty:t,value:r,options:n})=>{if(kf(r)){const n=Cf(e,t,"@type"),i=Cf(e,t,"@language"),o=Cf(e,t,"@container")||[],a="@index"in r&&!o.includes("@index");if(!a&&(r["@type"]===n||r["@language"]===i))return r["@value"];const s=Object.keys(r).length,c=1===s||2===s&&"@index"in r&&!a,u="@language"in e,l=Ef(r["@value"]),f=e.mappings.has(t)&&null===e.mappings.get(t)["@language"];if(c&&(!u||!l||f))return r["@value"];const h={};return a&&(h[Bf.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=r["@index"]),"@type"in r?h[Bf.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}})]=Bf.compactIri({activeCtx:e,iri:r["@type"],relativeTo:{vocab:!0}}):"@language"in r&&(h[Bf.compactIri({activeCtx:e,iri:"@language",relativeTo:{vocab:!0}})]=r["@language"]),h[Bf.compactIri({activeCtx:e,iri:"@value",relativeTo:{vocab:!0}})]=r["@value"],h}const i=Tf(e,t,{vocab:!0},n),o=Cf(e,t,"@type"),a=Bf.compactIri({activeCtx:e,iri:r["@id"],relativeTo:{vocab:"@vocab"===o}});return"@id"===o||"@vocab"===o||"@graph"===i?a:{[Bf.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]:a}}, /** * Removes the @preserve keywords as the last step of the compaction * algorithm when it is running on framed output. * * @param ctx the active context used to compact the input. * @param input the framed, compacted output. * @param options the compaction options used. * * @return the resulting output. */ Bf.removePreserve=(e,t,r)=>{if(_f(t)){const n=[];for(let i=0;i<t.length;++i){const o=Bf.removePreserve(e,t[i],r);null!==o&&n.push(o)}t=n}else if(Sf(t)){ // remove @preserve if("@preserve"in t)return"@null"===t["@preserve"]?null:t["@preserve"];if(kf(t))return t;if(If(t))return t["@list"]=Bf.removePreserve(e,t["@list"],r),t;const n=Bf.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}});if(t.hasOwnProperty(n)){const e=t[n];if(r.link.hasOwnProperty(e)){const n=r.link[e].indexOf(t);if(-1!==n)return r.link[e][n];r.link[e].push(t)}else r.link[e]=[t]}const i=Bf.compactIri({activeCtx:e,iri:"@graph",relativeTo:{vocab:!0}});for(const o in t){if(o===n&&r.bnodesToClear.includes(t[o])){delete t[n];continue}let a=Bf.removePreserve(e,t[o],r);const s=Cf(e,o,"@container")||[];r.compactArrays&&_f(a)&&1===a.length&&0===s.length&&o!==i&&(a=a[0]),t[o]=a}}return t};const{callbackify:Hf,normalizeDocumentLoader:Vf}=wu;var zf=class{constructor(){this._requests={},this.add=Hf(this.add.bind(this))}wrapLoader(e){const t=this;return t._loader=Vf(e),function(){return t.add.apply(t,arguments)}}async add(e){const t=this;let r=t._requests[e];if(r)return Promise.resolve(r);r=t._requests[e]=t._loader(e);try{return await r}finally{delete t._requests[e]}}};const{parseLinkHeader:qf,buildHeaders:Kf}=wu,{LINK_HEADER_REL:$f}=Pu;var Gf=({secure:e,strictSSL:t=!0,maxRedirects:r=-1,request:n,headers:i={}}={strictSSL:!0,maxRedirects:-1,headers:{}})=>{i=Kf(i),n=n||ou;const o=ou;return(new zf).wrapLoader((function(a){return async function a(s,c){if(0!==s.indexOf("http:")&&0!==s.indexOf("https:"))throw new du('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:s});if(e&&0!==s.indexOf("https"))throw new du('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:s});let u,l=null;if(null!==l)return l;try{u=await function(e,t){return new Promise((r,n)=>{e(t,(e,t,i)=>{e?n(e):r({res:t,body:i})})})}(n,{url:s,headers:i,strictSSL:t,followRedirect:!1})}catch(e){throw new du("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:s,cause:e})}const{res:f,body:h}=u;l={contextUrl:null,documentUrl:s,document:h||null};const d=o.STATUS_CODES[f.statusCode];if(f.statusCode>=400)throw new du("URL could not be dereferenced: "+d,"jsonld.InvalidUrl",{code:"loading document failed",url:s,httpStatusCode:f.statusCode});if(f.headers.link&&"application/ld+json"!==f.headers["content-type"]){const e=qf(f.headers.link)[$f];if(Array.isArray(e))throw new du("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:s});e&&(l.contextUrl=e.target)}if(f.statusCode>=300&&f.statusCode<400&&f.headers.location){if(c.length===r)throw new du("URL could not be dereferenced; there were too many redirects.","jsonld.TooManyRedirects",{code:"loading document failed",url:s,httpStatusCode:f.statusCode,redirects:c});if(-1!==c.indexOf(s))throw new du("URL could not be dereferenced; infinite redirection was detected.","jsonld.InfiniteRedirectDetected",{code:"recursive context inclusion",url:s,httpStatusCode:f.statusCode,redirects:c});return c.push(s),a(f.headers.location,c)}return c.push(s),l}(a,[])}))};const{parseLinkHeader:Jf,buildHeaders:Wf}=wu,{LINK_HEADER_REL:Xf}=Pu,Qf=/(^|(\r\n))link:/i;var Yf=({secure:e,headers:t={},xhr:r}={headers:{}})=>{t=Wf(t);return(new zf).wrapLoader((async function(n){if(0!==n.indexOf("http:")&&0!==n.indexOf("https:"))throw new du('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:n});if(e&&0!==n.indexOf("https"))throw new du('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:n});let i;try{i=await function(e,t,r){const n=new(e=e||XMLHttpRequest);return new Promise((e,i)=>{n.onload=()=>e(n),n.onerror=e=>i(e),n.open("GET",t,!0);for(const e in r)n.setRequestHeader(e,r[e]);n.send()})}(r,n,t)}catch(e){throw new du("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:n,cause:e})}if(i.status>=400)throw new du("URL could not be dereferenced: "+i.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:n,httpStatusCode:i.status});const o={contextUrl:null,documentUrl:n,document:i.response},a=i.getResponseHeader("Content-Type");let s;Qf.test(i.getAllResponseHeaders())&&(s=i.getResponseHeader("Link"));if(s&&"application/ld+json"!==a){if(s=Jf(s)[Xf],Array.isArray(s))throw new du("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:n});s&&(o.contextUrl=s.target)}return o}))}; /** * A JavaScript implementation of the JSON-LD API. * * @author Dave Longley * * @license BSD 3-Clause License * Copyright (c) 2011-2017 Digital Bazaar, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the Digital Bazaar, Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ const Zf=wu.IdentifierIssuer,{expand:eh}=bl,{flatten:th}=Ol,{fromRDF:rh}=Fl,{toRDF:nh}=nf,{frameMergedOrDefault:ih}=ff,{isArray:oh,isObject:ah,isString:sh}=lu,{isSubjectReference:ch}=hu,{getInitialContext:uh,process:lh,getAllContexts:fh}=Qu,{compact:hh,compactIri:dh,removePreserve:ph}=Uf,{createNodeMap:mh,createMergedNodeMap:gh,mergeNodeMaps:vh}=xl,yh=void 0!==ft&&ft.versions&&ft.versions.node,bh=!yh&&("undefined"!=typeof window||"undefined"!=typeof self),wh=function(e){const t={};function r(t,{documentLoader:r=e.documentLoader,...n}){return Object.assign({},{documentLoader:r},n,t)}return e.compact=wu.callbackify((async function(t,n,i){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(null===n)throw new du("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(null===t)return null;let o;(i=r(i,{base:sh(t)?t:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new Zf("_:b")})).link&&(i.skipExpansion=!0),i.compactToRelative||delete i.base,o=i.skipExpansion?t:await e.expand(t,i);const a=await e.processContext(uh(i),n,i);let s=hh({activeCtx:a,element:o,options:i,compactionMap:i.compactionMap});i.compactArrays&&!i.graph&&oh(s)?1===s.length?s=s[0]:0===s.length&&(s={}):i.graph&&ah(s)&&(s=[s]),ah(n)&&"@context"in n&&(n=n["@context"]),n=wu.clone(n),oh(n)||(n=[n]);const c=n;n=[];for(let e=0;e<c.length;++e)(!ah(c[e])||Object.keys(c[e]).length>0)&&n.push(c[e]);const u=n.length>0;if(1===n.length&&(n=n[0]),oh(s)){const e=dh({activeCtx:a,iri:"@graph",relativeTo:{vocab:!0}}),t=s;s={},u&&(s["@context"]=n),s[e]=t}else if(ah(s)&&u){const e=s;s={"@context":n};for(const t in e)s[t]=e[t]}if(i.framing){const e=dh({activeCtx:a,iri:"@graph",relativeTo:{vocab:!0}}); // remove @preserve from results i.link={},s[e]=ph(a,s[e],i)}return s})),e.expand=wu.callbackify((async function(t,n){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");!1===(n=r(n,{keepFreeFloatingNodes:!1})).expansionMap&&(n.expansionMap=void 0);const i={},o=[];if("expandContext"in n){const e=wu.clone(n.expandContext);ah(e)&&"@context"in e?i.expandContext=e:i.expandContext={"@context":e},o.push(i.expandContext)}let a;if(sh(t)){const r=await e.get(t,n);a=r.documentUrl,i.input=r.document,r.contextUrl&&(i.remoteContext={"@context":r.contextUrl},o.push(i.remoteContext))}else i.input=wu.clone(t);"base"in n||(n.base=a||""),await fh(i,n);let s=uh(n);o.forEach(e=>{s=lh({activeCtx:s,localCtx:e,options:n})});let c=eh({activeCtx:s,element:i.input,options:n,expansionMap:n.expansionMap});return ah(c)&&"@graph"in c&&1===Object.keys(c).length?c=c["@graph"]:null===c&&(c=[]),oh(c)||(c=[c]),c})),e.flatten=wu.callbackify((async function(t,n,i){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");n="function"==typeof n?null:n||null,i=r(i,{base:sh(t)?t:""});const o=await e.expand(t,i),a=th(o);if(null===n)return a;i.graph=!0,i.skipExpansion=!0;const s=await e.compact(a,n,i);return s})),e.frame=wu.callbackify((async function(t,n,i){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(i=r(i,{base:sh(t)?t:"",embed:"@last",explicit:!1,requireAll:!0,omitDefault:!1,pruneBlankNodeIdentifiers:!0,bnodesToClear:[]}),sh(n)){const t=await e.get(n,i);if(n=t.document,t.contextUrl){let e=n["@context"];e?oh(e)?e.push(t.contextUrl):e=[e,t.contextUrl]:e=t.contextUrl,n["@context"]=e}}const o=n&&n["@context"]||{},a=await e.expand(t,i),s=wu.clone(i);s.isFrame=!0,s.keepFreeFloatingNodes=!0;const c=await e.expand(n,s);s.merged=!("@graph"in n);const u=ih(a,c,s);s.graph=!0,s.skipExpansion=!0,s.link={},s.framing=!0;const l=await e.compact(u,o,s);return l})),e.link=wu.callbackify((async function(t,r,n){const i={};return r&&(i["@context"]=r),i["@embed"]="@link",e.frame(t,i,n)})),e.normalize=e.canonize=wu.callbackify((async function(t,n){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if("inputFormat"in(n=r(n,{base:sh(t)?t:"",algorithm:"URDNA2015",skipExpansion:!1}))){if("application/n-quads"!==n.inputFormat&&"application/nquads"!==n.inputFormat)throw new du("Unknown canonicalization input format.","jsonld.CanonizeError");const e=xu.parse(t);return cu.canonize(e,n)}const i=wu.clone(n);delete i.format,i.produceGeneralizedRdf=!1;const o=await e.toRDF(t,i);return cu.canonize(o,n)})),e.fromRDF=wu.callbackify((async function(e,n){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");n=r(n,{format:sh(e)?"application/n-quads":void 0});const{format:i}=n;let o,{rdfParser:a}=n;if(i){if(a=a||t[i],!a)throw new du("Unknown input format.","jsonld.UnknownFormat",{format:i})}else a=()=>e;return o=a.length>1?new Promise((t,r)=>{a(e,(e,n)=>{e?r(e):t(n)})}):Promise.resolve(a(e)),o=await o,Array.isArray(o)||(o=xu.legacyDatasetToQuads(o)),rh(o,n)})),e.toRDF=wu.callbackify((async function(t,n){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");let i;i=(n=r(n,{base:sh(t)?t:"",skipExpansion:!1})).skipExpansion?t:await e.expand(t,n);const o=nh(i,n);if(n.format){if("application/n-quads"===n.format||"application/nquads"===n.format)return await xu.serialize(o);throw new du("Unknown output format.","jsonld.UnknownFormat",{format:n.format})}return o})),e.createNodeMap=wu.callbackify((async function(t,n){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");n=r(n,{base:sh(t)?t:""});const i=await e.expand(t,n);return gh(i,n)})),e.merge=wu.callbackify((async function(t,n,i){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!oh(t))throw new TypeError('Could not merge, "docs" must be an array.');n="function"==typeof n?null:n||null,i=r(i,{});const o=await Promise.all(t.map(t=>{const r=Object.assign({},i);return e.expand(t,r)}));let a=!0;"mergeNodes"in i&&(a=i.mergeNodes);const s=i.issuer||new Zf("_:b"),c={"@default":{}};for(let e=0;e<o.length;++e){const t=wu.relabelBlankNodes(o[e],{issuer:new Zf("_:b"+e+"-")}),r=a||0===e?c:{"@default":{}};if(mh(t,r,"@default",s),r!==c)for(const e in r){const t=r[e];if(!(e in c)){c[e]=t;continue}const n=c[e];for(const e in t)e in n||(n[e]=t[e])}}const u=vh(c),l=[],f=Object.keys(u).sort();for(let e=0;e<f.length;++e){const t=u[f[e]];ch(t)||l.push(t)}if(null===n)return l;i.graph=!0,i.skipExpansion=!0;const h=await e.compact(l,n,i);return h})),Object.defineProperty(e,"documentLoader",{get:()=>e._documentLoader,set:t=>e._documentLoader=wu.normalizeDocumentLoader(t)}),e.documentLoader=async e=>{throw new du("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:e})},e.loadDocument=wu.callbackify((async function(){return e.documentLoader.apply(null,arguments)})),e.get=wu.callbackify((async function(t,r){let n;n="function"==typeof r.documentLoader?wu.normalizeDocumentLoader(r.documentLoader):e.documentLoader;const i=await n(t);try{if(!i.document)throw new du("No remote document found at the given URL.","jsonld.NullRemoteDocument");sh(i.document)&&(i.document=JSON.parse(i.document))}catch(e){throw new du("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:e,remoteDoc:i})}return i})),e.processContext=wu.callbackify((async function(e,t,n){if(n=r(n,{base:""}),null===t)return uh(n);t=wu.clone(t),ah(t)&&"@context"in t||(t={"@context":t});const i=await fh(t,n);return lh({activeCtx:e,localCtx:i,options:n})})),e.getContextValue=Qu.getContextValue,e.documentLoaders={},e.documentLoaders.node=Gf,e.documentLoaders.xhr=Yf,e.useDocumentLoader=function(t){if(!(t in e.documentLoaders))throw new du('Unknown document loader type: "'+t+'"',"jsonld.UnknownDocumentLoader",{type:t});e.documentLoader=e.documentLoaders[t].apply(e,Array.prototype.slice.call(arguments,1))},e.registerRDFParser=function(e,r){t[e]=r},e.unregisterRDFParser=function(e){delete t[e]},e.registerRDFParser("application/n-quads",xu.parse),e.registerRDFParser("application/nquads",xu.parse),e.registerRDFParser("rdfa-api",class{parse(e){const t={"@default":[]},r=e.getSubjects();for(let n=0;n<r.length;++n){const i=r[n];if(null===i)continue;const o=e.getSubjectTriples(i);if(null===o)continue;const a=o.predicates;for(const e in a){const r=a[e].objects;for(let n=0;n<r.length;++n){const o=r[n],a={};0===i.indexOf("_:")?a.subject={type:"blank node",value:i}:a.subject={type:"IRI",value:i},0===e.indexOf("_:")?a.predicate={type:"blank node",value:e}:a.predicate={type:"IRI",value:e};let s=o.value;if(o.type===Cu){const e=new(Mu());s="";for(let t=0;t<o.value.length;t++)o.value[t].nodeType===Ru.ELEMENT_NODE?s+=e.serializeToString(o.value[t]):o.value[t].nodeType===Ru.TEXT_NODE&&(s+=o.value[t].nodeValue)}a.object={},o.type===Tu?0===o.value.indexOf("_:")?a.object.type="blank node":a.object.type="IRI":(a.object.type="literal",o.type===Au?o.language?(a.object.datatype=Ou,a.object.language=o.language):a.object.datatype=Nu:a.object.datatype=o.type),a.object.value=s,t["@default"].push(a)}}}return t}}.parse),e.url=Du,e.util=wu,Object.assign(e,wu),e.promises=e,e.RequestQueue=zf,e.JsonLdProcessor=(e=>{class t{toString(){return"[object JsonLdProcessor]"}}return Object.defineProperty(t,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(t.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:t}),t.compact=function(t,r){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):e.compact(t,r)},t.expand=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):e.expand(t)},t.flatten=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):e.flatten(t)},t})(e),bh&&void 0===Zt.JsonLdProcessor&&Object.defineProperty(Zt,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:e.JsonLdProcessor}),yh?e.useDocumentLoader("node"):"undefined"!=typeof XMLHttpRequest&&e.useDocumentLoader("xhr"),e},_h=function(){return wh((function(){return _h()}))};wh(_h);var Sh=_h;const Eh={};var xh=Eh;Eh.isArray=Array.isArray,Eh.isBoolean=e=>"boolean"==typeof e||"[object Boolean]"===Object.prototype.toString.call(e),Eh.isDouble=e=>Eh.isNumber(e)&&-1!==String(e).indexOf("."),Eh.isEmptyObject=e=>Eh.isObject(e)&&0===Object.keys(e).length,Eh.isNumber=e=>"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e),Eh.isNumeric=e=>!isNaN(parseFloat(e))&&isFinite(e),Eh.isObject=e=>"[object Object]"===Object.prototype.toString.call(e),Eh.isString=e=>"string"==typeof e||"[object String]"===Object.prototype.toString.call(e),Eh.isUndefined=e=>void 0===e;const Ih={};var kh=Ih;Ih.isSubject=e=>{if(xh.isObject(e)&&!("@value"in e||"@set"in e||"@list"in e)){return Object.keys(e).length>1||!("@id"in e)}return!1},Ih.isSubjectReference=e=>xh.isObject(e)&&1===Object.keys(e).length&&"@id"in e,Ih.isValue=e=>xh.isObject(e)&&"@value"in e,Ih.isList=e=>xh.isObject(e)&&"@list"in e,Ih.isGraph=e=>xh.isObject(e)&&"@graph"in e&&1===Object.keys(e).filter(e=>"@id"!==e&&"@index"!==e).length,Ih.isSimpleGraph=e=>Ih.isGraph(e)&&!("@id"in e),Ih.isBlankNode=e=>!!xh.isObject(e)&&("@id"in e?0===e["@id"].indexOf("_:"):0===Object.keys(e).length||!("@value"in e||"@set"in e||"@list"in e));var Ph=class extends Error{constructor(e="An unspecified JSON-LD error occurred.",t="jsonld.Error",r={}){super(e),this.name=t,this.message=e,this.details=r}};function Oh(e,t,r,n,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,i)}function Ah(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){Oh(o,n,i,a,s,"next",e)}function s(e){Oh(o,n,i,a,s,"throw",e)}a(void 0)}))}}const Th=cu.IdentifierIssuer,Ch=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,Nh=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,Rh=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,Mh={accept:"application/ld+json, application/json"},Lh={};var jh=Lh;Lh.IdentifierIssuer=Th;const Dh="function"==typeof setImmediate&&setImmediate,Bh=Dh?e=>Dh(e):e=>setTimeout(e,0);function Uh(e,t,r){Lh.nextTick(()=>e(t,r))}Lh.nextTick="object"==typeof ft?Ye:Bh,Lh.setImmediate=Dh?Bh:Lh.nextTick,Lh.clone=function(e){if(e&&"object"==typeof e){let t;if(xh.isArray(e)){t=[];for(let r=0;r<e.length;++r)t[r]=Lh.clone(e[r])}else if(e instanceof Map){t=new Map;for(const[r,n]of e)t.set(r,Lh.clone(n))}else if(e instanceof Set){t=new Set;for(const r of e)t.add(Lh.clone(r))}else if(xh.isObject(e)){t={};for(const r in e)t[r]=Lh.clone(e[r])}else t=e.toString();return t}return e},Lh.asArray=function(e){return Array.isArray(e)?e:[e]},Lh.buildHeaders=(e={})=>{if(Object.keys(e).some(e=>"accept"===e.toLowerCase()))throw new RangeError('Accept header may not be specified; only "'+Mh.accept+'" is supported.');return Object.assign({Accept:Mh.accept},e)},Lh.parseLinkHeader=e=>{const t={},r=e.match(Ch);for(let e=0;e<r.length;++e){let n=r[e].match(Nh);if(!n)continue;const i={target:n[1]},o=n[2];for(;n=Rh.exec(o);)i[n[1]]=void 0===n[2]?n[3]:n[2];const a=i.rel||"";Array.isArray(t[a])?t[a].push(i):t.hasOwnProperty(a)?t[a]=[t[a],i]:t[a]=i}return t},Lh.validateTypeValue=e=>{if(xh.isString(e)||xh.isEmptyObject(e))return;let t=!1;if(xh.isArray(e)){t=!0;for(let r=0;r<e.length;++r)if(!xh.isString(e[r])){t=!1;break}}if(!t)throw new Ph('Invalid JSON-LD syntax; "@type" value must a string, an array of strings, or an empty object.',"jsonld.SyntaxError",{code:"invalid type value",value:e})},Lh.hasProperty=(e,t)=>{if(e.hasOwnProperty(t)){const r=e[t];return!xh.isArray(r)||r.length>0}return!1},Lh.hasValue=(e,t,r)=>{if(Lh.hasProperty(e,t)){let n=e[t];const i=kh.isList(n);if(xh.isArray(n)||i){i&&(n=n["@list"]);for(let e=0;e<n.length;++e)if(Lh.compareValues(r,n[e]))return!0}else if(!xh.isArray(r))return Lh.compareValues(r,n)}return!1},Lh.addValue=(e,t,r,n)=>{if("propertyIsArray"in(n=n||{})||(n.propertyIsArray=!1),"valueIsArray"in n||(n.valueIsArray=!1),"allowDuplicate"in n||(n.allowDuplicate=!0),n.valueIsArray)e[t]=r;else if(xh.isArray(r)){0===r.length&&n.propertyIsArray&&!e.hasOwnProperty(t)&&(e[t]=[]);for(let i=0;i<r.length;++i)Lh.addValue(e,t,r[i],n)}else if(e.hasOwnProperty(t)){const i=!n.allowDuplicate&&Lh.hasValue(e,t,r);xh.isArray(e[t])||i&&!n.propertyIsArray||(e[t]=[e[t]]),i||e[t].push(r)}else e[t]=n.propertyIsArray?[r]:r},Lh.getValues=(e,t)=>[].concat(e[t]||[]),Lh.removeProperty=(e,t)=>{delete e[t]},Lh.removeValue=(e,t,r,n)=>{"propertyIsArray"in(n=n||{})||(n.propertyIsArray=!1);const i=Lh.getValues(e,t).filter(e=>!Lh.compareValues(e,r));0===i.length?Lh.removeProperty(e,t):1!==i.length||n.propertyIsArray?e[t]=i:e[t]=i[0]},Lh.relabelBlankNodes=(e,t)=>function e(t,r){if(xh.isArray(r))for(let n=0;n<r.length;++n)r[n]=e(t,r[n]);else if(kh.isList(r))r["@list"]=e(t,r["@list"]);else if(xh.isObject(r)){kh.isBlankNode(r)&&(r["@id"]=t.getId(r["@id"]));const n=Object.keys(r).sort();for(let i=0;i<n.length;++i){const o=n[i];"@id"!==o&&(r[o]=e(t,r[o]))}}return r}((t=t||{}).issuer||new Th("_:b"),e),Lh.compareValues=(e,t)=>e===t||(!(!kh.isValue(e)||!kh.isValue(t)||e["@value"]!==t["@value"]||e["@type"]!==t["@type"]||e["@language"]!==t["@language"]||e["@index"]!==t["@index"])||!!(xh.isObject(e)&&"@id"in e&&xh.isObject(t)&&"@id"in t)&&e["@id"]===t["@id"]),Lh.compareShortestLeast=(e,t)=>e.length<t.length?-1:t.length<e.length?1:e===t?0:e<t?-1:1,Lh.normalizeDocumentLoader=e=>e.length<2?Lh.callbackify(e):function(){var t=Ah((function*(t){const r=arguments[1];return new Promise((n,i)=>{try{e(t,(e,t)=>{if("function"==typeof r)return Uh(r,e,t);e?i(e):n(t)})}catch(e){if("function"==typeof r)return Uh(r,e);i(e)}})}));return function(e){return t.apply(this,arguments)}}(),Lh.callbackify=e=>function(){var t=Ah((function*(...t){const r=t[t.length-1];let n;"function"==typeof r&&t.pop();try{n=yield e.apply(null,t)}catch(e){if("function"==typeof r)return Uh(r,e);throw e}return"function"==typeof r?Uh(r,null,n):n}));return function(){return t.apply(this,arguments)}}();var Fh=cu.NQuads;const Hh="http://www.w3.org/1999/02/22-rdf-syntax-ns#",Vh="http://www.w3.org/2001/XMLSchema#";var zh={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",RDF:Hh,RDF_LIST:Hh+"List",RDF_FIRST:Hh+"first",RDF_REST:Hh+"rest",RDF_NIL:Hh+"nil",RDF_TYPE:Hh+"type",RDF_PLAIN_LITERAL:Hh+"PlainLiteral",RDF_XML_LITERAL:Hh+"XMLLiteral",RDF_JSON_LITERAL:Hh+"JSON",RDF_OBJECT:Hh+"object",RDF_LANGSTRING:Hh+"langString",XSD:Vh,XSD_BOOLEAN:Vh+"boolean",XSD_DOUBLE:Vh+"double",XSD_INTEGER:Vh+"integer",XSD_STRING:Vh+"string"};const{RDF_LANGSTRING:qh,RDF_PLAIN_LITERAL:Kh,RDF_OBJECT:$h,RDF_XML_LITERAL:Gh,XSD_STRING:Jh}=zh;let Wh;Wh="undefined"!=typeof Node?Node:{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12};function Xh(){return"undefined"==typeof XMLSerializer?ou.XMLSerializer:XMLSerializer}const{clone:Qh}=jh;const Yh={};var Zh=Yh;Yh.parsers={simple:{keys:["href","scheme","authority","path","query","fragment"],regex:/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/},full:{keys:["href","protocol","scheme","authority","auth","user","password","hostname","port","path","directory","file","query","fragment"],regex:/^(([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},Yh.parse=(e,t)=>{const r={},n=Yh.parsers[t||"full"],i=n.regex.exec(e);let o=n.keys.length;for(;o--;)r[n.keys[o]]=void 0===i[o]?null:i[o];return("https"===r.scheme&&"443"===r.port||"http"===r.scheme&&"80"===r.port)&&(r.href=r.href.replace(":"+r.port,""),r.authority=r.authority.replace(":"+r.port,""),r.port=null),r.normalizedPath=Yh.removeDotSegments(r.path),r},Yh.prependBase=(e,t)=>{if(null===e)return t;if(-1!==t.indexOf(":"))return t;xh.isString(e)&&(e=Yh.parse(e||""));const r=Yh.parse(t),n={protocol:e.protocol||""};if(null!==r.authority)n.authority=r.authority,n.path=r.path,n.query=r.query;else if(n.authority=e.authority,""===r.path)n.path=e.path,null!==r.query?n.query=r.query:n.query=e.query;else{if(0===r.path.indexOf("/"))n.path=r.path;else{let t=e.path;t=t.substr(0,t.lastIndexOf("/")+1),t.length>0&&"/"!==t.substr(-1)&&(t+="/"),t+=r.path,n.path=t}n.query=r.query}""!==r.path&&(n.path=Yh.removeDotSegments(n.path));let i=n.protocol;return null!==n.authority&&(i+="//"+n.authority),i+=n.path,null!==n.query&&(i+="?"+n.query),null!==r.fragment&&(i+="#"+r.fragment),""===i&&(i="./"),i},Yh.removeBase=(e,t)=>{if(null===e)return t;xh.isString(e)&&(e=Yh.parse(e||""));let r="";if(""!==e.href?r+=(e.protocol||"")+"//"+(e.authority||""):t.indexOf("//")&&(r+="//"),0!==t.indexOf(r))return t;const n=Yh.parse(t.substr(r.length)),i=e.normalizedPath.split("/"),o=n.normalizedPath.split("/"),a=n.fragment||n.query?0:1;for(;i.length>0&&o.length>a&&i[0]===o[0];)i.shift(),o.shift();let s="";if(i.length>0){i.pop();for(let e=0;e<i.length;++e)s+="../"}return s+=o.join("/"),null!==n.query&&(s+="?"+n.query),null!==n.fragment&&(s+="#"+n.fragment),""===s&&(s="./"),s},Yh.removeDotSegments=e=>{if(0===e.length)return"";const t=e.split("/"),r=[];for(;t.length>0;){const e=t.shift(),n=0===t.length;"."!==e?".."!==e?r.push(e):(r.pop(),n&&r.push("")):n&&r.push("")}return r.length>0&&""!==r[0]&&r.unshift(""),1===r.length&&""===r[0]?"/":r.join("/")};const ed=/^([A-Za-z][A-Za-z0-9+-.]*|_):/;function td(e,t,r,n,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,i)}function rd(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){td(o,n,i,a,s,"next",e)}function s(e){td(o,n,i,a,s,"throw",e)}a(void 0)}))}}Yh.isAbsolute=e=>xh.isString(e)&&ed.test(e),Yh.isRelative=e=>xh.isString(e);const{isArray:nd,isObject:id,isString:od,isUndefined:ad}=xh,{isAbsolute:sd,isRelative:cd,prependBase:ud,parse:ld}=Zh,{asArray:fd,compareShortestLeast:hd}=jh,dd=new Map,pd={};var md=pd;function gd(e,t,r,n,i,o){if(null===t||!od(t)||pd.isKeyword(t))return t;if(n&&n.hasOwnProperty(t)&&!0!==i.get(t)&&pd.createTermDefinition(e,n,t,i,o),e.isPropertyTermScoped&&e.previousContext&&(e=e.previousContext),(r=r||{}).vocab){const r=e.mappings.get(t);if(null===r)return null;if(r)return r["@id"]}const a=t.indexOf(":");if(-1!==a){const r=t.substr(0,a),s=t.substr(a+1);if("_"===r||0===s.indexOf("//"))return t;if(n&&n.hasOwnProperty(r)&&pd.createTermDefinition(e,n,r,i,o),e.mappings.has(r)){return e.mappings.get(r)["@id"]+s}return t}return r.vocab&&"@vocab"in e?e["@vocab"]+t:r.base?ud(e["@base"],t):t}function vd(){return(vd=rd((function*(e,t){const r=jh.normalizeDocumentLoader(t.documentLoader);return yield n(e,new Set,r),e;function n(e,t,r){return i.apply(this,arguments)}function i(){return(i=rd((function*(e,r,i){if(r.size>10)throw new Ph("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"loading remote context failed",max:10});const o=new Map;if(yd(e,o,!1,t.base),0===o.size)return;const a=[...o.keys()].filter(e=>!1===o.get(e));return Promise.all(a.map(function(){var a=rd((function*(a){if(r.has(a))throw new Ph("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"recursive context inclusion",url:a});const s=new Set(r);let c,u;s.add(a);try{c=yield i(a),u=c.document||null,od(u)&&(u=JSON.parse(u))}catch(e){throw new Ph("Dereferencing a URL did not result in a valid JSON-LD object. Possible causes are an inaccessible URL perhaps due to a same-origin policy (ensure the server uses CORS if you are using client-side JavaScript), too many redirects, a non-JSON response, or more than one HTTP Link Header was provided for a remote context.","jsonld.InvalidUrl",{code:"loading remote context failed",url:a,cause:e})}if(!id(u))throw new Ph("Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object.","jsonld.InvalidUrl",{code:"invalid remote context",url:a});u="@context"in u?{"@context":u["@context"]}:{"@context":{}},c.contextUrl&&(nd(u["@context"])||(u["@context"]=[u["@context"]]),u["@context"].push(c.contextUrl)),yield n(u,s,i),o.set(a,u["@context"]),yd(e,o,!0,t.base)}));return function(e){return a.apply(this,arguments)}}()))}))).apply(this,arguments)}}))).apply(this,arguments)}function yd(e,t,r,n){if(nd(e))for(const i of e)yd(i,t,r,n);else if(id(e))for(const i in e){if("@context"!==i){yd(e[i],t,r,n);continue}const o=e[i];if(nd(o)){let e=o.length;for(let i=0;i<e;++i){const a=o[i];if(od(a)){const s=ud(n,a),c=t.get(s);r?nd(c)?(Array.prototype.splice.apply(o,[i,1].concat(c)),i+=c.length-1,e=o.length):!1!==c&&(o[i]=c):void 0===c&&t.set(s,!1)}else for(const e in a)id(a[e])&&yd(a[e],t,r,n)}}else if(od(o)){const a=ud(n,o),s=t.get(a);r?!1!==s&&(e[i]=s):void 0===s&&t.set(a,!1)}else for(const e in o)id(o[e])&&yd(o[e],t,r,n)}}pd.cache=new class{constructor(e=100){this.order=[],this.cache=new Map,this.size=e}get(e,t){const r=this.cache.get(e);if(r){const e=JSON.stringify(t);return r.get(e)||null}return null}set(e,t,r){if(this.order.length===this.size){const e=this.order.shift();this.cache.get(e.activeCtx).delete(e.localCtx)}const n=JSON.stringify(t);this.order.push({activeCtx:e,localCtx:n});let i=this.cache.get(e);i||(i=new Map,this.cache.set(e,i)),i.set(n,Qh(r))}},pd.process=({activeCtx:e,localCtx:t,options:r,isPropertyTermScopedContext:n=!1,isTypeScopedContext:i=!1})=>{id(t)&&"@context"in t&&nd(t["@context"])&&(t=t["@context"]);const o=fd(t);if(0===o.length)return e;const a=e.previousContext||e;if(n&&e.previousContext)return(e=e.clone()).isPropertyTermScoped=!0,e.previousContext=pd.process({activeCtx:e.previousContext,localCtx:o,options:r,isPropertyTermScopedContext:n}),e;let s=e;for(let c=0;c<o.length;++c){let u=o[c];if(e=s,null===u){if(!n&&0!==Object.keys(e.protected).length){const n=r&&r.protectedMode||"error";if("error"===n)throw new Ph("Tried to nullify a context with protected terms outside of a term definition.","jsonld.SyntaxError",{code:"invalid context nullification"});if("warn"===n){console.warn("WARNING: invalid context nullification");const t=e;s=e=pd.getInitialContext(r).clone();for(const[r,n]of Object.entries(t.protected))n&&(e.mappings[r]=jh.clone(t.mappings[r]));e.protected=jh.clone(t.protected),pd.cache&&pd.cache.set(t,u,s);continue}throw new Ph("Invalid protectedMode.","jsonld.SyntaxError",{code:"invalid protected mode",context:t,protectedMode:n})}s=e=pd.getInitialContext(r).clone(),i&&(s.previousContext=a.clone());continue}if(pd.cache){const t=pd.cache.get(e,u);if(t){s=e=t;continue}}if(id(u)&&"@context"in u&&(u=u["@context"]),!id(u))throw new Ph("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:u});s=s.clone();const l=new Map;if("@version"in u){if(1.1!==u["@version"])throw new Ph("Unsupported JSON-LD version: "+u["@version"],"jsonld.UnsupportedVersion",{code:"invalid @version value",context:u});if(e.processingMode&&"json-ld-1.0"===e.processingMode)throw new Ph("@version: "+u["@version"]+" not compatible with "+e.processingMode,"jsonld.ProcessingModeConflict",{code:"processing mode conflict",context:u});s.processingMode="json-ld-1.1",s["@version"]=u["@version"],l.set("@version",!0)}if(s.processingMode=s.processingMode||e.processingMode||"json-ld-1.0","@base"in u){let t=u["@base"];if(null===t);else if(sd(t))t=ld(t);else{if(!cd(t))throw new Ph('Invalid JSON-LD syntax; the value of "@base" in a @context must be an absolute IRI, a relative IRI, or null.',"jsonld.SyntaxError",{code:"invalid base IRI",context:u});t=ld(ud(e["@base"].href,t))}s["@base"]=t,l.set("@base",!0)}if("@vocab"in u){const e=u["@vocab"];if(null===e)delete s["@vocab"];else{if(!od(e))throw new Ph('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:u});if(!sd(e))throw new Ph('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be an absolute IRI.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:u});s["@vocab"]=e}l.set("@vocab",!0)}if("@language"in u){const e=u["@language"];if(null===e)delete s["@language"];else{if(!od(e))throw new Ph('Invalid JSON-LD syntax; the value of "@language" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid default language",context:u});s["@language"]=e.toLowerCase()}l.set("@language",!0)}l.set("@protected",u["@protected"]||!1);for(const e in u)pd.createTermDefinition(s,u,e,l,r,n);i&&!s.previousContext&&(s.previousContext=a.clone()),pd.cache&&pd.cache.set(e,u,s)}return s},pd.createTermDefinition=(e,t,r,n,i,o=!1)=>{if(n.has(r)){if(n.get(r))return;throw new Ph("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:t,term:r})}if(n.set(r,!1),pd.isKeyword(r))throw new Ph("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:t,term:r});if(""===r)throw new Ph("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:t});const a=e.mappings.get(r);let s;if(e.mappings.has(r)&&e.mappings.delete(r),t.hasOwnProperty(r)&&(s=t[r]),null===s||id(s)&&null===s["@id"])return e.mappings.set(r,null),void n.set(r,!0);let c=!1;if(od(s)&&(c=!0,s={"@id":s}),!id(s))throw new Ph("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:t});const u={};e.mappings.set(r,u),u.reverse=!1;const l=["@container","@id","@language","@reverse","@type"];pd.processingMode(e,1.1)&&l.push("@context","@nest","@prefix","@protected");for(const e in s)if(!l.includes(e))throw new Ph("Invalid JSON-LD syntax; a term definition must not contain "+e,"jsonld.SyntaxError",{code:"invalid term definition",context:t});const f=r.indexOf(":");if(u._termHasColon=-1!==f,"@reverse"in s){if("@id"in s)throw new Ph("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});if("@nest"in s)throw new Ph("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});const r=s["@reverse"];if(!od(r))throw new Ph("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});const o=gd(e,r,{vocab:!0,base:!1},t,n,i);if(!sd(o))throw new Ph("Invalid JSON-LD syntax; a @context @reverse value must be an absolute IRI or a blank node identifier.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});u["@id"]=o,u.reverse=!0}else if("@id"in s){let o=s["@id"];if(!od(o))throw new Ph("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(o!==r){if(o=gd(e,o,{vocab:!0,base:!1},t,n,i),!sd(o)&&!pd.isKeyword(o))throw new Ph("Invalid JSON-LD syntax; a @context @id value must be an absolute IRI, a blank node identifier, or a keyword.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});u["@id"]=o,u._prefix=!u._termHasColon&&o.match(/[:\/\?#\[\]@]$/)&&(c||pd.processingMode(e,1))}}if(!("@id"in u))if(u._termHasColon){const o=r.substr(0,f);if(t.hasOwnProperty(o)&&pd.createTermDefinition(e,t,o,n,i),e.mappings.has(o)){const t=r.substr(f+1);u["@id"]=e.mappings.get(o)["@id"]+t}else u["@id"]=r}else{if(!("@vocab"in e))throw new Ph("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t,term:r});u["@id"]=e["@vocab"]+r}if((!0===s["@protected"]||!0===n.get("@protected")&&!1!==s["@protected"])&&(e.protected[r]=!0,u.protected=!0),n.set(r,!0),"@type"in s){let r=s["@type"];if(!od(r))throw new Ph("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:t});if("@id"!==r&&"@vocab"!==r&&"@json"!==r){if(r=gd(e,r,{vocab:!0,base:!1},t,n,i),!sd(r))throw new Ph("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:t});if(0===r.indexOf("_:"))throw new Ph("Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:t})}u["@type"]=r}if("@container"in s){const r=od(s["@container"])?[s["@container"]]:s["@container"]||[],n=["@list","@set","@index","@language"];let i=!0;const o=r.includes("@set");if(pd.processingMode(e,1.1))if(n.push("@graph","@id","@type"),r.includes("@list")){if(1!==r.length)throw new Ph("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:t})}else if(r.includes("@graph")){if(r.some(e=>"@graph"!==e&&"@id"!==e&&"@index"!==e&&"@set"!==e))throw new Ph("Invalid JSON-LD syntax; @context @container with @graph must have no other values other than @id, @index, and @set","jsonld.SyntaxError",{code:"invalid container mapping",context:t})}else i&=r.length<=(o?2:1);else i&=!nd(s["@container"]),i&=r.length<=1;if(i&=r.every(e=>n.includes(e)),i&=!(o&&r.includes("@list")),!i)throw new Ph("Invalid JSON-LD syntax; @context @container value must be one of the following: "+n.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:t});if(u.reverse&&!r.every(e=>["@index","@set"].includes(e)))throw new Ph("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});u["@container"]=r}if("@context"in s&&(u["@context"]=s["@context"]),"@language"in s&&!("@type"in s)){let e=s["@language"];if(null!==e&&!od(e))throw new Ph("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:t});null!==e&&(e=e.toLowerCase()),u["@language"]=e}if("@prefix"in s){if(u._termHasColon)throw new Ph("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:t});if("boolean"!=typeof s["@prefix"])throw new Ph("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:t});u._prefix=!0===s["@prefix"]}if("@nest"in s){const e=s["@nest"];if(!od(e)||"@nest"!==e&&0===e.indexOf("@"))throw new Ph("Invalid JSON-LD syntax; @context @nest value must be a string which is not a keyword other than @nest.","jsonld.SyntaxError",{code:"invalid @nest value",context:t});u["@nest"]=e}// disallow aliasing @context and @preserve const h=u["@id"];if("@context"===h||"@preserve"===h)throw new Ph("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:t});if(a&&a.protected&&!o&&(e.protected[r]=!0,u.protected=!0,!function e(t,r){if(!t||"object"!=typeof t||!r||"object"!=typeof r)return t===r;const n=Array.isArray(t);if(n!==Array.isArray(r))return!1;if(n){if(t.length!==r.length)return!1;for(let n=0;n<t.length;++n)if(!e(t[n],r[n]))return!1;return!0}const i=Object.keys(t),o=Object.keys(r);if(i.length!==o.length)return!1;for(const n in t){let i=t[n],o=r[n];if("@container"===n&&Array.isArray(i)&&Array.isArray(o)&&(i=i.slice().sort(),o=o.slice().sort()),!e(i,o))return!1}return!0}(a,u))){const e=i&&i.protectedMode||"error";if("error"===e)throw new Ph("Invalid JSON-LD syntax; tried to redefine a protected term.","jsonld.SyntaxError",{code:"protected term redefinition",context:t,term:r});if("warn"===e)return void console.warn("WARNING: protected term redefinition",{term:r});throw new Ph("Invalid protectedMode.","jsonld.SyntaxError",{code:"invalid protected mode",context:t,term:r,protectedMode:e})}},pd.expandIri=(e,t,r,n)=>gd(e,t,r,void 0,void 0,n),pd.getInitialContext=e=>{const t=ld(e.base||""),r=JSON.stringify({base:t,processingMode:e.processingMode}),n=dd.get(r);if(n)return n;const i={"@base":t,processingMode:e.processingMode,mappings:new Map,inverse:null,getInverse:function(){const e=this;if(e.inverse)return e.inverse;const t=e.inverse={},r=e.fastCurieMap={},n={},i=e["@language"]||"@none",s=e.mappings,c=[...s.keys()].sort(hd);for(const e of c){const o=s.get(e);if(null===o)continue;let c=o["@container"]||"@none";c=[].concat(c).sort().join("");const u=fd(o["@id"]);for(const s of u){let u=t[s];const l=pd.isKeyword(s);if(u)l||o._termHasColon||n[s].push(e);else if(t[s]=u={},!l&&!o._termHasColon){n[s]=[e];const t={iri:s,terms:n[s]};s[0]in r?r[s[0]].push(t):r[s[0]]=[t]}if(u[c]||(u[c]={"@language":{},"@type":{},"@any":{}}),u=u[c],a(e,u["@any"],"@none"),o.reverse)a(e,u["@type"],"@reverse");else if("@type"in o)a(e,u["@type"],o["@type"]);else if("@language"in o){const t=o["@language"]||"@null";a(e,u["@language"],t)}else a(e,u["@language"],i),a(e,u["@type"],"@none"),a(e,u["@language"],"@none")}}for(const e in r)o(r,e,1);return t},clone:function(){const e={};e["@base"]=this["@base"],e.mappings=jh.clone(this.mappings),e.clone=this.clone,e.inverse=null,e.getInverse=this.getInverse,e.protected=jh.clone(this.protected),this.previousContext&&(e.isPropertyTermScoped=this.previousContext.isPropertyTermScoped,e.previousContext=this.previousContext.clone());e.revertTypeScopedContext=this.revertTypeScopedContext,"@language"in this&&(e["@language"]=this["@language"]);"@vocab"in this&&(e["@vocab"]=this["@vocab"]);return e},revertTypeScopedContext:function(){if(!this.previousContext)return this;return this.previousContext.clone()},protected:{}};return 1e4===dd.size&&dd.clear(),dd.set(r,i),i;function o(e,t,r){const n=e[t],i=e[t]={};let a,s;for(const e of n)a=e.iri,s=r>=a.length?"":a[r],s in i?i[s].push(e):i[s]=[e];for(const e in i)""!==e&&o(i,e,r+1)}function a(e,t,r){t.hasOwnProperty(r)||(t[r]=e)}},pd.getContextValue=(e,t,r)=>{if(null===t){if("@context"===r)return;return null}if(e.mappings.has(t)){const n=e.mappings.get(t);if(ad(r))return n;if(n.hasOwnProperty(r))return n[r]}return"@language"===r&&e.hasOwnProperty(r)?e[r]:"@context"!==r?null:void 0},pd.getAllContexts=function(){var e=rd((function*(e,t){return function(e,t){return vd.apply(this,arguments)}(e,t)}));return function(t,r){return e.apply(this,arguments)}}(),pd.processingMode=(e,t)=>t.toString()>="1.1"?e.processingMode&&e.processingMode>="json-ld-"+t.toString():!e.processingMode||"json-ld-1.0"===e.processingMode,pd.isKeyword=e=>{if(!od(e))return!1;switch(e){case"@base":case"@container":case"@context":case"@default":case"@embed":case"@explicit":case"@graph":case"@id":case"@index":case"@json":case"@language":case"@list":case"@nest":case"@none":case"@omitDefault":case"@prefix":case"@preserve":case"@protected":case"@requireAll":case"@reverse":case"@set":case"@type":case"@value":case"@version":case"@vocab":return!0}return!1};const{isArray:bd,isObject:wd,isEmptyObject:_d,isString:Sd,isUndefined:Ed}=xh,{isList:xd,isValue:Id,isGraph:kd}=kh,{expandIri:Pd,getContextValue:Od,isKeyword:Ad,process:Td,processingMode:Cd}=md,{isAbsolute:Nd}=Zh,{addValue:Rd,asArray:Md,getValues:Ld,validateTypeValue:jd}=jh,Dd={};var Bd=Dd;function Ud(e,t,r){const n=[],i=Object.keys(t).sort();for(const o of i){const i=Pd(e,o,{vocab:!0},r);let a=t[o];bd(a)||(a=[a]);for(const e of a){if(null===e)continue;if(!Sd(e))throw new Ph("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:t});const r={"@value":e};"@none"!==i&&(r["@language"]=o.toLowerCase()),n.push(r)}}return n}function Fd({activeCtx:e,options:t,activeProperty:r,value:n,expansionMap:i,asGraph:o,indexKey:a}){const s=[],c=Object.keys(n).sort(),u="@type"===a;for(let l of c){if(u){const r=Od(e,l,"@context");Ed(r)||(e=Td({activeCtx:e,localCtx:r,isTypeScopedContext:!0,options:t}))}let c=n[l];bd(c)||(c=[c]);const f=Pd(e,l,{vocab:!0},t);"@id"===a?l=Pd(e,l,{base:!0},t):u&&(l=f),c=Dd.expand({activeCtx:e,activeProperty:r,element:c,options:t,insideList:!1,insideIndex:!0,expansionMap:i});for(let e of c)o&&!kd(e)&&(e={"@graph":[e]}),"@type"===a?"@none"===f||(e["@type"]?e["@type"]=[l].concat(e["@type"]):e["@type"]=[l]):"@none"===f||a in e||(e[a]=l),s.push(e)}return s}Dd.expand=({activeCtx:e,activeProperty:t=null,element:r,options:n={},insideList:i=!1,insideIndex:o=!1,typeScopedContext:a=null,expansionMap:s=(()=>{})})=>{if(null==r)return null;if("@default"===t&&(n=Object.assign({},n,{isFrame:!1})),!bd(r)&&!wd(r)){if(!i&&(null===t||"@graph"===Pd(e,t,{vocab:!0},n))){const o=s({unmappedValue:r,activeCtx:e,activeProperty:t,options:n,insideList:i});return void 0===o?null:o}return function({activeCtx:e,activeProperty:t,value:r,options:n}){if(null==r)return null;const i=Pd(e,t,{vocab:!0},n);if("@id"===i)return Pd(e,r,{base:!0},n);if("@type"===i)return Pd(e,r,{vocab:!0,base:!0},n);const o=Od(e,t,"@type");if(("@id"===o||"@graph"===i)&&Sd(r))return{"@id":Pd(e,r,{base:!0},n)};if("@vocab"===o&&Sd(r))return{"@id":Pd(e,r,{vocab:!0,base:!0},n)};if(Ad(i))return r;const a={};if(o&&!["@id","@vocab"].includes(o))a["@type"]=o;else if(Sd(r)){const r=Od(e,t,"@language");null!==r&&(a["@language"]=r)}["boolean","number","string"].includes(typeof r)||(r=r.toString());return a["@value"]=r,a}({activeCtx:e,activeProperty:t,value:r,options:n})}if(bd(r)){let c=[];const u=Od(e,t,"@container")||[];i=i||u.includes("@list");for(let u=0;u<r.length;++u){let l=Dd.expand({activeCtx:e,activeProperty:t,element:r[u],options:n,expansionMap:s,insideIndex:o,typeScopedContext:a});i&&bd(l)&&(l={"@list":l}),null===l&&(l=s({unmappedValue:r[u],activeCtx:e,activeProperty:t,parent:r,index:u,options:n,expandedParent:c,insideList:i}),void 0===l)||(bd(l)?c=c.concat(l):c.push(l))}return c}const c=Pd(e,t,{vocab:!0},n);a=a||(e.previousContext?e:null);let u=Object.keys(r).sort(),l=!o;if(l&&a&&u.length<=2&&!u.includes("@context"))for(const t of u){const r=Pd(a,t,{vocab:!0},n);if("@value"===r){l=!1,e=a;break}if("@id"===r&&1===u.length){l=!1;break}}l&&(e=e.revertTypeScopedContext()),"@context"in r&&(e=Td({activeCtx:e,localCtx:r["@context"],options:n}));for(const t of u){if("@type"===Pd(e,t,{vocab:!0},n)){const i=r[t],o=Array.isArray(i)?i.length>1?i.slice().sort():i:[i];for(const t of o){const r=Od(e.previousContext||e,t,"@context");Ed(r)||(e=Td({activeCtx:e,localCtx:r,options:n,isTypeScopedContext:!0}))}}}let f={};!function e({activeCtx:t,activeProperty:r,expandedActiveProperty:n,element:i,expandedParent:o,options:a={},insideList:s,expansionMap:c}){const u=Object.keys(i).sort(),l=[];for(const e of u){let u,f=i[e];if("@context"===e)continue;let h=Pd(t,e,{vocab:!0},a);if((null===h||!Nd(h)&&!Ad(h))&&(h=c({unmappedProperty:e,activeCtx:t,activeProperty:r,parent:i,options:a,insideList:s,value:f,expandedParent:o}),void 0===h))continue;if(Ad(h)){if("@reverse"===n)throw new Ph("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:f});if(h in o)throw new Ph("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:h})}if("@id"===h){if(!Sd(f)){if(!a.isFrame)throw new Ph('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:f});if(wd(f)){if(!_d(f))throw new Ph('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:f})}else{if(!bd(f))throw new Ph('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:f});if(!f.every(e=>Sd(e)))throw new Ph('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:f})}}Rd(o,"@id",Md(f).map(e=>Sd(e)?Pd(t,e,{base:!0},a):e),{propertyIsArray:a.isFrame});continue}if("@type"===h){jd(f),Rd(o,"@type",Md(f).map(e=>Sd(e)?Pd(t.previousContext||t,e,{base:!0,vocab:!0},a):e),{propertyIsArray:a.isFrame});continue}if("@graph"===h&&!wd(f)&&!bd(f))throw new Ph('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:f});if("@value"===h){Rd(o,"@value",f,{propertyIsArray:a.isFrame});continue}if("@language"===h){if(null===f)continue;if(!Sd(f)&&!a.isFrame)throw new Ph('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:f});f=Md(f).map(e=>Sd(e)?e.toLowerCase():e),Rd(o,"@language",f,{propertyIsArray:a.isFrame});continue}if("@index"===h){if(!Sd(f))throw new Ph('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:f});Rd(o,"@index",f);continue}if("@reverse"===h){if(!wd(f))throw new Ph('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:f});if(u=Dd.expand({activeCtx:t,activeProperty:"@reverse",element:f,options:a,expansionMap:c}),"@reverse"in u)for(const e in u["@reverse"])Rd(o,e,u["@reverse"][e],{propertyIsArray:!0});let e=o["@reverse"]||null;for(const t in u){if("@reverse"===t)continue;null===e&&(e=o["@reverse"]={}),Rd(e,t,[],{propertyIsArray:!0});const r=u[t];for(let n=0;n<r.length;++n){const i=r[n];if(Id(i)||xd(i))throw new Ph('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:u});Rd(e,t,i,{propertyIsArray:!0})}}continue}if("@nest"===h){l.push(e);continue}let d=t;const p=Od(t,e,"@context");Ed(p)||(d=Td({activeCtx:t,localCtx:p,isPropertyTermScopedContext:!0,options:a}));const m=Od(d,e,"@container")||[];if(m.includes("@language")&&wd(f))u=Ud(d,f,a);else if(m.includes("@index")&&wd(f)){const t=m.includes("@graph");u=Fd({activeCtx:d,options:a,activeProperty:e,value:f,expansionMap:c,asGraph:t,indexKey:"@index"})}else if(m.includes("@id")&&wd(f)){const t=m.includes("@graph");u=Fd({activeCtx:d,options:a,activeProperty:e,value:f,expansionMap:c,asGraph:t,indexKey:"@id"})}else if(m.includes("@type")&&wd(f))u=Fd({activeCtx:d.revertTypeScopedContext(),options:a,activeProperty:e,value:f,expansionMap:c,asGraph:!1,indexKey:"@type"});else{const i="@list"===h;if(i||"@set"===h){let e=r;i&&"@graph"===n&&(e=null),u=Dd.expand({activeCtx:d,activeProperty:e,element:f,options:a,insideList:i,expansionMap:c})}else u="@json"===Od(t,e,"@type")?{"@type":"@json","@value":f}:Dd.expand({activeCtx:d,activeProperty:e,element:f,options:a,insideList:!1,expansionMap:c})}if(null===u&&"@value"!==h&&(u=c({unmappedValue:f,expandedProperty:h,activeCtx:d,activeProperty:r,parent:i,options:a,insideList:s,key:e,expandedParent:o}),void 0===u))continue;if("@list"!==h&&!xd(u)&&m.includes("@list")&&(u={"@list":Md(u)}),m.includes("@graph")&&!m.some(e=>"@id"===e||"@index"===e)&&(u=Md(u).map(e=>kd(e)?e:{"@graph":Md(e)})),d.mappings.has(e)&&d.mappings.get(e).reverse){const e=o["@reverse"]=o["@reverse"]||{};u=Md(u);for(let t=0;t<u.length;++t){const r=u[t];if(Id(r)||xd(r))throw new Ph('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:u});Rd(e,h,r,{propertyIsArray:!0})}continue}const g=!["@index","@id","@type","@value","@language"].includes(h);Rd(o,h,u,{propertyIsArray:g})}if("@value"in i){const e=i["@value"];if("@json"===i["@type"]&&Cd(t,1.1));else if((wd(e)||bd(e))&&!a.isFrame)throw new Ph('Invalid JSON-LD syntax; "@value" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid value object value",value:e})}for(const u of l){const l=bd(i[u])?i[u]:[i[u]];for(const i of l){if(!wd(i)||Object.keys(i).some(e=>"@value"===Pd(t,e,{vocab:!0},a)))throw new Ph("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:i});e({activeCtx:t,activeProperty:r,expandedActiveProperty:n,element:i,expandedParent:o,options:a,insideList:s,expansionMap:c})}}}({activeCtx:e,activeProperty:t,expandedActiveProperty:c,element:r,expandedParent:f,options:n,insideList:i,typeScopedContext:a,expansionMap:s}),u=Object.keys(f);let h=u.length;if("@value"in f){if("@type"in f&&"@language"in f)throw new Ph('Invalid JSON-LD syntax; an element containing "@value" may not contain both "@type" and "@language".',"jsonld.SyntaxError",{code:"invalid value object",element:f});let o=h-1;if("@type"in f&&(o-=1),"@index"in f&&(o-=1),"@language"in f&&(o-=1),0!==o)throw new Ph('Invalid JSON-LD syntax; an element containing "@value" may only have an "@index" property and at most one other property which can be "@type" or "@language".',"jsonld.SyntaxError",{code:"invalid value object",element:f});const a=null===f["@value"]?[]:Md(f["@value"]),c=Ld(f,"@type");if(0===a.length){const o=s({unmappedValue:f,activeCtx:e,activeProperty:t,element:r,options:n,insideList:i});f=void 0!==o?o:null}else{if(!a.every(e=>Sd(e)||_d(e))&&"@language"in f)throw new Ph("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:f});if(Cd(e,1.1)&&c.includes("@json")&&1===c.length);else if(!c.every(e=>Nd(e)&&!(Sd(e)&&0===e.indexOf("_:"))||_d(e)))throw new Ph('Invalid JSON-LD syntax; an element containing "@value" and "@type" must have an absolute IRI for the value of "@type".',"jsonld.SyntaxError",{code:"invalid typed value",element:f})}}else if("@type"in f&&!bd(f["@type"]))f["@type"]=[f["@type"]];else if("@set"in f||"@list"in f){if(h>1&&(2!==h||!("@index"in f)))throw new Ph('Invalid JSON-LD syntax; if an element has the property "@set" or "@list", then it can have at most one other property that is "@index".',"jsonld.SyntaxError",{code:"invalid set or list object",element:f});"@set"in f&&(f=f["@set"],u=Object.keys(f),h=u.length)}else if(1===h&&"@language"in f){const o=s(f,{unmappedValue:f,activeCtx:e,activeProperty:t,element:r,options:n,insideList:i});f=void 0!==o?o:null}if(wd(f)&&!n.keepFreeFloatingNodes&&!i&&(null===t||"@graph"===c)&&(0===h||"@value"in f||"@list"in f||1===h&&"@id"in f)){const o=s({unmappedValue:f,activeCtx:e,activeProperty:t,element:r,options:n,insideList:i});f=void 0!==o?o:null}return f};const{isKeyword:Hd}=md,Vd={};var zd=Vd;Vd.createMergedNodeMap=(e,t)=>{const r=(t=t||{}).issuer||new jh.IdentifierIssuer("_:b"),n={"@default":{}};return Vd.createNodeMap(e,n,"@default",r),Vd.mergeNodeMaps(n)},Vd.createNodeMap=(e,t,r,n,i,o)=>{if(xh.isArray(e)){for(const i of e)Vd.createNodeMap(i,t,r,n,void 0,o);return}if(!xh.isObject(e))return void(o&&o.push(e));if(kh.isValue(e)){if("@type"in e){let t=e["@type"];0===t.indexOf("_:")&&(e["@type"]=t=n.getId(t))}return void(o&&o.push(e))}if(o&&kh.isList(e)){const a=[];return Vd.createNodeMap(e["@list"],t,r,n,i,a),void o.push({"@list":a})}if("@type"in e){const t=e["@type"];for(const e of t)0===e.indexOf("_:")&&n.getId(e)}xh.isUndefined(i)&&(i=kh.isBlankNode(e)?n.getId(e["@id"]):e["@id"]),o&&o.push({"@id":i});const a=t[r],s=a[i]=a[i]||{};s["@id"]=i;const c=Object.keys(e).sort();for(let o of c){if("@id"===o)continue;if("@reverse"===o){const o={"@id":i},s=e["@reverse"];for(const e in s){const i=s[e];for(const s of i){let i=s["@id"];kh.isBlankNode(s)&&(i=n.getId(i)),Vd.createNodeMap(s,t,r,n,i),jh.addValue(a[i],e,o,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===o){i in t||(t[i]={}),Vd.createNodeMap(e[o],t,i,n);continue}if("@type"!==o&&Hd(o)){if("@index"===o&&o in s&&(e[o]!==s[o]||e[o]["@id"]!==s[o]["@id"]))throw new Ph("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:s});s[o]=e[o];continue}const c=e[o];if(0===o.indexOf("_:")&&(o=n.getId(o)),0!==c.length)for(let e of c)if("@type"===o&&(e=0===e.indexOf("_:")?n.getId(e):e),kh.isSubject(e)||kh.isSubjectReference(e)){const i=kh.isBlankNode(e)?n.getId(e["@id"]):e["@id"];jh.addValue(s,o,{"@id":i},{propertyIsArray:!0,allowDuplicate:!1}),Vd.createNodeMap(e,t,r,n,i)}else if(kh.isValue(e))jh.addValue(s,o,e,{propertyIsArray:!0,allowDuplicate:!1});else if(kh.isList(e)){const a=[];Vd.createNodeMap(e["@list"],t,r,n,i,a),e={"@list":a},jh.addValue(s,o,e,{propertyIsArray:!0,allowDuplicate:!1})}else Vd.createNodeMap(e,t,r,n,i),jh.addValue(s,o,e,{propertyIsArray:!0,allowDuplicate:!1});else jh.addValue(s,o,[],{propertyIsArray:!0})}},Vd.mergeNodeMapGraphs=e=>{const t={};for(const r of Object.keys(e).sort())for(const n of Object.keys(e[r]).sort()){const i=e[r][n];n in t||(t[n]={"@id":n});const o=t[n];for(const e of Object.keys(i).sort())if(Hd(e))o[e]=jh.clone(i[e]);else for(const t of i[e])jh.addValue(o,e,jh.clone(t),{propertyIsArray:!0,allowDuplicate:!1})}return t},Vd.mergeNodeMaps=e=>{const t=e["@default"],r=Object.keys(e).sort();for(const n of r){if("@default"===n)continue;const r=e[n];let i=t[n];i?"@graph"in i||(i["@graph"]=[]):t[n]=i={"@id":n,"@graph":[]};const o=i["@graph"];for(const e of Object.keys(r).sort()){const t=r[e];kh.isSubjectReference(t)||o.push(t)}}return t};const{isSubjectReference:qd}=kh,{createMergedNodeMap:Kd}=zd,$d={};var Gd=$d;function Jd(e,t,r,n,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,i)}$d.flatten=e=>{const t=Kd(e),r=[],n=Object.keys(t).sort();for(let e=0;e<n.length;++e){const i=t[n[e]];qd(i)||r.push(i)}return r};const{RDF_LIST:Wd,RDF_FIRST:Xd,RDF_REST:Qd,RDF_NIL:Yd,RDF_TYPE:Zd,RDF_JSON_LITERAL:ep,XSD_BOOLEAN:tp,XSD_DOUBLE:rp,XSD_INTEGER:np,XSD_STRING:ip}=zh,op={};var ap=op;function sp(e,t){if(e.termType.endsWith("Node"))return{"@id":e.value};const r={"@value":e.value};if(e.language)r["@language"]=e.language;else{let n=e.datatype.value;if(n||(n=ip),n===ep){n="@json";try{r["@value"]=JSON.parse(r["@value"])}catch(e){throw new Ph("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:r["@value"],cause:e})}}if(t){if(n===tp)"true"===r["@value"]?r["@value"]=!0:"false"===r["@value"]&&(r["@value"]=!1);else if(xh.isNumeric(r["@value"]))if(n===np){const e=parseInt(r["@value"],10);e.toFixed(0)===r["@value"]&&(r["@value"]=e)}else n===rp&&(r["@value"]=parseFloat(r["@value"]));[tp,np,rp,ip].includes(n)||(r["@type"]=n)}else n!==ip&&(r["@type"]=n)}return r}op.fromRDF=function(){var e,t=(e=function*(e,{useRdfType:t=!1,useNativeTypes:r=!1}){const n={},i={"@default":n},o={};for(const a of e){const e="DefaultGraph"===a.graph.termType?"@default":a.graph.value;e in i||(i[e]={}),"@default"===e||e in n||(n[e]={"@id":e});const s=i[e],c=a.subject.value,u=a.predicate.value,l=a.object;c in s||(s[c]={"@id":c});const f=s[c],h=l.termType.endsWith("Node");if(h&&!(l.value in s)&&(s[l.value]={"@id":l.value}),u===Zd&&!t&&h){jh.addValue(f,"@type",l.value,{propertyIsArray:!0});continue}const d=sp(l,r);if(jh.addValue(f,u,d,{propertyIsArray:!0}),h)if(l.value===Yd){const e=s[l.value];"usages"in e||(e.usages=[]),e.usages.push({node:f,property:u,value:d})}else l.value in o?o[l.value]=!1:o[l.value]={node:f,property:u,value:d}}for(const e in i){const t=i[e];if(!(Yd in t))continue;const r=t[Yd];if(r.usages){for(let e of r.usages){let r=e.node,n=e.property,i=e.value;const a=[],s=[];let c=Object.keys(r).length;for(;n===Qd&&xh.isObject(o[r["@id"]])&&xh.isArray(r[Xd])&&1===r[Xd].length&&xh.isArray(r[Qd])&&1===r[Qd].length&&(3===c||4===c&&xh.isArray(r["@type"])&&1===r["@type"].length&&r["@type"][0]===Wd)&&(a.push(r[Xd][0]),s.push(r["@id"]),e=o[r["@id"]],r=e.node,n=e.property,i=e.value,c=Object.keys(r).length,kh.isBlankNode(r)););delete i["@id"],i["@list"]=a.reverse();for(const e of s)delete t[e]}delete r.usages}}const a=[],s=Object.keys(n).sort();for(const e of s){const t=n[e];if(e in i){const r=t["@graph"]=[],n=i[e],o=Object.keys(n).sort();for(const e of o){const t=n[e];kh.isSubjectReference(t)||r.push(t)}}kh.isSubjectReference(t)||a.push(t)}return a},function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){Jd(o,n,i,a,s,"next",e)}function s(e){Jd(o,n,i,a,s,"throw",e)}a(void 0)}))});return function(e,r){return t.apply(this,arguments)}}();const{createNodeMap:cp}=zd,{isKeyword:up}=md,{RDF_FIRST:lp,RDF_REST:fp,RDF_NIL:hp,RDF_TYPE:dp,RDF_JSON_LITERAL:pp,RDF_LANGSTRING:mp,XSD_BOOLEAN:gp,XSD_DOUBLE:vp,XSD_INTEGER:yp,XSD_STRING:bp}=zh,{isAbsolute:wp}=Zh,_p={};var Sp=_p;function Ep(e,t,r,n,i){const o=Object.keys(t).sort();for(const a of o){const o=t[a],s=Object.keys(o).sort();for(let t of s){const s=o[t];if("@type"===t)t=dp;else if(up(t))continue;for(const o of s){const s={termType:a.startsWith("_:")?"BlankNode":"NamedNode",value:a};if(!wp(a))continue;const c={termType:t.startsWith("_:")?"BlankNode":"NamedNode",value:t};if(!wp(t))continue;if("BlankNode"===c.termType&&!i.produceGeneralizedRdf)continue;const u=xp(o,n,e,r);u&&e.push({subject:s,predicate:c,object:u,graph:r})}}}}function xp(e,t,r,n){const i={};if(kh.isValue(e)){i.termType="Literal",i.value=void 0,i.datatype={termType:"NamedNode"};let t=e["@value"];const r=e["@type"]||null;"@json"===r?(i.value=Vl(t),i.datatype.value=pp):xh.isBoolean(t)?(i.value=t.toString(),i.datatype.value=r||gp):xh.isDouble(t)||r===vp?(xh.isDouble(t)||(t=parseFloat(t)),i.value=t.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),i.datatype.value=r||vp):xh.isNumber(t)?(i.value=t.toFixed(0),i.datatype.value=r||yp):"@language"in e?(i.value=t,i.datatype.value=r||mp,i.language=e["@language"]):(i.value=t,i.datatype.value=r||bp)}else if(kh.isList(e)){const o=function(e,t,r,n){const i={termType:"NamedNode",value:lp},o={termType:"NamedNode",value:fp},a={termType:"NamedNode",value:hp},s=e.pop(),c=s?{termType:"BlankNode",value:t.getId()}:a;let u=c;for(const a of e){const e=xp(a,t,r,n),s={termType:"BlankNode",value:t.getId()};r.push({subject:u,predicate:i,object:e,graph:n}),r.push({subject:u,predicate:o,object:s,graph:n}),u=s}if(s){const e=xp(s,t,r,n);r.push({subject:u,predicate:i,object:e,graph:n}),r.push({subject:u,predicate:o,object:a,graph:n})}return c}(e["@list"],t,r,n);i.termType=o.termType,i.value=o.value}else{const t=xh.isObject(e)?e["@id"]:e;i.termType=t.startsWith("_:")?"BlankNode":"NamedNode",i.value=t}return"NamedNode"!==i.termType||wp(i.value)?i:null}_p.toRDF=(e,t)=>{const r=new jh.IdentifierIssuer("_:b"),n={"@default":{}};cp(e,n,"@default",r);const i=[],o=Object.keys(n).sort();for(const e of o){let o;if("@default"===e)o={termType:"DefaultGraph",value:""};else{if(!wp(e))continue;o=e.startsWith("_:")?{termType:"BlankNode"}:{termType:"NamedNode"},o.value=e}Ep(i,n[e],o,r,t)}return i};const{isKeyword:Ip}=md,{createNodeMap:kp,mergeNodeMapGraphs:Pp}=zd,Op={};var Ap=Op;function Tp(e){const t={};for(const r in e)void 0!==e[r]&&(t["@"+r]=[e[r]]);return[t]}function Cp(e,t,r){for(let n=r.length-1;n>=0;--n){const i=r[n];if(i.graph===t&&i.subject["@id"]===e["@id"])return!0}return!1}function Np(e,t,r){const n="@"+r;let i=n in e?e[n][0]:t[r];return"embed"===r&&(!0===i?i="@last":!1===i?i="@never":"@always"!==i&&"@never"!==i&&"@link"!==i&&(i="@last")),i}function Rp(e){if(!xh.isArray(e)||1!==e.length||!xh.isObject(e[0]))throw new Ph("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:e})}function Mp(e,t,r,n){let i=!0,o=!1;for(const a in r){let s=!1;const c=jh.getValues(t,a),u=0===jh.getValues(r,a).length;if(Ip(a)){if("@id"!==a&&"@type"!==a)continue;if(i=!1,"@id"===a){if(r["@id"].length>=0&&!xh.isEmptyObject(r["@id"][0]))return r["@id"].includes(c[0]);s=!0;continue}if("@type"in r)if(u){if(c.length>0)return!1;s=!0}else{if(1!==r["@type"].length||!xh.isEmptyObject(r["@type"][0])){for(const e of r["@type"])if(c.some(t=>t===e))return!0;return!1}s=c.length>0}}const l=jh.getValues(r,a)[0];let f=!1;if(l&&(Rp([l]),f="@default"in l),i=!1,0!==c.length||!f){if(c.length>0&&u)return!1;if(void 0===l){if(c.length>0)return!1;s=!0}else if(xh.isObject(l))s=c.length>0;else if(kh.isValue(l))s=c.some(e=>Bp(l,e));else if(kh.isSubject(l)||kh.isSubjectReference(l))s=c.some(t=>Dp(e,l,t,n));else if(kh.isList(l)){const t=l["@list"][0];if(kh.isList(c[0])){const r=c[0]["@list"];kh.isValue(t)?s=r.some(e=>Bp(t,e)):(kh.isSubject(t)||kh.isSubjectReference(t))&&(s=r.some(r=>Dp(e,t,r,n)))}else s=!1}if(!s&&n.requireAll)return!1;o=o||s}}return i||o}function Lp(e,t){const r=e.uniqueEmbeds[e.graph],n=r[t],i=n.parent,o=n.property,a={"@id":t};if(xh.isArray(i)){for(let e=0;e<i.length;++e)if(jh.compareValues(i[e],a)){i[e]=a;break}}else{const e=xh.isArray(i[o]);jh.removeValue(i,o,a,{propertyIsArray:e}),jh.addValue(i,o,a,{propertyIsArray:e})}const s=e=>{const t=Object.keys(r);for(const n of t)n in r&&xh.isObject(r[n].parent)&&r[n].parent["@id"]===e&&(delete r[n],s(n))};s(t)}function jp(e,t,r){xh.isObject(e)?jh.addValue(e,t,r,{propertyIsArray:!0}):e.push(r)}function Dp(e,t,r,n){if(!("@id"in r))return!1;const i=e.subjects[r["@id"]];return i&&Mp(e,i,t,n)}function Bp(e,t){const r=t["@value"],n=t["@type"],i=t["@language"],o=e["@value"]?xh.isArray(e["@value"])?e["@value"]:[e["@value"]]:[],a=e["@type"]?xh.isArray(e["@type"])?e["@type"]:[e["@type"]]:[],s=e["@language"]?xh.isArray(e["@language"])?e["@language"]:[e["@language"]]:[];return 0===o.length&&0===a.length&&0===s.length||!(!o.includes(r)&&!xh.isEmptyObject(o[0]))&&(!!(!n&&0===a.length||a.includes(n)||n&&xh.isEmptyObject(a[0]))&&!!(!i&&0===s.length||s.includes(i)||i&&xh.isEmptyObject(s[0])))}Op.frameMergedOrDefault=(e,t,r)=>{const n={options:r,graph:"@default",graphMap:{"@default":{}},graphStack:[],subjectStack:[],link:{},bnodeMap:{}},i=new jh.IdentifierIssuer("_:b");kp(e,n.graphMap,"@default",i),r.merged&&(n.graphMap["@merged"]=Pp(n.graphMap),n.graph="@merged"),n.subjects=n.graphMap[n.graph];const o=[];return Op.frame(n,Object.keys(n.subjects).sort(),t,o),r.pruneBlankNodeIdentifiers&&(r.bnodesToClear=Object.keys(n.bnodeMap).filter(e=>1===n.bnodeMap[e].length)),o},Op.frame=(e,t,r,n,i=null)=>{Rp(r),r=r[0];const o=e.options,a={embed:Np(r,o,"embed"),explicit:Np(r,o,"explicit"),requireAll:Np(r,o,"requireAll")},s=function(e,t,r,n){const i={};for(const o of t){const t=e.graphMap[e.graph][o];Mp(e,t,r,n)&&(i[o]=t)}return i}(e,t,r,a),c=Object.keys(s).sort();for(const t of c){const c=s[t];if("@link"===a.embed&&t in e.link){jp(n,i,e.link[t]);continue}null===i?e.uniqueEmbeds={[e.graph]:{}}:e.uniqueEmbeds[e.graph]=e.uniqueEmbeds[e.graph]||{};const u={};if(u["@id"]=t,0===t.indexOf("_:")&&jh.addValue(e.bnodeMap,t,u,{propertyIsArray:!0}),e.link[t]=u,"@never"===a.embed||Cp(c,e.graph,e.subjectStack))jp(n,i,u);else{if("@last"===a.embed&&(t in e.uniqueEmbeds[e.graph]&&Lp(e,t),e.uniqueEmbeds[e.graph][t]={parent:n,property:i}),e.subjectStack.push({subject:c,graph:e.graph}),t in e.graphMap){let n=!1,i=null;"@graph"in r?(i=r["@graph"][0],xh.isObject(i)||(i={}),n=!("@merged"===t||"@default"===t)):(n="@merged"!==e.graph,i={}),n&&(e.graphStack.push(e.graph),e.graph=t,Op.frame(e,Object.keys(e.graphMap[t]).sort(),[i],u,"@graph"),e.graph=e.graphStack.pop)}for(const t of Object.keys(c).sort())if(Ip(t)){if(u[t]=jh.clone(c[t]),"@type"===t)for(const t of c["@type"])0===t.indexOf("_:")&&jh.addValue(e.bnodeMap,t,u,{propertyIsArray:!0})}else if(!a.explicit||t in r)for(let n of c[t]){const i=t in r?r[t]:Tp(a);if(kh.isList(n)){const i={"@list":[]};jp(u,t,i);const o=n["@list"];for(const s in o)if(n=o[s],kh.isSubjectReference(n)){const o=t in r?r[t][0]["@list"]:Tp(a);Op.frame(e,[n["@id"]],o,i,"@list")}else jp(i,"@list",jh.clone(n))}else kh.isSubjectReference(n)?Op.frame(e,[n["@id"]],i,u,t):Bp(i[0],n)&&jp(u,t,jh.clone(n))}for(const e of Object.keys(r).sort()){if(Ip(e))continue;const t=r[e][0]||{};if(!Np(t,o,"omitDefault")&&!(e in u)){let r="@null";"@default"in t&&(r=jh.clone(t["@default"])),xh.isArray(r)||(r=[r]),u[e]=[{"@preserve":r}]}}if("@reverse"in r)for(const n of Object.keys(r["@reverse"]).sort()){const o=r["@reverse"][n];for(const r of Object.keys(e.subjects)){jh.getValues(e.subjects[r],n).some(e=>e["@id"]===t)&&(u["@reverse"]=u["@reverse"]||{},jh.addValue(u["@reverse"],n,[],{propertyIsArray:!0}),Op.frame(e,[r],o,u["@reverse"][n],i))}}jp(n,i,u),e.subjectStack.pop()}}};const{isArray:Up,isObject:Fp,isString:Hp,isUndefined:Vp}=xh,{isList:zp,isValue:qp,isGraph:Kp,isSimpleGraph:$p,isSubjectReference:Gp}=kh,{expandIri:Jp,getContextValue:Wp,isKeyword:Xp,process:Qp}=md,{removeBase:Yp}=Zh,{addValue:Zp,asArray:em,compareShortestLeast:tm}=jh,rm={};var nm=rm;function im(e,t,r){if("@nest"!==Jp(e,t,{vocab:!0},r))throw new Ph("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}function om(e,t,r,n,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,i)}rm.compact=({activeCtx:e,activeProperty:t=null,element:r,options:n={},compactionMap:i=(()=>{})})=>{if(Up(r)){let o=[];for(let a=0;a<r.length;++a){let s=rm.compact({activeCtx:e,activeProperty:t,element:r[a],options:n,compactionMap:i});null===s&&(s=i({unmappedValue:r[a],activeCtx:e,activeProperty:t,parent:r,index:a,options:n}),void 0===s)||o.push(s)}if(n.compactArrays&&1===o.length){0===(Wp(e,t,"@container")||[]).length&&(o=o[0])}return o}const o=Wp(e,t,"@context");if(Vp(o)||(e=Qp({activeCtx:e,localCtx:o,isPropertyTermScopedContext:!0,options:n})),Fp(r)){if(n.link&&"@id"in r&&n.link.hasOwnProperty(r["@id"])){const e=n.link[r["@id"]];for(let t=0;t<e.length;++t)if(e[t].expanded===r)return e[t].compacted}if(qp(r)||Gp(r)){const i=rm.compactValue({activeCtx:e,activeProperty:t,value:r,options:n});return n.link&&Gp(r)&&(n.link.hasOwnProperty(r["@id"])||(n.link[r["@id"]]=[]),n.link[r["@id"]].push({expanded:r,compacted:i})),i}if(zp(r)){if((Wp(e,t,"@container")||[]).includes("@list"))return rm.compact({activeCtx:e,activeProperty:t,element:r["@list"],options:n,compactionMap:i})}const o="@reverse"===t,a={};e=e.revertTypeScopedContext(),n.link&&"@id"in r&&(n.link.hasOwnProperty(r["@id"])||(n.link[r["@id"]]=[]),n.link[r["@id"]].push({expanded:r,compacted:a}));let s=r["@type"]||[];s.length>1&&(s=Array.from(s).sort());const c=e;for(const t of s){const r=rm.compactIri({activeCtx:c,iri:t,relativeTo:{vocab:!0}}),i=Wp(c,r,"@context");Vp(i)||(e=Qp({activeCtx:e,localCtx:i,options:n,isTypeScopedContext:!0}))}const u=Object.keys(r).sort();for(const s of u){const c=r[s];if("@id"!==s&&"@type"!==s)if("@reverse"!==s)if("@preserve"!==s)if("@index"!==s)if("@graph"!==s&&"@list"!==s&&Xp(s)){const t=rm.compactIri({activeCtx:e,iri:s,relativeTo:{vocab:!0}});Zp(a,t,c)}else{if(!Up(c))throw new Ph("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(0===c.length){const t=rm.compactIri({activeCtx:e,iri:s,value:c,relativeTo:{vocab:!0},reverse:o}),r=e.mappings.has(t)?e.mappings.get(t)["@nest"]:null;let i=a;r&&(im(e,r,n),Fp(a[r])||(a[r]={}),i=a[r]),Zp(i,t,c,{propertyIsArray:!0})}for(const t of c){const r=rm.compactIri({activeCtx:e,iri:s,value:t,relativeTo:{vocab:!0},reverse:o}),c=e.mappings.has(r)?e.mappings.get(r)["@nest"]:null;let u=a;c&&(im(e,c,n),Fp(a[c])||(a[c]={}),u=a[c]);const l=Wp(e,r,"@container")||[],f=Kp(t),h=zp(t);let d;h?d=t["@list"]:f&&(d=t["@graph"]);let p=rm.compact({activeCtx:e,activeProperty:r,element:h||f?d:t,options:n,compactionMap:i});if(h){if(Up(p)||(p=[p]),l.includes("@list")){Zp(u,r,p,{valueIsArray:!0,allowDuplicate:!0});continue}p={[rm.compactIri({activeCtx:e,iri:"@list",relativeTo:{vocab:!0}})]:p},"@index"in t&&(p[rm.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=t["@index"])}if(f)if(l.includes("@graph")&&(l.includes("@id")||l.includes("@index")&&$p(t))){let i;u.hasOwnProperty(r)?i=u[r]:u[r]=i={};const o=(l.includes("@id")?t["@id"]:t["@index"])||rm.compactIri({activeCtx:e,iri:"@none",vocab:!0});Zp(i,o,p,{propertyIsArray:!n.compactArrays||l.includes("@set")})}else l.includes("@graph")&&$p(t)||(Up(p)&&1===p.length&&n.compactArrays&&(p=p[0]),p={[rm.compactIri({activeCtx:e,iri:"@graph",relativeTo:{vocab:!0}})]:p},"@id"in t&&(p[rm.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]=t["@id"]),"@index"in t&&(p[rm.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=t["@index"])),Zp(u,r,p,{propertyIsArray:!n.compactArrays||l.includes("@set")});else if(l.includes("@language")||l.includes("@index")||l.includes("@id")||l.includes("@type")){let n,i;if(u.hasOwnProperty(r)?n=u[r]:u[r]=n={},l.includes("@language"))qp(p)&&(p=p["@value"]),i=t["@language"];else if(l.includes("@index"))i=t["@index"];else if(l.includes("@id")){const t=rm.compactIri({activeCtx:e,iri:"@id",vocab:!0});i=p[t],delete p[t]}else if(l.includes("@type")){const t=rm.compactIri({activeCtx:e,iri:"@type",vocab:!0});let r;switch([i,...r]=em(p[t]||[]),r.length){case 0:delete p[t];break;case 1:p[t]=r[0];break;default:p[t]=r}}i||(i=rm.compactIri({activeCtx:e,iri:"@none",vocab:!0})),Zp(n,i,p,{propertyIsArray:l.includes("@set")})}else{const e=!n.compactArrays||l.includes("@set")||l.includes("@list")||Up(p)&&0===p.length||"@list"===s||"@graph"===s;Zp(u,r,p,{propertyIsArray:e})}}}else{if((Wp(e,t,"@container")||[]).includes("@index"))continue;const r=rm.compactIri({activeCtx:e,iri:s,relativeTo:{vocab:!0}});Zp(a,r,c)}else{const r=rm.compact({activeCtx:e,activeProperty:t,element:c,options:n,compactionMap:i});Up(r)&&0===r.length||Zp(a,s,r)}else{const t=rm.compact({activeCtx:e,activeProperty:"@reverse",element:c,options:n,compactionMap:i});for(const r in t)if(e.mappings.has(r)&&e.mappings.get(r).reverse){const i=t[r],o=(Wp(e,r,"@container")||[]).includes("@set")||!n.compactArrays;Zp(a,r,i,{propertyIsArray:o}),delete t[r]}if(Object.keys(t).length>0){const r=rm.compactIri({activeCtx:e,iri:s,relativeTo:{vocab:!0}});Zp(a,r,t)}}else{const t="@type"===s,r=t&&e.previousContext||e;let n=em(c).map(e=>rm.compactIri({activeCtx:r,iri:e,relativeTo:{vocab:t}}));1===n.length&&(n=n[0]);const i=rm.compactIri({activeCtx:e,iri:s,relativeTo:{vocab:!0}}),o=Up(n)&&0===c.length;Zp(a,i,n,{propertyIsArray:o})}}return a}return r},rm.compactIri=({activeCtx:e,iri:t,value:r=null,relativeTo:n={vocab:!1},reverse:i=!1})=>{if(null===t)return t;e.isPropertyTermScoped&&e.previousContext&&(e=e.previousContext);const o=e.getInverse();if(Xp(t)&&t in o&&"@none"in o[t]&&"@type"in o[t]["@none"]&&"@none"in o[t]["@none"]["@type"])return o[t]["@none"]["@type"]["@none"];if(n.vocab&&t in o){const n=e["@language"]||"@none",o=[];Fp(r)&&"@index"in r&&!("@graph"in r)&&o.push("@index","@index@set"),Fp(r)&&"@preserve"in r&&(r=r["@preserve"][0]),Kp(r)?("@index"in r&&o.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in r&&o.push("@graph@id","@graph@id@set"),o.push("@graph","@graph@set","@set"),"@index"in r||o.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in r||o.push("@graph@id","@graph@id@set")):Fp(r)&&!qp(r)&&o.push("@id","@id@set","@type","@set@type");let a="@language",s="@null";if(i)a="@type",s="@reverse",o.push("@set");else if(zp(r)){"@index"in r||o.push("@list");const e=r["@list"];if(0===e.length)a="@any",s="@none";else{let t=0===e.length?n:null,r=null;for(let n=0;n<e.length;++n){const i=e[n];let o="@none",a="@none";if(qp(i)?"@language"in i?o=i["@language"]:"@type"in i?a=i["@type"]:o="@null":a="@id",null===t?t=o:o!==t&&qp(i)&&(t="@none"),null===r?r=a:a!==r&&(r="@none"),"@none"===t&&"@none"===r)break}t=t||"@none",r=r||"@none","@none"!==r?(a="@type",s=r):s=t}}else qp(r)?"@language"in r&&!("@index"in r)?(o.push("@language","@language@set"),s=r["@language"]):"@type"in r&&(a="@type",s=r["@type"]):(a="@type",s="@id"),o.push("@set");o.push("@none"),Fp(r)&&!("@index"in r)&&o.push("@index","@index@set"),qp(r)&&1===Object.keys(r).length&&o.push("@language","@language@set");const c=function(e,t,r,n,i,o){null===o&&(o="@null");const a=[];if("@id"!==o&&"@reverse"!==o||!Gp(r))a.push(o);else{"@reverse"===o&&a.push("@reverse");const t=rm.compactIri({activeCtx:e,iri:r["@id"],relativeTo:{vocab:!0}});e.mappings.has(t)&&e.mappings.get(t)&&e.mappings.get(t)["@id"]===r["@id"]?a.push.apply(a,["@vocab","@id"]):a.push.apply(a,["@id","@vocab"])}a.push("@none");const s=e.inverse[t];for(let e=0;e<n.length;++e){const t=n[e];if(!(t in s))continue;const r=s[t][i];for(let e=0;e<a.length;++e){const t=a[e];if(t in r)return r[t]}}return null}(e,t,r,o,a,s);if(null!==c)return c}if(n.vocab&&"@vocab"in e){const r=e["@vocab"];if(0===t.indexOf(r)&&t!==r){const n=t.substr(r.length);if(!e.mappings.has(n))return n}}let a=null;const s=[];let c=e.fastCurieMap;const u=t.length-1;for(let e=0;e<u&&t[e]in c;++e)c=c[t[e]],""in c&&s.push(c[""][0]);for(let n=s.length-1;n>=0;--n){const i=s[n],o=i.terms;for(const n of o){const o=n+":"+t.substr(i.iri.length);e.mappings.get(n)._prefix&&(!e.mappings.has(o)||null===r&&e.mappings.get(o)["@id"]===t)&&(null===a||tm(o,a)<0)&&(a=o)}}return null!==a?a:n.vocab?t:Yp(e["@base"],t)},rm.compactValue=({activeCtx:e,activeProperty:t,value:r,options:n})=>{if(qp(r)){const n=Wp(e,t,"@type"),i=Wp(e,t,"@language"),o=Wp(e,t,"@container")||[],a="@index"in r&&!o.includes("@index");if(!a&&(r["@type"]===n||r["@language"]===i))return r["@value"];const s=Object.keys(r).length,c=1===s||2===s&&"@index"in r&&!a,u="@language"in e,l=Hp(r["@value"]),f=e.mappings.has(t)&&null===e.mappings.get(t)["@language"];if(c&&(!u||!l||f))return r["@value"];const h={};return a&&(h[rm.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=r["@index"]),"@type"in r?h[rm.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}})]=rm.compactIri({activeCtx:e,iri:r["@type"],relativeTo:{vocab:!0}}):"@language"in r&&(h[rm.compactIri({activeCtx:e,iri:"@language",relativeTo:{vocab:!0}})]=r["@language"]),h[rm.compactIri({activeCtx:e,iri:"@value",relativeTo:{vocab:!0}})]=r["@value"],h}const i=Jp(e,t,{vocab:!0},n),o=Wp(e,t,"@type"),a=rm.compactIri({activeCtx:e,iri:r["@id"],relativeTo:{vocab:"@vocab"===o}});return"@id"===o||"@vocab"===o||"@graph"===i?a:{[rm.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]:a}}, /** * Removes the @preserve keywords as the last step of the compaction * algorithm when it is running on framed output. * * @param ctx the active context used to compact the input. * @param input the framed, compacted output. * @param options the compaction options used. * * @return the resulting output. */ rm.removePreserve=(e,t,r)=>{if(Up(t)){const n=[];for(let i=0;i<t.length;++i){const o=rm.removePreserve(e,t[i],r);null!==o&&n.push(o)}t=n}else if(Fp(t)){ // remove @preserve if("@preserve"in t)return"@null"===t["@preserve"]?null:t["@preserve"];if(qp(t))return t;if(zp(t))return t["@list"]=rm.removePreserve(e,t["@list"],r),t;const n=rm.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}});if(t.hasOwnProperty(n)){const e=t[n];if(r.link.hasOwnProperty(e)){const n=r.link[e].indexOf(t);if(-1!==n)return r.link[e][n];r.link[e].push(t)}else r.link[e]=[t]}const i=rm.compactIri({activeCtx:e,iri:"@graph",relativeTo:{vocab:!0}});for(const o in t){if(o===n&&r.bnodesToClear.includes(t[o])){delete t[n];continue}let a=rm.removePreserve(e,t[o],r);const s=Wp(e,o,"@container")||[];r.compactArrays&&Up(a)&&1===a.length&&0===s.length&&o!==i&&(a=a[0]),t[o]=a}}return t};const{callbackify:am,normalizeDocumentLoader:sm}=jh;var cm=class{constructor(){this._requests={},this.add=am(this.add.bind(this))}wrapLoader(e){const t=this;return t._loader=sm(e),function(){return t.add.apply(t,arguments)}}add(e){var t,r=this;return(t=function*(){const t=r;let n=t._requests[e];if(n)return Promise.resolve(n);n=t._requests[e]=t._loader(e);try{return yield n}finally{delete t._requests[e]}},function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function a(e){om(o,n,i,a,s,"next",e)}function s(e){om(o,n,i,a,s,"throw",e)}a(void 0)}))})()}};function um(e,t,r,n,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,i)}function lm(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){um(o,n,i,a,s,"next",e)}function s(e){um(o,n,i,a,s,"throw",e)}a(void 0)}))}}const{parseLinkHeader:fm,buildHeaders:hm}=jh,{LINK_HEADER_REL:dm}=zh;var pm=({secure:e,strictSSL:t=!0,maxRedirects:r=-1,request:n,headers:i={}}={strictSSL:!0,maxRedirects:-1,headers:{}})=>{i=hm(i),n=n||ou;const o=ou;return(new cm).wrapLoader((function(e){return a(e,[])}));function a(e,t){return s.apply(this,arguments)}function s(){return(s=lm((function*(s,c){if(0!==s.indexOf("http:")&&0!==s.indexOf("https:"))throw new Ph('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:s});if(e&&0!==s.indexOf("https"))throw new Ph('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:s});let u,l=null;if(null!==l)return l;try{u=yield mm(n,{url:s,headers:i,strictSSL:t,followRedirect:!1})}catch(e){throw new Ph("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:s,cause:e})}const{res:f,body:h}=u;l={contextUrl:null,documentUrl:s,document:h||null};const d=o.STATUS_CODES[f.statusCode];if(f.statusCode>=400)throw new Ph("URL could not be dereferenced: "+d,"jsonld.InvalidUrl",{code:"loading document failed",url:s,httpStatusCode:f.statusCode});if(f.headers.link&&"application/ld+json"!==f.headers["content-type"]){const e=fm(f.headers.link)[dm];if(Array.isArray(e))throw new Ph("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:s});e&&(l.contextUrl=e.target)}if(f.statusCode>=300&&f.statusCode<400&&f.headers.location){if(c.length===r)throw new Ph("URL could not be dereferenced; there were too many redirects.","jsonld.TooManyRedirects",{code:"loading document failed",url:s,httpStatusCode:f.statusCode,redirects:c});if(-1!==c.indexOf(s))throw new Ph("URL could not be dereferenced; infinite redirection was detected.","jsonld.InfiniteRedirectDetected",{code:"recursive context inclusion",url:s,httpStatusCode:f.statusCode,redirects:c});return c.push(s),a(f.headers.location,c)}return c.push(s),l}))).apply(this,arguments)}};function mm(e,t){return new Promise((r,n)=>{e(t,(e,t,i)=>{e?n(e):r({res:t,body:i})})})}function gm(e,t,r,n,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,i)}function vm(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){gm(o,n,i,a,s,"next",e)}function s(e){gm(o,n,i,a,s,"throw",e)}a(void 0)}))}}const{parseLinkHeader:ym,buildHeaders:bm}=jh,{LINK_HEADER_REL:wm}=zh,_m=/(^|(\r\n))link:/i;var Sm=({secure:e,headers:t={},xhr:r}={headers:{}})=>{t=bm(t);return(new cm).wrapLoader((function(e){return n.apply(this,arguments)}));function n(){return(n=vm((function*(n){if(0!==n.indexOf("http:")&&0!==n.indexOf("https:"))throw new Ph('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:n});if(e&&0!==n.indexOf("https"))throw new Ph('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:n});let i;try{i=yield Em(r,n,t)}catch(e){throw new Ph("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:n,cause:e})}if(i.status>=400)throw new Ph("URL could not be dereferenced: "+i.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:n,httpStatusCode:i.status});const o={contextUrl:null,documentUrl:n,document:i.response},a=i.getResponseHeader("Content-Type");let s;if(_m.test(i.getAllResponseHeaders())&&(s=i.getResponseHeader("Link")),s&&"application/ld+json"!==a){if(s=ym(s)[wm],Array.isArray(s))throw new Ph("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:n});s&&(o.contextUrl=s.target)}return o}))).apply(this,arguments)}};function Em(e,t,r){const n=new(e=e||XMLHttpRequest);return new Promise((e,i)=>{n.onload=()=>e(n),n.onerror=e=>i(e),n.open("GET",t,!0);for(const e in r)n.setRequestHeader(e,r[e]);n.send()})}function xm(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function Im(e,t,r,n,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,i)}function km(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){Im(o,n,i,a,s,"next",e)}function s(e){Im(o,n,i,a,s,"throw",e)}a(void 0)}))}} /** * A JavaScript implementation of the JSON-LD API. * * @author Dave Longley * * @license BSD 3-Clause License * Copyright (c) 2011-2017 Digital Bazaar, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the Digital Bazaar, Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */const Pm=jh.IdentifierIssuer,{expand:Om}=Bd,{flatten:Am}=Gd,{fromRDF:Tm}=ap,{toRDF:Cm}=Sp,{frameMergedOrDefault:Nm}=Ap,{isArray:Rm,isObject:Mm,isString:Lm}=xh,{isSubjectReference:jm}=kh,{getInitialContext:Dm,process:Bm,getAllContexts:Um}=md,{compact:Fm,compactIri:Hm,removePreserve:Vm}=nm,{createNodeMap:zm,createMergedNodeMap:qm,mergeNodeMaps:Km}=zd,$m=void 0!==ft&&ft.versions&&ft.versions.node,Gm=!$m&&("undefined"!=typeof window||"undefined"!=typeof self),Jm=function(e){const t={};function r(t,r){let{documentLoader:n=e.documentLoader}=r,i=xm(r,["documentLoader"]);return Object.assign({},{documentLoader:n},i,t)}return e.compact=jh.callbackify(function(){var t=km((function*(t,n,i){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(null===n)throw new Ph("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(null===t)return null;let o;(i=r(i,{base:Lm(t)?t:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new Pm("_:b")})).link&&(i.skipExpansion=!0),i.compactToRelative||delete i.base,o=i.skipExpansion?t:yield e.expand(t,i);const a=yield e.processContext(Dm(i),n,i);let s=Fm({activeCtx:a,element:o,options:i,compactionMap:i.compactionMap});i.compactArrays&&!i.graph&&Rm(s)?1===s.length?s=s[0]:0===s.length&&(s={}):i.graph&&Mm(s)&&(s=[s]),Mm(n)&&"@context"in n&&(n=n["@context"]),n=jh.clone(n),Rm(n)||(n=[n]);const c=n;n=[];for(let e=0;e<c.length;++e)(!Mm(c[e])||Object.keys(c[e]).length>0)&&n.push(c[e]);const u=n.length>0;if(1===n.length&&(n=n[0]),Rm(s)){const e=Hm({activeCtx:a,iri:"@graph",relativeTo:{vocab:!0}}),t=s;s={},u&&(s["@context"]=n),s[e]=t}else if(Mm(s)&&u){const e=s;s={"@context":n};for(const t in e)s[t]=e[t]}if(i.framing){const e=Hm({activeCtx:a,iri:"@graph",relativeTo:{vocab:!0}});// remove @preserve from results i.link={},s[e]=Vm(a,s[e],i)}return s}));return function(e,r,n){return t.apply(this,arguments)}}()),e.expand=jh.callbackify(function(){var t=km((function*(t,n){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");!1===(n=r(n,{keepFreeFloatingNodes:!1})).expansionMap&&(n.expansionMap=void 0);const i={},o=[];if("expandContext"in n){const e=jh.clone(n.expandContext);Mm(e)&&"@context"in e?i.expandContext=e:i.expandContext={"@context":e},o.push(i.expandContext)}let a;if(Lm(t)){const r=yield e.get(t,n);a=r.documentUrl,i.input=r.document,r.contextUrl&&(i.remoteContext={"@context":r.contextUrl},o.push(i.remoteContext))}else i.input=jh.clone(t);"base"in n||(n.base=a||""),yield Um(i,n);let s=Dm(n);o.forEach(e=>{s=Bm({activeCtx:s,localCtx:e,options:n})});let c=Om({activeCtx:s,element:i.input,options:n,expansionMap:n.expansionMap});return Mm(c)&&"@graph"in c&&1===Object.keys(c).length?c=c["@graph"]:null===c&&(c=[]),Rm(c)||(c=[c]),c}));return function(e,r){return t.apply(this,arguments)}}()),e.flatten=jh.callbackify(function(){var t=km((function*(t,n,i){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");n="function"==typeof n?null:n||null,i=r(i,{base:Lm(t)?t:""});const o=yield e.expand(t,i),a=Am(o);if(null===n)return a;i.graph=!0,i.skipExpansion=!0;const s=yield e.compact(a,n,i);return s}));return function(e,r,n){return t.apply(this,arguments)}}()),e.frame=jh.callbackify(function(){var t=km((function*(t,n,i){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(i=r(i,{base:Lm(t)?t:"",embed:"@last",explicit:!1,requireAll:!0,omitDefault:!1,pruneBlankNodeIdentifiers:!0,bnodesToClear:[]}),Lm(n)){const t=yield e.get(n,i);if(n=t.document,t.contextUrl){let e=n["@context"];e?Rm(e)?e.push(t.contextUrl):e=[e,t.contextUrl]:e=t.contextUrl,n["@context"]=e}}const o=n&&n["@context"]||{},a=yield e.expand(t,i),s=jh.clone(i);s.isFrame=!0,s.keepFreeFloatingNodes=!0;const c=yield e.expand(n,s);s.merged=!("@graph"in n);const u=Nm(a,c,s);s.graph=!0,s.skipExpansion=!0,s.link={},s.framing=!0;const l=yield e.compact(u,o,s);return l}));return function(e,r,n){return t.apply(this,arguments)}}()),e.link=jh.callbackify(function(){var t=km((function*(t,r,n){const i={};return r&&(i["@context"]=r),i["@embed"]="@link",e.frame(t,i,n)}));return function(e,r,n){return t.apply(this,arguments)}}()),e.normalize=e.canonize=jh.callbackify(function(){var t=km((function*(t,n){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if("inputFormat"in(n=r(n,{base:Lm(t)?t:"",algorithm:"URDNA2015",skipExpansion:!1}))){if("application/n-quads"!==n.inputFormat&&"application/nquads"!==n.inputFormat)throw new Ph("Unknown canonicalization input format.","jsonld.CanonizeError");const e=Fh.parse(t);return cu.canonize(e,n)}const i=jh.clone(n);delete i.format,i.produceGeneralizedRdf=!1;const o=yield e.toRDF(t,i);return cu.canonize(o,n)}));return function(e,r){return t.apply(this,arguments)}}()),e.fromRDF=jh.callbackify(function(){var e=km((function*(e,n){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");n=r(n,{format:Lm(e)?"application/n-quads":void 0});const{format:i}=n;let o,{rdfParser:a}=n;if(i){if(a=a||t[i],!a)throw new Ph("Unknown input format.","jsonld.UnknownFormat",{format:i})}else a=()=>e;return o=a.length>1?new Promise((t,r)=>{a(e,(e,n)=>{e?r(e):t(n)})}):Promise.resolve(a(e)),o=yield o,Array.isArray(o)||(o=Fh.legacyDatasetToQuads(o)),Tm(o,n)}));return function(t,r){return e.apply(this,arguments)}}()),e.toRDF=jh.callbackify(function(){var t=km((function*(t,n){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");let i;i=(n=r(n,{base:Lm(t)?t:"",skipExpansion:!1})).skipExpansion?t:yield e.expand(t,n);const o=Cm(i,n);if(n.format){if("application/n-quads"===n.format||"application/nquads"===n.format)return yield Fh.serialize(o);throw new Ph("Unknown output format.","jsonld.UnknownFormat",{format:n.format})}return o}));return function(e,r){return t.apply(this,arguments)}}()),e.createNodeMap=jh.callbackify(function(){var t=km((function*(t,n){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");n=r(n,{base:Lm(t)?t:""});const i=yield e.expand(t,n);return qm(i,n)}));return function(e,r){return t.apply(this,arguments)}}()),e.merge=jh.callbackify(function(){var t=km((function*(t,n,i){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!Rm(t))throw new TypeError('Could not merge, "docs" must be an array.');n="function"==typeof n?null:n||null,i=r(i,{});const o=yield Promise.all(t.map(t=>{const r=Object.assign({},i);return e.expand(t,r)}));let a=!0;"mergeNodes"in i&&(a=i.mergeNodes);const s=i.issuer||new Pm("_:b"),c={"@default":{}};for(let e=0;e<o.length;++e){const t=jh.relabelBlankNodes(o[e],{issuer:new Pm("_:b"+e+"-")}),r=a||0===e?c:{"@default":{}};if(zm(t,r,"@default",s),r!==c)for(const e in r){const t=r[e];if(!(e in c)){c[e]=t;continue}const n=c[e];for(const e in t)e in n||(n[e]=t[e])}}const u=Km(c),l=[],f=Object.keys(u).sort();for(let e=0;e<f.length;++e){const t=u[f[e]];jm(t)||l.push(t)}if(null===n)return l;i.graph=!0,i.skipExpansion=!0;const h=yield e.compact(l,n,i);return h}));return function(e,r,n){return t.apply(this,arguments)}}()),Object.defineProperty(e,"documentLoader",{get:()=>e._documentLoader,set:t=>e._documentLoader=jh.normalizeDocumentLoader(t)}),e.documentLoader=function(){var e=km((function*(e){throw new Ph("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:e})}));return function(t){return e.apply(this,arguments)}}(),e.loadDocument=jh.callbackify(km((function*(){return e.documentLoader.apply(null,arguments)}))),e.get=jh.callbackify(function(){var t=km((function*(t,r){let n;n="function"==typeof r.documentLoader?jh.normalizeDocumentLoader(r.documentLoader):e.documentLoader;const i=yield n(t);try{if(!i.document)throw new Ph("No remote document found at the given URL.","jsonld.NullRemoteDocument");Lm(i.document)&&(i.document=JSON.parse(i.document))}catch(e){throw new Ph("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:e,remoteDoc:i})}return i}));return function(e,r){return t.apply(this,arguments)}}()),e.processContext=jh.callbackify(function(){var e=km((function*(e,t,n){if(n=r(n,{base:""}),null===t)return Dm(n);t=jh.clone(t),Mm(t)&&"@context"in t||(t={"@context":t});const i=yield Um(t,n);return Bm({activeCtx:e,localCtx:i,options:n})}));return function(t,r,n){return e.apply(this,arguments)}}()),e.getContextValue=md.getContextValue,e.documentLoaders={},e.documentLoaders.node=pm,e.documentLoaders.xhr=Sm,e.useDocumentLoader=function(t){if(!(t in e.documentLoaders))throw new Ph('Unknown document loader type: "'+t+'"',"jsonld.UnknownDocumentLoader",{type:t});e.documentLoader=e.documentLoaders[t].apply(e,Array.prototype.slice.call(arguments,1))},e.registerRDFParser=function(e,r){t[e]=r},e.unregisterRDFParser=function(e){delete t[e]},e.registerRDFParser("application/n-quads",Fh.parse),e.registerRDFParser("application/nquads",Fh.parse),e.registerRDFParser("rdfa-api",class{parse(e){const t={"@default":[]},r=e.getSubjects();for(let n=0;n<r.length;++n){const i=r[n];if(null===i)continue;const o=e.getSubjectTriples(i);if(null===o)continue;const a=o.predicates;for(const e in a){const r=a[e].objects;for(let n=0;n<r.length;++n){const o=r[n],a={};0===i.indexOf("_:")?a.subject={type:"blank node",value:i}:a.subject={type:"IRI",value:i},0===e.indexOf("_:")?a.predicate={type:"blank node",value:e}:a.predicate={type:"IRI",value:e};let s=o.value;if(o.type===Gh){const e=new(Xh());s="";for(let t=0;t<o.value.length;t++)o.value[t].nodeType===Wh.ELEMENT_NODE?s+=e.serializeToString(o.value[t]):o.value[t].nodeType===Wh.TEXT_NODE&&(s+=o.value[t].nodeValue)}a.object={},o.type===$h?0===o.value.indexOf("_:")?a.object.type="blank node":a.object.type="IRI":(a.object.type="literal",o.type===Kh?o.language?(a.object.datatype=qh,a.object.language=o.language):a.object.datatype=Jh:a.object.datatype=o.type),a.object.value=s,t["@default"].push(a)}}}return t}}.parse),e.url=Zh,e.util=jh,Object.assign(e,jh),e.promises=e,e.RequestQueue=cm,e.JsonLdProcessor=(e=>{class t{toString(){return"[object JsonLdProcessor]"}}return Object.defineProperty(t,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(t.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:t}),t.compact=function(t,r){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):e.compact(t,r)},t.expand=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):e.expand(t)},t.flatten=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):e.flatten(t)},t})(e),Gm&&void 0===Zt.JsonLdProcessor&&Object.defineProperty(Zt,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:e.JsonLdProcessor}),$m?e.useDocumentLoader("node"):"undefined"!=typeof XMLHttpRequest&&e.useDocumentLoader("xhr"),e},Wm=function(){return Jm((function(){return Wm()}))};Jm(Wm);var Xm=Wm,Qm=tr((function(e){Nc.gte(ft.version,"8.6.0")?e.exports=Sh:e.exports=Xm})),Ym=(Qm.jsonld,tr((function(e){!function(t){var r={bytesToHex:function(e){return function(e){return e.map((function(e){return t=e.toString(16),r=2,t.length>r?t:Array(r-t.length+1).join("0")+t;var t,r})).join("")}(e)},hexToBytes:function(e){if(e.length%2==1)throw new Error("hexToBytes can't have a string with an odd number of characters.");return 0===e.indexOf("0x")&&(e=e.slice(2)),e.match(/../g).map((function(e){return parseInt(e,16)}))}};e.exports?e.exports=r:t.convertHex=r}(Zt)}))),Zm=tr((function(e){!function(t){var r={bytesToString:function(e){return e.map((function(e){return String.fromCharCode(e)})).join("")},stringToBytes:function(e){return e.split("").map((function(e){return e.charCodeAt(0)}))}};r.UTF8={bytesToString:function(e){return decodeURIComponent(escape(r.bytesToString(e)))},stringToBytes:function(e){return r.stringToBytes(unescape(encodeURIComponent(e)))}},e.exports?e.exports=r:t.convertString=r}(Zt)})),eg=tr((function(e){!function(t){var r={};e.exports?(r.bytesToHex=Ym.bytesToHex,r.convertString=Zm,e.exports=a):(r.bytesToHex=t.convertHex.bytesToHex,r.convertString=t.convertString,t.sha256=a);var n=[];!function(){function e(e){for(var t=Math.sqrt(e),r=2;r<=t;r++)if(!(e%r))return!1;return!0}function t(e){return 4294967296*(e-(0|e))|0}for(var r=2,i=0;i<64;)e(r)&&(n[i]=t(Math.pow(r,1/3)),i++),r++}();var i=[],o=function(e,t,r){for(var o=e[0],a=e[1],s=e[2],c=e[3],u=e[4],l=e[5],f=e[6],h=e[7],d=0;d<64;d++){if(d<16)i[d]=0|t[r+d];else{var p=i[d-15],m=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,g=i[d-2],v=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;i[d]=m+i[d-7]+v+i[d-16]}var y=o&a^o&s^a&s,b=(o<<30|o>>>2)^(o<<19|o>>>13)^(o<<10|o>>>22),w=h+((u<<26|u>>>6)^(u<<21|u>>>11)^(u<<7|u>>>25))+(u&l^~u&f)+n[d]+i[d];h=f,f=l,l=u,u=c+w|0,c=s,s=a,a=o,o=w+(b+y)|0}e[0]=e[0]+o|0,e[1]=e[1]+a|0,e[2]=e[2]+s|0,e[3]=e[3]+c|0,e[4]=e[4]+u|0,e[5]=e[5]+l|0,e[6]=e[6]+f|0,e[7]=e[7]+h|0};function a(e,t){e.constructor===String&&(e=r.convertString.UTF8.stringToBytes(e));var n=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],i=function(e){for(var t=[],r=0,n=0;r<e.length;r++,n+=8)t[n>>>5]|=e[r]<<24-n%32;return t}(e),a=8*e.length;i[a>>5]|=128<<24-a%32,i[15+(a+64>>9<<4)]=a;for(var s=0;s<i.length;s+=16)o(n,i,s);var c=function(e){for(var t=[],r=0;r<32*e.length;r+=8)t.push(e[r>>>5]>>>24-r%32&255);return t}(n);return t&&t.asBytes?c:t&&t.asString?r.convertString.bytesToString(c):r.bytesToHex(c)}a.x2=function(e,t){return a(a(e,{asBytes:!0}),t)}}(Zt)}));function tg(e){e=e.trim();const t=[];for(let r=0;r<e.length;r+=2)t.push(parseInt(e.substring(r,r+2),16));return t}const{obi:rg,blockcerts:ng,blockcertsv1_2:ig,blockcertsv2:og,blockcertsV3:ag,verifiableCredential:sg,verifiableCredentialExample:cg,merkleProof2019:ug}={obi:{"@context":{id:"@id",type:"@type",extensions:"https://w3id.org/openbadges/extensions#",obi:"https://w3id.org/openbadges#",validation:"obi:validation",cred:"https://w3id.org/credentials#",dc:"http://purl.org/dc/terms/",schema:"http://schema.org/",sec:"https://w3id.org/security#",xsd:"http://www.w3.org/2001/XMLSchema#",AlignmentObject:"schema:AlignmentObject",CryptographicKey:"sec:Key",Endorsement:"cred:Credential",Assertion:"obi:Assertion",BadgeClass:"obi:BadgeClass",Criteria:"obi:Criteria",Evidence:"obi:Evidence",Extension:"obi:Extension",FrameValidation:"obi:FrameValidation",IdentityObject:"obi:IdentityObject",Image:"obi:Image",HostedBadge:"obi:HostedBadge",hosted:"obi:HostedBadge",Issuer:"obi:Issuer",Profile:"obi:Profile",RevocationList:"obi:RevocationList",SignedBadge:"obi:SignedBadge",signed:"obi:SignedBadge",TypeValidation:"obi:TypeValidation",VerificationObject:"obi:VerificationObject",author:{"@id":"schema:author","@type":"@id"},caption:{"@id":"schema:caption"},claim:{"@id":"cred:claim","@type":"@id"},created:{"@id":"dc:created","@type":"xsd:dateTime"},creator:{"@id":"dc:creator","@type":"@id"},description:{"@id":"schema:description"},email:{"@id":"schema:email"},endorsement:{"@id":"cred:credential","@type":"@id"},expires:{"@id":"sec:expiration","@type":"xsd:dateTime"},genre:{"@id":"schema:genre"},image:{"@id":"schema:image","@type":"@id"},name:{"@id":"schema:name"},owner:{"@id":"sec:owner","@type":"@id"},publicKey:{"@id":"sec:publicKey","@type":"@id"},publicKeyPem:{"@id":"sec:publicKeyPem"},related:{"@id":"dc:relation","@type":"@id"},startsWith:{"@id":"http://purl.org/dqm-vocabulary/v1/dqm#startsWith"},tags:{"@id":"schema:keywords"},targetDescription:{"@id":"schema:targetDescription"},targetFramework:{"@id":"schema:targetFramework"},targetName:{"@id":"schema:targetName"},targetUrl:{"@id":"schema:targetUrl"},telephone:{"@id":"schema:telephone"},url:{"@id":"schema:url","@type":"@id"},version:{"@id":"schema:version"},alignment:{"@id":"obi:alignment","@type":"@id"},allowedOrigins:{"@id":"obi:allowedOrigins"},audience:{"@id":"obi:audience"},badge:{"@id":"obi:badge","@type":"@id"},criteria:{"@id":"obi:criteria","@type":"@id"},endorsementComment:{"@id":"obi:endorsementComment"},evidence:{"@id":"obi:evidence","@type":"@id"},hashed:{"@id":"obi:hashed","@type":"xsd:boolean"},identity:{"@id":"obi:identityHash"},issuedOn:{"@id":"obi:issueDate","@type":"xsd:dateTime"},issuer:{"@id":"obi:issuer","@type":"@id"},narrative:{"@id":"obi:narrative"},recipient:{"@id":"obi:recipient","@type":"@id"},revocationList:{"@id":"obi:revocationList","@type":"@id"},revocationReason:{"@id":"obi:revocationReason"},revoked:{"@id":"obi:revoked","@type":"xsd:boolean"},revokedAssertions:{"@id":"obi:revoked"},salt:{"@id":"obi:salt"},targetCode:{"@id":"obi:targetCode"},uid:{"@id":"obi:uid"},validatesType:"obi:validatesType",validationFrame:"obi:validationFrame",validationSchema:"obi:validationSchema",verification:{"@id":"obi:verify","@type":"@id"},verificationProperty:{"@id":"obi:verificationProperty"},verify:"verification"}},blockcerts:{"@context":{id:"@id",type:"@type",bc:"https://w3id.org/blockcerts#",obi:"https://w3id.org/openbadges#",cp:"https://w3id.org/chainpoint#",schema:"http://schema.org/",sec:"https://w3id.org/security#",xsd:"http://www.w3.org/2001/XMLSchema#",MerkleProof2017:"sec:MerkleProof2017",RecipientProfile:"bc:RecipientProfile",SignatureLine:"bc:SignatureLine",MerkleProofVerification2017:"bc:MerkleProofVerification2017",recipientProfile:"bc:recipientProfile",signatureLines:"bc:signatureLines",introductionUrl:{"@id":"bc:introductionUrl","@type":"@id"},subtitle:"bc:subtitle",jobTitle:"schema:jobTitle",creator:{"@id":"dc:creator","@type":"@id"},expires:{"@id":"sec:expiration","@type":"xsd:dateTime"},revoked:{"@id":"sec:expiration","@type":"xsd:dateTime"},CryptographicKey:"sec:Key",signature:"sec:signature",verification:"bc:verification",publicKeys:"bc:publicKeys",ChainpointSHA256v2:"cp:ChainpointSHA256v2",BTCOpReturn:"cp:BTCOpReturn",targetHash:"cp:targetHash",merkleRoot:"cp:merkleRoot",proof:"cp:proof",anchors:"cp:anchors",sourceId:"cp:sourceId",right:"cp:right",left:"cp:left"},"obi:validation":[{"obi:validatesType":"RecipientProfile","obi:validationSchema":"https://w3id.org/blockcerts/schema/2.0-alpha/recipientSchema.json"},{"obi:validatesType":"SignatureLine","obi:validationSchema":"https://w3id.org/blockcerts/schema/2.0-alpha/signatureLineSchema.json"},{"obi:validatesType":"MerkleProof2017","obi:validationSchema":"https://w3id.org/blockcerts/schema/2.0-alpha/merkleProof2017Schema.json"}]},blockcertsv1_2:{"@context":[{id:"@id",type:"@type",bc:"https://w3id.org/blockcerts#",obi:"https://w3id.org/openbadges#",cp:"https://w3id.org/chainpoint#",extensions:"https://w3id.org/openbadges/extensions#",validation:"obi:validation",xsd:"http://www.w3.org/2001/XMLSchema#",schema:"http://schema.org/",sec:"https://w3id.org/security#",Assertion:"bc:Assertion",Certificate:"bc:Certificate",Issuer:"bc:Issuer",BlockchainCertificate:"bc:BlockchainCertificate",CertificateDocument:"bc:CertificateDocument",issuer:{"@id":"bc:issuer","@type":"@id"},blockchaincertificate:{"@id":"bc:blockchaincertificate","@type":"@id"},certificate:{"@id":"bc:certificate","@type":"@id"},document:{"@id":"bc:document","@type":"@id"},assertion:{"@id":"bc:assertion","@type":"@id"},verify:{"@id":"bc:verify","@type":"@id"},recipient:{"@id":"bc:recipient","@type":"@id"},receipt:{"@id":"bc:receipt","@type":"@id"},publicKey:{"@id":"bc:publicKey"},revocationKey:{"@id":"bc:revocationKey"},"image:signature":{"@id":"bc:image:signature"},signature:{"@id":"bc:signature"},familyName:{"@id":"schema:familyName"},givenName:{"@id":"schema:givenName"},jobTitle:{"@id":"schema:jobTitle"},signer:{"@id":"bc:signer","@type":"@id"},"attribute-signed":{"@id":"bc:attribute-signed"},"ECDSA(secp256k1)":"bc:SignedBadge",subtitle:{"@id":"bc:subtitle"},email:"schema:email",hashed:{"@id":"obi:hashed","@type":"xsd:boolean"},image:{"@id":"schema:image","@type":"@id"},salt:{"@id":"obi:salt"},identity:{"@id":"obi:identityHash"},issuedOn:{"@id":"obi:issueDate","@type":"xsd:dateTime"},expires:{"@id":"sec:expiration","@type":"xsd:dateTime"},evidence:{"@id":"obi:evidence","@type":"@id"},criteria:{"@id":"obi:criteria","@type":"@id"},tags:{"@id":"schema:keywords"},alignment:{"@id":"obi:alignment","@type":"@id"},revocationList:{"@id":"obi:revocationList","@type":"@id"},name:{"@id":"schema:name"},description:{"@id":"schema:description"},url:{"@id":"schema:url","@type":"@id"},uid:{"@id":"obi:uid"},TypeValidation:"obi:TypeValidation",FrameValidation:"obi:FrameValidation",validatesType:"obi:validatesType",validationSchema:"obi:validationSchema",validationFrame:"obi:validationFrame",ChainpointSHA224v2:"cp:ChainpointSHA224v2",ChainpointSHA256v2:"cp:ChainpointSHA256v2",ChainpointSHA384v2:"cp:ChainpointSHA384v2",ChainpointSHA512v2:"cp:ChainpointSHA512v2","ChainpointSHA3-224v2":"cp:ChainpointSHA3-224v2","ChainpointSHA3-256v2":"cp:ChainpointSHA3-256v2","ChainpointSHA3-384v2":"cp:ChainpointSHA3-384v2","ChainpointSHA3-512v2":"cp:ChainpointSHA3-512v2",BTCOpReturn:"cp:BTCOpReturn",targetHash:"cp:targetHash",merkleRoot:"cp:merkleRoot",proof:"cp:proof",anchors:"cp:anchors",sourceId:"cp:sourceId",right:"cp:right",left:"cp:left"}],validation:[{type:"TypeValidation",validatesType:"Assertion",validationSchema:"https://w3id.org/blockcerts/schema/1.2/assertion-1.2.json"},{type:"TypeValidation",validatesType:"Certificate",validationSchema:"https://w3id.org/blockcerts/schema/1.2/certificate-1.2.json"},{type:"TypeValidation",validatesType:"Issuer",validationSchema:"https://w3id.org/blockcerts/schema/1.2/issuer-1.2.json"},{type:"TypeValidation",validatesType:"CertificateDocument",validationSchema:"https://w3id.org/blockcerts/schema/1.2/certificate-document-1.2.json"},{type:"TypeValidation",validatesType:"BlockchainCertificate",validationSchema:"https://w3id.org/blockcerts/schema/1.2/blockchain-certificate-1.2.json"},{type:"TypeValidation",validatesType:"BlockchainReceipt",validationSchema:"https://w3id.org/blockcerts/schema/1.2/blockchain-receipt-1.2.json"}]},blockcertsv2:{"@context":{id:"@id",type:"@type",bc:"https://w3id.org/blockcerts#",obi:"https://w3id.org/openbadges#",cp:"https://w3id.org/chainpoint#",schema:"http://schema.org/",sec:"https://w3id.org/security#",xsd:"http://www.w3.org/2001/XMLSchema#",MerkleProof2017:"sec:MerkleProof2017",RecipientProfile:"bc:RecipientProfile",SignatureLine:"bc:SignatureLine",MerkleProofVerification2017:"bc:MerkleProofVerification2017",recipientProfile:"bc:recipientProfile",signatureLines:"bc:signatureLines",introductionUrl:{"@id":"bc:introductionUrl","@type":"@id"},subtitle:"bc:subtitle",jobTitle:"schema:jobTitle",expires:{"@id":"sec:expiration","@type":"xsd:dateTime"},revoked:{"@id":"obi:revoked","@type":"xsd:boolean"},CryptographicKey:"sec:Key",signature:"sec:signature",verification:{"@id":"obi:verify","@type":"@id"},publicKey:{"@id":"sec:publicKey","@type":"@id"},ChainpointSHA256v2:"cp:ChainpointSHA256v2",BTCOpReturn:"cp:BTCOpReturn",targetHash:"cp:targetHash",merkleRoot:"cp:merkleRoot",proof:"cp:proof",anchors:"cp:anchors",sourceId:"cp:sourceId",right:"cp:right",left:"cp:left"},"obi:validation":[{"obi:validatesType":"RecipientProfile","obi:validationSchema":"https://w3id.org/blockcerts/schema/2.0/recipientSchema.json"},{"obi:validatesType":"SignatureLine","obi:validationSchema":"https://w3id.org/blockcerts/schema/2.0/signatureLineSchema.json"},{"obi:validatesType":"MerkleProof2017","obi:validationSchema":"https://w3id.org/blockcerts/schema/2.0/merkleProof2017Schema.json"}]},blockcertsV3:{"@context":{id:"@id",type:"@type",bc:"https://w3id.org/blockcerts#",cp:"https://w3id.org/chainpoint#",schema:"http://schema.org/",sec:"https://w3id.org/security#",xsd:"http://www.w3.org/2001/XMLSchema#",MerkleProof2019:"sec:MerkleProof2019",BlockcertsCredential:"bc:BlockcertsCredential",introductionUrl:{"@id":"bc:introductionUrl","@type":"@id"},CryptographicKey:"sec:Key",domain:"sec:domain",nonce:"sec:nonce",proofValue:"sec:proofValue",assertionMethod:{"@id":"sec:assertionMethod","@type":"@id","@container":"@set"},proofPurpose:{"@id":"sec:proofPurpose","@type":"@vocab"},verificationMethod:{"@id":"sec:verificationMethod","@type":"@id"},created:{"@id":"bc:created","@type":"xsd:dateTime"},name:{"@id":"schema:name"}}},verifiableCredential:{"@context":{"@version":1.1,id:"@id",type:"@type",VerifiableCredential:{"@id":"https://www.w3.org/2018/credentials#VerifiableCredential","@context":{"@version":1.1,id:"@id",type:"@type",cred:"https://www.w3.org/2018/credentials#",sec:"https://w3id.org/security#",xsd:"http://www.w3.org/2001/XMLSchema#",credentialSchema:{"@id":"cred:credentialSchema","@type":"@id","@context":{"@version":1.1,id:"@id",type:"@type",cred:"https://www.w3.org/2018/credentials#",JsonSchemaValidator2018:"cred:JsonSchemaValidator2018"}},credentialStatus:{"@id":"cred:credentialStatus","@type":"@id"},credentialSubject:{"@id":"cred:credentialSubject","@type":"@id"},evidence:{"@id":"cred:evidence","@type":"@id"},expirationDate:{"@id":"cred:expirationDate","@type":"xsd:dateTime"},holder:{"@id":"cred:holder","@type":"@id"},issued:{"@id":"cred:issued","@type":"xsd:dateTime"},issuer:{"@id":"cred:issuer","@type":"@id"},issuanceDate:{"@id":"cred:issuanceDate","@type":"xsd:dateTime"},proof:{"@id":"sec:proof","@type":"@id","@container":"@graph"},refreshService:{"@id":"cred:refreshService","@type":"@id","@context":{"@version":1.1,id:"@id",type:"@type",cred:"https://www.w3.org/2018/credentials#",ManualRefreshService2018:"cred:ManualRefreshService2018"}},termsOfUse:{"@id":"cred:termsOfUse","@type":"@id"},validFrom:{"@id":"cred:validFrom","@type":"xsd:dateTime"},validUntil:{"@id":"cred:validUntil","@type":"xsd:dateTime"}}},VerifiablePresentation:{"@id":"https://www.w3.org/2018/credentials#VerifiablePresentation","@context":{"@version":1.1,id:"@id",type:"@type",cred:"https://www.w3.org/2018/credentials#",sec:"https://w3id.org/security#",holder:{"@id":"cred:holder","@type":"@id"},proof:{"@id":"sec:proof","@type":"@id","@container":"@graph"},verifiableCredential:{"@id":"cred:verifiableCredential","@type":"@id","@container":"@graph"}}},EcdsaSecp256k1Signature2019:{"@id":"https://w3id.org/security#EcdsaSecp256k1Signature2019","@context":{"@version":1.1,id:"@id",type:"@type",sec:"https://w3id.org/security#",xsd:"http://www.w3.org/2001/XMLSchema#",challenge:"sec:challenge",created:{"@id":"http://purl.org/dc/terms/created","@type":"xsd:dateTime"},domain:"sec:domain",expires:{"@id":"sec:expiration","@type":"xsd:dateTime"},jws:"sec:jws",nonce:"sec:nonce",proofPurpose:{"@id":"sec:proofPurpose","@type":"@vocab","@context":{"@version":1.1,id:"@id",type:"@type",sec:"https://w3id.org/security#",assertionMethod:{"@id":"sec:assertionMethod","@type":"@id","@container":"@set"},authentication:{"@id":"sec:authenticationMethod","@type":"@id","@container":"@set"}}},proofValue:"sec:proofValue",verificationMethod:{"@id":"sec:verificationMethod","@type":"@id"}}},EcdsaSecp256r1Signature2019:{"@id":"https://w3id.org/security#EcdsaSecp256r1Signature2019","@context":{"@version":1.1,id:"@id",type:"@type",sec:"https://w3id.org/security#",xsd:"http://www.w3.org/2001/XMLSchema#",challenge:"sec:challenge",created:{"@id":"http://purl.org/dc/terms/created","@type":"xsd:dateTime"},domain:"sec:domain",expires:{"@id":"sec:expiration","@type":"xsd:dateTime"},jws:"sec:jws",nonce:"sec:nonce",proofPurpose:{"@id":"sec:proofPurpose","@type":"@vocab","@context":{"@version":1.1,id:"@id",type:"@type",sec:"https://w3id.org/security#",assertionMethod:{"@id":"sec:assertionMethod","@type":"@id","@container":"@set"},authentication:{"@id":"sec:authenticationMethod","@type":"@id","@container":"@set"}}},proofValue:"sec:proofValue",verificationMethod:{"@id":"sec:verificationMethod","@type":"@id"}}},Ed25519Signature2018:{"@id":"https://w3id.org/security#Ed25519Signature2018","@context":{"@version":1.1,id:"@id",type:"@type",sec:"https://w3id.org/security#",xsd:"http://www.w3.org/2001/XMLSchema#",challenge:"sec:challenge",created:{"@id":"http://purl.org/dc/terms/created","@type":"xsd:dateTime"},domain:"sec:domain",expires:{"@id":"sec:expiration","@type":"xsd:dateTime"},jws:"sec:jws",nonce:"sec:nonce",proofPurpose:{"@id":"sec:proofPurpose","@type":"@vocab","@context":{"@version":1.1,id:"@id",type:"@type",sec:"https://w3id.org/security#",assertionMethod:{"@id":"sec:assertionMethod","@type":"@id","@container":"@set"},authentication:{"@id":"sec:authenticationMethod","@type":"@id","@container":"@set"}}},proofValue:"sec:proofValue",verificationMethod:{"@id":"sec:verificationMethod","@type":"@id"}}},RsaSignature2018:{"@id":"https://w3id.org/security#RsaSignature2018","@context":{"@version":1.1,challenge:"sec:challenge",created:{"@id":"http://purl.org/dc/terms/created","@type":"xsd:dateTime"},domain:"sec:domain",expires:{"@id":"sec:expiration","@type":"xsd:dateTime"},jws:"sec:jws",nonce:"sec:nonce",proofPurpose:{"@id":"sec:proofPurpose","@type":"@vocab","@context":{"@version":1.1,id:"@id",type:"@type",sec:"https://w3id.org/security#",assertionMethod:{"@id":"sec:assertionMethod","@type":"@id","@container":"@set"},authentication:{"@id":"sec:authenticationMethod","@type":"@id","@container":"@set"}}},proofValue:"sec:proofValue",verificationMethod:{"@id":"sec:verificationMethod","@type":"@id"}}},proof:{"@id":"https://w3id.org/security#proof","@type":"@id","@container":"@graph"}}},verifiableCredentialExample:{"@context":[{"@version":1.1},"https://www.w3.org/ns/odrl.jsonld",{ex:"https://example.org/examples#",schema:"http://schema.org/",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#","3rdPartyCorrelation":"ex:3rdPartyCorrelation",AllVerifiers:"ex:AllVerifiers",Archival:"ex:Archival",BachelorDegree:"ex:BachelorDegree",Child:"ex:Child",CLCredentialDefinition2019:"ex:CLCredentialDefinition2019",CLSignature2019:"ex:CLSignature2019",IssuerPolicy:"ex:IssuerPolicy",HolderPolicy:"ex:HolderPolicy",Mother:"ex:Mother",RelationshipCredential:"ex:RelationshipCredential",UniversityDegreeCredential:"ex:UniversityDegreeCredential",ZkpExampleSchema2018:"ex:ZkpExampleSchema2018",issuerData:"ex:issuerData",attributes:"ex:attributes",signature:"ex:signature",signatureCorrectnessProof:"ex:signatureCorrectnessProof",primaryProof:"ex:primaryProof",nonRevocationProof:"ex:nonRevocationProof",alumniOf:{"@id":"schema:alumniOf","@type":"rdf:HTML"},child:{"@id":"ex:child","@type":"@id"},degree:"ex:degree",degreeType:"ex:degreeType",degreeSchool:"ex:degreeSchool",college:"ex:college",name:{"@id":"schema:name","@type":"rdf:HTML"},givenName:"schema:givenName",familyName:"schema:familyName",parent:{"@id":"ex:parent","@type":"@id"},referenceId:"ex:referenceId",documentPresence:"ex:documentPresence",evidenceDocument:"ex:evidenceDocument",spouse:"schema:spouse",subjectPresence:"ex:subjectPresence",verifier:{"@id":"ex:verifier","@type":"@id"}}]},merkleProof2019:{"@id":"https://w3id.org/blockcerts/schema/3.0-alpha/merkleProof2019Schema.json","@context":{"@version":1.1,challenge:"sec:challenge",created:{"@id":"http://purl.org/dc/terms/created","@type":"xsd:dateTime"},domain:"sec:domain",expires:{"@id":"sec:expiration","@type":"xsd:dateTime"},jws:"sec:jws",nonce:"sec:nonce",proofPurpose:{"@id":"sec:proofPurpose","@type":"@vocab","@context":{"@version":1.1,id:"@id",type:"@type",sec:"https://w3id.org/security#",assertionMethod:{"@id":"sec:assertionMethod","@type":"@id","@container":"@set"},authentication:{"@id":"sec:authenticationMethod","@type":"@id","@container":"@set"}}},proofValue:"sec:proofValue",verificationMethod:{"@id":"sec:verificationMethod","@type":"@id"}}}},lg={};function fg(e,t){let r=e["@context"];const n=e;t===o.V2_0&&S&&(r.find(e=>e===Object(e)&&"@vocab"in e)?r=null:r.push({"@vocab":"http://fallback.org/"}));const i="undefined"!=typeof window&&void 0!==window.XMLHttpRequest?Qm.documentLoaders.xhr():Qm.documentLoaders.node();Qm.documentLoader=function(e,t){return e in lg?t(null,{contextUrl:null,document:lg[e],documentUrl:e}):i(e,t)};const a={algorithm:"URDNA2015",format:"application/nquads"};return r&&(a.expandContext=r),new Promise((e,t)=>{Qm.normalize(n,a,(r,n)=>{if(!!r)t(new M("computeLocalHash",P("errors","failedJsonLdNormalization")));else{(function(e){const t=/<http:\/\/fallback\.org\/(.*)>/.exec(e);if(t){const e=[];for(let r=0;r<t.length;r++)e.push(t[r]);return e}return null})(n)?t(new M("computeLocalHash",P("errors","foundUnmappedFields"))):e(eg(function(e){const t=[];for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);n<128?t.push(n):n<2048?t.push(192|n>>6,128|63&n):n<55296||n>=57344?t.push(224|n>>12,128|n>>6&63,128|63&n):(r++,n=65536+((1023&n)<<10|1023&e.charCodeAt(r)),t.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n))}return t}(n)))}})})}function hg(e,t){if(e!==t)throw new M("compareHashes",P("errors","ensureHashesEqual"))}lg["https://w3id.org/blockcerts/schema/2.0-alpha/context.json"]=ng,lg["https://www.blockcerts.org/schema/2.0-alpha/context.json"]=ng,lg["https://w3id.org/openbadges/v2"]=rg,lg["https://openbadgespec.org/v2/context.json"]=rg,lg["https://w3id.org/blockcerts/v2"]=og,lg["https://www.w3id.org/blockcerts/schema/2.0/context.json"]=og,lg["https://w3id.org/blockcerts/v1"]=ig,lg["https://www.blockcerts.org/schema/3.0-alpha/context.json"]=ag,lg["https://w3id.org/blockcerts/schema/3.0-alpha/context.json"]=ag,lg["https://www.w3.org/2018/credentials/v1"]=sg,lg["https://www.w3.org/2018/credentials/examples/v1"]=cg,lg["https://w3id.org/blockcerts/schema/3.0-alpha/merkleProof2019Context.json"]=ug,lg["https://www.blockcerts.org/schema/3.0-alpha/merkleProof2019Context.json"]=ug;var dg=tr((function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}})),pg=fc.Buffer,mg=zn.Transform;function gg(e){mg.call(this),this._block=pg.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}dg(gg,mg),gg.prototype._transform=function(e,t,r){var n=null;try{this.update(e,t)}catch(e){n=e}r(n)},gg.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},gg.prototype.update=function(e,t){if(function(e,t){if(!pg.isBuffer(e)&&"string"!=typeof e)throw new TypeError(t+" must be a string or a buffer")}(e,"Data"),this._finalized)throw new Error("Digest already called");pg.isBuffer(e)||(e=pg.from(e,t));for(var r=this._block,n=0;this._blockOffset+e.length-n>=this._blockSize;){for(var i=this._blockOffset;i<this._blockSize;)r[i++]=e[n++];this._update(),this._blockOffset=0}for(;n<e.length;)r[this._blockOffset++]=e[n++];for(var o=0,a=8*e.length;a>0;++o)this._length[o]+=a,(a=this._length[o]/4294967296|0)>0&&(this._length[o]-=4294967296*a);return this},gg.prototype._update=function(){throw new Error("_update is not implemented")},gg.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t},gg.prototype._digest=function(){throw new Error("_digest is not implemented")};var vg=gg,yg=fc.Buffer,bg=new Array(16);function wg(){vg.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function _g(e,t){return e<<t|e>>>32-t}function Sg(e,t,r,n,i,o,a){return _g(e+(t&r|~t&n)+i+o|0,a)+t|0}function Eg(e,t,r,n,i,o,a){return _g(e+(t&n|r&~n)+i+o|0,a)+t|0}function xg(e,t,r,n,i,o,a){return _g(e+(t^r^n)+i+o|0,a)+t|0}function Ig(e,t,r,n,i,o,a){return _g(e+(r^(t|~n))+i+o|0,a)+t|0}dg(wg,vg),wg.prototype._update=function(){for(var e=bg,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,n=this._b,i=this._c,o=this._d;r=Sg(r,n,i,o,e[0],3614090360,7),o=Sg(o,r,n,i,e[1],3905402710,12),i=Sg(i,o,r,n,e[2],606105819,17),n=Sg(n,i,o,r,e[3],3250441966,22),r=Sg(r,n,i,o,e[4],4118548399,7),o=Sg(o,r,n,i,e[5],1200080426,12),i=Sg(i,o,r,n,e[6],2821735955,17),n=Sg(n,i,o,r,e[7],4249261313,22),r=Sg(r,n,i,o,e[8],1770035416,7),o=Sg(o,r,n,i,e[9],2336552879,12),i=Sg(i,o,r,n,e[10],4294925233,17),n=Sg(n,i,o,r,e[11],2304563134,22),r=Sg(r,n,i,o,e[12],1804603682,7),o=Sg(o,r,n,i,e[13],4254626195,12),i=Sg(i,o,r,n,e[14],2792965006,17),r=Eg(r,n=Sg(n,i,o,r,e[15],1236535329,22),i,o,e[1],4129170786,5),o=Eg(o,r,n,i,e[6],3225465664,9),i=Eg(i,o,r,n,e[11],643717713,14),n=Eg(n,i,o,r,e[0],3921069994,20),r=Eg(r,n,i,o,e[5],3593408605,5),o=Eg(o,r,n,i,e[10],38016083,9),i=Eg(i,o,r,n,e[15],3634488961,14),n=Eg(n,i,o,r,e[4],3889429448,20),r=Eg(r,n,i,o,e[9],568446438,5),o=Eg(o,r,n,i,e[14],3275163606,9),i=Eg(i,o,r,n,e[3],4107603335,14),n=Eg(n,i,o,r,e[8],1163531501,20),r=Eg(r,n,i,o,e[13],2850285829,5),o=Eg(o,r,n,i,e[2],4243563512,9),i=Eg(i,o,r,n,e[7],1735328473,14),r=xg(r,n=Eg(n,i,o,r,e[12],2368359562,20),i,o,e[5],4294588738,4),o=xg(o,r,n,i,e[8],2272392833,11),i=xg(i,o,r,n,e[11],1839030562,16),n=xg(n,i,o,r,e[14],4259657740,23),r=xg(r,n,i,o,e[1],2763975236,4),o=xg(o,r,n,i,e[4],1272893353,11),i=xg(i,o,r,n,e[7],4139469664,16),n=xg(n,i,o,r,e[10],3200236656,23),r=xg(r,n,i,o,e[13],681279174,4),o=xg(o,r,n,i,e[0],3936430074,11),i=xg(i,o,r,n,e[3],3572445317,16),n=xg(n,i,o,r,e[6],76029189,23),r=xg(r,n,i,o,e[9],3654602809,4),o=xg(o,r,n,i,e[12],3873151461,11),i=xg(i,o,r,n,e[15],530742520,16),r=Ig(r,n=xg(n,i,o,r,e[2],3299628645,23),i,o,e[0],4096336452,6),o=Ig(o,r,n,i,e[7],1126891415,10),i=Ig(i,o,r,n,e[14],2878612391,15),n=Ig(n,i,o,r,e[5],4237533241,21),r=Ig(r,n,i,o,e[12],1700485571,6),o=Ig(o,r,n,i,e[3],2399980690,10),i=Ig(i,o,r,n,e[10],4293915773,15),n=Ig(n,i,o,r,e[1],2240044497,21),r=Ig(r,n,i,o,e[8],1873313359,6),o=Ig(o,r,n,i,e[15],4264355552,10),i=Ig(i,o,r,n,e[6],2734768916,15),n=Ig(n,i,o,r,e[13],1309151649,21),r=Ig(r,n,i,o,e[4],4149444226,6),o=Ig(o,r,n,i,e[11],3174756917,10),i=Ig(i,o,r,n,e[2],718787259,15),n=Ig(n,i,o,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+o|0},wg.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=yg.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e};var kg=wg,Pg=Fe.Buffer,Og=new Array(16),Ag=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],Tg=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],Cg=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],Ng=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],Rg=[0,1518500249,1859775393,2400959708,2840853838],Mg=[1352829926,1548603684,1836072691,2053994217,0];function Lg(){vg.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function jg(e,t){return e<<t|e>>>32-t}function Dg(e,t,r,n,i,o,a,s){return jg(e+(t^r^n)+o+a|0,s)+i|0}function Bg(e,t,r,n,i,o,a,s){return jg(e+(t&r|~t&n)+o+a|0,s)+i|0}function Ug(e,t,r,n,i,o,a,s){return jg(e+((t|~r)^n)+o+a|0,s)+i|0}function Fg(e,t,r,n,i,o,a,s){return jg(e+(t&n|r&~n)+o+a|0,s)+i|0}function Hg(e,t,r,n,i,o,a,s){return jg(e+(t^(r|~n))+o+a|0,s)+i|0}dg(Lg,vg),Lg.prototype._update=function(){for(var e=Og,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,a=0|this._e,s=0|this._a,c=0|this._b,u=0|this._c,l=0|this._d,f=0|this._e,h=0;h<80;h+=1){var d,p;h<16?(d=Dg(r,n,i,o,a,e[Ag[h]],Rg[0],Cg[h]),p=Hg(s,c,u,l,f,e[Tg[h]],Mg[0],Ng[h])):h<32?(d=Bg(r,n,i,o,a,e[Ag[h]],Rg[1],Cg[h]),p=Fg(s,c,u,l,f,e[Tg[h]],Mg[1],Ng[h])):h<48?(d=Ug(r,n,i,o,a,e[Ag[h]],Rg[2],Cg[h]),p=Ug(s,c,u,l,f,e[Tg[h]],Mg[2],Ng[h])):h<64?(d=Fg(r,n,i,o,a,e[Ag[h]],Rg[3],Cg[h]),p=Bg(s,c,u,l,f,e[Tg[h]],Mg[3],Ng[h])):(d=Hg(r,n,i,o,a,e[Ag[h]],Rg[4],Cg[h]),p=Dg(s,c,u,l,f,e[Tg[h]],Mg[4],Ng[h])),r=a,a=o,o=jg(i,10),i=n,n=d,s=f,f=l,l=jg(u,10),u=c,c=p}var m=this._b+i+l|0;this._b=this._c+o+f|0,this._c=this._d+a+s|0,this._d=this._e+r+c|0,this._e=this._a+n+u|0,this._a=m},Lg.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=Pg.alloc?Pg.alloc(20):new Pg(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e};var Vg=Lg,zg=fc.Buffer;function qg(e,t){this._block=zg.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}qg.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=zg.from(e,t));for(var r=this._block,n=this._blockSize,i=e.length,o=this._len,a=0;a<i;){for(var s=o%n,c=Math.min(i-a,n-s),u=0;u<c;u++)r[s+u]=e[a+u];a+=c,(o+=c)%n==0&&this._update(r)}return this._len+=i,this},qg.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},qg.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var Kg=qg,$g=fc.Buffer,Gg=[1518500249,1859775393,-1894007588,-899497514],Jg=new Array(80);function Wg(){this.init(),this._w=Jg,Kg.call(this,64,56)}function Xg(e){return e<<30|e>>>2}function Qg(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}dg(Wg,Kg),Wg.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},Wg.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,s=0|this._e,c=0;c<16;++c)r[c]=e.readInt32BE(4*c);for(;c<80;++c)r[c]=r[c-3]^r[c-8]^r[c-14]^r[c-16];for(var u=0;u<80;++u){var l=~~(u/20),f=0|((t=n)<<5|t>>>27)+Qg(l,i,o,a)+s+r[u]+Gg[l];s=a,a=o,o=Xg(i),i=n,n=f}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=s+this._e|0},Wg.prototype._hash=function(){var e=$g.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e};var Yg=Wg,Zg=fc.Buffer,ev=[1518500249,1859775393,-1894007588,-899497514],tv=new Array(80);function rv(){this.init(),this._w=tv,Kg.call(this,64,56)}function nv(e){return e<<5|e>>>27}function iv(e){return e<<30|e>>>2}function ov(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}dg(rv,Kg),rv.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},rv.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,s=0|this._e,c=0;c<16;++c)r[c]=e.readInt32BE(4*c);for(;c<80;++c)r[c]=(t=r[c-3]^r[c-8]^r[c-14]^r[c-16])<<1|t>>>31;for(var u=0;u<80;++u){var l=~~(u/20),f=nv(n)+ov(l,i,o,a)+s+r[u]+ev[l]|0;s=a,a=o,o=iv(i),i=n,n=f}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=s+this._e|0},rv.prototype._hash=function(){var e=Zg.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e};var av=rv,sv=fc.Buffer,cv=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],uv=new Array(64);function lv(){this.init(),this._w=uv,Kg.call(this,64,56)}function fv(e,t,r){return r^e&(t^r)}function hv(e,t,r){return e&t|r&(e|t)}function dv(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function pv(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function mv(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function gv(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}dg(lv,Kg),lv.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},lv.prototype._update=function(e){for(var t=this._w,r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,a=0|this._e,s=0|this._f,c=0|this._g,u=0|this._h,l=0;l<16;++l)t[l]=e.readInt32BE(4*l);for(;l<64;++l)t[l]=gv(t[l-2])+t[l-7]+mv(t[l-15])+t[l-16]|0;for(var f=0;f<64;++f){var h=u+pv(a)+fv(a,s,c)+cv[f]+t[f]|0,d=dv(r)+hv(r,n,i)|0;u=c,c=s,s=a,a=o+h|0,o=i,i=n,n=r,r=h+d|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=a+this._e|0,this._f=s+this._f|0,this._g=c+this._g|0,this._h=u+this._h|0},lv.prototype._hash=function(){var e=sv.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e};var vv=lv,yv=fc.Buffer,bv=new Array(64);function wv(){this.init(),this._w=bv,Kg.call(this,64,56)}dg(wv,vv),wv.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},wv.prototype._hash=function(){var e=yv.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e};var _v=wv,Sv=fc.Buffer,Ev=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],xv=new Array(160);function Iv(){this.init(),this._w=xv,Kg.call(this,128,112)}function kv(e,t,r){return r^e&(t^r)}function Pv(e,t,r){return e&t|r&(e|t)}function Ov(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function Av(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function Tv(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function Cv(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function Nv(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function Rv(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function Mv(e,t){return e>>>0<t>>>0?1:0}dg(Iv,Kg),Iv.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},Iv.prototype._update=function(e){for(var t=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,a=0|this._eh,s=0|this._fh,c=0|this._gh,u=0|this._hh,l=0|this._al,f=0|this._bl,h=0|this._cl,d=0|this._dl,p=0|this._el,m=0|this._fl,g=0|this._gl,v=0|this._hl,y=0;y<32;y+=2)t[y]=e.readInt32BE(4*y),t[y+1]=e.readInt32BE(4*y+4);for(;y<160;y+=2){var b=t[y-30],w=t[y-30+1],_=Tv(b,w),S=Cv(w,b),E=Nv(b=t[y-4],w=t[y-4+1]),x=Rv(w,b),I=t[y-14],k=t[y-14+1],P=t[y-32],O=t[y-32+1],A=S+k|0,T=_+I+Mv(A,S)|0;T=(T=T+E+Mv(A=A+x|0,x)|0)+P+Mv(A=A+O|0,O)|0,t[y]=T,t[y+1]=A}for(var C=0;C<160;C+=2){T=t[C],A=t[C+1];var N=Pv(r,n,i),R=Pv(l,f,h),M=Ov(r,l),L=Ov(l,r),j=Av(a,p),D=Av(p,a),B=Ev[C],U=Ev[C+1],F=kv(a,s,c),H=kv(p,m,g),V=v+D|0,z=u+j+Mv(V,v)|0;z=(z=(z=z+F+Mv(V=V+H|0,H)|0)+B+Mv(V=V+U|0,U)|0)+T+Mv(V=V+A|0,A)|0;var q=L+R|0,K=M+N+Mv(q,L)|0;u=c,v=g,c=s,g=m,s=a,m=p,a=o+z+Mv(p=d+V|0,d)|0,o=i,d=h,i=n,h=f,n=r,f=l,r=z+K+Mv(l=V+q|0,V)|0}this._al=this._al+l|0,this._bl=this._bl+f|0,this._cl=this._cl+h|0,this._dl=this._dl+d|0,this._el=this._el+p|0,this._fl=this._fl+m|0,this._gl=this._gl+g|0,this._hl=this._hl+v|0,this._ah=this._ah+r+Mv(this._al,l)|0,this._bh=this._bh+n+Mv(this._bl,f)|0,this._ch=this._ch+i+Mv(this._cl,h)|0,this._dh=this._dh+o+Mv(this._dl,d)|0,this._eh=this._eh+a+Mv(this._el,p)|0,this._fh=this._fh+s+Mv(this._fl,m)|0,this._gh=this._gh+c+Mv(this._gl,g)|0,this._hh=this._hh+u+Mv(this._hl,v)|0},Iv.prototype._hash=function(){var e=Sv.allocUnsafe(64);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e};var Lv=Iv,jv=fc.Buffer,Dv=new Array(160);function Bv(){this.init(),this._w=Dv,Kg.call(this,128,112)}dg(Bv,Lv),Bv.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},Bv.prototype._hash=function(){var e=jv.allocUnsafe(48);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e};var Uv=Bv,Fv=tr((function(e){var t=e.exports=function(e){e=e.toLowerCase();var r=t[e];if(!r)throw new Error(e+" is not supported (we accept pull requests)");return new r};t.sha=Yg,t.sha1=av,t.sha224=_v,t.sha256=vv,t.sha384=Uv,t.sha512=Lv})),Hv=fc.Buffer,Vv=zn.Transform,zv=an.StringDecoder;function qv(e){Vv.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}dg(qv,Vv),qv.prototype.update=function(e,t,r){"string"==typeof e&&(e=Hv.from(e,t));var n=this._update(e);return this.hashMode?this:(r&&(n=this._toString(n,r)),n)},qv.prototype.setAutoPadding=function(){},qv.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},qv.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},qv.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},qv.prototype._transform=function(e,t,r){var n;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){n=e}finally{r(n)}},qv.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},qv.prototype._finalOrDigest=function(e){var t=this.__final()||Hv.alloc(0);return e&&(t=this._toString(t,e,!0)),t},qv.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new zv(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var n=this._decoder.write(e);return r&&(n+=this._decoder.end()),n};var Kv=qv;function $v(e){Kv.call(this,"digest"),this._hash=e}dg($v,Kv),$v.prototype._update=function(e){this._hash.update(e)},$v.prototype._final=function(){return this._hash.digest()};var Gv=function(e){return"md5"===(e=e.toLowerCase())?new kg:"rmd160"===e||"ripemd160"===e?new Vg:new $v(Fv(e))},Jv=fc.Buffer,Wv=Jv.alloc(128);function Xv(e,t){Kv.call(this,"digest"),"string"==typeof t&&(t=Jv.from(t)),this._alg=e,this._key=t,t.length>64?t=e(t):t.length<64&&(t=Jv.concat([t,Wv],64));for(var r=this._ipad=Jv.allocUnsafe(64),n=this._opad=Jv.allocUnsafe(64),i=0;i<64;i++)r[i]=54^t[i],n[i]=92^t[i];this._hash=[r]}dg(Xv,Kv),Xv.prototype._update=function(e){this._hash.push(e)},Xv.prototype._final=function(){var e=this._alg(Jv.concat(this._hash));return this._alg(Jv.concat([this._opad,e]))};var Qv=Xv,Yv=function(e){return(new kg).update(e).digest()},Zv=fc.Buffer,ey=Zv.alloc(128);function ty(e,t){Kv.call(this,"digest"),"string"==typeof t&&(t=Zv.from(t));var r="sha512"===e||"sha384"===e?128:64;(this._alg=e,this._key=t,t.length>r)?t=("rmd160"===e?new Vg:Fv(e)).update(t).digest():t.length<r&&(t=Zv.concat([t,ey],r));for(var n=this._ipad=Zv.allocUnsafe(r),i=this._opad=Zv.allocUnsafe(r),o=0;o<r;o++)n[o]=54^t[o],i[o]=92^t[o];this._hash="rmd160"===e?new Vg:Fv(e),this._hash.update(n)}dg(ty,Kv),ty.prototype._update=function(e){this._hash.update(e)},ty.prototype._final=function(){var e=this._hash.digest();return("rmd160"===this._alg?new Vg:Fv(this._alg)).update(this._opad).update(e).digest()};var ry=function(e,t){return"rmd160"===(e=e.toLowerCase())||"ripemd160"===e?new ty("rmd160",t):"md5"===e?new Qv(Yv,t):new ty(e,t)},ny=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.hash160=function(e){const t=Gv("sha256").update(e).digest();try{return Gv("rmd160").update(t).digest()}catch(e){return Gv("ripemd160").update(t).digest()}},t.hmacSHA512=function(e,t){return ry("sha512",e).update(t).digest()}}));er(ny);ny.hash160,ny.hmacSHA512;var iy=fc.Buffer;var oy=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");var t=new Uint8Array(256);t.fill(255);for(var r=0;r<e.length;r++){var n=e.charAt(r),i=n.charCodeAt(0);if(255!==t[i])throw new TypeError(n+" is ambiguous");t[i]=r}var o=e.length,a=e.charAt(0),s=Math.log(o)/Math.log(256),c=Math.log(256)/Math.log(o);function u(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return iy.alloc(0);var r=0;if(" "!==e[r]){for(var n=0,i=0;e[r]===a;)n++,r++;for(var c=(e.length-r)*s+1>>>0,u=new Uint8Array(c);e[r];){var l=t[e.charCodeAt(r)];if(255===l)return;for(var f=0,h=c-1;(0!==l||f<i)&&-1!==h;h--,f++)l+=o*u[h]>>>0,u[h]=l%256>>>0,l=l/256>>>0;if(0!==l)throw new Error("Non-zero carry");i=f,r++}if(" "!==e[r]){for(var d=c-i;d!==c&&0===u[d];)d++;var p=iy.allocUnsafe(n+(c-d));p.fill(0,0,n);for(var m=n;d!==c;)p[m++]=u[d++];return p}}}return{encode:function(t){if(!iy.isBuffer(t))throw new TypeError("Expected Buffer");if(0===t.length)return"";for(var r=0,n=0,i=0,s=t.length;i!==s&&0===t[i];)i++,r++;for(var u=(s-i)*c+1>>>0,l=new Uint8Array(u);i!==s;){for(var f=t[i],h=0,d=u-1;(0!==f||h<n)&&-1!==d;d--,h++)f+=256*l[d]>>>0,l[d]=f%o>>>0,f=f/o>>>0;if(0!==f)throw new Error("Non-zero carry");n=h,i++}for(var p=u-n;p!==u&&0===l[p];)p++;for(var m=a.repeat(r);p<u;++p)m+=e.charAt(l[p]);return m},decodeUnsafe:u,decode:function(e){var t=u(e);if(t)return t;throw new Error("Non-base"+o+" character")}}},ay=oy("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),sy=fc.Buffer;var cy=function(e){function t(t){var r=t.slice(0,-4),n=t.slice(-4),i=e(r);if(!(n[0]^i[0]|n[1]^i[1]|n[2]^i[2]|n[3]^i[3]))return r}return{encode:function(t){var r=e(t);return ay.encode(sy.concat([t,r],t.length+4))},decode:function(e){var r=t(ay.decode(e));if(!r)throw new Error("Invalid checksum");return r},decodeUnsafe:function(e){var r=ay.decodeUnsafe(e);if(r)return t(r)}}}((function(e){var t=Gv("sha256").update(e).digest();return Gv("sha256").update(t).digest()})),uy=tr((function(e){!function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"==typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{o=ou.Buffer}catch(e){}function a(e,t,r){for(var n=0,i=Math.min(e.length,r),o=t;o<i;o++){var a=e.charCodeAt(o)-48;n<<=4,n|=a>=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return n}function s(e,t,r,n){for(var i=0,o=Math.min(e.length,r),a=t;a<o;a++){var s=e.charCodeAt(a)-48;i*=n,i+=s>=49?s-49+10:s>=17?s-17+10:s}return i}i.isBN=function(e){return e instanceof i||null!==e&&"object"==typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&i++,16===t?this._parseHex(e,i):this._parseBase(e,t,i),"-"===e[0]&&(this.negative=1),this.strip(),"le"===n&&this._initArray(this.toArray(),t,n)},i.prototype._initNumber=function(e,t,n){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),t,n)},i.prototype._initArray=function(e,t,n){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,a,s=0;if("be"===n)for(i=e.length-1,o=0;i>=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===n)for(i=0,o=0;i<e.length;i+=3)a=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},i.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,i,o=0;for(r=e.length-6,n=0;r>=t;r-=6)i=a(e,r,r+6),this.words[n]|=i<<o&67108863,this.words[n+1]|=i>>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==t&&(i=a(e,t,r+6),this.words[n]|=i<<o&67108863,this.words[n+1]|=i>>>26-o&4194303),this.strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,a=o%n,c=Math.min(o,o-a)+r,u=0,l=r;l<c;l+=n)u=s(e,l,l+n,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==a){var f=1;for(u=s(e,l,e.length,t),l=0;l<a;l++)f*=t;this.imuln(f),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}},i.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},i.prototype.clone=function(){var e=new i(null);return this.copy(e),e},i.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},i.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],u=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],l=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,c=a/67108864|0;r.words[0]=s;for(var u=1;u<n;u++){for(var l=c>>>26,f=67108863&c,h=Math.min(u,t.length-1),d=Math.max(0,u-e.length+1);d<=h;d++){var p=u-d|0;l+=(a=(i=0|e.words[p])*(o=0|t.words[d])+f)/67108864|0,f=67108863&a}r.words[u]=0|f,c=0|l}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}i.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,o=0,a=0;a<this.length;a++){var s=this.words[a],f=(16777215&(s<<i|o)).toString(16);n=0!==(o=s>>>24-i&16777215)||a!==this.length-1?c[6-f.length]+f+n:f+n,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(n=o.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var h=u[e],d=l[e];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(e);n=(p=p.idivn(d)).isZero()?m+n:c[h-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return r(void 0!==o),this.toArrayLike(o,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,n){var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var a,s,c="le"===t,u=new e(o),l=this.clone();if(c){for(s=0;!l.isZero();s++)a=l.andln(255),l.iushrn(8),u[s]=a;for(;s<o;s++)u[s]=0}else{for(s=0;s<o-i;s++)u[s]=0;for(s=0;!l.isZero();s++)a=l.andln(255),l.iushrn(8),u[o-s-1]=a}return u},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},i.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},i.prototype.ior=function(e){return r(0==(this.negative|e.negative)),this.iuor(e)},i.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},i.prototype.iand=function(e){return r(0==(this.negative|e.negative)),this.iuand(e)},i.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},i.prototype.ixor=function(e){return r(0==(this.negative|e.negative)),this.iuxor(e)},i.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return n>0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<<i:this.words[n]&~(1<<i),this.strip()},i.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)t=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<r.length;o++)t=(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},i.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,a=0;a<n.length;a++)o=(t=(0|r.words[a])-(0|n.words[a])+o)>>26,this.words[a]=67108863&t;for(;0!==o&&a<r.length;a++)o=(t=(0|r.words[a])+o)>>26,this.words[a]=67108863&t;if(0===o&&a<r.length&&r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=Math.max(this.length,a),r!==this&&(this.negative=1),this.strip()},i.prototype.sub=function(e){return this.clone().isub(e)};var h=function(e,t,r){var n,i,o,a=e.words,s=t.words,c=r.words,u=0,l=0|a[0],f=8191&l,h=l>>>13,d=0|a[1],p=8191&d,m=d>>>13,g=0|a[2],v=8191&g,y=g>>>13,b=0|a[3],w=8191&b,_=b>>>13,S=0|a[4],E=8191&S,x=S>>>13,I=0|a[5],k=8191&I,P=I>>>13,O=0|a[6],A=8191&O,T=O>>>13,C=0|a[7],N=8191&C,R=C>>>13,M=0|a[8],L=8191&M,j=M>>>13,D=0|a[9],B=8191&D,U=D>>>13,F=0|s[0],H=8191&F,V=F>>>13,z=0|s[1],q=8191&z,K=z>>>13,$=0|s[2],G=8191&$,J=$>>>13,W=0|s[3],X=8191&W,Q=W>>>13,Y=0|s[4],Z=8191&Y,ee=Y>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,le=0|s[8],fe=8191&le,he=le>>>13,de=0|s[9],pe=8191&de,me=de>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(u+(n=Math.imul(f,H))|0)+((8191&(i=(i=Math.imul(f,V))+Math.imul(h,H)|0))<<13)|0;u=((o=Math.imul(h,V))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(p,H),i=(i=Math.imul(p,V))+Math.imul(m,H)|0,o=Math.imul(m,V);var ve=(u+(n=n+Math.imul(f,q)|0)|0)+((8191&(i=(i=i+Math.imul(f,K)|0)+Math.imul(h,q)|0))<<13)|0;u=((o=o+Math.imul(h,K)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(v,H),i=(i=Math.imul(v,V))+Math.imul(y,H)|0,o=Math.imul(y,V),n=n+Math.imul(p,q)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(m,q)|0,o=o+Math.imul(m,K)|0;var ye=(u+(n=n+Math.imul(f,G)|0)|0)+((8191&(i=(i=i+Math.imul(f,J)|0)+Math.imul(h,G)|0))<<13)|0;u=((o=o+Math.imul(h,J)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(w,H),i=(i=Math.imul(w,V))+Math.imul(_,H)|0,o=Math.imul(_,V),n=n+Math.imul(v,q)|0,i=(i=i+Math.imul(v,K)|0)+Math.imul(y,q)|0,o=o+Math.imul(y,K)|0,n=n+Math.imul(p,G)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,J)|0;var be=(u+(n=n+Math.imul(f,X)|0)|0)+((8191&(i=(i=i+Math.imul(f,Q)|0)+Math.imul(h,X)|0))<<13)|0;u=((o=o+Math.imul(h,Q)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(E,H),i=(i=Math.imul(E,V))+Math.imul(x,H)|0,o=Math.imul(x,V),n=n+Math.imul(w,q)|0,i=(i=i+Math.imul(w,K)|0)+Math.imul(_,q)|0,o=o+Math.imul(_,K)|0,n=n+Math.imul(v,G)|0,i=(i=i+Math.imul(v,J)|0)+Math.imul(y,G)|0,o=o+Math.imul(y,J)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,Q)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,Q)|0;var we=(u+(n=n+Math.imul(f,Z)|0)|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(h,Z)|0))<<13)|0;u=((o=o+Math.imul(h,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(k,H),i=(i=Math.imul(k,V))+Math.imul(P,H)|0,o=Math.imul(P,V),n=n+Math.imul(E,q)|0,i=(i=i+Math.imul(E,K)|0)+Math.imul(x,q)|0,o=o+Math.imul(x,K)|0,n=n+Math.imul(w,G)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,J)|0,n=n+Math.imul(v,X)|0,i=(i=i+Math.imul(v,Q)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,Q)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,ee)|0;var _e=(u+(n=n+Math.imul(f,re)|0)|0)+((8191&(i=(i=i+Math.imul(f,ne)|0)+Math.imul(h,re)|0))<<13)|0;u=((o=o+Math.imul(h,ne)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(A,H),i=(i=Math.imul(A,V))+Math.imul(T,H)|0,o=Math.imul(T,V),n=n+Math.imul(k,q)|0,i=(i=i+Math.imul(k,K)|0)+Math.imul(P,q)|0,o=o+Math.imul(P,K)|0,n=n+Math.imul(E,G)|0,i=(i=i+Math.imul(E,J)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,J)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,Q)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,Q)|0,n=n+Math.imul(v,Z)|0,i=(i=i+Math.imul(v,ee)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0;var Se=(u+(n=n+Math.imul(f,oe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ae)|0)+Math.imul(h,oe)|0))<<13)|0;u=((o=o+Math.imul(h,ae)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(N,H),i=(i=Math.imul(N,V))+Math.imul(R,H)|0,o=Math.imul(R,V),n=n+Math.imul(A,q)|0,i=(i=i+Math.imul(A,K)|0)+Math.imul(T,q)|0,o=o+Math.imul(T,K)|0,n=n+Math.imul(k,G)|0,i=(i=i+Math.imul(k,J)|0)+Math.imul(P,G)|0,o=o+Math.imul(P,J)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,Q)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,Q)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,ee)|0,n=n+Math.imul(v,re)|0,i=(i=i+Math.imul(v,ne)|0)+Math.imul(y,re)|0,o=o+Math.imul(y,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,ae)|0;var Ee=(u+(n=n+Math.imul(f,ce)|0)|0)+((8191&(i=(i=i+Math.imul(f,ue)|0)+Math.imul(h,ce)|0))<<13)|0;u=((o=o+Math.imul(h,ue)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(L,H),i=(i=Math.imul(L,V))+Math.imul(j,H)|0,o=Math.imul(j,V),n=n+Math.imul(N,q)|0,i=(i=i+Math.imul(N,K)|0)+Math.imul(R,q)|0,o=o+Math.imul(R,K)|0,n=n+Math.imul(A,G)|0,i=(i=i+Math.imul(A,J)|0)+Math.imul(T,G)|0,o=o+Math.imul(T,J)|0,n=n+Math.imul(k,X)|0,i=(i=i+Math.imul(k,Q)|0)+Math.imul(P,X)|0,o=o+Math.imul(P,Q)|0,n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ne)|0,n=n+Math.imul(v,oe)|0,i=(i=i+Math.imul(v,ae)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,ae)|0,n=n+Math.imul(p,ce)|0,i=(i=i+Math.imul(p,ue)|0)+Math.imul(m,ce)|0,o=o+Math.imul(m,ue)|0;var xe=(u+(n=n+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,he)|0)+Math.imul(h,fe)|0))<<13)|0;u=((o=o+Math.imul(h,he)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(B,H),i=(i=Math.imul(B,V))+Math.imul(U,H)|0,o=Math.imul(U,V),n=n+Math.imul(L,q)|0,i=(i=i+Math.imul(L,K)|0)+Math.imul(j,q)|0,o=o+Math.imul(j,K)|0,n=n+Math.imul(N,G)|0,i=(i=i+Math.imul(N,J)|0)+Math.imul(R,G)|0,o=o+Math.imul(R,J)|0,n=n+Math.imul(A,X)|0,i=(i=i+Math.imul(A,Q)|0)+Math.imul(T,X)|0,o=o+Math.imul(T,Q)|0,n=n+Math.imul(k,Z)|0,i=(i=i+Math.imul(k,ee)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,ae)|0,n=n+Math.imul(v,ce)|0,i=(i=i+Math.imul(v,ue)|0)+Math.imul(y,ce)|0,o=o+Math.imul(y,ue)|0,n=n+Math.imul(p,fe)|0,i=(i=i+Math.imul(p,he)|0)+Math.imul(m,fe)|0,o=o+Math.imul(m,he)|0;var Ie=(u+(n=n+Math.imul(f,pe)|0)|0)+((8191&(i=(i=i+Math.imul(f,me)|0)+Math.imul(h,pe)|0))<<13)|0;u=((o=o+Math.imul(h,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(B,q),i=(i=Math.imul(B,K))+Math.imul(U,q)|0,o=Math.imul(U,K),n=n+Math.imul(L,G)|0,i=(i=i+Math.imul(L,J)|0)+Math.imul(j,G)|0,o=o+Math.imul(j,J)|0,n=n+Math.imul(N,X)|0,i=(i=i+Math.imul(N,Q)|0)+Math.imul(R,X)|0,o=o+Math.imul(R,Q)|0,n=n+Math.imul(A,Z)|0,i=(i=i+Math.imul(A,ee)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,ee)|0,n=n+Math.imul(k,re)|0,i=(i=i+Math.imul(k,ne)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ne)|0,n=n+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,ae)|0,n=n+Math.imul(w,ce)|0,i=(i=i+Math.imul(w,ue)|0)+Math.imul(_,ce)|0,o=o+Math.imul(_,ue)|0,n=n+Math.imul(v,fe)|0,i=(i=i+Math.imul(v,he)|0)+Math.imul(y,fe)|0,o=o+Math.imul(y,he)|0;var ke=(u+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;u=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(B,G),i=(i=Math.imul(B,J))+Math.imul(U,G)|0,o=Math.imul(U,J),n=n+Math.imul(L,X)|0,i=(i=i+Math.imul(L,Q)|0)+Math.imul(j,X)|0,o=o+Math.imul(j,Q)|0,n=n+Math.imul(N,Z)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,ee)|0,n=n+Math.imul(A,re)|0,i=(i=i+Math.imul(A,ne)|0)+Math.imul(T,re)|0,o=o+Math.imul(T,ne)|0,n=n+Math.imul(k,oe)|0,i=(i=i+Math.imul(k,ae)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,ae)|0,n=n+Math.imul(E,ce)|0,i=(i=i+Math.imul(E,ue)|0)+Math.imul(x,ce)|0,o=o+Math.imul(x,ue)|0,n=n+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,he)|0)+Math.imul(_,fe)|0,o=o+Math.imul(_,he)|0;var Pe=(u+(n=n+Math.imul(v,pe)|0)|0)+((8191&(i=(i=i+Math.imul(v,me)|0)+Math.imul(y,pe)|0))<<13)|0;u=((o=o+Math.imul(y,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(B,X),i=(i=Math.imul(B,Q))+Math.imul(U,X)|0,o=Math.imul(U,Q),n=n+Math.imul(L,Z)|0,i=(i=i+Math.imul(L,ee)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,ee)|0,n=n+Math.imul(N,re)|0,i=(i=i+Math.imul(N,ne)|0)+Math.imul(R,re)|0,o=o+Math.imul(R,ne)|0,n=n+Math.imul(A,oe)|0,i=(i=i+Math.imul(A,ae)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,ae)|0,n=n+Math.imul(k,ce)|0,i=(i=i+Math.imul(k,ue)|0)+Math.imul(P,ce)|0,o=o+Math.imul(P,ue)|0,n=n+Math.imul(E,fe)|0,i=(i=i+Math.imul(E,he)|0)+Math.imul(x,fe)|0,o=o+Math.imul(x,he)|0;var Oe=(u+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(_,pe)|0))<<13)|0;u=((o=o+Math.imul(_,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(B,Z),i=(i=Math.imul(B,ee))+Math.imul(U,Z)|0,o=Math.imul(U,ee),n=n+Math.imul(L,re)|0,i=(i=i+Math.imul(L,ne)|0)+Math.imul(j,re)|0,o=o+Math.imul(j,ne)|0,n=n+Math.imul(N,oe)|0,i=(i=i+Math.imul(N,ae)|0)+Math.imul(R,oe)|0,o=o+Math.imul(R,ae)|0,n=n+Math.imul(A,ce)|0,i=(i=i+Math.imul(A,ue)|0)+Math.imul(T,ce)|0,o=o+Math.imul(T,ue)|0,n=n+Math.imul(k,fe)|0,i=(i=i+Math.imul(k,he)|0)+Math.imul(P,fe)|0,o=o+Math.imul(P,he)|0;var Ae=(u+(n=n+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,me)|0)+Math.imul(x,pe)|0))<<13)|0;u=((o=o+Math.imul(x,me)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(B,re),i=(i=Math.imul(B,ne))+Math.imul(U,re)|0,o=Math.imul(U,ne),n=n+Math.imul(L,oe)|0,i=(i=i+Math.imul(L,ae)|0)+Math.imul(j,oe)|0,o=o+Math.imul(j,ae)|0,n=n+Math.imul(N,ce)|0,i=(i=i+Math.imul(N,ue)|0)+Math.imul(R,ce)|0,o=o+Math.imul(R,ue)|0,n=n+Math.imul(A,fe)|0,i=(i=i+Math.imul(A,he)|0)+Math.imul(T,fe)|0,o=o+Math.imul(T,he)|0;var Te=(u+(n=n+Math.imul(k,pe)|0)|0)+((8191&(i=(i=i+Math.imul(k,me)|0)+Math.imul(P,pe)|0))<<13)|0;u=((o=o+Math.imul(P,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(B,oe),i=(i=Math.imul(B,ae))+Math.imul(U,oe)|0,o=Math.imul(U,ae),n=n+Math.imul(L,ce)|0,i=(i=i+Math.imul(L,ue)|0)+Math.imul(j,ce)|0,o=o+Math.imul(j,ue)|0,n=n+Math.imul(N,fe)|0,i=(i=i+Math.imul(N,he)|0)+Math.imul(R,fe)|0,o=o+Math.imul(R,he)|0;var Ce=(u+(n=n+Math.imul(A,pe)|0)|0)+((8191&(i=(i=i+Math.imul(A,me)|0)+Math.imul(T,pe)|0))<<13)|0;u=((o=o+Math.imul(T,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(B,ce),i=(i=Math.imul(B,ue))+Math.imul(U,ce)|0,o=Math.imul(U,ue),n=n+Math.imul(L,fe)|0,i=(i=i+Math.imul(L,he)|0)+Math.imul(j,fe)|0,o=o+Math.imul(j,he)|0;var Ne=(u+(n=n+Math.imul(N,pe)|0)|0)+((8191&(i=(i=i+Math.imul(N,me)|0)+Math.imul(R,pe)|0))<<13)|0;u=((o=o+Math.imul(R,me)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(B,fe),i=(i=Math.imul(B,he))+Math.imul(U,fe)|0,o=Math.imul(U,he);var Re=(u+(n=n+Math.imul(L,pe)|0)|0)+((8191&(i=(i=i+Math.imul(L,me)|0)+Math.imul(j,pe)|0))<<13)|0;u=((o=o+Math.imul(j,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863;var Me=(u+(n=Math.imul(B,pe))|0)+((8191&(i=(i=Math.imul(B,me))+Math.imul(U,pe)|0))<<13)|0;return u=((o=Math.imul(U,me))+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,c[0]=ge,c[1]=ve,c[2]=ye,c[3]=be,c[4]=we,c[5]=_e,c[6]=Se,c[7]=Ee,c[8]=xe,c[9]=Ie,c[10]=ke,c[11]=Pe,c[12]=Oe,c[13]=Ae,c[14]=Te,c[15]=Ce,c[16]=Ne,c[17]=Re,c[18]=Me,0!==u&&(c[19]=u,r.length++),r};function d(e,t,r){return(new p).mulp(e,t,r)}function p(e,t){this.x=e,this.y=t}Math.imul||(h=f),i.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?h(this,e,t):r<63?f(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var a=i;i=0;for(var s=67108863&n,c=Math.min(o,t.length-1),u=Math.max(0,o-e.length+1);u<=c;u++){var l=o-u,f=(0|e.words[l])*(0|t.words[u]),h=67108863&f;s=67108863&(h=h+s|0),i+=(a=(a=a+(f/67108864|0)|0)+(h>>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):d(this,e,t)},p.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},p.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},p.prototype.permute=function(e,t,r,n,i,o){for(var a=0;a<o;a++)n[a]=t[e[a]],i[a]=r[e[a]]},p.prototype.transform=function(e,t,r,n,i,o){this.permute(o,e,t,r,n,i);for(var a=1;a<i;a<<=1)for(var s=a<<1,c=Math.cos(2*Math.PI/s),u=Math.sin(2*Math.PI/s),l=0;l<i;l+=s)for(var f=c,h=u,d=0;d<a;d++){var p=r[l+d],m=n[l+d],g=r[l+d+a],v=n[l+d+a],y=f*g-h*v;v=f*v+h*g,g=y,r[l+d]=p+g,n[l+d]=m+v,r[l+d+a]=p-g,n[l+d+a]=m-v,d!==s&&(y=c*f-u*h,h=c*h+u*f,f=y)}},p.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},p.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},p.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},p.prototype.convert13b=function(e,t,n,i){for(var o=0,a=0;a<t;a++)o+=0|e[a],n[2*a]=8191&o,o>>>=13,n[2*a+1]=8191&o,o>>>=13;for(a=2*t;a<i;++a)n[a]=0;r(0===o),r(0==(-8192&o))},p.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},p.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),o=this.stub(n),a=new Array(n),s=new Array(n),c=new Array(n),u=new Array(n),l=new Array(n),f=new Array(n),h=r.words;h.length=n,this.convert13b(e.words,e.length,a,n),this.convert13b(t.words,t.length,u,n),this.transform(a,o,s,c,n,i),this.transform(u,o,l,f,n,i);for(var d=0;d<n;d++){var p=s[d]*l[d]-c[d]*f[d];c[d]=s[d]*f[d]+c[d]*l[d],s[d]=p}return this.conjugate(s,c,n),this.transform(s,c,h,o,n,i),this.conjugate(h,o,n),this.normalize13b(h,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},i.prototype.mul=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},i.prototype.mulf=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),d(this,e,t)},i.prototype.imul=function(e){return this.clone().mulTo(e,this)},i.prototype.imuln=function(e){r("number"==typeof e),r(e<67108864);for(var t=0,n=0;n<this.length;n++){var i=(0|this.words[n])*e,o=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=o>>>26,this.words[n]=67108863&o}return 0!==t&&(this.words[n]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=(e.words[n]&1<<i)>>>i}return t}(e);if(0===t.length)return new i(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var o=r.sqr();n<t.length;n++,o=o.sqr())0!==t[n]&&(r=r.mul(o));return r},i.prototype.iushln=function(e){r("number"==typeof e&&e>=0);var t,n=e%26,i=(e-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t<this.length;t++){var s=this.words[t]&o,c=(0|this.words[t])-s<<n;this.words[t]=c|a,a=s>>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()},i.prototype.ishln=function(e){return r(0===this.negative),this.iushln(e)},i.prototype.iushrn=function(e,t,n){var i;r("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<<o,c=n;if(i-=a,i=Math.max(0,i),c){for(var u=0;u<a;u++)c.words[u]=this.words[u];c.length=a}if(0===a);else if(this.length>a)for(this.length-=a,u=0;u<this.length;u++)this.words[u]=this.words[u+a];else this.words[0]=0,this.length=1;var l=0;for(u=this.length-1;u>=0&&(0!==l||u>=i);u--){var f=0|this.words[u];this.words[u]=l<<26-o|f>>>o,l=f&s}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<<t;return!(this.length<=n)&&!!(this.words[n]&i)},i.prototype.imaskn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.strip()},i.prototype.maskn=function(e){return this.clone().imaskn(e)},i.prototype.iaddn=function(e){return r("number"==typeof e),r(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},i.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},i.prototype.addn=function(e){return this.clone().iaddn(e)},i.prototype.subn=function(e){return this.clone().isubn(e)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(e,t,n){var i,o,a=e.length+n;this._expand(a);var s=0;for(i=0;i<e.length;i++){o=(0|this.words[i+n])+s;var c=(0|e.words[i])*t;s=((o-=67108863&c)>>26)-(c/67108864|0),this.words[i+n]=67108863&o}for(;i<this.length-n;i++)s=(o=(0|this.words[i+n])+s)>>26,this.words[i+n]=67108863&o;if(0===s)return this.strip();for(r(-1===s),s=0,i=0;i<this.length;i++)s=(o=-(0|this.words[i])+s)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),o=e,a=0|o.words[o.length-1];0!==(r=26-this._countBits(a))&&(o=o.ushln(r),n.iushln(r),a=0|o.words[o.length-1]);var s,c=n.length-o.length;if("mod"!==t){(s=new i(null)).length=c+1,s.words=new Array(s.length);for(var u=0;u<s.length;u++)s.words[u]=0}var l=n.clone()._ishlnsubmul(o,1,c);0===l.negative&&(n=l,s&&(s.words[c]=1));for(var f=c-1;f>=0;f--){var h=67108864*(0|n.words[o.length+f])+(0|n.words[o.length+f-1]);for(h=Math.min(h/a|0,67108863),n._ishlnsubmul(o,h,f);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(o,1,f),n.isZero()||(n.negative^=1);s&&(s.words[f]=h)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},i.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(o=s.div.neg()),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(o=s.div.neg()),{div:o,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var o,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(t*n+(0|this.words[i]))%e;return n},i.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*t;this.words[n]=i/e|0,t=i%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),s=new i(0),c=new i(1),u=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++u;for(var l=n.clone(),f=t.clone();!t.isZero();){for(var h=0,d=1;0==(t.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(l),a.isub(f)),o.iushrn(1),a.iushrn(1);for(var p=0,m=1;0==(n.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(l),c.isub(f)),s.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(s),a.isub(c)):(n.isub(t),s.isub(o),c.isub(a))}return{a:s,b:c,gcd:n.iushln(u)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),c=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,l=1;0==(t.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(t.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var f=0,h=1;0==(n.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(n.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s)):(n.isub(t),s.isub(a))}return(o=0===t.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,i=1<<t;if(this.length<=n)return this._expand(n+1),this.words[n]|=i,this;for(var o=i,a=n;0!==o&&a<this.length;a++){var s=0|this.words[a];o=(s+=o)>>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},i.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},i.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new _(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function g(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function y(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function b(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function S(e){_.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):r.strip(),r},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},n(v,g),v.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,i=10;i<e.length;i++){var a=0|e.words[i];e.words[i-10]=(a&r)<<4|o>>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},n(y,g),n(b,g),n(w,g),w.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new y;else if("p192"===e)t=new b;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new w}return m[e]=t,t},_.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},_.prototype._verify2=function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},_.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},_.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},_.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},_.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},_.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},_.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},_.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},_.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},_.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},_.prototype.isqr=function(e){return this.imul(e,e.clone())},_.prototype.sqr=function(e){return this.mul(e,e)},_.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new i(1)).iushrn(2);return this.pow(e,n)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);r(!o.isZero());var s=new i(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new i(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var f=this.pow(l,o),h=this.pow(e,o.addn(1).iushrn(1)),d=this.pow(e,o),p=a;0!==d.cmp(s);){for(var m=d,g=0;0!==m.cmp(s);g++)m=m.redSqr();r(g<p);var v=this.pow(f,new i(1).iushln(p-g-1));h=h.redMul(v),f=v.redSqr(),d=d.redMul(f),p=g}return h},_.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},_.prototype.pow=function(e,t){if(t.isZero())return new i(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new i(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var o=r[0],a=0,s=0,c=t.bitLength()%26;for(0===c&&(c=26),n=t.length-1;n>=0;n--){for(var u=t.words[n],l=c-1;l>=0;l--){var f=u>>l&1;o!==r[0]&&(o=this.sqr(o)),0!==f||0!==a?(a<<=1,a|=f,(4===++s||0===n&&0===l)&&(o=this.mul(o,r[a]),s=0,a=0)):s=0}c=26}return o},_.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},_.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new S(e)},n(S,_),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,Zt)})),ly=[["elliptic@6.5.3","/Users/yuto/Desktop/lastrust/cert-verifier-js"]],fy="elliptic@6.5.3",hy="sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==",dy={},py={type:"version",registry:!0,raw:"elliptic@6.5.3",name:"elliptic",escapedName:"elliptic",rawSpec:"6.5.3",saveSpec:null,fetchSpec:"6.5.3"},my=["/tiny-secp256k1"],gy="https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz",vy="/Users/yuto/Desktop/lastrust/cert-verifier-js",yy={name:"Fedor Indutny",email:"fedor@indutny.com"},by={url:"https://github.com/indutny/elliptic/issues"},wy={"bn.js":"^4.4.0",brorand:"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0",inherits:"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"},_y={brfs:"^1.4.3",coveralls:"^3.0.8",grunt:"^1.0.4","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.2",jscs:"^3.0.7",jshint:"^2.10.3",mocha:"^6.2.2"},Sy=["lib"],Ey="https://github.com/indutny/elliptic",xy=["EC","Elliptic","curve","Cryptography"],Iy="lib/elliptic.js",ky={type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},Py={jscs:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",jshint:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",lint:"npm run jscs && npm run jshint",test:"npm run lint && npm run unit",unit:"istanbul test _mocha --reporter=spec test/index.js",version:"grunt dist && git add dist/"},Oy={_args:ly,_from:"elliptic@6.5.3",_id:fy,_inBundle:false,_integrity:hy,_location:"/tiny-secp256k1/elliptic",_phantomChildren:dy,_requested:py,_requiredBy:my,_resolved:gy,_spec:"6.5.3",_where:vy,author:yy,bugs:by,dependencies:wy,description:"EC cryptography",devDependencies:_y,files:Sy,homepage:Ey,keywords:xy,license:"MIT",main:Iy,name:"elliptic",repository:ky,scripts:Py,version:"6.5.3"},Ay=Object.freeze({__proto__:null,_args:ly,_from:"elliptic@6.5.3",_id:fy,_inBundle:false,_integrity:hy,_location:"/tiny-secp256k1/elliptic",_phantomChildren:dy,_requested:py,_requiredBy:my,_resolved:gy,_spec:"6.5.3",_where:vy,author:yy,bugs:by,dependencies:wy,description:"EC cryptography",devDependencies:_y,files:Sy,homepage:Ey,keywords:xy,license:"MIT",main:Iy,name:"elliptic",repository:ky,scripts:Py,version:"6.5.3",default:Oy}),Ty=Cy;function Cy(e,t){if(!e)throw new Error(t||"Assertion failed")}Cy.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var Ny,Ry=tr((function(e,t){var r=t;function n(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",r=0;r<e.length;r++)t+=n(e[r].toString(16));return t}r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e);for(n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16))}else for(n=0;n<e.length;n++){var i=e.charCodeAt(n),o=i>>8,a=255&i;o?r.push(o,a):r.push(a)}return r},r.zero2=n,r.toHex=i,r.encode=function(e,t){return"hex"===t?i(e):e}})),My=tr((function(e,t){var r=t;r.assert=Ty,r.toArray=Ry.toArray,r.zero2=Ry.zero2,r.toHex=Ry.toHex,r.encode=Ry.encode,r.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<<t+1,o=e.clone(),a=0;a<n.length;a++){var s,c=o.andln(i-1);o.isOdd()?(s=c>(i>>1)-1?(i>>1)-c:c,o.isubn(s)):s=0,n[a]=s,o.iushrn(1)}return n},r.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n=0,i=0;e.cmpn(-n)>0||t.cmpn(-i)>0;){var o,a,s,c=e.andln(3)+n&3,u=t.andln(3)+i&3;if(3===c&&(c=-1),3===u&&(u=-1),0==(1&c))o=0;else o=3!==(s=e.andln(7)+n&7)&&5!==s||2!==u?c:-c;if(r[0].push(o),0==(1&u))a=0;else a=3!==(s=t.andln(7)+i&7)&&5!==s||2!==c?u:-u;r[1].push(a),2*n===o+1&&(n=1-n),2*i===a+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return r},r.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},r.parseBytes=function(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new uy(e,"hex","le")}})),Ly=function(e){return Ny||(Ny=new jy(null)),Ny.generate(e)};function jy(e){this.rand=e}var Dy=jy;if(jy.prototype.generate=function(e){return this._rand(e)},jy.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?jy.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?jy.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(jy.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var By=ou;if("function"!=typeof By.randomBytes)throw new Error("Not supported");jy.prototype._rand=function(e){return By.randomBytes(e)}}catch(e){}Ly.Rand=Dy;var Uy=My.getNAF,Fy=My.getJSF,Hy=My.assert;function Vy(e,t){this.type=e,this.p=new uy(t.p,16),this.red=t.prime?uy.red(t.prime):uy.mont(this.p),this.zero=new uy(0).toRed(this.red),this.one=new uy(1).toRed(this.red),this.two=new uy(2).toRed(this.red),this.n=t.n&&new uy(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var zy=Vy;function qy(e,t){this.curve=e,this.type=t,this.precomputed=null}Vy.prototype.point=function(){throw new Error("Not implemented")},Vy.prototype.validate=function(){throw new Error("Not implemented")},Vy.prototype._fixedNafMul=function(e,t){Hy(e.precomputed);var r=e._getDoubles(),n=Uy(t,1,this._bitLength),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;for(var o=[],a=0;a<n.length;a+=r.step){var s=0;for(t=a+r.step-1;t>=a;t--)s=(s<<1)+n[t];o.push(s)}for(var c=this.jpoint(null,null,null),u=this.jpoint(null,null,null),l=i;l>0;l--){for(a=0;a<o.length;a++){(s=o[a])===l?u=u.mixedAdd(r.points[a]):s===-l&&(u=u.mixedAdd(r.points[a].neg()))}c=c.add(u)}return c.toP()},Vy.prototype._wnafMul=function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var i=n.points,o=Uy(t,r,this._bitLength),a=this.jpoint(null,null,null),s=o.length-1;s>=0;s--){for(t=0;s>=0&&0===o[s];s--)t++;if(s>=0&&t++,a=a.dblp(t),s<0)break;var c=o[s];Hy(0!==c),a="affine"===e.type?c>0?a.mixedAdd(i[c-1>>1]):a.mixedAdd(i[-c-1>>1].neg()):c>0?a.add(i[c-1>>1]):a.add(i[-c-1>>1].neg())}return"affine"===e.type?a.toP():a},Vy.prototype._wnafMulAdd=function(e,t,r,n,i){for(var o=this._wnafT1,a=this._wnafT2,s=this._wnafT3,c=0,u=0;u<n;u++){var l=(E=t[u])._getNAFPoints(e);o[u]=l.wnd,a[u]=l.points}for(u=n-1;u>=1;u-=2){var f=u-1,h=u;if(1===o[f]&&1===o[h]){var d=[t[f],null,null,t[h]];0===t[f].y.cmp(t[h].y)?(d[1]=t[f].add(t[h]),d[2]=t[f].toJ().mixedAdd(t[h].neg())):0===t[f].y.cmp(t[h].y.redNeg())?(d[1]=t[f].toJ().mixedAdd(t[h]),d[2]=t[f].add(t[h].neg())):(d[1]=t[f].toJ().mixedAdd(t[h]),d[2]=t[f].toJ().mixedAdd(t[h].neg()));var p=[-3,-1,-5,-7,0,7,5,1,3],m=Fy(r[f],r[h]);c=Math.max(m[0].length,c),s[f]=new Array(c),s[h]=new Array(c);for(var g=0;g<c;g++){var v=0|m[0][g],y=0|m[1][g];s[f][g]=p[3*(v+1)+(y+1)],s[h][g]=0,a[f]=d}}else s[f]=Uy(r[f],o[f],this._bitLength),s[h]=Uy(r[h],o[h],this._bitLength),c=Math.max(s[f].length,c),c=Math.max(s[h].length,c)}var b=this.jpoint(null,null,null),w=this._wnafT4;for(u=c;u>=0;u--){for(var _=0;u>=0;){var S=!0;for(g=0;g<n;g++)w[g]=0|s[g][u],0!==w[g]&&(S=!1);if(!S)break;_++,u--}if(u>=0&&_++,b=b.dblp(_),u<0)break;for(g=0;g<n;g++){var E,x=w[g];0!==x&&(x>0?E=a[g][x-1>>1]:x<0&&(E=a[g][-x-1>>1].neg()),b="affine"===E.type?b.mixedAdd(E):b.add(E))}}for(u=0;u<n;u++)a[u]=null;return i?b:b.toP()},Vy.BasePoint=qy,qy.prototype.eq=function(){throw new Error("Not implemented")},qy.prototype.validate=function(){return this.curve.validate(this)},Vy.prototype.decodePoint=function(e,t){e=My.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?Hy(e[e.length-1]%2==0):7===e[0]&&Hy(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},qy.prototype.encodeCompressed=function(e){return this.encode(e,!0)},qy.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},qy.prototype.encode=function(e,t){return My.encode(this._encode(t),e)},qy.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},qy.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},qy.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<t;i+=e){for(var o=0;o<e;o++)n=n.dbl();r.push(n)}return{step:e,points:r}},qy.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)t[i]=t[i-1].add(n);return{wnd:e,points:t}},qy.prototype._getBeta=function(){return null},qy.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t};var Ky=My.assert;function $y(e){zy.call(this,"short",e),this.a=new uy(e.a,16).toRed(this.red),this.b=new uy(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}dg($y,zy);var Gy=$y;function Jy(e,t,r,n){zy.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new uy(t,16),this.y=new uy(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function Wy(e,t,r,n){zy.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new uy(0)):(this.x=new uy(t,16),this.y=new uy(r,16),this.z=new uy(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}function Xy(e){zy.call(this,"mont",e),this.a=new uy(e.a,16).toRed(this.red),this.b=new uy(e.b,16).toRed(this.red),this.i4=new uy(4).toRed(this.red).redInvm(),this.two=new uy(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}$y.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new uy(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new uy(e.lambda,16);else{var i=this._getEndoRoots(this.n);0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(t))?r=i[0]:(r=i[1],Ky(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new uy(e.a,16),b:new uy(e.b,16)}})):this._getEndoBasis(r)}}},$y.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:uy.mont(e),r=new uy(2).toRed(t).redInvm(),n=r.redNeg(),i=new uy(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(i).fromRed(),n.redSub(i).fromRed()]},$y.prototype._getEndoBasis=function(e){for(var t,r,n,i,o,a,s,c,u,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),f=e,h=this.n.clone(),d=new uy(1),p=new uy(0),m=new uy(0),g=new uy(1),v=0;0!==f.cmpn(0);){var y=h.div(f);c=h.sub(y.mul(f)),u=m.sub(y.mul(d));var b=g.sub(y.mul(p));if(!n&&c.cmp(l)<0)t=s.neg(),r=d,n=c.neg(),i=u;else if(n&&2==++v)break;s=c,h=f,f=c,m=d,d=u,g=p,p=b}o=c.neg(),a=u;var w=n.sqr().add(i.sqr());return o.sqr().add(a.sqr()).cmp(w)>=0&&(o=t,a=r),n.negative&&(n=n.neg(),i=i.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:n,b:i},{a:o,b:a}]},$y.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),c=i.mul(r.b),u=o.mul(n.b);return{k1:e.sub(a).sub(s),k2:c.add(u).neg()}},$y.prototype.pointFromX=function(e,t){(e=new uy(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(t&&!i||!t&&i)&&(n=n.redNeg()),this.point(e,n)},$y.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},$y.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<e.length;o++){var a=this._endoSplit(t[o]),s=e[o],c=s._getBeta();a.k1.negative&&(a.k1.ineg(),s=s.neg(!0)),a.k2.negative&&(a.k2.ineg(),c=c.neg(!0)),n[2*o]=s,n[2*o+1]=c,i[2*o]=a.k1,i[2*o+1]=a.k2}for(var u=this._wnafMulAdd(1,n,i,2*o,r),l=0;l<2*o;l++)n[l]=null,i[l]=null;return u},dg(Jy,zy.BasePoint),$y.prototype.point=function(e,t,r){return new Jy(this,e,t,r)},$y.prototype.pointFromJSON=function(e,t){return Jy.fromJSON(this,e,t)},Jy.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},Jy.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},Jy.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function i(t){return e.point(t[0],t[1],r)}var o=t[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},Jy.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},Jy.prototype.isInfinity=function(){return this.inf},Jy.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},Jy.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},Jy.prototype.getX=function(){return this.x.fromRed()},Jy.prototype.getY=function(){return this.y.fromRed()},Jy.prototype.mul=function(e){return e=new uy(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},Jy.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},Jy.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},Jy.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},Jy.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},Jy.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},dg(Wy,zy.BasePoint),$y.prototype.jpoint=function(e,t,r){return new Wy(this,e,t,r)},Wy.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},Wy.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},Wy.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=n.redSub(i),c=o.redSub(a);if(0===s.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),l=u.redMul(s),f=n.redMul(u),h=c.redSqr().redIAdd(l).redISub(f).redISub(f),d=c.redMul(f.redISub(h)).redISub(o.redMul(l)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,d,p)},Wy.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),u=c.redMul(a),l=r.redMul(c),f=s.redSqr().redIAdd(u).redISub(l).redISub(l),h=s.redMul(l.redISub(f)).redISub(i.redMul(u)),d=this.z.redMul(a);return this.curve.jpoint(f,h,d)},Wy.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r<e;r++)t=t.dbl();return t}var n=this.curve.a,i=this.curve.tinv,o=this.x,a=this.y,s=this.z,c=s.redSqr().redSqr(),u=a.redAdd(a);for(r=0;r<e;r++){var l=o.redSqr(),f=u.redSqr(),h=f.redSqr(),d=l.redAdd(l).redIAdd(l).redIAdd(n.redMul(c)),p=o.redMul(f),m=d.redSqr().redISub(p.redAdd(p)),g=p.redISub(m),v=d.redMul(g);v=v.redIAdd(v).redISub(h);var y=u.redMul(s);r+1<e&&(c=c.redMul(h)),o=m,s=y,u=v}return this.curve.jpoint(o,u.redMul(i),s)},Wy.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},Wy.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n),c=s.redSqr().redISub(a).redISub(a),u=o.redIAdd(o);u=(u=u.redIAdd(u)).redIAdd(u),e=c,t=s.redMul(a.redISub(c)).redISub(u),r=this.y.redAdd(this.y)}else{var l=this.x.redSqr(),f=this.y.redSqr(),h=f.redSqr(),d=this.x.redAdd(f).redSqr().redISub(l).redISub(h);d=d.redIAdd(d);var p=l.redAdd(l).redIAdd(l),m=p.redSqr(),g=h.redIAdd(h);g=(g=g.redIAdd(g)).redIAdd(g),e=m.redISub(d).redISub(d),t=p.redMul(d.redISub(e)).redISub(g),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},Wy.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),c=s.redSqr().redISub(a).redISub(a);e=c;var u=o.redIAdd(o);u=(u=u.redIAdd(u)).redIAdd(u),t=s.redMul(a.redISub(c)).redISub(u),r=this.y.redAdd(this.y)}else{var l=this.z.redSqr(),f=this.y.redSqr(),h=this.x.redMul(f),d=this.x.redSub(l).redMul(this.x.redAdd(l));d=d.redAdd(d).redIAdd(d);var p=h.redIAdd(h),m=(p=p.redIAdd(p)).redAdd(p);e=d.redSqr().redISub(m),r=this.y.redAdd(this.z).redSqr().redISub(f).redISub(l);var g=f.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),t=d.redMul(p.redISub(e)).redISub(g)}return this.curve.jpoint(e,t,r)},Wy.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=t.redSqr(),a=r.redSqr(),s=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(i)),c=t.redAdd(t),u=(c=c.redIAdd(c)).redMul(a),l=s.redSqr().redISub(u.redAdd(u)),f=u.redISub(l),h=a.redSqr();h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var d=s.redMul(f).redISub(h),p=r.redAdd(r).redMul(n);return this.curve.jpoint(l,d,p)},Wy.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),i=e.redAdd(e).redIAdd(e),o=i.redSqr(),a=this.x.redAdd(t).redSqr().redISub(e).redISub(n),s=(a=(a=(a=a.redIAdd(a)).redAdd(a).redIAdd(a)).redISub(o)).redSqr(),c=n.redIAdd(n);c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var u=i.redIAdd(a).redSqr().redISub(o).redISub(s).redISub(c),l=t.redMul(u);l=(l=l.redIAdd(l)).redIAdd(l);var f=this.x.redMul(s).redISub(l);f=(f=f.redIAdd(f)).redIAdd(f);var h=this.y.redMul(u.redMul(c.redISub(u)).redISub(a.redMul(s)));h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var d=this.z.redAdd(a).redSqr().redISub(r).redISub(s);return this.curve.jpoint(f,h,d)},Wy.prototype.mul=function(e,t){return e=new uy(e,t),this.curve._wnafMul(this,e)},Wy.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),i=r.redMul(e.z);return 0===this.y.redMul(i).redISub(e.y.redMul(n)).cmpn(0)},Wy.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),i=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},Wy.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},Wy.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},dg(Xy,zy);var Qy=Xy;function Yy(e,t,r){zy.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new uy(t,16),this.z=new uy(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}Xy.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},dg(Yy,zy.BasePoint),Xy.prototype.decodePoint=function(e,t){return this.point(My.toArray(e,t),1)},Xy.prototype.point=function(e,t){return new Yy(this,e,t)},Xy.prototype.pointFromJSON=function(e){return Yy.fromJSON(this,e)},Yy.prototype.precompute=function(){},Yy.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},Yy.fromJSON=function(e,t){return new Yy(e,t[0],t[1]||e.one)},Yy.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},Yy.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},Yy.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},Yy.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},Yy.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),a=i.redMul(n),s=t.z.redMul(o.redAdd(a).redSqr()),c=t.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,c)},Yy.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},Yy.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},Yy.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},Yy.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},Yy.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},Yy.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var Zy=My.assert;function eb(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,zy.call(this,"edwards",e),this.a=new uy(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new uy(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new uy(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),Zy(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}dg(eb,zy);var tb=eb;function rb(e,t,r,n,i){zy.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new uy(t,16),this.y=new uy(r,16),this.z=n?new uy(n,16):this.curve.one,this.t=i&&new uy(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}eb.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},eb.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},eb.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},eb.prototype.pointFromX=function(e,t){(e=new uy(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),i=this.one.redSub(this.c2.redMul(this.d).redMul(r)),o=n.redMul(i.redInvm()),a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");var s=a.fromRed().isOdd();return(t&&!s||!t&&s)&&(a=a.redNeg()),this.point(e,a)},eb.prototype.pointFromY=function(e,t){(e=new uy(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),i=r.redMul(this.d).redMul(this.c2).redSub(this.a),o=n.redMul(i.redInvm());if(0===o.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==t&&(a=a.redNeg()),this.point(a,e)},eb.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},dg(rb,zy.BasePoint),eb.prototype.pointFromJSON=function(e){return rb.fromJSON(this,e)},eb.prototype.point=function(e,t,r,n){return new rb(this,e,t,r,n)},rb.fromJSON=function(e,t){return new rb(e,t[0],t[1],t[2])},rb.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},rb.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},rb.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=n.redAdd(t),a=o.redSub(r),s=n.redSub(t),c=i.redMul(a),u=o.redMul(s),l=i.redMul(s),f=a.redMul(o);return this.curve.point(c,u,f,l)},rb.prototype._projDbl=function(){var e,t,r,n=this.x.redAdd(this.y).redSqr(),i=this.x.redSqr(),o=this.y.redSqr();if(this.curve.twisted){var a=(u=this.curve._mulA(i)).redAdd(o);if(this.zOne)e=n.redSub(i).redSub(o).redMul(a.redSub(this.curve.two)),t=a.redMul(u.redSub(o)),r=a.redSqr().redSub(a).redSub(a);else{var s=this.z.redSqr(),c=a.redSub(s).redISub(s);e=n.redSub(i).redISub(o).redMul(c),t=a.redMul(u.redSub(o)),r=a.redMul(c)}}else{var u=i.redAdd(o);s=this.curve._mulC(this.z).redSqr(),c=u.redSub(s).redSub(s);e=this.curve._mulC(n.redISub(u)).redMul(c),t=this.curve._mulC(u).redMul(i.redISub(o)),r=u.redMul(c)}return this.curve.point(e,t,r)},rb.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},rb.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),a=i.redSub(n),s=i.redAdd(n),c=r.redAdd(t),u=o.redMul(a),l=s.redMul(c),f=o.redMul(c),h=a.redMul(s);return this.curve.point(u,l,h,f)},rb.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),o=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(o).redMul(a),c=i.redSub(s),u=i.redAdd(s),l=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(a),f=n.redMul(c).redMul(l);return this.curve.twisted?(t=n.redMul(u).redMul(a.redSub(this.curve._mulA(o))),r=c.redMul(u)):(t=n.redMul(u).redMul(a.redSub(o)),r=this.curve._mulC(c).redMul(u)),this.curve.point(f,t,r)},rb.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},rb.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},rb.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},rb.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},rb.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},rb.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},rb.prototype.getX=function(){return this.normalize(),this.x.fromRed()},rb.prototype.getY=function(){return this.normalize(),this.y.fromRed()},rb.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},rb.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},rb.prototype.toP=rb.prototype.normalize,rb.prototype.mixedAdd=rb.prototype.add;var nb=tr((function(e,t){var r=t;r.base=zy,r.short=Gy,r.mont=Qy,r.edwards=tb}));function ib(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function ob(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function ab(e){return 1===e.length?"0"+e:e}function sb(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}var cb={inherits:dg,toArray:function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(var n=0,i=0;i<e.length;i++){var o=e.charCodeAt(i);o<128?r[n++]=o:o<2048?(r[n++]=o>>6|192,r[n++]=63&o|128):ib(e,i)?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++i)),r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=63&o|128):(r[n++]=o>>12|224,r[n++]=o>>6&63|128,r[n++]=63&o|128)}else for(i=0;i<e.length;i++)r[i]=0|e[i];return r},toHex:function(e){for(var t="",r=0;r<e.length;r++)t+=ab(e[r].toString(16));return t},htonl:ob,toHex32:function(e,t){for(var r="",n=0;n<e.length;n++){var i=e[n];"little"===t&&(i=ob(i)),r+=sb(i.toString(16))}return r},zero2:ab,zero8:sb,join32:function(e,t,r,n){var i=r-t;Ty(i%4==0);for(var o=new Array(i/4),a=0,s=t;a<o.length;a++,s+=4){var c;c="big"===n?e[s]<<24|e[s+1]<<16|e[s+2]<<8|e[s+3]:e[s+3]<<24|e[s+2]<<16|e[s+1]<<8|e[s],o[a]=c>>>0}return o},split32:function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n<e.length;n++,i+=4){var o=e[n];"big"===t?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},rotr32:function(e,t){return e>>>t|e<<32-t},rotl32:function(e,t){return e<<t|e>>>32-t},sum32:function(e,t){return e+t>>>0},sum32_3:function(e,t,r){return e+t+r>>>0},sum32_4:function(e,t,r,n){return e+t+r+n>>>0},sum32_5:function(e,t,r,n,i){return e+t+r+n+i>>>0},sum64:function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,a=(o<n?1:0)+r+i;e[t]=a>>>0,e[t+1]=o},sum64_hi:function(e,t,r,n){return(t+n>>>0<t?1:0)+e+r>>>0},sum64_lo:function(e,t,r,n){return t+n>>>0},sum64_4_hi:function(e,t,r,n,i,o,a,s){var c=0,u=t;return c+=(u=u+n>>>0)<t?1:0,c+=(u=u+o>>>0)<o?1:0,e+r+i+a+(c+=(u=u+s>>>0)<s?1:0)>>>0},sum64_4_lo:function(e,t,r,n,i,o,a,s){return t+n+o+s>>>0},sum64_5_hi:function(e,t,r,n,i,o,a,s,c,u){var l=0,f=t;return l+=(f=f+n>>>0)<t?1:0,l+=(f=f+o>>>0)<o?1:0,l+=(f=f+s>>>0)<s?1:0,e+r+i+a+c+(l+=(f=f+u>>>0)<u?1:0)>>>0},sum64_5_lo:function(e,t,r,n,i,o,a,s,c,u){return t+n+o+s+u>>>0},rotr64_hi:function(e,t,r){return(t<<32-r|e>>>r)>>>0},rotr64_lo:function(e,t,r){return(e<<32-r|t>>>r)>>>0},shr64_hi:function(e,t,r){return e>>>r},shr64_lo:function(e,t,r){return(e<<32-r|t>>>r)>>>0}};function ub(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}var lb=ub;ub.prototype.update=function(e,t){if(e=cb.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=cb.join32(e,0,e.length-r,this.endian);for(var n=0;n<e.length;n+=this._delta32)this._update(e,n,n+this._delta32)}return this},ub.prototype.digest=function(e){return this.update(this._pad()),Ty(null===this.pending),this._digest(e)},ub.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(e<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=e>>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n};var fb={BlockHash:lb},hb=cb.rotr32;function db(e,t,r){return e&t^~e&r}function pb(e,t,r){return e&t^e&r^t&r}function mb(e,t,r){return e^t^r}var gb={ft_1:function(e,t,r,n){return 0===e?db(t,r,n):1===e||3===e?mb(t,r,n):2===e?pb(t,r,n):void 0},ch32:db,maj32:pb,p32:mb,s0_256:function(e){return hb(e,2)^hb(e,13)^hb(e,22)},s1_256:function(e){return hb(e,6)^hb(e,11)^hb(e,25)},g0_256:function(e){return hb(e,7)^hb(e,18)^e>>>3},g1_256:function(e){return hb(e,17)^hb(e,19)^e>>>10}},vb=cb.rotl32,yb=cb.sum32,bb=cb.sum32_5,wb=gb.ft_1,_b=fb.BlockHash,Sb=[1518500249,1859775393,2400959708,3395469782];function Eb(){if(!(this instanceof Eb))return new Eb;_b.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}cb.inherits(Eb,_b);var xb=Eb;Eb.blockSize=512,Eb.outSize=160,Eb.hmacStrength=80,Eb.padLength=64,Eb.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=vb(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],a=this.h[2],s=this.h[3],c=this.h[4];for(n=0;n<r.length;n++){var u=~~(n/20),l=bb(vb(i,5),wb(u,o,a,s),c,r[n],Sb[u]);c=s,s=a,a=vb(o,30),o=i,i=l}this.h[0]=yb(this.h[0],i),this.h[1]=yb(this.h[1],o),this.h[2]=yb(this.h[2],a),this.h[3]=yb(this.h[3],s),this.h[4]=yb(this.h[4],c)},Eb.prototype._digest=function(e){return"hex"===e?cb.toHex32(this.h,"big"):cb.split32(this.h,"big")};var Ib=cb.sum32,kb=cb.sum32_4,Pb=cb.sum32_5,Ob=gb.ch32,Ab=gb.maj32,Tb=gb.s0_256,Cb=gb.s1_256,Nb=gb.g0_256,Rb=gb.g1_256,Mb=fb.BlockHash,Lb=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function jb(){if(!(this instanceof jb))return new jb;Mb.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=Lb,this.W=new Array(64)}cb.inherits(jb,Mb);var Db=jb;function Bb(){if(!(this instanceof Bb))return new Bb;Db.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}jb.blockSize=512,jb.outSize=256,jb.hmacStrength=192,jb.padLength=64,jb.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=kb(Rb(r[n-2]),r[n-7],Nb(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],a=this.h[2],s=this.h[3],c=this.h[4],u=this.h[5],l=this.h[6],f=this.h[7];for(Ty(this.k.length===r.length),n=0;n<r.length;n++){var h=Pb(f,Cb(c),Ob(c,u,l),this.k[n],r[n]),d=Ib(Tb(i),Ab(i,o,a));f=l,l=u,u=c,c=Ib(s,h),s=a,a=o,o=i,i=Ib(h,d)}this.h[0]=Ib(this.h[0],i),this.h[1]=Ib(this.h[1],o),this.h[2]=Ib(this.h[2],a),this.h[3]=Ib(this.h[3],s),this.h[4]=Ib(this.h[4],c),this.h[5]=Ib(this.h[5],u),this.h[6]=Ib(this.h[6],l),this.h[7]=Ib(this.h[7],f)},jb.prototype._digest=function(e){return"hex"===e?cb.toHex32(this.h,"big"):cb.split32(this.h,"big")},cb.inherits(Bb,Db);var Ub=Bb;Bb.blockSize=512,Bb.outSize=224,Bb.hmacStrength=192,Bb.padLength=64,Bb.prototype._digest=function(e){return"hex"===e?cb.toHex32(this.h.slice(0,7),"big"):cb.split32(this.h.slice(0,7),"big")};var Fb=cb.rotr64_hi,Hb=cb.rotr64_lo,Vb=cb.shr64_hi,zb=cb.shr64_lo,qb=cb.sum64,Kb=cb.sum64_hi,$b=cb.sum64_lo,Gb=cb.sum64_4_hi,Jb=cb.sum64_4_lo,Wb=cb.sum64_5_hi,Xb=cb.sum64_5_lo,Qb=fb.BlockHash,Yb=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function Zb(){if(!(this instanceof Zb))return new Zb;Qb.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=Yb,this.W=new Array(160)}cb.inherits(Zb,Qb);var ew=Zb;function tw(e,t,r,n,i){var o=e&r^~e&i;return o<0&&(o+=4294967296),o}function rw(e,t,r,n,i,o){var a=t&n^~t&o;return a<0&&(a+=4294967296),a}function nw(e,t,r,n,i){var o=e&r^e&i^r&i;return o<0&&(o+=4294967296),o}function iw(e,t,r,n,i,o){var a=t&n^t&o^n&o;return a<0&&(a+=4294967296),a}function ow(e,t){var r=Fb(e,t,28)^Fb(t,e,2)^Fb(t,e,7);return r<0&&(r+=4294967296),r}function aw(e,t){var r=Hb(e,t,28)^Hb(t,e,2)^Hb(t,e,7);return r<0&&(r+=4294967296),r}function sw(e,t){var r=Fb(e,t,14)^Fb(e,t,18)^Fb(t,e,9);return r<0&&(r+=4294967296),r}function cw(e,t){var r=Hb(e,t,14)^Hb(e,t,18)^Hb(t,e,9);return r<0&&(r+=4294967296),r}function uw(e,t){var r=Fb(e,t,1)^Fb(e,t,8)^Vb(e,t,7);return r<0&&(r+=4294967296),r}function lw(e,t){var r=Hb(e,t,1)^Hb(e,t,8)^zb(e,t,7);return r<0&&(r+=4294967296),r}function fw(e,t){var r=Fb(e,t,19)^Fb(t,e,29)^Vb(e,t,6);return r<0&&(r+=4294967296),r}function hw(e,t){var r=Hb(e,t,19)^Hb(t,e,29)^zb(e,t,6);return r<0&&(r+=4294967296),r}function dw(){if(!(this instanceof dw))return new dw;ew.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}Zb.blockSize=1024,Zb.outSize=512,Zb.hmacStrength=192,Zb.padLength=128,Zb.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n<r.length;n+=2){var i=fw(r[n-4],r[n-3]),o=hw(r[n-4],r[n-3]),a=r[n-14],s=r[n-13],c=uw(r[n-30],r[n-29]),u=lw(r[n-30],r[n-29]),l=r[n-32],f=r[n-31];r[n]=Gb(i,o,a,s,c,u,l,f),r[n+1]=Jb(i,o,a,s,c,u,l,f)}},Zb.prototype._update=function(e,t){this._prepareBlock(e,t);var r=this.W,n=this.h[0],i=this.h[1],o=this.h[2],a=this.h[3],s=this.h[4],c=this.h[5],u=this.h[6],l=this.h[7],f=this.h[8],h=this.h[9],d=this.h[10],p=this.h[11],m=this.h[12],g=this.h[13],v=this.h[14],y=this.h[15];Ty(this.k.length===r.length);for(var b=0;b<r.length;b+=2){var w=v,_=y,S=sw(f,h),E=cw(f,h),x=tw(f,h,d,p,m),I=rw(f,h,d,p,m,g),k=this.k[b],P=this.k[b+1],O=r[b],A=r[b+1],T=Wb(w,_,S,E,x,I,k,P,O,A),C=Xb(w,_,S,E,x,I,k,P,O,A);w=ow(n,i),_=aw(n,i),S=nw(n,i,o,a,s),E=iw(n,i,o,a,s,c);var N=Kb(w,_,S,E),R=$b(w,_,S,E);v=m,y=g,m=d,g=p,d=f,p=h,f=Kb(u,l,T,C),h=$b(l,l,T,C),u=s,l=c,s=o,c=a,o=n,a=i,n=Kb(T,C,N,R),i=$b(T,C,N,R)}qb(this.h,0,n,i),qb(this.h,2,o,a),qb(this.h,4,s,c),qb(this.h,6,u,l),qb(this.h,8,f,h),qb(this.h,10,d,p),qb(this.h,12,m,g),qb(this.h,14,v,y)},Zb.prototype._digest=function(e){return"hex"===e?cb.toHex32(this.h,"big"):cb.split32(this.h,"big")},cb.inherits(dw,ew);var pw=dw;dw.blockSize=1024,dw.outSize=384,dw.hmacStrength=192,dw.padLength=128,dw.prototype._digest=function(e){return"hex"===e?cb.toHex32(this.h.slice(0,12),"big"):cb.split32(this.h.slice(0,12),"big")};var mw={sha1:xb,sha224:Ub,sha256:Db,sha384:pw,sha512:ew},gw=cb.rotl32,vw=cb.sum32,yw=cb.sum32_3,bw=cb.sum32_4,ww=fb.BlockHash;function _w(){if(!(this instanceof _w))return new _w;ww.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}cb.inherits(_w,ww);var Sw=_w;function Ew(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function xw(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function Iw(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}_w.blockSize=512,_w.outSize=160,_w.hmacStrength=192,_w.padLength=64,_w.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],i=this.h[2],o=this.h[3],a=this.h[4],s=r,c=n,u=i,l=o,f=a,h=0;h<80;h++){var d=vw(gw(bw(r,Ew(h,n,i,o),e[kw[h]+t],xw(h)),Ow[h]),a);r=a,a=o,o=gw(i,10),i=n,n=d,d=vw(gw(bw(s,Ew(79-h,c,u,l),e[Pw[h]+t],Iw(h)),Aw[h]),f),s=f,f=l,l=gw(u,10),u=c,c=d}d=yw(this.h[1],i,l),this.h[1]=yw(this.h[2],o,f),this.h[2]=yw(this.h[3],a,s),this.h[3]=yw(this.h[4],r,c),this.h[4]=yw(this.h[0],n,u),this.h[0]=d},_w.prototype._digest=function(e){return"hex"===e?cb.toHex32(this.h,"little"):cb.split32(this.h,"little")};var kw=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],Pw=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],Ow=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],Aw=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],Tw={ripemd160:Sw};function Cw(e,t,r){if(!(this instanceof Cw))return new Cw(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(cb.toArray(t,r))}var Nw=Cw;Cw.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),Ty(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},Cw.prototype.update=function(e,t){return this.inner.update(e,t),this},Cw.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)};var Rw=tr((function(e,t){var r=t;r.utils=cb,r.common=fb,r.sha=mw,r.ripemd=Tw,r.hmac=Nw,r.sha1=r.sha.sha1,r.sha256=r.sha.sha256,r.sha224=r.sha.sha224,r.sha384=r.sha.sha384,r.sha512=r.sha.sha512,r.ripemd160=r.ripemd.ripemd160})),Mw={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}},Lw=tr((function(e,t){var r,n=t,i=My.assert;function o(e){"short"===e.type?this.curve=new nb.short(e):"edwards"===e.type?this.curve=new nb.edwards(e):this.curve=new nb.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function a(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var r=new o(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=o,a("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:Rw.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:Rw.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:Rw.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:Rw.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),a("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:Rw.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Rw.sha256,gRed:!1,g:["9"]}),a("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Rw.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=Mw}catch(e){r=void 0}a("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:Rw.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function jw(e){if(!(this instanceof jw))return new jw(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=Ry.toArray(e.entropy,e.entropyEnc||"hex"),r=Ry.toArray(e.nonce,e.nonceEnc||"hex"),n=Ry.toArray(e.pers,e.persEnc||"hex");Ty(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var Dw=jw;jw.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},jw.prototype._hmac=function(){return new Rw.hmac(this.hash,this.K)},jw.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},jw.prototype.reseed=function(e,t,r,n){"string"!=typeof t&&(n=r,r=t,t=null),e=Ry.toArray(e,t),r=Ry.toArray(r,n),Ty(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},jw.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=Ry.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length<e;)this.V=this._hmac().update(this.V).digest(),i=i.concat(this.V);var o=i.slice(0,e);return this._update(r),this._reseed++,Ry.encode(o,t)};var Bw=My.assert;function Uw(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}var Fw=Uw;Uw.fromPublic=function(e,t,r){return t instanceof Uw?t:new Uw(e,{pub:t,pubEnc:r})},Uw.fromPrivate=function(e,t,r){return t instanceof Uw?t:new Uw(e,{priv:t,privEnc:r})},Uw.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},Uw.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},Uw.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},Uw.prototype._importPrivate=function(e,t){this.priv=new uy(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},Uw.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?Bw(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||Bw(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},Uw.prototype.derive=function(e){return e.mul(this.priv).getX()},Uw.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},Uw.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},Uw.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var Hw=My.assert;function Vw(e,t){if(e instanceof Vw)return e;this._importDER(e,t)||(Hw(e.r&&e.s,"Signature without r or s"),this.r=new uy(e.r,16),this.s=new uy(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var zw=Vw;function qw(){this.place=0}function Kw(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,a=t.place;o<n;o++,a++)i<<=8,i|=e[a],i>>>=0;return!(i<=127)&&(t.place=a,i)}function $w(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function Gw(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}Vw.prototype._importDER=function(e,t){e=My.toArray(e,t);var r=new qw;if(48!==e[r.place++])return!1;var n=Kw(e,r);if(!1===n)return!1;if(n+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=Kw(e,r);if(!1===i)return!1;var o=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var a=Kw(e,r);if(!1===a)return!1;if(e.length!==a+r.place)return!1;var s=e.slice(r.place,a+r.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}return this.r=new uy(o),this.s=new uy(s),this.recoveryParam=null,!0},Vw.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=$w(t),r=$w(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];Gw(n,t.length),(n=n.concat(t)).push(2),Gw(n,r.length);var i=n.concat(r),o=[48];return Gw(o,i.length),o=o.concat(i),My.encode(o,e)};var Jw=My.assert;function Ww(e){if(!(this instanceof Ww))return new Ww(e);"string"==typeof e&&(Jw(Lw.hasOwnProperty(e),"Unknown curve "+e),e=Lw[e]),e instanceof Lw.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var Xw=Ww;Ww.prototype.keyPair=function(e){return new Fw(this,e)},Ww.prototype.keyFromPrivate=function(e,t){return Fw.fromPrivate(this,e,t)},Ww.prototype.keyFromPublic=function(e,t){return Fw.fromPublic(this,e,t)},Ww.prototype.genKeyPair=function(e){e||(e={});for(var t=new Dw({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||Ly(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new uy(2));;){var i=new uy(t.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},Ww.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},Ww.prototype.sign=function(e,t,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new uy(e,16));for(var i=this.n.byteLength(),o=t.getPrivate().toArray("be",i),a=e.toArray("be",i),s=new Dw({hash:this.hash,entropy:o,nonce:a,pers:n.pers,persEnc:n.persEnc||"utf8"}),c=this.n.sub(new uy(1)),u=0;;u++){var l=n.k?n.k(u):new uy(s.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||l.cmp(c)>=0)){var f=this.g.mul(l);if(!f.isInfinity()){var h=f.getX(),d=h.umod(this.n);if(0!==d.cmpn(0)){var p=l.invm(this.n).mul(d.mul(t.getPrivate()).iadd(e));if(0!==(p=p.umod(this.n)).cmpn(0)){var m=(f.getY().isOdd()?1:0)|(0!==h.cmp(d)?2:0);return n.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),m^=1),new zw({r:d,s:p,recoveryParam:m})}}}}}},Ww.prototype.verify=function(e,t,r,n){e=this._truncateToN(new uy(e,16)),r=this.keyFromPublic(r,n);var i=(t=new zw(t,"hex")).r,o=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a,s=o.invm(this.n),c=s.mul(e).umod(this.n),u=s.mul(i).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(c,r.getPublic(),u)).isInfinity()&&a.eqXToP(i):!(a=this.g.mulAdd(c,r.getPublic(),u)).isInfinity()&&0===a.getX().umod(this.n).cmp(i)},Ww.prototype.recoverPubKey=function(e,t,r,n){Jw((3&r)===r,"The recovery param is more than two bits"),t=new zw(t,n);var i=this.n,o=new uy(e),a=t.r,s=t.s,c=1&r,u=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw new Error("Unable to find sencond key candinate");a=u?this.curve.pointFromX(a.add(this.curve.n),c):this.curve.pointFromX(a,c);var l=t.r.invm(i),f=i.sub(o).mul(l).umod(i),h=s.mul(l).umod(i);return this.g.mulAdd(f,a,h)},Ww.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new zw(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var Qw=My.assert,Yw=My.parseBytes,Zw=My.cachedProperty;function e_(e,t){this.eddsa=e,this._secret=Yw(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=Yw(t.pub)}e_.fromPublic=function(e,t){return t instanceof e_?t:new e_(e,{pub:t})},e_.fromSecret=function(e,t){return t instanceof e_?t:new e_(e,{secret:t})},e_.prototype.secret=function(){return this._secret},Zw(e_,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),Zw(e_,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),Zw(e_,"privBytes",(function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),Zw(e_,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),Zw(e_,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),Zw(e_,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),e_.prototype.sign=function(e){return Qw(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},e_.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},e_.prototype.getSecret=function(e){return Qw(this._secret,"KeyPair is public only"),My.encode(this.secret(),e)},e_.prototype.getPublic=function(e){return My.encode(this.pubBytes(),e)};var t_=e_,r_=My.assert,n_=My.cachedProperty,i_=My.parseBytes;function o_(e,t){this.eddsa=e,"object"!=typeof t&&(t=i_(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),r_(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof uy&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}n_(o_,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),n_(o_,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),n_(o_,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),n_(o_,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),o_.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},o_.prototype.toHex=function(){return My.encode(this.toBytes(),"hex").toUpperCase()};var a_=o_,s_=My.assert,c_=My.parseBytes;function u_(e){if(s_("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof u_))return new u_(e);e=Lw[e].curve;this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=Rw.sha512}var l_=u_;u_.prototype.sign=function(e,t){e=c_(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),o=this.encodePoint(i),a=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),s=n.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:s,Rencoded:o})},u_.prototype.verify=function(e,t,r){e=c_(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(o)},u_.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return My.intFromLE(e.digest()).umod(this.curve.n)},u_.prototype.keyFromPublic=function(e){return t_.fromPublic(this,e)},u_.prototype.keyFromSecret=function(e){return t_.fromSecret(this,e)},u_.prototype.makeSignature=function(e){return e instanceof a_?e:new a_(this,e)},u_.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},u_.prototype.decodePoint=function(e){var t=(e=My.parseBytes(e)).length-1,r=e.slice(0,t).concat(-129&e[t]),n=0!=(128&e[t]),i=My.intFromLE(r);return this.curve.pointFromY(i,n)},u_.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},u_.prototype.decodeInt=function(e){return My.intFromLE(e)},u_.prototype.isPoint=function(e){return e instanceof this.pointClass};var f_=rr(Ay),h_=tr((function(e,t){var r=t;r.version=f_.version,r.utils=My,r.rand=Ly,r.curve=nb,r.curves=Lw,r.ec=Xw,r.eddsa=l_}));const d_=re.alloc(1,1),p_=re.alloc(1,0);var m_=function(e,t,r,n,i){let o=re.alloc(32,0),a=re.alloc(32,1);o=ry("sha256",o).update(a).update(p_).update(t).update(e).update(i||"").digest(),a=ry("sha256",o).update(a).digest(),o=ry("sha256",o).update(a).update(d_).update(t).update(e).update(i||"").digest(),a=ry("sha256",o).update(a).digest(),a=ry("sha256",o).update(a).digest();let s=a;for(;!n(s)||!r(s);)o=ry("sha256",o).update(a).update(p_).digest(),a=ry("sha256",o).update(a).digest(),a=ry("sha256",o).update(a).digest(),s=a;return s};const g_=new(0,h_.ec)("secp256k1"),v_=re.alloc(32,0),y_=re.from("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141","hex"),b_=re.from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f","hex"),w_=g_.curve.n,__=w_.shrn(1),S_=g_.curve.g;function E_(e){return Be(e)&&32===e.length}function x_(e){return!!E_(e)&&e.compare(y_)<0}function I_(e){if(!Be(e))return!1;if(e.length<33)return!1;const t=e[0],r=e.slice(1,33);if(0===r.compare(v_))return!1;if(r.compare(b_)>=0)return!1;if((2===t||3===t)&&33===e.length){try{C_(e)}catch(e){return!1}return!0}const n=e.slice(33);return 0!==n.compare(v_)&&(!(n.compare(b_)>=0)&&(4===t&&65===e.length))}function k_(e){return 4!==e[0]}function P_(e){return!!E_(e)&&(e.compare(v_)>0&&e.compare(y_)<0)}function O_(e,t){return void 0===e&&void 0!==t?k_(t):void 0===e||e}function A_(e){return new uy(e)}function T_(e){return e.toArrayLike(re,"be",32)}function C_(e){return g_.curve.decodePoint(e)}function N_(e,t){return re.from(e._encode(t))}function R_(e,t,r){if(!E_(e))throw new TypeError("Expected Hash");if(!P_(t))throw new TypeError("Expected Private");if(void 0!==r&&!E_(r))throw new TypeError("Expected Extra Data (32 bytes)");const n=A_(t),i=A_(e);let o,a;m_(e,t,(function(e){const t=A_(e),r=S_.mul(t);return!r.isInfinity()&&(o=r.x.umod(w_),0!==o.isZero()&&(a=t.invm(w_).mul(i.add(n.mul(o))).umod(w_),0!==a.isZero()))}),P_,r),a.cmp(__)>0&&(a=w_.sub(a));const s=re.allocUnsafe(64);return T_(o).copy(s,0),T_(a).copy(s,32),s}var M_={isPoint:I_,isPointCompressed:function(e){return!!I_(e)&&k_(e)},isPrivate:P_,pointAdd:function(e,t,r){if(!I_(e))throw new TypeError("Expected Point");if(!I_(t))throw new TypeError("Expected Point");const n=C_(e),i=C_(t),o=n.add(i);return o.isInfinity()?null:N_(o,O_(r,e))},pointAddScalar:function(e,t,r){if(!I_(e))throw new TypeError("Expected Point");if(!x_(t))throw new TypeError("Expected Tweak");const n=O_(r,e),i=C_(e);if(0===t.compare(v_))return N_(i,n);const o=A_(t),a=S_.mul(o),s=i.add(a);return s.isInfinity()?null:N_(s,n)},pointCompress:function(e,t){if(!I_(e))throw new TypeError("Expected Point");const r=C_(e);if(r.isInfinity())throw new TypeError("Expected Point");return N_(r,O_(t,e))},pointFromScalar:function(e,t){if(!P_(e))throw new TypeError("Expected Private");const r=A_(e),n=S_.mul(r);return n.isInfinity()?null:N_(n,O_(t))},pointMultiply:function(e,t,r){if(!I_(e))throw new TypeError("Expected Point");if(!x_(t))throw new TypeError("Expected Tweak");const n=O_(r,e),i=C_(e),o=A_(t),a=i.mul(o);return a.isInfinity()?null:N_(a,n)},privateAdd:function(e,t){if(!P_(e))throw new TypeError("Expected Private");if(!x_(t))throw new TypeError("Expected Tweak");const r=A_(e),n=A_(t),i=T_(r.add(n).umod(w_));return P_(i)?i:null},privateSub:function(e,t){if(!P_(e))throw new TypeError("Expected Private");if(!x_(t))throw new TypeError("Expected Tweak");const r=A_(e),n=A_(t),i=T_(r.sub(n).umod(w_));return P_(i)?i:null},sign:function(e,t){return R_(e,t)},signWithEntropy:function(e,t,r){return R_(e,t,r)},verify:function(e,t,r,n){if(!E_(e))throw new TypeError("Expected Hash");if(!I_(t))throw new TypeError("Expected Point");if(!function(e){const t=e.slice(0,32),r=e.slice(32,64);return Be(e)&&64===e.length&&t.compare(y_)<0&&r.compare(y_)<0}(r))throw new TypeError("Expected Signature");const i=C_(t),o=A_(r.slice(0,32)),a=A_(r.slice(32,64));if(n&&a.cmp(__)>0)return!1;if(o.gtn(0)<=0)return!1;if(a.gtn(0)<=0)return!1;const s=A_(e),c=a.invm(w_),u=s.mul(c).umod(w_),l=o.mul(c).umod(w_),f=S_.mulAdd(u,i,l);return!f.isInfinity()&&f.x.umod(w_).eq(o)}},L_={Array:function(e){return null!=e&&e.constructor===Array},Boolean:function(e){return"boolean"==typeof e},Function:function(e){return"function"==typeof e},Nil:function(e){return null==e},Number:function(e){return"number"==typeof e},Object:function(e){return"object"==typeof e},String:function(e){return"string"==typeof e},"":function(){return!0}};for(var j_ in L_.Null=L_.Nil,L_)L_[j_].toJSON=function(e){return e}.bind(null,j_);var D_=L_;function B_(e){return e.name||e.toString().match(/function (.*?)\s*\(/)[1]}function U_(e){return D_.Nil(e)?"":B_(e.constructor)}function F_(e,t){Error.captureStackTrace&&Error.captureStackTrace(e,t)}function H_(e){return D_.Function(e)?e.toJSON?e.toJSON():B_(e):D_.Array(e)?"Array":e&&D_.Object(e)?"Object":void 0!==e?e:""}function V_(e,t,r){var n=function(e){return D_.Function(e)?"":D_.String(e)?JSON.stringify(e):e&&D_.Object(e)?"":e}(t);return"Expected "+H_(e)+", got"+(""!==r?" "+r:"")+(""!==n?" "+n:"")}function z_(e,t,r){r=r||U_(t),this.message=V_(e,t,r),F_(this,z_),this.__type=e,this.__value=t,this.__valueTypeName=r}function q_(e,t,r,n,i){e?(i=i||U_(n),this.message=function(e,t,r,n,i){var o='" of type ';return"key"===t&&(o='" with key type '),V_('property "'+H_(r)+o+H_(e),n,i)}(e,r,t,n,i)):this.message='Unexpected property "'+t+'"',F_(this,z_),this.__label=r,this.__property=t,this.__type=e,this.__value=n,this.__valueTypeName=i}z_.prototype=Object.create(Error.prototype),z_.prototype.constructor=z_,q_.prototype=Object.create(Error.prototype),q_.prototype.constructor=z_;var K_={TfTypeError:z_,TfPropertyTypeError:q_,tfCustomError:function(e,t){return new z_(e,{},t)},tfSubError:function(e,t,r){return e instanceof q_?(t=t+"."+e.__property,e=new q_(e.__type,t,e.__label,e.__value,e.__valueTypeName)):e instanceof z_&&(e=new q_(e.__type,t,r,e.__value,e.__valueTypeName)),F_(e),e},tfJSON:H_,getValueTypeName:U_};function $_(e){return Be(e)}function G_(e){return"string"==typeof e&&/^([0-9a-f]{2})+$/i.test(e)}function J_(e,t){var r=e.toJSON();function n(n){if(!e(n))return!1;if(n.length===t)return!0;throw K_.tfCustomError(r+"(Length: "+t+")",r+"(Length: "+n.length+")")}return n.toJSON=function(){return r},n}var W_=J_.bind(null,D_.Array),X_=J_.bind(null,$_),Q_=J_.bind(null,G_),Y_=J_.bind(null,D_.String);var Z_=Math.pow(2,53)-1;var eS={ArrayN:W_,Buffer:$_,BufferN:X_,Finite:function(e){return"number"==typeof e&&isFinite(e)},Hex:G_,HexN:Q_,Int8:function(e){return e<<24>>24===e},Int16:function(e){return e<<16>>16===e},Int32:function(e){return(0|e)===e},Int53:function(e){return"number"==typeof e&&e>=-Z_&&e<=Z_&&Math.floor(e)===e},Range:function(e,t,r){function n(n,i){return r(n,i)&&n>e&&n<t}return r=r||D_.Number,n.toJSON=function(){return`${r.toJSON()} between [${e}, ${t}]`},n},StringN:Y_,UInt8:function(e){return(255&e)===e},UInt16:function(e){return(65535&e)===e},UInt32:function(e){return e>>>0===e},UInt53:function(e){return"number"==typeof e&&e>=0&&e<=Z_&&Math.floor(e)===e}};for(var tS in eS)eS[tS].toJSON=function(e){return e}.bind(null,tS);var rS=eS,nS=K_.tfJSON,iS=K_.TfTypeError,oS=K_.TfPropertyTypeError,aS=K_.tfSubError,sS=K_.getValueTypeName,cS={arrayOf:function(e,t){function r(r,n){return!!D_.Array(r)&&(!D_.Nil(r)&&(!(void 0!==t.minLength&&r.length<t.minLength)&&(!(void 0!==t.maxLength&&r.length>t.maxLength)&&((void 0===t.length||r.length===t.length)&&r.every((function(t,r){try{return lS(e,t,n)}catch(e){throw aS(e,r)}}))))))}return e=uS(e),t=t||{},r.toJSON=function(){var r="["+nS(e)+"]";return void 0!==t.length?r+="{"+t.length+"}":void 0===t.minLength&&void 0===t.maxLength||(r+="{"+(void 0===t.minLength?0:t.minLength)+","+(void 0===t.maxLength?1/0:t.maxLength)+"}"),r},r},maybe:function e(t){function r(r,n){return D_.Nil(r)||t(r,n,e)}return t=uS(t),r.toJSON=function(){return"?"+nS(t)},r},map:function(e,t){function r(r,n){if(!D_.Object(r))return!1;if(D_.Nil(r))return!1;for(var i in r){try{t&&lS(t,i,n)}catch(e){throw aS(e,i,"key")}try{var o=r[i];lS(e,o,n)}catch(e){throw aS(e,i)}}return!0}return e=uS(e),t&&(t=uS(t)),r.toJSON=t?function(){return"{"+nS(t)+": "+nS(e)+"}"}:function(){return"{"+nS(e)+"}"},r},object:function(e){var t={};for(var r in e)t[r]=uS(e[r]);function n(e,r){if(!D_.Object(e))return!1;if(D_.Nil(e))return!1;var n;try{for(n in t){lS(t[n],e[n],r)}}catch(e){throw aS(e,n)}if(r)for(n in e)if(!t[n])throw new oS(void 0,n);return!0}return n.toJSON=function(){return nS(t)},n},anyOf:function(){var e=[].slice.call(arguments).map(uS);function t(t,r){return e.some((function(e){try{return lS(e,t,r)}catch(e){return!1}}))}return t.toJSON=function(){return e.map(nS).join("|")},t},allOf:function(){var e=[].slice.call(arguments).map(uS);function t(t,r){return e.every((function(e){try{return lS(e,t,r)}catch(e){return!1}}))}return t.toJSON=function(){return e.map(nS).join(" & ")},t},quacksLike:function(e){function t(t){return e===sS(t)}return t.toJSON=function(){return e},t},tuple:function(){var e=[].slice.call(arguments).map(uS);function t(t,r){return!D_.Nil(t)&&(!D_.Nil(t.length)&&((!r||t.length===e.length)&&e.every((function(e,n){try{return lS(e,t[n],r)}catch(e){throw aS(e,n)}}))))}return t.toJSON=function(){return"("+e.map(nS).join(", ")+")"},t},value:function(e){function t(t){return t===e}return t.toJSON=function(){return e},t}};function uS(e){if(D_.String(e))return"?"===e[0]?cS.maybe(e.slice(1)):D_[e]||cS.quacksLike(e);if(e&&D_.Object(e)){if(D_.Array(e)){if(1!==e.length)throw new TypeError("Expected compile() parameter of type Array of length 1");return cS.arrayOf(e[0])}return cS.object(e)}return D_.Function(e)?e:cS.value(e)}function lS(e,t,r,n){if(D_.Function(e)){if(e(t,r))return!0;throw new iS(n||e,t)}return lS(uS(e),t,r)}for(var fS in cS.oneOf=cS.anyOf,D_)lS[fS]=D_[fS];for(fS in cS)lS[fS]=cS[fS];for(fS in rS)lS[fS]=rS[fS];lS.compile=uS,lS.TfTypeError=iS,lS.TfPropertyTypeError=oS;var hS=lS;function dS(e,t){if(void 0!==t&&e[0]!==t)throw new Error("Invalid network version");if(33===e.length)return{version:e[0],privateKey:e.slice(1,33),compressed:!1};if(34!==e.length)throw new Error("Invalid WIF length");if(1!==e[33])throw new Error("Invalid compression flag");return{version:e[0],privateKey:e.slice(1,33),compressed:!0}}function pS(e,t,r){var n=new re(r?34:33);return n.writeUInt8(e,0),t.copy(n,1),r&&(n[33]=1),n}var mS={decode:function(e,t){return dS(cy.decode(e),t)},decodeRaw:dS,encode:function(e,t,r){return"number"==typeof e?cy.encode(pS(e,t,r)):cy.encode(pS(e.version,e.privateKey,e.compressed))},encodeRaw:pS},gS=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=hS.BufferN(32),n=hS.compile({wif:hS.UInt8,bip32:{public:hS.UInt32,private:hS.UInt32}}),i={messagePrefix:"Bitcoin Signed Message:\n",bech32:"bc",bip32:{public:76067358,private:76066276},pubKeyHash:0,scriptHash:5,wif:128},o=2147483648,a=Math.pow(2,31)-1;function s(e){return hS.String(e)&&null!==e.match(/^(m\/)?(\d+'?\/)*\d+'?$/)}function c(e){return hS.UInt32(e)&&e<=a}class u{constructor(e,t,r,i,o=0,a=0,s=0){this.__D=e,this.__Q=t,this.chainCode=r,this.network=i,this.__DEPTH=o,this.__INDEX=a,this.__PARENT_FINGERPRINT=s,hS(n,i),this.lowR=!1}get depth(){return this.__DEPTH}get index(){return this.__INDEX}get parentFingerprint(){return this.__PARENT_FINGERPRINT}get publicKey(){return void 0===this.__Q&&(this.__Q=M_.pointFromScalar(this.__D,!0)),this.__Q}get privateKey(){return this.__D}get identifier(){return ny.hash160(this.publicKey)}get fingerprint(){return this.identifier.slice(0,4)}isNeutered(){return void 0===this.__D}neutered(){return h(this.publicKey,this.chainCode,this.network,this.depth,this.index,this.parentFingerprint)}toBase58(){const e=this.network,t=this.isNeutered()?e.bip32.public:e.bip32.private,r=re.allocUnsafe(78);return r.writeUInt32BE(t,0),r.writeUInt8(this.depth,4),r.writeUInt32BE(this.parentFingerprint,5),r.writeUInt32BE(this.index,9),this.chainCode.copy(r,13),this.isNeutered()?this.publicKey.copy(r,45):(r.writeUInt8(0,45),this.privateKey.copy(r,46)),cy.encode(r)}toWIF(){if(!this.privateKey)throw new TypeError("Missing private key");return mS.encode(this.network.wif,this.privateKey,!0)}derive(e){hS(hS.UInt32,e);const t=e>=o,r=re.allocUnsafe(37);if(t){if(this.isNeutered())throw new TypeError("Missing private key for hardened child key");r[0]=0,this.privateKey.copy(r,1),r.writeUInt32BE(e,33)}else this.publicKey.copy(r,0),r.writeUInt32BE(e,33);const n=ny.hmacSHA512(this.chainCode,r),i=n.slice(0,32),a=n.slice(32);if(!M_.isPrivate(i))return this.derive(e+1);let s;if(this.isNeutered()){const t=M_.pointAddScalar(this.publicKey,i,!0);if(null===t)return this.derive(e+1);s=h(t,a,this.network,this.depth+1,e,this.fingerprint.readUInt32BE(0))}else{const t=M_.privateAdd(this.privateKey,i);if(null==t)return this.derive(e+1);s=f(t,a,this.network,this.depth+1,e,this.fingerprint.readUInt32BE(0))}return s}deriveHardened(e){return hS(c,e),this.derive(e+o)}derivePath(e){hS(s,e);let t=e.split("/");if("m"===t[0]){if(this.parentFingerprint)throw new TypeError("Expected master, got child");t=t.slice(1)}return t.reduce((e,t)=>{let r;return"'"===t.slice(-1)?(r=parseInt(t.slice(0,-1),10),e.deriveHardened(r)):(r=parseInt(t,10),e.derive(r))},this)}sign(e,t){if(!this.privateKey)throw new Error("Missing private key");if(void 0===t&&(t=this.lowR),!1===t)return M_.sign(e,this.privateKey);{let t=M_.sign(e,this.privateKey);const r=re.alloc(32,0);let n=0;for(;t[0]>127;)n++,r.writeUIntLE(n,0,6),t=M_.signWithEntropy(e,this.privateKey,r);return t}}verify(e,t){return M_.verify(e,this.publicKey,t)}}function l(e,t,r){return f(e,t,r)}function f(e,t,n,o,a,s){if(hS({privateKey:r,chainCode:r},{privateKey:e,chainCode:t}),n=n||i,!M_.isPrivate(e))throw new TypeError("Private key not in range [1, n)");return new u(e,void 0,t,n,o,a,s)}function h(e,t,n,o,a,s){if(hS({publicKey:hS.BufferN(33),chainCode:r},{publicKey:e,chainCode:t}),n=n||i,!M_.isPoint(e))throw new TypeError("Point is not on the curve");return new u(void 0,e,t,n,o,a,s)}t.fromBase58=function(e,t){const r=cy.decode(e);if(78!==r.length)throw new TypeError("Invalid buffer length");t=t||i;const n=r.readUInt32BE(0);if(n!==t.bip32.private&&n!==t.bip32.public)throw new TypeError("Invalid network version");const o=r[4],a=r.readUInt32BE(5);if(0===o&&0!==a)throw new TypeError("Invalid parent fingerprint");const s=r.readUInt32BE(9);if(0===o&&0!==s)throw new TypeError("Invalid index");const c=r.slice(13,45);let u;if(n===t.bip32.private){if(0!==r.readUInt8(45))throw new TypeError("Invalid private key");u=f(r.slice(46,78),c,t,o,s,a)}else{u=h(r.slice(45,78),c,t,o,s,a)}return u},t.fromPrivateKey=l,t.fromPublicKey=function(e,t,r){return h(e,t,r)},t.fromSeed=function(e,t){if(hS(hS.Buffer,e),e.length<16)throw new TypeError("Seed should be at least 128 bits");if(e.length>64)throw new TypeError("Seed should be at most 512 bits");t=t||i;const r=ny.hmacSHA512(re.from("Bitcoin seed","utf8"),e);return l(r.slice(0,32),r.slice(32),t)}}));er(gS);gS.fromBase58,gS.fromPrivateKey,gS.fromPublicKey,gS.fromSeed;var vS=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.fromSeed=gS.fromSeed,t.fromBase58=gS.fromBase58,t.fromPublicKey=gS.fromPublicKey,t.fromPrivateKey=gS.fromPrivateKey}));er(vS);vS.fromSeed,vS.fromBase58,vS.fromPublicKey,vS.fromPrivateKey;var yS=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.bitcoin={messagePrefix:"Bitcoin Signed Message:\n",bech32:"bc",bip32:{public:76067358,private:76066276},pubKeyHash:0,scriptHash:5,wif:128},t.regtest={messagePrefix:"Bitcoin Signed Message:\n",bech32:"bcrt",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239},t.testnet={messagePrefix:"Bitcoin Signed Message:\n",bech32:"tb",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239}}));er(yS);yS.bitcoin,yS.regtest,yS.testnet;var bS=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e,t,r){t=t||4,r=void 0===r||r;const n=e.length;if(0===n)return 0;if(n>t)throw new TypeError("Script number overflow");if(r&&0==(127&e[n-1])&&(n<=1||0==(128&e[n-2])))throw new Error("Non-minimally encoded script number");if(5===n){const t=e.readUInt32LE(0),r=e.readUInt8(4);return 128&r?-(4294967296*(-129&r)+t):4294967296*r+t}let i=0;for(let t=0;t<n;++t)i|=e[t]<<8*t;return 128&e[n-1]?-(i&~(128<<8*(n-1))):i},t.encode=function(e){let t=Math.abs(e);const r=(n=t)>2147483647?5:n>8388607?4:n>32767?3:n>127?2:n>0?1:0;var n;const i=re.allocUnsafe(r),o=e<0;for(let e=0;e<r;++e)i.writeUInt8(255&t,e),t>>=8;return 128&i[r-1]?i.writeUInt8(o?128:0,r-1):o&&(i[r-1]|=128),i}}));er(bS);bS.decode,bS.encode;var wS=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=Math.pow(2,31)-1;function n(e){return hS.String(e)&&!!e.match(/^(m\/)?(\d+'?\/)*\d+'?$/)}t.UInt31=function(e){return hS.UInt32(e)&&e<=r},t.BIP32Path=n,n.toJSON=()=>"BIP32 derivation path",t.Signer=function(e){return(hS.Buffer(e.publicKey)||"function"==typeof e.getPublicKey)&&"function"==typeof e.sign};t.Satoshi=function(e){return hS.UInt53(e)&&e<=21e14},t.ECPoint=hS.quacksLike("Point"),t.Network=hS.compile({messagePrefix:hS.oneOf(hS.Buffer,hS.String),bip32:{public:hS.UInt32,private:hS.UInt32},pubKeyHash:hS.UInt8,scriptHash:hS.UInt8,wif:hS.UInt8}),t.Buffer256bit=hS.BufferN(32),t.Hash160bit=hS.BufferN(20),t.Hash256bit=hS.BufferN(32),t.Number=hS.Number,t.Array=hS.Array,t.Boolean=hS.Boolean,t.String=hS.String,t.Buffer=hS.Buffer,t.Hex=hS.Hex,t.maybe=hS.maybe,t.tuple=hS.tuple,t.UInt8=hS.UInt8,t.UInt32=hS.UInt32,t.Function=hS.Function,t.BufferN=hS.BufferN,t.Null=hS.Null,t.oneOf=hS.oneOf}));er(wS);wS.UInt31,wS.BIP32Path,wS.Signer,wS.Satoshi,wS.ECPoint,wS.Network,wS.Buffer256bit,wS.Hash160bit,wS.Hash256bit,wS.Number,wS.Array,wS.Boolean,wS.String,wS.Buffer,wS.Hex,wS.maybe,wS.tuple,wS.UInt8,wS.UInt32,wS.Function,wS.BufferN,wS.Null,wS.oneOf;var _S=fc.Buffer;var SS={check:function(e){if(e.length<8)return!1;if(e.length>72)return!1;if(48!==e[0])return!1;if(e[1]!==e.length-2)return!1;if(2!==e[2])return!1;var t=e[3];if(0===t)return!1;if(5+t>=e.length)return!1;if(2!==e[4+t])return!1;var r=e[5+t];return 0!==r&&(6+t+r===e.length&&(!(128&e[4])&&(!(t>1&&0===e[4]&&!(128&e[5]))&&(!(128&e[t+6])&&!(r>1&&0===e[t+6]&&!(128&e[t+7]))))))},decode:function(e){if(e.length<8)throw new Error("DER sequence length is too short");if(e.length>72)throw new Error("DER sequence length is too long");if(48!==e[0])throw new Error("Expected DER sequence");if(e[1]!==e.length-2)throw new Error("DER sequence length is invalid");if(2!==e[2])throw new Error("Expected DER integer");var t=e[3];if(0===t)throw new Error("R length is zero");if(5+t>=e.length)throw new Error("R length is too long");if(2!==e[4+t])throw new Error("Expected DER integer (2)");var r=e[5+t];if(0===r)throw new Error("S length is zero");if(6+t+r!==e.length)throw new Error("S length is invalid");if(128&e[4])throw new Error("R value is negative");if(t>1&&0===e[4]&&!(128&e[5]))throw new Error("R value excessively padded");if(128&e[t+6])throw new Error("S value is negative");if(r>1&&0===e[t+6]&&!(128&e[t+7]))throw new Error("S value excessively padded");return{r:e.slice(4,4+t),s:e.slice(6+t)}},encode:function(e,t){var r=e.length,n=t.length;if(0===r)throw new Error("R length is zero");if(0===n)throw new Error("S length is zero");if(r>33)throw new Error("R length is too long");if(n>33)throw new Error("S length is too long");if(128&e[0])throw new Error("R value is negative");if(128&t[0])throw new Error("S value is negative");if(r>1&&0===e[0]&&!(128&e[1]))throw new Error("R value excessively padded");if(n>1&&0===t[0]&&!(128&t[1]))throw new Error("S value excessively padded");var i=_S.allocUnsafe(6+r+n);return i[0]=48,i[1]=i.length-2,i[2]=2,i[3]=e.length,e.copy(i,4),i[4+r]=2,i[5+r]=t.length,t.copy(i,6+r),i}},ES=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=re.alloc(1,0);function n(e){let t=0;for(;0===e[t];)++t;return t===e.length?r:128&(e=e.slice(t))[0]?re.concat([r,e],1+e.length):e}function i(e){0===e[0]&&(e=e.slice(1));const t=re.alloc(32,0),r=Math.max(0,32-e.length);return e.copy(t,r),t}t.decode=function(e){const t=e.readUInt8(e.length-1),r=-129&t;if(r<=0||r>=4)throw new Error("Invalid hashType "+t);const n=SS.decode(e.slice(0,-1)),o=i(n.r),a=i(n.s);return{signature:re.concat([o,a],64),hashType:t}},t.encode=function(e,t){hS({signature:wS.BufferN(64),hashType:wS.UInt8},{signature:e,hashType:t});const r=-129&t;if(r<=0||r>=4)throw new Error("Invalid hashType "+t);const i=re.allocUnsafe(1);i.writeUInt8(t,0);const o=n(e.slice(0,32)),a=n(e.slice(32,64));return re.concat([SS.encode(o,a),i])}}));er(ES);ES.decode,ES.encode;var xS={OP_FALSE:0,OP_0:0,OP_PUSHDATA1:76,OP_PUSHDATA2:77,OP_PUSHDATA4:78,OP_1NEGATE:79,OP_RESERVED:80,OP_TRUE:81,OP_1:81,OP_2:82,OP_3:83,OP_4:84,OP_5:85,OP_6:86,OP_7:87,OP_8:88,OP_9:89,OP_10:90,OP_11:91,OP_12:92,OP_13:93,OP_14:94,OP_15:95,OP_16:96,OP_NOP:97,OP_VER:98,OP_IF:99,OP_NOTIF:100,OP_VERIF:101,OP_VERNOTIF:102,OP_ELSE:103,OP_ENDIF:104,OP_VERIFY:105,OP_RETURN:106,OP_TOALTSTACK:107,OP_FROMALTSTACK:108,OP_2DROP:109,OP_2DUP:110,OP_3DUP:111,OP_2OVER:112,OP_2ROT:113,OP_2SWAP:114,OP_IFDUP:115,OP_DEPTH:116,OP_DROP:117,OP_DUP:118,OP_NIP:119,OP_OVER:120,OP_PICK:121,OP_ROLL:122,OP_ROT:123,OP_SWAP:124,OP_TUCK:125,OP_CAT:126,OP_SUBSTR:127,OP_LEFT:128,OP_RIGHT:129,OP_SIZE:130,OP_INVERT:131,OP_AND:132,OP_OR:133,OP_XOR:134,OP_EQUAL:135,OP_EQUALVERIFY:136,OP_RESERVED1:137,OP_RESERVED2:138,OP_1ADD:139,OP_1SUB:140,OP_2MUL:141,OP_2DIV:142,OP_NEGATE:143,OP_ABS:144,OP_NOT:145,OP_0NOTEQUAL:146,OP_ADD:147,OP_SUB:148,OP_MUL:149,OP_DIV:150,OP_MOD:151,OP_LSHIFT:152,OP_RSHIFT:153,OP_BOOLAND:154,OP_BOOLOR:155,OP_NUMEQUAL:156,OP_NUMEQUALVERIFY:157,OP_NUMNOTEQUAL:158,OP_LESSTHAN:159,OP_GREATERTHAN:160,OP_LESSTHANOREQUAL:161,OP_GREATERTHANOREQUAL:162,OP_MIN:163,OP_MAX:164,OP_WITHIN:165,OP_RIPEMD160:166,OP_SHA1:167,OP_SHA256:168,OP_HASH160:169,OP_HASH256:170,OP_CODESEPARATOR:171,OP_CHECKSIG:172,OP_CHECKSIGVERIFY:173,OP_CHECKMULTISIG:174,OP_CHECKMULTISIGVERIFY:175,OP_NOP1:176,OP_NOP2:177,OP_CHECKLOCKTIMEVERIFY:177,OP_NOP3:178,OP_CHECKSEQUENCEVERIFY:178,OP_NOP4:179,OP_NOP5:180,OP_NOP6:181,OP_NOP7:182,OP_NOP8:183,OP_NOP9:184,OP_NOP10:185,OP_PUBKEYHASH:253,OP_PUBKEY:254,OP_INVALIDOPCODE:255},IS=rr(Object.freeze({__proto__:null,OP_FALSE:0,OP_0:0,OP_PUSHDATA1:76,OP_PUSHDATA2:77,OP_PUSHDATA4:78,OP_1NEGATE:79,OP_RESERVED:80,OP_TRUE:81,OP_1:81,OP_2:82,OP_3:83,OP_4:84,OP_5:85,OP_6:86,OP_7:87,OP_8:88,OP_9:89,OP_10:90,OP_11:91,OP_12:92,OP_13:93,OP_14:94,OP_15:95,OP_16:96,OP_NOP:97,OP_VER:98,OP_IF:99,OP_NOTIF:100,OP_VERIF:101,OP_VERNOTIF:102,OP_ELSE:103,OP_ENDIF:104,OP_VERIFY:105,OP_RETURN:106,OP_TOALTSTACK:107,OP_FROMALTSTACK:108,OP_2DROP:109,OP_2DUP:110,OP_3DUP:111,OP_2OVER:112,OP_2ROT:113,OP_2SWAP:114,OP_IFDUP:115,OP_DEPTH:116,OP_DROP:117,OP_DUP:118,OP_NIP:119,OP_OVER:120,OP_PICK:121,OP_ROLL:122,OP_ROT:123,OP_SWAP:124,OP_TUCK:125,OP_CAT:126,OP_SUBSTR:127,OP_LEFT:128,OP_RIGHT:129,OP_SIZE:130,OP_INVERT:131,OP_AND:132,OP_OR:133,OP_XOR:134,OP_EQUAL:135,OP_EQUALVERIFY:136,OP_RESERVED1:137,OP_RESERVED2:138,OP_1ADD:139,OP_1SUB:140,OP_2MUL:141,OP_2DIV:142,OP_NEGATE:143,OP_ABS:144,OP_NOT:145,OP_0NOTEQUAL:146,OP_ADD:147,OP_SUB:148,OP_MUL:149,OP_DIV:150,OP_MOD:151,OP_LSHIFT:152,OP_RSHIFT:153,OP_BOOLAND:154,OP_BOOLOR:155,OP_NUMEQUAL:156,OP_NUMEQUALVERIFY:157,OP_NUMNOTEQUAL:158,OP_LESSTHAN:159,OP_GREATERTHAN:160,OP_LESSTHANOREQUAL:161,OP_GREATERTHANOREQUAL:162,OP_MIN:163,OP_MAX:164,OP_WITHIN:165,OP_RIPEMD160:166,OP_SHA1:167,OP_SHA256:168,OP_HASH160:169,OP_HASH256:170,OP_CODESEPARATOR:171,OP_CHECKSIG:172,OP_CHECKSIGVERIFY:173,OP_CHECKMULTISIG:174,OP_CHECKMULTISIGVERIFY:175,OP_NOP1:176,OP_NOP2:177,OP_CHECKLOCKTIMEVERIFY:177,OP_NOP3:178,OP_CHECKSEQUENCEVERIFY:178,OP_NOP4:179,OP_NOP5:180,OP_NOP6:181,OP_NOP7:182,OP_NOP8:183,OP_NOP9:184,OP_NOP10:185,OP_PUBKEYHASH:253,OP_PUBKEY:254,OP_INVALIDOPCODE:255,default:xS}));function kS(e){return e<IS.OP_PUSHDATA1?1:e<=255?2:e<=65535?3:5}var PS={encodingLength:kS,encode:function(e,t,r){var n=kS(t);return 1===n?e.writeUInt8(t,r):2===n?(e.writeUInt8(IS.OP_PUSHDATA1,r),e.writeUInt8(t,r+1)):3===n?(e.writeUInt8(IS.OP_PUSHDATA2,r),e.writeUInt16LE(t,r+1)):(e.writeUInt8(IS.OP_PUSHDATA4,r),e.writeUInt32LE(t,r+1)),n},decode:function(e,t){var r,n,i=e.readUInt8(t);if(i<IS.OP_PUSHDATA1)r=i,n=1;else if(i===IS.OP_PUSHDATA1){if(t+2>e.length)return null;r=e.readUInt8(t+1),n=2}else if(i===IS.OP_PUSHDATA2){if(t+3>e.length)return null;r=e.readUInt16LE(t+1),n=3}else{if(t+5>e.length)return null;if(i!==IS.OP_PUSHDATA4)throw new Error("Unexpected opcode");r=e.readUInt32LE(t+1),n=5}return{opcode:i,number:r,size:n}}},OS={};for(var AS in IS){OS[IS[AS]]=AS}var TS=OS,CS=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.OPS=IS;const r=t.OPS.OP_RESERVED;function n(e){return wS.Buffer(e)||function(e){return wS.Number(e)&&(e===t.OPS.OP_0||e>=t.OPS.OP_1&&e<=t.OPS.OP_16||e===t.OPS.OP_1NEGATE)}(e)}function i(e){return wS.Array(e)&&e.every(n)}function o(e){return 0===e.length?t.OPS.OP_0:1===e.length?e[0]>=1&&e[0]<=16?r+e[0]:129===e[0]?t.OPS.OP_1NEGATE:void 0:void 0}function a(e){return Be(e)}function s(e){return Be(e)}function c(e){if(a(e))return e;hS(wS.Array,e);const t=e.reduce((e,t)=>s(t)?1===t.length&&void 0!==o(t)?e+1:e+PS.encodingLength(t.length)+t.length:e+1,0),r=re.allocUnsafe(t);let n=0;if(e.forEach(e=>{if(s(e)){const t=o(e);if(void 0!==t)return r.writeUInt8(t,n),void(n+=1);n+=PS.encode(r,e.length,n),e.copy(r,n),n+=e.length}else r.writeUInt8(e,n),n+=1}),n!==r.length)throw new Error("Could not decode chunks");return r}function u(e){if(r=e,wS.Array(r))return e;var r;hS(wS.Buffer,e);const n=[];let i=0;for(;i<e.length;){const r=e[i];if(r>t.OPS.OP_0&&r<=t.OPS.OP_PUSHDATA4){const t=PS.decode(e,i);if(null===t)return null;if(i+=t.size,i+t.number>e.length)return null;const r=e.slice(i,i+t.number);i+=t.number;const a=o(r);void 0!==a?n.push(a):n.push(r)}else n.push(r),i+=1}return n}function l(e){const t=-129&e;return t>0&&t<4}t.isPushOnly=i,t.compile=c,t.decompile=u,t.toASM=function(e){return a(e)&&(e=u(e)),e.map(e=>{if(s(e)){const t=o(e);if(void 0===t)return e.toString("hex");e=t}return TS[e]}).join(" ")},t.fromASM=function(e){return hS(wS.String,e),c(e.split(" ").map(e=>void 0!==t.OPS[e]?t.OPS[e]:(hS(wS.Hex,e),re.from(e,"hex"))))},t.toStack=function(e){return e=u(e),hS(i,e),e.map(e=>s(e)?e:e===t.OPS.OP_0?re.allocUnsafe(0):bS.encode(e-r))},t.isCanonicalPubKey=function(e){return M_.isPoint(e)},t.isDefinedHashType=l,t.isCanonicalScriptSignature=function(e){return!!Be(e)&&(!!l(e[e.length-1])&&SS.check(e.slice(0,-1)))},t.number=bS,t.signature=ES}));er(CS);CS.OPS,CS.isPushOnly,CS.compile,CS.decompile,CS.toASM,CS.fromASM,CS.toStack,CS.isCanonicalPubKey,CS.isDefinedHashType,CS.isCanonicalScriptSignature,CS.number,CS.signature;var NS=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.prop=function(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get(){const e=r.call(this);return this[t]=e,e},set(e){Object.defineProperty(this,t,{configurable:!0,enumerable:!0,value:e,writable:!0})}})},t.value=function(e){let t;return()=>(void 0!==t||(t=e()),t)}}));er(NS);NS.prop,NS.value;var RS=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=CS.OPS;t.p2data=function(e,t){if(!e.data&&!e.output)throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),hS({network:hS.maybe(hS.Object),output:hS.maybe(hS.Buffer),data:hS.maybe(hS.arrayOf(hS.Buffer))},e);const n={name:"embed",network:e.network||yS.bitcoin};if(NS.prop(n,"output",()=>{if(e.data)return CS.compile([r.OP_RETURN].concat(e.data))}),NS.prop(n,"data",()=>{if(e.output)return CS.decompile(e.output).slice(1)}),t.validate&&e.output){const t=CS.decompile(e.output);if(t[0]!==r.OP_RETURN)throw new TypeError("Output is invalid");if(!t.slice(1).every(hS.Buffer))throw new TypeError("Output is invalid");if(e.data&&!function(e,t){return e.length===t.length&&e.every((e,r)=>e.equals(t[r]))}(e.data,n.data))throw new TypeError("Data mismatch")}return Object.assign(n,e)}}));er(RS);RS.p2data;var MS=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=CS.OPS,n=r.OP_RESERVED;function i(e,t){return e.length===t.length&&e.every((e,r)=>e.equals(t[r]))}t.p2ms=function(e,t){if(!(e.input||e.output||e.pubkeys&&void 0!==e.m||e.signatures))throw new TypeError("Not enough data");function o(e){return CS.isCanonicalScriptSignature(e)||void 0!==(t.allowIncomplete&&e===r.OP_0)}t=Object.assign({validate:!0},t||{}),hS({network:hS.maybe(hS.Object),m:hS.maybe(hS.Number),n:hS.maybe(hS.Number),output:hS.maybe(hS.Buffer),pubkeys:hS.maybe(hS.arrayOf(M_.isPoint)),signatures:hS.maybe(hS.arrayOf(o)),input:hS.maybe(hS.Buffer)},e);const a={network:e.network||yS.bitcoin};let s=[],c=!1;function u(e){c||(c=!0,s=CS.decompile(e),a.m=s[0]-n,a.n=s[s.length-2]-n,a.pubkeys=s.slice(1,-2))}if(NS.prop(a,"output",()=>{if(e.m&&a.n&&e.pubkeys)return CS.compile([].concat(n+e.m,e.pubkeys,n+a.n,r.OP_CHECKMULTISIG))}),NS.prop(a,"m",()=>{if(a.output)return u(a.output),a.m}),NS.prop(a,"n",()=>{if(a.pubkeys)return a.pubkeys.length}),NS.prop(a,"pubkeys",()=>{if(e.output)return u(e.output),a.pubkeys}),NS.prop(a,"signatures",()=>{if(e.input)return CS.decompile(e.input).slice(1)}),NS.prop(a,"input",()=>{if(e.signatures)return CS.compile([r.OP_0].concat(e.signatures))}),NS.prop(a,"witness",()=>{if(a.input)return[]}),NS.prop(a,"name",()=>{if(a.m&&a.n)return`p2ms(${a.m} of ${a.n})`}),t.validate){if(e.output){if(u(e.output),!hS.Number(s[0]))throw new TypeError("Output is invalid");if(!hS.Number(s[s.length-2]))throw new TypeError("Output is invalid");if(s[s.length-1]!==r.OP_CHECKMULTISIG)throw new TypeError("Output is invalid");if(a.m<=0||a.n>16||a.m>a.n||a.n!==s.length-3)throw new TypeError("Output is invalid");if(!a.pubkeys.every(e=>M_.isPoint(e)))throw new TypeError("Output is invalid");if(void 0!==e.m&&e.m!==a.m)throw new TypeError("m mismatch");if(void 0!==e.n&&e.n!==a.n)throw new TypeError("n mismatch");if(e.pubkeys&&!i(e.pubkeys,a.pubkeys))throw new TypeError("Pubkeys mismatch")}if(e.pubkeys){if(void 0!==e.n&&e.n!==e.pubkeys.length)throw new TypeError("Pubkey count mismatch");if(a.n=e.pubkeys.length,a.n<a.m)throw new TypeError("Pubkey count cannot be less than m")}if(e.signatures){if(e.signatures.length<a.m)throw new TypeError("Not enough signatures provided");if(e.signatures.length>a.m)throw new TypeError("Too many signatures provided")}if(e.input){if(e.input[0]!==r.OP_0)throw new TypeError("Input is invalid");if(0===a.signatures.length||!a.signatures.every(o))throw new TypeError("Input has invalid signature(s)");if(e.signatures&&!i(e.signatures,a.signatures))throw new TypeError("Signature mismatch");if(void 0!==e.m&&e.m!==e.signatures.length)throw new TypeError("Signature count mismatch")}}return Object.assign(a,e)}}));er(MS);MS.p2ms;var LS=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=CS.OPS;t.p2pk=function(e,t){if(!(e.input||e.output||e.pubkey||e.input||e.signature))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),hS({network:hS.maybe(hS.Object),output:hS.maybe(hS.Buffer),pubkey:hS.maybe(M_.isPoint),signature:hS.maybe(CS.isCanonicalScriptSignature),input:hS.maybe(hS.Buffer)},e);const n=NS.value(()=>CS.decompile(e.input)),i={name:"p2pk",network:e.network||yS.bitcoin};if(NS.prop(i,"output",()=>{if(e.pubkey)return CS.compile([e.pubkey,r.OP_CHECKSIG])}),NS.prop(i,"pubkey",()=>{if(e.output)return e.output.slice(1,-1)}),NS.prop(i,"signature",()=>{if(e.input)return n()[0]}),NS.prop(i,"input",()=>{if(e.signature)return CS.compile([e.signature])}),NS.prop(i,"witness",()=>{if(i.input)return[]}),t.validate){if(e.output){if(e.output[e.output.length-1]!==r.OP_CHECKSIG)throw new TypeError("Output is invalid");if(!M_.isPoint(i.pubkey))throw new TypeError("Output pubkey is invalid");if(e.pubkey&&!e.pubkey.equals(i.pubkey))throw new TypeError("Pubkey mismatch")}if(e.signature&&e.input&&!e.input.equals(i.input))throw new TypeError("Signature mismatch");if(e.input){if(1!==n().length)throw new TypeError("Input is invalid");if(!CS.isCanonicalScriptSignature(i.signature))throw new TypeError("Input has invalid signature")}}return Object.assign(i,e)}}));er(LS);LS.p2pk;var jS=tr((function(e,t){function r(e){try{return Gv("rmd160").update(e).digest()}catch(t){return Gv("ripemd160").update(e).digest()}}function n(e){return Gv("sha256").update(e).digest()}Object.defineProperty(t,"__esModule",{value:!0}),t.ripemd160=r,t.sha1=function(e){return Gv("sha1").update(e).digest()},t.sha256=n,t.hash160=function(e){return r(n(e))},t.hash256=function(e){return n(n(e))}}));er(jS);jS.ripemd160,jS.sha1,jS.sha256,jS.hash160,jS.hash256;var DS=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=CS.OPS;t.p2pkh=function(e,t){if(!(e.address||e.hash||e.output||e.pubkey||e.input))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),hS({network:hS.maybe(hS.Object),address:hS.maybe(hS.String),hash:hS.maybe(hS.BufferN(20)),output:hS.maybe(hS.BufferN(25)),pubkey:hS.maybe(M_.isPoint),signature:hS.maybe(CS.isCanonicalScriptSignature),input:hS.maybe(hS.Buffer)},e);const n=NS.value(()=>{const t=cy.decode(e.address);return{version:t.readUInt8(0),hash:t.slice(1)}}),i=NS.value(()=>CS.decompile(e.input)),o=e.network||yS.bitcoin,a={name:"p2pkh",network:o};if(NS.prop(a,"address",()=>{if(!a.hash)return;const e=re.allocUnsafe(21);return e.writeUInt8(o.pubKeyHash,0),a.hash.copy(e,1),cy.encode(e)}),NS.prop(a,"hash",()=>e.output?e.output.slice(3,23):e.address?n().hash:e.pubkey||a.pubkey?jS.hash160(e.pubkey||a.pubkey):void 0),NS.prop(a,"output",()=>{if(a.hash)return CS.compile([r.OP_DUP,r.OP_HASH160,a.hash,r.OP_EQUALVERIFY,r.OP_CHECKSIG])}),NS.prop(a,"pubkey",()=>{if(e.input)return i()[1]}),NS.prop(a,"signature",()=>{if(e.input)return i()[0]}),NS.prop(a,"input",()=>{if(e.pubkey&&e.signature)return CS.compile([e.signature,e.pubkey])}),NS.prop(a,"witness",()=>{if(a.input)return[]}),t.validate){let t=re.from([]);if(e.address){if(n().version!==o.pubKeyHash)throw new TypeError("Invalid version or Network mismatch");if(20!==n().hash.length)throw new TypeError("Invalid address");t=n().hash}if(e.hash){if(t.length>0&&!t.equals(e.hash))throw new TypeError("Hash mismatch");t=e.hash}if(e.output){if(25!==e.output.length||e.output[0]!==r.OP_DUP||e.output[1]!==r.OP_HASH160||20!==e.output[2]||e.output[23]!==r.OP_EQUALVERIFY||e.output[24]!==r.OP_CHECKSIG)throw new TypeError("Output is invalid");const n=e.output.slice(3,23);if(t.length>0&&!t.equals(n))throw new TypeError("Hash mismatch");t=n}if(e.pubkey){const r=jS.hash160(e.pubkey);if(t.length>0&&!t.equals(r))throw new TypeError("Hash mismatch");t=r}if(e.input){const r=i();if(2!==r.length)throw new TypeError("Input is invalid");if(!CS.isCanonicalScriptSignature(r[0]))throw new TypeError("Input has invalid signature");if(!M_.isPoint(r[1]))throw new TypeError("Input has invalid pubkey");if(e.signature&&!e.signature.equals(r[0]))throw new TypeError("Signature mismatch");if(e.pubkey&&!e.pubkey.equals(r[1]))throw new TypeError("Pubkey mismatch");const n=jS.hash160(r[1]);if(t.length>0&&!t.equals(n))throw new TypeError("Hash mismatch")}}return Object.assign(a,e)}}));er(DS);DS.p2pkh;var BS=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=CS.OPS;t.p2sh=function(e,t){if(!(e.address||e.hash||e.output||e.redeem||e.input))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),hS({network:hS.maybe(hS.Object),address:hS.maybe(hS.String),hash:hS.maybe(hS.BufferN(20)),output:hS.maybe(hS.BufferN(23)),redeem:hS.maybe({network:hS.maybe(hS.Object),output:hS.maybe(hS.Buffer),input:hS.maybe(hS.Buffer),witness:hS.maybe(hS.arrayOf(hS.Buffer))}),input:hS.maybe(hS.Buffer),witness:hS.maybe(hS.arrayOf(hS.Buffer))},e);let n=e.network;n||(n=e.redeem&&e.redeem.network||yS.bitcoin);const i={network:n},o=NS.value(()=>{const t=cy.decode(e.address);return{version:t.readUInt8(0),hash:t.slice(1)}}),a=NS.value(()=>CS.decompile(e.input)),s=NS.value(()=>{const t=a();return{network:n,output:t[t.length-1],input:CS.compile(t.slice(0,-1)),witness:e.witness||[]}});if(NS.prop(i,"address",()=>{if(!i.hash)return;const e=re.allocUnsafe(21);return e.writeUInt8(i.network.scriptHash,0),i.hash.copy(e,1),cy.encode(e)}),NS.prop(i,"hash",()=>e.output?e.output.slice(2,22):e.address?o().hash:i.redeem&&i.redeem.output?jS.hash160(i.redeem.output):void 0),NS.prop(i,"output",()=>{if(i.hash)return CS.compile([r.OP_HASH160,i.hash,r.OP_EQUAL])}),NS.prop(i,"redeem",()=>{if(e.input)return s()}),NS.prop(i,"input",()=>{if(e.redeem&&e.redeem.input&&e.redeem.output)return CS.compile([].concat(CS.decompile(e.redeem.input),e.redeem.output))}),NS.prop(i,"witness",()=>i.redeem&&i.redeem.witness?i.redeem.witness:i.input?[]:void 0),NS.prop(i,"name",()=>{const e=["p2sh"];return void 0!==i.redeem&&e.push(i.redeem.name),e.join("-")}),t.validate){let t=re.from([]);if(e.address){if(o().version!==n.scriptHash)throw new TypeError("Invalid version or Network mismatch");if(20!==o().hash.length)throw new TypeError("Invalid address");t=o().hash}if(e.hash){if(t.length>0&&!t.equals(e.hash))throw new TypeError("Hash mismatch");t=e.hash}if(e.output){if(23!==e.output.length||e.output[0]!==r.OP_HASH160||20!==e.output[1]||e.output[22]!==r.OP_EQUAL)throw new TypeError("Output is invalid");const n=e.output.slice(2,22);if(t.length>0&&!t.equals(n))throw new TypeError("Hash mismatch");t=n}const i=e=>{if(e.output){const r=CS.decompile(e.output);if(!r||r.length<1)throw new TypeError("Redeem.output too short");const n=jS.hash160(e.output);if(t.length>0&&!t.equals(n))throw new TypeError("Hash mismatch");t=n}if(e.input){const t=e.input.length>0,r=e.witness&&e.witness.length>0;if(!t&&!r)throw new TypeError("Empty input");if(t&&r)throw new TypeError("Input and witness provided");if(t){const t=CS.decompile(e.input);if(!CS.isPushOnly(t))throw new TypeError("Non push-only scriptSig")}}};if(e.input){const e=a();if(!e||e.length<1)throw new TypeError("Input too short");if(!Be(s().output))throw new TypeError("Input is invalid");i(s())}if(e.redeem){if(e.redeem.network&&e.redeem.network!==n)throw new TypeError("Network mismatch");if(e.input){const t=s();if(e.redeem.output&&!e.redeem.output.equals(t.output))throw new TypeError("Redeem.output mismatch");if(e.redeem.input&&!e.redeem.input.equals(t.input))throw new TypeError("Redeem.input mismatch")}i(e.redeem)}if(e.witness&&e.redeem&&e.redeem.witness&&!function(e,t){return e.length===t.length&&e.every((e,r)=>e.equals(t[r]))}(e.redeem.witness,e.witness))throw new TypeError("Witness and redeem.witness mismatch")}return Object.assign(i,e)}}));er(BS);BS.p2sh;for(var US="qpzry9x8gf2tvdw0s3jn54khce6mua7l",FS={},HS=0;HS<US.length;HS++){var VS=US.charAt(HS);if(void 0!==FS[VS])throw new TypeError(VS+" is ambiguous");FS[VS]=HS}function zS(e){var t=e>>25;return(33554431&e)<<5^996825010&-(t>>0&1)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function qS(e){for(var t=1,r=0;r<e.length;++r){var n=e.charCodeAt(r);if(n<33||n>126)return"Invalid prefix ("+e+")";t=zS(t)^n>>5}for(t=zS(t),r=0;r<e.length;++r){var i=e.charCodeAt(r);t=zS(t)^31&i}return t}function KS(e,t){if(t=t||90,e.length<8)return e+" too short";if(e.length>t)return"Exceeds length limit";var r=e.toLowerCase(),n=e.toUpperCase();if(e!==r&&e!==n)return"Mixed-case string "+e;var i=(e=r).lastIndexOf("1");if(-1===i)return"No separator character for "+e;if(0===i)return"Missing prefix for "+e;var o=e.slice(0,i),a=e.slice(i+1);if(a.length<6)return"Data too short";var s=qS(o);if("string"==typeof s)return s;for(var c=[],u=0;u<a.length;++u){var l=a.charAt(u),f=FS[l];if(void 0===f)return"Unknown character "+l;s=zS(s)^f,u+6>=a.length||c.push(f)}return 1!==s?"Invalid checksum for "+e:{prefix:o,words:c}}function $S(e,t,r,n){for(var i=0,o=0,a=(1<<r)-1,s=[],c=0;c<e.length;++c)for(i=i<<t|e[c],o+=t;o>=r;)o-=r,s.push(i>>o&a);if(n)o>0&&s.push(i<<r-o&a);else{if(o>=t)return"Excess padding";if(i<<r-o&a)return"Non-zero padding"}return s}var GS={decodeUnsafe:function(){var e=KS.apply(null,arguments);if("object"==typeof e)return e},decode:function(e){var t=KS.apply(null,arguments);if("object"==typeof t)return t;throw new Error(t)},encode:function(e,t,r){if(r=r||90,e.length+7+t.length>r)throw new TypeError("Exceeds length limit");var n=qS(e=e.toLowerCase());if("string"==typeof n)throw new Error(n);for(var i=e+"1",o=0;o<t.length;++o){var a=t[o];if(a>>5!=0)throw new Error("Non 5-bit word");n=zS(n)^a,i+=US.charAt(a)}for(o=0;o<6;++o)n=zS(n);for(n^=1,o=0;o<6;++o){i+=US.charAt(n>>5*(5-o)&31)}return i},toWordsUnsafe:function(e){var t=$S(e,8,5,!0);if(Array.isArray(t))return t},toWords:function(e){var t=$S(e,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)},fromWordsUnsafe:function(e){var t=$S(e,5,8,!1);if(Array.isArray(t))return t},fromWords:function(e){var t=$S(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}},JS=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=CS.OPS,n=re.alloc(0);t.p2wpkh=function(e,t){if(!(e.address||e.hash||e.output||e.pubkey||e.witness))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),hS({address:hS.maybe(hS.String),hash:hS.maybe(hS.BufferN(20)),input:hS.maybe(hS.BufferN(0)),network:hS.maybe(hS.Object),output:hS.maybe(hS.BufferN(22)),pubkey:hS.maybe(M_.isPoint),signature:hS.maybe(CS.isCanonicalScriptSignature),witness:hS.maybe(hS.arrayOf(hS.Buffer))},e);const i=NS.value(()=>{const t=GS.decode(e.address),r=t.words.shift(),n=GS.fromWords(t.words);return{version:r,prefix:t.prefix,data:re.from(n)}}),o=e.network||yS.bitcoin,a={name:"p2wpkh",network:o};if(NS.prop(a,"address",()=>{if(!a.hash)return;const e=GS.toWords(a.hash);return e.unshift(0),GS.encode(o.bech32,e)}),NS.prop(a,"hash",()=>e.output?e.output.slice(2,22):e.address?i().data:e.pubkey||a.pubkey?jS.hash160(e.pubkey||a.pubkey):void 0),NS.prop(a,"output",()=>{if(a.hash)return CS.compile([r.OP_0,a.hash])}),NS.prop(a,"pubkey",()=>e.pubkey?e.pubkey:e.witness?e.witness[1]:void 0),NS.prop(a,"signature",()=>{if(e.witness)return e.witness[0]}),NS.prop(a,"input",()=>{if(a.witness)return n}),NS.prop(a,"witness",()=>{if(e.pubkey&&e.signature)return[e.signature,e.pubkey]}),t.validate){let t=re.from([]);if(e.address){if(o&&o.bech32!==i().prefix)throw new TypeError("Invalid prefix or Network mismatch");if(0!==i().version)throw new TypeError("Invalid address version");if(20!==i().data.length)throw new TypeError("Invalid address data");t=i().data}if(e.hash){if(t.length>0&&!t.equals(e.hash))throw new TypeError("Hash mismatch");t=e.hash}if(e.output){if(22!==e.output.length||e.output[0]!==r.OP_0||20!==e.output[1])throw new TypeError("Output is invalid");if(t.length>0&&!t.equals(e.output.slice(2)))throw new TypeError("Hash mismatch");t=e.output.slice(2)}if(e.pubkey){const r=jS.hash160(e.pubkey);if(t.length>0&&!t.equals(r))throw new TypeError("Hash mismatch");if(t=r,!M_.isPoint(e.pubkey)||33!==e.pubkey.length)throw new TypeError("Invalid pubkey for p2wpkh")}if(e.witness){if(2!==e.witness.length)throw new TypeError("Witness is invalid");if(!CS.isCanonicalScriptSignature(e.witness[0]))throw new TypeError("Witness has invalid signature");if(!M_.isPoint(e.witness[1])||33!==e.witness[1].length)throw new TypeError("Witness has invalid pubkey");if(e.signature&&!e.signature.equals(e.witness[0]))throw new TypeError("Signature mismatch");if(e.pubkey&&!e.pubkey.equals(e.witness[1]))throw new TypeError("Pubkey mismatch");const r=jS.hash160(e.witness[1]);if(t.length>0&&!t.equals(r))throw new TypeError("Hash mismatch")}}return Object.assign(a,e)}}));er(JS);JS.p2wpkh;var WS=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=CS.OPS,n=re.alloc(0);function i(e){return!(!Be(e)||65!==e.length||4!==e[0]||!M_.isPoint(e))}t.p2wsh=function(e,t){if(!(e.address||e.hash||e.output||e.redeem||e.witness))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),hS({network:hS.maybe(hS.Object),address:hS.maybe(hS.String),hash:hS.maybe(hS.BufferN(32)),output:hS.maybe(hS.BufferN(34)),redeem:hS.maybe({input:hS.maybe(hS.Buffer),network:hS.maybe(hS.Object),output:hS.maybe(hS.Buffer),witness:hS.maybe(hS.arrayOf(hS.Buffer))}),input:hS.maybe(hS.BufferN(0)),witness:hS.maybe(hS.arrayOf(hS.Buffer))},e);const o=NS.value(()=>{const t=GS.decode(e.address),r=t.words.shift(),n=GS.fromWords(t.words);return{version:r,prefix:t.prefix,data:re.from(n)}}),a=NS.value(()=>CS.decompile(e.redeem.input));let s=e.network;s||(s=e.redeem&&e.redeem.network||yS.bitcoin);const c={network:s};if(NS.prop(c,"address",()=>{if(!c.hash)return;const e=GS.toWords(c.hash);return e.unshift(0),GS.encode(s.bech32,e)}),NS.prop(c,"hash",()=>e.output?e.output.slice(2):e.address?o().data:c.redeem&&c.redeem.output?jS.sha256(c.redeem.output):void 0),NS.prop(c,"output",()=>{if(c.hash)return CS.compile([r.OP_0,c.hash])}),NS.prop(c,"redeem",()=>{if(e.witness)return{output:e.witness[e.witness.length-1],input:n,witness:e.witness.slice(0,-1)}}),NS.prop(c,"input",()=>{if(c.witness)return n}),NS.prop(c,"witness",()=>{if(e.redeem&&e.redeem.input&&e.redeem.input.length>0&&e.redeem.output&&e.redeem.output.length>0){const t=CS.toStack(a());return c.redeem=Object.assign({witness:t},e.redeem),c.redeem.input=n,[].concat(t,e.redeem.output)}if(e.redeem&&e.redeem.output&&e.redeem.witness)return[].concat(e.redeem.witness,e.redeem.output)}),NS.prop(c,"name",()=>{const e=["p2wsh"];return void 0!==c.redeem&&e.push(c.redeem.name),e.join("-")}),t.validate){let t=re.from([]);if(e.address){if(o().prefix!==s.bech32)throw new TypeError("Invalid prefix or Network mismatch");if(0!==o().version)throw new TypeError("Invalid address version");if(32!==o().data.length)throw new TypeError("Invalid address data");t=o().data}if(e.hash){if(t.length>0&&!t.equals(e.hash))throw new TypeError("Hash mismatch");t=e.hash}if(e.output){if(34!==e.output.length||e.output[0]!==r.OP_0||32!==e.output[1])throw new TypeError("Output is invalid");const n=e.output.slice(2);if(t.length>0&&!t.equals(n))throw new TypeError("Hash mismatch");t=n}if(e.redeem){if(e.redeem.network&&e.redeem.network!==s)throw new TypeError("Network mismatch");if(e.redeem.input&&e.redeem.input.length>0&&e.redeem.witness&&e.redeem.witness.length>0)throw new TypeError("Ambiguous witness source");if(e.redeem.output){if(0===CS.decompile(e.redeem.output).length)throw new TypeError("Redeem.output is invalid");const r=jS.sha256(e.redeem.output);if(t.length>0&&!t.equals(r))throw new TypeError("Hash mismatch");t=r}if(e.redeem.input&&!CS.isPushOnly(a()))throw new TypeError("Non push-only scriptSig");if(e.witness&&e.redeem.witness&&!function(e,t){return e.length===t.length&&e.every((e,r)=>e.equals(t[r]))}(e.witness,e.redeem.witness))throw new TypeError("Witness and redeem.witness mismatch");if(e.redeem.input&&a().some(i)||e.redeem.output&&(CS.decompile(e.redeem.output)||[]).some(i))throw new TypeError("redeem.input or redeem.output contains uncompressed pubkey")}if(e.witness&&e.witness.length>0){const t=e.witness[e.witness.length-1];if(e.redeem&&e.redeem.output&&!e.redeem.output.equals(t))throw new TypeError("Witness and redeem.output mismatch");if(e.witness.some(i)||(CS.decompile(t)||[]).some(i))throw new TypeError("Witness contains uncompressed pubkey")}}return Object.assign(c,e)}}));er(WS);WS.p2wsh;var XS=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.embed=RS.p2data,t.p2ms=MS.p2ms,t.p2pk=LS.p2pk,t.p2pkh=DS.p2pkh,t.p2sh=BS.p2sh,t.p2wpkh=JS.p2wpkh,t.p2wsh=WS.p2wsh}));er(XS);XS.embed,XS.p2ms,XS.p2pk,XS.p2pkh,XS.p2sh,XS.p2wpkh,XS.p2wsh;var QS=tr((function(e,t){function r(e){const t=cy.decode(e);if(t.length<21)throw new TypeError(e+" is too short");if(t.length>21)throw new TypeError(e+" is too long");return{version:t.readUInt8(0),hash:t.slice(1)}}function n(e){const t=GS.decode(e),r=GS.fromWords(t.words.slice(1));return{version:t.words[0],prefix:t.prefix,data:re.from(r)}}Object.defineProperty(t,"__esModule",{value:!0}),t.fromBase58Check=r,t.fromBech32=n,t.toBase58Check=function(e,t){hS(wS.tuple(wS.Hash160bit,wS.UInt8),arguments);const r=re.allocUnsafe(21);return r.writeUInt8(t,0),e.copy(r,1),cy.encode(r)},t.toBech32=function(e,t,r){const n=GS.toWords(e);return n.unshift(t),GS.encode(r,n)},t.fromOutputScript=function(e,t){t=t||yS.bitcoin;try{return XS.p2pkh({output:e,network:t}).address}catch(e){}try{return XS.p2sh({output:e,network:t}).address}catch(e){}try{return XS.p2wpkh({output:e,network:t}).address}catch(e){}try{return XS.p2wsh({output:e,network:t}).address}catch(e){}throw new Error(CS.toASM(e)+" has no matching Address")},t.toOutputScript=function(e,t){let i,o;t=t||yS.bitcoin;try{i=r(e)}catch(e){}if(i){if(i.version===t.pubKeyHash)return XS.p2pkh({hash:i.hash}).output;if(i.version===t.scriptHash)return XS.p2sh({hash:i.hash}).output}else{try{o=n(e)}catch(e){}if(o){if(o.prefix!==t.bech32)throw new Error(e+" has an invalid prefix");if(0===o.version){if(20===o.data.length)return XS.p2wpkh({hash:o.data}).output;if(32===o.data.length)return XS.p2wsh({hash:o.data}).output}}}throw new Error(e+" has no matching Script")}}));er(QS);QS.fromBase58Check,QS.fromBech32,QS.toBase58Check,QS.toBech32,QS.fromOutputScript,QS.toOutputScript;var YS=tr((function(e){var t=65536,r=4294967295;var n=fc.Buffer,i=Zt.crypto||Zt.msCrypto;i&&i.getRandomValues?e.exports=function(e,o){if(e>r)throw new RangeError("requested too many random bytes");var a=n.allocUnsafe(e);if(e>0)if(e>t)for(var s=0;s<e;s+=t)i.getRandomValues(a.slice(s,s+t));else i.getRandomValues(a);if("function"==typeof o)return Ye((function(){o(null,a)}));return a}:e.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}})),ZS=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=hS.maybe(hS.compile({compressed:wS.maybe(wS.Boolean),network:wS.maybe(wS.Network)}));class n{constructor(e,t,r){this.__D=e,this.__Q=t,this.lowR=!1,void 0===r&&(r={}),this.compressed=void 0===r.compressed||r.compressed,this.network=r.network||yS.bitcoin,void 0!==t&&(this.__Q=M_.pointCompress(t,this.compressed))}get privateKey(){return this.__D}get publicKey(){return this.__Q||(this.__Q=M_.pointFromScalar(this.__D,this.compressed)),this.__Q}toWIF(){if(!this.__D)throw new Error("Missing private key");return mS.encode(this.network.wif,this.__D,this.compressed)}sign(e,t){if(!this.__D)throw new Error("Missing private key");if(void 0===t&&(t=this.lowR),!1===t)return M_.sign(e,this.__D);{let t=M_.sign(e,this.__D);const r=re.alloc(32,0);let n=0;for(;t[0]>127;)n++,r.writeUIntLE(n,0,6),t=M_.signWithEntropy(e,this.__D,r);return t}}verify(e,t){return M_.verify(e,this.publicKey,t)}}function i(e,t){if(hS(wS.Buffer256bit,e),!M_.isPrivate(e))throw new TypeError("Private key not in range [1, n)");return hS(r,t),new n(e,void 0,t)}t.fromPrivateKey=i,t.fromPublicKey=function(e,t){return hS(M_.isPoint,e),hS(r,t),new n(void 0,e,t)},t.fromWIF=function(e,t){const r=mS.decode(e),n=r.version;if(wS.Array(t)){if(!(t=t.filter(e=>n===e.wif).pop()))throw new Error("Unknown network version")}else if(t=t||yS.bitcoin,n!==t.wif)throw new Error("Invalid network version");return i(r.privateKey,{compressed:r.compressed,network:t})},t.makeRandom=function(e){hS(r,e),void 0===e&&(e={});const t=e.rng||YS;let n;do{n=t(32),hS(wS.Buffer256bit,n)}while(!M_.isPrivate(n));return i(n,e)}}));er(ZS);ZS.fromPrivateKey,ZS.fromPublicKey,ZS.fromWIF,ZS.makeRandom;var eE=fc.Buffer;function tE(e){if(e<0||e>9007199254740991||e%1!=0)throw new RangeError("value out of range")}function rE(e){return tE(e),e<253?1:e<=65535?3:e<=4294967295?5:9}var nE={encode:function e(t,r,n){if(tE(t),r||(r=eE.allocUnsafe(rE(t))),!eE.isBuffer(r))throw new TypeError("buffer must be a Buffer instance");return n||(n=0),t<253?(r.writeUInt8(t,n),e.bytes=1):t<=65535?(r.writeUInt8(253,n),r.writeUInt16LE(t,n+1),e.bytes=3):t<=4294967295?(r.writeUInt8(254,n),r.writeUInt32LE(t,n+1),e.bytes=5):(r.writeUInt8(255,n),r.writeUInt32LE(t>>>0,n+1),r.writeUInt32LE(t/4294967296|0,n+5),e.bytes=9),r},decode:function e(t,r){if(!eE.isBuffer(t))throw new TypeError("buffer must be a Buffer instance");r||(r=0);var n=t.readUInt8(r);if(n<253)return e.bytes=1,n;if(253===n)return e.bytes=3,t.readUInt16LE(r+1);if(254===n)return e.bytes=5,t.readUInt32LE(r+1);e.bytes=9;var i=t.readUInt32LE(r+1),o=4294967296*t.readUInt32LE(r+5)+i;return tE(o),o},encodingLength:rE},iE=tr((function(e,t){function r(e,t){if("number"!=typeof e)throw new Error("cannot write a non-number as a number");if(e<0)throw new Error("specified a negative value for writing an unsigned value");if(e>t)throw new Error("RangeError: value out of range");if(Math.floor(e)!==e)throw new Error("value has a fractional component")}function n(e,t){const n=e.readUInt32LE(t);let i=e.readUInt32LE(t+4);return i*=4294967296,r(i+n,9007199254740991),i+n}function i(e,t,n){return r(t,9007199254740991),e.writeInt32LE(-1&t,n),e.writeUInt32LE(Math.floor(t/4294967296),n+4),n+8}Object.defineProperty(t,"__esModule",{value:!0}),t.readUInt64LE=n,t.writeUInt64LE=i,t.reverseBuffer=function(e){if(e.length<1)return e;let t=e.length-1,r=0;for(let n=0;n<e.length/2;n++)r=e[n],e[n]=e[t],e[t]=r,t--;return e},t.cloneBuffer=function(e){const t=re.allocUnsafe(e.length);return e.copy(t),t};t.BufferWriter=class{constructor(e,t=0){this.buffer=e,this.offset=t,hS(wS.tuple(wS.Buffer,wS.UInt32),[e,t])}writeUInt8(e){this.offset=this.buffer.writeUInt8(e,this.offset)}writeInt32(e){this.offset=this.buffer.writeInt32LE(e,this.offset)}writeUInt32(e){this.offset=this.buffer.writeUInt32LE(e,this.offset)}writeUInt64(e){this.offset=i(this.buffer,e,this.offset)}writeVarInt(e){nE.encode(e,this.buffer,this.offset),this.offset+=nE.encode.bytes}writeSlice(e){if(this.buffer.length<this.offset+e.length)throw new Error("Cannot write slice out of bounds");this.offset+=e.copy(this.buffer,this.offset)}writeVarSlice(e){this.writeVarInt(e.length),this.writeSlice(e)}writeVector(e){this.writeVarInt(e.length),e.forEach(e=>this.writeVarSlice(e))}};t.BufferReader=class{constructor(e,t=0){this.buffer=e,this.offset=t,hS(wS.tuple(wS.Buffer,wS.UInt32),[e,t])}readUInt8(){const e=this.buffer.readUInt8(this.offset);return this.offset++,e}readInt32(){const e=this.buffer.readInt32LE(this.offset);return this.offset+=4,e}readUInt32(){const e=this.buffer.readUInt32LE(this.offset);return this.offset+=4,e}readUInt64(){const e=n(this.buffer,this.offset);return this.offset+=8,e}readVarInt(){const e=nE.decode(this.buffer,this.offset);return this.offset+=nE.decode.bytes,e}readSlice(e){if(this.buffer.length<this.offset+e)throw new Error("Cannot read slice out of bounds");const t=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t}readVarSlice(){return this.readSlice(this.readVarInt())}readVector(){const e=this.readVarInt(),t=[];for(let r=0;r<e;r++)t.push(this.readVarSlice());return t}}}));er(iE);iE.readUInt64LE,iE.writeUInt64LE,iE.reverseBuffer,iE.cloneBuffer,iE.BufferWriter,iE.BufferReader;var oE=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=CS;function n(e){const t=e.length;return nE.encodingLength(t)+t}const i=re.allocUnsafe(0),o=[],a=re.from("0000000000000000000000000000000000000000000000000000000000000000","hex"),s=re.from("0000000000000000000000000000000000000000000000000000000000000001","hex"),c=re.from("ffffffffffffffff","hex"),u={script:i,valueBuffer:c};class l{constructor(){this.version=1,this.locktime=0,this.ins=[],this.outs=[]}static fromBuffer(e,t){const r=new iE.BufferReader(e),n=new l;n.version=r.readInt32();const i=r.readUInt8(),a=r.readUInt8();let s=!1;i===l.ADVANCED_TRANSACTION_MARKER&&a===l.ADVANCED_TRANSACTION_FLAG?s=!0:r.offset-=2;const c=r.readVarInt();for(let e=0;e<c;++e)n.ins.push({hash:r.readSlice(32),index:r.readUInt32(),script:r.readVarSlice(),sequence:r.readUInt32(),witness:o});const u=r.readVarInt();for(let e=0;e<u;++e)n.outs.push({value:r.readUInt64(),script:r.readVarSlice()});if(s){for(let e=0;e<c;++e)n.ins[e].witness=r.readVector();if(!n.hasWitnesses())throw new Error("Transaction has superfluous witness data")}if(n.locktime=r.readUInt32(),t)return n;if(r.offset!==e.length)throw new Error("Transaction has unexpected data");return n}static fromHex(e){return l.fromBuffer(re.from(e,"hex"),!1)}static isCoinbaseHash(e){hS(wS.Hash256bit,e);for(let t=0;t<32;++t)if(0!==e[t])return!1;return!0}isCoinbase(){return 1===this.ins.length&&l.isCoinbaseHash(this.ins[0].hash)}addInput(e,t,r,n){return hS(wS.tuple(wS.Hash256bit,wS.UInt32,wS.maybe(wS.UInt32),wS.maybe(wS.Buffer)),arguments),wS.Null(r)&&(r=l.DEFAULT_SEQUENCE),this.ins.push({hash:e,index:t,script:n||i,sequence:r,witness:o})-1}addOutput(e,t){return hS(wS.tuple(wS.Buffer,wS.Satoshi),arguments),this.outs.push({script:e,value:t})-1}hasWitnesses(){return this.ins.some(e=>0!==e.witness.length)}weight(){return 3*this.byteLength(!1)+this.byteLength(!0)}virtualSize(){return Math.ceil(this.weight()/4)}byteLength(e=!0){const t=e&&this.hasWitnesses();return(t?10:8)+nE.encodingLength(this.ins.length)+nE.encodingLength(this.outs.length)+this.ins.reduce((e,t)=>e+40+n(t.script),0)+this.outs.reduce((e,t)=>e+8+n(t.script),0)+(t?this.ins.reduce((e,t)=>e+function(e){const t=e.length;return nE.encodingLength(t)+e.reduce((e,t)=>e+n(t),0)}(t.witness),0):0)}clone(){const e=new l;return e.version=this.version,e.locktime=this.locktime,e.ins=this.ins.map(e=>({hash:e.hash,index:e.index,script:e.script,sequence:e.sequence,witness:e.witness})),e.outs=this.outs.map(e=>({script:e.script,value:e.value})),e}hashForSignature(e,t,n){if(hS(wS.tuple(wS.UInt32,wS.Buffer,wS.Number),arguments),e>=this.ins.length)return s;const o=CS.compile(CS.decompile(t).filter(e=>e!==r.OPS.OP_CODESEPARATOR)),a=this.clone();if((31&n)===l.SIGHASH_NONE)a.outs=[],a.ins.forEach((t,r)=>{r!==e&&(t.sequence=0)});else if((31&n)===l.SIGHASH_SINGLE){if(e>=this.outs.length)return s;a.outs.length=e+1;for(let t=0;t<e;t++)a.outs[t]=u;a.ins.forEach((t,r)=>{r!==e&&(t.sequence=0)})}n&l.SIGHASH_ANYONECANPAY?(a.ins=[a.ins[e]],a.ins[0].script=o):(a.ins.forEach(e=>{e.script=i}),a.ins[e].script=o);const c=re.allocUnsafe(a.byteLength(!1)+4);return c.writeInt32LE(n,c.length-4),a.__toBuffer(c,0,!1),jS.hash256(c)}hashForWitnessV0(e,t,r,i){hS(wS.tuple(wS.UInt32,wS.Buffer,wS.Satoshi,wS.UInt32),arguments);let o,s=re.from([]),c=a,u=a,f=a;if(i&l.SIGHASH_ANYONECANPAY||(s=re.allocUnsafe(36*this.ins.length),o=new iE.BufferWriter(s,0),this.ins.forEach(e=>{o.writeSlice(e.hash),o.writeUInt32(e.index)}),u=jS.hash256(s)),i&l.SIGHASH_ANYONECANPAY||(31&i)===l.SIGHASH_SINGLE||(31&i)===l.SIGHASH_NONE||(s=re.allocUnsafe(4*this.ins.length),o=new iE.BufferWriter(s,0),this.ins.forEach(e=>{o.writeUInt32(e.sequence)}),f=jS.hash256(s)),(31&i)!==l.SIGHASH_SINGLE&&(31&i)!==l.SIGHASH_NONE){const e=this.outs.reduce((e,t)=>e+8+n(t.script),0);s=re.allocUnsafe(e),o=new iE.BufferWriter(s,0),this.outs.forEach(e=>{o.writeUInt64(e.value),o.writeVarSlice(e.script)}),c=jS.hash256(s)}else if((31&i)===l.SIGHASH_SINGLE&&e<this.outs.length){const t=this.outs[e];s=re.allocUnsafe(8+n(t.script)),o=new iE.BufferWriter(s,0),o.writeUInt64(t.value),o.writeVarSlice(t.script),c=jS.hash256(s)}s=re.allocUnsafe(156+n(t)),o=new iE.BufferWriter(s,0);const h=this.ins[e];return o.writeUInt32(this.version),o.writeSlice(u),o.writeSlice(f),o.writeSlice(h.hash),o.writeUInt32(h.index),o.writeVarSlice(t),o.writeUInt64(r),o.writeUInt32(h.sequence),o.writeSlice(c),o.writeUInt32(this.locktime),o.writeUInt32(i),jS.hash256(s)}getHash(e){return e&&this.isCoinbase()?re.alloc(32,0):jS.hash256(this.__toBuffer(void 0,void 0,e))}getId(){return iE.reverseBuffer(this.getHash(!1)).toString("hex")}toBuffer(e,t){return this.__toBuffer(e,t,!0)}toHex(){return this.toBuffer(void 0,void 0).toString("hex")}setInputScript(e,t){hS(wS.tuple(wS.Number,wS.Buffer),arguments),this.ins[e].script=t}setWitness(e,t){hS(wS.tuple(wS.Number,[wS.Buffer]),arguments),this.ins[e].witness=t}__toBuffer(e,t,r=!1){e||(e=re.allocUnsafe(this.byteLength(r)));const n=new iE.BufferWriter(e,t||0);n.writeInt32(this.version);const i=r&&this.hasWitnesses();return i&&(n.writeUInt8(l.ADVANCED_TRANSACTION_MARKER),n.writeUInt8(l.ADVANCED_TRANSACTION_FLAG)),n.writeVarInt(this.ins.length),this.ins.forEach(e=>{n.writeSlice(e.hash),n.writeUInt32(e.index),n.writeVarSlice(e.script),n.writeUInt32(e.sequence)}),n.writeVarInt(this.outs.length),this.outs.forEach(e=>{void 0!==e.value?n.writeUInt64(e.value):n.writeSlice(e.valueBuffer),n.writeVarSlice(e.script)}),i&&this.ins.forEach(e=>{n.writeVector(e.witness)}),n.writeUInt32(this.locktime),void 0!==t?e.slice(t,n.offset):e}}l.DEFAULT_SEQUENCE=4294967295,l.SIGHASH_ALL=1,l.SIGHASH_NONE=2,l.SIGHASH_SINGLE=3,l.SIGHASH_ANYONECANPAY=128,l.ADVANCED_TRANSACTION_MARKER=0,l.ADVANCED_TRANSACTION_FLAG=1,t.Transaction=l}));er(oE);oE.Transaction;var aE=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=new TypeError("Cannot compute merkle root for zero transactions"),n=new TypeError("Cannot compute witness commit for non-segwit block");class i{constructor(){this.version=1,this.prevHash=void 0,this.merkleRoot=void 0,this.timestamp=0,this.witnessCommit=void 0,this.bits=0,this.nonce=0,this.transactions=void 0}static fromBuffer(e){if(e.length<80)throw new Error("Buffer too small (< 80 bytes)");const t=new iE.BufferReader(e),r=new i;if(r.version=t.readInt32(),r.prevHash=t.readSlice(32),r.merkleRoot=t.readSlice(32),r.timestamp=t.readUInt32(),r.bits=t.readUInt32(),r.nonce=t.readUInt32(),80===e.length)return r;const n=()=>{const e=oE.Transaction.fromBuffer(t.buffer.slice(t.offset),!0);return t.offset+=e.byteLength(),e},o=t.readVarInt();r.transactions=[];for(let e=0;e<o;++e){const e=n();r.transactions.push(e)}const a=r.getWitnessCommit();return a&&(r.witnessCommit=a),r}static fromHex(e){return i.fromBuffer(re.from(e,"hex"))}static calculateTarget(e){const t=((4278190080&e)>>24)-3,r=8388607&e,n=re.alloc(32,0);return n.writeUIntBE(r,29-t,3),n}static calculateMerkleRoot(e,t){if(hS([{getHash:wS.Function}],e),0===e.length)throw r;if(t&&!o(e))throw n;const i=function(e,t){if(!Array.isArray(e))throw TypeError("Expected values Array");if("function"!=typeof t)throw TypeError("Expected digest Function");for(var r=e.length,n=e.concat();r>1;){for(var i=0,o=0;o<r;o+=2,++i){var a=n[o],s=o+1===r?a:n[o+1],c=re.concat([a,s]);n[i]=t(c)}r=i}return n[0]}(e.map(e=>e.getHash(t)),jS.hash256);return t?jS.hash256(re.concat([i,e[0].ins[0].witness[0]])):i}getWitnessCommit(){if(!o(this.transactions))return null;const e=this.transactions[0].outs.filter(e=>e.script.slice(0,6).equals(re.from("6a24aa21a9ed","hex"))).map(e=>e.script.slice(6,38));if(0===e.length)return null;const t=e[e.length-1];return t instanceof re&&32===t.length?t:null}hasWitnessCommit(){return this.witnessCommit instanceof re&&32===this.witnessCommit.length||null!==this.getWitnessCommit()}hasWitness(){return(e=this.transactions)instanceof Array&&e.some(e=>"object"==typeof e&&e.ins instanceof Array&&e.ins.some(e=>"object"==typeof e&&e.witness instanceof Array&&e.witness.length>0));var e}weight(){return 3*this.byteLength(!1,!1)+this.byteLength(!1,!0)}byteLength(e,t=!0){return e||!this.transactions?80:80+nE.encodingLength(this.transactions.length)+this.transactions.reduce((e,r)=>e+r.byteLength(t),0)}getHash(){return jS.hash256(this.toBuffer(!0))}getId(){return iE.reverseBuffer(this.getHash()).toString("hex")}getUTCDate(){const e=new Date(0);return e.setUTCSeconds(this.timestamp),e}toBuffer(e){const t=re.allocUnsafe(this.byteLength(e)),r=new iE.BufferWriter(t);return r.writeInt32(this.version),r.writeSlice(this.prevHash),r.writeSlice(this.merkleRoot),r.writeUInt32(this.timestamp),r.writeUInt32(this.bits),r.writeUInt32(this.nonce),e||!this.transactions||(nE.encode(this.transactions.length,t,r.offset),r.offset+=nE.encode.bytes,this.transactions.forEach(e=>{const n=e.byteLength();e.toBuffer(t,r.offset),r.offset+=n})),t}toHex(e){return this.toBuffer(e).toString("hex")}checkTxRoots(){const e=this.hasWitnessCommit();return!(!e&&this.hasWitness())&&(this.__checkMerkleRoot()&&(!e||this.__checkWitnessCommit()))}checkProofOfWork(){const e=iE.reverseBuffer(this.getHash()),t=i.calculateTarget(this.bits);return e.compare(t)<=0}__checkMerkleRoot(){if(!this.transactions)throw r;const e=i.calculateMerkleRoot(this.transactions);return 0===this.merkleRoot.compare(e)}__checkWitnessCommit(){if(!this.transactions)throw r;if(!this.hasWitnessCommit())throw n;const e=i.calculateMerkleRoot(this.transactions,!0);return 0===this.witnessCommit.compare(e)}}function o(e){return e instanceof Array&&e[0]&&e[0].ins&&e[0].ins instanceof Array&&e[0].ins[0]&&e[0].ins[0].witness&&e[0].ins[0].witness instanceof Array&&e[0].ins[0].witness.length>0}t.Block=i}));er(aE);aE.Block;var sE=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.UNSIGNED_TX=0]="UNSIGNED_TX",e[e.GLOBAL_XPUB=1]="GLOBAL_XPUB"}(t.GlobalTypes||(t.GlobalTypes={})),t.GLOBAL_TYPE_NAMES=["unsignedTx","globalXpub"],function(e){e[e.NON_WITNESS_UTXO=0]="NON_WITNESS_UTXO",e[e.WITNESS_UTXO=1]="WITNESS_UTXO",e[e.PARTIAL_SIG=2]="PARTIAL_SIG",e[e.SIGHASH_TYPE=3]="SIGHASH_TYPE",e[e.REDEEM_SCRIPT=4]="REDEEM_SCRIPT",e[e.WITNESS_SCRIPT=5]="WITNESS_SCRIPT",e[e.BIP32_DERIVATION=6]="BIP32_DERIVATION",e[e.FINAL_SCRIPTSIG=7]="FINAL_SCRIPTSIG",e[e.FINAL_SCRIPTWITNESS=8]="FINAL_SCRIPTWITNESS",e[e.POR_COMMITMENT=9]="POR_COMMITMENT"}(t.InputTypes||(t.InputTypes={})),t.INPUT_TYPE_NAMES=["nonWitnessUtxo","witnessUtxo","partialSig","sighashType","redeemScript","witnessScript","bip32Derivation","finalScriptSig","finalScriptWitness","porCommitment"],function(e){e[e.REDEEM_SCRIPT=0]="REDEEM_SCRIPT",e[e.WITNESS_SCRIPT=1]="WITNESS_SCRIPT",e[e.BIP32_DERIVATION=2]="BIP32_DERIVATION"}(t.OutputTypes||(t.OutputTypes={})),t.OUTPUT_TYPE_NAMES=["redeemScript","witnessScript","bip32Derivation"]}));er(sE);sE.GlobalTypes,sE.GLOBAL_TYPE_NAMES,sE.InputTypes,sE.INPUT_TYPE_NAMES,sE.OutputTypes,sE.OUTPUT_TYPE_NAMES;var cE=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});t.decode=function(e){if(e.key[0]!==sE.GlobalTypes.GLOBAL_XPUB)throw new Error("Decode Error: could not decode globalXpub with key 0x"+e.key.toString("hex"));if(79!==e.key.length||![2,3].includes(e.key[46]))throw new Error("Decode Error: globalXpub has invalid extended pubkey in key 0x"+e.key.toString("hex"));if(e.value.length/4%1!=0)throw new Error("Decode Error: Global GLOBAL_XPUB value length should be multiple of 4");const t=e.key.slice(1),r={masterFingerprint:e.value.slice(0,4),extendedPubkey:t,path:"m"};for(const t of(e=>[...Array(e).keys()])(e.value.length/4-1)){const n=e.value.readUInt32LE(4*t+4),i=!!(2147483648&n),o=2147483647&n;r.path+="/"+o.toString(10)+(i?"'":"")}return r},t.encode=function(e){const t=re.from([sE.GlobalTypes.GLOBAL_XPUB]),r=re.concat([t,e.extendedPubkey]),n=e.path.split("/"),i=re.allocUnsafe(4*n.length);e.masterFingerprint.copy(i,0);let o=4;return n.slice(1).forEach(e=>{const t="'"===e.slice(-1);let r=2147483647&parseInt(t?e.slice(0,-1):e,10);t&&(r+=2147483648),i.writeUInt32LE(r,o),o+=4}),{key:r,value:i}},t.expected="{ masterFingerprint: Buffer; extendedPubkey: Buffer; path: string; }",t.check=function(e){const t=e.extendedPubkey,r=e.masterFingerprint,n=e.path;return Be(t)&&78===t.length&&[2,3].indexOf(t[45])>-1&&Be(r)&&4===r.length&&"string"==typeof n&&!!n.match(/^m(\/\d+'?)+$/)},t.canAddToArray=function(e,t,r){const n=t.extendedPubkey.toString("hex");return!r.has(n)&&(r.add(n),0===e.filter(e=>e.extendedPubkey.equals(t.extendedPubkey)).length)}}));er(cE);cE.decode,cE.encode,cE.expected,cE.check,cE.canAddToArray;var uE=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.encode=function(e){return{key:re.from([sE.GlobalTypes.UNSIGNED_TX]),value:e.toBuffer()}}}));er(uE);uE.encode;var lE=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e){if(e.key[0]!==sE.InputTypes.FINAL_SCRIPTSIG)throw new Error("Decode Error: could not decode finalScriptSig with key 0x"+e.key.toString("hex"));return e.value},t.encode=function(e){return{key:re.from([sE.InputTypes.FINAL_SCRIPTSIG]),value:e}},t.expected="Buffer",t.check=function(e){return Be(e)},t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.finalScriptSig}}));er(lE);lE.decode,lE.encode,lE.expected,lE.check,lE.canAdd;var fE=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e){if(e.key[0]!==sE.InputTypes.FINAL_SCRIPTWITNESS)throw new Error("Decode Error: could not decode finalScriptWitness with key 0x"+e.key.toString("hex"));return e.value},t.encode=function(e){return{key:re.from([sE.InputTypes.FINAL_SCRIPTWITNESS]),value:e}},t.expected="Buffer",t.check=function(e){return Be(e)},t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.finalScriptWitness}}));er(fE);fE.decode,fE.encode,fE.expected,fE.check,fE.canAdd;var hE=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e){if(e.key[0]!==sE.InputTypes.NON_WITNESS_UTXO)throw new Error("Decode Error: could not decode nonWitnessUtxo with key 0x"+e.key.toString("hex"));return e.value},t.encode=function(e){return{key:re.from([sE.InputTypes.NON_WITNESS_UTXO]),value:e}},t.expected="Buffer",t.check=function(e){return Be(e)},t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.nonWitnessUtxo}}));er(hE);hE.decode,hE.encode,hE.expected,hE.check,hE.canAdd;var dE=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e){if(e.key[0]!==sE.InputTypes.PARTIAL_SIG)throw new Error("Decode Error: could not decode partialSig with key 0x"+e.key.toString("hex"));if(34!==e.key.length&&66!==e.key.length||![2,3,4].includes(e.key[1]))throw new Error("Decode Error: partialSig has invalid pubkey in key 0x"+e.key.toString("hex"));return{pubkey:e.key.slice(1),signature:e.value}},t.encode=function(e){const t=re.from([sE.InputTypes.PARTIAL_SIG]);return{key:re.concat([t,e.pubkey]),value:e.signature}},t.expected="{ pubkey: Buffer; signature: Buffer; }",t.check=function(e){return Be(e.pubkey)&&Be(e.signature)&&[33,65].includes(e.pubkey.length)&&[2,3,4].includes(e.pubkey[0])&&function(e){if(!Be(e)||e.length<9)return!1;if(48!==e[0])return!1;if(e.length!==e[1]+3)return!1;if(2!==e[2])return!1;const t=e[3];if(t>33||t<1)return!1;if(2!==e[3+t+1])return!1;const r=e[3+t+2];return!(r>33||r<1)&&e.length===3+t+2+r+2}(e.signature)},t.canAddToArray=function(e,t,r){const n=t.pubkey.toString("hex");return!r.has(n)&&(r.add(n),0===e.filter(e=>e.pubkey.equals(t.pubkey)).length)}}));er(dE);dE.decode,dE.encode,dE.expected,dE.check,dE.canAddToArray;var pE=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e){if(e.key[0]!==sE.InputTypes.POR_COMMITMENT)throw new Error("Decode Error: could not decode porCommitment with key 0x"+e.key.toString("hex"));return e.value.toString("utf8")},t.encode=function(e){return{key:re.from([sE.InputTypes.POR_COMMITMENT]),value:re.from(e,"utf8")}},t.expected="string",t.check=function(e){return"string"==typeof e},t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.porCommitment}}));er(pE);pE.decode,pE.encode,pE.expected,pE.check,pE.canAdd;var mE=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e){if(e.key[0]!==sE.InputTypes.SIGHASH_TYPE)throw new Error("Decode Error: could not decode sighashType with key 0x"+e.key.toString("hex"));return e.value.readUInt32LE(0)},t.encode=function(e){const t=re.from([sE.InputTypes.SIGHASH_TYPE]),r=re.allocUnsafe(4);return r.writeUInt32LE(e,0),{key:t,value:r}},t.expected="number",t.check=function(e){return"number"==typeof e},t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.sighashType}}));er(mE);mE.decode,mE.encode,mE.expected,mE.check,mE.canAdd;var gE=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});function r(e){if(e<0||e>9007199254740991||e%1!=0)throw new RangeError("value out of range")}function n(e){return r(e),e<253?1:e<=65535?3:e<=4294967295?5:9}t.encode=function e(t,i,o){if(r(t),i||(i=re.allocUnsafe(n(t))),!Be(i))throw new TypeError("buffer must be a Buffer instance");return o||(o=0),t<253?(i.writeUInt8(t,o),Object.assign(e,{bytes:1})):t<=65535?(i.writeUInt8(253,o),i.writeUInt16LE(t,o+1),Object.assign(e,{bytes:3})):t<=4294967295?(i.writeUInt8(254,o),i.writeUInt32LE(t,o+1),Object.assign(e,{bytes:5})):(i.writeUInt8(255,o),i.writeUInt32LE(t>>>0,o+1),i.writeUInt32LE(t/4294967296|0,o+5),Object.assign(e,{bytes:9})),i},t.decode=function e(t,n){if(!Be(t))throw new TypeError("buffer must be a Buffer instance");n||(n=0);const i=t.readUInt8(n);if(i<253)return Object.assign(e,{bytes:1}),i;if(253===i)return Object.assign(e,{bytes:3}),t.readUInt16LE(n+1);if(254===i)return Object.assign(e,{bytes:5}),t.readUInt32LE(n+1);{Object.assign(e,{bytes:9});const i=t.readUInt32LE(n+1),o=4294967296*t.readUInt32LE(n+5)+i;return r(o),o}},t.encodingLength=n}));er(gE);gE.encode,gE.decode,gE.encodingLength;var vE=tr((function(e,t){function r(e){const t=e.key.length,r=e.value.length,n=gE.encodingLength(t),i=gE.encodingLength(r),o=re.allocUnsafe(n+t+i+r);return gE.encode(t,o,0),e.key.copy(o,n),gE.encode(r,o,n+t),e.value.copy(o,n+t+i),o}function n(e,t){if("number"!=typeof e)throw new Error("cannot write a non-number as a number");if(e<0)throw new Error("specified a negative value for writing an unsigned value");if(e>t)throw new Error("RangeError: value out of range");if(Math.floor(e)!==e)throw new Error("value has a fractional component")}Object.defineProperty(t,"__esModule",{value:!0}),t.range=e=>[...Array(e).keys()],t.reverseBuffer=function(e){if(e.length<1)return e;let t=e.length-1,r=0;for(let n=0;n<e.length/2;n++)r=e[n],e[n]=e[t],e[t]=r,t--;return e},t.keyValsToBuffer=function(e){const t=e.map(r);return t.push(re.from([0])),re.concat(t)},t.keyValToBuffer=r,t.readUInt64LE=function(e,t){const r=e.readUInt32LE(t);let i=e.readUInt32LE(t+4);return i*=4294967296,n(i+r,9007199254740991),i+r},t.writeUInt64LE=function(e,t,r){return n(t,9007199254740991),e.writeInt32LE(-1&t,r),e.writeUInt32LE(Math.floor(t/4294967296),r+4),r+8}}));er(vE);vE.range,vE.reverseBuffer,vE.keyValsToBuffer,vE.keyValToBuffer,vE.readUInt64LE,vE.writeUInt64LE;var yE=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e){if(e.key[0]!==sE.InputTypes.WITNESS_UTXO)throw new Error("Decode Error: could not decode witnessUtxo with key 0x"+e.key.toString("hex"));const t=vE.readUInt64LE(e.value,0);let r=8;const n=gE.decode(e.value,r);r+=gE.encodingLength(n);const i=e.value.slice(r);if(i.length!==n)throw new Error("Decode Error: WITNESS_UTXO script is not proper length");return{script:i,value:t}},t.encode=function(e){const{script:t,value:r}=e,n=gE.encodingLength(t.length),i=re.allocUnsafe(8+n+t.length);return vE.writeUInt64LE(i,r,0),gE.encode(t.length,i,8),t.copy(i,8+n),{key:re.from([sE.InputTypes.WITNESS_UTXO]),value:i}},t.expected="{ script: Buffer; value: number; }",t.check=function(e){return Be(e.script)&&"number"==typeof e.value},t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.witnessUtxo}}));er(yE);yE.decode,yE.encode,yE.expected,yE.check,yE.canAdd;var bE=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});t.makeConverter=function(e){return{decode:function(t){if(t.key[0]!==e)throw new Error("Decode Error: could not decode bip32Derivation with key 0x"+t.key.toString("hex"));if(34!==t.key.length&&66!==t.key.length||![2,3,4].includes(t.key[1]))throw new Error("Decode Error: bip32Derivation has invalid pubkey in key 0x"+t.key.toString("hex"));if(t.value.length/4%1!=0)throw new Error("Decode Error: Input BIP32_DERIVATION value length should be multiple of 4");const r=t.key.slice(1),n={masterFingerprint:t.value.slice(0,4),pubkey:r,path:"m"};for(const e of(e=>[...Array(e).keys()])(t.value.length/4-1)){const r=t.value.readUInt32LE(4*e+4),i=!!(2147483648&r),o=2147483647&r;n.path+="/"+o.toString(10)+(i?"'":"")}return n},encode:function(t){const r=re.from([e]),n=re.concat([r,t.pubkey]),i=t.path.split("/"),o=re.allocUnsafe(4*i.length);t.masterFingerprint.copy(o,0);let a=4;return i.slice(1).forEach(e=>{const t="'"===e.slice(-1);let r=2147483647&parseInt(t?e.slice(0,-1):e,10);t&&(r+=2147483648),o.writeUInt32LE(r,a),a+=4}),{key:n,value:o}},check:function(e){return Be(e.pubkey)&&Be(e.masterFingerprint)&&"string"==typeof e.path&&[33,65].includes(e.pubkey.length)&&[2,3,4].includes(e.pubkey[0])&&4===e.masterFingerprint.length},expected:"{ masterFingerprint: Buffer; pubkey: Buffer; path: string; }",canAddToArray:function(e,t,r){const n=t.pubkey.toString("hex");return!r.has(n)&&(r.add(n),0===e.filter(e=>e.pubkey.equals(t.pubkey)).length)}}}}));er(bE);bE.makeConverter;var wE=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.makeChecker=function(e){return function(t){let r;if(e.includes(t.key[0])&&(r=t.key.slice(1),33!==r.length&&65!==r.length||![2,3,4].includes(r[0])))throw new Error("Format Error: invalid pubkey in key 0x"+t.key.toString("hex"));return r}}}));er(wE);wE.makeChecker;var _E=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.makeConverter=function(e){return{decode:function(t){if(t.key[0]!==e)throw new Error("Decode Error: could not decode redeemScript with key 0x"+t.key.toString("hex"));return t.value},encode:function(t){return{key:re.from([e]),value:t}},check:function(e){return Be(e)},expected:"Buffer",canAdd:function(e,t){return!!e&&!!t&&void 0===e.redeemScript}}}}));er(_E);_E.makeConverter;var SE=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.makeConverter=function(e){return{decode:function(t){if(t.key[0]!==e)throw new Error("Decode Error: could not decode witnessScript with key 0x"+t.key.toString("hex"));return t.value},encode:function(t){return{key:re.from([e]),value:t}},check:function(e){return Be(e)},expected:"Buffer",canAdd:function(e,t){return!!e&&!!t&&void 0===e.witnessScript}}}}));er(SE);SE.makeConverter;var EE=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r={unsignedTx:uE,globalXpub:cE,checkPubkey:wE.makeChecker([])};t.globals=r;const n={nonWitnessUtxo:hE,partialSig:dE,sighashType:mE,finalScriptSig:lE,finalScriptWitness:fE,porCommitment:pE,witnessUtxo:yE,bip32Derivation:bE.makeConverter(sE.InputTypes.BIP32_DERIVATION),redeemScript:_E.makeConverter(sE.InputTypes.REDEEM_SCRIPT),witnessScript:SE.makeConverter(sE.InputTypes.WITNESS_SCRIPT),checkPubkey:wE.makeChecker([sE.InputTypes.PARTIAL_SIG,sE.InputTypes.BIP32_DERIVATION])};t.inputs=n;const i={bip32Derivation:bE.makeConverter(sE.OutputTypes.BIP32_DERIVATION),redeemScript:_E.makeConverter(sE.OutputTypes.REDEEM_SCRIPT),witnessScript:SE.makeConverter(sE.OutputTypes.WITNESS_SCRIPT),checkPubkey:wE.makeChecker([sE.OutputTypes.BIP32_DERIVATION])};t.outputs=i}));er(EE);EE.globals,EE.inputs,EE.outputs;var xE=tr((function(e,t){function r(e,t,r){if(!t.equals(re.from([r])))throw new Error(`Format Error: Invalid ${e} key: ${t.toString("hex")}`)}function n(e,{globalMapKeyVals:t,inputKeyVals:n,outputKeyVals:i}){const o={unsignedTx:e};let a=0;for(const e of t)switch(e.key[0]){case sE.GlobalTypes.UNSIGNED_TX:if(r("global",e.key,sE.GlobalTypes.UNSIGNED_TX),a>0)throw new Error("Format Error: GlobalMap has multiple UNSIGNED_TX");a++;break;case sE.GlobalTypes.GLOBAL_XPUB:void 0===o.globalXpub&&(o.globalXpub=[]),o.globalXpub.push(EE.globals.globalXpub.decode(e));break;default:o.unknownKeyVals||(o.unknownKeyVals=[]),o.unknownKeyVals.push(e)}const s=n.length,c=i.length,u=[],l=[];for(const e of vE.range(s)){const t={};for(const i of n[e])switch(EE.inputs.checkPubkey(i),i.key[0]){case sE.InputTypes.NON_WITNESS_UTXO:if(r("input",i.key,sE.InputTypes.NON_WITNESS_UTXO),void 0!==t.nonWitnessUtxo)throw new Error("Format Error: Input has multiple NON_WITNESS_UTXO");t.nonWitnessUtxo=EE.inputs.nonWitnessUtxo.decode(i);break;case sE.InputTypes.WITNESS_UTXO:if(r("input",i.key,sE.InputTypes.WITNESS_UTXO),void 0!==t.witnessUtxo)throw new Error("Format Error: Input has multiple WITNESS_UTXO");t.witnessUtxo=EE.inputs.witnessUtxo.decode(i);break;case sE.InputTypes.PARTIAL_SIG:void 0===t.partialSig&&(t.partialSig=[]),t.partialSig.push(EE.inputs.partialSig.decode(i));break;case sE.InputTypes.SIGHASH_TYPE:if(r("input",i.key,sE.InputTypes.SIGHASH_TYPE),void 0!==t.sighashType)throw new Error("Format Error: Input has multiple SIGHASH_TYPE");t.sighashType=EE.inputs.sighashType.decode(i);break;case sE.InputTypes.REDEEM_SCRIPT:if(r("input",i.key,sE.InputTypes.REDEEM_SCRIPT),void 0!==t.redeemScript)throw new Error("Format Error: Input has multiple REDEEM_SCRIPT");t.redeemScript=EE.inputs.redeemScript.decode(i);break;case sE.InputTypes.WITNESS_SCRIPT:if(r("input",i.key,sE.InputTypes.WITNESS_SCRIPT),void 0!==t.witnessScript)throw new Error("Format Error: Input has multiple WITNESS_SCRIPT");t.witnessScript=EE.inputs.witnessScript.decode(i);break;case sE.InputTypes.BIP32_DERIVATION:void 0===t.bip32Derivation&&(t.bip32Derivation=[]),t.bip32Derivation.push(EE.inputs.bip32Derivation.decode(i));break;case sE.InputTypes.FINAL_SCRIPTSIG:r("input",i.key,sE.InputTypes.FINAL_SCRIPTSIG),t.finalScriptSig=EE.inputs.finalScriptSig.decode(i);break;case sE.InputTypes.FINAL_SCRIPTWITNESS:r("input",i.key,sE.InputTypes.FINAL_SCRIPTWITNESS),t.finalScriptWitness=EE.inputs.finalScriptWitness.decode(i);break;case sE.InputTypes.POR_COMMITMENT:r("input",i.key,sE.InputTypes.POR_COMMITMENT),t.porCommitment=EE.inputs.porCommitment.decode(i);break;default:t.unknownKeyVals||(t.unknownKeyVals=[]),t.unknownKeyVals.push(i)}u.push(t)}for(const e of vE.range(c)){const t={};for(const n of i[e])switch(EE.outputs.checkPubkey(n),n.key[0]){case sE.OutputTypes.REDEEM_SCRIPT:if(r("output",n.key,sE.OutputTypes.REDEEM_SCRIPT),void 0!==t.redeemScript)throw new Error("Format Error: Output has multiple REDEEM_SCRIPT");t.redeemScript=EE.outputs.redeemScript.decode(n);break;case sE.OutputTypes.WITNESS_SCRIPT:if(r("output",n.key,sE.OutputTypes.WITNESS_SCRIPT),void 0!==t.witnessScript)throw new Error("Format Error: Output has multiple WITNESS_SCRIPT");t.witnessScript=EE.outputs.witnessScript.decode(n);break;case sE.OutputTypes.BIP32_DERIVATION:void 0===t.bip32Derivation&&(t.bip32Derivation=[]),t.bip32Derivation.push(EE.outputs.bip32Derivation.decode(n));break;default:t.unknownKeyVals||(t.unknownKeyVals=[]),t.unknownKeyVals.push(n)}l.push(t)}return{globalMap:o,inputs:u,outputs:l}}Object.defineProperty(t,"__esModule",{value:!0}),t.psbtFromBuffer=function(e,t){let r=0;function i(){const t=gE.decode(e,r);r+=gE.encodingLength(t);const n=e.slice(r,r+t);return r+=t,n}function o(){return{key:i(),value:i()}}function a(){if(r>=e.length)throw new Error("Format Error: Unexpected End of PSBT");const t=0===e.readUInt8(r);return t&&r++,t}if(1886610036!==function(){const t=e.readUInt32BE(r);return r+=4,t}())throw new Error("Format Error: Invalid Magic Number");if(255!==function(){const t=e.readUInt8(r);return r+=1,t}())throw new Error("Format Error: Magic Number must be followed by 0xff separator");const s=[],c={};for(;!a();){const e=o(),t=e.key.toString("hex");if(c[t])throw new Error("Format Error: Keys must be unique for global keymap: key "+t);c[t]=1,s.push(e)}const u=s.filter(e=>e.key[0]===sE.GlobalTypes.UNSIGNED_TX);if(1!==u.length)throw new Error("Format Error: Only one UNSIGNED_TX allowed");const l=t(u[0].value),{inputCount:f,outputCount:h}=l.getInputOutputCounts(),d=[],p=[];for(const e of vE.range(f)){const t={},r=[];for(;!a();){const n=o(),i=n.key.toString("hex");if(t[i])throw new Error("Format Error: Keys must be unique for each input: input index "+e+" key "+i);t[i]=1,r.push(n)}d.push(r)}for(const e of vE.range(h)){const t={},r=[];for(;!a();){const n=o(),i=n.key.toString("hex");if(t[i])throw new Error("Format Error: Keys must be unique for each output: output index "+e+" key "+i);t[i]=1,r.push(n)}p.push(r)}return n(l,{globalMapKeyVals:s,inputKeyVals:d,outputKeyVals:p})},t.checkKeyBuffer=r,t.psbtFromKeyVals=n}));er(xE);xE.psbtFromBuffer,xE.checkKeyBuffer,xE.psbtFromKeyVals;var IE=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.psbtToBuffer=function({globalMap:e,inputs:t,outputs:r}){const{globalKeyVals:n,inputKeyVals:o,outputKeyVals:a}=i({globalMap:e,inputs:t,outputs:r}),s=vE.keyValsToBuffer(n),c=e=>0===e.length?[re.from([0])]:e.map(vE.keyValsToBuffer),u=c(o),l=c(a),f=re.allocUnsafe(5);return f.writeUIntBE(482972169471,0,5),re.concat([f,s].concat(u,l))};const r=(e,t)=>e.key.compare(t.key);function n(e,t){const n=new Set,i=Object.entries(e).reduce((e,[r,i])=>{if("unknownKeyVals"===r)return e;const o=t[r];if(void 0===o)return e;const a=(Array.isArray(i)?i:[i]).map(o.encode);return a.map(e=>e.key.toString("hex")).forEach(e=>{if(n.has(e))throw new Error("Serialize Error: Duplicate key: "+e);n.add(e)}),e.concat(a)},[]),o=e.unknownKeyVals?e.unknownKeyVals.filter(e=>!n.has(e.key.toString("hex"))):[];return i.concat(o).sort(r)}function i({globalMap:e,inputs:t,outputs:r}){return{globalKeyVals:n(e,EE.globals),inputKeyVals:t.map(e=>n(e,EE.inputs)),outputKeyVals:r.map(e=>n(e,EE.outputs))}}t.psbtToKeyVals=i}));er(IE);IE.psbtToBuffer,IE.psbtToKeyVals;var kE=tr((function(e,t){function r(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,"__esModule",{value:!0}),r(xE),r(IE)}));er(kE);var PE=tr((function(e,t){function r(e,t,r){return n=>{if(e.has(n))return;const i=r.filter(e=>e.key.toString("hex")===n)[0];t.push(i),e.add(n)}}function n(e){return e.globalMap.unsignedTx}function i(e){const t=new Set;return e.forEach(e=>{const r=e.key.toString("hex");if(t.has(r))throw new Error("Combine: KeyValue Map keys should be unique");t.add(r)}),t}Object.defineProperty(t,"__esModule",{value:!0}),t.combine=function(e){const t=e[0],o=kE.psbtToKeyVals(t),a=e.slice(1);if(0===a.length)throw new Error("Combine: Nothing to combine");const s=n(t);if(void 0===s)throw new Error("Combine: Self missing transaction");const c=i(o.globalKeyVals),u=o.inputKeyVals.map(i),l=o.outputKeyVals.map(i);for(const e of a){const t=n(e);if(void 0===t||!t.toBuffer().equals(s.toBuffer()))throw new Error("Combine: One of the Psbts does not have the same transaction.");const a=kE.psbtToKeyVals(e);i(a.globalKeyVals).forEach(r(c,o.globalKeyVals,a.globalKeyVals));a.inputKeyVals.map(i).forEach((e,t)=>e.forEach(r(u[t],o.inputKeyVals[t],a.inputKeyVals[t])));a.outputKeyVals.map(i).forEach((e,t)=>e.forEach(r(l[t],o.outputKeyVals[t],a.outputKeyVals[t])))}return kE.psbtFromKeyVals(s,{globalMapKeyVals:o.globalKeyVals,inputKeyVals:o.inputKeyVals,outputKeyVals:o.outputKeyVals})}}));er(PE);PE.combine;var OE=tr((function(e,t){function r(e,t){const r=e[t];if(void 0===r)throw new Error("No input #"+t);return r}function n(e,t,r,n){throw new Error(`Data for ${e} key ${t} is incorrect: Expected ${r} and got ${JSON.stringify(n)}`)}function i(e){return(t,r)=>{for(const i of Object.keys(t)){const o=t[i],{canAdd:a,canAddToArray:s,check:c,expected:u}=EE[e+"s"][i]||{},l=!!s;if(c)if(l){if(!Array.isArray(o)||r[i]&&!Array.isArray(r[i]))throw new Error(`Key type ${i} must be an array`);o.every(c)||n(e,i,u,o);const t=r[i]||[],a=new Set;if(!o.every(e=>s(t,e,a)))throw new Error("Can not add duplicate data to array");r[i]=t.concat(o)}else{if(c(o)||n(e,i,u,o),!a(r,o))throw new Error("Can not add duplicate data to "+e);r[i]=o}}}}Object.defineProperty(t,"__esModule",{value:!0}),t.checkForInput=r,t.checkForOutput=function(e,t){const r=e[t];if(void 0===r)throw new Error("No output #"+t);return r},t.checkHasKey=function(e,t,r){if(e.key[0]<r)throw new Error("Use the method for your specific key instead of addUnknownKeyVal*");if(t&&0!==t.filter(t=>t.key.equals(e.key)).length)throw new Error("Duplicate Key: "+e.key.toString("hex"))},t.getEnumLength=function(e){let t=0;return Object.keys(e).forEach(e=>{Number(isNaN(Number(e)))&&t++}),t},t.inputCheckUncleanFinalized=function(e,t){let r=!1;if(t.nonWitnessUtxo||t.witnessUtxo){const e=!!t.redeemScript,n=!!t.witnessScript,i=!e||!!t.finalScriptSig,o=!n||!!t.finalScriptWitness,a=!!t.finalScriptSig||!!t.finalScriptWitness;r=i&&o&&a}if(!1===r)throw new Error(`Input #${e} has too much or too little data to clean`)},t.updateGlobal=i("global"),t.updateInput=i("input"),t.updateOutput=i("output"),t.addInputAttributes=function(e,n){const i=r(e,e.length-1);t.updateInput(n,i)},t.addOutputAttributes=function(e,n){const i=r(e,e.length-1);t.updateOutput(n,i)},t.defaultVersionSetter=function(e,t){if(!Be(t)||t.length<4)throw new Error("Set Version: Invalid Transaction");return t.writeUInt32LE(e,0),t},t.defaultLocktimeSetter=function(e,t){if(!Be(t)||t.length<4)throw new Error("Set Locktime: Invalid Transaction");return t.writeUInt32LE(e,t.length-4),t}}));er(OE);OE.checkForInput,OE.checkForOutput,OE.checkHasKey,OE.getEnumLength,OE.inputCheckUncleanFinalized,OE.updateGlobal,OE.updateInput,OE.updateOutput,OE.addInputAttributes,OE.addOutputAttributes,OE.defaultVersionSetter,OE.defaultLocktimeSetter;var AE=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});t.Psbt=class{constructor(e){this.inputs=[],this.outputs=[],this.globalMap={unsignedTx:e}}static fromBase64(e,t){const r=re.from(e,"base64");return this.fromBuffer(r,t)}static fromHex(e,t){const r=re.from(e,"hex");return this.fromBuffer(r,t)}static fromBuffer(e,t){const r=kE.psbtFromBuffer(e,t),n=new this(r.globalMap.unsignedTx);return Object.assign(n,r),n}toBase64(){return this.toBuffer().toString("base64")}toHex(){return this.toBuffer().toString("hex")}toBuffer(){return kE.psbtToBuffer(this)}updateGlobal(e){return OE.updateGlobal(e,this.globalMap),this}updateInput(e,t){const r=OE.checkForInput(this.inputs,e);return OE.updateInput(t,r),this}updateOutput(e,t){const r=OE.checkForOutput(this.outputs,e);return OE.updateOutput(t,r),this}addUnknownKeyValToGlobal(e){return OE.checkHasKey(e,this.globalMap.unknownKeyVals,OE.getEnumLength(sE.GlobalTypes)),this.globalMap.unknownKeyVals||(this.globalMap.unknownKeyVals=[]),this.globalMap.unknownKeyVals.push(e),this}addUnknownKeyValToInput(e,t){const r=OE.checkForInput(this.inputs,e);return OE.checkHasKey(t,r.unknownKeyVals,OE.getEnumLength(sE.InputTypes)),r.unknownKeyVals||(r.unknownKeyVals=[]),r.unknownKeyVals.push(t),this}addUnknownKeyValToOutput(e,t){const r=OE.checkForOutput(this.outputs,e);return OE.checkHasKey(t,r.unknownKeyVals,OE.getEnumLength(sE.OutputTypes)),r.unknownKeyVals||(r.unknownKeyVals=[]),r.unknownKeyVals.push(t),this}addInput(e){this.globalMap.unsignedTx.addInput(e),this.inputs.push({unknownKeyVals:[]});const t=e.unknownKeyVals||[],r=this.inputs.length-1;if(!Array.isArray(t))throw new Error("unknownKeyVals must be an Array");return t.forEach(e=>this.addUnknownKeyValToInput(r,e)),OE.addInputAttributes(this.inputs,e),this}addOutput(e){this.globalMap.unsignedTx.addOutput(e),this.outputs.push({unknownKeyVals:[]});const t=e.unknownKeyVals||[],r=this.outputs.length-1;if(!Array.isArray(t))throw new Error("unknownKeyVals must be an Array");return t.forEach(e=>this.addUnknownKeyValToInput(r,e)),OE.addOutputAttributes(this.outputs,e),this}clearFinalizedInput(e){const t=OE.checkForInput(this.inputs,e);OE.inputCheckUncleanFinalized(e,t);for(const e of Object.keys(t))["witnessUtxo","nonWitnessUtxo","finalScriptSig","finalScriptWitness","unknownKeyVals"].includes(e)||delete t[e];return this}combine(...e){const t=PE.combine([this].concat(e));return Object.assign(this,t),this}getTransaction(){return this.globalMap.unsignedTx.toBuffer()}}}));er(AE);AE.Psbt;var TE=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r={network:yS.bitcoin,maximumFeeRate:5e3};class n{constructor(e={},t=new AE.Psbt(new o)){this.data=t,this.opts=Object.assign({},r,e),this.__CACHE={__NON_WITNESS_UTXO_TX_CACHE:[],__NON_WITNESS_UTXO_BUF_CACHE:[],__TX_IN_CACHE:{},__TX:this.data.globalMap.unsignedTx.tx,__UNSAFE_SIGN_NONSEGWIT:!1},0===this.data.inputs.length&&this.setVersion(2);const n=(e,t,r,n)=>Object.defineProperty(e,t,{enumerable:r,writable:n});n(this,"__CACHE",!1,!0),n(this,"opts",!1,!0)}static fromBase64(e,t={}){const r=re.from(e,"base64");return this.fromBuffer(r,t)}static fromHex(e,t={}){const r=re.from(e,"hex");return this.fromBuffer(r,t)}static fromBuffer(e,t={}){const r=AE.Psbt.fromBuffer(e,i),o=new n(t,r);return function(e,t){e.ins.forEach(e=>{_(t,e)})}(o.__CACHE.__TX,o.__CACHE),o}get inputCount(){return this.data.inputs.length}get version(){return this.__CACHE.__TX.version}set version(e){this.setVersion(e)}get locktime(){return this.__CACHE.__TX.locktime}set locktime(e){this.setLocktime(e)}get txInputs(){return this.__CACHE.__TX.ins.map(e=>({hash:iE.cloneBuffer(e.hash),index:e.index,sequence:e.sequence}))}get txOutputs(){return this.__CACHE.__TX.outs.map(e=>{let t;try{t=QS.fromOutputScript(e.script,this.opts.network)}catch(e){}return{script:iE.cloneBuffer(e.script),value:e.value,address:t}})}combine(...e){return this.data.combine(...e.map(e=>e.data)),this}clone(){const e=n.fromBuffer(this.data.toBuffer());return e.opts=JSON.parse(JSON.stringify(this.opts)),e}setMaximumFeeRate(e){v(e),this.opts.maximumFeeRate=e}setVersion(e){v(e),y(this.data.inputs,"setVersion");const t=this.__CACHE;return t.__TX.version=e,t.__EXTRACTED_TX=void 0,this}setLocktime(e){v(e),y(this.data.inputs,"setLocktime");const t=this.__CACHE;return t.__TX.locktime=e,t.__EXTRACTED_TX=void 0,this}setInputSequence(e,t){v(t),y(this.data.inputs,"setInputSequence");const r=this.__CACHE;if(r.__TX.ins.length<=e)throw new Error("Input index too high");return r.__TX.ins[e].sequence=t,r.__EXTRACTED_TX=void 0,this}addInputs(e){return e.forEach(e=>this.addInput(e)),this}addInput(e){if(arguments.length>1||!e||void 0===e.hash||void 0===e.index)throw new Error("Invalid arguments for Psbt.addInput. Requires single object with at least [hash] and [index]");y(this.data.inputs,"addInput"),e.witnessScript&&F(e.witnessScript);const t=this.__CACHE;this.data.addInput(e);_(t,t.__TX.ins[t.__TX.ins.length-1]);const r=this.data.inputs.length-1,n=this.data.inputs[r];return n.nonWitnessUtxo&&N(this.__CACHE,n,r),t.__FEE=void 0,t.__FEE_RATE=void 0,t.__EXTRACTED_TX=void 0,this}addOutputs(e){return e.forEach(e=>this.addOutput(e)),this}addOutput(e){if(arguments.length>1||!e||void 0===e.value||void 0===e.address&&void 0===e.script)throw new Error("Invalid arguments for Psbt.addOutput. Requires single object with at least [script or address] and [value]");y(this.data.inputs,"addOutput");const{address:t}=e;if("string"==typeof t){const{network:r}=this.opts,n=QS.toOutputScript(t,r);e=Object.assign(e,{script:n})}const r=this.__CACHE;return this.data.addOutput(e),r.__FEE=void 0,r.__FEE_RATE=void 0,r.__EXTRACTED_TX=void 0,this}extractTransaction(e){if(!this.data.inputs.every(c))throw new Error("Not finalized");const t=this.__CACHE;if(e||function(e,t,r){const n=t.__FEE_RATE||e.getFeeRate(),i=t.__EXTRACTED_TX.virtualSize(),o=n*i;if(n>=r.maximumFeeRate)throw new Error(`Warning: You are paying around ${(o/1e8).toFixed(8)} in fees, which is ${n} satoshi per byte for a transaction with a VSize of ${i} bytes (segwit counted as 0.25 byte per byte). Use setMaximumFeeRate method to raise your threshold, or pass true to the first arg of extractTransaction.`)}(this,t,this.opts),t.__EXTRACTED_TX)return t.__EXTRACTED_TX;const r=t.__TX.clone();return R(this.data.inputs,r,t,!0),r}getFeeRate(){return I("__FEE_RATE","fee rate",this.data.inputs,this.__CACHE)}getFee(){return I("__FEE","fee",this.data.inputs,this.__CACHE)}finalizeAllInputs(){return OE.checkForInput(this.data.inputs,0),z(this.data.inputs.length).forEach(e=>this.finalizeInput(e)),this}finalizeInput(e,t=k){const r=OE.checkForInput(this.data.inputs,e),{script:n,isP2SH:i,isP2WSH:o,isSegwit:a}=function(e,t,r){const n=r.__TX,i={script:null,isSegwit:!1,isP2SH:!1,isP2WSH:!1};if(i.isP2SH=!!t.redeemScript,i.isP2WSH=!!t.witnessScript,t.witnessScript)i.script=t.witnessScript;else if(t.redeemScript)i.script=t.redeemScript;else if(t.nonWitnessUtxo){const o=M(r,t,e),a=n.ins[e].index;i.script=o.outs[a].script}else t.witnessUtxo&&(i.script=t.witnessUtxo.script);(t.witnessScript||d(i.script))&&(i.isSegwit=!0);return i}(e,r,this.__CACHE);if(!n)throw new Error("No script found for input #"+e);b(r);const{finalScriptSig:s,finalScriptWitness:c}=t(e,r,n,a,i,o);if(s&&this.data.updateInput(e,{finalScriptSig:s}),c&&this.data.updateInput(e,{finalScriptWitness:c}),!s&&!c)throw new Error("Unknown error finalizing input #"+e);return this.data.clearFinalizedInput(e),this}getInputType(e){const t=OE.checkForInput(this.data.inputs,e),r=U(L(e,t,this.__CACHE),e,"input",t.redeemScript||j(t.finalScriptSig),t.witnessScript||D(t.finalScriptWitness));return("raw"===r.type?"":r.type+"-")+V(r.meaningfulScript)}inputHasPubkey(e,t){return function(e,t,r,n){const i=L(r,t,n),{meaningfulScript:o}=U(i,r,"input",t.redeemScript,t.witnessScript);return H(e,o)}(t,OE.checkForInput(this.data.inputs,e),e,this.__CACHE)}inputHasHDKey(e,t){const r=OE.checkForInput(this.data.inputs,e),n=g(t);return!!r.bip32Derivation&&r.bip32Derivation.some(n)}outputHasPubkey(e,t){return function(e,t,r,n){const i=n.__TX.outs[r].script,{meaningfulScript:o}=U(i,r,"output",t.redeemScript,t.witnessScript);return H(e,o)}(t,OE.checkForOutput(this.data.outputs,e),e,this.__CACHE)}outputHasHDKey(e,t){const r=OE.checkForOutput(this.data.outputs,e),n=g(t);return!!r.bip32Derivation&&r.bip32Derivation.some(n)}validateSignaturesOfAllInputs(){OE.checkForInput(this.data.inputs,0);return z(this.data.inputs.length).map(e=>this.validateSignaturesOfInput(e)).reduce((e,t)=>!0===t&&e,!0)}validateSignaturesOfInput(e,t){const r=this.data.inputs[e],n=(r||{}).partialSig;if(!r||!n||n.length<1)throw new Error("No signatures to validate");const i=t?n.filter(e=>e.pubkey.equals(t)):n;if(i.length<1)throw new Error("No signatures for this pubkey");const o=[];let a,s,c;for(const t of i){const n=CS.signature.decode(t.signature),{hash:i,script:u}=c!==n.hashType?O(e,Object.assign({},r,{sighashType:n.hashType}),this.__CACHE,!0):{hash:a,script:s};c=n.hashType,a=i,s=u,w(t.pubkey,u,"verify");const l=ZS.fromPublicKey(t.pubkey);o.push(l.verify(i,n.signature))}return o.every(e=>!0===e)}signAllInputsHD(e,t=[oE.Transaction.SIGHASH_ALL]){if(!e||!e.publicKey||!e.fingerprint)throw new Error("Need HDSigner to sign input");const r=[];for(const n of z(this.data.inputs.length))try{this.signInputHD(n,e,t),r.push(!0)}catch(e){r.push(!1)}if(r.every(e=>!1===e))throw new Error("No inputs were signed");return this}signAllInputsHDAsync(e,t=[oE.Transaction.SIGHASH_ALL]){return new Promise((r,n)=>{if(!e||!e.publicKey||!e.fingerprint)return n(new Error("Need HDSigner to sign input"));const i=[],o=[];for(const r of z(this.data.inputs.length))o.push(this.signInputHDAsync(r,e,t).then(()=>{i.push(!0)},()=>{i.push(!1)}));return Promise.all(o).then(()=>{if(i.every(e=>!1===e))return n(new Error("No inputs were signed"));r()})})}signInputHD(e,t,r=[oE.Transaction.SIGHASH_ALL]){if(!t||!t.publicKey||!t.fingerprint)throw new Error("Need HDSigner to sign input");return A(e,this.data.inputs,t).forEach(t=>this.signInput(e,t,r)),this}signInputHDAsync(e,t,r=[oE.Transaction.SIGHASH_ALL]){return new Promise((n,i)=>{if(!t||!t.publicKey||!t.fingerprint)return i(new Error("Need HDSigner to sign input"));const o=A(e,this.data.inputs,t).map(t=>this.signInputAsync(e,t,r));return Promise.all(o).then(()=>{n()}).catch(i)})}signAllInputs(e,t=[oE.Transaction.SIGHASH_ALL]){if(!e||!e.publicKey)throw new Error("Need Signer to sign input");const r=[];for(const n of z(this.data.inputs.length))try{this.signInput(n,e,t),r.push(!0)}catch(e){r.push(!1)}if(r.every(e=>!1===e))throw new Error("No inputs were signed");return this}signAllInputsAsync(e,t=[oE.Transaction.SIGHASH_ALL]){return new Promise((r,n)=>{if(!e||!e.publicKey)return n(new Error("Need Signer to sign input"));const i=[],o=[];for(const[r]of this.data.inputs.entries())o.push(this.signInputAsync(r,e,t).then(()=>{i.push(!0)},()=>{i.push(!1)}));return Promise.all(o).then(()=>{if(i.every(e=>!1===e))return n(new Error("No inputs were signed"));r()})})}signInput(e,t,r=[oE.Transaction.SIGHASH_ALL]){if(!t||!t.publicKey)throw new Error("Need Signer to sign input");const{hash:n,sighashType:i}=P(this.data.inputs,e,t.publicKey,this.__CACHE,r),o=[{pubkey:t.publicKey,signature:CS.signature.encode(t.sign(n),i)}];return this.data.updateInput(e,{partialSig:o}),this}signInputAsync(e,t,r=[oE.Transaction.SIGHASH_ALL]){return Promise.resolve().then(()=>{if(!t||!t.publicKey)throw new Error("Need Signer to sign input");const{hash:n,sighashType:i}=P(this.data.inputs,e,t.publicKey,this.__CACHE,r);return Promise.resolve(t.sign(n)).then(r=>{const n=[{pubkey:t.publicKey,signature:CS.signature.encode(r,i)}];this.data.updateInput(e,{partialSig:n})})})}toBuffer(){return a(this.__CACHE),this.data.toBuffer()}toHex(){return a(this.__CACHE),this.data.toHex()}toBase64(){return a(this.__CACHE),this.data.toBase64()}updateGlobal(e){return this.data.updateGlobal(e),this}updateInput(e,t){return t.witnessScript&&F(t.witnessScript),this.data.updateInput(e,t),t.nonWitnessUtxo&&N(this.__CACHE,this.data.inputs[e],e),this}updateOutput(e,t){return this.data.updateOutput(e,t),this}addUnknownKeyValToGlobal(e){return this.data.addUnknownKeyValToGlobal(e),this}addUnknownKeyValToInput(e,t){return this.data.addUnknownKeyValToInput(e,t),this}addUnknownKeyValToOutput(e,t){return this.data.addUnknownKeyValToOutput(e,t),this}clearFinalizedInput(e){return this.data.clearFinalizedInput(e),this}}t.Psbt=n;const i=e=>new o(e);class o{constructor(e=re.from([2,0,0,0,0,0,0,0,0,0])){this.tx=oE.Transaction.fromBuffer(e),function(e){if(!e.ins.every(e=>e.script&&0===e.script.length&&e.witness&&0===e.witness.length))throw new Error("Format Error: Transaction ScriptSigs are not empty")}(this.tx),Object.defineProperty(this,"tx",{enumerable:!1,writable:!0})}getInputOutputCounts(){return{inputCount:this.tx.ins.length,outputCount:this.tx.outs.length}}addInput(e){if(void 0===e.hash||void 0===e.index||!Be(e.hash)&&"string"!=typeof e.hash||"number"!=typeof e.index)throw new Error("Error adding input.");const t="string"==typeof e.hash?iE.reverseBuffer(re.from(e.hash,"hex")):e.hash;this.tx.addInput(t,e.index,e.sequence)}addOutput(e){if(void 0===e.script||void 0===e.value||!Be(e.script)||"number"!=typeof e.value)throw new Error("Error adding output.");this.tx.addOutput(e.script,e.value)}toBuffer(){return this.tx.toBuffer()}}function a(e){if(!1!==e.__UNSAFE_SIGN_NONSEGWIT)throw new Error("Not BIP174 compliant, can not export")}function s(e,t,r){if(!t)return!1;let n;if(n=r?r.map(e=>{const r=ZS.fromPublicKey(e,{compressed:!0}).publicKey;return t.find(e=>e.pubkey.equals(r))}).filter(e=>!!e):t,n.length>e)throw new Error("Too many signatures");return n.length===e}function c(e){return!!e.finalScriptSig||!!e.finalScriptWitness}function u(e){return t=>{try{return e({output:t}),!0}catch(e){return!1}}}const l=u(XS.p2ms),f=u(XS.p2pk),h=u(XS.p2pkh),d=u(XS.p2wpkh),p=u(XS.p2wsh),m=u(XS.p2sh);function g(e){return t=>!!t.masterFingerprint.equals(e.fingerprint)&&!!e.derivePath(t.path).publicKey.equals(t.pubkey)}function v(e){if("number"!=typeof e||e!==Math.floor(e)||e>4294967295||e<0)throw new Error("Invalid 32 bit integer")}function y(e,t){e.forEach(e=>{let r=!1,n=[];if(0===(e.partialSig||[]).length){if(!e.finalScriptSig&&!e.finalScriptWitness)return;n=function(e){const t=e.finalScriptSig&&CS.decompile(e.finalScriptSig)||[],r=e.finalScriptWitness&&CS.decompile(e.finalScriptWitness)||[];return t.concat(r).filter(e=>Be(e)&&CS.isCanonicalScriptSignature(e)).map(e=>({signature:e}))}(e)}else n=e.partialSig;if(n.forEach(e=>{const{hashType:n}=CS.signature.decode(e.signature),i=[];n&oE.Transaction.SIGHASH_ANYONECANPAY&&i.push("addInput");switch(31&n){case oE.Transaction.SIGHASH_ALL:break;case oE.Transaction.SIGHASH_SINGLE:case oE.Transaction.SIGHASH_NONE:i.push("addOutput"),i.push("setInputSequence")}-1===i.indexOf(t)&&(r=!0)}),r)throw new Error("Can not modify transaction, signatures exist.")})}function b(e){if(!e.sighashType||!e.partialSig)return;const{partialSig:t,sighashType:r}=e;t.forEach(e=>{const{hashType:t}=CS.signature.decode(e.signature);if(r!==t)throw new Error("Signature sighash does not match input sighash type")})}function w(e,t,r){if(!H(e,t))throw new Error(`Can not ${r} for this input with the key ${e.toString("hex")}`)}function _(e,t){const r=iE.reverseBuffer(re.from(t.hash)).toString("hex")+":"+t.index;if(e.__TX_IN_CACHE[r])throw new Error("Duplicate input detected.");e.__TX_IN_CACHE[r]=1}function S(e,t){return(r,n,i,o)=>{const a=e({redeem:{output:i}}).output;if(!n.equals(a))throw new Error(`${t} for ${o} #${r} doesn't match the scriptPubKey in the prevout`)}}const E=S(XS.p2sh,"Redeem script"),x=S(XS.p2wsh,"Witness script");function I(e,t,r,n){if(!r.every(c))throw new Error("PSBT must be finalized to calculate "+t);if("__FEE_RATE"===e&&n.__FEE_RATE)return n.__FEE_RATE;if("__FEE"===e&&n.__FEE)return n.__FEE;let i,o=!0;return n.__EXTRACTED_TX?(i=n.__EXTRACTED_TX,o=!1):i=n.__TX.clone(),R(r,i,n,o),"__FEE_RATE"===e?n.__FEE_RATE:"__FEE"===e?n.__FEE:void 0}function k(e,t,r,n,i,o){const a=V(r);if(!function(e,t,r){switch(r){case"pubkey":case"pubkeyhash":case"witnesspubkeyhash":return s(1,e.partialSig);case"multisig":const r=XS.p2ms({output:t});return s(r.m,e.partialSig,r.pubkeys);default:return!1}}(t,r,a))throw new Error("Can not finalize input #"+e);return function(e,t,r,n,i,o){let a,s;const c=function(e,t,r){let n;switch(t){case"multisig":const t=function(e,t){return XS.p2ms({output:e}).pubkeys.map(e=>(t.filter(t=>t.pubkey.equals(e))[0]||{}).signature).filter(e=>!!e)}(e,r);n=XS.p2ms({output:e,signatures:t});break;case"pubkey":n=XS.p2pk({output:e,signature:r[0].signature});break;case"pubkeyhash":n=XS.p2pkh({output:e,pubkey:r[0].pubkey,signature:r[0].signature});break;case"witnesspubkeyhash":n=XS.p2wpkh({output:e,pubkey:r[0].pubkey,signature:r[0].signature})}return n}(e,t,r),u=o?XS.p2wsh({redeem:c}):null,l=i?XS.p2sh({redeem:u||c}):null;n?(s=C(u?u.witness:c.witness),l&&(a=l.input)):a=l?l.input:c.input;return{finalScriptSig:a,finalScriptWitness:s}}(r,a,t.partialSig,n,i,o)}function P(e,t,r,n,i){const o=OE.checkForInput(e,t),{hash:a,sighashType:s,script:c}=O(t,o,n,!1,i);return w(r,c,"sign"),{hash:a,sighashType:s}}function O(e,t,r,n,i){const o=r.__TX,a=t.sighashType||oE.Transaction.SIGHASH_ALL;if(i&&i.indexOf(a)<0){const e=function(e){let t=e&oE.Transaction.SIGHASH_ANYONECANPAY?"SIGHASH_ANYONECANPAY | ":"";switch(31&e){case oE.Transaction.SIGHASH_ALL:t+="SIGHASH_ALL";break;case oE.Transaction.SIGHASH_SINGLE:t+="SIGHASH_SINGLE";break;case oE.Transaction.SIGHASH_NONE:t+="SIGHASH_NONE"}return t}(a);throw new Error("Sighash type is not allowed. Retry the sign method passing the sighashTypes array of whitelisted types. Sighash type: "+e)}let s,c;if(t.nonWitnessUtxo){const n=M(r,t,e),i=o.ins[e].hash,a=n.getHash();if(!i.equals(a))throw new Error(`Non-witness UTXO hash for input #${e} doesn't match the hash specified in the prevout`);const s=o.ins[e].index;c=n.outs[s]}else{if(!t.witnessUtxo)throw new Error("Need a Utxo input item for signing");c=t.witnessUtxo}const{meaningfulScript:u,type:l}=U(c.script,e,"input",t.redeemScript,t.witnessScript);if(["p2sh-p2wsh","p2wsh"].indexOf(l)>=0)s=o.hashForWitnessV0(e,u,c.value,a);else if(d(u)){const t=XS.p2pkh({hash:u.slice(2)}).output;s=o.hashForWitnessV0(e,t,c.value,a)}else{if(void 0===t.nonWitnessUtxo&&!1===r.__UNSAFE_SIGN_NONSEGWIT)throw new Error(`Input #${e} has witnessUtxo but non-segwit script: `+u.toString("hex"));n||!1===r.__UNSAFE_SIGN_NONSEGWIT||console.warn("Warning: Signing non-segwit inputs without the full parent transaction means there is a chance that a miner could feed you incorrect information to trick you into paying large fees. This behavior is the same as the old TransactionBuilder class when signing non-segwit scripts. You are not able to export this Psbt with toBuffer|toBase64|toHex since it is not BIP174 compliant.\n*********************\nPROCEED WITH CAUTION!\n*********************"),s=o.hashForSignature(e,u,a)}return{script:u,sighashType:a,hash:s}}function A(e,t,r){const n=OE.checkForInput(t,e);if(!n.bip32Derivation||0===n.bip32Derivation.length)throw new Error("Need bip32Derivation to sign with HD");const i=n.bip32Derivation.map(e=>e.masterFingerprint.equals(r.fingerprint)?e:void 0).filter(e=>!!e);if(0===i.length)throw new Error("Need one bip32Derivation masterFingerprint to match the HDSigner fingerprint");return i.map(e=>{const t=r.derivePath(e.path);if(!e.pubkey.equals(t.publicKey))throw new Error("pubkey did not match bip32Derivation");return t})}function T(e){let t=0;function r(){const r=gE.decode(e,t);return t+=gE.decode.bytes,r}function n(){return function(r){return t+=r,e.slice(t-r,t)}(r())}return function(){const e=r(),t=[];for(let r=0;r<e;r++)t.push(n());return t}()}function C(e){let t=re.allocUnsafe(0);function r(e){const r=t.length,n=gE.encodingLength(e);t=re.concat([t,re.allocUnsafe(n)]),gE.encode(e,t,r)}function n(e){r(e.length),function(e){t=re.concat([t,re.from(e)])}(e)}var i;return r((i=e).length),i.forEach(n),t}function N(e,t,r){e.__NON_WITNESS_UTXO_BUF_CACHE[r]=t.nonWitnessUtxo;const n=oE.Transaction.fromBuffer(t.nonWitnessUtxo);e.__NON_WITNESS_UTXO_TX_CACHE[r]=n;const i=e,o=r;delete t.nonWitnessUtxo,Object.defineProperty(t,"nonWitnessUtxo",{enumerable:!0,get(){const e=i.__NON_WITNESS_UTXO_BUF_CACHE[o],t=i.__NON_WITNESS_UTXO_TX_CACHE[o];if(void 0!==e)return e;{const e=t.toBuffer();return i.__NON_WITNESS_UTXO_BUF_CACHE[o]=e,e}},set(e){i.__NON_WITNESS_UTXO_BUF_CACHE[o]=e}})}function R(e,t,r,n){let i=0;e.forEach((e,o)=>{if(n&&e.finalScriptSig&&(t.ins[o].script=e.finalScriptSig),n&&e.finalScriptWitness&&(t.ins[o].witness=T(e.finalScriptWitness)),e.witnessUtxo)i+=e.witnessUtxo.value;else if(e.nonWitnessUtxo){const n=M(r,e,o),a=t.ins[o].index,s=n.outs[a];i+=s.value}});const o=t.outs.reduce((e,t)=>e+t.value,0),a=i-o;if(a<0)throw new Error("Outputs are spending more than Inputs");const s=t.virtualSize();r.__FEE=a,r.__EXTRACTED_TX=t,r.__FEE_RATE=Math.floor(a/s)}function M(e,t,r){const n=e.__NON_WITNESS_UTXO_TX_CACHE;return n[r]||N(e,t,r),n[r]}function L(e,t,r){if(void 0!==t.witnessUtxo)return t.witnessUtxo.script;if(void 0!==t.nonWitnessUtxo){return M(r,t,e).outs[r.__TX.ins[e].index].script}throw new Error("Can't find pubkey in input without Utxo data")}function j(e){if(!e)return;const t=CS.decompile(e);if(!t)return;const r=t[t.length-1];if(!Be(r)||B(r)||(n=r,CS.isCanonicalScriptSignature(n)))return;var n;return CS.decompile(r)?r:void 0}function D(e){if(!e)return;const t=T(e),r=t[t.length-1];if(B(r))return;return CS.decompile(r)?r:void 0}function B(e){return 33===e.length&&CS.isCanonicalPubKey(e)}function U(e,t,r,n,i){const o=m(e),a=o&&n&&p(n),s=p(e);if(o&&void 0===n)throw new Error("scriptPubkey is P2SH but redeemScript missing");if((s||a)&&void 0===i)throw new Error("scriptPubkey or redeemScript is P2WSH but witnessScript missing");let c;return a?(c=i,E(t,e,n,r),x(t,n,i,r),F(c)):s?(c=i,x(t,e,i,r),F(c)):o?(c=n,E(t,e,n,r)):c=e,{meaningfulScript:c,type:a?"p2sh-p2wsh":o?"p2sh":s?"p2wsh":"raw"}}function F(e){if(d(e)||m(e))throw new Error("P2WPKH or P2SH can not be contained within P2WSH")}function H(e,t){const r=jS.hash160(e),n=CS.decompile(t);if(null===n)throw new Error("Unknown script error");return n.some(t=>"number"!=typeof t&&(t.equals(e)||t.equals(r)))}function V(e){return d(e)?"witnesspubkeyhash":h(e)?"pubkeyhash":l(e)?"multisig":f(e)?"pubkey":"nonstandard"}function z(e){return[...Array(e).keys()]}}));er(TE);TE.Psbt;var CE=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=CS;function n(e){return e===r.OPS.OP_0||CS.isCanonicalScriptSignature(e)}function i(e,t){const i=CS.decompile(e);return!(i.length<2)&&(i[0]===r.OPS.OP_0&&(t?i.slice(1).every(n):i.slice(1).every(CS.isCanonicalScriptSignature)))}t.check=i,i.toJSON=()=>"multisig input"}));er(CE);CE.check;var NE=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=CS,n=r.OPS.OP_RESERVED;function i(e,t){const i=CS.decompile(e);if(i.length<4)return!1;if(i[i.length-1]!==r.OPS.OP_CHECKMULTISIG)return!1;if(!wS.Number(i[0]))return!1;if(!wS.Number(i[i.length-2]))return!1;const o=i[0]-n,a=i[i.length-2]-n;if(o<=0)return!1;if(a>16)return!1;if(o>a)return!1;if(a!==i.length-3)return!1;if(t)return!0;return i.slice(1,-2).every(CS.isCanonicalPubKey)}t.check=i,i.toJSON=()=>"multi-sig output"}));er(NE);NE.check;var RE=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.input=CE,t.output=NE}));er(RE);RE.input,RE.output;var ME=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=CS.OPS;function n(e){const t=CS.compile(e);return t.length>1&&t[0]===r.OP_RETURN}t.check=n,n.toJSON=()=>"null data output";const i={check:n};t.output=i}));er(ME);ME.check,ME.output;var LE=tr((function(e,t){function r(e){const t=CS.decompile(e);return 1===t.length&&CS.isCanonicalScriptSignature(t[0])}Object.defineProperty(t,"__esModule",{value:!0}),t.check=r,r.toJSON=()=>"pubKey input"}));er(LE);LE.check;var jE=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=CS;function n(e){const t=CS.decompile(e);return 2===t.length&&CS.isCanonicalPubKey(t[0])&&t[1]===r.OPS.OP_CHECKSIG}t.check=n,n.toJSON=()=>"pubKey output"}));er(jE);jE.check;var DE=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.input=LE,t.output=jE}));er(DE);DE.input,DE.output;var BE=tr((function(e,t){function r(e){const t=CS.decompile(e);return 2===t.length&&CS.isCanonicalScriptSignature(t[0])&&CS.isCanonicalPubKey(t[1])}Object.defineProperty(t,"__esModule",{value:!0}),t.check=r,r.toJSON=()=>"pubKeyHash input"}));er(BE);BE.check;var UE=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=CS;function n(e){const t=CS.compile(e);return 25===t.length&&t[0]===r.OPS.OP_DUP&&t[1]===r.OPS.OP_HASH160&&20===t[2]&&t[23]===r.OPS.OP_EQUALVERIFY&&t[24]===r.OPS.OP_CHECKSIG}t.check=n,n.toJSON=()=>"pubKeyHash output"}));er(UE);UE.check;var FE=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.input=BE,t.output=UE}));er(FE);FE.input,FE.output;var HE=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=CS;function n(e){const t=CS.compile(e);return 22===t.length&&t[0]===r.OPS.OP_0&&20===t[1]}t.check=n,n.toJSON=()=>"Witness pubKeyHash output"}));er(HE);HE.check;var VE=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=CS;function n(e){const t=CS.compile(e);return 34===t.length&&t[0]===r.OPS.OP_0&&32===t[1]}t.check=n,n.toJSON=()=>"Witness scriptHash output"}));er(VE);VE.check;var zE=tr((function(e,t){function r(e,t){const r=CS.decompile(e);if(r.length<1)return!1;const n=r[r.length-1];if(!Be(n))return!1;const i=CS.decompile(CS.compile(r.slice(0,-1))),o=CS.decompile(n);return!!o&&(!!CS.isPushOnly(i)&&(1===r.length?VE.check(o)||HE.check(o):!(!FE.input.check(i)||!FE.output.check(o))||(!(!RE.input.check(i,t)||!RE.output.check(o))||!(!DE.input.check(i)||!DE.output.check(o)))))}Object.defineProperty(t,"__esModule",{value:!0}),t.check=r,r.toJSON=()=>"scriptHash input"}));er(zE);zE.check;var qE=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=CS;function n(e){const t=CS.compile(e);return 23===t.length&&t[0]===r.OPS.OP_HASH160&&20===t[1]&&t[22]===r.OPS.OP_EQUAL}t.check=n,n.toJSON=()=>"scriptHash output"}));er(qE);qE.check;var KE=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.input=zE,t.output=qE}));er(KE);KE.input,KE.output;var $E=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=CS,n=re.from("aa21a9ed","hex");function i(e){const t=CS.compile(e);return t.length>37&&t[0]===r.OPS.OP_RETURN&&36===t[1]&&t.slice(2,6).equals(n)}t.check=i,i.toJSON=()=>"Witness commitment output",t.encode=function(e){hS(wS.Hash256bit,e);const t=re.allocUnsafe(36);return n.copy(t,0),e.copy(t,4),CS.compile([r.OPS.OP_RETURN,t])},t.decode=function(e){return hS(i,e),CS.decompile(e)[1].slice(4,36)}}));er($E);$E.check,$E.encode,$E.decode;var GE=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.output=$E}));er(GE);GE.output;var JE=tr((function(e,t){function r(e){const t=CS.decompile(e);return 2===t.length&&CS.isCanonicalScriptSignature(t[0])&&(r=t[1],CS.isCanonicalPubKey(r)&&33===r.length);var r}Object.defineProperty(t,"__esModule",{value:!0}),t.check=r,r.toJSON=()=>"witnessPubKeyHash input"}));er(JE);JE.check;var WE=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.input=JE,t.output=HE}));er(WE);WE.input,WE.output;var XE=tr((function(e,t){function r(e,t){if(hS(hS.Array,e),e.length<1)return!1;const r=e[e.length-1];if(!Be(r))return!1;const n=CS.decompile(r);if(!n||0===n.length)return!1;const i=CS.compile(e.slice(0,-1));return!(!FE.input.check(i)||!FE.output.check(n))||(!(!RE.input.check(i,t)||!RE.output.check(n))||!(!DE.input.check(i)||!DE.output.check(n)))}Object.defineProperty(t,"__esModule",{value:!0}),t.check=r,r.toJSON=()=>"witnessScriptHash input"}));er(XE);XE.check;var QE=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.input=XE,t.output=VE}));er(QE);QE.input,QE.output;var YE=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r={P2MS:"multisig",NONSTANDARD:"nonstandard",NULLDATA:"nulldata",P2PK:"pubkey",P2PKH:"pubkeyhash",P2SH:"scripthash",P2WPKH:"witnesspubkeyhash",P2WSH:"witnessscripthash",WITNESS_COMMITMENT:"witnesscommitment"};t.types=r,t.output=function(e){if(WE.output.check(e))return r.P2WPKH;if(QE.output.check(e))return r.P2WSH;if(FE.output.check(e))return r.P2PKH;if(KE.output.check(e))return r.P2SH;const t=CS.decompile(e);if(!t)throw new TypeError("Invalid script");return RE.output.check(t)?r.P2MS:DE.output.check(t)?r.P2PK:GE.output.check(t)?r.WITNESS_COMMITMENT:ME.output.check(t)?r.NULLDATA:r.NONSTANDARD},t.input=function(e,t){const n=CS.decompile(e);if(!n)throw new TypeError("Invalid script");return FE.input.check(n)?r.P2PKH:KE.input.check(n,t)?r.P2SH:RE.input.check(n,t)?r.P2MS:DE.input.check(n)?r.P2PK:r.NONSTANDARD},t.witness=function(e,t){const n=CS.decompile(e);if(!n)throw new TypeError("Invalid script");return WE.input.check(n)?r.P2WPKH:QE.input.check(n,t)?r.P2WSH:r.NONSTANDARD}}));er(YE);YE.types,YE.output,YE.input,YE.witness;var ZE=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=CS,n=YE.types,i=new Set(["p2pkh","p2pk","p2wpkh","p2ms","p2sh-p2pkh","p2sh-p2pk","p2sh-p2wpkh","p2sh-p2ms","p2wsh-p2pkh","p2wsh-p2pk","p2wsh-p2ms","p2sh-p2wsh-p2pkh","p2sh-p2wsh-p2pk","p2sh-p2wsh-p2ms"]);function o(e,t,r){try{hS(e,t)}catch(e){throw new Error(r)}}class a{constructor(e=yS.bitcoin,t=2500){this.network=e,this.maximumFeeRate=t,this.__PREV_TX_SET={},this.__INPUTS=[],this.__TX=new oE.Transaction,this.__TX.version=2,this.__USE_LOW_R=!1,console.warn("Deprecation Warning: TransactionBuilder will be removed in the future. (v6.x.x or later) Please use the Psbt class instead. Examples of usage are available in the transactions-psbt.js integration test file on our Github. A high level explanation is available in the psbt.ts and psbt.js files as well.")}static fromTransaction(e,t){const r=new a(t);return r.setVersion(e.version),r.setLockTime(e.locktime),e.outs.forEach(e=>{r.addOutput(e.script,e.value)}),e.ins.forEach(e=>{r.__addInputUnsafe(e.hash,e.index,{sequence:e.sequence,script:e.script,witness:e.witness})}),r.__INPUTS.forEach((t,r)=>{!function(e,t,r){if(e.redeemScriptType!==n.P2MS||!e.redeemScript)return;if(e.pubkeys.length===e.signatures.length)return;const i=e.signatures.concat();e.signatures=e.pubkeys.map(n=>{const o=ZS.fromPublicKey(n);let a;return i.some((n,s)=>{if(!n)return!1;const c=CS.signature.decode(n),u=t.hashForSignature(r,e.redeemScript,c.hashType);return!!o.verify(u,c.signature)&&(i[s]=void 0,a=n,!0)}),a})}(t,e,r)}),r}setLowR(e){return hS(hS.maybe(hS.Boolean),e),void 0===e&&(e=!0),this.__USE_LOW_R=e,e}setLockTime(e){if(hS(wS.UInt32,e),this.__INPUTS.some(e=>!!e.signatures&&e.signatures.some(e=>void 0!==e)))throw new Error("No, this would invalidate signatures");this.__TX.locktime=e}setVersion(e){hS(wS.UInt32,e),this.__TX.version=e}addInput(e,t,r,n){if(!this.__canModifyInputs())throw new Error("No, this would invalidate signatures");let i;if("string"==typeof(o=e)||o instanceof String)e=iE.reverseBuffer(re.from(e,"hex"));else if(function(e){return e instanceof oE.Transaction}(e)){const r=e.outs[t];n=r.script,i=r.value,e=e.getHash(!1)}var o;return this.__addInputUnsafe(e,t,{sequence:r,prevOutScript:n,value:i})}addOutput(e,t){if(!this.__canModifyOutputs())throw new Error("No, this would invalidate signatures");return"string"==typeof e&&(e=QS.toOutputScript(e,this.network)),this.__TX.addOutput(e,t)}build(){return this.__build(!1)}buildIncomplete(){return this.__build(!0)}sign(e,t,r,a,u,l){!function({input:e,ourPubKey:t,keyPair:r,signatureHash:n,hashType:i,useLowR:o}){let a=!1;for(const[s,c]of e.pubkeys.entries()){if(!t.equals(c))continue;if(e.signatures[s])throw new Error("Signature already exists");if(33!==t.length&&e.hasWitness)throw new Error("BIP143 rejects uncompressed public keys in P2WPKH or P2WSH");const u=r.sign(n,o);e.signatures[s]=CS.signature.encode(u,i),a=!0}if(!a)throw new Error("Key pair cannot sign for this input")}(function(e,t,r,a,u,l,f,h,d,p,m){let g;if("number"==typeof u)console.warn("DEPRECATED: TransactionBuilder sign method arguments will change in v6, please use the TxbSignArg interface"),g=u;else{if("object"!=typeof u)throw new TypeError("TransactionBuilder sign first arg must be TxbSignArg or number");!function(e,t){if(!i.has(t.prevOutScriptType))throw new TypeError(`Unknown prevOutScriptType "${t.prevOutScriptType}"`);o(hS.Number,t.vin,"sign must include vin parameter as Number (input index)"),o(wS.Signer,t.keyPair,"sign must include keyPair parameter as Signer interface"),o(hS.maybe(hS.Number),t.hashType,"sign hashType parameter must be a number");const r=(e[t.vin]||[]).prevOutType,n=t.prevOutScriptType;switch(n){case"p2pkh":if(r&&"pubkeyhash"!==r)throw new TypeError(`input #${t.vin} is not of type p2pkh: ${r}`);o(hS.value(void 0),t.witnessScript,n+" requires NO witnessScript"),o(hS.value(void 0),t.redeemScript,n+" requires NO redeemScript"),o(hS.value(void 0),t.witnessValue,n+" requires NO witnessValue");break;case"p2pk":if(r&&"pubkey"!==r)throw new TypeError(`input #${t.vin} is not of type p2pk: ${r}`);o(hS.value(void 0),t.witnessScript,n+" requires NO witnessScript"),o(hS.value(void 0),t.redeemScript,n+" requires NO redeemScript"),o(hS.value(void 0),t.witnessValue,n+" requires NO witnessValue");break;case"p2wpkh":if(r&&"witnesspubkeyhash"!==r)throw new TypeError(`input #${t.vin} is not of type p2wpkh: ${r}`);o(hS.value(void 0),t.witnessScript,n+" requires NO witnessScript"),o(hS.value(void 0),t.redeemScript,n+" requires NO redeemScript"),o(wS.Satoshi,t.witnessValue,n+" requires witnessValue");break;case"p2ms":if(r&&"multisig"!==r)throw new TypeError(`input #${t.vin} is not of type p2ms: ${r}`);o(hS.value(void 0),t.witnessScript,n+" requires NO witnessScript"),o(hS.value(void 0),t.redeemScript,n+" requires NO redeemScript"),o(hS.value(void 0),t.witnessValue,n+" requires NO witnessValue");break;case"p2sh-p2wpkh":if(r&&"scripthash"!==r)throw new TypeError(`input #${t.vin} is not of type p2sh-p2wpkh: ${r}`);o(hS.value(void 0),t.witnessScript,n+" requires NO witnessScript"),o(hS.Buffer,t.redeemScript,n+" requires redeemScript"),o(wS.Satoshi,t.witnessValue,n+" requires witnessValue");break;case"p2sh-p2ms":case"p2sh-p2pk":case"p2sh-p2pkh":if(r&&"scripthash"!==r)throw new TypeError(`input #${t.vin} is not of type ${n}: ${r}`);o(hS.value(void 0),t.witnessScript,n+" requires NO witnessScript"),o(hS.Buffer,t.redeemScript,n+" requires redeemScript"),o(hS.value(void 0),t.witnessValue,n+" requires NO witnessValue");break;case"p2wsh-p2ms":case"p2wsh-p2pk":case"p2wsh-p2pkh":if(r&&"witnessscripthash"!==r)throw new TypeError(`input #${t.vin} is not of type ${n}: ${r}`);o(hS.Buffer,t.witnessScript,n+" requires witnessScript"),o(hS.value(void 0),t.redeemScript,n+" requires NO redeemScript"),o(wS.Satoshi,t.witnessValue,n+" requires witnessValue");break;case"p2sh-p2wsh-p2ms":case"p2sh-p2wsh-p2pk":case"p2sh-p2wsh-p2pkh":if(r&&"scripthash"!==r)throw new TypeError(`input #${t.vin} is not of type ${n}: ${r}`);o(hS.Buffer,t.witnessScript,n+" requires witnessScript"),o(hS.Buffer,t.redeemScript,n+" requires witnessScript"),o(wS.Satoshi,t.witnessValue,n+" requires witnessScript")}}(t,u),({vin:g,keyPair:l,redeemScript:f,hashType:h,witnessValue:d,witnessScript:p}=u)}if(void 0===l)throw new Error("sign requires keypair");if(l.network&&l.network!==e)throw new TypeError("Inconsistent network");if(!t[g])throw new Error("No input at index: "+g);if(h=h||oE.Transaction.SIGHASH_ALL,r(h))throw new Error("Transaction needs outputs");const v=t[g];if(void 0!==v.redeemScript&&f&&!v.redeemScript.equals(f))throw new Error("Inconsistent redeemScript");const y=l.publicKey||l.getPublicKey&&l.getPublicKey();if(!c(v)){if(void 0!==d){if(void 0!==v.value&&v.value!==d)throw new Error("Input did not match witnessValue");hS(wS.Satoshi,d),v.value=d}if(!c(v)){const e=function(e,t,r,i){if(r&&i){const o=XS.p2wsh({redeem:{output:i}}),a=XS.p2wsh({output:r}),c=XS.p2sh({redeem:{output:r}}),u=XS.p2sh({redeem:o});if(!o.hash.equals(a.hash))throw new Error("Witness script inconsistent with prevOutScript");if(!c.hash.equals(u.hash))throw new Error("Redeem script inconsistent with prevOutScript");const l=s(o.redeem.output,t);if(!l.pubkeys)throw new Error(l.type+" not supported as witnessScript ("+CS.toASM(i)+")");e.signatures&&e.signatures.some(e=>void 0!==e)&&(l.signatures=e.signatures);const f=i;if(l.type===n.P2WPKH)throw new Error("P2SH(P2WSH(P2WPKH)) is a consensus failure");return{redeemScript:r,redeemScriptType:n.P2WSH,witnessScript:i,witnessScriptType:l.type,prevOutType:n.P2SH,prevOutScript:c.output,hasWitness:!0,signScript:f,signType:l.type,pubkeys:l.pubkeys,signatures:l.signatures,maxSignatures:l.maxSignatures}}if(r){const i=XS.p2sh({redeem:{output:r}});if(e.prevOutScript){let t;try{t=XS.p2sh({output:e.prevOutScript})}catch(e){throw new Error("PrevOutScript must be P2SH")}if(!i.hash.equals(t.hash))throw new Error("Redeem script inconsistent with prevOutScript")}const o=s(i.redeem.output,t);if(!o.pubkeys)throw new Error(o.type+" not supported as redeemScript ("+CS.toASM(r)+")");e.signatures&&e.signatures.some(e=>void 0!==e)&&(o.signatures=e.signatures);let a=r;return o.type===n.P2WPKH&&(a=XS.p2pkh({pubkey:o.pubkeys[0]}).output),{redeemScript:r,redeemScriptType:o.type,prevOutType:n.P2SH,prevOutScript:i.output,hasWitness:o.type===n.P2WPKH,signScript:a,signType:o.type,pubkeys:o.pubkeys,signatures:o.signatures,maxSignatures:o.maxSignatures}}if(i){const r=XS.p2wsh({redeem:{output:i}});if(e.prevOutScript){const t=XS.p2wsh({output:e.prevOutScript});if(!r.hash.equals(t.hash))throw new Error("Witness script inconsistent with prevOutScript")}const o=s(r.redeem.output,t);if(!o.pubkeys)throw new Error(o.type+" not supported as witnessScript ("+CS.toASM(i)+")");e.signatures&&e.signatures.some(e=>void 0!==e)&&(o.signatures=e.signatures);const a=i;if(o.type===n.P2WPKH)throw new Error("P2WSH(P2WPKH) is a consensus failure");return{witnessScript:i,witnessScriptType:o.type,prevOutType:n.P2WSH,prevOutScript:r.output,hasWitness:!0,signScript:a,signType:o.type,pubkeys:o.pubkeys,signatures:o.signatures,maxSignatures:o.maxSignatures}}if(e.prevOutType&&e.prevOutScript){if(e.prevOutType===n.P2SH)throw new Error("PrevOutScript is "+e.prevOutType+", requires redeemScript");if(e.prevOutType===n.P2WSH)throw new Error("PrevOutScript is "+e.prevOutType+", requires witnessScript");if(!e.prevOutScript)throw new Error("PrevOutScript is missing");const r=s(e.prevOutScript,t);if(!r.pubkeys)throw new Error(r.type+" not supported ("+CS.toASM(e.prevOutScript)+")");e.signatures&&e.signatures.some(e=>void 0!==e)&&(r.signatures=e.signatures);let i=e.prevOutScript;return r.type===n.P2WPKH&&(i=XS.p2pkh({pubkey:r.pubkeys[0]}).output),{prevOutType:r.type,prevOutScript:e.prevOutScript,hasWitness:r.type===n.P2WPKH,signScript:i,signType:r.type,pubkeys:r.pubkeys,signatures:r.signatures,maxSignatures:r.maxSignatures}}const o=XS.p2pkh({pubkey:t}).output;return{prevOutType:n.P2PKH,prevOutScript:o,hasWitness:!1,signScript:o,signType:n.P2PKH,pubkeys:[t],signatures:[void 0]}}(v,y,f,p);Object.assign(v,e)}if(!c(v))throw Error(v.prevOutType+" not supported")}let b;b=v.hasWitness?a.hashForWitnessV0(g,v.signScript,v.value,h):a.hashForSignature(g,v.signScript,h);return{input:v,ourPubKey:y,keyPair:l,signatureHash:b,hashType:h,useLowR:!!m}}(this.network,this.__INPUTS,this.__needsOutputs.bind(this),this.__TX,e,t,r,a,u,l,this.__USE_LOW_R))}__addInputUnsafe(e,t,r){if(oE.Transaction.isCoinbaseHash(e))throw new Error("coinbase inputs not supported");const i=e.toString("hex")+":"+t;if(void 0!==this.__PREV_TX_SET[i])throw new Error("Duplicate TxOut: "+i);let o={};if(void 0!==r.script&&(o=function e(t,r,i,o){if(0===t.length&&0===r.length)return{};if(!i){let e=YE.input(t,!0),o=YE.witness(r,!0);e===n.NONSTANDARD&&(e=void 0),o===n.NONSTANDARD&&(o=void 0),i=e||o}switch(i){case n.P2WPKH:{const{output:e,pubkey:t,signature:i}=XS.p2wpkh({witness:r});return{prevOutScript:e,prevOutType:n.P2WPKH,pubkeys:[t],signatures:[i]}}case n.P2PKH:{const{output:e,pubkey:r,signature:i}=XS.p2pkh({input:t});return{prevOutScript:e,prevOutType:n.P2PKH,pubkeys:[r],signatures:[i]}}case n.P2PK:{const{signature:e}=XS.p2pk({input:t});return{prevOutType:n.P2PK,pubkeys:[void 0],signatures:[e]}}case n.P2MS:{const{m:e,pubkeys:r,signatures:i}=XS.p2ms({input:t,output:o},{allowIncomplete:!0});return{prevOutType:n.P2MS,pubkeys:r,signatures:i,maxSignatures:e}}}if(i===n.P2SH){const{output:i,redeem:o}=XS.p2sh({input:t,witness:r}),a=YE.output(o.output),s=e(o.input,o.witness,a,o.output);return s.prevOutType?{prevOutScript:i,prevOutType:n.P2SH,redeemScript:o.output,redeemScriptType:s.prevOutType,witnessScript:s.witnessScript,witnessScriptType:s.witnessScriptType,pubkeys:s.pubkeys,signatures:s.signatures}:{}}if(i===n.P2WSH){const{output:i,redeem:o}=XS.p2wsh({input:t,witness:r}),a=YE.output(o.output);let s;return s=a===n.P2WPKH?e(o.input,o.witness,a):e(CS.compile(o.witness),[],a,o.output),s.prevOutType?{prevOutScript:i,prevOutType:n.P2WSH,witnessScript:o.output,witnessScriptType:s.prevOutType,pubkeys:s.pubkeys,signatures:s.signatures}:{}}return{prevOutType:n.NONSTANDARD,prevOutScript:t}}(r.script,r.witness||[])),void 0!==r.value&&(o.value=r.value),!o.prevOutScript&&r.prevOutScript){let e;if(!o.pubkeys&&!o.signatures){const t=s(r.prevOutScript);t.pubkeys&&(o.pubkeys=t.pubkeys,o.signatures=t.signatures),e=t.type}o.prevOutScript=r.prevOutScript,o.prevOutType=e||YE.output(r.prevOutScript)}const a=this.__TX.addInput(e,t,r.sequence,r.scriptSig);return this.__INPUTS[a]=o,this.__PREV_TX_SET[i]=!0,a}__build(e){if(!e){if(!this.__TX.ins.length)throw new Error("Transaction has no inputs");if(!this.__TX.outs.length)throw new Error("Transaction has no outputs")}const t=this.__TX.clone();if(this.__INPUTS.forEach((i,o)=>{if(!i.prevOutType&&!e)throw new Error("Transaction is not complete");const a=function e(t,i,o){const a=i.pubkeys||[];let s=i.signatures||[];switch(t){case n.P2PKH:if(0===a.length)break;if(0===s.length)break;return XS.p2pkh({pubkey:a[0],signature:s[0]});case n.P2WPKH:if(0===a.length)break;if(0===s.length)break;return XS.p2wpkh({pubkey:a[0],signature:s[0]});case n.P2PK:if(0===a.length)break;if(0===s.length)break;return XS.p2pk({signature:s[0]});case n.P2MS:{const e=i.maxSignatures;s=o?s.map(e=>e||r.OPS.OP_0):s.filter(e=>e);const t=!o||e===s.length;return XS.p2ms({m:e,pubkeys:a,signatures:s},{allowIncomplete:o,validate:t})}case n.P2SH:{const t=e(i.redeemScriptType,i,o);if(!t)return;return XS.p2sh({redeem:{output:t.output||i.redeemScript,input:t.input,witness:t.witness}})}case n.P2WSH:{const t=e(i.witnessScriptType,i,o);if(!t)return;return XS.p2wsh({redeem:{output:i.witnessScript,input:t.input,witness:t.witness}})}}}(i.prevOutType,i,e);if(a)t.setInputScript(o,a.input),t.setWitness(o,a.witness);else{if(!e&&i.prevOutType===n.NONSTANDARD)throw new Error("Unknown input type");if(!e)throw new Error("Not enough information")}}),!e&&this.__overMaximumFees(t.virtualSize()))throw new Error("Transaction has absurd fees");return t}__canModifyInputs(){return this.__INPUTS.every(e=>!e.signatures||e.signatures.every(e=>{if(!e)return!0;return 0!=(u(e)&oE.Transaction.SIGHASH_ANYONECANPAY)}))}__needsOutputs(e){return e===oE.Transaction.SIGHASH_ALL?0===this.__TX.outs.length:0===this.__TX.outs.length&&this.__INPUTS.some(e=>!!e.signatures&&e.signatures.some(e=>{if(!e)return!1;return!(u(e)&oE.Transaction.SIGHASH_NONE)}))}__canModifyOutputs(){const e=this.__TX.ins.length,t=this.__TX.outs.length;return this.__INPUTS.every(r=>void 0===r.signatures||r.signatures.every(r=>{if(!r)return!0;const n=31&u(r);return n===oE.Transaction.SIGHASH_NONE||n===oE.Transaction.SIGHASH_SINGLE&&e<=t}))}__overMaximumFees(e){return(this.__INPUTS.reduce((e,t)=>e+(t.value>>>0),0)-this.__TX.outs.reduce((e,t)=>e+t.value,0))/e>this.maximumFeeRate}}function s(e,t){hS(wS.Buffer,e);const r=YE.output(e);switch(r){case n.P2PKH:{if(!t)return{type:r};const n=XS.p2pkh({output:e}).hash,i=jS.hash160(t);return n.equals(i)?{type:r,pubkeys:[t],signatures:[void 0]}:{type:r}}case n.P2WPKH:{if(!t)return{type:r};const n=XS.p2wpkh({output:e}).hash,i=jS.hash160(t);return n.equals(i)?{type:r,pubkeys:[t],signatures:[void 0]}:{type:r}}case n.P2PK:return{type:r,pubkeys:[XS.p2pk({output:e}).pubkey],signatures:[void 0]};case n.P2MS:{const t=XS.p2ms({output:e});return{type:r,pubkeys:t.pubkeys,signatures:t.pubkeys.map(()=>{}),maxSignatures:t.m}}}return{type:r}}function c(e){return void 0!==e.signScript&&void 0!==e.signType&&void 0!==e.pubkeys&&void 0!==e.signatures&&e.signatures.length===e.pubkeys.length&&e.pubkeys.length>0&&(!1===e.hasWitness||void 0!==e.value)}function u(e){return e.readUInt8(e.length-1)}t.TransactionBuilder=a}));er(ZE);ZE.TransactionBuilder;var ex=tr((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.bip32=vS,t.address=QS,t.crypto=jS,t.ECPair=ZS,t.networks=yS,t.payments=XS,t.script=CS,t.Block=aE.Block,t.Psbt=TE.Psbt;var r=CS;t.opcodes=r.OPS,t.Transaction=oE.Transaction,t.TransactionBuilder=ZE.TransactionBuilder}));er(ex);ex.bitcoin,ex.bip32,ex.address,ex.crypto,ex.ECPair,ex.networks,ex.payments,ex.script,ex.Block,ex.Psbt,ex.opcodes,ex.Transaction,ex.TransactionBuilder;function tx(e=null){if(!e)return;const t=yi(e);if(new Date>=t)throw new M("checkExpiresDate",P("errors","ensureNotExpired"))}function rx(e,t,r){console.log({txTimeA:r});let n=!1;const i=function(e,t){let r=null;for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&n.toLowerCase()===t.toLowerCase()&&(r=n);return e[r]}(e,t);if(r=yi(r),console.log({txTimeB:r}),i&&(n=!0,i.created&&(n&=r>=i.created),i.revoked&&(n&=r<=i.revoked),i.expires&&(n&=r<=i.expires)),console.log({validKey:n}),console.log({theKey:i}),!n)throw new M("checkAuthenticity",P("errors","getCaseInsensitiveKey"))}function nx(e,t){let r=e.targetHash;const n=e.merkleRoot;if(i(t)&&e.proof)throw new M("checkReceipt",P("errors","invalidMerkleVersion"));try{const t=e.proof||e.path;if(!!t)for(const e in t){const n=t[e];let i;if(void 0!==n.left)i=tg(`${n.left}${r}`),r=eg(i);else{if(void 0===n.right)throw new M("checkReceipt","Trigger catch error.");i=tg(`${r}${n.right}`),r=eg(i)}}}catch(e){throw new M("checkReceipt",P("errors","ensureValidReceipt"))}if(r!==n)throw new M("checkReceipt",P("errors","invalidMerkleReceipt"))}function ix({explorerAPI:e,transactionIdPlaceholder:t="{transaction_id}",transactionId:r="",isTestApi:n=!1}){const{serviceURL:i}=e;let o="string"==typeof i?i:n?i.test:i.main;return o=o.replace(t,r),o=function(e,t){if(!t.key)return e;if(t.key&&!t.keyPropertyName)throw new Error("No keyPropertyName defined for explorerAPI "+t.serviceName);return hi(e,t.keyPropertyName,t.key)}(o,e),o}function ox(e,r){for(let n=0;n<r.length;n++){const i=r[n];if(t(e,i))return e.slice(i.length)}return e}const ax="https://api.etherscan.io/api?module=proxy",sx="https://api-ropsten.etherscan.io/api?module=proxy";const cx={serviceURL:{main:ax+"&action=eth_getTransactionByHash&txhash={transaction_id}&apikey=FJ3CZWH8PQBV8W5U6JR8TMKAYDHBKQ3B1D",test:sx+"&action=eth_getTransactionByHash&txhash={transaction_id}&apikey=FJ3CZWH8PQBV8W5U6JR8TMKAYDHBKQ3B1D"},serviceName:r.etherscan,parsingFunction:function(t,r,n,i){return e(this,void 0,void 0,(function*(){const o={serviceURL:{main:ax+"&action=eth_getBlockByNumber&boolean=true&tag={transaction_id}&apikey=FJ3CZWH8PQBV8W5U6JR8TMKAYDHBKQ3B1D",test:sx+"&action=eth_getBlockByNumber&boolean=true&tag={transaction_id}&apikey=FJ3CZWH8PQBV8W5U6JR8TMKAYDHBKQ3B1D"}},a={serviceURL:{main:ax+"&action=eth_blockNumber",test:sx+"&action=eth_blockNumber"}};const s=yield function(t,r){return e(this,void 0,void 0,(function*(){const s=t.result.blockNumber,c=ix({explorerAPI:Object.assign(Object.assign({},o),{key:n,keyPropertyName:i}),transactionId:s,isTestApi:v(r)});try{const t=yield fi({url:c}),o=JSON.parse(t),l=o.result;return console.log({requestUrl:c,responseData:o,blockData:l}),yield function(t,r){return e(this,void 0,void 0,(function*(){const e=ix({explorerAPI:Object.assign(Object.assign({},a),{key:n,keyPropertyName:i}),isTestApi:v(t)});let o;try{o=yield fi({url:e})}catch(e){throw new M(u,P("errors","unableToGetRemoteHash"))}const s=JSON.parse(o).result;if(s-r<w)throw new M(u,P("errors","checkEtherScanConfirmations"));return s}))}(r,s),l}catch(e){throw new M(u,P("errors","unableToGetRemoteHash"))}}))}(t,r);return console.log({blockResponse:s}),function(e,t){const r=e.result;console.log({parseEtherScanResponseData:r}),console.log({block:t});const n=new Date(1e3*parseInt(t.timestamp,16)),i=r.from,o=ox(r.input,g.ethmain.prefixes);return console.log({parseEtherScanResponse:{remoteHash:o,issuingAddress:i,time:n,revokedAddresses:[]}}),{remoteHash:o,issuingAddress:i,time:n,revokedAddresses:[]}}(t,s)}))},priority:-1};const ux={serviceURL:{main:"https://api.blockcypher.com/v1/eth/main/txs/{transaction_id}?limit=500",test:"https://api.blockcypher.com/v1/beth/test/txs/{transaction_id}?limit=500"},serviceName:r.blockcypher,parsingFunction:function(e){if(e.confirmations<w)throw new M(u,P("errors","parseBlockCypherResponse"));const r=yi(e.received),n=e.outputs,i=n[n.length-1];let o=e.inputs[0].addresses[0];const a=ox(i.script,g.ethmain.prefixes);return o=function(e,r){for(let n=0;n<r.length;n++){const i=r[n];if(!t(e,i))return`${i}${e}`}return e}(o,g.ethmain.prefixes),{remoteHash:a,issuingAddress:o,time:r,revokedAddresses:n.filter(e=>!!e.spent_by).map(e=>e.addresses[0])}},priority:-1};const lx={serviceURL:{main:"https://blockstream.info/api/tx/{transaction_id}",test:"https://blockstream.info/testnet/api/tx/{transaction_id}"},serviceName:r.blockstream,parsingFunction:function(e){if(!e.status.confirmed)throw new M(u,P("errors","parseBlockstreamResponse"));const t=function(e){return new Date(1e3*e)}(e.status.block_time),r=e.vout,n=r[r.length-1],i=e.vout[0].scriptpubkey_address;return{remoteHash:ox(n.scriptpubkey,g.bitcoin.prefixes),issuingAddress:i,time:t,revokedAddresses:r.filter(e=>!!e.scriptpubkey_address).map(e=>e.scriptpubkey_address)}},priority:-1};const fx={serviceURL:{main:"https://api.blockcypher.com/v1/btc/main/txs/{transaction_id}?limit=500",test:"https://api.blockcypher.com/v1/btc/test3/txs/{transaction_id}?limit=500"},serviceName:r.blockcypher,parsingFunction:function(e){if(e.confirmations<w)throw new M(u,P("errors","parseBlockCypherResponse"));const t=yi(e.received),r=e.outputs,n=r[r.length-1],i=e.inputs[0].addresses[0];return{remoteHash:ox(n.script,g.bitcoin.prefixes),issuingAddress:i,time:t,revokedAddresses:r.filter(e=>!!e.spent_by).map(e=>e.addresses[0])}},priority:-1};function hx(t){return console.log({TransactionAPIArray:t}),t.map(t=>({getTxData:(r,n)=>e(this,void 0,void 0,(function*(){return yield function(t,r,n){return e(this,void 0,void 0,(function*(){const e=ix({explorerAPI:t,transactionId:r,isTestApi:v(n)});try{const r=yield fi({url:e});return yield t.parsingFunction(JSON.parse(r),n,t.key,t.keyPropertyName)}catch(e){throw new M(u,P("errors","unableToGetRemoteHash"))}}))}(t,r,n)})),priority:t.priority}))}const dx=[fx,lx],px=[cx,ux],mx=[fx];const gx=[];function vx(e=[],t=[],n=!1){const i=e.map(e=>e.serviceName).filter(e=>!!e).filter(e=>!!r[e]);return i.length?t.reduce((t,r)=>{if(i.includes(r.serviceName)){const n=Object.assign({},r),i=e.find(e=>e.serviceName===r.serviceName);if(function(e){if(e.key&&!e.keyPropertyName)throw new Error(`Property keyPropertyName is not set for ${e.serviceName}. Cannot pass the key property to the service.`);return!0}(i)){const r=Object.assign(n,i);t.push(r);const o=e.findIndex(e=>e.serviceName===r.serviceName);gx.includes(o)||gx.push(o)}}else t.push(r);return n&&function(e,t){t.forEach(t=>e.splice(t,1))}(e,gx),t},[]):t}const yx=ui("Verifier");class bx{constructor({certificateJson:e,chain:t,expires:r,id:n,issuer:i,receipt:o,revocationKey:a,transactionId:s,version:c,explorerAPIs:u}){this.chain=t,this.expires=r,this.id=n,this.issuer=i,this.receipt=o,this.revocationKey=a,this.version=c,this.transactionId=s,this.setExplorerAPIs(u);let l=e.document;l||(l=this._retrieveDocumentBeforeIssuance(e)),this.documentToVerify=Object.assign({},l),this._stepsStatuses=[]}verify(t=(()=>{})){return e(this,void 0,void 0,(function*(){if(this._stepCallback=t,this.version===o.V1_1)throw new M("","Verification of 1.1 certificates is not supported by this component. See the python cert-verifier for legacy verification");wi.chains.isMockChain(this.chain)?yield this._verifyV2Mock():yield this._verifyMain();const e=this._stepsStatuses.find(e=>"failure"===e.status);return e?this._failed(e):this._succeed()}))}setExplorerAPIs(e){console.log({customExplorerAPIs:e}),this.explorerAPIs=function(e){return console.log({EthereumExplorers:hx(vx(e,px))}),{bitcoin:hx(vx(e,dx)),ethereum:hx(vx(e,px)),v1:hx(vx(e,mx,!0))}}(e),console.log({explorerAPIs1:this.explorerAPIs}),wi.explorerAPIs.ensureValidity(e)&&(this.explorerAPIs.custom=hx(e)),console.log({custom:this.explorerAPIs.custom})}_getRevocationListUrl(e){return this.issuer&&this.issuer.revocationList?this.issuer.revocationList:e.revocationList}_doAction(e,t){if(this._isFailing())return;let r;e&&(r=wi.i18n.getText("subSteps",e+"LabelPending"),yx(r),this._updateStatusCallback(e,r,"starting"));try{const n=t();return e&&(this._updateStatusCallback(e,r,"success"),this._stepsStatuses.push({step:e,label:r,status:"success"})),n}catch(t){e&&(this._updateStatusCallback(e,r,"failure",t.message),this._stepsStatuses.push({code:e,label:r,status:"failure",errorMessage:t.message}))}}_doAsyncAction(t,r){return e(this,void 0,void 0,(function*(){if(this._isFailing())return;let e;t&&(e=wi.i18n.getText("subSteps",t+"LabelPending"),yx(e),this._updateStatusCallback(t,e,"starting"));try{const n=yield r();return t&&(this._updateStatusCallback(t,e,"success"),this._stepsStatuses.push({step:t,label:e,status:"success"})),n}catch(r){t&&(this._updateStatusCallback(t,e,"failure",r.message),this._stepsStatuses.push({code:t,label:e,status:"failure",errorMessage:r.message}))}}))}_stepCallback(e){}_verifyMain(){return e(this,void 0,void 0,(function*(){this._doAction("getTransactionId",()=>function(e){if("string"==typeof e&&e.length>0)return e;throw new M("getTransactionId",P("errors","isTransactionIdValid"))}(this.transactionId));const t=yield this._doAsyncAction("computeLocalHash",()=>e(this,void 0,void 0,(function*(){return yield fg(this.documentToVerify,this.version)}))),r=yield this._doAsyncAction(u,()=>e(this,void 0,void 0,(function*(){return yield wi.verifier.lookForTx({transactionId:this.transactionId,chain:this.chain.code,certificateVersion:this.version,explorerAPIs:this.explorerAPIs})})));console.log({txData:r});let n=this.issuer;i(this.version)||(n=yield this._doAsyncAction("getIssuerProfile",()=>e(this,void 0,void 0,(function*(){return yield wi.verifier.getIssuerProfile(this.issuer)}))));const a=yield this._doAsyncAction("parseIssuerKeys",()=>wi.verifier.parseIssuerKeys(n));let s,c;this._doAction("compareHashes",()=>{hg(t,this.receipt.targetHash)}),this._doAction("checkMerkleRoot",()=>function(e,t){if(e!==t)throw new M("checkMerkleRoot",P("errors","ensureMerkleRootEqual"))}(this.receipt.merkleRoot,r.remoteHash)),this._doAction("checkReceipt",()=>nx(this.receipt,this.version)),this.version===o.V1_2?(c=r.revokedAddresses,s=[wi.verifier.parseRevocationKey(n),this.revocationKey]):(c=yield this._doAsyncAction(null,()=>e(this,void 0,void 0,(function*(){return yield wi.verifier.getRevokedAssertions(this._getRevocationListUrl(n),this.id)}))),s=this.id),this._doAction("checkRevokedStatus",()=>function(e,t){if(!e||!t)return;Array.isArray(t)||(t=[t]);const r=function(e=[],t=[]){return e.filter(e=>-1!==t.indexOf(e)).filter((e,t,r)=>r.indexOf(e)===t)}(t=t.filter(e=>null!=e),e.map(e=>e.id));if(r.length>0){const t=e.findIndex(e=>e.id===r[0]);if(t>-1)throw new M("checkRevokedStatus",wi.certificates.generateRevocationReason(e[t].revocationReason))}}(c,s)),this._doAction("checkAuthenticity",()=>rx(a,r.issuingAddress,r.time)),this._doAction("checkExpiresDate",()=>tx(this.expires))}))}_verifyV2Mock(){return e(this,void 0,void 0,(function*(){const t=yield this._doAsyncAction("computeLocalHash",()=>e(this,void 0,void 0,(function*(){return yield fg(this.documentToVerify,this.version)})));this._doAction("compareHashes",()=>hg(t,this.receipt.targetHash)),this._doAction("checkReceipt",()=>nx(this.receipt)),this._doAction("checkExpiresDate",()=>tx(this.expires))}))}_failed(e){const t=e.errorMessage;return yx("failure:"+t),this._setFinalStep({status:"failure",message:t})}_isFailing(){return this._stepsStatuses.some(e=>"failure"===e.status)}_retrieveDocumentBeforeIssuance(e){const t=Object.assign({},e);return i(this.version)?delete t.proof:delete t.signature,t}_succeed(){const e=wi.chains.isMockChain(this.chain)?wi.i18n.getText("success","mocknet"):wi.i18n.getText("success","blockchain");return yx(e),this._setFinalStep({status:"success",message:e})}_setFinalStep({status:e,message:t}){return{code:"final",status:e,message:t}}_updateStatusCallback(e,t,r,n=""){if(null!=e){const i={code:e,label:t,status:r};n&&(i.errorMessage=n),this._stepCallback(i)}}}class wx{constructor(e,t={}){if(this.explorerAPIs=[],this._setOptions(t),"object"!=typeof e)try{e=JSON.parse(e)}catch(e){throw new Error(wi.i18n.getText("errors","certificateNotValid"))}this.certificateJson=j(e)}init(){return e(this,void 0,void 0,(function*(){yield this.parseJson(this.certificateJson)}))}parseJson(t){return e(this,void 0,void 0,(function*(){const e=yield Cc(t);if(!e.isFormatValid)throw new Error(e.error);this._setProperties(e)}))}verify(t){return e(this,void 0,void 0,(function*(){const e=new bx({certificateJson:this.certificateJson,chain:this.chain,expires:this.expires,id:this.id,issuer:this.issuer,receipt:this.receipt,revocationKey:this.revocationKey,transactionId:this.transactionId,version:this.version,explorerAPIs:j(this.explorerAPIs)});return yield e.verify(t)}))}_setOptions(e){this.options=Object.assign({},x,e),this.locale=wi.i18n.ensureIsSupported("auto"===this.options.locale?wi.i18n.detectLocale():this.options.locale),this.explorerAPIs=this.options.explorerAPIs||[],k.locale=this.locale}_setProperties({certificateImage:e,chain:t,description:r,expires:n,id:i,isFormatValid:o,issuedOn:a,issuer:s,metadataJson:c,name:u,publicKey:l,receipt:f,recipientFullName:h,recordLink:d,revocationKey:p,sealImage:m,signature:g,signatureImage:v,subtitle:y,version:b}){this.isFormatValid=o,this.certificateImage=e,this.chain=t,this.description=r,this.expires=n,this.id=i,this.issuedOn=a,this.issuer=s,this.metadataJson=c,this.name=u,this.publicKey=l,this.receipt=f,this.recipientFullName=h,this.recordLink=d,this.revocationKey=p,this.sealImage=m,this.signature=g,this.signatureImage=v,this.subtitle=y,this.verificationSteps=wi.certificates.getVerificationMap(t,b),this.version=b,this._setTransactionDetails()}_setTransactionDetails(){this.transactionId=wi.certificates.getTransactionId(this.receipt),this.rawTransactionLink=wi.certificates.getTransactionLink(this.transactionId,this.chain,!0),this.transactionLink=wi.certificates.getTransactionLink(this.transactionId,this.chain)}}export{g as BLOCKCHAINS,o as CERTIFICATE_VERSIONS,wx as Certificate,s as STEPS,d as SUB_STEPS,R as SignatureImage,m as VERIFICATION_STATUSES,O as getSupportedLanguages};
import 'phaser'; import PhaserNavMeshPlugin from "phaser-navmesh"; // Base class for isometric map scenes export default class TestBaseScene extends Phaser.Scene { constructor(config) { super({ key: config.key, }); this.wobble = "wibble"; } }
describe('<md-autocomplete>', function() { var element, scope; beforeEach(module('material.components.autocomplete')); afterEach(function() { scope && scope.$destroy(); }); function compile(template, scope) { inject(function($compile) { element = $compile(template)(scope); scope.$apply(); }); return element; } function createScope(items, scopeData, matchLowercase) { items = items || ['foo', 'bar', 'baz'].map(function(item) { return { display: item }; }); inject(function($rootScope, $timeout) { scope = $rootScope.$new(); scope.match = function(term) { return items.filter(function(item) { return item.display.indexOf(matchLowercase ? term.toLowerCase() : term) === 0; }); }; scope.asyncMatch = function(term) { return $timeout(function() { return scope.match(term); }, 1000); }; scope.searchText = ''; scope.selectedItem = null; scope.items = items; angular.forEach(scopeData, function(value, key) { scope[key] = value; }); }); return scope; } function keydownEvent(keyCode) { return { keyCode: keyCode, stopPropagation: angular.noop, preventDefault: angular.noop }; } function waitForVirtualRepeat() { // Because the autocomplete does not make the suggestions menu visible // off the bat, the virtual repeat needs a couple more iterations to // figure out how tall it is and then how tall the repeated items are. // Using md-item-size would reduce this to a single flush, but given that // autocomplete allows for custom row templates, it's better to measure // rather than assuming a given size. inject(function($material, $timeout) { $material.flushOutstandingAnimations(); $timeout.flush(); }); } describe('basic functionality', function() { it('updates selected item and search text', inject(function($timeout, $mdConstant, $material) { var scope = createScope(); var template = '\ <md-autocomplete\ md-selected-item="selectedItem"\ md-search-text="searchText"\ md-items="item in match(searchText)"\ md-item-text="item.display"\ placeholder="placeholder">\ <span md-highlight-text="searchText">{{item.display}}</span>\ </md-autocomplete>'; var element = compile(template, scope); var ctrl = element.controller('mdAutocomplete'); var ul = element.find('ul'); $material.flushInterimElement(); expect(scope.searchText).toBe(''); expect(scope.selectedItem).toBe(null); // Focus the input ctrl.focus(); // Update the scope element.scope().searchText = 'fo'; waitForVirtualRepeat(element); // Check expectations expect(scope.searchText).toBe('fo'); expect(scope.match(scope.searchText).length).toBe(1); expect(ul.find('li').length).toBe(1); // Run our key events ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.DOWN_ARROW)); ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.ENTER)); $timeout.flush(); // Check expectations again expect(scope.searchText).toBe('foo'); expect(scope.selectedItem).toBe(scope.match(scope.searchText)[0]); element.remove(); })); it('should clear the searchText when the selectedItem manually got cleared', inject(function($timeout, $material, $mdConstant) { var scope = createScope(); var template = '<md-autocomplete ' + 'md-selected-item="selectedItem" ' + 'md-search-text="searchText" ' + 'md-items="item in match(searchText)" ' + 'md-item-text="item.display" ' + 'placeholder="placeholder"> ' + '<span md-highlight-text="searchText">{{item.display}}</span>' + '</md-autocomplete>'; var element = compile(template, scope); var ctrl = element.controller('mdAutocomplete'); var ul = element.find('ul'); $material.flushInterimElement(); expect(scope.searchText).toBe(''); expect(scope.selectedItem).toBe(null); ctrl.focus(); scope.$apply('searchText = "fo"'); waitForVirtualRepeat(element); expect(scope.searchText).toBe('fo'); expect(scope.match(scope.searchText).length).toBe(1); expect(ul.find('li').length).toBe(1); // Run our key events to trigger a select action ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.DOWN_ARROW)); ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.ENTER)); $timeout.flush(); expect(scope.searchText).toBe('foo'); expect(scope.selectedItem).toBe(scope.match(scope.searchText)[0]); // Reset / Clear the current selected item. scope.$apply('selectedItem = null'); waitForVirtualRepeat(element); // Run our key events to trigger a select action ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.DOWN_ARROW)); ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.ENTER)); $timeout.flush(); // The autocomplete automatically clears the searchText when the selectedItem was cleared. expect(scope.searchText).toBe(''); expect(scope.selectedItem).toBeFalsy(); element.remove(); })); it('should should not clear the searchText when clearing the selected item from the input', inject(function($timeout, $material, $mdConstant) { var scope = createScope(); var template = '<md-autocomplete ' + 'md-selected-item="selectedItem" ' + 'md-search-text="searchText" ' + 'md-items="item in match(searchText)" ' + 'md-item-text="item.display" ' + 'placeholder="placeholder"> ' + '<span md-highlight-text="searchText">{{item.display}}</span>' + '</md-autocomplete>'; var element = compile(template, scope); var ctrl = element.controller('mdAutocomplete'); var input = element.find('input'); var ul = element.find('ul'); $material.flushInterimElement(); expect(scope.searchText).toBe(''); expect(scope.selectedItem).toBe(null); ctrl.focus(); scope.$apply('searchText = "fo"'); waitForVirtualRepeat(element); expect(scope.searchText).toBe('fo'); expect(scope.match(scope.searchText).length).toBe(1); expect(ul.find('li').length).toBe(1); // Run our key events to trigger a select action ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.DOWN_ARROW)); ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.ENTER)); $timeout.flush(); expect(scope.searchText).toBe('foo'); expect(scope.selectedItem).toBe(scope.match(scope.searchText)[0]); scope.$apply('searchText = "food"'); $timeout.flush(); // The autocomplete automatically clears the searchText when the selectedItem was cleared. expect(scope.searchText).toBe('food'); expect(scope.selectedItem).toBeFalsy(); element.remove(); })); it('allows you to set an input id without floating label', inject(function() { var scope = createScope(null, {inputId: 'custom-input-id'}); var template = '\ <md-autocomplete\ md-input-id="{{inputId}}"\ md-selected-item="selectedItem"\ md-search-text="searchText"\ md-items="item in match(searchText)"\ md-item-text="item.display"\ placeholder="placeholder">\ <span md-highlight-text="searchText">{{item.display}}</span>\ </md-autocomplete>'; var element = compile(template, scope); var input = element.find('input'); expect(input.attr('id')).toBe(scope.inputId); element.remove(); })); it('should allow you to set a class to the md-virtual-repeat-container element', inject(function() { var scope = createScope(null, {menuContainerClass: 'custom-menu-container-class'}); var template = '\ <md-autocomplete\ md-menu-container-class="{{menuContainerClass}}"\ md-selected-item="selectedItem"\ md-search-text="searchText"\ md-items="item in match(searchText)"\ md-item-text="item.display"\ placeholder="placeholder">\ <span md-highlight-text="searchText">{{item.display}}</span>\ </md-autocomplete>'; var element = compile(template, scope); var repeatContainer = element.find('md-virtual-repeat-container'); expect(repeatContainer.attr('class')).toContain(scope.menuContainerClass); element.remove(); })); it('allows using ng-readonly', inject(function() { var scope = createScope(null, {inputId: 'custom-input-id'}); var template = '\ <md-autocomplete\ md-input-id="{{inputId}}"\ md-selected-item="selectedItem"\ md-search-text="searchText"\ md-items="item in match(searchText)"\ md-item-text="item.display"\ placeholder="placeholder"\ ng-readonly="readonly">\ <span md-highlight-text="searchText">{{item.display}}</span>\ </md-autocomplete>'; var element = compile(template, scope); var input = element.find('input'); scope.readonly = true; scope.$digest(); expect(input.attr('readonly')).toBe('readonly'); scope.readonly = false; scope.$digest(); expect(input.attr('readonly')).toBeUndefined(); element.remove(); })); it('does not open panel when ng-readonly is true', inject(function() { var scope = createScope(null, {inputId: 'custom-input-id'}); var template = '\ <md-autocomplete\ md-input-id="{{inputId}}"\ md-selected-item="selectedItem"\ md-search-text="searchText"\ md-items="item in match(searchText)"\ md-item-text="item.display"\ placeholder="placeholder"\ md-min-length="0"\ ng-readonly="readonly">\ <span md-highlight-text="searchText">{{item.display}}</span>\ </md-autocomplete>'; var element = compile(template, scope); var ctrl = element.controller('mdAutocomplete'); var input = element.find('input'); scope.readonly = false; scope.$digest(); ctrl.focus(); waitForVirtualRepeat(); expect(input.attr('readonly')).toBeUndefined(); expect(ctrl.hidden).toBe(false); ctrl.blur(); scope.readonly = true; scope.$digest(); expect(ctrl.hidden).toBe(true); ctrl.focus(); waitForVirtualRepeat(); expect(input.attr('readonly')).toBe('readonly'); expect(ctrl.hidden).toBe(true); element.remove(); })); it('should forward focus to the input element with md-autofocus', inject(function($timeout) { var scope = createScope(); var template = '<md-autocomplete ' + ' md-selected-item="selectedItem" ' + ' md-search-text="searchText" ' + ' md-items="item in match(searchText)" ' + ' md-item-text="item.display" ' + ' placeholder="placeholder"' + ' md-autofocus>' + ' <span md-highlight-text="searchText">{{item.display}}</span>' + '</md-autocomplete>'; var element = compile(template, scope); var input = element.find('input'); document.body.appendChild(element[0]); // Initial timeout for gathering elements $timeout.flush(); element.triggerHandler('focus'); expect(document.activeElement).toBe(input[0]); element.remove(); })); it('allows using an empty readonly attribute', inject(function() { var scope = createScope(null, {inputId: 'custom-input-id'}); var template = '\ <md-autocomplete\ md-input-id="{{inputId}}"\ md-selected-item="selectedItem"\ md-search-text="searchText"\ md-items="item in match(searchText)"\ md-item-text="item.display"\ placeholder="placeholder"\ readonly>\ <span md-highlight-text="searchText">{{item.display}}</span>\ </md-autocomplete>'; var element = compile(template, scope); var input = element.find('input'); expect(input.attr('readonly')).toBe('readonly'); element.remove(); })); it('allows you to set an input id with floating label', inject(function() { var scope = createScope(null, {inputId: 'custom-input-id'}); var template = '\ <md-autocomplete\ md-floating-label="Some Label"\ md-input-id="{{inputId}}"\ md-selected-item="selectedItem"\ md-search-text="searchText"\ md-items="item in match(searchText)"\ md-item-text="item.display"\ placeholder="placeholder">\ <span md-highlight-text="searchText">{{item.display}}</span>\ </md-autocomplete>'; var element = compile(template, scope); var input = element.find('input'); expect(input.attr('id')).toBe(scope.inputId); element.remove(); })); it('forwards the `md-input-class` attribute to the input', function() { var scope = createScope(null, {inputClass: 'custom-input-class'}); var template = '\ <md-autocomplete\ md-floating-label="Some Label"\ md-input-class="{{inputClass}}"\ md-selected-item="selectedItem"\ md-search-text="searchText"\ md-items="item in match(searchText)"\ md-item-text="item.display"\ placeholder="placeholder">\ <span md-highlight-text="searchText">{{item.display}}</span>\ </md-autocomplete>'; var element = compile(template, scope); var input = element.find('input'); expect(input).toHaveClass(scope.inputClass); element.remove(); }); it('forwards the `md-select-on-focus` attribute to the input', inject(function() { var scope = createScope(null, {inputId: 'custom-input-id'}); var template = '<md-autocomplete ' + 'md-input-id="{{inputId}}" ' + 'md-selected-item="selectedItem" ' + 'md-search-text="searchText" ' + 'md-items="item in match(searchText)" ' + 'md-item-text="item.display" ' + 'md-select-on-focus="" ' + 'tabindex="3"' + 'placeholder="placeholder">' + '<span md-highlight-text="searchText">{{item.display}}</span>' + '</md-autocomplete>'; var element = compile(template, scope); var input = element.find('input'); expect(input.attr('md-select-on-focus')).toBe(""); element.remove(); })); it('should support ng-trim for the search input', inject(function() { var scope = createScope(null, {inputId: 'custom-input-id'}); var template = '<md-autocomplete ' + 'md-selected-item="selectedItem" ' + 'md-search-text="searchText" ' + 'md-items="item in match(searchText)" ' + 'md-item-text="item.display" ' + 'ng-trim="false" ' + 'placeholder="placeholder">' + '<span md-highlight-text="searchText">{{item.display}}</span>' + '</md-autocomplete>'; var element = compile(template, scope); var input = element.find('input'); expect(input.attr('ng-trim')).toBe("false"); scope.$apply('searchText = " Text "'); expect(scope.searchText).not.toBe('Text'); element.remove(); })); it('should support ng-pattern for the search input', inject(function() { var scope = createScope(null, {inputId: 'custom-input-id'}); var template = '<form name="testForm">' + '<md-autocomplete ' + 'md-input-name="autocomplete" ' + 'md-selected-item="selectedItem" ' + 'md-search-text="searchText" ' + 'md-items="item in match(searchText)" ' + 'md-item-text="item.display" ' + 'ng-pattern="/^[0-9]$/" ' + 'placeholder="placeholder">' + '<span md-highlight-text="searchText">{{item.display}}</span>' + '</md-autocomplete>' + '</form>'; var element = compile(template, scope); var input = element.find('input'); expect(input.attr('ng-pattern')).toBeTruthy(); scope.$apply('searchText = "Test"'); expect(scope.testForm.autocomplete.$error['pattern']).toBeTruthy(); scope.$apply('searchText = "3"'); expect(scope.testForm.autocomplete.$error['pattern']).toBeFalsy(); element.remove(); })); it('forwards the tabindex to the input', inject(function() { var scope = createScope(null, {inputId: 'custom-input-id'}); var template = '<md-autocomplete ' + 'md-input-id="{{inputId}}" ' + 'md-selected-item="selectedItem" ' + 'md-search-text="searchText" ' + 'md-items="item in match(searchText)" ' + 'md-item-text="item.display" ' + 'tabindex="3"' + 'placeholder="placeholder">' + '<span md-highlight-text="searchText">{{item.display}}</span>' + '</md-autocomplete>'; var element = compile(template, scope); var input = element.find('input'); expect(input.attr('tabindex')).toBe('3'); element.remove(); })); it('always sets the tabindex of the autcomplete to `-1`', inject(function() { var scope = createScope(null, {inputId: 'custom-input-id'}); var template = '<md-autocomplete ' + 'md-input-id="{{inputId}}" ' + 'md-selected-item="selectedItem" ' + 'md-search-text="searchText" ' + 'md-items="item in match(searchText)" ' + 'md-item-text="item.display" ' + 'tabindex="3"' + 'placeholder="placeholder">' + '<span md-highlight-text="searchText">{{item.display}}</span>' + '</md-autocomplete>'; var element = compile(template, scope); expect(element.attr('tabindex')).toBe('-1'); element.remove(); })); it('should emit the ngBlur event from the input', inject(function() { var scope = createScope(null, { onBlur: jasmine.createSpy('onBlur event') }); var template = '<md-autocomplete ' + 'md-selected-item="selectedItem" ' + 'md-search-text="searchText" ' + 'md-items="item in match(searchText)" ' + 'md-item-text="item.display" ' + 'ng-blur="onBlur($event)" ' + 'placeholder="placeholder">' + '<span md-highlight-text="searchText">{{item.display}}</span>' + '</md-autocomplete>'; var element = compile(template, scope); var input = element.find('input'); input.triggerHandler('blur'); expect(scope.onBlur).toHaveBeenCalledTimes(1); // Confirm that the ngFocus event was called with the $event local. var focusEvent = scope.onBlur.calls.mostRecent().args[0]; expect(focusEvent.target).toBe(input[0]); element.remove(); })); it('should emit the ngFocus event from the input', inject(function() { var scope = createScope(null, { onFocus: jasmine.createSpy('onFocus event') }); var template = '<md-autocomplete ' + 'md-selected-item="selectedItem" ' + 'md-search-text="searchText" ' + 'md-items="item in match(searchText)" ' + 'md-item-text="item.display" ' + 'ng-focus="onFocus($event)" ' + 'placeholder="placeholder">' + '<span md-highlight-text="searchText">{{item.display}}</span>' + '</md-autocomplete>'; var element = compile(template, scope); var input = element.find('input'); input.triggerHandler('focus'); expect(scope.onFocus).toHaveBeenCalledTimes(1); // Confirm that the ngFocus event was called with the $event object. var focusEvent = scope.onFocus.calls.mostRecent().args[0]; expect(focusEvent.target).toBe(input[0]); element.remove(); })); it('should not show a loading progress when the items object is invalid', inject(function() { var scope = createScope(null, { match: function() { // Return an invalid object, which is not an array, neither a promise. return {} } }); var template = '<md-autocomplete ' + 'md-input-id="{{inputId}}" ' + 'md-selected-item="selectedItem" ' + 'md-search-text="searchText" ' + 'md-items="item in match(searchText)" ' + 'md-item-text="item.display" ' + 'tabindex="3"' + 'placeholder="placeholder">' + '<span md-highlight-text="searchText">{{item.display}}</span>' + '</md-autocomplete>'; var element = compile(template, scope); var ctrl = element.controller('mdAutocomplete'); scope.$apply('searchText = "test"'); expect(ctrl.loading).toBe(false); element.remove(); })); it('clears the value when hitting escape', inject(function($mdConstant, $timeout) { var scope = createScope(); var template = '\ <md-autocomplete\ md-search-text="searchText"\ md-items="item in match(searchText)"\ md-item-text="item.display"\ placeholder="placeholder">\ <span md-highlight-text="searchText">{{item.display}}</span>\ </md-autocomplete>'; var element = compile(template, scope); var input = element.find('input'); var ctrl = element.controller('mdAutocomplete'); expect(scope.searchText).toBe(''); scope.$apply('searchText = "test"'); expect(scope.searchText).toBe('test'); $timeout.flush(); scope.$apply(function() { ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.ESCAPE)); }); expect(scope.searchText).toBe(''); element.remove(); })); describe('md-input-maxlength', function() { it('should correctly set the form to invalid if floating label is present', inject(function($timeout) { var scope = createScope(null, {inputId: 'custom-input-id'}); var template = '<form name="testForm">' + '<md-autocomplete ' + 'md-input-id="{{inputId}}" ' + 'md-input-maxlength="2" ' + 'md-input-name="testAutocomplete" ' + 'md-selected-item="selectedItem" ' + 'md-search-text="searchText" ' + 'md-items="item in match(searchText)" ' + 'md-item-text="item.display" ' + 'tabindex="3"' + 'md-floating-label="Favorite state">' + '<span md-highlight-text="searchText">{{item.display}}</span>' + '</md-autocomplete>' + '</form>'; var element = compile(template, scope); var input = element.find('input'); expect(scope.searchText).toBe(''); expect(scope.testForm.$valid).toBe(true); scope.$apply('searchText = "Exceeded"'); expect(scope.testForm.$valid).toBe(false); element.remove(); })); it('should correctly set the form to invalid when no floating label is present', inject(function($timeout) { var scope = createScope(null, {inputId: 'custom-input-id'}); var template = '<form name="testForm">' + '<md-autocomplete ' + 'md-input-id="{{inputId}}" ' + 'md-input-maxlength="5" ' + 'md-input-name="testAutocomplete" ' + 'md-selected-item="selectedItem" ' + 'md-search-text="searchText" ' + 'md-items="item in match(searchText)" ' + 'md-item-text="item.display" >' + '<span md-highlight-text="searchText">{{item.display}}</span>' + '</md-autocomplete>' + '</form>'; var element = compile(template, scope); var input = element.find('input'); expect(scope.searchText).toBe(''); expect(scope.testForm.$valid).toBe(true); scope.$apply('searchText = "Exceeded"'); expect(scope.testForm.$valid).toBe(false); element.remove(); })); it('should not clear the view value if the input is invalid', inject(function($timeout) { var scope = createScope(null, {inputId: 'custom-input-id'}); var template = '<form name="testForm">' + '<md-autocomplete ' + 'md-input-id="{{inputId}}" ' + 'md-input-maxlength="2" ' + 'md-input-name="testAutocomplete" ' + 'md-selected-item="selectedItem" ' + 'md-search-text="searchText" ' + 'md-items="item in match(searchText)" ' + 'md-item-text="item.display" ' + 'tabindex="3"' + 'md-floating-label="Favorite state">' + '<span md-highlight-text="searchText">{{item.display}}</span>' + '</md-autocomplete>' + '</form>'; var element = compile(template, scope); var input = element.find('input'); expect(scope.searchText).toBe(''); expect(scope.testForm.$valid).toBe(true); input.val('Exceeded'); input.triggerHandler('change'); scope.$digest(); expect(scope.testForm.$valid).toBe(false); expect(scope.searchText).toBe('Exceeded'); element.remove(); })); }); describe('md-input-minlength', function() { it('should correctly set the form to invalid when floating label is present', inject(function($timeout) { var scope = createScope(null, {inputId: 'custom-input-id'}); var template = '<form name="testForm">' + '<md-autocomplete ' + 'md-input-id="{{inputId}}" ' + 'md-input-minlength="4" ' + 'md-input-name="testAutocomplete" ' + 'md-selected-item="selectedItem" ' + 'md-search-text="searchText" ' + 'md-items="item in match(searchText)" ' + 'md-item-text="item.display" ' + 'tabindex="3"' + 'md-floating-label="Favorite state">' + '<span md-highlight-text="searchText">{{item.display}}</span>' + '</md-autocomplete>' + '</form>'; var element = compile(template, scope); var input = element.find('input'); scope.$apply('searchText = "abc"'); expect(scope.testForm.$valid).toBe(false); scope.$apply('searchText = "abcde"'); expect(scope.testForm.$valid).toBe(true); element.remove(); })); it('should correctly set the form to invalid when no floating label is present', inject(function($timeout) { var scope = createScope(null, {inputId: 'custom-input-id'}); var template = '<form name="testForm">' + '<md-autocomplete ' + 'md-input-id="{{inputId}}" ' + 'md-input-minlength="4" ' + 'md-input-name="testAutocomplete" ' + 'md-selected-item="selectedItem" ' + 'md-search-text="searchText" ' + 'md-items="item in match(searchText)" ' + 'md-item-text="item.display" >' + '<span md-highlight-text="searchText">{{item.display}}</span>' + '</md-autocomplete>' + '</form>'; var element = compile(template, scope); var input = element.find('input'); scope.$apply('searchText = "abc"'); expect(scope.testForm.$valid).toBe(false); scope.$apply('searchText = "abcde"'); expect(scope.testForm.$valid).toBe(true); element.remove(); })); }); describe('md-escape-options checks', function() { var scope, ctrl, element; var template = '\ <md-autocomplete\ md-escape-options="{{escapeOptions}}"\ md-search-text="searchText"\ md-items="item in match(searchText)"\ md-item-text="item.display"\ placeholder="placeholder">\ <span md-highlight-text="searchText">{{item.display}}</span>\ </md-autocomplete>'; beforeEach( inject(function($timeout, $material) { scope = createScope(); element = compile(template, scope); ctrl = element.controller('mdAutocomplete'); $material.flushInterimElement(); // Update the scope element.scope().searchText = 'fo'; waitForVirtualRepeat(element); // Focus the input ctrl.focus(); $timeout.flush(); expect(ctrl.hidden).toBe(false); expect(scope.searchText).toBe('fo'); waitForVirtualRepeat(element); $timeout.flush(); expect(ctrl.hidden).toBe(false); })); afterEach(function() { element.remove() }); it('does not clear the value nor blur when hitting escape', inject(function($mdConstant, $document, $timeout) { scope.$apply('escapeOptions = "none"'); scope.$apply(function() { ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.ESCAPE)); $timeout.flush(); expect(ctrl.hidden).toBe(true); ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.ESCAPE)); $timeout.flush(); }); expect(scope.searchText).toBe('fo'); expect($document.activeElement).toBe(ctrl[0]); })); it('does not clear the value but does blur when hitting escape', inject(function($mdConstant, $document, $timeout) { scope.$apply('escapeOptions = "blur"'); scope.$apply(function() { ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.ESCAPE)); $timeout.flush(); expect(ctrl.hidden).toBe(true); ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.ESCAPE)); $timeout.flush(); }); expect(scope.searchText).toBe('fo'); expect($document.activeElement).toBe(undefined); })); it('clear the value but does not blur when hitting escape', inject(function($mdConstant, $document, $timeout) { scope.$apply('escapeOptions = "clear"'); scope.$apply(function() { ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.ESCAPE)); $timeout.flush(); expect(ctrl.hidden).toBe(true); ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.ESCAPE)); $timeout.flush(); }); expect(scope.searchText).toBe(''); expect($document.activeElement).toBe(ctrl[0]); })); }); it('should not show the progressbar when hitting escape on an empty input', inject(function($mdConstant, $timeout) { var scope = createScope(); var template = '\ <md-autocomplete\ md-search-text="searchText"\ md-items="item in match(searchText)">\ </md-autocomplete>'; var element = compile(template, scope); var ctrl = element.controller('mdAutocomplete'); $timeout.flush(); scope.$apply(function() { ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.ESCAPE)); }); expect(element.find('md-progress-linear').length).toBe(0); element.remove(); })); it('should not close list on ENTER key if nothing is selected', inject(function($timeout, $mdConstant, $material) { var scope = createScope(); var template = '\ <md-autocomplete\ md-selected-item="selectedItem"\ md-search-text="searchText"\ md-items="item in match(searchText)"\ md-item-text="item.display"\ placeholder="placeholder">\ <span md-highlight-text="searchText">{{item.display}}</span>\ </md-autocomplete>'; var element = compile(template, scope); var ctrl = element.controller('mdAutocomplete'); var ul = element.find('ul'); $material.flushInterimElement(); // Update the scope element.scope().searchText = 'fo'; waitForVirtualRepeat(element); // Focus the input ctrl.focus(); $timeout.flush(); expect(ctrl.hidden).toBe(false); // Run our key events ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.ENTER)); $timeout.flush(); // Check expectations again expect(ctrl.hidden).toBe(false); element.remove(); })); }); describe('basic functionality with template', function() { it('updates selected item and search text', inject(function($timeout, $material, $mdConstant) { var scope = createScope(); var template = '\ <md-autocomplete\ md-selected-item="selectedItem"\ md-search-text="searchText"\ md-items="item in match(searchText)"\ md-item-text="item.display"\ placeholder="placeholder">\ <md-item-template>\ <span md-highlight-text="searchText">{{item.display}}</span>\ </md-item-template>\ </md-autocomplete>'; var element = compile(template, scope); var ctrl = element.controller('mdAutocomplete'); var ul = element.find('ul'); expect(scope.searchText).toBe(''); expect(scope.selectedItem).toBe(null); $material.flushInterimElement(); // Focus the input ctrl.focus(); element.scope().searchText = 'fo'; waitForVirtualRepeat(element); expect(scope.searchText).toBe('fo'); expect(scope.match(scope.searchText).length).toBe(1); expect(ul.find('li').length).toBe(1); ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.DOWN_ARROW)); ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.ENTER)); $timeout.flush(); expect(scope.searchText).toBe('foo'); expect(scope.selectedItem).toBe(scope.match(scope.searchText)[0]); element.remove(); })); it('properly clears values when the item ends in a space character', inject(function($timeout, $material, $mdConstant) { var myItems = ['foo ', 'bar', 'baz'].map(function(item) { return {display: item}; }); var scope = createScope(myItems); var template = '\ <md-autocomplete\ md-selected-item="selectedItem"\ md-search-text="searchText"\ md-items="item in match(searchText)"\ md-item-text="item.display"\ placeholder="placeholder">\ <md-item-template>\ <span md-highlight-text="searchText">{{item.display}}</span>\ </md-item-template>\ </md-autocomplete>'; var element = compile(template, scope); var ctrl = element.controller('mdAutocomplete'); var ul = element.find('ul'); expect(scope.searchText).toBe(''); expect(scope.selectedItem).toBe(null); $material.flushInterimElement(); // Focus the input ctrl.focus(); element.scope().searchText = 'fo'; waitForVirtualRepeat(element); expect(scope.searchText).toBe('fo'); expect(scope.match(scope.searchText).length).toBe(1); expect(ul.find('li').length).toBe(1); ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.DOWN_ARROW)); ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.ENTER)); $timeout.flush(); expect(scope.searchText).toBe('foo '); expect(scope.selectedItem).toBe(scope.match(scope.searchText)[0]); ctrl.clear(); $timeout.flush(); expect(scope.searchText).toBe(''); expect(scope.selectedItem).toBe(null); element.remove(); })); it('compiles the template against the parent scope', inject(function($timeout, $material) { var scope = createScope(null, {bang: 'boom'}); var template = '<md-autocomplete' + ' md-selected-item="selectedItem"' + ' md-search-text="searchText"' + ' md-items="item in match(searchText)"' + ' md-item-text="item.display"' + ' placeholder="placeholder">' + ' <md-item-template>' + ' <span class="find-parent-scope">{{bang}}</span>' + ' <span class="find-index">{{$index}}</span>' + ' <span class="find-item">{{item.display}}</span>' + ' </md-item-template>' + '</md-autocomplete>'; var element = compile(template, scope); var ctrl = element.controller('mdAutocomplete'); var ul = element.find('ul'); $material.flushOutstandingAnimations(); expect(scope.bang).toBe('boom'); // Focus the input ctrl.focus(); element.scope().searchText = 'fo'; // Run our initial flush $timeout.flush(); waitForVirtualRepeat(element); // Wait for the next tick when the values will be updated $timeout.flush(); var li = ul.find('li')[0]; // Expect it to be compiled against the parent scope and have our variables copied expect(li.querySelector('.find-parent-scope').innerHTML).toBe('boom'); expect(li.querySelector('.find-index').innerHTML).toBe('0'); expect(li.querySelector('.find-item').innerHTML).toBe('foo'); // Make sure we wrap up anything and remove the element $timeout.flush(); element.remove(); })); it('removes the md-scroll-mask on cleanup', inject(function($mdUtil, $timeout, $material) { spyOn($mdUtil, 'enableScrolling').and.callThrough(); var scope = createScope(); var template = '<md-autocomplete' + ' md-selected-item="selectedItem"' + ' md-search-text="searchText"' + ' md-items="item in match(searchText)"' + ' md-item-text="item.display"' + ' placeholder="placeholder">' + ' <md-item-template>{{item.display}}</md-item-template>' + ' <md-not-found>Sorry, not found...</md-not-found>' + '</md-autocomplete>'; var element = compile(template, scope); var ctrl = element.controller('mdAutocomplete'); $material.flushOutstandingAnimations(); // Focus our input ctrl.focus(); // Set our search text to a value that we know doesn't exist scope.searchText = 'somethingthatdoesnotexist'; // Run our initial flush $timeout.flush(); waitForVirtualRepeat(element); // Wait for the next tick when the values will be updated $timeout.flush(); expect(ctrl.hidden).toBeFalsy(); // Make sure we wrap up anything and remove the element $timeout.flush(); element.remove(); scope.$destroy(); // Should be hidden on once the scope is destroyed to ensure proper cleanup (like md-scroll-mask is removed from the DOM) expect($mdUtil.enableScrolling).toHaveBeenCalled(); })); it('removes the md-scroll-mask when md-autocomplete removed on change', inject(function($mdUtil, $timeout, $material) { spyOn($mdUtil, 'enableScrolling').and.callThrough(); var scope = createScope(); var template = '<div>' + ' <md-autocomplete' + ' ng-if="!removeAutocomplete"' + ' md-selected-item="selectedItem"' + ' md-search-text="searchText"' + ' md-items="item in match(searchText)"' + ' md-item-text="item.display"' + ' placeholder="placeholder">' + ' <md-item-template>{{item.display}}</md-item-template>' + ' <md-not-found>Sorry, not found...</md-not-found>' + ' </md-autocomplete>' + '</div>'; var element = compile(template, scope); var ctrl = element.children().controller('mdAutocomplete'); $material.flushOutstandingAnimations(); // Focus our input ctrl.focus(); // Set our search text to a value to make md-scroll-mask added to DOM scope.$apply('searchText = "searchText"'); $timeout.flush(); // Set removeAutocomplete to false to remove the md-autocomplete scope.$apply('removeAutocomplete = true'); expect($mdUtil.enableScrolling).toHaveBeenCalled(); })); it('should initialize the search text with an empty string', inject(function($mdUtil, $timeout, $material) { var scope = createScope(); // Delete our searchText variable from the generated scope, because we // want to confirm, that the autocomplete uses an empty string by default. delete scope.searchText; var template = '<md-autocomplete' + ' md-selected-item="selectedItem"' + ' md-search-text="searchText"' + ' md-items="item in match(searchText)"' + ' md-item-text="item.display"' + ' placeholder="placeholder">' + ' <md-item-template>{{item.display}}</md-item-template>' + ' <md-not-found>Sorry, not found...</md-not-found>' + '</md-autocomplete>'; var element = compile(template, scope); var ctrl = element.controller('mdAutocomplete'); $material.flushOutstandingAnimations(); // Run our initial flush $timeout.flush(); waitForVirtualRepeat(element); // Set our search text to a value that we know doesn't exist expect(scope.searchText).toBe(''); // Make sure we wrap up anything and remove the element $timeout.flush(); element.remove(); })); it('ensures the parent scope digests along with the current scope', inject(function($timeout, $material) { var scope = createScope(null, {bang: 'boom'}); var template = '<md-autocomplete' + ' md-selected-item="selectedItem"' + ' md-search-text="searchText"' + ' md-items="item in match(searchText)"' + ' md-item-text="item.display"' + ' placeholder="placeholder">' + ' <md-item-template>' + ' <span class="find-parent-scope">{{bang}}</span>' + ' <span class="find-index">{{$index}}</span>' + ' <span class="find-item">{{item.display}}</span>' + ' </md-item-template>' + '</md-autocomplete>'; var element = compile(template, scope); var ctrl = element.controller('mdAutocomplete'); var ul = element.find('ul'); $material.flushOutstandingAnimations(); // Focus the input ctrl.focus(); element.scope().searchText = 'fo'; // Run our initial flush $timeout.flush(); waitForVirtualRepeat(element); // Wait for the next tick when the values will be updated $timeout.flush(); var li = ul.find('li')[0]; var parentScope = angular.element(li.querySelector('.find-parent-scope')).scope(); // When the autocomplete item's scope digests, ensure that the parent // scope does too. parentScope.bang = 'big'; scope.$digest(); expect(li.querySelector('.find-parent-scope').innerHTML).toBe('big'); // Make sure we wrap up anything and remove the element $timeout.flush(); element.remove(); })); it('is hidden when no matches are found without an md-not-found template', inject(function($timeout, $material) { var scope = createScope(); var template = '<md-autocomplete' + ' md-selected-item="selectedItem"' + ' md-search-text="searchText"' + ' md-items="item in match(searchText)"' + ' md-item-text="item.display"' + ' placeholder="placeholder">' + ' <md-item-template>{{item.display}}</md-item-template>' + '</md-autocomplete>'; var element = compile(template, scope); var ctrl = element.controller('mdAutocomplete'); $material.flushOutstandingAnimations(); // Focus our input ctrl.focus(); // Set our search text to a value that we know doesn't exist scope.searchText = 'somethingthatdoesnotexist'; // Run our initial flush $timeout.flush(); waitForVirtualRepeat(element); // Wait for the next tick when the values will be updated $timeout.flush(); // We should be hidden since no md-not-found template was provided expect(ctrl.hidden).toBe(true); // Make sure we wrap up anything and remove the element $timeout.flush(); element.remove(); })); it('is visible when no matches are found with an md-not-found template', inject(function($timeout, $material) { var scope = createScope(); var template = '<md-autocomplete' + ' md-selected-item="selectedItem"' + ' md-search-text="searchText"' + ' md-items="item in match(searchText)"' + ' md-item-text="item.display"' + ' placeholder="placeholder">' + ' <md-item-template>{{item.display}}</md-item-template>' + ' <md-not-found>Sorry, not found...</md-not-found>' + '</md-autocomplete>'; var element = compile(template, scope); var ctrl = element.controller('mdAutocomplete'); $material.flushOutstandingAnimations(); // Focus our input ctrl.focus(); // Set our search text to a value that we know doesn't exist scope.searchText = 'somethingthatdoesnotexist'; // Run our initial flush $timeout.flush(); waitForVirtualRepeat(element); // Wait for the next tick when the values will be updated $timeout.flush(); // We should be visible since an md-not-found template was provided expect(ctrl.hidden).toBe(false); // Make sure we wrap up anything and remove the element $timeout.flush(); element.remove(); })); it('properly sets hasNotFound when element is hidden through ng-if', inject(function() { var scope = createScope(); var template1 = '<div>' + '<md-autocomplete ' + 'md-selected-item="selectedItem" ' + 'md-search-text="searchText" ' + 'md-items="item in match(searchText)" ' + 'md-item-text="item.display" ' + 'placeholder="placeholder" ' + 'ng-if="showAutocomplete">' + '<md-item-template>{{item.display}}</md-item-template>' + '<md-not-found>Sorry, not found...</md-not-found>' + '</md-autocomplete>' + '</div>'; var element = compile(template1, scope); var ctrl = element.children().controller('mdAutocomplete'); expect(ctrl).toBeUndefined(); scope.$apply('showAutocomplete = true'); ctrl = element.children().controller('mdAutocomplete'); expect(ctrl.hasNotFound).toBe(true); })); it('properly sets hasNotFound with multiple autocompletes', inject(function($timeout, $material) { var scope = createScope(); var template1 = '<md-autocomplete' + ' md-selected-item="selectedItem"' + ' md-search-text="searchText"' + ' md-items="item in match(searchText)"' + ' md-item-text="item.display"' + ' placeholder="placeholder">' + ' <md-item-template>{{item.display}}</md-item-template>' + ' <md-not-found>Sorry, not found...</md-not-found>' + '</md-autocomplete>'; var element1 = compile(template1, scope); var ctrl1 = element1.controller('mdAutocomplete'); var template2 = '<md-autocomplete' + ' md-selected-item="selectedItem"' + ' md-search-text="searchText"' + ' md-items="item in match(searchText)"' + ' md-item-text="item.display"' + ' placeholder="placeholder">' + ' <md-item-template>{{item.display}}</md-item-template>' + '</md-autocomplete>'; var element2 = compile(template2, scope); var ctrl2 = element2.controller('mdAutocomplete'); // The first autocomplete has a template, the second one does not expect(ctrl1.hasNotFound).toBe(true); expect(ctrl2.hasNotFound).toBe(false); })); it('shows the md-not-found template even if we have lost focus', inject(function($timeout) { var scope = createScope(); var template = '<md-autocomplete' + ' md-selected-item="selectedItem"' + ' md-search-text="searchText"' + ' md-items="item in match(searchText)"' + ' md-item-text="item.display"' + ' placeholder="placeholder">' + ' <md-item-template>{{item.display}}</md-item-template>' + ' <md-not-found>Sorry, not found...</md-not-found>' + '</md-autocomplete>'; var element = compile(template, scope); var controller = element.controller('mdAutocomplete'); controller.focus(); scope.searchText = 'somethingthatdoesnotexist'; $timeout.flush(); controller.listEnter(); expect(controller.notFoundVisible()).toBe(true); controller.blur(); expect(controller.notFoundVisible()).toBe(true); controller.listLeave(); expect(controller.notFoundVisible()).toBe(false); $timeout.flush(); element.remove(); })); it('should not show the md-not-found template if we lost focus and left the list', inject(function($timeout) { var scope = createScope(); var template = '<md-autocomplete' + ' md-selected-item="selectedItem"' + ' md-search-text="searchText"' + ' md-items="item in match(searchText)"' + ' md-item-text="item.display"' + ' placeholder="placeholder">' + ' <md-item-template>{{item.display}}</md-item-template>' + ' <md-not-found>Sorry, not found...</md-not-found>' + '</md-autocomplete>'; var element = compile(template, scope); var controller = element.controller('mdAutocomplete'); controller.focus(); scope.searchText = 'somethingthatdoesnotexist'; $timeout.flush(); controller.listEnter(); expect(controller.notFoundVisible()).toBe(true); controller.listLeave(); controller.blur(); expect(controller.notFoundVisible()).toBe(false); $timeout.flush(); element.remove(); })); it('should log a warning if the display text does not evaluate to a string', inject(function($log) { spyOn($log, 'warn'); var scope = createScope(); var template = '<md-autocomplete ' + 'md-selected-item="selectedItem" ' + 'md-search-text="searchText"' + 'md-items="item in match(searchText)"> ' + '</md-autocomplete>'; var element = compile(template, scope); scope.$apply(function() { scope.selectedItem = { display: 'foo' }; }); expect($log.warn).toHaveBeenCalled(); expect($log.warn.calls.mostRecent().args[0]).toMatch(/md-item-text/); element.remove(); }) ); }); describe('clear button', function() { it('should show the clear button for inset autocomplete', function() { var scope = createScope(); var template = '<md-autocomplete ' + 'md-selected-item="selectedItem" ' + 'md-search-text="searchText" ' + 'md-items="item in match(searchText)" ' + 'md-item-text="item.display" ' + 'placeholder="placeholder"> ' + '<span md-highlight-text="searchText">{{item.display}}</span>' + '</md-autocomplete>'; var element = compile(template, scope); var ctrl = element.controller('mdAutocomplete'); var wrapEl = element.find('md-autocomplete-wrap'); expect(ctrl.scope.clearButton).toBe(true); expect(wrapEl).toHaveClass('md-show-clear-button'); }); it('should not show the clear button for floating label autocomplete', function() { var scope = createScope(); var template = '<md-autocomplete ' + 'md-selected-item="selectedItem" ' + 'md-search-text="searchText" ' + 'md-items="item in match(searchText)" ' + 'md-item-text="item.display" ' + 'md-floating-label="Label"> ' + '<span md-highlight-text="searchText">{{item.display}}</span>' + '</md-autocomplete>'; var element = compile(template, scope); var ctrl = element.controller('mdAutocomplete'); var wrapEl = element.find('md-autocomplete-wrap'); expect(ctrl.scope.clearButton).toBe(false); expect(wrapEl).not.toHaveClass('md-show-clear-button'); }); it('should allow developers to toggle the clear button', function() { var scope = createScope(); var template = '<md-autocomplete ' + 'md-selected-item="selectedItem" ' + 'md-search-text="searchText" ' + 'md-items="item in match(searchText)" ' + 'md-item-text="item.display" ' + 'md-floating-label="Label" ' + 'md-clear-button="showButton">' + '<span md-highlight-text="searchText">{{item.display}}</span>' + '</md-autocomplete>'; var element = compile(template, scope); var ctrl = element.controller('mdAutocomplete'); var wrapEl = element.find('md-autocomplete-wrap'); expect(ctrl.scope.clearButton).toBeFalsy(); expect(wrapEl).not.toHaveClass('md-show-clear-button'); scope.$apply('showButton = true'); expect(ctrl.scope.clearButton).toBe(true); expect(wrapEl).toHaveClass('md-show-clear-button'); }); }); describe('xss prevention', function() { it('should not allow html to slip through', inject(function($timeout, $material) { var html = 'foo <img src="img" onerror="alert(1)" />'; var scope = createScope([{ display: html }]); var template = '\ <md-autocomplete\ md-selected-item="selectedItem"\ md-search-text="searchText"\ md-items="item in match(searchText)"\ md-item-text="item.display"\ md-min-length="0"\ placeholder="placeholder">\ <span md-highlight-text="searchText">{{item.display}}</span>\ </md-autocomplete>'; var element = compile(template, scope); var ctrl = element.controller('mdAutocomplete'); var ul = element.find('ul'); $material.flushOutstandingAnimations(); expect(scope.searchText).toBe(''); expect(scope.selectedItem).toBe(null); // Focus the input ctrl.focus(); scope.$apply('searchText = "fo"'); $timeout.flush(); waitForVirtualRepeat(element); expect(scope.searchText).toBe('fo'); expect(scope.match(scope.searchText).length).toBe(1); expect(ul.find('li').length).toBe(1); expect(ul.find('li').find('img').length).toBe(0); element.remove(); })); }); describe('Async matching', function() { it('properly stops the loading indicator when clearing', inject(function($timeout, $material) { var scope = createScope(); var template = '<md-autocomplete ' + ' md-search-text="searchText"' + ' md-items="item in asyncMatch(searchText)" ' + ' md-item-text="item.display" ' + ' placeholder="placeholder">' + ' <span md-highlight-text="searchText">{{item.display}}</span>' + '</md-autocomplete>'; var element = compile(template, scope); var input = element.find('input'); var ctrl = element.controller('mdAutocomplete'); $material.flushInterimElement(); scope.$apply('searchText = "test"'); ctrl.clear(); expect(ctrl.loading).toBe(true); $timeout.flush(); expect(ctrl.loading).toBe(false); })); }); describe('accessibility', function() { var $mdLiveAnnouncer, $timeout, $mdConstant = null; var liveEl, scope, element, ctrl = null; var BASIC_TEMPLATE = '<md-autocomplete' + ' md-selected-item="selectedItem"' + ' md-search-text="searchText"' + ' md-items="item in match(searchText)"' + ' md-item-text="item.display"' + ' md-min-length="0"' + ' placeholder="placeholder">' + ' <span md-highlight-text="searchText">{{item.display}}</span>' + '</md-autocomplete>'; beforeEach(inject(function ($injector) { $mdLiveAnnouncer = $injector.get('$mdLiveAnnouncer'); $mdConstant = $injector.get('$mdConstant'); $timeout = $injector.get('$timeout'); liveEl = $mdLiveAnnouncer._liveElement; scope = createScope(); element = compile(BASIC_TEMPLATE, scope); ctrl = element.controller('mdAutocomplete'); // Flush the initial autocomplete timeout to gather the elements. $timeout.flush(); })); it('should announce count on dropdown open', function() { ctrl.focus(); waitForVirtualRepeat(); expect(ctrl.hidden).toBe(false); expect(liveEl.textContent).toBe('There are 3 matches available.'); }); it('should announce count and selection on dropdown open', function() { // Manually enable md-autoselect for the autocomplete. ctrl.index = 0; ctrl.focus(); waitForVirtualRepeat(); expect(ctrl.hidden).toBe(false); // Expect the announcement to contain the current selection in the dropdown. expect(liveEl.textContent).toBe(scope.items[0].display + ' There are 3 matches available.'); }); it('should announce the selection when using the arrow keys', function() { ctrl.focus(); waitForVirtualRepeat(); expect(ctrl.hidden).toBe(false); ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.DOWN_ARROW)); // Flush twice, because the display value will be resolved asynchronously and then the live-announcer will // be triggered. $timeout.flush(); $timeout.flush(); expect(ctrl.index).toBe(0); expect(liveEl.textContent).toBe(scope.items[0].display); ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.DOWN_ARROW)); // Flush twice, because the display value will be resolved asynchronously and then the // live-announcer will be triggered. $timeout.flush(); $timeout.flush(); expect(ctrl.index).toBe(1); expect(liveEl.textContent).toBe(scope.items[1].display); }); it('should announce when an option is selected', function() { ctrl.focus(); waitForVirtualRepeat(); expect(ctrl.hidden).toBe(false); ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.DOWN_ARROW)); // Flush twice, because the display value will be resolved asynchronously and then the // live-announcer will be triggered. $timeout.flush(); $timeout.flush(); expect(ctrl.index).toBe(0); expect(liveEl.textContent).toBe(scope.items[0].display); ctrl.keydown(keydownEvent($mdConstant.KEY_CODE.ENTER)); // Flush twice, because the display value will be resolved asynchronously and then the // live-announcer will be triggered. $timeout.flush(); $timeout.flush(); expect(liveEl.textContent).toBe(scope.items[0].display + ' ' + ctrl.selectedMessage); }); it('should announce the count when matches change', function() { ctrl.focus(); waitForVirtualRepeat(); expect(ctrl.hidden).toBe(false); expect(liveEl.textContent).toBe('There are 3 matches available.'); scope.$apply('searchText = "fo"'); $timeout.flush(); expect(liveEl.textContent).toBe('There is 1 match available.'); }); }); describe('API access', function() { it('clears the selected item', inject(function($timeout) { var scope = createScope(); var template = '\ <md-autocomplete\ md-selected-item="selectedItem"\ md-search-text="searchText"\ md-items="item in match(searchText)"\ md-item-text="item.display"\ placeholder="placeholder">\ <span md-highlight-text="searchText">{{item.display}}</span>\ </md-autocomplete>'; var element = compile(template, scope); var ctrl = element.controller('mdAutocomplete'); element.scope().searchText = 'fo'; $timeout.flush(); ctrl.select(0); $timeout.flush(); expect(scope.searchText).toBe('foo'); expect(scope.selectedItem).not.toBeNull(); expect(scope.selectedItem.display).toBe('foo'); expect(scope.match(scope.searchText).length).toBe(1); ctrl.clear(); element.scope().$apply(); expect(scope.searchText).toBe(''); expect(scope.selectedItem).toBe(null); element.remove(); })); it('notifies selected item watchers', inject(function($timeout) { var scope = createScope(); scope.itemChanged = jasmine.createSpy('itemChanged'); var registeredWatcher = jasmine.createSpy('registeredWatcher'); var template = '\ <md-autocomplete\ md-selected-item="selectedItem"\ md-search-text="searchText"\ md-items="item in match(searchText)"\ md-selected-item-change="itemChanged(selectedItem)"\ md-item-text="item.display"\ placeholder="placeholder">\ <span md-highlight-text="searchText">{{item.display}}</span>\ </md-autocomplete>'; var element = compile(template, scope); var ctrl = element.controller('mdAutocomplete'); ctrl.registerSelectedItemWatcher(registeredWatcher); element.scope().searchText = 'fo'; $timeout.flush(); ctrl.select(0); $timeout.flush(); expect(scope.itemChanged).toHaveBeenCalled(); expect(scope.itemChanged.calls.mostRecent().args[0].display).toBe('foo'); expect(registeredWatcher).toHaveBeenCalled(); expect(registeredWatcher.calls.mostRecent().args[0].display).toBe('foo'); expect(registeredWatcher.calls.mostRecent().args[1]).toBeNull(); expect(scope.selectedItem).not.toBeNull(); expect(scope.selectedItem.display).toBe('foo'); // Un-register the watcher ctrl.unregisterSelectedItemWatcher(registeredWatcher); ctrl.clear(); element.scope().$apply(); expect(registeredWatcher.calls.count()).toBe(1); expect(scope.itemChanged.calls.count()).toBe(2); expect(scope.itemChanged.calls.mostRecent().args[0]).toBeNull(); expect(scope.selectedItem).toBeNull(); element.remove(); })); it('passes the value to the item watcher', inject(function($timeout) { var scope = createScope(); var itemValue = null; var template = '\ <md-autocomplete\ md-selected-item="selectedItem"\ md-search-text="searchText"\ md-items="item in match(searchText)"\ md-selected-item-change="itemChanged(item)"\ md-item-text="item.display"\ placeholder="placeholder">\ <span md-highlight-text="searchText">{{item.display}}</span>\ </md-autocomplete>'; scope.itemChanged = function(item) { itemValue = item; }; var element = compile(template, scope); var ctrl = element.controller('mdAutocomplete'); element.scope().searchText = 'fo'; $timeout.flush(); ctrl.select(0); $timeout.flush(); expect(itemValue).not.toBeNull(); expect(itemValue.display).toBe('foo'); ctrl.clear(); element.scope().$apply(); element.remove(); })); }); describe('md-select-on-match', function() { it('selects matching item on exact match when `md-select-on-match` is toggled', inject(function($timeout) { var scope = createScope(); var template = '\ <md-autocomplete\ md-select-on-match\ md-selected-item="selectedItem"\ md-search-text="searchText"\ md-items="item in match(searchText)"\ md-item-text="item.display"\ placeholder="placeholder">\ <span md-highlight-text="searchText">{{item.display}}</span>\ </md-autocomplete>'; var element = compile(template, scope); expect(scope.searchText).toBe(''); expect(scope.selectedItem).toBe(null); element.scope().searchText = 'foo'; $timeout.flush(); expect(scope.selectedItem).not.toBe(null); expect(scope.selectedItem.display).toBe('foo'); element.remove(); })); it('selects matching item on exact match with caching enabled', inject(function($timeout) { var scope = createScope(); var template = '\ <md-autocomplete\ md-select-on-match\ md-selected-item="selectedItem"\ md-search-text="searchText"\ md-items="item in match(searchText)"\ md-item-text="item.display"\ placeholder="placeholder">\ <span md-highlight-text="searchText">{{item.display}}</span>\ </md-autocomplete>'; var element = compile(template, scope); expect(scope.searchText).toBe(''); expect(scope.selectedItem).toBe(null); scope.$apply('searchText = "foo"'); $timeout.flush(); expect(scope.selectedItem).not.toBe(null); expect(scope.selectedItem.display).toBe('foo'); scope.$apply('searchText = ""'); $timeout.flush(); expect(scope.selectedItem).toBeFalsy(); scope.$apply('searchText = "foo"'); $timeout.flush(); expect(scope.selectedItem).not.toBe(null); expect(scope.selectedItem.display).toBe('foo'); element.remove(); })); it('should not select matching item on exact match when `md-select-on-match` is NOT toggled', inject(function($timeout) { var scope = createScope(); var template = '\ <md-autocomplete\ md-selected-item="selectedItem"\ md-search-text="searchText"\ md-items="item in match(searchText)"\ md-item-text="item.display"\ placeholder="placeholder">\ <span md-highlight-text="searchText">{{item.display}}</span>\ </md-autocomplete>'; var element = compile(template, scope); expect(scope.searchText).toBe(''); expect(scope.selectedItem).toBe(null); element.scope().searchText = 'foo'; $timeout.flush(); expect(scope.selectedItem).toBe(null); element.remove(); })); it('selects matching item using case insensitive', inject(function($timeout) { var scope = createScope(null, null, true); var template = '<md-autocomplete ' + 'md-select-on-match ' + 'md-selected-item="selectedItem" ' + 'md-search-text="searchText" ' + 'md-items="item in match(searchText)" ' + 'md-item-text="item.display" ' + 'placeholder="placeholder" ' + 'md-match-case-insensitive="true">' + '<span md-highlight-text="searchText">{{item.display}}</span>' + '</md-autocomplete>'; var element = compile(template, scope); expect(scope.searchText).toBe(''); expect(scope.selectedItem).toBe(null); element.scope().searchText = 'FoO'; $timeout.flush(); expect(scope.selectedItem).not.toBe(null); expect(scope.selectedItem.display).toBe('foo'); element.remove(); })); }); describe('when requiring a match', function() { it('should correctly update the validity', inject(function($timeout) { var scope = createScope(); var template = '\ <form name="form">\ <md-autocomplete\ md-input-name="autocomplete"\ md-selected-item="selectedItem"\ md-search-text="searchText"\ md-items="item in match(searchText)"\ md-item-text="item.display"\ placeholder="placeholder"\ md-require-match="true">\ <span md-highlight-text="searchText">{{item.display}}</span>\ </md-autocomplete>\ </form>'; var element = compile(template, scope); var ctrl = element.find('md-autocomplete').controller('mdAutocomplete'); // Flush the element gathering. $timeout.flush(); scope.$apply('searchText = "fo"'); $timeout.flush(); ctrl.select(0); $timeout.flush(); expect(scope.searchText).toBe('foo'); expect(scope.selectedItem).not.toBeNull(); expect(scope.selectedItem.display).toBe('foo'); expect(scope.match(scope.searchText).length).toBe(1); expect(scope.form.autocomplete.$error['md-require-match']).toBeFalsy(); scope.$apply('searchText = "food"'); $timeout.flush(); expect(scope.searchText).toBe('food'); expect(scope.selectedItem).toBeNull(); expect(scope.form.autocomplete.$error['md-require-match']).toBeTruthy(); })); it('should not set to invalid if searchText is empty', inject(function($timeout) { var scope = createScope(); var template = '\ <form name="form">\ <md-autocomplete\ md-input-name="autocomplete"\ md-selected-item="selectedItem"\ md-search-text="searchText"\ md-items="item in match(searchText)"\ md-item-text="item.display"\ placeholder="placeholder"\ md-require-match="true">\ <span md-highlight-text="searchText">{{item.display}}</span>\ </md-autocomplete>\ </form>'; compile(template, scope); // Flush the element gathering. $timeout.flush(); scope.$apply('searchText = "food"'); $timeout.flush(); expect(scope.searchText).toBe('food'); expect(scope.selectedItem).toBeNull(); expect(scope.form.autocomplete.$error['md-require-match']).toBeTruthy(); scope.$apply('searchText = ""'); expect(scope.searchText).toBe(''); expect(scope.selectedItem).toBeNull(); expect(scope.form.autocomplete.$error['md-require-match']).toBeFalsy(); })); }); describe('when required', function() { it('properly handles md-min-length="0" and undefined searchText', function() { var scope = createScope(); var template = '\ <md-autocomplete\ md-selected-item="selectedItem"\ md-search-text="searchText"\ md-items="item in match(searchText)"\ md-item-text="item.display"\ md-min-length="0" \ required\ placeholder="placeholder">\ <span md-highlight-text="searchText">{{item.display}}</span>\ </md-autocomplete>'; var error; try { var element = compile(template, scope); scope.searchText = undefined; scope.$digest(); } catch (e) { error = e; } expect(error).toBe(undefined); element.remove(); }); it('validates an empty `required` as true', function() { var scope = createScope(); var template = '\ <md-autocomplete\ md-selected-item="selectedItem"\ md-search-text="searchText"\ md-items="item in match(searchText)"\ md-item-text="item.display"\ md-min-length="0" \ required\ placeholder="placeholder">\ <span md-highlight-text="searchText">{{item.display}}</span>\ </md-autocomplete>'; var element = compile(template, scope); var ctrl = element.controller('mdAutocomplete'); expect(ctrl.isRequired).toBe(true); }); it('correctly validates an interpolated `ng-required` value', function() { var scope = createScope(); var template = '\ <md-autocomplete\ md-selected-item="selectedItem"\ md-search-text="searchText"\ md-items="item in match(searchText)"\ md-item-text="item.display"\ md-min-length="0" \ ng-required="interpolateRequired"\ placeholder="placeholder">\ <span md-highlight-text="searchText">{{item.display}}</span>\ </md-autocomplete>'; var element = compile(template, scope); var ctrl = element.controller('mdAutocomplete'); expect(ctrl.isRequired).toBe(false); scope.interpolateRequired = false; scope.$apply(); expect(ctrl.isRequired).toBe(false); scope.interpolateRequired = true; scope.$apply(); expect(ctrl.isRequired).toBe(true); }); it('forwards the md-no-asterisk attribute', function() { var scope = createScope(); var template = '\ <md-autocomplete\ md-selected-item="selectedItem"\ md-search-text="searchText"\ md-items="item in match(searchText)"\ md-item-text="item.display"\ md-min-length="0" \ required\ md-no-asterisk="true"\ md-floating-label="Asterisk Label">\ <span md-highlight-text="searchText">{{item.display}}</span>\ </md-autocomplete>'; var element = compile(template, scope); var input = element.find('input'); expect(input.attr('md-no-asterisk')).toBe('true'); }); }); describe('dropdown position', function() { var DEFAULT_MAX_ITEMS = 5; var DEFAULT_ITEM_HEIGHT = 48; var dropdownItems = DEFAULT_MAX_ITEMS; /** * Function to create fake matches with the given dropdown items. * Useful when running tests against the dropdown max items calculations. * @returns {Array} Fake matches. */ function fakeItemMatch() { var matches = []; for (var i = 0; i < dropdownItems; i++) { matches.push('Item ' + i); } return matches; } it('should adjust the width when the window resizes', inject(function($timeout, $window) { var scope = createScope(); var template = '<div style="width: 400px">' + '<md-autocomplete ' + 'md-search-text="searchText" ' + 'md-items="item in match(searchText)" ' + 'md-item-text="item.display" ' + 'md-min-length="0" ' + 'placeholder="placeholder">' + '<span md-highlight-text="searchText">{{item.display}}</span>' + '</md-autocomplete>' + '</div>'; var parent = compile(template, scope); var element = parent.find('md-autocomplete'); var ctrl = element.controller('mdAutocomplete'); // Add container to the DOM to be able to test the rect calculations. document.body.appendChild(parent[0]); $timeout.flush(); expect(ctrl.positionDropdown).toBeTruthy(); // Focus the Autocomplete to open the dropdown. ctrl.focus(); scope.$apply('searchText = "fo"'); waitForVirtualRepeat(element); // The scroll repeat container has been moved to the body element to avoid // z-index / overflow issues. var scrollContainer = document.body.querySelector('.md-virtual-repeat-container'); expect(scrollContainer).toBeTruthy(); // Expect the current width of the scrollContainer to be the same as of the parent element // at initialization. expect(scrollContainer.style.minWidth).toBe('400px'); // Change the parents width, to be shrink the scrollContainers width. parent.css('width', '200px'); // Update the scrollContainers rectangle, by triggering a reposition of the dropdown. angular.element($window).triggerHandler('resize'); $timeout.flush(); // The scroll container should have a width of 200px, since we changed the parents width. expect(scrollContainer.style.minWidth).toBe('200px'); document.body.removeChild(parent[0]); })); it('should adjust the width when manually repositioning', inject(function($timeout) { var scope = createScope(); var template = '<div style="width: 400px">' + '<md-autocomplete ' + 'md-search-text="searchText" ' + 'md-items="item in match(searchText)" ' + 'md-item-text="item.display" ' + 'md-min-length="0" ' + 'placeholder="placeholder">' + '<span md-highlight-text="searchText">{{item.display}}</span>' + '</md-autocomplete>' + '</div>'; var parent = compile(template, scope); var element = parent.find('md-autocomplete'); var ctrl = element.controller('mdAutocomplete'); // Add container to the DOM to be able to test the rect calculations. document.body.appendChild(parent[0]); $timeout.flush(); expect(ctrl.positionDropdown).toBeTruthy(); // Focus the Autocomplete to open the dropdown. ctrl.focus(); scope.$apply('searchText = "fo"'); waitForVirtualRepeat(element); // The scroll repeat container has been moved to the body element to avoid // z-index / overflow issues. var scrollContainer = document.body.querySelector('.md-virtual-repeat-container'); expect(scrollContainer).toBeTruthy(); // Expect the current width of the scrollContainer to be the same as of the parent element // at initialization. expect(scrollContainer.style.minWidth).toBe('400px'); // Change the parents width, to be shrink the scrollContainers width. parent.css('width', '200px'); // Update the scrollContainers rectangle, by triggering a reposition of the dropdown. ctrl.positionDropdown(); // The scroll container should have a width of 200px, since we changed the parents width. expect(scrollContainer.style.minWidth).toBe('200px'); document.body.removeChild(parent[0]); })); it('should show on focus when min-length is met', inject(function($timeout) { var scope = createScope(); // Overwrite the match function to always show some results. scope.match = function() { return scope.items; }; var template = '<div style="width: 400px">' + '<md-autocomplete ' + 'md-search-text="searchText" ' + 'md-items="item in match(searchText)" ' + 'md-item-text="item.display" ' + 'md-min-length="0" ' + 'placeholder="placeholder">' + '<span md-highlight-text="searchText">{{item.display}}</span>' + '</md-autocomplete>' + '</div>'; var parent = compile(template, scope); var element = parent.find('md-autocomplete'); var ctrl = element.controller('mdAutocomplete'); // Add container to the DOM to be able to test the rect calculations. document.body.appendChild(parent[0]); ctrl.focus(); waitForVirtualRepeat(element); // The scroll repeat container has been moved to the body element to avoid // z-index / overflow issues. var scrollContainer = document.body.querySelector('.md-virtual-repeat-container'); expect(scrollContainer).toBeTruthy(); // Expect the current width of the scrollContainer to be the same as of the parent element // at initialization. expect(scrollContainer.offsetParent).toBeTruthy(); document.body.removeChild(parent[0]); })); it('should not show on focus when min-length is not met', inject(function($timeout) { var scope = createScope(); // Overwrite the match function to always show some results. scope.match = function() { return scope.items; }; var template = '<div style="width: 400px">' + '<md-autocomplete ' + 'md-search-text="searchText" ' + 'md-items="item in match(searchText)" ' + 'md-item-text="item.display" ' + 'md-min-length="1" ' + 'placeholder="placeholder">' + '<span md-highlight-text="searchText">{{item.display}}</span>' + '</md-autocomplete>' + '</div>'; var parent = compile(template, scope); var element = parent.find('md-autocomplete'); var ctrl = element.controller('mdAutocomplete'); // Add container to the DOM to be able to test the rect calculations. document.body.appendChild(parent[0]); ctrl.focus(); waitForVirtualRepeat(element); // The scroll repeat container has been moved to the body element to avoid // z-index / overflow issues. var scrollContainer = document.body.querySelector('.md-virtual-repeat-container'); expect(scrollContainer).toBeTruthy(); // Expect the dropdown to not show up, because the min-length is not met. expect(scrollContainer.offsetParent).toBeFalsy(); ctrl.blur(); // Add one char to the searchText to match the minlength. scope.$apply('searchText = "X"'); ctrl.focus(); waitForVirtualRepeat(element); // Expect the dropdown to not show up, because the min-length is not met. expect(scrollContainer.offsetParent).toBeTruthy(); document.body.removeChild(parent[0]); })); it('should calculate the height from the default max items', inject(function($timeout) { var scope = createScope(); scope.match = fakeItemMatch; var template = '<div>' + '<md-autocomplete ' + 'md-search-text="searchText" ' + 'md-items="item in match(searchText)" ' + 'md-item-text="item" ' + 'md-min-length="0" ' + 'placeholder="placeholder">' + '<span md-highlight-text="searchText">{{item}}</span>' + '</md-autocomplete>' + '</div>'; var parent = compile(template, scope); var element = parent.find('md-autocomplete'); var ctrl = element.controller('mdAutocomplete'); // Add container to the DOM to be able to test the rect calculations. document.body.appendChild(parent[0]); $timeout.flush(); // Focus the autocomplete and trigger a query to be able to open the dropdown. ctrl.focus(); scope.$apply('searchText = "Query 1"'); waitForVirtualRepeat(element); var scrollContainer = document.body.querySelector('.md-virtual-repeat-container'); expect(scrollContainer).toBeTruthy(); expect(scrollContainer.style.maxHeight).toBe(DEFAULT_MAX_ITEMS * DEFAULT_ITEM_HEIGHT + 'px'); dropdownItems = 6; // Trigger a new query to request an update of the items and dropdown. scope.$apply('searchText = "Query 2"'); // The dropdown should not increase its height because of the new extra item. expect(scrollContainer.style.maxHeight).toBe(DEFAULT_MAX_ITEMS * DEFAULT_ITEM_HEIGHT + 'px'); document.body.removeChild(parent[0]); })); it('should calculate its height from the specified max items', inject(function($timeout) { var scope = createScope(); var maxDropdownItems = 2; // Set the current dropdown items to the new maximum. dropdownItems = maxDropdownItems; scope.match = fakeItemMatch; var template = '<div>' + '<md-autocomplete ' + 'md-search-text="searchText" ' + 'md-items="item in match(searchText)" ' + 'md-item-text="item" ' + 'md-min-length="0" ' + 'md-dropdown-items="' + maxDropdownItems +'"' + 'placeholder="placeholder">' + '<span md-highlight-text="searchText">{{item}}</span>' + '</md-autocomplete>' + '</div>'; var parent = compile(template, scope); var element = parent.find('md-autocomplete'); var ctrl = element.controller('mdAutocomplete'); // Add container to the DOM to be able to test the rect calculations. document.body.appendChild(parent[0]); $timeout.flush(); // Focus the autocomplete and trigger a query to be able to open the dropdown. ctrl.focus(); scope.$apply('searchText = "Query 1"'); waitForVirtualRepeat(element); var scrollContainer = document.body.querySelector('.md-virtual-repeat-container'); expect(scrollContainer).toBeTruthy(); expect(scrollContainer.style.maxHeight).toBe(maxDropdownItems * DEFAULT_ITEM_HEIGHT + 'px'); dropdownItems = 6; // Trigger a new query to request an update of the items and dropdown. scope.$apply('searchText = "Query 2"'); // The dropdown should not increase its height because of the new extra item. expect(scrollContainer.style.maxHeight).toBe(maxDropdownItems * DEFAULT_ITEM_HEIGHT + 'px'); document.body.removeChild(parent[0]); })); it('should allow dropdown position to be specified', inject(function($timeout, $window) { var scope = createScope(); scope.match = fakeItemMatch; scope.position = 'top'; var template = '<div>' + '<md-autocomplete ' + 'md-search-text="searchText" ' + 'md-items="item in match(searchText)" ' + 'md-item-text="item" ' + 'md-min-length="0" ' + 'md-dropdown-position="{{position}}" ' + 'placeholder="placeholder">' + '<span md-highlight-text="searchText">{{item}}</span>' + '</md-autocomplete>' + '</div>'; var parent = compile(template, scope); var element = parent.find('md-autocomplete'); var ctrl = element.controller('mdAutocomplete'); // Add container to the DOM to be able to test the rect calculations. document.body.appendChild(parent[0]); $timeout.flush(); // Focus the autocomplete and trigger a query to be able to open the dropdown. ctrl.focus(); scope.$apply('searchText = "Query 1"'); waitForVirtualRepeat(element); var scrollContainer = document.body.querySelector('.md-virtual-repeat-container'); expect(scrollContainer).toBeTruthy(); expect(scrollContainer.style.top).toBe('auto'); expect(scrollContainer.style.bottom).toMatch(/[0-9]+px/); // Change position and resize to force a DOM update. scope.$apply('position = "bottom"'); angular.element($window).triggerHandler('resize'); $timeout.flush(); expect(scrollContainer.style.top).toMatch(/[0-9]+px/); expect(scrollContainer.style.bottom).toBe('auto'); parent.remove(); })); it('should not position dropdown on resize when being hidden', inject(function($window, $timeout) { var scope = createScope(); var template = '<div style="width: 400px">' + '<md-autocomplete ' + 'md-search-text="searchText" ' + 'md-items="item in match(searchText)" ' + 'md-item-text="item.display" ' + 'md-min-length="0" ' + 'placeholder="placeholder">' + '<span md-highlight-text="searchText">{{item.display}}</span>' + '</md-autocomplete>' + '</div>'; var parent = compile(template, scope); var element = parent.find('md-autocomplete'); var ctrl = element.controller('mdAutocomplete'); // Add container to the DOM to be able to test the rect calculations. document.body.appendChild(parent[0]); $timeout.flush(); expect(ctrl.positionDropdown).toBeTruthy(); // The scroll repeat container has been moved to the body element to avoid // z-index / overflow issues. var scrollContainer = document.body.querySelector('.md-virtual-repeat-container'); expect(scrollContainer).toBeTruthy(); // Expect the scroll container to not have minWidth set, because it was never positioned. expect(scrollContainer.style.minWidth).toBe(''); // Change the parents width, to be shrink the scrollContainers width. parent.css('width', '200px'); // Trigger a window resize, which should adjust the width of the scroll container. angular.element($window).triggerHandler('resize'); $timeout.flush(); // The scroll container should still have no minWidth, because there was no positioning called yet. expect(scrollContainer.style.minWidth).toBe(''); document.body.removeChild(parent[0]); })); it('should grow and shrink depending on the amount of items', inject(function($timeout) { var scope = createScope(); dropdownItems = 2; scope.match = fakeItemMatch; var template = '<div>' + '<md-autocomplete ' + 'md-search-text="searchText" ' + 'md-items="item in match(searchText)" ' + 'md-item-text="item" ' + 'md-min-length="0" ' + 'placeholder="placeholder">' + '<span md-highlight-text="searchText">{{item}}</span>' + '</md-autocomplete>' + '</div>'; var parent = compile(template, scope); var element = parent.find('md-autocomplete'); var ctrl = element.controller('mdAutocomplete'); // Add container to the DOM to be able to test the rect calculations. document.body.appendChild(parent[0]); $timeout.flush(); // Focus the autocomplete and trigger a query to be able to open the dropdown. ctrl.focus(); scope.$apply('searchText = "A"'); waitForVirtualRepeat(element); var scrollContainer = document.body.querySelector('.md-virtual-repeat-container'); expect(scrollContainer).toBeTruthy(); expect(scrollContainer.style.height).toBe(dropdownItems * DEFAULT_ITEM_HEIGHT + 'px'); dropdownItems = DEFAULT_MAX_ITEMS; // Trigger a new query to request an update of the items and dropdown. scope.$apply('searchText = "B"'); expect(scrollContainer.style.height).toBe(dropdownItems * DEFAULT_ITEM_HEIGHT + 'px'); document.body.removeChild(parent[0]); })); }); describe('md-highlight-text', function() { it('updates when content is modified', inject(function() { var template = '<div md-highlight-text="query">{{message}}</div>'; var scope = createScope(null, {message: 'some text', query: 'some'}); var element = compile(template, scope); expect(element.html()).toBe('<span class="highlight">some</span> text'); scope.query = 'so'; scope.$apply(); expect(element.html()).toBe('<span class="highlight">so</span>me text'); scope.message = 'some more text'; scope.$apply(); expect(element.html()).toBe('<span class="highlight">so</span>me more text'); element.remove(); })); it('should properly apply highlight flags', function() { var template = '<div md-highlight-text="query" md-highlight-flags="{{flags}}">{{message}}</div>'; var scope = createScope(null, {message: 'Some text', query: 'some', flags: '^i'}); var element = compile(template, scope); expect(element.html()).toBe('<span class="highlight">Some</span> text'); scope.query = 'text'; scope.$apply(); expect(element.html()).toBe('Some text'); scope.message = 'Some text, some flags'; scope.query = 'some'; scope.flags = 'ig'; element = compile(template, scope); expect(element.html()).toBe('<span class="highlight">Some</span> text, <span class="highlight">some</span> flags'); scope.query = 'some'; scope.flags = '^i'; element = compile(template, scope); expect(element.html()).toBe('<span class="highlight">Some</span> text, some flags'); scope.query = 's'; scope.flags = '$i'; element = compile(template, scope); expect(element.html()).toBe('Some text, some flag<span class="highlight">s</span>'); element.remove(); }); it('should correctly parse special text identifiers', function() { var template = '<div md-highlight-text="query">{{message}}</div>'; var scope = createScope(null, { message: 'AngularJS&Material', query: 'AngularJS&' }); var element = compile(template, scope); expect(element.html()).toBe('<span class="highlight">AngularJS&amp;</span>Material'); scope.query = 'AngularJS&Material'; scope.$apply(); expect(element.html()).toBe('<span class="highlight">AngularJS&amp;Material</span>'); element.remove(); }); it('should properly parse html entity identifiers', function() { var template = '<div md-highlight-text="query">{{message}}</div>'; var scope = createScope(null, { message: 'AngularJS&amp;Material', query: '' }); var element = compile(template, scope); expect(element.html()).toBe('AngularJS&amp;amp;Material'); scope.query = 'AngularJS&amp;Material'; scope.$apply(); expect(element.html()).toBe('<span class="highlight">AngularJS&amp;amp;Material</span>'); scope.query = 'AngularJS&'; scope.$apply(); expect(element.html()).toBe('<span class="highlight">AngularJS&amp;</span>amp;Material'); element.remove(); }); it('should prevent XSS attacks from the highlight text', function() { spyOn(window, 'alert'); var template = '<div md-highlight-text="query">{{message}}</div>'; var scope = createScope(null, { message: 'AngularJS Material', query: '<img src="img" onerror="alert(1)">' }); var element = compile(template, scope); expect(element.html()).toBe('AngularJS Material'); expect(window.alert).not.toHaveBeenCalled(); element.remove(); }); }); it('should prevent XSS attacks from the content text', function() { spyOn(window, 'alert'); var template = '<div md-highlight-text="query">{{message}}</div>'; var scope = createScope(null, { message: '<img src="img" onerror="alert(1)">', query: '' }); var element = compile(template, scope); // Expect the image to be escaped due to XSS protection. expect(element.html()).toBe('&lt;img src="img" onerror="alert(1)"&gt;'); expect(window.alert).not.toHaveBeenCalled(); element.remove(); }); describe('md-autocomplete-snap', function() { it('should match the width of the snap element if width is set', inject(function($timeout, $material) { var template = '\ <div style="width: 1000px" md-autocomplete-snap="width">\ <md-autocomplete\ md-selected-item="selectedItem"\ md-search-text="searchText"\ md-items="item in match(searchText)"\ md-item-text="item.display"\ placeholder="placeholder"\ style="width:200px">\ <span md-highlight-text="searchText">{{item.display}}</span>\ </md-autocomplete>\ </div>'; var scope = createScope(); var element = compile(template, scope); var autoEl = element.find('md-autocomplete'); var ctrl = autoEl.controller('mdAutocomplete'); var ul = element.find('ul'); angular.element(document.body).append(element); $material.flushInterimElement(); ctrl.focus(); autoEl.scope().searchText = 'fo'; waitForVirtualRepeat(autoEl); expect(ul[0].offsetWidth).toBe(1000); element.remove(); })); it('should match the width of the wrap element if width is not set', inject(function($timeout, $material) { var template = '\ <div style="width: 1000px" md-autocomplete-snap>\ <md-autocomplete\ md-selected-item="selectedItem"\ md-search-text="searchText"\ md-items="item in match(searchText)"\ md-item-text="item.display"\ placeholder="placeholder"\ style="width:200px">\ <span md-highlight-text="searchText">{{item.display}}</span>\ </md-autocomplete>\ </div>'; var scope = createScope(); var element = compile(template, scope); var autoEl = element.find('md-autocomplete'); var ctrl = autoEl.controller('mdAutocomplete'); var ul = element.find('ul'); angular.element(document.body).append(element); $material.flushInterimElement(); ctrl.focus(); autoEl.scope().searchText = 'fo'; waitForVirtualRepeat(autoEl); expect(ul[0].offsetWidth).toBe(200); element.remove(); })); }); });
const createScene = () => { const scene = new BABYLON.Scene(engine); const camera = new BABYLON.ArcRotateCamera( "Camera", -Math.PI / 2, Math.PI / 2, 5, BABYLON.Vector3.Zero(), scene ); camera.attachControl (canvas, true); camera.inputs.attached.mousewheel.detachControl(canvas); const images = { url: [ "https://dl.dropbox.com/s/710flojvo8ozhsg/0001.jpg", "https://dl.dropbox.com/s/q755i5xedpxaegz/0002.jpg", "https://dl.dropbox.com/s/v87xklv1dgirh6d/0003.jpg", "https://dl.dropbox.com/s/7an3g133p9rhla8/0004.jpg", "https://dl.dropbox.com/s/mf7hndsn7ui6va5/0005.jpg", ], }; // Create the spheres const domes = []; for (let i = 0; i < images.url.length; i++) { domes[i] = new BABYLON.PhotoDome( `dome${i}`, images.url[i], { resolution: 32, size: 1000, }, scene ); domes[i].position.x = i * -1000; } // Uncomment this line to see the spheres' position // camera.position = new BABYLON.Vector3(0,5000,0); // Hotspots const planes = []; const buttons = []; const advTexs = []; for (let i = 0; i < images.url.length; i++) { planes[i] = BABYLON.Mesh.CreatePlane("plane", 100); planes[i].parent = domes[i]; planes[i].position.y = 1; planes[i].position.x = -450; planes[i].rotation.y = -Math.PI / 2; advTexs[i] = BABYLON.GUI.AdvancedDynamicTexture.CreateForMesh(planes[i]); buttons[i] = BABYLON.GUI.Button.CreateSimpleButton( `button${i}`, "Click to move" ); buttons[i].width = 30; buttons[i].height = 4; buttons[i].color = "white"; buttons[i].fontSize = 100; buttons[i].background = "black"; buttons[i].onPointerUpObservable.add(() => { camera.position = domes[i + 1].position; camera.target = domes[i + 1].position; }); advTexs[i].addControl(buttons[i]); } return scene; };
'use strict'; const testUtils = require('./utils'); const dc = require("double-check"); const assert = dc.assert; let resolver; let keySSISpace; testUtils.resolverFactory({testFolder: 'load_dsu_test_folder', testName: 'Load DSU Test'}, (err, result) => { assert.true(err === null || typeof err === 'undefined', 'Failed to initialize test'); resolver = result.resolver; keySSISpace = result.keySSISpace; createDSU((err, keySSI) => { assert.true(typeof err === 'undefined', 'DSU is writable'); runTest(keySSI, result.doneCallback); }); }); function createDSU(callback) { resolver.createDSU(keySSISpace.buildTemplateSeedSSI("default"), (err, dsu) => { assert.true(typeof err === 'undefined', 'No error while creating the DSU'); assert.true(dsu.constructor.name === 'Archive', 'DSU has the correct class'); dsu.createFolder('/created-folder', (err) => { dsu.writeFile('my-file.txt', 'Lorem Ipsum', (err, hash) => { dsu.writeFile('/created-folder/my-second-file.txt', 'Iorem Lpsum', (err, hash) => { dsu.getKeySSIAsString((err, keySSI) => { callback(err, keySSI); }) }) }) }) }); } function runTest(keySSI, callback) { resolver.loadDSU(keySSI, (err, dsu) => { assert.true(typeof err === 'undefined', 'No error while loading the DSU'); dsu.readFile('my-file.txt', (err, data) => { assert.true(typeof err === 'undefined', 'No error while reading file from DSU'); assert.true(data.toString() === 'Lorem Ipsum', 'File has the correct content'); dsu.readFile('/created-folder/my-second-file.txt', (err, data) => { assert.true(typeof err === 'undefined', 'No error while reading second file from DSU'); assert.true(data.toString() === 'Iorem Lpsum', 'Second file has the correct content'); callback(); }) }); }); }
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[179],{ /***/ "./frontend/src/views/settings/create_vehicle_categories.vue": /*!*******************************************************************!*\ !*** ./frontend/src/views/settings/create_vehicle_categories.vue ***! \*******************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _create_vehicle_categories_vue_vue_type_template_id_09b32611___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./create_vehicle_categories.vue?vue&type=template&id=09b32611& */ "./frontend/src/views/settings/create_vehicle_categories.vue?vue&type=template&id=09b32611&"); /* harmony import */ var _create_vehicle_categories_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./create_vehicle_categories.vue?vue&type=script&lang=js& */ "./frontend/src/views/settings/create_vehicle_categories.vue?vue&type=script&lang=js&"); /* empty/unused harmony star reexport *//* harmony import */ var _create_vehicle_categories_vue_vue_type_style_index_0_lang_scss___WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./create_vehicle_categories.vue?vue&type=style&index=0&lang=scss& */ "./frontend/src/views/settings/create_vehicle_categories.vue?vue&type=style&index=0&lang=scss&"); /* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); /* normalize component */ var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__["default"])( _create_vehicle_categories_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], _create_vehicle_categories_vue_vue_type_template_id_09b32611___WEBPACK_IMPORTED_MODULE_0__["render"], _create_vehicle_categories_vue_vue_type_template_id_09b32611___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], false, null, null, null ) /* hot reload */ if (false) { var api; } component.options.__file = "frontend/src/views/settings/create_vehicle_categories.vue" /* harmony default export */ __webpack_exports__["default"] = (component.exports); /***/ }), /***/ "./frontend/src/views/settings/create_vehicle_categories.vue?vue&type=script&lang=js&": /*!********************************************************************************************!*\ !*** ./frontend/src/views/settings/create_vehicle_categories.vue?vue&type=script&lang=js& ***! \********************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_create_vehicle_categories_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib??ref--4-0!../../../../node_modules/vue-loader/lib??vue-loader-options!./create_vehicle_categories.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./frontend/src/views/settings/create_vehicle_categories.vue?vue&type=script&lang=js&"); /* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_create_vehicle_categories_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); /***/ }), /***/ "./frontend/src/views/settings/create_vehicle_categories.vue?vue&type=style&index=0&lang=scss&": /*!*****************************************************************************************************!*\ !*** ./frontend/src/views/settings/create_vehicle_categories.vue?vue&type=style&index=0&lang=scss& ***! \*****************************************************************************************************/ /*! no static exports found */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _node_modules_style_loader_index_js_node_modules_css_loader_index_js_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_sass_loader_dist_cjs_js_ref_7_3_node_modules_sass_loader_dist_cjs_js_ref_11_0_node_modules_vue_loader_lib_index_js_vue_loader_options_create_vehicle_categories_vue_vue_type_style_index_0_lang_scss___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/style-loader!../../../../node_modules/css-loader!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src??ref--7-2!../../../../node_modules/sass-loader/dist/cjs.js??ref--7-3!../../../../node_modules/sass-loader/dist/cjs.js??ref--11-0!../../../../node_modules/vue-loader/lib??vue-loader-options!./create_vehicle_categories.vue?vue&type=style&index=0&lang=scss& */ "./node_modules/style-loader/index.js!./node_modules/css-loader/index.js!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/sass-loader/dist/cjs.js?!./node_modules/sass-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./frontend/src/views/settings/create_vehicle_categories.vue?vue&type=style&index=0&lang=scss&"); /* harmony import */ var _node_modules_style_loader_index_js_node_modules_css_loader_index_js_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_sass_loader_dist_cjs_js_ref_7_3_node_modules_sass_loader_dist_cjs_js_ref_11_0_node_modules_vue_loader_lib_index_js_vue_loader_options_create_vehicle_categories_vue_vue_type_style_index_0_lang_scss___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_index_js_node_modules_css_loader_index_js_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_sass_loader_dist_cjs_js_ref_7_3_node_modules_sass_loader_dist_cjs_js_ref_11_0_node_modules_vue_loader_lib_index_js_vue_loader_options_create_vehicle_categories_vue_vue_type_style_index_0_lang_scss___WEBPACK_IMPORTED_MODULE_0__); /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_style_loader_index_js_node_modules_css_loader_index_js_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_sass_loader_dist_cjs_js_ref_7_3_node_modules_sass_loader_dist_cjs_js_ref_11_0_node_modules_vue_loader_lib_index_js_vue_loader_options_create_vehicle_categories_vue_vue_type_style_index_0_lang_scss___WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_style_loader_index_js_node_modules_css_loader_index_js_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_2_node_modules_sass_loader_dist_cjs_js_ref_7_3_node_modules_sass_loader_dist_cjs_js_ref_11_0_node_modules_vue_loader_lib_index_js_vue_loader_options_create_vehicle_categories_vue_vue_type_style_index_0_lang_scss___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__)); /***/ }), /***/ "./frontend/src/views/settings/create_vehicle_categories.vue?vue&type=template&id=09b32611&": /*!**************************************************************************************************!*\ !*** ./frontend/src/views/settings/create_vehicle_categories.vue?vue&type=template&id=09b32611& ***! \**************************************************************************************************/ /*! exports provided: render, staticRenderFns */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_create_vehicle_categories_vue_vue_type_template_id_09b32611___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../node_modules/vue-loader/lib??vue-loader-options!./create_vehicle_categories.vue?vue&type=template&id=09b32611& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./frontend/src/views/settings/create_vehicle_categories.vue?vue&type=template&id=09b32611&"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_create_vehicle_categories_vue_vue_type_template_id_09b32611___WEBPACK_IMPORTED_MODULE_0__["render"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_create_vehicle_categories_vue_vue_type_template_id_09b32611___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); /***/ }), /***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./frontend/src/views/settings/create_vehicle_categories.vue?vue&type=script&lang=js&": /*!****************************************************************************************************************************************************************************************!*\ !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./frontend/src/views/settings/create_vehicle_categories.vue?vue&type=script&lang=js& ***! \****************************************************************************************************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var bootstrap_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! bootstrap-vue */ "./frontend/node_modules/bootstrap-vue/esm/index.js"); /* harmony import */ var vue_select__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vue-select */ "./frontend/node_modules/vue-select/dist/vue-select.js"); /* harmony import */ var vue_select__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(vue_select__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/store */ "./frontend/src/store/index.js"); /* harmony import */ var _AddNew_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./AddNew.vue */ "./frontend/src/views/settings/AddNew.vue"); /* harmony import */ var vee_validate__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vee-validate */ "./frontend/node_modules/vee-validate/dist/vee-validate.esm.js"); /* harmony import */ var _vue_composition_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @vue/composition-api */ "./frontend/node_modules/@vue/composition-api/dist/vue-composition-api.esm.js"); /* harmony import */ var _validations__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @validations */ "./frontend/src/@core/utils/validations/validations.js"); /* harmony import */ var _core_comp_functions_forms_form_validation__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @core/comp-functions/forms/form-validation */ "./frontend/src/@core/comp-functions/forms/form-validation.js"); /* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! axios */ "./frontend/node_modules/axios/index.js"); /* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_8__); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["default"] = ({ components: { BSidebar: bootstrap_vue__WEBPACK_IMPORTED_MODULE_0__["BSidebar"], AddNew: _AddNew_vue__WEBPACK_IMPORTED_MODULE_3__["default"], BCard: bootstrap_vue__WEBPACK_IMPORTED_MODULE_0__["BCard"], BRow: bootstrap_vue__WEBPACK_IMPORTED_MODULE_0__["BRow"], BCol: bootstrap_vue__WEBPACK_IMPORTED_MODULE_0__["BCol"], BFormInput: bootstrap_vue__WEBPACK_IMPORTED_MODULE_0__["BFormInput"], BButton: bootstrap_vue__WEBPACK_IMPORTED_MODULE_0__["BButton"], BTable: bootstrap_vue__WEBPACK_IMPORTED_MODULE_0__["BTable"], BMedia: bootstrap_vue__WEBPACK_IMPORTED_MODULE_0__["BMedia"], BAvatar: bootstrap_vue__WEBPACK_IMPORTED_MODULE_0__["BAvatar"], BLink: bootstrap_vue__WEBPACK_IMPORTED_MODULE_0__["BLink"], BBadge: bootstrap_vue__WEBPACK_IMPORTED_MODULE_0__["BBadge"], BDropdown: bootstrap_vue__WEBPACK_IMPORTED_MODULE_0__["BDropdown"], BDropdownItem: bootstrap_vue__WEBPACK_IMPORTED_MODULE_0__["BDropdownItem"], BPagination: bootstrap_vue__WEBPACK_IMPORTED_MODULE_0__["BPagination"], // Form Validation ValidationProvider: vee_validate__WEBPACK_IMPORTED_MODULE_4__["ValidationProvider"], ValidationObserver: vee_validate__WEBPACK_IMPORTED_MODULE_4__["ValidationObserver"], vSelect: vue_select__WEBPACK_IMPORTED_MODULE_1___default.a }, data: function data() { return { vehicleCategories: { title: "", basis: "", part: "", unit: "", operator: "", value: "", condition: "", rowData: [] //the declared array }, laravelData: {}, inventoryduration: {}, inventorydates: {}, selected: null, basis: [{ value: null, text: "Select" }, { value: "Cubic", title: "Cubic" }, { value: "Dimensions", title: "Dimensions" }, { value: "Weight", title: "Weight" }], part: [{ value: "Length", title: "Length" }, { value: "Width", title: "Width" }, { value: "Height", title: "Height" }], unit: [{ value: "Pounds", title: "Pounds" }, { value: "Kilograms", title: "Kilograms" }, { value: "Inches", title: "Inches" }, { value: "Centimeters", title: "Centimeters" }, { value: "Meters", title: "Meters" }, { value: "Feet", title: "Feet" }], operator: [{ value: "=", title: "Equals" }, { value: ">=", title: "Greater-Than or Equals" }, { value: ">", title: "Greater-Than" }, { value: "<=", title: "Less-Than or Equals" }, { value: "<", title: "Less-Than" }], condition: [{ value: "AND", title: "AND" }, { value: "OR", title: "OR" }] }; }, methods: { postData: function postData(e) { console.log(this.terminal); var currentObj = this; e.preventDefault(); axios__WEBPACK_IMPORTED_MODULE_8___default.a.post("http://koboautos.com/twic-terminal/connect/api/create-vehicle-categories", { title: this.vehicleCategories.title, basis: this.vehicleCategories.basis.value, part: this.vehicleCategories.part.value, unit: this.vehicleCategories.unit.value, operator: this.vehicleCategories.operator.value, value: this.vehicleCategories.value, condition: this.vehicleCategories.condition.value }, { headers: { "Content-Type": "application/json", Authorization: "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjY4YmJiOGJkZmJiNmQ5YTgzNmVmMDkwZGRkZDY5MDFmOWEzZDFiNTE3MWUzODA5ODE0ZmJlMWE1MWY3ZjExZjBiMWIwNzExNjQ2NWRkYWZmIn0.eyJhdWQiOiIxOTM4NDcxMiIsImp0aSI6IjY4YmJiOGJkZmJiNmQ5YTgzNmVmMDkwZGRkZDY5MDFmOWEzZDFiNTE3MWUzODA5ODE0ZmJlMWE1MWY3ZjExZjBiMWIwNzExNjQ2NWRkYWZmIiwiaWF0IjoxNjA2MzA3ODc5LCJuYmYiOjE2MDYzMDc4NzksImV4cCI6MTYzNzg0Mzg3OSwic3ViIjoiIiwic2NvcGVzIjpbXX0.OSYl-wXlW42CIeFq-agf10WPbHo57EBRD1NDFTodnALlqVBWmEW2yMy3CA2YYYiKz27Ot6XP61ROcl153W7CpmL6wjVX2qUEbethwaGDvUReb2UEPY6hBBRVrhB6LoA46m3sHA5FNq9E02TzWAwvj7NQVpPgRF6dvaH6go1z-Opfp-L6q0czpTuUXGtgDbJmnU8yG1NCc8gJYqtZxjiqBDjHq8GiLpr5254hgoVJTdY_9kLjmy_VDE_GlBxdZJVyPB3hCCEuSCjnFaJiDwO3pAEFLqY2KecimVtc78TChFzJycwMo0bUQRsgpmSjzxSYE2z-J_dJJEtx4u8pR2Zg3PhDxmYRvMip0b688mGbay_BobAcyrXumQmJsFfqekDewLuBfYtmB0TCZmmf5H6G0tyaXGcmfKMMFY8Qdv2qLy-y-1Vu06npoK94pElsOexkESxiiu8__bpkNrWMt8VLHYMmygJ_Y8o0JrmB4eyfnceaO-lvtFnFMZtVQP_XgWApzWTzYAy27cU56oR9vz1UfmM0HfGCbXPQDTmkmmL1RNO-MyKEMoIJSJLWdjXB9f6yyDpEurgG0lt0xDgrvr43RCappToLGYtFHiAYMTT-xqy2ucZPnUXKf8X4WDYH_8yuMS9_JZKc2mLViaoZje4nhTQe3RquhloJB6VQon4WNNo" } }).then(function (response) { console.log(response); if (response.status == 200) { currentObj.$router.push({ path: "/vehicle-categories" }); } }); }, addItem: function addItem() { var my_object = { title: this.title, basis: this.basis, part: this.part, unit: this.unit, operator: this.operator, value: this.value, condition: this.condition }; this.rowData.push(my_object); this.title = ""; this.basis = ""; this.part = ""; this.unit = ""; this.operator = ""; this.value = ""; this.condition = ""; } } }); /***/ }), /***/ "./node_modules/css-loader/index.js!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/sass-loader/dist/cjs.js?!./node_modules/sass-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./frontend/src/views/settings/create_vehicle_categories.vue?vue&type=style&index=0&lang=scss&": /*!*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/css-loader!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--7-2!./node_modules/sass-loader/dist/cjs.js??ref--7-3!./node_modules/sass-loader/dist/cjs.js??ref--11-0!./node_modules/vue-loader/lib??vue-loader-options!./frontend/src/views/settings/create_vehicle_categories.vue?vue&type=style&index=0&lang=scss& ***! \*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { exports = module.exports = __webpack_require__(/*! ../../../../node_modules/css-loader/lib/css-base.js */ "./node_modules/css-loader/lib/css-base.js")(false); // imports // module exports.push([module.i, ".v-select {\n position: relative;\n font-family: inherit;\n}\n.v-select,\n.v-select * {\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n}\n\n/* KeyFrames */\n@-webkit-keyframes vSelectSpinner-ltr {\n0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n}\n100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n}\n}\n@-webkit-keyframes vSelectSpinner-rtl {\n0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n}\n100% {\n -webkit-transform: rotate(-360deg);\n transform: rotate(-360deg);\n}\n}\n@keyframes vSelectSpinner-ltr {\n0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n}\n100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n}\n}\n@keyframes vSelectSpinner-rtl {\n0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n}\n100% {\n -webkit-transform: rotate(-360deg);\n transform: rotate(-360deg);\n}\n}\n/* Dropdown Default Transition */\n.vs__fade-enter-active,\n.vs__fade-leave-active {\n pointer-events: none;\n -webkit-transition: opacity 0.15s cubic-bezier(1, 0.5, 0.8, 1);\n transition: opacity 0.15s cubic-bezier(1, 0.5, 0.8, 1);\n}\n[dir] .vs__fade-enter-active, [dir] .vs__fade-leave-active {\n -webkit-transition: opacity 0.15s cubic-bezier(1, 0.5, 0.8, 1);\n}\n.vs__fade-enter,\n.vs__fade-leave-to {\n opacity: 0;\n}\n\n/** Component States */\n/*\n * Disabled\n *\n * When the component is disabled, all interaction\n * should be prevented. Here we modify the bg color,\n * and change the cursor displayed on the interactive\n * components.\n */\n[dir] .vs--disabled .vs__dropdown-toggle, [dir] .vs--disabled .vs__clear, [dir] .vs--disabled .vs__search, [dir] .vs--disabled .vs__selected, [dir] .vs--disabled .vs__open-indicator {\n cursor: not-allowed;\n background-color: #f8f8f8;\n}\n\n/*\n * RTL - Right to Left Support\n *\n * Because we're using a flexbox layout, the `dir=\"rtl\"`\n * HTML attribute does most of the work for us by\n * rearranging the child elements visually.\n */\n.v-select[dir=rtl] .vs__actions {\n padding: 0 3px 0 6px;\n}\n.v-select[dir=rtl] .vs__clear {\n margin-left: 6px;\n margin-right: 0;\n}\n.v-select[dir=rtl] .vs__deselect {\n margin-left: 0;\n margin-right: 2px;\n}\n.v-select[dir=rtl] .vs__dropdown-menu {\n text-align: right;\n}\n\n/**\n Dropdown Toggle\n\n The dropdown toggle is the primary wrapper of the component. It\n has two direct descendants: .vs__selected-options, and .vs__actions.\n\n .vs__selected-options holds the .vs__selected's as well as the\n main search input.\n\n .vs__actions holds the clear button and dropdown toggle.\n */\n.vs__dropdown-toggle {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n white-space: normal;\n}\n[dir] .vs__dropdown-toggle {\n padding: 0 0 4px 0;\n background: none;\n border: 1px solid #d8d6de;\n border-radius: 0.357rem;\n}\n.vs__selected-options {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -ms-flex-preferred-size: 100%;\n flex-basis: 100%;\n -webkit-box-flex: 1;\n -ms-flex-positive: 1;\n flex-grow: 1;\n -ms-flex-wrap: wrap;\n flex-wrap: wrap;\n position: relative;\n}\n[dir] .vs__selected-options {\n padding: 0 2px;\n}\n.vs__actions {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n[dir=ltr] .vs__actions {\n padding: 4px 6px 0 3px;\n}\n[dir=rtl] .vs__actions {\n padding: 4px 3px 0 6px;\n}\n\n/* Dropdown Toggle States */\n[dir] .vs--searchable .vs__dropdown-toggle {\n cursor: text;\n}\n[dir] .vs--unsearchable .vs__dropdown-toggle {\n cursor: pointer;\n}\n[dir] .vs--open .vs__dropdown-toggle {\n border-bottom-color: transparent;\n}\n[dir=ltr] .vs--open .vs__dropdown-toggle {\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n}\n[dir=rtl] .vs--open .vs__dropdown-toggle {\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n}\n.vs__open-indicator {\n fill: rgba(60, 60, 60, 0.5);\n -webkit-transform: scale(1);\n transition: -webkit-transform 150ms cubic-bezier(1, -0.115, 0.975, 0.855);\n -webkit-transition: -webkit-transform 150ms cubic-bezier(1, -0.115, 0.975, 0.855);\n transition: transform 150ms cubic-bezier(1, -0.115, 0.975, 0.855);\n transition: transform 150ms cubic-bezier(1, -0.115, 0.975, 0.855), -webkit-transform 150ms cubic-bezier(1, -0.115, 0.975, 0.855);\n -webkit-transition-timing-function: cubic-bezier(1, -0.115, 0.975, 0.855);\n}\n[dir] .vs__open-indicator {\n -webkit-transform: scale(1);\n transform: scale(1);\n -webkit-transition: -webkit-transform 150ms cubic-bezier(1, -0.115, 0.975, 0.855);\n -webkit-transition-timing-function: cubic-bezier(1, -0.115, 0.975, 0.855);\n transition-timing-function: cubic-bezier(1, -0.115, 0.975, 0.855);\n}\n[dir=ltr] .vs--open .vs__open-indicator {\n -webkit-transform: rotate(180deg) scale(1);\n transform: rotate(180deg) scale(1);\n}\n[dir=rtl] .vs--open .vs__open-indicator {\n -webkit-transform: rotate(-180deg) scale(1);\n transform: rotate(-180deg) scale(1);\n}\n.vs--loading .vs__open-indicator {\n opacity: 0;\n}\n\n/* Clear Button */\n.vs__clear {\n fill: rgba(60, 60, 60, 0.5);\n}\n[dir] .vs__clear {\n padding: 0;\n border: 0;\n background-color: transparent;\n cursor: pointer;\n}\n[dir=ltr] .vs__clear {\n margin-right: 8px;\n}\n[dir=rtl] .vs__clear {\n margin-left: 8px;\n}\n\n/* Dropdown Menu */\n.vs__dropdown-menu {\n display: block;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n position: absolute;\n top: calc(100% - 1px);\n z-index: 1000;\n width: 100%;\n max-height: 350px;\n min-width: 160px;\n overflow-y: auto;\n -webkit-box-shadow: 0px 4px 25px 0px rgba(0, 0, 0, 0.1);\n list-style: none;\n}\n[dir] .vs__dropdown-menu {\n padding: 5px 0;\n margin: 0;\n -webkit-box-shadow: 0px 4px 25px 0px rgba(0, 0, 0, 0.1);\n box-shadow: 0px 4px 25px 0px rgba(0, 0, 0, 0.1);\n border: 1px solid #d8d6de;\n border-top-style: none;\n border-radius: 0 0 0.357rem 0.357rem;\n background: #fff;\n}\n[dir=ltr] .vs__dropdown-menu {\n left: 0;\n text-align: left;\n}\n[dir=rtl] .vs__dropdown-menu {\n right: 0;\n text-align: right;\n}\n[dir] .vs__no-options {\n text-align: center;\n}\n\n/* List Items */\n.vs__dropdown-option {\n line-height: 1.42857143;\n /* Normalize line height */\n display: block;\n color: #333;\n /* Overrides most CSS frameworks */\n white-space: nowrap;\n}\n[dir] .vs__dropdown-option {\n padding: 3px 20px;\n clear: both;\n}\n[dir] .vs__dropdown-option:hover {\n cursor: pointer;\n}\n.vs__dropdown-option--highlight {\n color: #7367f0 !important;\n}\n[dir] .vs__dropdown-option--highlight {\n background: rgba(115, 103, 240, 0.12);\n}\n.vs__dropdown-option--disabled {\n color: rgba(60, 60, 60, 0.5);\n}\n[dir] .vs__dropdown-option--disabled {\n background: inherit;\n}\n[dir] .vs__dropdown-option--disabled:hover {\n cursor: inherit;\n}\n\n/* Selected Tags */\n.vs__selected {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n color: #333;\n line-height: 1.8;\n z-index: 0;\n}\n[dir] .vs__selected {\n background-color: #7367f0;\n border: 0 solid rgba(60, 60, 60, 0.26);\n border-radius: 0.357rem;\n margin: 4px 2px 0px 2px;\n padding: 0 0.25em;\n}\n.vs__deselect {\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n fill: rgba(60, 60, 60, 0.5);\n}\n[dir] .vs__deselect {\n padding: 0;\n border: 0;\n cursor: pointer;\n background: none;\n text-shadow: 0 1px 0 #fff;\n}\n[dir=ltr] .vs__deselect {\n margin-left: 4px;\n}\n[dir=rtl] .vs__deselect {\n margin-right: 4px;\n}\n\n/* States */\n[dir] .vs--single .vs__selected {\n background-color: transparent;\n border-color: transparent;\n}\n.vs--single.vs--open .vs__selected {\n position: absolute;\n opacity: 0.4;\n}\n.vs--single.vs--searching .vs__selected {\n display: none;\n}\n\n/* Search Input */\n/**\n * Super weird bug... If this declaration is grouped\n * below, the cancel button will still appear in chrome.\n * If it's up here on it's own, it'll hide it.\n */\n.vs__search::-webkit-search-cancel-button {\n display: none;\n}\n.vs__search::-webkit-search-decoration,\n.vs__search::-webkit-search-results-button,\n.vs__search::-webkit-search-results-decoration,\n.vs__search::-ms-clear {\n display: none;\n}\n.vs__search,\n.vs__search:focus {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n line-height: 1.8;\n font-size: 1em;\n outline: none;\n -webkit-box-shadow: none;\n width: 0;\n max-width: 100%;\n -webkit-box-flex: 1;\n -ms-flex-positive: 1;\n flex-grow: 1;\n z-index: 1;\n}\n[dir] .vs__search, [dir] .vs__search:focus {\n border: 1px solid transparent;\n margin: 4px 0 0 0;\n padding: 0 7px;\n background: none;\n -webkit-box-shadow: none;\n box-shadow: none;\n}\n[dir=ltr] .vs__search, [dir=ltr] .vs__search:focus {\n border-left: none;\n}\n[dir=rtl] .vs__search, [dir=rtl] .vs__search:focus {\n border-right: none;\n}\n.vs__search::-webkit-input-placeholder {\n color: #6e6b7b;\n}\n.vs__search::-moz-placeholder {\n color: #6e6b7b;\n}\n.vs__search:-ms-input-placeholder {\n color: #6e6b7b;\n}\n.vs__search::-ms-input-placeholder {\n color: #6e6b7b;\n}\n.vs__search::placeholder {\n color: #6e6b7b;\n}\n\n/**\n States\n */\n.vs--unsearchable .vs__search {\n opacity: 1;\n}\n[dir] .vs--unsearchable:not(.vs--disabled) .vs__search:hover {\n cursor: pointer;\n}\n.vs--single.vs--searching:not(.vs--open):not(.vs--loading) .vs__search {\n opacity: 0.2;\n}\n\n/* Loading Spinner */\n.vs__spinner {\n -ms-flex-item-align: center;\n align-self: center;\n opacity: 0;\n font-size: 5px;\n text-indent: -9999em;\n overflow: hidden;\n -webkit-transform: translateZ(0);\n -webkit-transition: opacity 0.1s;\n transition: opacity 0.1s;\n}\n[dir] .vs__spinner {\n border-top: 0.9em solid rgba(100, 100, 100, 0.1);\n border-bottom: 0.9em solid rgba(100, 100, 100, 0.1);\n -webkit-transform: translateZ(0);\n transform: translateZ(0);\n -webkit-transition: opacity 0.1s;\n}\n[dir=ltr] .vs__spinner {\n border-right: 0.9em solid rgba(100, 100, 100, 0.1);\n border-left: 0.9em solid rgba(60, 60, 60, 0.45);\n -webkit-animation: vSelectSpinner-ltr 1.1s infinite linear;\n animation: vSelectSpinner-ltr 1.1s infinite linear;\n}\n[dir=rtl] .vs__spinner {\n border-left: 0.9em solid rgba(100, 100, 100, 0.1);\n border-right: 0.9em solid rgba(60, 60, 60, 0.45);\n -webkit-animation: vSelectSpinner-rtl 1.1s infinite linear;\n animation: vSelectSpinner-rtl 1.1s infinite linear;\n}\n.vs__spinner,\n.vs__spinner:after {\n width: 5em;\n height: 5em;\n}\n[dir] .vs__spinner, [dir] .vs__spinner:after {\n border-radius: 50%;\n}\n\n/* Loading Spinner States */\n.vs--loading .vs__spinner {\n opacity: 1;\n}\n.vs__open-indicator {\n fill: none;\n}\n[dir] .vs__open-indicator {\n margin-top: 0.15rem;\n}\n.vs__dropdown-toggle {\n -webkit-transition: all 0.25s ease-in-out;\n transition: all 0.25s ease-in-out;\n}\n[dir] .vs__dropdown-toggle {\n padding: 0.59px 0 4px 0;\n -webkit-transition: all 0.25s ease-in-out;\n}\n[dir=ltr] .vs--single .vs__dropdown-toggle {\n padding-left: 6px;\n}\n[dir=rtl] .vs--single .vs__dropdown-toggle {\n padding-right: 6px;\n}\n.vs__dropdown-option--disabled {\n opacity: 0.5;\n}\n[dir] .vs__dropdown-option--disabled.vs__dropdown-option--selected {\n background: #7367f0 !important;\n}\n.vs__dropdown-option {\n color: #6e6b7b;\n}\n[dir] .vs__dropdown-option, [dir] .vs__no-options {\n padding: 7px 20px;\n}\n.vs__dropdown-option--selected {\n background-color: #7367f0;\n color: #fff;\n position: relative;\n}\n.vs__dropdown-option--selected::after {\n content: \"\";\n height: 1.1rem;\n width: 1.1rem;\n display: inline-block;\n position: absolute;\n top: 50%;\n -webkit-transform: translateY(-50%);\n transform: translateY(-50%);\n right: 20px;\n background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-check'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E\");\n background-repeat: no-repeat;\n background-position: center;\n background-size: 1.1rem;\n}\n[dir=rtl] .vs__dropdown-option--selected::after {\n left: 20px;\n right: unset;\n}\n.vs__dropdown-option--selected.vs__dropdown-option--highlight {\n color: #fff !important;\n background-color: #7367f0 !important;\n}\n.vs__clear svg {\n color: #6e6b7b;\n}\n.vs__selected {\n color: #fff;\n}\n.v-select.vs--single .vs__selected {\n color: #6e6b7b;\n transition: -webkit-transform 0.2s ease;\n -webkit-transition: -webkit-transform 0.2s ease;\n transition: transform 0.2s ease;\n transition: transform 0.2s ease, -webkit-transform 0.2s ease;\n}\n[dir] .v-select.vs--single .vs__selected {\n margin-top: 5px;\n -webkit-transition: -webkit-transform 0.2s ease;\n}\n[dir=ltr] .v-select.vs--single .vs__selected input {\n padding-left: 0;\n}\n[dir=rtl] .v-select.vs--single .vs__selected input {\n padding-right: 0;\n}\n[dir=ltr] .vs--single.vs--open .vs__selected {\n -webkit-transform: translateX(5px);\n transform: translateX(5px);\n}\n[dir=rtl] .vs--single.vs--open .vs__selected {\n -webkit-transform: translateX(-5px);\n transform: translateX(-5px);\n}\n.vs__selected .vs__deselect {\n color: inherit;\n}\n.v-select:not(.vs--single) .vs__selected {\n font-size: 0.9rem;\n}\n[dir] .v-select:not(.vs--single) .vs__selected {\n border-radius: 3px;\n padding: 0 0.6em;\n}\n[dir=ltr] .v-select:not(.vs--single) .vs__selected {\n margin: 5px 2px 2px 5px;\n}\n[dir=rtl] .v-select:not(.vs--single) .vs__selected {\n margin: 5px 5px 2px 2px;\n}\n.v-select:not(.vs--single) .vs__deselect svg {\n -webkit-transform: scale(0.8);\n vertical-align: text-top;\n}\n[dir] .v-select:not(.vs--single) .vs__deselect svg {\n -webkit-transform: scale(0.8);\n transform: scale(0.8);\n}\n.vs__dropdown-menu {\n top: calc(100% + 1rem);\n}\n[dir] .vs__dropdown-menu {\n border: none;\n border-radius: 6px;\n padding: 0;\n}\n.vs--open .vs__dropdown-toggle {\n -webkit-box-shadow: 0 3px 10px 0 rgba(34, 41, 47, 0.1);\n}\n[dir] .vs--open .vs__dropdown-toggle {\n border-color: #7367f0;\n border-bottom-color: #7367f0;\n -webkit-box-shadow: 0 3px 10px 0 rgba(34, 41, 47, 0.1);\n box-shadow: 0 3px 10px 0 rgba(34, 41, 47, 0.1);\n}\n[dir=ltr] .vs--open .vs__dropdown-toggle {\n border-bottom-left-radius: 0.357rem;\n border-bottom-right-radius: 0.357rem;\n}\n[dir=rtl] .vs--open .vs__dropdown-toggle {\n border-bottom-right-radius: 0.357rem;\n border-bottom-left-radius: 0.357rem;\n}\n.select-size-lg .vs__selected {\n font-size: 1rem !important;\n}\n[dir] .select-size-lg.vs--single.vs--open .vs__selected {\n margin-top: 6px;\n}\n.select-size-lg .vs__dropdown-toggle,\n.select-size-lg .vs__selected {\n font-size: 1.25rem;\n}\n[dir] .select-size-lg .vs__dropdown-toggle {\n padding: 5px;\n}\n[dir] .select-size-lg .vs__dropdown-toggle input {\n margin-top: 0;\n}\n.select-size-lg .vs__deselect svg {\n -webkit-transform: scale(1) !important;\n vertical-align: middle !important;\n}\n[dir] .select-size-lg .vs__deselect svg {\n -webkit-transform: scale(1) !important;\n transform: scale(1) !important;\n}\n[dir] .select-size-sm .vs__dropdown-toggle {\n padding-bottom: 0;\n padding: 1px;\n}\n[dir] .select-size-sm.vs--single .vs__dropdown-toggle {\n padding: 2px;\n}\n.select-size-sm .vs__dropdown-toggle,\n.select-size-sm .vs__selected {\n font-size: 0.9rem;\n}\n[dir] .select-size-sm .vs__actions {\n padding-top: 2px;\n padding-bottom: 2px;\n}\n.select-size-sm .vs__deselect svg {\n vertical-align: middle !important;\n}\n[dir] .select-size-sm .vs__search {\n margin-top: 0;\n}\n.select-size-sm.v-select .vs__selected {\n font-size: 0.75rem;\n}\n[dir] .select-size-sm.v-select .vs__selected {\n padding: 0 0.3rem;\n}\n[dir] .select-size-sm.v-select:not(.vs--single) .vs__selected {\n margin: 4px 5px;\n}\n[dir] .select-size-sm.v-select.vs--single .vs__selected {\n margin-top: 1px;\n}\n[dir] .select-size-sm.vs--single.vs--open .vs__selected {\n margin-top: 4px;\n}\n.dark-layout .vs__dropdown-toggle {\n color: #b4b7bd;\n}\n[dir] .dark-layout .vs__dropdown-toggle {\n background: #283046;\n border-color: #404656;\n}\n.dark-layout .vs__selected-options input {\n color: #b4b7bd;\n}\n.dark-layout .vs__selected-options input::-webkit-input-placeholder {\n color: #676d7d;\n}\n.dark-layout .vs__selected-options input::-moz-placeholder {\n color: #676d7d;\n}\n.dark-layout .vs__selected-options input:-ms-input-placeholder {\n color: #676d7d;\n}\n.dark-layout .vs__selected-options input::-ms-input-placeholder {\n color: #676d7d;\n}\n.dark-layout .vs__selected-options input::placeholder {\n color: #676d7d;\n}\n.dark-layout .vs__actions svg {\n fill: #404656;\n}\n[dir] .dark-layout .vs__dropdown-menu {\n background: #283046;\n}\n.dark-layout .vs__dropdown-menu li {\n color: #b4b7bd;\n}\n.dark-layout .v-select:not(.vs--single) .vs__selected {\n color: #7367f0;\n}\n[dir] .dark-layout .v-select:not(.vs--single) .vs__selected {\n background-color: rgba(115, 103, 240, 0.12);\n}\n.dark-layout .v-select.vs--single .vs__selected {\n color: #b4b7bd !important;\n}\n.dark-layout .vs--disabled .vs__dropdown-toggle,\n.dark-layout .vs--disabled .vs__clear,\n.dark-layout .vs--disabled .vs__search,\n.dark-layout .vs--disabled .vs__selected,\n.dark-layout .vs--disabled .vs__open-indicator {\n opacity: 0.5;\n}\n[dir] .dark-layout .vs--disabled .vs__dropdown-toggle, [dir] .dark-layout .vs--disabled .vs__clear, [dir] .dark-layout .vs--disabled .vs__search, [dir] .dark-layout .vs--disabled .vs__selected, [dir] .dark-layout .vs--disabled .vs__open-indicator {\n background-color: #283046;\n}", ""]); // exports /***/ }), /***/ "./node_modules/style-loader/index.js!./node_modules/css-loader/index.js!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/sass-loader/dist/cjs.js?!./node_modules/sass-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./frontend/src/views/settings/create_vehicle_categories.vue?vue&type=style&index=0&lang=scss&": /*!*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/style-loader!./node_modules/css-loader!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--7-2!./node_modules/sass-loader/dist/cjs.js??ref--7-3!./node_modules/sass-loader/dist/cjs.js??ref--11-0!./node_modules/vue-loader/lib??vue-loader-options!./frontend/src/views/settings/create_vehicle_categories.vue?vue&type=style&index=0&lang=scss& ***! \*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../../node_modules/css-loader!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src??ref--7-2!../../../../node_modules/sass-loader/dist/cjs.js??ref--7-3!../../../../node_modules/sass-loader/dist/cjs.js??ref--11-0!../../../../node_modules/vue-loader/lib??vue-loader-options!./create_vehicle_categories.vue?vue&type=style&index=0&lang=scss& */ "./node_modules/css-loader/index.js!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/sass-loader/dist/cjs.js?!./node_modules/sass-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./frontend/src/views/settings/create_vehicle_categories.vue?vue&type=style&index=0&lang=scss&"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./frontend/src/views/settings/create_vehicle_categories.vue?vue&type=template&id=09b32611&": /*!********************************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./frontend/src/views/settings/create_vehicle_categories.vue?vue&type=template&id=09b32611& ***! \********************************************************************************************************************************************************************************************************************************/ /*! exports provided: render, staticRenderFns */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; }); var render = function() { var _vm = this var _h = _vm.$createElement var _c = _vm._self._c || _h return _c( "div", [ _c("b-card", { staticClass: "mb-0", attrs: { "no-body": "" } }, [ _c("div", { staticClass: "card-header pb-50" }, [ _c("h5", [ _vm._v("\n Add New Vehicle Category\n ") ]) ]), _vm._v(" "), _c( "form", { attrs: { method: "post" }, on: { submit: function($event) { $event.preventDefault() return _vm.postData($event) } } }, [ _c( "div", { staticClass: "m-2" }, [ _c( "b-row", { staticClass: "mb-2" }, [ _c("b-col", { attrs: { cols: "12", md: "12" } }, [ _c( "label", { staticClass: "d-block", attrs: { for: "basicInput" } }, [_vm._v("Title")] ), _vm._v(" "), _c( "div", { staticClass: "d-flex align-items-center justify-content-end" }, [ _c("b-form-input", { staticClass: "d-inline-block mr-1", attrs: { "v-model": _vm.searchQuery }, model: { value: _vm.vehicleCategories.title, callback: function($$v) { _vm.$set(_vm.vehicleCategories, "title", $$v) }, expression: "vehicleCategories.title" } }) ], 1 ) ]) ], 1 ), _vm._v(" "), _c( "b-row", { staticClass: "mb-2" }, [ _c("b-col", { attrs: { cols: "12", md: "12" } }, [ _c( "table", { staticClass: "table-bordered addmoresection", staticStyle: { width: "100%" }, attrs: { id: "tblAddRow" } }, [ _c("thead", [ _c("tr", [ _c("th", [_vm._v("Basis")]), _vm._v(" "), _c("th", [_vm._v("Part")]), _vm._v(" "), _c("th", [_vm._v("Unit")]), _vm._v(" "), _c("th", [_vm._v("Operator")]), _vm._v(" "), _c("th", [_vm._v("Value")]), _vm._v(" "), _c("th", [_vm._v("Condition")]), _vm._v(" "), _c("th") ]) ]), _vm._v(" "), _c( "tbody", _vm._l(_vm.rowData, function(item) { return _c("tr", [ _c( "td", [ _c( "b-form-group", [ _c("v-select", { attrs: { "v-model": _vm.selected, dir: _vm.$store.state.appConfig .isRTL ? "rtl" : "ltr", label: "title", options: _vm.basis }, model: { value: item.basis, callback: function($$v) { _vm.$set(item, "basis", $$v) }, expression: "\n item.basis\n " } }) ], 1 ) ], 1 ), _vm._v(" "), _c( "td", [ _c( "b-form-group", [ _c("v-select", { attrs: { "v-model": _vm.selected, dir: _vm.$store.state.appConfig .isRTL ? "rtl" : "ltr", label: "title", options: _vm.part }, model: { value: item.part, callback: function($$v) { _vm.$set(item, "part", $$v) }, expression: "\n item.part\n " } }) ], 1 ) ], 1 ), _vm._v(" "), _c( "td", [ _c( "b-form-group", [ _c("v-select", { attrs: { "v-model": _vm.selected, dir: _vm.$store.state.appConfig .isRTL ? "rtl" : "ltr", label: "title", options: _vm.unit }, model: { value: item.unit, callback: function($$v) { _vm.$set(item, "unit", $$v) }, expression: "\n item.unit\n " } }) ], 1 ) ], 1 ), _vm._v(" "), _c( "td", [ _c( "b-form-group", [ _c("v-select", { attrs: { "v-model": _vm.selected, dir: _vm.$store.state.appConfig .isRTL ? "rtl" : "ltr", label: "title", options: _vm.operator }, model: { value: item.operator, callback: function($$v) { _vm.$set(item, "operator", $$v) }, expression: "\n item.operator\n " } }) ], 1 ) ], 1 ), _vm._v(" "), _c( "td", [ _c("b-form-input", { staticClass: "d-inline-block mr-1", attrs: { "v-model": _vm.searchQuery }, model: { value: item.value, callback: function($$v) { _vm.$set(item, "value", $$v) }, expression: "\n item.value\n " } }) ], 1 ), _vm._v(" "), _c( "td", [ _c( "b-form-group", [ _c("v-select", { attrs: { "v-model": _vm.selected, dir: _vm.$store.state.appConfig .isRTL ? "rtl" : "ltr", label: "title", options: _vm.condition }, model: { value: item.condition, callback: function($$v) { _vm.$set(item, "condition", $$v) }, expression: "\n item.condition\n " } }) ], 1 ) ], 1 ), _vm._v(" "), _c( "td", [ _c( "b-button", { directives: [ { name: "ripple", rawName: "v-ripple.400", value: "rgba(234, 84, 85, 0.15)", expression: "\n 'rgba(234, 84, 85, 0.15)'\n ", modifiers: { "400": true } } ], staticClass: "mt-0", attrs: { variant: "danger" }, on: { click: function($event) { return _vm.removeItem( _vm.index, _vm.phoneNumbers ) } } }, [_c("span", [_vm._v("X")])] ) ], 1 ) ]) }), 0 ) ] ) ]) ], 1 ), _vm._v(" "), _c( "b-row", [ _c("b-col", { attrs: { cols: "12", md: "12" } }, [ _c( "div", { staticClass: "d-flex align-items-center justify-content-end" }, [ _c( "router-link", { staticClass: "btn btn-danger", staticStyle: { "margin-right": "10px" }, attrs: { to: "/vehicle-categories" } }, [_vm._v("Back")] ), _vm._v(" "), _c( "b-button", { attrs: { variant: "success", type: "submit" } }, [ _c("span", { staticClass: "text-nowrap" }, [ _vm._v("Submit") ]) ] ) ], 1 ) ]) ], 1 ) ], 1 ) ] ), _vm._v(" "), _c("div", { staticClass: "position-relative table-responsive" }) ]) ], 1 ) } var staticRenderFns = [] render._withStripped = true /***/ }) }]);
/*! * UI development toolkit for HTML5 (OpenUI5) * (c) Copyright 2009-2015 SAP SE or an SAP affiliate company. * Licensed under the Apache License, Version 2.0 - see LICENSE.txt. */ sap.ui.define(['sap/ui/core/Renderer','./ToolbarRenderer'],function(R,T){"use strict";var O=R.extend(T);O.renderBarContent=function(r,t){t._getVisibleContent().forEach(function(c){sap.m.BarInPageEnabler.addChildClassTo(c,t);r.renderControl(c);});if(t._getOverflowButtonNeeded()){O.renderOverflowButton(r,t);}};O.renderOverflowButton=function(r,t){var o=t._getOverflowButton();sap.m.BarInPageEnabler.addChildClassTo(o,t);r.renderControl(o);};return O;},true);
const request = require('request-promise-native'); const util = require('util'); const accessToken = 'ilovegadd'; async function main() { const response = await request.post({ url: `${process.env.BLUELAB_API_ENDPOINT}/dev/accountRegistration`, headers: { bluelabToken: accessToken, 'x-api-key': process.env.BLUELAB_API_KEY }, body: { paymentInformation: { paymentMethod: 'bankAPI(mizuho)', paymentInstitute: 'mizuhoBank', accountInformation: { branchNumber: '015', accountNumber: '1011000', accountName: 'ツキジタロウ' } } }, json: true, simple: false, resolveWithFullResponse: true }); console.log('response:', response); console.log('statusCode:', response.statusCode); console.log('response body:', response.body); // console.log(util.inspect(response.body, { showHidden: true, depth: null })); } main().then(() => { console.log('success!'); }).catch(console.error)
import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; import { APIDEMOS_CAPS } from '../../desired'; import { initDriver } from '../../helpers/session'; chai.should(); chai.use(chaiAsPromised); const atv = 'android.widget.TextView'; const f = "android.widget.FrameLayout"; describe('Find - xpath', function () { let driver; before(async () => { driver = await initDriver(APIDEMOS_CAPS); }); after(async () => { await driver.deleteSession(); }); it('should find element by type', async () => { let el = await driver.findElOrEls('xpath', `//${atv}`, false); await driver.getText(el.ELEMENT).should.eventually.equal('API Demos'); }); it('should find element by text', async () => { let el = await driver.findElOrEls('xpath', `//${atv}[@text='Accessibility']`, false); await driver.getText(el.ELEMENT).should.eventually.equal('Accessibility'); }); it('should find element by attribute', async () => { await driver.findElOrEls('xpath', `//*[@enabled='true' and @focused='true']`, true) .should.eventually.have.length(1); }); it('should find exactly one element via elementsByXPath', async () => { let el = await driver.findElOrEls('xpath', `//${atv}[@text='Accessibility']`, true); el.length.should.equal(1); await driver.getText(el[0].ELEMENT).should.eventually.equal('Accessibility'); }); it('should find element by partial text', async () => { let el = await driver.findElOrEls('xpath', `//${atv}[contains(@text, 'Accessibility')]`, false); await driver.getText(el.ELEMENT).should.eventually.equal('Accessibility'); }); it('should find the last element', async () => { let el = await driver.findElOrEls('xpath', `(//${atv})[last()]`, false); let text = await driver.getText(el.ELEMENT); ["OS", "Text", "Views", "Preference"].should.include(text); }); it('should find element by index and embedded desc', async () => { let el = await driver.findElOrEls('xpath', `//${f}//${atv}[5]`, false); await driver.getText(el.ELEMENT).should.eventually.equal('Content'); }); it('should find all elements', async () => { let el = await driver.findElOrEls('xpath', `//*`, true); el.length.should.be.above(2); }); it('should find the first element when searching for all elements', async () => { let el = await driver.findElOrEls('xpath', `//*`, true); el[0].should.exist; }); it('should find less elements with compression turned on', async () => { await driver.updateSettings({"ignoreUnimportantViews": false}); let elementsWithoutCompression = await driver.findElOrEls('xpath', `//*`, true); await driver.updateSettings({"ignoreUnimportantViews": true}); let elementsWithCompression = await driver.findElOrEls('xpath', `//*`, true); elementsWithoutCompression.length.should.be.greaterThan(elementsWithCompression.length); }); it('should find toast message element by text @skip-ci', async function () { // skip on travis, as it is too slow and the message is removed before // we can find it await driver.startActivity(`io.appium.android.apis`, `.view.PopupMenu1`); await driver.implicitWait(20000); let popUp = await driver.findElOrEls('accessibility id', 'Make a Popup!', false); let popUpEl = popUp.ELEMENT; await driver.click(popUpEl); let search = await driver.findElOrEls('xpath', `.//*[@text='Search']`, false); await driver.click(search.ELEMENT); await driver.findElOrEls('xpath', `//*[@text='Clicked popup menu item Search']`, false) .should.eventually.exist; await driver.click(popUpEl); let add =await driver.findElOrEls('xpath', `.//*[@text='Add']`, false); await driver.click(add.ELEMENT); await driver.findElOrEls('xpath', `//*[@text='Clicked popup menu item Add']`, false) .should.eventually.exist; }); });
const common = require('../../../../../server/lib/common'); const {authenticateContentApiKey} = require('../../../../../server/services/auth/api-key/content'); const models = require('../../../../../server/models'); const should = require('should'); const sinon = require('sinon'); const testUtils = require('../../../../utils'); describe('Content API Key Auth', function () { before(models.init); before(testUtils.teardown); this.beforeEach(function () { const fakeApiKey = { id: '1234', type: 'content', secret: Buffer.from('testing').toString('hex'), get(prop) { return this[prop]; } }; this.fakeApiKey = fakeApiKey; this.apiKeyStub = sinon.stub(models.ApiKey, 'findOne'); this.apiKeyStub.returns(new Promise.resolve()); this.apiKeyStub.withArgs({secret: fakeApiKey.secret}).returns(new Promise.resolve(fakeApiKey)); }); afterEach(function () { sinon.restore(); }); it('should authenticate with known+valid key', function (done) { const req = { query: { key: this.fakeApiKey.secret } }; const res = {}; authenticateContentApiKey(req, res, (arg) => { should.not.exist(arg); req.api_key.should.eql(this.fakeApiKey); done(); }); }); it('shouldn\'t authenticate with invalid/unknown key', function (done) { const req = { query: { key: 'unknown' } }; const res = {}; authenticateContentApiKey(req, res, function next(err) { should.exist(err); should.equal(err instanceof common.errors.UnauthorizedError, true); err.code.should.eql('UNKNOWN_CONTENT_API_KEY'); should.not.exist(req.api_key); done(); }); }); it('shouldn\'t authenticate with a non-content-api key', function (done) { const req = { query: { key: this.fakeApiKey.secret } }; const res = {}; this.fakeApiKey.type = 'admin'; authenticateContentApiKey(req, res, function next(err) { should.exist(err); should.equal(err instanceof common.errors.UnauthorizedError, true); err.code.should.eql('INVALID_API_KEY_TYPE'); should.not.exist(req.api_key); done(); }); }); });
//-------------------------------------------------------- //-- Node IoC - Test - Unit - ServiceStartCommandTest //-------------------------------------------------------- 'use strict'; const Handler = require('../../../../../dist/node/app/handlers/Handler'); const ServiceRestartCommand = require('../../../../../dist/node/app/console/commands/service/ServiceRestartCommand'); const TestCase = require('../../../../TestCase'); class ServiceRestartCommandTest extends TestCase { beforeEach() { super.beforeEach(); this.givenMockedTerminal(); this.givenEmptySpies(); this.givenCommand(); this.givenMockedExceptionHandler(); } async testServiceRestartWithoutSpecificVersionThroughDedicatedHandler() { this.givenFakeServiceHandler('foo'); this.givenServiceEmptyVersion(); await this.whenRunningCommandForService('foo'); this.thenShouldHaveRestartedServiceThroughHandler('foo'); } async testServiceRestartWithSpecificVersionThroughDedicatedHandler() { this.givenFakeServiceHandler('foo'); this.givenServiceVersion('888'); await this.whenRunningCommandForService('foo'); this.thenShouldHaveRestartedServiceThroughHandler('foo'); } async testThrowErrorIfHandlerDoesNotExist() { this.givenFakeServiceHandler('foo'); this.givenServiceEmptyVersion(); await this.whenRunningCommandForService('bar'); this.thenShouldNotHaveRestartedServiceThroughHandler('foo'); } // GIVEN METHODS //-------------------------------------------------------- givenCommand() { this.app.make('command.registrar').add(ServiceRestartCommand); } givenEmptySpies() { this.spies = { handlers: {} }; } givenFakeServiceHandler(service) { this.spies.handlers[service] = {}; this.spies.handlers[service].restart = jest.fn(() => { return { message: 'restart success' }; }); const self = this; // eslint-disable-line unicorn/no-this-assignment this.app.bind(`handler.${service}`, class extends Handler { restart(...parameters) { return self.spies.handlers[service].restart(...parameters); } }); } givenServiceEmptyVersion() { this.version = ''; } givenServiceVersion(version) { this.version = version; } givenMockedTerminal() { this.mockedTerminal = { success: jest.fn() }; } givenMockedExceptionHandler() { this.app.bind('exception.handler', { handle: (error) => { this.error = error; } }); } // WHEN METHODS //-------------------------------------------------------- async whenRunningCommandForService(service) { await this.whenAttemptingAsync(async () => { await this.app.make('command.registrar') .resolve(`service:restart ${service} ${this.version}`.trim()); }); } // THEN METHODS //-------------------------------------------------------- thenShouldHaveRestartedServiceThroughHandler(service) { this.expect(this.spies.handlers[service].restart).toHaveBeenCalled(); } thenShouldNotHaveRestartedServiceThroughHandler(service) { this.expect(this.spies.handlers[service].restart).not.toHaveBeenCalled(); this.thenShouldHaveThrown(); } } module.exports = ServiceRestartCommandTest;
import * as util from '../../util'; import Component from './Component'; import moment from '../../module/moment'; import locales from '../locales'; /** * A current time bar * @param {{range: Range, dom: Object, domProps: Object}} body * @param {Object} [options] Available parameters: * {Boolean} [showCurrentTime] * {String} [alignCurrentTime] * @constructor CurrentTime * @extends Component */ class CurrentTime extends Component { constructor(body, options) { super() this.body = body; // default options this.defaultOptions = { rtl: false, showCurrentTime: true, alignCurrentTime: undefined, moment, locales, locale: 'en' }; this.options = util.extend({}, this.defaultOptions); this.offset = 0; this._create(); this.setOptions(options); } /** * Create the HTML DOM for the current time bar * @private */ _create() { const bar = document.createElement('div'); bar.className = 'timeline-current-time'; bar.style.position = 'absolute'; bar.style.top = '0px'; bar.style.height = '100%'; this.bar = bar; } /** * Destroy the CurrentTime bar */ destroy() { this.options.showCurrentTime = false; this.redraw(); // will remove the bar from the DOM and stop refreshing this.body = null; } /** * Set options for the component. Options will be merged in current options. * @param {Object} options Available parameters: * {boolean} [showCurrentTime] * {String} [alignCurrentTime] */ setOptions(options) { if (options) { // copy all options that we know util.selectiveExtend(['rtl', 'showCurrentTime', 'alignCurrentTime', 'moment', 'locale', 'locales'], this.options, options); } } /** * Repaint the component * @return {boolean} Returns true if the component is resized */ redraw() { if (this.options.showCurrentTime) { const parent = this.body.dom.backgroundVertical; if (this.bar.parentNode != parent) { // attach to the dom if (this.bar.parentNode) { this.bar.parentNode.removeChild(this.bar); } parent.appendChild(this.bar); this.start(); } let now = this.options.moment(new Date().valueOf() + this.offset); if (this.options.alignCurrentTime) { now = now.startOf(this.options.alignCurrentTime); } const x = this.body.util.toScreen(now); let locale = this.options.locales[this.options.locale]; if (!locale) { if (!this.warned) { console.log(`WARNING: options.locales['${this.options.locale}'] not found. See http://visjs.org/docs/timeline/#Localization`); this.warned = true; } locale = this.options.locales['en']; // fall back on english when not available } let title = `${locale.current} ${locale.time}: ${now.format('dddd, MMMM Do YYYY, H:mm:ss')}`; title = title.charAt(0).toUpperCase() + title.substring(1); if (this.options.rtl) { this.bar.style.right = `${x}px`; } else { this.bar.style.left = `${x}px`; } this.bar.title = title; } else { // remove the line from the DOM if (this.bar.parentNode) { this.bar.parentNode.removeChild(this.bar); } this.stop(); } return false; } /** * Start auto refreshing the current time bar */ start() { const me = this; /** * Updates the current time. */ function update () { me.stop(); // determine interval to refresh const scale = me.body.range.conversion(me.body.domProps.center.width).scale; let interval = 1 / scale / 10; if (interval < 30) interval = 30; if (interval > 1000) interval = 1000; me.redraw(); me.body.emitter.emit('currentTimeTick'); // start a renderTimer to adjust for the new time me.currentTimeTimer = setTimeout(update, interval); } update(); } /** * Stop auto refreshing the current time bar */ stop() { if (this.currentTimeTimer !== undefined) { clearTimeout(this.currentTimeTimer); delete this.currentTimeTimer; } } /** * Set a current time. This can be used for example to ensure that a client's * time is synchronized with a shared server time. * @param {Date | string | number} time A Date, unix timestamp, or * ISO date string. */ setCurrentTime(time) { const t = util.convert(time, 'Date').valueOf(); const now = new Date().valueOf(); this.offset = t - now; this.redraw(); } /** * Get the current time. * @return {Date} Returns the current time. */ getCurrentTime() { return new Date(new Date().valueOf() + this.offset); } } export default CurrentTime;
define(['exports', 'module', 'angular', 'laxar-patterns'], function (exports, module, _angular, _laxarPatterns) { /** * Copyright 2016 aixigo AG * Released under the MIT license * http://www.laxarjs.org */ 'use strict'; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _ng = _interopRequireDefault(_angular); var _patterns = _interopRequireDefault(_laxarPatterns); Controller.$inject = ['$scope']; function Controller($scope) { _patterns['default'].resources.handlerFor($scope).registerResourceFromFeature('cart'); $scope.actions = { checkout: _patterns['default'].actions.publisherForFeature($scope, 'checkout') }; } module.exports = _ng['default'].module('shoppingCartWidget', []).controller('ShoppingCartWidgetController', Controller); });
import React from 'react' import { View, Text, StyleSheet, ScrollView, Image, TouchableOpacity } from 'react-native' import { MaterialIcons } from '@expo/vector-icons' import { useNavigation } from '@react-navigation/native' import Shoes from '../../components/Shoes' export default function Home() { const navigation = useNavigation() return ( <View style={styles.container}> <View style={styles.header}> <Image source={require('../../assets/banner.png')} style={styles.image} /> <View style={styles.textContainer}> <Text style={styles.text}>TÊNIS</Text> <Text style={[styles.text, { color: '#cececf' } ]}>•</Text> <Text style={[styles.text, { color: '#cececf' } ]}>MASCULINO</Text> <TouchableOpacity style={{position: 'absolute', right: 0, alignSelf: 'center'}}> <MaterialIcons name="filter-list" size={24} color="#000" /> </TouchableOpacity> </View> </View> <View style={styles.line} /> <ScrollView> <Text style={styles.text}>LANÇAMENTOS</Text> <View style={{ flexDirection: 'row', justifyContent: 'space-around' }}> <Shoes img={require('../../assets/1.png')} cost="R$140,90" onClick={() => navigation.navigate('Detail')}> Nike Air Max Dia </Shoes> <Shoes img={require('../../assets/2.png')} cost="R$280,90" onClick={() => navigation.navigate('Detail')}> Nike Downshifter 10 </Shoes> </View> <View style={{ flexDirection: 'row', justifyContent: 'space-around' }}> <Shoes img={require('../../assets/3.png')} cost="R$560,90" onClick={() => alert('CLICOU')}> Nike Squidward Tentacles </Shoes> <Shoes img={require('../../assets/4.png')} cost="R$220" onClick={() => alert('CLICOU')}> Nike Epic React Flyknit 2 </Shoes> </View> <View style={{ flexDirection: 'row', justifyContent: 'space-around' }}> <Shoes img={require('../../assets/5.png')} cost="R$120,90" onClick={() => alert('CLICOU')}> Nike Joyride Run Flyknit </Shoes> <Shoes img={require('../../assets/6.png')} cost="R$920" onClick={() => alert('CLICOU')}> Nike Air Max Dia Sujeito Programador </Shoes> </View> </ScrollView> </View> ) } const styles = StyleSheet.create({ container: { flex: 1, width: '100%', backgroundColor: '#fff' }, header: { marginBottom: 8 }, image: { width: '100%' }, textContainer: { flexDirection: 'row', marginVertical: '5%', marginHorizontal: '5%' }, text: { fontFamily: 'Anton_400Regular', fontSize: 26, marginHorizontal: '1%' }, line: { borderBottomColor: '#d8d8d8', borderBottomWidth: 2 } })
'use strict'; // polyfills HTMLElement.prototype.classList and DOMTokenList require('classlist-polyfill'); // polyfills HTMLElement.prototype.hidden require('./element-hidden');
require('./app.js').wat2wasm();
"use strict"; ///<reference path="../typings/node/node.d.ts" /> const Callmonitor_1 = require('./Callmonitor'); const MqttAdapter_1 = require('./MqttAdapter'); class Fritz2Mqtt { constructor(config) { this.state = new State(); this.mqttAdapter = new MqttAdapter_1.MqttAdapter(config.mqttAdapter); this.mqttAdapter.config.statePaths = [ 'extension/*', 'connection/*', 'lastCall', 'lastRing', 'lastConnect', 'lastDisconnect', ]; this.callmonitor = new Callmonitor_1.Callmonitor(config.callmonitor); this.callmonitor.on('event', () => { console.log('onEvent', this.state.lastEvent); this.state.extension = this.callmonitor.state.extension; this.state.connection = this.callmonitor.state.connection; this.state.lastCall = this.callmonitor.state.lastCall; this.state.lastRing = this.callmonitor.state.lastRing; this.state.lastConnect = this.callmonitor.state.lastConnect; this.state.lastDisconnect = this.callmonitor.state.lastDisconnect; this.state.lastEvent = this.callmonitor.state.lastEvent; this.state.history.push(this.callmonitor.state.lastEvent); this.state.history = this.state.history.splice(100); this.mqttAdapter.publishEvent(this.state.lastEvent); }).on('connect', () => { console.log('fritz connected'); }).on('disconnect', () => { console.log('fritz disconnected'); }); } main() { console.log('start Fritz2Mqtt'); this.mqttAdapter.init(); this.callmonitor.init(); } } exports.Fritz2Mqtt = Fritz2Mqtt; class State { constructor() { this.extension = {}; this.devices = {}; this.connection = {}; this.lastEvent = {}; this.lastCall = {}; this.lastRing = {}; this.lastConnect = {}; this.lastDisconnect = {}; this.history = []; } } exports.State = State; class Config { } exports.Config = Config;
(function(a){const e=a["ca"]=a["ca"]||{};e.dictionary=Object.assign(e.dictionary||{},{"%0 of %1":"","Block quote":"Cita de bloc","Blue marker":"Marcador blau",Bold:"Negreta",Cancel:"Cancel·lar","Choose heading":"Escull capçalera","Green marker":"Marcador verd","Green pen":"Bolígraf verd",Heading:"Capçalera","Heading 1":"Capçalera 1","Heading 2":"Capçalera 2","Heading 3":"Capçalera 3","Heading 4":"","Heading 5":"","Heading 6":"",Highlight:"Destacat",Italic:"Cursiva",Paragraph:"Pàrraf","Pink marker":"Marcador rosa","Red pen":"Marcador vermell","Remove highlight":"Esborrar destacat",Save:"Desar","Show more items":"",Strikethrough:"Marcat","Text highlight toolbar":"","Type or paste your content here.":"","Type your title":"","Yellow marker":"Marcador groc"});e.getPluralForm=function(a){return a!=1}})(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
tinymce.addI18n('pt-BR',{ "Cut": "Recortar", "Heading 5": "Cabe\u00e7alho 5", "Header 2": "Cabe\u00e7alho 2", "Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\/C\/V keyboard shortcuts instead.": "Seu navegador n\u00e3o suporta acesso direto \u00e0 \u00e1rea de transfer\u00eancia. Por favor use os atalhos Ctrl+X - C - V do teclado", "Heading 4": "Cabe\u00e7alho 4", "Div": "Div", "Heading 2": "Cabe\u00e7alho 2", "Paste": "Colar", "Close": "Fechar", "Font Family": "Fonte", "Pre": "Pre", "Align right": "Alinhar \u00e0 direita", "New document": "Novo documento", "Blockquote": "Aspas", "Numbered list": "Lista ordenada", "Heading 1": "Cabe\u00e7alho 1", "Headings": "Cabe\u00e7alhos", "Increase indent": "Aumentar recuo", "Formats": "Formatos", "Headers": "Cabe\u00e7alhos", "Select all": "Selecionar tudo", "Header 3": "Cabe\u00e7alho 3", "Blocks": "Blocos", "Undo": "Desfazer", "Strikethrough": "Riscar", "Bullet list": "Lista n\u00e3o ordenada", "Header 1": "Cabe\u00e7alho 1", "Superscript": "Sobrescrito", "Clear formatting": "Limpar formata\u00e7\u00e3o", "Font Sizes": "Tamanho", "Subscript": "Subscrever", "Header 6": "Cabe\u00e7alho 6", "Redo": "Refazer", "Paragraph": "Par\u00e1grafo", "Ok": "Ok", "Bold": "Negrito", "Code": "C\u00f3digo", "Italic": "It\u00e1lico", "Align center": "Centralizar", "Header 5": "Cabe\u00e7alho 5", "Heading 6": "Cabe\u00e7alho 6", "Heading 3": "Cabe\u00e7alho 3", "Decrease indent": "Diminuir recuo", "Header 4": "Cabe\u00e7alho 4", "Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.": "O comando colar est\u00e1 agora em modo texto plano. O conte\u00fado ser\u00e1 colado como texto plano at\u00e9 voc\u00ea desligar esta op\u00e7\u00e3o.", "Underline": "Sublinhar", "Cancel": "Cancelar", "Justify": "Justificar", "Inline": "Em linha", "Copy": "Copiar", "Align left": "Alinhar \u00e0 esquerda", "Visual aids": "Ajuda visual", "Lower Greek": "\u03b1. \u03b2. \u03b3. ...", "Square": "Quadrado", "Default": "Padr\u00e3o", "Lower Alpha": "a. b. c. ...", "Circle": "C\u00edrculo", "Disc": "Disco", "Upper Alpha": "A. B. C. ...", "Upper Roman": "I. II. III. ...", "Lower Roman": "i. ii. iii. ...", "Name": "Nome", "Anchor": "\u00c2ncora", "You have unsaved changes are you sure you want to navigate away?": "Voc\u00ea tem mudan\u00e7as n\u00e3o salvas. Voc\u00ea tem certeza que deseja sair?", "Restore last draft": "Restaurar \u00faltimo rascunho", "Special character": "Caracteres especiais", "Source code": "C\u00f3digo fonte", "B": "B", "R": "R", "G": "G", "Color": "Cor", "Right to left": "Da direita para a esquerda", "Left to right": "Da esquerda para a direita", "Emoticons": "Emoticons", "Robots": "Rob\u00f4s", "Document properties": "Propriedades do documento", "Title": "T\u00edtulo", "Keywords": "Palavras-chave", "Encoding": "Codifica\u00e7\u00e3o", "Description": "Descri\u00e7\u00e3o", "Author": "Autor", "Fullscreen": "Tela cheia", "Horizontal line": "Linha horizontal", "Horizontal space": "Espa\u00e7amento horizontal", "Insert\/edit image": "Inserir\/editar imagem", "General": "Geral", "Advanced": "Avan\u00e7ado", "Source": "Endere\u00e7o da imagem", "Border": "Borda", "Constrain proportions": "Manter propor\u00e7\u00f5es", "Vertical space": "Espa\u00e7amento vertical", "Image description": "Inserir descri\u00e7\u00e3o", "Style": "Estilo", "Dimensions": "Dimens\u00f5es", "Insert image": "Inserir imagem", "Zoom in": "Aumentar zoom", "Contrast": "Contraste", "Back": "Voltar", "Gamma": "Gama", "Flip horizontally": "Virar horizontalmente", "Resize": "Redimensionar", "Sharpen": "Aumentar nitidez", "Zoom out": "Diminuir zoom", "Image options": "Op\u00e7\u00f5es de Imagem", "Apply": "Aplicar", "Brightness": "Brilho", "Rotate clockwise": "Girar em sentido anti-hor\u00e1rio", "Rotate counterclockwise": "Girar em sentido hor\u00e1rio", "Edit image": "Editar imagem", "Color levels": "N\u00edveis de cor", "Crop": "Cortar", "Orientation": "Orienta\u00e7\u00e3o", "Flip vertically": "Virar verticalmente", "Invert": "Inverter", "Insert date\/time": "Inserir data\/hora", "Remove link": "Remover link", "Url": "Url", "Text to display": "Texto para mostrar", "Anchors": "\u00c2ncoras", "Insert link": "Inserir link", "New window": "Nova janela", "None": "Nenhum", "The URL you entered seems to be an external link. Do you want to add the required http:\/\/ prefix?": "A URL que voc\u00ea informou parece ser um link externo. Deseja incluir o prefixo http:\/\/?", "Target": "Alvo", "The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?": "The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?", "Insert\/edit link": "Inserir\/editar link", "Insert\/edit video": "Inserir\/editar v\u00eddeo", "Poster": "Autor", "Alternative source": "Fonte alternativa", "Paste your embed code below:": "Insira o c\u00f3digo de incorpora\u00e7\u00e3o abaixo:", "Insert video": "Inserir v\u00eddeo", "Embed": "Incorporar", "Nonbreaking space": "Espa\u00e7o n\u00e3o separ\u00e1vel", "Page break": "Quebra de p\u00e1gina", "Paste as text": "Colar como texto", "Preview": "Pr\u00e9-visualizar", "Print": "Imprimir", "Save": "Salvar", "Could not find the specified string.": "N\u00e3o foi poss\u00edvel encontrar o termo especificado", "Replace": "Substituir", "Next": "Pr\u00f3ximo", "Whole words": "Palavras inteiras", "Find and replace": "Localizar e substituir", "Replace with": "Substituir por", "Find": "Localizar", "Replace all": "Substituir tudo", "Match case": "Diferenciar mai\u00fasculas e min\u00fasculas", "Prev": "Anterior", "Spellcheck": "Corretor ortogr\u00e1fico", "Finish": "Finalizar", "Ignore all": "Ignorar tudo", "Ignore": "Ignorar", "Add to Dictionary": "Adicionar ao Dicion\u00e1rio", "Insert row before": "Inserir linha antes", "Rows": "Linhas", "Height": "Altura", "Paste row after": "Colar linha depois", "Alignment": "Alinhamento", "Border color": "Cor da borda", "Column group": "Agrupar coluna", "Row": "Linha", "Insert column before": "Inserir coluna antes", "Split cell": "Dividir c\u00e9lula", "Cell padding": "Espa\u00e7amento interno da c\u00e9lula", "Cell spacing": "Espa\u00e7amento da c\u00e9lula", "Row type": "Tipo de linha", "Insert table": "Inserir tabela", "Body": "Corpo", "Caption": "Legenda", "Footer": "Rodap\u00e9", "Delete row": "Excluir linha", "Paste row before": "Colar linha antes", "Scope": "Escopo", "Delete table": "Excluir tabela", "H Align": "Alinhamento H", "Top": "Superior", "Header cell": "C\u00e9lula cabe\u00e7alho", "Column": "Coluna", "Row group": "Agrupar linha", "Cell": "C\u00e9lula", "Middle": "Meio", "Cell type": "Tipo de c\u00e9lula", "Copy row": "Copiar linha", "Row properties": "Propriedades da linha", "Table properties": "Propriedades da tabela", "Bottom": "Inferior", "V Align": "Alinhamento V", "Header": "Cabe\u00e7alho", "Right": "Direita", "Insert column after": "Inserir coluna depois", "Cols": "Colunas", "Insert row after": "Inserir linha depois", "Width": "Largura", "Cell properties": "Propriedades da c\u00e9lula", "Left": "Esquerdo", "Cut row": "Recortar linha", "Delete column": "Excluir coluna", "Center": "Centro", "Merge cells": "Agrupar c\u00e9lulas", "Insert template": "Inserir modelo", "Templates": "Modelos", "Background color": "Cor do fundo", "Custom...": "Personalizado...", "Custom color": "Cor personalizada", "No color": "Nenhuma cor", "Text color": "Cor do texto", "Show blocks": "Mostrar blocos", "Show invisible characters": "Exibir caracteres invis\u00edveis", "Words: {0}": "Palavras: {0}", "Insert": "Inserir", "File": "Arquivo", "Edit": "Editar", "Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help": "\u00c1rea de texto formatado. Pressione ALT-F9 para exibir o menu, ALT-F10 para exibir a barra de ferramentas ou ALT-0 para exibir a ajuda", "Tools": "Ferramentas", "View": "Visualizar", "Table": "Tabela", "Format": "Formatar" });
class OrganisationSummaryController { constructor() { this.name = 'organisationSummary'; } } export default OrganisationSummaryController;
const CarModel = require('./cars.model'); exports.makeEntry = (data) => { console.log('Car Save initiated'); return CarModel.insertMany(data).then(d => { console.log('Car entry saved'); return d[0]; }) } exports.getAll = async () => { console.log('Fetching all cars...'); try { let result = await CarModel.find({}); console.log('Fetched all cars.') return result; } catch (error) { throw error; } }
import React from 'react' import { Redirect } from 'react-router-dom' import axios from 'axios' import Banner from '../../components/Banner' import Navigation from '../../common/navigation' import { API_URL } from "../../common/url-types" import Testimonial from '../../components/Testimonial' import styled from 'styled-components' import { Grid, AppBar, Card, Tabs, Tab, Typography, List, ListItem, ListItemIcon, ListItemText, Divider, ListSubheader, Button } from '@material-ui/core' import Schedule from '@material-ui/icons/Schedule' import Event from '@material-ui/icons/Event' import Person from '@material-ui/icons/Person' import ViewHeadline from '@material-ui/icons/ViewHeadline' import AudioTrack from '@material-ui/icons/AudioTrack' import LibraryBooks from '@material-ui/icons/LibraryBooks' import VideoLibrary from '@material-ui/icons/VideoLibrary' import VideoCam from '@material-ui/icons/VideoCam' const Container = styled(Grid)` max-width: 1024px; margin: 0 auto!important; padding: 0 15px; width: 100%!important; padding: 30px 0; ` const TabStyle = styled(Tab)` box-shadow: none ` class Page extends React.Component { constructor(props) { super(props); this.state = { courseID: this.props.match.params.id, course: { id: '', title: '', create_at: '', description: '', start_date: '' }, message: '', onCourse: false, value: 0 } } getData = () => { if (this.props.isAuthenticated) { axios.get(`${API_URL}/api/users/${this.props.user.id}/courses/${this.state.courseID}`) .then(res => { const { data } = res; if (!data.view) { axios.post(`${API_URL}/api/users/${this.props.user.id}/courses/${this.state.courseID}`, { view: 1 }); } this.getCourse(); this.setState({ progress: data.progress }); }); } this.getLessons(); }; getCourse = () => { axios.get(`${API_URL}/api/courses/${this.state.courseID}`) .then(res => { const course = res.data; this.setState({ course: course }); }); } componentDidMount() { this.getData(); } getLessons = () => { axios.get(`${API_URL}/api/courses/${this.state.courseID}/lessons`) .then(res => { const lessons = res.data; this.setState({ lessons: lessons, lessonsCount: lessons.length }); }); }; startCourse = () => { axios.get(`${API_URL}/api/users/${this.props.user.id}/courses/${this.state.courseID}`) .then(res => { if (res.data.progress === null) { this.updateCourse(); } this.setState({ onCourse: true }); }); }; updateCourse = () => { axios.put(`${API_URL}/api/users/${this.props.user.id}/courses/${this.state.courseID}`, { progress: 0, view: 1 }) .then(res => { this.setState({ onCourse: true }); }); }; formatIcons = (type) => { switch (type) { case 'text': return <LibraryBooks /> break; case 'video-internal': return <VideoLibrary /> break; case 'video-external': return <VideoCam /> break; default: return <AudioTrack /> } }; handleChange = (event, value) => { this.setState({ value }); }; handleChangeIndex = index => { this.setState({ value: index }); }; formatDateReverse = (date) => { const oldDate = date.split('-'); let day, month, year; day = Number(oldDate[2]); month = Number(oldDate[1]) - 1; year = Number(oldDate[0]); const newDate = day + '/' + month + '/' + year; return newDate }; render() { const { course, courseID, lessons, lessonsCount, progress, value } = this.state; const { isAuthenticated, user } = this.props; if (this.state.onCourse === true) { return <Redirect to={'/courses/' + courseID} /> } return ( <div id="course-page"> <Navigation /> <main className="fadeIn animated"> <Banner internal title={course.title} image={course.image} /> <Container container spacing={16} justify="center"> <Grid item md={9}> {course.image? <img src={course.image} style={{ width: '100%' }} /> : <img src={'../../../img/logo.png'} style={{ width: '100%' }} /> } <Divider style={{ margin: '20px 0' }} /> <Tabs value={value} onChange={this.handleChange} indicatorColor="secondary" textColor="secondary" > <Tab label="Detalhes" /> {/* <Tab label="Avaliações" /> */} <Tab label="Conteúdo" /> </Tabs> {value === 0 && <Typography component="div" dir={'x'} style={{ padding: 8 * 3 }}> <p> {course.description} </p> <br /><br /> </Typography> } {/* {value === 1 && <Typography component="div" dir={'x'} style={{ padding: 8 * 3 }}> <Testimonial /> </Typography> } */} {value === 1 && <Typography component="div" dir={'x'} style={{ padding: 8 * 3 }}> <List> {lessons ? <React.Fragment> <Divider /> {lessons.map((lesson) => <React.Fragment key={lesson.id}> <ListItem> <ListItemIcon> {this.formatIcons(lesson.type)} </ListItemIcon> <ListItemText primary={lesson.title} /> </ListItem> <Divider /> </React.Fragment> )} </React.Fragment> : null} </List> </Typography> } </Grid> <Grid item md={3}> <Grid container justify="center"> <Grid item xs={12}> <Card> <List> <ListSubheader>Detalhes</ListSubheader> <Divider /> <ListItem> <ListItemIcon> <Schedule /> </ListItemIcon> <ListItemText primary={course.duration === 1 ? course.duration + ' hora' : course.duration + ' horas'} /> </ListItem> <ListItem> <ListItemIcon> <Event /> </ListItemIcon> <ListItemText primary={this.formatDateReverse(course.start_date)} /> </ListItem> {/* <ListItem> <ListItemIcon> <Person /> </ListItemIcon> <ListItemText primary={course.instructor} /> </ListItem> */} <ListItem> <ListItemIcon> <ViewHeadline /> </ListItemIcon> <ListItemText primary={lessonsCount === 1 ? lessonsCount + ' Lição' : lessonsCount + ' Lições'} /> </ListItem> </List> </Card> </Grid> <Button variant='contained' size="large" color='secondary' style={{ marginTop: '20px' }} onClick={this.startCourse}>{isAuthenticated ? progress != null ? "Continuar Curso" : "Iniciar Curso" : "Iniciar Curso"}</Button> </Grid> </Grid> </Container> </main> </div> ); } } export default Page;
"use strict"; var _get = function get(object, property, receiver) { var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc && desc.writable) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; var _inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; }; var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; var DispatchCoordinator = require("../dispatchCoordinator"); var Queries = (function (_DispatchCoordinator) { function Queries(options) { _classCallCheck(this, Queries); _get(Object.getPrototypeOf(Queries.prototype), "constructor", this).call(this, "Queries", options); } _inherits(Queries, _DispatchCoordinator); return Queries; })(DispatchCoordinator); module.exports = Queries;
const spawn = require('child_process').spawn; const os = require('os').platform(); export function arp(ip, cb) { if(os.indexOf('linux') === 0) linux(ip, cb); else if(os.indexOf('win') === 0) windows(ip, cb); else if(os.indexOf('darwin') === 0) mac(ip, cb); }; function linux(ip, cb) { var arp = spawn('arp', [ '-n', ip ]), buffer = ''; if(! arp) return cb('arp failed'); arp.stdout.on('data', function (data) { buffer += data; }); arp.on('close', function(code) { var lines = buffer.split('\n'); if (code !== 0) return cb('arp failed'); if (lines.length >= 2) { var chunks = lines[1].split(' ').filter(String); return cb(null, chunks[2]); } cb(null, false); }); }; function windows(ip, cb) { var arp = spawn('arp', ['-a', ip]), buffer = ''; if(! arp) return cb('arp failed'); arp.stdout.on('data', function(data) { buffer += data; }); arp.on('close', function(code) { var lines = buffer.split('\r\n'); if (code !== 0) return cb('arp failed'); for(var i = 3; i < lines.length; i++) { var chunks = lines[i].split(' ').filter(String); if (chunks[0] === ip) return cb(null, chunks[1].replace(/-/g, ':')); } cb(null, false); }); }; function mac(ip, cb) { var arp = spawn('arp', ['-n', ip]), buffer = ''; if(! arp) return cb('arp failed'); arp.stdout.on('data', function(data) { buffer += data; }); arp.on('close', function(code) { var chunks = buffer.split(' ').filter(String); if (code !== 0) return cb('arp failed'); if (chunks[3] !== 'no') { var mac = chunks[3].replace(/^0:/g, '00:').replace(/:0:/g, ':00:').replace(/:0$/g, ':00'); return cb(null, mac); } cb(null, false); }); }; //export default arp;
import demo from "./demo"; export default { ...demo };
import { select, call, put, all, takeEvery } from 'redux-saga/effects'; import axios from 'axios'; import * as actions from './actions'; import initializeCanvas from '../utils/init'; function* fetchCountyData(action) { try { const { data } = yield call(axios.get, 'http://localhost:8080/api/counties'); yield put({type: actions.COUNTY_DATA_FETCH_SUCCEEDED, data}); } catch (e) { yield put({type: actions.COUNTY_DATA_FETCH_FAILED, message: e.message}); } } function* fetchCaseData(action) { try { const { data } = yield call(axios.get, 'http://localhost:8080/api/cases'); yield put({type: actions.CASE_DATA_FETCH_SUCCEEDED, data}); } catch (e) { yield put({type: actions.CASE_DATA_FETCH_FAILED, message: e.message}); } } function* initialize(action) { try { yield all([ fetchCountyData(), fetchCaseData() ]) const counties = yield select(state => state.data.counties) const cases = yield select(state => state.data.cases) const threeObjects = initializeCanvas(counties, cases) document.getElementById('earth-canvas-wrapper').append(threeObjects.renderer.domElement) yield put({type: actions.SAVE_THREE_OBJECTS, objects: threeObjects}) yield put({type: actions.INITIALIZATION_SUCCEEDED}); } catch (e) { yield put({type: actions.INITIALIZATION_FAILED, message: e.message}); } } function* rootSaga() { yield takeEvery(actions.INITIALIZATION_REQUESTED, initialize); } export default rootSaga;
/** * Created by paul on 8/26/17. * @flow */ import { Buffer } from 'buffer' import { bns } from 'biggystring' import { type EdgeCurrencyInfo, type EdgeMetaToken } from 'edge-core-js/types' import { validate } from 'jsonschema' function normalizeAddress (address: string) { return address.toLowerCase().replace('0x', '') } function addHexPrefix (value: string) { if (value.indexOf('0x') === 0) { return value } else { return '0x' + value } } function shuffleArray (array: Array<any>) { let currentIndex = array.length let temporaryValue, randomIndex // While there remain elements to shuffle... while (currentIndex !== 0) { // Pick a remaining element... randomIndex = Math.floor(Math.random() * currentIndex) currentIndex -= 1 // And swap it with the current element. temporaryValue = array[currentIndex] array[currentIndex] = array[randomIndex] array[randomIndex] = temporaryValue } return array } function validateObject (object: any, schema: any) { const result = validate(object, schema) if (result.errors.length === 0) { return true } else { for (const n in result.errors) { const errMsg = result.errors[n].message console.log('ERROR: validateObject:' + errMsg) } return false } } export function isEmpty (map: Object) { for (const key in map) { if (map.hasOwnProperty(key)) { return false } } return true } export function isHex (h: string) { const out = /^[0-9A-F]+$/i.test(h) return out } export function toHex (num: string) { return bns.add(num, '0', 16) } export function hexToBuf (hex: string) { const noHexPrefix = hex.replace('0x', '') const buf = Buffer.from(noHexPrefix, 'hex') return buf } export function bufToHex (buf: any) { const signedTxBuf = Buffer.from(buf) const hex = '0x' + signedTxBuf.toString('hex') return hex } function getDenomInfo ( currencyInfo: EdgeCurrencyInfo, denom: string, customTokens?: Array<EdgeMetaToken> ) { // Look in the primary currency denoms let edgeDenomination = currencyInfo.denominations.find(element => { return element.name === denom }) // Look in the currencyInfo tokens if (!edgeDenomination) { for (const metaToken of currencyInfo.metaTokens) { edgeDenomination = metaToken.denominations.find(element => { return element.name === denom }) if (edgeDenomination) { break } } } // Look in custom tokens if (!edgeDenomination && customTokens) { for (const metaToken of customTokens) { edgeDenomination = metaToken.denominations.find(element => { return element.name === denom }) if (edgeDenomination) { break } } } return edgeDenomination } const snoozeReject: Function = (ms: number) => new Promise((resolve: Function, reject: Function) => setTimeout(reject, ms)) const snooze: Function = (ms: number) => new Promise((resolve: Function) => setTimeout(resolve, ms)) function promiseAny (promises: Array<Promise<any>>): Promise<any> { return new Promise((resolve: Function, reject: Function) => { let pending = promises.length for (const promise of promises) { promise.then( value => { resolve(value) }, error => { return --pending || reject(error) } ) } }) } type AsyncFunction = void => Promise<any> async function asyncWaterfall ( asyncFuncs: Array<AsyncFunction>, timeoutMs: number = 5000 ): Promise<any> { let pending = asyncFuncs.length const promises: Array<Promise<any>> = [] for (const func of asyncFuncs) { const index = promises.length promises.push( func().catch(e => { e.index = index throw e }) ) if (pending > 1) { promises.push( new Promise(resolve => { snooze(timeoutMs).then(() => { resolve('async_waterfall_timed_out') }) }) ) } try { const result = await Promise.race(promises) if (result === 'async_waterfall_timed_out') { promises.pop() --pending } else { return result } } catch (e) { const i = e.index promises.splice(i, 1) promises.pop() --pending if (!pending) { throw e } } } } function getEdgeInfoServer () { return 'https://info1.edgesecure.co:8444' } export { normalizeAddress, addHexPrefix, validateObject, getDenomInfo, asyncWaterfall, snooze, shuffleArray, snoozeReject, getEdgeInfoServer, promiseAny }
const mongoose = require('mongoose') const UserSchema = new mongoose.Schema({ fname: {type: String,required: true,trim:true}, lname: {type: String,required: true,trim:true}, email: { type: String,required: true,unique: true}, profileImage:{type:String,required:true}, phone:{type:String,trim: true,required:`Phone Number is required`,unique:true}, password:{type: String,required: true,}, address:{ shipping: { street:{type:String,required:true}, city:{type:String,required:true}, pincode:{type:String,required:true} }, billing:{ street:{type:String,required:true}, city:{type:String,required:true}, pincode:{type:String,required:true} } }, createdAt:{type: Date,default: Date.now}, updatedAt:{type:Date, default:Date.now} },{ timestamps: true }) module.exports = mongoose.model('UserDBphase1', UserSchema)
#!/usr/bin/env node //用法: // webpart rename <id> <new-id> 对指定模块及所有子模块进行重命名。 //参数: // <id> 原模块 id。 // <new-id> 新模块 id。 //选项: // -a, --abbr 输出的新模块 id 是否为短名称。 //示例: // webpart rename --abbr /Login/Main Main2 //强依赖配置节点: // stat const console = require('@webpart/console'); const File = require('@definejs/file'); const Program = require('./lib/Program'); const Stat = require('./lib/Stat'); const Task = require('./rename/Task'); let { opts, config, args, program, } = Program.parse({ 'config': true, '<id> <new-id>': '', '-a, --abbr': 'abbreviate the module id.', }); if (args.length < 2) { return program.help(); } let id = args[0]; let newId = args[1]; //采用了目标模块 id 省略前缀的写法。 //例如:`webpart rename --abbr /Login/Main Main2 ` //或者:`webpart rename -a /Login/Main Main2` //等于:`webpart rename /Login/Main /Login/Main2` if (opts.abbr && id.includes('/')) { newId = id.split('/').slice(0, -1).join('/') + '/' + newId; } let stat = Stat.parse(config.stat); let list = Task.rename(stat, id, newId); if (!list) { console.log(`Rename Failed`.red); return; } list.forEach((item) => { File.write(item.file, item.newContent, null); //输出如: //rename: /Login/Main2 --> /Login/Main(htdocs/views/login/Login/Main.js) console.log(`rename:`, `${item.id}`.yellow, `-->`.green, `${item.newId}`.magenta, `(${item.file.underline.cyan})`); }); console.log('rename all done!'.bold.green);
function getInventoryAPI() { return fetch("http://localhost:3100/api/inventory") .then(res => { if (res.status === 200) { return res.json(); } }); } export function getInventory() { return getInventoryAPI().then(res => { let response = []; for (let data in res) { const inventory = res[data]; response.push( { id: inventory._id, thumbnail: inventory.thumbnail, price: inventory.price, title: inventory.name, description: inventory.description, quantity: inventory.quantity } ); } return response; }); };