text
stringlengths
2
1.05M
import React from 'react'; import createSvgIcon from './utils/createSvgIcon'; export default createSvgIcon(React.createElement(React.Fragment, null, React.createElement("path", { fill: "none", d: "M0 0h24v24H0V0z" }), React.createElement("path", { fillOpacity: ".3", d: "M22 8V2L2 22h16V8h4z" }), React.createElement("path", { d: "M20 22h2v-2h-2v2zm0-12v8h2v-8h-2z" })), 'SignalCellularConnectedNoInternet0BarSharp');
import Store from 'data/abstract_store'; QUnit.module('Abstract Store', function() { class MyStore { } QUnit.test('registerClass', function(assert) { Store.registerClass(MyStore, 'my-store'); const customStore = Store.create('my-store'); assert.ok(customStore instanceof MyStore); }); });
/** * Auto-generated action file for "Slicebox" API. * * Generated at: 2019-05-07T14:44:06.330Z * Mass generator version: 1.1.0 * * flowground :- Telekom iPaaS / slicebox-local-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: undefined * Endpoint Path: '/metadata/series/{id}/seriestags' * Method: 'get' * */ 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 = [ "id" ]; // mappings from connector field names to API field names const FIELD_MAP = { "id": "id" }; 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 = undefined; const body = msg.body; mapFieldNames(body); let parameters = {}; for(let param of PARAMETERS) { parameters[param] = body[param]; } // credentials for this operation let securities = {}; let callParams = { spec: spec, operationId: undefined, pathName: '/metadata/series/{id}/seriestags', method: 'get', 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]; } }); } }
const mqtt = require("mqtt"); const NodeHelper = require("node_helper"); var servers = []; module.exports = NodeHelper.create({ log: function (...args) { if (this.config.logging) { console.log(args); } }, start: function () { console.log(this.name + ": Starting node helper"); this.loaded = false; }, makeServerKey: function (server) { return "" + server.address + ":" + (server.port | ("1883" + server.user)); }, addServer: function (server) { console.log(this.name + ": Adding server: ", server); var serverKey = this.makeServerKey(server); var mqttServer = {}; var foundServer = false; for (i = 0; i < servers.length; i++) { if (servers[i].serverKey === serverKey) { mqttServer = servers[i]; foundServer = true; } } if (!foundServer) { mqttServer.serverKey = serverKey; mqttServer.address = server.address; mqttServer.port = server.port; mqttServer.options = {}; mqttServer.topics = []; mqttServer.payloads = []; if (server.user) mqttServer.options.username = server.user; if (server.password) mqttServer.options.password = server.password; } for (i = 0; i < server.subscriptions.length; i++) { mqttServer.topics.push(server.subscriptions[i].topic); mqttServer.payloads.push(server.subscriptions[i].payload); } servers.push(mqttServer); this.startClient(mqttServer); }, addConfig: function (config) { for (i = 0; i < config.mqttServers.length; i++) { this.addServer(config.mqttServers[i]); } }, startClient: function (server) { console.log(this.name + ": Starting client for: ", server); var self = this; var mqttServer = (server.address.match(/^mqtts?:\/\//) ? "" : "mqtt://") + server.address; if (server.port) { mqttServer = mqttServer + ":" + server.port; } console.log(self.name + ": Connecting to " + mqttServer); server.client = mqtt.connect(mqttServer, server.options); server.client.on("error", function (err) { console.log(self.name + " " + server.serverKey + ": Error: " + err); }); server.client.on("reconnect", function (err) { server.value = "reconnecting"; // Hmmm... console.log(self.name + ": " + server.serverKey + " reconnecting"); }); server.client.on("connect", function (connack) { console.log(self.name + " connected to " + mqttServer); console.log(self.name + ": subscribing to " + server.topics); server.client.subscribe(server.topics); }); server.client.on("message", (topic, payload) => { // just to make sure... (but should also work only with subscribe selection) if (server.topics.includes(topic) && server.payloads.includes(payload.toString())) { // add some debug information console.log(self.name + ": MQTT EXIT message detected"); console.log(self.name + ": intentional stopping server"); // kill server process.exit(1); } this.sendSocketNotification("MQTT_PAYLOAD", { serverKey: server.serverKey, topic: topic, value: payload.toString(), time: Date.now(), }); }); }, socketNotificationReceived: function (notification, payload) { var self = this; if (notification === "MQTT_CONFIG") { var config = payload; self.addConfig(config); self.loaded = true; } }, });
/* * @Description:过滤器 * @Version: * @Autor: 申豪强 * @Date: 2020-05-20 14:56:49 * @LastEditTime: 2020-05-26 14:37:04 */ import axios from '@/utils/axios' export default { // /添加过滤器 addBimFilter(data) { return axios.design.post('/bim/bimFilter/add', data) }, // 删除过滤器 deleteFilter(id) { return axios.design.get(`/bim/bimFilter/delete/${id}`) }, // 过滤详情 getFilterDetails(id) { return axios.design.get(`/bim/bimFilter/get/${id}`) }, // 点击按钮过滤器列表 getBimFilterList(data) { return axios.design.post('/bim/bimFilter/list', data) }, // 根据过滤器搜索 searchBimFilter(data) { return axios.design.post('/bim/bimFilter/search', data) }, // 修改过滤器 updateBimFilter(data) { return axios.design.post('/bim/bimFilter/update', data) }, // 进行过滤 goFilter(data) { return axios.bimLight.post('/feign/bim/bimFilter/search', data) } }
import styled from '@emotion/styled'; const InputGroup = styled.div` display: flex; align-items: center; height: 42px; width: 100%; `; InputGroup.defaultProps = { className: 'input-group' }; export default InputGroup;
/** * @param { import("knex").Knex } knex * @returns { Promise<void> } */ exports.seed = function (knex) { // Deletes ALL existing entries return knex('users') .del() .then(function () { // Inserts seed entries return knex('users').insert([ { auth0Id: 'auth0|1234', isSupporter: false, name: 'Sarah', dob: '2001-04-23', email: 'cheese@gmail.com', svgAvatar: '' } ]) }) }
const API = require('./API'); const ApiMap = require(`./transportResolvers/ApiMap`); const DeviceTypeListQuery = require('../models/query/DeviceTypeListQuery'); const DeviceTypeCountQuery = require('../models/query/DeviceTypeCountQuery'); const DeviceTypeDeleteQuery = require('../models/query/DeviceTypeDeleteQuery'); /** * Returns information about the current deviceType */ class DeviceTypeAPI extends API { /** * Creates DeviceTypeAPI * @param {number} deviceTypeId - Device type ID * @returns {Promise} selected deviceType */ get(deviceTypeId) { return this.send(ApiMap.getDeviceType, { deviceTypeId: deviceTypeId }); } /** * Return a list of deviceTypes * @param {DeviceTypeListQuery} deviceTypeListQuery * @returns {Promise} list of deviceTypes */ list(deviceTypeListQuery = new DeviceTypeListQuery()) { return this.send(ApiMap.listDeviceType, deviceTypeListQuery.toObject()); } /** * Returns count of deviceTypes * @param {DeviceTypeCountQuery} deviceTypeCountQuery * @returns {Promise} count of deviceTypes */ count(deviceTypeCountQuery = new DeviceTypeCountQuery()) { return this.send(ApiMap.countDeviceType, deviceTypeCountQuery.toObject()); } /** * Registers a deviceType * @param {DeviceType} deviceType data * @returns {Promise} count of deviceTypes */ insert(deviceType) { return this.send(ApiMap.addDeviceType, {}, deviceType.toObject()); } /** * Updates a deviceType * @param {DeviceType} deviceType data * @returns {Promise} count of deviceTypes */ update(deviceType) { return this.send(ApiMap.updateDeviceType, { deviceTypeId: deviceType.id }, deviceType.toObject()); } /** * Deletes an existing deviceType * @param {DeviceTypeDeleteQuery} deviceTypeDeleteQuery * @returns {Promise} */ delete(deviceTypeDeleteQuery = new DeviceTypeDeleteQuery()) { return this.send(ApiMap.deleteDeviceType, deviceTypeDeleteQuery.toObject()); } } module.exports = DeviceTypeAPI;
import React, { Component } from 'react'; import { UserSession, Person } from 'blockstack'; import NavBar from './NavBar'; import { jsonCopy, remove, add, check } from '../assets/utils'; import { appConfig, TASKS_FILENAME } from '../assets/constants'; import '../styles/Profile.css'; class Profile extends Component { constructor(props) { super(props); this.state = { tasks: [], value: '' }; this.loadTasks = this.loadTasks.bind(this); this.handleChange = this.handleChange.bind(this); this.addTask = this.addTask.bind(this); this.removeTask = this.removeTask.bind(this); this.checkTask = this.checkTask.bind(this); } componentWillMount() { this.loadTasks(); } componentWillReceiveProps(nextProps) { const nextTasks = nextProps.tasks; if (nextTasks) { if (nextTasks.length !== this.state.tasks.length) { this.setState({ tasks: jsonCopy(nextTasks) }); } } } loadTasks() { const options = { decrypt: true }; this.props.userSession.getFile(TASKS_FILENAME, options).then(content => { if (content) { const tasks = JSON.parse(content); this.setState({ tasks }); } }); } saveTasks(tasks) { const options = { encrypt: true }; this.props.userSession.putFile(TASKS_FILENAME, JSON.stringify(tasks), options); } handleChange(event) { this.setState({ value: event.target.value }); } removeTask(e) { e.preventDefault(); //fixed: undefined data-index from input const tasks = remove(e.currentTarget.dataset.index, this.state); this.setState({ tasks }); this.saveTasks(tasks); } addTask(e) { e.preventDefault(); const tasks = add(this.state); this.setState({ value: '', tasks }); this.saveTasks(tasks); } checkTask(e) { const tasks = check(e.target.dataset.index, this.state); this.setState({ tasks }); this.saveTasks(tasks); } render() { const username = this.props.userSession.loadUserData().username; const profile = this.props.userSession.loadUserData(); const person = new Person(profile); return ( <div className="Dashboard"> <NavBar username={username} user={person} signOut={this.props.handleSignOut} /> <div className="row justify-content-center" id="header"> <h3 className="user-info">{username}'s to-dos</h3> </div> <br></br> <div className="row justify-content-center"> <div id="addTask" className="frame" style={{ borderColor: '#f8f9fa' }}> <form onSubmit={this.addTask} className="input-group"> <input className="form-control" type="text" onChange={this.handleChange} value={this.state.value} required placeholder="To-do..." autoFocus={true} /> <div className="input-group-append" id="add-task"> <input type="submit" className="btn btn-primary" value="Add" /> </div> </form> </div> </div> <br></br> <div className="row justify-content-center"> <div className="frame"> {this.state.tasks.map((task, i) => ( <ul key={i}> <div className="row"> <input type="checkbox" className="form-check-input" data-index={i} onChange={this.checkTask} checked={task[1]} ></input> <div className="col"> <span className="input-group-text"> <div className="task">{task[1] ? <s>{task[0]}</s> : task[0]}</div> <div className="delete"> <button className="btn btn-primary" data-index={i} onClick={this.removeTask} > <div className="X" data-index={i}> X </div> </button> </div> </span> </div> </div> </ul> ))} </div> </div> </div> ); } } // Made this a default prop (instead of using this.userSession) so a dummy userSession // can be passed in for testing purposes Profile.defaultProps = { userSession: new UserSession(appConfig) }; export default Profile;
/** * Helper to manage className attribute on node or nodelist * eg. * removeClass(el, 'myClass'); or * addClass(document.querySelectorAll('li'), 'list-item'); or * hasClass(el, 'is-open'); */ export function addClass(node, classString) { if (node.length) { return Array.prototype.forEach(node, (el) => { addClass(el, classString); }); } const classList = node.className.split(' '); const classNames = classString.split(' '); classNames.forEach((className) => { if (classList.indexOf(className) < 0) { classList.push(className); } }); node.setAttribute('class', classList.join(' ')); } export function removeClass(node, classString) { if (node.length) { return Array.prototype.forEach(node, (el) => { removeClass(el, classString); }); } const classNames = classString.split(' '); const classList = node.className.split(' ').filter((className) => { const match = (classNames.indexOf(className) > -1); return !match; }); node.setAttribute('class', classList.join(' ')); } export function hasClass(node, classString) { const classList = node.className.split(' '); const classNames = classString.split(' '); let exists = true; classNames.forEach((className) => { if (classList.indexOf(className) < 0) { exists = false; } }); return exists; } export default { addClass, removeClass, hasClass, add: addClass, remove: removeClass, has: hasClass, };
const Attachment = require('discord.js').Attachment; const apiService = require('../services/api-service'); const relink = require('./relink'); module.exports = { name: 'migrate-all', args: false, ownerOnly: true, cooldown: 3, sortIndex: 0, usage: '', execute: async function (message, args) { let stickers = await apiService.getAll(); stickers = stickers.filter(s => s.url.includes('imgur') && s.useCount > 0); if (stickers && stickers.length > 0) { for (let i = 0; i < stickers.length; ++i) { const sticker = stickers[i]; message.channel.send(`Migrating ${sticker.keyword} to discord...`); message.channel.send(new Attachment(sticker.url)) .then((msg) => { relink.execute(msg, [sticker.keyword, msg.attachments.first().url ]) }) .catch((error) => { msg.channel.send('Migration failed.'); console.error(error); }); } } else { message.channel.send(`There's nothing to migrate.`); } } };
import Ember from 'ember'; export default Ember.Route.extend({ title() { let stack = this.modelFor('stack'); return `${stack.get('handle')} Certificates`; }, model() { let stack = this.modelFor('stack'); return stack.get('certificates'); }, setupController(controller, model) { let stack = this.modelFor('stack'); controller.setProperties({ model, stack }); }, actions: { openCreateCertificateModal() { let stack = this.modelFor('stack'); this.controller.set('newCertificate', this.store.createRecord('certificate', { stack })); }, onCreateCertificate(certificate) { let stack = this.modelFor('stack'); certificate.save({ stack: {id: stack.get('id') } }).then(() => { let message = `${certificate.get('commonName')} created.`; this.transitionTo('certificates.index'); Ember.get(this, 'flashMessages').success(message); }); }, delete(model) { // Confirm... let confirmMsg = `\nAre you sure you want to delete ${model.get('commonName')}?\n`; if (!confirm(confirmMsg)) { return false; } let stack = model.get('stack'); model.deleteRecord(); model.save().then(() => { let message = `${model.get('commonName')} certificate destroyed`; this.transitionTo('certificates', stack); Ember.get(this, 'flashMessages').success(message); }); } } });
!function(i){const e=i.lt=i.lt||{};e.dictionary=Object.assign(e.dictionary||{},{"%0 of %1":"","Align center":"Centruoti","Align left":"Lygiuoti į kairę","Align right":"Lygiuoti į dešinę","Block quote":"Citata",Bold:"Paryškintas","Bulleted List":"Sąrašas",Cancel:"Atšaukti","Cannot upload file:":"Negalima įkelti failo:","Centered image":"Vaizdas centre","Change image text alternative":"Pakeisti vaizdo alternatyvųjį tekstą","Choose heading":"Pasirinkite antraštę",Column:"Stulpelis","Decrease indent":"Sumažinti atitraukimą","Delete column":"Ištrinti stulpelį","Delete row":"Ištrinti eilutę",Downloadable:"","Dropdown toolbar":"","Edit link":"Keisti nuorodą","Editor toolbar":"","Enter image caption":"Įveskite vaizdo antraštę","Full size image":"Pilno dydžio vaizdas","Header column":"Antraštės stulpelis","Header row":"Antraštės eilutė",Heading:"Antraštė","Heading 1":"Antraštė 1","Heading 2":"Antraštė 2","Heading 3":"Antraštė 3","Heading 4":"Antraštė 4","Heading 5":"Antraštė 5","Heading 6":"Antraštė 6","Image toolbar":"","image widget":"vaizdų valdiklis","Increase indent":"Padidinti atitraukimą","Insert column left":"Įterpti stulpelį kairėje","Insert column right":"Įterpti stulpelį dešinėje","Insert image":"Įterpti vaizdą","Insert row above":"Įterpti eilutę aukščiau","Insert row below":"Įterpti eilutę žemiau","Insert table":"Įterpti lentelę",Italic:"Kursyvas",Justify:"Lygiuoti per visą plotį","Left aligned image":"Vaizdas kairėje",Link:"Pridėti nuorodą","Link URL":"Nuorodos URL","Merge cell down":"Prijungti langelį apačioje","Merge cell left":"Prijungti langelį kairėje","Merge cell right":"Prijungti langelį dešinėje","Merge cell up":"Prijungti langelį viršuje","Merge cells":"Sujungti langelius",Next:"","Numbered List":"Numeruotas rąrašas","Open in a new tab":"","Open link in new tab":"Atidaryti nuorodą naujame skirtuke",Paragraph:"Paragrafas",Previous:"",Redo:"Pirmyn","Rich Text Editor":"Raiškiojo teksto redaktorius","Rich Text Editor, %0":"Raiškiojo teksto redaktorius, %0","Right aligned image":"Vaizdas dešinėje",Row:"Eilutė",Save:"Išsaugoti","Select column":"","Select row":"","Show more items":"","Side image":"Vaizdas šone","Split cell horizontally":"Padalinti langelį horizontaliai","Split cell vertically":"Padalinti langelį vertikaliai","Table toolbar":"","Text alignment":"Teksto lygiavimas","Text alignment toolbar":"","Text alternative":"Alternatyvusis tekstas","This link has no URL":"Ši nuorda neturi URL",Undo:"Atgal",Unlink:"Pašalinti nuorodą","Upload failed":"Įkelti nepavyko","Upload in progress":"Įkelima"}),e.getPluralForm=function(i){return i%10==1&&(i%100>19||i%100<11)?0:i%10>=2&&i%10<=9&&(i%100>19||i%100<11)?1:i%1!=0?2:3}}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
'use strict' class Checkout { constructor () { const $ = document.querySelector.bind(document) // props this.cardNumber = $('#numero-do-cartao-front') this.cardNumberBack = $('#numero-do-cartao-back') this.cardName = $('#nome-front') this.cardNameBack = $('#nome-back') this.cardDate = $('#data-front') this.cardDateBack = $('#data-back') this.cardBack = $('#cartao-back') this.areaTitle = $('#titulo-area') this.cardAreaTitle = $('#card-area-titulo') this.areaButton = $('#button-area') this.flipper = $('#flipper') this.littleMachine = $('#maquininha') this.niceEdge = $('#bordinha-nice') this.successFeedback = $('#feedback-sucesso') this.total = $('#total') this.willDisappearAll = document.querySelectorAll('.vai-sumir') this.willDisappear = $('.vai-sumir') // methods this.scrolTop = this.scrolTop.bind(this) this.secondStep = this.secondStep.bind(this) this.submit = this.submit.bind(this) } scrolTop () { window.scroll({ top: 0, left: 0, behavior: 'smooth' }) } secondStep () { this.littleMachine.addEventListener('transitionend', () => { this.littleMachine.style.cssText = ` height:auto; z-index: 999; padding: 50px 35px 90px 35px; width: 80%; margin:0px auto; background: #362563; background: -moz-linear-gradient(360deg, #362563 0%, #4b2563 100%); background: -webkit-linear-gradient(360deg, #362563 0%,#4b2563 100%); background: linear-gradient(360deg, #362563 0%,#4b2563 100%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#362563', endColorstr='#4b2563',GradientType=1 ); border-bottom: 6px solid #20163d; box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.45); ` this.niceEdge.style.opacity = '1' }) this.flipper.addEventListener('animationend', () => { this.successFeedback.classList.add('confirmado') }) } submit () { this.littleMachine.style.height = `${this.littleMachine.offsetHeight}px` this.scrolTop() this.cardNumberBack.insertAdjacentHTML('afterbegin', this.cardNumber.value) this.cardNameBack.insertAdjacentHTML('afterbegin', this.cardName.value.toUpperCase()) this.cardDateBack.insertAdjacentHTML('afterbegin', this.cardDate.value) this.cardAreaTitle.classList.add('fadeOut') this.areaTitle.classList.add('fadeOut') this.areaButton.classList.add('fadeOut') this.flipper.classList.add('anima-flipper') this.cardBack.classList.add('anima-cartao-back') this.littleMachine.classList.add('animacao-maquininha') this.cardBack.addEventListener('animationend', () => { this.willDisappearAll.forEach(item => { item.style.animation = 'vaiSumir 300ms both' }) this.willDisappear.addEventListener('animationend', () => { this.willDisappearAll.forEach(item => item.remove()) this.total.style.cssText = 'padding:15px; border:2px solid rgba(255,255,255,0.7); border-radius:4px;' this.littleMachine.style.height = '100px' this.secondStep() }, false) }, false) } } export default Checkout
var plugins = require('electron-plugins'), ipc = require('electron').ipcMain; document.addEventListener('DOMContentLoaded', function () { var context = { document: document } plugins.load(context, function (err, loaded) { if(err) return console.error(err) console.log('Plugins loaded successfully.') }); var electronScreen = require('screen'); var webFrame = require('web-frame'); var size = electronScreen.getPrimaryDisplay().workAreaSize; function log2(number) { return Math.log(number) / Math.log(2); } webFrame.setZoomFactor(Math.floor(log2((size.width*size.height)/(800*600)))); }) ipc.on('update-available', function () { console.log('there is an update available for download') })
/** * This file purpose is just to write `src/assets/version.json` file that * contains current version information about this application. This file * is executed on `postinstall` process. * * This static file will be used later on to check if frontend application * has been updated during user has been used it without reloading page * itself. */ 'use strict'; const fs = require('fs'); const data = { version: require('./package.json').version, }; fs.writeFile('./src/assets/version.json', JSON.stringify(data, null, ' ') + '\n', (error) => { if (error) { throw error; } });
import React from "react"; import axios from "axios"; import { withRouter } from "react-router"; import { NavLink } from "react-router-dom"; const NavigationComponent = props => { const dynamicLink = (route, linkText) => { return ( <div className="nav-link-wrapper"> <NavLink to={route} activeClassName="nav-link-active"> {linkText} </NavLink> </div> ); }; const handleSignOut = () => { axios .delete("https://api.devcamp.space/logout", { withCredentials: true }) .then(response => { if (response.status === 200) { props.history.push("/"); props.handleSuccessfulLogout(); } return response.data; }) .catch(error => { console.log("Error signing out", error); }); }; return ( <div className="nav-wrapper"> <div className="left-side"> <div className="nav-link-wrapper"> <NavLink exact to="/" activeClassName="nav-link-active"> Home </NavLink> </div> <div className="nav-link-wrapper"> <NavLink to="/about-me" activeClassName="nav-link-active"> About </NavLink> </div> <div className="nav-link-wrapper"> <NavLink to="/contact" activeClassName="nav-link-active"> Contact </NavLink> </div> <div className="nav-link-wrapper"> <NavLink to="/blog" activeClassName="nav-link-active"> Blog </NavLink> </div> {props.loggedInStatus === "LOGGED_IN" ? ( dynamicLink("/portfolio-manager", "Portfolio Manager") ) : null} </div> <div className="right-side"> CAMI GARRETT {props.loggedInStatus === "LOGGED_IN" ? ( <a onClick={handleSignOut}><i class="far fa-times-circle"></i></a> ) : null} </div> </div> ); }; export default withRouter(NavigationComponent);
var https = require('https'); var solrApi={ getRequestParam: function(options){ var requestParam={ "search_intent": options.search_intent, "min_inr": options.minRent, "max_inr": options.maxrent,// "house_type": options.houseTypes, "bed_rooms": options.bedRooms, "page": 1, "city": options.cityName, "show_ungrouped_results": 0,//? "physically_verified": 0,//? "bachelors_allowed": "", //? "time_stamp": options.time_stamp, "request_id": options.request_id, "fetch_max": 1, "number_of_children": "2", "mapBounds": [options.lat1, options.lng1, options.lat2, options.lng2], "srtby": "bestquality", "page_size": 30 }; return requestParam; }, getJsonDataFromUrl: function (options, callback) { var http = require('http'); var req = http.request(options, function(res){ var responseString = ''; res.setEncoding('utf-8'); var responseString = ''; res.on('data', function(data) { responseString += data; }); res.on('end', function() { callback(null, responseString); }); }); req.on('error', callback); req.end(); }, getJsonData: function (options, callback) { var dataString = JSON.stringify(this.getRequestParam(options)); var headers = { 'Content-Type': 'application/json', 'Content-Length': dataString.length }; var requestOptions = { host: "www.commonfloor.com", path: "/nitro/search/search-results", method: "POST", headers: headers }; var req = https.request(requestOptions, function(res) { res.setEncoding('utf-8'); var responseString = ''; res.on('data', function(data) { responseString += data; }); res.on('end', function() { callback(null, responseString); }); }); req.on('error', callback); req.end(dataString); } } module.exports=solrApi;
import React, { memo, useMemo, useCallback } from "react"; import { View, StyleSheet } from "react-native"; import type { App } from "@ledgerhq/live-common/lib/types/manager"; import type { State, Action } from "@ledgerhq/live-common/lib/apps"; import { useNotEnoughMemoryToInstall } from "@ledgerhq/live-common/lib/apps/react"; import { Trans } from "react-i18next"; import { useTheme } from "@react-navigation/native"; import LText from "../../../components/LText"; import Touchable from "../../../components/Touchable"; import Warning from "../../../icons/Warning"; import AppIcon from "./AppIcon"; import AppStateButton from "./AppStateButton"; import ByteSize from "../../../components/ByteSize"; type Props = { app: App, state: State, dispatch: Action => void, isInstalledView: boolean, setAppInstallWithDependencies: ({ app: App, dependencies: App[] }) => void, setAppUninstallWithDependencies: ({ dependents: App[], app: App }) => void, setStorageWarning: () => void, managerTabs: *, optimisticState: State, }; const AppRow = ({ app, state, dispatch, isInstalledView, setAppInstallWithDependencies, setAppUninstallWithDependencies, setStorageWarning, optimisticState, }: Props) => { const { name, bytes, version: appVersion, displayName } = app; const { installed, deviceInfo } = state; const isInstalled = useMemo(() => installed.find(i => i.name === name), [ installed, name, ]); const version = (isInstalled && isInstalled.version) || appVersion; const availableVersion = (isInstalled && isInstalled.availableVersion) || appVersion; const notEnoughMemoryToInstall = useNotEnoughMemoryToInstall( optimisticState, name, ); const onSizePress = useCallback(() => setStorageWarning(name), [ setStorageWarning, name, ]); const { colors } = useTheme(); return ( <View style={styles.root}> <View style={[ styles.item, { backgroundColor: colors.card, borderBottomColor: colors.lightFog, }, ]} > <AppIcon app={app} /> <View style={styles.labelContainer}> <LText numberOfLines={1} bold> {displayName} </LText> <LText numberOfLines={1} style={styles.versionText} color="grey"> {version}{" "} {isInstalled && !isInstalled.updated && ( <Trans i18nKey="manager.appList.versionNew" values={{ newVersion: availableVersion !== version ? ` ${availableVersion}` : "", }} /> )} </LText> </View> {!isInstalled && notEnoughMemoryToInstall ? ( <Touchable activeOpacity={0.5} onPress={onSizePress} style={styles.warnText} event="ManagerAppNotEnoughMemory" eventProperties={{ appName: name }} > <Warning size={16} color={colors.lightOrange} /> <LText semiBold style={[styles.versionText, styles.sizeText, styles.warnText]} color="grey" > <ByteSize value={bytes} deviceModel={state.deviceModel} firmwareVersion={deviceInfo.version} formatFunction={Math.ceil} /> </LText> </Touchable> ) : ( <LText style={[ styles.versionText, styles.sizeText, notEnoughMemoryToInstall ? styles.warnText : {}, ]} color={notEnoughMemoryToInstall ? "lightOrange" : "grey"} > <ByteSize value={bytes} deviceModel={state.deviceModel} firmwareVersion={deviceInfo.version} formatFunction={Math.ceil} /> </LText> )} <AppStateButton app={app} state={state} dispatch={dispatch} notEnoughMemoryToInstall={notEnoughMemoryToInstall} isInstalled={!!isInstalled} isInstalledView={isInstalledView} setAppInstallWithDependencies={setAppInstallWithDependencies} setAppUninstallWithDependencies={setAppUninstallWithDependencies} /> </View> </View> ); }; const styles = StyleSheet.create({ root: { height: 64, }, item: { flexDirection: "row", alignItems: "center", justifyContent: "flex-start", paddingVertical: 14, paddingHorizontal: 16, borderRadius: 0, height: 64, borderBottomWidth: 1, }, labelContainer: { flexGrow: 0, flexShrink: 1, flexBasis: "40%", flexDirection: "column", alignItems: "flex-start", justifyContent: "center", paddingHorizontal: 10, }, versionText: { fontSize: 12, fontWeight: "bold", }, sizeText: { fontSize: 12, width: 44, marginHorizontal: 10, }, warnText: { flexDirection: "row", alignItems: "center", justifyContent: "center", }, installedLabel: { flexGrow: 1, flexShrink: 0, flexBasis: "auto", flexDirection: "row", alignItems: "center", justifyContent: "flex-end", borderRadius: 4, overflow: "hidden", paddingHorizontal: 10, }, appButton: { flexGrow: 1, flexShrink: 0, flexBasis: "auto", alignItems: "flex-start", height: 38, paddingHorizontal: 10, paddingVertical: 12, zIndex: 5, }, }); export default memo(AppRow);
const resources = { state: { resources:{ } }, mutations: { SET_RESOURCE (state, obj){ if(obj.resources) state.resources[obj.menuId] = obj.resources } }, actions:{ setResources({ commit }, obj){ commit('SET_RESOURCE', obj) } } } export default resources
"use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var e=t(require("jsbi")),n=require("@uniswap/sdk-core"),r=t(require("tiny-invariant")),o=require("@ethersproject/solidity"),u=require("@ethersproject/address"),i="0xe507440624a5a47d3ef89b2702932ed0707cd426503dcb9d7e5dc672a9b19816",s=e.BigInt(1e3),a=e.BigInt(0),c=e.BigInt(1),p=e.BigInt(5),l=e.BigInt(997),f=e.BigInt(1e3);function d(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function m(t,e,n){return e&&d(t.prototype,e),n&&d(t,n),t}function h(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function y(t){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function v(t,e){return(v=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function T(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function A(t,e,n){return(A=T()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var o=new(Function.bind.apply(t,r));return n&&v(o,n.prototype),o}).apply(null,arguments)}function q(t){var e="function"==typeof Map?new Map:void 0;return(q=function(t){if(null===t||-1===Function.toString.call(t).indexOf("[native code]"))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return A(t,arguments,y(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),v(n,t)})(t)}function k(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function g(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function w(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return g(t,void 0);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?g(t,void 0):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=t[Symbol.iterator]()).next.bind(n)}var E="setPrototypeOf"in Object,I=function(t){function e(){var n;return(n=t.call(this)||this).isInsufficientReservesError=!0,n.name=n.constructor.name,E&&Object.setPrototypeOf(k(n),(this instanceof e?this.constructor:void 0).prototype),n}return h(e,t),e}(q(Error)),x=function(t){function e(){var n;return(n=t.call(this)||this).isInsufficientInputAmountError=!0,n.name=n.constructor.name,E&&Object.setPrototypeOf(k(n),(this instanceof e?this.constructor:void 0).prototype),n}return h(e,t),e}(q(Error)),b=function(t){var e=t.factoryAddress,n=t.tokenA,r=t.tokenB,s=n.sortsBefore(r)?[n,r]:[r,n];return u.getCreate2Address(e,o.keccak256(["bytes"],[o.pack(["address","address"],[s[0].address,s[1].address])]),i)},O=function(){function t(e,r){var o=e.currency.sortsBefore(r.currency)?[e,r]:[r,e];this.liquidityToken=new n.Token(o[0].currency.chainId,t.getAddress(o[0].currency,o[1].currency),18,"UNI-V2","Uniswap V2"),this.tokenAmounts=o}t.getAddress=function(t,e){return b({factoryAddress:"0x49b5d05c82E045E2fEE9f5eEfDDD45B415D773B7",tokenA:t,tokenB:e})};var o=t.prototype;return o.involvesToken=function(t){return t.equals(this.token0)||t.equals(this.token1)},o.priceOf=function(t){return this.involvesToken(t)||r(!1),t.equals(this.token0)?this.token0Price:this.token1Price},o.reserveOf=function(t){return this.involvesToken(t)||r(!1),t.equals(this.token0)?this.reserve0:this.reserve1},o.getOutputAmount=function(o){if(this.involvesToken(o.currency)||r(!1),e.equal(this.reserve0.quotient,a)||e.equal(this.reserve1.quotient,a))throw new I;var u=this.reserveOf(o.currency),i=this.reserveOf(o.currency.equals(this.token0)?this.token1:this.token0),s=e.multiply(o.quotient,l),c=e.multiply(s,i.quotient),p=e.add(e.multiply(u.quotient,f),s),d=n.CurrencyAmount.fromRawAmount(o.currency.equals(this.token0)?this.token1:this.token0,e.divide(c,p));if(e.equal(d.quotient,a))throw new x;return[d,new t(u.add(o),i.subtract(d))]},o.getInputAmount=function(o){if(this.involvesToken(o.currency)||r(!1),e.equal(this.reserve0.quotient,a)||e.equal(this.reserve1.quotient,a)||e.greaterThanOrEqual(o.quotient,this.reserveOf(o.currency).quotient))throw new I;var u=this.reserveOf(o.currency),i=this.reserveOf(o.currency.equals(this.token0)?this.token1:this.token0),s=e.multiply(e.multiply(i.quotient,o.quotient),f),p=e.multiply(e.subtract(u.quotient,o.quotient),l),d=n.CurrencyAmount.fromRawAmount(o.currency.equals(this.token0)?this.token1:this.token0,e.add(e.divide(s,p),c));return[d,new t(i.add(d),u.subtract(o))]},o.getLiquidityMinted=function(t,o,u){t.currency.equals(this.liquidityToken)||r(!1);var i,c=o.currency.sortsBefore(u.currency)?[o,u]:[u,o];if(c[0].currency.equals(this.token0)&&c[1].currency.equals(this.token1)||r(!1),e.equal(t.quotient,a))i=e.subtract(n.sqrt(e.multiply(c[0].quotient,c[1].quotient)),s);else{var p=e.divide(e.multiply(c[0].quotient,t.quotient),this.reserve0.quotient),l=e.divide(e.multiply(c[1].quotient,t.quotient),this.reserve1.quotient);i=e.lessThanOrEqual(p,l)?p:l}if(!e.greaterThan(i,a))throw new x;return n.CurrencyAmount.fromRawAmount(this.liquidityToken,i)},o.getLiquidityValue=function(t,o,u,i,s){var c;if(void 0===i&&(i=!1),this.involvesToken(t)||r(!1),o.currency.equals(this.liquidityToken)||r(!1),u.currency.equals(this.liquidityToken)||r(!1),e.lessThanOrEqual(u.quotient,o.quotient)||r(!1),i){s||r(!1);var l=e.BigInt(s);if(e.equal(l,a))c=o;else{var f=n.sqrt(e.multiply(this.reserve0.quotient,this.reserve1.quotient)),d=n.sqrt(l);if(e.greaterThan(f,d)){var m=e.multiply(o.quotient,e.subtract(f,d)),h=e.add(e.multiply(f,p),d),y=e.divide(m,h);c=o.add(n.CurrencyAmount.fromRawAmount(this.liquidityToken,y))}else c=o}}else c=o;return n.CurrencyAmount.fromRawAmount(t,e.divide(e.multiply(u.quotient,this.reserveOf(t).quotient),c.quotient))},m(t,[{key:"token0Price",get:function(){var t=this.tokenAmounts[1].divide(this.tokenAmounts[0]);return new n.Price(this.token0,this.token1,t.denominator,t.numerator)}},{key:"token1Price",get:function(){var t=this.tokenAmounts[0].divide(this.tokenAmounts[1]);return new n.Price(this.token1,this.token0,t.denominator,t.numerator)}},{key:"chainId",get:function(){return this.token0.chainId}},{key:"token0",get:function(){return this.tokenAmounts[0].currency}},{key:"token1",get:function(){return this.tokenAmounts[1].currency}},{key:"reserve0",get:function(){return this.tokenAmounts[0]}},{key:"reserve1",get:function(){return this.tokenAmounts[1]}}]),t}(),P=function(){function t(t,e,n){this._midPrice=null,t.length>0||r(!1);var o=t[0].chainId;t.every((function(t){return t.chainId===o}))||r(!1);var u=e.wrapped;t[0].involvesToken(u)||r(!1),void 0===n||t[t.length-1].involvesToken(n.wrapped)||r(!1);for(var i,s=[u],a=w(t.entries());!(i=a()).done;){var c=i.value,p=c[1],l=s[c[0]];l.equals(p.token0)||l.equals(p.token1)||r(!1);var f=l.equals(p.token0)?p.token1:p.token0;s.push(f)}this.pairs=t,this.path=s,this.input=e,this.output=n}return m(t,[{key:"midPrice",get:function(){if(null!==this._midPrice)return this._midPrice;for(var t,e=[],r=w(this.pairs.entries());!(t=r()).done;){var o=t.value,u=o[1];e.push(this.path[o[0]].equals(u.token0)?new n.Price(u.reserve0.currency,u.reserve1.currency,u.reserve0.quotient,u.reserve1.quotient):new n.Price(u.reserve1.currency,u.reserve0.currency,u.reserve1.quotient,u.reserve0.quotient))}var i=e.slice(1).reduce((function(t,e){return t.multiply(e)}),e[0]);return this._midPrice=new n.Price(this.input,this.output,i.denominator,i.numerator)}},{key:"chainId",get:function(){return this.pairs[0].chainId}}]),t}();function _(t,e){return t.inputAmount.currency.equals(e.inputAmount.currency)||r(!1),t.outputAmount.currency.equals(e.outputAmount.currency)||r(!1),t.outputAmount.equalTo(e.outputAmount)?t.inputAmount.equalTo(e.inputAmount)?0:t.inputAmount.lessThan(e.inputAmount)?-1:1:t.outputAmount.lessThan(e.outputAmount)?1:-1}function C(t,e){var n=_(t,e);return 0!==n?n:t.priceImpact.lessThan(e.priceImpact)?-1:t.priceImpact.greaterThan(e.priceImpact)?1:t.route.path.length-e.route.path.length}var R=function(){function t(t,e,o){this.route=t,this.tradeType=o;var u=new Array(t.path.length);if(o===n.TradeType.EXACT_INPUT){e.currency.equals(t.input)||r(!1),u[0]=e.wrapped;for(var i=0;i<t.path.length-1;i++){var s=t.pairs[i].getOutputAmount(u[i]);u[i+1]=s[0]}this.inputAmount=n.CurrencyAmount.fromFractionalAmount(t.input,e.numerator,e.denominator),this.outputAmount=n.CurrencyAmount.fromFractionalAmount(t.output,u[u.length-1].numerator,u[u.length-1].denominator)}else{e.currency.equals(t.output)||r(!1),u[u.length-1]=e.wrapped;for(var a=t.path.length-1;a>0;a--){var c=t.pairs[a-1].getInputAmount(u[a]);u[a-1]=c[0]}this.inputAmount=n.CurrencyAmount.fromFractionalAmount(t.input,u[0].numerator,u[0].denominator),this.outputAmount=n.CurrencyAmount.fromFractionalAmount(t.output,e.numerator,e.denominator)}this.executionPrice=new n.Price(this.inputAmount.currency,this.outputAmount.currency,this.inputAmount.quotient,this.outputAmount.quotient),this.priceImpact=n.computePriceImpact(t.midPrice,this.inputAmount,this.outputAmount)}t.exactIn=function(e,r){return new t(e,r,n.TradeType.EXACT_INPUT)},t.exactOut=function(e,r){return new t(e,r,n.TradeType.EXACT_OUTPUT)};var e=t.prototype;return e.minimumAmountOut=function(t){if(t.lessThan(a)&&r(!1),this.tradeType===n.TradeType.EXACT_OUTPUT)return this.outputAmount;var e=new n.Fraction(c).add(t).invert().multiply(this.outputAmount.quotient).quotient;return n.CurrencyAmount.fromRawAmount(this.outputAmount.currency,e)},e.maximumAmountIn=function(t){if(t.lessThan(a)&&r(!1),this.tradeType===n.TradeType.EXACT_INPUT)return this.inputAmount;var e=new n.Fraction(c).add(t).multiply(this.inputAmount.quotient).quotient;return n.CurrencyAmount.fromRawAmount(this.inputAmount.currency,e)},t.bestTradeExactIn=function(e,o,u,i,s,c,p){var l=void 0===i?{}:i,f=l.maxNumResults,d=void 0===f?3:f,m=l.maxHops,h=void 0===m?3:m;void 0===s&&(s=[]),void 0===c&&(c=o),void 0===p&&(p=[]),e.length>0||r(!1),h>0||r(!1),o===c||s.length>0||r(!1);for(var y=c.wrapped,v=u.wrapped,T=0;T<e.length;T++){var A=e[T];if((A.token0.equals(y.currency)||A.token1.equals(y.currency))&&!A.reserve0.equalTo(a)&&!A.reserve1.equalTo(a)){var q=void 0;try{q=A.getOutputAmount(y)[0]}catch(t){if(t.isInsufficientInputAmountError)continue;throw t}if(q.currency.equals(v))n.sortedInsert(p,new t(new P([].concat(s,[A]),o.currency,u),o,n.TradeType.EXACT_INPUT),d,C);else if(h>1&&e.length>1){var k=e.slice(0,T).concat(e.slice(T+1,e.length));t.bestTradeExactIn(k,o,u,{maxNumResults:d,maxHops:h-1},[].concat(s,[A]),q,p)}}}return p},e.worstExecutionPrice=function(t){return new n.Price(this.inputAmount.currency,this.outputAmount.currency,this.maximumAmountIn(t).quotient,this.minimumAmountOut(t).quotient)},t.bestTradeExactOut=function(e,o,u,i,s,c,p){var l=void 0===i?{}:i,f=l.maxNumResults,d=void 0===f?3:f,m=l.maxHops,h=void 0===m?3:m;void 0===s&&(s=[]),void 0===c&&(c=u),void 0===p&&(p=[]),e.length>0||r(!1),h>0||r(!1),u===c||s.length>0||r(!1);for(var y=c.wrapped,v=o.wrapped,T=0;T<e.length;T++){var A=e[T];if((A.token0.equals(y.currency)||A.token1.equals(y.currency))&&!A.reserve0.equalTo(a)&&!A.reserve1.equalTo(a)){var q=void 0;try{q=A.getInputAmount(y)[0]}catch(t){if(t.isInsufficientReservesError)continue;throw t}if(q.currency.equals(v))n.sortedInsert(p,new t(new P([A].concat(s),o,u.currency),u,n.TradeType.EXACT_OUTPUT),d,C);else if(h>1&&e.length>1){var k=e.slice(0,T).concat(e.slice(T+1,e.length));t.bestTradeExactOut(k,o,u,{maxNumResults:d,maxHops:h-1},[A].concat(s),q,p)}}}return p},t}();function S(t){return"0x"+t.quotient.toString(16)}var D=function(){function t(){}return t.swapCallParameters=function(t,e){var o=t.inputAmount.currency.isNative,u=t.outputAmount.currency.isNative;o&&u&&r(!1),!("ttl"in e)||e.ttl>0||r(!1);var i,s,a,c=n.validateAndParseAddress(e.recipient),p=S(t.maximumAmountIn(e.allowedSlippage)),l=S(t.minimumAmountOut(e.allowedSlippage)),f=t.route.path.map((function(t){return t.address})),d="ttl"in e?"0x"+(Math.floor((new Date).getTime()/1e3)+e.ttl).toString(16):"0x"+e.deadline.toString(16),m=Boolean(e.feeOnTransfer);switch(t.tradeType){case n.TradeType.EXACT_INPUT:o?(i=m?"swapExactETHForTokensSupportingFeeOnTransferTokens":"swapExactETHForTokens",s=[l,f,c,d],a=p):u?(i=m?"swapExactTokensForETHSupportingFeeOnTransferTokens":"swapExactTokensForETH",s=[p,l,f,c,d],a="0x0"):(i=m?"swapExactTokensForTokensSupportingFeeOnTransferTokens":"swapExactTokensForTokens",s=[p,l,f,c,d],a="0x0");break;case n.TradeType.EXACT_OUTPUT:m&&r(!1),o?(i="swapETHForExactTokens",s=[l,f,c,d],a=p):u?(i="swapTokensForExactETH",s=[l,p,f,c,d],a="0x0"):(i="swapTokensForExactTokens",s=[l,p,f,c,d],a="0x0")}return{methodName:i,args:s,value:a}},t}();exports.FACTORY_ADDRESS="0x49b5d05c82E045E2fEE9f5eEfDDD45B415D773B7",exports.FACTORY_ADDRESS_FUTURIZE="0x49b5d05c82E045E2fEE9f5eEfDDD45B415D773B7",exports.FACTORY_ADDRESS_UNISWAP="0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f",exports.INIT_CODE_HASH=i,exports.INIT_CODE_HASH_FUTURIZE="0xe507440624a5a47d3ef89b2702932ed0707cd426503dcb9d7e5dc672a9b19816",exports.INIT_CODE_HASH_UNISWAP="0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f",exports.InsufficientInputAmountError=x,exports.InsufficientReservesError=I,exports.MINIMUM_LIQUIDITY=s,exports.Pair=O,exports.Route=P,exports.Router=D,exports.Trade=R,exports.computePairAddress=b,exports.inputOutputComparator=_,exports.tradeComparator=C; //# sourceMappingURL=v2-sdk.cjs.production.min.js.map
/** * Copyright 2016 The AMP HTML Authors. 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 * * 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. */ // Need the following side-effect import because in actual production code, // Fast Fetch impls are always loaded via an AmpAd tag, which means AmpAd is // always available for them. However, when we test an impl in isolation, // AmpAd is not loaded already, so we need to load it separately. import '../../../amp-ad/0.1/amp-ad'; import '../../../amp-ad/0.1/amp-ad-xorigin-iframe-handler'; import * as sinon from 'sinon'; import {AMP_SIGNATURE_HEADER} from '../signature-verifier'; import {FetchMock, networkFailure} from './fetch-mock'; import {MockA4AImpl, TEST_URL} from './utils'; import {createIframePromise} from '../../../../testing/iframe'; import {getA4ARegistry} from '../../../../ads/_a4a-config'; import {installCryptoService} from '../../../../src/service/crypto-impl'; import {installDocService} from '../../../../src/service/ampdoc-impl'; import {loadPromise} from '../../../../src/event-helper'; import { resetScheduledElementForTesting, upgradeOrRegisterElement, } from '../../../../src/service/custom-element-registry'; import {signingServerURLs} from '../../../../ads/_a4a-config'; import { data as validCSSAmp, } from './testdata/valid_css_at_rules_amp.reserialized'; // Integration tests for A4A. These stub out accesses to the outside world // (e.g., XHR requests and interfaces to ad network-specific code), but // otherwise test the complete A4A flow, without making assumptions about // the structure of that flow. /** * Checks various consistency properties on the friendly iframe created by * A4A privileged path rendering. Note that this returns a Promise, so its * value must be returned from any test invoking it. * * @param {!Element} element amp-ad element to examine. * @param {string} srcdoc A string that must occur somewhere in the friendly * iframe `srcdoc` attribute. * @return {!Promise} Promise that executes assertions on friendly * iframe contents. */ function expectRenderedInFriendlyIframe(element, srcdoc) { expect(element, 'ad element').to.be.ok; const child = element.querySelector('iframe[srcdoc]'); expect(child, 'iframe child').to.be.ok; expect(child.getAttribute('srcdoc')).to.contain.string(srcdoc); return loadPromise(child).then(() => { const childDocument = child.contentDocument.documentElement; expect(childDocument, 'iframe doc').to.be.ok; expect(element, 'ad tag').to.be.visible; expect(child, 'iframe child').to.be.visible; expect(childDocument, 'ad creative content doc').to.be.visible; }); } function expectRenderedInXDomainIframe(element, src) { // Note: Unlike expectRenderedInXDomainIframe, this doesn't return a Promise // because it doesn't (cannot) inspect the contents of the iframe. expect(element, 'ad element').to.be.ok; expect(element.querySelector('iframe[srcdoc]'), 'does not have a friendly iframe child').to.not.be.ok; const child = element.querySelector('iframe[src]'); expect(child, 'iframe child').to.be.ok; expect(child.getAttribute('src')).to.contain.string(src); expect(element, 'ad tag').to.be.visible; expect(child, 'iframe child').to.be.visible; } describe('integration test: a4a', () => { let sandbox; let fixture; let fetchMock; let adResponse; let a4aElement; let a4aRegistry; beforeEach(() => { sandbox = sinon.sandbox.create(); a4aRegistry = getA4ARegistry(); a4aRegistry['mock'] = () => {return true;}; return createIframePromise().then(f => { fixture = f; fetchMock = new FetchMock(fixture.win); for (const serviceName in signingServerURLs) { fetchMock.getOnce(signingServerURLs[serviceName], { body: validCSSAmp.publicKeyset, headers: {'Content-Type': 'application/jwk-set+json'}, }); } fetchMock.getOnce( TEST_URL + '&__amp_source_origin=about%3Asrcdoc', () => adResponse, {name: 'ad'}); adResponse = { headers: {'AMP-Access-Control-Allow-Source-Origin': 'about:srcdoc'}, body: validCSSAmp.reserialized, }; adResponse.headers[AMP_SIGNATURE_HEADER] = validCSSAmp.signatureHeader; installDocService(fixture.win, /* isSingleDoc */ true); installCryptoService(fixture.win); upgradeOrRegisterElement(fixture.win, 'amp-a4a', MockA4AImpl); const doc = fixture.doc; a4aElement = doc.createElement('amp-a4a'); a4aElement.setAttribute('width', 200); a4aElement.setAttribute('height', 50); a4aElement.setAttribute('type', 'mock'); }); }); afterEach(() => { fetchMock./*OK*/restore(); sandbox.restore(); resetScheduledElementForTesting(window, 'amp-a4a'); delete a4aRegistry['mock']; }); it('should render a single AMP ad in a friendly iframe', () => { return fixture.addElement(a4aElement).then(unusedElement => { return expectRenderedInFriendlyIframe(a4aElement, 'Hello, world.'); }); }); it('should fall back to 3p when no signature is present', () => { delete adResponse.headers[AMP_SIGNATURE_HEADER]; return fixture.addElement(a4aElement).then(unusedElement => { expectRenderedInXDomainIframe(a4aElement, TEST_URL); }); }); it('should not send request if display none', () => { a4aElement.style.display = 'none'; return fixture.addElement(a4aElement).then(element => { expect(fetchMock.called('ad')).to.be.false; expect(element.querySelector('iframe')).to.not.be.ok; }); }); it('should fall back to 3p when the XHR fails', () => { adResponse = Promise.reject(networkFailure()); // TODO(tdrl) Currently layoutCallback rejects, even though something *is* // rendered. This should be fixed in a refactor, and we should change this // .catch to a .then. const forceCollapseStub = sandbox.spy(MockA4AImpl.prototype, 'forceCollapse'); return fixture.addElement(a4aElement).catch(error => { expect(error.message).to.contain.string('Testing network error'); expect(error.message).to.contain.string('AMP-A4A-'); expectRenderedInXDomainIframe(a4aElement, TEST_URL); expect(forceCollapseStub).to.not.be.called; }); }); it('should collapse slot when creative response has code 204', () => { adResponse.status = 204; adResponse.body = null; const forceCollapseStub = sandbox.spy(MockA4AImpl.prototype, 'forceCollapse'); return fixture.addElement(a4aElement).then(() => { expect(forceCollapseStub).to.be.calledOnce; }); }); it('should collapse slot when creative response.arrayBuffer() is empty', () => { adResponse.body = ''; const forceCollapseStub = sandbox.spy(MockA4AImpl.prototype, 'forceCollapse'); return fixture.addElement(a4aElement).then(unusedElement => { expect(forceCollapseStub).to.be.calledOnce; }); }); it('should continue to show old creative after refresh and no fill', () => { return fixture.addElement(a4aElement).then(() => { return expectRenderedInFriendlyIframe(a4aElement, 'Hello, world.') .then(() => { const a4a = new MockA4AImpl(a4aElement); const initiateAdRequestMock = sandbox.stub( MockA4AImpl.prototype, 'initiateAdRequest').callsFake( () => { a4a.adPromise_ = Promise.resolve(); // This simulates calling forceCollapse, without tripping // up any unrelated asserts. a4a.isRefreshing = false; }); const tearDownSlotMock = sandbox.stub(MockA4AImpl.prototype, 'tearDownSlot'); tearDownSlotMock.returns(undefined); const destroyFrameSpy = sandbox.spy(MockA4AImpl.prototype, 'destroyFrame'); const callback = sandbox.spy(); return a4a.refresh(callback).then(() => { expect(initiateAdRequestMock).to.be.called; expect(tearDownSlotMock).to.be.called; expect(destroyFrameSpy).to.not.be.called; expect(callback).to.be.called; }); }); }); }); // TODO(@ampproject/a4a): Need a test that double-checks that thrown errors // are propagated out and printed to console and/or sent upstream to error // logging systems. This is a bit tricky, because it's handled by the AMP // runtime and can't be done within the context of a // fixture.addElement().then() or .catch(). This should be integrated into // all tests, so that we know precisely when errors are being reported and // to whom. it('should propagate errors out and report them to upstream error log'); });
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[20],{ /***/ "./node_modules/react-chat-widget/lib/index.js": /*!*****************************************************!*\ !*** ./node_modules/react-chat-widget/lib/index.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("!function(t,e){ true?module.exports=e():undefined}(window,function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(t,\"__esModule\",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&\"object\"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,\"default\",{enumerable:!0,value:t}),2&e&&\"string\"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,\"a\",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p=\"\",r(r.s=143)}([function(t,e,r){\"use strict\";var n=Object.prototype.hasOwnProperty;function o(t,e){return n.call(t,e)}function i(t){return!(t>=55296&&t<=57343)&&(!(t>=64976&&t<=65007)&&(65535!=(65535&t)&&65534!=(65535&t)&&(!(t>=0&&t<=8)&&(11!==t&&(!(t>=14&&t<=31)&&(!(t>=127&&t<=159)&&!(t>1114111)))))))}function s(t){if(t>65535){var e=55296+((t-=65536)>>10),r=56320+(1023&t);return String.fromCharCode(e,r)}return String.fromCharCode(t)}var u=/\\\\([!\"#$%&'()*+,\\-.\\/:;<=>?@[\\\\\\]^_`{|}~])/g,a=new RegExp(u.source+\"|\"+/&([a-z#][a-z0-9]{1,31});/gi.source,\"gi\"),c=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,l=r(27);var f=/[&<>\"]/,p=/[&<>\"]/g,h={\"&\":\"&amp;\",\"<\":\"&lt;\",\">\":\"&gt;\",'\"':\"&quot;\"};function d(t){return h[t]}var _=/[.?*+^$[\\]\\\\(){}|-]/g;var g=r(12);e.lib={},e.lib.mdurl=r(26),e.lib.ucmicro=r(118),e.assign=function(t){return Array.prototype.slice.call(arguments,1).forEach(function(e){if(e){if(\"object\"!=typeof e)throw new TypeError(e+\"must be object\");Object.keys(e).forEach(function(r){t[r]=e[r]})}}),t},e.isString=function(t){return\"[object String]\"===function(t){return Object.prototype.toString.call(t)}(t)},e.has=o,e.unescapeMd=function(t){return t.indexOf(\"\\\\\")<0?t:t.replace(u,\"$1\")},e.unescapeAll=function(t){return t.indexOf(\"\\\\\")<0&&t.indexOf(\"&\")<0?t:t.replace(a,function(t,e,r){return e||function(t,e){var r=0;return o(l,e)?l[e]:35===e.charCodeAt(0)&&c.test(e)&&i(r=\"x\"===e[1].toLowerCase()?parseInt(e.slice(2),16):parseInt(e.slice(1),10))?s(r):t}(t,r)})},e.isValidEntityCode=i,e.fromCodePoint=s,e.escapeHtml=function(t){return f.test(t)?t.replace(p,d):t},e.arrayReplaceAt=function(t,e,r){return[].concat(t.slice(0,e),r,t.slice(e+1))},e.isSpace=function(t){switch(t){case 9:case 32:return!0}return!1},e.isWhiteSpace=function(t){if(t>=8192&&t<=8202)return!0;switch(t){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1},e.isMdAsciiPunct=function(t){switch(t){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}},e.isPunctChar=function(t){return g.test(t)},e.escapeRE=function(t){return t.replace(_,\"\\\\$&\")},e.normalizeReference=function(t){return t.trim().replace(/\\s+/g,\" \").toUpperCase()}},function(t,e,r){t.exports=r(136)()},function(t,e,r){\"use strict\";t.exports=r(141)},function(t,e,r){\"use strict\";r.r(e);var n=r(2),o=r(1),i=r.n(o),s=i.a.shape({trySubscribe:i.a.func.isRequired,tryUnsubscribe:i.a.func.isRequired,notifyNestedSubs:i.a.func.isRequired,isSubscribed:i.a.func.isRequired}),u=i.a.shape({subscribe:i.a.func.isRequired,dispatch:i.a.func.isRequired,getState:i.a.func.isRequired});function a(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:\"store\",r=arguments[1]||e+\"Subscription\",o=function(t){function o(r,n){!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,o);var i=function(t,e){if(!t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!e||\"object\"!=typeof e&&\"function\"!=typeof e?t:e}(this,t.call(this,r,n));return i[e]=r.store,i}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(o,t),o.prototype.getChildContext=function(){var t;return(t={})[e]=this[e],t[r]=null,t},o.prototype.render=function(){return n.Children.only(this.props.children)},o}(n.Component);return o.propTypes={store:u.isRequired,children:i.a.element.isRequired},o.childContextTypes=((t={})[e]=u.isRequired,t[r]=s,t),o}var c=a(),l=r(31),f=r.n(l),p=r(8),h=r.n(p);var d=null,_={notify:function(){}};var g=function(){function t(e,r,n){!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.store=e,this.parentSub=r,this.onStateChange=n,this.unsubscribe=null,this.listeners=_}return t.prototype.addNestedSub=function(t){return this.trySubscribe(),this.listeners.subscribe(t)},t.prototype.notifyNestedSubs=function(){this.listeners.notify()},t.prototype.isSubscribed=function(){return Boolean(this.unsubscribe)},t.prototype.trySubscribe=function(){this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.onStateChange):this.store.subscribe(this.onStateChange),this.listeners=function(){var t=[],e=[];return{clear:function(){e=d,t=d},notify:function(){for(var r=t=e,n=0;n<r.length;n++)r[n]()},get:function(){return e},subscribe:function(r){var n=!0;return e===t&&(e=t.slice()),e.push(r),function(){n&&t!==d&&(n=!1,e===t&&(e=t.slice()),e.splice(e.indexOf(r),1))}}}}())},t.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null,this.listeners.clear(),this.listeners=_)},t}(),y=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t};var v=0,m={};function b(){}function M(t){var e,r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=o.getDisplayName,a=void 0===i?function(t){return\"ConnectAdvanced(\"+t+\")\"}:i,c=o.methodName,l=void 0===c?\"connectAdvanced\":c,p=o.renderCountProp,d=void 0===p?void 0:p,_=o.shouldHandleStateChanges,M=void 0===_||_,w=o.storeKey,k=void 0===w?\"store\":w,E=o.withRef,D=void 0!==E&&E,S=function(t,e){var r={};for(var n in t)e.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n]);return r}(o,[\"getDisplayName\",\"methodName\",\"renderCountProp\",\"shouldHandleStateChanges\",\"storeKey\",\"withRef\"]),C=k+\"Subscription\",x=v++,A=((e={})[k]=u,e[C]=s,e),I=((r={})[C]=s,r);return function(e){h()(\"function\"==typeof e,\"You must pass a component to the function returned by \"+l+\". Instead received \"+JSON.stringify(e));var r=e.displayName||e.name||\"Component\",o=a(r),i=y({},S,{getDisplayName:a,methodName:l,renderCountProp:d,shouldHandleStateChanges:M,storeKey:k,withRef:D,displayName:o,wrappedComponentName:r,WrappedComponent:e}),s=function(r){function s(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,s);var n=function(t,e){if(!t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!e||\"object\"!=typeof e&&\"function\"!=typeof e?t:e}(this,r.call(this,t,e));return n.version=x,n.state={},n.renderCount=0,n.store=t[k]||e[k],n.propsMode=Boolean(t[k]),n.setWrappedInstance=n.setWrappedInstance.bind(n),h()(n.store,'Could not find \"'+k+'\" in either the context or props of \"'+o+'\". Either wrap the root component in a <Provider>, or explicitly pass \"'+k+'\" as a prop to \"'+o+'\".'),n.initSelector(),n.initSubscription(),n}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(s,r),s.prototype.getChildContext=function(){var t,e=this.propsMode?null:this.subscription;return(t={})[C]=e||this.context[C],t},s.prototype.componentDidMount=function(){M&&(this.subscription.trySubscribe(),this.selector.run(this.props),this.selector.shouldComponentUpdate&&this.forceUpdate())},s.prototype.componentWillReceiveProps=function(t){this.selector.run(t)},s.prototype.shouldComponentUpdate=function(){return this.selector.shouldComponentUpdate},s.prototype.componentWillUnmount=function(){this.subscription&&this.subscription.tryUnsubscribe(),this.subscription=null,this.notifyNestedSubs=b,this.store=null,this.selector.run=b,this.selector.shouldComponentUpdate=!1},s.prototype.getWrappedInstance=function(){return h()(D,\"To access the wrapped instance, you need to specify { withRef: true } in the options argument of the \"+l+\"() call.\"),this.wrappedInstance},s.prototype.setWrappedInstance=function(t){this.wrappedInstance=t},s.prototype.initSelector=function(){var e=t(this.store.dispatch,i);this.selector=function(t,e){var r={run:function(n){try{var o=t(e.getState(),n);(o!==r.props||r.error)&&(r.shouldComponentUpdate=!0,r.props=o,r.error=null)}catch(t){r.shouldComponentUpdate=!0,r.error=t}}};return r}(e,this.store),this.selector.run(this.props)},s.prototype.initSubscription=function(){if(M){var t=(this.propsMode?this.props:this.context)[C];this.subscription=new g(this.store,t,this.onStateChange.bind(this)),this.notifyNestedSubs=this.subscription.notifyNestedSubs.bind(this.subscription)}},s.prototype.onStateChange=function(){this.selector.run(this.props),this.selector.shouldComponentUpdate?(this.componentDidUpdate=this.notifyNestedSubsOnComponentDidUpdate,this.setState(m)):this.notifyNestedSubs()},s.prototype.notifyNestedSubsOnComponentDidUpdate=function(){this.componentDidUpdate=void 0,this.notifyNestedSubs()},s.prototype.isSubscribed=function(){return Boolean(this.subscription)&&this.subscription.isSubscribed()},s.prototype.addExtraProps=function(t){if(!(D||d||this.propsMode&&this.subscription))return t;var e=y({},t);return D&&(e.ref=this.setWrappedInstance),d&&(e[d]=this.renderCount++),this.propsMode&&this.subscription&&(e[C]=this.subscription),e},s.prototype.render=function(){var t=this.selector;if(t.shouldComponentUpdate=!1,t.error)throw t.error;return Object(n.createElement)(e,this.addExtraProps(t.props))},s}(n.Component);return s.WrappedComponent=e,s.displayName=o,s.childContextTypes=I,s.contextTypes=A,s.propTypes=A,f()(s,e)}}var w=Object.prototype.hasOwnProperty;function k(t,e){return t===e?0!==t||0!==e||1/t==1/e:t!=t&&e!=e}function E(t,e){if(k(t,e))return!0;if(\"object\"!=typeof t||null===t||\"object\"!=typeof e||null===e)return!1;var r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(var o=0;o<r.length;o++)if(!w.call(e,r[o])||!k(t[r[o]],e[r[o]]))return!1;return!0}var D=r(17);r(4);function S(t){return function(e,r){var n=t(e,r);function o(){return n}return o.dependsOnOwnProps=!1,o}}function C(t){return null!==t.dependsOnOwnProps&&void 0!==t.dependsOnOwnProps?Boolean(t.dependsOnOwnProps):1!==t.length}function x(t,e){return function(e,r){r.displayName;var n=function(t,e){return n.dependsOnOwnProps?n.mapToProps(t,e):n.mapToProps(t)};return n.dependsOnOwnProps=!0,n.mapToProps=function(e,r){n.mapToProps=t,n.dependsOnOwnProps=C(t);var o=n(e,r);return\"function\"==typeof o&&(n.mapToProps=o,n.dependsOnOwnProps=C(o),o=n(e,r)),o},n}}var A=[function(t){return\"function\"==typeof t?x(t):void 0},function(t){return t?void 0:S(function(t){return{dispatch:t}})},function(t){return t&&\"object\"==typeof t?S(function(e){return Object(D.bindActionCreators)(t,e)}):void 0}];var I=[function(t){return\"function\"==typeof t?x(t):void 0},function(t){return t?void 0:S(function(){return{}})}],N=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t};function j(t,e,r){return N({},r,t,e)}var T=[function(t){return\"function\"==typeof t?function(t){return function(e,r){r.displayName;var n=r.pure,o=r.areMergedPropsEqual,i=!1,s=void 0;return function(e,r,u){var a=t(e,r,u);return i?n&&o(a,s)||(s=a):(i=!0,s=a),s}}}(t):void 0},function(t){return t?void 0:function(){return j}}];function O(t,e,r,n){return function(o,i){return r(t(o,i),e(n,i),i)}}function z(t,e,r,n,o){var i=o.areStatesEqual,s=o.areOwnPropsEqual,u=o.areStatePropsEqual,a=!1,c=void 0,l=void 0,f=void 0,p=void 0,h=void 0;function d(o,a){var d=!s(a,l),_=!i(o,c);return c=o,l=a,d&&_?(f=t(c,l),e.dependsOnOwnProps&&(p=e(n,l)),h=r(f,p,l)):d?(t.dependsOnOwnProps&&(f=t(c,l)),e.dependsOnOwnProps&&(p=e(n,l)),h=r(f,p,l)):_?function(){var e=t(c,l),n=!u(e,f);return f=e,n&&(h=r(f,p,l)),h}():h}return function(o,i){return a?d(o,i):function(o,i){return f=t(c=o,l=i),p=e(n,l),h=r(f,p,l),a=!0,h}(o,i)}}function L(t,e){var r=e.initMapStateToProps,n=e.initMapDispatchToProps,o=e.initMergeProps,i=function(t,e){var r={};for(var n in t)e.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n]);return r}(e,[\"initMapStateToProps\",\"initMapDispatchToProps\",\"initMergeProps\"]),s=r(t,i),u=n(t,i),a=o(t,i);return(i.pure?z:O)(s,u,a,t,i)}var P=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t};function q(t,e,r){for(var n=e.length-1;n>=0;n--){var o=e[n](t);if(o)return o}return function(e,n){throw new Error(\"Invalid value of type \"+typeof t+\" for \"+r+\" argument when connecting component \"+n.wrappedComponentName+\".\")}}function R(t,e){return t===e}var U=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.connectHOC,r=void 0===e?M:e,n=t.mapStateToPropsFactories,o=void 0===n?I:n,i=t.mapDispatchToPropsFactories,s=void 0===i?A:i,u=t.mergePropsFactories,a=void 0===u?T:u,c=t.selectorFactory,l=void 0===c?L:c;return function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},u=i.pure,c=void 0===u||u,f=i.areStatesEqual,p=void 0===f?R:f,h=i.areOwnPropsEqual,d=void 0===h?E:h,_=i.areStatePropsEqual,g=void 0===_?E:_,y=i.areMergedPropsEqual,v=void 0===y?E:y,m=function(t,e){var r={};for(var n in t)e.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n]);return r}(i,[\"pure\",\"areStatesEqual\",\"areOwnPropsEqual\",\"areStatePropsEqual\",\"areMergedPropsEqual\"]),b=q(t,o,\"mapStateToProps\"),M=q(e,s,\"mapDispatchToProps\"),w=q(n,a,\"mergeProps\");return r(l,P({methodName:\"connect\",getDisplayName:function(t){return\"Connect(\"+t+\")\"},shouldHandleStateChanges:Boolean(t),initMapStateToProps:b,initMapDispatchToProps:M,initMergeProps:w,pure:c,areStatesEqual:p,areOwnPropsEqual:d,areStatePropsEqual:g,areMergedPropsEqual:v},m))}}();r.d(e,\"Provider\",function(){return c}),r.d(e,\"createProvider\",function(){return a}),r.d(e,\"connectAdvanced\",function(){return M}),r.d(e,\"connect\",function(){return U})},function(t,e,r){\"use strict\";var n=r(29),o=\"object\"==typeof self&&self&&self.Object===Object&&self,i=(n.a||o||Function(\"return this\")()).Symbol,s=Object.prototype,u=s.hasOwnProperty,a=s.toString,c=i?i.toStringTag:void 0;var l=function(t){var e=u.call(t,c),r=t[c];try{t[c]=void 0;var n=!0}catch(t){}var o=a.call(t);return n&&(e?t[c]=r:delete t[c]),o},f=Object.prototype.toString;var p=function(t){return f.call(t)},h=\"[object Null]\",d=\"[object Undefined]\",_=i?i.toStringTag:void 0;var g=function(t){return null==t?void 0===t?d:h:_&&_ in Object(t)?l(t):p(t)};var y=function(t,e){return function(r){return t(e(r))}}(Object.getPrototypeOf,Object);var v=function(t){return null!=t&&\"object\"==typeof t},m=\"[object Object]\",b=Function.prototype,M=Object.prototype,w=b.toString,k=M.hasOwnProperty,E=w.call(Object);e.a=function(t){if(!v(t)||g(t)!=m)return!1;var e=y(t);if(null===e)return!0;var r=k.call(e,\"constructor\")&&e.constructor;return\"function\"==typeof r&&r instanceof r&&w.call(r)==E}},function(t,e,r){t.exports=function(){\"use strict\";var t=Array.prototype.slice;function e(t,e){e&&(t.prototype=Object.create(e.prototype)),t.prototype.constructor=t}function r(t){return s(t)?t:Z(t)}function n(t){return u(t)?t:V(t)}function o(t){return a(t)?t:H(t)}function i(t){return s(t)&&!c(t)?t:W(t)}function s(t){return!(!t||!t[f])}function u(t){return!(!t||!t[p])}function a(t){return!(!t||!t[h])}function c(t){return u(t)||a(t)}function l(t){return!(!t||!t[d])}e(n,r),e(o,r),e(i,r),r.isIterable=s,r.isKeyed=u,r.isIndexed=a,r.isAssociative=c,r.isOrdered=l,r.Keyed=n,r.Indexed=o,r.Set=i;var f=\"@@__IMMUTABLE_ITERABLE__@@\",p=\"@@__IMMUTABLE_KEYED__@@\",h=\"@@__IMMUTABLE_INDEXED__@@\",d=\"@@__IMMUTABLE_ORDERED__@@\",_=5,g=1<<_,y=g-1,v={},m={value:!1},b={value:!1};function M(t){return t.value=!1,t}function w(t){t&&(t.value=!0)}function k(){}function E(t,e){e=e||0;for(var r=Math.max(0,t.length-e),n=new Array(r),o=0;o<r;o++)n[o]=t[o+e];return n}function D(t){return void 0===t.size&&(t.size=t.__iterate(C)),t.size}function S(t,e){if(\"number\"!=typeof e){var r=e>>>0;if(\"\"+r!==e||4294967295===r)return NaN;e=r}return e<0?D(t)+e:e}function C(){return!0}function x(t,e,r){return(0===t||void 0!==r&&t<=-r)&&(void 0===e||void 0!==r&&e>=r)}function A(t,e){return N(t,e,0)}function I(t,e){return N(t,e,e)}function N(t,e,r){return void 0===t?r:t<0?Math.max(0,e+t):void 0===e?t:Math.min(e,t)}var j=0,T=1,O=2,z=\"function\"==typeof Symbol&&Symbol.iterator,L=\"@@iterator\",P=z||L;function q(t){this.next=t}function R(t,e,r,n){var o=0===t?e:1===t?r:[e,r];return n?n.value=o:n={value:o,done:!1},n}function U(){return{value:void 0,done:!0}}function B(t){return!!G(t)}function F(t){return t&&\"function\"==typeof t.next}function Y(t){var e=G(t);return e&&e.call(t)}function G(t){var e=t&&(z&&t[z]||t[L]);if(\"function\"==typeof e)return e}function Q(t){return t&&\"number\"==typeof t.length}function Z(t){return null===t||void 0===t?it():s(t)?t.toSeq():function(t){var e=at(t)||\"object\"==typeof t&&new et(t);if(!e)throw new TypeError(\"Expected Array or iterable object of values, or keyed object: \"+t);return e}(t)}function V(t){return null===t||void 0===t?it().toKeyedSeq():s(t)?u(t)?t.toSeq():t.fromEntrySeq():st(t)}function H(t){return null===t||void 0===t?it():s(t)?u(t)?t.entrySeq():t.toIndexedSeq():ut(t)}function W(t){return(null===t||void 0===t?it():s(t)?u(t)?t.entrySeq():t:ut(t)).toSetSeq()}q.prototype.toString=function(){return\"[Iterator]\"},q.KEYS=j,q.VALUES=T,q.ENTRIES=O,q.prototype.inspect=q.prototype.toSource=function(){return this.toString()},q.prototype[P]=function(){return this},e(Z,r),Z.of=function(){return Z(arguments)},Z.prototype.toSeq=function(){return this},Z.prototype.toString=function(){return this.__toString(\"Seq {\",\"}\")},Z.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},Z.prototype.__iterate=function(t,e){return ct(this,t,e,!0)},Z.prototype.__iterator=function(t,e){return lt(this,t,e,!0)},e(V,Z),V.prototype.toKeyedSeq=function(){return this},e(H,Z),H.of=function(){return H(arguments)},H.prototype.toIndexedSeq=function(){return this},H.prototype.toString=function(){return this.__toString(\"Seq [\",\"]\")},H.prototype.__iterate=function(t,e){return ct(this,t,e,!1)},H.prototype.__iterator=function(t,e){return lt(this,t,e,!1)},e(W,Z),W.of=function(){return W(arguments)},W.prototype.toSetSeq=function(){return this},Z.isSeq=ot,Z.Keyed=V,Z.Set=W,Z.Indexed=H;var K,$,J,X=\"@@__IMMUTABLE_SEQ__@@\";function tt(t){this._array=t,this.size=t.length}function et(t){var e=Object.keys(t);this._object=t,this._keys=e,this.size=e.length}function rt(t){this._iterable=t,this.size=t.length||t.size}function nt(t){this._iterator=t,this._iteratorCache=[]}function ot(t){return!(!t||!t[X])}function it(){return K||(K=new tt([]))}function st(t){var e=Array.isArray(t)?new tt(t).fromEntrySeq():F(t)?new nt(t).fromEntrySeq():B(t)?new rt(t).fromEntrySeq():\"object\"==typeof t?new et(t):void 0;if(!e)throw new TypeError(\"Expected Array or iterable object of [k, v] entries, or keyed object: \"+t);return e}function ut(t){var e=at(t);if(!e)throw new TypeError(\"Expected Array or iterable object of values: \"+t);return e}function at(t){return Q(t)?new tt(t):F(t)?new nt(t):B(t)?new rt(t):void 0}function ct(t,e,r,n){var o=t._cache;if(o){for(var i=o.length-1,s=0;s<=i;s++){var u=o[r?i-s:s];if(!1===e(u[1],n?u[0]:s,t))return s+1}return s}return t.__iterateUncached(e,r)}function lt(t,e,r,n){var o=t._cache;if(o){var i=o.length-1,s=0;return new q(function(){var t=o[r?i-s:s];return s++>i?{value:void 0,done:!0}:R(e,n?t[0]:s-1,t[1])})}return t.__iteratorUncached(e,r)}function ft(t,e){return e?function t(e,r,n,o){return Array.isArray(r)?e.call(o,n,H(r).map(function(n,o){return t(e,n,o,r)})):ht(r)?e.call(o,n,V(r).map(function(n,o){return t(e,n,o,r)})):r}(e,t,\"\",{\"\":t}):pt(t)}function pt(t){return Array.isArray(t)?H(t).map(pt).toList():ht(t)?V(t).map(pt).toMap():t}function ht(t){return t&&(t.constructor===Object||void 0===t.constructor)}function dt(t,e){if(t===e||t!=t&&e!=e)return!0;if(!t||!e)return!1;if(\"function\"==typeof t.valueOf&&\"function\"==typeof e.valueOf){if(t=t.valueOf(),e=e.valueOf(),t===e||t!=t&&e!=e)return!0;if(!t||!e)return!1}return!(\"function\"!=typeof t.equals||\"function\"!=typeof e.equals||!t.equals(e))}function _t(t,e){if(t===e)return!0;if(!s(e)||void 0!==t.size&&void 0!==e.size&&t.size!==e.size||void 0!==t.__hash&&void 0!==e.__hash&&t.__hash!==e.__hash||u(t)!==u(e)||a(t)!==a(e)||l(t)!==l(e))return!1;if(0===t.size&&0===e.size)return!0;var r=!c(t);if(l(t)){var n=t.entries();return e.every(function(t,e){var o=n.next().value;return o&&dt(o[1],t)&&(r||dt(o[0],e))})&&n.next().done}var o=!1;if(void 0===t.size)if(void 0===e.size)\"function\"==typeof t.cacheResult&&t.cacheResult();else{o=!0;var i=t;t=e,e=i}var f=!0,p=e.__iterate(function(e,n){if(r?!t.has(e):o?!dt(e,t.get(n,v)):!dt(t.get(n,v),e))return f=!1,!1});return f&&t.size===p}function gt(t,e){if(!(this instanceof gt))return new gt(t,e);if(this._value=t,this.size=void 0===e?1/0:Math.max(0,e),0===this.size){if($)return $;$=this}}function yt(t,e){if(!t)throw new Error(e)}function vt(t,e,r){if(!(this instanceof vt))return new vt(t,e,r);if(yt(0!==r,\"Cannot step a Range by 0\"),t=t||0,void 0===e&&(e=1/0),r=void 0===r?1:Math.abs(r),e<t&&(r=-r),this._start=t,this._end=e,this._step=r,this.size=Math.max(0,Math.ceil((e-t)/r-1)+1),0===this.size){if(J)return J;J=this}}function mt(){throw TypeError(\"Abstract\")}function bt(){}function Mt(){}function wt(){}Z.prototype[X]=!0,e(tt,H),tt.prototype.get=function(t,e){return this.has(t)?this._array[S(this,t)]:e},tt.prototype.__iterate=function(t,e){for(var r=this._array,n=r.length-1,o=0;o<=n;o++)if(!1===t(r[e?n-o:o],o,this))return o+1;return o},tt.prototype.__iterator=function(t,e){var r=this._array,n=r.length-1,o=0;return new q(function(){return o>n?{value:void 0,done:!0}:R(t,o,r[e?n-o++:o++])})},e(et,V),et.prototype.get=function(t,e){return void 0===e||this.has(t)?this._object[t]:e},et.prototype.has=function(t){return this._object.hasOwnProperty(t)},et.prototype.__iterate=function(t,e){for(var r=this._object,n=this._keys,o=n.length-1,i=0;i<=o;i++){var s=n[e?o-i:i];if(!1===t(r[s],s,this))return i+1}return i},et.prototype.__iterator=function(t,e){var r=this._object,n=this._keys,o=n.length-1,i=0;return new q(function(){var s=n[e?o-i:i];return i++>o?{value:void 0,done:!0}:R(t,s,r[s])})},et.prototype[d]=!0,e(rt,H),rt.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e);var r=this._iterable,n=Y(r),o=0;if(F(n))for(var i;!(i=n.next()).done&&!1!==t(i.value,o++,this););return o},rt.prototype.__iteratorUncached=function(t,e){if(e)return this.cacheResult().__iterator(t,e);var r=this._iterable,n=Y(r);if(!F(n))return new q(U);var o=0;return new q(function(){var e=n.next();return e.done?e:R(t,o++,e.value)})},e(nt,H),nt.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e);for(var r,n=this._iterator,o=this._iteratorCache,i=0;i<o.length;)if(!1===t(o[i],i++,this))return i;for(;!(r=n.next()).done;){var s=r.value;if(o[i]=s,!1===t(s,i++,this))break}return i},nt.prototype.__iteratorUncached=function(t,e){if(e)return this.cacheResult().__iterator(t,e);var r=this._iterator,n=this._iteratorCache,o=0;return new q(function(){if(o>=n.length){var e=r.next();if(e.done)return e;n[o]=e.value}return R(t,o,n[o++])})},e(gt,H),gt.prototype.toString=function(){return 0===this.size?\"Repeat []\":\"Repeat [ \"+this._value+\" \"+this.size+\" times ]\"},gt.prototype.get=function(t,e){return this.has(t)?this._value:e},gt.prototype.includes=function(t){return dt(this._value,t)},gt.prototype.slice=function(t,e){var r=this.size;return x(t,e,r)?this:new gt(this._value,I(e,r)-A(t,r))},gt.prototype.reverse=function(){return this},gt.prototype.indexOf=function(t){return dt(this._value,t)?0:-1},gt.prototype.lastIndexOf=function(t){return dt(this._value,t)?this.size:-1},gt.prototype.__iterate=function(t,e){for(var r=0;r<this.size;r++)if(!1===t(this._value,r,this))return r+1;return r},gt.prototype.__iterator=function(t,e){var r=this,n=0;return new q(function(){return n<r.size?R(t,n++,r._value):{value:void 0,done:!0}})},gt.prototype.equals=function(t){return t instanceof gt?dt(this._value,t._value):_t(t)},e(vt,H),vt.prototype.toString=function(){return 0===this.size?\"Range []\":\"Range [ \"+this._start+\"...\"+this._end+(1!==this._step?\" by \"+this._step:\"\")+\" ]\"},vt.prototype.get=function(t,e){return this.has(t)?this._start+S(this,t)*this._step:e},vt.prototype.includes=function(t){var e=(t-this._start)/this._step;return e>=0&&e<this.size&&e===Math.floor(e)},vt.prototype.slice=function(t,e){return x(t,e,this.size)?this:(t=A(t,this.size),(e=I(e,this.size))<=t?new vt(0,0):new vt(this.get(t,this._end),this.get(e,this._end),this._step))},vt.prototype.indexOf=function(t){var e=t-this._start;if(e%this._step==0){var r=e/this._step;if(r>=0&&r<this.size)return r}return-1},vt.prototype.lastIndexOf=function(t){return this.indexOf(t)},vt.prototype.__iterate=function(t,e){for(var r=this.size-1,n=this._step,o=e?this._start+r*n:this._start,i=0;i<=r;i++){if(!1===t(o,i,this))return i+1;o+=e?-n:n}return i},vt.prototype.__iterator=function(t,e){var r=this.size-1,n=this._step,o=e?this._start+r*n:this._start,i=0;return new q(function(){var s=o;return o+=e?-n:n,i>r?{value:void 0,done:!0}:R(t,i++,s)})},vt.prototype.equals=function(t){return t instanceof vt?this._start===t._start&&this._end===t._end&&this._step===t._step:_t(this,t)},e(mt,r),e(bt,mt),e(Mt,mt),e(wt,mt),mt.Keyed=bt,mt.Indexed=Mt,mt.Set=wt;var kt=\"function\"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(t,e){var r=65535&(t|=0),n=65535&(e|=0);return r*n+((t>>>16)*n+r*(e>>>16)<<16>>>0)|0};function Et(t){return t>>>1&1073741824|3221225471&t}function Dt(t){if(!1===t||null===t||void 0===t)return 0;if(\"function\"==typeof t.valueOf&&(!1===(t=t.valueOf())||null===t||void 0===t))return 0;if(!0===t)return 1;var e=typeof t;if(\"number\"===e){if(t!=t||t===1/0)return 0;var r=0|t;for(r!==t&&(r^=4294967295*t);t>4294967295;)r^=t/=4294967295;return Et(r)}if(\"string\"===e)return t.length>Tt?function(t){var e=Lt[t];return void 0===e&&(e=St(t),zt===Ot&&(zt=0,Lt={}),zt++,Lt[t]=e),e}(t):St(t);if(\"function\"==typeof t.hashCode)return t.hashCode();if(\"object\"===e)return function(t){var e;if(It&&void 0!==(e=Ct.get(t)))return e;if(void 0!==(e=t[jt]))return e;if(!At){if(void 0!==(e=t.propertyIsEnumerable&&t.propertyIsEnumerable[jt]))return e;if(void 0!==(e=function(t){if(t&&t.nodeType>0)switch(t.nodeType){case 1:return t.uniqueID;case 9:return t.documentElement&&t.documentElement.uniqueID}}(t)))return e}if(e=++Nt,1073741824&Nt&&(Nt=0),It)Ct.set(t,e);else{if(void 0!==xt&&!1===xt(t))throw new Error(\"Non-extensible objects are not allowed as keys.\");if(At)Object.defineProperty(t,jt,{enumerable:!1,configurable:!1,writable:!1,value:e});else if(void 0!==t.propertyIsEnumerable&&t.propertyIsEnumerable===t.constructor.prototype.propertyIsEnumerable)t.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},t.propertyIsEnumerable[jt]=e;else{if(void 0===t.nodeType)throw new Error(\"Unable to set a non-enumerable property on object.\");t[jt]=e}}return e}(t);if(\"function\"==typeof t.toString)return St(t.toString());throw new Error(\"Value type \"+e+\" cannot be hashed.\")}function St(t){for(var e=0,r=0;r<t.length;r++)e=31*e+t.charCodeAt(r)|0;return Et(e)}var Ct,xt=Object.isExtensible,At=function(){try{return Object.defineProperty({},\"@\",{}),!0}catch(t){return!1}}(),It=\"function\"==typeof WeakMap;It&&(Ct=new WeakMap);var Nt=0,jt=\"__immutablehash__\";\"function\"==typeof Symbol&&(jt=Symbol(jt));var Tt=16,Ot=255,zt=0,Lt={};function Pt(t){yt(t!==1/0,\"Cannot perform this action with an infinite size.\")}function qt(t){return null===t||void 0===t?Jt():Rt(t)&&!l(t)?t:Jt().withMutations(function(e){var r=n(t);Pt(r.size),r.forEach(function(t,r){return e.set(r,t)})})}function Rt(t){return!(!t||!t[Bt])}e(qt,bt),qt.of=function(){var e=t.call(arguments,0);return Jt().withMutations(function(t){for(var r=0;r<e.length;r+=2){if(r+1>=e.length)throw new Error(\"Missing value for key: \"+e[r]);t.set(e[r],e[r+1])}})},qt.prototype.toString=function(){return this.__toString(\"Map {\",\"}\")},qt.prototype.get=function(t,e){return this._root?this._root.get(0,void 0,t,e):e},qt.prototype.set=function(t,e){return Xt(this,t,e)},qt.prototype.setIn=function(t,e){return this.updateIn(t,v,function(){return e})},qt.prototype.remove=function(t){return Xt(this,t,v)},qt.prototype.deleteIn=function(t){return this.updateIn(t,function(){return v})},qt.prototype.update=function(t,e,r){return 1===arguments.length?t(this):this.updateIn([t],e,r)},qt.prototype.updateIn=function(t,e,r){r||(r=e,e=void 0);var n=function t(e,r,n,o){var i=e===v,s=r.next();if(s.done){var u=i?n:e,a=o(u);return a===u?e:a}yt(i||e&&e.set,\"invalid keyPath\");var c=s.value,l=i?v:e.get(c,v),f=t(l,r,n,o);return f===l?e:f===v?e.remove(c):(i?Jt():e).set(c,f)}(this,rr(t),e,r);return n===v?void 0:n},qt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Jt()},qt.prototype.merge=function(){return ne(this,void 0,arguments)},qt.prototype.mergeWith=function(e){var r=t.call(arguments,1);return ne(this,e,r)},qt.prototype.mergeIn=function(e){var r=t.call(arguments,1);return this.updateIn(e,Jt(),function(t){return\"function\"==typeof t.merge?t.merge.apply(t,r):r[r.length-1]})},qt.prototype.mergeDeep=function(){return ne(this,oe,arguments)},qt.prototype.mergeDeepWith=function(e){var r=t.call(arguments,1);return ne(this,ie(e),r)},qt.prototype.mergeDeepIn=function(e){var r=t.call(arguments,1);return this.updateIn(e,Jt(),function(t){return\"function\"==typeof t.mergeDeep?t.mergeDeep.apply(t,r):r[r.length-1]})},qt.prototype.sort=function(t){return Ae(Qe(this,t))},qt.prototype.sortBy=function(t,e){return Ae(Qe(this,e,t))},qt.prototype.withMutations=function(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this},qt.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new k)},qt.prototype.asImmutable=function(){return this.__ensureOwner()},qt.prototype.wasAltered=function(){return this.__altered},qt.prototype.__iterator=function(t,e){return new Ht(this,t,e)},qt.prototype.__iterate=function(t,e){var r=this,n=0;return this._root&&this._root.iterate(function(e){return n++,t(e[1],e[0],r)},e),n},qt.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?$t(this.size,this._root,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},qt.isMap=Rt;var Ut,Bt=\"@@__IMMUTABLE_MAP__@@\",Ft=qt.prototype;function Yt(t,e){this.ownerID=t,this.entries=e}function Gt(t,e,r){this.ownerID=t,this.bitmap=e,this.nodes=r}function Qt(t,e,r){this.ownerID=t,this.count=e,this.nodes=r}function Zt(t,e,r){this.ownerID=t,this.keyHash=e,this.entries=r}function Vt(t,e,r){this.ownerID=t,this.keyHash=e,this.entry=r}function Ht(t,e,r){this._type=e,this._reverse=r,this._stack=t._root&&Kt(t._root)}function Wt(t,e){return R(t,e[0],e[1])}function Kt(t,e){return{node:t,index:0,__prev:e}}function $t(t,e,r,n){var o=Object.create(Ft);return o.size=t,o._root=e,o.__ownerID=r,o.__hash=n,o.__altered=!1,o}function Jt(){return Ut||(Ut=$t(0))}function Xt(t,e,r){var n,o;if(t._root){var i=M(m),s=M(b);if(n=te(t._root,t.__ownerID,0,void 0,e,r,i,s),!s.value)return t;o=t.size+(i.value?r===v?-1:1:0)}else{if(r===v)return t;o=1,n=new Yt(t.__ownerID,[[e,r]])}return t.__ownerID?(t.size=o,t._root=n,t.__hash=void 0,t.__altered=!0,t):n?$t(o,n):Jt()}function te(t,e,r,n,o,i,s,u){return t?t.update(e,r,n,o,i,s,u):i===v?t:(w(u),w(s),new Vt(e,n,[o,i]))}function ee(t){return t.constructor===Vt||t.constructor===Zt}function re(t,e,r,n,o){if(t.keyHash===n)return new Zt(e,n,[t.entry,o]);var i,s=(0===r?t.keyHash:t.keyHash>>>r)&y,u=(0===r?n:n>>>r)&y,a=s===u?[re(t,e,r+_,n,o)]:(i=new Vt(e,n,o),s<u?[t,i]:[i,t]);return new Gt(e,1<<s|1<<u,a)}function ne(t,e,r){for(var o=[],i=0;i<r.length;i++){var u=r[i],a=n(u);s(u)||(a=a.map(function(t){return ft(t)})),o.push(a)}return se(t,e,o)}function oe(t,e,r){return t&&t.mergeDeep&&s(e)?t.mergeDeep(e):dt(t,e)?t:e}function ie(t){return function(e,r,n){if(e&&e.mergeDeepWith&&s(r))return e.mergeDeepWith(t,r);var o=t(e,r,n);return dt(e,o)?e:o}}function se(t,e,r){return 0===(r=r.filter(function(t){return 0!==t.size})).length?t:0!==t.size||t.__ownerID||1!==r.length?t.withMutations(function(t){for(var n=e?function(r,n){t.update(n,v,function(t){return t===v?r:e(t,r,n)})}:function(e,r){t.set(r,e)},o=0;o<r.length;o++)r[o].forEach(n)}):t.constructor(r[0])}function ue(t){return t=(t=(858993459&(t-=t>>1&1431655765))+(t>>2&858993459))+(t>>4)&252645135,t+=t>>8,127&(t+=t>>16)}function ae(t,e,r,n){var o=n?t:E(t);return o[e]=r,o}Ft[Bt]=!0,Ft.delete=Ft.remove,Ft.removeIn=Ft.deleteIn,Yt.prototype.get=function(t,e,r,n){for(var o=this.entries,i=0,s=o.length;i<s;i++)if(dt(r,o[i][0]))return o[i][1];return n},Yt.prototype.update=function(t,e,r,n,o,i,s){for(var u=o===v,a=this.entries,c=0,l=a.length;c<l&&!dt(n,a[c][0]);c++);var f=c<l;if(f?a[c][1]===o:u)return this;if(w(s),(u||!f)&&w(i),!u||1!==a.length){if(!f&&!u&&a.length>=ce)return function(t,e,r,n){t||(t=new k);for(var o=new Vt(t,Dt(r),[r,n]),i=0;i<e.length;i++){var s=e[i];o=o.update(t,0,void 0,s[0],s[1])}return o}(t,a,n,o);var p=t&&t===this.ownerID,h=p?a:E(a);return f?u?c===l-1?h.pop():h[c]=h.pop():h[c]=[n,o]:h.push([n,o]),p?(this.entries=h,this):new Yt(t,h)}},Gt.prototype.get=function(t,e,r,n){void 0===e&&(e=Dt(r));var o=1<<((0===t?e:e>>>t)&y),i=this.bitmap;return 0==(i&o)?n:this.nodes[ue(i&o-1)].get(t+_,e,r,n)},Gt.prototype.update=function(t,e,r,n,o,i,s){void 0===r&&(r=Dt(n));var u=(0===e?r:r>>>e)&y,a=1<<u,c=this.bitmap,l=0!=(c&a);if(!l&&o===v)return this;var f=ue(c&a-1),p=this.nodes,h=l?p[f]:void 0,d=te(h,t,e+_,r,n,o,i,s);if(d===h)return this;if(!l&&d&&p.length>=le)return function(t,e,r,n,o){for(var i=0,s=new Array(g),u=0;0!==r;u++,r>>>=1)s[u]=1&r?e[i++]:void 0;return s[n]=o,new Qt(t,i+1,s)}(t,p,c,u,d);if(l&&!d&&2===p.length&&ee(p[1^f]))return p[1^f];if(l&&d&&1===p.length&&ee(d))return d;var m=t&&t===this.ownerID,b=l?d?c:c^a:c|a,M=l?d?ae(p,f,d,m):function(t,e,r){var n=t.length-1;if(r&&e===n)return t.pop(),t;for(var o=new Array(n),i=0,s=0;s<n;s++)s===e&&(i=1),o[s]=t[s+i];return o}(p,f,m):function(t,e,r,n){var o=t.length+1;if(n&&e+1===o)return t[e]=r,t;for(var i=new Array(o),s=0,u=0;u<o;u++)u===e?(i[u]=r,s=-1):i[u]=t[u+s];return i}(p,f,d,m);return m?(this.bitmap=b,this.nodes=M,this):new Gt(t,b,M)},Qt.prototype.get=function(t,e,r,n){void 0===e&&(e=Dt(r));var o=(0===t?e:e>>>t)&y,i=this.nodes[o];return i?i.get(t+_,e,r,n):n},Qt.prototype.update=function(t,e,r,n,o,i,s){void 0===r&&(r=Dt(n));var u=(0===e?r:r>>>e)&y,a=o===v,c=this.nodes,l=c[u];if(a&&!l)return this;var f=te(l,t,e+_,r,n,o,i,s);if(f===l)return this;var p=this.count;if(l){if(!f&&--p<fe)return function(t,e,r,n){for(var o=0,i=0,s=new Array(r),u=0,a=1,c=e.length;u<c;u++,a<<=1){var l=e[u];void 0!==l&&u!==n&&(o|=a,s[i++]=l)}return new Gt(t,o,s)}(t,c,p,u)}else p++;var h=t&&t===this.ownerID,d=ae(c,u,f,h);return h?(this.count=p,this.nodes=d,this):new Qt(t,p,d)},Zt.prototype.get=function(t,e,r,n){for(var o=this.entries,i=0,s=o.length;i<s;i++)if(dt(r,o[i][0]))return o[i][1];return n},Zt.prototype.update=function(t,e,r,n,o,i,s){void 0===r&&(r=Dt(n));var u=o===v;if(r!==this.keyHash)return u?this:(w(s),w(i),re(this,t,e,r,[n,o]));for(var a=this.entries,c=0,l=a.length;c<l&&!dt(n,a[c][0]);c++);var f=c<l;if(f?a[c][1]===o:u)return this;if(w(s),(u||!f)&&w(i),u&&2===l)return new Vt(t,this.keyHash,a[1^c]);var p=t&&t===this.ownerID,h=p?a:E(a);return f?u?c===l-1?h.pop():h[c]=h.pop():h[c]=[n,o]:h.push([n,o]),p?(this.entries=h,this):new Zt(t,this.keyHash,h)},Vt.prototype.get=function(t,e,r,n){return dt(r,this.entry[0])?this.entry[1]:n},Vt.prototype.update=function(t,e,r,n,o,i,s){var u=o===v,a=dt(n,this.entry[0]);return(a?o===this.entry[1]:u)?this:(w(s),u?void w(i):a?t&&t===this.ownerID?(this.entry[1]=o,this):new Vt(t,this.keyHash,[n,o]):(w(i),re(this,t,e,Dt(n),[n,o])))},Yt.prototype.iterate=Zt.prototype.iterate=function(t,e){for(var r=this.entries,n=0,o=r.length-1;n<=o;n++)if(!1===t(r[e?o-n:n]))return!1},Gt.prototype.iterate=Qt.prototype.iterate=function(t,e){for(var r=this.nodes,n=0,o=r.length-1;n<=o;n++){var i=r[e?o-n:n];if(i&&!1===i.iterate(t,e))return!1}},Vt.prototype.iterate=function(t,e){return t(this.entry)},e(Ht,q),Ht.prototype.next=function(){for(var t=this._type,e=this._stack;e;){var r,n=e.node,o=e.index++;if(n.entry){if(0===o)return Wt(t,n.entry)}else if(n.entries){if(r=n.entries.length-1,o<=r)return Wt(t,n.entries[this._reverse?r-o:o])}else if(r=n.nodes.length-1,o<=r){var i=n.nodes[this._reverse?r-o:o];if(i){if(i.entry)return Wt(t,i.entry);e=this._stack=Kt(i,e)}continue}e=this._stack=this._stack.__prev}return{value:void 0,done:!0}};var ce=g/4,le=g/2,fe=g/4;function pe(t){var e=we();if(null===t||void 0===t)return e;if(he(t))return t;var r=o(t),n=r.size;return 0===n?e:(Pt(n),n>0&&n<g?Me(0,n,_,null,new ge(r.toArray())):e.withMutations(function(t){t.setSize(n),r.forEach(function(e,r){return t.set(r,e)})}))}function he(t){return!(!t||!t[de])}e(pe,Mt),pe.of=function(){return this(arguments)},pe.prototype.toString=function(){return this.__toString(\"List [\",\"]\")},pe.prototype.get=function(t,e){if((t=S(this,t))>=0&&t<this.size){var r=De(this,t+=this._origin);return r&&r.array[t&y]}return e},pe.prototype.set=function(t,e){return function(t,e,r){if((e=S(t,e))!=e)return t;if(e>=t.size||e<0)return t.withMutations(function(t){e<0?Se(t,e).set(0,r):Se(t,0,e+1).set(e,r)});e+=t._origin;var n=t._tail,o=t._root,i=M(b);return e>=xe(t._capacity)?n=ke(n,t.__ownerID,0,e,r,i):o=ke(o,t.__ownerID,t._level,e,r,i),i.value?t.__ownerID?(t._root=o,t._tail=n,t.__hash=void 0,t.__altered=!0,t):Me(t._origin,t._capacity,t._level,o,n):t}(this,t,e)},pe.prototype.remove=function(t){return this.has(t)?0===t?this.shift():t===this.size-1?this.pop():this.splice(t,1):this},pe.prototype.insert=function(t,e){return this.splice(t,0,e)},pe.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=_,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):we()},pe.prototype.push=function(){var t=arguments,e=this.size;return this.withMutations(function(r){Se(r,0,e+t.length);for(var n=0;n<t.length;n++)r.set(e+n,t[n])})},pe.prototype.pop=function(){return Se(this,0,-1)},pe.prototype.unshift=function(){var t=arguments;return this.withMutations(function(e){Se(e,-t.length);for(var r=0;r<t.length;r++)e.set(r,t[r])})},pe.prototype.shift=function(){return Se(this,1)},pe.prototype.merge=function(){return Ce(this,void 0,arguments)},pe.prototype.mergeWith=function(e){var r=t.call(arguments,1);return Ce(this,e,r)},pe.prototype.mergeDeep=function(){return Ce(this,oe,arguments)},pe.prototype.mergeDeepWith=function(e){var r=t.call(arguments,1);return Ce(this,ie(e),r)},pe.prototype.setSize=function(t){return Se(this,0,t)},pe.prototype.slice=function(t,e){var r=this.size;return x(t,e,r)?this:Se(this,A(t,r),I(e,r))},pe.prototype.__iterator=function(t,e){var r=0,n=be(this,e);return new q(function(){var e=n();return e===me?{value:void 0,done:!0}:R(t,r++,e)})},pe.prototype.__iterate=function(t,e){for(var r,n=0,o=be(this,e);(r=o())!==me&&!1!==t(r,n++,this););return n},pe.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Me(this._origin,this._capacity,this._level,this._root,this._tail,t,this.__hash):(this.__ownerID=t,this)},pe.isList=he;var de=\"@@__IMMUTABLE_LIST__@@\",_e=pe.prototype;function ge(t,e){this.array=t,this.ownerID=e}_e[de]=!0,_e.delete=_e.remove,_e.setIn=Ft.setIn,_e.deleteIn=_e.removeIn=Ft.removeIn,_e.update=Ft.update,_e.updateIn=Ft.updateIn,_e.mergeIn=Ft.mergeIn,_e.mergeDeepIn=Ft.mergeDeepIn,_e.withMutations=Ft.withMutations,_e.asMutable=Ft.asMutable,_e.asImmutable=Ft.asImmutable,_e.wasAltered=Ft.wasAltered,ge.prototype.removeBefore=function(t,e,r){if(r===e?1<<e:0===this.array.length)return this;var n=r>>>e&y;if(n>=this.array.length)return new ge([],t);var o,i=0===n;if(e>0){var s=this.array[n];if((o=s&&s.removeBefore(t,e-_,r))===s&&i)return this}if(i&&!o)return this;var u=Ee(this,t);if(!i)for(var a=0;a<n;a++)u.array[a]=void 0;return o&&(u.array[n]=o),u},ge.prototype.removeAfter=function(t,e,r){if(r===(e?1<<e:0)||0===this.array.length)return this;var n,o=r-1>>>e&y;if(o>=this.array.length)return this;if(e>0){var i=this.array[o];if((n=i&&i.removeAfter(t,e-_,r))===i&&o===this.array.length-1)return this}var s=Ee(this,t);return s.array.splice(o+1),n&&(s.array[o]=n),s};var ye,ve,me={};function be(t,e){var r=t._origin,n=t._capacity,o=xe(n),i=t._tail;return s(t._root,t._level,0);function s(t,u,a){return 0===u?function(t,s){var u=s===o?i&&i.array:t&&t.array,a=s>r?0:r-s,c=n-s;return c>g&&(c=g),function(){if(a===c)return me;var t=e?--c:a++;return u&&u[t]}}(t,a):function(t,o,i){var u,a=t&&t.array,c=i>r?0:r-i>>o,l=1+(n-i>>o);return l>g&&(l=g),function(){for(;;){if(u){var t=u();if(t!==me)return t;u=null}if(c===l)return me;var r=e?--l:c++;u=s(a&&a[r],o-_,i+(r<<o))}}}(t,u,a)}}function Me(t,e,r,n,o,i,s){var u=Object.create(_e);return u.size=e-t,u._origin=t,u._capacity=e,u._level=r,u._root=n,u._tail=o,u.__ownerID=i,u.__hash=s,u.__altered=!1,u}function we(){return ye||(ye=Me(0,0,_))}function ke(t,e,r,n,o,i){var s,u=n>>>r&y,a=t&&u<t.array.length;if(!a&&void 0===o)return t;if(r>0){var c=t&&t.array[u],l=ke(c,e,r-_,n,o,i);return l===c?t:((s=Ee(t,e)).array[u]=l,s)}return a&&t.array[u]===o?t:(w(i),s=Ee(t,e),void 0===o&&u===s.array.length-1?s.array.pop():s.array[u]=o,s)}function Ee(t,e){return e&&t&&e===t.ownerID?t:new ge(t?t.array.slice():[],e)}function De(t,e){if(e>=xe(t._capacity))return t._tail;if(e<1<<t._level+_){for(var r=t._root,n=t._level;r&&n>0;)r=r.array[e>>>n&y],n-=_;return r}}function Se(t,e,r){void 0!==e&&(e|=0),void 0!==r&&(r|=0);var n=t.__ownerID||new k,o=t._origin,i=t._capacity,s=o+e,u=void 0===r?i:r<0?i+r:o+r;if(s===o&&u===i)return t;if(s>=u)return t.clear();for(var a=t._level,c=t._root,l=0;s+l<0;)c=new ge(c&&c.array.length?[void 0,c]:[],n),l+=1<<(a+=_);l&&(s+=l,o+=l,u+=l,i+=l);for(var f=xe(i),p=xe(u);p>=1<<a+_;)c=new ge(c&&c.array.length?[c]:[],n),a+=_;var h=t._tail,d=p<f?De(t,u-1):p>f?new ge([],n):h;if(h&&p>f&&s<i&&h.array.length){for(var g=c=Ee(c,n),v=a;v>_;v-=_){var m=f>>>v&y;g=g.array[m]=Ee(g.array[m],n)}g.array[f>>>_&y]=h}if(u<i&&(d=d&&d.removeAfter(n,0,u)),s>=p)s-=p,u-=p,a=_,c=null,d=d&&d.removeBefore(n,0,s);else if(s>o||p<f){for(l=0;c;){var b=s>>>a&y;if(b!==p>>>a&y)break;b&&(l+=(1<<a)*b),a-=_,c=c.array[b]}c&&s>o&&(c=c.removeBefore(n,a,s-l)),c&&p<f&&(c=c.removeAfter(n,a,p-l)),l&&(s-=l,u-=l)}return t.__ownerID?(t.size=u-s,t._origin=s,t._capacity=u,t._level=a,t._root=c,t._tail=d,t.__hash=void 0,t.__altered=!0,t):Me(s,u,a,c,d)}function Ce(t,e,r){for(var n=[],i=0,u=0;u<r.length;u++){var a=r[u],c=o(a);c.size>i&&(i=c.size),s(a)||(c=c.map(function(t){return ft(t)})),n.push(c)}return i>t.size&&(t=t.setSize(i)),se(t,e,n)}function xe(t){return t<g?0:t-1>>>_<<_}function Ae(t){return null===t||void 0===t?je():Ie(t)?t:je().withMutations(function(e){var r=n(t);Pt(r.size),r.forEach(function(t,r){return e.set(r,t)})})}function Ie(t){return Rt(t)&&l(t)}function Ne(t,e,r,n){var o=Object.create(Ae.prototype);return o.size=t?t.size:0,o._map=t,o._list=e,o.__ownerID=r,o.__hash=n,o}function je(){return ve||(ve=Ne(Jt(),we()))}function Te(t,e,r){var n,o,i=t._map,s=t._list,u=i.get(e),a=void 0!==u;if(r===v){if(!a)return t;s.size>=g&&s.size>=2*i.size?(o=s.filter(function(t,e){return void 0!==t&&u!==e}),n=o.toKeyedSeq().map(function(t){return t[0]}).flip().toMap(),t.__ownerID&&(n.__ownerID=o.__ownerID=t.__ownerID)):(n=i.remove(e),o=u===s.size-1?s.pop():s.set(u,void 0))}else if(a){if(r===s.get(u)[1])return t;n=i,o=s.set(u,[e,r])}else n=i.set(e,s.size),o=s.set(s.size,[e,r]);return t.__ownerID?(t.size=n.size,t._map=n,t._list=o,t.__hash=void 0,t):Ne(n,o)}function Oe(t,e){this._iter=t,this._useKeys=e,this.size=t.size}function ze(t){this._iter=t,this.size=t.size}function Le(t){this._iter=t,this.size=t.size}function Pe(t){this._iter=t,this.size=t.size}function qe(t){var e=Xe(t);return e._iter=t,e.size=t.size,e.flip=function(){return t},e.reverse=function(){var e=t.reverse.apply(this);return e.flip=function(){return t.reverse()},e},e.has=function(e){return t.includes(e)},e.includes=function(e){return t.has(e)},e.cacheResult=tr,e.__iterateUncached=function(e,r){var n=this;return t.__iterate(function(t,r){return!1!==e(r,t,n)},r)},e.__iteratorUncached=function(e,r){if(e===O){var n=t.__iterator(e,r);return new q(function(){var t=n.next();if(!t.done){var e=t.value[0];t.value[0]=t.value[1],t.value[1]=e}return t})}return t.__iterator(e===T?j:T,r)},e}function Re(t,e,r){var n=Xe(t);return n.size=t.size,n.has=function(e){return t.has(e)},n.get=function(n,o){var i=t.get(n,v);return i===v?o:e.call(r,i,n,t)},n.__iterateUncached=function(n,o){var i=this;return t.__iterate(function(t,o,s){return!1!==n(e.call(r,t,o,s),o,i)},o)},n.__iteratorUncached=function(n,o){var i=t.__iterator(O,o);return new q(function(){var o=i.next();if(o.done)return o;var s=o.value,u=s[0];return R(n,u,e.call(r,s[1],u,t),o)})},n}function Ue(t,e){var r=Xe(t);return r._iter=t,r.size=t.size,r.reverse=function(){return t},t.flip&&(r.flip=function(){var e=qe(t);return e.reverse=function(){return t.flip()},e}),r.get=function(r,n){return t.get(e?r:-1-r,n)},r.has=function(r){return t.has(e?r:-1-r)},r.includes=function(e){return t.includes(e)},r.cacheResult=tr,r.__iterate=function(e,r){var n=this;return t.__iterate(function(t,r){return e(t,r,n)},!r)},r.__iterator=function(e,r){return t.__iterator(e,!r)},r}function Be(t,e,r,n){var o=Xe(t);return n&&(o.has=function(n){var o=t.get(n,v);return o!==v&&!!e.call(r,o,n,t)},o.get=function(n,o){var i=t.get(n,v);return i!==v&&e.call(r,i,n,t)?i:o}),o.__iterateUncached=function(o,i){var s=this,u=0;return t.__iterate(function(t,i,a){if(e.call(r,t,i,a))return u++,o(t,n?i:u-1,s)},i),u},o.__iteratorUncached=function(o,i){var s=t.__iterator(O,i),u=0;return new q(function(){for(;;){var i=s.next();if(i.done)return i;var a=i.value,c=a[0],l=a[1];if(e.call(r,l,c,t))return R(o,n?c:u++,l,i)}})},o}function Fe(t,e,r,n){var o=t.size;if(void 0!==e&&(e|=0),void 0!==r&&(r===1/0?r=o:r|=0),x(e,r,o))return t;var i=A(e,o),s=I(r,o);if(i!=i||s!=s)return Fe(t.toSeq().cacheResult(),e,r,n);var u,a=s-i;a==a&&(u=a<0?0:a);var c=Xe(t);return c.size=0===u?u:t.size&&u||void 0,!n&&ot(t)&&u>=0&&(c.get=function(e,r){return(e=S(this,e))>=0&&e<u?t.get(e+i,r):r}),c.__iterateUncached=function(e,r){var o=this;if(0===u)return 0;if(r)return this.cacheResult().__iterate(e,r);var s=0,a=!0,c=0;return t.__iterate(function(t,r){if(!a||!(a=s++<i))return c++,!1!==e(t,n?r:c-1,o)&&c!==u}),c},c.__iteratorUncached=function(e,r){if(0!==u&&r)return this.cacheResult().__iterator(e,r);var o=0!==u&&t.__iterator(e,r),s=0,a=0;return new q(function(){for(;s++<i;)o.next();if(++a>u)return{value:void 0,done:!0};var t=o.next();return n||e===T?t:R(e,a-1,e===j?void 0:t.value[1],t)})},c}function Ye(t,e,r,n){var o=Xe(t);return o.__iterateUncached=function(o,i){var s=this;if(i)return this.cacheResult().__iterate(o,i);var u=!0,a=0;return t.__iterate(function(t,i,c){if(!u||!(u=e.call(r,t,i,c)))return a++,o(t,n?i:a-1,s)}),a},o.__iteratorUncached=function(o,i){var s=this;if(i)return this.cacheResult().__iterator(o,i);var u=t.__iterator(O,i),a=!0,c=0;return new q(function(){var t,i,l;do{if((t=u.next()).done)return n||o===T?t:R(o,c++,o===j?void 0:t.value[1],t);var f=t.value;i=f[0],l=f[1],a&&(a=e.call(r,l,i,s))}while(a);return o===O?t:R(o,i,l,t)})},o}function Ge(t,e,r){var n=Xe(t);return n.__iterateUncached=function(n,o){var i=0,u=!1;return function t(a,c){var l=this;a.__iterate(function(o,a){return(!e||c<e)&&s(o)?t(o,c+1):!1===n(o,r?a:i++,l)&&(u=!0),!u},o)}(t,0),i},n.__iteratorUncached=function(n,o){var i=t.__iterator(n,o),u=[],a=0;return new q(function(){for(;i;){var t=i.next();if(!1===t.done){var c=t.value;if(n===O&&(c=c[1]),e&&!(u.length<e)||!s(c))return r?t:R(n,a++,c,t);u.push(i),i=c.__iterator(n,o)}else i=u.pop()}return{value:void 0,done:!0}})},n}function Qe(t,e,r){e||(e=er);var n=u(t),o=0,i=t.toSeq().map(function(e,n){return[n,e,o++,r?r(e,n,t):e]}).toArray();return i.sort(function(t,r){return e(t[3],r[3])||t[2]-r[2]}).forEach(n?function(t,e){i[e].length=2}:function(t,e){i[e]=t[1]}),n?V(i):a(t)?H(i):W(i)}function Ze(t,e,r){if(e||(e=er),r){var n=t.toSeq().map(function(e,n){return[e,r(e,n,t)]}).reduce(function(t,r){return Ve(e,t[1],r[1])?r:t});return n&&n[0]}return t.reduce(function(t,r){return Ve(e,t,r)?r:t})}function Ve(t,e,r){var n=t(r,e);return 0===n&&r!==e&&(void 0===r||null===r||r!=r)||n>0}function He(t,e,n){var o=Xe(t);return o.size=new tt(n).map(function(t){return t.size}).min(),o.__iterate=function(t,e){for(var r,n=this.__iterator(T,e),o=0;!(r=n.next()).done&&!1!==t(r.value,o++,this););return o},o.__iteratorUncached=function(t,o){var i=n.map(function(t){return t=r(t),Y(o?t.reverse():t)}),s=0,u=!1;return new q(function(){var r;return u||(r=i.map(function(t){return t.next()}),u=r.some(function(t){return t.done})),u?{value:void 0,done:!0}:R(t,s++,e.apply(null,r.map(function(t){return t.value})))})},o}function We(t,e){return ot(t)?e:t.constructor(e)}function Ke(t){if(t!==Object(t))throw new TypeError(\"Expected [K, V] tuple: \"+t)}function $e(t){return Pt(t.size),D(t)}function Je(t){return u(t)?n:a(t)?o:i}function Xe(t){return Object.create((u(t)?V:a(t)?H:W).prototype)}function tr(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):Z.prototype.cacheResult.call(this)}function er(t,e){return t>e?1:t<e?-1:0}function rr(t){var e=Y(t);if(!e){if(!Q(t))throw new TypeError(\"Expected iterable or array-like: \"+t);e=Y(r(t))}return e}function nr(t,e){var r,n=function(i){if(i instanceof n)return i;if(!(this instanceof n))return new n(i);if(!r){r=!0;var s=Object.keys(t);!function(t,e){try{e.forEach(function(t,e){Object.defineProperty(t,e,{get:function(){return this.get(e)},set:function(t){yt(this.__ownerID,\"Cannot set on an immutable record.\"),this.set(e,t)}})}.bind(void 0,t))}catch(t){}}(o,s),o.size=s.length,o._name=e,o._keys=s,o._defaultValues=t}this._map=qt(i)},o=n.prototype=Object.create(or);return o.constructor=n,n}e(Ae,qt),Ae.of=function(){return this(arguments)},Ae.prototype.toString=function(){return this.__toString(\"OrderedMap {\",\"}\")},Ae.prototype.get=function(t,e){var r=this._map.get(t);return void 0!==r?this._list.get(r)[1]:e},Ae.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):je()},Ae.prototype.set=function(t,e){return Te(this,t,e)},Ae.prototype.remove=function(t){return Te(this,t,v)},Ae.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},Ae.prototype.__iterate=function(t,e){var r=this;return this._list.__iterate(function(e){return e&&t(e[1],e[0],r)},e)},Ae.prototype.__iterator=function(t,e){return this._list.fromEntrySeq().__iterator(t,e)},Ae.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t),r=this._list.__ensureOwner(t);return t?Ne(e,r,t,this.__hash):(this.__ownerID=t,this._map=e,this._list=r,this)},Ae.isOrderedMap=Ie,Ae.prototype[d]=!0,Ae.prototype.delete=Ae.prototype.remove,e(Oe,V),Oe.prototype.get=function(t,e){return this._iter.get(t,e)},Oe.prototype.has=function(t){return this._iter.has(t)},Oe.prototype.valueSeq=function(){return this._iter.valueSeq()},Oe.prototype.reverse=function(){var t=this,e=Ue(this,!0);return this._useKeys||(e.valueSeq=function(){return t._iter.toSeq().reverse()}),e},Oe.prototype.map=function(t,e){var r=this,n=Re(this,t,e);return this._useKeys||(n.valueSeq=function(){return r._iter.toSeq().map(t,e)}),n},Oe.prototype.__iterate=function(t,e){var r,n=this;return this._iter.__iterate(this._useKeys?function(e,r){return t(e,r,n)}:(r=e?$e(this):0,function(o){return t(o,e?--r:r++,n)}),e)},Oe.prototype.__iterator=function(t,e){if(this._useKeys)return this._iter.__iterator(t,e);var r=this._iter.__iterator(T,e),n=e?$e(this):0;return new q(function(){var o=r.next();return o.done?o:R(t,e?--n:n++,o.value,o)})},Oe.prototype[d]=!0,e(ze,H),ze.prototype.includes=function(t){return this._iter.includes(t)},ze.prototype.__iterate=function(t,e){var r=this,n=0;return this._iter.__iterate(function(e){return t(e,n++,r)},e)},ze.prototype.__iterator=function(t,e){var r=this._iter.__iterator(T,e),n=0;return new q(function(){var e=r.next();return e.done?e:R(t,n++,e.value,e)})},e(Le,W),Le.prototype.has=function(t){return this._iter.includes(t)},Le.prototype.__iterate=function(t,e){var r=this;return this._iter.__iterate(function(e){return t(e,e,r)},e)},Le.prototype.__iterator=function(t,e){var r=this._iter.__iterator(T,e);return new q(function(){var e=r.next();return e.done?e:R(t,e.value,e.value,e)})},e(Pe,V),Pe.prototype.entrySeq=function(){return this._iter.toSeq()},Pe.prototype.__iterate=function(t,e){var r=this;return this._iter.__iterate(function(e){if(e){Ke(e);var n=s(e);return t(n?e.get(1):e[1],n?e.get(0):e[0],r)}},e)},Pe.prototype.__iterator=function(t,e){var r=this._iter.__iterator(T,e);return new q(function(){for(;;){var e=r.next();if(e.done)return e;var n=e.value;if(n){Ke(n);var o=s(n);return R(t,o?n.get(0):n[0],o?n.get(1):n[1],e)}}})},ze.prototype.cacheResult=Oe.prototype.cacheResult=Le.prototype.cacheResult=Pe.prototype.cacheResult=tr,e(nr,bt),nr.prototype.toString=function(){return this.__toString(sr(this)+\" {\",\"}\")},nr.prototype.has=function(t){return this._defaultValues.hasOwnProperty(t)},nr.prototype.get=function(t,e){if(!this.has(t))return e;var r=this._defaultValues[t];return this._map?this._map.get(t,r):r},nr.prototype.clear=function(){if(this.__ownerID)return this._map&&this._map.clear(),this;var t=this.constructor;return t._empty||(t._empty=ir(this,Jt()))},nr.prototype.set=function(t,e){if(!this.has(t))throw new Error('Cannot set unknown key \"'+t+'\" on '+sr(this));if(this._map&&!this._map.has(t)){var r=this._defaultValues[t];if(e===r)return this}var n=this._map&&this._map.set(t,e);return this.__ownerID||n===this._map?this:ir(this,n)},nr.prototype.remove=function(t){if(!this.has(t))return this;var e=this._map&&this._map.remove(t);return this.__ownerID||e===this._map?this:ir(this,e)},nr.prototype.wasAltered=function(){return this._map.wasAltered()},nr.prototype.__iterator=function(t,e){var r=this;return n(this._defaultValues).map(function(t,e){return r.get(e)}).__iterator(t,e)},nr.prototype.__iterate=function(t,e){var r=this;return n(this._defaultValues).map(function(t,e){return r.get(e)}).__iterate(t,e)},nr.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map&&this._map.__ensureOwner(t);return t?ir(this,e,t):(this.__ownerID=t,this._map=e,this)};var or=nr.prototype;function ir(t,e,r){var n=Object.create(Object.getPrototypeOf(t));return n._map=e,n.__ownerID=r,n}function sr(t){return t._name||t.constructor.name||\"Record\"}function ur(t){return null===t||void 0===t?dr():ar(t)&&!l(t)?t:dr().withMutations(function(e){var r=i(t);Pt(r.size),r.forEach(function(t){return e.add(t)})})}function ar(t){return!(!t||!t[lr])}or.delete=or.remove,or.deleteIn=or.removeIn=Ft.removeIn,or.merge=Ft.merge,or.mergeWith=Ft.mergeWith,or.mergeIn=Ft.mergeIn,or.mergeDeep=Ft.mergeDeep,or.mergeDeepWith=Ft.mergeDeepWith,or.mergeDeepIn=Ft.mergeDeepIn,or.setIn=Ft.setIn,or.update=Ft.update,or.updateIn=Ft.updateIn,or.withMutations=Ft.withMutations,or.asMutable=Ft.asMutable,or.asImmutable=Ft.asImmutable,e(ur,wt),ur.of=function(){return this(arguments)},ur.fromKeys=function(t){return this(n(t).keySeq())},ur.prototype.toString=function(){return this.__toString(\"Set {\",\"}\")},ur.prototype.has=function(t){return this._map.has(t)},ur.prototype.add=function(t){return pr(this,this._map.set(t,!0))},ur.prototype.remove=function(t){return pr(this,this._map.remove(t))},ur.prototype.clear=function(){return pr(this,this._map.clear())},ur.prototype.union=function(){var e=t.call(arguments,0);return 0===(e=e.filter(function(t){return 0!==t.size})).length?this:0!==this.size||this.__ownerID||1!==e.length?this.withMutations(function(t){for(var r=0;r<e.length;r++)i(e[r]).forEach(function(e){return t.add(e)})}):this.constructor(e[0])},ur.prototype.intersect=function(){var e=t.call(arguments,0);if(0===e.length)return this;e=e.map(function(t){return i(t)});var r=this;return this.withMutations(function(t){r.forEach(function(r){e.every(function(t){return t.includes(r)})||t.remove(r)})})},ur.prototype.subtract=function(){var e=t.call(arguments,0);if(0===e.length)return this;e=e.map(function(t){return i(t)});var r=this;return this.withMutations(function(t){r.forEach(function(r){e.some(function(t){return t.includes(r)})&&t.remove(r)})})},ur.prototype.merge=function(){return this.union.apply(this,arguments)},ur.prototype.mergeWith=function(e){var r=t.call(arguments,1);return this.union.apply(this,r)},ur.prototype.sort=function(t){return _r(Qe(this,t))},ur.prototype.sortBy=function(t,e){return _r(Qe(this,e,t))},ur.prototype.wasAltered=function(){return this._map.wasAltered()},ur.prototype.__iterate=function(t,e){var r=this;return this._map.__iterate(function(e,n){return t(n,n,r)},e)},ur.prototype.__iterator=function(t,e){return this._map.map(function(t,e){return e}).__iterator(t,e)},ur.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t);return t?this.__make(e,t):(this.__ownerID=t,this._map=e,this)},ur.isSet=ar;var cr,lr=\"@@__IMMUTABLE_SET__@@\",fr=ur.prototype;function pr(t,e){return t.__ownerID?(t.size=e.size,t._map=e,t):e===t._map?t:0===e.size?t.__empty():t.__make(e)}function hr(t,e){var r=Object.create(fr);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r}function dr(){return cr||(cr=hr(Jt()))}function _r(t){return null===t||void 0===t?br():gr(t)?t:br().withMutations(function(e){var r=i(t);Pt(r.size),r.forEach(function(t){return e.add(t)})})}function gr(t){return ar(t)&&l(t)}fr[lr]=!0,fr.delete=fr.remove,fr.mergeDeep=fr.merge,fr.mergeDeepWith=fr.mergeWith,fr.withMutations=Ft.withMutations,fr.asMutable=Ft.asMutable,fr.asImmutable=Ft.asImmutable,fr.__empty=dr,fr.__make=hr,e(_r,ur),_r.of=function(){return this(arguments)},_r.fromKeys=function(t){return this(n(t).keySeq())},_r.prototype.toString=function(){return this.__toString(\"OrderedSet {\",\"}\")},_r.isOrderedSet=gr;var yr,vr=_r.prototype;function mr(t,e){var r=Object.create(vr);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r}function br(){return yr||(yr=mr(je()))}function Mr(t){return null===t||void 0===t?Cr():wr(t)?t:Cr().unshiftAll(t)}function wr(t){return!(!t||!t[Er])}vr[d]=!0,vr.__empty=br,vr.__make=mr,e(Mr,Mt),Mr.of=function(){return this(arguments)},Mr.prototype.toString=function(){return this.__toString(\"Stack [\",\"]\")},Mr.prototype.get=function(t,e){var r=this._head;for(t=S(this,t);r&&t--;)r=r.next;return r?r.value:e},Mr.prototype.peek=function(){return this._head&&this._head.value},Mr.prototype.push=function(){if(0===arguments.length)return this;for(var t=this.size+arguments.length,e=this._head,r=arguments.length-1;r>=0;r--)e={value:arguments[r],next:e};return this.__ownerID?(this.size=t,this._head=e,this.__hash=void 0,this.__altered=!0,this):Sr(t,e)},Mr.prototype.pushAll=function(t){if(0===(t=o(t)).size)return this;Pt(t.size);var e=this.size,r=this._head;return t.reverse().forEach(function(t){e++,r={value:t,next:r}}),this.__ownerID?(this.size=e,this._head=r,this.__hash=void 0,this.__altered=!0,this):Sr(e,r)},Mr.prototype.pop=function(){return this.slice(1)},Mr.prototype.unshift=function(){return this.push.apply(this,arguments)},Mr.prototype.unshiftAll=function(t){return this.pushAll(t)},Mr.prototype.shift=function(){return this.pop.apply(this,arguments)},Mr.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Cr()},Mr.prototype.slice=function(t,e){if(x(t,e,this.size))return this;var r=A(t,this.size),n=I(e,this.size);if(n!==this.size)return Mt.prototype.slice.call(this,t,e);for(var o=this.size-r,i=this._head;r--;)i=i.next;return this.__ownerID?(this.size=o,this._head=i,this.__hash=void 0,this.__altered=!0,this):Sr(o,i)},Mr.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Sr(this.size,this._head,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},Mr.prototype.__iterate=function(t,e){if(e)return this.reverse().__iterate(t);for(var r=0,n=this._head;n&&!1!==t(n.value,r++,this);)n=n.next;return r},Mr.prototype.__iterator=function(t,e){if(e)return this.reverse().__iterator(t);var r=0,n=this._head;return new q(function(){if(n){var e=n.value;return n=n.next,R(t,r++,e)}return{value:void 0,done:!0}})},Mr.isStack=wr;var kr,Er=\"@@__IMMUTABLE_STACK__@@\",Dr=Mr.prototype;function Sr(t,e,r,n){var o=Object.create(Dr);return o.size=t,o._head=e,o.__ownerID=r,o.__hash=n,o.__altered=!1,o}function Cr(){return kr||(kr=Sr(0))}function xr(t,e){var r=function(r){t.prototype[r]=e[r]};return Object.keys(e).forEach(r),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(e).forEach(r),t}Dr[Er]=!0,Dr.withMutations=Ft.withMutations,Dr.asMutable=Ft.asMutable,Dr.asImmutable=Ft.asImmutable,Dr.wasAltered=Ft.wasAltered,r.Iterator=q,xr(r,{toArray:function(){Pt(this.size);var t=new Array(this.size||0);return this.valueSeq().__iterate(function(e,r){t[r]=e}),t},toIndexedSeq:function(){return new ze(this)},toJS:function(){return this.toSeq().map(function(t){return t&&\"function\"==typeof t.toJS?t.toJS():t}).__toJS()},toJSON:function(){return this.toSeq().map(function(t){return t&&\"function\"==typeof t.toJSON?t.toJSON():t}).__toJS()},toKeyedSeq:function(){return new Oe(this,!0)},toMap:function(){return qt(this.toKeyedSeq())},toObject:function(){Pt(this.size);var t={};return this.__iterate(function(e,r){t[r]=e}),t},toOrderedMap:function(){return Ae(this.toKeyedSeq())},toOrderedSet:function(){return _r(u(this)?this.valueSeq():this)},toSet:function(){return ur(u(this)?this.valueSeq():this)},toSetSeq:function(){return new Le(this)},toSeq:function(){return a(this)?this.toIndexedSeq():u(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return Mr(u(this)?this.valueSeq():this)},toList:function(){return pe(u(this)?this.valueSeq():this)},toString:function(){return\"[Iterable]\"},__toString:function(t,e){return 0===this.size?t+e:t+\" \"+this.toSeq().map(this.__toStringMapper).join(\", \")+\" \"+e},concat:function(){var e=t.call(arguments,0);return We(this,function(t,e){var r=u(t),o=[t].concat(e).map(function(t){return s(t)?r&&(t=n(t)):t=r?st(t):ut(Array.isArray(t)?t:[t]),t}).filter(function(t){return 0!==t.size});if(0===o.length)return t;if(1===o.length){var i=o[0];if(i===t||r&&u(i)||a(t)&&a(i))return i}var c=new tt(o);return r?c=c.toKeyedSeq():a(t)||(c=c.toSetSeq()),(c=c.flatten(!0)).size=o.reduce(function(t,e){if(void 0!==t){var r=e.size;if(void 0!==r)return t+r}},0),c}(this,e))},includes:function(t){return this.some(function(e){return dt(e,t)})},entries:function(){return this.__iterator(O)},every:function(t,e){Pt(this.size);var r=!0;return this.__iterate(function(n,o,i){if(!t.call(e,n,o,i))return r=!1,!1}),r},filter:function(t,e){return We(this,Be(this,t,e,!0))},find:function(t,e,r){var n=this.findEntry(t,e);return n?n[1]:r},forEach:function(t,e){return Pt(this.size),this.__iterate(e?t.bind(e):t)},join:function(t){Pt(this.size),t=void 0!==t?\"\"+t:\",\";var e=\"\",r=!0;return this.__iterate(function(n){r?r=!1:e+=t,e+=null!==n&&void 0!==n?n.toString():\"\"}),e},keys:function(){return this.__iterator(j)},map:function(t,e){return We(this,Re(this,t,e))},reduce:function(t,e,r){var n,o;return Pt(this.size),arguments.length<2?o=!0:n=e,this.__iterate(function(e,i,s){o?(o=!1,n=e):n=t.call(r,n,e,i,s)}),n},reduceRight:function(t,e,r){var n=this.toKeyedSeq().reverse();return n.reduce.apply(n,arguments)},reverse:function(){return We(this,Ue(this,!0))},slice:function(t,e){return We(this,Fe(this,t,e,!0))},some:function(t,e){return!this.every(Tr(t),e)},sort:function(t){return We(this,Qe(this,t))},values:function(){return this.__iterator(T)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some(function(){return!0})},count:function(t,e){return D(t?this.toSeq().filter(t,e):this)},countBy:function(t,e){return function(t,e,r){var n=qt().asMutable();return t.__iterate(function(o,i){n.update(e.call(r,o,i,t),0,function(t){return t+1})}),n.asImmutable()}(this,t,e)},equals:function(t){return _t(this,t)},entrySeq:function(){var t=this;if(t._cache)return new tt(t._cache);var e=t.toSeq().map(jr).toIndexedSeq();return e.fromEntrySeq=function(){return t.toSeq()},e},filterNot:function(t,e){return this.filter(Tr(t),e)},findEntry:function(t,e,r){var n=r;return this.__iterate(function(r,o,i){if(t.call(e,r,o,i))return n=[o,r],!1}),n},findKey:function(t,e){var r=this.findEntry(t,e);return r&&r[0]},findLast:function(t,e,r){return this.toKeyedSeq().reverse().find(t,e,r)},findLastEntry:function(t,e,r){return this.toKeyedSeq().reverse().findEntry(t,e,r)},findLastKey:function(t,e){return this.toKeyedSeq().reverse().findKey(t,e)},first:function(){return this.find(C)},flatMap:function(t,e){return We(this,function(t,e,r){var n=Je(t);return t.toSeq().map(function(o,i){return n(e.call(r,o,i,t))}).flatten(!0)}(this,t,e))},flatten:function(t){return We(this,Ge(this,t,!0))},fromEntrySeq:function(){return new Pe(this)},get:function(t,e){return this.find(function(e,r){return dt(r,t)},void 0,e)},getIn:function(t,e){for(var r,n=this,o=rr(t);!(r=o.next()).done;){var i=r.value;if((n=n&&n.get?n.get(i,v):v)===v)return e}return n},groupBy:function(t,e){return function(t,e,r){var n=u(t),o=(l(t)?Ae():qt()).asMutable();t.__iterate(function(i,s){o.update(e.call(r,i,s,t),function(t){return(t=t||[]).push(n?[s,i]:i),t})});var i=Je(t);return o.map(function(e){return We(t,i(e))})}(this,t,e)},has:function(t){return this.get(t,v)!==v},hasIn:function(t){return this.getIn(t,v)!==v},isSubset:function(t){return t=\"function\"==typeof t.includes?t:r(t),this.every(function(e){return t.includes(e)})},isSuperset:function(t){return(t=\"function\"==typeof t.isSubset?t:r(t)).isSubset(this)},keyOf:function(t){return this.findKey(function(e){return dt(e,t)})},keySeq:function(){return this.toSeq().map(Nr).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},lastKeyOf:function(t){return this.toKeyedSeq().reverse().keyOf(t)},max:function(t){return Ze(this,t)},maxBy:function(t,e){return Ze(this,e,t)},min:function(t){return Ze(this,t?Or(t):Pr)},minBy:function(t,e){return Ze(this,e?Or(e):Pr,t)},rest:function(){return this.slice(1)},skip:function(t){return this.slice(Math.max(0,t))},skipLast:function(t){return We(this,this.toSeq().reverse().skip(t).reverse())},skipWhile:function(t,e){return We(this,Ye(this,t,e,!0))},skipUntil:function(t,e){return this.skipWhile(Tr(t),e)},sortBy:function(t,e){return We(this,Qe(this,e,t))},take:function(t){return this.slice(0,Math.max(0,t))},takeLast:function(t){return We(this,this.toSeq().reverse().take(t).reverse())},takeWhile:function(t,e){return We(this,function(t,e,r){var n=Xe(t);return n.__iterateUncached=function(n,o){var i=this;if(o)return this.cacheResult().__iterate(n,o);var s=0;return t.__iterate(function(t,o,u){return e.call(r,t,o,u)&&++s&&n(t,o,i)}),s},n.__iteratorUncached=function(n,o){var i=this;if(o)return this.cacheResult().__iterator(n,o);var s=t.__iterator(O,o),u=!0;return new q(function(){if(!u)return{value:void 0,done:!0};var t=s.next();if(t.done)return t;var o=t.value,a=o[0],c=o[1];return e.call(r,c,a,i)?n===O?t:R(n,a,c,t):(u=!1,{value:void 0,done:!0})})},n}(this,t,e))},takeUntil:function(t,e){return this.takeWhile(Tr(t),e)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=function(t){if(t.size===1/0)return 0;var e=l(t),r=u(t),n=e?1:0;return function(t,e){return e=kt(e,3432918353),e=kt(e<<15|e>>>-15,461845907),e=kt(e<<13|e>>>-13,5),e=kt((e=(e+3864292196|0)^t)^e>>>16,2246822507),e=Et((e=kt(e^e>>>13,3266489909))^e>>>16)}(t.__iterate(r?e?function(t,e){n=31*n+qr(Dt(t),Dt(e))|0}:function(t,e){n=n+qr(Dt(t),Dt(e))|0}:e?function(t){n=31*n+Dt(t)|0}:function(t){n=n+Dt(t)|0}),n)}(this))}});var Ar=r.prototype;Ar[f]=!0,Ar[P]=Ar.values,Ar.__toJS=Ar.toArray,Ar.__toStringMapper=zr,Ar.inspect=Ar.toSource=function(){return this.toString()},Ar.chain=Ar.flatMap,Ar.contains=Ar.includes,xr(n,{flip:function(){return We(this,qe(this))},mapEntries:function(t,e){var r=this,n=0;return We(this,this.toSeq().map(function(o,i){return t.call(e,[i,o],n++,r)}).fromEntrySeq())},mapKeys:function(t,e){var r=this;return We(this,this.toSeq().flip().map(function(n,o){return t.call(e,n,o,r)}).flip())}});var Ir=n.prototype;function Nr(t,e){return e}function jr(t,e){return[e,t]}function Tr(t){return function(){return!t.apply(this,arguments)}}function Or(t){return function(){return-t.apply(this,arguments)}}function zr(t){return\"string\"==typeof t?JSON.stringify(t):String(t)}function Lr(){return E(arguments)}function Pr(t,e){return t<e?1:t>e?-1:0}function qr(t,e){return t^e+2654435769+(t<<6)+(t>>2)|0}return Ir[p]=!0,Ir[P]=Ar.entries,Ir.__toJS=Ar.toObject,Ir.__toStringMapper=function(t,e){return JSON.stringify(e)+\": \"+zr(t)},xr(o,{toKeyedSeq:function(){return new Oe(this,!1)},filter:function(t,e){return We(this,Be(this,t,e,!1))},findIndex:function(t,e){var r=this.findEntry(t,e);return r?r[0]:-1},indexOf:function(t){var e=this.keyOf(t);return void 0===e?-1:e},lastIndexOf:function(t){var e=this.lastKeyOf(t);return void 0===e?-1:e},reverse:function(){return We(this,Ue(this,!1))},slice:function(t,e){return We(this,Fe(this,t,e,!1))},splice:function(t,e){var r=arguments.length;if(e=Math.max(0|e,0),0===r||2===r&&!e)return this;t=A(t,t<0?this.count():this.size);var n=this.slice(0,t);return We(this,1===r?n:n.concat(E(arguments,2),this.slice(t+e)))},findLastIndex:function(t,e){var r=this.findLastEntry(t,e);return r?r[0]:-1},first:function(){return this.get(0)},flatten:function(t){return We(this,Ge(this,t,!1))},get:function(t,e){return(t=S(this,t))<0||this.size===1/0||void 0!==this.size&&t>this.size?e:this.find(function(e,r){return r===t},void 0,e)},has:function(t){return(t=S(this,t))>=0&&(void 0!==this.size?this.size===1/0||t<this.size:-1!==this.indexOf(t))},interpose:function(t){return We(this,function(t,e){var r=Xe(t);return r.size=t.size&&2*t.size-1,r.__iterateUncached=function(r,n){var o=this,i=0;return t.__iterate(function(t,n){return(!i||!1!==r(e,i++,o))&&!1!==r(t,i++,o)},n),i},r.__iteratorUncached=function(r,n){var o,i=t.__iterator(T,n),s=0;return new q(function(){return(!o||s%2)&&(o=i.next()).done?o:s%2?R(r,s++,e):R(r,s++,o.value,o)})},r}(this,t))},interleave:function(){var t=[this].concat(E(arguments)),e=He(this.toSeq(),H.of,t),r=e.flatten(!0);return e.size&&(r.size=e.size*t.length),We(this,r)},keySeq:function(){return vt(0,this.size)},last:function(){return this.get(-1)},skipWhile:function(t,e){return We(this,Ye(this,t,e,!1))},zip:function(){return We(this,He(this,Lr,[this].concat(E(arguments))))},zipWith:function(t){var e=E(arguments);return e[0]=this,We(this,He(this,t,e))}}),o.prototype[h]=!0,o.prototype[d]=!0,xr(i,{get:function(t,e){return this.has(t)?t:e},includes:function(t){return this.has(t)},keySeq:function(){return this.valueSeq()}}),i.prototype.has=Ar.includes,i.prototype.contains=i.prototype.includes,xr(V,n.prototype),xr(H,o.prototype),xr(W,i.prototype),xr(bt,n.prototype),xr(Mt,o.prototype),xr(wt,i.prototype),{Iterable:r,Seq:Z,Collection:mt,Map:qt,OrderedMap:Ae,List:pe,Stack:Mr,Set:ur,OrderedSet:_r,Record:nr,Range:vt,Repeat:gt,is:dt,fromJS:ft}}()},function(t,e,r){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.MESSAGE_BOX_SCROLL_DURATION=e.PROP_TYPES=e.MESSAGES_TYPES=e.MESSAGE_SENDER=void 0;var n=i(r(1)),o=i(r(14));function i(t){return t&&t.__esModule?t:{default:t}}var s=e.MESSAGE_SENDER={CLIENT:\"client\",RESPONSE:\"response\"},u=e.MESSAGES_TYPES={TEXT:\"text\",SNIPPET:{LINK:\"snippet\"},CUSTOM_COMPONENT:\"component\"};e.PROP_TYPES={MESSAGE:o.default.contains({type:n.default.oneOf([u.TEXT,u.SNIPPET.LINK]),text:n.default.string,sender:n.default.oneOf([s.CLIENT,s.RESPONSE])}),SNIPPET:o.default.contains({type:n.default.oneOf([u.TEXT,u.SNIPPET.LINK]),title:n.default.string,link:n.default.string,sender:n.default.oneOf([s.CLIENT,s.RESPONSE])})},e.MESSAGE_BOX_SCROLL_DURATION=400},function(t,e,r){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});e.TOGGLE_CHAT=\"BEHAVIOR/TOGGLE_CHAT\",e.TOGGLE_INPUT_DISABLED=\"BEHAVIOR/TOGGLE_INPUT_DISABLED\",e.TOGGLE_MSG_LOADER=\"BEHAVIOR/TOGGLE_MSG_LOADER\",e.ADD_NEW_USER_MESSAGE=\"MESSAGES/ADD_NEW_USER_MESSAGE\",e.ADD_NEW_RESPONSE_MESSAGE=\"MESSAGES/ADD_NEW_RESPONSE_MESSAGE\",e.ADD_NEW_LINK_SNIPPET=\"MESSAGES/ADD_NEW_LINK_SNIPPET\",e.ADD_COMPONENT_MESSAGE=\"MESSAGES/ADD_COMPONENT_MESSAGE\",e.DROP_MESSAGES=\"MESSAGES/DROP_MESSAGES\",e.HIDE_AVATAR=\"MESSAGES/HIDE_AVATAR\",e.SET_QUICK_BUTTONS=\"SET_QUICK_BUTTONS\"},function(t,e,r){\"use strict\";t.exports=function(t,e,r,n,o,i,s,u){if(!t){var a;if(void 0===e)a=new Error(\"Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.\");else{var c=[r,n,o,i,s,u],l=0;(a=new Error(e.replace(/%s/g,function(){return c[l++]}))).name=\"Invariant Violation\"}throw a.framesToPop=1,a}}},function(t,e,r){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});e.createReducer=function(t,e,r){return t[r.type]?t[r.type](e,r):e}},function(t,e,r){\"use strict\";function n(t,e,r){this.type=t,this.tag=e,this.attrs=null,this.map=null,this.nesting=r,this.level=0,this.children=null,this.content=\"\",this.markup=\"\",this.info=\"\",this.meta=null,this.block=!1,this.hidden=!1}n.prototype.attrIndex=function(t){var e,r,n;if(!this.attrs)return-1;for(r=0,n=(e=this.attrs).length;r<n;r++)if(e[r][0]===t)return r;return-1},n.prototype.attrPush=function(t){this.attrs?this.attrs.push(t):this.attrs=[t]},n.prototype.attrSet=function(t,e){var r=this.attrIndex(t),n=[t,e];r<0?this.attrPush(n):this.attrs[r]=n},n.prototype.attrGet=function(t){var e=this.attrIndex(t),r=null;return e>=0&&(r=this.attrs[e][1]),r},n.prototype.attrJoin=function(t,e){var r=this.attrIndex(t);r<0?this.attrPush([t,e]):this.attrs[r][1]=this.attrs[r][1]+\" \"+e},t.exports=n},function(t,e,r){\"use strict\";function n(){this.__rules__=[],this.__cache__=null}n.prototype.__find__=function(t){for(var e=0;e<this.__rules__.length;e++)if(this.__rules__[e].name===t)return e;return-1},n.prototype.__compile__=function(){var t=this,e=[\"\"];t.__rules__.forEach(function(t){t.enabled&&t.alt.forEach(function(t){e.indexOf(t)<0&&e.push(t)})}),t.__cache__={},e.forEach(function(e){t.__cache__[e]=[],t.__rules__.forEach(function(r){r.enabled&&(e&&r.alt.indexOf(e)<0||t.__cache__[e].push(r.fn))})})},n.prototype.at=function(t,e,r){var n=this.__find__(t),o=r||{};if(-1===n)throw new Error(\"Parser rule not found: \"+t);this.__rules__[n].fn=e,this.__rules__[n].alt=o.alt||[],this.__cache__=null},n.prototype.before=function(t,e,r,n){var o=this.__find__(t),i=n||{};if(-1===o)throw new Error(\"Parser rule not found: \"+t);this.__rules__.splice(o,0,{name:e,enabled:!0,fn:r,alt:i.alt||[]}),this.__cache__=null},n.prototype.after=function(t,e,r,n){var o=this.__find__(t),i=n||{};if(-1===o)throw new Error(\"Parser rule not found: \"+t);this.__rules__.splice(o+1,0,{name:e,enabled:!0,fn:r,alt:i.alt||[]}),this.__cache__=null},n.prototype.push=function(t,e,r){var n=r||{};this.__rules__.push({name:t,enabled:!0,fn:e,alt:n.alt||[]}),this.__cache__=null},n.prototype.enable=function(t,e){Array.isArray(t)||(t=[t]);var r=[];return t.forEach(function(t){var n=this.__find__(t);if(n<0){if(e)return;throw new Error(\"Rules manager: invalid rule name \"+t)}this.__rules__[n].enabled=!0,r.push(t)},this),this.__cache__=null,r},n.prototype.enableOnly=function(t,e){Array.isArray(t)||(t=[t]),this.__rules__.forEach(function(t){t.enabled=!1}),this.enable(t,e)},n.prototype.disable=function(t,e){Array.isArray(t)||(t=[t]);var r=[];return t.forEach(function(t){var n=this.__find__(t);if(n<0){if(e)return;throw new Error(\"Rules manager: invalid rule name \"+t)}this.__rules__[n].enabled=!1,r.push(t)},this),this.__cache__=null,r},n.prototype.getRules=function(t){return null===this.__cache__&&this.__compile__(),this.__cache__[t]||[]},t.exports=n},function(t,e){t.exports=/[!-#%-\\*,-/:;\\?@\\[-\\]_\\{\\}\\xA1\\xA7\\xAB\\xB6\\xB7\\xBB\\xBF\\u037E\\u0387\\u055A-\\u055F\\u0589\\u058A\\u05BE\\u05C0\\u05C3\\u05C6\\u05F3\\u05F4\\u0609\\u060A\\u060C\\u060D\\u061B\\u061E\\u061F\\u066A-\\u066D\\u06D4\\u0700-\\u070D\\u07F7-\\u07F9\\u0830-\\u083E\\u085E\\u0964\\u0965\\u0970\\u09FD\\u0AF0\\u0DF4\\u0E4F\\u0E5A\\u0E5B\\u0F04-\\u0F12\\u0F14\\u0F3A-\\u0F3D\\u0F85\\u0FD0-\\u0FD4\\u0FD9\\u0FDA\\u104A-\\u104F\\u10FB\\u1360-\\u1368\\u1400\\u166D\\u166E\\u169B\\u169C\\u16EB-\\u16ED\\u1735\\u1736\\u17D4-\\u17D6\\u17D8-\\u17DA\\u1800-\\u180A\\u1944\\u1945\\u1A1E\\u1A1F\\u1AA0-\\u1AA6\\u1AA8-\\u1AAD\\u1B5A-\\u1B60\\u1BFC-\\u1BFF\\u1C3B-\\u1C3F\\u1C7E\\u1C7F\\u1CC0-\\u1CC7\\u1CD3\\u2010-\\u2027\\u2030-\\u2043\\u2045-\\u2051\\u2053-\\u205E\\u207D\\u207E\\u208D\\u208E\\u2308-\\u230B\\u2329\\u232A\\u2768-\\u2775\\u27C5\\u27C6\\u27E6-\\u27EF\\u2983-\\u2998\\u29D8-\\u29DB\\u29FC\\u29FD\\u2CF9-\\u2CFC\\u2CFE\\u2CFF\\u2D70\\u2E00-\\u2E2E\\u2E30-\\u2E49\\u3001-\\u3003\\u3008-\\u3011\\u3014-\\u301F\\u3030\\u303D\\u30A0\\u30FB\\uA4FE\\uA4FF\\uA60D-\\uA60F\\uA673\\uA67E\\uA6F2-\\uA6F7\\uA874-\\uA877\\uA8CE\\uA8CF\\uA8F8-\\uA8FA\\uA8FC\\uA92E\\uA92F\\uA95F\\uA9C1-\\uA9CD\\uA9DE\\uA9DF\\uAA5C-\\uAA5F\\uAADE\\uAADF\\uAAF0\\uAAF1\\uABEB\\uFD3E\\uFD3F\\uFE10-\\uFE19\\uFE30-\\uFE52\\uFE54-\\uFE61\\uFE63\\uFE68\\uFE6A\\uFE6B\\uFF01-\\uFF03\\uFF05-\\uFF0A\\uFF0C-\\uFF0F\\uFF1A\\uFF1B\\uFF1F\\uFF20\\uFF3B-\\uFF3D\\uFF3F\\uFF5B\\uFF5D\\uFF5F-\\uFF65]|\\uD800[\\uDD00-\\uDD02\\uDF9F\\uDFD0]|\\uD801\\uDD6F|\\uD802[\\uDC57\\uDD1F\\uDD3F\\uDE50-\\uDE58\\uDE7F\\uDEF0-\\uDEF6\\uDF39-\\uDF3F\\uDF99-\\uDF9C]|\\uD804[\\uDC47-\\uDC4D\\uDCBB\\uDCBC\\uDCBE-\\uDCC1\\uDD40-\\uDD43\\uDD74\\uDD75\\uDDC5-\\uDDC9\\uDDCD\\uDDDB\\uDDDD-\\uDDDF\\uDE38-\\uDE3D\\uDEA9]|\\uD805[\\uDC4B-\\uDC4F\\uDC5B\\uDC5D\\uDCC6\\uDDC1-\\uDDD7\\uDE41-\\uDE43\\uDE60-\\uDE6C\\uDF3C-\\uDF3E]|\\uD806[\\uDE3F-\\uDE46\\uDE9A-\\uDE9C\\uDE9E-\\uDEA2]|\\uD807[\\uDC41-\\uDC45\\uDC70\\uDC71]|\\uD809[\\uDC70-\\uDC74]|\\uD81A[\\uDE6E\\uDE6F\\uDEF5\\uDF37-\\uDF3B\\uDF44]|\\uD82F\\uDC9F|\\uD836[\\uDE87-\\uDE8B]|\\uD83A[\\uDD5E\\uDD5F]/},function(t,e,r){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.createNewMessage=function(t,e){return(0,n.Map)({type:o.MESSAGES_TYPES.TEXT,component:i.default,text:t,sender:e,showAvatar:e===o.MESSAGE_SENDER.RESPONSE})},e.createLinkSnippet=function(t){return(0,n.Map)({type:o.MESSAGES_TYPES.SNIPPET.LINK,component:s.default,title:t.title,link:t.link,target:t.target||\"_blank\",sender:o.MESSAGE_SENDER.RESPONSE,showAvatar:!0})},e.createComponentMessage=function(t,e,r){return(0,n.Map)({type:o.MESSAGES_TYPES.CUSTOM_COMPONENT,component:t,props:e,sender:o.MESSAGE_SENDER.RESPONSE,showAvatar:r})},e.scrollToBottom=function(t){if(!t)return;var e=t.clientHeight,r=t.scrollTop,n=t.scrollHeight-(r+e);n&&function(t,e,r){var n=window.webkitRequestAnimationFrame||window.requestAnimationFrame,i=null;n(function s(u){i||(i=u);var a=function(t,e,r,n){return r*((t=t/n-1)*t*t+1)+e}(u-i,0,r,o.MESSAGE_BOX_SCROLL_DURATION),c=e+a;t.scrollTop=c,c<e+r&&n(s)})}(t,r,n)},e.createQuickButton=function(t){return(0,n.Map)({component:u.default,label:t.label,value:t.value})};var n=r(5),o=r(6),i=a(r(126)),s=a(r(64)),u=a(r(61));function a(t){return t&&t.__esModule?t:{default:t}}},function(t,e,r){\"use strict\";var n=r(5),o=\"<<anonymous>>\",i={listOf:function(t){return c(t,\"List\",n.List.isList)},mapOf:function(t,e){return l(t,e,\"Map\",n.Map.isMap)},orderedMapOf:function(t,e){return l(t,e,\"OrderedMap\",n.OrderedMap.isOrderedMap)},setOf:function(t){return c(t,\"Set\",n.Set.isSet)},orderedSetOf:function(t){return c(t,\"OrderedSet\",n.OrderedSet.isOrderedSet)},stackOf:function(t){return c(t,\"Stack\",n.Stack.isStack)},iterableOf:function(t){return c(t,\"Iterable\",n.Iterable.isIterable)},recordOf:function(t){return u(function(e,r,o,i,u){for(var a=arguments.length,c=Array(a>5?a-5:0),l=5;l<a;l++)c[l-5]=arguments[l];var f=e[r];if(!(f instanceof n.Record)){var p=s(f),h=i;return new Error(\"Invalid \"+h+\" `\"+u+\"` of type `\"+p+\"` supplied to `\"+o+\"`, expected an Immutable.js Record.\")}for(var d in t){var _=t[d];if(_){var g=f.toObject(),y=_.apply(void 0,[g,d,o,i,u+\".\"+d].concat(c));if(y)return y}}})},shape:p,contains:p,mapContains:function(t){return f(t,\"Map\",n.Map.isMap)},list:a(\"List\",n.List.isList),map:a(\"Map\",n.Map.isMap),orderedMap:a(\"OrderedMap\",n.OrderedMap.isOrderedMap),set:a(\"Set\",n.Set.isSet),orderedSet:a(\"OrderedSet\",n.OrderedSet.isOrderedSet),stack:a(\"Stack\",n.Stack.isStack),seq:a(\"Seq\",n.Seq.isSeq),record:a(\"Record\",function(t){return t instanceof n.Record}),iterable:a(\"Iterable\",n.Iterable.isIterable)};function s(t){var e=typeof t;return Array.isArray(t)?\"array\":t instanceof RegExp?\"object\":t instanceof n.Iterable?\"Immutable.\"+t.toSource().split(\" \")[0]:e}function u(t){function e(e,r,n,i,s,u){for(var a=arguments.length,c=Array(a>6?a-6:0),l=6;l<a;l++)c[l-6]=arguments[l];return u=u||n,i=i||o,null!=r[n]?t.apply(void 0,[r,n,i,s,u].concat(c)):e?new Error(\"Required \"+s+\" `\"+u+\"` was not specified in `\"+i+\"`.\"):void 0}var r=e.bind(null,!1);return r.isRequired=e.bind(null,!0),r}function a(t,e){return u(function(r,n,o,i,u){var a=r[n];if(!e(a)){var c=s(a);return new Error(\"Invalid \"+i+\" `\"+u+\"` of type `\"+c+\"` supplied to `\"+o+\"`, expected `\"+t+\"`.\")}return null})}function c(t,e,r){return u(function(n,o,i,u,a){for(var c=arguments.length,l=Array(c>5?c-5:0),f=5;f<c;f++)l[f-5]=arguments[f];var p=n[o];if(!r(p)){var h=u,d=s(p);return new Error(\"Invalid \"+h+\" `\"+a+\"` of type `\"+d+\"` supplied to `\"+i+\"`, expected an Immutable.js \"+e+\".\")}if(\"function\"!=typeof t)return new Error(\"Invalid typeChecker supplied to `\"+i+\"` for propType `\"+a+\"`, expected a function.\");for(var _=p.toArray(),g=0,y=_.length;g<y;g++){var v=t.apply(void 0,[_,g,i,u,a+\"[\"+g+\"]\"].concat(l));if(v instanceof Error)return v}})}function l(t,e,r,n){return u(function(){for(var o=arguments.length,i=Array(o),s=0;s<o;s++)i[s]=arguments[s];return c(t,r,n).apply(void 0,i)||e&&function(t){return u(function(e,r,n,o,i){for(var s=arguments.length,u=Array(s>5?s-5:0),a=5;a<s;a++)u[a-5]=arguments[a];var c=e[r];if(\"function\"!=typeof t)return new Error(\"Invalid keysTypeChecker (optional second argument) supplied to `\"+n+\"` for propType `\"+i+\"`, expected a function.\");for(var l=c.keySeq().toArray(),f=0,p=l.length;f<p;f++){var h=t.apply(void 0,[l,f,n,o,i+\" -> key(\"+l[f]+\")\"].concat(u));if(h instanceof Error)return h}})}(e).apply(void 0,i)})}function f(t){var e=void 0===arguments[1]?\"Iterable\":arguments[1],r=void 0===arguments[2]?n.Iterable.isIterable:arguments[2];return u(function(n,o,i,u,a){for(var c=arguments.length,l=Array(c>5?c-5:0),f=5;f<c;f++)l[f-5]=arguments[f];var p=n[o];if(!r(p)){var h=s(p);return new Error(\"Invalid \"+u+\" `\"+a+\"` of type `\"+h+\"` supplied to `\"+i+\"`, expected an Immutable.js \"+e+\".\")}var d=p.toObject();for(var _ in t){var g=t[_];if(g){var y=g.apply(void 0,[d,_,i,u,a+\".\"+_].concat(l));if(y)return y}}})}function p(t){return f(t)}t.exports=i},function(t,e,r){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.toggleChat=function(){return{type:n.TOGGLE_CHAT}},e.toggleInputDisabled=function(){return{type:n.TOGGLE_INPUT_DISABLED}},e.addUserMessage=function(t){return{type:n.ADD_NEW_USER_MESSAGE,text:t}},e.addResponseMessage=function(t){return{type:n.ADD_NEW_RESPONSE_MESSAGE,text:t}},e.toggleMsgLoader=function(){return{type:n.TOGGLE_MSG_LOADER}},e.addLinkSnippet=function(t){return{type:n.ADD_NEW_LINK_SNIPPET,link:t}},e.renderCustomComponent=function(t,e,r){return{type:n.ADD_COMPONENT_MESSAGE,component:t,props:e,showAvatar:r}},e.dropMessages=function(){return{type:n.DROP_MESSAGES}},e.hideAvatar=function(){return{type:n.HIDE_AVATAR}},e.setQuickButtons=function(t){return{type:n.SET_QUICK_BUTTONS,buttons:t}};var n=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(r(7))},function(t,e){var r;r=function(){return this}();try{r=r||Function(\"return this\")()||(0,eval)(\"this\")}catch(t){\"object\"==typeof window&&(r=window)}t.exports=r},function(t,e,r){\"use strict\";r.r(e);var n=r(4),o=r(18),i={INIT:\"@@redux/INIT\"};function s(t,e,r){var u;if(\"function\"==typeof e&&void 0===r&&(r=e,e=void 0),void 0!==r){if(\"function\"!=typeof r)throw new Error(\"Expected the enhancer to be a function.\");return r(s)(t,e)}if(\"function\"!=typeof t)throw new Error(\"Expected the reducer to be a function.\");var a=t,c=e,l=[],f=l,p=!1;function h(){f===l&&(f=l.slice())}function d(){return c}function _(t){if(\"function\"!=typeof t)throw new Error(\"Expected listener to be a function.\");var e=!0;return h(),f.push(t),function(){if(e){e=!1,h();var r=f.indexOf(t);f.splice(r,1)}}}function g(t){if(!Object(n.a)(t))throw new Error(\"Actions must be plain objects. Use custom middleware for async actions.\");if(void 0===t.type)throw new Error('Actions may not have an undefined \"type\" property. Have you misspelled a constant?');if(p)throw new Error(\"Reducers may not dispatch actions.\");try{p=!0,c=a(c,t)}finally{p=!1}for(var e=l=f,r=0;r<e.length;r++){(0,e[r])()}return t}return g({type:i.INIT}),(u={dispatch:g,subscribe:_,getState:d,replaceReducer:function(t){if(\"function\"!=typeof t)throw new Error(\"Expected the nextReducer to be a function.\");a=t,g({type:i.INIT})}})[o.a]=function(){var t,e=_;return(t={subscribe:function(t){if(\"object\"!=typeof t)throw new TypeError(\"Expected the observer to be an object.\");function r(){t.next&&t.next(d())}return r(),{unsubscribe:e(r)}}})[o.a]=function(){return this},t},u}function u(t,e){var r=e&&e.type;return\"Given action \"+(r&&'\"'+r.toString()+'\"'||\"an action\")+', reducer \"'+t+'\" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.'}function a(t){for(var e=Object.keys(t),r={},n=0;n<e.length;n++){var o=e[n];0,\"function\"==typeof t[o]&&(r[o]=t[o])}var s=Object.keys(r);var a=void 0;try{!function(t){Object.keys(t).forEach(function(e){var r=t[e];if(void 0===r(void 0,{type:i.INIT}))throw new Error('Reducer \"'+e+\"\\\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.\");if(void 0===r(void 0,{type:\"@@redux/PROBE_UNKNOWN_ACTION_\"+Math.random().toString(36).substring(7).split(\"\").join(\".\")}))throw new Error('Reducer \"'+e+\"\\\" returned undefined when probed with a random type. Don't try to handle \"+i.INIT+' or other actions in \"redux/*\" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.')})}(r)}catch(t){a=t}return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments[1];if(a)throw a;for(var n=!1,o={},i=0;i<s.length;i++){var c=s[i],l=r[c],f=t[c],p=l(f,e);if(void 0===p){var h=u(c,e);throw new Error(h)}o[c]=p,n=n||p!==f}return n?o:t}}function c(t,e){return function(){return e(t.apply(void 0,arguments))}}function l(t,e){if(\"function\"==typeof t)return c(t,e);if(\"object\"!=typeof t||null===t)throw new Error(\"bindActionCreators expected an object or a function, instead received \"+(null===t?\"null\":typeof t)+'. Did you write \"import ActionCreators from\" instead of \"import * as ActionCreators from\"?');for(var r=Object.keys(t),n={},o=0;o<r.length;o++){var i=r[o],s=t[i];\"function\"==typeof s&&(n[i]=c(s,e))}return n}function f(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return 0===e.length?function(t){return t}:1===e.length?e[0]:e.reduce(function(t,e){return function(){return t(e.apply(void 0,arguments))}})}var p=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t};function h(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return function(t){return function(r,n,o){var i,s=t(r,n,o),u=s.dispatch,a={getState:s.getState,dispatch:function(t){return u(t)}};return i=e.map(function(t){return t(a)}),u=f.apply(void 0,i)(s.dispatch),p({},s,{dispatch:u})}}}r.d(e,\"createStore\",function(){return s}),r.d(e,\"combineReducers\",function(){return a}),r.d(e,\"bindActionCreators\",function(){return l}),r.d(e,\"applyMiddleware\",function(){return h}),r.d(e,\"compose\",function(){return f})},function(t,e,r){\"use strict\";(function(t,n){var o,i=r(30);o=\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:void 0!==t?t:n;var s=Object(i.a)(o);e.a=s}).call(this,r(16),r(134)(t))},function(t,e,r){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});var n=r(17),o=u(r(35)),i=u(r(34)),s=u(r(33));function u(t){return t&&t.__esModule?t:{default:t}}var a=(0,n.combineReducers)({behavior:o.default,messages:i.default,quickButtons:s.default});e.default=(0,n.createStore)(a,\"\")},function(t,e,r){\"use strict\";t.exports.tokenize=function(t,e){var r,n,o=t.pos,i=t.src.charCodeAt(o);if(e)return!1;if(95!==i&&42!==i)return!1;for(n=t.scanDelims(t.pos,42===i),r=0;r<n.length;r++)t.push(\"text\",\"\",0).content=String.fromCharCode(i),t.delimiters.push({marker:i,length:n.length,jump:r,token:t.tokens.length-1,level:t.level,end:-1,open:n.can_open,close:n.can_close});return t.pos+=n.length,!0},t.exports.postProcess=function(t){var e,r,n,o,i,s,u=t.delimiters;for(e=t.delimiters.length-1;e>=0;e--)95!==(r=u[e]).marker&&42!==r.marker||-1!==r.end&&(n=u[r.end],s=e>0&&u[e-1].end===r.end+1&&u[e-1].token===r.token-1&&u[r.end+1].token===n.token+1&&u[e-1].marker===r.marker,i=String.fromCharCode(r.marker),(o=t.tokens[r.token]).type=s?\"strong_open\":\"em_open\",o.tag=s?\"strong\":\"em\",o.nesting=1,o.markup=s?i+i:i,o.content=\"\",(o=t.tokens[n.token]).type=s?\"strong_close\":\"em_close\",o.tag=s?\"strong\":\"em\",o.nesting=-1,o.markup=s?i+i:i,o.content=\"\",s&&(t.tokens[u[e-1].token].content=\"\",t.tokens[u[r.end+1].token].content=\"\",e--))}},function(t,e,r){\"use strict\";t.exports.tokenize=function(t,e){var r,n,o,i,s=t.pos,u=t.src.charCodeAt(s);if(e)return!1;if(126!==u)return!1;if(o=(n=t.scanDelims(t.pos,!0)).length,i=String.fromCharCode(u),o<2)return!1;for(o%2&&(t.push(\"text\",\"\",0).content=i,o--),r=0;r<o;r+=2)t.push(\"text\",\"\",0).content=i+i,t.delimiters.push({marker:u,jump:r,token:t.tokens.length-1,level:t.level,end:-1,open:n.can_open,close:n.can_close});return t.pos+=n.length,!0},t.exports.postProcess=function(t){var e,r,n,o,i,s=[],u=t.delimiters,a=t.delimiters.length;for(e=0;e<a;e++)126===(n=u[e]).marker&&-1!==n.end&&(o=u[n.end],(i=t.tokens[n.token]).type=\"s_open\",i.tag=\"s\",i.nesting=1,i.markup=\"~~\",i.content=\"\",(i=t.tokens[o.token]).type=\"s_close\",i.tag=\"s\",i.nesting=-1,i.markup=\"~~\",i.content=\"\",\"text\"===t.tokens[o.token-1].type&&\"~\"===t.tokens[o.token-1].content&&s.push(o.token-1));for(;s.length;){for(r=(e=s.pop())+1;r<t.tokens.length&&\"s_close\"===t.tokens[r].type;)r++;e!==--r&&(i=t.tokens[r],t.tokens[r]=t.tokens[e],t.tokens[e]=i)}}},function(t,e,r){\"use strict\";var n=\"<[A-Za-z][A-Za-z0-9\\\\-]*(?:\\\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\\\s*=\\\\s*(?:[^\\\"'=<>`\\\\x00-\\\\x20]+|'[^']*'|\\\"[^\\\"]*\\\"))?)*\\\\s*\\\\/?>\",o=\"<\\\\/[A-Za-z][A-Za-z0-9\\\\-]*\\\\s*>\",i=new RegExp(\"^(?:\"+n+\"|\"+o+\"|\\x3c!----\\x3e|\\x3c!--(?:-?[^>-])(?:-?[^-])*--\\x3e|<[?].*?[?]>|<![A-Z]+\\\\s+[^>]*>|<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?\\\\]\\\\]>)\"),s=new RegExp(\"^(?:\"+n+\"|\"+o+\")\");t.exports.HTML_TAG_RE=i,t.exports.HTML_OPEN_CLOSE_TAG_RE=s},function(t,e){t.exports=/[ \\xA0\\u1680\\u2000-\\u200A\\u202F\\u205F\\u3000]/},function(t,e){t.exports=/[\\0-\\x1F\\x7F-\\x9F]/},function(t,e){t.exports=/[\\0-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF]/},function(t,e,r){\"use strict\";t.exports.encode=r(122),t.exports.decode=r(121),t.exports.format=r(120),t.exports.parse=r(119)},function(t,e,r){\"use strict\";t.exports=r(123)},function(t,e){t.exports=\"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjUxMnB4IiBoZWlnaHQ9IjUxMnB4IiB2aWV3Qm94PSIwIDAgMzU3IDM1NyIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMzU3IDM1NzsiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8Zz4KCTxnIGlkPSJjbGVhciI+CgkJPHBvbHlnb24gcG9pbnRzPSIzNTcsMzUuNyAzMjEuMywwIDE3OC41LDE0Mi44IDM1LjcsMCAwLDM1LjcgMTQyLjgsMTc4LjUgMCwzMjEuMyAzNS43LDM1NyAxNzguNSwyMTQuMiAzMjEuMywzNTcgMzU3LDMyMS4zICAgICAyMTQuMiwxNzguNSAgICIgZmlsbD0iI0ZGRkZGRiIvPgoJPC9nPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+Cjwvc3ZnPgo=\"},function(t,e,r){\"use strict\";(function(t){var r=\"object\"==typeof t&&t&&t.Object===Object&&t;e.a=r}).call(this,r(16))},function(t,e,r){\"use strict\";function n(t){var e,r=t.Symbol;return\"function\"==typeof r?r.observable?e=r.observable:(e=r(\"observable\"),r.observable=e):e=\"@@observable\",e}r.d(e,\"a\",function(){return n})},function(t,e,r){\"use strict\";var n={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i=Object.defineProperty,s=Object.getOwnPropertyNames,u=Object.getOwnPropertySymbols,a=Object.getOwnPropertyDescriptor,c=Object.getPrototypeOf,l=c&&c(Object);t.exports=function t(e,r,f){if(\"string\"!=typeof r){if(l){var p=c(r);p&&p!==l&&t(e,p,f)}var h=s(r);u&&(h=h.concat(u(r)));for(var d=0;d<h.length;++d){var _=h[d];if(!(n[_]||o[_]||f&&f[_])){var g=a(r,_);try{i(e,_,g)}catch(t){}}}return e}return e}},function(t,e,r){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.addUserMessage=function(t){n.default.dispatch(o.addUserMessage(t))},e.addResponseMessage=function(t){n.default.dispatch(o.addResponseMessage(t))},e.addLinkSnippet=function(t){n.default.dispatch(o.addLinkSnippet(t))},e.toggleMsgLoader=function(){n.default.dispatch(o.toggleMsgLoader())},e.renderCustomComponent=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];n.default.dispatch(o.renderCustomComponent(t,e,r))},e.toggleWidget=function(){n.default.dispatch(o.toggleChat())},e.toggleInputDisabled=function(){n.default.dispatch(o.toggleInputDisabled())},e.dropMessages=function(){n.default.dispatch(o.dropMessages())},e.isWidgetOpened=function(){return n.default.getState().behavior.get(\"showChat\")},e.setQuickButtons=function(t){n.default.dispatch(o.setQuickButtons(t))};var n=function(t){return t&&t.__esModule?t:{default:t}}(r(19)),o=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(r(15))},function(t,e,r){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});var n=r(5),o=r(9),i=r(13),s=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(r(7));var u=(0,n.List)([]),a=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}({},s.SET_QUICK_BUTTONS,function(t,e){return(0,n.List)(e.buttons.map(function(t){return(0,i.createQuickButton)(t)}))});e.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u,e=arguments[1];return(0,o.createReducer)(a,t,e)}},function(t,e,r){\"use strict\";var n;Object.defineProperty(e,\"__esModule\",{value:!0});var o=r(5),i=r(9),s=r(13),u=r(6),a=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(r(7));function c(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var l=(0,o.List)([]),f=(c(n={},a.ADD_NEW_USER_MESSAGE,function(t,e){var r=e.text;return t.push((0,s.createNewMessage)(r,u.MESSAGE_SENDER.CLIENT))}),c(n,a.ADD_NEW_RESPONSE_MESSAGE,function(t,e){var r=e.text;return t.push((0,s.createNewMessage)(r,u.MESSAGE_SENDER.RESPONSE))}),c(n,a.ADD_NEW_LINK_SNIPPET,function(t,e){var r=e.link;return t.push((0,s.createLinkSnippet)(r,u.MESSAGE_SENDER.RESPONSE))}),c(n,a.ADD_COMPONENT_MESSAGE,function(t,e){var r=e.component,n=e.props,o=e.showAvatar;return t.push((0,s.createComponentMessage)(r,n,o))}),c(n,a.DROP_MESSAGES,function(){return(0,o.List)([])}),c(n,a.HIDE_AVATAR,function(t,e){var r=e.index;return t.update(r,function(t){return t.set(\"showAvatar\",!1)})}),n);e.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,e=arguments[1];return(0,i.createReducer)(f,t,e)}},function(t,e,r){\"use strict\";var n;Object.defineProperty(e,\"__esModule\",{value:!0});var o=r(5),i=r(9),s=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(r(7));function u(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var a=(0,o.Map)({showChat:!1,disabledInput:!1,msgLoader:!1}),c=(u(n={},s.TOGGLE_CHAT,function(t){return t.update(\"showChat\",function(t){return!t})}),u(n,s.TOGGLE_INPUT_DISABLED,function(t){return t.update(\"disabledInput\",function(t){return!t})}),u(n,s.TOGGLE_MSG_LOADER,function(t){return t.update(\"msgLoader\",function(t){return!t})}),n);e.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,e=arguments[1];return(0,i.createReducer)(c,t,e)}},,function(t,e,r){},,function(t,e,r){},,function(t,e,r){},function(t,e,r){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});var n=i(r(2)),o=i(r(1));function i(t){return t&&t.__esModule?t:{default:t}}r(41);var s=function(t){var e=t.badge;return e>0&&n.default.createElement(\"span\",{className:\"rcw-badge\"},e)};s.propTypes={badge:o.default.number},e.default=s},function(t,e){t.exports=\"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMzRweCIgaGVpZ2h0PSIzMnB4IiB2aWV3Qm94PSIwIDAgMzQgMzIiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDQ1LjEgKDQzNTA0KSAtIGh0dHA6Ly93d3cuYm9oZW1pYW5jb2RpbmcuY29tL3NrZXRjaCAtLT4KICAgIDx0aXRsZT5pY19idXR0b248L3RpdGxlPgogICAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+CiAgICA8ZGVmcz48L2RlZnM+CiAgICA8ZyBpZD0iUGFnZS0xIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0iRGVza3RvcC1IRCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTEyOTkuMDAwMDAwLCAtNzQ4LjAwMDAwMCkiIGZpbGwtcnVsZT0ibm9uemVybyIgZmlsbD0iI0ZGRkZGRiI+CiAgICAgICAgICAgIDxnIGlkPSJHcm91cC0yIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMjg5LjAwMDAwMCwgNzM1LjAwMDAwMCkiPgogICAgICAgICAgICAgICAgPGcgaWQ9ImljX2J1dHRvbiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTAuMjA2OTMzLCAxMy42MDc4MjUpIj4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMjUuNzg2NTM5OCw3LjM3MDUxODYzIEMyNS43ODY1Mzk4LDguNDA4MDMxMTggMjUuMDQzMjAyNiw5LjAzOTAxMDkgMjQuNTAwNDE2MSw5LjUwMjA1NjQyIEMyNC4yOTQ4NTE3LDkuNjc3NDQzODggMjMuOTEyMjI3MSw5Ljk5NzQ2MjMgMjMuOTEzMjQ4NCwxMC4xMTY5OTc1IEMyMy45MTY5NjIzLDEwLjU4NTg5MjQgMjMuNTQ1OTQzNiwxMC45NjAzNDc5IDIzLjA4NDM5ODYsMTAuOTYwMzQ3OSBDMjMuMDgyMDc3NSwxMC45NjAzNDc5IDIzLjA3OTc1NjMsMTAuOTYwMzQ3OSAyMy4wNzc0MzUxLDEwLjk2MDM0NzkgQzIyLjYxOTEzOTgsMTAuOTYwMzQ3OSAyMi4yNDU3MDcxLDEwLjU5NzQwMjUgMjIuMjQxOTkzMiwxMC4xMzA4NjYyIEMyMi4yMzQ2NTgyLDkuMjExMjg0OTcgMjIuODk1MDgyNiw4LjY2MDU5Mjg5IDIzLjQyNTc5ODksOC4yMDc4MzA5OCBDMjMuODQyMjIsNy44NTI1Mjc1MSAyNC4xMTUyODQ2LDcuNjAyNTEzMTEgMjQuMTE1Mjg0Niw3LjM3MzcyNjM2IEMyNC4xMTUyODQ2LDYuOTEwNTg2NDkgMjMuNzQ0NDUxNiw2LjUzMzc3MjM1IDIzLjI4ODY2MzIsNi41MzM3NzIzNSBDMjIuODMyNjg5LDYuNTMzNzcyMzUgMjIuNDYxNzYzMiw2LjkxMDU4NjQ5IDIyLjQ2MTc2MzIsNy4zNzM3MjYzNiBDMjIuNDYxNzYzMiw3Ljg0MjcxNTYyIDIyLjA4NzY4MDYsOC4yMjI4MzE4NCAyMS42MjYxMzU2LDguMjIyODMxODQgQzIxLjE2NDU5MDYsOC4yMjI4MzE4NCAyMC43OTA1MDgsNy44NDI3MTU2MiAyMC43OTA1MDgsNy4zNzM3MjYzNiBDMjAuNzkwNTA4LDUuOTc0MjExODMgMjEuOTExMDg0Niw0LjgzNTU2MTM4IDIzLjI4ODQ3NzUsNC44MzU1NjEzOCBDMjQuNjY1OTYzMiw0LjgzNTQ2NzAzIDI1Ljc4NjUzOTgsNS45NzA5MDk3NiAyNS43ODY1Mzk4LDcuMzcwNTE4NjMgWiBNMjMuMTAwNTU0MSwxMS43NDQxNjY2IEMyMi42MzkwMDkxLDExLjc0NDE2NjYgMjIuMjgzNDAzMSwxMi4xMjQyODI4IDIyLjI4MzQwMzEsMTIuNTkzMjcyMSBMMjIuMjgzNDAzMSwxMi41OTk3ODE5IEMyMi4yODM0MDMxLDEzLjA2ODc3MTIgMjIuNjM5MTAyLDEzLjQ0NTY3OTcgMjMuMTAwNTU0MSwxMy40NDU2Nzk3IEMyMy41NjIwMDYzLDEzLjQ0NTY3OTcgMjMuOTM2MTgxNywxMy4wNjIyNjE0IDIzLjkzNjE4MTcsMTIuNTkzMjcyMSBDMjMuOTM2MTgxNywxMi4xMjQyODI4IDIzLjU2MjA5OTEsMTEuNzQ0MTY2NiAyMy4xMDA1NTQxLDExLjc0NDE2NjYgWiBNNi4yNTcxNzk2LDE3LjY1ODk0MTEgQzUuNzk1NjM0NjIsMTcuNjU4OTQxMSA1LjQyMTU1MTk5LDE4LjAzOTA1NzMgNS40MjE1NTE5OSwxOC41MDgwNDY2IEM1LjQyMTU1MTk5LDE4Ljk3NzAzNTggNS43OTU2MzQ2MiwxOS4zNTcxNTIgNi4yNTcxNzk2LDE5LjM1NzE1MiBMNi4zMjY4MTUyNCwxOS4zNTcxNTIgQzYuNzg4MzYwMjMsMTkuMzU3MTUyIDcuMTYyNDQyODYsMTguOTc3MDM1OCA3LjE2MjQ0Mjg2LDE4LjUwODA0NjYgQzcuMTYyNDQyODYsMTguMDM5MDU3MyA2Ljc4ODM2MDIzLDE3LjY1ODk0MTEgNi4zMjY4MTUyNCwxNy42NTg5NDExIEw2LjI1NzE3OTYsMTcuNjU4OTQxMSBaIE05LjE2MTM1Njk3LDE3LjY1ODk0MTEgQzguNjk5ODExOTgsMTcuNjU4OTQxMSA4LjMyNTcyOTM1LDE4LjAzOTA1NzMgOC4zMjU3MjkzNSwxOC41MDgwNDY2IEM4LjMyNTcyOTM1LDE4Ljk3NzAzNTggOC42OTk4MTE5OCwxOS4zNTcxNTIgOS4xNjEzNTY5NywxOS4zNTcxNTIgTDkuMjMwODk5NzUsMTkuMzU3MTUyIEM5LjY5MjQ0NDc0LDE5LjM1NzE1MiAxMC4wNjY1Mjc0LDE4Ljk3NzAzNTggMTAuMDY2NTI3NCwxOC41MDgwNDY2IEMxMC4wNjY1Mjc0LDE4LjAzOTA1NzMgOS42OTI0NDQ3NCwxNy42NTg5NDExIDkuMjMwODk5NzUsMTcuNjU4OTQxMSBMOS4xNjEzNTY5NywxNy42NTg5NDExIFogTTMzLjcwMzY0NzMsNC4wOTY5MzM5NSBMMzMuNzAzNjQ3MywxMy42NTQxODIyIEMzMy43MDM2NDczLDE1LjkxNzA0ODMgMzEuOTE4MDAzOSwxNy43NTMyODYxIDI5LjY5MTA1NjMsMTcuNzUzMjg2MSBMMTguODU0MTczMSwxNy43NTMyODYxIEMxOC42NDIyOTUxLDE3Ljc1MzI4NjEgMTguNDY3ODM0NiwxNy43NTIwNTk2IDE4LjMyMTg3ODMsMTcuNzQ4OTQ2MyBDMTguMTY4OTU4NSwxNy43NDU3Mzg1IDE3Ljk5NjgxOTIsMTcuNzQ0NTEyIDE3LjkyOTY5MDQsMTcuNzUyMDU5NiBDMTcuODU5Nzc2MiwxNy43OTkyMzIyIDE3LjY4ODM3OTcsMTcuOTU4NzY5NyAxNy41MjMyMDQsMTguMTEzNDAxMiBDMTcuNDU3NzQ2NSwxOC4xNzQ2MzExIDE3LjM4MzY1NDIsMTguMjQxOTkzNSAxNy4zMDM3MTI1LDE4LjMxNjE0ODcgTDE0LjIzNzcwMTksMjEuMTU1NzQ2MSBDMTMuOTkzMTQxNSwyMS4zODI0NTczIDEzLjYzMTMxNDgsMjEuNDQxMTM5OSAxMy4zMjg0NDYyLDIxLjMwNTQ3MTcgQzEzLjAyNTU3NzYsMjEuMTY5NzA5MiAxMi44MTI5NTY4LDIwLjg2NDk3NDcgMTIuODEyOTU2OCwyMC41Mjg2MzQ2IEwxMi44MTI5NTY4LDExLjUyNjUxMjYgTDQuMDU5MjkzMjcsMTEuNTI2NTEyNiBDMi43NTM2NzE1NCwxMS41MjY1MTI2IDEuNjcxMjU1MjQsMTIuNjEzNjUwNiAxLjY3MTI1NTI0LDEzLjk0MDE0MjEgTDEuNjcxMjU1MjQsMjMuNDk3MzkwNCBDMS42NzEyNTUyNCwyNC44MjM5NzYyIDIuNzUzNzY0MzksMjUuODY2OTYwNyA0LjA1OTI5MzI3LDI1Ljg2Njk2MDcgTDE2LjE2NDE5NDksMjUuODY2OTYwNyBDMTYuMzcyNjM3NiwyNS44NjY5NjA3IDE2LjU2NzYxNzQsMjUuOTY0MjMwNSAxNi43MjE1NTg2LDI2LjEwNzA2ODkgTDE5LjIxOTQzNTIsMjguNDQ3MjAzNiBMMTkuMjE5NDM1MiwyMC4zNzcwMjIxIEMxOS4yMTk0MzUyLDE5LjkwODAzMjggMTkuNTkzNTE3OCwxOS41Mjc5MTY2IDIwLjA1NTA2MjgsMTkuNTI3OTE2NiBDMjAuNTE2NjA3OCwxOS41Mjc5MTY2IDIwLjg5MDY5MDUsMTkuOTA4MDMyOCAyMC44OTA2OTA1LDIwLjM3NzAyMjEgTDIwLjg5MDY5MDUsMzAuMzcxNzQ4NCBDMjAuODkwNjkwNSwzMC43MDgwODg1IDIwLjcwMTI4MTUsMzEuMDA4Mjk0NCAyMC4zOTgzMjAxLDMxLjE0NDA1NyBDMjAuMjg5OTY3LDMxLjE5MjY0NDcgMjAuMTgxMTQ5OCwzMS4yMTE3OTY3IDIwLjA2NzIyNTksMzEuMjExNzk2NyBDMTkuODYyNTg5OSwzMS4yMTE3OTY3IDE5LjY2MDczOTQsMzEuMTI2NDE0NCAxOS41MDM3MzQzLDMwLjk4MDc0NTcgTDE1Ljg0MDI1LDI3LjU2NTA3NzQgTDQuMDU5MjkzMjcsMjcuNTY1MDc3NCBDMS44MzIyNTI4MiwyNy41NjUwNzc0IDAsMjUuNzYwMjU2NSAwLDIzLjQ5NzI5NiBMMCwxMy45NDAxNDIxIEMwLDExLjY3NzI3NiAxLjgzMjI1MjgyLDkuODI4MzAxNjIgNC4wNTkyOTMyNyw5LjgyODMwMTYyIEwxMi44MTI5NTY4LDkuODI4MzAxNjIgTDEyLjgxMjk1NjgsNC4wOTY5MzM5NSBDMTIuODEyOTU2OCwxLjgzMzk3MzUgMTQuNjU5MjI5NiwwLjAxNjQxNjAzOTMgMTYuODg2MjcwMSwwLjAxNjQxNjAzOTMgTDI5LjY5MTE0OTEsMC4wMTY0MTYwMzkzIEMzMS45MTgwMDM5LDAuMDE2NDE2MDM5MyAzMy43MDM2NDczLDEuODMzOTczNSAzMy43MDM2NDczLDQuMDk2OTMzOTUgWiBNMzIuMDMyMzkyLDQuMDk2OTMzOTUgQzMyLjAzMjM5MiwyLjc3MDM0ODE2IDMwLjk5NjQ5MjMsMS43MTQ2MjcgMjkuNjkxMDU2MywxLjcxNDYyNyBMMTYuODg2MjcwMSwxLjcxNDYyNyBDMTUuNTgwNzQxMiwxLjcxNDYyNyAxNC40ODQyMTIsMi43NzAzNDgxNiAxNC40ODQyMTIsNC4wOTY5MzM5NSBMMTQuNDg0MjEyLDEwLjY4NTMzMjEgTDE0LjQ4NDIxMiwxOC42MDQwODk4IEwxNi4xNjQyODc4LDE3LjA2MTI2NTIgQzE2LjI0MjA5NCwxNi45ODkwOTEyIDE2LjMyOTI3NzgsMTYuOTIzMDQ5NyAxNi4zOTI4Nzg0LDE2Ljg2MzQyMzYgQzE3LjE2MDA3NzQsMTYuMTQ1MDgwMyAxNy4zNTYzNTcsMTYuMDMwMjYyNCAxOC4zNTcwNjc1LDE2LjA1MTIwNyBDMTguNDkzNTUzNCwxNi4wNTQxMzE3IDE4LjY1NjEyOTQsMTYuMDU1MTY5NSAxOC44NTQxNzMxLDE2LjA1NTE2OTUgTDI5LjY5MTA1NjMsMTYuMDU1MTY5NSBDMzAuOTk2NDkyMywxNi4wNTUxNjk1IDMyLjAzMjM5MiwxNC45ODA3NjggMzIuMDMyMzkyLDEzLjY1NDI3NjYgTDMyLjAzMjM5Miw0LjA5NjkzMzk1IFoiIGlkPSJTaGFwZSI+PC9wYXRoPgogICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICA8L2c+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4=\"},function(t,e,r){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});var n=c(r(2)),o=c(r(1)),i=r(3),s=c(r(43)),u=c(r(28)),a=c(r(42));function c(t){return t&&t.__esModule?t:{default:t}}r(39);var l=function(t){var e=t.toggle,r=t.chatOpened,o=t.badge;return n.default.createElement(\"button\",{type:\"button\",className:r?\"rcw-launcher rcw-hide-sm\":\"rcw-launcher\",onClick:e},n.default.createElement(a.default,{badge:o}),r?n.default.createElement(\"img\",{src:u.default,className:\"rcw-close-launcher\",alt:\"\"}):n.default.createElement(\"img\",{src:s.default,className:\"rcw-open-launcher\",alt:\"\"}))};l.propTypes={toggle:o.default.func,chatOpened:o.default.bool,badge:o.default.number},e.default=(0,i.connect)(function(t){return{chatOpened:t.behavior.get(\"showChat\")}})(l)},,function(t,e,r){},,function(t,e,r){},function(t,e,r){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});var n=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,\"value\"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),o=r(2),i=a(o),s=a(r(14)),u=r(3);function a(t){return t&&t.__esModule?t:{default:t}}r(48);var c=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!e||\"object\"!=typeof e&&\"function\"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return r.getComponentToRender=r.getComponentToRender.bind(r),r}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,o.Component),n(e,[{key:\"getComponentToRender\",value:function(t){var e=t.get(\"component\");return i.default.createElement(e,{onQuickButtonClicked:this.props.onQuickButtonClicked,button:t})}},{key:\"render\",value:function(){var t=this;return this.props.buttons.size?i.default.createElement(\"div\",{className:\"quick-buttons-container\"},i.default.createElement(\"ul\",{className:\"quick-buttons\"},this.props.buttons.map(function(e,r){return i.default.createElement(\"li\",{className:\"quick-list-button\",key:r},t.getComponentToRender(e))}))):null}}]),e}();c.propTypes={buttons:s.default.listOf(s.default.map)},e.default=(0,u.connect)(function(t){return{buttons:t.quickButtons}})(c)},,function(t,e,r){},function(t,e){t.exports=\"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjUxMnB4IiBoZWlnaHQ9IjUxMnB4IiB2aWV3Qm94PSIwIDAgNTM1LjUgNTM1LjUiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDUzNS41IDUzNS41OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxnPgoJPGcgaWQ9InNlbmQiPgoJCTxwb2x5Z29uIHBvaW50cz0iMCw0OTcuMjUgNTM1LjUsMjY3Ljc1IDAsMzguMjUgMCwyMTYuNzUgMzgyLjUsMjY3Ljc1IDAsMzE4Ljc1ICAgIiBmaWxsPSIjY2JjYmNiIi8+Cgk8L2c+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPC9zdmc+Cg==\"},function(t,e,r){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});var n=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,\"value\"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),o=r(2),i=a(o),s=a(r(1)),u=a(r(52));function a(t){return t&&t.__esModule?t:{default:t}}function c(t,e){if(!t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!e||\"object\"!=typeof e&&\"function\"!=typeof e?t:e}r(51);var l=function(t){function e(){var t,r,n;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e);for(var o=arguments.length,s=Array(o),u=0;u<o;u++)s[u]=arguments[u];return r=n=c(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(s))),n.input=i.default.createRef(),c(n,r)}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,o.Component),n(e,[{key:\"componentDidUpdate\",value:function(){this.input.current.focus()}},{key:\"render\",value:function(){var t=this.props,e=t.sendMessage,r=t.placeholder,n=t.disabledInput,o=t.autofocus;return i.default.createElement(\"form\",{className:\"rcw-sender\",onSubmit:e},i.default.createElement(\"input\",{type:\"text\",className:\"rcw-new-message\",name:\"message\",placeholder:r,disabled:n,autoFocus:o,autoComplete:\"off\",ref:this.input}),i.default.createElement(\"button\",{type:\"submit\",className:\"rcw-send\"},i.default.createElement(\"img\",{src:u.default,className:\"rcw-send-icon\",alt:\"send\"})))}}]),e}();l.propTypes={sendMessage:s.default.func,placeholder:s.default.string,disabledInput:s.default.bool,autofocus:s.default.bool},e.default=l},,function(t,e,r){},,function(t,e,r){},function(t,e,r){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});var n=i(r(2)),o=i(r(1));function i(t){return t&&t.__esModule?t:{default:t}}r(57);var s=function(t){return n.default.createElement(\"div\",{className:\"loader \"+(t.typing&&\"active\")},n.default.createElement(\"div\",{className:\"loader-container\"},n.default.createElement(\"span\",{className:\"loader-dots\"}),n.default.createElement(\"span\",{className:\"loader-dots\"}),n.default.createElement(\"span\",{className:\"loader-dots\"})))};s.propTypes={typing:o.default.bool},e.default=s},,function(t,e,r){},function(t,e,r){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});var n=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,\"value\"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),o=r(2),i=u(o),s=u(r(1));function u(t){return t&&t.__esModule?t:{default:t}}r(60);var a=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),function(t,e){if(!t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!e||\"object\"!=typeof e&&\"function\"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,o.PureComponent),n(e,[{key:\"render\",value:function(){var t=this;return i.default.createElement(\"button\",{className:\"quick-button\",onClick:function(e){return t.props.onQuickButtonClicked(e,t.props.button.get(\"value\"))}},this.props.button.get(\"label\"))}}]),e}();a.propTypes={label:s.default.string,value:s.default.string},e.default=a},,function(t,e,r){},function(t,e,r){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});var n=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,\"value\"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),o=r(2),i=function(t){return t&&t.__esModule?t:{default:t}}(o),s=r(6);r(63);var u=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),function(t,e){if(!t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!e||\"object\"!=typeof e&&\"function\"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,o.PureComponent),n(e,[{key:\"render\",value:function(){return i.default.createElement(\"div\",{className:\"rcw-snippet\"},i.default.createElement(\"h5\",{className:\"rcw-snippet-title\"},this.props.message.get(\"title\")),i.default.createElement(\"div\",{className:\"rcw-snippet-details\"},i.default.createElement(\"a\",{href:this.props.message.get(\"link\"),target:this.props.message.get(\"target\"),className:\"rcw-link\"},this.props.message.get(\"link\"))))}}]),e}();u.propTypes={message:s.PROP_TYPES.SNIPPET},e.default=u},,function(t,e,r){},function(t,e,r){\"use strict\";function n(t,e){e=e?Array.isArray(e)?e:[e]:[],Object.freeze(e);var r=t.renderer.rules.link_open||this.defaultRender;t.renderer.rules.link_open=function(t,n,o,i,s){var u=function(t,e){var r,n,o=t.attrs[t.attrIndex(\"href\")][1];for(r=0;r<e.length;++r)if(!(n=e[r]).pattern||new RegExp(n.pattern).test(o))return n}(t[n],e),a=u&&u.attrs;return a&&function(t,e,r){Object.keys(r).forEach(function(n){var o,i=r[n];\"className\"===n&&(n=\"class\"),(o=e[t].attrIndex(n))<0?e[t].attrPush([n,i]):e[t].attrs[o][1]=i})}(n,t,a),r(t,n,o,i,s)}}n.defaultRender=function(t,e,r,n,o){return o.renderToken(t,e,r)},t.exports=n},function(t,e,r){\"use strict\";t.exports=function(t,e){var r,n=t.linkify,o=t.utils.escapeHtml,i=RegExp('<a\\\\s([^<>]*href=\"[^\"<>]*\"[^<>]*)\\\\s?>',\"i\"),s=RegExp('<img\\\\s([^<>]*src=\"[^\"<>]*\"[^<>]*)\\\\s?\\\\/?>',\"i\"),u=/^(?:https?:)?\\/\\//i,a=/^(?:https?:\\/\\/|ftp:\\/\\/|\\/\\/|mailto:|xmpp:)/i,c=void 0!==(e=e||{}).removeUnknown&&e.removeUnknown,l=void 0!==e.removeUnbalanced&&e.removeUnbalanced,f=void 0!==e.imageClass?e.imageClass:\"\",p=!1,h=[\"a\",\"b\",\"blockquote\",\"code\",\"em\",\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\",\"li\",\"ol\",\"p\",\"pre\",\"s\",\"sub\",\"sup\",\"strong\",\"ul\"],d=new Array(h.length),_=new Array(h.length);for(r=0;r<h.length;r++)d[r]=0;for(r=0;r<h.length;r++)_[r]=!1;function g(t){var e=n.match(t);return e&&1===e.length&&0===e[0].index&&e[0].lastIndex===t.length?e[0].url:null}function y(t){return t=t.replace(/<[^<>]*>?/gi,function(t){var e,r,n,l,y,v;return/(^<->|^<-\\s|^<3\\s)/.test(t)?t:(e=t.match(s))&&(n=g((r=e[1]).match(/src=\"([^\"<>]*)\"/i)[1]),l=(l=r.match(/alt=\"([^\"<>]*)\"/i))&&void 0!==l[1]?l[1]:\"\",y=(y=r.match(/title=\"([^\"<>]*)\"/i))&&void 0!==y[1]?y[1]:\"\",n&&u.test(n))?\"\"!==f?'<img src=\"'+n+'\" alt=\"'+l+'\" title=\"'+y+'\" class=\"'+f+'\">':'<img src=\"'+n+'\" alt=\"'+l+'\" title=\"'+y+'\">':(v=h.indexOf(\"a\"),(e=t.match(i))&&(n=g((r=e[1]).match(/href=\"([^\"<>]*)\"/i)[1]),y=(y=r.match(/title=\"([^\"<>]*)\"/i))&&void 0!==y[1]?y[1]:\"\",n&&a.test(n))?(p=!0,d[v]+=1,'<a href=\"'+n+'\" title=\"'+y+'\" target=\"_blank\">'):(e=/<\\/a>/i.test(t))?(p=!0,d[v]-=1,d[v]<0&&(_[v]=!0),\"</a>\"):(e=t.match(/<(br|hr)\\s?\\/?>/i))?\"<\"+e[1].toLowerCase()+\">\":(e=t.match(/<(\\/?)(b|blockquote|code|em|h[1-6]|li|ol(?: start=\"\\d+\")?|p|pre|s|sub|sup|strong|ul)>/i))&&!/<\\/ol start=\"\\d+\"/i.test(t)?(p=!0,v=h.indexOf(e[2].toLowerCase().split(\" \")[0]),\"/\"===e[1]?d[v]-=1:d[v]+=1,d[v]<0&&(_[v]=!0),\"<\"+e[1]+e[2].toLowerCase()+\">\"):!0===c?\"\":o(t))})}t.core.ruler.after(\"linkify\",\"sanitize_inline\",function(t){var e,n,o;for(r=0;r<h.length;r++)d[r]=0;for(r=0;r<h.length;r++)_[r]=!1;for(p=!1,n=0;n<t.tokens.length;n++)if(\"html_block\"===t.tokens[n].type&&(t.tokens[n].content=y(t.tokens[n].content)),\"inline\"===t.tokens[n].type)for(o=t.tokens[n].children,e=0;e<o.length;e++)\"html_inline\"===o[e].type&&(o[e].content=y(o[e].content))}),t.core.ruler.after(\"sanitize_inline\",\"sanitize_balance\",function(t){if(!1!==p){var e,n;for(r=0;r<h.length;r++)0!==d[r]&&(_[r]=!0);for(e=0;e<t.tokens.length;e++)if(\"html_block\"!==t.tokens[e].type){if(\"inline\"===t.tokens[e].type)for(n=t.tokens[e].children,r=0;r<n.length;r++)\"html_inline\"===n[r].type&&(n[r].content=s(n[r].content))}else t.tokens[e].content=s(t.tokens[e].content)}function i(t,e){var r,n;return r=\"a\"===e?RegExp('<a href=\"[^\"<>]*\" title=\"[^\"<>]*\" target=\"_blank\">',\"g\"):\"ol\"===e?/<ol(?: start=\"\\d+\")?>/g:RegExp(\"<\"+e+\">\",\"g\"),n=RegExp(\"</\"+e+\">\",\"g\"),t=!0===l?(t=t.replace(r,\"\")).replace(n,\"\"):(t=t.replace(r,function(t){return o(t)})).replace(n,function(t){return o(t)})}function s(t){var e;for(e=0;e<h.length;e++)!0===_[e]&&(t=i(t,h[e]));return t}})}},function(t,e,r){\"use strict\";var n=/\\\\([ \\\\!\"#$%&'()*+,.\\/:;<=>?@[\\]^_`{|}~-])/g;function o(t,e){var r,o,i=t.posMax,s=t.pos;if(94!==t.src.charCodeAt(s))return!1;if(e)return!1;if(s+2>=i)return!1;for(t.pos=s+1;t.pos<i;){if(94===t.src.charCodeAt(t.pos)){r=!0;break}t.md.inline.skipToken(t)}return r&&s+1!==t.pos?(o=t.src.slice(s+1,t.pos)).match(/(^|[^\\\\])(\\\\\\\\)*\\s/)?(t.pos=s,!1):(t.posMax=t.pos,t.pos=s+1,t.push(\"sup_open\",\"sup\",1).markup=\"^\",t.push(\"text\",\"\",0).content=o.replace(n,\"$1\"),t.push(\"sup_close\",\"sup\",-1).markup=\"^\",t.pos=t.posMax+1,t.posMax=i,!0):(t.pos=s,!1)}t.exports=function(t){t.inline.ruler.after(\"emphasis\",\"sup\",o)}},function(t,e,r){\"use strict\";t.exports={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:\"language-\",linkify:!1,typographer:!1,quotes:\"“”‘’\",highlight:null,maxNesting:20},components:{core:{rules:[\"normalize\",\"block\",\"inline\"]},block:{rules:[\"blockquote\",\"code\",\"fence\",\"heading\",\"hr\",\"html_block\",\"lheading\",\"list\",\"reference\",\"paragraph\"]},inline:{rules:[\"autolink\",\"backticks\",\"emphasis\",\"entity\",\"escape\",\"html_inline\",\"image\",\"link\",\"newline\",\"text\"],rules2:[\"balance_pairs\",\"emphasis\",\"text_collapse\"]}}}},function(t,e,r){\"use strict\";t.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:\"language-\",linkify:!1,typographer:!1,quotes:\"“”‘’\",highlight:null,maxNesting:20},components:{core:{rules:[\"normalize\",\"block\",\"inline\"]},block:{rules:[\"paragraph\"]},inline:{rules:[\"text\"],rules2:[\"balance_pairs\",\"text_collapse\"]}}}},function(t,e,r){\"use strict\";t.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:\"language-\",linkify:!1,typographer:!1,quotes:\"“”‘’\",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}}},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,\"loaded\",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,\"id\",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,r){(function(t,n){var o;/*! https://mths.be/punycode v1.4.1 by @mathias */!function(i){\"object\"==typeof e&&e&&e.nodeType,\"object\"==typeof t&&t&&t.nodeType;var s=\"object\"==typeof n&&n;s.global!==s&&s.window!==s&&s.self;var u,a=2147483647,c=36,l=1,f=26,p=38,h=700,d=72,_=128,g=\"-\",y=/^xn--/,v=/[^\\x20-\\x7E]/,m=/[\\x2E\\u3002\\uFF0E\\uFF61]/g,b={overflow:\"Overflow: input needs wider integers to process\",\"not-basic\":\"Illegal input >= 0x80 (not a basic code point)\",\"invalid-input\":\"Invalid input\"},M=c-l,w=Math.floor,k=String.fromCharCode;function E(t){throw new RangeError(b[t])}function D(t,e){for(var r=t.length,n=[];r--;)n[r]=e(t[r]);return n}function S(t,e){var r=t.split(\"@\"),n=\"\";return r.length>1&&(n=r[0]+\"@\",t=r[1]),n+D((t=t.replace(m,\".\")).split(\".\"),e).join(\".\")}function C(t){for(var e,r,n=[],o=0,i=t.length;o<i;)(e=t.charCodeAt(o++))>=55296&&e<=56319&&o<i?56320==(64512&(r=t.charCodeAt(o++)))?n.push(((1023&e)<<10)+(1023&r)+65536):(n.push(e),o--):n.push(e);return n}function x(t){return D(t,function(t){var e=\"\";return t>65535&&(e+=k((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=k(t)}).join(\"\")}function A(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:c}function I(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function N(t,e,r){var n=0;for(t=r?w(t/h):t>>1,t+=w(t/e);t>M*f>>1;n+=c)t=w(t/M);return w(n+(M+1)*t/(t+p))}function j(t){var e,r,n,o,i,s,u,p,h,y,v=[],m=t.length,b=0,M=_,k=d;for((r=t.lastIndexOf(g))<0&&(r=0),n=0;n<r;++n)t.charCodeAt(n)>=128&&E(\"not-basic\"),v.push(t.charCodeAt(n));for(o=r>0?r+1:0;o<m;){for(i=b,s=1,u=c;o>=m&&E(\"invalid-input\"),((p=A(t.charCodeAt(o++)))>=c||p>w((a-b)/s))&&E(\"overflow\"),b+=p*s,!(p<(h=u<=k?l:u>=k+f?f:u-k));u+=c)s>w(a/(y=c-h))&&E(\"overflow\"),s*=y;k=N(b-i,e=v.length+1,0==i),w(b/e)>a-M&&E(\"overflow\"),M+=w(b/e),b%=e,v.splice(b++,0,M)}return x(v)}function T(t){var e,r,n,o,i,s,u,p,h,y,v,m,b,M,D,S=[];for(m=(t=C(t)).length,e=_,r=0,i=d,s=0;s<m;++s)(v=t[s])<128&&S.push(k(v));for(n=o=S.length,o&&S.push(g);n<m;){for(u=a,s=0;s<m;++s)(v=t[s])>=e&&v<u&&(u=v);for(u-e>w((a-r)/(b=n+1))&&E(\"overflow\"),r+=(u-e)*b,e=u,s=0;s<m;++s)if((v=t[s])<e&&++r>a&&E(\"overflow\"),v==e){for(p=r,h=c;!(p<(y=h<=i?l:h>=i+f?f:h-i));h+=c)D=p-y,M=c-y,S.push(k(I(y+D%M,0))),p=w(D/M);S.push(k(I(p,0))),i=N(r,b,n==o),r=0,++n}++r,++e}return S.join(\"\")}u={version:\"1.4.1\",ucs2:{decode:C,encode:x},decode:j,encode:T,toASCII:function(t){return S(t,function(t){return v.test(t)?\"xn--\"+T(t):t})},toUnicode:function(t){return S(t,function(t){return y.test(t)?j(t.slice(4).toLowerCase()):t})}},void 0===(o=function(){return u}.call(e,r,e,t))||(t.exports=o)}()}).call(this,r(73)(t),r(16))},function(t,e,r){\"use strict\";t.exports=function(t){var e={};e.src_Any=r(25).source,e.src_Cc=r(24).source,e.src_Z=r(23).source,e.src_P=r(12).source,e.src_ZPCc=[e.src_Z,e.src_P,e.src_Cc].join(\"|\"),e.src_ZCc=[e.src_Z,e.src_Cc].join(\"|\");return e.src_pseudo_letter=\"(?:(?![><|]|\"+e.src_ZPCc+\")\"+e.src_Any+\")\",e.src_ip4=\"(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\",e.src_auth=\"(?:(?:(?!\"+e.src_ZCc+\"|[@/\\\\[\\\\]()]).)+@)?\",e.src_port=\"(?::(?:6(?:[0-4]\\\\d{3}|5(?:[0-4]\\\\d{2}|5(?:[0-2]\\\\d|3[0-5])))|[1-5]?\\\\d{1,4}))?\",e.src_host_terminator=\"(?=$|[><|]|\"+e.src_ZPCc+\")(?!-|_|:\\\\d|\\\\.-|\\\\.(?!$|\"+e.src_ZPCc+\"))\",e.src_path=\"(?:[/?#](?:(?!\"+e.src_ZCc+\"|[><|]|[()[\\\\]{}.,\\\"'?!\\\\-]).|\\\\[(?:(?!\"+e.src_ZCc+\"|\\\\]).)*\\\\]|\\\\((?:(?!\"+e.src_ZCc+\"|[)]).)*\\\\)|\\\\{(?:(?!\"+e.src_ZCc+'|[}]).)*\\\\}|\\\\\"(?:(?!'+e.src_ZCc+'|[\"]).)+\\\\\"|\\\\\\'(?:(?!'+e.src_ZCc+\"|[']).)+\\\\'|\\\\'(?=\"+e.src_pseudo_letter+\"|[-]).|\\\\.{2,3}[a-zA-Z0-9%/]|\\\\.(?!\"+e.src_ZCc+\"|[.]).|\"+(t&&t[\"---\"]?\"\\\\-(?!--(?:[^-]|$))(?:-*)|\":\"\\\\-+|\")+\"\\\\,(?!\"+e.src_ZCc+\").|\\\\!(?!\"+e.src_ZCc+\"|[!]).|\\\\?(?!\"+e.src_ZCc+\"|[?]).)+|\\\\/)?\",e.src_email_name='[\\\\-;:&=\\\\+\\\\$,\\\\\"\\\\.a-zA-Z0-9_]+',e.src_xn=\"xn--[a-z0-9\\\\-]{1,59}\",e.src_domain_root=\"(?:\"+e.src_xn+\"|\"+e.src_pseudo_letter+\"{1,63})\",e.src_domain=\"(?:\"+e.src_xn+\"|(?:\"+e.src_pseudo_letter+\")|(?:\"+e.src_pseudo_letter+\"(?:-(?!-)|\"+e.src_pseudo_letter+\"){0,61}\"+e.src_pseudo_letter+\"))\",e.src_host=\"(?:(?:(?:(?:\"+e.src_domain+\")\\\\.)*\"+e.src_domain+\"))\",e.tpl_host_fuzzy=\"(?:\"+e.src_ip4+\"|(?:(?:(?:\"+e.src_domain+\")\\\\.)+(?:%TLDS%)))\",e.tpl_host_no_ip_fuzzy=\"(?:(?:(?:\"+e.src_domain+\")\\\\.)+(?:%TLDS%))\",e.src_host_strict=e.src_host+e.src_host_terminator,e.tpl_host_fuzzy_strict=e.tpl_host_fuzzy+e.src_host_terminator,e.src_host_port_strict=e.src_host+e.src_port+e.src_host_terminator,e.tpl_host_port_fuzzy_strict=e.tpl_host_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_port_no_ip_fuzzy_strict=e.tpl_host_no_ip_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_fuzzy_test=\"localhost|www\\\\.|\\\\.\\\\d{1,3}\\\\.|(?:\\\\.(?:%TLDS%)(?:\"+e.src_ZPCc+\"|>|$))\",e.tpl_email_fuzzy=\"(^|[><|]|\\\\(|\"+e.src_ZCc+\")(\"+e.src_email_name+\"@\"+e.tpl_host_fuzzy_strict+\")\",e.tpl_link_fuzzy=\"(^|(?![.:/\\\\-_@])(?:[$+<=>^`||]|\"+e.src_ZPCc+\"))((?![$+<=>^`||])\"+e.tpl_host_port_fuzzy_strict+e.src_path+\")\",e.tpl_link_no_ip_fuzzy=\"(^|(?![.:/\\\\-_@])(?:[$+<=>^`||]|\"+e.src_ZPCc+\"))((?![$+<=>^`||])\"+e.tpl_host_port_no_ip_fuzzy_strict+e.src_path+\")\",e}},function(t,e,r){\"use strict\";function n(t){return Array.prototype.slice.call(arguments,1).forEach(function(e){e&&Object.keys(e).forEach(function(r){t[r]=e[r]})}),t}function o(t){return Object.prototype.toString.call(t)}function i(t){return\"[object Function]\"===o(t)}function s(t){return t.replace(/[.?*+^$[\\]\\\\(){}|-]/g,\"\\\\$&\")}var u={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};var a={\"http:\":{validate:function(t,e,r){var n=t.slice(e);return r.re.http||(r.re.http=new RegExp(\"^\\\\/\\\\/\"+r.re.src_auth+r.re.src_host_port_strict+r.re.src_path,\"i\")),r.re.http.test(n)?n.match(r.re.http)[0].length:0}},\"https:\":\"http:\",\"ftp:\":\"http:\",\"//\":{validate:function(t,e,r){var n=t.slice(e);return r.re.no_http||(r.re.no_http=new RegExp(\"^\"+r.re.src_auth+\"(?:localhost|(?:(?:\"+r.re.src_domain+\")\\\\.)+\"+r.re.src_domain_root+\")\"+r.re.src_port+r.re.src_host_terminator+r.re.src_path,\"i\")),r.re.no_http.test(n)?e>=3&&\":\"===t[e-3]?0:e>=3&&\"/\"===t[e-3]?0:n.match(r.re.no_http)[0].length:0}},\"mailto:\":{validate:function(t,e,r){var n=t.slice(e);return r.re.mailto||(r.re.mailto=new RegExp(\"^\"+r.re.src_email_name+\"@\"+r.re.src_host_strict,\"i\")),r.re.mailto.test(n)?n.match(r.re.mailto)[0].length:0}}},c=\"a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]\",l=\"biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф\".split(\"|\");function f(t){var e=t.re=r(75)(t.__opts__),n=t.__tlds__.slice();function u(t){return t.replace(\"%TLDS%\",e.src_tlds)}t.onCompile(),t.__tlds_replaced__||n.push(c),n.push(e.src_xn),e.src_tlds=n.join(\"|\"),e.email_fuzzy=RegExp(u(e.tpl_email_fuzzy),\"i\"),e.link_fuzzy=RegExp(u(e.tpl_link_fuzzy),\"i\"),e.link_no_ip_fuzzy=RegExp(u(e.tpl_link_no_ip_fuzzy),\"i\"),e.host_fuzzy_test=RegExp(u(e.tpl_host_fuzzy_test),\"i\");var a=[];function l(t,e){throw new Error('(LinkifyIt) Invalid schema \"'+t+'\": '+e)}t.__compiled__={},Object.keys(t.__schemas__).forEach(function(e){var r=t.__schemas__[e];if(null!==r){var n={validate:null,link:null};if(t.__compiled__[e]=n,function(t){return\"[object Object]\"===o(t)}(r))return!function(t){return\"[object RegExp]\"===o(t)}(r.validate)?i(r.validate)?n.validate=r.validate:l(e,r):n.validate=function(t){return function(e,r){var n=e.slice(r);return t.test(n)?n.match(t)[0].length:0}}(r.validate),void(i(r.normalize)?n.normalize=r.normalize:r.normalize?l(e,r):n.normalize=function(t,e){e.normalize(t)});!function(t){return\"[object String]\"===o(t)}(r)?l(e,r):a.push(e)}}),a.forEach(function(e){t.__compiled__[t.__schemas__[e]]&&(t.__compiled__[e].validate=t.__compiled__[t.__schemas__[e]].validate,t.__compiled__[e].normalize=t.__compiled__[t.__schemas__[e]].normalize)}),t.__compiled__[\"\"]={validate:null,normalize:function(t,e){e.normalize(t)}};var f=Object.keys(t.__compiled__).filter(function(e){return e.length>0&&t.__compiled__[e]}).map(s).join(\"|\");t.re.schema_test=RegExp(\"(^|(?!_)(?:[><|]|\"+e.src_ZPCc+\"))(\"+f+\")\",\"i\"),t.re.schema_search=RegExp(\"(^|(?!_)(?:[><|]|\"+e.src_ZPCc+\"))(\"+f+\")\",\"ig\"),t.re.pretest=RegExp(\"(\"+t.re.schema_test.source+\")|(\"+t.re.host_fuzzy_test.source+\")|@\",\"i\"),function(t){t.__index__=-1,t.__text_cache__=\"\"}(t)}function p(t,e){var r=new function(t,e){var r=t.__index__,n=t.__last_index__,o=t.__text_cache__.slice(r,n);this.schema=t.__schema__.toLowerCase(),this.index=r+e,this.lastIndex=n+e,this.raw=o,this.text=o,this.url=o}(t,e);return t.__compiled__[r.schema].normalize(r,t),r}function h(t,e){if(!(this instanceof h))return new h(t,e);e||function(t){return Object.keys(t||{}).reduce(function(t,e){return t||u.hasOwnProperty(e)},!1)}(t)&&(e=t,t={}),this.__opts__=n({},u,e),this.__index__=-1,this.__last_index__=-1,this.__schema__=\"\",this.__text_cache__=\"\",this.__schemas__=n({},a,t),this.__compiled__={},this.__tlds__=l,this.__tlds_replaced__=!1,this.re={},f(this)}h.prototype.add=function(t,e){return this.__schemas__[t]=e,f(this),this},h.prototype.set=function(t){return this.__opts__=n(this.__opts__,t),this},h.prototype.test=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return!1;var e,r,n,o,i,s,u,a;if(this.re.schema_test.test(t))for((u=this.re.schema_search).lastIndex=0;null!==(e=u.exec(t));)if(o=this.testSchemaAt(t,e[2],u.lastIndex)){this.__schema__=e[2],this.__index__=e.index+e[1].length,this.__last_index__=e.index+e[0].length+o;break}return this.__opts__.fuzzyLink&&this.__compiled__[\"http:\"]&&(a=t.search(this.re.host_fuzzy_test))>=0&&(this.__index__<0||a<this.__index__)&&null!==(r=t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))&&(i=r.index+r[1].length,(this.__index__<0||i<this.__index__)&&(this.__schema__=\"\",this.__index__=i,this.__last_index__=r.index+r[0].length)),this.__opts__.fuzzyEmail&&this.__compiled__[\"mailto:\"]&&t.indexOf(\"@\")>=0&&null!==(n=t.match(this.re.email_fuzzy))&&(i=n.index+n[1].length,s=n.index+n[0].length,(this.__index__<0||i<this.__index__||i===this.__index__&&s>this.__last_index__)&&(this.__schema__=\"mailto:\",this.__index__=i,this.__last_index__=s)),this.__index__>=0},h.prototype.pretest=function(t){return this.re.pretest.test(t)},h.prototype.testSchemaAt=function(t,e,r){return this.__compiled__[e.toLowerCase()]?this.__compiled__[e.toLowerCase()].validate(t,r,this):0},h.prototype.match=function(t){var e=0,r=[];this.__index__>=0&&this.__text_cache__===t&&(r.push(p(this,e)),e=this.__last_index__);for(var n=e?t.slice(e):t;this.test(n);)r.push(p(this,e)),n=n.slice(this.__last_index__),e+=this.__last_index__;return r.length?r:null},h.prototype.tlds=function(t,e){return t=Array.isArray(t)?t:[t],e?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(t,e,r){return t!==r[e-1]}).reverse(),f(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,f(this),this)},h.prototype.normalize=function(t){t.schema||(t.url=\"http://\"+t.url),\"mailto:\"!==t.schema||/^mailto:/i.test(t.url)||(t.url=\"mailto:\"+t.url)},h.prototype.onCompile=function(){},t.exports=h},function(t,e,r){\"use strict\";var n=r(10),o=r(0).isWhiteSpace,i=r(0).isPunctChar,s=r(0).isMdAsciiPunct;function u(t,e,r,n){this.src=t,this.env=r,this.md=e,this.tokens=n,this.pos=0,this.posMax=this.src.length,this.level=0,this.pending=\"\",this.pendingLevel=0,this.cache={},this.delimiters=[]}u.prototype.pushPending=function(){var t=new n(\"text\",\"\",0);return t.content=this.pending,t.level=this.pendingLevel,this.tokens.push(t),this.pending=\"\",t},u.prototype.push=function(t,e,r){this.pending&&this.pushPending();var o=new n(t,e,r);return r<0&&this.level--,o.level=this.level,r>0&&this.level++,this.pendingLevel=this.level,this.tokens.push(o),o},u.prototype.scanDelims=function(t,e){var r,n,u,a,c,l,f,p,h,d=t,_=!0,g=!0,y=this.posMax,v=this.src.charCodeAt(t);for(r=t>0?this.src.charCodeAt(t-1):32;d<y&&this.src.charCodeAt(d)===v;)d++;return u=d-t,n=d<y?this.src.charCodeAt(d):32,f=s(r)||i(String.fromCharCode(r)),h=s(n)||i(String.fromCharCode(n)),l=o(r),(p=o(n))?_=!1:h&&(l||f||(_=!1)),l?g=!1:f&&(p||h||(g=!1)),e?(a=_,c=g):(a=_&&(!g||f),c=g&&(!_||h)),{can_open:a,can_close:c,length:u}},u.prototype.Token=n,t.exports=u},function(t,e,r){\"use strict\";t.exports=function(t){var e,r,n=0,o=t.tokens,i=t.tokens.length;for(e=r=0;e<i;e++)n+=o[e].nesting,o[e].level=n,\"text\"===o[e].type&&e+1<i&&\"text\"===o[e+1].type?o[e+1].content=o[e].content+o[e+1].content:(e!==r&&(o[r]=o[e]),r++);e!==r&&(o.length=r)}},function(t,e,r){\"use strict\";t.exports=function(t){var e,r,n,o,i=t.delimiters,s=t.delimiters.length;for(e=0;e<s;e++)if((n=i[e]).close)for(r=e-n.jump-1;r>=0;){if((o=i[r]).open&&o.marker===n.marker&&o.end<0&&o.level===n.level)if(!((o.close||n.open)&&void 0!==o.length&&void 0!==n.length&&(o.length+n.length)%3==0)){n.jump=e-r,n.open=!1,o.end=e,o.jump=0;break}r-=o.jump+1}}},function(t,e,r){\"use strict\";var n=r(27),o=r(0).has,i=r(0).isValidEntityCode,s=r(0).fromCodePoint,u=/^&#((?:x[a-f0-9]{1,8}|[0-9]{1,8}));/i,a=/^&([a-z][a-z0-9]{1,31});/i;t.exports=function(t,e){var r,c,l=t.pos,f=t.posMax;if(38!==t.src.charCodeAt(l))return!1;if(l+1<f)if(35===t.src.charCodeAt(l+1)){if(c=t.src.slice(l).match(u))return e||(r=\"x\"===c[1][0].toLowerCase()?parseInt(c[1].slice(1),16):parseInt(c[1],10),t.pending+=i(r)?s(r):s(65533)),t.pos+=c[0].length,!0}else if((c=t.src.slice(l).match(a))&&o(n,c[1]))return e||(t.pending+=n[c[1]]),t.pos+=c[0].length,!0;return e||(t.pending+=\"&\"),t.pos++,!0}},function(t,e,r){\"use strict\";var n=r(22).HTML_TAG_RE;t.exports=function(t,e){var r,o,i,s=t.pos;return!!t.md.options.html&&(i=t.posMax,!(60!==t.src.charCodeAt(s)||s+2>=i)&&(!(33!==(r=t.src.charCodeAt(s+1))&&63!==r&&47!==r&&!function(t){var e=32|t;return e>=97&&e<=122}(r))&&(!!(o=t.src.slice(s).match(n))&&(e||(t.push(\"html_inline\",\"\",0).content=t.src.slice(s,s+o[0].length)),t.pos+=o[0].length,!0))))}},function(t,e,r){\"use strict\";var n=/^<([a-zA-Z0-9.!#$%&'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/,o=/^<([a-zA-Z][a-zA-Z0-9+.\\-]{1,31}):([^<>\\x00-\\x20]*)>/;t.exports=function(t,e){var r,i,s,u,a,c,l=t.pos;return 60===t.src.charCodeAt(l)&&(!((r=t.src.slice(l)).indexOf(\">\")<0)&&(o.test(r)?(u=(i=r.match(o))[0].slice(1,-1),a=t.md.normalizeLink(u),!!t.md.validateLink(a)&&(e||((c=t.push(\"link_open\",\"a\",1)).attrs=[[\"href\",a]],c.markup=\"autolink\",c.info=\"auto\",(c=t.push(\"text\",\"\",0)).content=t.md.normalizeLinkText(u),(c=t.push(\"link_close\",\"a\",-1)).markup=\"autolink\",c.info=\"auto\"),t.pos+=i[0].length,!0)):!!n.test(r)&&(u=(s=r.match(n))[0].slice(1,-1),a=t.md.normalizeLink(\"mailto:\"+u),!!t.md.validateLink(a)&&(e||((c=t.push(\"link_open\",\"a\",1)).attrs=[[\"href\",a]],c.markup=\"autolink\",c.info=\"auto\",(c=t.push(\"text\",\"\",0)).content=t.md.normalizeLinkText(u),(c=t.push(\"link_close\",\"a\",-1)).markup=\"autolink\",c.info=\"auto\"),t.pos+=s[0].length,!0))))}},function(t,e,r){\"use strict\";var n=r(0).normalizeReference,o=r(0).isSpace;t.exports=function(t,e){var r,i,s,u,a,c,l,f,p,h,d,_,g,y=\"\",v=t.pos,m=t.posMax;if(33!==t.src.charCodeAt(t.pos))return!1;if(91!==t.src.charCodeAt(t.pos+1))return!1;if(c=t.pos+2,(a=t.md.helpers.parseLinkLabel(t,t.pos+1,!1))<0)return!1;if((l=a+1)<m&&40===t.src.charCodeAt(l)){for(l++;l<m&&(i=t.src.charCodeAt(l),o(i)||10===i);l++);if(l>=m)return!1;for(g=l,(p=t.md.helpers.parseLinkDestination(t.src,l,t.posMax)).ok&&(y=t.md.normalizeLink(p.str),t.md.validateLink(y)?l=p.pos:y=\"\"),g=l;l<m&&(i=t.src.charCodeAt(l),o(i)||10===i);l++);if(p=t.md.helpers.parseLinkTitle(t.src,l,t.posMax),l<m&&g!==l&&p.ok)for(h=p.str,l=p.pos;l<m&&(i=t.src.charCodeAt(l),o(i)||10===i);l++);else h=\"\";if(l>=m||41!==t.src.charCodeAt(l))return t.pos=v,!1;l++}else{if(void 0===t.env.references)return!1;if(l<m&&91===t.src.charCodeAt(l)?(g=l+1,(l=t.md.helpers.parseLinkLabel(t,l))>=0?u=t.src.slice(g,l++):l=a+1):l=a+1,u||(u=t.src.slice(c,a)),!(f=t.env.references[n(u)]))return t.pos=v,!1;y=f.href,h=f.title}return e||(s=t.src.slice(c,a),t.md.inline.parse(s,t.md,t.env,_=[]),(d=t.push(\"image\",\"img\",0)).attrs=r=[[\"src\",y],[\"alt\",\"\"]],d.children=_,d.content=s,h&&r.push([\"title\",h])),t.pos=l,t.posMax=m,!0}},function(t,e,r){\"use strict\";var n=r(0).normalizeReference,o=r(0).isSpace;t.exports=function(t,e){var r,i,s,u,a,c,l,f,p,h=\"\",d=t.pos,_=t.posMax,g=t.pos,y=!0;if(91!==t.src.charCodeAt(t.pos))return!1;if(a=t.pos+1,(u=t.md.helpers.parseLinkLabel(t,t.pos,!0))<0)return!1;if((c=u+1)<_&&40===t.src.charCodeAt(c)){for(y=!1,c++;c<_&&(i=t.src.charCodeAt(c),o(i)||10===i);c++);if(c>=_)return!1;for(g=c,(l=t.md.helpers.parseLinkDestination(t.src,c,t.posMax)).ok&&(h=t.md.normalizeLink(l.str),t.md.validateLink(h)?c=l.pos:h=\"\"),g=c;c<_&&(i=t.src.charCodeAt(c),o(i)||10===i);c++);if(l=t.md.helpers.parseLinkTitle(t.src,c,t.posMax),c<_&&g!==c&&l.ok)for(p=l.str,c=l.pos;c<_&&(i=t.src.charCodeAt(c),o(i)||10===i);c++);else p=\"\";(c>=_||41!==t.src.charCodeAt(c))&&(y=!0),c++}if(y){if(void 0===t.env.references)return!1;if(c<_&&91===t.src.charCodeAt(c)?(g=c+1,(c=t.md.helpers.parseLinkLabel(t,c))>=0?s=t.src.slice(g,c++):c=u+1):c=u+1,s||(s=t.src.slice(a,u)),!(f=t.env.references[n(s)]))return t.pos=d,!1;h=f.href,p=f.title}return e||(t.pos=a,t.posMax=u,t.push(\"link_open\",\"a\",1).attrs=r=[[\"href\",h]],p&&r.push([\"title\",p]),t.md.inline.tokenize(t),t.push(\"link_close\",\"a\",-1)),t.pos=c,t.posMax=_,!0}},function(t,e,r){\"use strict\";t.exports=function(t,e){var r,n,o,i,s,u,a=t.pos;if(96!==t.src.charCodeAt(a))return!1;for(r=a,a++,n=t.posMax;a<n&&96===t.src.charCodeAt(a);)a++;for(o=t.src.slice(r,a),i=s=a;-1!==(i=t.src.indexOf(\"`\",s));){for(s=i+1;s<n&&96===t.src.charCodeAt(s);)s++;if(s-i===o.length)return e||((u=t.push(\"code_inline\",\"code\",0)).markup=o,u.content=t.src.slice(a,i).replace(/[ \\n]+/g,\" \").trim()),t.pos=s,!0}return e||(t.pending+=o),t.pos+=o.length,!0}},function(t,e,r){\"use strict\";for(var n=r(0).isSpace,o=[],i=0;i<256;i++)o.push(0);\"\\\\!\\\"#$%&'()*+,./:;<=>?@[]^_`{|}~-\".split(\"\").forEach(function(t){o[t.charCodeAt(0)]=1}),t.exports=function(t,e){var r,i=t.pos,s=t.posMax;if(92!==t.src.charCodeAt(i))return!1;if(++i<s){if((r=t.src.charCodeAt(i))<256&&0!==o[r])return e||(t.pending+=t.src[i]),t.pos+=2,!0;if(10===r){for(e||t.push(\"hardbreak\",\"br\",0),i++;i<s&&(r=t.src.charCodeAt(i),n(r));)i++;return t.pos=i,!0}}return e||(t.pending+=\"\\\\\"),t.pos++,!0}},function(t,e,r){\"use strict\";var n=r(0).isSpace;t.exports=function(t,e){var r,o,i=t.pos;if(10!==t.src.charCodeAt(i))return!1;for(r=t.pending.length-1,o=t.posMax,e||(r>=0&&32===t.pending.charCodeAt(r)?r>=1&&32===t.pending.charCodeAt(r-1)?(t.pending=t.pending.replace(/ +$/,\"\"),t.push(\"hardbreak\",\"br\",0)):(t.pending=t.pending.slice(0,-1),t.push(\"softbreak\",\"br\",0)):t.push(\"softbreak\",\"br\",0)),i++;i<o&&n(t.src.charCodeAt(i));)i++;return t.pos=i,!0}},function(t,e,r){\"use strict\";function n(t){switch(t){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}t.exports=function(t,e){for(var r=t.pos;r<t.posMax&&!n(t.src.charCodeAt(r));)r++;return r!==t.pos&&(e||(t.pending+=t.src.slice(t.pos,r)),t.pos=r,!0)}},function(t,e,r){\"use strict\";var n=r(11),o=[[\"text\",r(88)],[\"newline\",r(87)],[\"escape\",r(86)],[\"backticks\",r(85)],[\"strikethrough\",r(21).tokenize],[\"emphasis\",r(20).tokenize],[\"link\",r(84)],[\"image\",r(83)],[\"autolink\",r(82)],[\"html_inline\",r(81)],[\"entity\",r(80)]],i=[[\"balance_pairs\",r(79)],[\"strikethrough\",r(21).postProcess],[\"emphasis\",r(20).postProcess],[\"text_collapse\",r(78)]];function s(){var t;for(this.ruler=new n,t=0;t<o.length;t++)this.ruler.push(o[t][0],o[t][1]);for(this.ruler2=new n,t=0;t<i.length;t++)this.ruler2.push(i[t][0],i[t][1])}s.prototype.skipToken=function(t){var e,r,n=t.pos,o=this.ruler.getRules(\"\"),i=o.length,s=t.md.options.maxNesting,u=t.cache;if(void 0===u[n]){if(t.level<s)for(r=0;r<i&&(t.level++,e=o[r](t,!0),t.level--,!e);r++);else t.pos=t.posMax;e||t.pos++,u[n]=t.pos}else t.pos=u[n]},s.prototype.tokenize=function(t){for(var e,r,n=this.ruler.getRules(\"\"),o=n.length,i=t.posMax,s=t.md.options.maxNesting;t.pos<i;){if(t.level<s)for(r=0;r<o&&!(e=n[r](t,!1));r++);if(e){if(t.pos>=i)break}else t.pending+=t.src[t.pos++]}t.pending&&t.pushPending()},s.prototype.parse=function(t,e,r,n){var o,i,s,u=new this.State(t,e,r,n);for(this.tokenize(u),s=(i=this.ruler2.getRules(\"\")).length,o=0;o<s;o++)i[o](u)},s.prototype.State=r(77),t.exports=s},function(t,e,r){\"use strict\";var n=r(10),o=r(0).isSpace;function i(t,e,r,n){var i,s,u,a,c,l,f,p;for(this.src=t,this.md=e,this.env=r,this.tokens=n,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.parentType=\"root\",this.level=0,this.result=\"\",p=!1,u=a=l=f=0,c=(s=this.src).length;a<c;a++){if(i=s.charCodeAt(a),!p){if(o(i)){l++,9===i?f+=4-f%4:f++;continue}p=!0}10!==i&&a!==c-1||(10!==i&&a++,this.bMarks.push(u),this.eMarks.push(a),this.tShift.push(l),this.sCount.push(f),this.bsCount.push(0),p=!1,l=0,f=0,u=a+1)}this.bMarks.push(s.length),this.eMarks.push(s.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}i.prototype.push=function(t,e,r){var o=new n(t,e,r);return o.block=!0,r<0&&this.level--,o.level=this.level,r>0&&this.level++,this.tokens.push(o),o},i.prototype.isEmpty=function(t){return this.bMarks[t]+this.tShift[t]>=this.eMarks[t]},i.prototype.skipEmptyLines=function(t){for(var e=this.lineMax;t<e&&!(this.bMarks[t]+this.tShift[t]<this.eMarks[t]);t++);return t},i.prototype.skipSpaces=function(t){for(var e,r=this.src.length;t<r&&(e=this.src.charCodeAt(t),o(e));t++);return t},i.prototype.skipSpacesBack=function(t,e){if(t<=e)return t;for(;t>e;)if(!o(this.src.charCodeAt(--t)))return t+1;return t},i.prototype.skipChars=function(t,e){for(var r=this.src.length;t<r&&this.src.charCodeAt(t)===e;t++);return t},i.prototype.skipCharsBack=function(t,e,r){if(t<=r)return t;for(;t>r;)if(e!==this.src.charCodeAt(--t))return t+1;return t},i.prototype.getLines=function(t,e,r,n){var i,s,u,a,c,l,f,p=t;if(t>=e)return\"\";for(l=new Array(e-t),i=0;p<e;p++,i++){for(s=0,f=a=this.bMarks[p],c=p+1<e||n?this.eMarks[p]+1:this.eMarks[p];a<c&&s<r;){if(u=this.src.charCodeAt(a),o(u))9===u?s+=4-(s+this.bsCount[p])%4:s++;else{if(!(a-f<this.tShift[p]))break;s++}a++}l[i]=s>r?new Array(s-r+1).join(\" \")+this.src.slice(a,c):this.src.slice(a,c)}return l.join(\"\")},i.prototype.Token=n,t.exports=i},function(t,e,r){\"use strict\";t.exports=function(t,e){var r,n,o,i,s,u,a=e+1,c=t.md.block.ruler.getRules(\"paragraph\"),l=t.lineMax;for(u=t.parentType,t.parentType=\"paragraph\";a<l&&!t.isEmpty(a);a++)if(!(t.sCount[a]-t.blkIndent>3||t.sCount[a]<0)){for(n=!1,o=0,i=c.length;o<i;o++)if(c[o](t,a,l,!0)){n=!0;break}if(n)break}return r=t.getLines(e,a,t.blkIndent,!1).trim(),t.line=a,(s=t.push(\"paragraph_open\",\"p\",1)).map=[e,t.line],(s=t.push(\"inline\",\"\",0)).content=r,s.map=[e,t.line],s.children=[],s=t.push(\"paragraph_close\",\"p\",-1),t.parentType=u,!0}},function(t,e,r){\"use strict\";t.exports=[\"address\",\"article\",\"aside\",\"base\",\"basefont\",\"blockquote\",\"body\",\"caption\",\"center\",\"col\",\"colgroup\",\"dd\",\"details\",\"dialog\",\"dir\",\"div\",\"dl\",\"dt\",\"fieldset\",\"figcaption\",\"figure\",\"footer\",\"form\",\"frame\",\"frameset\",\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\",\"head\",\"header\",\"hr\",\"html\",\"iframe\",\"legend\",\"li\",\"link\",\"main\",\"menu\",\"menuitem\",\"meta\",\"nav\",\"noframes\",\"ol\",\"optgroup\",\"option\",\"p\",\"param\",\"section\",\"source\",\"summary\",\"table\",\"tbody\",\"td\",\"tfoot\",\"th\",\"thead\",\"title\",\"tr\",\"track\",\"ul\"]},function(t,e,r){\"use strict\";var n=r(92),o=r(22).HTML_OPEN_CLOSE_TAG_RE,i=[[/^<(script|pre|style)(?=(\\s|>|$))/i,/<\\/(script|pre|style)>/i,!0],[/^<!--/,/-->/,!0],[/^<\\?/,/\\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\\[CDATA\\[/,/\\]\\]>/,!0],[new RegExp(\"^</?(\"+n.join(\"|\")+\")(?=(\\\\s|/?>|$))\",\"i\"),/^$/,!0],[new RegExp(o.source+\"\\\\s*$\"),/^$/,!1]];t.exports=function(t,e,r,n){var o,s,u,a,c=t.bMarks[e]+t.tShift[e],l=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;if(!t.md.options.html)return!1;if(60!==t.src.charCodeAt(c))return!1;for(a=t.src.slice(c,l),o=0;o<i.length&&!i[o][0].test(a);o++);if(o===i.length)return!1;if(n)return i[o][2];if(s=e+1,!i[o][1].test(a))for(;s<r&&!(t.sCount[s]<t.blkIndent);s++)if(c=t.bMarks[s]+t.tShift[s],l=t.eMarks[s],a=t.src.slice(c,l),i[o][1].test(a)){0!==a.length&&s++;break}return t.line=s,(u=t.push(\"html_block\",\"\",0)).map=[e,s],u.content=t.getLines(e,s,t.blkIndent,!0),!0}},function(t,e,r){\"use strict\";t.exports=function(t,e,r){var n,o,i,s,u,a,c,l,f,p,h=e+1,d=t.md.block.ruler.getRules(\"paragraph\");if(t.sCount[e]-t.blkIndent>=4)return!1;for(p=t.parentType,t.parentType=\"paragraph\";h<r&&!t.isEmpty(h);h++)if(!(t.sCount[h]-t.blkIndent>3)){if(t.sCount[h]>=t.blkIndent&&(a=t.bMarks[h]+t.tShift[h])<(c=t.eMarks[h])&&(45===(f=t.src.charCodeAt(a))||61===f)&&(a=t.skipChars(a,f),(a=t.skipSpaces(a))>=c)){l=61===f?1:2;break}if(!(t.sCount[h]<0)){for(o=!1,i=0,s=d.length;i<s;i++)if(d[i](t,h,r,!0)){o=!0;break}if(o)break}}return!!l&&(n=t.getLines(e,h,t.blkIndent,!1).trim(),t.line=h+1,(u=t.push(\"heading_open\",\"h\"+String(l),1)).markup=String.fromCharCode(f),u.map=[e,t.line],(u=t.push(\"inline\",\"\",0)).content=n,u.map=[e,t.line-1],u.children=[],(u=t.push(\"heading_close\",\"h\"+String(l),-1)).markup=String.fromCharCode(f),t.parentType=p,!0)}},function(t,e,r){\"use strict\";var n=r(0).isSpace;t.exports=function(t,e,r,o){var i,s,u,a,c=t.bMarks[e]+t.tShift[e],l=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;if(35!==(i=t.src.charCodeAt(c))||c>=l)return!1;for(s=1,i=t.src.charCodeAt(++c);35===i&&c<l&&s<=6;)s++,i=t.src.charCodeAt(++c);return!(s>6||c<l&&!n(i))&&(!!o||(l=t.skipSpacesBack(l,c),(u=t.skipCharsBack(l,35,c))>c&&n(t.src.charCodeAt(u-1))&&(l=u),t.line=e+1,(a=t.push(\"heading_open\",\"h\"+String(s),1)).markup=\"########\".slice(0,s),a.map=[e,t.line],(a=t.push(\"inline\",\"\",0)).content=t.src.slice(c,l).trim(),a.map=[e,t.line],a.children=[],(a=t.push(\"heading_close\",\"h\"+String(s),-1)).markup=\"########\".slice(0,s),!0))}},function(t,e,r){\"use strict\";var n=r(0).normalizeReference,o=r(0).isSpace;t.exports=function(t,e,r,i){var s,u,a,c,l,f,p,h,d,_,g,y,v,m,b,M,w=0,k=t.bMarks[e]+t.tShift[e],E=t.eMarks[e],D=e+1;if(t.sCount[e]-t.blkIndent>=4)return!1;if(91!==t.src.charCodeAt(k))return!1;for(;++k<E;)if(93===t.src.charCodeAt(k)&&92!==t.src.charCodeAt(k-1)){if(k+1===E)return!1;if(58!==t.src.charCodeAt(k+1))return!1;break}for(c=t.lineMax,b=t.md.block.ruler.getRules(\"reference\"),_=t.parentType,t.parentType=\"reference\";D<c&&!t.isEmpty(D);D++)if(!(t.sCount[D]-t.blkIndent>3||t.sCount[D]<0)){for(m=!1,f=0,p=b.length;f<p;f++)if(b[f](t,D,c,!0)){m=!0;break}if(m)break}for(E=(v=t.getLines(e,D,t.blkIndent,!1).trim()).length,k=1;k<E;k++){if(91===(s=v.charCodeAt(k)))return!1;if(93===s){d=k;break}10===s?w++:92===s&&++k<E&&10===v.charCodeAt(k)&&w++}if(d<0||58!==v.charCodeAt(d+1))return!1;for(k=d+2;k<E;k++)if(10===(s=v.charCodeAt(k)))w++;else if(!o(s))break;if(!(g=t.md.helpers.parseLinkDestination(v,k,E)).ok)return!1;if(l=t.md.normalizeLink(g.str),!t.md.validateLink(l))return!1;for(u=k=g.pos,a=w+=g.lines,y=k;k<E;k++)if(10===(s=v.charCodeAt(k)))w++;else if(!o(s))break;for(g=t.md.helpers.parseLinkTitle(v,k,E),k<E&&y!==k&&g.ok?(M=g.str,k=g.pos,w+=g.lines):(M=\"\",k=u,w=a);k<E&&(s=v.charCodeAt(k),o(s));)k++;if(k<E&&10!==v.charCodeAt(k)&&M)for(M=\"\",k=u,w=a;k<E&&(s=v.charCodeAt(k),o(s));)k++;return!(k<E&&10!==v.charCodeAt(k))&&(!!(h=n(v.slice(1,d)))&&(!!i||(void 0===t.env.references&&(t.env.references={}),void 0===t.env.references[h]&&(t.env.references[h]={title:M,href:l}),t.parentType=_,t.line=e+w+1,!0)))}},function(t,e,r){\"use strict\";var n=r(0).isSpace;function o(t,e){var r,o,i,s;return o=t.bMarks[e]+t.tShift[e],i=t.eMarks[e],42!==(r=t.src.charCodeAt(o++))&&45!==r&&43!==r?-1:o<i&&(s=t.src.charCodeAt(o),!n(s))?-1:o}function i(t,e){var r,o=t.bMarks[e]+t.tShift[e],i=o,s=t.eMarks[e];if(i+1>=s)return-1;if((r=t.src.charCodeAt(i++))<48||r>57)return-1;for(;;){if(i>=s)return-1;if(!((r=t.src.charCodeAt(i++))>=48&&r<=57)){if(41===r||46===r)break;return-1}if(i-o>=10)return-1}return i<s&&(r=t.src.charCodeAt(i),!n(r))?-1:i}t.exports=function(t,e,r,n){var s,u,a,c,l,f,p,h,d,_,g,y,v,m,b,M,w,k,E,D,S,C,x,A,I,N,j,T,O=!1,z=!0;if(t.sCount[e]-t.blkIndent>=4)return!1;if(n&&\"paragraph\"===t.parentType&&t.tShift[e]>=t.blkIndent&&(O=!0),(x=i(t,e))>=0){if(p=!0,I=t.bMarks[e]+t.tShift[e],v=Number(t.src.substr(I,x-I-1)),O&&1!==v)return!1}else{if(!((x=o(t,e))>=0))return!1;p=!1}if(O&&t.skipSpaces(x)>=t.eMarks[e])return!1;if(y=t.src.charCodeAt(x-1),n)return!0;for(g=t.tokens.length,p?(T=t.push(\"ordered_list_open\",\"ol\",1),1!==v&&(T.attrs=[[\"start\",v]])):T=t.push(\"bullet_list_open\",\"ul\",1),T.map=_=[e,0],T.markup=String.fromCharCode(y),b=e,A=!1,j=t.md.block.ruler.getRules(\"list\"),E=t.parentType,t.parentType=\"list\";b<r;){for(C=x,m=t.eMarks[b],f=M=t.sCount[b]+x-(t.bMarks[e]+t.tShift[e]);C<m;){if(9===(s=t.src.charCodeAt(C)))M+=4-(M+t.bsCount[b])%4;else{if(32!==s)break;M++}C++}if((l=(u=C)>=m?1:M-f)>4&&(l=1),c=f+l,(T=t.push(\"list_item_open\",\"li\",1)).markup=String.fromCharCode(y),T.map=h=[e,0],w=t.blkIndent,S=t.tight,D=t.tShift[e],k=t.sCount[e],t.blkIndent=c,t.tight=!0,t.tShift[e]=u-t.bMarks[e],t.sCount[e]=M,u>=m&&t.isEmpty(e+1)?t.line=Math.min(t.line+2,r):t.md.block.tokenize(t,e,r,!0),t.tight&&!A||(z=!1),A=t.line-e>1&&t.isEmpty(t.line-1),t.blkIndent=w,t.tShift[e]=D,t.sCount[e]=k,t.tight=S,(T=t.push(\"list_item_close\",\"li\",-1)).markup=String.fromCharCode(y),b=e=t.line,h[1]=b,u=t.bMarks[e],b>=r)break;if(t.sCount[b]<t.blkIndent)break;for(N=!1,a=0,d=j.length;a<d;a++)if(j[a](t,b,r,!0)){N=!0;break}if(N)break;if(p){if((x=i(t,b))<0)break}else if((x=o(t,b))<0)break;if(y!==t.src.charCodeAt(x-1))break}return(T=p?t.push(\"ordered_list_close\",\"ol\",-1):t.push(\"bullet_list_close\",\"ul\",-1)).markup=String.fromCharCode(y),_[1]=b,t.line=b,t.parentType=E,z&&function(t,e){var r,n,o=t.level+2;for(r=e+2,n=t.tokens.length-2;r<n;r++)t.tokens[r].level===o&&\"paragraph_open\"===t.tokens[r].type&&(t.tokens[r+2].hidden=!0,t.tokens[r].hidden=!0,r+=2)}(t,g),!0}},function(t,e,r){\"use strict\";var n=r(0).isSpace;t.exports=function(t,e,r,o){var i,s,u,a,c=t.bMarks[e]+t.tShift[e],l=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;if(42!==(i=t.src.charCodeAt(c++))&&45!==i&&95!==i)return!1;for(s=1;c<l;){if((u=t.src.charCodeAt(c++))!==i&&!n(u))return!1;u===i&&s++}return!(s<3)&&(!!o||(t.line=e+1,(a=t.push(\"hr\",\"hr\",0)).map=[e,t.line],a.markup=Array(s+1).join(String.fromCharCode(i)),!0))}},function(t,e,r){\"use strict\";var n=r(0).isSpace;t.exports=function(t,e,r,o){var i,s,u,a,c,l,f,p,h,d,_,g,y,v,m,b,M,w,k,E,D=t.lineMax,S=t.bMarks[e]+t.tShift[e],C=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;if(62!==t.src.charCodeAt(S++))return!1;if(o)return!0;for(a=h=t.sCount[e]+S-(t.bMarks[e]+t.tShift[e]),32===t.src.charCodeAt(S)?(S++,a++,h++,i=!1,b=!0):9===t.src.charCodeAt(S)?(b=!0,(t.bsCount[e]+h)%4==3?(S++,a++,h++,i=!1):i=!0):b=!1,d=[t.bMarks[e]],t.bMarks[e]=S;S<C&&(s=t.src.charCodeAt(S),n(s));)9===s?h+=4-(h+t.bsCount[e]+(i?1:0))%4:h++,S++;for(_=[t.bsCount[e]],t.bsCount[e]=t.sCount[e]+1+(b?1:0),l=S>=C,v=[t.sCount[e]],t.sCount[e]=h-a,m=[t.tShift[e]],t.tShift[e]=S-t.bMarks[e],w=t.md.block.ruler.getRules(\"blockquote\"),y=t.parentType,t.parentType=\"blockquote\",E=!1,p=e+1;p<r&&(t.sCount[p]<t.blkIndent&&(E=!0),!((S=t.bMarks[p]+t.tShift[p])>=(C=t.eMarks[p])));p++)if(62!==t.src.charCodeAt(S++)||E){if(l)break;for(M=!1,u=0,c=w.length;u<c;u++)if(w[u](t,p,r,!0)){M=!0;break}if(M){t.lineMax=p,0!==t.blkIndent&&(d.push(t.bMarks[p]),_.push(t.bsCount[p]),m.push(t.tShift[p]),v.push(t.sCount[p]),t.sCount[p]-=t.blkIndent);break}d.push(t.bMarks[p]),_.push(t.bsCount[p]),m.push(t.tShift[p]),v.push(t.sCount[p]),t.sCount[p]=-1}else{for(a=h=t.sCount[p]+S-(t.bMarks[p]+t.tShift[p]),32===t.src.charCodeAt(S)?(S++,a++,h++,i=!1,b=!0):9===t.src.charCodeAt(S)?(b=!0,(t.bsCount[p]+h)%4==3?(S++,a++,h++,i=!1):i=!0):b=!1,d.push(t.bMarks[p]),t.bMarks[p]=S;S<C&&(s=t.src.charCodeAt(S),n(s));)9===s?h+=4-(h+t.bsCount[p]+(i?1:0))%4:h++,S++;l=S>=C,_.push(t.bsCount[p]),t.bsCount[p]=t.sCount[p]+1+(b?1:0),v.push(t.sCount[p]),t.sCount[p]=h-a,m.push(t.tShift[p]),t.tShift[p]=S-t.bMarks[p]}for(g=t.blkIndent,t.blkIndent=0,(k=t.push(\"blockquote_open\",\"blockquote\",1)).markup=\">\",k.map=f=[e,0],t.md.block.tokenize(t,e,p),(k=t.push(\"blockquote_close\",\"blockquote\",-1)).markup=\">\",t.lineMax=D,t.parentType=y,f[1]=t.line,u=0;u<m.length;u++)t.bMarks[u+e]=d[u],t.tShift[u+e]=m[u],t.sCount[u+e]=v[u],t.bsCount[u+e]=_[u];return t.blkIndent=g,!0}},function(t,e,r){\"use strict\";t.exports=function(t,e,r,n){var o,i,s,u,a,c,l,f=!1,p=t.bMarks[e]+t.tShift[e],h=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;if(p+3>h)return!1;if(126!==(o=t.src.charCodeAt(p))&&96!==o)return!1;if(a=p,(i=(p=t.skipChars(p,o))-a)<3)return!1;if(l=t.src.slice(a,p),(s=t.src.slice(p,h)).indexOf(String.fromCharCode(o))>=0)return!1;if(n)return!0;for(u=e;!(++u>=r)&&!((p=a=t.bMarks[u]+t.tShift[u])<(h=t.eMarks[u])&&t.sCount[u]<t.blkIndent);)if(t.src.charCodeAt(p)===o&&!(t.sCount[u]-t.blkIndent>=4||(p=t.skipChars(p,o))-a<i||(p=t.skipSpaces(p))<h)){f=!0;break}return i=t.sCount[e],t.line=u+(f?1:0),(c=t.push(\"fence\",\"code\",0)).info=s,c.content=t.getLines(e+1,u,i,!0),c.markup=l,c.map=[e,t.line],!0}},function(t,e,r){\"use strict\";t.exports=function(t,e,r){var n,o,i;if(t.sCount[e]-t.blkIndent<4)return!1;for(o=n=e+1;n<r;)if(t.isEmpty(n))n++;else{if(!(t.sCount[n]-t.blkIndent>=4))break;o=++n}return t.line=o,(i=t.push(\"code_block\",\"code\",0)).content=t.getLines(e,o,4+t.blkIndent,!0),i.map=[e,t.line],!0}},function(t,e,r){\"use strict\";var n=r(0).isSpace;function o(t,e){var r=t.bMarks[e]+t.blkIndent,n=t.eMarks[e];return t.src.substr(r,n-r)}function i(t){var e,r=[],n=0,o=t.length,i=0,s=0,u=!1,a=0;for(e=t.charCodeAt(n);n<o;)96===e?u?(u=!1,a=n):i%2==0&&(u=!0,a=n):124!==e||i%2!=0||u||(r.push(t.substring(s,n)),s=n+1),92===e?i++:i=0,++n===o&&u&&(u=!1,n=a+1),e=t.charCodeAt(n);return r.push(t.substring(s)),r}t.exports=function(t,e,r,s){var u,a,c,l,f,p,h,d,_,g,y,v;if(e+2>r)return!1;if(f=e+1,t.sCount[f]<t.blkIndent)return!1;if(t.sCount[f]-t.blkIndent>=4)return!1;if((c=t.bMarks[f]+t.tShift[f])>=t.eMarks[f])return!1;if(124!==(u=t.src.charCodeAt(c++))&&45!==u&&58!==u)return!1;for(;c<t.eMarks[f];){if(124!==(u=t.src.charCodeAt(c))&&45!==u&&58!==u&&!n(u))return!1;c++}for(p=(a=o(t,e+1)).split(\"|\"),_=[],l=0;l<p.length;l++){if(!(g=p[l].trim())){if(0===l||l===p.length-1)continue;return!1}if(!/^:?-+:?$/.test(g))return!1;58===g.charCodeAt(g.length-1)?_.push(58===g.charCodeAt(0)?\"center\":\"right\"):58===g.charCodeAt(0)?_.push(\"left\"):_.push(\"\")}if(-1===(a=o(t,e).trim()).indexOf(\"|\"))return!1;if(t.sCount[e]-t.blkIndent>=4)return!1;if((h=(p=i(a.replace(/^\\||\\|$/g,\"\"))).length)>_.length)return!1;if(s)return!0;for((d=t.push(\"table_open\",\"table\",1)).map=y=[e,0],(d=t.push(\"thead_open\",\"thead\",1)).map=[e,e+1],(d=t.push(\"tr_open\",\"tr\",1)).map=[e,e+1],l=0;l<p.length;l++)(d=t.push(\"th_open\",\"th\",1)).map=[e,e+1],_[l]&&(d.attrs=[[\"style\",\"text-align:\"+_[l]]]),(d=t.push(\"inline\",\"\",0)).content=p[l].trim(),d.map=[e,e+1],d.children=[],d=t.push(\"th_close\",\"th\",-1);for(d=t.push(\"tr_close\",\"tr\",-1),d=t.push(\"thead_close\",\"thead\",-1),(d=t.push(\"tbody_open\",\"tbody\",1)).map=v=[e+2,0],f=e+2;f<r&&!(t.sCount[f]<t.blkIndent)&&-1!==(a=o(t,f).trim()).indexOf(\"|\")&&!(t.sCount[f]-t.blkIndent>=4);f++){for(p=i(a.replace(/^\\||\\|$/g,\"\")),d=t.push(\"tr_open\",\"tr\",1),l=0;l<h;l++)d=t.push(\"td_open\",\"td\",1),_[l]&&(d.attrs=[[\"style\",\"text-align:\"+_[l]]]),(d=t.push(\"inline\",\"\",0)).content=p[l]?p[l].trim():\"\",d.children=[],d=t.push(\"td_close\",\"td\",-1);d=t.push(\"tr_close\",\"tr\",-1)}return d=t.push(\"tbody_close\",\"tbody\",-1),d=t.push(\"table_close\",\"table\",-1),y[1]=v[1]=f,t.line=f,!0}},function(t,e,r){\"use strict\";var n=r(11),o=[[\"table\",r(102),[\"paragraph\",\"reference\"]],[\"code\",r(101)],[\"fence\",r(100),[\"paragraph\",\"reference\",\"blockquote\",\"list\"]],[\"blockquote\",r(99),[\"paragraph\",\"reference\",\"blockquote\",\"list\"]],[\"hr\",r(98),[\"paragraph\",\"reference\",\"blockquote\",\"list\"]],[\"list\",r(97),[\"paragraph\",\"reference\",\"blockquote\"]],[\"reference\",r(96)],[\"heading\",r(95),[\"paragraph\",\"reference\",\"blockquote\"]],[\"lheading\",r(94)],[\"html_block\",r(93),[\"paragraph\",\"reference\",\"blockquote\"]],[\"paragraph\",r(91)]];function i(){this.ruler=new n;for(var t=0;t<o.length;t++)this.ruler.push(o[t][0],o[t][1],{alt:(o[t][2]||[]).slice()})}i.prototype.tokenize=function(t,e,r){for(var n,o=this.ruler.getRules(\"\"),i=o.length,s=e,u=!1,a=t.md.options.maxNesting;s<r&&(t.line=s=t.skipEmptyLines(s),!(s>=r))&&!(t.sCount[s]<t.blkIndent);){if(t.level>=a){t.line=r;break}for(n=0;n<i&&!o[n](t,s,r,!1);n++);t.tight=!u,t.isEmpty(t.line-1)&&(u=!0),(s=t.line)<r&&t.isEmpty(s)&&(u=!0,s++,t.line=s)}},i.prototype.parse=function(t,e,r,n){var o;t&&(o=new this.State(t,e,r,n),this.tokenize(o,o.line,o.lineMax))},i.prototype.State=r(90),t.exports=i},function(t,e,r){\"use strict\";var n=r(10);function o(t,e,r){this.src=t,this.env=r,this.tokens=[],this.inlineMode=!1,this.md=e}o.prototype.Token=n,t.exports=o},function(t,e,r){\"use strict\";var n=r(0).isWhiteSpace,o=r(0).isPunctChar,i=r(0).isMdAsciiPunct,s=/['\"]/,u=/['\"]/g,a=\"’\";function c(t,e,r){return t.substr(0,e)+r+t.substr(e+1)}function l(t,e){var r,s,l,f,p,h,d,_,g,y,v,m,b,M,w,k,E,D,S,C,x;for(S=[],r=0;r<t.length;r++){for(s=t[r],d=t[r].level,E=S.length-1;E>=0&&!(S[E].level<=d);E--);if(S.length=E+1,\"text\"===s.type){p=0,h=(l=s.content).length;t:for(;p<h&&(u.lastIndex=p,f=u.exec(l));){if(w=k=!0,p=f.index+1,D=\"'\"===f[0],g=32,f.index-1>=0)g=l.charCodeAt(f.index-1);else for(E=r-1;E>=0&&(\"softbreak\"!==t[E].type&&\"hardbreak\"!==t[E].type);E--)if(\"text\"===t[E].type){g=t[E].content.charCodeAt(t[E].content.length-1);break}if(y=32,p<h)y=l.charCodeAt(p);else for(E=r+1;E<t.length&&(\"softbreak\"!==t[E].type&&\"hardbreak\"!==t[E].type);E++)if(\"text\"===t[E].type){y=t[E].content.charCodeAt(0);break}if(v=i(g)||o(String.fromCharCode(g)),m=i(y)||o(String.fromCharCode(y)),b=n(g),(M=n(y))?w=!1:m&&(b||v||(w=!1)),b?k=!1:v&&(M||m||(k=!1)),34===y&&'\"'===f[0]&&g>=48&&g<=57&&(k=w=!1),w&&k&&(w=!1,k=m),w||k){if(k)for(E=S.length-1;E>=0&&(_=S[E],!(S[E].level<d));E--)if(_.single===D&&S[E].level===d){_=S[E],D?(C=e.md.options.quotes[2],x=e.md.options.quotes[3]):(C=e.md.options.quotes[0],x=e.md.options.quotes[1]),s.content=c(s.content,f.index,x),t[_.token].content=c(t[_.token].content,_.pos,C),p+=x.length-1,_.token===r&&(p+=C.length-1),h=(l=s.content).length,S.length=E;continue t}w?S.push({token:r,pos:f.index,single:D,level:d}):k&&D&&(s.content=c(s.content,f.index,a))}else D&&(s.content=c(s.content,f.index,a))}}}}t.exports=function(t){var e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)\"inline\"===t.tokens[e].type&&s.test(t.tokens[e].content)&&l(t.tokens[e].children,t)}},function(t,e,r){\"use strict\";var n=/\\+-|\\.\\.|\\?\\?\\?\\?|!!!!|,,|--/,o=/\\((c|tm|r|p)\\)/i,i=/\\((c|tm|r|p)\\)/gi,s={c:\"©\",r:\"®\",p:\"§\",tm:\"™\"};function u(t,e){return s[e.toLowerCase()]}function a(t){var e,r,n=0;for(e=t.length-1;e>=0;e--)\"text\"!==(r=t[e]).type||n||(r.content=r.content.replace(i,u)),\"link_open\"===r.type&&\"auto\"===r.info&&n--,\"link_close\"===r.type&&\"auto\"===r.info&&n++}function c(t){var e,r,o=0;for(e=t.length-1;e>=0;e--)\"text\"!==(r=t[e]).type||o||n.test(r.content)&&(r.content=r.content.replace(/\\+-/g,\"±\").replace(/\\.{2,}/g,\"…\").replace(/([?!])…/g,\"$1..\").replace(/([?!]){4,}/g,\"$1$1$1\").replace(/,{2,}/g,\",\").replace(/(^|[^-])---([^-]|$)/gm,\"$1—$2\").replace(/(^|\\s)--(\\s|$)/gm,\"$1–$2\").replace(/(^|[^-\\s])--([^-\\s]|$)/gm,\"$1–$2\")),\"link_open\"===r.type&&\"auto\"===r.info&&o--,\"link_close\"===r.type&&\"auto\"===r.info&&o++}t.exports=function(t){var e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)\"inline\"===t.tokens[e].type&&(o.test(t.tokens[e].content)&&a(t.tokens[e].children),n.test(t.tokens[e].content)&&c(t.tokens[e].children))}},function(t,e,r){\"use strict\";var n=r(0).arrayReplaceAt;function o(t){return/^<a[>\\s]/i.test(t)}function i(t){return/^<\\/a\\s*>/i.test(t)}t.exports=function(t){var e,r,s,u,a,c,l,f,p,h,d,_,g,y,v,m,b,M=t.tokens;if(t.md.options.linkify)for(r=0,s=M.length;r<s;r++)if(\"inline\"===M[r].type&&t.md.linkify.pretest(M[r].content))for(g=0,e=(u=M[r].children).length-1;e>=0;e--)if(\"link_close\"!==(c=u[e]).type){if(\"html_inline\"===c.type&&(o(c.content)&&g>0&&g--,i(c.content)&&g++),!(g>0)&&\"text\"===c.type&&t.md.linkify.test(c.content)){for(p=c.content,b=t.md.linkify.match(p),l=[],_=c.level,d=0,f=0;f<b.length;f++)y=b[f].url,v=t.md.normalizeLink(y),t.md.validateLink(v)&&(m=b[f].text,m=b[f].schema?\"mailto:\"!==b[f].schema||/^mailto:/i.test(m)?t.md.normalizeLinkText(m):t.md.normalizeLinkText(\"mailto:\"+m).replace(/^mailto:/,\"\"):t.md.normalizeLinkText(\"http://\"+m).replace(/^http:\\/\\//,\"\"),(h=b[f].index)>d&&((a=new t.Token(\"text\",\"\",0)).content=p.slice(d,h),a.level=_,l.push(a)),(a=new t.Token(\"link_open\",\"a\",1)).attrs=[[\"href\",v]],a.level=_++,a.markup=\"linkify\",a.info=\"auto\",l.push(a),(a=new t.Token(\"text\",\"\",0)).content=m,a.level=_,l.push(a),(a=new t.Token(\"link_close\",\"a\",-1)).level=--_,a.markup=\"linkify\",a.info=\"auto\",l.push(a),d=b[f].lastIndex);d<p.length&&((a=new t.Token(\"text\",\"\",0)).content=p.slice(d),a.level=_,l.push(a)),M[r].children=u=n(u,e,l)}}else for(e--;u[e].level!==c.level&&\"link_open\"!==u[e].type;)e--}},function(t,e,r){\"use strict\";t.exports=function(t){var e,r,n,o=t.tokens;for(r=0,n=o.length;r<n;r++)\"inline\"===(e=o[r]).type&&t.md.inline.parse(e.content,t.md,t.env,e.children)}},function(t,e,r){\"use strict\";t.exports=function(t){var e;t.inlineMode?((e=new t.Token(\"inline\",\"\",0)).content=t.src,e.map=[0,1],e.children=[],t.tokens.push(e)):t.md.block.parse(t.src,t.md,t.env,t.tokens)}},function(t,e,r){\"use strict\";var n=/\\r[\\n\\u0085]?|[\\u2424\\u2028\\u0085]/g,o=/\\u0000/g;t.exports=function(t){var e;e=(e=t.src.replace(n,\"\\n\")).replace(o,\"�\"),t.src=e}},function(t,e,r){\"use strict\";var n=r(11),o=[[\"normalize\",r(110)],[\"block\",r(109)],[\"inline\",r(108)],[\"linkify\",r(107)],[\"replacements\",r(106)],[\"smartquotes\",r(105)]];function i(){this.ruler=new n;for(var t=0;t<o.length;t++)this.ruler.push(o[t][0],o[t][1])}i.prototype.process=function(t){var e,r,n;for(e=0,r=(n=this.ruler.getRules(\"\")).length;e<r;e++)n[e](t)},i.prototype.State=r(104),t.exports=i},function(t,e,r){\"use strict\";var n=r(0).assign,o=r(0).unescapeAll,i=r(0).escapeHtml,s={};function u(){this.rules=n({},s)}s.code_inline=function(t,e,r,n,o){var s=t[e];return\"<code\"+o.renderAttrs(s)+\">\"+i(t[e].content)+\"</code>\"},s.code_block=function(t,e,r,n,o){var s=t[e];return\"<pre\"+o.renderAttrs(s)+\"><code>\"+i(t[e].content)+\"</code></pre>\\n\"},s.fence=function(t,e,r,n,s){var u,a,c,l,f=t[e],p=f.info?o(f.info).trim():\"\",h=\"\";return p&&(h=p.split(/\\s+/g)[0]),0===(u=r.highlight&&r.highlight(f.content,h)||i(f.content)).indexOf(\"<pre\")?u+\"\\n\":p?(a=f.attrIndex(\"class\"),c=f.attrs?f.attrs.slice():[],a<0?c.push([\"class\",r.langPrefix+h]):c[a][1]+=\" \"+r.langPrefix+h,l={attrs:c},\"<pre><code\"+s.renderAttrs(l)+\">\"+u+\"</code></pre>\\n\"):\"<pre><code\"+s.renderAttrs(f)+\">\"+u+\"</code></pre>\\n\"},s.image=function(t,e,r,n,o){var i=t[e];return i.attrs[i.attrIndex(\"alt\")][1]=o.renderInlineAsText(i.children,r,n),o.renderToken(t,e,r)},s.hardbreak=function(t,e,r){return r.xhtmlOut?\"<br />\\n\":\"<br>\\n\"},s.softbreak=function(t,e,r){return r.breaks?r.xhtmlOut?\"<br />\\n\":\"<br>\\n\":\"\\n\"},s.text=function(t,e){return i(t[e].content)},s.html_block=function(t,e){return t[e].content},s.html_inline=function(t,e){return t[e].content},u.prototype.renderAttrs=function(t){var e,r,n;if(!t.attrs)return\"\";for(n=\"\",e=0,r=t.attrs.length;e<r;e++)n+=\" \"+i(t.attrs[e][0])+'=\"'+i(t.attrs[e][1])+'\"';return n},u.prototype.renderToken=function(t,e,r){var n,o=\"\",i=!1,s=t[e];return s.hidden?\"\":(s.block&&-1!==s.nesting&&e&&t[e-1].hidden&&(o+=\"\\n\"),o+=(-1===s.nesting?\"</\":\"<\")+s.tag,o+=this.renderAttrs(s),0===s.nesting&&r.xhtmlOut&&(o+=\" /\"),s.block&&(i=!0,1===s.nesting&&e+1<t.length&&(\"inline\"===(n=t[e+1]).type||n.hidden?i=!1:-1===n.nesting&&n.tag===s.tag&&(i=!1))),o+=i?\">\\n\":\">\")},u.prototype.renderInline=function(t,e,r){for(var n,o=\"\",i=this.rules,s=0,u=t.length;s<u;s++)void 0!==i[n=t[s].type]?o+=i[n](t,s,e,r,this):o+=this.renderToken(t,s,e);return o},u.prototype.renderInlineAsText=function(t,e,r){for(var n=\"\",o=0,i=t.length;o<i;o++)\"text\"===t[o].type?n+=t[o].content:\"image\"===t[o].type&&(n+=this.renderInlineAsText(t[o].children,e,r));return n},u.prototype.render=function(t,e,r){var n,o,i,s=\"\",u=this.rules;for(n=0,o=t.length;n<o;n++)\"inline\"===(i=t[n].type)?s+=this.renderInline(t[n].children,e,r):void 0!==u[i]?s+=u[t[n].type](t,n,e,r,this):s+=this.renderToken(t,n,e,r);return s},t.exports=u},function(t,e,r){\"use strict\";var n=r(0).unescapeAll;t.exports=function(t,e,r){var o,i,s=0,u=e,a={ok:!1,pos:0,lines:0,str:\"\"};if(e>=r)return a;if(34!==(i=t.charCodeAt(e))&&39!==i&&40!==i)return a;for(e++,40===i&&(i=41);e<r;){if((o=t.charCodeAt(e))===i)return a.pos=e+1,a.lines=s,a.str=n(t.slice(u+1,e)),a.ok=!0,a;10===o?s++:92===o&&e+1<r&&(e++,10===t.charCodeAt(e)&&s++),e++}return a}},function(t,e,r){\"use strict\";var n=r(0).isSpace,o=r(0).unescapeAll;t.exports=function(t,e,r){var i,s,u=e,a={ok:!1,pos:0,lines:0,str:\"\"};if(60===t.charCodeAt(e)){for(e++;e<r;){if(10===(i=t.charCodeAt(e))||n(i))return a;if(62===i)return a.pos=e+1,a.str=o(t.slice(u+1,e)),a.ok=!0,a;92===i&&e+1<r?e+=2:e++}return a}for(s=0;e<r&&32!==(i=t.charCodeAt(e))&&!(i<32||127===i);)if(92===i&&e+1<r)e+=2;else{if(40===i&&s++,41===i){if(0===s)break;s--}e++}return u===e?a:0!==s?a:(a.str=o(t.slice(u,e)),a.lines=0,a.pos=e,a.ok=!0,a)}},function(t,e,r){\"use strict\";t.exports=function(t,e,r){var n,o,i,s,u=-1,a=t.posMax,c=t.pos;for(t.pos=e+1,n=1;t.pos<a;){if(93===(i=t.src.charCodeAt(t.pos))&&0===--n){o=!0;break}if(s=t.pos,t.md.inline.skipToken(t),91===i)if(s===t.pos-1)n++;else if(r)return t.pos=c,-1}return o&&(u=t.pos),t.pos=c,u}},function(t,e,r){\"use strict\";e.parseLinkLabel=r(115),e.parseLinkDestination=r(114),e.parseLinkTitle=r(113)},function(t,e){t.exports=/[\\xAD\\u0600-\\u0605\\u061C\\u06DD\\u070F\\u08E2\\u180E\\u200B-\\u200F\\u202A-\\u202E\\u2060-\\u2064\\u2066-\\u206F\\uFEFF\\uFFF9-\\uFFFB]|\\uD804\\uDCBD|\\uD82F[\\uDCA0-\\uDCA3]|\\uD834[\\uDD73-\\uDD7A]|\\uDB40[\\uDC01\\uDC20-\\uDC7F]/},function(t,e,r){\"use strict\";e.Any=r(25),e.Cc=r(24),e.Cf=r(117),e.P=r(12),e.Z=r(23)},function(t,e,r){\"use strict\";function n(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}var o=/^([a-z0-9.+-]+:)/i,i=/:[0-9]*$/,s=/^(\\/\\/?(?!\\/)[^\\?\\s]*)(\\?[^\\s]*)?$/,u=[\"{\",\"}\",\"|\",\"\\\\\",\"^\",\"`\"].concat([\"<\",\">\",'\"',\"`\",\" \",\"\\r\",\"\\n\",\"\\t\"]),a=[\"'\"].concat(u),c=[\"%\",\"/\",\"?\",\";\",\"#\"].concat(a),l=[\"/\",\"?\",\"#\"],f=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,h={javascript:!0,\"javascript:\":!0},d={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,\"http:\":!0,\"https:\":!0,\"ftp:\":!0,\"gopher:\":!0,\"file:\":!0};n.prototype.parse=function(t,e){var r,n,i,u,a,_=t;if(_=_.trim(),!e&&1===t.split(\"#\").length){var g=s.exec(_);if(g)return this.pathname=g[1],g[2]&&(this.search=g[2]),this}var y=o.exec(_);if(y&&(i=(y=y[0]).toLowerCase(),this.protocol=y,_=_.substr(y.length)),(e||y||_.match(/^\\/\\/[^@\\/]+@[^@\\/]+/))&&(!(a=\"//\"===_.substr(0,2))||y&&h[y]||(_=_.substr(2),this.slashes=!0)),!h[y]&&(a||y&&!d[y])){var v,m,b=-1;for(r=0;r<l.length;r++)-1!==(u=_.indexOf(l[r]))&&(-1===b||u<b)&&(b=u);for(-1!==(m=-1===b?_.lastIndexOf(\"@\"):_.lastIndexOf(\"@\",b))&&(v=_.slice(0,m),_=_.slice(m+1),this.auth=v),b=-1,r=0;r<c.length;r++)-1!==(u=_.indexOf(c[r]))&&(-1===b||u<b)&&(b=u);-1===b&&(b=_.length),\":\"===_[b-1]&&b--;var M=_.slice(0,b);_=_.slice(b),this.parseHost(M),this.hostname=this.hostname||\"\";var w=\"[\"===this.hostname[0]&&\"]\"===this.hostname[this.hostname.length-1];if(!w){var k=this.hostname.split(/\\./);for(r=0,n=k.length;r<n;r++){var E=k[r];if(E&&!E.match(f)){for(var D=\"\",S=0,C=E.length;S<C;S++)E.charCodeAt(S)>127?D+=\"x\":D+=E[S];if(!D.match(f)){var x=k.slice(0,r),A=k.slice(r+1),I=E.match(p);I&&(x.push(I[1]),A.unshift(I[2])),A.length&&(_=A.join(\".\")+_),this.hostname=x.join(\".\");break}}}}this.hostname.length>255&&(this.hostname=\"\"),w&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}var N=_.indexOf(\"#\");-1!==N&&(this.hash=_.substr(N),_=_.slice(0,N));var j=_.indexOf(\"?\");return-1!==j&&(this.search=_.substr(j),_=_.slice(0,j)),_&&(this.pathname=_),d[i]&&this.hostname&&!this.pathname&&(this.pathname=\"\"),this},n.prototype.parseHost=function(t){var e=i.exec(t);e&&(\":\"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)},t.exports=function(t,e){if(t&&t instanceof n)return t;var r=new n;return r.parse(t,e),r}},function(t,e,r){\"use strict\";t.exports=function(t){var e=\"\";return e+=t.protocol||\"\",e+=t.slashes?\"//\":\"\",e+=t.auth?t.auth+\"@\":\"\",t.hostname&&-1!==t.hostname.indexOf(\":\")?e+=\"[\"+t.hostname+\"]\":e+=t.hostname||\"\",e+=t.port?\":\"+t.port:\"\",e+=t.pathname||\"\",e+=t.search||\"\",e+=t.hash||\"\"}},function(t,e,r){\"use strict\";var n={};function o(t,e){var r;return\"string\"!=typeof e&&(e=o.defaultChars),r=function(t){var e,r,o=n[t];if(o)return o;for(o=n[t]=[],e=0;e<128;e++)r=String.fromCharCode(e),o.push(r);for(e=0;e<t.length;e++)o[r=t.charCodeAt(e)]=\"%\"+(\"0\"+r.toString(16).toUpperCase()).slice(-2);return o}(e),t.replace(/(%[a-f0-9]{2})+/gi,function(t){var e,n,o,i,s,u,a,c=\"\";for(e=0,n=t.length;e<n;e+=3)(o=parseInt(t.slice(e+1,e+3),16))<128?c+=r[o]:192==(224&o)&&e+3<n&&128==(192&(i=parseInt(t.slice(e+4,e+6),16)))?(c+=(a=o<<6&1984|63&i)<128?\"��\":String.fromCharCode(a),e+=3):224==(240&o)&&e+6<n&&(i=parseInt(t.slice(e+4,e+6),16),s=parseInt(t.slice(e+7,e+9),16),128==(192&i)&&128==(192&s))?(c+=(a=o<<12&61440|i<<6&4032|63&s)<2048||a>=55296&&a<=57343?\"���\":String.fromCharCode(a),e+=6):240==(248&o)&&e+9<n&&(i=parseInt(t.slice(e+4,e+6),16),s=parseInt(t.slice(e+7,e+9),16),u=parseInt(t.slice(e+10,e+12),16),128==(192&i)&&128==(192&s)&&128==(192&u))?((a=o<<18&1835008|i<<12&258048|s<<6&4032|63&u)<65536||a>1114111?c+=\"����\":(a-=65536,c+=String.fromCharCode(55296+(a>>10),56320+(1023&a))),e+=9):c+=\"�\";return c})}o.defaultChars=\";/?:@&=+$,#\",o.componentChars=\"\",t.exports=o},function(t,e,r){\"use strict\";var n={};function o(t,e,r){var i,s,u,a,c,l=\"\";for(\"string\"!=typeof e&&(r=e,e=o.defaultChars),void 0===r&&(r=!0),c=function(t){var e,r,o=n[t];if(o)return o;for(o=n[t]=[],e=0;e<128;e++)r=String.fromCharCode(e),/^[0-9a-z]$/i.test(r)?o.push(r):o.push(\"%\"+(\"0\"+e.toString(16).toUpperCase()).slice(-2));for(e=0;e<t.length;e++)o[t.charCodeAt(e)]=t[e];return o}(e),i=0,s=t.length;i<s;i++)if(u=t.charCodeAt(i),r&&37===u&&i+2<s&&/^[0-9a-f]{2}$/i.test(t.slice(i+1,i+3)))l+=t.slice(i,i+3),i+=2;else if(u<128)l+=c[u];else if(u>=55296&&u<=57343){if(u>=55296&&u<=56319&&i+1<s&&(a=t.charCodeAt(i+1))>=56320&&a<=57343){l+=encodeURIComponent(t[i]+t[i+1]),i++;continue}l+=\"%EF%BF%BD\"}else l+=encodeURIComponent(t[i]);return l}o.defaultChars=\";/?:@&=+$,-_.!~*'()#\",o.componentChars=\"-_.!~*'()\",t.exports=o},function(t){t.exports={Aacute:\"Á\",aacute:\"á\",Abreve:\"Ă\",abreve:\"ă\",ac:\"∾\",acd:\"∿\",acE:\"∾̳\",Acirc:\"Â\",acirc:\"â\",acute:\"´\",Acy:\"А\",acy:\"а\",AElig:\"Æ\",aelig:\"æ\",af:\"⁡\",Afr:\"𝔄\",afr:\"𝔞\",Agrave:\"À\",agrave:\"à\",alefsym:\"ℵ\",aleph:\"ℵ\",Alpha:\"Α\",alpha:\"α\",Amacr:\"Ā\",amacr:\"ā\",amalg:\"⨿\",amp:\"&\",AMP:\"&\",andand:\"⩕\",And:\"⩓\",and:\"∧\",andd:\"⩜\",andslope:\"⩘\",andv:\"⩚\",ang:\"∠\",ange:\"⦤\",angle:\"∠\",angmsdaa:\"⦨\",angmsdab:\"⦩\",angmsdac:\"⦪\",angmsdad:\"⦫\",angmsdae:\"⦬\",angmsdaf:\"⦭\",angmsdag:\"⦮\",angmsdah:\"⦯\",angmsd:\"∡\",angrt:\"∟\",angrtvb:\"⊾\",angrtvbd:\"⦝\",angsph:\"∢\",angst:\"Å\",angzarr:\"⍼\",Aogon:\"Ą\",aogon:\"ą\",Aopf:\"𝔸\",aopf:\"𝕒\",apacir:\"⩯\",ap:\"≈\",apE:\"⩰\",ape:\"≊\",apid:\"≋\",apos:\"'\",ApplyFunction:\"⁡\",approx:\"≈\",approxeq:\"≊\",Aring:\"Å\",aring:\"å\",Ascr:\"𝒜\",ascr:\"𝒶\",Assign:\"≔\",ast:\"*\",asymp:\"≈\",asympeq:\"≍\",Atilde:\"Ã\",atilde:\"ã\",Auml:\"Ä\",auml:\"ä\",awconint:\"∳\",awint:\"⨑\",backcong:\"≌\",backepsilon:\"϶\",backprime:\"‵\",backsim:\"∽\",backsimeq:\"⋍\",Backslash:\"∖\",Barv:\"⫧\",barvee:\"⊽\",barwed:\"⌅\",Barwed:\"⌆\",barwedge:\"⌅\",bbrk:\"⎵\",bbrktbrk:\"⎶\",bcong:\"≌\",Bcy:\"Б\",bcy:\"б\",bdquo:\"„\",becaus:\"∵\",because:\"∵\",Because:\"∵\",bemptyv:\"⦰\",bepsi:\"϶\",bernou:\"ℬ\",Bernoullis:\"ℬ\",Beta:\"Β\",beta:\"β\",beth:\"ℶ\",between:\"≬\",Bfr:\"𝔅\",bfr:\"𝔟\",bigcap:\"⋂\",bigcirc:\"◯\",bigcup:\"⋃\",bigodot:\"⨀\",bigoplus:\"⨁\",bigotimes:\"⨂\",bigsqcup:\"⨆\",bigstar:\"★\",bigtriangledown:\"▽\",bigtriangleup:\"△\",biguplus:\"⨄\",bigvee:\"⋁\",bigwedge:\"⋀\",bkarow:\"⤍\",blacklozenge:\"⧫\",blacksquare:\"▪\",blacktriangle:\"▴\",blacktriangledown:\"▾\",blacktriangleleft:\"◂\",blacktriangleright:\"▸\",blank:\"␣\",blk12:\"▒\",blk14:\"░\",blk34:\"▓\",block:\"█\",bne:\"=⃥\",bnequiv:\"≡⃥\",bNot:\"⫭\",bnot:\"⌐\",Bopf:\"𝔹\",bopf:\"𝕓\",bot:\"⊥\",bottom:\"⊥\",bowtie:\"⋈\",boxbox:\"⧉\",boxdl:\"┐\",boxdL:\"╕\",boxDl:\"╖\",boxDL:\"╗\",boxdr:\"┌\",boxdR:\"╒\",boxDr:\"╓\",boxDR:\"╔\",boxh:\"─\",boxH:\"═\",boxhd:\"┬\",boxHd:\"╤\",boxhD:\"╥\",boxHD:\"╦\",boxhu:\"┴\",boxHu:\"╧\",boxhU:\"╨\",boxHU:\"╩\",boxminus:\"⊟\",boxplus:\"⊞\",boxtimes:\"⊠\",boxul:\"┘\",boxuL:\"╛\",boxUl:\"╜\",boxUL:\"╝\",boxur:\"└\",boxuR:\"╘\",boxUr:\"╙\",boxUR:\"╚\",boxv:\"│\",boxV:\"║\",boxvh:\"┼\",boxvH:\"╪\",boxVh:\"╫\",boxVH:\"╬\",boxvl:\"┤\",boxvL:\"╡\",boxVl:\"╢\",boxVL:\"╣\",boxvr:\"├\",boxvR:\"╞\",boxVr:\"╟\",boxVR:\"╠\",bprime:\"‵\",breve:\"˘\",Breve:\"˘\",brvbar:\"¦\",bscr:\"𝒷\",Bscr:\"ℬ\",bsemi:\"⁏\",bsim:\"∽\",bsime:\"⋍\",bsolb:\"⧅\",bsol:\"\\\\\",bsolhsub:\"⟈\",bull:\"•\",bullet:\"•\",bump:\"≎\",bumpE:\"⪮\",bumpe:\"≏\",Bumpeq:\"≎\",bumpeq:\"≏\",Cacute:\"Ć\",cacute:\"ć\",capand:\"⩄\",capbrcup:\"⩉\",capcap:\"⩋\",cap:\"∩\",Cap:\"⋒\",capcup:\"⩇\",capdot:\"⩀\",CapitalDifferentialD:\"ⅅ\",caps:\"∩︀\",caret:\"⁁\",caron:\"ˇ\",Cayleys:\"ℭ\",ccaps:\"⩍\",Ccaron:\"Č\",ccaron:\"č\",Ccedil:\"Ç\",ccedil:\"ç\",Ccirc:\"Ĉ\",ccirc:\"ĉ\",Cconint:\"∰\",ccups:\"⩌\",ccupssm:\"⩐\",Cdot:\"Ċ\",cdot:\"ċ\",cedil:\"¸\",Cedilla:\"¸\",cemptyv:\"⦲\",cent:\"¢\",centerdot:\"·\",CenterDot:\"·\",cfr:\"𝔠\",Cfr:\"ℭ\",CHcy:\"Ч\",chcy:\"ч\",check:\"✓\",checkmark:\"✓\",Chi:\"Χ\",chi:\"χ\",circ:\"ˆ\",circeq:\"≗\",circlearrowleft:\"↺\",circlearrowright:\"↻\",circledast:\"⊛\",circledcirc:\"⊚\",circleddash:\"⊝\",CircleDot:\"⊙\",circledR:\"®\",circledS:\"Ⓢ\",CircleMinus:\"⊖\",CirclePlus:\"⊕\",CircleTimes:\"⊗\",cir:\"○\",cirE:\"⧃\",cire:\"≗\",cirfnint:\"⨐\",cirmid:\"⫯\",cirscir:\"⧂\",ClockwiseContourIntegral:\"∲\",CloseCurlyDoubleQuote:\"”\",CloseCurlyQuote:\"’\",clubs:\"♣\",clubsuit:\"♣\",colon:\":\",Colon:\"∷\",Colone:\"⩴\",colone:\"≔\",coloneq:\"≔\",comma:\",\",commat:\"@\",comp:\"∁\",compfn:\"∘\",complement:\"∁\",complexes:\"ℂ\",cong:\"≅\",congdot:\"⩭\",Congruent:\"≡\",conint:\"∮\",Conint:\"∯\",ContourIntegral:\"∮\",copf:\"𝕔\",Copf:\"ℂ\",coprod:\"∐\",Coproduct:\"∐\",copy:\"©\",COPY:\"©\",copysr:\"℗\",CounterClockwiseContourIntegral:\"∳\",crarr:\"↵\",cross:\"✗\",Cross:\"⨯\",Cscr:\"𝒞\",cscr:\"𝒸\",csub:\"⫏\",csube:\"⫑\",csup:\"⫐\",csupe:\"⫒\",ctdot:\"⋯\",cudarrl:\"⤸\",cudarrr:\"⤵\",cuepr:\"⋞\",cuesc:\"⋟\",cularr:\"↶\",cularrp:\"⤽\",cupbrcap:\"⩈\",cupcap:\"⩆\",CupCap:\"≍\",cup:\"∪\",Cup:\"⋓\",cupcup:\"⩊\",cupdot:\"⊍\",cupor:\"⩅\",cups:\"∪︀\",curarr:\"↷\",curarrm:\"⤼\",curlyeqprec:\"⋞\",curlyeqsucc:\"⋟\",curlyvee:\"⋎\",curlywedge:\"⋏\",curren:\"¤\",curvearrowleft:\"↶\",curvearrowright:\"↷\",cuvee:\"⋎\",cuwed:\"⋏\",cwconint:\"∲\",cwint:\"∱\",cylcty:\"⌭\",dagger:\"†\",Dagger:\"‡\",daleth:\"ℸ\",darr:\"↓\",Darr:\"↡\",dArr:\"⇓\",dash:\"‐\",Dashv:\"⫤\",dashv:\"⊣\",dbkarow:\"⤏\",dblac:\"˝\",Dcaron:\"Ď\",dcaron:\"ď\",Dcy:\"Д\",dcy:\"д\",ddagger:\"‡\",ddarr:\"⇊\",DD:\"ⅅ\",dd:\"ⅆ\",DDotrahd:\"⤑\",ddotseq:\"⩷\",deg:\"°\",Del:\"∇\",Delta:\"Δ\",delta:\"δ\",demptyv:\"⦱\",dfisht:\"⥿\",Dfr:\"𝔇\",dfr:\"𝔡\",dHar:\"⥥\",dharl:\"⇃\",dharr:\"⇂\",DiacriticalAcute:\"´\",DiacriticalDot:\"˙\",DiacriticalDoubleAcute:\"˝\",DiacriticalGrave:\"`\",DiacriticalTilde:\"˜\",diam:\"⋄\",diamond:\"⋄\",Diamond:\"⋄\",diamondsuit:\"♦\",diams:\"♦\",die:\"¨\",DifferentialD:\"ⅆ\",digamma:\"ϝ\",disin:\"⋲\",div:\"÷\",divide:\"÷\",divideontimes:\"⋇\",divonx:\"⋇\",DJcy:\"Ђ\",djcy:\"ђ\",dlcorn:\"⌞\",dlcrop:\"⌍\",dollar:\"$\",Dopf:\"𝔻\",dopf:\"𝕕\",Dot:\"¨\",dot:\"˙\",DotDot:\"⃜\",doteq:\"≐\",doteqdot:\"≑\",DotEqual:\"≐\",dotminus:\"∸\",dotplus:\"∔\",dotsquare:\"⊡\",doublebarwedge:\"⌆\",DoubleContourIntegral:\"∯\",DoubleDot:\"¨\",DoubleDownArrow:\"⇓\",DoubleLeftArrow:\"⇐\",DoubleLeftRightArrow:\"⇔\",DoubleLeftTee:\"⫤\",DoubleLongLeftArrow:\"⟸\",DoubleLongLeftRightArrow:\"⟺\",DoubleLongRightArrow:\"⟹\",DoubleRightArrow:\"⇒\",DoubleRightTee:\"⊨\",DoubleUpArrow:\"⇑\",DoubleUpDownArrow:\"⇕\",DoubleVerticalBar:\"∥\",DownArrowBar:\"⤓\",downarrow:\"↓\",DownArrow:\"↓\",Downarrow:\"⇓\",DownArrowUpArrow:\"⇵\",DownBreve:\"̑\",downdownarrows:\"⇊\",downharpoonleft:\"⇃\",downharpoonright:\"⇂\",DownLeftRightVector:\"⥐\",DownLeftTeeVector:\"⥞\",DownLeftVectorBar:\"⥖\",DownLeftVector:\"↽\",DownRightTeeVector:\"⥟\",DownRightVectorBar:\"⥗\",DownRightVector:\"⇁\",DownTeeArrow:\"↧\",DownTee:\"⊤\",drbkarow:\"⤐\",drcorn:\"⌟\",drcrop:\"⌌\",Dscr:\"𝒟\",dscr:\"𝒹\",DScy:\"Ѕ\",dscy:\"ѕ\",dsol:\"⧶\",Dstrok:\"Đ\",dstrok:\"đ\",dtdot:\"⋱\",dtri:\"▿\",dtrif:\"▾\",duarr:\"⇵\",duhar:\"⥯\",dwangle:\"⦦\",DZcy:\"Џ\",dzcy:\"џ\",dzigrarr:\"⟿\",Eacute:\"É\",eacute:\"é\",easter:\"⩮\",Ecaron:\"Ě\",ecaron:\"ě\",Ecirc:\"Ê\",ecirc:\"ê\",ecir:\"≖\",ecolon:\"≕\",Ecy:\"Э\",ecy:\"э\",eDDot:\"⩷\",Edot:\"Ė\",edot:\"ė\",eDot:\"≑\",ee:\"ⅇ\",efDot:\"≒\",Efr:\"𝔈\",efr:\"𝔢\",eg:\"⪚\",Egrave:\"È\",egrave:\"è\",egs:\"⪖\",egsdot:\"⪘\",el:\"⪙\",Element:\"∈\",elinters:\"⏧\",ell:\"ℓ\",els:\"⪕\",elsdot:\"⪗\",Emacr:\"Ē\",emacr:\"ē\",empty:\"∅\",emptyset:\"∅\",EmptySmallSquare:\"◻\",emptyv:\"∅\",EmptyVerySmallSquare:\"▫\",emsp13:\" \",emsp14:\" \",emsp:\" \",ENG:\"Ŋ\",eng:\"ŋ\",ensp:\" \",Eogon:\"Ę\",eogon:\"ę\",Eopf:\"𝔼\",eopf:\"𝕖\",epar:\"⋕\",eparsl:\"⧣\",eplus:\"⩱\",epsi:\"ε\",Epsilon:\"Ε\",epsilon:\"ε\",epsiv:\"ϵ\",eqcirc:\"≖\",eqcolon:\"≕\",eqsim:\"≂\",eqslantgtr:\"⪖\",eqslantless:\"⪕\",Equal:\"⩵\",equals:\"=\",EqualTilde:\"≂\",equest:\"≟\",Equilibrium:\"⇌\",equiv:\"≡\",equivDD:\"⩸\",eqvparsl:\"⧥\",erarr:\"⥱\",erDot:\"≓\",escr:\"ℯ\",Escr:\"ℰ\",esdot:\"≐\",Esim:\"⩳\",esim:\"≂\",Eta:\"Η\",eta:\"η\",ETH:\"Ð\",eth:\"ð\",Euml:\"Ë\",euml:\"ë\",euro:\"€\",excl:\"!\",exist:\"∃\",Exists:\"∃\",expectation:\"ℰ\",exponentiale:\"ⅇ\",ExponentialE:\"ⅇ\",fallingdotseq:\"≒\",Fcy:\"Ф\",fcy:\"ф\",female:\"♀\",ffilig:\"ffi\",fflig:\"ff\",ffllig:\"ffl\",Ffr:\"𝔉\",ffr:\"𝔣\",filig:\"fi\",FilledSmallSquare:\"◼\",FilledVerySmallSquare:\"▪\",fjlig:\"fj\",flat:\"♭\",fllig:\"fl\",fltns:\"▱\",fnof:\"ƒ\",Fopf:\"𝔽\",fopf:\"𝕗\",forall:\"∀\",ForAll:\"∀\",fork:\"⋔\",forkv:\"⫙\",Fouriertrf:\"ℱ\",fpartint:\"⨍\",frac12:\"½\",frac13:\"⅓\",frac14:\"¼\",frac15:\"⅕\",frac16:\"⅙\",frac18:\"⅛\",frac23:\"⅔\",frac25:\"⅖\",frac34:\"¾\",frac35:\"⅗\",frac38:\"⅜\",frac45:\"⅘\",frac56:\"⅚\",frac58:\"⅝\",frac78:\"⅞\",frasl:\"⁄\",frown:\"⌢\",fscr:\"𝒻\",Fscr:\"ℱ\",gacute:\"ǵ\",Gamma:\"Γ\",gamma:\"γ\",Gammad:\"Ϝ\",gammad:\"ϝ\",gap:\"⪆\",Gbreve:\"Ğ\",gbreve:\"ğ\",Gcedil:\"Ģ\",Gcirc:\"Ĝ\",gcirc:\"ĝ\",Gcy:\"Г\",gcy:\"г\",Gdot:\"Ġ\",gdot:\"ġ\",ge:\"≥\",gE:\"≧\",gEl:\"⪌\",gel:\"⋛\",geq:\"≥\",geqq:\"≧\",geqslant:\"⩾\",gescc:\"⪩\",ges:\"⩾\",gesdot:\"⪀\",gesdoto:\"⪂\",gesdotol:\"⪄\",gesl:\"⋛︀\",gesles:\"⪔\",Gfr:\"𝔊\",gfr:\"𝔤\",gg:\"≫\",Gg:\"⋙\",ggg:\"⋙\",gimel:\"ℷ\",GJcy:\"Ѓ\",gjcy:\"ѓ\",gla:\"⪥\",gl:\"≷\",glE:\"⪒\",glj:\"⪤\",gnap:\"⪊\",gnapprox:\"⪊\",gne:\"⪈\",gnE:\"≩\",gneq:\"⪈\",gneqq:\"≩\",gnsim:\"⋧\",Gopf:\"𝔾\",gopf:\"𝕘\",grave:\"`\",GreaterEqual:\"≥\",GreaterEqualLess:\"⋛\",GreaterFullEqual:\"≧\",GreaterGreater:\"⪢\",GreaterLess:\"≷\",GreaterSlantEqual:\"⩾\",GreaterTilde:\"≳\",Gscr:\"𝒢\",gscr:\"ℊ\",gsim:\"≳\",gsime:\"⪎\",gsiml:\"⪐\",gtcc:\"⪧\",gtcir:\"⩺\",gt:\">\",GT:\">\",Gt:\"≫\",gtdot:\"⋗\",gtlPar:\"⦕\",gtquest:\"⩼\",gtrapprox:\"⪆\",gtrarr:\"⥸\",gtrdot:\"⋗\",gtreqless:\"⋛\",gtreqqless:\"⪌\",gtrless:\"≷\",gtrsim:\"≳\",gvertneqq:\"≩︀\",gvnE:\"≩︀\",Hacek:\"ˇ\",hairsp:\" \",half:\"½\",hamilt:\"ℋ\",HARDcy:\"Ъ\",hardcy:\"ъ\",harrcir:\"⥈\",harr:\"↔\",hArr:\"⇔\",harrw:\"↭\",Hat:\"^\",hbar:\"ℏ\",Hcirc:\"Ĥ\",hcirc:\"ĥ\",hearts:\"♥\",heartsuit:\"♥\",hellip:\"…\",hercon:\"⊹\",hfr:\"𝔥\",Hfr:\"ℌ\",HilbertSpace:\"ℋ\",hksearow:\"⤥\",hkswarow:\"⤦\",hoarr:\"⇿\",homtht:\"∻\",hookleftarrow:\"↩\",hookrightarrow:\"↪\",hopf:\"𝕙\",Hopf:\"ℍ\",horbar:\"―\",HorizontalLine:\"─\",hscr:\"𝒽\",Hscr:\"ℋ\",hslash:\"ℏ\",Hstrok:\"Ħ\",hstrok:\"ħ\",HumpDownHump:\"≎\",HumpEqual:\"≏\",hybull:\"⁃\",hyphen:\"‐\",Iacute:\"Í\",iacute:\"í\",ic:\"⁣\",Icirc:\"Î\",icirc:\"î\",Icy:\"И\",icy:\"и\",Idot:\"İ\",IEcy:\"Е\",iecy:\"е\",iexcl:\"¡\",iff:\"⇔\",ifr:\"𝔦\",Ifr:\"ℑ\",Igrave:\"Ì\",igrave:\"ì\",ii:\"ⅈ\",iiiint:\"⨌\",iiint:\"∭\",iinfin:\"⧜\",iiota:\"℩\",IJlig:\"IJ\",ijlig:\"ij\",Imacr:\"Ī\",imacr:\"ī\",image:\"ℑ\",ImaginaryI:\"ⅈ\",imagline:\"ℐ\",imagpart:\"ℑ\",imath:\"ı\",Im:\"ℑ\",imof:\"⊷\",imped:\"Ƶ\",Implies:\"⇒\",incare:\"℅\",in:\"∈\",infin:\"∞\",infintie:\"⧝\",inodot:\"ı\",intcal:\"⊺\",int:\"∫\",Int:\"∬\",integers:\"ℤ\",Integral:\"∫\",intercal:\"⊺\",Intersection:\"⋂\",intlarhk:\"⨗\",intprod:\"⨼\",InvisibleComma:\"⁣\",InvisibleTimes:\"⁢\",IOcy:\"Ё\",iocy:\"ё\",Iogon:\"Į\",iogon:\"į\",Iopf:\"𝕀\",iopf:\"𝕚\",Iota:\"Ι\",iota:\"ι\",iprod:\"⨼\",iquest:\"¿\",iscr:\"𝒾\",Iscr:\"ℐ\",isin:\"∈\",isindot:\"⋵\",isinE:\"⋹\",isins:\"⋴\",isinsv:\"⋳\",isinv:\"∈\",it:\"⁢\",Itilde:\"Ĩ\",itilde:\"ĩ\",Iukcy:\"І\",iukcy:\"і\",Iuml:\"Ï\",iuml:\"ï\",Jcirc:\"Ĵ\",jcirc:\"ĵ\",Jcy:\"Й\",jcy:\"й\",Jfr:\"𝔍\",jfr:\"𝔧\",jmath:\"ȷ\",Jopf:\"𝕁\",jopf:\"𝕛\",Jscr:\"𝒥\",jscr:\"𝒿\",Jsercy:\"Ј\",jsercy:\"ј\",Jukcy:\"Є\",jukcy:\"є\",Kappa:\"Κ\",kappa:\"κ\",kappav:\"ϰ\",Kcedil:\"Ķ\",kcedil:\"ķ\",Kcy:\"К\",kcy:\"к\",Kfr:\"𝔎\",kfr:\"𝔨\",kgreen:\"ĸ\",KHcy:\"Х\",khcy:\"х\",KJcy:\"Ќ\",kjcy:\"ќ\",Kopf:\"𝕂\",kopf:\"𝕜\",Kscr:\"𝒦\",kscr:\"𝓀\",lAarr:\"⇚\",Lacute:\"Ĺ\",lacute:\"ĺ\",laemptyv:\"⦴\",lagran:\"ℒ\",Lambda:\"Λ\",lambda:\"λ\",lang:\"⟨\",Lang:\"⟪\",langd:\"⦑\",langle:\"⟨\",lap:\"⪅\",Laplacetrf:\"ℒ\",laquo:\"«\",larrb:\"⇤\",larrbfs:\"⤟\",larr:\"←\",Larr:\"↞\",lArr:\"⇐\",larrfs:\"⤝\",larrhk:\"↩\",larrlp:\"↫\",larrpl:\"⤹\",larrsim:\"⥳\",larrtl:\"↢\",latail:\"⤙\",lAtail:\"⤛\",lat:\"⪫\",late:\"⪭\",lates:\"⪭︀\",lbarr:\"⤌\",lBarr:\"⤎\",lbbrk:\"❲\",lbrace:\"{\",lbrack:\"[\",lbrke:\"⦋\",lbrksld:\"⦏\",lbrkslu:\"⦍\",Lcaron:\"Ľ\",lcaron:\"ľ\",Lcedil:\"Ļ\",lcedil:\"ļ\",lceil:\"⌈\",lcub:\"{\",Lcy:\"Л\",lcy:\"л\",ldca:\"⤶\",ldquo:\"“\",ldquor:\"„\",ldrdhar:\"⥧\",ldrushar:\"⥋\",ldsh:\"↲\",le:\"≤\",lE:\"≦\",LeftAngleBracket:\"⟨\",LeftArrowBar:\"⇤\",leftarrow:\"←\",LeftArrow:\"←\",Leftarrow:\"⇐\",LeftArrowRightArrow:\"⇆\",leftarrowtail:\"↢\",LeftCeiling:\"⌈\",LeftDoubleBracket:\"⟦\",LeftDownTeeVector:\"⥡\",LeftDownVectorBar:\"⥙\",LeftDownVector:\"⇃\",LeftFloor:\"⌊\",leftharpoondown:\"↽\",leftharpoonup:\"↼\",leftleftarrows:\"⇇\",leftrightarrow:\"↔\",LeftRightArrow:\"↔\",Leftrightarrow:\"⇔\",leftrightarrows:\"⇆\",leftrightharpoons:\"⇋\",leftrightsquigarrow:\"↭\",LeftRightVector:\"⥎\",LeftTeeArrow:\"↤\",LeftTee:\"⊣\",LeftTeeVector:\"⥚\",leftthreetimes:\"⋋\",LeftTriangleBar:\"⧏\",LeftTriangle:\"⊲\",LeftTriangleEqual:\"⊴\",LeftUpDownVector:\"⥑\",LeftUpTeeVector:\"⥠\",LeftUpVectorBar:\"⥘\",LeftUpVector:\"↿\",LeftVectorBar:\"⥒\",LeftVector:\"↼\",lEg:\"⪋\",leg:\"⋚\",leq:\"≤\",leqq:\"≦\",leqslant:\"⩽\",lescc:\"⪨\",les:\"⩽\",lesdot:\"⩿\",lesdoto:\"⪁\",lesdotor:\"⪃\",lesg:\"⋚︀\",lesges:\"⪓\",lessapprox:\"⪅\",lessdot:\"⋖\",lesseqgtr:\"⋚\",lesseqqgtr:\"⪋\",LessEqualGreater:\"⋚\",LessFullEqual:\"≦\",LessGreater:\"≶\",lessgtr:\"≶\",LessLess:\"⪡\",lesssim:\"≲\",LessSlantEqual:\"⩽\",LessTilde:\"≲\",lfisht:\"⥼\",lfloor:\"⌊\",Lfr:\"𝔏\",lfr:\"𝔩\",lg:\"≶\",lgE:\"⪑\",lHar:\"⥢\",lhard:\"↽\",lharu:\"↼\",lharul:\"⥪\",lhblk:\"▄\",LJcy:\"Љ\",ljcy:\"љ\",llarr:\"⇇\",ll:\"≪\",Ll:\"⋘\",llcorner:\"⌞\",Lleftarrow:\"⇚\",llhard:\"⥫\",lltri:\"◺\",Lmidot:\"Ŀ\",lmidot:\"ŀ\",lmoustache:\"⎰\",lmoust:\"⎰\",lnap:\"⪉\",lnapprox:\"⪉\",lne:\"⪇\",lnE:\"≨\",lneq:\"⪇\",lneqq:\"≨\",lnsim:\"⋦\",loang:\"⟬\",loarr:\"⇽\",lobrk:\"⟦\",longleftarrow:\"⟵\",LongLeftArrow:\"⟵\",Longleftarrow:\"⟸\",longleftrightarrow:\"⟷\",LongLeftRightArrow:\"⟷\",Longleftrightarrow:\"⟺\",longmapsto:\"⟼\",longrightarrow:\"⟶\",LongRightArrow:\"⟶\",Longrightarrow:\"⟹\",looparrowleft:\"↫\",looparrowright:\"↬\",lopar:\"⦅\",Lopf:\"𝕃\",lopf:\"𝕝\",loplus:\"⨭\",lotimes:\"⨴\",lowast:\"∗\",lowbar:\"_\",LowerLeftArrow:\"↙\",LowerRightArrow:\"↘\",loz:\"◊\",lozenge:\"◊\",lozf:\"⧫\",lpar:\"(\",lparlt:\"⦓\",lrarr:\"⇆\",lrcorner:\"⌟\",lrhar:\"⇋\",lrhard:\"⥭\",lrm:\"‎\",lrtri:\"⊿\",lsaquo:\"‹\",lscr:\"𝓁\",Lscr:\"ℒ\",lsh:\"↰\",Lsh:\"↰\",lsim:\"≲\",lsime:\"⪍\",lsimg:\"⪏\",lsqb:\"[\",lsquo:\"‘\",lsquor:\"‚\",Lstrok:\"Ł\",lstrok:\"ł\",ltcc:\"⪦\",ltcir:\"⩹\",lt:\"<\",LT:\"<\",Lt:\"≪\",ltdot:\"⋖\",lthree:\"⋋\",ltimes:\"⋉\",ltlarr:\"⥶\",ltquest:\"⩻\",ltri:\"◃\",ltrie:\"⊴\",ltrif:\"◂\",ltrPar:\"⦖\",lurdshar:\"⥊\",luruhar:\"⥦\",lvertneqq:\"≨︀\",lvnE:\"≨︀\",macr:\"¯\",male:\"♂\",malt:\"✠\",maltese:\"✠\",Map:\"⤅\",map:\"↦\",mapsto:\"↦\",mapstodown:\"↧\",mapstoleft:\"↤\",mapstoup:\"↥\",marker:\"▮\",mcomma:\"⨩\",Mcy:\"М\",mcy:\"м\",mdash:\"—\",mDDot:\"∺\",measuredangle:\"∡\",MediumSpace:\" \",Mellintrf:\"ℳ\",Mfr:\"𝔐\",mfr:\"𝔪\",mho:\"℧\",micro:\"µ\",midast:\"*\",midcir:\"⫰\",mid:\"∣\",middot:\"·\",minusb:\"⊟\",minus:\"−\",minusd:\"∸\",minusdu:\"⨪\",MinusPlus:\"∓\",mlcp:\"⫛\",mldr:\"…\",mnplus:\"∓\",models:\"⊧\",Mopf:\"𝕄\",mopf:\"𝕞\",mp:\"∓\",mscr:\"𝓂\",Mscr:\"ℳ\",mstpos:\"∾\",Mu:\"Μ\",mu:\"μ\",multimap:\"⊸\",mumap:\"⊸\",nabla:\"∇\",Nacute:\"Ń\",nacute:\"ń\",nang:\"∠⃒\",nap:\"≉\",napE:\"⩰̸\",napid:\"≋̸\",napos:\"ʼn\",napprox:\"≉\",natural:\"♮\",naturals:\"ℕ\",natur:\"♮\",nbsp:\" \",nbump:\"≎̸\",nbumpe:\"≏̸\",ncap:\"⩃\",Ncaron:\"Ň\",ncaron:\"ň\",Ncedil:\"Ņ\",ncedil:\"ņ\",ncong:\"≇\",ncongdot:\"⩭̸\",ncup:\"⩂\",Ncy:\"Н\",ncy:\"н\",ndash:\"–\",nearhk:\"⤤\",nearr:\"↗\",neArr:\"⇗\",nearrow:\"↗\",ne:\"≠\",nedot:\"≐̸\",NegativeMediumSpace:\"​\",NegativeThickSpace:\"​\",NegativeThinSpace:\"​\",NegativeVeryThinSpace:\"​\",nequiv:\"≢\",nesear:\"⤨\",nesim:\"≂̸\",NestedGreaterGreater:\"≫\",NestedLessLess:\"≪\",NewLine:\"\\n\",nexist:\"∄\",nexists:\"∄\",Nfr:\"𝔑\",nfr:\"𝔫\",ngE:\"≧̸\",nge:\"≱\",ngeq:\"≱\",ngeqq:\"≧̸\",ngeqslant:\"⩾̸\",nges:\"⩾̸\",nGg:\"⋙̸\",ngsim:\"≵\",nGt:\"≫⃒\",ngt:\"≯\",ngtr:\"≯\",nGtv:\"≫̸\",nharr:\"↮\",nhArr:\"⇎\",nhpar:\"⫲\",ni:\"∋\",nis:\"⋼\",nisd:\"⋺\",niv:\"∋\",NJcy:\"Њ\",njcy:\"њ\",nlarr:\"↚\",nlArr:\"⇍\",nldr:\"‥\",nlE:\"≦̸\",nle:\"≰\",nleftarrow:\"↚\",nLeftarrow:\"⇍\",nleftrightarrow:\"↮\",nLeftrightarrow:\"⇎\",nleq:\"≰\",nleqq:\"≦̸\",nleqslant:\"⩽̸\",nles:\"⩽̸\",nless:\"≮\",nLl:\"⋘̸\",nlsim:\"≴\",nLt:\"≪⃒\",nlt:\"≮\",nltri:\"⋪\",nltrie:\"⋬\",nLtv:\"≪̸\",nmid:\"∤\",NoBreak:\"⁠\",NonBreakingSpace:\" \",nopf:\"𝕟\",Nopf:\"ℕ\",Not:\"⫬\",not:\"¬\",NotCongruent:\"≢\",NotCupCap:\"≭\",NotDoubleVerticalBar:\"∦\",NotElement:\"∉\",NotEqual:\"≠\",NotEqualTilde:\"≂̸\",NotExists:\"∄\",NotGreater:\"≯\",NotGreaterEqual:\"≱\",NotGreaterFullEqual:\"≧̸\",NotGreaterGreater:\"≫̸\",NotGreaterLess:\"≹\",NotGreaterSlantEqual:\"⩾̸\",NotGreaterTilde:\"≵\",NotHumpDownHump:\"≎̸\",NotHumpEqual:\"≏̸\",notin:\"∉\",notindot:\"⋵̸\",notinE:\"⋹̸\",notinva:\"∉\",notinvb:\"⋷\",notinvc:\"⋶\",NotLeftTriangleBar:\"⧏̸\",NotLeftTriangle:\"⋪\",NotLeftTriangleEqual:\"⋬\",NotLess:\"≮\",NotLessEqual:\"≰\",NotLessGreater:\"≸\",NotLessLess:\"≪̸\",NotLessSlantEqual:\"⩽̸\",NotLessTilde:\"≴\",NotNestedGreaterGreater:\"⪢̸\",NotNestedLessLess:\"⪡̸\",notni:\"∌\",notniva:\"∌\",notnivb:\"⋾\",notnivc:\"⋽\",NotPrecedes:\"⊀\",NotPrecedesEqual:\"⪯̸\",NotPrecedesSlantEqual:\"⋠\",NotReverseElement:\"∌\",NotRightTriangleBar:\"⧐̸\",NotRightTriangle:\"⋫\",NotRightTriangleEqual:\"⋭\",NotSquareSubset:\"⊏̸\",NotSquareSubsetEqual:\"⋢\",NotSquareSuperset:\"⊐̸\",NotSquareSupersetEqual:\"⋣\",NotSubset:\"⊂⃒\",NotSubsetEqual:\"⊈\",NotSucceeds:\"⊁\",NotSucceedsEqual:\"⪰̸\",NotSucceedsSlantEqual:\"⋡\",NotSucceedsTilde:\"≿̸\",NotSuperset:\"⊃⃒\",NotSupersetEqual:\"⊉\",NotTilde:\"≁\",NotTildeEqual:\"≄\",NotTildeFullEqual:\"≇\",NotTildeTilde:\"≉\",NotVerticalBar:\"∤\",nparallel:\"∦\",npar:\"∦\",nparsl:\"⫽⃥\",npart:\"∂̸\",npolint:\"⨔\",npr:\"⊀\",nprcue:\"⋠\",nprec:\"⊀\",npreceq:\"⪯̸\",npre:\"⪯̸\",nrarrc:\"⤳̸\",nrarr:\"↛\",nrArr:\"⇏\",nrarrw:\"↝̸\",nrightarrow:\"↛\",nRightarrow:\"⇏\",nrtri:\"⋫\",nrtrie:\"⋭\",nsc:\"⊁\",nsccue:\"⋡\",nsce:\"⪰̸\",Nscr:\"𝒩\",nscr:\"𝓃\",nshortmid:\"∤\",nshortparallel:\"∦\",nsim:\"≁\",nsime:\"≄\",nsimeq:\"≄\",nsmid:\"∤\",nspar:\"∦\",nsqsube:\"⋢\",nsqsupe:\"⋣\",nsub:\"⊄\",nsubE:\"⫅̸\",nsube:\"⊈\",nsubset:\"⊂⃒\",nsubseteq:\"⊈\",nsubseteqq:\"⫅̸\",nsucc:\"⊁\",nsucceq:\"⪰̸\",nsup:\"⊅\",nsupE:\"⫆̸\",nsupe:\"⊉\",nsupset:\"⊃⃒\",nsupseteq:\"⊉\",nsupseteqq:\"⫆̸\",ntgl:\"≹\",Ntilde:\"Ñ\",ntilde:\"ñ\",ntlg:\"≸\",ntriangleleft:\"⋪\",ntrianglelefteq:\"⋬\",ntriangleright:\"⋫\",ntrianglerighteq:\"⋭\",Nu:\"Ν\",nu:\"ν\",num:\"#\",numero:\"№\",numsp:\" \",nvap:\"≍⃒\",nvdash:\"⊬\",nvDash:\"⊭\",nVdash:\"⊮\",nVDash:\"⊯\",nvge:\"≥⃒\",nvgt:\">⃒\",nvHarr:\"⤄\",nvinfin:\"⧞\",nvlArr:\"⤂\",nvle:\"≤⃒\",nvlt:\"<⃒\",nvltrie:\"⊴⃒\",nvrArr:\"⤃\",nvrtrie:\"⊵⃒\",nvsim:\"∼⃒\",nwarhk:\"⤣\",nwarr:\"↖\",nwArr:\"⇖\",nwarrow:\"↖\",nwnear:\"⤧\",Oacute:\"Ó\",oacute:\"ó\",oast:\"⊛\",Ocirc:\"Ô\",ocirc:\"ô\",ocir:\"⊚\",Ocy:\"О\",ocy:\"о\",odash:\"⊝\",Odblac:\"Ő\",odblac:\"ő\",odiv:\"⨸\",odot:\"⊙\",odsold:\"⦼\",OElig:\"Œ\",oelig:\"œ\",ofcir:\"⦿\",Ofr:\"𝔒\",ofr:\"𝔬\",ogon:\"˛\",Ograve:\"Ò\",ograve:\"ò\",ogt:\"⧁\",ohbar:\"⦵\",ohm:\"Ω\",oint:\"∮\",olarr:\"↺\",olcir:\"⦾\",olcross:\"⦻\",oline:\"‾\",olt:\"⧀\",Omacr:\"Ō\",omacr:\"ō\",Omega:\"Ω\",omega:\"ω\",Omicron:\"Ο\",omicron:\"ο\",omid:\"⦶\",ominus:\"⊖\",Oopf:\"𝕆\",oopf:\"𝕠\",opar:\"⦷\",OpenCurlyDoubleQuote:\"“\",OpenCurlyQuote:\"‘\",operp:\"⦹\",oplus:\"⊕\",orarr:\"↻\",Or:\"⩔\",or:\"∨\",ord:\"⩝\",order:\"ℴ\",orderof:\"ℴ\",ordf:\"ª\",ordm:\"º\",origof:\"⊶\",oror:\"⩖\",orslope:\"⩗\",orv:\"⩛\",oS:\"Ⓢ\",Oscr:\"𝒪\",oscr:\"ℴ\",Oslash:\"Ø\",oslash:\"ø\",osol:\"⊘\",Otilde:\"Õ\",otilde:\"õ\",otimesas:\"⨶\",Otimes:\"⨷\",otimes:\"⊗\",Ouml:\"Ö\",ouml:\"ö\",ovbar:\"⌽\",OverBar:\"‾\",OverBrace:\"⏞\",OverBracket:\"⎴\",OverParenthesis:\"⏜\",para:\"¶\",parallel:\"∥\",par:\"∥\",parsim:\"⫳\",parsl:\"⫽\",part:\"∂\",PartialD:\"∂\",Pcy:\"П\",pcy:\"п\",percnt:\"%\",period:\".\",permil:\"‰\",perp:\"⊥\",pertenk:\"‱\",Pfr:\"𝔓\",pfr:\"𝔭\",Phi:\"Φ\",phi:\"φ\",phiv:\"ϕ\",phmmat:\"ℳ\",phone:\"☎\",Pi:\"Π\",pi:\"π\",pitchfork:\"⋔\",piv:\"ϖ\",planck:\"ℏ\",planckh:\"ℎ\",plankv:\"ℏ\",plusacir:\"⨣\",plusb:\"⊞\",pluscir:\"⨢\",plus:\"+\",plusdo:\"∔\",plusdu:\"⨥\",pluse:\"⩲\",PlusMinus:\"±\",plusmn:\"±\",plussim:\"⨦\",plustwo:\"⨧\",pm:\"±\",Poincareplane:\"ℌ\",pointint:\"⨕\",popf:\"𝕡\",Popf:\"ℙ\",pound:\"£\",prap:\"⪷\",Pr:\"⪻\",pr:\"≺\",prcue:\"≼\",precapprox:\"⪷\",prec:\"≺\",preccurlyeq:\"≼\",Precedes:\"≺\",PrecedesEqual:\"⪯\",PrecedesSlantEqual:\"≼\",PrecedesTilde:\"≾\",preceq:\"⪯\",precnapprox:\"⪹\",precneqq:\"⪵\",precnsim:\"⋨\",pre:\"⪯\",prE:\"⪳\",precsim:\"≾\",prime:\"′\",Prime:\"″\",primes:\"ℙ\",prnap:\"⪹\",prnE:\"⪵\",prnsim:\"⋨\",prod:\"∏\",Product:\"∏\",profalar:\"⌮\",profline:\"⌒\",profsurf:\"⌓\",prop:\"∝\",Proportional:\"∝\",Proportion:\"∷\",propto:\"∝\",prsim:\"≾\",prurel:\"⊰\",Pscr:\"𝒫\",pscr:\"𝓅\",Psi:\"Ψ\",psi:\"ψ\",puncsp:\" \",Qfr:\"𝔔\",qfr:\"𝔮\",qint:\"⨌\",qopf:\"𝕢\",Qopf:\"ℚ\",qprime:\"⁗\",Qscr:\"𝒬\",qscr:\"𝓆\",quaternions:\"ℍ\",quatint:\"⨖\",quest:\"?\",questeq:\"≟\",quot:'\"',QUOT:'\"',rAarr:\"⇛\",race:\"∽̱\",Racute:\"Ŕ\",racute:\"ŕ\",radic:\"√\",raemptyv:\"⦳\",rang:\"⟩\",Rang:\"⟫\",rangd:\"⦒\",range:\"⦥\",rangle:\"⟩\",raquo:\"»\",rarrap:\"⥵\",rarrb:\"⇥\",rarrbfs:\"⤠\",rarrc:\"⤳\",rarr:\"→\",Rarr:\"↠\",rArr:\"⇒\",rarrfs:\"⤞\",rarrhk:\"↪\",rarrlp:\"↬\",rarrpl:\"⥅\",rarrsim:\"⥴\",Rarrtl:\"⤖\",rarrtl:\"↣\",rarrw:\"↝\",ratail:\"⤚\",rAtail:\"⤜\",ratio:\"∶\",rationals:\"ℚ\",rbarr:\"⤍\",rBarr:\"⤏\",RBarr:\"⤐\",rbbrk:\"❳\",rbrace:\"}\",rbrack:\"]\",rbrke:\"⦌\",rbrksld:\"⦎\",rbrkslu:\"⦐\",Rcaron:\"Ř\",rcaron:\"ř\",Rcedil:\"Ŗ\",rcedil:\"ŗ\",rceil:\"⌉\",rcub:\"}\",Rcy:\"Р\",rcy:\"р\",rdca:\"⤷\",rdldhar:\"⥩\",rdquo:\"”\",rdquor:\"”\",rdsh:\"↳\",real:\"ℜ\",realine:\"ℛ\",realpart:\"ℜ\",reals:\"ℝ\",Re:\"ℜ\",rect:\"▭\",reg:\"®\",REG:\"®\",ReverseElement:\"∋\",ReverseEquilibrium:\"⇋\",ReverseUpEquilibrium:\"⥯\",rfisht:\"⥽\",rfloor:\"⌋\",rfr:\"𝔯\",Rfr:\"ℜ\",rHar:\"⥤\",rhard:\"⇁\",rharu:\"⇀\",rharul:\"⥬\",Rho:\"Ρ\",rho:\"ρ\",rhov:\"ϱ\",RightAngleBracket:\"⟩\",RightArrowBar:\"⇥\",rightarrow:\"→\",RightArrow:\"→\",Rightarrow:\"⇒\",RightArrowLeftArrow:\"⇄\",rightarrowtail:\"↣\",RightCeiling:\"⌉\",RightDoubleBracket:\"⟧\",RightDownTeeVector:\"⥝\",RightDownVectorBar:\"⥕\",RightDownVector:\"⇂\",RightFloor:\"⌋\",rightharpoondown:\"⇁\",rightharpoonup:\"⇀\",rightleftarrows:\"⇄\",rightleftharpoons:\"⇌\",rightrightarrows:\"⇉\",rightsquigarrow:\"↝\",RightTeeArrow:\"↦\",RightTee:\"⊢\",RightTeeVector:\"⥛\",rightthreetimes:\"⋌\",RightTriangleBar:\"⧐\",RightTriangle:\"⊳\",RightTriangleEqual:\"⊵\",RightUpDownVector:\"⥏\",RightUpTeeVector:\"⥜\",RightUpVectorBar:\"⥔\",RightUpVector:\"↾\",RightVectorBar:\"⥓\",RightVector:\"⇀\",ring:\"˚\",risingdotseq:\"≓\",rlarr:\"⇄\",rlhar:\"⇌\",rlm:\"‏\",rmoustache:\"⎱\",rmoust:\"⎱\",rnmid:\"⫮\",roang:\"⟭\",roarr:\"⇾\",robrk:\"⟧\",ropar:\"⦆\",ropf:\"𝕣\",Ropf:\"ℝ\",roplus:\"⨮\",rotimes:\"⨵\",RoundImplies:\"⥰\",rpar:\")\",rpargt:\"⦔\",rppolint:\"⨒\",rrarr:\"⇉\",Rrightarrow:\"⇛\",rsaquo:\"›\",rscr:\"𝓇\",Rscr:\"ℛ\",rsh:\"↱\",Rsh:\"↱\",rsqb:\"]\",rsquo:\"’\",rsquor:\"’\",rthree:\"⋌\",rtimes:\"⋊\",rtri:\"▹\",rtrie:\"⊵\",rtrif:\"▸\",rtriltri:\"⧎\",RuleDelayed:\"⧴\",ruluhar:\"⥨\",rx:\"℞\",Sacute:\"Ś\",sacute:\"ś\",sbquo:\"‚\",scap:\"⪸\",Scaron:\"Š\",scaron:\"š\",Sc:\"⪼\",sc:\"≻\",sccue:\"≽\",sce:\"⪰\",scE:\"⪴\",Scedil:\"Ş\",scedil:\"ş\",Scirc:\"Ŝ\",scirc:\"ŝ\",scnap:\"⪺\",scnE:\"⪶\",scnsim:\"⋩\",scpolint:\"⨓\",scsim:\"≿\",Scy:\"С\",scy:\"с\",sdotb:\"⊡\",sdot:\"⋅\",sdote:\"⩦\",searhk:\"⤥\",searr:\"↘\",seArr:\"⇘\",searrow:\"↘\",sect:\"§\",semi:\";\",seswar:\"⤩\",setminus:\"∖\",setmn:\"∖\",sext:\"✶\",Sfr:\"𝔖\",sfr:\"𝔰\",sfrown:\"⌢\",sharp:\"♯\",SHCHcy:\"Щ\",shchcy:\"щ\",SHcy:\"Ш\",shcy:\"ш\",ShortDownArrow:\"↓\",ShortLeftArrow:\"←\",shortmid:\"∣\",shortparallel:\"∥\",ShortRightArrow:\"→\",ShortUpArrow:\"↑\",shy:\"­\",Sigma:\"Σ\",sigma:\"σ\",sigmaf:\"ς\",sigmav:\"ς\",sim:\"∼\",simdot:\"⩪\",sime:\"≃\",simeq:\"≃\",simg:\"⪞\",simgE:\"⪠\",siml:\"⪝\",simlE:\"⪟\",simne:\"≆\",simplus:\"⨤\",simrarr:\"⥲\",slarr:\"←\",SmallCircle:\"∘\",smallsetminus:\"∖\",smashp:\"⨳\",smeparsl:\"⧤\",smid:\"∣\",smile:\"⌣\",smt:\"⪪\",smte:\"⪬\",smtes:\"⪬︀\",SOFTcy:\"Ь\",softcy:\"ь\",solbar:\"⌿\",solb:\"⧄\",sol:\"/\",Sopf:\"𝕊\",sopf:\"𝕤\",spades:\"♠\",spadesuit:\"♠\",spar:\"∥\",sqcap:\"⊓\",sqcaps:\"⊓︀\",sqcup:\"⊔\",sqcups:\"⊔︀\",Sqrt:\"√\",sqsub:\"⊏\",sqsube:\"⊑\",sqsubset:\"⊏\",sqsubseteq:\"⊑\",sqsup:\"⊐\",sqsupe:\"⊒\",sqsupset:\"⊐\",sqsupseteq:\"⊒\",square:\"□\",Square:\"□\",SquareIntersection:\"⊓\",SquareSubset:\"⊏\",SquareSubsetEqual:\"⊑\",SquareSuperset:\"⊐\",SquareSupersetEqual:\"⊒\",SquareUnion:\"⊔\",squarf:\"▪\",squ:\"□\",squf:\"▪\",srarr:\"→\",Sscr:\"𝒮\",sscr:\"𝓈\",ssetmn:\"∖\",ssmile:\"⌣\",sstarf:\"⋆\",Star:\"⋆\",star:\"☆\",starf:\"★\",straightepsilon:\"ϵ\",straightphi:\"ϕ\",strns:\"¯\",sub:\"⊂\",Sub:\"⋐\",subdot:\"⪽\",subE:\"⫅\",sube:\"⊆\",subedot:\"⫃\",submult:\"⫁\",subnE:\"⫋\",subne:\"⊊\",subplus:\"⪿\",subrarr:\"⥹\",subset:\"⊂\",Subset:\"⋐\",subseteq:\"⊆\",subseteqq:\"⫅\",SubsetEqual:\"⊆\",subsetneq:\"⊊\",subsetneqq:\"⫋\",subsim:\"⫇\",subsub:\"⫕\",subsup:\"⫓\",succapprox:\"⪸\",succ:\"≻\",succcurlyeq:\"≽\",Succeeds:\"≻\",SucceedsEqual:\"⪰\",SucceedsSlantEqual:\"≽\",SucceedsTilde:\"≿\",succeq:\"⪰\",succnapprox:\"⪺\",succneqq:\"⪶\",succnsim:\"⋩\",succsim:\"≿\",SuchThat:\"∋\",sum:\"∑\",Sum:\"∑\",sung:\"♪\",sup1:\"¹\",sup2:\"²\",sup3:\"³\",sup:\"⊃\",Sup:\"⋑\",supdot:\"⪾\",supdsub:\"⫘\",supE:\"⫆\",supe:\"⊇\",supedot:\"⫄\",Superset:\"⊃\",SupersetEqual:\"⊇\",suphsol:\"⟉\",suphsub:\"⫗\",suplarr:\"⥻\",supmult:\"⫂\",supnE:\"⫌\",supne:\"⊋\",supplus:\"⫀\",supset:\"⊃\",Supset:\"⋑\",supseteq:\"⊇\",supseteqq:\"⫆\",supsetneq:\"⊋\",supsetneqq:\"⫌\",supsim:\"⫈\",supsub:\"⫔\",supsup:\"⫖\",swarhk:\"⤦\",swarr:\"↙\",swArr:\"⇙\",swarrow:\"↙\",swnwar:\"⤪\",szlig:\"ß\",Tab:\"\\t\",target:\"⌖\",Tau:\"Τ\",tau:\"τ\",tbrk:\"⎴\",Tcaron:\"Ť\",tcaron:\"ť\",Tcedil:\"Ţ\",tcedil:\"ţ\",Tcy:\"Т\",tcy:\"т\",tdot:\"⃛\",telrec:\"⌕\",Tfr:\"𝔗\",tfr:\"𝔱\",there4:\"∴\",therefore:\"∴\",Therefore:\"∴\",Theta:\"Θ\",theta:\"θ\",thetasym:\"ϑ\",thetav:\"ϑ\",thickapprox:\"≈\",thicksim:\"∼\",ThickSpace:\"  \",ThinSpace:\" \",thinsp:\" \",thkap:\"≈\",thksim:\"∼\",THORN:\"Þ\",thorn:\"þ\",tilde:\"˜\",Tilde:\"∼\",TildeEqual:\"≃\",TildeFullEqual:\"≅\",TildeTilde:\"≈\",timesbar:\"⨱\",timesb:\"⊠\",times:\"×\",timesd:\"⨰\",tint:\"∭\",toea:\"⤨\",topbot:\"⌶\",topcir:\"⫱\",top:\"⊤\",Topf:\"𝕋\",topf:\"𝕥\",topfork:\"⫚\",tosa:\"⤩\",tprime:\"‴\",trade:\"™\",TRADE:\"™\",triangle:\"▵\",triangledown:\"▿\",triangleleft:\"◃\",trianglelefteq:\"⊴\",triangleq:\"≜\",triangleright:\"▹\",trianglerighteq:\"⊵\",tridot:\"◬\",trie:\"≜\",triminus:\"⨺\",TripleDot:\"⃛\",triplus:\"⨹\",trisb:\"⧍\",tritime:\"⨻\",trpezium:\"⏢\",Tscr:\"𝒯\",tscr:\"𝓉\",TScy:\"Ц\",tscy:\"ц\",TSHcy:\"Ћ\",tshcy:\"ћ\",Tstrok:\"Ŧ\",tstrok:\"ŧ\",twixt:\"≬\",twoheadleftarrow:\"↞\",twoheadrightarrow:\"↠\",Uacute:\"Ú\",uacute:\"ú\",uarr:\"↑\",Uarr:\"↟\",uArr:\"⇑\",Uarrocir:\"⥉\",Ubrcy:\"Ў\",ubrcy:\"ў\",Ubreve:\"Ŭ\",ubreve:\"ŭ\",Ucirc:\"Û\",ucirc:\"û\",Ucy:\"У\",ucy:\"у\",udarr:\"⇅\",Udblac:\"Ű\",udblac:\"ű\",udhar:\"⥮\",ufisht:\"⥾\",Ufr:\"𝔘\",ufr:\"𝔲\",Ugrave:\"Ù\",ugrave:\"ù\",uHar:\"⥣\",uharl:\"↿\",uharr:\"↾\",uhblk:\"▀\",ulcorn:\"⌜\",ulcorner:\"⌜\",ulcrop:\"⌏\",ultri:\"◸\",Umacr:\"Ū\",umacr:\"ū\",uml:\"¨\",UnderBar:\"_\",UnderBrace:\"⏟\",UnderBracket:\"⎵\",UnderParenthesis:\"⏝\",Union:\"⋃\",UnionPlus:\"⊎\",Uogon:\"Ų\",uogon:\"ų\",Uopf:\"𝕌\",uopf:\"𝕦\",UpArrowBar:\"⤒\",uparrow:\"↑\",UpArrow:\"↑\",Uparrow:\"⇑\",UpArrowDownArrow:\"⇅\",updownarrow:\"↕\",UpDownArrow:\"↕\",Updownarrow:\"⇕\",UpEquilibrium:\"⥮\",upharpoonleft:\"↿\",upharpoonright:\"↾\",uplus:\"⊎\",UpperLeftArrow:\"↖\",UpperRightArrow:\"↗\",upsi:\"υ\",Upsi:\"ϒ\",upsih:\"ϒ\",Upsilon:\"Υ\",upsilon:\"υ\",UpTeeArrow:\"↥\",UpTee:\"⊥\",upuparrows:\"⇈\",urcorn:\"⌝\",urcorner:\"⌝\",urcrop:\"⌎\",Uring:\"Ů\",uring:\"ů\",urtri:\"◹\",Uscr:\"𝒰\",uscr:\"𝓊\",utdot:\"⋰\",Utilde:\"Ũ\",utilde:\"ũ\",utri:\"▵\",utrif:\"▴\",uuarr:\"⇈\",Uuml:\"Ü\",uuml:\"ü\",uwangle:\"⦧\",vangrt:\"⦜\",varepsilon:\"ϵ\",varkappa:\"ϰ\",varnothing:\"∅\",varphi:\"ϕ\",varpi:\"ϖ\",varpropto:\"∝\",varr:\"↕\",vArr:\"⇕\",varrho:\"ϱ\",varsigma:\"ς\",varsubsetneq:\"⊊︀\",varsubsetneqq:\"⫋︀\",varsupsetneq:\"⊋︀\",varsupsetneqq:\"⫌︀\",vartheta:\"ϑ\",vartriangleleft:\"⊲\",vartriangleright:\"⊳\",vBar:\"⫨\",Vbar:\"⫫\",vBarv:\"⫩\",Vcy:\"В\",vcy:\"в\",vdash:\"⊢\",vDash:\"⊨\",Vdash:\"⊩\",VDash:\"⊫\",Vdashl:\"⫦\",veebar:\"⊻\",vee:\"∨\",Vee:\"⋁\",veeeq:\"≚\",vellip:\"⋮\",verbar:\"|\",Verbar:\"‖\",vert:\"|\",Vert:\"‖\",VerticalBar:\"∣\",VerticalLine:\"|\",VerticalSeparator:\"❘\",VerticalTilde:\"≀\",VeryThinSpace:\" \",Vfr:\"𝔙\",vfr:\"𝔳\",vltri:\"⊲\",vnsub:\"⊂⃒\",vnsup:\"⊃⃒\",Vopf:\"𝕍\",vopf:\"𝕧\",vprop:\"∝\",vrtri:\"⊳\",Vscr:\"𝒱\",vscr:\"𝓋\",vsubnE:\"⫋︀\",vsubne:\"⊊︀\",vsupnE:\"⫌︀\",vsupne:\"⊋︀\",Vvdash:\"⊪\",vzigzag:\"⦚\",Wcirc:\"Ŵ\",wcirc:\"ŵ\",wedbar:\"⩟\",wedge:\"∧\",Wedge:\"⋀\",wedgeq:\"≙\",weierp:\"℘\",Wfr:\"𝔚\",wfr:\"𝔴\",Wopf:\"𝕎\",wopf:\"𝕨\",wp:\"℘\",wr:\"≀\",wreath:\"≀\",Wscr:\"𝒲\",wscr:\"𝓌\",xcap:\"⋂\",xcirc:\"◯\",xcup:\"⋃\",xdtri:\"▽\",Xfr:\"𝔛\",xfr:\"𝔵\",xharr:\"⟷\",xhArr:\"⟺\",Xi:\"Ξ\",xi:\"ξ\",xlarr:\"⟵\",xlArr:\"⟸\",xmap:\"⟼\",xnis:\"⋻\",xodot:\"⨀\",Xopf:\"𝕏\",xopf:\"𝕩\",xoplus:\"⨁\",xotime:\"⨂\",xrarr:\"⟶\",xrArr:\"⟹\",Xscr:\"𝒳\",xscr:\"𝓍\",xsqcup:\"⨆\",xuplus:\"⨄\",xutri:\"△\",xvee:\"⋁\",xwedge:\"⋀\",Yacute:\"Ý\",yacute:\"ý\",YAcy:\"Я\",yacy:\"я\",Ycirc:\"Ŷ\",ycirc:\"ŷ\",Ycy:\"Ы\",ycy:\"ы\",yen:\"¥\",Yfr:\"𝔜\",yfr:\"𝔶\",YIcy:\"Ї\",yicy:\"ї\",Yopf:\"𝕐\",yopf:\"𝕪\",Yscr:\"𝒴\",yscr:\"𝓎\",YUcy:\"Ю\",yucy:\"ю\",yuml:\"ÿ\",Yuml:\"Ÿ\",Zacute:\"Ź\",zacute:\"ź\",Zcaron:\"Ž\",zcaron:\"ž\",Zcy:\"З\",zcy:\"з\",Zdot:\"Ż\",zdot:\"ż\",zeetrf:\"ℨ\",ZeroWidthSpace:\"​\",Zeta:\"Ζ\",zeta:\"ζ\",zfr:\"𝔷\",Zfr:\"ℨ\",ZHcy:\"Ж\",zhcy:\"ж\",zigrarr:\"⇝\",zopf:\"𝕫\",Zopf:\"ℤ\",Zscr:\"𝒵\",zscr:\"𝓏\",zwj:\"‍\",zwnj:\"‌\"}},function(t,e,r){\"use strict\";var n=r(0),o=r(116),i=r(112),s=r(111),u=r(103),a=r(89),c=r(76),l=r(26),f=r(74),p={default:r(72),zero:r(71),commonmark:r(70)},h=/^(vbscript|javascript|file|data):/,d=/^data:image\\/(gif|png|jpeg|webp);/;function _(t){var e=t.trim().toLowerCase();return!h.test(e)||!!d.test(e)}var g=[\"http:\",\"https:\",\"mailto:\"];function y(t){var e=l.parse(t,!0);if(e.hostname&&(!e.protocol||g.indexOf(e.protocol)>=0))try{e.hostname=f.toASCII(e.hostname)}catch(t){}return l.encode(l.format(e))}function v(t){var e=l.parse(t,!0);if(e.hostname&&(!e.protocol||g.indexOf(e.protocol)>=0))try{e.hostname=f.toUnicode(e.hostname)}catch(t){}return l.decode(l.format(e))}function m(t,e){if(!(this instanceof m))return new m(t,e);e||n.isString(t)||(e=t||{},t=\"default\"),this.inline=new a,this.block=new u,this.core=new s,this.renderer=new i,this.linkify=new c,this.validateLink=_,this.normalizeLink=y,this.normalizeLinkText=v,this.utils=n,this.helpers=n.assign({},o),this.options={},this.configure(t),e&&this.set(e)}m.prototype.set=function(t){return n.assign(this.options,t),this},m.prototype.configure=function(t){var e,r=this;if(n.isString(t)&&!(t=p[e=t]))throw new Error('Wrong `markdown-it` preset \"'+e+'\", check name');if(!t)throw new Error(\"Wrong `markdown-it` preset, can't be empty\");return t.options&&r.set(t.options),t.components&&Object.keys(t.components).forEach(function(e){t.components[e].rules&&r[e].ruler.enableOnly(t.components[e].rules),t.components[e].rules2&&r[e].ruler2.enableOnly(t.components[e].rules2)}),this},m.prototype.enable=function(t,e){var r=[];Array.isArray(t)||(t=[t]),[\"core\",\"block\",\"inline\"].forEach(function(e){r=r.concat(this[e].ruler.enable(t,!0))},this),r=r.concat(this.inline.ruler2.enable(t,!0));var n=t.filter(function(t){return r.indexOf(t)<0});if(n.length&&!e)throw new Error(\"MarkdownIt. Failed to enable unknown rule(s): \"+n);return this},m.prototype.disable=function(t,e){var r=[];Array.isArray(t)||(t=[t]),[\"core\",\"block\",\"inline\"].forEach(function(e){r=r.concat(this[e].ruler.disable(t,!0))},this),r=r.concat(this.inline.ruler2.disable(t,!0));var n=t.filter(function(t){return r.indexOf(t)<0});if(n.length&&!e)throw new Error(\"MarkdownIt. Failed to disable unknown rule(s): \"+n);return this},m.prototype.use=function(t){var e=[this].concat(Array.prototype.slice.call(arguments,1));return t.apply(t,e),this},m.prototype.parse=function(t,e){if(\"string\"!=typeof t)throw new Error(\"Input data should be a String\");var r=new this.core.State(t,this,e);return this.core.process(r),r.tokens},m.prototype.render=function(t,e){return e=e||{},this.renderer.render(this.parse(t,e),this.options,e)},m.prototype.parseInline=function(t,e){var r=new this.core.State(t,this,e);return r.inlineMode=!0,this.core.process(r),r.tokens},m.prototype.renderInline=function(t,e){return e=e||{},this.renderer.render(this.parseInline(t,e),this.options,e)},t.exports=m},function(t,e,r){\"use strict\";t.exports=r(124)},function(t,e,r){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});var n=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,\"value\"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),o=r(2),i=f(o),s=f(r(125)),u=f(r(69)),a=f(r(68)),c=f(r(67)),l=r(6);function f(t){return t&&t.__esModule?t:{default:t}}r(66);var p=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e),function(t,e){if(!t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!e||\"object\"!=typeof e&&\"function\"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,o.PureComponent),n(e,[{key:\"render\",value:function(){var t=(0,s.default)().use(u.default).use(a.default).use(c.default,{attrs:{target:\"_blank\",rel:\"noopener\"}}).render(this.props.message.get(\"text\"));return i.default.createElement(\"div\",{className:\"rcw-\"+this.props.message.get(\"sender\")},i.default.createElement(\"div\",{className:\"rcw-message-text\",dangerouslySetInnerHTML:{__html:t}}))}}]),e}();p.propTypes={message:l.PROP_TYPES.MESSAGE},e.default=p},function(t,e,r){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});var n=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,\"value\"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),o=r(2),i=p(o),s=p(r(1)),u=p(r(14)),a=r(3),c=r(15),l=r(13),f=p(r(58));function p(t){return t&&t.__esModule?t:{default:t}}function h(t,e){if(!t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!e||\"object\"!=typeof e&&\"function\"!=typeof e?t:e}r(55);var d=function(t){function e(){var t,r,n;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e);for(var o=arguments.length,s=Array(o),u=0;u<o;u++)s[u]=arguments[u];return r=n=h(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(s))),n.$message=null,n.getComponentToRender=function(t){var e=t.get(\"component\");n.props.messages.get();return\"component\"===t.get(\"type\")?i.default.createElement(e,t.get(\"props\")):i.default.createElement(e,{message:t})},n.shouldRenderAvatar=function(t,e){var r=n.props.messages.get(e-1);t.get(\"showAvatar\")&&r.get(\"showAvatar\")&&n.props.dispatch((0,c.hideAvatar)(e))},h(n,r)}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,o.Component),n(e,[{key:\"componentDidMount\",value:function(){(0,l.scrollToBottom)(this.$message)}},{key:\"componentDidUpdate\",value:function(){(0,l.scrollToBottom)(this.$message)}},{key:\"render\",value:function(){var t=this,e=this.props,r=e.messages,n=e.profileAvatar,o=e.typing;return i.default.createElement(\"div\",{id:\"messages\",className:\"rcw-messages-container\",ref:function(e){return t.$message=e}},r.map(function(e,r){return i.default.createElement(\"div\",{className:\"rcw-message\",key:r},n&&e.get(\"showAvatar\")&&i.default.createElement(\"img\",{src:n,className:\"rcw-avatar\",alt:\"profile\"}),t.getComponentToRender(e))}),i.default.createElement(f.default,{typing:o}))}}]),e}();d.propTypes={messages:u.default.listOf(u.default.map),profileAvatar:s.default.string},e.default=(0,a.connect)(function(t){return{messages:t.messages,typing:t.behavior.get(\"msgLoader\")}})(d)},,function(t,e,r){},function(t,e,r){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});var n=s(r(2)),o=s(r(1)),i=s(r(28));function s(t){return t&&t.__esModule?t:{default:t}}r(129);var u=function(t){var e=t.title,r=t.subtitle,o=t.toggleChat,s=t.showCloseButton,u=t.titleAvatar;return n.default.createElement(\"div\",{className:\"rcw-header\"},s&&n.default.createElement(\"button\",{className:\"rcw-close-button\",onClick:o},n.default.createElement(\"img\",{src:i.default,className:\"rcw-close\",alt:\"close\"})),n.default.createElement(\"h4\",{className:\"rcw-title\"},u&&n.default.createElement(\"img\",{src:u,className:\"avatar\",alt:\"profile\"}),e),n.default.createElement(\"span\",null,r))};u.propTypes={title:o.default.string,subtitle:o.default.string,toggleChat:o.default.func,showCloseButton:o.default.bool,titleAvatar:o.default.string},e.default=u},function(t,e,r){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});var n=c(r(2)),o=c(r(1)),i=c(r(130)),s=c(r(127)),u=c(r(53)),a=c(r(49));function c(t){return t&&t.__esModule?t:{default:t}}r(46);var l=function(t){return n.default.createElement(\"div\",{className:\"rcw-conversation-container\"},n.default.createElement(i.default,{title:t.title,subtitle:t.subtitle,toggleChat:t.toggleChat,showCloseButton:t.showCloseButton,titleAvatar:t.titleAvatar}),n.default.createElement(s.default,{profileAvatar:t.profileAvatar}),n.default.createElement(a.default,{onQuickButtonClicked:t.onQuickButtonClicked}),n.default.createElement(u.default,{sendMessage:t.sendMessage,placeholder:t.senderPlaceHolder,disabledInput:t.disabledInput,autofocus:t.autofocus}))};l.propTypes={title:o.default.string,titleAvatar:o.default.string,subtitle:o.default.string,sendMessage:o.default.func,senderPlaceHolder:o.default.string,profileAvatar:o.default.string,toggleChat:o.default.func,showCloseButton:o.default.bool,disabledInput:o.default.bool,autofocus:o.default.bool},e.default=l},function(t,e,r){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});var n=a(r(2)),o=r(3),i=a(r(1)),s=a(r(131)),u=a(r(44));function a(t){return t&&t.__esModule?t:{default:t}}r(37);var c=function(t){return n.default.createElement(\"div\",{className:\"rcw-widget-container \"+(t.fullScreenMode?\"rcw-full-screen\":\"\")+\" \"+(t.showChat?\"rcw-opened\":\"\")},t.showChat&&n.default.createElement(s.default,{title:t.title,subtitle:t.subtitle,sendMessage:t.onSendMessage,senderPlaceHolder:t.senderPlaceHolder,onQuickButtonClicked:t.onQuickButtonClicked,profileAvatar:t.profileAvatar,toggleChat:t.onToggleConversation,showChat:t.showChat,showCloseButton:t.showCloseButton,disabledInput:t.disabledInput,autofocus:t.autofocus,titleAvatar:t.titleAvatar}),t.customLauncher?t.customLauncher(t.onToggleConversation):!t.fullScreenMode&&n.default.createElement(u.default,{toggle:t.onToggleConversation,badge:t.badge}))};c.propTypes={title:i.default.string,titleAvatar:i.default.string,subtitle:i.default.string,onSendMessage:i.default.func,onToggleConversation:i.default.func,showChat:i.default.bool,senderPlaceHolder:i.default.string,onQuickButtonClicked:i.default.func,profileAvatar:i.default.string,showCloseButton:i.default.bool,disabledInput:i.default.bool,fullScreenMode:i.default.bool,badge:i.default.number,autofocus:i.default.bool,customLauncher:i.default.func},e.default=(0,o.connect)(function(t){return{showChat:t.behavior.get(\"showChat\"),disabledInput:t.behavior.get(\"disabledInput\")}})(c)},function(t,e,r){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});var n=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,\"value\"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),o=r(2),i=l(o),s=r(3),u=l(r(1)),a=r(15),c=l(r(132));function l(t){return t&&t.__esModule?t:{default:t}}function f(t,e){if(!t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!e||\"object\"!=typeof e&&\"function\"!=typeof e?t:e}var p=function(t){function e(){var t,r,n;!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,e);for(var o=arguments.length,i=Array(o),s=0;s<o;s++)i[s]=arguments[s];return r=n=f(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(i))),n.toggleConversation=function(){n.props.dispatch((0,a.toggleChat)())},n.handleMessageSubmit=function(t){t.preventDefault();var e=t.target.message.value;e.trim()&&(n.props.dispatch((0,a.addUserMessage)(e)),n.props.handleNewUserMessage(e)),t.target.message.value=\"\"},n.handleQuickButtonClicked=function(t,e){t.preventDefault(),n.props.handleQuickButtonClicked&&n.props.handleQuickButtonClicked(e)},f(n,r)}return function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,o.Component),n(e,[{key:\"componentWillReceiveProps\",value:function(t){t.fullScreenMode&&this.props.dispatch((0,a.toggleChat)())}},{key:\"render\",value:function(){return i.default.createElement(c.default,{onToggleConversation:this.toggleConversation,onSendMessage:this.handleMessageSubmit,onQuickButtonClicked:this.handleQuickButtonClicked,title:this.props.title,titleAvatar:this.props.titleAvatar,subtitle:this.props.subtitle,senderPlaceHolder:this.props.senderPlaceHolder,profileAvatar:this.props.profileAvatar,showCloseButton:this.props.showCloseButton,fullScreenMode:this.props.fullScreenMode,badge:this.props.badge,autofocus:this.props.autofocus,customLauncher:this.props.customLauncher})}}]),e}();p.propTypes={title:u.default.string,titleAvatar:u.default.string,subtitle:u.default.string,handleNewUserMessage:u.default.func.isRequired,handleQuickButtonClicked:u.default.func.isRequired,senderPlaceHolder:u.default.string,profileAvatar:u.default.string,showCloseButton:u.default.bool,fullScreenMode:u.default.bool,badge:u.default.number,autofocus:u.default.bool,customLauncher:u.default.func},e.default=(0,s.connect)()(p)},function(t,e){t.exports=function(t){if(!t.webpackPolyfill){var e=Object.create(t);e.children||(e.children=[]),Object.defineProperty(e,\"loaded\",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,\"id\",{enumerable:!0,get:function(){return e.i}}),Object.defineProperty(e,\"exports\",{enumerable:!0}),e.webpackPolyfill=1}return e}},function(t,e,r){\"use strict\";t.exports=\"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED\"},function(t,e,r){\"use strict\";var n=r(135);function o(){}t.exports=function(){function t(t,e,r,o,i,s){if(s!==n){var u=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\");throw u.name=\"Invariant Violation\",u}}function e(){return t}t.isRequired=t;var r={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e};return r.checkPropTypes=o,r.PropTypes=r,r}},function(t,e,r){\"use strict\";function n(t){return function(){return t}}var o=function(){};o.thatReturns=n,o.thatReturnsFalse=n(!1),o.thatReturnsTrue=n(!0),o.thatReturnsNull=n(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(t){return t},t.exports=o},function(t,e,r){\"use strict\";t.exports={}},function(t,e,r){\"use strict\";var n=function(t){};t.exports=function(t,e,r,o,i,s,u,a){if(n(e),!t){var c;if(void 0===e)c=new Error(\"Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.\");else{var l=[r,o,i,s,u,a],f=0;(c=new Error(e.replace(/%s/g,function(){return l[f++]}))).name=\"Invariant Violation\"}throw c.framesToPop=1,c}}},function(t,e,r){\"use strict\";\n/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/var n=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;t.exports=function(){try{if(!Object.assign)return!1;var t=new String(\"abc\");if(t[5]=\"de\",\"5\"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e[\"_\"+String.fromCharCode(r)]=r;if(\"0123456789\"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(\"\"))return!1;var n={};return\"abcdefghijklmnopqrst\".split(\"\").forEach(function(t){n[t]=t}),\"abcdefghijklmnopqrst\"===Object.keys(Object.assign({},n)).join(\"\")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,s,u=function(t){if(null===t||void 0===t)throw new TypeError(\"Object.assign cannot be called with null or undefined\");return Object(t)}(t),a=1;a<arguments.length;a++){for(var c in r=Object(arguments[a]))o.call(r,c)&&(u[c]=r[c]);if(n){s=n(r);for(var l=0;l<s.length;l++)i.call(r,s[l])&&(u[s[l]]=r[s[l]])}}return u}},function(t,e,r){\"use strict\";\n/** @license React v16.4.1\n * react.production.min.js\n *\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */var n=r(140),o=r(139),i=r(138),s=r(137),u=\"function\"==typeof Symbol&&Symbol.for,a=u?Symbol.for(\"react.element\"):60103,c=u?Symbol.for(\"react.portal\"):60106,l=u?Symbol.for(\"react.fragment\"):60107,f=u?Symbol.for(\"react.strict_mode\"):60108,p=u?Symbol.for(\"react.profiler\"):60114,h=u?Symbol.for(\"react.provider\"):60109,d=u?Symbol.for(\"react.context\"):60110,_=u?Symbol.for(\"react.async_mode\"):60111,g=u?Symbol.for(\"react.forward_ref\"):60112;u&&Symbol.for(\"react.timeout\");var y=\"function\"==typeof Symbol&&Symbol.iterator;function v(t){for(var e=arguments.length-1,r=\"https://reactjs.org/docs/error-decoder.html?invariant=\"+t,n=0;n<e;n++)r+=\"&args[]=\"+encodeURIComponent(arguments[n+1]);o(!1,\"Minified React error #\"+t+\"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. \",r)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}};function b(t,e,r){this.props=t,this.context=e,this.refs=i,this.updater=r||m}function M(){}function w(t,e,r){this.props=t,this.context=e,this.refs=i,this.updater=r||m}b.prototype.isReactComponent={},b.prototype.setState=function(t,e){\"object\"!=typeof t&&\"function\"!=typeof t&&null!=t&&v(\"85\"),this.updater.enqueueSetState(this,t,e,\"setState\")},b.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,\"forceUpdate\")},M.prototype=b.prototype;var k=w.prototype=new M;k.constructor=w,n(k,b.prototype),k.isPureReactComponent=!0;var E={current:null},D=Object.prototype.hasOwnProperty,S={key:!0,ref:!0,__self:!0,__source:!0};function C(t,e,r){var n=void 0,o={},i=null,s=null;if(null!=e)for(n in void 0!==e.ref&&(s=e.ref),void 0!==e.key&&(i=\"\"+e.key),e)D.call(e,n)&&!S.hasOwnProperty(n)&&(o[n]=e[n]);var u=arguments.length-2;if(1===u)o.children=r;else if(1<u){for(var c=Array(u),l=0;l<u;l++)c[l]=arguments[l+2];o.children=c}if(t&&t.defaultProps)for(n in u=t.defaultProps)void 0===o[n]&&(o[n]=u[n]);return{$$typeof:a,type:t,key:i,ref:s,props:o,_owner:E.current}}function x(t){return\"object\"==typeof t&&null!==t&&t.$$typeof===a}var A=/\\/+/g,I=[];function N(t,e,r,n){if(I.length){var o=I.pop();return o.result=t,o.keyPrefix=e,o.func=r,o.context=n,o.count=0,o}return{result:t,keyPrefix:e,func:r,context:n,count:0}}function j(t){t.result=null,t.keyPrefix=null,t.func=null,t.context=null,t.count=0,10>I.length&&I.push(t)}function T(t,e,r,n){var o=typeof t;\"undefined\"!==o&&\"boolean\"!==o||(t=null);var i=!1;if(null===t)i=!0;else switch(o){case\"string\":case\"number\":i=!0;break;case\"object\":switch(t.$$typeof){case a:case c:i=!0}}if(i)return r(n,t,\"\"===e?\".\"+O(t,0):e),1;if(i=0,e=\"\"===e?\".\":e+\":\",Array.isArray(t))for(var s=0;s<t.length;s++){var u=e+O(o=t[s],s);i+=T(o,u,r,n)}else if(null===t||void 0===t?u=null:u=\"function\"==typeof(u=y&&t[y]||t[\"@@iterator\"])?u:null,\"function\"==typeof u)for(t=u.call(t),s=0;!(o=t.next()).done;)i+=T(o=o.value,u=e+O(o,s++),r,n);else\"object\"===o&&v(\"31\",\"[object Object]\"===(r=\"\"+t)?\"object with keys {\"+Object.keys(t).join(\", \")+\"}\":r,\"\");return i}function O(t,e){return\"object\"==typeof t&&null!==t&&null!=t.key?function(t){var e={\"=\":\"=0\",\":\":\"=2\"};return\"$\"+(\"\"+t).replace(/[=:]/g,function(t){return e[t]})}(t.key):e.toString(36)}function z(t,e){t.func.call(t.context,e,t.count++)}function L(t,e,r){var n=t.result,o=t.keyPrefix;t=t.func.call(t.context,e,t.count++),Array.isArray(t)?P(t,n,r,s.thatReturnsArgument):null!=t&&(x(t)&&(e=o+(!t.key||e&&e.key===t.key?\"\":(\"\"+t.key).replace(A,\"$&/\")+\"/\")+r,t={$$typeof:a,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}),n.push(t))}function P(t,e,r,n,o){var i=\"\";null!=r&&(i=(\"\"+r).replace(A,\"$&/\")+\"/\"),e=N(e,i,n,o),null==t||T(t,\"\",L,e),j(e)}var q={Children:{map:function(t,e,r){if(null==t)return t;var n=[];return P(t,n,null,e,r),n},forEach:function(t,e,r){if(null==t)return t;e=N(null,null,e,r),null==t||T(t,\"\",z,e),j(e)},count:function(t){return null==t?0:T(t,\"\",s.thatReturnsNull,null)},toArray:function(t){var e=[];return P(t,e,null,s.thatReturnsArgument),e},only:function(t){return x(t)||v(\"143\"),t}},createRef:function(){return{current:null}},Component:b,PureComponent:w,createContext:function(t,e){return void 0===e&&(e=null),(t={$$typeof:d,_calculateChangedBits:e,_defaultValue:t,_currentValue:t,_currentValue2:t,_changedBits:0,_changedBits2:0,Provider:null,Consumer:null}).Provider={$$typeof:h,_context:t},t.Consumer=t},forwardRef:function(t){return{$$typeof:g,render:t}},Fragment:l,StrictMode:f,unstable_AsyncMode:_,unstable_Profiler:p,createElement:C,cloneElement:function(t,e,r){(null===t||void 0===t)&&v(\"267\",t);var o=void 0,i=n({},t.props),s=t.key,u=t.ref,c=t._owner;if(null!=e){void 0!==e.ref&&(u=e.ref,c=E.current),void 0!==e.key&&(s=\"\"+e.key);var l=void 0;for(o in t.type&&t.type.defaultProps&&(l=t.type.defaultProps),e)D.call(e,o)&&!S.hasOwnProperty(o)&&(i[o]=void 0===e[o]&&void 0!==l?l[o]:e[o])}if(1===(o=arguments.length-2))i.children=r;else if(1<o){l=Array(o);for(var f=0;f<o;f++)l[f]=arguments[f+2];i.children=l}return{$$typeof:a,type:t.type,key:s,ref:u,props:i,_owner:c}},createFactory:function(t){var e=C.bind(null,t);return e.type=t,e},isValidElement:x,version:\"16.4.1\",__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentOwner:E,assign:n}},R={default:q},U=R&&q||R;t.exports=U.default?U.default:U},function(t,e,r){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});var n=a(r(2)),o=a(r(1)),i=r(3),s=a(r(133)),u=a(r(19));function a(t){return t&&t.__esModule?t:{default:t}}var c=function(t){return n.default.createElement(i.Provider,{store:u.default},n.default.createElement(s.default,{title:t.title,titleAvatar:t.titleAvatar,subtitle:t.subtitle,handleNewUserMessage:t.handleNewUserMessage,handleQuickButtonClicked:t.handleQuickButtonClicked,senderPlaceHolder:t.senderPlaceHolder,profileAvatar:t.profileAvatar,showCloseButton:t.showCloseButton,fullScreenMode:t.fullScreenMode,badge:t.badge,autofocus:t.autofocus,customLauncher:t.launcher}))};c.propTypes={title:o.default.string,titleAvatar:o.default.string,subtitle:o.default.string,handleNewUserMessage:o.default.func.isRequired,handleQuickButtonClicked:o.default.func,senderPlaceHolder:o.default.string,profileAvatar:o.default.string,showCloseButton:o.default.bool,fullScreenMode:o.default.bool,badge:o.default.number,autofocus:o.default.bool,launcher:o.default.func},c.defaultProps={title:\"Welcome\",subtitle:\"This is your chat subtitle\",senderPlaceHolder:\"Type a message...\",showCloseButton:!0,fullScreenMode:!1,badge:0,autofocus:!0},e.default=c},function(t,e,r){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.setQuickButtons=e.isWidgetOpened=e.dropMessages=e.toggleMsgLoader=e.toggleInputDisabled=e.toggleWidget=e.renderCustomComponent=e.addLinkSnippet=e.addResponseMessage=e.addUserMessage=e.Widget=void 0;var n=function(t){return t&&t.__esModule?t:{default:t}}(r(142)),o=r(32);e.Widget=n.default,e.addUserMessage=o.addUserMessage,e.addResponseMessage=o.addResponseMessage,e.addLinkSnippet=o.addLinkSnippet,e.renderCustomComponent=o.renderCustomComponent,e.toggleWidget=o.toggleWidget,e.toggleInputDisabled=o.toggleInputDisabled,e.toggleMsgLoader=o.toggleMsgLoader,e.dropMessages=o.dropMessages,e.isWidgetOpened=o.isWidgetOpened,e.setQuickButtons=o.setQuickButtons}])});\n\n//# sourceURL=webpack:///./node_modules/react-chat-widget/lib/index.js?"); /***/ }) }]);
import React from 'react' import Logo from '../../Logo/Logo' import NavigationItems from '../NavigationItems/NavigationItems' import DrawerToggle from '../SideDrawer/DrawerToggle/DrawerToggle' import classes from './Toolbar.module.css' const toolbar = (props) => ( <header className={classes.Toolbar}> <DrawerToggle clicked={props.drawerToggleClicked} /> <div className={classes.Logo}> <Logo /> </div> <nav className={classes.DesktopOnly}> <NavigationItems /> </nav> </header> ) export default toolbar
const theme = { colors: { primaryBackground: '#0A1128', secondaryBackground: '#dc143c', white: '#FFF', mediumGray: '#DDD', }, font: { family: { default: "'Opens Sans', sans-serif", secondary: "'Montserrat', sans-serif", }, sizes: { small: '1.6rem', xsmall: '8rem', medium: '2.4rem', large: '3.2rem', xlarge: '4.0rem', xxlarge: '4.8rem', huge: '5.6rem', xhuge: '6.4rem', }, }, media: { lteMedium: '(max-width: 768px)', }, spacings: { xsmall: '8rem', small: '1.6rem', medium: '2.4rem', large: '3.2rem', xlarge: '4.0rem', xxlarge: '4.8rem', huge: '5.6rem', xhuge: '6.4rem', }, }; export default theme;
$(document).ready(function () { // const domain = window.location.origin; const domain = "../services.html"; var trackAppForm = document.createElement("form"); trackAppForm.method = "POST"; trackAppForm.action = domain+"/citizenApplication.html"; trackAppForm.target = "iframe_a"; $('.citizen-iframe').prepend(trackAppForm); trackAppForm.submit(); });
/** * EditorManager.js * * Copyright 2009, Moxiecode Systems AB * Released under LGPL License. * * License: http://tinymce.moxiecode.com/license * Contributing: http://tinymce.moxiecode.com/contributing */ (function(tinymce) { /** * @class tinymce */ // Shorten names var each = tinymce.each, extend = tinymce.extend, DOM = tinymce.DOM, Event = tinymce.dom.Event, ThemeManager = tinymce.ThemeManager, PluginManager = tinymce.PluginManager, explode = tinymce.explode, Dispatcher = tinymce.util.Dispatcher, undefined, instanceCounter = 0; // Setup some URLs where the editor API is located and where the document is tinymce.documentBaseURL = window.location.href.replace(/[\?#].*$/, '').replace(/[\/\\][^\/]+$/, ''); if (!/[\/\\]$/.test(tinymce.documentBaseURL)) tinymce.documentBaseURL += '/'; tinymce.baseURL = new tinymce.util.URI(tinymce.documentBaseURL).toAbsolute(tinymce.baseURL); /** * Absolute baseURI for the installation path of TinyMCE. * * @property baseURI * @type tinymce.util.URI */ tinymce.baseURI = new tinymce.util.URI(tinymce.baseURL); // Add before unload listener // This was required since IE was leaking memory if you added and removed beforeunload listeners // with attachEvent/detatchEvent so this only adds one listener and instances can the attach to the onBeforeUnload event tinymce.onBeforeUnload = new Dispatcher(tinymce); // Must be on window or IE will leak if the editor is placed in frame or iframe Event.add(window, 'beforeunload', function(e) { tinymce.onBeforeUnload.dispatch(tinymce, e); }); /** * Fires when a new editor instance is added to the tinymce collection. * * @event onAddEditor * @param {tinymce} sender TinyMCE root class/namespace. * @param {tinymce.Editor} editor Editor instance. * @example * tinyMCE.execCommand("mceAddControl", false, "some_textarea"); * tinyMCE.onAddEditor.add(function(mgr,ed) { * console.debug('A new editor is available' + ed.id); * }); */ tinymce.onAddEditor = new Dispatcher(tinymce); /** * Fires when an editor instance is removed from the tinymce collection. * * @event onRemoveEditor * @param {tinymce} sender TinyMCE root class/namespace. * @param {tinymce.Editor} editor Editor instance. */ tinymce.onRemoveEditor = new Dispatcher(tinymce); tinymce.EditorManager = extend(tinymce, { /** * Collection of editor instances. * * @property editors * @type Object * @example * for (edId in tinyMCE.editors) * tinyMCE.editors[edId].save(); */ editors : [], /** * Collection of language pack data. * * @property i18n * @type Object */ i18n : {}, /** * Currently active editor instance. * * @property activeEditor * @type tinymce.Editor * @example * tinyMCE.activeEditor.selection.getContent(); * tinymce.EditorManager.activeEditor.selection.getContent(); */ activeEditor : null, /** * Initializes a set of editors. This method will create a bunch of editors based in the input. * * @method init * @param {Object} s Settings object to be passed to each editor instance. * @example * // Initializes a editor using the longer method * tinymce.EditorManager.init({ * some_settings : 'some value' * }); * * // Initializes a editor instance using the shorter version * tinyMCE.init({ * some_settings : 'some value' * }); */ init : function(s) { var t = this, pl, sl = tinymce.ScriptLoader, e, el = [], ed; function execCallback(se, n, s) { var f = se[n]; if (!f) return; if (tinymce.is(f, 'string')) { s = f.replace(/\.\w+$/, ''); s = s ? tinymce.resolve(s) : 0; f = tinymce.resolve(f); } return f.apply(s || this, Array.prototype.slice.call(arguments, 2)); }; s = extend({ theme : "simple", language : "en" }, s); t.settings = s; // Legacy call Event.add(document, 'init', function() { var l, co; execCallback(s, 'onpageload'); switch (s.mode) { case "exact": l = s.elements || ''; if(l.length > 0) { each(explode(l), function(v) { if (DOM.get(v)) { ed = new tinymce.Editor(v, s); el.push(ed); ed.render(1); } else { each(document.forms, function(f) { each(f.elements, function(e) { if (e.name === v) { v = 'mce_editor_' + instanceCounter++; DOM.setAttrib(e, 'id', v); ed = new tinymce.Editor(v, s); el.push(ed); ed.render(1); } }); }); } }); } break; case "textareas": case "specific_textareas": function hasClass(n, c) { return c.constructor === RegExp ? c.test(n.className) : DOM.hasClass(n, c); }; each(DOM.select('textarea'), function(v) { if (s.editor_deselector && hasClass(v, s.editor_deselector)) return; if (!s.editor_selector || hasClass(v, s.editor_selector)) { // Can we use the name e = DOM.get(v.name); if (!v.id && !e) v.id = v.name; // Generate unique name if missing or already exists if (!v.id || t.get(v.id)) v.id = DOM.uniqueId(); ed = new tinymce.Editor(v.id, s); el.push(ed); ed.render(1); } }); break; } // Call onInit when all editors are initialized if (s.oninit) { l = co = 0; each(el, function(ed) { co++; if (!ed.initialized) { // Wait for it ed.onInit.add(function() { l++; // All done if (l == co) execCallback(s, 'oninit'); }); } else l++; // All done if (l == co) execCallback(s, 'oninit'); }); } }); }, /** * Returns a editor instance by id. * * @method get * @param {String/Number} id Editor instance id or index to return. * @return {tinymce.Editor} Editor instance to return. * @example * // Adds an onclick event to an editor by id (shorter version) * tinyMCE.get('mytextbox').onClick.add(function(ed, e) { * ed.windowManager.alert('Hello world!'); * }); * * // Adds an onclick event to an editor by id (longer version) * tinymce.EditorManager.get('mytextbox').onClick.add(function(ed, e) { * ed.windowManager.alert('Hello world!'); * }); */ get : function(id) { if (id === undefined) return this.editors; return this.editors[id]; }, /** * Returns a editor instance by id. This method was added for compatibility with the 2.x branch. * * @method getInstanceById * @param {String} id Editor instance id to return. * @return {tinymce.Editor} Editor instance to return. * @deprecated Use get method instead. * @see #get */ getInstanceById : function(id) { return this.get(id); }, /** * Adds an editor instance to the editor collection. This will also set it as the active editor. * * @method add * @param {tinymce.Editor} editor Editor instance to add to the collection. * @return {tinymce.Editor} The same instance that got passed in. */ add : function(editor) { var self = this, editors = self.editors; // Add named and index editor instance editors[editor.id] = editor; editors.push(editor); self._setActive(editor); self.onAddEditor.dispatch(self, editor); // #ifdef jquery // Patch the tinymce.Editor instance with jQuery adapter logic if (tinymce.adapter) tinymce.adapter.patchEditor(editor); // #endif return editor; }, /** * Removes a editor instance from the collection. * * @method remove * @param {tinymce.Editor} e Editor instance to remove. * @return {tinymce.Editor} The editor that got passed in will be return if it was found otherwise null. */ remove : function(editor) { var t = this, i, editors = t.editors; // Not in the collection if (!editors[editor.id]) return null; delete editors[editor.id]; for (i = 0; i < editors.length; i++) { if (editors[i] == editor) { editors.splice(i, 1); break; } } // Select another editor since the active one was removed if (t.activeEditor == editor) t._setActive(editors[0]); editor.destroy(); t.onRemoveEditor.dispatch(t, editor); return editor; }, /** * Executes a specific command on the currently active editor. * * @method execCommand * @param {String} c Command to perform for example Bold. * @param {Boolean} u Optional boolean state if a UI should be presented for the command or not. * @param {String} v Optional value parameter like for example an URL to a link. * @return {Boolean} true/false if the command was executed or not. */ execCommand : function(c, u, v) { var t = this, ed = t.get(v), w; // Manager commands switch (c) { case "mceFocus": ed.focus(); return true; case "mceAddEditor": case "mceAddControl": if (!t.get(v)) new tinymce.Editor(v, t.settings).render(); return true; case "mceAddFrameControl": w = v.window; // Add tinyMCE global instance and tinymce namespace to specified window w.tinyMCE = tinyMCE; w.tinymce = tinymce; tinymce.DOM.doc = w.document; tinymce.DOM.win = w; ed = new tinymce.Editor(v.element_id, v); ed.render(); // Fix IE memory leaks if (tinymce.isIE) { function clr() { ed.destroy(); w.detachEvent('onunload', clr); w = w.tinyMCE = w.tinymce = null; // IE leak }; w.attachEvent('onunload', clr); } v.page_window = null; return true; case "mceRemoveEditor": case "mceRemoveControl": if (ed) ed.remove(); return true; case 'mceToggleEditor': if (!ed) { t.execCommand('mceAddControl', 0, v); return true; } if (ed.isHidden()) ed.show(); else ed.hide(); return true; } // Run command on active editor if (t.activeEditor) return t.activeEditor.execCommand(c, u, v); return false; }, /** * Executes a command on a specific editor by id. This method was added for compatibility with the 2.x branch. * * @deprecated Use the execCommand method of a editor instance instead. * @method execInstanceCommand * @param {String} id Editor id to perform the command on. * @param {String} c Command to perform for example Bold. * @param {Boolean} u Optional boolean state if a UI should be presented for the command or not. * @param {String} v Optional value parameter like for example an URL to a link. * @return {Boolean} true/false if the command was executed or not. */ execInstanceCommand : function(id, c, u, v) { var ed = this.get(id); if (ed) return ed.execCommand(c, u, v); return false; }, /** * Calls the save method on all editor instances in the collection. This can be useful when a form is to be submitted. * * @method triggerSave * @example * // Saves all contents * tinyMCE.triggerSave(); */ triggerSave : function() { each(this.editors, function(e) { e.save(); }); }, /** * Adds a language pack, this gets called by the loaded language files like en.js. * * @method addI18n * @param {String} p Prefix for the language items. For example en.myplugin * @param {Object} o Name/Value collection with items to add to the language group. */ addI18n : function(p, o) { var lo, i18n = this.i18n; if (!tinymce.is(p, 'string')) { each(p, function(o, lc) { each(o, function(o, g) { each(o, function(o, k) { if (g === 'common') i18n[lc + '.' + k] = o; else i18n[lc + '.' + g + '.' + k] = o; }); }); }); } else { each(o, function(o, k) { i18n[p + '.' + k] = o; }); } }, // Private methods _setActive : function(editor) { this.selectedInstance = this.activeEditor = editor; } }); })(tinymce); /** * Alternative name for tinymce added for 2.x compatibility. * * @member * @property tinyMCE * @type tinymce * @example * // To initialize editor instances * tinyMCE.init({ * ... * }); */ /** * Alternative name for tinymce added for compatibility. * * @member tinymce * @property EditorManager * @type tinymce * @example * // To initialize editor instances * tinymce.EditorManager.get('editor'); */
$(document).ready(function() { /* ================================================================= Basic ================================================================= */ $('#exampleBasic').wizard({ templates: { buttons: function(){ var options = this.options; return '<div class="clearfix">' + '<button class="btn btn-secondary" data-target="#'+this.id+'" data-wizard="back">'+options.buttonLabels.back+'</button>' + '<button class="btn btn-primary float-right" data-target="#'+this.id+'" data-wizard="next">'+options.buttonLabels.next+'</button>' + '<button class="btn btn-primary float-right" data-target="#'+this.id+'" data-wizard="finish">'+options.buttonLabels.finish+'</button>' + '</div>'; } }, }); /* ================================================================= Validation ================================================================= */ $('#exampleValidator').wizard({ templates: { buttons: function(){ var options = this.options; return '<div class="clearfix">' + '<button class="btn btn-secondary" data-target="#'+this.id+'" data-wizard="back">'+options.buttonLabels.back+'</button>' + '<button class="btn btn-primary float-right" data-target="#'+this.id+'" data-wizard="next">'+options.buttonLabels.next+'</button>' + '<button class="btn btn-primary float-right" data-target="#'+this.id+'" data-wizard="finish">'+options.buttonLabels.finish+'</button>' + '</div>'; } }, onInit: function(){ $('#validation').formValidation({ framework: 'bootstrap', fields: { username: { validators: { notEmpty: { message: 'The username is required' }, stringLength: { min: 6, max: 30, message: 'The username must be more than 6 and less than 30 characters long' }, regexp: { regexp: /^[a-zA-Z0-9_\.]+$/, message: 'The username can only consist of alphabetical, number, dot and underscore' } } }, email: { validators: { notEmpty: { message: 'The email address is required' }, emailAddress: { message: 'The input is not a valid email address' } } }, password: { validators: { notEmpty: { message: 'The password is required' }, different: { field: 'username', message: 'The password cannot be the same as username' } } } } }); }, validator: function(){ var fv = $('#validation').data('formValidation'); var $this = $(this); // Validate the container fv.validateContainer($this); var isValidStep = fv.isValidContainer($this); if (isValidStep === false || isValidStep === null) { return false; } return true; }, onFinish: function(){ $('#validation').submit(); alert('finish'); } }); /* ================================================================= Tabs ================================================================= */ $('.wizard').wizard({ step: '> .nav > li > a', templates: { buttons: function(){ var options = this.options; return '<div class="clearfix">' + '<button class="btn btn-default" data-target="#'+this.id+'" data-wizard="back">'+options.buttonLabels.back+'</button>' + '<button class="btn btn-primary float-right" data-target="#'+this.id+'" data-wizard="next">'+options.buttonLabels.next+'</button>' + '<button class="btn btn-primary float-right" data-target="#'+this.id+'" data-wizard="finish">'+options.buttonLabels.finish+'</button>' + '</div>'; } }, onBeforeShow: function(step){ step.$element.tab('show'); }, onFinish: function(){ alert('finish'); } }); });
export { MenuButton } from './MenuButton'
$(document).ready(function(){ if ($('#map').length) { var lat = 57.651774; var log = 39.829889; var urlBaby = window.location.hostname; var markerUrl = 'static/img/assets/contacts/marker.svg'; var myMap; var myPlacemark; var init = function init() { myMap = new ymaps.Map("map", { center: [lat, log], zoom: 18, controls: [] }); myMap.behaviors.disable('scrollZoom'); var myPlacemark = new ymaps.Placemark([lat, log], {}, { iconLayout: 'default#image', iconImageHref: markerUrl, iconImageSize: [60, 60], iconImageOffset: [-3, -42] }); myMap.geoObjects.add(myPlacemark); }; ymaps.ready(init); } })
import React from 'react' import { Styled, Box } from 'theme-ui' export default props => ( <> <Box sx={{ px: 1, opacity: 0.4 }} >/ </Box> <Box sx={{ px: 1 }} > <Styled.h2 {...props} /> </Box> </> )
import { Box, ListTable, Screen } from '@pres/components' const screen = Screen.build({ dump: process.cwd() + '/logs/dock.log', smartCSR: true, dockBorders: true, warnings: true }) const topleft = Box.build({ parent: screen, left: 0, top: 0, width: '50%', height: '50%', border: { type: 'line', left: false, top: false, right: true, bottom: false }, // border: 'line', content: 'Foo' }) const topright = Box.build({ parent: screen, left: '50%-1', top: 0, width: '50%+1', height: '50%', border: { type: 'line', left: true, top: false, right: false, bottom: false }, // border: 'line', content: 'Bar' }) const bottomleft = Box.build({ parent: screen, left: 0, top: '50%-1', width: '50%', height: '50%+1', border: { type: 'line', left: false, top: true, right: false, bottom: false }, // border: 'line', content: 'Foo' }) const bottomright = ListTable.build({ parent: screen, left: '50%-1', top: '50%-1', width: '50%+1', height: '50%+1', border: { type: 'line', left: true, top: true, right: false, bottom: false }, // border: 'line', align: 'center', tags: true, keys: true, vi: true, mouse: true, style: { header: { fg: 'blue', bold: true }, cell: { fg: 'magenta', selected: { bg: 'blue' } } }, data: [ [ 'Animals', 'Foods', 'Times', 'Numbers' ], [ 'Elephant', 'Apple', '1:00am', 'One' ], [ 'Bird', 'Orange', '2:15pm', 'Two' ], [ 'T-Rex', 'Taco', '8:45am', 'Three' ], [ 'Mouse', 'Cheese', '9:05am', 'Four' ] ] }) bottomright.focus() const over = Box.build({ parent: screen, left: 'center', top: 'center', width: '50%', height: '50%', draggable: true, border: { type: 'line', left: false, top: true, right: true, bottom: true }, content: 'Drag Me' }) screen.key('q', function () { return screen.destroy() }) screen.render()
(function(e){const t=e["cs"]=e["cs"]||{};t.dictionary=Object.assign(t.dictionary||{},{"%0 of %1":"%0 z %1","Align cell text to the bottom":"Zarovnat text buňky dolů","Align cell text to the center":"Zarovnat text buňky na střed","Align cell text to the left":"Zarovnat text buňky doleva","Align cell text to the middle":"Zarovnat text buňky na střed","Align cell text to the right":"Zarovnat text buňky doprava","Align cell text to the top":"Zarovnat text buňky nahoru","Align center":"Zarovnat na střed","Align left":"Zarovnat vlevo","Align right":"Zarovnat vpravo","Align table to the left":"Zarovnat tabulku doleva","Align table to the right":"Zarovnat tabulku doprava",Alignment:"Zarovnání",Aquamarine:"Akvamarínová",Background:"Pozadí",Big:"Velké",Black:"Černá","Block quote":"Citace",Blue:"Modrá","Blue marker":"Modrý fix",Bold:"Tučné",Border:"Okraj","Break text":"Obtékání textu","Bulleted List":"Odrážky","Bulleted list styles toolbar":"Panel seznamu s odrážkami",Cancel:"Zrušit","Cannot upload file:":"Soubor nelze nahrát:","Cell properties":"Vlastnosti buňky","Center table":"Centrovat tabulku","Centered image":"Obrázek zarovnaný na střed","Change image text alternative":"Změnit alternativní text obrázku","Characters: %0":"Počet znaků: %0","Choose heading":"Zvolte nadpis",Circle:"Kruh",Code:"Kódový blok",Color:"Barva","Color picker":"Vybrat barvu",Column:"Sloupec",Dashed:"Čárkovaná",Decimal:"Čísla","Decimal with leading zero":"Čísla s nulou na začátku","Decrease indent":"Zmenšit odsazení",Default:"Výchozí","Delete column":"Smazat sloupec","Delete row":"Smazat řádek","Dim grey":"Tmavě šedá",Dimensions:"Rozměry",Disc:"Plný kruh","Document colors":"Barvy dokumentu",Dotted:"Tečkovaná",Double:"Dvojitá",Downloadable:"Ke stažení","Dropdown toolbar":"Rozbalovací panel nástrojů","Edit block":"Upravit blok","Edit link":"Upravit odkaz","Edit source":"Upravit zdroj","Editor toolbar":"Panel nástrojů editoru","Empty snippet content":"Prázdný obsah kódu","Enter image caption":"Zadejte popis obrázku","Enter table caption":"Zadejte titulek tabulky",Find:"Najít","Find and replace":"Najít a nahradit","Find in text…":"Najít v textu...","Font Background Color":"Barva pozadí písma","Font Color":"Barva písma","Font Family":"Typ písma","Font Size":"Velikost písma","Full size image":"Obrázek v plné velikosti",Green:"Zelená","Green marker":"Zelený fix","Green pen":"Zelené pero",Grey:"Šedá",Groove:"Drážkovaná","Header column":"Sloupec záhlaví","Header row":"Řádek záhlaví",Heading:"Nadpis","Heading 1":"Nadpis 1","Heading 2":"Nadpis 2","Heading 3":"Nadpis 3","Heading 4":"Nadpis 4","Heading 5":"Nadpis 5","Heading 6":"Nadpis 6",Height:"Výška",Highlight:"Zvýraznění","Horizontal line":"Vodorovná čára","Horizontal text alignment toolbar":"Horizontální zarovnání textu v panelu","HTML snippet":"Kód HTML",Huge:"Obrovské","Image resize list":"Seznam možností změny velikosti","Image toolbar":"Panel nástrojů obrázku","image widget":"ovládací prvek obrázku","In line":"Rovnoběžně s textem","Increase indent":"Zvětšit odsazení","Insert code block":"Vložit blok zdrojového kódu","Insert column left":"Vložit sloupec vlevo","Insert column right":"Vložit sloupec vpravo","Insert HTML":"Vložit kód HTML","Insert image":"Vložit obrázek","Insert media":"Vložit média","Insert paragraph after block":"Vložte odstavec za blok","Insert paragraph before block":"Vložte odstavec před blok","Insert row above":"Vložit řádek před","Insert row below":"Vložit řádek pod","Insert table":"Vložit tabulku",Inset:"Vložená zevnitř",Italic:"Kurzíva",Justify:"Zarovnat do bloku","Justify cell text":"Zarovnat text buňky z obou stran","Left aligned image":"Obrázek zarovnaný vlevo","Light blue":"Světle modrá","Light green":"Světle zelená","Light grey":"Světle šedá",Link:"Odkaz","Link image":"Adresa obrázku","Link URL":"URL odkazu","List properties":"","Lower-latin":"Malá písmena","Lower–roman":"Malé římské čísla","Match case":"Rozlišovat velikost písmen","Media URL":"URL adresa","media widget":"ovládací prvek médií","Merge cell down":"Sloučit s buňkou pod","Merge cell left":"Sloučit s buňkou vlevo","Merge cell right":"Sloučit s buňkou vpravo","Merge cell up":"Sloučit s buňkou nad","Merge cells":"Sloučit buňky",Next:"Další","Next result":"Další výskyt","No preview available":"Náhled není k dispozici",None:"Žádná","Numbered List":"Číslování","Numbered list styles toolbar":"Panel se styly číslovaného seznamu","Open in a new tab":"Otevřít v nové kartě","Open link in new tab":"Otevřít odkaz v nové kartě",Orange:"Oranžová",Original:"Originální",Outset:"Vložená zvenku",Padding:"Vnitřní okraj","Page break":"Konec stránky",Paragraph:"Odstavec","Paste raw HTML here...":"Sem vložte kód HTML ...","Paste the media URL in the input.":"Vložte URL média do vstupního pole.","Pink marker":"Růžový fix","Plain text":"Prostý text",Previous:"Předchozí","Previous result":"Předchozí výskyt",Purple:"Fialová",Red:"Červená","Red pen":"Červený fix",Redo:"Znovu","Remove color":"Odstranit barvu","Remove highlight":"Odstranit zvýraznění",Replace:"Nahradit","Replace all":"Nahradit vše","Replace with…":"Nahradit čím...","Resize image":"Změnit velikost","Resize image to %0":"Změnit velikost na %0","Resize image to the original size":"Změnit velikost na původní velikost","Restore default":"Obnovit výchozí","Reversed order":"","Rich Text Editor":"Textový editor","Rich Text Editor, %0":"Textový editor, %0",Ridge:"Rámovaná","Right aligned image":"Obrázek zarovnaný vpravo",Row:"Řádek",Save:"Uložit","Save changes":"Uložit změny","Select all":"Vybrat vše","Select column":"Vybrat sloupec","Select row":"Vybrat řádek","Show more items":"Zobrazit další položky","Show options":"Zobrazit možnosti","Side image":"Postranní obrázek",Small:"Malé",Solid:"Plná","Split cell horizontally":"Rozdělit buňky horizontálně","Split cell vertically":"Rozdělit buňky vertikálně",Square:"Čtverec","Start at":"","Start index must be greater than 0.":"",Style:"Styl","Table alignment toolbar":"Panel zarovnání tabulky","Table cell text alignment":"Zarovnání textu buňky tabulky","Table properties":"Vlastnosti tabulky","Table toolbar":"Panel nástrojů tabulky","Text alignment":"Zarovnání textu","Text alignment toolbar":"Panel nástrojů zarovnání textu","Text alternative":"Alternativní text","Text highlight toolbar":"Panel nástrojů zvýraznění textu","Text to find must not be empty.":"Hledaný text nesmí být prázdný.",'The color is invalid. Try "#FF0000" or "rgb(255,0,0)" or "red".':'Barva má nesprávný formát. Zkuste "#FF0000", "rgb(255,0,0)" nebo "red".',"The URL must not be empty.":"URL adresa musí být vyplněna.",'The value is invalid. Try "10px" or "2em" or simply "2".':'Hodnota je nesprávná. Zkuste "10px", "2em" nebo jednoduše "2".',"This link has no URL":"Tento odkaz nemá žádnou URL","This media URL is not supported.":"Tato adresa bohužel není podporována.",Tiny:"Drobné","Tip: Find some text first in order to replace it.":"Tip: Nejprve najděte nějaký text, abyste jej mohli nahradit.","Tip: Paste the URL into the content to embed faster.":"Rada: Vložte URL přímo do editoru pro rychlejší vnoření.","Toggle caption off":"Vypnout titulek","Toggle caption on":"Zapnout titulek","Toggle the circle list style":"Přepnout na seznam s kruhovým označením","Toggle the decimal list style":"Přepnout na číselný seznam","Toggle the decimal with leading zero list style":"Přepnout na číselný seznam s nulou na začátku","Toggle the disc list style":"Přepnout na seznam s označením plného kruhu","Toggle the lower–latin list style":"Přepnout na seznam s malými písmeny","Toggle the lower–roman list style":"Přepnout na seznam s malými římskými čísly","Toggle the square list style":"Přepnout na seznam se čtvercovým označením","Toggle the upper–latin list style":"Přepnout na seznam s velkými písmeny","Toggle the upper–roman list style":"Přepnout na seznam s velkými římskými čísly",Turquoise:"Tyrkysová","Type or paste your content here.":"Zde zadejte nebo vložte obsah.","Type your title":"Sem zadejte název",Underline:"Podtržené",Undo:"Zpět",Unlink:"Odstranit odkaz","Upload failed":"Nahrání selhalo","Upload in progress":"Probíhá nahrávání","Upper-latin":"Velká písmena","Upper-roman":"Velké římské čísla","Vertical text alignment toolbar":"Vertikální zarovnání textu v panelu",White:"Bílá","Whole words only":"Pouze celá slova","Widget toolbar":"Panel nástrojů ovládacího prvku",Width:"Šířka","Words: %0":"Počet slov: %0","Wrap text":"Text nahoře a dole",Yellow:"Žlutá","Yellow marker":"Žlutý fix"});t.getPluralForm=function(e){return e==1&&e%1==0?0:e>=2&&e<=4&&e%1==0?1:e%1!=0?2:3}})(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
import { Trans } from 'react-i18next'; export default function TransTemplator({ t, children, }) { return ( <Trans t={t} components={{ bold: <b />, blue: <span className="blue-text" />, green: <span className="green-text" />, red: <span className="red-text" />, yellow: <span className="yellow-text" />, }} > {children} </Trans> ); }
/* * * NavigationContainer reducer * */ import { fromJS } from "immutable"; import { DEFAULT_ACTION } from "./constants"; const initialState = fromJS({ items: [ { fname: "Elmer", lname: "Altermatt" }, { fname: "Marina", lname: "Matros" }, { fname: "Tanya", lname: "Pento" } ] }); function navigationContainerReducer(state = initialState, action) { switch (action.type) { case DEFAULT_ACTION: return state; default: return state; } } export default navigationContainerReducer;
var V3_URL = 'https://js.stripe.com/v3'; var V3_URL_REGEX = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/; var EXISTING_SCRIPT_MESSAGE = 'loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used'; var findScript = function findScript() { var scripts = document.querySelectorAll("script[src^=\"".concat(V3_URL, "\"]")); for (var i = 0; i < scripts.length; i++) { var script = scripts[i]; if (!V3_URL_REGEX.test(script.src)) { continue; } return script; } return null; }; var injectScript = function injectScript(params) { var queryString = params && !params.advancedFraudSignals ? '?advancedFraudSignals=false' : ''; var script = document.createElement('script'); script.src = "".concat(V3_URL).concat(queryString); var headOrBody = document.head || document.body; if (!headOrBody) { throw new Error('Expected document.body not to be null. Stripe.js requires a <body> element.'); } headOrBody.appendChild(script); return script; }; var registerWrapper = function registerWrapper(stripe, startTime) { if (!stripe || !stripe._registerWrapper) { return; } stripe._registerWrapper({ name: 'stripe-js', version: "1.17.0", startTime: startTime }); }; var stripePromise = null; var loadScript = function loadScript(params) { // Ensure that we only attempt to load Stripe.js at most once if (stripePromise !== null) { return stripePromise; } stripePromise = new Promise(function (resolve, reject) { if (typeof window === 'undefined') { // Resolve to null when imported server side. This makes the module // safe to import in an isomorphic code base. resolve(null); return; } if (window.Stripe && params) { console.warn(EXISTING_SCRIPT_MESSAGE); } if (window.Stripe) { resolve(window.Stripe); return; } try { var script = findScript(); if (script && params) { console.warn(EXISTING_SCRIPT_MESSAGE); } else if (!script) { script = injectScript(params); } script.addEventListener('load', function () { if (window.Stripe) { resolve(window.Stripe); } else { reject(new Error('Stripe.js not available')); } }); script.addEventListener('error', function () { reject(new Error('Failed to load Stripe.js')); }); } catch (error) { reject(error); return; } }); return stripePromise; }; var initStripe = function initStripe(maybeStripe, args, startTime) { if (maybeStripe === null) { return null; } var stripe = maybeStripe.apply(undefined, args); registerWrapper(stripe, startTime); return stripe; }; // own script injection. var stripePromise$1 = Promise.resolve().then(function () { return loadScript(null); }); var loadCalled = false; stripePromise$1["catch"](function (err) { if (!loadCalled) { console.warn(err); } }); var loadStripe = function loadStripe() { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } loadCalled = true; var startTime = Date.now(); return stripePromise$1.then(function (maybeStripe) { return initStripe(maybeStripe, args, startTime); }); }; export { loadStripe };
const express = require('express'); const mongoose = require('mongoose'); const config = require('config-yml'); //routers const packageRouter = require('./routes/packageRoutes.js'); const itemRouter = require('./routes/itemRoutes.js'); const testRouter = require('./routes/testRoutes.js'); //EasyPostAPI const apiKey = config.easy_post.prod_key; //Production API Key const EasyPost = require('@easypost/api'); //create EasyPostAPI object to make calls to API const api = new EasyPost(apiKey, { timeout: 10000 }); const app = express(); app.use(express.json()); // Make sure it comes back as json //connect to db mongoose.connect(config.mongo_db.uri, { useNewUrlParser: true }); const port = 3005; //Express.js const cors = require('cors'); const axios = require('axios'); //to prevent cross-origin request blocked errors app.use(cors()); app.use(packageRouter); app.use(itemRouter); app.use(testRouter); //this code is taken from CreateTrackingNum.js //refactor code to import it instead, but this might run into conflicts function translateDeliveryStatus(status){ let statusCode; const statusText = ['pre_transit', 'in_transit', 'out_for_delivery', 'delivered', 'return_to_sender', 'failure', 'unknown']; switch (status) { case statusText[0]: statusCode = 0; break; case statusText[1]: statusCode = 1; break; case statusText[2]: statusCode = 2; break; case statusText[3]: statusCode = 3; break; case statusText[4]: statusCode = 4; break; case statusText[5]: statusCode = 5; break; default: statusCode = 6; } return statusCode; } //easypost API routes //POST /getDeliveryStatus //get delivery status from EasyPost API app.post('/getDeliveryStatus', async(req, res) => { const tracker = new api.Tracker({ tracking_code: req.body.trackingNum, carrier: req.body.carrier }) try{ await tracker.save(); res.send(tracker.status); //uncomment to get detailed tracking information //res.send(tracker); } catch(err){ res.status(500).send(err); } }); //webhooks event handler app.post("/trackerUpdated", (req, res) => { res.status(200).end(); // Responding to webhooks before it retries if(req.body.description == "tracker.updated"){ let deliveryStatus = req.body.result.status; //console.log(deliveryStatus); let tracking_code = req.body.result.tracking_code; deliveryStatus = translateDeliveryStatus(deliveryStatus); //console.log(tracking_code); axios.patch(`http://localhost:3005/updatePackage/${tracking_code}`, {deliveryStatus: deliveryStatus}) .then((response) => console.log(`TRACKER STATUS UPDATED: ${response.data.deliveryStatus}`)) .catch((err) => console.log(err)); } }); app.listen(port, () => console.log("Express server on port 3005"));
/*! Tdrag 0.0.1 */ (function($,window,document,undefined){jQuery(function(){$.fn.Tdrag=function(opt){var call={scope:null,grid:null,axis:"all",pos:false,handle:null,moveClass:"tezml",dragChange:false,changeMode:"point",cbStart:function(){},cbMove:function(){},cbEnd:function(){},random:false,randomInput:null,animation_options:{duration:800,easing:"ease-out"},disable:false,disableInput:null};var dragfn=new Dragfn(this,opt);if(opt&&$.isEmptyObject(opt)==false){dragfn.options=$.extend(call,opt)}else{dragfn.options=call}dragfn.firstRandom=true;var ele=dragfn.$element;dragfn.pack(ele,false);if(dragfn.options.randomInput!=null){$(dragfn.options.randomInput).bind("click",function(){dragfn.pack(ele,true)})}dragfn.loadJqueryfn()};var Dragfn=function(ele,opt){this.$element=ele;this.options=opt};Dragfn.prototype={init:function(obj){var self=this;self.ele=self.$element;self.handle=$(obj);self.options=self.options;self.disable=self.options.disable;self._start=false;self._move=false;self._end=false;self.disX=0;self.disY=0;self.zIndex=1000;self.moving=false;self.box=$.type(self.options.scope)==="string"?self.options.scope:null;if(self.options.handle!=null){self.handle=$(obj).find(self.options.handle)}self.handle.on("mousedown",function(ev){self.start(ev,obj);obj.setCapture&&obj.setCapture();return false});if(self.options.dragChange){$(obj).on("mousemove",function(ev){self.move(ev,obj)});$(obj).on("mouseup",function(ev){self.end(ev,obj)})}else{$(document).on("mousemove",function(ev){self.move(ev,obj)});$(document).on("mouseup",function(ev){self.end(ev,obj)})}},loadJqueryfn:function(){var self=this;$.extend({sortBox:function(obj){var arr=[];for(var s=0;s<$(obj).length;s++){arr.push($(obj).eq(s))}for(var i=0;i<arr.length;i++){for(var j=i+1;j<arr.length;j++){if(Number(arr[i].attr("cuika.view.cuika.index.index"))>Number(arr[j].attr("cuika.view.cuika.index.index"))){var temp=arr[i];arr[i]=arr[j];arr[j]=temp}}}return arr},randomfn:function(obj){self.pack($(obj),true)},disable_open:function(){self.disable=false},disable_cloose:function(){self.disable=true}})},toDisable:function(){var self=this;if(self.options.disableInput!=null){$(self.options.disableInput).bind("click",function(){if(self.disable==true){self.disable=false}else{self.disable=true}})}},start:function(ev, obj){var self=this;if(self.disable==true){return false}self._start=true;var oEvent=ev||event;self.disX=oEvent.clientX-obj.offsetLeft;self.disY=oEvent.clientY-obj.offsetTop;$(obj).css("zIndex",self.zIndex++);self.options.cbStart()},move:function(ev,obj){var self=this;if(self._start!=true){return false}self._move=true;var oEvent=ev||event;var l=oEvent.clientX-self.disX;var t=oEvent.clientY-self.disY;if(self.box!=null){var rule=self.collTestBox(obj,self.box);if(l>rule.lmax){l=rule.lmax}else{if(l<rule.lmin){l=rule.lmin}}if(t>rule.tmax){t=rule.tmax}else{if(t<rule.tmin){t=rule.tmin}}}if(self.options.axis=="all"){obj.style.left=self.grid(obj,l,t).left+"px";obj.style.top=self.grid(obj,l,t).top+"px"}else{if(self.options.axis=="y"){obj.style.top=self.grid(obj,l,t).top+"px"}else{if(self.options.axis=="x"){obj.style.left=self.grid(obj,l,t).left+"px"}}}if(self.options.pos==true){self.moveAddClass(obj)}self.options.cbMove(obj,self)},end:function(ev, obj){var self=this;if(self._start!=true){return false}if(self.options.changeMode=="sort"&&self.options.pos==true){self.sortDrag(obj)}else{if(self.options.changeMode=="point"&&self.options.pos==true){self.pointDrag(obj)}}if(self.options.pos==true){self.animation(obj,self.aPos[$(obj).attr("cuika.view.cuika.index.index")])}self.options.cbEnd();if(self.options.handle!=null){$(obj).find(self.options.handle).unbind("onmousemove");$(obj).find(self.options.handle).unbind("onmouseup")}else{$(obj).unbind("onmousemove");$(obj).unbind("onmouseup")}obj.releaseCapture&&obj.releaseCapture();self._start=false},collTestBox:function(obj, obj2){var self=this;var l1=0;var t1=0;var l2=$(obj2).innerWidth()-$(obj).outerWidth();var t2=$(obj2).innerHeight()-$(obj).outerHeight();return{lmin:l1,tmin:t1,lmax:l2,tmax:t2}},grid:function(obj, l, t){var self=this;var json={left:l,top:t};if($.isArray(self.options.grid)&&self.options.grid.length==2){var gx=self.options.grid[0];var gy=self.options.grid[1];json.left=Math.floor((l+gx/2)/gx)*gx;json.top=Math.floor((t+gy/2)/gy)*gy;return json}else{if(self.options.grid==null){return json}else{console.log("grid参数传递格式错误");return false}}},findNearest:function(obj){var self=this;var iMin=new Date().getTime();var iMinIndex=-1;var ele=self.ele;for(var i=0;i<ele.length;i++){if(obj==ele[i]){continue}if(self.collTest(obj,ele[i])){var dis=self.getDis(obj,ele[i]);if(dis<iMin){iMin=dis;iMinIndex=i}}}if(iMinIndex==-1){return null}else{return ele[iMinIndex]}},getDis:function(obj,obj2){var self=this;var l1=obj.offsetLeft+obj.offsetWidth/2;var l2=obj2.offsetLeft+obj2.offsetWidth/2;var t1=obj.offsetTop+obj.offsetHeight/2;var t2=obj2.offsetTop+obj2.offsetHeight/2;var a=l2-l1;var b=t1-t2;return Math.sqrt(a*a+b*b)},collTest:function(obj,obj2){var self=this;var l1=obj.offsetLeft;var r1=obj.offsetLeft+obj.offsetWidth;var t1=obj.offsetTop;var b1=obj.offsetTop+obj.offsetHeight;var l2=obj2.offsetLeft;var r2=obj2.offsetLeft+obj2.offsetWidth;var t2=obj2.offsetTop;var b2=obj2.offsetTop+obj2.offsetHeight;if(r1<l2||r2<l1||t2>b1||b2<t1){return false}else{return true}},pack:function(ele,click){var self=this;self.toDisable();if(self.options.pos==false){for(var i=0; i<ele.length; i++){$(ele[i]).css("position","absolute");$(ele[i]).css("margin","0");self.init(ele[i])}}else{if(self.options.pos==true){var arr=[];if(self.options.random||click){while(arr.length<ele.length){var n=self.rnd(0,ele.length);if(!self.finInArr(arr,n)){arr.push(n)}}}if(self.options.random==false||click!=true){var n=0;while(arr.length<ele.length){arr.push(n);n++}}if(self.firstRandom==false){var sortarr=[];var n=0;while(sortarr.length<ele.length){sortarr.push(n);n++}for(var i=0; i<ele.length; i++){$(ele[i]).attr("cuika.view.cuika.index.index",sortarr[i]);$(ele[i]).css("left",self.aPos[sortarr[i]].left);$(ele[i]).css("top",self.aPos[sortarr[i]].top)}}self.aPos=[];if(self.firstRandom==false){for(var j=0; j<ele.length; j++){self.aPos[j]={left:ele[$(ele).eq(j).attr("cuika.view.cuika.index.index")].offsetLeft,top:ele[$(ele).eq(j).attr("cuika.view.cuika.index.index")].offsetTop}}}else{for(var j=0; j<ele.length; j++){self.aPos[j]={left:ele[j].offsetLeft,top:ele[j].offsetTop}}}for(var i=0; i<ele.length; i++){$(ele[i]).attr("cuika.view.cuika.index.index",arr[i]);$(ele[i]).css("left",self.aPos[arr[i]].left);$(ele[i]).css("top",self.aPos[arr[i]].top);$(ele[i]).css("position","absolute");$(ele[i]).css("margin","0");self.init(ele[i])}self.firstRandom=false}}},moveAddClass:function(obj){var self=this;var oNear=self.findNearest(obj);$(self.$element).removeClass(self.options.moveClass);if(oNear&&$(oNear).hasClass(self.options.moveClass)==false){$(oNear).addClass(self.options.moveClass)}},sort:function(){var self=this;var arr_li=[];for(var s=0; s<self.$element.length; s++){arr_li.push(self.$element[s])}for(var i=0; i<arr_li.length; i++){for(var j=i+1; j<arr_li.length; j++){if(Number($(arr_li[i]).attr("cuika.view.cuika.index.index"))>Number($(arr_li[j]).attr("cuika.view.cuika.index.index"))){var temp=arr_li[i];arr_li[i]=arr_li[j];arr_li[j]=temp}}}return arr_li},pointDrag:function(obj){var self=this;var oNear=self.findNearest(obj);if(oNear){self.animation(obj,self.aPos[$(oNear).attr("cuika.view.cuika.index.index")]);self.animation(oNear,self.aPos[$(obj).attr("cuika.view.cuika.index.index")]);var tmp;tmp=$(obj).attr("cuika.view.cuika.index.index");$(obj).attr("cuika.view.cuika.index.index",$(oNear).attr("cuika.view.cuika.index.index"));$(oNear).attr("cuika.view.cuika.index.index",tmp);$(oNear).removeClass(self.options.moveClass)}else{if(self.options.changeWhen=="end"){self.animation(obj,self.aPos[$(obj).attr("cuika.view.cuika.index.index")])}}},sortDrag:function(obj){var self=this;var arr_li=self.sort();var oNear=self.findNearest(obj);if(oNear){if(Number($(oNear).attr("cuika.view.cuika.index.index"))>Number($(obj).attr("cuika.view.cuika.index.index"))){var obj_tmp=Number($(obj).attr("cuika.view.cuika.index.index"));$(obj).attr("cuika.view.cuika.index.index",Number($(oNear).attr("cuika.view.cuika.index.index"))+1);for(var i=obj_tmp; i<Number($(oNear).attr("cuika.view.cuika.index.index"))+1; i++){self.animation(arr_li[i],self.aPos[i-1]);self.animation(obj,self.aPos[$(oNear).attr("cuika.view.cuika.index.index")]);$(arr_li[i]).removeClass(self.options.moveClass);$(arr_li[i]).attr("cuika.view.cuika.index.index",Number($(arr_li[i]).attr("cuika.view.cuika.index.index"))-1)}}else{if(Number($(obj).attr("cuika.view.cuika.index.index"))>Number($(oNear).attr("cuika.view.cuika.index.index"))){var obj_tmp=Number($(obj).attr("cuika.view.cuika.index.index"));$(obj).attr("cuika.view.cuika.index.index",$(oNear).attr("cuika.view.cuika.index.index"));for(var i=Number($(oNear).attr("cuika.view.cuika.index.index")); i<obj_tmp; i++){self.animation(arr_li[i],self.aPos[i+1]);self.animation(obj,self.aPos[Number($(obj).attr("cuika.view.cuika.index.index"))]);$(arr_li[i]).removeClass(self.options.moveClass);$(arr_li[i]).attr("cuika.view.cuika.index.index",Number($(arr_li[i]).attr("cuika.view.cuika.index.index"))+1)}}}}else{self.animation(obj,self.aPos[$(obj).attr("cuika.view.cuika.index.index")])}},animation:function(obj, json){var self=this;var options=self.options.animation_options;var self=this;var count=Math.round(options.duration/30);var start={};var dis={};for(var name in json){start[name]=parseFloat(self.getStyle(obj,name));if(isNaN(start[name])){switch(name){case"left":start[name]=obj.offsetLeft;break;case"top":start[name]=obj.offsetTop;break;case"width":start[name]=obj.offsetWidth;break;case"height":start[name]=obj.offsetHeight;break;case"marginLeft":start[name]=obj.offsetLeft;break;case"borderWidth":start[name]=0;break}}dis[name]=json[name]-start[name]}var n=0;clearInterval(obj.timer);obj.timer=setInterval(function(){n++;for(var name in json){switch(options.easing){case"linear":var a=n/count;var cur=start[name]+dis[name]*a;break;case"ease-in":var a=n/count;var cur=start[name]+dis[name]*a*a*a;break;case"ease-out":var a=1-n/count;var cur=start[name]+dis[name]*(1-a*a*a);break}if(name=="opacity"){obj.style.opacity=cur;obj.style.filter="alpha(opacity:"+cur*100+")"}else{obj.style[name]=cur+"px"}}if(n==count){clearInterval(obj.timer);options.complete&&options.complete()}},30)},getStyle:function(obj,name){return(obj.currentStyle||getComputedStyle(obj,false))[name]},rnd:function(n,m){return parseInt(Math.random()*(m-n)+n)},finInArr:function(arr,n){for(var i=0;i<arr.length;i++){if(arr[i]==n){return true}}return false}}})})(jQuery,window,document);
(function( $ ) { var settings = { width: 250, minimizeWidth: 50, duration: 500, canvasEl: '.canvas', toggleBtn: '.sidebar-toggle' }; var methods = { init : function( options ) { settings = $.extend(settings, options); return this.each( function() { var $this = $(this), data = $this.data('mobilesidebar'); if ( ! data ) { var $toggleButton = $(settings.toggleBtn).first(), $canvas = $(settings.canvasEl).first(); $(this).data('mobilesidebar', { target : $this, toggleButton: $toggleButton, canvas: $canvas }); methods.resize.apply($this); $this.hammer().bind('swiperight.mobilesidebar', methods.swiperight); $this.hammer().bind('swipeleft.mobilesidebar', methods.swipeleft); $toggleButton.bind('click.mobilesidebar', $this.data('mobilesidebar'), methods.toggle); // $this.bind('click.mobilesidebar', methods.click); // $(window).bind('resize.mobilesidebar', methods.reposition); } }); }, swiperight: function(e) { e.preventDefault(); methods.off.apply(this); e.stopPropagation(); }, swipeleft: function(e) { e.preventDefault(); methods.out.apply(this); e.stopPropagation(); }, click: function(e) { e.preventDefault(); methods.toggle.apply(this); e.stopPropagation(); }, off: function() { var data = $(this).data('mobilesidebar'); data.target.removeClass('minimize').addClass('full');//.width(settings.width); // if ( $(window).width() >= 768 ) { // data.canvas.css('paddingLeft', settings.width); // } }, out: function() { var data = $(this).data('mobilesidebar'); data.target.removeClass('full').addClass('minimize');//.width(settings.minimizeWidth); // if ( $(window).width() >= 768 ) { // data.canvas.css('paddingLeft', settings.minimizeWidth); // } }, toggle: function(e) { var data = e.data; if ( data.target.hasClass('full') ) { methods.out.apply(data.target); } else { methods.off.apply(data.target); } }, destroy : function( ) { return this.each(function() { var $this = $(this), data = $this.data('mobilesidebar'); // пространства имён рулят!!11 $(window).unbind('.mobilesidebar'); $this.unbind('.mobilesidebar'); $this.hammer().unbind('.mobilesidebar'); $this.removeData('mobilesidebar'); }); }, resize: function (e) { if ( $(window).width() > 768 ) { methods.off.apply(this); } else { methods.out.apply(this); } } }; $.fn.mobilesidebar = function( method ) { if ( methods[method] ) { return methods[method].apply( this, Array.prototype.slice.call( arguments, 1 )); } else if ( typeof method === 'object' || ! method ) { return methods.init.apply( this, arguments ); } else { $.error( 'Метод с именем ' + method + ' не существует для jQuery.mobilesidebar' ); } }; }) ( jQuery );
export default useStateHook => () => { const [isTrue, setIsTrue] = useStateHook(false); const setTrue = () => setIsTrue(true); const setFalse = () => setIsTrue(false); return [isTrue, setTrue, setFalse]; };
module.exports = (config) => { config.setDataDeepMerge(true); config.addPassthroughCopy('src/assets/img/'); config.addPassthroughCopy({ 'src/posts/img/': 'assets/img/' }); config.addPassthroughCopy({ 'src/work/img/': 'assets/img/' }); config.addPassthroughCopy('src/assets/files/'); config.addWatchTarget("src/assets/js/"); config.addWatchTarget("src/assets/css/"); config.addLayoutAlias('default', 'layouts/default.njk'); config.addLayoutAlias('post', 'layouts/post.njk'); config.addLayoutAlias('work', 'layouts/work.njk'); config.addFilter('readableDate', require('./lib/filters/readableDate')); config.addFilter('minifyJs', require('./lib/filters/minifyJs')); config.addTransform('postcss', require('./lib/transforms/postcss')); config.addTransform('minifyHtml', require('./lib/transforms/minifyHtml')); config.addCollection('posts', require('./lib/collections/posts')); config.addCollection('work', require('./lib/collections/work')); config.addCollection('pagedPosts', require('./lib/collections/pagedPosts')); config.addPassthroughCopy("src/admin"); const eleventyNavigationPlugin = require("@11ty/eleventy-navigation"); module.exports = function(eleventyConfig) { eleventyConfig.addPlugin(eleventyNavigationPlugin); }; return { dir: { input: 'src', output: 'dist' }, // pathPrefix: "/subfolder/", templateFormats: ['md', 'njk', 'html'], dataTemplateEngine: 'njk', markdownTemplateEngine: 'njk' }; };
$(document).ready(function () { startSlider(0); }); function startSlider(idx) { $img = $("#slide div img").eq(idx); $img.fadeIn('slow', function () { $img.delay(5000).fadeOut('slow', function () { if ($("#slide div img").length - 1 == idx) { startSlider(0); } else { startSlider(idx + 1); } }); }); } $(document).ready(function () { $("div.bhoechie-tab-menu>div.list-group>a").click(function (e) { e.preventDefault(); $(this).siblings('a.active').removeClass("active"); $(this).addClass("active"); var index = $(this).index(); $("div.bhoechie-tab>div.bhoechie-tab-content").removeClass("active"); $("div.bhoechie-tab>div.bhoechie-tab-content").eq(index).addClass("active"); }); });
import React from 'react'; import { sizeHandler } from '../utils/utils'; export default function AlertCircle(props) { return <svg stroke="currentColor" fill="none" stroke-width="2" viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round" height={sizeHandler(props)} width={sizeHandler(props)}><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="8" x2="12" y2="12"></line><line x1="12" y1="16" x2="12.01" y2="16"></line></svg> }
import React from 'react'; import PropTypes from 'prop-types'; import { Mutation } from 'react-apollo'; import gql from 'graphql-tag'; import { WidgetForm } from '../components'; export const INSERT_WIDGET_MUTATION = gql` mutation InsertWidget($widget: InsertWidget) { insertWidget(widget: $widget) { id name description color size price quantity } } `; export const InsertWidgetMutation = ({ refetchQueries }) => { return <Mutation mutation={INSERT_WIDGET_MUTATION}> {mutateInsertWidget => { const insertWidget = widget => { return mutateInsertWidget({ variables: { widget }, refetchQueries, }); }; return <WidgetForm buttonText="Add Widget" onSubmitWidget={insertWidget} />; }} </Mutation>; }; InsertWidgetMutation.propTypes = { refetchQueries: PropTypes.array.isRequired, };
var contains = function(needle) { // Per spec, the way to identify NaN is that it is not equal to itself var findNaN = needle !== needle; var indexOf; if(!findNaN && typeof Array.prototype.indexOf === 'function') { indexOf = Array.prototype.indexOf; } else { indexOf = function(needle) { var i = -1, index = -1; for(i = 0; i < this.length; i++) { var item = this[i]; if((findNaN && item !== item) || item === needle) { index = i; break; } } return index; }; } return indexOf.call(this, needle) > -1; };
class String { constructor(bodyA, pointB){ var options = { bodyA: bodyA, pointB: pointB, stiffness: 0.04, length: 10 } this.pointB = pointB this.string= Constraint.create(options); World.add(world, this.sling); } display(){ if(this.string.bodyA){ var pointA = this.string.bodyA.position; var pointB = this.pointB; } } }
/** * Copyright IBM Corp. 2019, 2020 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. * * Code generated by @carbon/icon-build-helpers. DO NOT EDIT. */ 'use strict'; function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } var Icon = require('../Icon-1f3f78db.js'); require('@carbon/icon-helpers'); require('prop-types'); var React = _interopDefault(require('react')); var _ref2 = /*#__PURE__*/ /*#__PURE__*/ React.createElement("path", { d: "M26 6H5.83L9.41 2.41 8 1 2 7l6 6 1.41-1.41L5.83 8H26v7h2V8A2 2 0 0026 6zM22.59 20.41L26.17 24H6V17H4v7a2 2 0 002 2H26.17l-3.58 3.59L24 31l6-6-6-6z" }); var _ref3 = /*#__PURE__*/ /*#__PURE__*/ React.createElement("path", { d: "M17 19L17 11 15 11 15 12 13 12 13 14 15 14 15 19 13 19 13 21 19 21 19 19 17 19z" }); var RepeatOne32 = /*#__PURE__*/React.forwardRef(function RepeatOne32(_ref, ref) { var children = _ref.children, rest = Icon._objectWithoutProperties(_ref, ["children"]); return /*#__PURE__*/React.createElement(Icon.Icon, Icon._extends({ width: 32, height: 32, viewBox: "0 0 32 32", xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", ref: ref }, rest), _ref2, _ref3, children); }); module.exports = RepeatOne32;
import * as React from "react" import { Link } from "gatsby" import { BlogItemStyles } from "./BlogStyles" import Button from "../Button/Button" const BlogItem = ({ blog }) => { const { slug, title, published, introduction } = blog return ( <BlogItemStyles> <h2> <Link to={slug}>{title}</Link> </h2> <p>{introduction}</p> <div className="blogitem__meta"> <Button text="Read More" as={Link} to={slug} /> <p>{published}</p> </div> </BlogItemStyles> ) } export default BlogItem
// Copyright (c) YugaByte, Inc. import { formValueSelector, reduxForm } from 'redux-form'; import { connect } from 'react-redux'; import { RollingUpgradeForm } from '../../../common/forms'; import { closeDialog } from '../../../../actions/modal'; import { rollingUpgrade, rollingUpgradeResponse, closeUniverseDialog, resetRollingUpgrade, fetchUniverseTasks, fetchUniverseTasksResponse, fetchUniverseMetadata, fetchUniverseInfo, fetchUniverseInfoResponse } from '../../../../actions/universe'; import { fetchUniversesPendingTasks, fetchUniversesPendingTasksSuccess, fetchUniversesPendingTasksFailure } from '../../../../actions/tasks'; import { isDefinedNotNull, isNonEmptyObject } from '../../../../utils/ObjectUtils'; import { getPrimaryCluster } from '../../../../utils/UniverseUtils'; import { TASK_LONG_TIMEOUT } from '../../../tasks/constants'; const FORM_NAME = 'RollingUpgradeForm'; const mapDispatchToProps = (dispatch) => { return { /** * Dispatch Rolling Upgrade/ Gflag restart to endpoint and handle response. * @param values form data payload * @param universeUUID UUID of the current Universe * @param reset function that sets the value of the form to pristine state */ submitRollingUpgradeForm: (values, universeUUID, reset) => { dispatch(rollingUpgrade(values, universeUUID)).then((response) => { if (!response.error) { dispatch(closeDialog()); dispatch(closeUniverseDialog()); } dispatch(rollingUpgradeResponse(response.payload)); // Reset the Rolling upgrade form fields to pristine state, // component may be called multiple times within the context of Universe Detail. reset(); }); }, fetchUniverseTasks: (uuid) => { dispatch(fetchUniverseTasks(uuid)).then((response) => { dispatch(fetchUniverseTasksResponse(response.payload)); }); }, getAllUniversePendingTasks: () => { dispatch(fetchUniversesPendingTasks()).then((response) => { if (!response.error) { dispatch(fetchUniversesPendingTasksSuccess(response.payload)); } else { dispatch(fetchUniversesPendingTasksFailure(response.payload)); } }); }, resetRollingUpgrade: () => { dispatch(resetRollingUpgrade()); }, fetchUniverseMetadata: () => { dispatch(fetchUniverseMetadata()); }, fetchCurrentUniverse: (universeUUID) => { dispatch(fetchUniverseInfo(universeUUID)).then((response) => { dispatch(fetchUniverseInfoResponse(response.payload)); }); } }; }; function mapStateToProps(state, ownProps) { const { universe: { currentUniverse } } = state; const initalGFlagValues = {}; if (isNonEmptyObject(currentUniverse) && isNonEmptyObject(currentUniverse.data.universeDetails)) { const primaryCluster = getPrimaryCluster(currentUniverse.data.universeDetails.clusters); if (isDefinedNotNull(primaryCluster)) { const masterGFlags = primaryCluster.userIntent.masterGFlags; const tserverGFlags = primaryCluster.userIntent.tserverGFlags; if (isNonEmptyObject(masterGFlags)) { initalGFlagValues.masterGFlags = Object.keys(masterGFlags).map(function (gFlagKey) { return { name: gFlagKey, value: masterGFlags[gFlagKey] }; }); } if (isNonEmptyObject(tserverGFlags)) { initalGFlagValues.tserverGFlags = Object.keys(tserverGFlags).map(function (gFlagKey) { return { name: gFlagKey, value: tserverGFlags[gFlagKey] }; }); } } } initalGFlagValues.ybSoftwareVersion = state.customer.softwareVersions[0]; initalGFlagValues.timeDelay = TASK_LONG_TIMEOUT / 1000; initalGFlagValues.upgradeOption = 'Rolling'; initalGFlagValues.rollingUpgrade = true; const selector = formValueSelector(FORM_NAME); const upgradeOption = selector(state, 'upgradeOption'); return { modal: state.modal, universe: state.universe, softwareVersions: state.customer.softwareVersions, initialValues: initalGFlagValues, upgradeOption }; } const rollingUpgradeForm = reduxForm({ form: FORM_NAME }); export default connect(mapStateToProps, mapDispatchToProps)(rollingUpgradeForm(RollingUpgradeForm));
/* * /MathJax/jax/output/SVG/fonts/TeX/Main/Regular/SpacingModLetters.js * * Copyright (c) 2012 Design Science, Inc. * * Part of the MathJax library. * See http://www.mathjax.org for details. * * Licensed under the Apache License, Version 2.0; * you may not use this file except in compliance with the License. * * http://www.apache.org/licenses/LICENSE-2.0 */ MathJax.Hub.Insert(MathJax.OutputJax.SVG.FONTDATA.FONTS.MathJax_Main,{730:[715,-542,500,147,352,"147 628Q147 669 179 692T244 715Q298 715 325 689T352 629Q352 592 323 567T249 542Q202 542 175 567T147 628ZM313 628Q313 660 300 669T259 678H253Q248 678 242 678T234 679Q217 679 207 674T192 659T188 644T187 629Q187 600 198 590Q210 579 250 579H265Q279 579 288 581T305 595T313 628"]});MathJax.Ajax.loadComplete(MathJax.OutputJax.SVG.fontDir+"/Main/Regular/SpacingModLetters.js");
import mongodb from "mongodb"; const ObjectId = mongodb.ObjectId; let movies; export default class MoviesDAO { // Establish connection handle in moviesDAO static async injectDB(conn) { if (movies) { return; } try { const database = await conn.db(process.env.MFLIX_NS); movies = database.collection("movies"); } catch (err) { console.error( `Unable to establish connection handle in moviesDAO: ${err}`, err ); } } static async getMovies({ // here's where the default parameters are set for the getMovies method filters = null, page = 0, moviesPerPage = 20, } = {}) { let queryParams = {}; if (filters) { if ("text" in filters) { queryParams = this.textSearchQuery(filters["text"]); } else if ("cast" in filters) { queryParams = this.castSearchQuery(filters["cast"]); } else if ("genre" in filters) { queryParams = this.genreSearchQuery(filters["genre"]); } } let { query = {}, project = {}, sort = DEFAULT_SORT } = queryParams; let cursor; try { cursor = await movies.find(query).project(project).sort(sort); } catch (e) { console.error(`Unable to issue find command, ${e}`); return { moviesList: [], totalNumMovies: 0 }; } /** Ticket: Paging Before this method returns back to the API, use the "moviesPerPage" and "page" arguments to decide the movies to display. Paging can be implemented by using the skip() and limit() cursor methods. */ // TODO Ticket: Paging // Use the cursor to only return the movies that belong on the current page const displayCursor = cursor.limit(moviesPerPage); try { const moviesList = await displayCursor.toArray(); const totalNumMovies = page === 0 ? await movies.countDocuments(query) : 0; return { moviesList, totalNumMovies }; } catch (e) { console.error( `Unable to convert cursor to array or problem counting documents, ${e}` ); return { moviesList: [], totalNumMovies: 0 }; } } }
// Copyright 2021 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. const appName = 'com.google.chrome.test.echo'; const kExtensionURL = 'chrome-extension://knldjmfmopnpolahpmmgbagdohdnhkik/'; var sentMessage = {text: 'test-echo'}; port = chrome.runtime.connectNative(appName); port.onMessage.addListener((message) => { chrome.test.assertEq(sentMessage, message.echo); chrome.test.assertEq(kExtensionURL, message.caller_url); chrome.test.succeed(); }); port.postMessage(sentMessage);
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const enhanced_resolve_1 = require("enhanced-resolve"); const path = require("path"); function resolveUser(id) { return new Promise((resolve, reject) => { if (id.startsWith('/')) { id = '.' + id; } resolveUser.Resolver.resolve({}, resolveUser.rootDir, id, (err, res) => { if (err) return reject(err); resolve(res); }); }); } exports.resolveUser = resolveUser; resolveUser.init = function init(rootDir) { resolveUser.rootDir = rootDir; resolveUser.config = require(path.join(rootDir, 'webpack.config.js')); resolveUser.Resolver = enhanced_resolve_1.ResolverFactory.createResolver({ fileSystem: new enhanced_resolve_1.CachedInputFileSystem(new enhanced_resolve_1.NodeJsInputFileSystem(), 4000), ...resolveUser.config.resolve, }); }; resolveUser.Resolver = null; resolveUser.rootDir = null; resolveUser.config = null; //# sourceMappingURL=resolveUser.js.map
module.exports = { extends: ['cz'], rules: { 'type-empty': [2, 'never'], 'subject-empty': [2, 'never'], 'scope-case': [1, 'always', 'pascal-case'], 'subject-case': [0], 'subject-full-stop': [0], }, };
/*! * * simple-keyboard v2.27.56 * https://github.com/go-keyboard/keyboard * * Copyright (c) Francisco Hodge (https://github.com/hodgef) * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * */ !function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e():"function"===typeof define&&define.amd?define("SimpleKeyboard",[],e):"object"===typeof exports?exports.SimpleKeyboard=e():t.SimpleKeyboard=e()}(window,(function(){return function(t){var e={};function __webpack_require__(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,__webpack_require__),o.l=!0,o.exports}return __webpack_require__.m=t,__webpack_require__.c=e,__webpack_require__.d=function(t,e,n){__webpack_require__.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},__webpack_require__.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},__webpack_require__.t=function(t,e){if(1&e&&(t=__webpack_require__(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(__webpack_require__.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)__webpack_require__.d(n,o,function(e){return t[e]}.bind(null,o));return n},__webpack_require__.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return __webpack_require__.d(e,"a",e),e},__webpack_require__.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=0)}([function(t,e,n){t.exports=n(2)},function(t,e,n){},function(t,e,n){"use strict";n.r(e);n(1);function _typeof(t){return(_typeof="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _defineProperties(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var o=function(){function Utilities(t){var e=t.getOptions,n=t.getCaretPosition,o=t.dispatch;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,Utilities),this.getOptions=e,this.getCaretPosition=n,this.dispatch=o,Utilities.bindMethods(Utilities,this)}var t,e,n;return t=Utilities,n=[{key:"bindMethods",value:function(t,e){var n=!0,o=!1,i=void 0;try{for(var s,a=Object.getOwnPropertyNames(t.prototype)[Symbol.iterator]();!(n=(s=a.next()).done);n=!0){var r=s.value;"constructor"===r||"bindMethods"===r||(e[r]=e[r].bind(e))}}catch(u){o=!0,i=u}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}}}],(e=[{key:"getButtonClass",value:function(t){var e=t.includes("{")&&t.includes("}")&&"{//}"!==t?"functionBtn":"standardBtn",n=t.replace("{","").replace("}",""),o="";return"standardBtn"!==e&&(o=" hg-button-".concat(n)),"hg-".concat(e).concat(o)}},{key:"getDefaultDiplay",value:function(){return{"{bksp}":"backspace","{backspace}":"backspace","{enter}":"< enter","{shift}":"shift","{shiftleft}":"shift","{shiftright}":"shift","{alt}":"alt","{s}":"shift","{tab}":"tab","{lock}":"caps","{capslock}":"caps","{accept}":"Submit","{space}":" ","{//}":" ","{esc}":"esc","{escape}":"esc","{f1}":"f1","{f2}":"f2","{f3}":"f3","{f4}":"f4","{f5}":"f5","{f6}":"f6","{f7}":"f7","{f8}":"f8","{f9}":"f9","{f10}":"f10","{f11}":"f11","{f12}":"f12","{numpaddivide}":"/","{numlock}":"lock","{arrowup}":"\u2191","{arrowleft}":"\u2190","{arrowdown}":"\u2193","{arrowright}":"\u2192","{prtscr}":"print","{scrolllock}":"scroll","{pause}":"pause","{insert}":"ins","{home}":"home","{pageup}":"up","{delete}":"del","{end}":"end","{pagedown}":"down","{numpadmultiply}":"*","{numpadsubtract}":"-","{numpadadd}":"+","{numpadenter}":"enter","{period}":".","{numpaddecimal}":".","{numpad0}":"0","{numpad1}":"1","{numpad2}":"2","{numpad3}":"3","{numpad4}":"4","{numpad5}":"5","{numpad6}":"6","{numpad7}":"7","{numpad8}":"8","{numpad9}":"9"}}},{key:"getButtonDisplayName",value:function(t,e,n){return(e=n?Object.assign({},this.getDefaultDiplay(),e):e||this.getDefaultDiplay())[t]||t}},{key:"getUpdatedInput",value:function(t,e,n,o){var i=this.getOptions(),s=e;return("{bksp}"===t||"{backspace}"===t)&&s.length>0?s=this.removeAt(s,n,o):"{space}"===t?s=this.addStringAt(s," ",n,o):"{tab}"!==t||"boolean"===typeof i.tabCharOnTab&&!1===i.tabCharOnTab?"{enter}"!==t&&"{numpadenter}"!==t||!i.newLineOnEnter?t.includes("numpad")&&Number.isInteger(Number(t[t.length-2]))?s=this.addStringAt(s,t[t.length-2],n,o):"{numpaddivide}"===t?s=this.addStringAt(s,"/",n,o):"{numpadmultiply}"===t?s=this.addStringAt(s,"*",n,o):"{numpadsubtract}"===t?s=this.addStringAt(s,"-",n,o):"{numpadadd}"===t?s=this.addStringAt(s,"+",n,o):"{numpaddecimal}"===t?s=this.addStringAt(s,".",n,o):"{"===t||"}"===t?s=this.addStringAt(s,t,n,o):t.includes("{")||t.includes("}")||(s=this.addStringAt(s,t,n,o)):s=this.addStringAt(s,"\n",n,o):s=this.addStringAt(s,"\t",n,o),s}},{key:"updateCaretPos",value:function(t,e){var n=this.updateCaretPosAction(t,e);this.dispatch((function(t){t.caretPosition=n}))}},{key:"updateCaretPosAction",value:function(t,e){var n=this.getOptions(),o=this.getCaretPosition();return e?o>0&&(o-=t):o+=t,n.debug&&console.log("Caret at:",o,"(".concat(this.keyboardDOMClass,")")),o}},{key:"addStringAt",value:function(t,e,n,o){var i;return n||0===n?(i=[t.slice(0,n),e,t.slice(n)].join(""),this.isMaxLengthReached()||o&&this.updateCaretPos(e.length)):i=t+e,i}},{key:"removeAt",value:function(t,e,n){var o;if(0===this.getCaretPosition())return t;var i=/([\uD800-\uDBFF][\uDC00-\uDFFF])/g;return e&&e>=0?t.substring(e-2,e).match(i)?(o=t.substr(0,e-2)+t.substr(e),n&&this.updateCaretPos(2,!0)):(o=t.substr(0,e-1)+t.substr(e),n&&this.updateCaretPos(1,!0)):t.slice(-2).match(i)?(o=t.slice(0,-2),n&&this.updateCaretPos(2,!0)):(o=t.slice(0,-1),n&&this.updateCaretPos(1,!0)),o}},{key:"handleMaxLength",value:function(t,e){var n=this.getOptions(),o=n.maxLength,i=t[n.inputName],s=e.length-1>=o;if(e.length<=i.length)return!1;if(Number.isInteger(o))return n.debug&&console.log("maxLength (num) reached:",s),s?(this.maxLengthReached=!0,!0):(this.maxLengthReached=!1,!1);if("object"===_typeof(o)){var a=i.length===o[n.inputName];return n.debug&&console.log("maxLength (obj) reached:",a),a?(this.maxLengthReached=!0,!0):(this.maxLengthReached=!1,!1)}}},{key:"isMaxLengthReached",value:function(){return Boolean(this.maxLengthReached)}},{key:"isTouchDevice",value:function(){return"ontouchstart"in window||navigator.maxTouchPoints}},{key:"pointerEventsSupported",value:function(){return window.PointerEvent}},{key:"camelCase",value:function(t){return!!t&&t.toLowerCase().trim().split(/[.\-_\s]/g).reduce((function(t,e){return e.length?t+e[0].toUpperCase()+e.slice(1):t}))}}])&&_defineProperties(t.prototype,e),n&&_defineProperties(t,n),Utilities}();function PhysicalKeyboard_defineProperties(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var i=function(){function PhysicalKeyboard(t){var e=t.dispatch,n=t.getOptions;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,PhysicalKeyboard),this.dispatch=e,this.getOptions=n,o.bindMethods(PhysicalKeyboard,this)}var t,e,n;return t=PhysicalKeyboard,(e=[{key:"handleHighlightKeyDown",value:function(t){var e=this.getOptions(),n=this.getSimpleKeyboardLayoutKey(t);this.dispatch((function(t){var o=t.getButtonElement(n)||t.getButtonElement("{".concat(n,"}"));o&&(o.style.backgroundColor=e.physicalKeyboardHighlightBgColor||"#9ab4d0",o.style.color=e.physicalKeyboardHighlightTextColor||"white")}))}},{key:"handleHighlightButton",value:function(t){var e=this.getOptions();this.dispatch((function(n){var o=n.getButtonElement(t)||n.getButtonElement("{".concat(t,"}"));o&&(o.style.backgroundColor=e.physicalKeyboardHighlightBgColor||"#9ab4d0",o.style.color=e.physicalKeyboardHighlightTextColor||"white")}))}},{key:"handleHighlightKeyUp",value:function(t){var e=this.getSimpleKeyboardLayoutKey(t);this.dispatch((function(t){var n=t.getButtonElement(e)||t.getButtonElement("{".concat(e,"}"));n&&n.removeAttribute&&n.removeAttribute("style")}))}},{key:"getSimpleKeyboardLayoutKey",value:function(t){var e;return console.log(t),((e=t.code.includes("Numpad")||t.code.includes("Shift")||t.code.includes("Space")||t.code.includes("Backspace")||t.code.includes("Control")||t.code.includes("Alt")||t.code.includes("Meta")?t.code:t.key)!==e.toUpperCase()||"F"===t.code[0]&&Number.isInteger(Number(t.code[1]))&&t.code.length<=3)&&(e=e.toLowerCase()),e}}])&&PhysicalKeyboard_defineProperties(t.prototype,e),n&&PhysicalKeyboard_defineProperties(t,n),PhysicalKeyboard}();function KeyboardLayout_defineProperties(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var s=function(){function KeyboardLayout(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,KeyboardLayout)}var t,e,n;return t=KeyboardLayout,n=[{key:"getDefaultLayout",value:function(){return{default:["` 1 2 3 4 5 6 7 8 9 0 - = {bksp}","{tab} q w e r t y u i o p [ ] \\","{lock} a s d f g h j k l ; ' {enter}","{shift} z x c v b n m , . / {shift}",".com @ {space}"],shift:["~ ! @ # $ % ^ & * ( ) _ + {bksp}","{tab} Q W E R T Y U I O P { } |",'{lock} A S D F G H J K L : " {enter}',"{shift} Z X C V B N M < > ? {shift}",".com @ {space}"]}}}],(e=null)&&KeyboardLayout_defineProperties(t.prototype,e),n&&KeyboardLayout_defineProperties(t,n),KeyboardLayout}();function _toConsumableArray(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function Keyboard_typeof(t){return(Keyboard_typeof="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Keyboard_defineProperties(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function _defineProperty(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var a=function(){function SimpleKeyboard(){var t=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,SimpleKeyboard),_defineProperty(this,"getOptions",(function(){return t.options})),_defineProperty(this,"getCaretPosition",(function(){return t.caretPosition})),_defineProperty(this,"registerModule",(function(e,n){t.modules[e]||(t.modules[e]={}),n(t.modules[e])}));var e="string"===typeof(arguments.length<=0?void 0:arguments[0])?arguments.length<=0?void 0:arguments[0]:".simple-keyboard",n="object"===Keyboard_typeof(arguments.length<=0?void 0:arguments[0])?arguments.length<=0?void 0:arguments[0]:arguments.length<=1?void 0:arguments[1];if(n||(n={}),this.utilities=new o({getOptions:this.getOptions,getCaretPosition:this.getCaretPosition,dispatch:this.dispatch}),this.caretPosition=null,this.keyboardDOM=document.querySelector(e),this.options=n,this.options.layoutName=this.options.layoutName||"default",this.options.theme=this.options.theme||"hg-theme-default",this.options.inputName=this.options.inputName||"default",this.options.preventMouseDownDefault=this.options.preventMouseDownDefault||!1,this.keyboardPluginClasses="",o.bindMethods(SimpleKeyboard,this),this.input={},this.input[this.options.inputName]="",this.keyboardDOMClass=e.split(".").join(""),this.buttonElements={},window.SimpleKeyboardInstances||(window.SimpleKeyboardInstances={}),this.currentInstanceName=this.utilities.camelCase(this.keyboardDOMClass),window.SimpleKeyboardInstances[this.currentInstanceName]=this,this.allKeyboardInstances=window.SimpleKeyboardInstances,this.keyboardInstanceNames=Object.keys(window.SimpleKeyboardInstances),this.isFirstKeyboardInstance=this.keyboardInstanceNames[0]===this.currentInstanceName,this.physicalKeyboard=new i({dispatch:this.dispatch,getOptions:this.getOptions}),this.mapPressKey={},!this.keyboardDOM)throw console.warn('"'.concat(e,'" was not found in the DOM.')),new Error("KEYBOARD_DOM_ERROR");this.render(),this.modules={},this.loadModules()}var t,e,n;return t=SimpleKeyboard,(e=[{key:"handleButtonClicked",value:function(t){var e=this.options.debug;if("{//}"===t)return!1;"function"===typeof this.options.onKeyPress&&this.options.onKeyPress(t),this.mapPressKey[t]=!0,this.input[this.options.inputName]||(this.input[this.options.inputName]="");var n=this.utilities.getUpdatedInput(t,this.input[this.options.inputName],this.caretPosition);if(this.input[this.options.inputName]!==n&&(!this.options.inputPattern||this.options.inputPattern&&this.inputPatternIsValid(n))){if(this.options.maxLength&&this.utilities.handleMaxLength(this.input,n))return!1;this.input[this.options.inputName]=this.utilities.getUpdatedInput(t,this.input[this.options.inputName],this.caretPosition,!0),e&&console.log("Input changed:",this.input),this.options.syncInstanceInputs&&this.syncInstanceInputs(),"function"===typeof this.options.onChange&&this.options.onChange(this.input[this.options.inputName]),"function"===typeof this.options.onChangeAll&&this.options.onChangeAll(this.input)}e&&console.log("Key pressed:",t)}},{key:"handleButtonMouseDown",value:function(t,e){var n=this;this.options.preventMouseDownDefault&&e.preventDefault(),this.options.stopMouseDownPropagation&&e.stopPropagation(),e&&e.target.classList.add(this.activeButtonClass),this.isMouseHold=!0,this.holdInteractionTimeout&&clearTimeout(this.holdInteractionTimeout),this.holdTimeout&&clearTimeout(this.holdTimeout),this.options.disableButtonHold||(this.holdTimeout=setTimeout((function(){!n.isMouseHold||(t.includes("{")||t.includes("}"))&&"{delete}"!==t&&"{backspace}"!==t&&"{bksp}"!==t&&"{space}"!==t&&"{tab}"!==t||(n.options.debug&&console.log("Button held:",t),n.handleButtonHold(t,e)),clearTimeout(n.holdTimeout)}),500))}},{key:"handleButtonMouseUp",value:function(t){var e=this;this.recurseButtons((function(t){t.classList.remove(e.activeButtonClass)})),this.isMouseHold=!1,this.holdInteractionTimeout&&clearTimeout(this.holdInteractionTimeout),t&&"function"===typeof this.options.onKeyReleased&&this.options.onKeyReleased(t),this.mapPressKey[t]=!1}},{key:"handleKeyboardContainerMouseDown",value:function(t){this.options.preventMouseDownDefault&&t.preventDefault()}},{key:"handleButtonHold",value:function(t){var e=this;this.holdInteractionTimeout&&clearTimeout(this.holdInteractionTimeout),this.holdInteractionTimeout=setTimeout((function(){e.isMouseHold?(e.handleButtonClicked(t),e.handleButtonHold(t)):clearTimeout(e.holdInteractionTimeout)}),100)}},{key:"syncInstanceInputs",value:function(){var t=this;this.dispatch((function(e){e.replaceInput(t.input),e.caretPosition=t.caretPosition}))}},{key:"clearInput",value:function(t){t=t||this.options.inputName,this.input[t]="",this.caretPosition=0,this.options.syncInstanceInputs&&this.syncInstanceInputs()}},{key:"getInput",value:function(t){return t=t||this.options.inputName,this.options.syncInstanceInputs&&this.syncInstanceInputs(),this.input[t]}},{key:"setInput",value:function(t,e){e=e||this.options.inputName,this.input[e]=t,this.options.syncInstanceInputs&&this.syncInstanceInputs()}},{key:"replaceInput",value:function(t){this.input=t}},{key:"setOptions",value:function(t){var e=this;t=t||{},this.options=Object.assign(this.options,t),this.onSetOptions(t),this.render(),Object.keys(this.mapPressKey).forEach((function(t){!0===e.mapPressKey[t]&&e.physicalKeyboard.handleHighlightButton(t)}))}},{key:"onSetOptions",value:function(t){t.inputName&&(this.options.debug&&console.log("inputName changed. caretPosition reset."),this.caretPosition=null)}},{key:"clear",value:function(){this.keyboardDOM.innerHTML="",this.keyboardDOM.className=this.keyboardDOMClass,this.buttonElements={}}},{key:"dispatch",value:function(t){if(!window.SimpleKeyboardInstances)throw console.warn("SimpleKeyboardInstances is not defined. Dispatch cannot be called."),new Error("INSTANCES_VAR_ERROR");return Object.keys(window.SimpleKeyboardInstances).forEach((function(e){t(window.SimpleKeyboardInstances[e],e)}))}},{key:"addButtonTheme",value:function(t,e){var n=this;if(!e||!t)return!1;t.split(" ").forEach((function(o){e.split(" ").forEach((function(e){n.options.buttonTheme||(n.options.buttonTheme=[]);var i=!1;n.options.buttonTheme.map((function(t){if(t.class.split(" ").includes(e)){i=!0;var n=t.buttons.split(" ");n.includes(o)||(i=!0,n.push(o),t.buttons=n.join(" "))}return t})),i||n.options.buttonTheme.push({class:e,buttons:t})}))})),this.render()}},{key:"removeButtonTheme",value:function(t,e){var n=this;if(!t&&!e)return this.options.buttonTheme=[],this.render(),!1;t&&Array.isArray(this.options.buttonTheme)&&this.options.buttonTheme.length&&(t.split(" ").forEach((function(t,o){n.options.buttonTheme.map((function(o,i){if(e&&e.includes(o.class)||!e){var s=o.buttons.split(" ").filter((function(e){return e!==t}));s.length?o.buttons=s.join(" "):(n.options.buttonTheme.splice(i,1),o=null)}return o}))})),this.render())}},{key:"getButtonElement",value:function(t){var e,n=this.buttonElements[t];return n&&(e=n.length>1?n:n[0]),e}},{key:"inputPatternIsValid",value:function(t){var e,n=this.options.inputPattern;if((e=n instanceof RegExp?n:n[this.options.inputName])&&t){var o=e.test(t);return this.options.debug&&console.log('inputPattern ("'.concat(e,'"): ').concat(o?"passed":"did not pass!")),o}return!0}},{key:"setEventListeners",value:function(){!this.isFirstKeyboardInstance&&this.allKeyboardInstances||(this.options.debug&&console.log("Caret handling started (".concat(this.keyboardDOMClass,")")),document.addEventListener("keyup",this.handleKeyUp),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("touchend",this.handleTouchEnd))}},{key:"handleKeyUp",value:function(t){var e=this;this.caretEventHandler(t);var n=this.physicalKeyboard.getSimpleKeyboardLayoutKey(t);console.log(n),this.dispatch((function(t){t.getButtonElement("{".concat(n,"}"))?e.handleButtonMouseUp("{"+n+"}"):e.handleButtonMouseUp(n)})),this.options.physicalKeyboardHighlight&&this.physicalKeyboard.handleHighlightKeyUp(t)}},{key:"handleKeyDown",value:function(t){var e=this,n=this.physicalKeyboard.getSimpleKeyboardLayoutKey(t);console.log(n),this.dispatch((function(t){t.getButtonElement("{".concat(n,"}"))?e.handleButtonClicked("{"+n+"}"):e.handleButtonClicked(n)})),this.options.physicalKeyboardHighlight&&this.physicalKeyboard.handleHighlightKeyDown(t)}},{key:"handleMouseUp",value:function(t){this.caretEventHandler(t)}},{key:"handleTouchEnd",value:function(t){this.caretEventHandler(t)}},{key:"caretEventHandler",value:function(t){var e;t.target.tagName&&(e=t.target.tagName.toLowerCase()),this.dispatch((function(n){n.isMouseHold&&(n.isMouseHold=!1),"textarea"!==e&&"input"!==e||n.options.disableCaretPositioning?n.options.disableCaretPositioning&&(n.caretPosition=null):(n.caretPosition=t.target.selectionStart,n.options.debug&&console.log("Caret at: ",t.target.selectionStart,t.target.tagName.toLowerCase(),"(".concat(n.keyboardDOMClass,")")))}))}},{key:"recurseButtons",value:function(t){var e=this;if(!t)return!1;Object.keys(this.buttonElements).forEach((function(n){return e.buttonElements[n].forEach(t)}))}},{key:"destroy",value:function(){this.options.debug&&console.log("Destroying simple-keyboard instance: ".concat(this.currentInstanceName)),document.removeEventListener("keyup",this.handleKeyUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("touchend",this.handleTouchEnd),document.onpointerup=null,document.ontouchend=null,document.ontouchcancel=null,document.onmouseup=null;var deleteButton=function(t){t.onpointerdown=null,t.onpointerup=null,t.onpointercancel=null,t.ontouchstart=null,t.ontouchend=null,t.ontouchcancel=null,t.onclick=null,t.onmousedown=null,t.onmouseup=null,t.remove(),t=null};this.recurseButtons(deleteButton),this.recurseButtons=null,deleteButton=null,this.keyboardDOM.onpointerdown=null,this.keyboardDOM.ontouchstart=null,this.keyboardDOM.onmousedown=null,this.clear(),window.SimpleKeyboardInstances[this.currentInstanceName]=null,delete window.SimpleKeyboardInstances[this.currentInstanceName],this.initialized=!1}},{key:"getButtonThemeClasses",value:function(t){var e=this.options.buttonTheme,n=[];return Array.isArray(e)&&e.forEach((function(e){if(e.class&&"string"===typeof e.class&&e.buttons&&"string"===typeof e.buttons){var o=e.class.split(" ");e.buttons.split(" ").includes(t)&&(n=[].concat(_toConsumableArray(n),_toConsumableArray(o)))}else console.warn('Incorrect "buttonTheme". Please check the documentation.',e)})),n}},{key:"setDOMButtonAttributes",value:function(t,e){var n=this.options.buttonAttributes;Array.isArray(n)&&n.forEach((function(n){n.attribute&&"string"===typeof n.attribute&&n.value&&"string"===typeof n.value&&n.buttons&&"string"===typeof n.buttons?n.buttons.split(" ").includes(t)&&e(n.attribute,n.value):console.warn('Incorrect "buttonAttributes". Please check the documentation.',n)}))}},{key:"onTouchDeviceDetected",value:function(){this.processAutoTouchEvents(),this.disableContextualWindow()}},{key:"disableContextualWindow",value:function(){window.oncontextmenu=function(t){if(t.target.classList.contains("hg-button"))return t.preventDefault(),t.stopPropagation(),!1}}},{key:"processAutoTouchEvents",value:function(){this.options.autoUseTouchEvents&&(this.options.useTouchEvents=!0,this.options.debug&&console.log("autoUseTouchEvents: Touch device detected, useTouchEvents enabled."))}},{key:"onInit",value:function(){this.options.debug&&console.log("".concat(this.keyboardDOMClass," Initialized")),this.setEventListeners(),"function"===typeof this.options.onInit&&this.options.onInit()}},{key:"beforeFirstRender",value:function(){this.utilities.isTouchDevice()&&this.onTouchDeviceDetected(),"function"===typeof this.options.beforeFirstRender&&this.options.beforeFirstRender(),this.isFirstKeyboardInstance&&this.utilities.pointerEventsSupported()&&!this.options.useTouchEvents&&!this.options.useMouseEvents&&this.options.debug&&console.log("Using PointerEvents as it is supported by this browser"),this.options.useTouchEvents&&this.options.debug&&console.log("useTouchEvents has been enabled. Only touch events will be used.")}},{key:"beforeRender",value:function(){"function"===typeof this.options.beforeRender&&this.options.beforeRender()}},{key:"onRender",value:function(){"function"===typeof this.options.onRender&&this.options.onRender()}},{key:"onModulesLoaded",value:function(){"function"===typeof this.options.onModulesLoaded&&this.options.onModulesLoaded()}},{key:"loadModules",value:function(){var t=this;Array.isArray(this.options.modules)&&(this.options.modules.forEach((function(e){var n=new e;if(n.constructor.name&&"Function"!==n.constructor.name){var o="module-".concat(t.utilities.camelCase(n.constructor.name));t.keyboardPluginClasses=t.keyboardPluginClasses+" ".concat(o)}n.init(t)})),this.keyboardPluginClasses=this.keyboardPluginClasses+" modules-loaded",this.render(),this.onModulesLoaded())}},{key:"getModuleProp",value:function(t,e){return!!this.modules[t]&&this.modules[t][e]}},{key:"getModulesList",value:function(){return Object.keys(this.modules)}},{key:"parseRowDOMContainers",value:function(t,e,n,o){var i=this,s=Array.from(t.children),a=0;return s.length&&n.forEach((function(n,r){var u=o[r];if(!u||!(u>n))return!1;var c=n-a,l=u-a,h=document.createElement("div");h.className+="hg-button-container";var d="".concat(i.options.layoutName,"-r").concat(e,"c").concat(r);h.setAttribute("data-skUID",d);var p=s.splice(c,l-c+1);a=l-c,p.forEach((function(t){return h.appendChild(t)})),s.splice(c,0,h),t.innerHTML="",s.forEach((function(e){return t.appendChild(e)})),i.options.debug&&console.log("rowDOMContainer",p,c,l,a+1)})),t}},{key:"render",value:function(){var t=this;this.clear(),this.initialized||this.beforeFirstRender(),this.beforeRender();var e="hg-layout-".concat(this.options.layoutName),n=this.options.layout||s.getDefaultLayout(),o=this.options.useTouchEvents||!1,i=o?"hg-touch-events":"",a=this.options.useMouseEvents||!1,r=this.options.disableRowButtonContainers;this.keyboardDOM.className+=" ".concat(this.options.theme," ").concat(e," ").concat(this.keyboardPluginClasses," ").concat(i),n[this.options.layoutName].forEach((function(e,n){var i=e.split(" "),s=document.createElement("div");s.className+="hg-row";var u=[],c=[];i.forEach((function(e,i){var l,h=!r&&e.includes("[")&&e.length>1,d=!r&&e.includes("]")&&e.length>1;h&&(u.push(i),e=e.replace(/\[/g,"")),d&&(c.push(i),e=e.replace(/\]/g,""));var p=t.utilities.getButtonClass(e),f=t.utilities.getButtonDisplayName(e,t.options.display,t.options.mergeDisplay),y=t.options.useButtonTag?"button":"div",b=document.createElement(y);b.className+="hg-button ".concat(p),(l=b.classList).add.apply(l,_toConsumableArray(t.getButtonThemeClasses(e))),t.setDOMButtonAttributes(e,(function(t,e){b.setAttribute(t,e)})),t.activeButtonClass="hg-activeButton",!t.utilities.pointerEventsSupported()||o||a?o?(b.ontouchstart=function(n){t.handleButtonClicked(e),t.handleButtonMouseDown(e,n)},b.ontouchend=function(){t.handleButtonMouseUp(e)},b.ontouchcancel=function(){t.handleButtonMouseUp(e)}):(b.onclick=function(){t.isMouseHold=!1,t.handleButtonClicked(e)},b.onmousedown=function(n){t.handleButtonMouseDown(e,n)},b.onmouseup=function(){t.handleButtonMouseUp(e)}):(b.onpointerdown=function(n){t.handleButtonClicked(e),t.handleButtonMouseDown(e,n)},b.onpointerup=function(){t.handleButtonMouseUp(e)},b.onpointercancel=function(){t.handleButtonMouseUp(e)}),b.setAttribute("data-skBtn",e);var m="".concat(t.options.layoutName,"-r").concat(n,"b").concat(i);b.setAttribute("data-skBtnUID",m);var g=document.createElement("span");g.innerHTML=f,b.appendChild(g),t.buttonElements[e]||(t.buttonElements[e]=[]),t.buttonElements[e].push(b),s.appendChild(b)})),s=t.parseRowDOMContainers(s,n,u,c),t.keyboardDOM.appendChild(s)})),this.onRender(),this.initialized||(this.initialized=!0,!this.utilities.pointerEventsSupported()||o||a?o?(document.ontouchend=function(){return t.handleButtonMouseUp()},document.ontouchcancel=function(){return t.handleButtonMouseUp()},this.keyboardDOM.ontouchstart=function(e){return t.handleKeyboardContainerMouseDown(e)}):o||(document.onmouseup=function(){return t.handleButtonMouseUp()},this.keyboardDOM.onmousedown=function(e){return t.handleKeyboardContainerMouseDown(e)}):(document.onpointerup=function(){return t.handleButtonMouseUp()},this.keyboardDOM.onpointerdown=function(e){return t.handleKeyboardContainerMouseDown(e)}),this.onInit())}}])&&Keyboard_defineProperties(t.prototype,e),n&&Keyboard_defineProperties(t,n),SimpleKeyboard}();e.default=a}])})); //# sourceMappingURL=index.js.map
import React from 'react' import PropTypes from 'prop-types' import {connect} from 'react-redux' import {Link} from 'react-router-dom' import {logout} from '../store' const Navbar = ({handleClick, isLoggedIn}) => ( <div> <div> <Link to="/home"> <h1 className="logo">Go Games</h1> </Link> </div> <nav> <div className="navbar"> {isLoggedIn ? ( <div className="loginSection"> {/* The navbar will show these links after you log in */} <div> <Link to="/home" className="home"> Home </Link> </div> <div> <Link to="/consoles" className="allConsoles"> All Consoles </Link> <Link to="/games">All Games</Link> <Link to="/accessories" className="accessories"> All accessories </Link> </div> <div> <a href="#" className="logout" onClick={handleClick}> Logout </a> </div> </div> ) : ( <div className="loginSection"> {/* The navbar will show these links before you log in */} <div> <Link to="/consoles">All Consoles</Link> <Link to="/games">All Games</Link> <Link to="/accessories" className="allAccessories"> All accessories </Link> </div> <div> <Link to="/login">Login</Link> <Link to="/signup">Sign Up</Link> </div> </div> )} </div> </nav> <hr /> </div> ) /** * CONTAINER */ const mapState = state => { return { isLoggedIn: !!state.user.id } } const mapDispatch = dispatch => { return { handleClick() { dispatch(logout()) } } } export default connect(mapState, mapDispatch)(Navbar) /** * PROP TYPES */ Navbar.propTypes = { handleClick: PropTypes.func.isRequired, isLoggedIn: PropTypes.bool.isRequired }
(window.webpackJsonp=window.webpackJsonp||[]).push([[12],{341:function(t,e,n){"use strict";var i=n(6),r=n(60),a=n(212),o=n(13),c=n(65),s=n(158),l=n(213),u=n(38);i({target:"Promise",proto:!0,real:!0,forced:!!a&&o((function(){a.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(t){var e=s(this,c("Promise")),n="function"==typeof t;return this.then(n?function(n){return l(e,t()).then((function(){return n}))}:t,n?function(n){return l(e,t()).then((function(){throw n}))}:t)}}),r||"function"!=typeof a||a.prototype.finally||u(a.prototype,"finally",c("Promise").prototype.finally)},365:function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[t.isInitiallyLoaded?t._e():t._t("default"),t._v(" "),n("div",{staticClass:"row"},[t._l(t.categoryChildren,(function(e){return n("div",{staticClass:"mb-3 col-6",class:"col-md-"+t.columnDivider},[n("a",{attrs:{href:t.getCategoryUrl(e.url),title:e.details[0].metaTitle||e.details[0].name}},[n("div",{staticClass:"nav-item border d-flex",class:{"no-img":"none"===t.imageSource}},[e.details[0][t.imageSource]?n("div",{staticClass:"prop-1-1"},["none"!==t.imageSource?n("img",{attrs:{src:"/documents/"+e.details[0][t.imageSource],alt:e.details[0].metaTitle||e.details[0].name}}):t._e()]):t._e(),t._v(" "),n("div",{staticClass:"nav-text d-flex align-center p-2"},[n("span",{staticClass:"text-appearance mx-auto text-truncate"},[t._v(t._s(e.details[0].name))])])])])])})),t._v(" "),t.categoryChildren.length&&t.categoryChildren.length<t.childrenCount?n("div",{staticClass:"mb-3 mx-auto"},[n("button",{staticClass:"btn btn-appearance px-4 py-3",class:{disabled:t.isWaiting},attrs:{type:"button"},on:{click:function(e){return t.loadChunk()}}},[n("span",[t._v(t._s(t.$translate("Ceres::Template.stepByStepNavigationShowMore")))]),t._v(" "),n("icon",{staticClass:"fa-fw",attrs:{icon:"plus-circle","class-loading":"fa-repeat",loading:t.isWaiting}})],1)]):t._e()],2)],2)};i._withStripped=!0;n(45),n(341),n(23),n(4),n(36),n(29),n(7),n(3),n(49),n(15),n(50);var r=n(30);function a(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var c={props:{categoryId:{type:Number,required:!0},chunkSize:{type:Number,default:8},imageSource:{type:String,default:"imagePath"},columns:{type:Number,default:4},columnsMax:{type:Number,default:12},childrenCount:{type:Number,required:!0}},data:function(){return{isWaiting:!1,isInitiallyLoaded:!1}},computed:function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?a(Object(n),!0).forEach((function(e){o(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({columnDivider:function(){return this.columnsMax/this.columns}},Object(r.e)({categoryChildren:function(t){return t.navigation.categoryChildren}})),created:function(){this.loadChunk()},methods:{loadChunk:function(){var t=this;this.isWaiting||(this.isWaiting=!0,this.$store.dispatch("loadCategoryChildrenChunk",{categoryId:this.categoryId,size:this.chunkSize}).finally((function(){t.isWaiting=!1,t.isInitiallyLoaded=!0})))},getCategoryUrl:function(t){var e="/"===t[0]?"":"/";return(App.urls.includeLanguage?"/".concat(App.language).concat(e):"")+t}}},s=n(2),l=Object(s.a)(c,i,[],!1,null,null,null);l.options.__file="resources/js/src/app/components/category/StepByStepNavigation.vue";e.default=l.exports}}]); //# sourceMappingURL=ceres-client-12.min.js.map
(window.webpackJsonp=window.webpackJsonp||[]).push([[10],{eyxc:function(n,e,t){"use strict";t.r(e),t.d(e,"DistinctuntilchangedModule",(function(){return v}));var i=t("iInd");class c{constructor(){this.fruits=["banana","apple","apple","banana","banana"],this.expectedFruits=["banana","apple","banana"],this.code='const fruits = from([\n "banana",\n "apple",\n "apple",\n "banana",\n "banana"]);\n\nfruits.pipe(\n\t\n).subscribe(fruit => toConveyorBelt(fruit));\n',this.minPositionLineNumber=8,this.positionColumnNumber=2}}var a=t("8Y7J"),r=t("VIrA"),s=t("TSSN"),o=t("SVse"),p=t("dJsq"),b=t("uzYf");function d(n,e){if(1&n&&(a.Mb(0,"div"),a.Mb(1,"p"),a.pc(2,"Eins nach dem anderen! Einige Fr\xfcchte kommen doppelt hintereinander. Wir brauchen allerdings die Fr\xfcchte abwechselnd."),a.Lb(),a.Mb(3,"p"),a.pc(4,"In unserem Fall hilft uns der "),a.Mb(5,"code",4),a.pc(6,"distinctUntilChanged"),a.Lb(),a.pc(7,"-Operator. Er verhindert, dass in unserem Datenstrom doppelte Fr\xfcchte direkt hintereinander geliefert werden. "),a.Mb(8,"a",5),a.pc(9,"(Mehr Infos zu distinctUntilChanged)"),a.Lb(),a.Lb(),a.Lb()),2&n){a.Yb();const n=a.fc(8);a.zb(5),a.dc("appTooltip",n)}}function u(n,e){if(1&n&&(a.Mb(0,"div"),a.Mb(1,"p"),a.pc(2,"One after the other! Some fruits come twice in a row. However, we need the fruits alternately."),a.Lb(),a.Mb(3,"p"),a.pc(4,"In our case, the "),a.Mb(5,"code",4),a.pc(6,"distinctUntilChanged"),a.Lb(),a.pc(7," operator helps us. It prevents duplicate fruits from being delivered one after the other in our data stream. "),a.Mb(8,"a",5),a.pc(9,"(Learn more about distinctUntilChanged)"),a.Lb(),a.Lb(),a.Lb()),2&n){a.Yb();const n=a.fc(8);a.zb(5),a.dc("appTooltip",n)}}function l(n,e){if(1&n&&(a.Mb(0,"div"),a.Mb(1,"p"),a.pc(2,"\u6c34\u679c\u4f1a\u4e00\u4e2a\u63a5\u4e00\u4e2a\u5730\u51fa\u73b0\uff0c\u6709\u4e9b\u6c34\u679c\u8fde\u7eed\u51fa\u73b0\u4e86\u4e24\u6b21\u3002\u4f46\u662f\uff0c\u6211\u4eec\u9700\u8981\u4ea4\u66ff\u4f7f\u7528\u4e0d\u540c\u7684\u6c34\u679c\u3002"),a.Lb(),a.Mb(3,"p"),a.pc(4,"\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c"),a.Mb(5,"code",4),a.pc(6,"distinctUntilChanged"),a.Lb(),a.pc(7," \u64cd\u4f5c\u7b26\u53ef\u4ee5\u4e3a\u6211\u4eec\u63d0\u4f9b\u5e2e\u52a9\u3002\u5b83\u53ef\u4ee5\u9632\u6b62\u91cd\u590d\u7684\u6c34\u679c\u5728\u6570\u636e\u6d41\u4e2d\u8fde\u7eed\u5730\u4f20\u9012\u3002 "),a.Mb(8,"a",5),a.pc(9,"\uff08\u4e86\u89e3\u5173\u4e8e distinctUntilChanged \u64cd\u4f5c\u7b26\u7684\u66f4\u591a\u4fe1\u606f\uff09"),a.Lb(),a.Lb(),a.Lb()),2&n){a.Yb();const n=a.fc(8);a.zb(5),a.dc("appTooltip",n)}}function h(n,e){if(1&n&&(a.Mb(0,"div"),a.Mb(1,"p"),a.pc(2,"\u041e\u0434\u0438\u043d \u0437\u0430 \u0434\u0440\u0443\u0433\u0438\u043c! \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0444\u0440\u0443\u043a\u0442\u044b \u043f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0434\u0432\u0430 \u0440\u0430\u0437\u0430 \u043f\u043e\u0434\u0440\u044f\u0434. \u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0430\u043c \u043f\u043e\u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e \u043d\u0443\u0436\u043d\u044b \u0444\u0440\u0443\u043a\u0442\u044b."),a.Lb(),a.Mb(3,"p"),a.pc(4,"\u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430\u043c \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 "),a.Mb(5,"code",4),a.pc(6,"distinctUntilChanged"),a.Lb(),a.pc(7,". \u042d\u0442\u043e \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0443 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0438\u0445\u0441\u044f \u0444\u0440\u0443\u043a\u0442\u043e\u0432 \u043e\u0434\u0438\u043d \u0437\u0430 \u0434\u0440\u0443\u0433\u0438\u043c \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u043e\u0442\u043e\u043a\u0435 \u0434\u0430\u043d\u043d\u044b\u0445. "),a.Mb(8,"a",5),a.pc(9,"(\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e DifferentUntilChanged)"),a.Lb(),a.Lb(),a.Lb()),2&n){a.Yb();const n=a.fc(8);a.zb(5),a.dc("appTooltip",n)}}const g=[{path:"",component:(()=>{class n{constructor(n,e){this.exerciseService=n,this.translateService=e,this.exerciseTitle="distinctUntilChanged",this.distinctUntilChangedCode="\n of(1, 1, 2, 1, 3, 4).pipe(\n distinctUntilChanged()\n ).subscribe(data => console.log(data));\n\n // Logs:\n // 1\n // 2\n // 1\n // 3\n // 4\n ",this.currentLanguage=""}ngOnInit(){this.exerciseService.newExercise(new c),this.currentLanguage=this.translateService.currentLang,this.onLangChangeSubscription=this.translateService.onLangChange.subscribe({next:()=>{this.currentLanguage=this.translateService.currentLang}})}ngOnDestroy(){this.onLangChangeSubscription.unsubscribe()}}return n.\u0275fac=function(e){return new(e||n)(a.Jb(r.a),a.Jb(s.d))},n.\u0275cmp=a.Db({type:n,selectors:[["app-distinctuntilchanged"]],decls:13,vars:9,consts:[[4,"ngIf"],[1,"tooltip","codeTooltip"],["tooltip",""],[3,"highlight"],[1,"help",3,"appTooltip"],["href","https://rxjs.dev/api/operators/distinctUntilChanged","target","_blank"]],template:function(n,e){1&n&&(a.Mb(0,"h3"),a.pc(1),a.Zb(2,"translate"),a.Lb(),a.oc(3,d,10,1,"div",0),a.oc(4,u,10,1,"div",0),a.oc(5,l,10,1,"div",0),a.oc(6,h,10,1,"div",0),a.Mb(7,"div",1,2),a.Mb(9,"pre"),a.pc(10," "),a.Kb(11,"code",3),a.pc(12,"\n "),a.Lb(),a.Lb()),2&n&&(a.zb(1),a.sc("",a.ac(2,7,"EXERCISES.EXERCISETITLE"),": ",e.exerciseTitle,""),a.zb(2),a.dc("ngIf","de"===e.currentLanguage),a.zb(1),a.dc("ngIf","en"===e.currentLanguage),a.zb(1),a.dc("ngIf","zh_CN"===e.currentLanguage),a.zb(1),a.dc("ngIf","ru"===e.currentLanguage),a.zb(5),a.dc("highlight",e.distinctUntilChangedCode))},directives:[o.j,p.b,b.a],pipes:[s.c],styles:[""]}),n})()}];let f=(()=>{class n{}return n.\u0275mod=a.Hb({type:n}),n.\u0275inj=a.Gb({factory:function(e){return new(e||n)},imports:[[i.d.forChild(g)],i.d]}),n})();var L=t("PCNd");let v=(()=>{class n{}return n.\u0275mod=a.Hb({type:n}),n.\u0275inj=a.Gb({factory:function(e){return new(e||n)},imports:[[L.a,f]]}),n})()}}]);
import mongoose from 'mongoose'; // We are establishing a 1-1 relationship here, where one user account can only map back to one profile // Can an account have more than one profile. Sure. You can make your design choices in your own project on this matter. But for now, we will establish this as a 1-1 relationship. const profileSchema = mongoose.Schema({ firstName: { type: String, required: true, }, lastName: { type: String }, bio: { type: String }, location: String, profileImageUrl: { type: String }, accountId: { type: mongoose.Schema.Types.ObjectId, required: true, unique: true, }, }); const skipInit = process.env.NODE_ENV === 'development'; export default mongoose.model('profiles', profileSchema, 'profiles', skipInit);
/*! videojs-wavesurfer v1.3.1 * https://github.com/collab-project/videojs-wavesurfer * Copyright (c) Collab 2014-2017 - Licensed MIT */ !function(a,b){"function"==typeof define&&define.amd?define(["videojs","wavesurfer"],b):"object"==typeof module&&module.exports?module.exports=b(require("video.js"),require("wavesurfer.js")):a.returnExports=b(a.videojs,a.WaveSurfer)}(this,function(a,b){var c="error",d="warn",e=a.getComponent("Component");a.Waveform=a.extend(e,{constructor:function(a,c){if(e.call(this,a,c),this.waveReady=!1,this.waveFinished=!1,this.liveMode=!1,this.debug="true"===this.options_.options.debug.toString(),this.msDisplayMax=parseFloat(this.options_.options.msDisplayMax),"live"===this.options_.options.src)try{this.microphone=Object.create(b.Microphone),this.microphone.on("deviceError",this.onWaveError.bind(this)),this.liveMode=!0,this.waveReady=!0,this.log("wavesurfer.js microphone plugin enabled.")}catch(a){this.onWaveError("Could not find wavesurfer.js microphone plugin!")}this.player().one("ready",this.setupUI.bind(this))},setupUI:function(){if(this.player().bigPlayButton.hide(),this.player().usingNativeControls_===!0&&void 0!==this.player().tech_.el_&&(this.player().tech_.el_.controls=!1),this.player().currentSrc=function(){return"videojs-wavesurfer"},this.player().options_.controls){this.player().controlBar.show(),this.player().controlBar.el().style.display="flex",this.player().controlBar.progressControl.hide(),this.player().on("userinactive",function(a){this.player().userActive(!0)});var a=[this.player().controlBar.currentTimeDisplay,this.player().controlBar.timeDivider,this.player().controlBar.durationDisplay];for(var c in a)void 0!==a[c]&&(a[c].el().style.display="block",a[c].show());void 0!==this.player().controlBar.remainingTimeDisplay&&this.player().controlBar.remainingTimeDisplay.hide(),void 0!==this.player().controlBar.timeDivider&&(this.player().controlBar.timeDivider.el().style.textAlign="center",this.player().controlBar.timeDivider.el().style.width="2em"),this.liveMode||this.player().controlBar.playToggle.hide()}this.surfer=Object.create(b),this.surfer.on("error",this.onWaveError.bind(this)),this.surfer.on("finish",this.onWaveFinish.bind(this)),this.surferReady=this.onWaveReady.bind(this),this.surferProgress=this.onWaveProgress.bind(this),this.surferSeek=this.onWaveSeek.bind(this),this.liveMode||this.setupPlaybackEvents(!0),this.player().on("play",this.onPlay.bind(this)),this.player().on("pause",this.onPause.bind(this)),this.player().on("volumechange",this.onVolumeChange.bind(this)),this.player().on("fullscreenchange",this.onScreenChange.bind(this)),this.startPlayers()},setupPlaybackEvents:function(a){a===!1?(this.surfer.un("ready",this.surferReady),this.surfer.un("audioprocess",this.surferProgress),this.surfer.un("seek",this.surferSeek)):a===!0&&(this.surfer.on("ready",this.surferReady),this.surfer.on("audioprocess",this.surferProgress),this.surfer.on("seek",this.surferSeek))},startPlayers:function(){var a=this.options_.options;this.initialize(a),void 0!==a.src?void 0===this.microphone?(this.player().loadingSpinner.show(),this.load(a.src)):(this.player().loadingSpinner.hide(),a.wavesurfer=this.surfer,this.microphone.init(a)):this.player().loadingSpinner.hide()},initialize:function(a){this.originalHeight=this.player().options_.height;var b=this.player().controlBar.height();this.player().options_.controls===!0&&0===b&&(b=30),void 0===a.container&&(a.container=this.el()),void 0===a.waveformHeight?a.height=this.player().height()-b:a.height=a.waveformHeight,a.splitChannels&&a.splitChannels===!0&&(a.height/=2),this.surfer.init(a)},load:function(a){a instanceof Blob||a instanceof File?(this.log("Loading object: "+a),this.surfer.loadBlob(a)):(this.log("Loading URL: "+a),this.surfer.load(a))},play:function(){this.liveMode?this.microphone.active?(this.log("Resume microphone"),this.microphone.play()):(this.log("Start microphone"),this.microphone.start()):(this.log("Start playback"),this.player().play(),this.surfer.play())},pause:function(){this.liveMode?(this.log("Pause microphone"),this.microphone.pause()):(this.log("Pause playback"),this.waveFinished?this.waveFinished=!1:this.surfer.pause(),this.setCurrentTime())},destroy:function(){this.log("Destroying plugin"),this.liveMode&&this.microphone&&(this.log("Destroying microphone"),this.microphone.destroy()),this.surfer.destroy(),this.player().dispose()},setVolume:function(a){void 0!==a&&(this.log("Changing volume to: "+a),this.surfer.setVolume(a))},exportImage:function(a,b){return this.surfer.exportImage(a,b)},log:function(b,e){this.debug===!0&&(e===c?a.log.error(b):e===d?a.log.warn(b):a.log(b))},getCurrentTime:function(){var a=this.surfer.getCurrentTime();return a=isNaN(a)?0:a},setCurrentTime:function(a,b){void 0===a&&(a=this.surfer.getCurrentTime()),void 0===b&&(b=this.surfer.getDuration()),a=isNaN(a)?0:a,b=isNaN(b)?0:b;var c=Math.min(a,b);this.player().controlBar.currentTimeDisplay.contentEl().innerHTML=this.formatTime(c,b)},getDuration:function(){var a=this.surfer.getDuration();return a=isNaN(a)?0:a},setDuration:function(a){void 0===a&&(a=this.surfer.getDuration()),a=isNaN(a)?0:a,this.player().controlBar.durationDisplay.contentEl().innerHTML=this.formatTime(a,a)},onWaveReady:function(){this.waveReady=!0,this.waveFinished=!1,this.liveMode=!1,this.log("Waveform is ready"),this.player().trigger("waveReady"),this.setCurrentTime(),this.setDuration(),this.player().controlBar.playToggle.show(),this.player().loadingSpinner.hide(),this.player().options_.autoplay&&this.play()},onWaveFinish:function(){this.log("Finished playback"),this.player().trigger("playbackFinish"),this.player().paused()||(this.player().options_.loop?(this.surfer.stop(),this.play()):(this.waveFinished=!0,this.player().pause()))},onWaveProgress:function(a){this.setCurrentTime()},onWaveSeek:function(){this.setCurrentTime()},onPlay:function(){this.waveReady&&this.play()},onPause:function(){this.pause()},onVolumeChange:function(){var a=this.player().volume();this.player().muted()&&(a=0),this.setVolume(a)},onScreenChange:function(){var a,b=this.player().isFullscreen();if(a=b?window.outerHeight:this.originalHeight,this.waveReady){if(this.liveMode&&!this.microphone.active)return;this.surfer.drawer.destroy(),this.surfer.params.height=a-this.player().controlBar.height(),this.surfer.createDrawer(),this.surfer.drawBuffer(),this.surfer.drawer.progress(this.surfer.backend.getPlayedPercents())}},onWaveError:function(a){this.log(a,c),this.player().trigger("error",a)},formatTime:function(a,b){a=a<0?0:a,b=b||a;var c=Math.floor(a%60),d=Math.floor(a/60%60),e=Math.floor(a/3600),f=Math.floor(b/60%60),g=Math.floor(b/3600),h=Math.floor(1e3*(a-c));return(isNaN(a)||a===1/0)&&(e=d=c=h="-"),b>0&&b<this.msDisplayMax?(h<100&&(h=h<10?"00"+h:"0"+h),h=":"+h):h="",e=e>0||g>0?e+":":"",d=((e||f>=10)&&d<10?"0"+d:d)+":",c=c<10?"0"+c:c,e+d+c+h}});var f=function(){var a={className:"vjs-waveform",tabIndex:0};return e.prototype.createEl("div",a)},g={debug:!1,msDisplayMax:3},h=function(b){var c=a.mergeOptions(g,b),d=this;d.waveform=new a.Waveform(d,{el:f(),options:c}),d.el().appendChild(d.waveform.el())};return a.plugin("wavesurfer",h),h});
var waktu = $('#waktu').val(); var oldDate = new Date(waktu); var hour = oldDate.getHours(); var newDate = oldDate.setHours(hour + 24); console.log(newDate); // Set the date we're counting down to = tujuan = 24 jam var countDownDate = newDate; // console.log(countDownDate); // Update the count down every 1 second var x = setInterval(function() { // Get today's date and time = awal var now = new Date().getTime(); // Find the distance between now and the count down date var distance = countDownDate - now; // Time calculations for days, hours, minutes and seconds // var days = Math.floor(distance / (1000 * 60 * 60 * 24)); var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); var seconds = Math.floor((distance % (1000 * 60)) / 1000); // Output the result in an element with id="demo" document.getElementById("demo").innerHTML = hours + " jam " + minutes + "menit " + seconds + "detik "; // If the count down is over, write some text if (distance < 0) { clearInterval(x); document.getElementById("demo").innerHTML = "Pesanan Dibatalkan"; } }, 1000);
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isPropChange = exports.isLatLngChange = exports.toTuple = void 0; var toTuple = function (latLng) { return (Array.isArray(latLng) ? latLng : [latLng.lat, latLng.lng]); }; exports.toTuple = toTuple; var isLatLngChange = function (latLng, prevLatLng) { if (latLng && prevLatLng) { var _a = (0, exports.toTuple)(latLng), lat = _a[0], lng = _a[1]; var _b = (0, exports.toTuple)(prevLatLng), prevLat = _b[0], prevLng = _b[1]; if (lat !== prevLat) { return true; } return lng !== prevLng; } // undefined => [x,y] return prevLatLng == null && latLng != null; }; exports.isLatLngChange = isLatLngChange; var isPropChange = function (name, props, prevProps) { return props[name] != null && props[name] !== prevProps[name]; }; exports.isPropChange = isPropChange;
/* global chai */ import sinonChai from 'sinon-chai' import chaiAsPromised from 'chai-as-promised' import dirtyChai from 'dirty-chai' chai.use(sinonChai) chai.use(chaiAsPromised) chai.use(dirtyChai)
'use strict'; // --------------------------------------------------------------------------- const Exchange = require ('./base/Exchange'); const { AuthenticationError, BadRequest, DDoSProtection, ExchangeError, ExchangeNotAvailable, InsufficientFunds, InvalidOrder, OrderNotFound, PermissionDenied } = require ('./base/errors'); // --------------------------------------------------------------------------- module.exports = class bitmex extends Exchange { describe () { return this.deepExtend (super.describe (), { 'id': 'bitmex', 'name': 'BitMEX', 'countries': [ 'SC' ], // Seychelles 'version': 'v1', 'userAgent': undefined, 'rateLimit': 2000, 'has': { 'CORS': false, 'fetchOHLCV': true, 'withdraw': true, 'editOrder': true, 'fetchOrder': true, 'fetchOrders': true, 'fetchOpenOrders': true, 'fetchClosedOrders': true, }, 'timeframes': { '1m': '1m', '5m': '5m', '1h': '1h', '1d': '1d', }, 'urls': { 'test': 'https://testnet.bitmex.com', 'logo': 'https://user-images.githubusercontent.com/1294454/27766319-f653c6e6-5ed4-11e7-933d-f0bc3699ae8f.jpg', 'api': 'https://www.bitmex.com', 'www': 'https://www.bitmex.com', 'doc': [ 'https://www.bitmex.com/app/apiOverview', 'https://github.com/BitMEX/api-connectors/tree/master/official-http', ], 'fees': 'https://www.bitmex.com/app/fees', 'referral': 'https://www.bitmex.com/register/rm3C16', }, 'api': { 'public': { 'get': [ 'announcement', 'announcement/urgent', 'funding', 'instrument', 'instrument/active', 'instrument/activeAndIndices', 'instrument/activeIntervals', 'instrument/compositeIndex', 'instrument/indices', 'insurance', 'leaderboard', 'liquidation', 'orderBook', 'orderBook/L2', 'quote', 'quote/bucketed', 'schema', 'schema/websocketHelp', 'settlement', 'stats', 'stats/history', 'trade', 'trade/bucketed', ], }, 'private': { 'get': [ 'apiKey', 'chat', 'chat/channels', 'chat/connected', 'execution', 'execution/tradeHistory', 'notification', 'order', 'position', 'user', 'user/affiliateStatus', 'user/checkReferralCode', 'user/commission', 'user/depositAddress', 'user/margin', 'user/minWithdrawalFee', 'user/wallet', 'user/walletHistory', 'user/walletSummary', ], 'post': [ 'apiKey', 'apiKey/disable', 'apiKey/enable', 'chat', 'order', 'order/bulk', 'order/cancelAllAfter', 'order/closePosition', 'position/isolate', 'position/leverage', 'position/riskLimit', 'position/transferMargin', 'user/cancelWithdrawal', 'user/confirmEmail', 'user/confirmEnableTFA', 'user/confirmWithdrawal', 'user/disableTFA', 'user/logout', 'user/logoutAll', 'user/preferences', 'user/requestEnableTFA', 'user/requestWithdrawal', ], 'put': [ 'order', 'order/bulk', 'user', ], 'delete': [ 'apiKey', 'order', 'order/all', ], }, }, 'exceptions': { 'exact': { 'Invalid API Key.': AuthenticationError, 'Access Denied': PermissionDenied, 'Duplicate clOrdID': InvalidOrder, 'Signature not valid': AuthenticationError, }, 'broad': { 'overloaded': ExchangeNotAvailable, 'Account has insufficient Available Balance': InsufficientFunds, }, }, 'options': { 'api-expires': undefined, 'fetchTickerQuotes': false, }, }); } async fetchMarkets (params = {}) { let markets = await this.publicGetInstrumentActiveAndIndices (); let result = []; for (let p = 0; p < markets.length; p++) { let market = markets[p]; let active = (market['state'] !== 'Unlisted'); let id = market['symbol']; let baseId = market['underlying']; let quoteId = market['quoteCurrency']; let type = undefined; let future = false; let prediction = false; let basequote = baseId + quoteId; let base = this.commonCurrencyCode (baseId); let quote = this.commonCurrencyCode (quoteId); let swap = (id === basequote); let symbol = id; if (swap) { type = 'swap'; symbol = base + '/' + quote; } else if (id.indexOf ('B_') >= 0) { prediction = true; type = 'prediction'; } else { future = true; type = 'future'; } let precision = { 'amount': undefined, 'price': undefined, }; if (market['lotSize']) precision['amount'] = this.precisionFromString (this.truncate_to_string (market['lotSize'], 16)); if (market['tickSize']) precision['price'] = this.precisionFromString (this.truncate_to_string (market['tickSize'], 16)); result.push ({ 'id': id, 'symbol': symbol, 'base': base, 'quote': quote, 'baseId': baseId, 'quoteId': quoteId, 'active': active, 'precision': precision, 'limits': { 'amount': { 'min': market['lotSize'], 'max': market['maxOrderQty'], }, 'price': { 'min': market['tickSize'], 'max': market['maxPrice'], }, }, 'taker': market['takerFee'], 'maker': market['makerFee'], 'type': type, 'spot': false, 'swap': swap, 'future': future, 'prediction': prediction, 'info': market, }); } return result; } async fetchBalance (params = {}) { await this.loadMarkets (); let response = await this.privateGetUserMargin ({ 'currency': 'all' }); let result = { 'info': response }; for (let b = 0; b < response.length; b++) { let balance = response[b]; let currency = balance['currency'].toUpperCase (); currency = this.commonCurrencyCode (currency); let account = { 'free': balance['availableMargin'], 'used': 0.0, 'total': balance['marginBalance'], }; if (currency === 'BTC') { account['free'] = account['free'] * 0.00000001; account['total'] = account['total'] * 0.00000001; } account['used'] = account['total'] - account['free']; result[currency] = account; } return this.parseBalance (result); } async fetchOrderBook (symbol, limit = undefined, params = {}) { await this.loadMarkets (); let market = this.market (symbol); let request = { 'symbol': market['id'], }; if (limit !== undefined) request['depth'] = limit; let orderbook = await this.publicGetOrderBookL2 (this.extend (request, params)); let result = { 'bids': [], 'asks': [], 'timestamp': undefined, 'datetime': undefined, 'nonce': undefined, }; for (let o = 0; o < orderbook.length; o++) { let order = orderbook[o]; let side = (order['side'] === 'Sell') ? 'asks' : 'bids'; let amount = order['size']; let price = order['price']; result[side].push ([ price, amount ]); } result['bids'] = this.sortBy (result['bids'], 0, true); result['asks'] = this.sortBy (result['asks'], 0); return result; } async fetchOrder (id, symbol = undefined, params = {}) { let filter = { 'filter': { 'orderID': id }}; let result = await this.fetchOrders (symbol, undefined, undefined, this.deepExtend (filter, params)); let numResults = result.length; if (numResults === 1) return result[0]; throw new OrderNotFound (this.id + ': The order ' + id + ' not found.'); } async fetchOrders (symbol = undefined, since = undefined, limit = undefined, params = {}) { await this.loadMarkets (); let market = undefined; let request = {}; if (symbol !== undefined) { market = this.market (symbol); request['symbol'] = market['id']; } if (since !== undefined) request['startTime'] = this.iso8601 (since); if (limit !== undefined) request['count'] = limit; request = this.deepExtend (request, params); // why the hassle? urlencode in python is kinda broken for nested dicts. // E.g. self.urlencode({"filter": {"open": True}}) will return "filter={'open':+True}" // Bitmex doesn't like that. Hence resorting to this hack. if ('filter' in request) request['filter'] = this.json (request['filter']); let response = await this.privateGetOrder (request); return this.parseOrders (response, market, since, limit); } async fetchOpenOrders (symbol = undefined, since = undefined, limit = undefined, params = {}) { let filter_params = { 'filter': { 'open': true }}; return await this.fetchOrders (symbol, since, limit, this.deepExtend (filter_params, params)); } async fetchClosedOrders (symbol = undefined, since = undefined, limit = undefined, params = {}) { // Bitmex barfs if you set 'open': false in the filter... let orders = await this.fetchOrders (symbol, since, limit, params); return this.filterBy (orders, 'status', 'closed'); } async fetchTicker (symbol, params = {}) { await this.loadMarkets (); let market = this.market (symbol); if (!market['active']) throw new ExchangeError (this.id + ': symbol ' + symbol + ' is delisted'); let request = this.extend ({ 'symbol': market['id'], 'binSize': '1d', 'partial': true, 'count': 1, 'reverse': true, }, params); let bid = undefined; let ask = undefined; if (this.options['fetchTickerQuotes']) { let quotes = await this.publicGetQuoteBucketed (request); let quotesLength = quotes.length; let quote = quotes[quotesLength - 1]; bid = this.safeFloat (quote, 'bidPrice'); ask = this.safeFloat (quote, 'askPrice'); } let tickers = await this.publicGetTradeBucketed (request); let ticker = tickers[0]; let timestamp = this.milliseconds (); let open = this.safeFloat (ticker, 'open'); let close = this.safeFloat (ticker, 'close'); let change = close - open; return { 'symbol': symbol, 'timestamp': timestamp, 'datetime': this.iso8601 (timestamp), 'high': this.safeFloat (ticker, 'high'), 'low': this.safeFloat (ticker, 'low'), 'bid': bid, 'bidVolume': undefined, 'ask': ask, 'askVolume': undefined, 'vwap': this.safeFloat (ticker, 'vwap'), 'open': open, 'close': close, 'last': close, 'previousClose': undefined, 'change': change, 'percentage': change / open * 100, 'average': this.sum (open, close) / 2, 'baseVolume': this.safeFloat (ticker, 'homeNotional'), 'quoteVolume': this.safeFloat (ticker, 'foreignNotional'), 'info': ticker, }; } parseOHLCV (ohlcv, market = undefined, timeframe = '1m', since = undefined, limit = undefined) { let timestamp = this.parse8601 (ohlcv['timestamp']); return [ timestamp, ohlcv['open'], ohlcv['high'], ohlcv['low'], ohlcv['close'], ohlcv['volume'], ]; } async fetchOHLCV (symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) { await this.loadMarkets (); // send JSON key/value pairs, such as {"key": "value"} // filter by individual fields and do advanced queries on timestamps // let filter = { 'key': 'value' }; // send a bare series (e.g. XBU) to nearest expiring contract in that series // you can also send a timeframe, e.g. XBU:monthly // timeframes: daily, weekly, monthly, quarterly, and biquarterly let market = this.market (symbol); let request = { 'symbol': market['id'], 'binSize': this.timeframes[timeframe], 'partial': true, // true == include yet-incomplete current bins // 'filter': filter, // filter by individual fields and do advanced queries // 'columns': [], // will return all columns if omitted // 'start': 0, // starting point for results (wtf?) // 'reverse': false, // true == newest first // 'endTime': '', // ending date filter for results }; if (limit !== undefined) request['count'] = limit; // default 100, max 500 // if since is not set, they will return candles starting from 2017-01-01 if (since !== undefined) { let ymdhms = this.ymdhms (since); request['startTime'] = ymdhms; // starting date filter for results } let response = await this.publicGetTradeBucketed (this.extend (request, params)); return this.parseOHLCVs (response, market, timeframe, since, limit); } parseTrade (trade, market = undefined) { let timestamp = this.parse8601 (trade['timestamp']); let symbol = undefined; if (market === undefined) { if ('symbol' in trade) market = this.markets_by_id[trade['symbol']]; } if (market) symbol = market['symbol']; return { 'id': trade['trdMatchID'], 'info': trade, 'timestamp': timestamp, 'datetime': this.iso8601 (timestamp), 'symbol': symbol, 'order': undefined, 'type': undefined, 'side': trade['side'].toLowerCase (), 'price': trade['price'], 'amount': trade['size'], }; } parseOrderStatus (status) { let statuses = { 'New': 'open', 'PartiallyFilled': 'open', 'Filled': 'closed', 'DoneForDay': 'open', 'Canceled': 'canceled', 'PendingCancel': 'open', 'PendingNew': 'open', 'Rejected': 'rejected', 'Expired': 'expired', 'Stopped': 'open', 'Untriggered': 'open', 'Triggered': 'open', }; return this.safeString (statuses, status, status); } parseOrder (order, market = undefined) { let status = this.parseOrderStatus (this.safeString (order, 'ordStatus')); let symbol = undefined; if (market !== undefined) { symbol = market['symbol']; } else { let id = order['symbol']; if (id in this.markets_by_id) { market = this.markets_by_id[id]; symbol = market['symbol']; } } let timestamp = this.parse8601 (this.safeString (order, 'timestamp')); let lastTradeTimestamp = this.parse8601 (this.safeString (order, 'transactTime')); let price = this.safeFloat (order, 'price'); let amount = this.safeFloat (order, 'orderQty'); let filled = this.safeFloat (order, 'cumQty', 0.0); let remaining = undefined; if (amount !== undefined) { if (filled !== undefined) { remaining = Math.max (amount - filled, 0.0); } } let cost = undefined; if (price !== undefined) if (filled !== undefined) cost = price * filled; let result = { 'info': order, 'id': order['orderID'].toString (), 'timestamp': timestamp, 'datetime': this.iso8601 (timestamp), 'lastTradeTimestamp': lastTradeTimestamp, 'symbol': symbol, 'type': order['ordType'].toLowerCase (), 'side': order['side'].toLowerCase (), 'price': price, 'amount': amount, 'cost': cost, 'filled': filled, 'remaining': remaining, 'status': status, 'fee': undefined, }; return result; } async fetchTrades (symbol, since = undefined, limit = undefined, params = {}) { await this.loadMarkets (); let market = this.market (symbol); let request = { 'symbol': market['id'], }; if (since !== undefined) request['startTime'] = this.iso8601 (since); if (limit !== undefined) request['count'] = limit; let response = await this.publicGetTrade (this.extend (request, params)); return this.parseTrades (response, market); } async createOrder (symbol, type, side, amount, price = undefined, params = {}) { await this.loadMarkets (); let request = { 'symbol': this.marketId (symbol), 'side': this.capitalize (side), 'orderQty': amount, 'ordType': this.capitalize (type), }; if (price !== undefined) request['price'] = price; let response = await this.privatePostOrder (this.extend (request, params)); let order = this.parseOrder (response); let id = order['id']; this.orders[id] = order; return this.extend ({ 'info': response }, order); } async editOrder (id, symbol, type, side, amount = undefined, price = undefined, params = {}) { await this.loadMarkets (); let request = { 'orderID': id, }; if (amount !== undefined) request['orderQty'] = amount; if (price !== undefined) request['price'] = price; let response = await this.privatePutOrder (this.extend (request, params)); let order = this.parseOrder (response); this.orders[order['id']] = order; return this.extend ({ 'info': response }, order); } async cancelOrder (id, symbol = undefined, params = {}) { await this.loadMarkets (); let response = await this.privateDeleteOrder (this.extend ({ 'orderID': id }, params)); let order = response[0]; let error = this.safeString (order, 'error'); if (error !== undefined) if (error.indexOf ('Unable to cancel order due to existing state') >= 0) throw new OrderNotFound (this.id + ' cancelOrder() failed: ' + error); order = this.parseOrder (order); this.orders[order['id']] = order; return this.extend ({ 'info': response }, order); } isFiat (currency) { if (currency === 'EUR') return true; if (currency === 'PLN') return true; return false; } async withdraw (code, amount, address, tag = undefined, params = {}) { this.checkAddress (address); await this.loadMarkets (); // let currency = this.currency (code); if (code !== 'BTC') { throw new ExchangeError (this.id + ' supoprts BTC withdrawals only, other currencies coming soon...'); } let request = { 'currency': 'XBt', // temporarily 'amount': amount, 'address': address, // 'otpToken': '123456', // requires if two-factor auth (OTP) is enabled // 'fee': 0.001, // bitcoin network fee }; let response = await this.privatePostUserRequestWithdrawal (this.extend (request, params)); return { 'info': response, 'id': response['transactID'], }; } handleErrors (code, reason, url, method, headers, body, response) { if (code === 429) throw new DDoSProtection (this.id + ' ' + body); if (code >= 400) { if (body) { if (body[0] === '{') { const error = this.safeValue (response, 'error', {}); const message = this.safeString (error, 'message'); const feedback = this.id + ' ' + body; const exact = this.exceptions['exact']; if (message in exact) { throw new exact[message] (feedback); } const broad = this.exceptions['broad']; const broadKey = this.findBroadlyMatchedKey (broad, message); if (broadKey !== undefined) { throw new broad[broadKey] (feedback); } if (code === 400) { throw new BadRequest (feedback); } throw new ExchangeError (feedback); // unknown message } } } } nonce () { return this.milliseconds (); } sign (path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) { let query = '/api/' + this.version + '/' + path; if (method !== 'PUT') if (Object.keys (params).length) query += '?' + this.urlencode (params); let url = this.urls['api'] + query; if (api === 'private') { this.checkRequiredCredentials (); let auth = method + query; let expires = this.safeInteger (this.options, 'api-expires'); let nonce = this.nonce ().toString (); headers = { 'Content-Type': 'application/json', 'api-key': this.apiKey, }; if (expires !== undefined) { expires = this.sum (this.seconds (), expires); expires = expires.toString (); auth += expires; headers['api-expires'] = expires; } else { auth += nonce; headers['api-nonce'] = nonce; } if (method === 'POST' || method === 'PUT') { if (Object.keys (params).length) { body = this.json (params); auth += body; } } headers['api-signature'] = this.hmac (this.encode (auth), this.encode (this.secret)); } return { 'url': url, 'method': method, 'body': body, 'headers': headers }; } };
import { all, fork, takeLatest, takeEvery, call, put, delay } from 'redux-saga/effects'; import axios from 'axios'; import { LOG_IN_SUCCESS, LOG_IN_FAILURE, LOG_IN_REQUEST, SIGN_UP_SUCCESS, SIGN_UP_FAILURE, SIGN_UP_REQUEST, LOG_OUT_SUCCESS, LOG_OUT_FAILURE, LOG_OUT_REQUEST, LOAD_USER_SUCCESS, LOAD_USER_FAILURE, LOAD_USER_REQUEST, FOLLOW_USER_REQUEST, FOLLOW_USER_FAILURE, FOLLOW_USER_SUCCESS, LOAD_FOLLOWERS_SUCCESS, LOAD_FOLLOWERS_FAILURE, LOAD_FOLLOWERS_REQUEST, LOAD_FOLLOWINGS_SUCCESS, LOAD_FOLLOWINGS_FAILURE, LOAD_FOLLOWINGS_REQUEST, REMOVE_FOLLOWER_FAILURE, REMOVE_FOLLOWER_REQUEST, REMOVE_FOLLOWER_SUCCESS, EDIT_NICKNAME_SUCCESS, EDIT_NICKNAME_FAILURE, EDIT_NICKNAME_REQUEST } from '../reducers/user'; import { Result } from 'antd'; import { RETWEET_REQUEST, RETWEET_SUCCESS, RETWEET_FAILURE, UNFOLLOW_USER_SUCCESS, UNFOLLOW_USER_FAILURE, UNFOLLOW_USER_REQUEST, REMOVE_POST_SUCCESS } from '../reducers/post'; function logInAPI(loginData){ //서버에 요청을 보내는 부분 return axios.post('/user/login', loginData, { withCredentials: true, // 서로 쿠키를 주고받을 수 있도록 (front) }); } function* logIn(action){ try { const result = yield call(logInAPI, action.data); //함수 동기적 호출 (응답을 받을 때까지 기다림) yield put({ // put은 dispatch와 동일 type: LOG_IN_SUCCESS, data: result.data, }); } catch (e){ console.error(e); yield put({ type: LOG_IN_FAILURE, reason: e.response && e.response.data, }); } } function* watchLogIn(){ yield takeEvery(LOG_IN_REQUEST, logIn); } function signUpAPI(signUpData) { return axios.post('/user', signUpData); } function* signUp(action) { try { yield call(signUpAPI, action.data); // 함수 동기적 호출 (응답을 받을 때까지 기다림) // call은 첫번째는 함수, 두번째부터 인자 yield put({ //put은 dispatch와 동일 type: SIGN_UP_SUCCESS, }); } catch (e){ console.error(e); yield put({ type: SIGN_UP_FAILURE, error: e, }); } } function* watchSignUp(){ yield takeEvery(SIGN_UP_REQUEST, signUp); } function logOutAPI(){ return axios.post('/user/logout', {}, { withCredentials: true, // 쿠키를 백으로 보내기 위해 }); } function* logOut(){ try { yield call(logOutAPI); yield put({ type: LOG_OUT_SUCCESS }); } catch (e){ console.error(e); yield put({ type: LOG_OUT_FAILURE, error: e, }); } } function* watchLogOut(){ yield takeEvery(LOG_OUT_REQUEST, logOut); } function loadUserAPI(userId){ console.log('loadUserAPI arrived'); return axios.get(userId? `/user/${userId}` : '/user/', { withCredentials: true, }); } function* loadUser(action){ console.log('loadUser arrived') try { const result = yield call(loadUserAPI, action.data); console.log(result); yield put({ type: LOAD_USER_SUCCESS, data: result.data, me: !action.data, }); } catch (e){ console.error(e); yield put({ type: LOAD_USER_FAILURE, error: e, }); } } function* watchLoadUser(){ yield takeEvery(LOAD_USER_REQUEST, loadUser); } function followAPI(userId){ return axios.post(`/user/${userId}/follow`, {}, { withCredentials: true, }); } function* follow(action){ try { const result = yield call(followAPI, action.data); yield put({ type: FOLLOW_USER_SUCCESS, data: result.data, }); } catch (e){ console.error(e); yield put({ type: FOLLOW_USER_FAILURE, error: e, }); } } function* watchFollow(){ yield takeEvery(FOLLOW_USER_REQUEST, follow); } function unfollowAPI(userId){ return axios.delete(`/user/${userId}/follow`, { withCredentials: true, }); } function* unfollow(action){ try { const result = yield call(unfollowAPI, action.data); yield put({ type: UNFOLLOW_USER_SUCCESS, data: result.data, }); } catch (e){ console.error(e); yield put({ type: UNFOLLOW_USER_FAILURE, error: e, }); } } function* watchUnfollow(){ yield takeEvery(UNFOLLOW_USER_REQUEST, unfollow); } function loadFollowingsAPI(userId, offset = 0, limit = 3){ return axios.get(`/user/${userId || 0}/followings?offset=${offset}&limit=${limit}`, { withCredentials: true, }); } function* loadFollowings(action){ try { const result = yield call(loadFollowingsAPI, action.data, action.offset); yield put({ type: LOAD_FOLLOWINGS_SUCCESS, data: result.data, }); } catch (e){ console.error(e); yield put({ type: LOAD_FOLLOWINGS_FAILURE, error: e, }); } } function* watchLoadFollowings(){ yield takeEvery(LOAD_FOLLOWINGS_REQUEST, loadFollowings); } function loadFollowersAPI(userId, offset = 0, limit = 3){ return axios.get(`/user/${userId || 0}/followers?offset=${offset}&limit=${limit}`, { withCredentials: true, }); } function* loadFollowers(action){ try { const result = yield call(loadFollowersAPI, action.data, action.offset); yield put({ type: LOAD_FOLLOWERS_SUCCESS, data: result.data, }); } catch (e){ console.error(e); yield put({ type: LOAD_FOLLOWERS_FAILURE, error: e, }); } } function* watchLoadFollowers(){ yield takeEvery(LOAD_FOLLOWERS_REQUEST, loadFollowers); } function removeFollowerAPI(userId){ return axios.delete(`/user/${userId}/followers`, { withCredentials: true, }); } function* removeFollower(action){ try { const result = yield call(removeFollowerAPI, action.data); yield put({ type: REMOVE_FOLLOWER_SUCCESS, data: result.data, }); } catch (e){ console.error(e); yield put({ type: REMOVE_FOLLOWER_FAILURE, error: e, }); } } function* watchRemoveFollower(){ yield takeEvery(REMOVE_FOLLOWER_REQUEST, removeFollower); } function editNicknameAPI(nickname){ return axios.patch(`/user/nickname`, {nickname}, { //전체 수정은 put, 부분 수정은 patch withCredentials: true, }); } function* editNickname(action){ try { const result = yield call(editNicknameAPI, action.data); yield put({ type: EDIT_NICKNAME_SUCCESS, data: result.data, }); } catch (e){ console.error(e); yield put({ type: EDIT_NICKNAME_FAILURE, error: e, }); } } function* watchEditNickname(){ yield takeEvery(EDIT_NICKNAME_REQUEST, editNickname); } export default function* userSaga(){ yield all([ fork(watchLogIn), fork(watchLogOut), fork(watchLoadUser), fork(watchSignUp), fork(watchFollow), fork(watchUnfollow), fork(watchLoadFollowings), fork(watchLoadFollowers), fork(watchRemoveFollower), fork(watchEditNickname), ]); }
/** * @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md or http://ckeditor.com/license */ ( function() { function noBlockLeft( bqBlock ) { for ( var i = 0, length = bqBlock.getChildCount(), child; i < length && ( child = bqBlock.getChild( i ) ); i++ ) { if ( child.type == CKEDITOR.NODE_ELEMENT && child.isBlockBoundary() ) return false; } return true; } var commandObject = { exec: function( editor ) { var state = editor.getCommand( 'blockquote' ).state, selection = editor.getSelection(), range = selection && selection.getRanges()[ 0 ]; if ( !range ) return; var bookmarks = selection.createBookmarks(); // Kludge for #1592: if the bookmark nodes are in the beginning of // blockquote, then move them to the nearest block element in the // blockquote. if ( CKEDITOR.env.ie ) { var bookmarkStart = bookmarks[ 0 ].startNode, bookmarkEnd = bookmarks[ 0 ].endNode, cursor; if ( bookmarkStart && bookmarkStart.getParent().getName() == 'blockquote' ) { cursor = bookmarkStart; while ( ( cursor = cursor.getNext() ) ) { if ( cursor.type == CKEDITOR.NODE_ELEMENT && cursor.isBlockBoundary() ) { bookmarkStart.move( cursor, true ); break; } } } if ( bookmarkEnd && bookmarkEnd.getParent().getName() == 'blockquote' ) { cursor = bookmarkEnd; while ( ( cursor = cursor.getPrevious() ) ) { if ( cursor.type == CKEDITOR.NODE_ELEMENT && cursor.isBlockBoundary() ) { bookmarkEnd.move( cursor ); break; } } } } var iterator = range.createIterator(), block; iterator.enlargeBr = editor.config.enterMode != CKEDITOR.ENTER_BR; if ( state == CKEDITOR.TRISTATE_OFF ) { var paragraphs = []; while ( ( block = iterator.getNextParagraph() ) ) paragraphs.push( block ); // If no paragraphs, create one from the current selection position. if ( paragraphs.length < 1 ) { var para = editor.document.createElement( editor.config.enterMode == CKEDITOR.ENTER_P ? 'p' : 'div' ), firstBookmark = bookmarks.shift(); range.insertNode( para ); para.append( new CKEDITOR.dom.text( '\ufeff', editor.document ) ); range.moveToBookmark( firstBookmark ); range.selectNodeContents( para ); range.collapse( true ); firstBookmark = range.createBookmark(); paragraphs.push( para ); bookmarks.unshift( firstBookmark ); } // Make sure all paragraphs have the same parent. var commonParent = paragraphs[ 0 ].getParent(), tmp = []; for ( var i = 0; i < paragraphs.length; i++ ) { block = paragraphs[ i ]; commonParent = commonParent.getCommonAncestor( block.getParent() ); } // The common parent must not be the following tags: table, tbody, tr, ol, ul. var denyTags = { table: 1, tbody: 1, tr: 1, ol: 1, ul: 1 }; while ( denyTags[ commonParent.getName() ] ) commonParent = commonParent.getParent(); // Reconstruct the block list to be processed such that all resulting blocks // satisfy parentNode.equals( commonParent ). var lastBlock = null; while ( paragraphs.length > 0 ) { block = paragraphs.shift(); while ( !block.getParent().equals( commonParent ) ) block = block.getParent(); if ( !block.equals( lastBlock ) ) tmp.push( block ); lastBlock = block; } // If any of the selected blocks is a blockquote, remove it to prevent // nested blockquotes. while ( tmp.length > 0 ) { block = tmp.shift(); if ( block.getName() == 'blockquote' ) { var docFrag = new CKEDITOR.dom.documentFragment( editor.document ); while ( block.getFirst() ) { docFrag.append( block.getFirst().remove() ); paragraphs.push( docFrag.getLast() ); } docFrag.replace( block ); } else paragraphs.push( block ); } // Now we have all the blocks to be included in a new blockquote node. var bqBlock = editor.document.createElement( 'blockquote' ); bqBlock.insertBefore( paragraphs[ 0 ] ); while ( paragraphs.length > 0 ) { block = paragraphs.shift(); bqBlock.append( block ); } } else if ( state == CKEDITOR.TRISTATE_ON ) { var moveOutNodes = [], database = {}; while ( ( block = iterator.getNextParagraph() ) ) { var bqParent = null, bqChild = null; while ( block.getParent() ) { if ( block.getParent().getName() == 'blockquote' ) { bqParent = block.getParent(); bqChild = block; break; } block = block.getParent(); } // Remember the blocks that were recorded down in the moveOutNodes array // to prevent duplicates. if ( bqParent && bqChild && !bqChild.getCustomData( 'blockquote_moveout' ) ) { moveOutNodes.push( bqChild ); CKEDITOR.dom.element.setMarker( database, bqChild, 'blockquote_moveout', true ); } } CKEDITOR.dom.element.clearAllMarkers( database ); var movedNodes = [], processedBlockquoteBlocks = []; database = {}; while ( moveOutNodes.length > 0 ) { var node = moveOutNodes.shift(); bqBlock = node.getParent(); // If the node is located at the beginning or the end, just take it out // without splitting. Otherwise, split the blockquote node and move the // paragraph in between the two blockquote nodes. if ( !node.getPrevious() ) node.remove().insertBefore( bqBlock ); else if ( !node.getNext() ) node.remove().insertAfter( bqBlock ); else { node.breakParent( node.getParent() ); processedBlockquoteBlocks.push( node.getNext() ); } // Remember the blockquote node so we can clear it later (if it becomes empty). if ( !bqBlock.getCustomData( 'blockquote_processed' ) ) { processedBlockquoteBlocks.push( bqBlock ); CKEDITOR.dom.element.setMarker( database, bqBlock, 'blockquote_processed', true ); } movedNodes.push( node ); } CKEDITOR.dom.element.clearAllMarkers( database ); // Clear blockquote nodes that have become empty. for ( i = processedBlockquoteBlocks.length - 1; i >= 0; i-- ) { bqBlock = processedBlockquoteBlocks[ i ]; if ( noBlockLeft( bqBlock ) ) bqBlock.remove(); } if ( editor.config.enterMode == CKEDITOR.ENTER_BR ) { var firstTime = true; while ( movedNodes.length ) { node = movedNodes.shift(); if ( node.getName() == 'div' ) { docFrag = new CKEDITOR.dom.documentFragment( editor.document ); var needBeginBr = firstTime && node.getPrevious() && !( node.getPrevious().type == CKEDITOR.NODE_ELEMENT && node.getPrevious().isBlockBoundary() ); if ( needBeginBr ) docFrag.append( editor.document.createElement( 'br' ) ); var needEndBr = node.getNext() && !( node.getNext().type == CKEDITOR.NODE_ELEMENT && node.getNext().isBlockBoundary() ); while ( node.getFirst() ) node.getFirst().remove().appendTo( docFrag ); if ( needEndBr ) docFrag.append( editor.document.createElement( 'br' ) ); docFrag.replace( node ); firstTime = false; } } } } selection.selectBookmarks( bookmarks ); editor.focus(); }, refresh: function( editor, path ) { // Check if inside of blockquote. var firstBlock = path.block || path.blockLimit; this.setState( editor.elementPath( firstBlock ).contains( 'blockquote', 1 ) ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF ); }, context: 'blockquote', allowedContent: 'blockquote', requiredContent: 'blockquote' }; CKEDITOR.plugins.add( 'blockquote', { lang: 'af,ar,bg,bn,bs,ca,cs,cy,da,de,el,en,en-au,en-ca,en-gb,eo,es,et,eu,fa,fi,fo,fr,fr-ca,gl,gu,he,hi,hr,hu,id,is,it,ja,ka,km,ko,ku,lt,lv,mk,mn,ms,nb,nl,no,pl,pt,pt-br,ro,ru,si,sk,sl,sq,sr,sr-latn,sv,th,tr,tt,ug,uk,vi,zh,zh-cn', // %REMOVE_LINE_CORE% icons: 'blockquote', // %REMOVE_LINE_CORE% hidpi: true, // %REMOVE_LINE_CORE% init: function( editor ) { if ( editor.blockless ) return; editor.addCommand( 'blockquote', commandObject ); editor.ui.addButton && editor.ui.addButton( 'Blockquote', { label: editor.lang.blockquote.toolbar, command: 'blockquote', toolbar: 'blocks,10' } ); } } ); } )();
// COPYRIGHT © 201 Esri // // All rights reserved under the copyright laws of the United States // and applicable international laws, treaties, and conventions. // // This material is licensed for use under the Esri Master License // Agreement (MLA), and is bound by the terms of that agreement. // You may redistribute and use this code without modification, // provided you adhere to the terms of the MLA and include this // copyright notice. // // See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english // // For additional information, contact: // Environmental Systems Research Institute, Inc. // Attn: Contracts and Legal Services Department // 380 New York Street // Redlands, California, USA 92373 // USA // // email: contracts@esri.com // // See http://js.arcgis.com/3.31/esri/copyright.txt for details. define(["dojo/dom-geometry","../../../ReportPlayer","esri/dijit/geoenrichment/utils/ColorUtil","esri/dijit/geoenrichment/utils/DomUtil"],function(e,n,r,o){var t={};return t.getElementPageInfo=function(n){function o(n,r){var o=e.position(n.domNode),t=e.position(r.domNode);P.x+=o.x-t.x,P.y+=o.y-t.y}function i(e){if(!f){var n=e.getFullStyle().backgroundColor;n&&!r.isTransparent(n)&&(f=n)}}function a(e){if(e){e.parentGridCell&&i(e.parentGridCell);var r=e.parentWidget;if(!r)return void(e.parentElementInPageInfo&&(d=e.parentElementInPageInfo.reportContainer,f=f||e.parentElementInPageInfo.panelBackgroundColor,P.x+=e.parentElementInPageInfo.pos.x,P.y+=e.parentElementInPageInfo.pos.y));if(r&&r.isReportContainerGrid){d=r;var c=t.getNodePositionOnPage(d,e.domNode);if(c){P.x+=c.x,P.y+=c.y,l=c.pageGrid,g=c.gridContainer,p=c.pageIndex;var I=t.getNodePositionOnPage(d,n.domNode);u=I.layoutCell,s=I.isBackgroundFloatingPanel,m=I.isForegroundFloatingPanel,C=I.panelIndex}}else o(e,r),a(r)}}if(n&&(n.parentWidget||n.parentGrid)){var d,l,g,p,u,f,s,m,C,P={x:0,y:0};return n.parentGrid&&n.rowId&&n.columnId?(i(n),o(n,n.parentGrid),a(n.parentGrid)):a(n),d?{reportContainer:d,documentOptions:d.documentOptions,pos:P,zoom:d.getZoomInfo().scale,pageGrid:l,gridContainer:g,pageIndex:p,layoutCell:u,panelBackgroundColor:f,isFloatingPanel:s||m,isBackgroundFloatingPanel:s,isForegroundFloatingPanel:m,panelIndex:C}:null}},t.getReportContainerPageNode=function(e){for(;e;){if(e.reportContainerPageNode)return e.reportContainerPageNode;e=e.parentWidget||e.parentGrid}return null},t.getParentReportContainerGrid=function(e){if(e&&e.isReportContainerGrid)return e;for(;e;){if(e.parentWidget&&e.parentWidget.isReportContainerGrid)return e.parentWidget;if(e.parentElementInPageInfo)return e.parentElementInPageInfo.reportContainer;e=e.parentWidget||e.parentGrid}return null},t.getParentReportPlayer=function(e){if(e instanceof n)return e;for(;e;){if(e.parentWidget instanceof n)return e.parentWidget;e=e.parentWidget||e.parentGrid}return null},t.getNodePositionOnPage=function(n,r){if(!r)return null;var t,i,a,d,l,g=-1;if(n.getGrids().some(function(e,n){if(e.domNode===r||o.isChildOf(r,e.domNode))return t=e,i=n,e.getFieldCells().some(function(e,n){if(e.domNode===r||o.isChildOf(r,e.domNode))return g=n,l=e,!0}),-1===g&&e.getBackgroundFloatingCells().some(function(e,n){if(e.domNode===r||o.isChildOf(r,e.domNode))return g=n,a=!0,l=e,!0}),-1===g&&e.getForegroundFloatingCells().some(function(e,n){if(e.domNode===r||o.isChildOf(r,e.domNode))return g=n,d=!0,l=e,!0}),!0}),!t)return null;var p=n.getGridContainer(t),u=e.position(p),f=e.position(r);return{x:f.x-u.x,y:f.y-u.y,pageGrid:t,gridContainer:p,pageIndex:i,layoutCell:l,isFloatingPanel:a||d,isBackgroundFloatingPanel:a,isForegroundFloatingPanel:d,panelIndex:g}},t});
import * as React from 'react'; import PropTypes from 'prop-types'; import NextLink from 'next/link'; import Button from '@mui/material/Button'; import Divider from '@mui/material/Divider'; import { styled, alpha } from '@mui/material/styles'; import List from '@mui/material/List'; import Drawer from '@mui/material/Drawer'; import Menu from '@mui/material/Menu'; import MenuItem from '@mui/material/MenuItem'; import SwipeableDrawer from '@mui/material/SwipeableDrawer'; import useMediaQuery from '@mui/material/useMediaQuery'; import Box from '@mui/material/Box'; import { unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils'; import SvgMuiLogo from 'docs/src/icons/SvgMuiLogo'; import DiamondSponsors from 'docs/src/modules/components/DiamondSponsors'; import AppNavDrawerItem from 'docs/src/modules/components/AppNavDrawerItem'; import { pageToTitleI18n } from 'docs/src/modules/utils/helpers'; import PageContext from 'docs/src/modules/components/PageContext'; import { useUserLanguage, useTranslate } from 'docs/src/modules/utils/i18n'; import ArrowDropDownRoundedIcon from '@mui/icons-material/ArrowDropDownRounded'; import DoneRounded from '@mui/icons-material/DoneRounded'; const savedScrollTop = {}; function PersistScroll(props) { const { slot, children, enabled } = props; const rootRef = React.useRef(); useEnhancedEffect(() => { const parent = rootRef.current ? rootRef.current.parentElement : null; const activeElement = parent.querySelector('.app-drawer-active'); if (!enabled || !parent || !activeElement || !activeElement.scrollIntoView) { return undefined; } parent.scrollTop = savedScrollTop[slot]; const activeBox = activeElement.getBoundingClientRect(); if (activeBox.top < 0 || activeBox.top > window.innerHeight) { parent.scrollTop += activeBox.top - 8 - 32; } return () => { savedScrollTop[slot] = parent.scrollTop; }; }, [enabled, slot]); return <div ref={rootRef}>{children}</div>; } PersistScroll.propTypes = { children: PropTypes.node.isRequired, enabled: PropTypes.bool.isRequired, slot: PropTypes.string.isRequired, }; // https://github.com/philipwalton/flexbugs#3-min-height-on-a-flex-container-wont-apply-to-its-flex-items const ToolbarIE11 = styled('div')({ display: 'flex' }); const ToolbarDiv = styled('div')(({ theme }) => { return { paddingTop: theme.spacing(1.6), paddingBottom: theme.spacing(1.6), paddingLeft: theme.spacing(3), display: 'flex', flexGrow: 1, flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', }; }); const StyledDrawer = styled(Drawer)(({ theme }) => { return { [theme.breakpoints.up('xs')]: { display: 'none', }, [theme.breakpoints.up('lg')]: { display: 'block', }, }; }); const SwipeableDrawerPaperComponent = styled('div')({ width: 250, boxShadow: 'none', }); function renderNavItems(options) { const { pages, ...params } = options; return ( <List disablePadding> {pages.reduce( // eslint-disable-next-line @typescript-eslint/no-use-before-define (items, page) => reduceChildRoutes({ items, page, ...params }), [], )} </List> ); } /** * @param {object} context * @param {import('docs/src/pages').MuiPage} context.page */ function reduceChildRoutes(context) { const { onClose, activePage, items, depth, t } = context; let { page } = context; if (page.ordered === false) { return items; } if (page.children && page.children.length > 1) { const title = pageToTitleI18n(page, t); const topLevel = activePage ? activePage.pathname.indexOf(`${page.pathname}/`) === 0 : false; items.push( <AppNavDrawerItem linkProps={page.linkProps} depth={depth} key={title} topLevel={topLevel && !page.subheader} openImmediately={topLevel || Boolean(page.subheader)} title={title} icon={page.icon} > {renderNavItems({ onClose, pages: page.children, activePage, depth: depth + 1, t })} </AppNavDrawerItem>, ); } else { const title = pageToTitleI18n(page, t); page = page.children && page.children.length === 1 ? page.children[0] : page; items.push( <AppNavDrawerItem linkProps={page.linkProps} depth={depth} key={title} title={title} href={page.pathname} onClick={onClose} icon={page.icon} />, ); } return items; } // iOS is hosted on high-end devices. We can enable the backdrop transition without // dropping frames. The performance will be good enough. // So: <SwipeableDrawer disableBackdropTransition={false} /> const iOS = typeof navigator !== 'undefined' && /iPad|iPhone|iPod/.test(navigator.userAgent); function AppNavDrawer(props) { const { className, disablePermanent, mobileOpen, onClose, onOpen } = props; const { activePage, pages } = React.useContext(PageContext); const [anchorEl, setAnchorEl] = React.useState(null); const userLanguage = useUserLanguage(); const languagePrefix = userLanguage === 'en' ? '' : `/${userLanguage}`; const t = useTranslate(); const mobile = useMediaQuery((theme) => theme.breakpoints.down('lg')); const drawer = React.useMemo(() => { const navItems = renderNavItems({ onClose, pages, activePage, depth: 0, t }); return ( <React.Fragment> <ToolbarIE11> <ToolbarDiv> <NextLink href="/" passHref onClick={onClose}> <Box component="a" aria-label={t('goToHome')} sx={{ lineHeight: 0, mr: 2 }}> <SvgMuiLogo width={30} /> </Box> </NextLink> {process.env.LIB_VERSION ? ( <React.Fragment> <Button onClick={(event) => { setAnchorEl(event.currentTarget); }} size="small" variant="outlined" endIcon={<ArrowDropDownRoundedIcon fontSize="small" />} sx={{ border: (theme) => `1px solid ${ theme.palette.mode === 'dark' ? theme.palette.primaryDark[700] : theme.palette.grey[200] }`, color: (theme) => theme.palette.mode === 'dark' ? theme.palette.primary[300] : theme.palette.primary[500], mr: 2, '&:hover': { borderColor: (theme) => theme.palette.mode === 'dark' ? theme.palette.primaryDark[600] : theme.palette.grey[300], background: (theme) => theme.palette.mode === 'dark' ? alpha(theme.palette.primaryDark[700], 0.4) : theme.palette.grey[50], }, }} > {/* eslint-disable-next-line material-ui/no-hardcoded-labels -- version string is untranslatable */} {`v${process.env.LIB_VERSION}`} </Button> <Menu anchorEl={anchorEl} open={Boolean(anchorEl)} onClose={() => setAnchorEl(null)} PaperProps={{ variant: 'outlined', elevation: 0, sx: { mt: 0.5, minWidth: 180, backgroundImage: 'none', borderColor: (theme) => theme.palette.mode === 'dark' ? 'primaryDark.700' : 'grey.200', bgcolor: (theme) => theme.palette.mode === 'dark' ? 'primaryDark.900' : 'background.paper', boxShadow: (theme) => `0px 4px 20px ${ theme.palette.mode === 'dark' ? 'rgba(0, 0, 0, 0.5)' : 'rgba(170, 180, 190, 0.3)' }`, '& .MuiMenuItem-root': { fontSize: (theme) => theme.typography.pxToRem(14), fontWeight: 500, '&:hover': { color: (theme) => theme.palette.mode === 'dark' ? '#fff' : theme.palette.common.black, backgroundColor: (theme) => theme.palette.mode === 'dark' ? alpha(theme.palette.primaryDark[700], 0.4) : theme.palette.grey[50], }, '&:focus': { backgroundColor: (theme) => theme.palette.mode === 'dark' ? alpha(theme.palette.primaryDark[700], 0.4) : theme.palette.grey[50], }, '&.Mui-selected': { fontWeight: 500, color: (theme) => theme.palette.mode === 'dark' ? theme.palette.primary[300] : theme.palette.primary[600], backgroundColor: (theme) => theme.palette.mode === 'dark' ? theme.palette.primaryDark[700] : alpha(theme.palette.primary[100], 0.6), }, }, }, }} > <MenuItem selected onClick={() => setAnchorEl(null)}> {/* eslint-disable-next-line material-ui/no-hardcoded-labels -- version string is untranslatable */} {`v${process.env.LIB_VERSION}`} <DoneRounded sx={{ fontSize: 16, ml: 0.25 }} /> </MenuItem> <MenuItem component="a" href={`https://v4.mui.com${languagePrefix}/`} onClick={onClose} > {/* eslint-disable-next-line material-ui/no-hardcoded-labels -- version string is untranslatable */} {`v4`} </MenuItem> <Divider /> <MenuItem component="a" href={`https://mui.com${languagePrefix}/versions/`} onClick={onClose} > {/* eslint-disable-next-line material-ui/no-hardcoded-labels -- version string is untranslatable */} {`View all versions`} </MenuItem> </Menu> </React.Fragment> ) : null} </ToolbarDiv> </ToolbarIE11> <Divider sx={{ borderColor: (theme) => theme.palette.mode === 'dark' ? alpha(theme.palette.primary[100], 0.08) : theme.palette.grey[100], }} /> <DiamondSponsors spot="drawer" /> {navItems} <Box sx={{ height: 40 }} /> </React.Fragment> ); }, [activePage, pages, onClose, languagePrefix, t, anchorEl, setAnchorEl]); return ( <nav className={className} aria-label={t('mainNavigation')}> {disablePermanent || mobile ? ( <SwipeableDrawer disableBackdropTransition={!iOS} variant="temporary" open={mobileOpen} onOpen={onOpen} onClose={onClose} ModalProps={{ keepMounted: true, }} PaperProps={{ className: 'algolia-drawer', component: SwipeableDrawerPaperComponent, sx: { background: (theme) => theme.palette.mode === 'dark' ? theme.palette.primaryDark[900] : '#FFF', }, }} > <PersistScroll slot="swipeable" enabled={mobileOpen}> {drawer} </PersistScroll> </SwipeableDrawer> ) : null} {disablePermanent || mobile ? null : ( <StyledDrawer variant="permanent" PaperProps={{ component: SwipeableDrawerPaperComponent, sx: { background: (theme) => theme.palette.mode === 'dark' ? theme.palette.primaryDark[900] : '#fff', borderColor: (theme) => theme.palette.mode === 'dark' ? alpha(theme.palette.primary[100], 0.08) : theme.palette.grey[100], }, }} open > <PersistScroll slot="side" enabled> {drawer} </PersistScroll> </StyledDrawer> )} </nav> ); } AppNavDrawer.propTypes = { className: PropTypes.string, disablePermanent: PropTypes.bool.isRequired, mobileOpen: PropTypes.bool.isRequired, onClose: PropTypes.func.isRequired, onOpen: PropTypes.func.isRequired, }; export default AppNavDrawer;
import { hapticSelectionChanged } from '../../utils'; import { clamp } from '../../utils/helpers'; import { createThemedClasses } from '../../utils/theme'; /** @hidden */ export class PickerColumnCmp { constructor() { this.optHeight = 0; this.pos = []; this.rotateFactor = 0; this.scaleFactor = 1; this.velocity = 0; this.y = 0; } componentWillLoad() { let pickerRotateFactor = 0; let pickerScaleFactor = 0.81; if (this.mode === 'ios') { pickerRotateFactor = -0.46; pickerScaleFactor = 1; } this.rotateFactor = pickerRotateFactor; this.scaleFactor = pickerScaleFactor; } componentDidLoad() { // get the scrollable element within the column const colEl = this.el.querySelector('.picker-opts'); // get the height of one option this.optHeight = (colEl.firstElementChild ? colEl.firstElementChild.clientHeight : 0); this.refresh(); } optClick(ev, index) { if (!this.velocity) { ev.preventDefault(); ev.stopPropagation(); this.setSelected(index, 150); } } setSelected(selectedIndex, duration) { // if there is a selected index, then figure out it's y position // if there isn't a selected index, then just use the top y position const y = (selectedIndex > -1) ? ((selectedIndex * this.optHeight) * -1) : 0; this.velocity = 0; // set what y position we're at this.update(y, duration, true, true); } update(y, duration, saveY, emitChange) { // ensure we've got a good round number :) y = Math.round(y); let i; let button; let opt; let optOffset; let visible; let translateY = 0; let translateZ = 0; let rotateX; let transform; let selected; const parent = this.el.querySelector('.picker-opts'); const children = parent.children; const length = children.length; const selectedIndex = this.col.selectedIndex = Math.min(Math.max(Math.round(-y / this.optHeight), 0), length - 1); const durationStr = (duration === 0) ? null : duration + 'ms'; const scaleStr = `scale(${this.scaleFactor})`; for (i = 0; i < length; i++) { button = children[i]; opt = this.col.options[i]; optOffset = (i * this.optHeight) + y; visible = true; transform = ''; if (this.rotateFactor !== 0) { rotateX = optOffset * this.rotateFactor; if (Math.abs(rotateX) > 90) { visible = false; } else { translateY = 0; translateZ = 90; transform = `rotateX(${rotateX}deg) `; } } else { translateZ = 0; translateY = optOffset; if (Math.abs(translateY) > 170) { visible = false; } } selected = selectedIndex === i; if (visible) { transform += `translate3d(0px,${translateY}px,${translateZ}px) `; if (this.scaleFactor !== 1 && !selected) { transform += scaleStr; } } else { transform = 'translate3d(-9999px,0px,0px)'; } // Update transition duration if (duration !== opt.duration) { opt.duration = duration; button.style.transitionDuration = durationStr; } // Update transform if (transform !== opt.transform) { opt.transform = transform; button.style.transform = transform; } // Update selected item if (selected !== opt.selected) { opt.selected = selected; if (selected) { button.classList.add(PICKER_OPT_SELECTED); } else { button.classList.remove(PICKER_OPT_SELECTED); } } } this.col.prevSelected = selectedIndex; if (saveY) { this.y = y; } if (emitChange) { if (this.lastIndex === undefined) { // have not set a last index yet this.lastIndex = this.col.selectedIndex; } else if (this.lastIndex !== this.col.selectedIndex) { // new selected index has changed from the last index // update the lastIndex and emit that it has changed this.lastIndex = this.col.selectedIndex; // TODO ionChange event // var ionChange = this.ionChange; // if (ionChange.observers.length > 0) { // this._zone.run(ionChange.emit.bind(ionChange, this.col.options[this.col.selectedIndex])); // } } } } decelerate() { let y = 0; if (isNaN(this.y) || !this.optHeight) { // fallback in case numbers get outta wack this.update(y, 0, true, true); } else if (Math.abs(this.velocity) > 0) { // still decelerating this.velocity *= DECELERATION_FRICTION; // do not let it go slower than a velocity of 1 this.velocity = (this.velocity > 0) ? Math.max(this.velocity, 1) : Math.min(this.velocity, -1); y = Math.round(this.y - this.velocity); if (y > this.minY) { // whoops, it's trying to scroll up farther than the options we have! y = this.minY; this.velocity = 0; } else if (y < this.maxY) { // gahh, it's trying to scroll down farther than we can! y = this.maxY; this.velocity = 0; } const notLockedIn = (y % this.optHeight !== 0 || Math.abs(this.velocity) > 1); this.update(y, 0, true, !notLockedIn); if (notLockedIn) { // isn't locked in yet, keep decelerating until it is this.queue.read(() => this.decelerate()); } } else if (this.y % this.optHeight !== 0) { // needs to still get locked into a position so options line up const currentPos = Math.abs(this.y % this.optHeight); // create a velocity in the direction it needs to scroll this.velocity = (currentPos > (this.optHeight / 2) ? 1 : -1); this.decelerate(); } const currentIndex = Math.max(Math.abs(Math.round(y / this.optHeight)), 0); if (currentIndex !== this.lastTempIndex) { // Trigger a haptic event for physical feedback that the index has changed hapticSelectionChanged(); } this.lastTempIndex = currentIndex; } // TODO should this check disabled? canStart() { return true; } onDragStart(detail) { console.debug('picker, onDragStart', detail, this.startY); // We have to prevent default in order to block scrolling under the picker // but we DO NOT have to stop propagation, since we still want // some "click" events to capture if (detail.event) { detail.event.preventDefault(); detail.event.stopPropagation(); } // remember where the pointer started from this.startY = detail.startY; // reset everything this.velocity = 0; this.pos.length = 0; this.pos.push(this.startY, Date.now()); const options = this.col.options; let minY = (options.length - 1); let maxY = 0; for (let i = 0; i < options.length; i++) { if (!options[i].disabled) { minY = Math.min(minY, i); maxY = Math.max(maxY, i); } } this.minY = (minY * this.optHeight * -1); this.maxY = (maxY * this.optHeight * -1); return true; } onDragMove(detail) { if (detail.event) { detail.event.preventDefault(); detail.event.stopPropagation(); } const currentY = detail.currentY; this.pos.push(currentY, Date.now()); if (this.startY === undefined) { return; } // update the scroll position relative to pointer start position let y = this.y + (currentY - this.startY); if (y > this.minY) { // scrolling up higher than scroll area y = Math.pow(y, 0.8); this.bounceFrom = y; } else if (y < this.maxY) { // scrolling down below scroll area y += Math.pow(this.maxY - y, 0.9); this.bounceFrom = y; } else { this.bounceFrom = 0; } this.update(y, 0, false, false); const currentIndex = Math.max(Math.abs(Math.round(y / this.optHeight)), 0); if (currentIndex !== this.lastTempIndex) { this.lastTempIndex = currentIndex; } } onDragEnd(detail) { if (this.startY === undefined) { return; } console.debug('picker, onDragEnd', detail); this.velocity = 0; if (this.bounceFrom > 0) { // bounce back up this.update(this.minY, 100, true, true); return; } else if (this.bounceFrom < 0) { // bounce back down this.update(this.maxY, 100, true, true); return; } const endY = detail.currentY; this.pos.push(endY, Date.now()); const endPos = (this.pos.length - 1); let startPos = endPos; const timeRange = (Date.now() - 100); // move pointer to position measured 100ms ago for (let i = endPos; i > 0 && this.pos[i] > timeRange; i -= 2) { startPos = i; } if (startPos !== endPos) { // compute relative movement between these two points const timeOffset = (this.pos[endPos] - this.pos[startPos]); const movedTop = (this.pos[startPos - 1] - this.pos[endPos - 1]); // based on XXms compute the movement to apply for each render step const velocity = ((movedTop / timeOffset) * FRAME_MS); this.velocity = clamp(-MAX_PICKER_SPEED, velocity, MAX_PICKER_SPEED); } if (Math.abs(endY - this.startY) > 3) { const y = this.y + (endY - this.startY); this.update(y, 0, true, true); } this.startY = undefined; this.decelerate(); } refresh() { let min = this.col.options.length - 1; let max = 0; const options = this.col.options; for (let i = 0; i < options.length; i++) { if (!options[i].disabled) { min = Math.min(min, i); max = Math.max(max, i); } } const selectedIndex = clamp(min, this.col.selectedIndex, max); if (this.col.prevSelected !== selectedIndex) { const y = (selectedIndex * this.optHeight) * -1; this.velocity = 0; this.update(y, 150, true, false); } } hostData() { return { class: Object.assign({}, createThemedClasses(this.mode, 'picker-col'), { 'picker-opts-left': this.col.align === 'left', 'picker-opts-right': this.col.align === 'right' }), style: { 'max-width': this.col.columnWidth } }; } render() { const col = this.col; const options = col.options.map(o => { if (typeof o === 'string') { o = { text: o }; } return o; }) .filter(clientInformation => clientInformation !== null); const results = []; if (col.prefix) { results.push(h("div", { class: "picker-prefix", style: { width: col.prefixWidth } }, col.prefix)); } results.push(h("ion-gesture", { canStart: this.canStart.bind(this), onStart: this.onDragStart.bind(this), onMove: this.onDragMove.bind(this), onEnd: this.onDragEnd.bind(this), gestureName: "picker-swipe", gesturePriority: 10, direction: "y", passive: false, threshold: 0, attachTo: "parent" }), h("div", { class: "picker-opts", style: { maxWidth: col.optionsWidth } }, options.map((o, index) => h("button", { class: { 'picker-opt': true, 'picker-opt-disabled': !!o.disabled }, "disable-activated": true, onClick: (event) => this.optClick(event, index) }, o.text)))); if (col.suffix) { results.push(h("div", { class: "picker-suffix", style: { width: col.suffixWidth } }, col.suffix)); } return results; } static get is() { return "ion-picker-column"; } static get properties() { return { "col": { "type": "Any", "attr": "col" }, "el": { "elementRef": true }, "queue": { "context": "queue" } }; } } export const PICKER_OPT_SELECTED = 'picker-opt-selected'; export const DECELERATION_FRICTION = 0.97; export const FRAME_MS = (1000 / 60); export const MAX_PICKER_SPEED = 60;
import Http from '../../utils/Http' import Transformer from '../../utils/Transformer' import * as articleActions from './store/actions' function transformRequest(parms) { return Transformer.send(parms) } function transformResponse(params) { return Transformer.fetch(params) } export function articleAddRequest(params) { return dispatch => ( new Promise((resolve, reject) => { Http.post('api/v1/articles', transformRequest(params)) .then(res => { dispatch(articleActions.add(transformResponse(res.data))) return resolve() }) .catch((err) => { const statusCode = err.response.status; const data = { error: null, statusCode, }; if (statusCode === 422) { const resetErrors = { errors: err.response.data, replace: false, searchStr: '', replaceStr: '', }; data.error = Transformer.resetValidationFields(resetErrors); } else if (statusCode === 401) { data.error = err.response.data.message; } return reject(data); }) }) ) } export function articleUpdateRequest(params) { return dispatch => ( new Promise((resolve, reject) => { Http.patch(`api/v1/articles/${params.id}`, transformRequest(params)) .then(res => { dispatch(articleActions.add(transformResponse(res.data))) return resolve() }) .catch((err) => { const statusCode = err.response.status; const data = { error: null, statusCode, }; if (statusCode === 422) { const resetErrors = { errors: err.response.data, replace: false, searchStr: '', replaceStr: '', }; data.error = Transformer.resetValidationFields(resetErrors); } else if (statusCode === 401) { data.error = err.response.data.message; } return reject(data); }) }) ) } export function articleRemoveRequest(id) { return dispatch => { Http.delete(`api/v1/articles/${id}`) .then(() => { dispatch(articleActions.remove(id)) }) .catch((err) => { // TODO: handle err console.error(err.response) }) } } export function articleListRequest(params) { let { pageNumber = 1, url = 'api/v1/articles' } = params return dispatch => { if (pageNumber > 1) { url = url + `?page=${pageNumber}` } Http.get(url) .then((res) => { dispatch(articleActions.list(transformResponse(res.data))) }) .catch((err) => { // TODO: handle err console.error(err.response) }) } } export function articleEditRequest(id) { return dispatch => { Http.get(`api/v1/articles/${id}`) .then((res) => { dispatch(articleActions.add(transformResponse(res.data))) }) .catch((err) => { // TODO: handle err console.error(err.response) }) } } export function articleFetchRequest(slug) { return dispatch => { Http.get(`api/v1/articles/published/${slug}`) .then((res) => { dispatch(articleActions.add(transformResponse(res.data))) }) .catch((err) => { // TODO: handle err console.error(err.response) }) } }
/** * Copyright 2015 Google Inc. 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 * * 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. */ /* jshint maxlen: false */ 'use strict'; var createAPIRequest = require('../../lib/apirequest'); var utils = require('../../lib/utils'); /** * Ad Exchange Buyer API II * * Accesses the latest features for managing Ad Exchange accounts, Real-Time Bidding configurations and auction metrics, and Marketplace programmatic deals. * * @example * var google = require('googleapis'); * var adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); * * @namespace adexchangebuyer2 * @type {Function} * @version v2beta1 * @variation v2beta1 * @param {object=} options Options for Adexchangebuyer2 */ function Adexchangebuyer2(options) { // eslint-disable-line var self = this; self._options = options || {}; self.accounts = { clients: { /** * adexchangebuyer2.accounts.clients.get * * @desc Gets a client buyer with a given client account ID. * * @alias adexchangebuyer2.accounts.clients.get * @memberOf! adexchangebuyer2(v2beta1) * * @param {object} params Parameters for request * @param {string} params.accountId Numerical account ID of the client's sponsor buyer. (required) * @param {string} params.clientAccountId Numerical account ID of the client buyer to retrieve. (required) * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. * @param {callback} callback The callback that handles the response. * @return {object} Request object */ get: function (params, options, callback) { if (typeof options === 'function') { callback = options; options = {}; } options || (options = {}); var parameters = { options: utils.extend({ url: 'https://adexchangebuyer.googleapis.com/v2beta1/accounts/{accountId}/clients/{clientAccountId}', method: 'GET' }, options), params: params, requiredParams: ['accountId', 'clientAccountId'], pathParams: ['accountId', 'clientAccountId'], context: self }; return createAPIRequest(parameters, callback); }, /** * adexchangebuyer2.accounts.clients.list * * @desc Lists all the clients for the current sponsor buyer. * * @alias adexchangebuyer2.accounts.clients.list * @memberOf! adexchangebuyer2(v2beta1) * * @param {object} params Parameters for request * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListClientsResponse.nextPageToken returned from the previous call to the accounts.clients.list method. * @param {string} params.accountId Unique numerical account ID of the sponsor buyer to list the clients for. * @param {integer=} params.pageSize Requested page size. The server may return fewer clients than requested. If unspecified, the server will pick an appropriate default. * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. * @param {callback} callback The callback that handles the response. * @return {object} Request object */ list: function (params, options, callback) { if (typeof options === 'function') { callback = options; options = {}; } options || (options = {}); var parameters = { options: utils.extend({ url: 'https://adexchangebuyer.googleapis.com/v2beta1/accounts/{accountId}/clients', method: 'GET' }, options), params: params, requiredParams: ['accountId'], pathParams: ['accountId'], context: self }; return createAPIRequest(parameters, callback); }, /** * adexchangebuyer2.accounts.clients.update * * @desc Updates an existing client buyer. * * @alias adexchangebuyer2.accounts.clients.update * @memberOf! adexchangebuyer2(v2beta1) * * @param {object} params Parameters for request * @param {string} params.accountId Unique numerical account ID for the buyer of which the client buyer is a customer; the sponsor buyer to update a client for. (required) * @param {string} params.clientAccountId Unique numerical account ID of the client to update. (required) * @param {adexchangebuyer2(v2beta1).Client} params.resource Request body data * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. * @param {callback} callback The callback that handles the response. * @return {object} Request object */ update: function (params, options, callback) { if (typeof options === 'function') { callback = options; options = {}; } options || (options = {}); var parameters = { options: utils.extend({ url: 'https://adexchangebuyer.googleapis.com/v2beta1/accounts/{accountId}/clients/{clientAccountId}', method: 'PUT' }, options), params: params, requiredParams: ['accountId', 'clientAccountId'], pathParams: ['accountId', 'clientAccountId'], context: self }; return createAPIRequest(parameters, callback); }, /** * adexchangebuyer2.accounts.clients.create * * @desc Creates a new client buyer. * * @alias adexchangebuyer2.accounts.clients.create * @memberOf! adexchangebuyer2(v2beta1) * * @param {object} params Parameters for request * @param {string} params.accountId Unique numerical account ID for the buyer of which the client buyer is a customer; the sponsor buyer to create a client for. (required) * @param {adexchangebuyer2(v2beta1).Client} params.resource Request body data * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. * @param {callback} callback The callback that handles the response. * @return {object} Request object */ create: function (params, options, callback) { if (typeof options === 'function') { callback = options; options = {}; } options || (options = {}); var parameters = { options: utils.extend({ url: 'https://adexchangebuyer.googleapis.com/v2beta1/accounts/{accountId}/clients', method: 'POST' }, options), params: params, requiredParams: ['accountId'], pathParams: ['accountId'], context: self }; return createAPIRequest(parameters, callback); }, invitations: { /** * adexchangebuyer2.accounts.clients.invitations.get * * @desc Retrieves an existing client user invitation. * * @alias adexchangebuyer2.accounts.clients.invitations.get * @memberOf! adexchangebuyer2(v2beta1) * * @param {object} params Parameters for request * @param {string} params.accountId Numerical account ID of the client's sponsor buyer. (required) * @param {string} params.clientAccountId Numerical account ID of the client buyer that the user invitation to be retrieved is associated with. (required) * @param {string} params.invitationId Numerical identifier of the user invitation to retrieve. (required) * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. * @param {callback} callback The callback that handles the response. * @return {object} Request object */ get: function (params, options, callback) { if (typeof options === 'function') { callback = options; options = {}; } options || (options = {}); var parameters = { options: utils.extend({ url: 'https://adexchangebuyer.googleapis.com/v2beta1/accounts/{accountId}/clients/{clientAccountId}/invitations/{invitationId}', method: 'GET' }, options), params: params, requiredParams: ['accountId', 'clientAccountId', 'invitationId'], pathParams: ['accountId', 'clientAccountId', 'invitationId'], context: self }; return createAPIRequest(parameters, callback); }, /** * adexchangebuyer2.accounts.clients.invitations.list * * @desc Lists all the client users invitations for a client with a given account ID. * * @alias adexchangebuyer2.accounts.clients.invitations.list * @memberOf! adexchangebuyer2(v2beta1) * * @param {object} params Parameters for request * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListClientUserInvitationsResponse.nextPageToken returned from the previous call to the clients.invitations.list method. * @param {string} params.accountId Numerical account ID of the client's sponsor buyer. (required) * @param {integer=} params.pageSize Requested page size. Server may return fewer clients than requested. If unspecified, server will pick an appropriate default. * @param {string} params.clientAccountId Numerical account ID of the client buyer to list invitations for. (required) You must either specify a string representation of a numerical account identifier or the `-` character to list all the invitations for all the clients of a given sponsor buyer. * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. * @param {callback} callback The callback that handles the response. * @return {object} Request object */ list: function (params, options, callback) { if (typeof options === 'function') { callback = options; options = {}; } options || (options = {}); var parameters = { options: utils.extend({ url: 'https://adexchangebuyer.googleapis.com/v2beta1/accounts/{accountId}/clients/{clientAccountId}/invitations', method: 'GET' }, options), params: params, requiredParams: ['accountId', 'clientAccountId'], pathParams: ['accountId', 'clientAccountId'], context: self }; return createAPIRequest(parameters, callback); }, /** * adexchangebuyer2.accounts.clients.invitations.create * * @desc Creates and sends out an email invitation to access an Ad Exchange client buyer account. * * @alias adexchangebuyer2.accounts.clients.invitations.create * @memberOf! adexchangebuyer2(v2beta1) * * @param {object} params Parameters for request * @param {string} params.accountId Numerical account ID of the client's sponsor buyer. (required) * @param {string} params.clientAccountId Numerical account ID of the client buyer that the user should be associated with. (required) * @param {adexchangebuyer2(v2beta1).ClientUserInvitation} params.resource Request body data * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. * @param {callback} callback The callback that handles the response. * @return {object} Request object */ create: function (params, options, callback) { if (typeof options === 'function') { callback = options; options = {}; } options || (options = {}); var parameters = { options: utils.extend({ url: 'https://adexchangebuyer.googleapis.com/v2beta1/accounts/{accountId}/clients/{clientAccountId}/invitations', method: 'POST' }, options), params: params, requiredParams: ['accountId', 'clientAccountId'], pathParams: ['accountId', 'clientAccountId'], context: self }; return createAPIRequest(parameters, callback); } }, users: { /** * adexchangebuyer2.accounts.clients.users.list * * @desc Lists all the known client users for a specified sponsor buyer account ID. * * @alias adexchangebuyer2.accounts.clients.users.list * @memberOf! adexchangebuyer2(v2beta1) * * @param {object} params Parameters for request * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListClientUsersResponse.nextPageToken returned from the previous call to the accounts.clients.users.list method. * @param {string} params.accountId Numerical account ID of the sponsor buyer of the client to list users for. (required) * @param {integer=} params.pageSize Requested page size. The server may return fewer clients than requested. If unspecified, the server will pick an appropriate default. * @param {string} params.clientAccountId The account ID of the client buyer to list users for. (required) You must specify either a string representation of a numerical account identifier or the `-` character to list all the client users for all the clients of a given sponsor buyer. * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. * @param {callback} callback The callback that handles the response. * @return {object} Request object */ list: function (params, options, callback) { if (typeof options === 'function') { callback = options; options = {}; } options || (options = {}); var parameters = { options: utils.extend({ url: 'https://adexchangebuyer.googleapis.com/v2beta1/accounts/{accountId}/clients/{clientAccountId}/users', method: 'GET' }, options), params: params, requiredParams: ['accountId', 'clientAccountId'], pathParams: ['accountId', 'clientAccountId'], context: self }; return createAPIRequest(parameters, callback); }, /** * adexchangebuyer2.accounts.clients.users.get * * @desc Retrieves an existing client user. * * @alias adexchangebuyer2.accounts.clients.users.get * @memberOf! adexchangebuyer2(v2beta1) * * @param {object} params Parameters for request * @param {string} params.userId Numerical identifier of the user to retrieve. (required) * @param {string} params.accountId Numerical account ID of the client's sponsor buyer. (required) * @param {string} params.clientAccountId Numerical account ID of the client buyer that the user to be retrieved is associated with. (required) * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. * @param {callback} callback The callback that handles the response. * @return {object} Request object */ get: function (params, options, callback) { if (typeof options === 'function') { callback = options; options = {}; } options || (options = {}); var parameters = { options: utils.extend({ url: 'https://adexchangebuyer.googleapis.com/v2beta1/accounts/{accountId}/clients/{clientAccountId}/users/{userId}', method: 'GET' }, options), params: params, requiredParams: ['accountId', 'clientAccountId', 'userId'], pathParams: ['userId', 'accountId', 'clientAccountId'], context: self }; return createAPIRequest(parameters, callback); }, /** * adexchangebuyer2.accounts.clients.users.update * * @desc Updates an existing client user. Only the user status can be changed on update. * * @alias adexchangebuyer2.accounts.clients.users.update * @memberOf! adexchangebuyer2(v2beta1) * * @param {object} params Parameters for request * @param {string} params.userId Numerical identifier of the user to retrieve. (required) * @param {string} params.accountId Numerical account ID of the client's sponsor buyer. (required) * @param {string} params.clientAccountId Numerical account ID of the client buyer that the user to be retrieved is associated with. (required) * @param {adexchangebuyer2(v2beta1).ClientUser} params.resource Request body data * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. * @param {callback} callback The callback that handles the response. * @return {object} Request object */ update: function (params, options, callback) { if (typeof options === 'function') { callback = options; options = {}; } options || (options = {}); var parameters = { options: utils.extend({ url: 'https://adexchangebuyer.googleapis.com/v2beta1/accounts/{accountId}/clients/{clientAccountId}/users/{userId}', method: 'PUT' }, options), params: params, requiredParams: ['accountId', 'clientAccountId', 'userId'], pathParams: ['userId', 'accountId', 'clientAccountId'], context: self }; return createAPIRequest(parameters, callback); } } }, creatives: { /** * adexchangebuyer2.accounts.creatives.list * * @desc Lists creatives. * * @alias adexchangebuyer2.accounts.creatives.list * @memberOf! adexchangebuyer2(v2beta1) * * @param {object} params Parameters for request * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListCreativesResponse.next_page_token returned from the previous call to 'ListCreatives' method. * @param {string} params.accountId The account to list the creatives from. Specify "-" to list all creatives the current user has access to. * @param {integer=} params.pageSize Requested page size. The server may return fewer creatives than requested (due to timeout constraint) even if more are available via another call. If unspecified, server will pick an appropriate default. Acceptable values are 1 to 1000, inclusive. * @param {string=} params.query An optional query string to filter creatives. If no filter is specified, all active creatives will be returned. Supported queries are: <ul> <li>accountId=<i>account_id_string</i> <li>creativeId=<i>creative_id_string</i> <li>dealsStatus: {approved, conditionally_approved, disapproved, not_checked} <li>openAuctionStatus: {approved, conditionally_approved, disapproved, not_checked} <li>attribute: {a numeric attribute from the list of attributes} <li>disapprovalReason: {a reason from DisapprovalReason </ul> Example: 'accountId=12345 AND (dealsStatus:disapproved AND disapprovalReason:unacceptable_content) OR attribute:47' * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. * @param {callback} callback The callback that handles the response. * @return {object} Request object */ list: function (params, options, callback) { if (typeof options === 'function') { callback = options; options = {}; } options || (options = {}); var parameters = { options: utils.extend({ url: 'https://adexchangebuyer.googleapis.com/v2beta1/accounts/{accountId}/creatives', method: 'GET' }, options), params: params, requiredParams: ['accountId'], pathParams: ['accountId'], context: self }; return createAPIRequest(parameters, callback); }, /** * adexchangebuyer2.accounts.creatives.create * * @desc Creates a creative. * * @alias adexchangebuyer2.accounts.creatives.create * @memberOf! adexchangebuyer2(v2beta1) * * @param {object} params Parameters for request * @param {string} params.accountId The account that this creative belongs to. Can be used to filter the response of the creatives.list method. * @param {string=} params.duplicateIdMode Indicates if multiple creatives can share an ID or not. Default is NO_DUPLICATES (one ID per creative). * @param {adexchangebuyer2(v2beta1).Creative} params.resource Request body data * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. * @param {callback} callback The callback that handles the response. * @return {object} Request object */ create: function (params, options, callback) { if (typeof options === 'function') { callback = options; options = {}; } options || (options = {}); var parameters = { options: utils.extend({ url: 'https://adexchangebuyer.googleapis.com/v2beta1/accounts/{accountId}/creatives', method: 'POST' }, options), params: params, requiredParams: ['accountId'], pathParams: ['accountId'], context: self }; return createAPIRequest(parameters, callback); }, /** * adexchangebuyer2.accounts.creatives.stopWatching * * @desc Stops watching a creative. Will stop push notifications being sent to the topics when the creative changes status. * * @alias adexchangebuyer2.accounts.creatives.stopWatching * @memberOf! adexchangebuyer2(v2beta1) * * @param {object} params Parameters for request * @param {string} params.accountId The account of the creative to stop notifications for. * @param {string} params.creativeId The creative ID of the creative to stop notifications for. Specify "-" to specify stopping account level notifications. * @param {adexchangebuyer2(v2beta1).StopWatchingCreativeRequest} params.resource Request body data * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. * @param {callback} callback The callback that handles the response. * @return {object} Request object */ stopWatching: function (params, options, callback) { if (typeof options === 'function') { callback = options; options = {}; } options || (options = {}); var parameters = { options: utils.extend({ url: 'https://adexchangebuyer.googleapis.com/v2beta1/accounts/{accountId}/creatives/{creativeId}:stopWatching', method: 'POST' }, options), params: params, requiredParams: ['accountId', 'creativeId'], pathParams: ['accountId', 'creativeId'], context: self }; return createAPIRequest(parameters, callback); }, /** * adexchangebuyer2.accounts.creatives.get * * @desc Gets a creative. * * @alias adexchangebuyer2.accounts.creatives.get * @memberOf! adexchangebuyer2(v2beta1) * * @param {object} params Parameters for request * @param {string} params.accountId The account the creative belongs to. * @param {string} params.creativeId The ID of the creative to retrieve. * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. * @param {callback} callback The callback that handles the response. * @return {object} Request object */ get: function (params, options, callback) { if (typeof options === 'function') { callback = options; options = {}; } options || (options = {}); var parameters = { options: utils.extend({ url: 'https://adexchangebuyer.googleapis.com/v2beta1/accounts/{accountId}/creatives/{creativeId}', method: 'GET' }, options), params: params, requiredParams: ['accountId', 'creativeId'], pathParams: ['accountId', 'creativeId'], context: self }; return createAPIRequest(parameters, callback); }, /** * adexchangebuyer2.accounts.creatives.watch * * @desc Watches a creative. Will result in push notifications being sent to the topic when the creative changes status. * * @alias adexchangebuyer2.accounts.creatives.watch * @memberOf! adexchangebuyer2(v2beta1) * * @param {object} params Parameters for request * @param {string} params.accountId The account of the creative to watch. * @param {string} params.creativeId The creative ID to watch for status changes. Specify "-" to watch all creatives under the above account. If both creative-level and account-level notifications are sent, only a single notification will be sent to the creative-level notification topic. * @param {adexchangebuyer2(v2beta1).WatchCreativeRequest} params.resource Request body data * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. * @param {callback} callback The callback that handles the response. * @return {object} Request object */ watch: function (params, options, callback) { if (typeof options === 'function') { callback = options; options = {}; } options || (options = {}); var parameters = { options: utils.extend({ url: 'https://adexchangebuyer.googleapis.com/v2beta1/accounts/{accountId}/creatives/{creativeId}:watch', method: 'POST' }, options), params: params, requiredParams: ['accountId', 'creativeId'], pathParams: ['accountId', 'creativeId'], context: self }; return createAPIRequest(parameters, callback); }, /** * adexchangebuyer2.accounts.creatives.update * * @desc Updates a creative. * * @alias adexchangebuyer2.accounts.creatives.update * @memberOf! adexchangebuyer2(v2beta1) * * @param {object} params Parameters for request * @param {string} params.creativeId The buyer-defined creative ID of this creative. Can be used to filter the response of the creatives.list method. * @param {string} params.accountId The account that this creative belongs to. Can be used to filter the response of the creatives.list method. * @param {adexchangebuyer2(v2beta1).Creative} params.resource Request body data * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. * @param {callback} callback The callback that handles the response. * @return {object} Request object */ update: function (params, options, callback) { if (typeof options === 'function') { callback = options; options = {}; } options || (options = {}); var parameters = { options: utils.extend({ url: 'https://adexchangebuyer.googleapis.com/v2beta1/accounts/{accountId}/creatives/{creativeId}', method: 'PUT' }, options), params: params, requiredParams: ['accountId', 'creativeId'], pathParams: ['creativeId', 'accountId'], context: self }; return createAPIRequest(parameters, callback); }, dealAssociations: { /** * adexchangebuyer2.accounts.creatives.dealAssociations.list * * @desc List all creative-deal associations. * * @alias adexchangebuyer2.accounts.creatives.dealAssociations.list * @memberOf! adexchangebuyer2(v2beta1) * * @param {object} params Parameters for request * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListDealAssociationsResponse.next_page_token returned from the previous call to 'ListDealAssociations' method. * @param {string} params.accountId The account to list the associations from. Specify "-" to list all creatives the current user has access to. * @param {integer=} params.pageSize Requested page size. Server may return fewer associations than requested. If unspecified, server will pick an appropriate default. * @param {string=} params.query An optional query string to filter deal associations. If no filter is specified, all associations will be returned. Supported queries are: <ul> <li>accountId=<i>account_id_string</i> <li>creativeId=<i>creative_id_string</i> <li>dealsId=<i>deals_id_string</i> <li>dealsStatus:{approved, conditionally_approved, disapproved, not_checked} <li>openAuctionStatus:{approved, conditionally_approved, disapproved, not_checked} </ul> Example: 'dealsId=12345 AND dealsStatus:disapproved' * @param {string} params.creativeId The creative ID to list the associations from. Specify "-" to list all creatives under the above account. * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. * @param {callback} callback The callback that handles the response. * @return {object} Request object */ list: function (params, options, callback) { if (typeof options === 'function') { callback = options; options = {}; } options || (options = {}); var parameters = { options: utils.extend({ url: 'https://adexchangebuyer.googleapis.com/v2beta1/accounts/{accountId}/creatives/{creativeId}/dealAssociations', method: 'GET' }, options), params: params, requiredParams: ['accountId', 'creativeId'], pathParams: ['accountId', 'creativeId'], context: self }; return createAPIRequest(parameters, callback); }, /** * adexchangebuyer2.accounts.creatives.dealAssociations.add * * @desc Associate an existing deal with a creative. * * @alias adexchangebuyer2.accounts.creatives.dealAssociations.add * @memberOf! adexchangebuyer2(v2beta1) * * @param {object} params Parameters for request * @param {string} params.accountId The account the creative belongs to. * @param {string} params.creativeId The ID of the creative associated with the deal. * @param {adexchangebuyer2(v2beta1).AddDealAssociationRequest} params.resource Request body data * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. * @param {callback} callback The callback that handles the response. * @return {object} Request object */ add: function (params, options, callback) { if (typeof options === 'function') { callback = options; options = {}; } options || (options = {}); var parameters = { options: utils.extend({ url: 'https://adexchangebuyer.googleapis.com/v2beta1/accounts/{accountId}/creatives/{creativeId}/dealAssociations:add', method: 'POST' }, options), params: params, requiredParams: ['accountId', 'creativeId'], pathParams: ['accountId', 'creativeId'], context: self }; return createAPIRequest(parameters, callback); }, /** * adexchangebuyer2.accounts.creatives.dealAssociations.remove * * @desc Remove the association between a deal and a creative. * * @alias adexchangebuyer2.accounts.creatives.dealAssociations.remove * @memberOf! adexchangebuyer2(v2beta1) * * @param {object} params Parameters for request * @param {string} params.accountId The account the creative belongs to. * @param {string} params.creativeId The ID of the creative associated with the deal. * @param {adexchangebuyer2(v2beta1).RemoveDealAssociationRequest} params.resource Request body data * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. * @param {callback} callback The callback that handles the response. * @return {object} Request object */ remove: function (params, options, callback) { if (typeof options === 'function') { callback = options; options = {}; } options || (options = {}); var parameters = { options: utils.extend({ url: 'https://adexchangebuyer.googleapis.com/v2beta1/accounts/{accountId}/creatives/{creativeId}/dealAssociations:remove', method: 'POST' }, options), params: params, requiredParams: ['accountId', 'creativeId'], pathParams: ['accountId', 'creativeId'], context: self }; return createAPIRequest(parameters, callback); } } } }; } /** * @typedef FilteringStats * @memberOf! adexchangebuyer2(v2beta1) * @type object * @property {adexchangebuyer2(v2beta1).Reason[]} reasons The set of filtering reasons for this date. * @property {adexchangebuyer2(v2beta1).Date} date The day during which the data was collected. The data is collected from 00:00:00 to 23:59:59 PT. During switches from PST to PDT and back, the day may contain 23 or 25 hours of data instead of the usual 24. */ /** * @typedef Creative * @memberOf! adexchangebuyer2(v2beta1) * @type object * @property {string} accountId The account that this creative belongs to. Can be used to filter the response of the creatives.list method. * @property {adexchangebuyer2(v2beta1).NativeContent} native A native creative. * @property {adexchangebuyer2(v2beta1).ServingRestriction[]} servingRestrictions @OutputOnly The granular status of this ad in specific contexts. A context here relates to where something ultimately serves (for example, a physical location, a platform, an HTTPS vs HTTP request, or the type of auction). * @property {adexchangebuyer2(v2beta1).VideoContent} video A video creative. * @property {string} agencyId The agency ID for this creative. * @property {string[]} clickThroughUrls The set of destination URLs for the creative. * @property {integer[]} detectedSensitiveCategories @OutputOnly Detected sensitive categories, if any. See the ad-sensitive-categories.txt file in the technical documentation for a list of IDs. You should use these IDs along with the excluded-sensitive-category field in the bid request to filter your bids. * @property {string} adChoicesDestinationUrl The link to AdChoices destination page. * @property {string[]} restrictedCategories All restricted categories for the ads that may be shown from this creative. * @property {adexchangebuyer2(v2beta1).Correction[]} corrections @OutputOnly Shows any corrections that were applied to this creative. * @property {integer} version @OutputOnly The version of this creative. * @property {integer[]} vendorIds All vendor IDs for the ads that may be shown from this creative. See https://storage.googleapis.com/adx-rtb-dictionaries/vendors.txt for possible values. * @property {string[]} impressionTrackingUrls The set of URLs to be called to record an impression. * @property {adexchangebuyer2(v2beta1).HtmlContent} html An HTML creative. * @property {integer[]} detectedProductCategories @OutputOnly Detected product categories, if any. See the ad-product-categories.txt file in the technical documentation for a list of IDs. * @property {string} dealsStatus @OutputOnly The top-level deals status of this creative. If disapproved, an entry for &#39;auctionType=DIRECT_DEALS&#39; (or &#39;ALL&#39;) in serving_restrictions will also exist. Note that this may be nuanced with other contextual restrictions, in which case, it may be preferable to read from serving_restrictions directly. Can be used to filter the response of the creatives.list method. * @property {string} openAuctionStatus @OutputOnly The top-level open auction status of this creative. If disapproved, an entry for &#39;auctionType = OPEN_AUCTION&#39; (or &#39;ALL&#39;) in serving_restrictions will also exist. Note that this may be nuanced with other contextual restrictions, in which case, it may be preferable to read from serving_restrictions directly. Can be used to filter the response of the creatives.list method. * @property {string} advertiserName The name of the company being advertised in the creative. * @property {string[]} detectedDomains @OutputOnly The detected domains for this creative. * @property {string[]} detectedAdvertiserIds @OutputOnly Detected advertiser IDs, if any. * @property {adexchangebuyer2(v2beta1).FilteringStats} filteringStats @OutputOnly The filtering stats for this creative. * @property {string[]} attributes All attributes for the ads that may be shown from this creative. Can be used to filter the response of the creatives.list method. * @property {string} apiUpdateTime @OutputOnly The last update timestamp of the creative via API. * @property {string[]} detectedLanguages @OutputOnly The detected languages for this creative. The order is arbitrary. The codes are 2 or 5 characters and are documented at https://developers.google.com/adwords/api/docs/appendix/languagecodes. * @property {string} creativeId The buyer-defined creative ID of this creative. Can be used to filter the response of the creatives.list method. */ /** * @typedef RemoveDealAssociationRequest * @memberOf! adexchangebuyer2(v2beta1) * @type object * @property {adexchangebuyer2(v2beta1).CreativeDealAssociation} association The association between a creative and a deal that should be removed. */ /** * @typedef Client * @memberOf! adexchangebuyer2(v2beta1) * @type object * @property {string} entityName The name of the entity. This field is automatically fetched based on the type and ID. The value of this field is ignored in create and update operations. * @property {string} status The status of the client buyer. * @property {string} entityType The type of the client entity: `ADVERTISER`, `BRAND`, or `AGENCY`. * @property {string} clientName Name used to represent this client to publishers. You may have multiple clients that map to the same entity, but for each client the combination of `clientName` and entity must be unique. You can specify this field as empty. * @property {string} role The role which is assigned to the client buyer. Each role implies a set of permissions granted to the client. Must be one of `CLIENT_DEAL_VIEWER`, `CLIENT_DEAL_NEGOTIATOR` or `CLIENT_DEAL_APPROVER`. * @property {boolean} visibleToSeller Whether the client buyer will be visible to sellers. * @property {string} entityId Numerical identifier of the client entity. The entity can be an advertiser, a brand, or an agency. This identifier is unique among all the entities with the same type. A list of all known advertisers with their identifiers is available in the [advertisers.txt](https://storage.googleapis.com/adx-rtb-dictionaries/advertisers.txt) file. A list of all known brands with their identifiers is available in the [brands.txt](https://storage.googleapis.com/adx-rtb-dictionaries/brands.txt) file. A list of all known agencies with their identifiers is available in the [agencies.txt](https://storage.googleapis.com/adx-rtb-dictionaries/agencies.txt) file. * @property {string} clientAccountId The globally-unique numerical ID of the client. The value of this field is ignored in create and update operations. */ /** * @typedef Correction * @memberOf! adexchangebuyer2(v2beta1) * @type object * @property {string[]} details Additional details about what was corrected. * @property {string} type The type of correction that was applied to the creative. * @property {adexchangebuyer2(v2beta1).ServingContext[]} contexts The contexts for the correction. */ /** * @typedef AddDealAssociationRequest * @memberOf! adexchangebuyer2(v2beta1) * @type object * @property {adexchangebuyer2(v2beta1).CreativeDealAssociation} association The association between a creative and a deal that should be added. */ /** * @typedef ListDealAssociationsResponse * @memberOf! adexchangebuyer2(v2beta1) * @type object * @property {adexchangebuyer2(v2beta1).CreativeDealAssociation[]} associations The list of associations. * @property {string} nextPageToken A token to retrieve the next page of results. Pass this value in the ListDealAssociationsRequest.page_token field in the subsequent call to &#39;ListDealAssociation&#39; method to retrieve the next page of results. */ /** * @typedef StopWatchingCreativeRequest * @memberOf! adexchangebuyer2(v2beta1) * @type object */ /** * @typedef Disapproval * @memberOf! adexchangebuyer2(v2beta1) * @type object * @property {string[]} details Additional details about the reason for disapproval. * @property {string} reason The categorized reason for disapproval. */ /** * @typedef ServingRestriction * @memberOf! adexchangebuyer2(v2beta1) * @type object * @property {adexchangebuyer2(v2beta1).Disapproval[]} disapprovalReasons Any disapprovals bound to this restriction. Only present if status=DISAPPROVED. Can be used to filter the response of the creatives.list method. * @property {adexchangebuyer2(v2beta1).ServingContext[]} contexts The contexts for the restriction. * @property {string} status The status of the creative in this context (for example, it has been explicitly disapproved or is pending review). */ /** * @typedef Date * @memberOf! adexchangebuyer2(v2beta1) * @type object * @property {integer} month Month of year. Must be from 1 to 12. * @property {integer} year Year of date. Must be from 1 to 9999, or 0 if specifying a date without a year. * @property {integer} day Day of month. Must be from 1 to 31 and valid for the year and month, or 0 if specifying a year/month where the day is not significant. */ /** * @typedef Empty * @memberOf! adexchangebuyer2(v2beta1) * @type object */ /** * @typedef WatchCreativeRequest * @memberOf! adexchangebuyer2(v2beta1) * @type object * @property {string} topic The Pub/Sub topic to publish notifications to. This topic must already exist and must give permission to ad-exchange-buyside-reports@google.com to write to the topic. This should be the full resource name in &quot;projects/{project_id}/topics/{topic_id}&quot; format. */ /** * @typedef AppContext * @memberOf! adexchangebuyer2(v2beta1) * @type object * @property {string[]} appTypes The app types this restriction applies to. */ /** * @typedef NativeContent * @memberOf! adexchangebuyer2(v2beta1) * @type object * @property {string} clickLinkUrl The URL that the browser/SDK will load when the user clicks the ad. * @property {adexchangebuyer2(v2beta1).Image} logo A smaller image, for the advertiser&#39;s logo. * @property {string} priceDisplayText The price of the promoted app including currency info. * @property {string} clickTrackingUrl The URL to use for click tracking. * @property {adexchangebuyer2(v2beta1).Image} image A large image. * @property {string} advertiserName The name of the advertiser or sponsor, to be displayed in the ad creative. * @property {string} storeUrl The URL to the app store to purchase/download the promoted app. * @property {string} headline A short title for the ad. * @property {adexchangebuyer2(v2beta1).Image} appIcon The app icon, for app download ads. * @property {string} callToAction A label for the button that the user is supposed to click. * @property {string} body A long description of the ad. * @property {number} starRating The app rating in the app store. Must be in the range [0-5]. * @property {string} videoUrl The URL to fetch a native video ad. */ /** * @typedef ListClientsResponse * @memberOf! adexchangebuyer2(v2beta1) * @type object * @property {adexchangebuyer2(v2beta1).Client[]} clients The returned list of clients. * @property {string} nextPageToken A token to retrieve the next page of results. Pass this value in the ListClientsRequest.pageToken field in the subsequent call to the accounts.clients.list method to retrieve the next page of results. */ /** * @typedef SecurityContext * @memberOf! adexchangebuyer2(v2beta1) * @type object * @property {string[]} securities The security types in this context. */ /** * @typedef ListCreativesResponse * @memberOf! adexchangebuyer2(v2beta1) * @type object * @property {string} nextPageToken A token to retrieve the next page of results. Pass this value in the ListCreativesRequest.page_token field in the subsequent call to `ListCreatives` method to retrieve the next page of results. * @property {adexchangebuyer2(v2beta1).Creative[]} creatives The list of creatives. */ /** * @typedef HtmlContent * @memberOf! adexchangebuyer2(v2beta1) * @type object * @property {string} snippet The HTML snippet that displays the ad when inserted in the web page. * @property {integer} height The height of the HTML snippet in pixels. * @property {integer} width The width of the HTML snippet in pixels. */ /** * @typedef ServingContext * @memberOf! adexchangebuyer2(v2beta1) * @type object * @property {adexchangebuyer2(v2beta1).LocationContext} location Matches impressions coming from users *or* publishers in a specific location. * @property {adexchangebuyer2(v2beta1).AuctionContext} auctionType Matches impressions for a particular auction type. * @property {string} all Matches all contexts. * @property {adexchangebuyer2(v2beta1).AppContext} appType Matches impressions for a particular app type. * @property {adexchangebuyer2(v2beta1).SecurityContext} securityType Matches impressions for a particular security type. * @property {adexchangebuyer2(v2beta1).PlatformContext} platform Matches impressions coming from a particular platform. */ /** * @typedef Image * @memberOf! adexchangebuyer2(v2beta1) * @type object * @property {integer} height Image height in pixels. * @property {integer} width Image width in pixels. * @property {string} url The URL of the image. */ /** * @typedef Reason * @memberOf! adexchangebuyer2(v2beta1) * @type object * @property {integer} status The filtering status code. Please refer to the [creative-status-codes.txt](https://storage.googleapis.com/adx-rtb-dictionaries/creative-status-codes.txt) file for different statuses. * @property {string} count The number of times the creative was filtered for the status. The count is aggregated across all publishers on the exchange. */ /** * @typedef VideoContent * @memberOf! adexchangebuyer2(v2beta1) * @type object * @property {string} videoUrl The URL to fetch a video ad. */ /** * @typedef ClientUserInvitation * @memberOf! adexchangebuyer2(v2beta1) * @type object * @property {string} clientAccountId Numerical account ID of the client buyer that the invited user is associated with. The value of this field is ignored in create operations. * @property {string} invitationId The unique numerical ID of the invitation that is sent to the user. The value of this field is ignored in create operations. * @property {string} email The email address to which the invitation is sent. Email addresses should be unique among all client users under each sponsor buyer. */ /** * @typedef AuctionContext * @memberOf! adexchangebuyer2(v2beta1) * @type object * @property {string[]} auctionTypes The auction types this restriction applies to. */ /** * @typedef ListClientUsersResponse * @memberOf! adexchangebuyer2(v2beta1) * @type object * @property {string} nextPageToken A token to retrieve the next page of results. Pass this value in the ListClientUsersRequest.pageToken field in the subsequent call to the clients.invitations.list method to retrieve the next page of results. * @property {adexchangebuyer2(v2beta1).ClientUser[]} users The returned list of client users. */ /** * @typedef ListClientUserInvitationsResponse * @memberOf! adexchangebuyer2(v2beta1) * @type object * @property {string} nextPageToken A token to retrieve the next page of results. Pass this value in the ListClientUserInvitationsRequest.pageToken field in the subsequent call to the clients.invitations.list method to retrieve the next page of results. * @property {adexchangebuyer2(v2beta1).ClientUserInvitation[]} invitations The returned list of client users. */ /** * @typedef LocationContext * @memberOf! adexchangebuyer2(v2beta1) * @type object * @property {integer[]} geoCriteriaIds IDs representing the geo location for this context. Please refer to the [geo-table.csv](https://storage.googleapis.com/adx-rtb-dictionaries/geo-table.csv) file for different geo criteria IDs. */ /** * @typedef PlatformContext * @memberOf! adexchangebuyer2(v2beta1) * @type object * @property {string[]} platforms The platforms this restriction applies to. */ /** * @typedef ClientUser * @memberOf! adexchangebuyer2(v2beta1) * @type object * @property {string} clientAccountId Numerical account ID of the client buyer with which the user is associated; the buyer must be a client of the current sponsor buyer. The value of this field is ignored in an update operation. * @property {string} status The status of the client user. * @property {string} userId The unique numerical ID of the client user that has accepted an invitation. The value of this field is ignored in an update operation. * @property {string} email User&#39;s email address. The value of this field is ignored in an update operation. */ /** * @typedef CreativeDealAssociation * @memberOf! adexchangebuyer2(v2beta1) * @type object * @property {string} accountId The account the creative belongs to. * @property {string} creativeId The ID of the creative associated with the deal. * @property {string} dealsId The externalDealId for the deal associated with the creative. */ module.exports = Adexchangebuyer2;
'use strict'; let mongoose = require('mongoose'); let note = require('../models/noteModel'); // Get /note function getNotes(req, res) { let query = Note.find({}); query, exec((err, notes) => { if (err) res.send(err); res.json(notes); }); } // Post /note/:id function postNote(req, res) { var newNote = Note(req.body); newNote.save((err, note) => { if (err) { res.sernd(err); } else { res.json({ message: "Saved", note }); } }); } // Get /note/:id function getNote(req, res) { Note.findById(req.parrams.id, (err, note) => { if (err) res.send(err); res.json(note); }); } // Delete /note/:id function deleteNote(req, res) { Note.remove({ _id: req.parrams.id }, (err, result) => { res.json({ message: "Deleted", result }); }); } //Pup 'note/:id function updateNote(req, res) { Note.findById({ _id: req.parrams.id }, (err, book) => { if (err) res.send(err); Object.assign(note, req.body).save((err, note) => { if (err) res.send(err); res.json({ messege: 'Updated', note }); }); }); } module.exports = { postNote, getNote, getNotes, updateNote, deleteNote };
const Issue = require('../../models/IssueModel'); module.exports = function (req, res) { const { id } = req.params; Issue.findById(id).populate("project").then(issue => { res.json(issue); }) }
const CHECK = 'planner/login/credentials/CHECK'; const CREATE = 'planner/login/credentials/CREATE'; const initialState = [ { email: 'xmartinez@gmail.com', password: 'skyhigh87', }, ]; // Action Creators export const fetchCredentials = () => ({ type: CHECK, }); export const createCredentials = (email, password) => ({ type: CREATE, email, password, }); // Reducer export default function reducer(state = initialState, action = {}) { switch (action.type) { case CHECK: return state; case CREATE: return [...state, { email: action.email, password: action.password, }]; default: return state; } } // side effects, only as applicable // e.g. thunks, epics, etc
// fetch() is built in to Next.js 9.4 (you can use a polyfill if using an older version) /* global fetch:false */ import { useState, useEffect, useContext, createContext, createElement } from 'react' const DEFAULT_BASE_URL_COOKIE_NAME = 'next-auth.base-url' const DEFAULT_SITE = '' const DEFAULT_BASE_PATH = '/api/auth' // Isomorphic get session method const session = async ({ req, site, basePath, baseUrlCookieName } = {}) => { const baseUrl = _baseUrl({ req, site, basePath, baseUrlCookieName }) if (!baseUrl) { return null } // If server side, send with cookies in header (sent automatically client side) const fetchOptions = req ? { headers: { cookie: req.headers.cookie } } : {} try { const res = await fetch(`${baseUrl}/session`, fetchOptions) const data = await res.json() return Object.keys(data).length > 0 ? data : null // Return null if session data empty } catch (error) { console.error('CLIENT_SESSION_ERROR', error) return null } } // Context to store session data globally const SessionContext = createContext() // Internal hook for getting session from the api. const useSessionData = (session, { basePath } = {}) => { const [data, setData] = useState(session) const [loading, setLoading] = useState(true) const getSession = async () => { try { const res = await fetch(`${basePath || DEFAULT_BASE_PATH}/session`) // Releative URL const data = await res.json() setData(Object.keys(data).length > 0 ? data : null) // Return null if session data empty setLoading(false) } catch (error) { console.error('CLIENT_USE_SESSION_ERROR', error) } } useEffect(() => { getSession() }, []) return [data, loading] } // Provider to wrap the app in to make session data available globally const Provider = ({ children, session, basePath }) => { const value = useSession(session, { basePath }) return createElement(SessionContext.Provider, { value }, children) } // Hook to access the session data stored in the context const useSession = (session, { basePath } = {}) => { const value = useContext(SessionContext) // If we have no Provider in the tree we call the actual hook for fetching the session if (value === undefined) { return useSessionData(session, { basePath }) } return value } const _baseUrl = ({ req, site, baseUrlCookieName, basePath }) => { // If we have a 'req' object are running sever side and should get cookies from headers const cookies = req ? _parseCookies(req.headers.cookie) : null // If site and/or basePath are specified, use them (or the defaults) // otherwise get the server URL from the signed HTTP only cookie. // // If no options specified (which usually will be the case) then grab // the configuration dynamically from a cookie. Prefer the _Secure- // prefixed version if it is avalible, but fall back to checking the // version without the prefix so it still works on URLs like http://localhost // // If there is no cookie set, then we use the default prefix (/api/auth). const baseUrl = (site || basePath || !cookies) ? `${site || DEFAULT_SITE}${basePath || DEFAULT_BASE_PATH}` : _getUrlPrefixFromCookies(cookies, baseUrlCookieName) return baseUrl } // Adapted from https://github.com/felixfong227/simple-cookie-parser/blob/master/index.js const _parseCookies = (string) => { if (!string) { return {} } try { const object = {} const a = string.split(';') for (let i = 0; i < a.length; i++) { const b = a[i].split('=') if (b[0].length > 1 && b[1]) { object[b[0].trim()] = decodeURIComponent(b[1]) } } return object } catch (e) { console.error('CLIENT_COOKIE_PARSE_ERROR') return {} } } const _getUrlPrefixFromCookies = (cookies, baseUrlCookieName) => { const cookieValue = cookies[baseUrlCookieName] || cookies[`__Secure-${DEFAULT_BASE_URL_COOKIE_NAME}`] || cookies[DEFAULT_BASE_URL_COOKIE_NAME] const [baseUrl] = cookieValue ? cookieValue.split('|') : [null] return baseUrl } export default { session, useSession, Provider }
module.exports={A:{A:{"2":"J D E F A B tB"},B:{"2":"C K L G M N O","194":"P Q R S V W X Y Z a b c d e f g h i j T H"},C:{"1":"0 1 2 3 4 5 6 7 8 9 iB I k J D E F A B C K L G M N O l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB jB PB kB QB RB U SB TB UB VB WB XB YB ZB aB bB cB dB eB fB P Q R lB S V W X Y Z a b c d e f g h i j T H mB vB wB","2":"uB"},D:{"2":"0 1 2 3 4 5 6 7 8 I k J D E F A B C K L G M N O l m n o p q r s t u v w x y z","194":"9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB jB PB kB QB RB U SB TB UB VB WB XB YB ZB aB bB cB dB eB fB P Q R S V W X Y Z a b c d e f g h i j T H mB xB yB"},E:{"2":"I k J D E F A B C K L G zB nB 0B 1B 2B 3B oB gB hB 4B 5B 6B pB qB 7B"},F:{"2":"F B C G M N O l m n o p q r s t u v 8B 9B AC BC gB rB CC hB","194":"0 1 2 3 4 5 6 7 8 9 w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB U SB TB UB VB WB XB YB ZB aB bB cB dB eB fB P Q R lB S"},G:{"2":"E nB DC sB EC FC GC HC IC JC KC LC MC NC OC PC QC RC SC TC UC VC WC pB qB"},H:{"2":"XC"},I:{"2":"iB I H YC ZC aC bC sB cC dC"},J:{"2":"D A"},K:{"2":"A B C U gB rB hB"},L:{"2":"H"},M:{"258":"T"},N:{"2":"A B"},O:{"2":"eC"},P:{"2":"I fC gC hC iC jC oB kC lC mC nC oC pC"},Q:{"194":"qC"},R:{"2":"rC"},S:{"2":"sC"}},B:4,C:"CSS font-size-adjust"};
import React from 'react' import {StaticImage} from "gatsby-plugin-image" import styled from "@emotion/styled" import {css, jsx} from '@emotion/react' import DownScrollIcon from './DownScrollIcon' import bgGradient from "./AboutPage/bgGradient.jpeg" import CurriculumTimelineMobile from './AboutPage/CurriculumTimelineMobile' import LogoIllustrationBig from "../assets/LogoIllustrationBig.svg" import WorkingSectionMobile from './AboutPage/WorkingSectionMobile' import AboutCtaMobile from './AboutPage/AboutCtaMobile' const HeroOuterWrapper = styled("div")` display: flex; flex-direction: column; align-items: center; width: 100%; height: 80vh; ` const HeroInnerWrapper = styled("div")` width: 100%; display: flex; align-items: center; justify-content: center; margin-top: -20%; ` const HeroTextbox = styled("div")` width: 90%; text-align: center; ` const HeroHeader = styled("h3")` margin-bottom: 5%; ` const Spacer = styled("div")` width: 100%; height: 20vh; ` const WhiteWrapper = styled("div")` background-color: #fff; display: flex; flex-direction: column; align-items: center; margin: 10% 0; text-align: center; ` const ParagraphWrapper = styled("div")` width: 90%; margin-bottom: 8%; display: flex; justify-content: center; ` const TextImageWrapper = styled("div")` display: flex; flex-direction: column; justify-content: space-around; align-items: center; padding-top: 10%; ` const TextImageTextbox = styled("div")` width: 90%; text-align: center; ` const TextImageHeader = styled("h3")` margin-bottom: 5%; ` const TextImageParagraphBox = styled("div")` padding-right: 5%; text-align: center; ` const TextImageCtaTextbox = styled("div")` width: 34%; ` const TextImageCtaParagraphBox = styled("div")` padding-right: 20%; ` const TextImageCtaButton = styled("button")` width: 66%; height: 5vh; align-self: flex-start; margin-top: 10%; ` const OfferColumns = styled("div")` display: flex; flex-direction: column; align-items: center; justify-content: space-between; width: 85%; margin-bottom: 5%; ` const OfferTitleBox = styled("div")` width: 80%; ` const OfferDescriptionBox = styled("div")` width: 90%; ` const OfferColumnParagraphContainer = styled("div")` width: 75%; ` const PriceBox = styled("div")` margin-top: 2%; margin-bottom: 3%; width: 80%; background-color: rgba(209, 194, 187, .1); display: flex; justify-content: center; align-items: center; height: 10vh; border-radius: 10px; ` const DisclaimerBox = styled("div")` color: #6C665A; opacity: 50%; width: 90%; text-align: center; margin-bottom: 5%; ` const OutlineButton = styled("button")` background-color: transparent; border: 1px solid #D1C2BB; color: #D1C2BB; width: 85%; height: 6vh; margin-bottom: 3%; ` const ContactButton = styled("button")` width: 85%; height: 6vh; background-color: #F5EEE9; margin-bottom: 10%; ` const CtaParagraph = styled("div")` width: 80%; text-align: center; margin-bottom: 5%; ` const ObersvationParagraph = styled("div")` width: 90%; text-align: center; margin-bottom: 5%; ` const GradientCircle = styled("div")` background-image: url(${bgGradient}); background-size: cover; overflow: hidden; height: 90vw; width: 90vw; max-width: 549px; max-height: 549px; border-radius: 50%; position: absolute; z-index: -1; transform: translateY(-20%); ` const QuoteOuterWrapper = styled("div")` display: flex; flex-direction: column; width: 100%; border-radius: 20px; height: 100vh; display: flex; justify-content: space-around; align-items: center; background-color: #F5EEE9; margin-top: 30%; ` const QuoteInnerWrapper = styled("div")` display: flex; flex-direction: column; width: 90%; border-radius: 10px; height: 50%; display: flex; justify-content: center; padding: 0 3% ; align-items: center; background-color: white; text-align: center; ` const Signature = styled("div")` font-family: "Open Sans"; font-style: italic; font-size: 1.875rem; color: #D4C1BA; margin-top: 5% ; ` const ValueProposition = styled("h3")` margin: 14% auto; text-align: center; width: 100%; ` const BottomText = styled("div")` width: 100%; text-align: center; margin-bottom: 15%; ` export default function AboutMobile({currentLanguage}) { return ( <React.Fragment> <HeroOuterWrapper> <Spacer/> <HeroInnerWrapper> <HeroTextbox> <HeroHeader>{currentLanguage.heroHeader}</HeroHeader> <h4>{currentLanguage.heroSubHeader}</h4> <p className="p">{currentLanguage.heroText}</p> </HeroTextbox> <GradientCircle/> </HeroInnerWrapper> <DownScrollIcon size="15vw" mt="5%"/> </HeroOuterWrapper> <WhiteWrapper> <h3 css={css `margin: 5% 0 5% 0;`}>{currentLanguage.imgHeader}</h3> <ParagraphWrapper> <p className="p">{currentLanguage.imgText}</p> </ParagraphWrapper> <StaticImage src="../images/curriculumPicture.png" alt="A dog in the beach" layout="constrained" width={1640} height={1093} css={css `width: 88%; margin-bottom: 10%;`}/> <CurriculumTimelineMobile currentLanguage={currentLanguage}/> </WhiteWrapper> <WhiteWrapper><WorkingSectionMobile currentLanguage={currentLanguage}/></WhiteWrapper> <TextImageWrapper> <TextImageTextbox> <TextImageHeader>{currentLanguage.educationHeader}</TextImageHeader> <TextImageParagraphBox> <p className="p">{currentLanguage.educationTextOne}</p> </TextImageParagraphBox> </TextImageTextbox> <StaticImage src="../images/CityImageOne.png" alt="Another facade of a Church" layout="constrained" width={950} height={633} css={css `width: 100%; margin: 10% 0;`}/> <TextImageParagraphBox> <p className="p">{currentLanguage.educationTextTwo}</p> </TextImageParagraphBox> </TextImageWrapper> <QuoteOuterWrapper> <QuoteInnerWrapper> <h4>{currentLanguage.quote} </h4> <Signature> {currentLanguage.quoteSignature} </Signature> </QuoteInnerWrapper> </QuoteOuterWrapper> <TextImageWrapper> <TextImageTextbox> <TextImageHeader>{currentLanguage.agHeader} </TextImageHeader> <TextImageParagraphBox> <p className="p">{currentLanguage.agText} </p> </TextImageParagraphBox> </TextImageTextbox> <LogoIllustrationBig css={css `width: 100%; height:auto; margin: 10% 0;`}/> <h4 css={css `text-align: center; margin-bottom: 5%;`}>{currentLanguage.complementarySubHeader} </h4> <TextImageParagraphBox> <p className="p">{currentLanguage.complementaryTextOne}</p> </TextImageParagraphBox> <StaticImage src="../images/JulianeAndDog.png" alt="Juliane with a dog" layout="constrained" width={950} height={711} css={css `width: 100%; margin: 10% 0;`}/> <TextImageParagraphBox> <p className="p">{currentLanguage.complementaryTextTwo}</p> </TextImageParagraphBox> <ValueProposition>{currentLanguage.valueProp}</ValueProposition> <StaticImage src="../images/JulianeAndTwoDogs.png" alt="Juliane with two dogs" layout="constrained" width={1364} height={911} css={css `width: 100%; margin: 10%;`}/> <BottomText> <p className="p-small">{currentLanguage.bottomText}</p> </BottomText> </TextImageWrapper> <AboutCtaMobile currentLanguage={currentLanguage} /> </React.Fragment> ) }
var app = new Vue({ el:'#section-list', data:{ sectionList: [], keyword: "" }, methods:{ sectionDetails: function(item_id){ window.location.href = '/wechat/course/sectionIntroduction?item_id=' + item_id; }, index: function() { window.location.href = "/wechat"; }, myCenter: function() { window.location.href = "/wechat/center/userCenter"; }, top: function() { $('body,html').animate({scrollTop:0},300); } } }) var isNeedRefresh = false; var page_num = 1; var data_order = 'create_time'; $(function() { var course_id = $.getUrlParam('course_id'); getSectionList(course_id,data_order); $(window).scroll(function(){ var scrollTop = $(this).scrollTop(); var scrollHeight = $(document).height(); var windowHeight = $(this).height(); if(!isNeedRefresh && (scrollHeight - scrollTop - windowHeight <= 25)){ isNeedRefresh = true; page_num = page_num + 1; getSectionList(course_id,data_order); $(window).scrollTop(0); } }); $("img.icon-search").on("click", function(event) { event.preventDefault(); var keyword = $("input[name=keyword]").val(); app.keyword = keyword; getSectionList(course_id,data_order); }); $('.sellect-label').on('click', function(event) { event.preventDefault(); /* Act on the event */ page_num = 1; isNeedRefresh = false; data_order = $(this).attr("data-order"); $(".sellect-label").each(function() { if($(this).hasClass("active")) { $(this).removeClass("active"); } }); $(this).addClass("active"); var keyword = $("input[name=keyword]").val(); app.keyword = keyword; getSectionList(course_id,data_order); }); }); function getSectionList(course_id,data_order){ $.ajax({ url:urlCourseItemList, type:"POST", data:{ course_id: course_id, order: data_order, keyword: app.keyword, page_num: page_num }, dataType:"JSON", success:function(data){ if(data.code==200){ if(!isNullOrEmpty(data.data.list)) { if(page_num == 1){ app.sectionList = data.data.list; }else{ app.sectionList = app.sectionList.concat(data.data.list); } }else{ isNeedRefresh = true; } } } }) }
// Checks to see if given row-column pair are in snake const isSnakeSegment = (snake, row, col) => { const reducer = (acc, val) => acc || (val[0] === row && val[1] === col); return snake.reduce(reducer, false); } export default isSnakeSegment;
// @flow import {observable} from 'mobx'; import ResourceStore from '../../../stores/ResourceStore'; import FormInspector from '../FormInspector'; import FormStore from '../stores/FormStore'; jest.mock('../../../stores/ResourceStore', () => jest.fn(function(resourceKey, id, options) { this.resourceKey = resourceKey; this.id = id; if (options) { this.locale = options.locale; } })); jest.mock('../stores/FormStore', () => jest.fn(function(resourceStore) { this.resourceKey = resourceStore.resourceKey; this.id = resourceStore.id; this.locale = resourceStore.locale; this.data = resourceStore.data; this.options = {}; this.schema = {}; this.getValueByPath = jest.fn(); this.getValuesByTag = jest.fn(); this.getSchemaEntryByPath = jest.fn(); this.finishField = jest.fn(); this.isFieldModified = jest.fn(); })); test('Should return the resourceKey from the FormStore', () => { const formStore = new FormStore(new ResourceStore('test')); const formInspector = new FormInspector(formStore); expect(formInspector.resourceKey).toEqual('test'); }); test('Should return the locale from the FormStore', () => { const formStore = new FormStore(new ResourceStore('test', 1, {locale: observable.box('de')})); const formInspector = new FormInspector(formStore); if (!formInspector.locale) { throw new Error('Locale must have a value in formInspector'); } expect(formInspector.locale.get()).toEqual('de'); }); test('Should return the id from the FormStore', () => { const formStore = new FormStore(new ResourceStore('test', 3)); const formInspector = new FormInspector(formStore); expect(formInspector.id).toEqual(3); }); test('Should return the errors from the FormStore', () => { const formStore = new FormStore(new ResourceStore('test', 3)); formStore.errors = {}; const formInspector = new FormInspector(formStore); expect(formInspector.errors).toBe(formStore.errors); }); test('Should return the options from the FormStore', () => { const formStore = new FormStore(new ResourceStore('test', 1)); formStore.options = { webspace: 'example', }; const formInspector = new FormInspector(formStore); expect(formInspector.options).toEqual({ webspace: 'example', }); }); test('Should return the value for a path by using the FormStore', () => { const data = []; const formStore = new FormStore(new ResourceStore('test', 3)); // $FlowFixMe formStore.getValueByPath.mockReturnValue(data); const formInspector = new FormInspector(formStore); expect(formInspector.getValueByPath('/test')).toBe(data); expect(formStore.getValueByPath).toBeCalledWith('/test'); }); test('Should return the values for a given tag by using the FormStore', () => { const data = []; const formStore = new FormStore(new ResourceStore('test', 3)); formStore.getValuesByTag.mockReturnValue(data); const formInspector = new FormInspector(formStore); expect(formInspector.getValuesByTag('/test')).toBe(data); expect(formStore.getValuesByTag).toBeCalledWith('/test'); }); test('Should call finishField method from formStore', () => { const formStore = new FormStore(new ResourceStore('test', 3)); const formInspector = new FormInspector(formStore); formInspector.finishField('/block/0/test', '/test'); expect(formStore.finishField).toBeCalledWith('/block/0/test'); }); test('Should call registered onFinishField handlers', () => { const formInspector = new FormInspector(new FormStore(new ResourceStore('test', 3))); const finishFieldHandler1 = jest.fn(); const finishFieldHandler2 = jest.fn(); formInspector.addFinishFieldHandler(finishFieldHandler1); formInspector.addFinishFieldHandler(finishFieldHandler2); formInspector.finishField('/block/0/test', '/test'); expect(finishFieldHandler1).toBeCalledWith('/block/0/test', '/test'); expect(finishFieldHandler2).toBeCalledWith('/block/0/test', '/test'); }); test('Should return the SchemaEntry for a given path by using the FormStore', () => { const schemaEntry = { type: 'text_line', }; const formStore = new FormStore(new ResourceStore('test', 3)); formStore.getSchemaEntryByPath.mockReturnValue(schemaEntry); const formInspector = new FormInspector(formStore); expect(formInspector.getSchemaEntryByPath('/test')).toBe(schemaEntry); expect(formStore.getSchemaEntryByPath).toBeCalledWith('/test'); }); test('Should return if a field is modified by using the FormStore', () => { const formStore = new FormStore(new ResourceStore('test', 3)); formStore.isFieldModified.mockReturnValue(true); const formInspector = new FormInspector(formStore); expect(formInspector.isFieldModified('/test')).toBe(true); expect(formStore.isFieldModified).toBeCalledWith('/test'); });
/** * Session Configuration * (sails.config.session) * * Use the settings below to configure session integration in your app. * (for additional recommended settings, see `config/env/production.js`) * * For all available options, see: * https://sailsjs.com/config/session */ module.exports.session = { /*************************************************************************** * * * Session secret is automatically generated when your new app is created * * Replace at your own risk in production-- you will invalidate the cookies * * of your users, forcing them to log in again. * * * ***************************************************************************/ secret: '7001d454bbf105b007c886f156f1a166', /*************************************************************************** * * * Customize when built-in session support will be skipped. * * * * (Useful for performance tuning; particularly to avoid wasting cycles on * * session management when responding to simple requests for static assets, * * like images or stylesheets.) * * * * https://sailsjs.com/config/session * * * ***************************************************************************/ // isSessionDisabled: function (req){ // return !!req.path.match(req._sails.LOOKS_LIKE_ASSET_RX); // }, };
// @flow import React from 'react' import { StyleSheet, View } from 'react-native' import { Paragraph, Portal } from 'react-native-paper' import normalize from '../../../lib/utils/normalizeText' import SimpleStore from '../../../lib/undux/SimpleStore' import CustomButton from '../buttons/CustomButton' import ErrorIcon from '../modal/ErrorIcon' import SuccessIcon from '../modal/SuccessIcon' import ModalWrapper from '../modal/ModalWrapper' import { theme } from '../../theme/styles' import Text from '../view/Text' export type DialogButtonProps = { color?: string, mode?: string, onPress?: Function => void, text: string, style?: any } export type DialogProps = { children?: any, image?: any, loading?: boolean, message?: string, boldMessage?: any, onCancel?: () => void, onDismiss?: () => void, showButtons?: boolean, title?: string, type?: string, visible?: boolean, buttons?: DialogButtonProps[], } /** * Custom Dialog based on react-native-paper * @param {DialogProps} props * @param {React.Node|String} [props.children] * @param {function} [props.onDismiss] * @param {function} [props.onCancel] * @param {boolean} [props.visible] * @param {string} [props.title] * @param {string} [props.message] * @param {boolean} [props.loading] * @param {DialogButtonProps[]} [props.buttons] * @returns {React.Node} */ const CustomDialog = ({ children = null, image, loading = false, message = null, boldMessage = null, onDismiss, showButtons = true, showTooltipArrow, title, type = 'common', visible, content, buttons, showAtBottom, }: DialogProps) => { const defaultImage = type === 'error' ? <ErrorIcon /> : <SuccessIcon /> const modalColor = getColorFromType(type) const textColor = type === 'error' ? 'red' : 'darkGray' const color = theme.colors[textColor] return visible ? ( <Portal> <ModalWrapper onClose={onDismiss} leftBorderColor={modalColor} showAtBottom={showAtBottom} showTooltipArrow={showTooltipArrow} itemType={'custom'} > <React.Fragment> {title && ( <Text color={textColor} fontFamily="slab" fontSize={24} fontWeight="bold" style={styles.title}> {title} </Text> )} <View style={styles.content}> {content || ( <> {children} {image ? image : defaultImage} {message && <Paragraph style={[styles.paragraph, { color }]}>{message}</Paragraph>} {boldMessage && ( <Paragraph style={[styles.paragraph, { fontWeight: 'bold', color }]}>{boldMessage}</Paragraph> )} </> )} </View> {showButtons ? ( <View style={styles.buttonsContainer}> {buttons ? ( buttons.map(({ onPress = dismiss => dismiss(), style, ...buttonProps }, index) => ( <CustomButton {...buttonProps} onPress={() => onPress(onDismiss)} style={[{ marginLeft: 10 }, style]} disabled={loading} loading={loading} key={index} > {buttonProps.text} </CustomButton> )) ) : ( <CustomButton disabled={loading} loading={loading} onPress={onDismiss} style={[styles.buttonOK]}> Ok </CustomButton> )} </View> ) : null} </React.Fragment> </ModalWrapper> </Portal> ) : null } const getColorFromType = (type: string) => { return ( { success: theme.colors.primary, error: theme.colors.red, }[type] || theme.colors.primary ) } const SimpleStoreDialog = () => { const store = SimpleStore.useStore() const { dialogData } = store.get('currentScreen') return ( <CustomDialog {...dialogData} onDismiss={(...args) => { const currentDialogData = { ...dialogData } store.set('currentScreen')({ dialogData: { visible: false } }) currentDialogData.onDismiss && currentDialogData.onDismiss(currentDialogData) }} /> ) } const styles = StyleSheet.create({ title: { marginBottom: theme.sizes.defaultDouble, paddingTop: theme.sizes.defaultDouble, }, paragraph: { color: theme.colors.darkGray, fontSize: normalize(16), textAlign: 'center', }, content: { display: 'flex', flexDirection: 'column', flexGrow: 1, marginBottom: 40, padding: 0, }, buttonsContainer: { display: 'flex', flexDirection: 'row', justifyContent: 'flex-end', paddingLeft: 0, paddingRight: 0, }, buttonCancel: { minWidth: 80, }, buttonOK: { minWidth: 80, paddingHorizontal: 10, }, }) export { CustomDialog as default, SimpleStoreDialog }
"use strict"; class Time { static get current() { let hrtime = process.hrtime(); return (hrtime[0] * 1000000 + hrtime[1] / 1000) / 1000; } } Object.defineProperty(exports, "__esModule", { value: true }); exports.default = Time; //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGltZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlscy90aW1lLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFDQTtJQUVFLFdBQVcsT0FBTztRQUNoQixJQUFJLE1BQU0sR0FBRyxPQUFPLENBQUMsTUFBTSxFQUFFLENBQUE7UUFDN0IsTUFBTSxDQUFDLENBQUMsTUFBTSxDQUFDLENBQUMsQ0FBQyxHQUFHLE9BQU8sR0FBRyxNQUFNLENBQUMsQ0FBQyxDQUFDLEdBQUcsSUFBSSxDQUFDLEdBQUcsSUFBSSxDQUFDO0lBQ3pELENBQUM7QUFDSCxDQUFDO0FBTkQ7c0JBTUMsQ0FBQSJ9
var http = require('http'); var fs = require('fs'); var hostname = '127.0.0.1'; // var hostname = '192.168.14.254'; var port = 3000; console.log(1); // 创建服务器 var server = http.createServer(function(req, res){ // 跳过了 chrome 的收藏夹图标的请求 if (req.url == '/favicon.ico') return; // 获取用户的IP var userIp = getIp(req); // 随机数 1-9 var num = Math.ceil(Math.random() * 10000 % 9); // console.log('欢迎IP: ' + userIp + ' 的用户读取第:[ ' + num + ' ]张图片'); // 读取图片输出 fs.readFile('./imgs/'+num+'.jpg', function (err, data){ if (err) throw err; res.writeHead(200, {'content-type': 'image/jpeg'}); // console.log(userIp + ' 的第[ ' + num + ' ]张图片,已读取完成!'); res.end(data); console.log(2); }); console.log(3); }); // 运行服务器 server.listen(port, hostname); console.log(4); // 获取url请求客户端ip var getIp = function(req) { var ip = req.headers['x-forwarded-for'] || req.ip || req.connection.remoteAddress || req.socket.remoteAddress || req.connection.socket.remoteAddress || ''; if(ip.split(',').length>0){ ip = ip.split(',')[0] } return ip; };
/* Modernizr 2.7.2 (Custom Build) | MIT & BSD * Build: http://modernizr.com/download/#-a_download */ ;window.Modernizr=function(a,b,c){function t(a){i.cssText=a}function u(a,b){return t(prefixes.join(a+";")+(b||""))}function v(a,b){return typeof a===b}function w(a,b){return!!~(""+a).indexOf(b)}function x(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:v(f,"function")?f.bind(d||b):f}return!1}var d="2.7.2",e={},f=b.documentElement,g="modernizr",h=b.createElement(g),i=h.style,j,k={}.toString,l={},m={},n={},o=[],p=o.slice,q,r={}.hasOwnProperty,s;!v(r,"undefined")&&!v(r.call,"undefined")?s=function(a,b){return r.call(a,b)}:s=function(a,b){return b in a&&v(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=p.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(p.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(p.call(arguments)))};return e});for(var y in l)s(l,y)&&(q=y.toLowerCase(),e[q]=l[y](),o.push((e[q]?"":"no-")+q));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)s(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof enableClasses!="undefined"&&enableClasses&&(f.className+=" "+(b?"":"no-")+a),e[a]=b}return e},t(""),h=j=null,e._version=d,e}(this,this.document),Modernizr.addTest("adownload","download"in document.createElement("a"));
// ==UserScript== // @name Open CDN MenuCommand // @namespace https://github.com/Cologler/monkeys-javascript // @version 0.1.1 // @description register open CDN MenuCommand // @author Cologler (skyoflw@gmail.com) // @match https://github.com/* // @grant GM.registerMenuCommand // @grant GM.openInTab // @noframes // @license MIT // ==/UserScript== /** * @typedef GithubMetadata * @property {string} owner * @property {string} repo * @property {string} branch * @property {string} path */ (function () { 'use strict'; /** * * @param {Location} location * @returns {GithubMetadata} */ function parseGithubMetadataFromLocation(location) { const match = location.pathname.match( /^\/(?<owner>[^/]+)\/(?<repo>[^/]+)(?:\/(?<type>tree|blob)\/(?<branch>[^/]+)(?:\/(?<path>.+))?)?$/ ); if (!match) { return null; } return { owner: match.groups.owner, repo: match.groups.repo, branch: match.groups.branch, path: match.groups.path, }; } /** * @param {GithubMetadata} metadata */ function getJsDelivrUrlFromGithubMetadata(metadata) { // browse packages: // https://www.jsdelivr.com/package/gh/Cologler/monkey-in-zoo-javascript // direct link: // https://cdn.jsdelivr.net/gh/Cologler/dom-builder-typescript@0.1.0/dist/dom-builder.js let url = `https://www.jsdelivr.com/package/gh/${metadata.owner}/${metadata.repo}`; if (metadata.path) { url += `?path=${metadata.path}`; } return url; } function getCDNInfos() { const cdns = []; if (window.location.hostname === 'github.com') { const githubMetadata = parseGithubMetadataFromLocation(window.location); if (githubMetadata) { const jsDelivrUrl = getJsDelivrUrlFromGithubMetadata(githubMetadata); cdns.push({ name: 'jsDelivr', url: jsDelivrUrl }); } } return cdns; } for (const cdn of getCDNInfos()) { GM.registerMenuCommand(cdn.name, () => { console.info(`GoTo: ${cdn.url}`); GM.openInTab(cdn.url); }); } })();
'use strict'; /******************************************************************************************** * * * Plese read the following tutorial before implementing tasks: * * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Numbers_and_dates#Date_object * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date * * * ********************************************************************************************/ /** * Parses a rfc2822 string date representation into date value * For rfc2822 date specification refer to : http://tools.ietf.org/html/rfc2822#page-14 * * @param {string} value * @return {date} * * @example: * 'December 17, 1995 03:24:00' => Date() * 'Tue, 26 Jan 2016 13:48:02 GMT' => Date() * 'Sun, 17 May 1998 03:00:00 GMT+01' => Date() */ function parseDataFromRfc2822(value) { return new Date(value); } /** * Parses an ISO 8601 string date representation into date value * For ISO 8601 date specification refer to : https://en.wikipedia.org/wiki/ISO_8601 * * @param {string} value * @return {date} * * @example : * '2016-01-19T16:07:37+00:00' => Date() * '2016-01-19T08:07:37Z' => Date() */ function parseDataFromIso8601(value) { return new Date(value); } /** * Returns true if specified date is leap year and false otherwise * Please find algorithm here: https://en.wikipedia.org/wiki/Leap_year#Algorithm * * @param {date} date * @return {bool} * * @example : * Date(1900,1,1) => false * Date(2000,1,1) => true * Date(2001,1,1) => false * Date(2012,1,1) => true * Date(2015,1,1) => false */ function isLeapYear(date) { return new Date(date.getFullYear(), 1, 29).getMonth() === 1; } /** * Returns the string represention of the timespan between two dates. * The format of output string is "HH:mm:ss.sss" * * @param {date} startDate * @param {date} endDate * @return {string} * * @example: * Date(2000,1,1,10,0,0), Date(2000,1,1,11,0,0) => "01:00:00.000" * Date(2000,1,1,10,0,0), Date(2000,1,1,10,30,0) => "00:30:00.000" * Date(2000,1,1,10,0,0), Date(2000,1,1,10,0,20) => "00:00:20.000" * Date(2000,1,1,10,0,0), Date(2000,1,1,10,0,0,250) => "00:00:00.250" * Date(2000,1,1,10,0,0), Date(2000,1,1,15,20,10,453) => "05:20:10.453" */ function timeSpanToString(startDate, endDate) { let date = new Date(1,1,0,0,0,0,endDate - startDate); let ms = date.getMilliseconds() || '000'; let str = date.toString().slice(16, 24)+`.${ms}`; return str; } /** * Returns the angle (in radians) between the hands of an analog clock for the specified Greenwich time. * If you have problem with solution please read: https://en.wikipedia.org/wiki/Clock_angle_problem * * @param {date} date * @return {number} * * @example: * Date.UTC(2016,2,5, 0, 0) => 0 * Date.UTC(2016,3,5, 3, 0) => Math.PI/2 * Date.UTC(2016,3,5,18, 0) => Math.PI * Date.UTC(2016,3,5,21, 0) => Math.PI/2 */ function angleBetweenClockHands(date) { let hours = date.getUTCHours(); let minutes = date.getMinutes(); let hoursAngel = 0.5*(60*hours+minutes); while(hoursAngel > 180) hoursAngel = hoursAngel - 180; let minutesAngel = 6*minutes; while(minutesAngel > 180) minutesAngel = minutesAngel - 180; return Math.abs(hoursAngel - minutesAngel)*Math.PI/180; } module.exports = { parseDataFromRfc2822: parseDataFromRfc2822, parseDataFromIso8601: parseDataFromIso8601, isLeapYear: isLeapYear, timeSpanToString: timeSpanToString, angleBetweenClockHands: angleBetweenClockHands };
import React from "react"; const dom = (eq) => ({ type: "math", subtype: "summationSymbol", children: [{ text: "\u00b7" }], }); const Element = (attributes, children) => { return <span {...attributes}>{children}</span>; }; const icon = (attributes, children) => { return <span {...attributes}> &#183;{children}</span>; }; export default { slateDOM: dom, MathElement: Element, Icon: icon };
$(function () { $(document).ready(function () { var map; var bounds; var $hsLatitude, $hsLongitude; var infowindow = new google.maps.InfoWindow(); var markersCollection = [] $("#Scontainter").draggable(); Readhs(); setlanguage(); function Readhs() { var req = $.DataAccess.HeatingSystem_Read(localStorage.getItem("hsId")); req.success(function (json) { var data = json.d; if (data) { $("#hsDescr").text(data.DesImpianto + ' ' + data.Descr); $hsLatitude = data.Latitude; $hsLongitude = data.Longitude; setTimeout(function () { loadmap(data.Latitude, data.Longitude); }, 500); } }); } function loadmap(Latitude, Longitude) { var h = $(window).height() - $('.header').height(); //google maps $('#googlemap').height(h); map = new google.maps.Map(document.getElementById('googlemap'), { zoom: 13, zoomControl: false, streetViewControl: false, center: new google.maps.LatLng(Latitude, Longitude), mapTypeId: google.maps.MapTypeId.ROADMAP }); var latlng = new google.maps.LatLng(parseFloat(Latitude), parseFloat(Longitude)); new google.maps.Marker({ position: latlng, icon: 'http://maps.google.com/mapfiles/ms/icons/blue-dot.png', map: map, draggable: false }); bounds = new google.maps.LatLngBounds(); if ($(window).width() > 600) { $('#Scontainter').show({ left: "100px", top: "100px", opacity: 1 }); $("#Scontainter").animate({ left: "100px", top: "100px", opacity: 1 }, { duration: 500, queue: false }); } setTimeout(function () { load(); }, 500); } function load() { $("#ulList").empty(); var r = $.DataAccess.hs_Doors_List(localStorage.getItem("hsId")); r.success(function (json) { var data = json.d; if (data) { $("#tmpllList").tmpl(data).appendTo("#ulList"); for (var i = 0; i < data.length; i++) { if (data[i].Latitude != 0 && data[i].Longitude != 0) { geoLoc(data[i].DoorId, data[i].DoorCod, data[i].Latitude, data[i].Longitude); } }//end for $('#ulList').slimscroll({ height: '400px', wheelStep: 15 }); setlanguage(); } }); } function geoLoc(Id, Cod, Latitude, Longitude) { var latlng; if (Latitude == 0 && Longitude == 0) { latlng = new google.maps.LatLng(parseFloat($hsLatitude), parseFloat($hsLongitude)); } else { latlng = new google.maps.LatLng(parseFloat(Latitude), parseFloat(Longitude)); } DeleteMarker(Id); marker = new google.maps.Marker({ position: latlng, icon: 'http://maps.google.com/mapfiles/ms/icons/red-dot.png', map: map, draggable: true, zIndex: google.maps.Marker.MAX_ZINDEX + 1, id: Id, Cod: Cod }); markersCollection.push(marker); google.maps.event.addListener(marker, 'click', function () { //console.log('click this.id=' + this.id + ' this.IdStall=' + this.IdStall + ' lat=' + this.getPosition().lat() + ' long=' + this.getPosition().lng()); removeActiveClass(); $('#li_' + this.id).addClass("active"); //infowindow.setContent(marker.content); infowindow.setContent(setInfowindowContent(Id, Cod, Latitude, Longitude)); infowindow.open(map, this); setlanguage(); }); google.maps.event.addListener(marker, 'dragstart', function (event) { //console.log('PlaceId=' + this.id); var lat = this.getPosition().lat(); var lng = this.getPosition().lng(); console.log('dragstart this.id=' + this.id + ' this.IdStall=' + this.IdStall + ' lat=' + lat + ' lng=' + lng + ' latlng=' + latlng + ' this.getPosition()=' + this.getPosition()); }); google.maps.event.addListener(marker, 'dragend', function (event) { var lat = this.getPosition().lat(); var lng = this.getPosition().lng(); var latlng = this.getPosition(); //console.log('dragend this.id=' + this.id + ' this.IdStall=' + this.IdStall + ' lat=' + lat + ' lng=' + lng + ' latlng=' + latlng + ' this.getPosition()=' + this.getPosition()); $('#lat_' + this.id).text(lat); $('#long_' + this.id).text(lng); var req = $.DataAccess.hs_Doors_setGeoLocation(this.id, lat, lng); req.success(function (json) { var data = json.d; if (data == true) { console.log('saved'); //$('#resultFor_' + this.id).addClass("operationOk"); } else { //$('#resultFor_' + this.id).addClass("operationNok"); } }); }); } function setInfowindowContent(Id, Cod, Latitude, Longitude) { var html = ""; html = '<div id="content" style="display:block;white-space: nowrap;width:200px;">'; html += '<div id="siteNotice">' + Cod + '</div>'; html += '<div id="info_window">'; html += '<strong>Lat :</strong> ' + Math.round(Latitude * 1000000) / 1000000 + '<br />'; html += '<strong>Long :</strong> ' + Math.round(Longitude * 1000000) / 1000000 + '<br/>'; html += '</div>'; html += '</div>'; return html; } $.fn.sel = function (Id, Cod, Latitude, Longitude) { console.log('$.fn.sel', Id, Cod, Latitude, Longitude); geoLoc(Id, Cod, Latitude, Longitude); } function DeleteMarker(id) { //Find and remove the marker from the Array for (var i = 0; i < markersCollection.length; i++) { if (markersCollection[i].id == id) { //Remove the marker from Map markersCollection[i].setMap(null); //Remove the marker from array. markersCollection.splice(i, 1); return; } } }; function removeActiveClass() { $('#ulList li').each(function (n) { $(this).removeClass("active"); }); } $(window).resize(function () { var h = $(window).height() - $('.header').height(); $('#googlemap').height(h); }); }); //document ready }); function sel(Id, Cod, Latitude, Longitude) { console.log('sel', Id, Cod, Latitude, Longitude); $.fn.sel(Id, Cod, Latitude, Longitude); }
import * as lib from "./lib/lib.js"; import CONSTANTS from "./constants.js"; import { itemPileSocket, SOCKET_HANDLERS } from "./socket.js"; import { ItemPileInventory } from "./formapplications/item-pile-inventory.js"; import DropItemDialog from "./formapplications/drop-item-dialog.js"; import HOOKS from "./hooks.js"; import { hotkeyState } from "./hotkeys.js"; const API = { /** * The actor class type used for the original item pile actor in this system * * @returns {string} */ get ACTOR_CLASS_TYPE() { return game.settings.get(CONSTANTS.MODULE_NAME, "actorClassType"); }, /** * The currencies used in this system * * @returns {array} */ get CURRENCIES() { return game.settings.get(CONSTANTS.MODULE_NAME, "currencies"); }, /** * The attribute used to track the quantity of items in this system * * @returns {string} */ get ITEM_QUANTITY_ATTRIBUTE() { return game.settings.get(CONSTANTS.MODULE_NAME, "itemQuantityAttribute"); }, /** * The filters for item types eligible for interaction within this system * * @returns {Array} */ get ITEM_FILTERS() { return lib.cleanItemFilters(game.settings.get(CONSTANTS.MODULE_NAME, "itemFilters")); }, /** * The attributes for detecting item similarities * * @returns {Array} */ get ITEM_SIMILARITIES() { return game.settings.get(CONSTANTS.MODULE_NAME, "itemSimilarities"); }, /** * Sets the actor class type used for the original item pile actor in this system * * @param {string} inClassType * @returns {Promise} */ async setActorClassType(inClassType) { if (typeof inClassType !== "string") { throw lib.custom_error("setActorTypeClass | inClassType must be of type string"); } return game.settings.set(CONSTANTS.MODULE_NAME, "actorClassType", inClassType); }, /** * Sets the currencies used in this system * * @param {array} inCurrencies * @returns {Promise} */ async setCurrencies(inCurrencies) { if (!Array.isArray(inCurrencies)) { throw lib.custom_error("setCurrencies | inCurrencies must be of type array"); } inCurrencies.forEach(currency => { if (typeof currency !== "object") { throw lib.custom_error("setCurrencies | each entry in the inCurrencies array must be of type object"); } if (typeof currency.name !== "string") { throw lib.custom_error("setCurrencies | currency.name must be of type string"); } if (typeof currency.currency !== "string") { throw lib.custom_error("setCurrencies | currency.path must be of type string"); } if (currency.img && typeof currency.img !== "string") { throw lib.custom_error("setCurrencies | currency.img must be of type string"); } }) return game.settings.set(CONSTANTS.MODULE_NAME, "currencies", inCurrencies); }, /** * Sets the inAttribute used to track the quantity of items in this system * * @param {string} inAttribute * @returns {Promise} */ async setItemQuantityAttribute(inAttribute) { if (typeof inAttribute !== "string") { throw lib.custom_error("setItemQuantityAttribute | inAttribute must be of type string"); } return game.settings.set(CONSTANTS.MODULE_NAME, "itemQuantityAttribute", inAttribute); }, /** * Sets the items filters for interaction within this system * * @param {array} inFilters * @returns {Promise} */ async setItemFilters(inFilters) { if (!Array.isArray(inFilters)) { throw lib.custom_error("setItemFilters | inFilters must be of type array"); } inFilters.forEach(filter => { if (typeof filter?.path !== "string") { throw lib.custom_error("setItemFilters | each entry in inFilters must have a \"path\" property with a value that is of type string"); } if (typeof filter?.filters !== "string") { throw lib.custom_error("setItemFilters | each entry in inFilters must have a \"filters\" property with a value that is of type string"); } }); return game.settings.set(CONSTANTS.MODULE_NAME, "itemFilters", inFilters); }, /** * Sets the attributes for detecting item similarities * * @param {array} inPaths * @returns {Promise} */ async setItemSimilarities(inPaths) { if (!Array.isArray(inPaths)) { throw lib.custom_error("setItemSimilarities | inPaths must be of type array"); } inPaths.forEach(path => { if (typeof path !== "string") { throw lib.custom_error("setItemSimilarities | each entry in inPaths must be of type string"); } }); return game.settings.set(CONSTANTS.MODULE_NAME, "itemSimilarities", inPaths); }, /** * Creates the default item pile token at a location. * * @param {object} position The position to create the item pile at * @param {array/boolean} [items=false] Any items to create on the item pile * @param {string/boolean} [pileActorName=false] Whether to use an existing item pile actor as the basis of this new token * * @returns {Promise} */ async createItemPile(position, { items = false, pileActorName = false } = {}) { const hookResult = Hooks.call(HOOKS.PILE.PRE_CREATE, position, items, pileActorName); if (hookResult === false) return; if (pileActorName) { const pileActor = game.actors.getName(pileActorName); if (!pileActor) { throw lib.custom_error(`There is no actor of the name "${pileActorName}"`, true); } else if (!lib.isValidItemPile(pileActor)) { throw lib.custom_error(`The actor of name "${pileActorName}" is not a valid item pile actor.`, true); } } if (items) { items = items.map(item => { return item instanceof Item ? item.toObject() : item; }) } return itemPileSocket.executeAsGM(SOCKET_HANDLERS.CREATE_PILE, position, { pileActorName, items }); }, /** * Turns tokens and its actors into item piles * * @param {Token/TokenDocument/Array<Token/TokenDocument>} targets The targets to be turned into item piles * @param {object} pileSettings Overriding settings to be put on the item piles' settings * @param {object} tokenSettings Overriding settings that will update the tokens' settings * * @return {Promise<Array>} The uuids of the targets after they were turned into item piles */ async turnTokensIntoItemPiles(targets, { pileSettings = {}, tokenSettings = {} } = {}) { const hookResult = Hooks.call(HOOKS.PILE.PRE_TURN_INTO, targets, pileSettings, tokenSettings); if (hookResult === false) return; if(!Array.isArray(targets)) targets = [targets]; const targetUuids = targets.map(target => { if(!(target instanceof Token || target instanceof TokenDocument)){ throw lib.custom_error(`turnTokensIntoItemPiles | Target must be of type Token or TokenDocument`, true) } const targetUuid = lib.getUuid(target); if (!targetUuid) throw lib.custom_error(`turnTokensIntoItemPiles | Could not determine the UUID, please provide a valid target`, true) return targetUuid; }) return itemPileSocket.executeAsGM(SOCKET_HANDLERS.TURN_INTO_PILE, targetUuids, pileSettings, tokenSettings); }, /** * @private */ async _turnTokensIntoItemPiles(targetUuids, pileSettings = {}, tokenSettings = {}) { const tokenUpdateGroups = {}; const actorUpdateGroups = {}; const defaults = foundry.utils.duplicate(CONSTANTS.PILE_DEFAULTS); for(const targetUuid of targetUuids) { let target = await fromUuid(targetUuid); const existingPileSettings = foundry.utils.mergeObject(defaults, lib.getItemPileData(target)); pileSettings = foundry.utils.mergeObject(existingPileSettings, pileSettings); pileSettings.enabled = true; const targetItems = lib.getActorItems(target, pileSettings.overrideItemFilters); const targetCurrencies = lib.getActorCurrencies(target, pileSettings.overrideCurrencies); const data = { data: pileSettings, items: targetItems, currencies: targetCurrencies }; tokenSettings = foundry.utils.mergeObject(tokenSettings, { "img": lib.getItemPileTokenImage(target, data), "scale": lib.getItemPileTokenScale(target, data), "name": lib.getItemPileName(target, data) }); const sceneId = targetUuid.split('.')[1]; const tokenId = targetUuid.split('.')[3]; if (!tokenUpdateGroups[sceneId]) { tokenUpdateGroups[sceneId] = [] } tokenUpdateGroups[sceneId].push({ "_id": tokenId, ...tokenSettings, [`flags.${CONSTANTS.MODULE_NAME}.${CONSTANTS.PILE_DATA}`]: pileSettings, [`actorData.flags.${CONSTANTS.MODULE_NAME}.${CONSTANTS.PILE_DATA}`]: pileSettings }); if(target.isLinked){ if(actorUpdateGroups[target.actor.id]) continue; actorUpdateGroups[target.actor.id] = { "_id": target.actor.id, [`flags.${CONSTANTS.MODULE_NAME}.${CONSTANTS.PILE_DATA}`]: pileSettings } } } await Actor.updateDocuments(Object.values(actorUpdateGroups)); for(const [sceneId, updateData] of Object.entries(tokenUpdateGroups)){ const scene = game.scenes.get(sceneId); await scene.updateEmbeddedDocuments("Token", updateData); } setTimeout(API.rerenderTokenHud, 100); await itemPileSocket.executeForEveryone(SOCKET_HANDLERS.CALL_HOOK, HOOKS.PILE.TURN_INTO, targetUuids); return targetUuids; }, /** * Reverts tokens from an item pile into a normal token and actor * * @param {Token/TokenDocument/Array<Token/TokenDocument>} targets The targets to be reverted from item piles * @param {object} tokenSettings Overriding settings that will update the tokens * * @return {Promise<Array>} The uuids of the targets after they were reverted from being item piles */ async revertTokensFromItemPiles(targets, { tokenSettings = {} } = {}) { const hookResult = Hooks.call(HOOKS.PILE.PRE_REVERT_FROM, targets, tokenSettings); if (hookResult === false) return; if(!Array.isArray(targets)) targets = [targets]; const targetUuids = targets.map(target => { if(!(target instanceof Token || target instanceof TokenDocument)){ throw lib.custom_error(`revertTokensFromItemPiles | Target must be of type Token or TokenDocument`, true) } const targetUuid = lib.getUuid(target); if (!targetUuid) throw lib.custom_error(`revertTokensFromItemPiles | Could not determine the UUID, please provide a valid target`, true) return targetUuid; }) return itemPileSocket.executeAsGM(SOCKET_HANDLERS.REVERT_FROM_PILE, targetUuids, tokenSettings); }, /** * @private */ async _revertTokensFromItemPiles(targetUuids, tokenSettings) { const actorUpdateGroups = {}; const tokenUpdateGroups = {}; const defaults = foundry.utils.duplicate(CONSTANTS.PILE_DEFAULTS); for(const targetUuid of targetUuids) { let target = await fromUuid(targetUuid); const pileSettings = foundry.utils.mergeObject(defaults, lib.getItemPileData(target)); pileSettings.enabled = false; const sceneId = targetUuid.split('.')[1]; const tokenId = targetUuid.split('.')[3]; if (!tokenUpdateGroups[sceneId]) { tokenUpdateGroups[sceneId] = []; } tokenUpdateGroups[sceneId].push({ "_id": tokenId, ...tokenSettings, [`flags.${CONSTANTS.MODULE_NAME}.${CONSTANTS.PILE_DATA}`]: pileSettings, [`actorData.flags.${CONSTANTS.MODULE_NAME}.${CONSTANTS.PILE_DATA}`]: pileSettings }); if(target.isLinked){ if(actorUpdateGroups[target.actor.id]) continue; actorUpdateGroups[target.actor.id] = { "_id": target.actor.id, [`flags.${CONSTANTS.MODULE_NAME}.${CONSTANTS.PILE_DATA}`]: pileSettings } } } await Actor.updateDocuments(Object.values(actorUpdateGroups)); for(const [sceneId, updateData] of Object.entries(tokenUpdateGroups)){ const scene = game.scenes.get(sceneId); await scene.updateEmbeddedDocuments("Token", updateData); } setTimeout(API.rerenderTokenHud, 100); await itemPileSocket.executeForEveryone(SOCKET_HANDLERS.CALL_HOOK, HOOKS.PILE.REVERT_FROM, targetUuids); return targetUuids; }, /** * Opens a pile if it is enabled and a container * * @param {Token/TokenDocument} target * @param {Token/TokenDocument/boolean} [interactingToken=false] * * @return {Promise} */ async openItemPile(target, interactingToken = false) { const targetDocument = lib.getDocument(target); const interactingTokenDocument = interactingToken ? lib.getDocument(interactingToken) : false; const data = lib.getItemPileData(targetDocument); if (!data?.enabled || !data?.isContainer) return false; const wasLocked = data.locked; const wasClosed = data.closed; data.closed = false; data.locked = false; if (wasLocked) { const hookResult = Hooks.call(HOOKS.PILE.PRE_UNLOCK, targetDocument, data, interactingTokenDocument); if (hookResult === false) return; } const hookResult = Hooks.call(HOOKS.PILE.PRE_OPEN, targetDocument, data, interactingTokenDocument); if (hookResult === false) return; if (wasClosed && data.openSound) { AudioHelper.play({ src: data.openSound }) } return API.updateItemPile(targetDocument, data, { interactingToken: interactingTokenDocument }); }, /** * Closes a pile if it is enabled and a container * * @param {Token/TokenDocument} target Target pile to close * @param {Token/TokenDocument/boolean} [interactingToken=false] * * @return {Promise} */ async closeItemPile(target, interactingToken = false) { const targetDocument = lib.getDocument(target); const interactingTokenDocument = interactingToken ? lib.getDocument(interactingToken) : false; const data = lib.getItemPileData(targetDocument); if (!data?.enabled || !data?.isContainer) return false; const wasClosed = data.closed; data.closed = true; const hookResult = Hooks.call(HOOKS.PILE.PRE_CLOSE, targetDocument, data, interactingTokenDocument); if (hookResult === false) return; if (!wasClosed && data.closeSound) { AudioHelper.play({ src: data.closeSound }) } return API.updateItemPile(targetDocument, data, { interactingToken: interactingTokenDocument }); }, /** * Toggles a pile's closed state if it is enabled and a container * * @param {Token/TokenDocument} target Target pile to open or close * @param {Token/TokenDocument/boolean} [interactingToken=false] * * @return {Promise} */ async toggleItemPileClosed(target, interactingToken = false) { const targetDocument = lib.getDocument(target); const interactingTokenDocument = interactingToken ? lib.getDocument(interactingToken) : false; const data = lib.getItemPileData(targetDocument); if (!data?.enabled || !data?.isContainer) return false; if (data.closed) { await API.openItemPile(targetDocument, interactingTokenDocument); } else { await API.closeItemPile(targetDocument, interactingTokenDocument); } return !data.closed; }, /** * Locks a pile if it is enabled and a container * * @param {Token/TokenDocument} target Target pile to lock * @param {Token/TokenDocument/boolean} [interactingToken=false] * * @return {Promise} */ async lockItemPile(target, interactingToken = false) { const targetDocument = lib.getDocument(target); const interactingTokenDocument = interactingToken ? lib.getDocument(interactingToken) : false; const data = lib.getItemPileData(targetDocument); if (!data?.enabled || !data?.isContainer) return false; const wasClosed = data.closed; data.closed = true; data.locked = true; if (!wasClosed) { const hookResult = Hooks.call(HOOKS.PILE.PRE_CLOSE, targetDocument, data, interactingTokenDocument); if (hookResult === false) return; } const hookResult = Hooks.call(HOOKS.PILE.PRE_LOCK, targetDocument, data, interactingTokenDocument); if (hookResult === false) return; if (!wasClosed && data.closeSound) { AudioHelper.play({ src: data.closeSound }) } return API.updateItemPile(targetDocument, data, { interactingToken: interactingTokenDocument }); }, /** * Unlocks a pile if it is enabled and a container * * @param {Token/TokenDocument} target Target pile to unlock * @param {Token/TokenDocument/boolean} [interactingToken=false] * * @return {Promise} */ async unlockItemPile(target, interactingToken = false) { const targetDocument = lib.getDocument(target); const interactingTokenDocument = interactingToken ? lib.getDocument(interactingToken) : false; const data = lib.getItemPileData(targetDocument); if (!data?.enabled || !data?.isContainer) return false; data.locked = false; Hooks.call(HOOKS.PILE.PRE_UNLOCK, targetDocument, data, interactingTokenDocument); return API.updateItemPile(targetDocument, data, { interactingToken: interactingTokenDocument }); }, /** * Toggles a pile's locked state if it is enabled and a container * * @param {Token/TokenDocument} target Target pile to lock or unlock * @param {Token/TokenDocument/boolean} [interactingToken=false] * * @return {Promise} */ async toggleItemPileLocked(target, interactingToken = false) { const targetDocument = lib.getDocument(target); const interactingTokenDocument = interactingToken ? lib.getDocument(interactingToken) : false; const data = lib.getItemPileData(targetDocument); if (!data?.enabled || !data?.isContainer) return false; if (data.locked) { return API.unlockItemPile(targetDocument, interactingTokenDocument); } return API.lockItemPile(targetDocument, interactingTokenDocument); }, /** * Causes the item pile to play a sound as it was attempted to be opened, but was locked * * @param {Token/TokenDocument} target * @param {Token/TokenDocument/boolean} [interactingToken=false] * * @return {Promise<boolean>} */ async rattleItemPile(target, interactingToken = false) { const targetDocument = lib.getDocument(target); const interactingTokenDocument = interactingToken ? lib.getDocument(interactingToken) : false; const data = lib.getItemPileData(targetDocument); if (!data?.enabled || !data?.isContainer || !data?.locked) return false; Hooks.call(HOOKS.PILE.PRE_RATTLE, targetDocument, data, interactingTokenDocument); if (data.lockedSound) { AudioHelper.play({ src: data.lockedSound }) } await itemPileSocket.executeForEveryone(SOCKET_HANDLERS.CALL_HOOK, HOOKS.PILE.RATTLE, lib.getUuid(targetDocument), data, lib.getUuid(interactingTokenDocument)); return true; }, /** * Whether an item pile is locked. If it is not enabled or not a container, it is always false. * * @param {Token/TokenDocument} target * * @return {boolean} */ isItemPileLocked(target) { const targetDocument = lib.getDocument(target); const data = lib.getItemPileData(targetDocument); if (!data?.enabled || !data?.isContainer) return false; return data.locked; }, /** * Whether an item pile is closed. If it is not enabled or not a container, it is always false. * * @param {Token/TokenDocument} target * * @return {boolean} */ isItemPileClosed(target) { const targetDocument = lib.getDocument(target); const data = lib.getItemPileData(targetDocument); if (!data?.enabled || !data?.isContainer) return false; return data.closed; }, /** * Whether an item pile is a container. If it is not enabled, it is always false. * * @param {Token/TokenDocument} target * * @return {boolean} */ isItemPileContainer(target) { const targetDocument = lib.getDocument(target); const data = lib.getItemPileData(targetDocument); return data?.enabled && data?.isContainer; }, /** * Updates a pile with new data. * * @param {Token/TokenDocument} target * @param {object} newData * @param {Token/TokenDocument/boolean} [interactingToken=false] * @param {object/boolean} [tokenSettings=false] * * @return {Promise} */ async updateItemPile(target, newData, { interactingToken = false, tokenSettings = false } = {}) { const targetUuid = lib.getUuid(target); if (!targetUuid) throw lib.custom_error(`updateItemPile | Could not determine the UUID, please provide a valid target`, true); const interactingTokenUuid = interactingToken ? lib.getUuid(interactingToken) : false; if (interactingToken && !interactingTokenUuid) throw lib.custom_error(`updateItemPile | Could not determine the UUID, please provide a valid target`, true); const hookResult = Hooks.call(HOOKS.PILE.PRE_UPDATE, target, newData, interactingToken, tokenSettings); if (hookResult === false) return; return itemPileSocket.executeAsGM(SOCKET_HANDLERS.UPDATE_PILE, targetUuid, newData, { interactingTokenUuid, tokenSettings }) }, /** * @private */ async _updateItemPile(targetUuid, newData, { interactingTokenUuid = false, tokenSettings = false } = {}) { const target = await fromUuid(targetUuid); const oldData = lib.getItemPileData(target); const data = foundry.utils.mergeObject( foundry.utils.duplicate(oldData), foundry.utils.duplicate(newData) ); const diff = foundry.utils.diffObject(oldData, data); await lib.wait(15); await lib.updateItemPileData(target, data, tokenSettings); if (data.enabled && data.isContainer) { if (diff?.closed === true) { API._executeItemPileMacro(targetUuid, { action: "closeItemPile", source: interactingTokenUuid, target: targetUuid }); } if (diff?.locked === true) { API._executeItemPileMacro(targetUuid, { action: "lockItemPile", source: interactingTokenUuid, target: targetUuid }); } if (diff?.locked === false) { API._executeItemPileMacro(targetUuid, { action: "unlockItemPile", source: interactingTokenUuid, target: targetUuid }); } if (diff?.closed === false) { API._executeItemPileMacro(targetUuid, { action: "openItemPile", source: interactingTokenUuid, target: targetUuid }); } } return itemPileSocket.executeForEveryone(SOCKET_HANDLERS.UPDATED_PILE, targetUuid, diff, interactingTokenUuid); }, /** * @private */ async _updatedItemPile(targetUuid, diffData, interactingTokenUuid) { const target = await lib.getToken(targetUuid); const interactingToken = interactingTokenUuid ? await fromUuid(interactingTokenUuid) : false; if (foundry.utils.isObjectEmpty(diffData)) return; const data = lib.getItemPileData(target); Hooks.callAll(HOOKS.PILE.UPDATE, target, diffData, interactingToken) if (data.enabled && data.isContainer) { if (diffData?.closed === true) { Hooks.callAll(HOOKS.PILE.CLOSE, target, interactingToken) } if (diffData?.locked === true) { Hooks.callAll(HOOKS.PILE.LOCK, target, interactingToken) } if (diffData?.locked === false) { Hooks.callAll(HOOKS.PILE.UNLOCK, target, interactingToken) } if (diffData?.closed === false) { Hooks.callAll(HOOKS.PILE.OPEN, target, interactingToken) } } }, /** * Deletes a pile, calling the relevant hooks. * * @param {Token/TokenDocument} target * * @return {Promise} */ async deleteItemPile(target) { if (!lib.isValidItemPile(target)) { if (!targetUuid) throw lib.custom_error(`deleteItemPile | This is not an item pile, please provide a valid target`, true); } const targetUuid = lib.getUuid(target); if (!targetUuid) throw lib.custom_error(`deleteItemPile | Could not determine the UUID, please provide a valid target`, true); if (!targetUuid.includes("Token")) { throw lib.custom_error(`deleteItemPile | Please provide a Token or TokenDocument`, true); } const hookResult = Hooks.call(HOOKS.PILE.PRE_DELETE, target); if (hookResult === false) return; return itemPileSocket.executeAsGM(SOCKET_HANDLERS.DELETE_PILE, targetUuid); }, async _deleteItemPile(targetUuid) { const target = await lib.getToken(targetUuid); return target.delete(); }, /** * @deprecated */ async openItemPileInventory(...args){ lib.custom_warning("deprecation warning - openItemPileInventory has been renamed to renderItemPileInventory") return this.renderItemPileInterface(...args); }, /** * Remotely opens an item pile's inventory, if you have permission to edit the item pile. Passing a user ID, or a list of user IDs, will cause those users to open the item pile. * * @param {Token/TokenDocument/Actor} target The item pile actor or token whose inventory to open * @param {array<string>} userIds The IDs of the users that should open this item pile inventory * @param {boolean/Token/TokenDocument/Actor} [inspectingTarget=false] This will force the users to inspect this item pile as a specific character * @param {boolean} [useDefaultCharacter=true] Causes the users to inspect the item pile inventory as their default character * @returns {Promise} */ async renderItemPileInterface(target, userIds = [ game.user.id ], { inspectingTarget = false, useDefaultCharacter = true }={}){ const targetDocument = lib.getDocument(target); const targetUuid = lib.getUuid(targetDocument); if (!targetUuid) throw lib.custom_error(`renderItemPileInterface | Could not determine the UUID, please provide a valid target item pile`); if(!lib.isValidItemPile(targetDocument)){ lib.custom_warning("renderItemPileInterface | This target is not a valid item pile") return; } if(inspectingTarget && useDefaultCharacter){ lib.custom_warning("renderItemPileInterface | You cannot force users to use both their default character and a specific character to inspect the pile") return; } if(!Array.isArray(userIds)) userIds = [userIds]; if(!game.user.isGM){ if(!userIds.includes(game.user.id)) { lib.custom_warning(`renderItemPileInterface | You are not a GM, so you cannot force others to render an item pile's interface`); return; } userIds = [game.user.id]; } for(const userId of userIds){ const user = game.users.get(userId); if(!user) throw lib.custom_error(`renderItemPileInterface | No user with ID "${userId}" exists`); if(useDefaultCharacter){ if(!user.character){ lib.custom_warning(`renderItemPileInterface | User with id "${userId}" has no default character`, true); return; } } } const inspectingTargetUuid = inspectingTarget ? lib.getUuid(inspectingTarget) : false; if (inspectingTarget && !inspectingTargetUuid) throw lib.custom_error(`renderItemPileInterface | Could not determine the UUID, please provide a valid inspecting target`); return itemPileSocket.executeForUsers(SOCKET_HANDLERS.RENDER_INTERFACE, userIds, targetUuid, inspectingTargetUuid, useDefaultCharacter) }, async _renderItemPileInterface(targetUuid, inspectingTargetUuid, useDefaultCharacter){ const target = await fromUuid(targetUuid); let inspectingTarget; if(useDefaultCharacter && !game.user.isGM){ inspectingTarget = game.user.character; }else{ inspectingTarget = inspectingTargetUuid ? (await fromUuid(inspectingTargetUuid)) : false; } return ItemPileInventory.show(target, inspectingTarget, { remote: true }); }, /** * Whether a given document is a valid pile or not * * @param {Token/TokenDocument/Actor} document * @return {boolean} */ isValidItemPile(document) { return lib.isValidItemPile(document); }, /** * Whether the item pile is empty * * @param {Token/TokenDocument/Actor} target * @returns {boolean} */ isItemPileEmpty(target){ return lib.isItemPileEmpty(target); }, /** * Returns the items this item pile can transfer * * @param {Token/TokenDocument/Actor} target * @param {array/boolean} [itemFilters=false] Array of item types disallowed - will default to pile settings or module settings if none provided * @returns {Array} */ getItemPileItems(target, itemFilters = false){ return lib.getActorItems(target, itemFilters); }, /** * Returns the currencies this item pile can transfer * * @param {Token/TokenDocument/Actor} target * @returns {array} */ getItemPileCurrencies(target){ return lib.getActorCurrencies(target); }, /** * Refreshes the target image of an item pile, ensuring it remains in sync * * @param {Token/TokenDocument/Actor} target * @return {Promise} */ async refreshItemPile(target) { if (!lib.isValidItemPile(target)) return; const targetUuid = lib.getUuid(target); return itemPileSocket.executeAsGM(SOCKET_HANDLERS.REFRESH_PILE, targetUuid) }, /** * @private */ async _refreshItemPile(targetUuid) { const targetDocument = await fromUuid(targetUuid); if (!lib.isValidItemPile(targetDocument)) return; let targets = [targetDocument] if (targetDocument instanceof Actor) { targets = Array.from(canvas.tokens.getDocuments()).filter(token => token.actor === targetDocument); } return Promise.allSettled(targets.map(_target => { return new Promise(async (resolve) => { const uuid = lib.getUuid(_target); const shouldBeDeleted = await API._checkItemPileShouldBeDeleted(uuid); if (!shouldBeDeleted) { await _target.update({ "img": lib.getItemPileTokenImage(targetDocument), "scale": lib.getItemPileTokenScale(targetDocument), "name": lib.getItemPileName(targetDocument) }) } resolve(); }) })); }, /** * Causes all connected users to re-render a specific pile's inventory UI * * @param {string} inPileUuid The uuid of the pile to be re-rendered * @param {boolean} [deleted=false] Whether the pile was deleted as a part of this re-render * @return {Promise} */ async rerenderItemPileInventoryApplication(inPileUuid, deleted = false) { return itemPileSocket.executeForEveryone(SOCKET_HANDLERS.RERENDER_PILE_INVENTORY, inPileUuid, deleted); }, /** * @private */ async _rerenderItemPileInventoryApplication(inPileUuid, deleted = false) { return ItemPileInventory.rerenderActiveApp(inPileUuid, deleted); }, /** * Splits an item pile's content between all players (or a specified set of target actors). * * @param itemPile {Token/TokenDocument/Actor} The item pile to split * @param targets {boolean/TokenDocument/Actor/Array<TokenDocument/Actor>} [targets=false] The targets to receive the split contents * @param instigator {boolean/TokenDocument/Actor} [instigator=false] Whether this was triggered by a specific actor * @returns {Promise<object>} */ async splitItemPileContents(itemPile, { targets = false, instigator = false }={}){ if (!lib.isValidItemPile(itemPile)) return false; const itemPileUuid = lib.getUuid(itemPile); if (!itemPileUuid) throw lib.custom_error(`SplitItemPileContents | Could not determine the UUID, please provide a valid item pile`, true) const itemPileActor = itemPile?.actor ?? itemPile; if(targets){ if(!Array.isArray(targets)){ targets = [targets] } targets.forEach(actor => { if(!(actor instanceof TokenDocument || actor instanceof Actor)){ throw lib.custom_error("SplitItemPileContents | Each of the entries in targets must be of type TokenDocument or Actor") } }) targets = targets.map(target => target?.character ?? target?.actor ?? target); } if(instigator && !(instigator instanceof TokenDocument || instigator instanceof Actor)){ throw lib.custom_error("SplitItemPileContents | splitter must be of type TokenDocument or Actor") } const actorUuids = (targets || lib.getPlayersForItemPile(itemPileActor).map(u => u.character)).map(actor => lib.getUuid(actor)); const hookResult = Hooks.call(HOOKS.PILE.PRE_SPLIT_INVENTORY, itemPile, targets, game.user.id, instigator); if (hookResult === false) return; return itemPileSocket.executeAsGM(SOCKET_HANDLERS.SPLIT_PILE, itemPileUuid, actorUuids, game.user.id, instigator); }, async _splitItemPileContents(itemPileUuid, actorUuids, userId, instigator) { const itemPile = await fromUuid(itemPileUuid); const itemPileActor = itemPile?.actor ?? itemPile; const transferData = {}; for(let actorUuid of actorUuids){ const actor = await fromUuid(actorUuid); const itemsToTransfer = lib.getItemPileItemsForActor(itemPileActor, actor, true).filter(item => item.toShare).map(item => { return { _id: item.id, quantity: item.shareLeft }; }).filter(item => item.quantity); const currenciesToTransfer = Object.fromEntries(lib.getItemPileCurrenciesForActor(itemPileActor, actor, true).filter(item => item.toShare).map(entry => { return [entry.path, entry.shareLeft] }).filter(currency => currency[1])) transferData[actorUuid] = { itemsTransferred: [], currenciesTransferred: [] } if(itemsToTransfer.length) { transferData[actorUuid].itemsTransferred = await API._transferItems(itemPileUuid, actorUuid, itemsToTransfer, userId, { isEverything: true }); } if(!foundry.utils.isObjectEmpty(currenciesToTransfer)) { transferData[actorUuid].currenciesTransferred = await API._transferAttributes(itemPileUuid, actorUuid, currenciesToTransfer, userId, { isEverything: true }); } await lib.setItemPileSharingData(itemPileUuid, actorUuid, { items: transferData[actorUuid].itemsTransferred, currencies: transferData[actorUuid].currenciesTransferred }); } await itemPileSocket.executeForEveryone( SOCKET_HANDLERS.CALL_HOOK, HOOKS.PILE.SPLIT_INVENTORY, itemPileUuid, transferData, userId, instigator ); const macroData = { action: "splitInventory", source: itemPileUuid, target: actorUuids, transfers: transferData, userId: userId, instigator: instigator }; await API._executeItemPileMacro(itemPileUuid, macroData); const shouldBeDeleted = await API._checkItemPileShouldBeDeleted(itemPileUuid); await API.rerenderItemPileInventoryApplication(itemPileUuid, shouldBeDeleted); if (shouldBeDeleted) { await API._deleteItemPile(itemPileUuid); }else if(lib.isItemPileEmpty(itemPileActor)){ await lib.clearItemPileSharingData(itemPileActor); } return transferData; }, /* --- ITEM AND ATTRIBUTE METHODS --- */ /** * Adds item to an actor, increasing item quantities if matches were found * * @param {Actor/TokenDocument/Token} target The target to add an item to * @param {array} items An array of objects, with the key "item" being an item object or an Item class (the foundry class), with an optional key of "quantity" being the amount of the item to add * @param {boolean} [mergeSimilarItems=true] Whether to merge similar items based on their name and type * @param {string/boolean} [interactionId=false] The interaction ID of this action * * @returns {Promise<array>} An array of objects, each containing the item that was added or updated, and the quantity that was added */ async addItems(target, items, { mergeSimilarItems = true, interactionId = false }={}) { const hookResult = Hooks.call(HOOKS.ITEM.PRE_ADD, target, items, interactionId); if (hookResult === false) return; const targetUuid = lib.getUuid(target); if (!targetUuid) throw lib.custom_error(`AddItems | Could not determine the UUID, please provide a valid target`, true) const itemsToAdd = [] items.forEach(itemData => { let item = itemData; if(itemData instanceof Item){ item = itemData.toObject(); }else if(itemData.item instanceof Item){ item = itemData.item.toObject(); }else if(itemData.item){ item = itemData.item; } if(itemData?.quantity !== undefined){ setProperty(item, API.ITEM_QUANTITY_ATTRIBUTE, itemData?.quantity) } const existingItems = mergeSimilarItems ? lib.findSimilarItem(itemsToAdd, item) : false; if(existingItems){ setProperty(existingItems, API.ITEM_QUANTITY_ATTRIBUTE, lib.getItemQuantity(existingItems) + lib.getItemQuantity(item)) }else{ itemsToAdd.push(item); } }); if(interactionId){ if (typeof interactionId !== "string") throw lib.custom_error(`AddItems | interactionId must be of type string`); } return itemPileSocket.executeAsGM(SOCKET_HANDLERS.ADD_ITEMS, targetUuid, itemsToAdd, game.user.id, { interactionId }); }, /** * @private */ async _addItems(targetUuid, items, userId, { runHooks = true, interactionId = false } = {}) { const target = await fromUuid(targetUuid); const targetActor = target instanceof TokenDocument ? target.actor : target; const targetActorItems = Array.from(targetActor.items); const itemsAdded = []; const itemsToCreate = []; const itemsToUpdate = []; for (const itemData of items) { let item = itemData?.item ?? itemData; const foundItem = lib.findSimilarItem(targetActorItems, item); const incomingQuantity = Number(itemData?.quantity ?? lib.getItemQuantity(itemData)); if (foundItem) { item = foundItem.toObject(); const currentQuantity = lib.getItemQuantity(item); const newQuantity = currentQuantity + incomingQuantity; itemsToUpdate.push({ "_id": item._id, [API.ITEM_QUANTITY_ATTRIBUTE]: newQuantity }); setProperty(item, API.ITEM_QUANTITY_ATTRIBUTE, newQuantity) itemsAdded.push({ item: item, quantity: incomingQuantity }); } else { setProperty(item, API.ITEM_QUANTITY_ATTRIBUTE, incomingQuantity) itemsToCreate.push(item); } } const itemsCreated = await targetActor.createEmbeddedDocuments("Item", itemsToCreate); await targetActor.updateEmbeddedDocuments("Item", itemsToUpdate); itemsCreated.forEach(item => { const itemObject = item.toObject() itemsAdded.push({ item: itemObject, quantity: lib.getItemQuantity(itemObject) }) }); if (runHooks) { await itemPileSocket.executeForEveryone(SOCKET_HANDLERS.CALL_HOOK, HOOKS.ITEM.ADD, targetUuid, itemsAdded, userId, interactionId); const macroData = { action: "addItems", target: targetUuid, items: itemsAdded, userId: userId, interactionId: interactionId }; await API._executeItemPileMacro(targetUuid, macroData); await API.rerenderItemPileInventoryApplication(targetUuid); } return itemsAdded; }, /** * Subtracts the quantity of items on an actor. If the quantity of an item reaches 0, the item is removed from the actor. * * @param {Actor/Token/TokenDocument} target The target to remove a items from * @param {array} items An array of objects each containing the item id (key "_id") and the quantity to remove (key "quantity"), or Items (the foundry class) or strings of IDs to remove all quantities of * @param {string/boolean} [interactionId=false] The interaction ID of this action * * @returns {Promise<array>} An array of objects, each containing the item that was removed or updated, the quantity that was removed, and whether the item was deleted */ async removeItems(target, items, { interactionId = false }={}) { const hookResult = Hooks.call(HOOKS.ITEM.PRE_REMOVE, target, items, interactionId); if (hookResult === false) return; const targetUuid = lib.getUuid(target); if (!targetUuid) throw lib.custom_error(`RemoveItems | Could not determine the UUID, please provide a valid target`, true); const targetActorItems = API.getItemPileItems(target); items = items.map(itemData => { let item; if(typeof itemData === "string" || itemData._id){ const itemId = typeof itemData === "string" ? itemData : itemData._id; item = targetActorItems.find(actorItem => actorItem.id === itemId); if (!item) { throw lib.custom_error(`RemoveItems | Could not find item with id "${itemId}" on target "${targetUuid}"`, true) } item = item.toObject(); }else{ if(itemData.item instanceof Item){ item = itemData.item.toObject(); }else{ item = itemData.item; } let foundActorItem = targetActorItems.find(actorItem => actorItem.id === item._id); if (!foundActorItem) { throw lib.custom_error(`RemoveItems | Could not find item with id "${item._id}" on target "${targetUuid}"`, true) } } return { _id: item._id, quantity: itemData?.quantity ?? lib.getItemQuantity(item) } }); if(interactionId){ if (typeof interactionId !== "string") throw lib.custom_error(`RemoveItems | interactionId must be of type string`); } return itemPileSocket.executeAsGM(SOCKET_HANDLERS.REMOVE_ITEMS, targetUuid, items, game.user.id, { interactionId }); }, /** * @private */ async _removeItems(targetUuid, items, userId, { runHooks = true, interactionId = false } = {}) { const target = await fromUuid(targetUuid); const targetActor = target instanceof TokenDocument ? target.actor : target; const itemsRemoved = []; const itemsToUpdate = []; const itemsToDelete = []; for (const itemData of items) { let item = targetActor.items.get(itemData._id); if(!item) continue; item = item.toObject(); const currentQuantity = lib.getItemQuantity(item); const quantityToRemove = itemData.quantity; const newQuantity = Math.max(0, currentQuantity - quantityToRemove); if (newQuantity >= 1) { itemsToUpdate.push({ _id: item._id, [API.ITEM_QUANTITY_ATTRIBUTE]: newQuantity }); setProperty(item, API.ITEM_QUANTITY_ATTRIBUTE, quantityToRemove); itemsRemoved.push({ item: item, quantity: quantityToRemove, deleted: false }); } else { itemsToDelete.push(item._id); setProperty(item, API.ITEM_QUANTITY_ATTRIBUTE, currentQuantity); itemsRemoved.push({ item: item, quantity: currentQuantity, deleted: true }); } } await targetActor.updateEmbeddedDocuments("Item", itemsToUpdate); await targetActor.deleteEmbeddedDocuments("Item", itemsToDelete); if (runHooks) { await itemPileSocket.executeForEveryone(SOCKET_HANDLERS.CALL_HOOK, HOOKS.ITEM.REMOVE, targetUuid, itemsRemoved, userId, interactionId); const macroData = { action: "removeItems", target: targetUuid, items: itemsRemoved, userId: userId, interactionId: interactionId }; await API._executeItemPileMacro(targetUuid, macroData); const shouldBeDeleted = await API._checkItemPileShouldBeDeleted(targetUuid); await API.rerenderItemPileInventoryApplication(targetUuid, shouldBeDeleted); if (shouldBeDeleted) { await API._deleteItemPile(targetUuid); } } return itemsRemoved; }, /** * Transfers items from the source to the target, subtracting a number of quantity from the source's item and adding it to the target's item, deleting items from the source if their quantity reaches 0 * * @param {Actor/Token/TokenDocument} source The source to transfer the items from * @param {Actor/Token/TokenDocument} target The target to transfer the items to * @param {array} items An array of objects each containing the item id (key "_id") and the quantity to transfer (key "quantity"), or Items (the foundry class) or strings of IDs to transfer all quantities of * @param {string/boolean} [interactionId=false] The interaction ID of this action * * @returns {Promise<object>} An array of objects, each containing the item that was added or updated, and the quantity that was transferred */ async transferItems(source, target, items, { interactionId = false }={}) { const hookResult = Hooks.call(HOOKS.ITEM.PRE_TRANSFER, source, target, items, interactionId); if (hookResult === false) return; const sourceUuid = lib.getUuid(source); if (!sourceUuid) throw lib.custom_error(`TransferItems | Could not determine the UUID, please provide a valid source`, true) const sourceActorItems = API.getItemPileItems(source); items = items.map(itemData => { let item; if(typeof itemData === "string" || itemData._id){ const itemId = typeof itemData === "string" ? itemData : itemData._id; item = sourceActorItems.find(actorItem => actorItem.id === itemId); if (!item) { throw lib.custom_error(`TransferItems | Could not find item with id "${itemId}" on target "${sourceUuid}"`, true) } item = item.toObject(); }else if(itemData.item instanceof Item){ item = itemData.item.toObject(); }else{ item = itemData.item; } let foundActorItem = sourceActorItems.find(actorItem => actorItem.id === item._id); if (!foundActorItem) { throw lib.custom_error(`TransferItems | Could not find item with id "${item._id}" on target "${sourceUuid}"`, true) } return { _id: item._id, quantity: Math.max((itemData?.quantity ?? 0) ?? lib.getItemQuantity(itemData)) } }); const targetUuid = lib.getUuid(target); if (!targetUuid) throw lib.custom_error(`TransferItems | Could not determine the UUID, please provide a valid target`, true) if(interactionId){ if (typeof interactionId !== "string") throw lib.custom_error(`TransferItems | interactionId must be of type string`); } return itemPileSocket.executeAsGM(SOCKET_HANDLERS.TRANSFER_ITEMS, sourceUuid, targetUuid, items, game.user.id, { interactionId }); }, /** * @private */ async _transferItems(sourceUuid, targetUuid, items, userId, { runHooks = true, interactionId = false } = {}) { const itemsRemoved = await API._removeItems(sourceUuid, items, userId, { runHooks: false }); const itemsAdded = await API._addItems(targetUuid, itemsRemoved, userId, { runHooks: false }); if (runHooks) { await itemPileSocket.executeForEveryone(SOCKET_HANDLERS.CALL_HOOK, HOOKS.ITEM.TRANSFER, sourceUuid, targetUuid, itemsAdded, userId, interactionId); const macroData = { action: "transferItems", source: sourceUuid, target: targetUuid, itemsAdded: itemsAdded, userId: userId, interactionId: interactionId }; await API._executeItemPileMacro(sourceUuid, macroData); await API._executeItemPileMacro(targetUuid, macroData); const shouldBeDeleted = await API._checkItemPileShouldBeDeleted(sourceUuid); await API.rerenderItemPileInventoryApplication(sourceUuid, shouldBeDeleted); await API.rerenderItemPileInventoryApplication(targetUuid); const itemPile = await fromUuid(sourceUuid); if (shouldBeDeleted) { await API._deleteItemPile(sourceUuid); } else if (lib.isItemPileEmpty(itemPile)) { await lib.clearItemPileSharingData(itemPile); } else { await lib.setItemPileSharingData(sourceUuid, targetUuid, { items: itemsAdded }); } } return itemsAdded; }, /** * Transfers all items between the source and the target. * * @param {Actor/Token/TokenDocument} source The actor to transfer all items from * @param {Actor/Token/TokenDocument} target The actor to receive all the items * @param {array/boolean} [itemFilters=false] Array of item types disallowed - will default to module settings if none provided * @param {string/boolean} [interactionId=false] The interaction ID of this action * * @returns {Promise<array>} An array containing all of the items that were transferred to the target */ async transferAllItems(source, target, { itemFilters = false, interactionId = false } = {}) { const hookResult = Hooks.call(HOOKS.ITEM.PRE_TRANSFER_ALL, source, target, itemFilters, interactionId); if (hookResult === false) return; const sourceUuid = lib.getUuid(source); if (!sourceUuid) throw lib.custom_error(`TransferAllItems | Could not determine the UUID, please provide a valid source`, true) const targetUuid = lib.getUuid(target); if (!targetUuid) throw lib.custom_error(`TransferAllItems | Could not determine the UUID, please provide a valid target`, true) if (itemFilters) { if (!Array.isArray(itemFilters)) throw lib.custom_error(`TransferAllItems | itemFilters must be of type array`); itemFilters.forEach(entry => { if (typeof entry?.path !== "string") throw lib.custom_error(`TransferAllItems | each entry in the itemFilters must have a "path" property that is of type string`); if (typeof entry?.filter !== "string") throw lib.custom_error(`TransferAllItems | each entry in the itemFilters must have a "filter" property that is of type string`); }) } if(interactionId){ if (typeof interactionId !== "string") throw lib.custom_error(`TransferAllItems | interactionId must be of type string`); } return itemPileSocket.executeAsGM(SOCKET_HANDLERS.TRANSFER_ALL_ITEMS, sourceUuid, targetUuid, game.user.id, { itemFilters, interactionId }); }, /** * @private */ async _transferAllItems(sourceUuid, targetUuid, userId, { itemFilters = false, runHooks = false, interactionId = false } = {}) { const source = await fromUuid(sourceUuid); const itemsToRemove = API.getItemPileItems(source, itemFilters).map(item => item.toObject()); const itemsRemoved = await API._removeItems(sourceUuid, itemsToRemove, userId, { runHooks: false, interactionId }); const itemAdded = await API._addItems(targetUuid, itemsRemoved, userId, { runHooks: false, interactionId }); if (runHooks) { await itemPileSocket.executeForEveryone(SOCKET_HANDLERS.TRANSFER_ALL_ITEMS, HOOKS.ITEM.TRANSFER_ALL, sourceUuid, targetUuid, itemAdded, userId, interactionId); const macroData = { action: "transferAllItems", source: sourceUuid, target: targetUuid, items: itemAdded, userId: userId, interactionId: interactionId }; await API._executeItemPileMacro(sourceUuid, macroData); await API._executeItemPileMacro(targetUuid, macroData); const shouldBeDeleted = await API._checkItemPileShouldBeDeleted(sourceUuid); await API.rerenderItemPileInventoryApplication(sourceUuid, shouldBeDeleted); await API.rerenderItemPileInventoryApplication(targetUuid); if (shouldBeDeleted) { await API._deleteItemPile(sourceUuid); } } return itemAdded; }, /** * Adds to attributes on an actor * * @param {Actor/Token/TokenDocument} target The target whose attribute will have a set quantity added to it * @param {object} attributes An object with each key being an attribute path, and its value being the quantity to add * @param {string/boolean} [interactionId=false] The interaction ID of this action * * @returns {Promise<object>} An array containing a key value pair of the attribute path and the quantity of that attribute that was removed * */ async addAttributes(target, attributes, { interactionId = false }={}) { const hookResult = Hooks.call(HOOKS.ATTRIBUTE.PRE_ADD, target, attributes, interactionId); if (hookResult === false) return; const targetUuid = lib.getUuid(target); if (!targetUuid) throw lib.custom_error(`AddAttributes | Could not determine the UUID, please provide a valid target`, true) const targetActor = target instanceof TokenDocument ? target.actor : target; Object.entries(attributes).forEach(entry => { const [attribute, quantity] = entry; if (!hasProperty(targetActor.data, attribute)) { throw lib.custom_error(`AddAttributes | Could not find attribute ${attribute} on target's actor with UUID "${targetUuid}"`, true) } if (!lib.is_real_number(quantity) && quantity > 0) { throw lib.custom_error(`AddAttributes | Attribute "${attribute}" must be of type number and greater than 0`, true) } }); if(interactionId){ if (typeof interactionId !== "string") throw lib.custom_error(`AddAttributes | interactionId must be of type string`); } return itemPileSocket.executeAsGM(SOCKET_HANDLERS.ADD_ATTRIBUTE, targetUuid, attributes, game.user.id, { interactionId }); }, /** * @private */ async _addAttributes(targetUuid, attributes, userId, { runHooks = true, interactionId = false } = {}) { const target = await fromUuid(targetUuid); const targetActor = target instanceof TokenDocument ? target.actor : target; const updates = {}; const attributesAdded = {}; for (const [attribute, quantityToAdd] of Object.entries(attributes)) { const currentQuantity = Number(getProperty(targetActor.data, attribute)); updates[attribute] = currentQuantity + quantityToAdd; attributesAdded[attribute] = currentQuantity + quantityToAdd; } await targetActor.update(updates); if (runHooks) { await itemPileSocket.executeForEveryone(SOCKET_HANDLERS.CALL_HOOK, HOOKS.ATTRIBUTE.ADD, targetUuid, attributesAdded, userId, interactionId); const macroData = { action: "addAttributes", target: targetUuid, attributes: attributesAdded, userId: userId, interactionId: interactionId }; await API._executeItemPileMacro(targetUuid, macroData); await API.rerenderItemPileInventoryApplication(targetUuid); } return attributesAdded; }, /** * Subtracts attributes on the target * * @param {Token/TokenDocument} target The target whose attributes will be subtracted from * @param {array/object} attributes This can be either an array of attributes to subtract (to zero out a given attribute), or an object with each key being an attribute path, and its value being the quantity to subtract * @param {string/boolean} [interactionId=false] The interaction ID of this action * * @returns {Promise<object>} An array containing a key value pair of the attribute path and the quantity of that attribute that was removed */ async removeAttributes(target, attributes, { interactionId = false }={}) { const hookResult = Hooks.call(HOOKS.ATTRIBUTE.PRE_REMOVE, target, attributes, interactionId); if (hookResult === false) return; const targetUuid = lib.getUuid(target); if (!targetUuid) throw lib.custom_error(`RemoveAttributes | Could not determine the UUID, please provide a valid target`, true) const targetActor = target instanceof TokenDocument ? target.actor : target; if (Array.isArray(attributes)) { attributes.forEach(attribute => { if (typeof attribute !== "string") { throw lib.custom_error(`RemoveAttributes | Each attribute in the array must be of type string`, true) } if (!hasProperty(targetActor.data, attribute)) { throw lib.custom_error(`RemoveAttributes | Could not find attribute ${attribute} on target's actor with UUID "${targetUuid}"`, true) } }); } else { Object.entries(attributes).forEach(entry => { const [attribute, quantity] = entry; if (!hasProperty(targetActor.data, attribute)) { throw lib.custom_error(`RemoveAttributes | Could not find attribute ${attribute} on target's actor with UUID "${targetUuid}"`, true) } if (!lib.is_real_number(quantity) && quantity > 0) { throw lib.custom_error(`RemoveAttributes | Attribute "${attribute}" must be of type number and greater than 0`, true) } }); } if(interactionId){ if (typeof interactionId !== "string") throw lib.custom_error(`RemoveAttributes | interactionId must be of type string`); } return itemPileSocket.executeAsGM(SOCKET_HANDLERS.REMOVE_ATTRIBUTES, targetUuid, attributes, game.user.id, { interactionId }); }, /** * @private */ async _removeAttributes(targetUuid, attributes, userId, { runHooks = true, interactionId = false } = {}) { const target = await fromUuid(targetUuid); const targetActor = target instanceof TokenDocument ? target.actor : target; const updates = {}; const attributesRemoved = {}; if (Array.isArray(attributes)) { attributes = Object.fromEntries(attributes.map(attribute => { return [attribute, Number(getProperty(targetActor.data, attribute))]; })) } for (const [attribute, quantityToRemove] of Object.entries(attributes)) { const currentQuantity = Number(getProperty(targetActor.data, attribute)); const newQuantity = Math.max(0, currentQuantity - quantityToRemove); updates[attribute] = newQuantity; // if the target's quantity is above 1, we've removed the amount we expected, otherwise however many were left attributesRemoved[attribute] = newQuantity ? quantityToRemove : currentQuantity; } await targetActor.update(updates); if (runHooks) { await itemPileSocket.executeForEveryone(SOCKET_HANDLERS.CALL_HOOK, HOOKS.ATTRIBUTE.REMOVE, targetUuid, attributesRemoved, userId, interactionId); const macroData = { action: "removeAttributes", target: targetUuid, attributes: attributesRemoved, userId: userId, interactionId: interactionId }; await API._executeItemPileMacro(targetUuid, macroData); const shouldBeDeleted = await API._checkItemPileShouldBeDeleted(targetUuid); await API.rerenderItemPileInventoryApplication(targetUuid, shouldBeDeleted); if (shouldBeDeleted) { await API._deleteItemPile(targetUuid); } } return attributesRemoved; }, /** * Transfers a set quantity of an attribute from a source to a target, removing it or subtracting from the source and adds it the target * * @param {Actor/Token/TokenDocument} source The source to transfer the attribute from * @param {Actor/Token/TokenDocument} target The target to transfer the attribute to * @param {array/object} attributes This can be either an array of attributes to transfer (to transfer all of a given attribute), or an object with each key being an attribute path, and its value being the quantity to transfer * @param {string/boolean} [interactionId=false] The interaction ID of this action * * @returns {Promise<object>} An object containing a key value pair of each attribute transferred, the key being the attribute path and its value being the quantity that was transferred */ async transferAttributes(source, target, attributes, { interactionId = false }={}) { const hookResult = Hooks.call(HOOKS.ATTRIBUTE.PRE_TRANSFER, source, target, attributes, interactionId); if (hookResult === false) return; const sourceUuid = lib.getUuid(source); if (!sourceUuid) throw lib.custom_error(`TransferAttributes | Could not determine the UUID, please provide a valid source`, true) const targetUuid = lib.getUuid(target); if (!targetUuid) throw lib.custom_error(`TransferAttributes | Could not determine the UUID, please provide a valid target`, true) const sourceActor = source instanceof TokenDocument ? source.actor : source; const targetActor = target instanceof TokenDocument ? target.actor : target; if (Array.isArray(attributes)) { attributes.forEach(attribute => { if (typeof attribute !== "string") { throw lib.custom_error(`TransferAttributes | Each attribute in the array must be of type string`, true) } if (!hasProperty(sourceActor.data, attribute)) { throw lib.custom_error(`TransferAttributes | Could not find attribute ${attribute} on source's actor with UUID "${targetUuid}"`, true) } if (!hasProperty(targetActor.data, attribute)) { throw lib.custom_error(`TransferAttributes | Could not find attribute ${attribute} on target's actor with UUID "${targetUuid}"`, true) } }); } else { Object.entries(attributes).forEach(entry => { const [attribute, quantity] = entry; if (!hasProperty(sourceActor.data, attribute)) { throw lib.custom_error(`TransferAttributes | Could not find attribute ${attribute} on source's actor with UUID "${targetUuid}"`, true) } if (!hasProperty(targetActor.data, attribute)) { throw lib.custom_error(`TransferAttributes | Could not find attribute ${attribute} on target's actor with UUID "${targetUuid}"`, true) } if (!lib.is_real_number(quantity) && quantity > 0) { throw lib.custom_error(`TransferAttributes | Attribute "${attribute}" must be of type number and greater than 0`, true) } }); } if(interactionId){ if (typeof interactionId !== "string") throw lib.custom_error(`TransferAttributes | interactionId must be of type string`); } return itemPileSocket.executeAsGM(SOCKET_HANDLERS.TRANSFER_ATTRIBUTES, sourceUuid, targetUuid, attributes, game.user.id, { interactionId }); }, /** * @private */ async _transferAttributes(sourceUuid, targetUuid, attributes, userId, { runHooks = true, interactionId = false }={}) { const attributesRemoved = await API._removeAttributes(sourceUuid, attributes, userId, { runHooks: false }); await API._addAttributes(targetUuid, attributesRemoved, userId, { runHooks: false }); if (runHooks) { await itemPileSocket.executeForEveryone(SOCKET_HANDLERS.CALL_HOOK, HOOKS.ATTRIBUTE.TRANSFER, sourceUuid, targetUuid, attributesRemoved, userId, interactionId); const macroData = { action: "transferAttributes", source: sourceUuid, target: targetUuid, attributes: attributesRemoved, userId: userId, interactionId: interactionId }; await API._executeItemPileMacro(sourceUuid, macroData); await API._executeItemPileMacro(targetUuid, macroData); const shouldBeDeleted = await API._checkItemPileShouldBeDeleted(sourceUuid); await API.rerenderItemPileInventoryApplication(sourceUuid, shouldBeDeleted); await API.rerenderItemPileInventoryApplication(targetUuid); const itemPile = await fromUuid(sourceUuid) if (shouldBeDeleted) { await API._deleteItemPile(sourceUuid); } else if (lib.isItemPileEmpty(itemPile)) { await lib.clearItemPileSharingData(itemPile); } else { await lib.setItemPileSharingData(sourceUuid, targetUuid, { currencies: attributesRemoved }); } } return attributesRemoved; }, /** * Transfers all dynamic attributes from a source to a target, removing it or subtracting from the source and adding them to the target * * @param {Actor/Token/TokenDocument} source The source to transfer the attributes from * @param {Actor/Token/TokenDocument} target The target to transfer the attributes to * @param {string/boolean} [interactionId=false] The interaction ID of this action * * @returns {Promise<object>} An object containing a key value pair of each attribute transferred, the key being the attribute path and its value being the quantity that was transferred */ async transferAllAttributes(source, target, { interactionId = false }={}) { const hookResult = Hooks.call(HOOKS.ATTRIBUTE.PRE_TRANSFER_ALL, source, target, interactionId); if (hookResult === false) return; const sourceUuid = lib.getUuid(source); if (!sourceUuid) throw lib.custom_error(`TransferAllAttributes | Could not determine the UUID, please provide a valid source`, true); const targetUuid = lib.getUuid(target); if (!targetUuid) throw lib.custom_error(`TransferAllAttributes | Could not determine the UUID, please provide a valid target`, true); if(interactionId){ if (typeof interactionId !== "string") throw lib.custom_error(`TransferAllAttributes | interactionId must be of type string`); } return itemPileSocket.executeAsGM(SOCKET_HANDLERS.TRANSFER_ALL_ATTRIBUTES, sourceUuid, targetUuid, game.user.id, { interactionId }); }, /** * @private */ async _transferAllAttributes(sourceUuid, targetUuid, userId, { runHooks = true, interactionId = false } = {}) { const source = await fromUuid(sourceUuid); const sourceActor = source instanceof TokenDocument ? source.actor : source; const target = await fromUuid(targetUuid); const targetActor = target instanceof TokenDocument ? target.actor : target; const sourceAttributes = API.getItemPileCurrencies(sourceActor); const attributesToTransfer = sourceAttributes.filter(attribute => { return hasProperty(targetActor.data, attribute.path); }).map(attribute => attribute.path); const attributesRemoved = await API._removeAttributes(sourceUuid, attributesToTransfer, userId, { runHooks: false }); const attributesAdded = await API._addAttributes(targetUuid, attributesRemoved, userId, { runHooks: false }); if (runHooks) { await itemPileSocket.executeForEveryone(SOCKET_HANDLERS.CALL_HOOK, HOOKS.ATTRIBUTE.TRANSFER_ALL, sourceUuid, targetUuid, attributesAdded, userId, interactionId); const macroData = { action: "transferAllAttributes", source: sourceUuid, target: targetUuid, attributes: attributesAdded, userId: userId, interactionId: interactionId }; await API._executeItemPileMacro(sourceUuid, macroData); await API._executeItemPileMacro(targetUuid, macroData); const shouldBeDeleted = await API._checkItemPileShouldBeDeleted(sourceUuid); await API.rerenderItemPileInventoryApplication(sourceUuid, shouldBeDeleted); if (shouldBeDeleted) { await API._deleteItemPile(sourceUuid); } } return attributesAdded; }, /** * Transfers all items and attributes between the source and the target. * * @param {Actor/Token/TokenDocument} source The actor to transfer all items and attributes from * @param {Actor/Token/TokenDocument} target The actor to receive all the items and attributes * @param {array/boolean} [itemFilters=false] Array of item types disallowed - will default to module settings if none provided * @param {string/boolean} [interactionId=false] The ID of this interaction * * @returns {Promise<object>} An object containing all items and attributes transferred to the target */ async transferEverything(source, target, { itemFilters = false, interactionId = false } = {}) { const hookResult = Hooks.call(HOOKS.PRE_TRANSFER_EVERYTHING, source, target, itemFilters, interactionId); if (hookResult === false) return; const sourceUuid = lib.getUuid(source); if (!sourceUuid) throw lib.custom_error(`TransferEverything | Could not determine the UUID, please provide a valid source`, true) const targetUuid = lib.getUuid(target); if (!targetUuid) throw lib.custom_error(`TransferEverything | Could not determine the UUID, please provide a valid target`, true) if (itemFilters) { if (!Array.isArray(itemFilters)) throw lib.custom_error(`TransferEverything | itemFilters must be of type array`); itemFilters.forEach(entry => { if (typeof entry?.path !== "string") throw lib.custom_error(`TransferEverything | each entry in the itemFilters must have a "path" property that is of type string`); if (typeof entry?.filter !== "string") throw lib.custom_error(`TransferEverything | each entry in the itemFilters must have a "filter" property that is of type string`); }) } if(interactionId){ if (typeof interactionId !== "string") throw lib.custom_error(`TransferEverything | interactionId must be of type string`); } return itemPileSocket.executeAsGM(SOCKET_HANDLERS.TRANSFER_EVERYTHING, sourceUuid, targetUuid, game.user.id, { itemFilters, interactionId }) }, /** * @private */ async _transferEverything(sourceUuid, targetUuid, userId, { itemFilters = false, interactionId } = {}) { const itemsTransferred = await API._transferAllItems(sourceUuid, targetUuid, userId, { itemFilters, isEverything: true, interactionId }); const currenciesTransferred = await API._transferAllAttributes(sourceUuid, targetUuid, userId, { isEverything: true, interactionId }); await itemPileSocket.executeForEveryone(SOCKET_HANDLERS.CALL_HOOK, HOOKS.TRANSFER_EVERYTHING, sourceUuid, targetUuid, itemsTransferred, currenciesTransferred, userId, interactionId); const macroData = { action: "transferEverything", source: sourceUuid, target: targetUuid, items: itemsTransferred, attributes: currenciesTransferred, userId: userId, interactionId: interactionId }; await API._executeItemPileMacro(sourceUuid, macroData); await API._executeItemPileMacro(targetUuid, macroData); const shouldBeDeleted = await API._checkItemPileShouldBeDeleted(sourceUuid); await API.rerenderItemPileInventoryApplication(sourceUuid, shouldBeDeleted); await API.rerenderItemPileInventoryApplication(targetUuid); if (shouldBeDeleted) { await API._deleteItemPile(sourceUuid); } return { itemsTransferred, currenciesTransferred }; }, /* -------- UTILITY METHODS -------- */ /** * Causes every user's token HUD to rerender * * @return {Promise} */ async rerenderTokenHud() { return itemPileSocket.executeForEveryone(SOCKET_HANDLERS.RERENDER_TOKEN_HUD); }, /** * @private */ async _rerenderTokenHud() { if (!canvas.tokens.hud.rendered) return; await canvas.tokens.hud.render(true) return true; }, /* -------- PRIVATE ITEM PILE METHODS -------- */ /** * Initializes a pile on the client-side. * * @param {TokenDocument} tokenDocument * @return {Promise<boolean>} * @private */ async _initializeItemPile(tokenDocument) { if (!lib.isValidItemPile(tokenDocument)) return false; const pileData = lib.getItemPileData(tokenDocument); if (game.settings.get(CONSTANTS.MODULE_NAME, "preloadFiles")) { await Promise.allSettled(Object.entries(pileData).map(entry => { return new Promise(async (resolve) => { const [key, value] = entry; if (preloadedFiles.has(value) || !value){ return resolve(); } if (key.toLowerCase().includes("image")) { preloadedFiles.add(value); lib.debug(`Preloaded image: ${value}`); await loadTexture(value); } else if (key.toLowerCase().includes("sound")) { preloadedFiles.add(value); lib.debug(`Preloaded sound: ${value}`); await AudioHelper.preloadSound(value); } return resolve(); }); })); } lib.debug(`Initialized item pile with uuid ${tokenDocument.uuid}`); return true; }, /** * This executes any macro that is configured on the item pile, providing the macro with extra data relating to the * action that prompted the execution (if the advanced-macros module is installed) * * @param {String} targetUuid * @param {Object} macroData * @return {Promise} * @private */ async _executeItemPileMacro(targetUuid, macroData) { const target = await fromUuid(targetUuid); if (!lib.isValidItemPile(target)) return; const pileData = lib.getItemPileData(target); if (!pileData.macro) return; const macro = game.macros.getName(pileData.macro); if (!macro) { throw lib.custom_error(`Could not find macro with name "${pileData.macro}" on target with UUID ${target.uuid}`); } // Reformat macro data to contain useful information if (macroData.source) { macroData.source = await fromUuid(macroData.source); } if (macroData.target) { macroData.target = await fromUuid(macroData.target); } const targetActor = macroData.target instanceof TokenDocument ? macroData.target.actor : macroData.target; if (macroData.item) { macroData.items = macroData.items.map(item => targetActor.items.get(item._id)); } return macro.execute([macroData]); }, /** * This handles any dropped data onto the canvas or a set item pile * * @param {canvas} canvas * @param {object} data * @param {Actor/Token/TokenDocument/boolean}[target=false] * @return {Promise} * @private */ async _dropData(canvas, data, { target = false } = {}) { if (data.type !== "Item") return; let itemData; if(data.pack){ const uuid = `Compendium.${data.pack}.${data.id}`; const item = await fromUuid(uuid); itemData = item.toObject(); }else if(data.id){ itemData = game.items.get(data.id)?.toObject(); }else{ itemData = data.data; } if (!itemData) { console.error(data); throw lib.custom_error("Something went wrong when dropping this item!") } const dropData = { source: false, target: target, itemData: { item: itemData, quantity: 1 }, position: false } if (data.tokenId) { dropData.source = canvas.tokens.get(data.tokenId).actor; } else if (data.actorId) { dropData.source = game.actors.get(data.actorId); } if (!dropData.source && !game.user.isGM) { return lib.custom_warning(game.i18n.localize("ITEM-PILES.Errors.NoSourceDrop"), true) } const pre_drop_determined_hook = Hooks.call(HOOKS.ITEM.PRE_DROP_DETERMINED, dropData.source, dropData.target, dropData.position, dropData.itemData); if (pre_drop_determined_hook === false) return; let action; let droppableDocuments = []; let x; let y; if (dropData.target) { droppableDocuments.push(dropData.target); } else { const position = canvas.grid.getTopLeft(data.x, data.y); x = position[0]; y = position[1]; droppableDocuments = lib.getTokensAtLocation({ x, y }) .map(token => token.document) .filter(token => lib.isValidItemPile(token)); } if(droppableDocuments.length && game.modules.get("midi-qol")?.active && game.settings.get('midi-qol', "DragDropTarget")){ lib.custom_warning("You have Drag & Drop Targetting enabled in MidiQOL, which disables drag & drop items") return; } if (droppableDocuments.length > 0 && !game.user.isGM) { if(!(droppableDocuments[0] instanceof Actor && dropData.source instanceof Actor)) { const sourceToken = canvas.tokens.placeables.find(token => token.actor === dropData.source); if (sourceToken) { const targetToken = droppableDocuments[0]; const distance = Math.floor(lib.distance_between_rect(sourceToken, targetToken.object) / canvas.grid.size) + 1 const pileData = lib.getItemPileData(targetToken); const maxDistance = pileData.distance ? pileData.distance : Infinity; if (distance > maxDistance) { lib.custom_warning(game.i18n.localize("ITEM-PILES.Errors.PileTooFar"), true); return; } } } droppableDocuments = droppableDocuments.filter(token => !API.isItemPileLocked(token)); if (!droppableDocuments.length) { lib.custom_warning(game.i18n.localize("ITEM-PILES.Errors.PileLocked"), true); return; } } const disallowedType = lib.isItemInvalid(droppableDocuments?.[0], itemData); if (disallowedType) { if (!game.user.isGM) { return lib.custom_warning(game.i18n.format("ITEM-PILES.Errors.DisallowedItemDrop", { type: disallowedType }), true) } if (!hotkeyState.shiftDown) { const force = await Dialog.confirm({ title: game.i18n.localize("ITEM-PILES.Dialogs.DropTypeWarning.Title"), content: `<p class="item-piles-dialog">${game.i18n.format("ITEM-PILES.Dialogs.DropTypeWarning.Content", { type: disallowedType })}</p>`, defaultYes: false }); if (!force) { return; } } } if (hotkeyState.altDown) { if (droppableDocuments.length) { action = "addToPile"; } setProperty(dropData.itemData.item, API.ITEM_QUANTITY_ATTRIBUTE, 1); dropData.itemData.quantity = 1; } else { const result = await DropItemDialog.query(itemData, droppableDocuments[0]); if (!result) return; action = result.action; setProperty(dropData.itemData.item, API.ITEM_QUANTITY_ATTRIBUTE, Number(result.quantity)) dropData.itemData.quantity = Number(result.quantity); } if (action === "addToPile") { dropData.target = droppableDocuments[0]; } else { dropData.position = { x, y }; } const hookResult = Hooks.call(HOOKS.ITEM.PRE_DROP, dropData.source, dropData.target, dropData.position, dropData.itemData); if (hookResult === false) return; return itemPileSocket.executeAsGM(SOCKET_HANDLERS.DROP_ITEMS, { userId: game.user.id, sceneId: canvas.scene.id, sourceUuid: lib.getUuid(dropData.source), targetUuid: lib.getUuid(dropData.target), position: dropData.position, itemData: dropData.itemData }); }, /** * If not given an actor, this method creates an item pile at a location, then adds an item to it. * * If a target was provided, it will just add the item to that target actor. * * If an actor was provided, it will transfer the item from the actor to the target actor. * * @param {string} userId * @param {string} sceneId * @param {string/boolean} [sourceUuid=false] * @param {string/boolean} [targetUuid=false] * @param {object/boolean} [position=false] * @param {object} [itemData=false] * * @returns {Promise<{sourceUuid: string/boolean, targetUuid: string/boolean, position: object/boolean, itemsDropped: array }>} * @private */ async _dropItems({ userId, sceneId, sourceUuid = false, targetUuid = false, itemData = false, position = false } = {}) { let itemsDropped; // If there's a source of the item (it wasn't dropped from the item bar) if (sourceUuid) { const itemsToTransfer = [{ _id: itemData.item._id, quantity: itemData.quantity }]; // If there's a target token, add the item to it, otherwise create a new pile at the drop location if (targetUuid) { itemsDropped = await API._transferItems(sourceUuid, targetUuid, itemsToTransfer, userId); } else { itemsDropped = await API._removeItems(sourceUuid, itemsToTransfer, userId); targetUuid = await API._createItemPile(sceneId, position, { items: itemsDropped }); } // If there's no source (it was dropped from the item bar) } else { // If there's a target token, add the item to it, otherwise create a new pile at the drop location if (targetUuid) { itemsDropped = await API._addItems(targetUuid, [itemData], userId); } else { targetUuid = await API._createItemPile(sceneId, position, { items: [itemData] }); } } await itemPileSocket.executeForEveryone(SOCKET_HANDLERS.CALL_HOOK, HOOKS.ITEM.DROP, sourceUuid, targetUuid, itemsDropped, position); return { sourceUuid, targetUuid, position, itemsDropped }; }, /** * @param {string} sceneId * @param {object} position * @param {string/boolean} [pileActorName=false] * @param {array/boolean} [items=false] * @returns {Promise<string>} * @private */ async _createItemPile(sceneId, position, { pileActorName = false, items = false } = {}) { let pileActor; if (!pileActorName) { pileActor = game.settings.get(CONSTANTS.MODULE_NAME, "defaultItemPileActorID") ? game.actors.get(game.settings.get(CONSTANTS.MODULE_NAME, "defaultItemPileActorID")) : false; if (!pileActor) { lib.custom_notify("A Default Item Pile has been added to your Actors list. You can configure the default look and behavior on it, or duplicate it to create different styles.") const pileDataDefaults = foundry.utils.duplicate(CONSTANTS.PILE_DEFAULTS); pileDataDefaults.enabled = true; pileDataDefaults.deleteWhenEmpty = true; pileDataDefaults.displayOne = true; pileDataDefaults.showItemName = true; pileDataDefaults.overrideSingleItemScale = true; pileDataDefaults.singleItemScale = 0.75; pileActor = await Actor.create({ name: "Default Item Pile", type: game.settings.get(CONSTANTS.MODULE_NAME, "actorClassType"), img: "icons/svg/item-bag.svg", [`flags.${CONSTANTS.MODULE_NAME}.${CONSTANTS.PILE_DATA}`]: pileDataDefaults }); await pileActor.update({ "token": { name: "Item Pile", actorLink: false, bar1: { attribute: "" }, vision: false, displayName: 50, [`flags.${CONSTANTS.MODULE_NAME}.${CONSTANTS.PILE_DATA}`]: pileDataDefaults } }) await game.settings.set(CONSTANTS.MODULE_NAME, "defaultItemPileActorID", pileActor.id); } } else { pileActor = game.actors.getName(pileActorName); } let overrideData = { ...position }; const pileData = lib.getItemPileData(pileActor); if (!pileActor.data.token.actorLink) { items = items ? items.map(itemData => itemData.item ?? itemData) : []; overrideData['actorData'] = { items: items } const data = { data: pileData, items: items }; overrideData = foundry.utils.mergeObject(overrideData, { "img": lib.getItemPileTokenImage(pileActor, data), "scale": lib.getItemPileTokenScale(pileActor, data), "name": lib.getItemPileName(pileActor, data), }); } const tokenData = await pileActor.getTokenData(overrideData); const scene = game.scenes.get(sceneId); const [tokenDocument] = await scene.createEmbeddedDocuments("Token", [tokenData]); return lib.getUuid(tokenDocument); }, /** * @private */ async _itemPileClicked(pileDocument) { if(!lib.isValidItemPile(pileDocument)) return; const pileToken = pileDocument.object; if (!lib.isGMConnected()){ lib.custom_warning(`Item Piles requires a GM to be connected for players to be able to loot item piles.`, true) return; } lib.debug(`Clicked: ${pileDocument.uuid}`); const data = lib.getItemPileData(pileDocument); const maxDistance = data.distance ? data.distance : Infinity; let validTokens = []; if(canvas.tokens.controlled.length > 0){ validTokens = [...canvas.tokens.controlled]; validTokens = validTokens.filter(token => token.document !== pileDocument); } if(!validTokens.length && !game.user.isGM){ validTokens.push(...canvas.tokens.placeables); if (_token) { validTokens.unshift(_token); } } validTokens = validTokens.filter(token => token.owner && token.document !== pileDocument).filter(token => { return lib.tokens_close_enough(pileToken, token, maxDistance) || game.user.isGM; }); if (!validTokens.length && !game.user.isGM && maxDistance !== Infinity) { lib.custom_warning(game.i18n.localize("ITEM-PILES.Errors.PileTooFar"), true); return; } let interactingActor; if(validTokens.length) { if (validTokens.includes(_token)) { interactingActor = _token.actor; } else { validTokens.sort((potentialTargetA, potentialTargetB) => { return lib.grids_between_tokens(pileToken, potentialTargetA) - lib.grids_between_tokens(pileToken, potentialTargetB); }) interactingActor = validTokens[0].actor; } } else if(game.user.character){ interactingActor = game.user.character; } if (data.isContainer && interactingActor) { if (data.locked && !game.user.isGM) { lib.debug(`Attempted to locked item pile with UUID ${pileDocument.uuid}`); return API.rattleItemPile(pileDocument, interactingActor); } if (data.closed) { lib.debug(`Opened item pile with UUID ${pileDocument.uuid}`); await API.openItemPile(pileDocument, interactingActor); } } return ItemPileInventory.show(pileDocument, interactingActor); }, /** * @private */ async _checkItemPileShouldBeDeleted(targetUuid) { const target = await fromUuid(targetUuid); if (!(target instanceof TokenDocument)) return false; const pileData = lib.getItemPileData(target); const shouldDelete = { "default": game.settings.get(CONSTANTS.MODULE_NAME, "deleteEmptyPiles"), "true": true, "false": false }[pileData?.deleteWhenEmpty ?? "default"] return pileData?.enabled && shouldDelete && lib.isItemPileEmpty(target); } } const preloadedFiles = new Set(); export default API;
// META: script=/common/get-host-info.sub.js // META: script=./resources/common.js // META: timeout=long 'use strict'; assert_true(self.crossOriginIsolated); promise_test(async testCase => { const {iframes, windows} = await build([ { id: 'cross-site-1', window_open: true, children: [ { id: 'same-origin-2', window_open: true, }, { id: 'same-origin-3', }, { id: 'cross-origin-4', }, ] }, ]); const result = await performance.measureMemory(); checkMeasureMemory(result, [ { url: window.location.href, scope: 'Window', container: null, }, ]); }, 'performance.measureMemory does not leak URL of cross-site window.open.');
var searchData= [ ['ddualquat',['ddualquat',['../a00189.html#ga3d71f98d84ba59dfe4e369fde4714cd6',1,'glm']]], ['decompose',['decompose',['../a00204.html#ga0f1245817507156b337798a253577c8b',1,'glm']]], ['degrees',['degrees',['../a00151.html#gabccdcc282134fd62af0ff3d6e4bb21f1',1,'glm']]], ['determinant',['determinant',['../a00149.html#ga26ea77c574802bc6fc193c40478718d2',1,'glm']]], ['diagonal2x2',['diagonal2x2',['../a00207.html#ga01dc503262dba9c457113d131fc8c024',1,'glm']]], ['diagonal2x3',['diagonal2x3',['../a00207.html#ga763817f07d6a94b722a48adfa87a35db',1,'glm']]], ['diagonal2x4',['diagonal2x4',['../a00207.html#ga49b37c819cf6dd8e35112ed1a13d45a3',1,'glm']]], ['diagonal3x2',['diagonal3x2',['../a00207.html#ga586e1ced91fd8a7c414186a200f13532',1,'glm']]], ['diagonal3x3',['diagonal3x3',['../a00207.html#ga8e817dba22f2305cdebae07bbbe0360c',1,'glm']]], ['diagonal3x4',['diagonal3x4',['../a00207.html#gae3f85af86c18c80f2acbe3223feb8e81',1,'glm']]], ['diagonal4x2',['diagonal4x2',['../a00207.html#ga70cc5632aa9f41e7cf0b81fee6f2bfe6',1,'glm']]], ['diagonal4x3',['diagonal4x3',['../a00207.html#ga4242ea5681f81539e0c5b54fadcd9ddf',1,'glm']]], ['diagonal4x4',['diagonal4x4',['../a00207.html#gade576e044d8e52f343166f665589d782',1,'glm']]], ['diskrand',['diskRand',['../a00173.html#gad3a3ee7d26502a31ba552cb627a68606',1,'glm']]], ['distance',['distance',['../a00147.html#ga7ca317dde0d7e94d920153554d4a02a8',1,'glm']]], ['distance2',['distance2',['../a00211.html#ga647d2602008801d6ed78f9708eb439cc',1,'glm']]], ['dmat2',['dmat2',['../a00156.html#gac7f51e23c8802d867f564dfd146bdb44',1,'glm']]], ['dmat2x2',['dmat2x2',['../a00156.html#gacc27b39853a2ecb538c8b3afc20c359e',1,'glm']]], ['dmat2x3',['dmat2x3',['../a00156.html#ga1cb3c561a32f0864733dfaf97c71f0c7',1,'glm']]], ['dmat2x4',['dmat2x4',['../a00156.html#gaddd230c88fbd6ec33242329be3a1b738',1,'glm']]], ['dmat3',['dmat3',['../a00156.html#gae174ff65e148bb7dec4bf10a63cb46ff',1,'glm']]], ['dmat3x2',['dmat3x2',['../a00156.html#gaec22f44dddbdadfe5dfca68eb3457ea8',1,'glm']]], ['dmat3x3',['dmat3x3',['../a00156.html#gac44263f56ff3cbf0a9cc4e2405d5ecb8',1,'glm']]], ['dmat3x4',['dmat3x4',['../a00156.html#ga38d9bfca882ec542b1928cf77b5c2091',1,'glm']]], ['dmat4',['dmat4',['../a00156.html#ga97b38ea24e9ebf58eac04a8d99dc3e27',1,'glm']]], ['dmat4x2',['dmat4x2',['../a00156.html#ga6ddab280c735a2139133b4164b99a68a',1,'glm']]], ['dmat4x3',['dmat4x3',['../a00156.html#gab6c8974496fc7c72dad09219118ba89e',1,'glm']]], ['dmat4x4',['dmat4x4',['../a00156.html#ga41c2da87ca627c1b2da5e895435a508e',1,'glm']]], ['dot',['dot',['../a00147.html#ga7dada304da2ba7dd3376ab4f178c3f6b',1,'glm::dot(vecType&lt; T, P &gt; const &amp;x, vecType&lt; T, P &gt; const &amp;y)'],['../a00172.html#gac54dfc83de465a2d03e90d342242ab3d',1,'glm::dot(quatType&lt; T, P &gt; const &amp;x, quatType&lt; T, P &gt; const &amp;y)']]], ['double1',['double1',['../a00187.html#ga20b861a9b6e2a300323671c57a02525b',1,'glm']]], ['double1x1',['double1x1',['../a00187.html#ga45f16a4dd0db1f199afaed9fd12fe9a8',1,'glm']]], ['double2',['double2',['../a00187.html#gaa16a13c6f2768e83ca133430e82ab89e',1,'glm']]], ['double2x2',['double2x2',['../a00187.html#ga320d0a71a4ad9f14a1992d40546cffa7',1,'glm']]], ['double2x3',['double2x3',['../a00187.html#gade37cf30c69bacb41ceea7e32717eac7',1,'glm']]], ['double2x4',['double2x4',['../a00187.html#gaf923922adf744404d5bfb3fafb7d0d8e',1,'glm']]], ['double3',['double3',['../a00187.html#gaed4bc64196bd25d46f6a1f417320a391',1,'glm']]], ['double3x2',['double3x2',['../a00187.html#gaeaac4d0e18164e4d2fe54432c0fbbcf6',1,'glm']]], ['double3x3',['double3x3',['../a00187.html#gac934f579ee5cf3cbdbb25b73f2640c0a',1,'glm']]], ['double3x4',['double3x4',['../a00187.html#gaad84a1ea83be8fce04c1570c5e719413',1,'glm']]], ['double4',['double4',['../a00187.html#gab8bbb086c9a6c2deffbe0e80afd6be56',1,'glm']]], ['double4x2',['double4x2',['../a00187.html#ga2f87500119da15e35e4a74780ba512bd',1,'glm']]], ['double4x3',['double4x3',['../a00187.html#gaa4e6d53c03780dfa76bd399324f9fe37',1,'glm']]], ['double4x4',['double4x4',['../a00187.html#ga686a3a5590f0a0e721faba08bda301d6',1,'glm']]], ['dual_5fquaternion_2ehpp',['dual_quaternion.hpp',['../a00020.html',1,'']]], ['dualquat',['dualquat',['../a00189.html#gae93abee0c979902fbec6a7bee0f6fae1',1,'glm']]], ['dualquat_5fcast',['dualquat_cast',['../a00189.html#gada9799afe2b62394dc498534beb5bc78',1,'glm::dualquat_cast(tmat2x4&lt; T, P &gt; const &amp;x)'],['../a00189.html#ga20eb5758beb73cc6dbc2d9104f03ec20',1,'glm::dualquat_cast(tmat3x4&lt; T, P &gt; const &amp;x)']]], ['dvec2',['dvec2',['../a00156.html#ga15ade901680b29b78c1f9d1796db6e0e',1,'glm']]], ['dvec3',['dvec3',['../a00156.html#gabebd0c7e3c5cd337d95c313c5e8b8db4',1,'glm']]], ['dvec4',['dvec4',['../a00156.html#ga9503f809789bda7e8852a6abde3ae5c1',1,'glm']]], ['dword',['dword',['../a00222.html#ga86e46fff9f80ae33893d8d697f2ca98a',1,'glm']]] ];
// Código responsa por proceder com o req, res que foi passado pela rota /* Abaixo dentro do yup (framework de schema validation), não temos export.default, portanto procedemos com o seguinte:*/ import * as Yup from 'yup' import User from '../models/User' class UserController { // store: responsa por criar usuário async store(req, res) { // ANTES DE TUDO, VALIDAÇÕES: /*abaixo o Yup espera um objeto (será o req.body) que tenha esta shape:*/ const schema = Yup.object().shape({ name: Yup.string().required(), email: Yup.string().email().required(), password: Yup.string().required().min(6), //min carac. }) // dito isso, se for verdade que o isValid deu erro, então: if (!(await schema.isValid(req.body))) { return res.status(400).json({ error: 'Validations fails.' }) } // VERIFICAÇÃO: o e-mail passado no req já existe ?: const userExists = await User.findOne({ where: { email: req.body.email } }) if (userExists) { return res.status(400).json({ error: 'User already exists.' }) } const { id, name, email, provider } = await User.create(req.body) // aqui na resposta somente vamos mandar para o front-end alguns dados do usuário: return res.json({ id, name, email, provider, }) } // update: responsa editar dados do usuário async update(req, res) { // ANTES DE TUDO, VALIDAÇÕES(código copiado do store-criação): /*abaixo o Yup espera um objeto (será o req.body) que tenha esta shape:*/ const schema = Yup.object().shape({ /* sem required(): não é toda vez que o user edita nome*/ name: Yup.string(), /* .required(), não é toda vez que o user edita nome*/ email: Yup.string().email(), /* somente quando o user informar o oldPassword, password deve ser required (se informar ele quer trocar)*/ oldpassword: Yup.string().min(6), /* Yup abaixo que depende de oldpassword para ser required */ password: Yup.string().min(6).when( //quando.. 'oldpassword', (oldpassword, field) => oldpassword ? field.required() : field /*sobre o if acima: se oldpassword for informado [?], então field (password) é required senão[:] field normal sem required!*/ ), /* Yup abaixo para confirmação de senhas */ confirmPassword: Yup.string().when( //quando.. 'password', (password, field) => password ? field.required().oneOf([Yup.ref('password')]) : field /*sobre o if acima: se password for informado [?], então field (confirmPassword) é required , ^ este .oneOf diz que confirmPassword tem que se referenciar[Yup.ref] em password, sendo assim iguais. senão[:] deixa o field normal sem required!*/ ) }) // dito isso, se for verdade que o isValid deu erro, então: if (!(await schema.isValid(req.body))) { return res.status(400).json({ error: 'Validations fails.' }) } // aqui vamos capturar o que vem do JSON: const { email, oldPassword } = req.body // buscando dentro do banco o user que será modificado: const user = await User.findByPk(req.userId) // VERIFICAÇÃO: o email do req é dif. do banco (se for ele quer trocar)? if (email !== user.email) { const userExists = await User.findOne({ where: { email } }) if (userExists) { return res.status(400).json({ error: 'User already exists.' }) } } // VERIFICAÇÃO: /* se no json o oldPassword for true (ele quer trocar) AND lá dentro do banco esse oldPassword estiver dif. de FALSE então..*/ if (oldPassword && !(await user.checkPassword(oldPassword))) { return res.status(401).json({ error: 'Password does not match' }) } // Depois de tudo validado, vamos realizar o update, baseado no que foi passado req.body const { id, name, provider } = await user.update(req.body) return res.json({ id, name, email, provider }) } /* LEMBRE-SE: dentro de checkPassword() tem o bcrypt */ } export default new UserController();
import axios from 'axios/dist/axios' export const register = newUser => { return axios .post('http://localhost:5000/users/register', { genre: newUser.genre, tranche_d_age: newUser.tranche_d_age, pays: newUser.pays, ville: newUser.ville, email: newUser.email, password: newUser.password }) .then(response => { console.log('Registered') }) } export const login = user => { return axios .post('http://localhost:5000/users/login', { email: user.email, password: user.password }) .then(response => { localStorage.setItem('usertoken', response.data) return response.data }) .catch(err => { console.log( err.response.request._response) }) } export const audiorecorder = newRecord => { return axios .post('http://localhost:4000/records/audiorecorder', { record: newRecord.record, version_record: newRecord.version_record, ref_micro_record: newRecord.ref_micro_record, ref_device_record: newRecord.ref_device_record }) .then(response => { console.log('Record registered') /*localStorage.setItem('recordtoken', response.data) return response.data*/ }) } export const audiocheck = recorder => { return axios .post('http://localhost:4000/recorders/audiocheck', { record: recorder.record }) .then(response => { localStorage.setItem('recordtoken', response.data) return response.data }) .catch(err => { console.log( err.response.request._response) }) }
/* globals simulant chai DocumentTouch */ var expect = chai.expect /** * This file represents perfectly how you should not do a unit test! * I will clean this up once */ function check(done, f) { f() done() } var testDiv = document.createElement('div'), isTouch = 'ontouchstart' in window || window.DocumentTouch && document instanceof DocumentTouch || !!navigator.pointerEnabled, touchend = isTouch ? 'touchend' : 'mouseup', touchmove = isTouch ? 'touchmove' : 'mousemove', touchstart = isTouch ? 'touchstart' : 'mousedown' // append the test div into the body document.body.appendChild(testDiv) describe('Tocca.js nojQuery events', function() { /** * Test the simple tap event */ describe('tap event', function() { it('The "tap" event gets fired correctly', function(done) { function onEventFired(e) { check(done, function() { expect(e).to.be.ok expect(e).to.contain.keys(['x', 'y', 'originalEvent']) expect(e.x).to.be.an('number') expect(e.x).to.be.equal(99) expect(e.y).to.be.an('number') expect(e.y).to.be.equal(99) expect(e.originalEvent).to.be.ok expect(e.originalEvent).to.not.be.equal(undefined) expect(e.distance).to.be.equal(undefined) }) testDiv.removeEventListener('tap', onEventFired, false) } testDiv.addEventListener('tap', onEventFired, false) simulant.fire(testDiv, touchstart, { clientX: 99, clientY: 99 }) setTimeout(function() { simulant.fire(testDiv, touchend, { clientX: 99, clientY: 99 }) }, 20) }) }) /** * Test the double tap event */ describe('dbltap event', function() { it('The "dbltap" event gets fired correctly', function(done) { function onEventFired(e) { check(done, function() { expect(e).to.be.ok expect(e).to.contain.keys(['x', 'y', 'originalEvent']) expect(e.x).to.be.an('number') expect(e.x).to.be.equal(50) expect(e.y).to.be.an('number') expect(e.y).to.be.equal(50) expect(e.originalEvent).to.be.ok expect(e.originalEvent).to.not.be.equal(undefined) expect(e.distance).to.be.equal(undefined) }) testDiv.removeEventListener('dbltap', onEventFired, false) } testDiv.addEventListener('dbltap', onEventFired, false) simulant.fire(testDiv, touchstart, { clientX: 50, clientY: 50 }) simulant.fire(testDiv, touchend, { clientX: 50, clientY: 50 }) setTimeout(function() { simulant.fire(testDiv, touchstart, { clientX: 50, clientY: 50 }) simulant.fire(testDiv, touchend, { clientX: 50, clientY: 50 }) }, 20) }) }) /** * Test the long tap event */ describe('longtap event', function() { it('The "longtap" event gets fired correctly', function(done) { function onEventFired(e) { check(done, function() { expect(e).to.be.ok expect(e).to.contain.keys(['x', 'y', 'originalEvent']) expect(e.x).to.be.an('number') expect(e.x).to.be.equal(50) expect(e.y).to.be.an('number') expect(e.y).to.be.equal(50) expect(e.originalEvent).to.be.ok expect(e.originalEvent).to.not.be.equal(undefined) expect(e.distance).to.be.equal(undefined) }) testDiv.removeEventListener('longtap', onEventFired, false) } testDiv.addEventListener('longtap', onEventFired, false) simulant.fire(testDiv, touchstart, { clientX: 50, clientY: 50 }) setTimeout(function() { simulant.fire(testDiv, touchend, { clientX: 50, clientY: 50 }) }, 1081) }) }) /** * Test all the swipe events */ describe('swipe events', function() { it('The "swipeup" event gets fired correctly', function(done) { function onEventFired(e) { check(done, function() { expect(e).to.be.ok expect(e).to.contain.keys(['x', 'y', 'originalEvent', 'distance']) expect(e.x).to.be.an('number') expect(e.x).to.be.equal(40) expect(e.y).to.be.an('number') expect(e.y).to.be.equal(50) expect(e.originalEvent).to.be.ok expect(e.originalEvent).to.not.be.equal(undefined) expect(e.distance.y).to.be.equal(400) expect(e.distance.x).to.be.equal(10) }) testDiv.removeEventListener('swipeup', onEventFired, false) } testDiv.addEventListener('swipeup', onEventFired, false) var initialY = 450, pixelMoved = 401 simulant.fire(testDiv, touchstart, { clientX: 50, clientY: initialY }) var i = pixelMoved while (i--) { simulant.fire(testDiv, touchmove, { clientX: 40, clientY: initialY-- }) } simulant.fire(testDiv, touchend, { clientX: 40, clientY: initialY - pixelMoved }) }) it('The "swipedown" event gets fired correctly', function(done) { function onEventFired(e) { check(done, function() { expect(e).to.be.ok expect(e).to.contain.keys(['x', 'y', 'originalEvent', 'distance']) expect(e.x).to.be.an('number') expect(e.x).to.be.equal(70) expect(e.y).to.be.an('number') expect(e.y).to.be.equal(850) expect(e.originalEvent).to.be.ok expect(e.originalEvent).to.not.be.equal(undefined) expect(e.distance.y).to.be.equal(400) expect(e.distance.x).to.be.equal(20) }) testDiv.removeEventListener('swipedown', onEventFired, false) } testDiv.addEventListener('swipedown', onEventFired, false) var initialY = 450, pixelMoved = 401 simulant.fire(testDiv, touchstart, { clientX: 50, clientY: initialY }) var i = pixelMoved while (i--) { simulant.fire(testDiv, touchmove, { clientX: 70, clientY: initialY++ }) } simulant.fire(testDiv, touchend, { clientX: 70, clientY: initialY + pixelMoved }) }) it('The "swipeleft" event gets fired correctly', function(done) { function onEventFired(e) { check(done, function() { expect(e).to.be.ok expect(e).to.contain.keys(['x', 'y', 'originalEvent', 'distance']) expect(e.x).to.be.an('number') expect(e.x).to.be.equal(50) expect(e.y).to.be.an('number') expect(e.y).to.be.equal(40) expect(e.originalEvent).to.be.ok expect(e.originalEvent).to.not.be.equal(undefined) expect(e.distance.y).to.be.equal(10) expect(e.distance.x).to.be.equal(400) }) testDiv.removeEventListener('swipeleft', onEventFired, false) } testDiv.addEventListener('swipeleft', onEventFired, false) var initialX = 450, pixelMoved = 401 simulant.fire(testDiv, touchstart, { clientX: initialX, clientY: 50 }) var i = pixelMoved while (i--) { simulant.fire(testDiv, touchmove, { clientX: initialX--, clientY: 40 }) } simulant.fire(testDiv, touchend, { clientX: initialX - pixelMoved, clientY: 40 }) }) it('The "swiperight" event gets fired correctly', function(done) { function onEventFired(e) { check(done, function() { expect(e).to.be.ok expect(e).to.contain.keys(['x', 'y', 'originalEvent', 'distance']) expect(e.x).to.be.an('number') expect(e.x).to.be.equal(850) expect(e.y).to.be.an('number') expect(e.y).to.be.equal(10) expect(e.originalEvent).to.be.ok expect(e.originalEvent).to.not.be.equal(undefined) expect(e.distance.y).to.be.equal(40) expect(e.distance.x).to.be.equal(400) }) testDiv.removeEventListener('swiperight', onEventFired, false) } testDiv.addEventListener('swiperight', onEventFired, false) var initialX = 450, pixelMoved = 401 simulant.fire(testDiv, touchstart, { clientX: initialX, clientY: 50 }) var i = pixelMoved while (i--) { simulant.fire(testDiv, touchmove, { clientX: initialX++, clientY: 10 }) } simulant.fire(testDiv, touchend, { clientX: initialX - pixelMoved, clientY: 10 }) }) }) }) describe('Inline events', function() { it('The "tap" event gets fired correctly', function(done) { function onEventFired(e) { check(done, function() { expect(e).to.be.ok expect(e).to.contain.keys(['x', 'y', 'originalEvent']) expect(e.x).to.be.an('number') expect(e.x).to.be.equal(99) expect(e.y).to.be.an('number') expect(e.y).to.be.equal(99) expect(e.originalEvent).to.be.ok expect(e.originalEvent).to.not.be.equal(undefined) expect(e.distance).to.be.equal(undefined) }) testDiv.ontap = null } testDiv.ontap = onEventFired simulant.fire(testDiv, touchstart, { clientX: 99, clientY: 99 }) setTimeout(function() { simulant.fire(testDiv, touchend, { clientX: 99, clientY: 99 }) }, 20) }) it('The "dbltap" event gets fired correctly', function(done) { function onEventFired(e) { check(done, function() { expect(e).to.be.ok expect(e).to.contain.keys(['x', 'y', 'originalEvent']) expect(e.x).to.be.an('number') expect(e.x).to.be.equal(50) expect(e.y).to.be.an('number') expect(e.y).to.be.equal(50) expect(e.originalEvent).to.be.ok expect(e.originalEvent).to.not.be.equal(undefined) expect(e.distance).to.be.equal(undefined) }) testDiv.ondbltap = null } simulant.fire(testDiv, touchstart, { clientX: 50, clientY: 50 }) simulant.fire(testDiv, touchend, { clientX: 50, clientY: 50 }) testDiv.ondbltap = onEventFired setTimeout(function() { simulant.fire(testDiv, touchstart, { clientX: 50, clientY: 50 }) simulant.fire(testDiv, touchend, { clientX: 50, clientY: 50 }) }, 20) }) it('The "longtap" event gets fired correctly', function(done) { function onEventFired(e) { check(done, function() { expect(e).to.be.ok expect(e).to.contain.keys(['x', 'y', 'originalEvent']) expect(e.x).to.be.an('number') expect(e.x).to.be.equal(50) expect(e.y).to.be.an('number') expect(e.y).to.be.equal(50) expect(e.originalEvent).to.be.ok expect(e.originalEvent).to.not.be.equal(undefined) expect(e.distance).to.be.equal(undefined) }) testDiv.onlongtap = null } testDiv.onlongtap = onEventFired setTimeout(function() { simulant.fire(testDiv, touchstart, { clientX: 50, clientY: 50 }) }, 10) setTimeout(function() { simulant.fire(testDiv, touchend, { clientX: 50, clientY: 50 }) }, 1081) }) }) describe('Tocca.js validate events', function() { /** * Test the tap event */ describe('tap event', function() { it('The "tap" event must not be triggered because out of the time range defined', function(done) { var eventObject = false function onEventFired(e) { check(done, function() { eventObject = e expect(true).to.be.equal(false) }) } testDiv.addEventListener('tap', onEventFired, false) simulant.fire(testDiv, touchstart, { clientX: 99, clientY: 99 }) setTimeout(function() { simulant.fire(testDiv, touchend) check(done, function() { expect(eventObject).to.be.equal(false) testDiv.removeEventListener('tap', onEventFired, false) }) }, 220) }) }) /** * Test the dbltap event */ describe('dbltap event', function() { it('The "dbltap" event must not be triggered because out of the time range defined', function(done) { var eventObject = false function onEventFired(e) { check(done, function() { eventObject = e expect(true).to.be.equal(false) }) } testDiv.addEventListener('dbltap', onEventFired, false) simulant.fire(testDiv, touchstart, { clientX: 99, clientY: 99 }) simulant.fire(testDiv, touchmove, { clientX: 58, clientY: 58 }) simulant.fire(testDiv, touchend) setTimeout(function() { simulant.fire(testDiv, touchstart, { clientX: 98, clientY: 98 }) simulant.fire(testDiv, touchend) setTimeout(function() { check(done, function() { expect(eventObject).to.be.equal(false) testDiv.removeEventListener('dbltap', onEventFired, false) }) }, 500) }, 250) }) }) /** * Test the longtap event */ describe('longtap event', function() { it('The "longtap" event must not be triggered because out of the time range defined', function(done) { var eventObject=false function onEventFired(e) { check(done, function() { eventObject=e expect(true).to.be.equal(false) }) } testDiv.addEventListener('longtap', onEventFired, false) simulant.fire(testDiv, touchstart, { clientX: 50, clientY: 50 }) setTimeout(function() { simulant.fire(testDiv, touchend, { clientX: 50, clientY: 50 }) check(done, function() { expect(eventObject).to.be.equal(false) }) testDiv.removeEventListener('longtap', onEventFired, false) }, window.tocca().longtapThreshold - 500) }) }) /** * Test the swipe event */ // TODO: fixme! /* describe('swipe events', function() { it('The "swipeup" event must not be triggered because the swipe movement is too short', function(done) { var eventObject = false function onEventFired(e) { check(done, function() { eventObject = e expect(true).to.be.equal(false) }) } testDiv.addEventListener('swipeup', onEventFired, false) var initialY = 450, pixelMoved = 50 simulant.fire(testDiv, touchstart, { clientX: 50, clientY: initialY }) var i = pixelMoved while (i--) { simulant.fire(testDiv, touchmove, { clientX: 40, clientY: initialY-- }) } simulant.fire(testDiv, touchend, { clientX: 40, clientY: initialY - pixelMoved }) setTimeout(function() { check(done, function() { expect(eventObject).to.be.equal(false) testDiv.removeEventListener('swipeup', onEventFired, false) }) }, 500) }) it('The "swipedown" event must not be triggered because the swipe movement is too short', function(done) { var eventObject = false function onEventFired(e) { check(done, function() { eventObject = e expect(true).to.be.equal(false) }) } testDiv.addEventListener('swipedown', onEventFired, false) var initialY = 450, pixelMoved = 50 simulant.fire(testDiv, touchstart, { clientX: 50, clientY: initialY }) var i = pixelMoved while (i--) { simulant.fire(testDiv, touchmove, { clientX: 40, clientY: initialY++ }) } setTimeout(function() { simulant.fire(testDiv, touchend, { clientX: 40, clientY: initialY + pixelMoved }) }, 10) setTimeout(function() { check(done, function() { expect(eventObject).to.be.equal(false) testDiv.removeEventListener('swipedown', onEventFired, false) }) }, 500) })*/ it('The "swipeleft" event must not be triggered because the swipe movement is too short', function(done) { var eventObject = false function onEventFired(e) { check(done, function() { eventObject = e expect(true).to.be.equal(false) }) } testDiv.addEventListener('swipeleft', onEventFired, false) var initialX = 450, pixelMoved = 70 simulant.fire(testDiv, touchstart, { clientX: initialX, clientY: 50 }) var i = pixelMoved while (i--) { simulant.fire(testDiv, touchmove, { clientX: initialX--, clientY: 50 }) } simulant.fire(testDiv, touchend, { clientX: initialX - pixelMoved, clientY: 50 }) setTimeout(function() { check(done, function() { expect(eventObject).to.be.equal(false) testDiv.removeEventListener('swipeleft', onEventFired, false) }) }, 500) }) it('The "swiperight" event must not be triggered because the swipe movement is too short', function(done) { var eventObject = false function onEventFired(e) { check(done, function() { eventObject = e expect(true).to.be.equal(false) }) } testDiv.addEventListener('swiperight', onEventFired, false) var initialX = 450, pixelMoved = 70 simulant.fire(testDiv, touchstart, { clientX: initialX, clientY: 50 }) var i = pixelMoved while (i--) { simulant.fire(testDiv, touchmove, { clientX: initialX++, clientY: 50 }) } simulant.fire(testDiv, touchend, { clientX: initialX + pixelMoved, clientY: 50 }) setTimeout(function() { check(done, function() { expect(eventObject).to.be.equal(false) testDiv.removeEventListener('swiperight', onEventFired, false) }) }, 500) }) })
/* * Copyright 2020 Poly Forest, LLC * * 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. */ import * as utils from "./timesheetServiceUtils.js" import * as modal from "./modal.js" let appProperties = {}; /** * Safari in OSX doesn't support date or inputs * @type {RegExp} */ const DATE_REGEX = /([\d]{4})[-/.]([\d]{1,2})[-/.]([\d]{1,2})/ /** * Safari in OSX doesn't support date or inputs * @type {RegExp} */ const TIME_REGEX = /([\d]{1,2}):([\d]{2})(:[\d]{2})?([\s]*(?:AM|PM))?/i // Safari in OSX doesn't support date or inputs const DATE_FALLBACK = `placeholder="yyyy-mm-dd" pattern="${DATE_REGEX.source}" title="Date should be in the format: yyyy-mm-dd"`; // Safari in OSX doesn't support date or inputs const TIME_FALLBACK = `placeholder="h:mm:ss" pattern="${TIME_REGEX.source}" title="Time should be in the format: h:mm:ss"`; const timer = { /** * The timestamp the timer began. * @type {Date|null} */ startTime: null, /** * The update interval handle for the timer display. * @type {number} */ updateIntervalId: -1 } /** * Creates a timesheet row. * This row should then be added to the spreadsheet table's body. * * @param row {Array<string | null>} * @return {HTMLTableRowElement} */ function createTimeRow(row) { const tr = document.createElement("tr"); const startTimeTd = document.createElement("td"); startTimeTd.innerHTML = row[0] || ""; tr.appendChild(startTimeTd); const endTimeTd = document.createElement("td"); endTimeTd.innerHTML = row[1] || ""; tr.appendChild(endTimeTd); const hoursTd = document.createElement("td"); hoursTd.innerHTML = row[2] || ""; tr.appendChild(hoursTd); const categoryTd = document.createElement("td"); categoryTd.innerHTML = row[3] || ""; tr.appendChild(categoryTd); const commentsTd = document.createElement("td"); commentsTd.innerHTML = row[4] || ""; tr.appendChild(commentsTd); tr.onclick = () => { const index = Array.prototype.indexOf.call(tr.parentNode.children, tr); openSubmitForm(ele("spreadsheetId").value, index, new Date(parseDateTime(startTimeTd.innerText)), new Date(parseDateTime(endTimeTd.innerText)), categoryTd.innerText, commentsTd.innerText); } return tr; } function pad(num, size) { let s = num + ""; while (s.length < size) s = "0" + s; return s; } /** * Updates the timer data. * @param startTime {Date|null} The timestamp the timer began. */ function updateTimerUi(startTime) { const startTimerBtn = ele("startTimerBtn"); const stopTimerBtn = ele("stopTimerBtn"); const timerDisplay = ele("timerDisplay"); timer.startTime = startTime; if (startTime == null) { startTimerBtn.style.display = ""; stopTimerBtn.style.display = "none"; timerDisplay.innerText = ""; stopWindowInterval(); } else { startTimerBtn.style.display = "none"; stopTimerBtn.style.display = ""; if (timer.updateIntervalId === -1) { timer.updateIntervalId = window.setInterval(() => { refreshTime(); }, 1000); } refreshTime(); } } function refreshTime() { const timerDisplay = ele("timerDisplay"); if (timerDisplay == null || timer.startTime == null) { stopWindowInterval(); return; } const elapsedS = Math.floor((Date.now() - timer.startTime) / 1000); const h = Math.floor(elapsedS / 3600); const m = Math.floor((elapsedS % 3600) / 60); const s = Math.floor(elapsedS % 60); timerDisplay.innerText = pad(h, 2) + ":" + pad(m, 2) + ":" + pad(s, 2); } function stopWindowInterval() { window.clearInterval(timer.updateIntervalId); timer.updateIntervalId = -1; } /** * Refreshes the timesheet table data. * @param spreadsheetId String * @return {Promise<void>} */ async function refreshTimesheet(spreadsheetId) { const propertiesPromise = utils.getFileMetadata(spreadsheetId).then((response) => { console.debug("fileMetadata", response); const properties = response.result.appProperties || {} const startTime = properties.startTime || null; updateTimerUi(startTime && new Date(Number(startTime))); appProperties = properties; ele("title").innerText = response.result.name; ele("documentLink").href = response.result.webViewLink; }); const valuesResponse = await gapi.client.sheets.spreadsheets.values.get({ spreadsheetId: spreadsheetId, range: "A2:E" }); console.debug("spreadsheets.values response", valuesResponse); const rows = valuesResponse.result.values; updateTimesheetRowsUi(rows); await propertiesPromise; } function updateTimesheetRowsUi(rows) { const tableBody = query("#timesheetTable > tbody"); tableBody.innerHTML = "" const categoriesList = /** @type {HTMLDataListElement} */ (ele("categoriesList")); const existingOptions = {}; for (let i = 0; i < categoriesList.options.length; i++) { const option = categoriesList.options[i]; existingOptions[option.value.toLowerCase()] = true; } if (rows !== undefined) { for (let i = 0; i < rows.length; i++) { const row = rows[i]; const tr = createTimeRow(row); tableBody.appendChild(tr); // Update unique categories const category = row[3]; if (!!category) { const key = category.toLowerCase(); if (!existingOptions.hasOwnProperty(key)) { existingOptions[key] = true; const newOption = /** @type HTMLOptionElement */ document.createElement("option"); newOption.value = category; categoriesList.appendChild(newOption); } } } } } async function startTimerClickedHandler(spreadsheetId) { const startTime = new Date(); updateTimerUi(startTime); await utils.updateStartTime(spreadsheetId, startTime); } /** * Coerces local time into UTC time. * Google Sheets time format has no time zone, so we treat time numbers as UTC. * However, in order to keep the Google sheet easy to manually edit, time stamps should be represented * as local time. * This method will take the start and end times, changing their timezones to UTC without converting the * time. In order to maintain duration integrity, if there was a local time change (DST <--> ST), offset the end time. * * @param startTime {Date} * @param endTime {Date} * @return {Array<Date>} Returns [startTimeUtc, endTimeUtc] */ function coerceTimesToUtc(startTime, endTime) { const tZOffset = (endTime.getTimezoneOffset() - startTime.getTimezoneOffset()) * 60 * 1000; const startTime2 = new Date(Date.UTC(startTime.getFullYear(), startTime.getMonth(), startTime.getDate(), startTime.getHours(), startTime.getMinutes(), startTime.getSeconds())) const endTime2 = new Date(Date.UTC(endTime.getFullYear(), endTime.getMonth(), endTime.getDate(), endTime.getHours(), endTime.getMinutes(), endTime.getSeconds()) + tZOffset) return [startTime2, endTime2]; } async function stopTimerClickedHandler(spreadsheetId) { const times = coerceTimesToUtc(timer.startTime, new Date()); openSubmitForm(spreadsheetId, -1, times[0], times[1], "", ""); updateTimerUi(null); await utils.updateStartTime(spreadsheetId, null); } /** * Formats a UTC date as yyyy-mm-dd, according to https://xkcd.com/1179/ * * @param date {Date} * @return {string} */ function formatUtcDate(date) { return `${date.getUTCFullYear()}-${pad(date.getUTCMonth() + 1, 2)}-${pad(date.getUTCDate(), 2)}` } /** * Formats a UTC time as hh:mm:ss (24 hour format) * * @param time {Date} * @return {string} */ function formatUtcTime(time) { return `${pad(time.getUTCHours(), 2)}:${pad(time.getUTCMinutes(), 2)}:${pad(time.getUTCSeconds(), 2)}`; } /** * Formats a UTC datetime as yyyy-mm-dd hh:mm:ss (24 hour format) * * @param date {Date} * @return {string} */ function formatUtcDateTime(date) { return `${formatUtcDate(date)} ${formatUtcTime(date)}` } /** * * @param spreadsheetId {String} * @param rowId {number} * @param startTime {Date} * @param endTime {Date} * @param category {String} * @param comment {String} */ function openSubmitForm(spreadsheetId, rowId, startTime, endTime, category, comment) { const isNewEntry = (rowId === -1); ele("submitTimeEntryTitle").innerText = (isNewEntry) ? "New Time Entry" : "Edit Time Entry" ele("spreadsheetId").value = spreadsheetId; ele("rowId").value = rowId; if (isNewEntry) { ele("deleteEntryLink").style.display = "none"; } else { ele("deleteEntryLink").style.removeProperty("display"); } ele("dateStart").value = formatUtcDate(startTime); ele("timeStart").value = formatUtcTime(startTime); ele("dateEnd").value = formatUtcDate(endTime); ele("timeEnd").value = formatUtcTime(endTime); ele("category").value = category || ""; ele("comment").value = comment || ""; ele("timeResolutionsInput").value = !!appProperties.timeResolution ? appProperties.timeResolution.toString() : "4"; modal.openModal(ele("submitTimeEntryContainer")); updateDuration(); } /** * Returns the value of a date input. * @param id String the ID of the HTMLInputElement to parse. * @return number | null */ function dateInput(id) { const input = /** @type {HTMLInputElement} */ ele(id); if (supportsNumber(input)) return input.valueAsNumber; return parseDate(input.value); } function parseDate(str) { const groups = DATE_REGEX.exec(str); if (groups == null) return null; return (new Date(Date.UTC(parseInt(groups[1]), parseInt(groups[2]) - 1, parseInt(groups[3])))).getTime(); } /** * Returns the value of a time input. * @param id String the ID of the HTMLInputElement to parse. * @return number | null */ function timeInput(id) { const input = /** @type {HTMLInputElement} */ ele(id); if (supportsNumber(input)) return input.valueAsNumber; return parseTime(input.value); } function parseTime(str) { const groups = TIME_REGEX.exec(str); if (groups == null) return null; const isPm = groups[4] !== undefined && groups[4].toLowerCase() === "pm" const hours = parseInt(groups[1]) + ((isPm) ? 12 : 0); const minutes = parseInt(groups[2]); const seconds = parseInt(groups[3].substr(1) || 0); return hours * 3600000 + minutes * 60000 + seconds * 1000; } function parseDateTime(str) { const splitIndex = str.indexOf(" "); const dateStr = str.substring(0, splitIndex); const timeStr = str.substring(splitIndex + 1); return parseDate(dateStr) + parseTime(timeStr); } /** * @param input {HTMLInputElement} * @return Boolean Returns true if the input supports `valueAsNumber` */ function supportsNumber(input) { const n = input.valueAsNumber; return n != null && !isNaN(n); } async function submitTimeEntryFormHandler() { const rowId = parseInt(ele("rowId").value); const startTime = new Date(dateInput("dateStart") + timeInput("timeStart")); const endTime = new Date(dateInput("dateEnd") + timeInput("timeEnd")); const spreadsheetId = ele("spreadsheetId").value; const cat = ele("category").value; const comment = ele("comment").value; modal.closeModal(ele("submitTimeEntryContainer")); const tableBody = query("#timesheetTable > tbody"); if (rowId === -1) { tableBody.appendChild(createTimeRow([formatUtcDateTime(startTime), formatUtcDateTime(endTime), ele("duration").innerText, cat, comment])); await utils.appendTimeEntry(spreadsheetId, startTime, endTime, cat, comment, appProperties.timeResolution || 4); } else { const previousRow = tableBody.childNodes[rowId]; tableBody.insertBefore(createTimeRow([formatUtcDateTime(startTime), formatUtcDateTime(endTime), ele("duration").innerText, cat, comment]), previousRow); tableBody.removeChild(previousRow); await utils.updateTimeEntry(spreadsheetId, rowId, startTime, endTime, cat, comment, appProperties.timeResolution || 4); } } /** * Deletes the given time entry row. * @param spreadsheetId string * @param rowId number (zero-indexed) * @return {Promise<void>} */ async function deleteRow(spreadsheetId, rowId) { console.log("Deleting row " + rowId); const tableBody = query("#timesheetTable > tbody"); tableBody.removeChild(tableBody.childNodes[rowId]); await utils.deleteRow(spreadsheetId, rowId); } /** * Sets the duration display to be the time difference rounded to the next time resolution value. */ function updateDuration() { const deltaS = (dateInput("dateEnd") + timeInput("timeEnd") - (dateInput("dateStart") + timeInput("timeStart"))) / 1000; const round = 3600 / parseInt(ele("timeResolutionsInput").value); const duration = Math.ceil(deltaS / round) * round; const hours = Math.floor(duration / 3600); const minutes = Math.floor((duration - hours * 3600) / 60); const seconds = Math.floor(duration - hours * 3600 - minutes * 60); ele("duration").innerText = `${hours}:${pad(minutes, 2)}:${pad(seconds, 2)}`; } /** * Sets the content area UI to edit the given timesheet. * @param spreadsheetId String The timesheet to edit. * @return {Promise<void>} */ async function editSheet(spreadsheetId) { const content = ele("content"); content.innerHTML = ` <div id="submitTimeEntryContainer" style="display: none" class="modal"> <div class="panel"> <div class="titleBar"> <div id="submitTimeEntryTitle" class="label"></div> <div class="close">&times;</div> </div> <a id="deleteEntryLink" class="withIcon" style="cursor: pointer; margin-top: 7px;"><i class="material-icons">delete</i> Delete Entry</a> <form id="submitTimeEntryForm"> <input type="hidden" id="spreadsheetId" value="${spreadsheetId}"> <input type="hidden" id="rowId" value="-1"> <label for="dateStart">Date Start</label> <input type="date" id="dateStart" required ${DATE_FALLBACK}> <label for="timeStart">Time Start</label> <input type="time" id="timeStart" step="1" required ${TIME_FALLBACK}> <label for="dateEnd">Date End</label> <input type="date" id="dateEnd" required ${DATE_FALLBACK}> <label for="timeEnd">Time End</label> <input type="time" id="timeEnd" step="1" required ${TIME_FALLBACK}> <label for="timeResolutionsInput">Round Time to Next:</label> <select name="timeResolutionsInput" id="timeResolutionsInput"> <option value="3600"/> 1s</option> <option value="60">1m</option> <option value="12">5m</option> <option value="6">10m</option> <option value="4">15m</option> <option value="2">30m</option> <option value="1">1hr</option> </select> <label>Duration</label> <div id="duration"></div> <label for="category">Category</label> <input list="categoriesList" id="category"> <datalist id="categoriesList"> <option value="test"></option> </datalist> <label for="comment">Comment</label> <textarea id="comment"></textarea> <label></label> <input type="submit"> </form> </div> </div> <div> <div class="documentInfoBar"><h2 id="title"></h2><a id="documentLink"><img src="images/drive.svg"></a> </div> <p><a href='#list' class="withIcon"><i class="material-icons">keyboard_backspace</i> Back to List</a></p> <div class="controls"> <button id="startTimerBtn" class="withIcon" style="display: none;"><i class="material-icons">play_circle_outline</i> Start Timer</button> <button id="stopTimerBtn" class="withIcon" style="display: none;"><i class="material-icons">pause_circle_outline</i> Stop Timer</button> <div id="timerDisplay"></div> </div> </div> <p></p> <div id="timesheetTableContainer"> <table id="timesheetTable"> <thead> <tr> <th>Start Time</th> <th>End Time</th> <th>Hours</th> <th>Category</th> <th>Comment</th> </tr> </thead> <tbody> </tbody> </table> </div>`; ele("startTimerBtn").onclick = startTimerClickedHandler.bind(this, spreadsheetId); ele("stopTimerBtn").onclick = stopTimerClickedHandler.bind(this, spreadsheetId); const timeResolutionsInput = ele("timeResolutionsInput"); timeResolutionsInput.onchange = async (e) => { appProperties.timeResolution = parseInt(timeResolutionsInput.value); await utils.updateProperties(spreadsheetId, { timeResolution: timeResolutionsInput.value }); } modal.initModal(ele("submitTimeEntryContainer")); const submitForm = ele("submitTimeEntryForm"); submitForm.onsubmit = (e) => { loadInc(); submitTimeEntryFormHandler().finally(()=> { loadDec(); }); return false; }; ele("deleteEntryLink").onclick = () => { loadInc(); const spreadsheetId = ele("spreadsheetId").value; const rowId = parseInt(ele("rowId").value); modal.closeModal(ele("submitTimeEntryContainer")); deleteRow(spreadsheetId, rowId); loadDec(); } submitForm.querySelectorAll("input,select").forEach((input) => { input.addEventListener("change", updateDuration); }); await refreshTimesheet(spreadsheetId); } export default editSheet;
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[4],{ /***/ "./node_modules/@ionic/core/dist/esm/ion-alert-ios.entry.js": /*!******************************************************************!*\ !*** ./node_modules/@ionic/core/dist/esm/ion-alert-ios.entry.js ***! \******************************************************************/ /*! exports provided: ion_alert */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ion_alert", function() { return Alert; }); /* harmony import */ var _chunk_d0403a2f_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./chunk-d0403a2f.js */ "./node_modules/@ionic/core/dist/esm/chunk-d0403a2f.js"); /* harmony import */ var _chunk_1074393c_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./chunk-1074393c.js */ "./node_modules/@ionic/core/dist/esm/chunk-1074393c.js"); /* harmony import */ var _chunk_d83bfeae_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./chunk-d83bfeae.js */ "./node_modules/@ionic/core/dist/esm/chunk-d83bfeae.js"); /* harmony import */ var _chunk_353a032e_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./chunk-353a032e.js */ "./node_modules/@ionic/core/dist/esm/chunk-353a032e.js"); /* harmony import */ var _chunk_cae2ca23_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./chunk-cae2ca23.js */ "./node_modules/@ionic/core/dist/esm/chunk-cae2ca23.js"); /** * iOS Alert Enter Animation */ const iosEnterAnimation = (AnimationC, baseEl) => { const baseAnimation = new AnimationC(); const backdropAnimation = new AnimationC(); backdropAnimation.addElement(baseEl.querySelector('ion-backdrop')); const wrapperAnimation = new AnimationC(); wrapperAnimation.addElement(baseEl.querySelector('.alert-wrapper')); backdropAnimation.fromTo('opacity', 0.01, 0.3); wrapperAnimation.fromTo('opacity', 0.01, 1).fromTo('scale', 1.1, 1); const ani = baseAnimation .addElement(baseEl) .easing('ease-in-out') .duration(200) .add(backdropAnimation) .add(wrapperAnimation); return Promise.resolve(ani); }; /** * iOS Alert Leave Animation */ const iosLeaveAnimation = (AnimationC, baseEl) => { const baseAnimation = new AnimationC(); const backdropAnimation = new AnimationC(); backdropAnimation.addElement(baseEl.querySelector('ion-backdrop')); const wrapperAnimation = new AnimationC(); wrapperAnimation.addElement(baseEl.querySelector('.alert-wrapper')); backdropAnimation.fromTo('opacity', 0.3, 0); wrapperAnimation.fromTo('opacity', 0.99, 0).fromTo('scale', 1, 0.9); const ani = baseAnimation .addElement(baseEl) .easing('ease-in-out') .duration(200) .add(backdropAnimation) .add(wrapperAnimation); return Promise.resolve(ani); }; /** * Md Alert Enter Animation */ const mdEnterAnimation = (AnimationC, baseEl) => { const baseAnimation = new AnimationC(); const backdropAnimation = new AnimationC(); backdropAnimation.addElement(baseEl.querySelector('ion-backdrop')); const wrapperAnimation = new AnimationC(); wrapperAnimation.addElement(baseEl.querySelector('.alert-wrapper')); backdropAnimation.fromTo('opacity', 0.01, 0.32); wrapperAnimation.fromTo('opacity', 0.01, 1).fromTo('scale', 0.9, 1); return Promise.resolve(baseAnimation .addElement(baseEl) .easing('ease-in-out') .duration(150) .add(backdropAnimation) .add(wrapperAnimation)); }; /** * Md Alert Leave Animation */ const mdLeaveAnimation = (AnimationC, baseEl) => { const baseAnimation = new AnimationC(); const backdropAnimation = new AnimationC(); backdropAnimation.addElement(baseEl.querySelector('ion-backdrop')); const wrapperAnimation = new AnimationC(); wrapperAnimation.addElement(baseEl.querySelector('.alert-wrapper')); backdropAnimation.fromTo('opacity', 0.32, 0); wrapperAnimation.fromTo('opacity', 0.99, 0); return Promise.resolve(baseAnimation .addElement(baseEl) .easing('ease-in-out') .duration(150) .add(backdropAnimation) .add(wrapperAnimation)); }; /** * @virtualProp {"ios" | "md"} mode - The mode determines which platform styles to use. */ class Alert { constructor(hostRef) { Object(_chunk_d0403a2f_js__WEBPACK_IMPORTED_MODULE_0__["r"])(this, hostRef); this.processedInputs = []; this.processedButtons = []; this.presented = false; this.mode = Object(_chunk_d0403a2f_js__WEBPACK_IMPORTED_MODULE_0__["d"])(this); /** * If `true`, the keyboard will be automatically dismissed when the overlay is presented. */ this.keyboardClose = true; /** * Array of buttons to be added to the alert. */ this.buttons = []; /** * Array of input to show in the alert. */ this.inputs = []; /** * If `true`, the alert will be dismissed when the backdrop is clicked. */ this.backdropDismiss = true; /** * If `true`, the alert will be translucent. * Only applies when the mode is `"ios"` and the device supports * [`backdrop-filter`](https://developer.mozilla.org/en-US/docs/Web/CSS/backdrop-filter#Browser_compatibility). */ this.translucent = false; /** * If `true`, the alert will animate. */ this.animated = true; this.onBackdropTap = () => { this.dismiss(undefined, _chunk_d83bfeae_js__WEBPACK_IMPORTED_MODULE_2__["B"]); }; this.dispatchCancelHandler = (ev) => { const role = ev.detail.role; if (Object(_chunk_d83bfeae_js__WEBPACK_IMPORTED_MODULE_2__["i"])(role)) { const cancelButton = this.processedButtons.find(b => b.role === 'cancel'); this.callButtonHandler(cancelButton); } }; this.didPresent = Object(_chunk_d0403a2f_js__WEBPACK_IMPORTED_MODULE_0__["c"])(this, "ionAlertDidPresent", 7); this.willPresent = Object(_chunk_d0403a2f_js__WEBPACK_IMPORTED_MODULE_0__["c"])(this, "ionAlertWillPresent", 7); this.willDismiss = Object(_chunk_d0403a2f_js__WEBPACK_IMPORTED_MODULE_0__["c"])(this, "ionAlertWillDismiss", 7); this.didDismiss = Object(_chunk_d0403a2f_js__WEBPACK_IMPORTED_MODULE_0__["c"])(this, "ionAlertDidDismiss", 7); } buttonsChanged() { const buttons = this.buttons; this.processedButtons = buttons.map(btn => { return (typeof btn === 'string') ? { text: btn, role: btn.toLowerCase() === 'cancel' ? 'cancel' : undefined } : btn; }); } inputsChanged() { const inputs = this.inputs; // An alert can be created with several different inputs. Radios, // checkboxes and inputs are all accepted, but they cannot be mixed. const inputTypes = new Set(inputs.map(i => i.type)); if (inputTypes.has('checkbox') && inputTypes.has('radio')) { console.warn(`Alert cannot mix input types: ${(Array.from(inputTypes.values()).join('/'))}. Please see alert docs for more info.`); } this.inputType = inputTypes.values().next().value; this.processedInputs = inputs.map((i, index) => ({ type: i.type || 'text', name: i.name || `${index}`, placeholder: i.placeholder || '', value: i.value, label: i.label, checked: !!i.checked, disabled: !!i.disabled, id: i.id || `alert-input-${this.overlayIndex}-${index}`, handler: i.handler, min: i.min, max: i.max })); } componentWillLoad() { this.inputsChanged(); this.buttonsChanged(); } /** * Present the alert overlay after it has been created. */ present() { return Object(_chunk_d83bfeae_js__WEBPACK_IMPORTED_MODULE_2__["d"])(this, 'alertEnter', iosEnterAnimation, mdEnterAnimation); } /** * Dismiss the alert overlay after it has been presented. * * @param data Any data to emit in the dismiss events. * @param role The role of the element that is dismissing the alert. * This can be useful in a button handler for determining which button was * clicked to dismiss the alert. * Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`. */ dismiss(data, role) { return Object(_chunk_d83bfeae_js__WEBPACK_IMPORTED_MODULE_2__["e"])(this, data, role, 'alertLeave', iosLeaveAnimation, mdLeaveAnimation); } /** * Returns a promise that resolves when the alert did dismiss. */ onDidDismiss() { return Object(_chunk_d83bfeae_js__WEBPACK_IMPORTED_MODULE_2__["f"])(this.el, 'ionAlertDidDismiss'); } /** * Returns a promise that resolves when the alert will dismiss. */ onWillDismiss() { return Object(_chunk_d83bfeae_js__WEBPACK_IMPORTED_MODULE_2__["f"])(this.el, 'ionAlertWillDismiss'); } rbClick(selectedInput) { for (const input of this.processedInputs) { input.checked = input === selectedInput; } this.activeId = selectedInput.id; Object(_chunk_d83bfeae_js__WEBPACK_IMPORTED_MODULE_2__["s"])(selectedInput.handler, selectedInput); this.el.forceUpdate(); } cbClick(selectedInput) { selectedInput.checked = !selectedInput.checked; Object(_chunk_d83bfeae_js__WEBPACK_IMPORTED_MODULE_2__["s"])(selectedInput.handler, selectedInput); this.el.forceUpdate(); } buttonClick(button) { const role = button.role; const values = this.getValues(); if (Object(_chunk_d83bfeae_js__WEBPACK_IMPORTED_MODULE_2__["i"])(role)) { return this.dismiss({ values }, role); } const returnData = this.callButtonHandler(button, values); if (returnData !== false) { return this.dismiss(Object.assign({ values }, returnData), button.role); } return Promise.resolve(false); } callButtonHandler(button, data) { if (button && button.handler) { // a handler has been provided, execute it // pass the handler the values from the inputs const returnData = Object(_chunk_d83bfeae_js__WEBPACK_IMPORTED_MODULE_2__["s"])(button.handler, data); if (returnData === false) { // if the return value of the handler is false then do not dismiss return false; } if (typeof returnData === 'object') { return returnData; } } return {}; } getValues() { if (this.processedInputs.length === 0) { // this is an alert without any options/inputs at all return undefined; } if (this.inputType === 'radio') { // this is an alert with radio buttons (single value select) // return the one value which is checked, otherwise undefined const checkedInput = this.processedInputs.find(i => !!i.checked); return checkedInput ? checkedInput.value : undefined; } if (this.inputType === 'checkbox') { // this is an alert with checkboxes (multiple value select) // return an array of all the checked values return this.processedInputs.filter(i => i.checked).map(i => i.value); } // this is an alert with text inputs // return an object of all the values with the input name as the key const values = {}; this.processedInputs.forEach(i => { values[i.name] = i.value || ''; }); return values; } renderAlertInputs(labelledBy) { switch (this.inputType) { case 'checkbox': return this.renderCheckbox(labelledBy); case 'radio': return this.renderRadio(labelledBy); default: return this.renderInput(labelledBy); } } renderCheckbox(labelledby) { const inputs = this.processedInputs; const mode = Object(_chunk_d0403a2f_js__WEBPACK_IMPORTED_MODULE_0__["d"])(this); if (inputs.length === 0) { return null; } return (Object(_chunk_d0403a2f_js__WEBPACK_IMPORTED_MODULE_0__["h"])("div", { class: "alert-checkbox-group", "aria-labelledby": labelledby }, inputs.map(i => (Object(_chunk_d0403a2f_js__WEBPACK_IMPORTED_MODULE_0__["h"])("button", { type: "button", onClick: () => this.cbClick(i), "aria-checked": `${i.checked}`, id: i.id, disabled: i.disabled, tabIndex: 0, role: "checkbox", class: "alert-tappable alert-checkbox alert-checkbox-button ion-focusable" }, Object(_chunk_d0403a2f_js__WEBPACK_IMPORTED_MODULE_0__["h"])("div", { class: "alert-button-inner" }, Object(_chunk_d0403a2f_js__WEBPACK_IMPORTED_MODULE_0__["h"])("div", { class: "alert-checkbox-icon" }, Object(_chunk_d0403a2f_js__WEBPACK_IMPORTED_MODULE_0__["h"])("div", { class: "alert-checkbox-inner" })), Object(_chunk_d0403a2f_js__WEBPACK_IMPORTED_MODULE_0__["h"])("div", { class: "alert-checkbox-label" }, i.label)), mode === 'md' && Object(_chunk_d0403a2f_js__WEBPACK_IMPORTED_MODULE_0__["h"])("ion-ripple-effect", null)))))); } renderRadio(labelledby) { const inputs = this.processedInputs; if (inputs.length === 0) { return null; } return (Object(_chunk_d0403a2f_js__WEBPACK_IMPORTED_MODULE_0__["h"])("div", { class: "alert-radio-group", role: "radiogroup", "aria-labelledby": labelledby, "aria-activedescendant": this.activeId }, inputs.map(i => (Object(_chunk_d0403a2f_js__WEBPACK_IMPORTED_MODULE_0__["h"])("button", { type: "button", onClick: () => this.rbClick(i), "aria-checked": `${i.checked}`, disabled: i.disabled, id: i.id, tabIndex: 0, class: "alert-radio-button alert-tappable alert-radio ion-focusable", role: "radio" }, Object(_chunk_d0403a2f_js__WEBPACK_IMPORTED_MODULE_0__["h"])("div", { class: "alert-button-inner" }, Object(_chunk_d0403a2f_js__WEBPACK_IMPORTED_MODULE_0__["h"])("div", { class: "alert-radio-icon" }, Object(_chunk_d0403a2f_js__WEBPACK_IMPORTED_MODULE_0__["h"])("div", { class: "alert-radio-inner" })), Object(_chunk_d0403a2f_js__WEBPACK_IMPORTED_MODULE_0__["h"])("div", { class: "alert-radio-label" }, i.label))))))); } renderInput(labelledby) { const inputs = this.processedInputs; if (inputs.length === 0) { return null; } return (Object(_chunk_d0403a2f_js__WEBPACK_IMPORTED_MODULE_0__["h"])("div", { class: "alert-input-group", "aria-labelledby": labelledby }, inputs.map(i => (Object(_chunk_d0403a2f_js__WEBPACK_IMPORTED_MODULE_0__["h"])("div", { class: "alert-input-wrapper" }, Object(_chunk_d0403a2f_js__WEBPACK_IMPORTED_MODULE_0__["h"])("input", { placeholder: i.placeholder, value: i.value, type: i.type, min: i.min, max: i.max, onInput: e => i.value = e.target.value, id: i.id, disabled: i.disabled, tabIndex: 0, class: "alert-input" })))))); } renderAlertButtons() { const buttons = this.processedButtons; const mode = Object(_chunk_d0403a2f_js__WEBPACK_IMPORTED_MODULE_0__["d"])(this); const alertButtonGroupClass = { 'alert-button-group': true, 'alert-button-group-vertical': buttons.length > 2 }; return (Object(_chunk_d0403a2f_js__WEBPACK_IMPORTED_MODULE_0__["h"])("div", { class: alertButtonGroupClass }, buttons.map(button => Object(_chunk_d0403a2f_js__WEBPACK_IMPORTED_MODULE_0__["h"])("button", { type: "button", class: buttonClass(button), tabIndex: 0, onClick: () => this.buttonClick(button) }, Object(_chunk_d0403a2f_js__WEBPACK_IMPORTED_MODULE_0__["h"])("span", { class: "alert-button-inner" }, button.text), mode === 'md' && Object(_chunk_d0403a2f_js__WEBPACK_IMPORTED_MODULE_0__["h"])("ion-ripple-effect", null))))); } render() { const { overlayIndex, header, subHeader } = this; const mode = Object(_chunk_d0403a2f_js__WEBPACK_IMPORTED_MODULE_0__["d"])(this); const hdrId = `alert-${overlayIndex}-hdr`; const subHdrId = `alert-${overlayIndex}-sub-hdr`; const msgId = `alert-${overlayIndex}-msg`; let labelledById; if (header !== undefined) { labelledById = hdrId; } else if (subHeader !== undefined) { labelledById = subHdrId; } return (Object(_chunk_d0403a2f_js__WEBPACK_IMPORTED_MODULE_0__["h"])(_chunk_d0403a2f_js__WEBPACK_IMPORTED_MODULE_0__["H"], { role: "dialog", "aria-modal": "true", style: { zIndex: `${20000 + overlayIndex}`, }, class: Object.assign({}, Object(_chunk_353a032e_js__WEBPACK_IMPORTED_MODULE_3__["g"])(this.cssClass), { [mode]: true, 'alert-translucent': this.translucent }), onIonAlertWillDismiss: this.dispatchCancelHandler, onIonBackdropTap: this.onBackdropTap }, Object(_chunk_d0403a2f_js__WEBPACK_IMPORTED_MODULE_0__["h"])("ion-backdrop", { tappable: this.backdropDismiss }), Object(_chunk_d0403a2f_js__WEBPACK_IMPORTED_MODULE_0__["h"])("div", { class: "alert-wrapper" }, Object(_chunk_d0403a2f_js__WEBPACK_IMPORTED_MODULE_0__["h"])("div", { class: "alert-head" }, header && Object(_chunk_d0403a2f_js__WEBPACK_IMPORTED_MODULE_0__["h"])("h2", { id: hdrId, class: "alert-title" }, header), subHeader && Object(_chunk_d0403a2f_js__WEBPACK_IMPORTED_MODULE_0__["h"])("h2", { id: subHdrId, class: "alert-sub-title" }, subHeader)), Object(_chunk_d0403a2f_js__WEBPACK_IMPORTED_MODULE_0__["h"])("div", { id: msgId, class: "alert-message", innerHTML: Object(_chunk_cae2ca23_js__WEBPACK_IMPORTED_MODULE_4__["s"])(this.message) }), this.renderAlertInputs(labelledById), this.renderAlertButtons()))); } get el() { return Object(_chunk_d0403a2f_js__WEBPACK_IMPORTED_MODULE_0__["e"])(this); } static get watchers() { return { "buttons": ["buttonsChanged"], "inputs": ["inputsChanged"] }; } static get style() { return ".sc-ion-alert-ios-h{--min-width:250px;--width:auto;--min-height:auto;--height:auto;--max-height:90%;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:fixed;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;font-family:var(--ion-font-family,inherit);contain:strict;-ms-touch-action:none;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:1000}.overlay-hidden.sc-ion-alert-ios-h{display:none}.alert-top.sc-ion-alert-ios-h{padding-top:50px;-ms-flex-align:start;align-items:flex-start}.alert-wrapper.sc-ion-alert-ios{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);background:var(--background);contain:content;opacity:0;z-index:10}.alert-title.sc-ion-alert-ios{margin-top:0}.alert-sub-title.sc-ion-alert-ios, .alert-title.sc-ion-alert-ios{margin-left:0;margin-right:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0}.alert-sub-title.sc-ion-alert-ios{margin-top:5px;font-weight:400}.alert-message.sc-ion-alert-ios{-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-overflow-scrolling:touch;overflow-y:auto;overscroll-behavior-y:contain}.alert-checkbox-group.sc-ion-alert-ios::-webkit-scrollbar, .alert-message.sc-ion-alert-ios::-webkit-scrollbar, .alert-radio-group.sc-ion-alert-ios::-webkit-scrollbar{display:none}.alert-input.sc-ion-alert-ios{padding-left:0;padding-right:0;padding-top:10px;padding-bottom:10px;width:100%;border:0;background:inherit;font:inherit;-webkit-box-sizing:border-box;box-sizing:border-box}.alert-button-group.sc-ion-alert-ios{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;width:100%}.alert-button-group-vertical.sc-ion-alert-ios{-ms-flex-direction:column;flex-direction:column;-ms-flex-wrap:nowrap;flex-wrap:nowrap}.alert-button.sc-ion-alert-ios{display:block;border:0;font-size:14px;line-height:20px;z-index:0}.alert-button.ion-focused.sc-ion-alert-ios, .alert-tappable.ion-focused.sc-ion-alert-ios{background:var(--ion-color-step-100,#e6e6e6)}.alert-button-inner.sc-ion-alert-ios{-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;height:100%}.alert-button-inner.sc-ion-alert-ios, .alert-tappable.sc-ion-alert-ios{display:-ms-flexbox;display:flex;width:100%}.alert-tappable.sc-ion-alert-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;border:0;background:transparent;font-size:inherit;line-height:normal;text-align:start;-webkit-appearance:none;-moz-appearance:none;appearance:none;contain:strict}.alert-button.sc-ion-alert-ios, .alert-checkbox.sc-ion-alert-ios, .alert-input.sc-ion-alert-ios, .alert-radio.sc-ion-alert-ios{outline:none}.alert-checkbox-icon.sc-ion-alert-ios, .alert-checkbox-inner.sc-ion-alert-ios, .alert-radio-icon.sc-ion-alert-ios{-webkit-box-sizing:border-box;box-sizing:border-box}.sc-ion-alert-ios-h{--background:var(--ion-overlay-background-color,var(--ion-color-step-100,#f9f9f9));--max-width:270px;font-size:14px}.alert-wrapper.sc-ion-alert-ios{border-radius:13px;-webkit-box-shadow:none;box-shadow:none;overflow:hidden}\@supports ((-webkit-backdrop-filter:blur(0)) or (backdrop-filter:blur(0))){.alert-translucent.sc-ion-alert-ios-h .alert-wrapper.sc-ion-alert-ios{background:rgba(var(--ion-background-color-rgb,255,255,255),.9);-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px)}}.alert-head.sc-ion-alert-ios{padding-left:16px;padding-right:16px;padding-top:12px;padding-bottom:7px;text-align:center}\@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){.alert-head.sc-ion-alert-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px}}.alert-title.sc-ion-alert-ios{margin-top:8px;color:var(--ion-text-color,#000);font-size:17px;font-weight:600}.alert-sub-title.sc-ion-alert-ios{color:var(--ion-color-step-600,#666);font-size:14px}.alert-input-group.sc-ion-alert-ios, .alert-message.sc-ion-alert-ios{padding-left:16px;padding-right:16px;padding-top:0;padding-bottom:21px;color:var(--ion-text-color,#000);font-size:13px;text-align:center}\@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){.alert-input-group.sc-ion-alert-ios, .alert-message.sc-ion-alert-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px}}.alert-message.sc-ion-alert-ios{max-height:240px}.alert-message.sc-ion-alert-ios:empty{padding-left:0;padding-right:0;padding-top:0;padding-bottom:12px}.alert-input.sc-ion-alert-ios{border-radius:4px;margin-top:10px;padding-left:6px;padding-right:6px;padding-top:6px;padding-bottom:6px;border:.55px solid var(--ion-color-step-250,#bfbfbf);background-color:var(--ion-background-color,#fff);-webkit-appearance:none;-moz-appearance:none;appearance:none}\@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){.alert-input.sc-ion-alert-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:6px;padding-inline-start:6px;-webkit-padding-end:6px;padding-inline-end:6px}}.alert-input.sc-ion-alert-ios::-webkit-input-placeholder{color:var(--ion-placeholder-color,var(--ion-color-step-400,#999));font-family:inherit;font-weight:inherit}.alert-input.sc-ion-alert-ios::-moz-placeholder{color:var(--ion-placeholder-color,var(--ion-color-step-400,#999));font-family:inherit;font-weight:inherit}.alert-input.sc-ion-alert-ios:-ms-input-placeholder{color:var(--ion-placeholder-color,var(--ion-color-step-400,#999));font-family:inherit;font-weight:inherit}.alert-input.sc-ion-alert-ios::-ms-input-placeholder{color:var(--ion-placeholder-color,var(--ion-color-step-400,#999));font-family:inherit;font-weight:inherit}.alert-input.sc-ion-alert-ios::placeholder{color:var(--ion-placeholder-color,var(--ion-color-step-400,#999));font-family:inherit;font-weight:inherit}.alert-input.sc-ion-alert-ios::-ms-clear{display:none}.alert-checkbox-group.sc-ion-alert-ios, .alert-radio-group.sc-ion-alert-ios{-ms-scroll-chaining:none;overscroll-behavior:contain;max-height:240px;border-top:.55px solid rgba(var(--ion-text-color-rgb,0,0,0),.2);overflow-y:auto;-webkit-overflow-scrolling:touch}.alert-tappable.sc-ion-alert-ios{height:44px}.alert-radio-label.sc-ion-alert-ios{padding-left:13px;padding-right:13px;padding-top:13px;padding-bottom:13px;-ms-flex:1;flex:1;-ms-flex-order:0;order:0;color:var(--ion-text-color,#000);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}\@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){.alert-radio-label.sc-ion-alert-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:13px;padding-inline-start:13px;-webkit-padding-end:13px;padding-inline-end:13px}}[aria-checked=true].sc-ion-alert-ios .alert-radio-label.sc-ion-alert-ios{color:var(--ion-color-primary,#3880ff)}.alert-radio-icon.sc-ion-alert-ios{position:relative;-ms-flex-order:1;order:1;min-width:30px}[aria-checked=true].sc-ion-alert-ios .alert-radio-inner.sc-ion-alert-ios{left:7px;top:-7px;position:absolute;width:6px;height:12px;-webkit-transform:rotate(45deg);transform:rotate(45deg);border-width:2px;border-top-width:0;border-left-width:0;border-style:solid;border-color:var(--ion-color-primary,#3880ff)}[dir=rtl].sc-ion-alert-ios-h [aria-checked=true].sc-ion-alert-ios .alert-radio-inner.sc-ion-alert-ios, [dir=rtl] .sc-ion-alert-ios-h [aria-checked=true].sc-ion-alert-ios .alert-radio-inner.sc-ion-alert-ios, [dir=rtl].sc-ion-alert-ios [aria-checked=true].sc-ion-alert-ios .alert-radio-inner.sc-ion-alert-ios{left:unset;right:unset;right:7px}.alert-checkbox-label.sc-ion-alert-ios{padding-left:13px;padding-right:13px;padding-top:13px;padding-bottom:13px;-ms-flex:1;flex:1;color:var(--ion-text-color,#000);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}\@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){.alert-checkbox-label.sc-ion-alert-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:13px;padding-inline-start:13px;-webkit-padding-end:13px;padding-inline-end:13px}}.alert-checkbox-icon.sc-ion-alert-ios{border-radius:50%;margin-left:16px;margin-right:6px;margin-top:10px;margin-bottom:10px;position:relative;width:24px;height:24px;border-width:1px;border-style:solid;border-color:var(--ion-item-border-color,var(--ion-border-color,var(--ion-color-step-250,#c8c7cc)));background-color:var(--ion-item-background,var(--ion-background-color,#fff));contain:strict}\@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){.alert-checkbox-icon.sc-ion-alert-ios{margin-left:unset;margin-right:unset;-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:6px;margin-inline-end:6px}}[aria-checked=true].sc-ion-alert-ios .alert-checkbox-icon.sc-ion-alert-ios{border-color:var(--ion-color-primary,#3880ff);background-color:var(--ion-color-primary,#3880ff)}[aria-checked=true].sc-ion-alert-ios .alert-checkbox-inner.sc-ion-alert-ios{left:9px;top:4px;position:absolute;width:5px;height:12px;-webkit-transform:rotate(45deg);transform:rotate(45deg);border-width:1px;border-top-width:0;border-left-width:0;border-style:solid;border-color:var(--ion-background-color,#fff)}[dir=rtl].sc-ion-alert-ios-h [aria-checked=true].sc-ion-alert-ios .alert-checkbox-inner.sc-ion-alert-ios, [dir=rtl] .sc-ion-alert-ios-h [aria-checked=true].sc-ion-alert-ios .alert-checkbox-inner.sc-ion-alert-ios, [dir=rtl].sc-ion-alert-ios [aria-checked=true].sc-ion-alert-ios .alert-checkbox-inner.sc-ion-alert-ios{left:unset;right:unset;right:9px}.alert-button-group.sc-ion-alert-ios{margin-right:-.55px;-ms-flex-wrap:wrap;flex-wrap:wrap}\@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){.alert-button-group.sc-ion-alert-ios{margin-right:unset;-webkit-margin-end:-.55px;margin-inline-end:-.55px}}.alert-button.sc-ion-alert-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;border-radius:0;-ms-flex:1 1 auto;flex:1 1 auto;min-width:50%;height:44px;border-top:.55px solid rgba(var(--ion-text-color-rgb,0,0,0),.2);border-right:.55px solid rgba(var(--ion-text-color-rgb,0,0,0),.2);background-color:transparent;color:var(--ion-color-primary,#3880ff);font-size:17px;overflow:hidden}[dir=rtl].sc-ion-alert-ios-h .alert-button.sc-ion-alert-ios:first-child, [dir=rtl] .sc-ion-alert-ios-h .alert-button.sc-ion-alert-ios:first-child, [dir=rtl].sc-ion-alert-ios .alert-button.sc-ion-alert-ios:first-child{border-right:0}.alert-button.sc-ion-alert-ios:last-child{border-right:0;font-weight:700}[dir=rtl].sc-ion-alert-ios-h .alert-button.sc-ion-alert-ios:last-child, [dir=rtl] .sc-ion-alert-ios-h .alert-button.sc-ion-alert-ios:last-child, [dir=rtl].sc-ion-alert-ios .alert-button.sc-ion-alert-ios:last-child{border-right:.55px solid rgba(var(--ion-text-color-rgb,0,0,0),.2)}.alert-button.activated.sc-ion-alert-ios{background-color:rgba(var(--ion-text-color-rgb,0,0,0),.1)}"; } } const buttonClass = (button) => { return Object.assign({ 'alert-button': true, 'ion-focusable': true, 'ion-activatable': true }, Object(_chunk_353a032e_js__WEBPACK_IMPORTED_MODULE_3__["g"])(button.cssClass)); }; /***/ }) }]); //# sourceMappingURL=4-es2015.js.map
import React from 'react' import * as Survey from '@core/survey/survey' import * as DateUtils from '@core/dateUtils' import { useI18n } from '@webapp/commonComponents/hooks' const SurveyListRow = props => { const { row: surveyRow, isRowActive } = props const surveyInfoRow = Survey.getSurveyInfo(surveyRow) const i18n = useI18n() return ( <> <span className={`icon icon-14px icon-action icon-radio-${isRowActive(surveyRow) ? 'checked2' : 'unchecked'}`} /> <div>{Survey.getName(surveyInfoRow)}</div> <div>{Survey.getDefaultLabel(surveyInfoRow)}</div> <div>{DateUtils.getRelativeDate(i18n, Survey.getDateCreated(surveyInfoRow))}</div> <div>{DateUtils.getRelativeDate(i18n, Survey.getDateModified(surveyInfoRow))}</div> <div>{Survey.getStatus(surveyInfoRow)}</div> </> ) } export default SurveyListRow
import React from 'react'; import { useRouter } from 'next/router'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faSearch } from '@fortawesome/free-solid-svg-icons'; import HeaderSearchModal from './HeaderSearchStyle'; import InputSearch from './searchBox'; function HeaderSearch() { const router = useRouter(); const [modalVisibility, setModalVisibility] = React.useState(false); const handleKeyPress = (e) => { if (e.key === 'Enter') { setModalVisibility(false); const url = `/search/${e.target.value}`; router.push(url); } }; return ( <div className="header__search--container"> <FontAwesomeIcon className="search__icon" icon={faSearch} onClick={() => setModalVisibility(true)} /> <HeaderSearchModal style={{ top: 0 }} visible={modalVisibility} onOk={() => setModalVisibility(false)} onCancel={() => setModalVisibility(false)} footer={null} className="header__search--modal" width="100%" closable={false} destroyOnClose={true} > <FontAwesomeIcon className="search__icon" icon={faSearch} /> <InputSearch handleKeyPress={handleKeyPress} /> <button className="ant-modal-close" onClick={() => setModalVisibility(false)}> <span className="ant-modal-close-x"></span> </button> </HeaderSearchModal> </div> ); } export default HeaderSearch;
String.prototype.capitalize = function() { return this.charAt(0).toUpperCase() + this.slice(1) }